$&&(N=$)}if(g){var O,U;const L=T==="y"?"width":"height",Q=Kv.has(Pn(u)),$=f.reference[h]-f.floating[L]+(Q&&((O=m.offset)==null?void 0:O[h])||0)+(Q?0:R.crossAxis),F=f.reference[h]+f.reference[L]+(Q?0:((U=m.offset)==null?void 0:U[h])||0)-(Q?R.crossAxis:0);D<$?D=$:D>F&&(D=F)}return{[T]:N,[h]:D}}}},ME=function(l){return l===void 0&&(l={}),{name:"size",options:l,async fn(i){var s,r;const{placement:u,rects:f,platform:m,elements:p}=i,{apply:v=()=>{},...g}=Wn(l,i),S=await hi(i,g),h=Pn(u),T=mo(u),N=Cn(u)==="y",{width:D,height:E}=f.floating;let R,O;h==="top"||h==="bottom"?(R=h,O=T===(await(m.isRTL==null?void 0:m.isRTL(p.floating))?"start":"end")?"left":"right"):(O=h,R=T==="end"?"top":"bottom");const U=E-S.top-S.bottom,L=D-S.left-S.right,Q=Ma(E-S[R],U),$=Ma(D-S[O],L),F=!i.middlewareData.shift;let X=Q,K=$;if((s=i.middlewareData.shift)!=null&&s.enabled.x&&(K=L),(r=i.middlewareData.shift)!=null&&r.enabled.y&&(X=U),F&&!T){const ve=Xt(S.left,0),ye=Xt(S.right,0),fe=Xt(S.top,0),de=Xt(S.bottom,0);N?K=D-2*(ve!==0||ye!==0?ve+ye:Xt(S.left,S.right)):X=E-2*(fe!==0||de!==0?fe+de:Xt(S.top,S.bottom))}await v({...i,availableWidth:K,availableHeight:X});const se=await m.getDimensions(p.floating);return D!==se.width||E!==se.height?{reset:{rects:!0}}:{}}}};function rs(){return typeof window<"u"}function po(l){return Qv(l)?(l.nodeName||"").toLowerCase():"#document"}function Kt(l){var i;return(l==null||(i=l.ownerDocument)==null?void 0:i.defaultView)||window}function Rn(l){var i;return(i=(Qv(l)?l.ownerDocument:l.document)||window.document)==null?void 0:i.documentElement}function Qv(l){return rs()?l instanceof Node||l instanceof Kt(l).Node:!1}function dn(l){return rs()?l instanceof Element||l instanceof Kt(l).Element:!1}function Nn(l){return rs()?l instanceof HTMLElement||l instanceof Kt(l).HTMLElement:!1}function xg(l){return!rs()||typeof ShadowRoot>"u"?!1:l instanceof ShadowRoot||l instanceof Kt(l).ShadowRoot}const DE=new Set(["inline","contents"]);function bi(l){const{overflow:i,overflowX:s,overflowY:r,display:u}=mn(l);return/auto|scroll|overlay|hidden|clip/.test(i+r+s)&&!DE.has(u)}const zE=new Set(["table","td","th"]);function jE(l){return zE.has(po(l))}const UE=[":popover-open",":modal"];function ss(l){return UE.some(i=>{try{return l.matches(i)}catch{return!1}})}const HE=["transform","translate","scale","rotate","perspective"],BE=["transform","translate","scale","rotate","perspective","filter"],LE=["paint","layout","strict","content"];function Mf(l){const i=Df(),s=dn(l)?mn(l):l;return HE.some(r=>s[r]?s[r]!=="none":!1)||(s.containerType?s.containerType!=="normal":!1)||!i&&(s.backdropFilter?s.backdropFilter!=="none":!1)||!i&&(s.filter?s.filter!=="none":!1)||BE.some(r=>(s.willChange||"").includes(r))||LE.some(r=>(s.contain||"").includes(r))}function kE(l){let i=Da(l);for(;Nn(i)&&!ro(i);){if(Mf(i))return i;if(ss(i))return null;i=Da(i)}return null}function Df(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const VE=new Set(["html","body","#document"]);function ro(l){return VE.has(po(l))}function mn(l){return Kt(l).getComputedStyle(l)}function cs(l){return dn(l)?{scrollLeft:l.scrollLeft,scrollTop:l.scrollTop}:{scrollLeft:l.scrollX,scrollTop:l.scrollY}}function Da(l){if(po(l)==="html")return l;const i=l.assignedSlot||l.parentNode||xg(l)&&l.host||Rn(l);return xg(i)?i.host:i}function Zv(l){const i=Da(l);return ro(i)?l.ownerDocument?l.ownerDocument.body:l.body:Nn(i)&&bi(i)?i:Zv(i)}function gi(l,i,s){var r;i===void 0&&(i=[]),s===void 0&&(s=!0);const u=Zv(l),f=u===((r=l.ownerDocument)==null?void 0:r.body),m=Kt(u);if(f){const p=tf(m);return i.concat(m,m.visualViewport||[],bi(u)?u:[],p&&s?gi(p):[])}return i.concat(u,gi(u,[],s))}function tf(l){return l.parent&&Object.getPrototypeOf(l.parent)?l.frameElement:null}function Jv(l){const i=mn(l);let s=parseFloat(i.width)||0,r=parseFloat(i.height)||0;const u=Nn(l),f=u?l.offsetWidth:s,m=u?l.offsetHeight:r,p=Ir(s)!==f||Ir(r)!==m;return p&&(s=f,r=m),{width:s,height:r,$:p}}function zf(l){return dn(l)?l:l.contextElement}function io(l){const i=zf(l);if(!Nn(i))return _n(1);const s=i.getBoundingClientRect(),{width:r,height:u,$:f}=Jv(i);let m=(f?Ir(s.width):s.width)/r,p=(f?Ir(s.height):s.height)/u;return(!m||!Number.isFinite(m))&&(m=1),(!p||!Number.isFinite(p))&&(p=1),{x:m,y:p}}const YE=_n(0);function $v(l){const i=Kt(l);return!Df()||!i.visualViewport?YE:{x:i.visualViewport.offsetLeft,y:i.visualViewport.offsetTop}}function GE(l,i,s){return i===void 0&&(i=!1),!s||i&&s!==Kt(l)?!1:i}function cl(l,i,s,r){i===void 0&&(i=!1),s===void 0&&(s=!1);const u=l.getBoundingClientRect(),f=zf(l);let m=_n(1);i&&(r?dn(r)&&(m=io(r)):m=io(l));const p=GE(f,s,r)?$v(f):_n(0);let v=(u.left+p.x)/m.x,g=(u.top+p.y)/m.y,S=u.width/m.x,h=u.height/m.y;if(f){const T=Kt(f),N=r&&dn(r)?Kt(r):r;let D=T,E=tf(D);for(;E&&r&&N!==D;){const R=io(E),O=E.getBoundingClientRect(),U=mn(E),L=O.left+(E.clientLeft+parseFloat(U.paddingLeft))*R.x,Q=O.top+(E.clientTop+parseFloat(U.paddingTop))*R.y;v*=R.x,g*=R.y,S*=R.x,h*=R.y,v+=L,g+=Q,D=Kt(E),E=tf(D)}}return Wr({width:S,height:h,x:v,y:g})}function us(l,i){const s=cs(l).scrollLeft;return i?i.left+s:cl(Rn(l)).left+s}function Iv(l,i){const s=l.getBoundingClientRect(),r=s.left+i.scrollLeft-us(l,s),u=s.top+i.scrollTop;return{x:r,y:u}}function qE(l){let{elements:i,rect:s,offsetParent:r,strategy:u}=l;const f=u==="fixed",m=Rn(r),p=i?ss(i.floating):!1;if(r===m||p&&f)return s;let v={scrollLeft:0,scrollTop:0},g=_n(1);const S=_n(0),h=Nn(r);if((h||!h&&!f)&&((po(r)!=="body"||bi(m))&&(v=cs(r)),Nn(r))){const N=cl(r);g=io(r),S.x=N.x+r.clientLeft,S.y=N.y+r.clientTop}const T=m&&!h&&!f?Iv(m,v):_n(0);return{width:s.width*g.x,height:s.height*g.y,x:s.x*g.x-v.scrollLeft*g.x+S.x+T.x,y:s.y*g.y-v.scrollTop*g.y+S.y+T.y}}function XE(l){return Array.from(l.getClientRects())}function KE(l){const i=Rn(l),s=cs(l),r=l.ownerDocument.body,u=Xt(i.scrollWidth,i.clientWidth,r.scrollWidth,r.clientWidth),f=Xt(i.scrollHeight,i.clientHeight,r.scrollHeight,r.clientHeight);let m=-s.scrollLeft+us(l);const p=-s.scrollTop;return mn(r).direction==="rtl"&&(m+=Xt(i.clientWidth,r.clientWidth)-u),{width:u,height:f,x:m,y:p}}const Sg=25;function QE(l,i){const s=Kt(l),r=Rn(l),u=s.visualViewport;let f=r.clientWidth,m=r.clientHeight,p=0,v=0;if(u){f=u.width,m=u.height;const S=Df();(!S||S&&i==="fixed")&&(p=u.offsetLeft,v=u.offsetTop)}const g=us(r);if(g<=0){const S=r.ownerDocument,h=S.body,T=getComputedStyle(h),N=S.compatMode==="CSS1Compat"&&parseFloat(T.marginLeft)+parseFloat(T.marginRight)||0,D=Math.abs(r.clientWidth-h.clientWidth-N);D<=Sg&&(f-=D)}else g<=Sg&&(f+=g);return{width:f,height:m,x:p,y:v}}const ZE=new Set(["absolute","fixed"]);function JE(l,i){const s=cl(l,!0,i==="fixed"),r=s.top+l.clientTop,u=s.left+l.clientLeft,f=Nn(l)?io(l):_n(1),m=l.clientWidth*f.x,p=l.clientHeight*f.y,v=u*f.x,g=r*f.y;return{width:m,height:p,x:v,y:g}}function Eg(l,i,s){let r;if(i==="viewport")r=QE(l,s);else if(i==="document")r=KE(Rn(l));else if(dn(i))r=JE(i,s);else{const u=$v(l);r={x:i.x-u.x,y:i.y-u.y,width:i.width,height:i.height}}return Wr(r)}function Fv(l,i){const s=Da(l);return s===i||!dn(s)||ro(s)?!1:mn(s).position==="fixed"||Fv(s,i)}function $E(l,i){const s=i.get(l);if(s)return s;let r=gi(l,[],!1).filter(p=>dn(p)&&po(p)!=="body"),u=null;const f=mn(l).position==="fixed";let m=f?Da(l):l;for(;dn(m)&&!ro(m);){const p=mn(m),v=Mf(m);!v&&p.position==="fixed"&&(u=null),(f?!v&&!u:!v&&p.position==="static"&&!!u&&ZE.has(u.position)||bi(m)&&!v&&Fv(l,m))?r=r.filter(S=>S!==m):u=p,m=Da(m)}return i.set(l,r),r}function IE(l){let{element:i,boundary:s,rootBoundary:r,strategy:u}=l;const m=[...s==="clippingAncestors"?ss(i)?[]:$E(i,this._c):[].concat(s),r],p=m[0],v=m.reduce((g,S)=>{const h=Eg(i,S,u);return g.top=Xt(h.top,g.top),g.right=Ma(h.right,g.right),g.bottom=Ma(h.bottom,g.bottom),g.left=Xt(h.left,g.left),g},Eg(i,p,u));return{width:v.right-v.left,height:v.bottom-v.top,x:v.left,y:v.top}}function FE(l){const{width:i,height:s}=Jv(l);return{width:i,height:s}}function WE(l,i,s){const r=Nn(i),u=Rn(i),f=s==="fixed",m=cl(l,!0,f,i);let p={scrollLeft:0,scrollTop:0};const v=_n(0);function g(){v.x=us(u)}if(r||!r&&!f)if((po(i)!=="body"||bi(u))&&(p=cs(i)),r){const N=cl(i,!0,f,i);v.x=N.x+i.clientLeft,v.y=N.y+i.clientTop}else u&&g();f&&!r&&u&&g();const S=u&&!r&&!f?Iv(u,p):_n(0),h=m.left+p.scrollLeft-v.x-S.x,T=m.top+p.scrollTop-v.y-S.y;return{x:h,y:T,width:m.width,height:m.height}}function Ku(l){return mn(l).position==="static"}function wg(l,i){if(!Nn(l)||mn(l).position==="fixed")return null;if(i)return i(l);let s=l.offsetParent;return Rn(l)===s&&(s=s.ownerDocument.body),s}function Wv(l,i){const s=Kt(l);if(ss(l))return s;if(!Nn(l)){let u=Da(l);for(;u&&!ro(u);){if(dn(u)&&!Ku(u))return u;u=Da(u)}return s}let r=wg(l,i);for(;r&&jE(r)&&Ku(r);)r=wg(r,i);return r&&ro(r)&&Ku(r)&&!Mf(r)?s:r||kE(l)||s}const PE=async function(l){const i=this.getOffsetParent||Wv,s=this.getDimensions,r=await s(l.floating);return{reference:WE(l.reference,await i(l.floating),l.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ew(l){return mn(l).direction==="rtl"}const tw={convertOffsetParentRelativeRectToViewportRelativeRect:qE,getDocumentElement:Rn,getClippingRect:IE,getOffsetParent:Wv,getElementRects:PE,getClientRects:XE,getDimensions:FE,getScale:io,isElement:dn,isRTL:ew};function Pv(l,i){return l.x===i.x&&l.y===i.y&&l.width===i.width&&l.height===i.height}function nw(l,i){let s=null,r;const u=Rn(l);function f(){var p;clearTimeout(r),(p=s)==null||p.disconnect(),s=null}function m(p,v){p===void 0&&(p=!1),v===void 0&&(v=1),f();const g=l.getBoundingClientRect(),{left:S,top:h,width:T,height:N}=g;if(p||i(),!T||!N)return;const D=Yr(h),E=Yr(u.clientWidth-(S+T)),R=Yr(u.clientHeight-(h+N)),O=Yr(S),L={rootMargin:-D+"px "+-E+"px "+-R+"px "+-O+"px",threshold:Xt(0,Ma(1,v))||1};let Q=!0;function $(F){const X=F[0].intersectionRatio;if(X!==v){if(!Q)return m();X?m(!1,X):r=setTimeout(()=>{m(!1,1e-7)},1e3)}X===1&&!Pv(g,l.getBoundingClientRect())&&m(),Q=!1}try{s=new IntersectionObserver($,{...L,root:u.ownerDocument})}catch{s=new IntersectionObserver($,L)}s.observe(l)}return m(!0),f}function aw(l,i,s,r){r===void 0&&(r={});const{ancestorScroll:u=!0,ancestorResize:f=!0,elementResize:m=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:v=!1}=r,g=zf(l),S=u||f?[...g?gi(g):[],...gi(i)]:[];S.forEach(O=>{u&&O.addEventListener("scroll",s,{passive:!0}),f&&O.addEventListener("resize",s)});const h=g&&p?nw(g,s):null;let T=-1,N=null;m&&(N=new ResizeObserver(O=>{let[U]=O;U&&U.target===g&&N&&(N.unobserve(i),cancelAnimationFrame(T),T=requestAnimationFrame(()=>{var L;(L=N)==null||L.observe(i)})),s()}),g&&!v&&N.observe(g),N.observe(i));let D,E=v?cl(l):null;v&&R();function R(){const O=cl(l);E&&!Pv(E,O)&&s(),E=O,D=requestAnimationFrame(R)}return s(),()=>{var O;S.forEach(U=>{u&&U.removeEventListener("scroll",s),f&&U.removeEventListener("resize",s)}),h?.(),(O=N)==null||O.disconnect(),N=null,v&&cancelAnimationFrame(D)}}const lw=NE,ow=RE,iw=CE,rw=ME,sw=AE,Tg=TE,cw=OE,uw=(l,i,s)=>{const r=new Map,u={platform:tw,...s},f={...u.platform,_c:r};return wE(l,i,{...u,platform:f})};var fw=typeof document<"u",dw=function(){},Kr=fw?b.useLayoutEffect:dw;function Pr(l,i){if(l===i)return!0;if(typeof l!=typeof i)return!1;if(typeof l=="function"&&l.toString()===i.toString())return!0;let s,r,u;if(l&&i&&typeof l=="object"){if(Array.isArray(l)){if(s=l.length,s!==i.length)return!1;for(r=s;r--!==0;)if(!Pr(l[r],i[r]))return!1;return!0}if(u=Object.keys(l),s=u.length,s!==Object.keys(i).length)return!1;for(r=s;r--!==0;)if(!{}.hasOwnProperty.call(i,u[r]))return!1;for(r=s;r--!==0;){const f=u[r];if(!(f==="_owner"&&l.$$typeof)&&!Pr(l[f],i[f]))return!1}return!0}return l!==l&&i!==i}function ey(l){return typeof window>"u"?1:(l.ownerDocument.defaultView||window).devicePixelRatio||1}function Cg(l,i){const s=ey(l);return Math.round(i*s)/s}function Qu(l){const i=b.useRef(l);return Kr(()=>{i.current=l}),i}function mw(l){l===void 0&&(l={});const{placement:i="bottom",strategy:s="absolute",middleware:r=[],platform:u,elements:{reference:f,floating:m}={},transform:p=!0,whileElementsMounted:v,open:g}=l,[S,h]=b.useState({x:0,y:0,strategy:s,placement:i,middlewareData:{},isPositioned:!1}),[T,N]=b.useState(r);Pr(T,r)||N(r);const[D,E]=b.useState(null),[R,O]=b.useState(null),U=b.useCallback(B=>{B!==F.current&&(F.current=B,E(B))},[]),L=b.useCallback(B=>{B!==X.current&&(X.current=B,O(B))},[]),Q=f||D,$=m||R,F=b.useRef(null),X=b.useRef(null),K=b.useRef(S),se=v!=null,ve=Qu(v),ye=Qu(u),fe=Qu(g),de=b.useCallback(()=>{if(!F.current||!X.current)return;const B={placement:i,strategy:s,middleware:T};ye.current&&(B.platform=ye.current),uw(F.current,X.current,B).then(ne=>{const ce={...ne,isPositioned:fe.current!==!1};me.current&&!Pr(K.current,ce)&&(K.current=ce,vi.flushSync(()=>{h(ce)}))})},[T,i,s,ye,fe]);Kr(()=>{g===!1&&K.current.isPositioned&&(K.current.isPositioned=!1,h(B=>({...B,isPositioned:!1})))},[g]);const me=b.useRef(!1);Kr(()=>(me.current=!0,()=>{me.current=!1}),[]),Kr(()=>{if(Q&&(F.current=Q),$&&(X.current=$),Q&&$){if(ve.current)return ve.current(Q,$,de);de()}},[Q,$,de,ve,se]);const he=b.useMemo(()=>({reference:F,floating:X,setReference:U,setFloating:L}),[U,L]),A=b.useMemo(()=>({reference:Q,floating:$}),[Q,$]),V=b.useMemo(()=>{const B={position:s,left:0,top:0};if(!A.floating)return B;const ne=Cg(A.floating,S.x),ce=Cg(A.floating,S.y);return p?{...B,transform:"translate("+ne+"px, "+ce+"px)",...ey(A.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:ne,top:ce}},[s,p,A.floating,S.x,S.y]);return b.useMemo(()=>({...S,update:de,refs:he,elements:A,floatingStyles:V}),[S,de,he,A,V])}const pw=l=>{function i(s){return{}.hasOwnProperty.call(s,"current")}return{name:"arrow",options:l,fn(s){const{element:r,padding:u}=typeof l=="function"?l(s):l;return r&&i(r)?r.current!=null?Tg({element:r.current,padding:u}).fn(s):{}:r?Tg({element:r,padding:u}).fn(s):{}}}},hw=(l,i)=>({...lw(l),options:[l,i]}),gw=(l,i)=>({...ow(l),options:[l,i]}),vw=(l,i)=>({...cw(l),options:[l,i]}),yw=(l,i)=>({...iw(l),options:[l,i]}),bw=(l,i)=>({...rw(l),options:[l,i]}),xw=(l,i)=>({...sw(l),options:[l,i]}),Sw=(l,i)=>({...pw(l),options:[l,i]});var Ew="Arrow",ty=b.forwardRef((l,i)=>{const{children:s,width:r=10,height:u=5,...f}=l;return y.jsx(Ne.svg,{...f,ref:i,width:r,height:u,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:l.asChild?s:y.jsx("polygon",{points:"0,0 30,0 15,10"})})});ty.displayName=Ew;var ww=ty;function Tw(l){const[i,s]=b.useState(void 0);return gt(()=>{if(l){s({width:l.offsetWidth,height:l.offsetHeight});const r=new ResizeObserver(u=>{if(!Array.isArray(u)||!u.length)return;const f=u[0];let m,p;if("borderBoxSize"in f){const v=f.borderBoxSize,g=Array.isArray(v)?v[0]:v;m=g.inlineSize,p=g.blockSize}else m=l.offsetWidth,p=l.offsetHeight;s({width:m,height:p})});return r.observe(l,{box:"border-box"}),()=>r.unobserve(l)}else s(void 0)},[l]),i}var jf="Popper",[ny,ay]=za(jf),[Cw,ly]=ny(jf),oy=l=>{const{__scopePopper:i,children:s}=l,[r,u]=b.useState(null);return y.jsx(Cw,{scope:i,anchor:r,onAnchorChange:u,children:s})};oy.displayName=jf;var iy="PopperAnchor",ry=b.forwardRef((l,i)=>{const{__scopePopper:s,virtualRef:r,...u}=l,f=ly(iy,s),m=b.useRef(null),p=Je(i,m),v=b.useRef(null);return b.useEffect(()=>{const g=v.current;v.current=r?.current||m.current,g!==v.current&&f.onAnchorChange(v.current)}),r?null:y.jsx(Ne.div,{...u,ref:p})});ry.displayName=iy;var Uf="PopperContent",[Aw,_w]=ny(Uf),sy=b.forwardRef((l,i)=>{const{__scopePopper:s,side:r="bottom",sideOffset:u=0,align:f="center",alignOffset:m=0,arrowPadding:p=0,avoidCollisions:v=!0,collisionBoundary:g=[],collisionPadding:S=0,sticky:h="partial",hideWhenDetached:T=!1,updatePositionStrategy:N="optimized",onPlaced:D,...E}=l,R=ly(Uf,s),[O,U]=b.useState(null),L=Je(i,W=>U(W)),[Q,$]=b.useState(null),F=Tw(Q),X=F?.width??0,K=F?.height??0,se=r+(f!=="center"?"-"+f:""),ve=typeof S=="number"?S:{top:0,right:0,bottom:0,left:0,...S},ye=Array.isArray(g)?g:[g],fe=ye.length>0,de={padding:ve,boundary:ye.filter(Rw),altBoundary:fe},{refs:me,floatingStyles:he,placement:A,isPositioned:V,middlewareData:B}=mw({strategy:"fixed",placement:se,whileElementsMounted:(...W)=>aw(...W,{animationFrame:N==="always"}),elements:{reference:R.anchor},middleware:[hw({mainAxis:u+K,alignmentAxis:m}),v&&gw({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?vw():void 0,...de}),v&&yw({...de}),bw({...de,apply:({elements:W,rects:te,availableWidth:ge,availableHeight:Ee})=>{const{width:Ce,height:Re}=te.reference,ut=W.floating.style;ut.setProperty("--radix-popper-available-width",`${ge}px`),ut.setProperty("--radix-popper-available-height",`${Ee}px`),ut.setProperty("--radix-popper-anchor-width",`${Ce}px`),ut.setProperty("--radix-popper-anchor-height",`${Re}px`)}}),Q&&Sw({element:Q,padding:p}),Ow({arrowWidth:X,arrowHeight:K}),T&&xw({strategy:"referenceHidden",...de})]}),[ne,ce]=fy(A),C=Ra(D);gt(()=>{V&&C?.()},[V,C]);const G=B.arrow?.x,Y=B.arrow?.y,I=B.arrow?.centerOffset!==0,[ee,ie]=b.useState();return gt(()=>{O&&ie(window.getComputedStyle(O).zIndex)},[O]),y.jsx("div",{ref:me.setFloating,"data-radix-popper-content-wrapper":"",style:{...he,transform:V?he.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ee,"--radix-popper-transform-origin":[B.transformOrigin?.x,B.transformOrigin?.y].join(" "),...B.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:l.dir,children:y.jsx(Aw,{scope:s,placedSide:ne,onArrowChange:$,arrowX:G,arrowY:Y,shouldHideArrow:I,children:y.jsx(Ne.div,{"data-side":ne,"data-align":ce,...E,ref:L,style:{...E.style,animation:V?void 0:"none"}})})})});sy.displayName=Uf;var cy="PopperArrow",Nw={top:"bottom",right:"left",bottom:"top",left:"right"},uy=b.forwardRef(function(i,s){const{__scopePopper:r,...u}=i,f=_w(cy,r),m=Nw[f.placedSide];return y.jsx("span",{ref:f.onArrowChange,style:{position:"absolute",left:f.arrowX,top:f.arrowY,[m]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[f.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[f.placedSide],visibility:f.shouldHideArrow?"hidden":void 0},children:y.jsx(ww,{...u,ref:s,style:{...u.style,display:"block"}})})});uy.displayName=cy;function Rw(l){return l!==null}var Ow=l=>({name:"transformOrigin",options:l,fn(i){const{placement:s,rects:r,middlewareData:u}=i,m=u.arrow?.centerOffset!==0,p=m?0:l.arrowWidth,v=m?0:l.arrowHeight,[g,S]=fy(s),h={start:"0%",center:"50%",end:"100%"}[S],T=(u.arrow?.x??0)+p/2,N=(u.arrow?.y??0)+v/2;let D="",E="";return g==="bottom"?(D=m?h:`${T}px`,E=`${-v}px`):g==="top"?(D=m?h:`${T}px`,E=`${r.floating.height+v}px`):g==="right"?(D=`${-v}px`,E=m?h:`${N}px`):g==="left"&&(D=`${r.floating.width+v}px`,E=m?h:`${N}px`),{data:{x:D,y:E}}}});function fy(l){const[i,s="center"]=l.split("-");return[i,s]}var Mw=oy,Dw=ry,zw=sy,jw=uy;function Uw(l){const i=Hw(l),s=b.forwardRef((r,u)=>{const{children:f,...m}=r,p=b.Children.toArray(f),v=p.find(Lw);if(v){const g=v.props.children,S=p.map(h=>h===v?b.Children.count(g)>1?b.Children.only(null):b.isValidElement(g)?g.props.children:null:h);return y.jsx(i,{...m,ref:u,children:b.isValidElement(g)?b.cloneElement(g,void 0,S):null})}return y.jsx(i,{...m,ref:u,children:f})});return s.displayName=`${l}.Slot`,s}function Hw(l){const i=b.forwardRef((s,r)=>{const{children:u,...f}=s;if(b.isValidElement(u)){const m=Vw(u),p=kw(f,u.props);return u.type!==b.Fragment&&(p.ref=r?so(r,m):m),b.cloneElement(u,p)}return b.Children.count(u)>1?b.Children.only(null):null});return i.displayName=`${l}.SlotClone`,i}var Bw=Symbol("radix.slottable");function Lw(l){return b.isValidElement(l)&&typeof l.type=="function"&&"__radixId"in l.type&&l.type.__radixId===Bw}function kw(l,i){const s={...i};for(const r in i){const u=l[r],f=i[r];/^on[A-Z]/.test(r)?u&&f?s[r]=(...p)=>{const v=f(...p);return u(...p),v}:u&&(s[r]=u):r==="style"?s[r]={...u,...f}:r==="className"&&(s[r]=[u,f].filter(Boolean).join(" "))}return{...l,...s}}function Vw(l){let i=Object.getOwnPropertyDescriptor(l.props,"ref")?.get,s=i&&"isReactWarning"in i&&i.isReactWarning;return s?l.ref:(i=Object.getOwnPropertyDescriptor(l,"ref")?.get,s=i&&"isReactWarning"in i&&i.isReactWarning,s?l.props.ref:l.props.ref||l.ref)}function Yw(l){const i=b.useRef({value:l,previous:l});return b.useMemo(()=>(i.current.value!==l&&(i.current.previous=i.current.value,i.current.value=l),i.current.previous),[l])}var dy=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Gw="VisuallyHidden",qw=b.forwardRef((l,i)=>y.jsx(Ne.span,{...l,ref:i,style:{...dy,...l.style}}));qw.displayName=Gw;var Xw=[" ","Enter","ArrowUp","ArrowDown"],Kw=[" ","Enter"],ul="Select",[fs,ds,Qw]=vf(ul),[ho]=za(ul,[Qw,ay]),ms=ay(),[Zw,ja]=ho(ul),[Jw,$w]=ho(ul),my=l=>{const{__scopeSelect:i,children:s,open:r,defaultOpen:u,onOpenChange:f,value:m,defaultValue:p,onValueChange:v,dir:g,name:S,autoComplete:h,disabled:T,required:N,form:D}=l,E=ms(i),[R,O]=b.useState(null),[U,L]=b.useState(null),[Q,$]=b.useState(!1),F=ns(g),[X,K]=Oa({prop:r,defaultProp:u??!1,onChange:f,caller:ul}),[se,ve]=Oa({prop:m,defaultProp:p,onChange:v,caller:ul}),ye=b.useRef(null),fe=R?D||!!R.closest("form"):!0,[de,me]=b.useState(new Set),he=Array.from(de).map(A=>A.props.value).join(";");return y.jsx(Mw,{...E,children:y.jsxs(Zw,{required:N,scope:i,trigger:R,onTriggerChange:O,valueNode:U,onValueNodeChange:L,valueNodeHasChildren:Q,onValueNodeHasChildrenChange:$,contentId:An(),value:se,onValueChange:ve,open:X,onOpenChange:K,dir:F,triggerPointerDownPosRef:ye,disabled:T,children:[y.jsx(fs.Provider,{scope:i,children:y.jsx(Jw,{scope:l.__scopeSelect,onNativeOptionAdd:b.useCallback(A=>{me(V=>new Set(V).add(A))},[]),onNativeOptionRemove:b.useCallback(A=>{me(V=>{const B=new Set(V);return B.delete(A),B})},[]),children:s})}),fe?y.jsxs(Uy,{"aria-hidden":!0,required:N,tabIndex:-1,name:S,autoComplete:h,value:se,onChange:A=>ve(A.target.value),disabled:T,form:D,children:[se===void 0?y.jsx("option",{value:""}):null,Array.from(de)]},he):null]})})};my.displayName=ul;var py="SelectTrigger",hy=b.forwardRef((l,i)=>{const{__scopeSelect:s,disabled:r=!1,...u}=l,f=ms(s),m=ja(py,s),p=m.disabled||r,v=Je(i,m.onTriggerChange),g=ds(s),S=b.useRef("touch"),[h,T,N]=By(E=>{const R=g().filter(L=>!L.disabled),O=R.find(L=>L.value===m.value),U=Ly(R,E,O);U!==void 0&&m.onValueChange(U.value)}),D=E=>{p||(m.onOpenChange(!0),N()),E&&(m.triggerPointerDownPosRef.current={x:Math.round(E.pageX),y:Math.round(E.pageY)})};return y.jsx(Dw,{asChild:!0,...f,children:y.jsx(Ne.button,{type:"button",role:"combobox","aria-controls":m.contentId,"aria-expanded":m.open,"aria-required":m.required,"aria-autocomplete":"none",dir:m.dir,"data-state":m.open?"open":"closed",disabled:p,"data-disabled":p?"":void 0,"data-placeholder":Hy(m.value)?"":void 0,...u,ref:v,onClick:De(u.onClick,E=>{E.currentTarget.focus(),S.current!=="mouse"&&D(E)}),onPointerDown:De(u.onPointerDown,E=>{S.current=E.pointerType;const R=E.target;R.hasPointerCapture(E.pointerId)&&R.releasePointerCapture(E.pointerId),E.button===0&&E.ctrlKey===!1&&E.pointerType==="mouse"&&(D(E),E.preventDefault())}),onKeyDown:De(u.onKeyDown,E=>{const R=h.current!=="";!(E.ctrlKey||E.altKey||E.metaKey)&&E.key.length===1&&T(E.key),!(R&&E.key===" ")&&Xw.includes(E.key)&&(D(),E.preventDefault())})})})});hy.displayName=py;var gy="SelectValue",vy=b.forwardRef((l,i)=>{const{__scopeSelect:s,className:r,style:u,children:f,placeholder:m="",...p}=l,v=ja(gy,s),{onValueNodeHasChildrenChange:g}=v,S=f!==void 0,h=Je(i,v.onValueNodeChange);return gt(()=>{g(S)},[g,S]),y.jsx(Ne.span,{...p,ref:h,style:{pointerEvents:"none"},children:Hy(v.value)?y.jsx(y.Fragment,{children:m}):f})});vy.displayName=gy;var Iw="SelectIcon",yy=b.forwardRef((l,i)=>{const{__scopeSelect:s,children:r,...u}=l;return y.jsx(Ne.span,{"aria-hidden":!0,...u,ref:i,children:r||"▼"})});yy.displayName=Iw;var Fw="SelectPortal",by=l=>y.jsx(Ef,{asChild:!0,...l});by.displayName=Fw;var fl="SelectContent",xy=b.forwardRef((l,i)=>{const s=ja(fl,l.__scopeSelect),[r,u]=b.useState();if(gt(()=>{u(new DocumentFragment)},[]),!s.open){const f=r;return f?vi.createPortal(y.jsx(Sy,{scope:l.__scopeSelect,children:y.jsx(fs.Slot,{scope:l.__scopeSelect,children:y.jsx("div",{children:l.children})})}),f):null}return y.jsx(Ey,{...l,ref:i})});xy.displayName=fl;var un=10,[Sy,Ua]=ho(fl),Ww="SelectContentImpl",Pw=Uw("SelectContent.RemoveScroll"),Ey=b.forwardRef((l,i)=>{const{__scopeSelect:s,position:r="item-aligned",onCloseAutoFocus:u,onEscapeKeyDown:f,onPointerDownOutside:m,side:p,sideOffset:v,align:g,alignOffset:S,arrowPadding:h,collisionBoundary:T,collisionPadding:N,sticky:D,hideWhenDetached:E,avoidCollisions:R,...O}=l,U=ja(fl,s),[L,Q]=b.useState(null),[$,F]=b.useState(null),X=Je(i,W=>Q(W)),[K,se]=b.useState(null),[ve,ye]=b.useState(null),fe=ds(s),[de,me]=b.useState(!1),he=b.useRef(!1);b.useEffect(()=>{if(L)return Sv(L)},[L]),dv();const A=b.useCallback(W=>{const[te,...ge]=fe().map(Re=>Re.ref.current),[Ee]=ge.slice(-1),Ce=document.activeElement;for(const Re of W)if(Re===Ce||(Re?.scrollIntoView({block:"nearest"}),Re===te&&$&&($.scrollTop=0),Re===Ee&&$&&($.scrollTop=$.scrollHeight),Re?.focus(),document.activeElement!==Ce))return},[fe,$]),V=b.useCallback(()=>A([K,L]),[A,K,L]);b.useEffect(()=>{de&&V()},[de,V]);const{onOpenChange:B,triggerPointerDownPosRef:ne}=U;b.useEffect(()=>{if(L){let W={x:0,y:0};const te=Ee=>{W={x:Math.abs(Math.round(Ee.pageX)-(ne.current?.x??0)),y:Math.abs(Math.round(Ee.pageY)-(ne.current?.y??0))}},ge=Ee=>{W.x<=10&&W.y<=10?Ee.preventDefault():L.contains(Ee.target)||B(!1),document.removeEventListener("pointermove",te),ne.current=null};return ne.current!==null&&(document.addEventListener("pointermove",te),document.addEventListener("pointerup",ge,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",te),document.removeEventListener("pointerup",ge,{capture:!0})}}},[L,B,ne]),b.useEffect(()=>{const W=()=>B(!1);return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[B]);const[ce,C]=By(W=>{const te=fe().filter(Ce=>!Ce.disabled),ge=te.find(Ce=>Ce.ref.current===document.activeElement),Ee=Ly(te,W,ge);Ee&&setTimeout(()=>Ee.ref.current.focus())}),G=b.useCallback((W,te,ge)=>{const Ee=!he.current&&!ge;(U.value!==void 0&&U.value===te||Ee)&&(se(W),Ee&&(he.current=!0))},[U.value]),Y=b.useCallback(()=>L?.focus(),[L]),I=b.useCallback((W,te,ge)=>{const Ee=!he.current&&!ge;(U.value!==void 0&&U.value===te||Ee)&&ye(W)},[U.value]),ee=r==="popper"?nf:wy,ie=ee===nf?{side:p,sideOffset:v,align:g,alignOffset:S,arrowPadding:h,collisionBoundary:T,collisionPadding:N,sticky:D,hideWhenDetached:E,avoidCollisions:R}:{};return y.jsx(Sy,{scope:s,content:L,viewport:$,onViewportChange:F,itemRefCallback:G,selectedItem:K,onItemLeave:Y,itemTextRefCallback:I,focusSelectedItem:V,selectedItemText:ve,position:r,isPositioned:de,searchRef:ce,children:y.jsx(wf,{as:Pw,allowPinchZoom:!0,children:y.jsx(Sf,{asChild:!0,trapped:U.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:De(u,W=>{U.trigger?.focus({preventScroll:!0}),W.preventDefault()}),children:y.jsx(xf,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>U.onOpenChange(!1),children:y.jsx(ee,{role:"listbox",id:U.contentId,"data-state":U.open?"open":"closed",dir:U.dir,onContextMenu:W=>W.preventDefault(),...O,...ie,onPlaced:()=>me(!0),ref:X,style:{display:"flex",flexDirection:"column",outline:"none",...O.style},onKeyDown:De(O.onKeyDown,W=>{const te=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!te&&W.key.length===1&&C(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let Ee=fe().filter(Ce=>!Ce.disabled).map(Ce=>Ce.ref.current);if(["ArrowUp","End"].includes(W.key)&&(Ee=Ee.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const Ce=W.target,Re=Ee.indexOf(Ce);Ee=Ee.slice(Re+1)}setTimeout(()=>A(Ee)),W.preventDefault()}})})})})})})});Ey.displayName=Ww;var eT="SelectItemAlignedPosition",wy=b.forwardRef((l,i)=>{const{__scopeSelect:s,onPlaced:r,...u}=l,f=ja(fl,s),m=Ua(fl,s),[p,v]=b.useState(null),[g,S]=b.useState(null),h=Je(i,X=>S(X)),T=ds(s),N=b.useRef(!1),D=b.useRef(!0),{viewport:E,selectedItem:R,selectedItemText:O,focusSelectedItem:U}=m,L=b.useCallback(()=>{if(f.trigger&&f.valueNode&&p&&g&&E&&R&&O){const X=f.trigger.getBoundingClientRect(),K=g.getBoundingClientRect(),se=f.valueNode.getBoundingClientRect(),ve=O.getBoundingClientRect();if(f.dir!=="rtl"){const Ce=ve.left-K.left,Re=se.left-Ce,ut=X.left-Re,lt=X.width+ut,On=Math.max(lt,K.width),gn=window.innerWidth-un,an=pg(Re,[un,Math.max(un,gn-On)]);p.style.minWidth=lt+"px",p.style.left=an+"px"}else{const Ce=K.right-ve.right,Re=window.innerWidth-se.right-Ce,ut=window.innerWidth-X.right-Re,lt=X.width+ut,On=Math.max(lt,K.width),gn=window.innerWidth-un,an=pg(Re,[un,Math.max(un,gn-On)]);p.style.minWidth=lt+"px",p.style.right=an+"px"}const ye=T(),fe=window.innerHeight-un*2,de=E.scrollHeight,me=window.getComputedStyle(g),he=parseInt(me.borderTopWidth,10),A=parseInt(me.paddingTop,10),V=parseInt(me.borderBottomWidth,10),B=parseInt(me.paddingBottom,10),ne=he+A+de+B+V,ce=Math.min(R.offsetHeight*5,ne),C=window.getComputedStyle(E),G=parseInt(C.paddingTop,10),Y=parseInt(C.paddingBottom,10),I=X.top+X.height/2-un,ee=fe-I,ie=R.offsetHeight/2,W=R.offsetTop+ie,te=he+A+W,ge=ne-te;if(te<=I){const Ce=ye.length>0&&R===ye[ye.length-1].ref.current;p.style.bottom="0px";const Re=g.clientHeight-E.offsetTop-E.offsetHeight,ut=Math.max(ee,ie+(Ce?Y:0)+Re+V),lt=te+ut;p.style.height=lt+"px"}else{const Ce=ye.length>0&&R===ye[0].ref.current;p.style.top="0px";const ut=Math.max(I,he+E.offsetTop+(Ce?G:0)+ie)+ge;p.style.height=ut+"px",E.scrollTop=te-I+E.offsetTop}p.style.margin=`${un}px 0`,p.style.minHeight=ce+"px",p.style.maxHeight=fe+"px",r?.(),requestAnimationFrame(()=>N.current=!0)}},[T,f.trigger,f.valueNode,p,g,E,R,O,f.dir,r]);gt(()=>L(),[L]);const[Q,$]=b.useState();gt(()=>{g&&$(window.getComputedStyle(g).zIndex)},[g]);const F=b.useCallback(X=>{X&&D.current===!0&&(L(),U?.(),D.current=!1)},[L,U]);return y.jsx(nT,{scope:s,contentWrapper:p,shouldExpandOnScrollRef:N,onScrollButtonChange:F,children:y.jsx("div",{ref:v,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:Q},children:y.jsx(Ne.div,{...u,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...u.style}})})})});wy.displayName=eT;var tT="SelectPopperPosition",nf=b.forwardRef((l,i)=>{const{__scopeSelect:s,align:r="start",collisionPadding:u=un,...f}=l,m=ms(s);return y.jsx(zw,{...m,...f,ref:i,align:r,collisionPadding:u,style:{boxSizing:"border-box",...f.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});nf.displayName=tT;var[nT,Hf]=ho(fl,{}),af="SelectViewport",Ty=b.forwardRef((l,i)=>{const{__scopeSelect:s,nonce:r,...u}=l,f=Ua(af,s),m=Hf(af,s),p=Je(i,f.onViewportChange),v=b.useRef(0);return y.jsxs(y.Fragment,{children:[y.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),y.jsx(fs.Slot,{scope:s,children:y.jsx(Ne.div,{"data-radix-select-viewport":"",role:"presentation",...u,ref:p,style:{position:"relative",flex:1,overflow:"hidden auto",...u.style},onScroll:De(u.onScroll,g=>{const S=g.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:T}=m;if(T?.current&&h){const N=Math.abs(v.current-S.scrollTop);if(N>0){const D=window.innerHeight-un*2,E=parseFloat(h.style.minHeight),R=parseFloat(h.style.height),O=Math.max(E,R);if(O0?Q:0,h.style.justifyContent="flex-end")}}}v.current=S.scrollTop})})})]})});Ty.displayName=af;var Cy="SelectGroup",[aT,lT]=ho(Cy),oT=b.forwardRef((l,i)=>{const{__scopeSelect:s,...r}=l,u=An();return y.jsx(aT,{scope:s,id:u,children:y.jsx(Ne.div,{role:"group","aria-labelledby":u,...r,ref:i})})});oT.displayName=Cy;var Ay="SelectLabel",iT=b.forwardRef((l,i)=>{const{__scopeSelect:s,...r}=l,u=lT(Ay,s);return y.jsx(Ne.div,{id:u.id,...r,ref:i})});iT.displayName=Ay;var es="SelectItem",[rT,_y]=ho(es),Ny=b.forwardRef((l,i)=>{const{__scopeSelect:s,value:r,disabled:u=!1,textValue:f,...m}=l,p=ja(es,s),v=Ua(es,s),g=p.value===r,[S,h]=b.useState(f??""),[T,N]=b.useState(!1),D=Je(i,U=>v.itemRefCallback?.(U,r,u)),E=An(),R=b.useRef("touch"),O=()=>{u||(p.onValueChange(r),p.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return y.jsx(rT,{scope:s,value:r,disabled:u,textId:E,isSelected:g,onItemTextChange:b.useCallback(U=>{h(L=>L||(U?.textContent??"").trim())},[]),children:y.jsx(fs.ItemSlot,{scope:s,value:r,disabled:u,textValue:S,children:y.jsx(Ne.div,{role:"option","aria-labelledby":E,"data-highlighted":T?"":void 0,"aria-selected":g&&T,"data-state":g?"checked":"unchecked","aria-disabled":u||void 0,"data-disabled":u?"":void 0,tabIndex:u?void 0:-1,...m,ref:D,onFocus:De(m.onFocus,()=>N(!0)),onBlur:De(m.onBlur,()=>N(!1)),onClick:De(m.onClick,()=>{R.current!=="mouse"&&O()}),onPointerUp:De(m.onPointerUp,()=>{R.current==="mouse"&&O()}),onPointerDown:De(m.onPointerDown,U=>{R.current=U.pointerType}),onPointerMove:De(m.onPointerMove,U=>{R.current=U.pointerType,u?v.onItemLeave?.():R.current==="mouse"&&U.currentTarget.focus({preventScroll:!0})}),onPointerLeave:De(m.onPointerLeave,U=>{U.currentTarget===document.activeElement&&v.onItemLeave?.()}),onKeyDown:De(m.onKeyDown,U=>{v.searchRef?.current!==""&&U.key===" "||(Kw.includes(U.key)&&O(),U.key===" "&&U.preventDefault())})})})})});Ny.displayName=es;var mi="SelectItemText",Ry=b.forwardRef((l,i)=>{const{__scopeSelect:s,className:r,style:u,...f}=l,m=ja(mi,s),p=Ua(mi,s),v=_y(mi,s),g=$w(mi,s),[S,h]=b.useState(null),T=Je(i,O=>h(O),v.onItemTextChange,O=>p.itemTextRefCallback?.(O,v.value,v.disabled)),N=S?.textContent,D=b.useMemo(()=>y.jsx("option",{value:v.value,disabled:v.disabled,children:N},v.value),[v.disabled,v.value,N]),{onNativeOptionAdd:E,onNativeOptionRemove:R}=g;return gt(()=>(E(D),()=>R(D)),[E,R,D]),y.jsxs(y.Fragment,{children:[y.jsx(Ne.span,{id:v.textId,...f,ref:T}),v.isSelected&&m.valueNode&&!m.valueNodeHasChildren?vi.createPortal(f.children,m.valueNode):null]})});Ry.displayName=mi;var Oy="SelectItemIndicator",My=b.forwardRef((l,i)=>{const{__scopeSelect:s,...r}=l;return _y(Oy,s).isSelected?y.jsx(Ne.span,{"aria-hidden":!0,...r,ref:i}):null});My.displayName=Oy;var lf="SelectScrollUpButton",Dy=b.forwardRef((l,i)=>{const s=Ua(lf,l.__scopeSelect),r=Hf(lf,l.__scopeSelect),[u,f]=b.useState(!1),m=Je(i,r.onScrollButtonChange);return gt(()=>{if(s.viewport&&s.isPositioned){let p=function(){const g=v.scrollTop>0;f(g)};const v=s.viewport;return p(),v.addEventListener("scroll",p),()=>v.removeEventListener("scroll",p)}},[s.viewport,s.isPositioned]),u?y.jsx(jy,{...l,ref:m,onAutoScroll:()=>{const{viewport:p,selectedItem:v}=s;p&&v&&(p.scrollTop=p.scrollTop-v.offsetHeight)}}):null});Dy.displayName=lf;var of="SelectScrollDownButton",zy=b.forwardRef((l,i)=>{const s=Ua(of,l.__scopeSelect),r=Hf(of,l.__scopeSelect),[u,f]=b.useState(!1),m=Je(i,r.onScrollButtonChange);return gt(()=>{if(s.viewport&&s.isPositioned){let p=function(){const g=v.scrollHeight-v.clientHeight,S=Math.ceil(v.scrollTop) v.removeEventListener("scroll",p)}},[s.viewport,s.isPositioned]),u?y.jsx(jy,{...l,ref:m,onAutoScroll:()=>{const{viewport:p,selectedItem:v}=s;p&&v&&(p.scrollTop=p.scrollTop+v.offsetHeight)}}):null});zy.displayName=of;var jy=b.forwardRef((l,i)=>{const{__scopeSelect:s,onAutoScroll:r,...u}=l,f=Ua("SelectScrollButton",s),m=b.useRef(null),p=ds(s),v=b.useCallback(()=>{m.current!==null&&(window.clearInterval(m.current),m.current=null)},[]);return b.useEffect(()=>()=>v(),[v]),gt(()=>{p().find(S=>S.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[p]),y.jsx(Ne.div,{"aria-hidden":!0,...u,ref:i,style:{flexShrink:0,...u.style},onPointerDown:De(u.onPointerDown,()=>{m.current===null&&(m.current=window.setInterval(r,50))}),onPointerMove:De(u.onPointerMove,()=>{f.onItemLeave?.(),m.current===null&&(m.current=window.setInterval(r,50))}),onPointerLeave:De(u.onPointerLeave,()=>{v()})})}),sT="SelectSeparator",cT=b.forwardRef((l,i)=>{const{__scopeSelect:s,...r}=l;return y.jsx(Ne.div,{"aria-hidden":!0,...r,ref:i})});cT.displayName=sT;var rf="SelectArrow",uT=b.forwardRef((l,i)=>{const{__scopeSelect:s,...r}=l,u=ms(s),f=ja(rf,s),m=Ua(rf,s);return f.open&&m.position==="popper"?y.jsx(jw,{...u,...r,ref:i}):null});uT.displayName=rf;var fT="SelectBubbleInput",Uy=b.forwardRef(({__scopeSelect:l,value:i,...s},r)=>{const u=b.useRef(null),f=Je(r,u),m=Yw(i);return b.useEffect(()=>{const p=u.current;if(!p)return;const v=window.HTMLSelectElement.prototype,S=Object.getOwnPropertyDescriptor(v,"value").set;if(m!==i&&S){const h=new Event("change",{bubbles:!0});S.call(p,i),p.dispatchEvent(h)}},[m,i]),y.jsx(Ne.select,{...s,style:{...dy,...s.style},ref:f,defaultValue:i})});Uy.displayName=fT;function Hy(l){return l===""||l===void 0}function By(l){const i=Ra(l),s=b.useRef(""),r=b.useRef(0),u=b.useCallback(m=>{const p=s.current+m;i(p),function v(g){s.current=g,window.clearTimeout(r.current),g!==""&&(r.current=window.setTimeout(()=>v(""),1e3))}(p)},[i]),f=b.useCallback(()=>{s.current="",window.clearTimeout(r.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),[s,u,f]}function Ly(l,i,s){const u=i.length>1&&Array.from(i).every(g=>g===i[0])?i[0]:i,f=s?l.indexOf(s):-1;let m=dT(l,Math.max(f,0));u.length===1&&(m=m.filter(g=>g!==s));const v=m.find(g=>g.textValue.toLowerCase().startsWith(u.toLowerCase()));return v!==s?v:void 0}function dT(l,i){return l.map((s,r)=>l[(i+r)%l.length])}var mT=my,pT=hy,hT=vy,gT=yy,vT=by,yT=xy,bT=Ty,xT=Ny,ST=Ry,ET=My,wT=Dy,TT=zy;function sf({...l}){return y.jsx(mT,{"data-slot":"select",...l})}function cf({...l}){return y.jsx(hT,{"data-slot":"select-value",...l})}function uf({className:l,children:i,...s}){return y.jsxs(pT,{"data-slot":"select-trigger",className:qe("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex h-9 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&>span]:line-clamp-1",l),...s,children:[i,y.jsx(gT,{asChild:!0,children:y.jsx(_f,{className:"size-4 opacity-50"})})]})}function ff({className:l,children:i,position:s="popper",...r}){return y.jsx(vT,{children:y.jsxs(yT,{"data-slot":"select-content",className:qe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md",s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",l),position:s,...r,children:[y.jsx(CT,{}),y.jsx(bT,{className:qe("p-1",s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:i}),y.jsx(AT,{})]})})}function df({className:l,children:i,...s}){return y.jsxs(xT,{"data-slot":"select-item",className:qe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",l),...s,children:[y.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:y.jsx(ET,{children:y.jsx(j2,{className:"size-4"})})}),y.jsx(ST,{children:i})]})}function CT({className:l,...i}){return y.jsx(wT,{"data-slot":"select-scroll-up-button",className:qe("flex cursor-default items-center justify-center py-1",l),...i,children:y.jsx(B2,{className:"size-4"})})}function AT({className:l,...i}){return y.jsx(TT,{"data-slot":"select-scroll-down-button",className:qe("flex cursor-default items-center justify-center py-1",l),...i,children:y.jsx(_f,{className:"size-4"})})}function _T(l){if(typeof document>"u")return;let i=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",i.appendChild(s),s.styleSheet?s.styleSheet.cssText=l:s.appendChild(document.createTextNode(l))}const NT=l=>{switch(l){case"success":return MT;case"info":return zT;case"warning":return DT;case"error":return jT;default:return null}},RT=Array(12).fill(0),OT=({visible:l,className:i})=>P.createElement("div",{className:["sonner-loading-wrapper",i].filter(Boolean).join(" "),"data-visible":l},P.createElement("div",{className:"sonner-spinner"},RT.map((s,r)=>P.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),MT=P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},P.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),DT=P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},P.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),zT=P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},P.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),jT=P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},P.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),UT=P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},P.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),P.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),HT=()=>{const[l,i]=P.useState(document.hidden);return P.useEffect(()=>{const s=()=>{i(document.hidden)};return document.addEventListener("visibilitychange",s),()=>window.removeEventListener("visibilitychange",s)},[]),l};let mf=1;class BT{constructor(){this.subscribe=i=>(this.subscribers.push(i),()=>{const s=this.subscribers.indexOf(i);this.subscribers.splice(s,1)}),this.publish=i=>{this.subscribers.forEach(s=>s(i))},this.addToast=i=>{this.publish(i),this.toasts=[...this.toasts,i]},this.create=i=>{var s;const{message:r,...u}=i,f=typeof i?.id=="number"||((s=i.id)==null?void 0:s.length)>0?i.id:mf++,m=this.toasts.find(v=>v.id===f),p=i.dismissible===void 0?!0:i.dismissible;return this.dismissedToasts.has(f)&&this.dismissedToasts.delete(f),m?this.toasts=this.toasts.map(v=>v.id===f?(this.publish({...v,...i,id:f,title:r}),{...v,...i,id:f,dismissible:p,title:r}):v):this.addToast({title:r,...u,dismissible:p,id:f}),f},this.dismiss=i=>(i?(this.dismissedToasts.add(i),requestAnimationFrame(()=>this.subscribers.forEach(s=>s({id:i,dismiss:!0})))):this.toasts.forEach(s=>{this.subscribers.forEach(r=>r({id:s.id,dismiss:!0}))}),i),this.message=(i,s)=>this.create({...s,message:i}),this.error=(i,s)=>this.create({...s,message:i,type:"error"}),this.success=(i,s)=>this.create({...s,type:"success",message:i}),this.info=(i,s)=>this.create({...s,type:"info",message:i}),this.warning=(i,s)=>this.create({...s,type:"warning",message:i}),this.loading=(i,s)=>this.create({...s,type:"loading",message:i}),this.promise=(i,s)=>{if(!s)return;let r;s.loading!==void 0&&(r=this.create({...s,promise:i,type:"loading",message:s.loading,description:typeof s.description!="function"?s.description:void 0}));const u=Promise.resolve(i instanceof Function?i():i);let f=r!==void 0,m;const p=u.then(async g=>{if(m=["resolve",g],P.isValidElement(g))f=!1,this.create({id:r,type:"default",message:g});else if(kT(g)&&!g.ok){f=!1;const h=typeof s.error=="function"?await s.error(`HTTP error! status: ${g.status}`):s.error,T=typeof s.description=="function"?await s.description(`HTTP error! status: ${g.status}`):s.description,D=typeof h=="object"&&!P.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:T,...D})}else if(g instanceof Error){f=!1;const h=typeof s.error=="function"?await s.error(g):s.error,T=typeof s.description=="function"?await s.description(g):s.description,D=typeof h=="object"&&!P.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:T,...D})}else if(s.success!==void 0){f=!1;const h=typeof s.success=="function"?await s.success(g):s.success,T=typeof s.description=="function"?await s.description(g):s.description,D=typeof h=="object"&&!P.isValidElement(h)?h:{message:h};this.create({id:r,type:"success",description:T,...D})}}).catch(async g=>{if(m=["reject",g],s.error!==void 0){f=!1;const S=typeof s.error=="function"?await s.error(g):s.error,h=typeof s.description=="function"?await s.description(g):s.description,N=typeof S=="object"&&!P.isValidElement(S)?S:{message:S};this.create({id:r,type:"error",description:h,...N})}}).finally(()=>{f&&(this.dismiss(r),r=void 0),s.finally==null||s.finally.call(s)}),v=()=>new Promise((g,S)=>p.then(()=>m[0]==="reject"?S(m[1]):g(m[1])).catch(S));return typeof r!="string"&&typeof r!="number"?{unwrap:v}:Object.assign(r,{unwrap:v})},this.custom=(i,s)=>{const r=s?.id||mf++;return this.create({jsx:i(r),id:r,...s}),r},this.getActiveToasts=()=>this.toasts.filter(i=>!this.dismissedToasts.has(i.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Ut=new BT,LT=(l,i)=>{const s=i?.id||mf++;return Ut.addToast({title:l,...i,id:s}),s},kT=l=>l&&typeof l=="object"&&"ok"in l&&typeof l.ok=="boolean"&&"status"in l&&typeof l.status=="number",VT=LT,YT=()=>Ut.toasts,GT=()=>Ut.getActiveToasts(),fn=Object.assign(VT,{success:Ut.success,info:Ut.info,warning:Ut.warning,error:Ut.error,custom:Ut.custom,message:Ut.message,promise:Ut.promise,dismiss:Ut.dismiss,loading:Ut.loading},{getHistory:YT,getToasts:GT});_T("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Gr(l){return l.label!==void 0}const qT=3,XT="24px",KT="16px",Ag=4e3,QT=356,ZT=14,JT=45,$T=200;function wn(...l){return l.filter(Boolean).join(" ")}function IT(l){const[i,s]=l.split("-"),r=[];return i&&r.push(i),s&&r.push(s),r}const FT=l=>{var i,s,r,u,f,m,p,v,g;const{invert:S,toast:h,unstyled:T,interacting:N,setHeights:D,visibleToasts:E,heights:R,index:O,toasts:U,expanded:L,removeToast:Q,defaultRichColors:$,closeButton:F,style:X,cancelButtonStyle:K,actionButtonStyle:se,className:ve="",descriptionClassName:ye="",duration:fe,position:de,gap:me,expandByDefault:he,classNames:A,icons:V,closeButtonAriaLabel:B="Close toast"}=l,[ne,ce]=P.useState(null),[C,G]=P.useState(null),[Y,I]=P.useState(!1),[ee,ie]=P.useState(!1),[W,te]=P.useState(!1),[ge,Ee]=P.useState(!1),[Ce,Re]=P.useState(!1),[ut,lt]=P.useState(0),[On,gn]=P.useState(0),an=P.useRef(h.duration||fe||Ag),go=P.useRef(null),Ht=P.useRef(null),vo=O===0,yo=O+1<=E,St=h.type,ea=h.dismissible!==!1,Et=h.className||"",vs=h.descriptionClassName||"",Ha=P.useMemo(()=>R.findIndex(be=>be.toastId===h.id)||0,[R,h.id]),xi=P.useMemo(()=>{var be;return(be=h.closeButton)!=null?be:F},[h.closeButton,F]),Ba=P.useMemo(()=>h.duration||fe||Ag,[h.duration,fe]),bo=P.useRef(0),Mn=P.useRef(0),Si=P.useRef(0),ta=P.useRef(null),[La,wt]=de.split("-"),ln=P.useMemo(()=>R.reduce((be,Qe,rt)=>rt>=Ha?be:be+Qe.height,0),[R,Ha]),yt=HT(),ys=h.invert||S,xo=St==="loading";Mn.current=P.useMemo(()=>Ha*me+ln,[Ha,ln]),P.useEffect(()=>{an.current=Ba},[Ba]),P.useEffect(()=>{I(!0)},[]),P.useEffect(()=>{const be=Ht.current;if(be){const Qe=be.getBoundingClientRect().height;return gn(Qe),D(rt=>[{toastId:h.id,height:Qe,position:h.position},...rt]),()=>D(rt=>rt.filter(bt=>bt.toastId!==h.id))}},[D,h.id]),P.useLayoutEffect(()=>{if(!Y)return;const be=Ht.current,Qe=be.style.height;be.style.height="auto";const rt=be.getBoundingClientRect().height;be.style.height=Qe,gn(rt),D(bt=>bt.find($e=>$e.toastId===h.id)?bt.map($e=>$e.toastId===h.id?{...$e,height:rt}:$e):[{toastId:h.id,height:rt,position:h.position},...bt])},[Y,h.title,h.description,D,h.id,h.jsx,h.action,h.cancel]);const vn=P.useCallback(()=>{ie(!0),lt(Mn.current),D(be=>be.filter(Qe=>Qe.toastId!==h.id)),setTimeout(()=>{Q(h)},$T)},[h,Q,D,Mn]);P.useEffect(()=>{if(h.promise&&St==="loading"||h.duration===1/0||h.type==="loading")return;let be;return L||N||yt?(()=>{if(Si.current {an.current!==1/0&&(bo.current=new Date().getTime(),be=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),vn()},an.current))})(),()=>clearTimeout(be)},[L,N,h,St,yt,vn]),P.useEffect(()=>{h.delete&&(vn(),h.onDismiss==null||h.onDismiss.call(h,h))},[vn,h.delete]);function dl(){var be;if(V?.loading){var Qe;return P.createElement("div",{className:wn(A?.loader,h==null||(Qe=h.classNames)==null?void 0:Qe.loader,"sonner-loader"),"data-visible":St==="loading"},V.loading)}return P.createElement(OT,{className:wn(A?.loader,h==null||(be=h.classNames)==null?void 0:be.loader),visible:St==="loading"})}const ml=h.icon||V?.[St]||NT(St);var ka,yn;return P.createElement("li",{tabIndex:0,ref:Ht,className:wn(ve,Et,A?.toast,h==null||(i=h.classNames)==null?void 0:i.toast,A?.default,A?.[St],h==null||(s=h.classNames)==null?void 0:s[St]),"data-sonner-toast":"","data-rich-colors":(ka=h.richColors)!=null?ka:$,"data-styled":!(h.jsx||h.unstyled||T),"data-mounted":Y,"data-promise":!!h.promise,"data-swiped":Ce,"data-removed":ee,"data-visible":yo,"data-y-position":La,"data-x-position":wt,"data-index":O,"data-front":vo,"data-swiping":W,"data-dismissible":ea,"data-type":St,"data-invert":ys,"data-swipe-out":ge,"data-swipe-direction":C,"data-expanded":!!(L||he&&Y),"data-testid":h.testId,style:{"--index":O,"--toasts-before":O,"--z-index":U.length-O,"--offset":`${ee?ut:Mn.current}px`,"--initial-height":he?"auto":`${On}px`,...X,...h.style},onDragEnd:()=>{te(!1),ce(null),ta.current=null},onPointerDown:be=>{be.button!==2&&(xo||!ea||(go.current=new Date,lt(Mn.current),be.target.setPointerCapture(be.pointerId),be.target.tagName!=="BUTTON"&&(te(!0),ta.current={x:be.clientX,y:be.clientY})))},onPointerUp:()=>{var be,Qe,rt;if(ge||!ea)return;ta.current=null;const bt=Number(((be=Ht.current)==null?void 0:be.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),na=Number(((Qe=Ht.current)==null?void 0:Qe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),$e=new Date().getTime()-((rt=go.current)==null?void 0:rt.getTime()),Ct=ne==="x"?bt:na,Va=Math.abs(Ct)/$e;if(Math.abs(Ct)>=JT||Va>.11){lt(Mn.current),h.onDismiss==null||h.onDismiss.call(h,h),G(ne==="x"?bt>0?"right":"left":na>0?"down":"up"),vn(),Ee(!0);return}else{var At,_t;(At=Ht.current)==null||At.style.setProperty("--swipe-amount-x","0px"),(_t=Ht.current)==null||_t.style.setProperty("--swipe-amount-y","0px")}Re(!1),te(!1),ce(null)},onPointerMove:be=>{var Qe,rt,bt;if(!ta.current||!ea||((Qe=window.getSelection())==null?void 0:Qe.toString().length)>0)return;const $e=be.clientY-ta.current.y,Ct=be.clientX-ta.current.x;var Va;const At=(Va=l.swipeDirections)!=null?Va:IT(de);!ne&&(Math.abs(Ct)>1||Math.abs($e)>1)&&ce(Math.abs(Ct)>Math.abs($e)?"x":"y");let _t={x:0,y:0};const pl=on=>1/(1.5+Math.abs(on)/20);if(ne==="y"){if(At.includes("top")||At.includes("bottom"))if(At.includes("top")&&$e<0||At.includes("bottom")&&$e>0)_t.y=$e;else{const on=$e*pl($e);_t.y=Math.abs(on) 0)_t.x=Ct;else{const on=Ct*pl(Ct);_t.x=Math.abs(on) 0||Math.abs(_t.y)>0)&&Re(!0),(rt=Ht.current)==null||rt.style.setProperty("--swipe-amount-x",`${_t.x}px`),(bt=Ht.current)==null||bt.style.setProperty("--swipe-amount-y",`${_t.y}px`)}},xi&&!h.jsx&&St!=="loading"?P.createElement("button",{"aria-label":B,"data-disabled":xo,"data-close-button":!0,onClick:xo||!ea?()=>{}:()=>{vn(),h.onDismiss==null||h.onDismiss.call(h,h)},className:wn(A?.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(yn=V?.close)!=null?yn:UT):null,(St||h.icon||h.promise)&&h.icon!==null&&(V?.[St]!==null||h.icon)?P.createElement("div",{"data-icon":"",className:wn(A?.icon,h==null||(u=h.classNames)==null?void 0:u.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||dl():null,h.type!=="loading"?ml:null):null,P.createElement("div",{"data-content":"",className:wn(A?.content,h==null||(f=h.classNames)==null?void 0:f.content)},P.createElement("div",{"data-title":"",className:wn(A?.title,h==null||(m=h.classNames)==null?void 0:m.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?P.createElement("div",{"data-description":"",className:wn(ye,vs,A?.description,h==null||(p=h.classNames)==null?void 0:p.description)},typeof h.description=="function"?h.description():h.description):null),P.isValidElement(h.cancel)?h.cancel:h.cancel&&Gr(h.cancel)?P.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||K,onClick:be=>{Gr(h.cancel)&&ea&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,be),vn())},className:wn(A?.cancelButton,h==null||(v=h.classNames)==null?void 0:v.cancelButton)},h.cancel.label):null,P.isValidElement(h.action)?h.action:h.action&&Gr(h.action)?P.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||se,onClick:be=>{Gr(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,be),!be.defaultPrevented&&vn())},className:wn(A?.actionButton,h==null||(g=h.classNames)==null?void 0:g.actionButton)},h.action.label):null)};function _g(){if(typeof window>"u"||typeof document>"u")return"ltr";const l=document.documentElement.getAttribute("dir");return l==="auto"||!l?window.getComputedStyle(document.documentElement).direction:l}function WT(l,i){const s={};return[l,i].forEach((r,u)=>{const f=u===1,m=f?"--mobile-offset":"--offset",p=f?KT:XT;function v(g){["top","right","bottom","left"].forEach(S=>{s[`${m}-${S}`]=typeof g=="number"?`${g}px`:g})}typeof r=="number"||typeof r=="string"?v(r):typeof r=="object"?["top","right","bottom","left"].forEach(g=>{r[g]===void 0?s[`${m}-${g}`]=p:s[`${m}-${g}`]=typeof r[g]=="number"?`${r[g]}px`:r[g]}):v(p)}),s}const Ng=P.forwardRef(function(i,s){const{id:r,invert:u,position:f="bottom-right",hotkey:m=["altKey","KeyT"],expand:p,closeButton:v,className:g,offset:S,mobileOffset:h,theme:T="light",richColors:N,duration:D,style:E,visibleToasts:R=qT,toastOptions:O,dir:U=_g(),gap:L=ZT,icons:Q,containerAriaLabel:$="Notifications"}=i,[F,X]=P.useState([]),K=P.useMemo(()=>r?F.filter(Y=>Y.toasterId===r):F.filter(Y=>!Y.toasterId),[F,r]),se=P.useMemo(()=>Array.from(new Set([f].concat(K.filter(Y=>Y.position).map(Y=>Y.position)))),[K,f]),[ve,ye]=P.useState([]),[fe,de]=P.useState(!1),[me,he]=P.useState(!1),[A,V]=P.useState(T!=="system"?T:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),B=P.useRef(null),ne=m.join("+").replace(/Key/g,"").replace(/Digit/g,""),ce=P.useRef(null),C=P.useRef(!1),G=P.useCallback(Y=>{X(I=>{var ee;return(ee=I.find(ie=>ie.id===Y.id))!=null&&ee.delete||Ut.dismiss(Y.id),I.filter(({id:ie})=>ie!==Y.id)})},[]);return P.useEffect(()=>Ut.subscribe(Y=>{if(Y.dismiss){requestAnimationFrame(()=>{X(I=>I.map(ee=>ee.id===Y.id?{...ee,delete:!0}:ee))});return}setTimeout(()=>{Dg.flushSync(()=>{X(I=>{const ee=I.findIndex(ie=>ie.id===Y.id);return ee!==-1?[...I.slice(0,ee),{...I[ee],...Y},...I.slice(ee+1)]:[Y,...I]})})})}),[F]),P.useEffect(()=>{if(T!=="system"){V(T);return}if(T==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?V("dark"):V("light")),typeof window>"u")return;const Y=window.matchMedia("(prefers-color-scheme: dark)");try{Y.addEventListener("change",({matches:I})=>{V(I?"dark":"light")})}catch{Y.addListener(({matches:ee})=>{try{V(ee?"dark":"light")}catch(ie){console.error(ie)}})}},[T]),P.useEffect(()=>{F.length<=1&&de(!1)},[F]),P.useEffect(()=>{const Y=I=>{var ee;if(m.every(te=>I[te]||I.code===te)){var W;de(!0),(W=B.current)==null||W.focus()}I.code==="Escape"&&(document.activeElement===B.current||(ee=B.current)!=null&&ee.contains(document.activeElement))&&de(!1)};return document.addEventListener("keydown",Y),()=>document.removeEventListener("keydown",Y)},[m]),P.useEffect(()=>{if(B.current)return()=>{ce.current&&(ce.current.focus({preventScroll:!0}),ce.current=null,C.current=!1)}},[B.current]),P.createElement("section",{ref:s,"aria-label":`${$} ${ne}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},se.map((Y,I)=>{var ee;const[ie,W]=Y.split("-");return K.length?P.createElement("ol",{key:Y,dir:U==="auto"?_g():U,tabIndex:-1,ref:B,className:g,"data-sonner-toaster":!0,"data-sonner-theme":A,"data-y-position":ie,"data-x-position":W,style:{"--front-toast-height":`${((ee=ve[0])==null?void 0:ee.height)||0}px`,"--width":`${QT}px`,"--gap":`${L}px`,...E,...WT(S,h)},onBlur:te=>{C.current&&!te.currentTarget.contains(te.relatedTarget)&&(C.current=!1,ce.current&&(ce.current.focus({preventScroll:!0}),ce.current=null))},onFocus:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||C.current||(C.current=!0,ce.current=te.relatedTarget)},onMouseEnter:()=>de(!0),onMouseMove:()=>de(!0),onMouseLeave:()=>{me||de(!1)},onDragEnd:()=>de(!1),onPointerDown:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||he(!0)},onPointerUp:()=>he(!1)},K.filter(te=>!te.position&&I===0||te.position===Y).map((te,ge)=>{var Ee,Ce;return P.createElement(FT,{key:te.id,icons:Q,index:ge,toast:te,defaultRichColors:N,duration:(Ee=O?.duration)!=null?Ee:D,className:O?.className,descriptionClassName:O?.descriptionClassName,invert:u,visibleToasts:R,closeButton:(Ce=O?.closeButton)!=null?Ce:v,interacting:me,position:Y,style:O?.style,unstyled:O?.unstyled,classNames:O?.classNames,cancelButtonStyle:O?.cancelButtonStyle,actionButtonStyle:O?.actionButtonStyle,closeButtonAriaLabel:O?.closeButtonAriaLabel,removeToast:G,toasts:K.filter(Re=>Re.position==te.position),heights:ve.filter(Re=>Re.position==te.position),setHeights:ye,expandByDefault:p,gap:L,expanded:fe,swipeDirections:i.swipeDirections})})):null}))});function PT(l,i){const s=b.useRef(null),r=b.useCallback(()=>{s.current&&(s.current.close(),s.current=null)},[]),u=b.useCallback(()=>{r(),i(m=>({...m,isTranscribing:!1,error:"Transcription cancelled"})),fn.info("Transcription cancelled")},[r,i]),f=b.useCallback((m,p)=>{if(m){i(v=>({...v,error:"",transcript:"",isTranscribing:!0}));try{const v=new URLSearchParams({url:m,model:p}),g=new EventSource(`/ytt?${v}`);s.current=g,g.onmessage=S=>{if(S.data==="error"){i(h=>({...h,error:"Transcription failed",isTranscribing:!1})),r();return}i(h=>({...h,transcript:h.transcript+S.data}))},g.onerror=()=>{i(S=>({...S,error:"Connection error",isTranscribing:!1})),r(),fn.error("Transcription failed")},g.addEventListener("done",()=>{r(),i(S=>({...S,isTranscribing:!1})),fn.success("Transcription completed")})}catch(v){i(g=>({...g,error:v instanceof Error?v.message:"An error occurred",isTranscribing:!1})),fn.error("Transcription failed")}}},[r,i]);return b.useEffect(()=>()=>{r()},[r]),{startTranscription:f,cancelTranscription:u,isTranscribing:l.isTranscribing}}const eC=({youtubeState:l,setYoutubeState:i,models:s})=>{const{startTranscription:r,cancelTranscription:u,isTranscribing:f}=PT(l,i),m=h=>{i(T=>({...T,url:h.target.value}))},p=h=>{i(T=>({...T,model:h}))},v=h=>{h.preventDefault(),r(l.url,l.model)},g=()=>{navigator.clipboard.writeText(l.transcript),fn.success("Copied to clipboard")},S=()=>{i(h=>({...h,transcript:"",error:""})),fn.success("Transcript cleared")};return y.jsxs("div",{className:"space-y-6",children:[y.jsxs(lo,{children:[y.jsx(Jr,{children:y.jsx($r,{children:"Generate Transcript from YouTube Videos"})}),y.jsx(oo,{children:y.jsxs("form",{onSubmit:v,className:"space-y-4",children:[y.jsxs("div",{className:"space-y-2",children:[y.jsx("label",{htmlFor:"youtube-url",className:"text-sm font-medium",children:"YouTube URL"}),y.jsx(is,{id:"youtube-url",type:"url",placeholder:"https://www.youtube.com/watch?v=...",value:l.url,onChange:m,className:"placeholder:text-muted-foreground/60"}),y.jsxs("div",{className:"mt-2 flex items-start space-x-2 rounded-lg bg-blue-50 p-3 dark:bg-blue-950",children:[y.jsx(Vv,{className:"mt-0.5 h-4 w-4 text-blue-600 dark:text-blue-400"}),y.jsx("p",{className:"text-sm text-blue-700 dark:text-blue-300",children:"Transcripts are generated by formatting autogenerated captions using an LLM model."})]})]}),y.jsxs("div",{className:"space-y-2",children:[y.jsx("label",{htmlFor:"model-select",className:"text-sm font-medium",children:"Model"}),y.jsxs(sf,{value:l.model,onValueChange:p,children:[y.jsx(uf,{id:"model-select",children:y.jsx(cf,{placeholder:"Select a model"})}),y.jsx(ff,{children:s.map(h=>y.jsx(df,{value:h.value,children:h.label},h.value))})]})]})]})}),y.jsx(qv,{children:f?y.jsxs("div",{className:"flex w-full gap-2",children:[y.jsxs(nn,{variant:"destructive",onClick:u,className:"flex-1",children:[y.jsx(Gv,{className:"mr-2 h-4 w-4"}),"Cancel Transcription"]}),y.jsxs(nn,{disabled:!0,className:"flex-1",children:[y.jsx(pi,{className:"mr-2 h-4 w-4 animate-spin"}),"Transcribing..."]})]}):y.jsx(nn,{onClick:v,disabled:f||!l.url,className:"w-full",children:"Generate Transcript"})})]}),l.error&&y.jsx(lo,{className:"border-red-200 bg-red-50 dark:border-red-900 dark:bg-red-950",children:y.jsx(oo,{className:"pt-6",children:y.jsx("p",{className:"text-red-700 dark:text-red-300",children:l.error})})}),l.transcript&&y.jsxs(lo,{children:[y.jsx(Jr,{className:"pb-3",children:y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx($r,{children:"Transcript"}),y.jsxs("div",{className:"flex space-x-2",children:[y.jsx(nn,{variant:"ghost",size:"icon",onClick:g,title:"Copy to clipboard","aria-label":"Copy transcript to clipboard",children:y.jsx(kv,{className:"h-4 w-4"})}),y.jsx(nn,{variant:"ghost",size:"icon",onClick:S,title:"Clear transcript","aria-label":"Clear transcript",children:y.jsx(Yv,{className:"h-4 w-4"})})]})]})}),y.jsx(oo,{children:y.jsx("div",{className:"bg-muted rounded-md p-4 whitespace-pre-wrap",role:"region","aria-label":"Transcript content",children:l.transcript})})]})]})},tC=({audioState:l,setAudioState:i,providers:s})=>{const r=(p=l.source)=>s.find(v=>v.provider.value===p)?.models??[],u=p=>{const v=r(p);i(g=>({...g,source:p,model:v.length>0?v[0].value:""}))},f=b.useCallback(async()=>{if(!(!l.url||!l.source)){i(p=>({...p,error:"",transcript:"",isTranscribing:!0}));try{const p=await fetch("/audio",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:l.url,service:l.source,model:l.model})}),v=await p.json();if(!p.ok)throw new Error(v.error??"Failed to transcribe audio");i(g=>({...g,transcript:v.text,isTranscribing:!1})),fn.success("Transcription completed")}catch(p){const v=p instanceof Error?p.message:"An error occurred";i(g=>({...g,error:v,isTranscribing:!1})),fn.error("Transcription failed")}}},[l.url,l.source,l.model,i]),m=r();return y.jsxs("div",{className:"space-y-6",children:[y.jsxs(lo,{children:[y.jsx(Jr,{children:y.jsx($r,{children:"Generate Transcript from Audio URLs"})}),y.jsx(oo,{children:y.jsxs("form",{onSubmit:p=>{p.preventDefault(),f()},className:"space-y-4",children:[y.jsxs("div",{className:"space-y-2",children:[y.jsx("label",{htmlFor:"audio-url",className:"text-sm font-medium",children:"Audio URL"}),y.jsx(is,{id:"audio-url",type:"url",placeholder:"https://example.com/podcast.mp3",value:l.url,onChange:p=>i(v=>({...v,url:p.target.value})),className:"placeholder:text-muted-foreground/60"}),y.jsxs("div",{className:"mt-2 flex items-start space-x-2 rounded-lg bg-blue-50 p-3 dark:bg-blue-950",children:[y.jsx(Vv,{className:"mt-0.5 h-4 w-4 text-blue-600 dark:text-blue-400"}),y.jsxs("p",{className:"text-sm text-blue-700 dark:text-blue-300",children:["You can find the audio download link for a podcast on"," ",y.jsx("a",{href:"https://www.listennotes.com/",className:"underline hover:text-blue-800 dark:hover:text-blue-200",target:"_blank",rel:"noopener noreferrer",children:"ListenNotes"})]})]})]}),y.jsxs("div",{className:"space-y-2",children:[y.jsx("label",{htmlFor:"provider-select",className:"text-sm font-medium",children:"Speech-to-Text (STT) Provider"}),y.jsxs(sf,{value:l.source,onValueChange:u,children:[y.jsx(uf,{id:"provider-select",children:y.jsx(cf,{})}),y.jsx(ff,{children:s.map(p=>y.jsx(df,{value:p.provider.value,children:p.provider.label},p.provider.value))})]})]}),y.jsxs("div",{className:"space-y-2",children:[y.jsx("label",{htmlFor:"model-select",className:"text-sm font-medium",children:"Model"}),y.jsxs(sf,{value:l.model||(m.length>0?m[0].value:""),onValueChange:p=>i(v=>({...v,model:p})),children:[y.jsx(uf,{id:"model-select",children:y.jsx(cf,{placeholder:"Select a model"})}),y.jsx(ff,{children:m.map(p=>y.jsx(df,{value:p.value,children:p.label},p.value))})]})]})]})}),y.jsx(qv,{children:y.jsx(nn,{onClick:()=>void f(),disabled:l.isTranscribing||!l.url,className:"w-full",children:l.isTranscribing?y.jsxs(y.Fragment,{children:[y.jsx(pi,{className:"mr-2 h-4 w-4 animate-spin"}),"Transcribing..."]}):"Generate Transcript"})})]}),l.error&&y.jsx(lo,{className:"border-red-200 bg-red-50 dark:border-red-900 dark:bg-red-950",children:y.jsx(oo,{className:"pt-6",children:y.jsx("p",{className:"text-red-700 dark:text-red-300",children:l.error})})}),l.transcript&&y.jsxs(lo,{children:[y.jsx(Jr,{className:"pb-3",children:y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx($r,{children:"Transcript"}),y.jsxs("div",{className:"flex space-x-2",children:[y.jsx(nn,{variant:"ghost",size:"icon",onClick:()=>{navigator.clipboard.writeText(l.transcript),fn.success("Copied to clipboard")},title:"Copy to clipboard","aria-label":"Copy transcript to clipboard",children:y.jsx(kv,{className:"h-4 w-4"})}),y.jsx(nn,{variant:"ghost",size:"icon",onClick:()=>{i(p=>({...p,transcript:"",error:""})),fn.success("Transcript cleared")},title:"Clear transcript","aria-label":"Clear transcript",children:y.jsx(Yv,{className:"h-4 w-4"})})]})]})}),y.jsx(oo,{children:y.jsx("div",{className:"bg-muted rounded-md p-4 whitespace-pre-wrap",role:"region","aria-label":"Transcript content",children:l.transcript})})]})]})},nC=sv("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-background text-foreground",destructive:"text-destructive-foreground [&>svg]:text-current *:data-[slot=alert-description]:text-destructive-foreground/80"}},defaultVariants:{variant:"default"}});function ky({className:l,variant:i,...s}){return y.jsx("div",{"data-slot":"alert",role:"alert",className:qe(nC({variant:i}),l),...s})}function aC({className:l,...i}){return y.jsx("div",{"data-slot":"alert-title",className:qe("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",l),...i})}function Vy({className:l,...i}){return y.jsx("div",{"data-slot":"alert-description",className:qe("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",l),...i})}var ps="Collapsible",[lC,Yy]=za(ps),[oC,Bf]=lC(ps),Gy=b.forwardRef((l,i)=>{const{__scopeCollapsible:s,open:r,defaultOpen:u,disabled:f,onOpenChange:m,...p}=l,[v,g]=Oa({prop:r,defaultProp:u??!1,onChange:m,caller:ps});return y.jsx(oC,{scope:s,disabled:f,contentId:An(),open:v,onOpenToggle:b.useCallback(()=>g(S=>!S),[g]),children:y.jsx(Ne.div,{"data-state":kf(v),"data-disabled":f?"":void 0,...p,ref:i})})});Gy.displayName=ps;var qy="CollapsibleTrigger",Xy=b.forwardRef((l,i)=>{const{__scopeCollapsible:s,...r}=l,u=Bf(qy,s);return y.jsx(Ne.button,{type:"button","aria-controls":u.contentId,"aria-expanded":u.open||!1,"data-state":kf(u.open),"data-disabled":u.disabled?"":void 0,disabled:u.disabled,...r,ref:i,onClick:De(l.onClick,u.onOpenToggle)})});Xy.displayName=qy;var Lf="CollapsibleContent",Ky=b.forwardRef((l,i)=>{const{forceMount:s,...r}=l,u=Bf(Lf,l.__scopeCollapsible);return y.jsx(co,{present:s||u.open,children:({present:f})=>y.jsx(iC,{...r,ref:i,present:f})})});Ky.displayName=Lf;var iC=b.forwardRef((l,i)=>{const{__scopeCollapsible:s,present:r,children:u,...f}=l,m=Bf(Lf,s),[p,v]=b.useState(r),g=b.useRef(null),S=Je(i,g),h=b.useRef(0),T=h.current,N=b.useRef(0),D=N.current,E=m.open||p,R=b.useRef(E),O=b.useRef(void 0);return b.useEffect(()=>{const U=requestAnimationFrame(()=>R.current=!1);return()=>cancelAnimationFrame(U)},[]),gt(()=>{const U=g.current;if(U){O.current=O.current||{transitionDuration:U.style.transitionDuration,animationName:U.style.animationName},U.style.transitionDuration="0s",U.style.animationName="none";const L=U.getBoundingClientRect();h.current=L.height,N.current=L.width,R.current||(U.style.transitionDuration=O.current.transitionDuration,U.style.animationName=O.current.animationName),v(r)}},[m.open,r]),y.jsx(Ne.div,{"data-state":kf(m.open),"data-disabled":m.disabled?"":void 0,id:m.contentId,hidden:!E,...f,ref:S,style:{"--radix-collapsible-content-height":T?`${T}px`:void 0,"--radix-collapsible-content-width":D?`${D}px`:void 0,...l.style},children:E&&u})});function kf(l){return l?"open":"closed"}var rC=Gy,sC=Xy,cC=Ky,hn="Accordion",uC=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Vf,fC,dC]=vf(hn),[hs]=za(hn,[dC,Yy]),Yf=Yy(),Qy=P.forwardRef((l,i)=>{const{type:s,...r}=l,u=r,f=r;return y.jsx(Vf.Provider,{scope:l.__scopeAccordion,children:s==="multiple"?y.jsx(gC,{...f,ref:i}):y.jsx(hC,{...u,ref:i})})});Qy.displayName=hn;var[Zy,mC]=hs(hn),[Jy,pC]=hs(hn,{collapsible:!1}),hC=P.forwardRef((l,i)=>{const{value:s,defaultValue:r,onValueChange:u=()=>{},collapsible:f=!1,...m}=l,[p,v]=Oa({prop:s,defaultProp:r??"",onChange:u,caller:hn});return y.jsx(Zy,{scope:l.__scopeAccordion,value:P.useMemo(()=>p?[p]:[],[p]),onItemOpen:v,onItemClose:P.useCallback(()=>f&&v(""),[f,v]),children:y.jsx(Jy,{scope:l.__scopeAccordion,collapsible:f,children:y.jsx($y,{...m,ref:i})})})}),gC=P.forwardRef((l,i)=>{const{value:s,defaultValue:r,onValueChange:u=()=>{},...f}=l,[m,p]=Oa({prop:s,defaultProp:r??[],onChange:u,caller:hn}),v=P.useCallback(S=>p((h=[])=>[...h,S]),[p]),g=P.useCallback(S=>p((h=[])=>h.filter(T=>T!==S)),[p]);return y.jsx(Zy,{scope:l.__scopeAccordion,value:m,onItemOpen:v,onItemClose:g,children:y.jsx(Jy,{scope:l.__scopeAccordion,collapsible:!0,children:y.jsx($y,{...f,ref:i})})})}),[vC,gs]=hs(hn),$y=P.forwardRef((l,i)=>{const{__scopeAccordion:s,disabled:r,dir:u,orientation:f="vertical",...m}=l,p=P.useRef(null),v=Je(p,i),g=fC(s),h=ns(u)==="ltr",T=De(l.onKeyDown,N=>{if(!uC.includes(N.key))return;const D=N.target,E=g().filter(K=>!K.ref.current?.disabled),R=E.findIndex(K=>K.ref.current===D),O=E.length;if(R===-1)return;N.preventDefault();let U=R;const L=0,Q=O-1,$=()=>{U=R+1,U>Q&&(U=L)},F=()=>{U=R-1,U {const{__scopeAccordion:s,value:r,...u}=l,f=gs(ts,s),m=mC(ts,s),p=Yf(s),v=An(),g=r&&m.value.includes(r)||!1,S=f.disabled||l.disabled;return y.jsx(yC,{scope:s,open:g,disabled:S,triggerId:v,children:y.jsx(rC,{"data-orientation":f.orientation,"data-state":n0(g),...p,...u,ref:i,disabled:S,open:g,onOpenChange:h=>{h?m.onItemOpen(r):m.onItemClose(r)}})})});Iy.displayName=ts;var Fy="AccordionHeader",Wy=P.forwardRef((l,i)=>{const{__scopeAccordion:s,...r}=l,u=gs(hn,s),f=Gf(Fy,s);return y.jsx(Ne.h3,{"data-orientation":u.orientation,"data-state":n0(f.open),"data-disabled":f.disabled?"":void 0,...r,ref:i})});Wy.displayName=Fy;var pf="AccordionTrigger",Py=P.forwardRef((l,i)=>{const{__scopeAccordion:s,...r}=l,u=gs(hn,s),f=Gf(pf,s),m=pC(pf,s),p=Yf(s);return y.jsx(Vf.ItemSlot,{scope:s,children:y.jsx(sC,{"aria-disabled":f.open&&!m.collapsible||void 0,"data-orientation":u.orientation,id:f.triggerId,...p,...r,ref:i})})});Py.displayName=pf;var e0="AccordionContent",t0=P.forwardRef((l,i)=>{const{__scopeAccordion:s,...r}=l,u=gs(hn,s),f=Gf(e0,s),m=Yf(s);return y.jsx(cC,{role:"region","aria-labelledby":f.triggerId,"data-orientation":u.orientation,...m,...r,ref:i,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...l.style}})});t0.displayName=e0;function n0(l){return l?"open":"closed"}var bC=Qy,xC=Iy,SC=Wy,EC=Py,wC=t0;function TC({...l}){return y.jsx(bC,{"data-slot":"accordion",...l})}function ol({className:l,...i}){return y.jsx(xC,{"data-slot":"accordion-item",className:qe("border-b last:border-b-0",l),...i})}function il({className:l,children:i,...s}){return y.jsx(SC,{className:"flex",children:y.jsxs(EC,{"data-slot":"accordion-trigger",className:qe("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",l),...s,children:[i,y.jsx(_f,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})]})})}function rl({className:l,children:i,...s}){return y.jsx(wC,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...s,children:y.jsx("div",{className:qe("pt-0 pb-4",l),children:i})})}const Fn=({id:l,value:i,onChange:s,placeholder:r,label:u})=>{const[f,m]=b.useState(!1);return y.jsxs("div",{className:"space-y-1.5",children:[y.jsx("label",{htmlFor:l,className:"block text-sm font-medium",children:u}),y.jsxs("div",{className:"relative",children:[y.jsx(is,{id:l,type:f?"text":"password",value:i,onChange:s,placeholder:r,autoComplete:"new-password",className:"placeholder:text-muted-foreground/60"}),y.jsx("button",{type:"button",onClick:()=>m(!f),className:"absolute top-1/2 right-2 -translate-y-1/2 text-gray-500 hover:text-gray-700",children:f?y.jsx(Y2,{size:16}):y.jsx(q2,{size:16})})]})]})},CC=()=>{const[l,i]=b.useState({openai:{apiKey:""},anthropic:{apiKey:""},groq:{apiKey:""},deepgram:{apiKey:""},assemblyai:{apiKey:""},google:{apiKey:""},aws:{accessKeyId:"",secretAccessKey:"",sessionToken:"",region:"us-east-1"}}),[s,r]=b.useState({message:"",isError:!1}),[u,f]=b.useState(!1),[m,p]=b.useState(!0);b.useEffect(()=>{(async()=>{p(!0);try{const h=await fetch("/settings");if(!h.ok)throw new Error("Failed to load settings");const T=await h.json();i({openai:{apiKey:T.openai_api_key??""},anthropic:{apiKey:T.anthropic_api_key??""},groq:{apiKey:T.groq_api_key??""},deepgram:{apiKey:T.deepgram_api_key??""},assemblyai:{apiKey:T.assembly_ai_api_key??""},google:{apiKey:T.gemini_api_key??""},aws:{accessKeyId:T.aws_access_key_id??"",secretAccessKey:T.aws_secret_access_key??"",sessionToken:T.aws_session_token??"",region:T.aws_region??"us-east-1"}})}catch(h){console.error("Error fetching settings:",h),r({message:"Failed to load settings. Please refresh the page.",isError:!0})}finally{p(!1)}})()},[]);const v=(S,h,T)=>{i(N=>({...N,[S]:{...N[S],[h]:T}}))},g=async S=>{S.preventDefault(),f(!0),r({message:"",isError:!1});try{const h={openai_api_key:l.openai.apiKey,anthropic_api_key:l.anthropic.apiKey,groq_api_key:l.groq.apiKey,deepgram_api_key:l.deepgram.apiKey,assembly_ai_api_key:l.assemblyai.apiKey,gemini_api_key:l.google.apiKey,aws_region:l.aws.region,aws_access_key_id:l.aws.accessKeyId,aws_secret_access_key:l.aws.secretAccessKey,aws_session_token:l.aws.sessionToken};if(!(await fetch("/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(h)})).ok)throw new Error("Failed to save settings");r({message:"Settings saved successfully!",isError:!1})}catch(h){console.error("Error saving settings:",h),r({message:"Error saving settings. Please try again.",isError:!0})}finally{f(!1),s.isError||setTimeout(()=>{r({message:"",isError:!1})},3e3)}};return m?y.jsxs("div",{className:"flex h-full items-center justify-center p-4",children:[y.jsx(pi,{className:"h-8 w-8 animate-spin text-gray-400"}),y.jsx("span",{className:"ml-2",children:"Loading settings..."})]}):y.jsxs("div",{className:"flex h-full flex-col",children:[y.jsx("div",{className:"flex-1 overflow-y-auto",children:y.jsxs("div",{className:"space-y-6 p-4 pb-24",children:[" ",s.message&&y.jsxs(ky,{className:s.isError?"bg-red-100 text-red-800 dark:bg-red-900/20 dark:text-red-300":"bg-green-100 text-green-800 dark:bg-green-900/20 dark:text-green-300",children:[y.jsx(Lv,{className:"mr-2 h-4 w-4"}),y.jsx(Vy,{children:s.message})]}),y.jsx("form",{id:"settings-form",onSubmit:S=>{g(S)},className:"space-y-6",children:y.jsxs(TC,{type:"multiple",className:"w-full rounded-lg border p-2",children:[y.jsxs(ol,{value:"openai",children:[y.jsx(il,{children:"OpenAI"}),y.jsx(rl,{children:y.jsx("div",{className:"space-y-4",children:y.jsx(Fn,{id:"openai-api-key",value:l.openai.apiKey,onChange:S=>v("openai","apiKey",S.target.value),placeholder:"sk-...",label:"API Key"})})})]}),y.jsxs(ol,{value:"anthropic",children:[y.jsx(il,{children:"Anthropic"}),y.jsx(rl,{children:y.jsx("div",{className:"space-y-4",children:y.jsx(Fn,{id:"anthropic-api-key",value:l.anthropic.apiKey,onChange:S=>v("anthropic","apiKey",S.target.value),placeholder:"sk-ant-...",label:"API Key"})})})]}),y.jsxs(ol,{value:"groq",children:[y.jsx(il,{children:"Groq"}),y.jsx(rl,{children:y.jsx("div",{className:"space-y-4",children:y.jsx(Fn,{id:"groq-api-key",value:l.groq.apiKey,onChange:S=>v("groq","apiKey",S.target.value),placeholder:"gsk_...",label:"API Key"})})})]}),y.jsxs(ol,{value:"deepgram",children:[y.jsx(il,{children:"Deepgram"}),y.jsx(rl,{children:y.jsx("div",{className:"space-y-4",children:y.jsx(Fn,{id:"deepgram-api-key",value:l.deepgram.apiKey,onChange:S=>v("deepgram","apiKey",S.target.value),placeholder:"...",label:"API Key"})})})]}),y.jsxs(ol,{value:"assemblyai",children:[y.jsx(il,{children:"AssemblyAI"}),y.jsx(rl,{children:y.jsx("div",{className:"space-y-4",children:y.jsx(Fn,{id:"assemblyai-api-key",value:l.assemblyai.apiKey,onChange:S=>v("assemblyai","apiKey",S.target.value),placeholder:"...",label:"API Key"})})})]}),y.jsxs(ol,{value:"google",children:[y.jsx(il,{children:"Google Gemini"}),y.jsx(rl,{children:y.jsx("div",{className:"space-y-4",children:y.jsx(Fn,{id:"google-api-key",value:l.google.apiKey,onChange:S=>v("google","apiKey",S.target.value),placeholder:"...",label:"API Key"})})})]}),y.jsxs(ol,{value:"aws",children:[y.jsx(il,{children:"AWS Bedrock"}),y.jsx(rl,{children:y.jsxs("div",{className:"space-y-4",children:[y.jsx(Fn,{id:"aws-access-key",value:l.aws.accessKeyId,onChange:S=>v("aws","accessKeyId",S.target.value),placeholder:"AKIA...",label:"Access Key ID"}),y.jsx(Fn,{id:"aws-secret-key",value:l.aws.secretAccessKey,onChange:S=>v("aws","secretAccessKey",S.target.value),placeholder:"...",label:"Secret Access Key"}),y.jsx(Fn,{id:"aws-session-token",value:l.aws.sessionToken,onChange:S=>v("aws","sessionToken",S.target.value),placeholder:"...",label:"Session Token (Optional)"}),y.jsxs("div",{className:"space-y-1.5",children:[y.jsx("label",{htmlFor:"aws-region",className:"block text-sm font-medium",children:"Region"}),y.jsx(is,{id:"aws-region",type:"text",value:l.aws.region,onChange:S=>v("aws","region",S.target.value),placeholder:"us-east-1",autoComplete:"off",className:"placeholder:text-muted-foreground/60"})]})]})})]})]})})]})}),y.jsx("div",{className:"sticky bottom-0 border-t border-gray-200 bg-white p-4 shadow-md dark:border-gray-800 dark:bg-gray-950",children:y.jsx(nn,{form:"settings-form",type:"submit",className:"w-full",disabled:u,children:u?y.jsxs(y.Fragment,{children:[y.jsx(pi,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):y.jsxs(y.Fragment,{children:[y.jsx(I2,{className:"mr-2 h-4 w-4"}),"Save Settings"]})})})]})},Rg=[{value:"deepgram",label:"Deepgram"},{value:"aai",label:"AssemblyAI"}],AC=()=>{const[l,i]=b.useState("dark"),[s,r]=b.useState([]),[u,f]=b.useState([]),[m,p]=b.useState(""),[v,g]=b.useState(!0),[S,h]=b.useState({url:"",model:"",transcript:"",error:"",isTranscribing:!1}),[T,N]=b.useState({url:"",source:"deepgram",model:"",transcript:"",error:"",isTranscribing:!1});b.useEffect(()=>{(async()=>{try{const O=await(await fetch("/models/ytt")).json(),U=O.models.map(F=>({value:F,label:F}));r(U),h(F=>({...F,model:O.default||(O.models.length>0?O.models[0]:"")}));const Q=(await Promise.all(Rg.map(async F=>{try{const K=await(await fetch(`/models/${F.value}`)).json();return{provider:F.value,models:K.models.map(se=>({value:se,label:se})),defaultModel:K.default}}catch(X){return console.error(`Error fetching models for ${F.value}:`,X),{provider:F.value,models:[],defaultModel:""}}}))).filter(F=>F.models.length>0).map(F=>({provider:{value:F.provider,label:Rg.find(X=>X.value===F.provider)?.label??F.provider},models:F.models}));f(Q);const $=Q.find(F=>F.provider.value==="deepgram");$?.models.length&&N(F=>({...F,model:$.models[0].value})),g(!1)}catch(R){console.error("Error fetching models:",R),p("Failed to load models. Please refresh the page and try again."),g(!1)}})()},[]),b.useEffect(()=>{document.documentElement.classList.toggle("dark",l==="dark")},[l]);const D=()=>y.jsxs("header",{className:"flex items-center justify-between border-b p-4",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(mg,{className:"h-6 w-6"}),y.jsx("h1",{className:"font-mono text-xl font-bold",children:"podscript"})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(nn,{variant:"ghost",size:"icon",onClick:()=>i(l==="light"?"dark":"light"),children:l==="light"?y.jsx(J2,{className:"h-5 w-5"}):y.jsx(eE,{className:"h-5 w-5"})}),y.jsxs(oE,{children:[y.jsx(iE,{asChild:!0,children:y.jsx(nn,{variant:"ghost",size:"icon",children:y.jsx(W2,{className:"h-5 w-5"})})}),y.jsxs(cE,{className:"w-80 sm:w-96",children:[y.jsx(uE,{children:y.jsx(fE,{children:"Settings"})}),y.jsx(CC,{})]})]})]})]});return v?y.jsx("div",{className:"bg-background flex min-h-screen items-center justify-center",children:y.jsxs("div",{className:"flex flex-col items-center gap-4",children:[y.jsx(pi,{className:"text-primary h-8 w-8 animate-spin"}),y.jsx("p",{className:"text-lg",children:"Loading models..."})]})}):m?y.jsxs("div",{className:"bg-background text-foreground min-h-screen transition-colors",children:[y.jsx(Ng,{position:"top-center"}),y.jsx(D,{}),y.jsxs("main",{className:"container mx-auto max-w-3xl p-4",children:[y.jsxs(ky,{variant:"destructive",children:[y.jsx(Lv,{className:"h-4 w-4"}),y.jsx(aC,{children:"Error"}),y.jsx(Vy,{children:m})]}),y.jsx("div",{className:"mt-4 text-center",children:y.jsx(nn,{onClick:()=>window.location.reload(),children:"Refresh Page"})})]})]}):y.jsxs("div",{className:"bg-background text-foreground min-h-screen transition-colors",children:[y.jsx(Ng,{position:"top-center"}),y.jsx(D,{}),y.jsx("main",{className:"container mx-auto max-w-3xl p-4",children:y.jsxs(Qx,{defaultValue:"youtube",className:"w-full",onValueChange:()=>{if(S.isTranscribing||T.isTranscribing)return fn.error("Please wait for the active transcription to complete before switching tabs"),!1},children:[y.jsxs(Zx,{className:"mb-6 w-full",children:[y.jsxs(Ih,{value:"youtube",className:"flex w-1/2 items-center gap-2",disabled:T.isTranscribing,children:[y.jsx(lE,{className:"h-4 w-4"}),"YouTube URL"]}),y.jsxs(Ih,{value:"audio",className:"flex w-1/2 items-center gap-2",disabled:S.isTranscribing,children:[y.jsx(mg,{className:"h-4 w-4"}),"Audio URL"]})]}),y.jsx(Fh,{value:"youtube",children:y.jsx(eC,{youtubeState:S,setYoutubeState:h,models:s})}),y.jsx(Fh,{value:"audio",children:y.jsx(tC,{audioState:T,setAudioState:N,providers:u})})]})})]})};w1.createRoot(document.getElementById("root")).render(y.jsx(b.StrictMode,{children:y.jsx(AC,{})})); ================================================ FILE: dist/assets/index-CqtPYu3T.css ================================================ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-red-950:oklch(25.8% .092 26.042);--color-green-100:oklch(96.2% .044 156.743);--color-green-300:oklch(87.1% .15 154.449);--color-green-800:oklch(44.8% .119 151.328);--color-green-900:oklch(39.3% .095 152.535);--color-blue-50:oklch(97% .014 254.604);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-blue-950:oklch(28.2% .091 267.935);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-950:oklch(13% .028 261.692);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--leading-relaxed:1.625;--radius-xs:.125rem;--radius-md:calc(var(--radius) - 2px);--radius-lg:var(--radius);--radius-xl:calc(var(--radius) + 4px);--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){*{outline-color:color-mix(in oklab,var(--ring)50%,transparent)}}body{background-color:var(--background);color:var(--foreground)}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.inset-x-0{inset-inline:calc(var(--spacing)*0)}.inset-y-0{inset-block:calc(var(--spacing)*0)}.-top-8{top:calc(var(--spacing)*-8)}.top-0{top:calc(var(--spacing)*0)}.top-1\/2{top:50%}.top-4{top:calc(var(--spacing)*4)}.-right-2{right:calc(var(--spacing)*-2)}.right-0{right:calc(var(--spacing)*0)}.right-2{right:calc(var(--spacing)*2)}.right-4{right:calc(var(--spacing)*4)}.bottom-0{bottom:calc(var(--spacing)*0)}.left-0{left:calc(var(--spacing)*0)}.z-50{z-index:50}.col-start-2{grid-column-start:2}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.-mx-1{margin-inline:calc(var(--spacing)*-1)}.mx-auto{margin-inline:auto}.my-1{margin-block:calc(var(--spacing)*1)}.mt-0\.5{margin-top:calc(var(--spacing)*.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-8{margin-top:calc(var(--spacing)*8)}.mt-auto{margin-top:auto}.mr-2{margin-right:calc(var(--spacing)*2)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.ml-2{margin-left:calc(var(--spacing)*2)}.line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-flex{display:inline-flex}.size-3\.5{width:calc(var(--spacing)*3.5);height:calc(var(--spacing)*3.5)}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-16{height:calc(var(--spacing)*16)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.max-h-96{max-height:calc(var(--spacing)*96)}.min-h-4{min-height:calc(var(--spacing)*4)}.min-h-screen{min-height:100vh}.w-1\/2{width:50%}.w-3\/4{width:75%}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-8{width:calc(var(--spacing)*8)}.w-80{width:calc(var(--spacing)*80)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-3xl{max-width:var(--container-3xl)}.max-w-md{max-width:var(--container-md)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-0\.5{--tw-translate-y:calc(var(--spacing)*.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.resize{resize:both}.scroll-my-1{scroll-margin-block:calc(var(--spacing)*1)}.grid-cols-\[0_1fr\]{grid-template-columns:0 1fr}.flex-col{flex-direction:column}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-items-start{justify-items:start}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-x-1>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*1)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}.gap-y-0\.5{row-gap:calc(var(--spacing)*.5)}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-xs{border-radius:var(--radius-xs)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-gray-200{border-color:var(--color-gray-200)}.border-input{border-color:var(--input)}.border-red-200{border-color:var(--color-red-200)}.bg-background{background-color:var(--background)}.bg-black\/80{background-color:#000c}@supports (color:color-mix(in lab,red,red)){.bg-black\/80{background-color:color-mix(in oklab,var(--color-black)80%,transparent)}}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-border{background-color:var(--border)}.bg-card{background-color:var(--card)}.bg-destructive{background-color:var(--destructive)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-800{background-color:var(--color-gray-800)}.bg-green-100{background-color:var(--color-green-100)}.bg-muted{background-color:var(--muted)}.bg-popover{background-color:var(--popover)}.bg-primary{background-color:var(--primary)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-100{background-color:var(--color-red-100)}.bg-secondary{background-color:var(--secondary)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-6{padding-block:calc(var(--spacing)*6)}.pt-0{padding-top:calc(var(--spacing)*0)}.pt-6{padding-top:calc(var(--spacing)*6)}.pr-8{padding-right:calc(var(--spacing)*8)}.pr-10{padding-right:calc(var(--spacing)*10)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pb-24{padding-bottom:calc(var(--spacing)*24)}.pl-2{padding-left:calc(var(--spacing)*2)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-5{--tw-leading:calc(var(--spacing)*5);line-height:calc(var(--spacing)*5)}.leading-none{--tw-leading:1;line-height:1}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-card-foreground{color:var(--card-foreground)}.text-destructive-foreground{color:var(--destructive-foreground)}.text-foreground{color:var(--foreground)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-green-800{color:var(--color-green-800)}.text-muted-foreground{color:var(--muted-foreground)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-red-700{color:var(--color-red-700)}.text-red-800{color:var(--color-red-800)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-white{color:var(--color-white)}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-25{opacity:.25}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-offset-background{--tw-ring-offset-color:var(--background)}.outline-hidden{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition\!{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events!important;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))!important;transition-duration:var(--tw-duration,var(--default-transition-duration))!important}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.duration-200{animation-duration:.2s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.group-data-\[disabled\=true\]\:pointer-events-none:is(:where(.group)[data-disabled=true] *){pointer-events:none}.group-data-\[disabled\=true\]\:opacity-50:is(:where(.group)[data-disabled=true] *){opacity:.5}.group-\[\.toast\]\:bg-muted:is(:where(.group).toast *){background-color:var(--muted)}.group-\[\.toast\]\:bg-primary:is(:where(.group).toast *){background-color:var(--primary)}.group-\[\.toast\]\:text-muted-foreground:is(:where(.group).toast *){color:var(--muted-foreground)}.group-\[\.toast\]\:text-primary-foreground:is(:where(.group).toast *){color:var(--primary-foreground)}.group-\[\.toaster\]\:border-border:is(:where(.group).toaster *){border-color:var(--border)}.group-\[\.toaster\]\:bg-background:is(:where(.group).toaster *){background-color:var(--background)}.group-\[\.toaster\]\:text-foreground:is(:where(.group).toaster *){color:var(--foreground)}.group-\[\.toaster\]\:shadow-lg:is(:where(.group).toaster *){--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-50:is(:where(.peer):disabled~*){opacity:.5}.selection\:bg-primary ::selection{background-color:var(--primary)}.selection\:bg-primary::selection{background-color:var(--primary)}.selection\:text-primary-foreground ::selection{color:var(--primary-foreground)}.selection\:text-primary-foreground::selection{color:var(--primary-foreground)}.file\:inline-flex::file-selector-button{display:inline-flex}.file\:h-7::file-selector-button{height:calc(var(--spacing)*7)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--foreground)}.placeholder\:text-muted-foreground::placeholder,.placeholder\:text-muted-foreground\/60::placeholder{color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.placeholder\:text-muted-foreground\/60::placeholder{color:color-mix(in oklab,var(--muted-foreground)60%,transparent)}}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media (hover:hover){.hover\:bg-accent:hover{background-color:var(--accent)}.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive)90%,transparent)}}.hover\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary)90%,transparent)}}.hover\:bg-secondary\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--secondary)80%,transparent)}}.hover\:bg-white\/\[0\.12\]:hover{background-color:#ffffff1f}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/\[0\.12\]:hover{background-color:color-mix(in oklab,var(--color-white)12%,transparent)}}.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\:text-blue-800:hover{color:var(--color-blue-800)}.hover\:text-gray-600:hover{color:var(--color-gray-600)}.hover\:text-gray-700:hover{color:var(--color-gray-700)}.hover\:text-gray-800:hover{color:var(--color-gray-800)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}}.focus\:bg-accent:focus{background-color:var(--accent)}.focus\:text-accent-foreground:focus{color:var(--accent-foreground)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-ring:focus{--tw-ring-color:var(--ring)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.focus\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}.focus-visible\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-ring:focus-visible{outline-color:var(--ring)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-blue-300:disabled{background-color:var(--color-blue-300)}.disabled\:opacity-50:disabled{opacity:.5}.has-\[\>svg\]\:grid-cols-\[calc\(var\(--spacing\)\*4\)_1fr\]:has(>svg){grid-template-columns:calc(var(--spacing)*4)1fr}.has-\[\>svg\]\:gap-x-3:has(>svg){column-gap:calc(var(--spacing)*3)}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[error\=true\]\:text-destructive-foreground[data-error=true]{color:var(--destructive-foreground)}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:var(--muted-foreground)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-.5rem}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:.5rem}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-.5rem}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:.5rem}:is(.\*\:data-\[slot\=alert-description\]\:text-destructive-foreground\/80>*)[data-slot=alert-description]{color:var(--destructive-foreground)}@supports (color:color-mix(in lab,red,red)){:is(.\*\:data-\[slot\=alert-description\]\:text-destructive-foreground\/80>*)[data-slot=alert-description]{color:color-mix(in oklab,var(--destructive-foreground)80%,transparent)}}:is(.\*\:data-\[slot\=select-value\]\:flex>*)[data-slot=select-value]{display:flex}:is(.\*\:data-\[slot\=select-value\]\:items-center>*)[data-slot=select-value]{align-items:center}:is(.\*\:data-\[slot\=select-value\]\:gap-2>*)[data-slot=select-value]{gap:calc(var(--spacing)*2)}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:var(--background)}.data-\[state\=active\]\:text-foreground[data-state=active]{color:var(--foreground)}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=closed\]\:duration-300[data-state=closed]{--tw-duration:.3s;transition-duration:.3s}.data-\[state\=closed\]\:animate-out[data-state=closed]{--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial;animation-name:exit;animation-duration:.15s}.data-\[state\=closed\]\:duration-300[data-state=closed]{animation-duration:.3s}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=closed\]\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y:100%}.data-\[state\=closed\]\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x:-100%}.data-\[state\=closed\]\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x:100%}.data-\[state\=closed\]\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y:-100%}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:var(--secondary)}.data-\[state\=open\]\:duration-500[data-state=open]{--tw-duration:.5s;transition-duration:.5s}.data-\[state\=open\]\:animate-in[data-state=open]{--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial;animation-name:enter;animation-duration:.15s}.data-\[state\=open\]\:duration-500[data-state=open]{animation-duration:.5s}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=open\]\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y:100%}.data-\[state\=open\]\:slide-in-from-left[data-state=open]{--tw-enter-translate-x:-100%}.data-\[state\=open\]\:slide-in-from-right[data-state=open]{--tw-enter-translate-x:100%}.data-\[state\=open\]\:slide-in-from-top[data-state=open]{--tw-enter-translate-y:-100%}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}@media (min-width:40rem){.sm\:w-96{width:calc(var(--spacing)*96)}.sm\:max-w-sm{max-width:var(--container-sm)}}@media (min-width:48rem){.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.dark\:border-gray-800:is(.dark *){border-color:var(--color-gray-800)}.dark\:border-red-900:is(.dark *){border-color:var(--color-red-900)}.dark\:bg-blue-950:is(.dark *){background-color:var(--color-blue-950)}.dark\:bg-gray-950:is(.dark *){background-color:var(--color-gray-950)}.dark\:bg-green-900\/20:is(.dark *){background-color:#0d542b33}@supports (color:color-mix(in lab,red,red)){.dark\:bg-green-900\/20:is(.dark *){background-color:color-mix(in oklab,var(--color-green-900)20%,transparent)}}.dark\:bg-red-900\/20:is(.dark *){background-color:#82181a33}@supports (color:color-mix(in lab,red,red)){.dark\:bg-red-900\/20:is(.dark *){background-color:color-mix(in oklab,var(--color-red-900)20%,transparent)}}.dark\:bg-red-950:is(.dark *){background-color:var(--color-red-950)}.dark\:text-blue-300:is(.dark *){color:var(--color-blue-300)}.dark\:text-blue-400:is(.dark *){color:var(--color-blue-400)}.dark\:text-green-300:is(.dark *){color:var(--color-green-300)}.dark\:text-red-300:is(.dark *){color:var(--color-red-300)}@media (hover:hover){.dark\:hover\:text-blue-200:is(.dark *):hover{color:var(--color-blue-200)}}.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.\[\&_p\]\:leading-relaxed p{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_svg\:not\(\[class\*\=\'text-\'\]\)\]\:text-muted-foreground svg:not([class*=text-]){color:var(--muted-foreground)}:is(.\*\:\[span\]\:last\:flex>*):is(span):last-child{display:flex}:is(.\*\:\[span\]\:last\:items-center>*):is(span):last-child{align-items:center}:is(.\*\:\[span\]\:last\:gap-2>*):is(span):last-child{gap:calc(var(--spacing)*2)}.\[\&\>span\]\:line-clamp-1>span{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\[\&\>svg\]\:size-4>svg{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&\>svg\]\:translate-y-0\.5>svg{--tw-translate-y:calc(var(--spacing)*.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.\[\&\>svg\]\:text-current>svg{color:currentColor}.\[\&\[data-state\=open\]\>svg\]\:rotate-180[data-state=open]>svg{rotate:180deg}}:root{--background:oklch(100% 0 0);--foreground:oklch(13% .028 261.692);--card:oklch(100% 0 0);--card-foreground:oklch(13% .028 261.692);--popover:oklch(100% 0 0);--popover-foreground:oklch(13% .028 261.692);--primary:oklch(21% .034 264.665);--primary-foreground:oklch(98.5% .002 247.839);--secondary:oklch(96.7% .003 264.542);--secondary-foreground:oklch(21% .034 264.665);--muted:oklch(96.7% .003 264.542);--muted-foreground:oklch(55.1% .027 264.364);--accent:oklch(96.7% .003 264.542);--accent-foreground:oklch(21% .034 264.665);--destructive:oklch(57.7% .245 27.325);--destructive-foreground:oklch(57.7% .245 27.325);--border:oklch(92.8% .006 264.531);--input:oklch(92.8% .006 264.531);--ring:oklch(87.2% .01 258.338);--chart-1:oklch(64.6% .222 41.116);--chart-2:oklch(60% .118 184.704);--chart-3:oklch(39.8% .07 227.392);--chart-4:oklch(82.8% .189 84.429);--chart-5:oklch(76.9% .188 70.08);--radius:.625rem;--sidebar:oklch(98.5% .002 247.839);--sidebar-foreground:oklch(13% .028 261.692);--sidebar-primary:oklch(21% .034 264.665);--sidebar-primary-foreground:oklch(98.5% .002 247.839);--sidebar-accent:oklch(96.7% .003 264.542);--sidebar-accent-foreground:oklch(21% .034 264.665);--sidebar-border:oklch(92.8% .006 264.531);--sidebar-ring:oklch(87.2% .01 258.338)}.dark{--background:oklch(13% .028 261.692);--foreground:oklch(98.5% .002 247.839);--card:oklch(13% .028 261.692);--card-foreground:oklch(98.5% .002 247.839);--popover:oklch(13% .028 261.692);--popover-foreground:oklch(98.5% .002 247.839);--primary:oklch(98.5% .002 247.839);--primary-foreground:oklch(21% .034 264.665);--secondary:oklch(27.8% .033 256.848);--secondary-foreground:oklch(98.5% .002 247.839);--muted:oklch(27.8% .033 256.848);--muted-foreground:oklch(70.7% .022 261.325);--accent:oklch(27.8% .033 256.848);--accent-foreground:oklch(98.5% .002 247.839);--destructive:oklch(39.6% .141 25.723);--destructive-foreground:oklch(63.7% .237 25.331);--border:oklch(27.8% .033 256.848);--input:oklch(27.8% .033 256.848);--ring:oklch(44.6% .03 256.802);--chart-1:oklch(48.8% .243 264.376);--chart-2:oklch(69.6% .17 162.48);--chart-3:oklch(76.9% .188 70.08);--chart-4:oklch(62.7% .265 303.9);--chart-5:oklch(64.5% .246 16.439);--sidebar:oklch(21% .034 264.665);--sidebar-foreground:oklch(98.5% .002 247.839);--sidebar-primary:oklch(48.8% .243 264.376);--sidebar-primary-foreground:oklch(98.5% .002 247.839);--sidebar-accent:oklch(27.8% .033 256.848);--sidebar-accent-foreground:oklch(98.5% .002 247.839);--sidebar-border:oklch(27.8% .033 256.848);--sidebar-ring:oklch(44.6% .03 256.802)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0))}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:" ";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:" ";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:" ";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:" ";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}} ================================================ FILE: dist/index.html ================================================ Podscript ================================================ FILE: go.mod ================================================ module github.com/cottonggeeks/podscript go 1.24.2 require ( github.com/AssemblyAI/assemblyai-go-sdk v1.10.0 github.com/alecthomas/kong v1.13.0 github.com/anthropics/anthropic-sdk-go v1.19.0 github.com/aws/aws-sdk-go-v2 v1.41.0 github.com/aws/aws-sdk-go-v2/config v1.32.6 github.com/aws/aws-sdk-go-v2/credentials v1.19.6 github.com/aws/aws-sdk-go-v2/service/bedrockruntime v1.47.1 github.com/charmbracelet/huh v0.8.0 github.com/deepakjois/groq v0.0.0-20250118174530-0262c383bbb6 github.com/deepakjois/ytt v0.0.0-20250614130656-34596ccf7d63 github.com/deepgram/deepgram-go-sdk/v2 v2.1.0 github.com/google/generative-ai-go v0.20.1 github.com/openai/openai-go v1.12.0 github.com/pelletier/go-toml/v2 v2.2.4 google.golang.org/api v0.258.0 ) require ( cloud.google.com/go v0.118.2 // indirect cloud.google.com/go/ai v0.10.0 // indirect cloud.google.com/go/auth v0.17.0 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect cloud.google.com/go/compute/metadata v0.9.0 // indirect cloud.google.com/go/longrunning v0.6.4 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.4 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.16 // indirect github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.16 // indirect github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.16 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.4 // indirect github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.16 // indirect github.com/aws/aws-sdk-go-v2/service/signin v1.0.4 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.30.8 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.12 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.41.5 // indirect github.com/aws/smithy-go v1.24.0 // indirect github.com/charmbracelet/colorprofile v0.3.3 // indirect github.com/charmbracelet/x/cellbuf v0.0.13 // indirect github.com/clipperhouse/displaywidth v0.4.1 // indirect github.com/clipperhouse/stringish v0.1.1 // indirect github.com/clipperhouse/uax29/v2 v2.3.0 // indirect github.com/coder/websocket v1.8.14 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dvonthenen/websocket v1.5.1-dyv.2 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/google/s2a-go v0.1.9 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.7 // indirect github.com/googleapis/gax-go/v2 v2.15.0 // indirect github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/tidwall/gjson v1.18.0 // indirect github.com/tidwall/match v1.2.0 // indirect github.com/tidwall/pretty v1.2.1 // indirect github.com/tidwall/sjson v1.2.5 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect go.opentelemetry.io/otel v1.38.0 // indirect go.opentelemetry.io/otel/metric v1.38.0 // indirect go.opentelemetry.io/otel/trace v1.38.0 // indirect golang.org/x/crypto v0.46.0 // indirect golang.org/x/net v0.48.0 // indirect golang.org/x/oauth2 v0.34.0 // indirect golang.org/x/time v0.14.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20251022142026-3a174f9686a8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20251213004720-97cd9d5aeac2 // indirect google.golang.org/grpc v1.77.0 // indirect google.golang.org/protobuf v1.36.11 // indirect ) require ( github.com/atotto/clipboard v0.1.4 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect // indirect dependencies github.com/catppuccin/go v0.3.0 // indirect github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/charmbracelet/bubbles v0.21.1-0.20250623103423-23b8fd6302d7 // indirect github.com/charmbracelet/bubbletea v1.3.10 // indirect github.com/charmbracelet/lipgloss v1.1.0 // indirect github.com/charmbracelet/x/ansi v0.10.3 // indirect github.com/charmbracelet/x/exp/strings v0.0.0-20251106155416-42745044e6bc // indirect github.com/charmbracelet/x/term v0.2.2 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/gorilla/schema v1.4.1 // indirect github.com/lucasb-eyer/go-colorful v1.3.0 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-localereader v0.0.1 // indirect github.com/mattn/go-runewidth v0.0.19 // indirect github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect github.com/muesli/cancelreader v0.2.2 // indirect github.com/muesli/termenv v0.16.0 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect golang.org/x/sync v0.19.0 // indirect golang.org/x/sys v0.39.0 // indirect golang.org/x/text v0.32.0 // indirect k8s.io/klog/v2 v2.130.1 // indirect ) ================================================ FILE: go.sum ================================================ cloud.google.com/go v0.118.2 h1:bKXO7RXMFDkniAAvvuMrAPtQ/VHrs9e7J5UT3yrGdTY= cloud.google.com/go v0.118.2/go.mod h1:CFO4UPEPi8oV21xoezZCrd3d81K4fFkDTEJu4R8K+9M= cloud.google.com/go/ai v0.10.0 h1:hwj6CI6sMKubXodoJJGTy/c2T1RbbLGM6TL3QoAvzU8= cloud.google.com/go/ai v0.10.0/go.mod h1:kvnt2KeHqX8+41PVeMRBETDyQAp/RFvBWGdx/aGjNMo= cloud.google.com/go/auth v0.17.0 h1:74yCm7hCj2rUyyAocqnFzsAYXgJhrG26XCFimrc/Kz4= cloud.google.com/go/auth v0.17.0/go.mod h1:6wv/t5/6rOPAX4fJiRjKkJCvswLwdet7G8+UGXt7nCQ= cloud.google.com/go/auth/oauth2adapt v0.2.8 h1:keo8NaayQZ6wimpNSmW5OPc283g65QNIiLpZnkHRbnc= cloud.google.com/go/auth/oauth2adapt v0.2.8/go.mod h1:XQ9y31RkqZCcwJWNSx2Xvric3RrU88hAYYbjDWYDL+c= cloud.google.com/go/compute/metadata v0.9.0 h1:pDUj4QMoPejqq20dK0Pg2N4yG9zIkYGdBtwLoEkH9Zs= cloud.google.com/go/compute/metadata v0.9.0/go.mod h1:E0bWwX5wTnLPedCKqk3pJmVgCBSM6qQI1yTBdEb3C10= cloud.google.com/go/longrunning v0.6.4 h1:3tyw9rO3E2XVXzSApn1gyEEnH2K9SynNQjMlBi3uHLg= cloud.google.com/go/longrunning v0.6.4/go.mod h1:ttZpLCe6e7EXvn9OxpBRx7kZEB0efv8yBO6YnVMfhJs= github.com/AssemblyAI/assemblyai-go-sdk v1.10.0 h1:JInE2GaIriJtT6HkOOoEtmMKomdzfUJfCdhl46Y8laI= github.com/AssemblyAI/assemblyai-go-sdk v1.10.0/go.mod h1:dwv8jDdg+UKPU9ClZzhQNXIVj3Yw68IaTVRuyKRLigw= github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ= github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= github.com/alecthomas/kong v1.13.0 h1:5e/7XC3ugvhP1DQBmTS+WuHtCbcv44hsohMgcvVxSrA= github.com/alecthomas/kong v1.13.0/go.mod h1:wrlbXem1CWqUV5Vbmss5ISYhsVPkBb1Yo7YKJghju2I= github.com/alecthomas/repr v0.5.2 h1:SU73FTI9D1P5UNtvseffFSGmdNci/O6RsqzeXJtP0Qs= github.com/alecthomas/repr v0.5.2/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/anthropics/anthropic-sdk-go v1.19.0 h1:mO6E+ffSzLRvR/YUH9KJC0uGw0uV8GjISIuzem//3KE= github.com/anthropics/anthropic-sdk-go v1.19.0/go.mod h1:WTz31rIUHUHqai2UslPpw5CwXrQP3geYBioRV4WOLvE= github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aws/aws-sdk-go-v2 v1.41.0 h1:tNvqh1s+v0vFYdA1xq0aOJH+Y5cRyZ5upu6roPgPKd4= github.com/aws/aws-sdk-go-v2 v1.41.0/go.mod h1:MayyLB8y+buD9hZqkCW3kX1AKq07Y5pXxtgB+rRFhz0= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.4 h1:489krEF9xIGkOaaX3CE/Be2uWjiXrkCH6gUX+bZA/BU= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.4/go.mod h1:IOAPF6oT9KCsceNTvvYMNHy0+kMF8akOjeDvPENWxp4= github.com/aws/aws-sdk-go-v2/config v1.32.6 h1:hFLBGUKjmLAekvi1evLi5hVvFQtSo3GYwi+Bx4lpJf8= github.com/aws/aws-sdk-go-v2/config v1.32.6/go.mod h1:lcUL/gcd8WyjCrMnxez5OXkO3/rwcNmvfno62tnXNcI= github.com/aws/aws-sdk-go-v2/credentials v1.19.6 h1:F9vWao2TwjV2MyiyVS+duza0NIRtAslgLUM0vTA1ZaE= github.com/aws/aws-sdk-go-v2/credentials v1.19.6/go.mod h1:SgHzKjEVsdQr6Opor0ihgWtkWdfRAIwxYzSJ8O85VHY= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.16 h1:80+uETIWS1BqjnN9uJ0dBUaETh+P1XwFy5vwHwK5r9k= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.16/go.mod h1:wOOsYuxYuB/7FlnVtzeBYRcjSRtQpAW0hCP7tIULMwo= github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.16 h1:rgGwPzb82iBYSvHMHXc8h9mRoOUBZIGFgKb9qniaZZc= github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.16/go.mod h1:L/UxsGeKpGoIj6DxfhOWHWQ/kGKcd4I1VncE4++IyKA= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.16 h1:1jtGzuV7c82xnqOVfx2F0xmJcOw5374L7N6juGW6x6U= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.16/go.mod h1:M2E5OQf+XLe+SZGmmpaI2yy+J326aFf6/+54PoxSANc= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4 h1:WKuaxf++XKWlHWu9ECbMlha8WOEGm0OUEZqm4K/Gcfk= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4/go.mod h1:ZWy7j6v1vWGmPReu0iSGvRiise4YI5SkR3OHKTZ6Wuc= github.com/aws/aws-sdk-go-v2/service/bedrockruntime v1.47.1 h1:xryaVPvLLcCf7Y/4beWjOcWxiftorB/KDjtiYORVSNo= github.com/aws/aws-sdk-go-v2/service/bedrockruntime v1.47.1/go.mod h1:ckSglleOJ2avj81L6vBb70nK51cnhTwvVK1SkLgFtj4= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.4 h1:0ryTNEdJbzUCEWkVXEXoqlXV72J5keC1GvILMOuD00E= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.4/go.mod h1:HQ4qwNZh32C3CBeO6iJLQlgtMzqeG17ziAA/3KDJFow= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.16 h1:oHjJHeUy0ImIV0bsrX0X91GkV5nJAyv1l1CC9lnO0TI= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.16/go.mod h1:iRSNGgOYmiYwSCXxXaKb9HfOEj40+oTKn8pTxMlYkRM= github.com/aws/aws-sdk-go-v2/service/signin v1.0.4 h1:HpI7aMmJ+mm1wkSHIA2t5EaFFv5EFYXePW30p1EIrbQ= github.com/aws/aws-sdk-go-v2/service/signin v1.0.4/go.mod h1:C5RdGMYGlfM0gYq/tifqgn4EbyX99V15P2V3R+VHbQU= github.com/aws/aws-sdk-go-v2/service/sso v1.30.8 h1:aM/Q24rIlS3bRAhTyFurowU8A0SMyGDtEOY/l/s/1Uw= github.com/aws/aws-sdk-go-v2/service/sso v1.30.8/go.mod h1:+fWt2UHSb4kS7Pu8y+BMBvJF0EWx+4H0hzNwtDNRTrg= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.12 h1:AHDr0DaHIAo8c9t1emrzAlVDFp+iMMKnPdYy6XO4MCE= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.12/go.mod h1:GQ73XawFFiWxyWXMHWfhiomvP3tXtdNar/fi8z18sx0= github.com/aws/aws-sdk-go-v2/service/sts v1.41.5 h1:SciGFVNZ4mHdm7gpD1dgZYnCuVdX1s+lFTg4+4DOy70= github.com/aws/aws-sdk-go-v2/service/sts v1.41.5/go.mod h1:iW40X4QBmUxdP+fZNOpfmkdMZqsovezbAeO+Ubiv2pk= github.com/aws/smithy-go v1.24.0 h1:LpilSUItNPFr1eY85RYgTIg5eIEPtvFbskaFcmmIUnk= github.com/aws/smithy-go v1.24.0/go.mod h1:LEj2LM3rBRQJxPZTB4KuzZkaZYnZPnvgIhb4pu07mx0= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/aymanbagabas/go-udiff v0.3.1 h1:LV+qyBQ2pqe0u42ZsUEtPiCaUoqgA9gYRDs3vj1nolY= github.com/aymanbagabas/go-udiff v0.3.1/go.mod h1:G0fsKmG+P6ylD0r6N/KgQD/nWzgfnl8ZBcNLgcbrw8E= github.com/catppuccin/go v0.3.0 h1:d+0/YicIq+hSTo5oPuRi5kOpqkVA5tAsU6dNhvRu+aY= github.com/catppuccin/go v0.3.0/go.mod h1:8IHJuMGaUUjQM82qBrGNBv7LFq6JI3NnQCF6MOlZjpc= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/charmbracelet/bubbles v0.21.1-0.20250623103423-23b8fd6302d7 h1:JFgG/xnwFfbezlUnFMJy0nusZvytYysV4SCS2cYbvws= github.com/charmbracelet/bubbles v0.21.1-0.20250623103423-23b8fd6302d7/go.mod h1:ISC1gtLcVilLOf23wvTfoQuYbW2q0JevFxPfUzZ9Ybw= github.com/charmbracelet/bubbletea v1.3.10 h1:otUDHWMMzQSB0Pkc87rm691KZ3SWa4KUlvF9nRvCICw= github.com/charmbracelet/bubbletea v1.3.10/go.mod h1:ORQfo0fk8U+po9VaNvnV95UPWA1BitP1E0N6xJPlHr4= github.com/charmbracelet/colorprofile v0.3.3 h1:DjJzJtLP6/NZ8p7Cgjno0CKGr7wwRJGxWUwh2IyhfAI= github.com/charmbracelet/colorprofile v0.3.3/go.mod h1:nB1FugsAbzq284eJcjfah2nhdSLppN2NqvfotkfRYP4= github.com/charmbracelet/huh v0.8.0 h1:Xz/Pm2h64cXQZn/Jvele4J3r7DDiqFCNIVteYukxDvY= github.com/charmbracelet/huh v0.8.0/go.mod h1:5YVc+SlZ1IhQALxRPpkGwwEKftN/+OlJlnJYlDRFqN4= github.com/charmbracelet/lipgloss v1.1.0 h1:vYXsiLHVkK7fp74RkV7b2kq9+zDLoEU4MZoFqR/noCY= github.com/charmbracelet/lipgloss v1.1.0/go.mod h1:/6Q8FR2o+kj8rz4Dq0zQc3vYf7X+B0binUUBwA0aL30= github.com/charmbracelet/x/ansi v0.10.3 h1:3WoV9XN8uMEnFRZZ+vBPRy59TaIWa+gJodS4Vg5Fut0= github.com/charmbracelet/x/ansi v0.10.3/go.mod h1:uQt8bOrq/xgXjlGcFMc8U2WYbnxyjrKhnvTQluvfCaE= github.com/charmbracelet/x/cellbuf v0.0.13 h1:/KBBKHuVRbq1lYx5BzEHBAFBP8VcQzJejZ/IA3iR28k= github.com/charmbracelet/x/cellbuf v0.0.13/go.mod h1:xe0nKWGd3eJgtqZRaN9RjMtK7xUYchjzPr7q6kcvCCs= github.com/charmbracelet/x/conpty v0.1.0 h1:4zc8KaIcbiL4mghEON8D72agYtSeIgq8FSThSPQIb+U= github.com/charmbracelet/x/conpty v0.1.0/go.mod h1:rMFsDJoDwVmiYM10aD4bH2XiRgwI7NYJtQgl5yskjEQ= github.com/charmbracelet/x/errors v0.0.0-20240508181413-e8d8b6e2de86 h1:JSt3B+U9iqk37QUU2Rvb6DSBYRLtWqFqfxf8l5hOZUA= github.com/charmbracelet/x/errors v0.0.0-20240508181413-e8d8b6e2de86/go.mod h1:2P0UgXMEa6TsToMSuFqKFQR+fZTO9CNGUNokkPatT/0= github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91 h1:payRxjMjKgx2PaCWLZ4p3ro9y97+TVLZNaRZgJwSVDQ= github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U= github.com/charmbracelet/x/exp/strings v0.0.0-20251106155416-42745044e6bc h1:BlaReNFLf93gTMJdtcZ5RLeegmW/qepH74tqBY+b1fM= github.com/charmbracelet/x/exp/strings v0.0.0-20251106155416-42745044e6bc/go.mod h1:/ehtMPNh9K4odGFkqYJKpIYyePhdp1hLBRvyY4bWkH8= github.com/charmbracelet/x/term v0.2.2 h1:xVRT/S2ZcKdhhOuSP4t5cLi5o+JxklsoEObBSgfgZRk= github.com/charmbracelet/x/term v0.2.2/go.mod h1:kF8CY5RddLWrsgVwpw4kAa6TESp6EB5y3uxGLeCqzAI= github.com/charmbracelet/x/termios v0.1.1 h1:o3Q2bT8eqzGnGPOYheoYS8eEleT5ZVNYNy8JawjaNZY= github.com/charmbracelet/x/termios v0.1.1/go.mod h1:rB7fnv1TgOPOyyKRJ9o+AsTU/vK5WHJ2ivHeut/Pcwo= github.com/charmbracelet/x/xpty v0.1.2 h1:Pqmu4TEJ8KeA9uSkISKMU3f+C1F6OGBn8ABuGlqCbtI= github.com/charmbracelet/x/xpty v0.1.2/go.mod h1:XK2Z0id5rtLWcpeNiMYBccNNBrP2IJnzHI0Lq13Xzq4= github.com/clipperhouse/displaywidth v0.4.1 h1:uVw9V8UDfnggg3K2U84VWY1YLQ/x2aKSCtkRyYozfoU= github.com/clipperhouse/displaywidth v0.4.1/go.mod h1:R+kHuzaYWFkTm7xoMmK1lFydbci4X2CicfbGstSGg0o= github.com/clipperhouse/stringish v0.1.1 h1:+NSqMOr3GR6k1FdRhhnXrLfztGzuG+VuFDfatpWHKCs= github.com/clipperhouse/stringish v0.1.1/go.mod h1:v/WhFtE1q0ovMta2+m+UbpZ+2/HEXNWYXQgCt4hdOzA= github.com/clipperhouse/uax29/v2 v2.3.0 h1:SNdx9DVUqMoBuBoW3iLOj4FQv3dN5mDtuqwuhIGpJy4= github.com/clipperhouse/uax29/v2 v2.3.0/go.mod h1:Wn1g7MK6OoeDT0vL+Q0SQLDz/KpfsVRgg6W7ihQeh4g= github.com/cncf/xds/go v0.0.0-20251022180443-0feb69152e9f h1:Y8xYupdHxryycyPlc9Y+bSQAYZnetRJ70VMVKm5CKI0= github.com/cncf/xds/go v0.0.0-20251022180443-0feb69152e9f/go.mod h1:HlzOvOjVBOfTGSRXRyY0OiCS/3J1akRGQQpRO/7zyF4= github.com/coder/websocket v1.8.14 h1:9L0p0iKiNOibykf283eHkKUHHrpG7f65OE3BhhO7v9g= github.com/coder/websocket v1.8.14/go.mod h1:NX3SzP+inril6yawo5CQXx8+fk145lPDC6pumgx0mVg= github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s= github.com/creack/pty v1.1.24/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/deepakjois/groq v0.0.0-20250118174530-0262c383bbb6 h1:8R+GRNhodcNVfXFFbOExWkPRN9D3W4ahi7gLzFj0ens= github.com/deepakjois/groq v0.0.0-20250118174530-0262c383bbb6/go.mod h1:O53wA/JpiZr628LmB6xRbS52Oo4u9spQ7USdkz/1+JA= github.com/deepakjois/ytt v0.0.0-20250614130656-34596ccf7d63 h1:gn7Y0vDlNTTISpTyqyAqJCpvgsNeG+pEg1EdTIdXzTU= github.com/deepakjois/ytt v0.0.0-20250614130656-34596ccf7d63/go.mod h1:10sJT4UpmA1U9aeWkgHpFDAHxmIrN3kShFq9U6cEelo= github.com/deepgram/deepgram-go-sdk/v2 v2.1.0 h1:BmO+h3mJ/WUnJ+vJzcI7FQH2b0+68RdpJkfWZ/SqX10= github.com/deepgram/deepgram-go-sdk/v2 v2.1.0/go.mod h1:KZpM7mSAZj9CsyDsppA4l/b7rzt+IE3Ya6BcAcdTTxI= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/dvonthenen/websocket v1.5.1-dyv.2 h1:OXlWJJkeHt8k4+MEI0Y8SQjY2ihHYD2z/tI7sZZfsnA= github.com/dvonthenen/websocket v1.5.1-dyv.2/go.mod h1:q2GbopbpFJvBP4iqVvqwwahVmvu2HnCfdqCWDoQVKMM= github.com/envoyproxy/go-control-plane v0.13.5-0.20251024222203-75eaa193e329 h1:K+fnvUM0VZ7ZFJf0n4L/BRlnsb9pL/GuDG6FqaH+PwM= github.com/envoyproxy/go-control-plane/envoy v1.35.0 h1:ixjkELDE+ru6idPxcHLj8LBVc2bFP7iBytj353BoHUo= github.com/envoyproxy/go-control-plane/envoy v1.35.0/go.mod h1:09qwbGVuSWWAyN5t/b3iyVfz5+z8QWGrzkoqm/8SbEs= github.com/envoyproxy/protoc-gen-validate v1.2.1 h1:DEo3O99U8j4hBFwbJfrz9VtgcDfUKS7KJ7spH3d86P8= github.com/envoyproxy/protoc-gen-validate v1.2.1/go.mod h1:d/C80l/jxXLdfEIhX1W2TmLfsJ31lvEjwamM4DxlWXU= github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4= github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/generative-ai-go v0.20.1 h1:6dEIujpgN2V0PgLhr6c/M1ynRdc7ARtiIDPFzj45uNQ= github.com/google/generative-ai-go v0.20.1/go.mod h1:TjOnZJmZKzarWbjUJgy+r3Ee7HGBRVLhOIgupnwR4Bg= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/s2a-go v0.1.9 h1:LGD7gtMgezd8a/Xak7mEWL0PjoTQFvpRudN895yqKW0= github.com/google/s2a-go v0.1.9/go.mod h1:YA0Ei2ZQL3acow2O62kdp9UlnvMmU7kA6Eutn0dXayM= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.3.7 h1:zrn2Ee/nWmHulBx5sAVrGgAa0f2/R35S4DJwfFaUPFQ= github.com/googleapis/enterprise-certificate-proxy v0.3.7/go.mod h1:MkHOF77EYAE7qfSuSS9PU6g4Nt4e11cnsDUowfwewLA= github.com/googleapis/gax-go/v2 v2.15.0 h1:SyjDc1mGgZU5LncH8gimWo9lW1DtIfPibOG81vgd/bo= github.com/googleapis/gax-go/v2 v2.15.0/go.mod h1:zVVkkxAQHa1RQpg9z2AUCMnKhi0Qld9rcmyfL1OZhoc= github.com/gorilla/schema v1.4.1 h1:jUg5hUjCSDZpNGLuXQOgIWGdlgrIdYvgQ0wZtdK1M3E= github.com/gorilla/schema v1.4.1/go.mod h1:Dg5SSm5PV60mhF2NFaTV1xuYYj8tV8NOPRo4FggUMnM= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/lucasb-eyer/go-colorful v1.3.0 h1:2/yBRLdWBZKrf7gB40FoiKfAWYQ0lqNcbuQwVHXptag= github.com/lucasb-eyer/go-colorful v1.3.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4= github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88= github.com/mattn/go-runewidth v0.0.19 h1:v++JhqYnZuu5jSKrk9RbgF5v4CGUjqRfBm05byFGLdw= github.com/mattn/go-runewidth v0.0.19/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4= github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE= github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI= github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo= github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc= github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk= github.com/openai/openai-go v1.12.0 h1:NBQCnXzqOTv5wsgNC36PrFEiskGfO5wccfCWDo9S1U0= github.com/openai/openai-go v1.12.0/go.mod h1:g461MYGXEXBVdV5SaR/5tNzNbSfwTBBefwc+LlDCK0Y= github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo= github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY= github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/match v1.2.0 h1:0pt8FlkOwjN2fPt4bIl4BoNxb98gGHN2ObFEDkrfZnM= github.com/tidwall/match v1.2.0/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 h1:q4XOmH/0opmeuJtPsbFNivyl7bCt7yRBbeEm2sC/XtQ= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0/go.mod h1:snMWehoOh2wsEwnvvwtDyFCxVeDAODenXHtn5vzrKjo= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 h1:RbKq8BG0FI8OiXhBfcRtqqHcZcka+gU3cskNuf05R18= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0/go.mod h1:h06DGIukJOevXaj/xrNjhi/2098RZzcLTbc0jDAUbsg= go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8= go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM= go.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA= go.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI= go.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E= go.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg= go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM= go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA= go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE= go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs= golang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU= golang.org/x/crypto v0.46.0/go.mod h1:Evb/oLKmMraqjZ2iQTwDwvCtJkczlDuTmdJXoZVzqU0= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU= golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY= golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw= golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4= golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk= golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU= golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY= golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= google.golang.org/api v0.258.0 h1:IKo1j5FBlN74fe5isA2PVozN3Y5pwNKriEgAXPOkDAc= google.golang.org/api v0.258.0/go.mod h1:qhOMTQEZ6lUps63ZNq9jhODswwjkjYYguA7fA3TBFww= google.golang.org/genproto v0.0.0-20250603155806-513f23925822 h1:rHWScKit0gvAPuOnu87KpaYtjK5zBMLcULh7gxkCXu4= google.golang.org/genproto v0.0.0-20250603155806-513f23925822/go.mod h1:HubltRL7rMh0LfnQPkMH4NPDFEWp0jw3vixw7jEM53s= google.golang.org/genproto/googleapis/api v0.0.0-20251022142026-3a174f9686a8 h1:mepRgnBZa07I4TRuomDE4sTIYieg/osKmzIf4USdWS4= google.golang.org/genproto/googleapis/api v0.0.0-20251022142026-3a174f9686a8/go.mod h1:fDMmzKV90WSg1NbozdqrE64fkuTv6mlq2zxo9ad+3yo= google.golang.org/genproto/googleapis/rpc v0.0.0-20251213004720-97cd9d5aeac2 h1:2I6GHUeJ/4shcDpoUlLs/2WPnhg7yJwvXtqcMJt9liA= google.golang.org/genproto/googleapis/rpc v0.0.0-20251213004720-97cd9d5aeac2/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk= google.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM= google.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig= google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= ================================================ FILE: groq.go ================================================ package main import ( "errors" "fmt" "os" "github.com/deepakjois/groq" ) type GroqCmd struct { File string `arg:"" help:"Audio file to transcribe"` Output string `help:"Path to output transcript file (default: stdout)" short:"o"` APIKey string `env:"GROQ_API_KEY" default:"" hidden:""` } func (g *GroqCmd) Run() error { if g.APIKey == "" { return errors.New("API key not found. Please run 'podscript configure' or set the GROQ_API_KEY environment variable") } file, err := os.Open(g.File) if err != nil { return fmt.Errorf("error opening file: %w", err) } defer file.Close() client := groq.NewClient(groq.WithAPIKey(g.APIKey)) response, err := client.CreateTranscription(groq.TranscriptionCreateParams{ File: file, Model: "whisper-large-v3", }) if err != nil { return fmt.Errorf("transcription failed: %w", err) } if g.Output != "" { if err = os.WriteFile(g.Output, []byte(response.Text), 0644); err != nil { return fmt.Errorf("failed to write transcript: %w", err) } } else { fmt.Println(response.Text) } return nil } ================================================ FILE: hooks/pre-commit ================================================ #!/bin/bash set -euo pipefail # Check if there are changes in web/frontend if git diff --cached --quiet web/frontend/; then exit 0 fi echo "Frontend changes detected. Running lint checks..." CURRENT_DIR=$(pwd) # Navigate to frontend dir and run lint cd web/frontend if ! npm run lint; then echo "❌ Frontend lint check failed. Please fix the errors before committing." cd "$CURRENT_DIR" exit 1 fi echo "✅ Frontend lint check passed. Building and copying dist..." # Run build npm run build cd "$CURRENT_DIR" # Stage the new dist files that were outputted by vite git add dist/ echo "All frontend checks passed and dist files updated!" exit 0 ================================================ FILE: llms.go ================================================ package main import ( "context" "encoding/json" "errors" "fmt" "github.com/anthropics/anthropic-sdk-go" anthropicoption "github.com/anthropics/anthropic-sdk-go/option" "github.com/openai/openai-go" openoption "github.com/openai/openai-go/option" "github.com/deepakjois/groq" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/credentials" "github.com/aws/aws-sdk-go-v2/service/bedrockruntime" "github.com/aws/aws-sdk-go-v2/service/bedrockruntime/types" "github.com/google/generative-ai-go/genai" "google.golang.org/api/iterator" "google.golang.org/api/option" ) type LLMProvider string const ( OpenAI LLMProvider = "openai" Claude LLMProvider = "claude" Groq LLMProvider = "groq" Gemini LLMProvider = "gemini" Bedrock LLMProvider = "bedrock" ) type LLMModel string const ( GPT4o LLMModel = "gpt-4o" GPT4oMini LLMModel = "gpt-4o-mini" Claude37Sonnet LLMModel = "claude-3-7-sonnet-20250219" Claude35Haiku LLMModel = "claude-3-5-haiku-20241022" Llama3370b LLMModel = "llama-3.3-70b-versatile" Llama318b LLMModel = "llama-3.1-8b-instant" // Gemini models Gemini2Flash LLMModel = "gemini-2.0-flash" // Bedrock models BedrockClaude35Haiku LLMModel = "anthropic.claude-3-5-haiku-20241022-v1:0" BedrockClaude37Sonnet LLMModel = "anthropic.claude-3-7-sonnet-20250219-v1:0" ) // output token limits for each model var modelTokenLimits = map[LLMModel]int{ GPT4o: 16384, GPT4oMini: 16384, Claude37Sonnet: 8192, Claude35Haiku: 8192, Llama3370b: 32768, Llama318b: 8192, Gemini2Flash: 8192, BedrockClaude37Sonnet: 4096, BedrockClaude35Haiku: 4096, } // CompletionRequest represents a generic completion request type CompletionRequest struct { SystemPrompt string UserPrompt string Model LLMModel } // CompletionChunk represents a piece of streamed response type CompletionChunk struct { Text string Provider LLMProvider Done bool // Indicates if this is the last chunk } // CompletionResponse represents a complete response (for non-streaming requests) type CompletionResponse struct { Text string Provider LLMProvider } // LLMClient interface defines the common contract for all LLM providers type LLMClient interface { Complete(ctx context.Context, req CompletionRequest) (*CompletionResponse, error) CompleteStream(ctx context.Context, req CompletionRequest) (<-chan CompletionChunk, <-chan error) } func NewLLMClient(provider LLMProvider, config Config) (LLMClient, error) { switch provider { case OpenAI: return NewOpenAIClient(config.OpenAIAPIKey), nil case Claude: return NewClaudeClient(config.AnthropicAPIKey), nil case Groq: return NewGroqClient(config.GroqAPIKey), nil case Gemini: return NewGeminiClient(config.GeminiAPIKey), nil case Bedrock: return NewBedrockClient(config.AWSRegion, config.AWSAccessKeyID, config.AWSSecretAccessKey, config.AWSSessionToken) default: return nil, fmt.Errorf("unsupported provider: %s", provider) } } type OpenAIClient struct { client openai.Client } func NewOpenAIClient(apiKey string) *OpenAIClient { return &OpenAIClient{ client: openai.NewClient(openoption.WithAPIKey(apiKey)), } } func (c *OpenAIClient) Complete(ctx context.Context, req CompletionRequest) (*CompletionResponse, error) { resp, err := c.client.Chat.Completions.New( ctx, openai.ChatCompletionNewParams{ Model: openai.ChatModel(string(req.Model)), Messages: []openai.ChatCompletionMessageParamUnion{ openai.SystemMessage(req.SystemPrompt), openai.UserMessage(req.UserPrompt), }, }, ) if err != nil { return nil, err } return &CompletionResponse{ Text: resp.Choices[0].Message.Content, Provider: OpenAI, }, nil } func (c *OpenAIClient) CompleteStream(ctx context.Context, req CompletionRequest) (<-chan CompletionChunk, <-chan error) { chunkChan := make(chan CompletionChunk) errChan := make(chan error, 1) go func() { defer close(chunkChan) defer close(errChan) stream := c.client.Chat.Completions.NewStreaming( ctx, openai.ChatCompletionNewParams{ Model: openai.ChatModel(string(req.Model)), Messages: []openai.ChatCompletionMessageParamUnion{ openai.SystemMessage(req.SystemPrompt), openai.UserMessage(req.UserPrompt), }, }, ) for stream.Next() { chunk := stream.Current() if len(chunk.Choices) > 0 { chunkChan <- CompletionChunk{ Text: chunk.Choices[0].Delta.Content, Provider: OpenAI, Done: false, } } } if err := stream.Err(); err != nil { errChan <- err return } // Send final done chunk chunkChan <- CompletionChunk{ Done: true, } }() return chunkChan, errChan } type GeminiClient struct { client *genai.Client model *genai.GenerativeModel } func NewGeminiClient(apiKey string) *GeminiClient { ctx := context.Background() client, err := genai.NewClient(ctx, option.WithAPIKey(apiKey)) if err != nil { panic(fmt.Sprintf("failed to create Gemini client: %v", err)) } model := client.GenerativeModel("gemini-2.0-flash") return &GeminiClient{ client: client, model: model, } } func (c *GeminiClient) Complete(ctx context.Context, req CompletionRequest) (*CompletionResponse, error) { prompt := req.UserPrompt if req.SystemPrompt != "" { prompt = req.SystemPrompt + "\n\n" + req.UserPrompt } resp, err := c.model.GenerateContent(ctx, genai.Text(prompt)) if err != nil { return nil, fmt.Errorf("failed to generate content: %w", err) } if len(resp.Candidates) == 0 || len(resp.Candidates[0].Content.Parts) == 0 { return nil, fmt.Errorf("no content in response") } return &CompletionResponse{ Text: fmt.Sprint(resp.Candidates[0].Content.Parts[0]), Provider: Gemini, }, nil } func (c *GeminiClient) CompleteStream(ctx context.Context, req CompletionRequest) (<-chan CompletionChunk, <-chan error) { chunkChan := make(chan CompletionChunk) errChan := make(chan error, 1) go func() { defer close(chunkChan) defer close(errChan) prompt := req.UserPrompt if req.SystemPrompt != "" { prompt = req.SystemPrompt + "\n\n" + req.UserPrompt } iter := c.model.GenerateContentStream(ctx, genai.Text(prompt)) for { resp, err := iter.Next() if err != nil { if errors.Is(err, iterator.Done) { break } errChan <- fmt.Errorf("stream error: %w", err) return } if len(resp.Candidates) > 0 && len(resp.Candidates[0].Content.Parts) > 0 { chunkChan <- CompletionChunk{ Text: fmt.Sprint(resp.Candidates[0].Content.Parts[0]), Provider: Gemini, Done: false, } } } // Send final done chunk chunkChan <- CompletionChunk{ Done: true, } }() return chunkChan, errChan } type ClaudeClient struct { client anthropic.Client } func NewClaudeClient(apiKey string) *ClaudeClient { return &ClaudeClient{ client: anthropic.NewClient(anthropicoption.WithAPIKey(apiKey)), } } func (c *ClaudeClient) Complete(ctx context.Context, req CompletionRequest) (*CompletionResponse, error) { params := anthropic.MessageNewParams{ Model: anthropic.Model(string(req.Model)), MaxTokens: int64(modelTokenLimits[req.Model]), Messages: []anthropic.MessageParam{ anthropic.NewUserMessage(anthropic.NewTextBlock(req.UserPrompt)), }, } if req.SystemPrompt != "" { params.System = []anthropic.TextBlockParam{ {Text: req.SystemPrompt}, } } resp, err := c.client.Messages.New(ctx, params) if err != nil { return nil, err } return &CompletionResponse{ Text: resp.Content[0].Text, Provider: Claude, }, nil } func (c *ClaudeClient) CompleteStream(ctx context.Context, req CompletionRequest) (<-chan CompletionChunk, <-chan error) { chunkChan := make(chan CompletionChunk) errChan := make(chan error, 1) go func() { defer close(chunkChan) defer close(errChan) params := anthropic.MessageNewParams{ Model: anthropic.Model(string(req.Model)), MaxTokens: int64(modelTokenLimits[req.Model]), Messages: []anthropic.MessageParam{ anthropic.NewUserMessage(anthropic.NewTextBlock(req.UserPrompt)), }, } if req.SystemPrompt != "" { params.System = []anthropic.TextBlockParam{ {Text: req.SystemPrompt}, } } stream := c.client.Messages.NewStreaming(ctx, params) message := anthropic.Message{} for stream.Next() { event := stream.Current() message.Accumulate(event) if event.Delta.Type == "content_block_delta" && event.Delta.Text != "" { chunkChan <- CompletionChunk{ Text: event.Delta.Text, Provider: Claude, Done: false, } } } if err := stream.Err(); err != nil { errChan <- err return } // Send final done chunk chunkChan <- CompletionChunk{ Done: true, } }() return chunkChan, errChan } type GroqClient struct { client *groq.Client } func NewGroqClient(apiKey string) *GroqClient { return &GroqClient{ client: groq.NewClient(groq.WithAPIKey(apiKey)), } } func (c *GroqClient) Complete(ctx context.Context, req CompletionRequest) (*CompletionResponse, error) { resp, err := c.client.CreateChatCompletion(groq.CompletionCreateParams{ Model: string(req.Model), Messages: []groq.Message{ {Role: "system", Content: req.SystemPrompt}, {Role: "user", Content: req.UserPrompt}, }, Stream: false, }) if err != nil { return nil, err } return &CompletionResponse{ Text: resp.Choices[0].Message.Content, Provider: Groq, }, nil } func (c *GroqClient) CompleteStream(ctx context.Context, req CompletionRequest) (<-chan CompletionChunk, <-chan error) { chunkChan := make(chan CompletionChunk) errChan := make(chan error, 1) go func() { defer close(chunkChan) defer close(errChan) resp, err := c.client.CreateChatCompletion(groq.CompletionCreateParams{ Model: string(req.Model), Messages: []groq.Message{ {Role: "system", Content: req.SystemPrompt}, {Role: "user", Content: req.UserPrompt}, }, Stream: true, }) if err != nil { errChan <- err return } for chunk := range resp.Stream { if len(chunk.Choices) > 0 { chunkChan <- CompletionChunk{ Text: chunk.Choices[0].Delta.Content, Provider: Groq, Done: false, } } } // Send final done chunk chunkChan <- CompletionChunk{ Done: true, } }() return chunkChan, errChan } type BedrockClient struct { client *bedrockruntime.Client temperature float32 } func NewBedrockClient(region, accessKeyID, secretAccessKey string, sessionToken string) (*BedrockClient, error) { cfg, err := config.LoadDefaultConfig(context.Background(), config.WithRegion(region), config.WithCredentialsProvider(credentials.NewStaticCredentialsProvider( accessKeyID, secretAccessKey, sessionToken, )), ) if err != nil { return nil, fmt.Errorf("failed to load AWS config: %w", err) } client := bedrockruntime.NewFromConfig(cfg) return &BedrockClient{ client: client, temperature: 0, }, nil } func (c *BedrockClient) buildRequest(req CompletionRequest) BedrockCompletionRequest { return BedrockCompletionRequest{ AnthropicVersion: BedrockAnthropicVersion, MaxTokens: modelTokenLimits[req.Model], Temperature: c.temperature, System: req.SystemPrompt, Messages: []BedrockMessage{ { Role: "user", Content: []BedrockMessageBlock{ { Type: "text", Text: req.UserPrompt, }, }, }, }, } } func (c *BedrockClient) invokeModel(ctx context.Context, modelID string, body []byte) (*bedrockruntime.InvokeModelOutput, error) { return c.client.InvokeModel(ctx, &bedrockruntime.InvokeModelInput{ ModelId: aws.String(modelID), ContentType: aws.String(BedrockContentType), Body: body, }) } func (c *BedrockClient) invokeModelStream(ctx context.Context, modelID string, body []byte) (*bedrockruntime.InvokeModelWithResponseStreamOutput, error) { return c.client.InvokeModelWithResponseStream(ctx, &bedrockruntime.InvokeModelWithResponseStreamInput{ ModelId: aws.String(modelID), ContentType: aws.String(BedrockContentType), Body: body, }) } func (c *BedrockClient) Complete(ctx context.Context, req CompletionRequest) (*CompletionResponse, error) { bedrockReq := c.buildRequest(req) body, err := json.Marshal(bedrockReq) if err != nil { return nil, fmt.Errorf("failed to marshal request: %w", err) } output, err := c.invokeModel(ctx, string(req.Model), body) if err != nil { return nil, fmt.Errorf("failed to invoke model: %w", err) } var response BedrockCompletionResponse if err := json.Unmarshal(output.Body, &response); err != nil { return nil, fmt.Errorf("failed to unmarshal response: %w", err) } return &CompletionResponse{ Text: response.Content[0].Text, Provider: Bedrock, }, nil } func (c *BedrockClient) CompleteStream(ctx context.Context, req CompletionRequest) (<-chan CompletionChunk, <-chan error) { chunkChan := make(chan CompletionChunk) errChan := make(chan error, 1) go func() { defer close(chunkChan) defer close(errChan) bedrockReq := c.buildRequest(req) body, err := json.Marshal(bedrockReq) if err != nil { errChan <- fmt.Errorf("failed to marshal request: %w", err) return } output, err := c.invokeModelStream(ctx, string(req.Model), body) if err != nil { errChan <- fmt.Errorf("failed to invoke model: %w", err) return } for event := range output.GetStream().Events() { switch v := event.(type) { case *types.ResponseStreamMemberChunk: var output BedrockStreamCompletionResponse if err := json.Unmarshal(v.Value.Bytes, &output); err != nil { errChan <- fmt.Errorf("failed to decode chunk: %w", err) return } if output.Type == "content_block_delta" && output.Delta.Text != "" { chunkChan <- CompletionChunk{ Text: output.Delta.Text, Provider: Bedrock, Done: false, } } case *types.UnknownUnionMember: errChan <- fmt.Errorf("unknown response stream event: %s", v.Tag) return default: if event == nil { errChan <- fmt.Errorf("received nil event") return } errChan <- fmt.Errorf("received unknown event type: %T", event) return } } // Send final done chunk chunkChan <- CompletionChunk{ Done: true, } }() return chunkChan, errChan } ================================================ FILE: main.go ================================================ package main import ( "fmt" "os" "github.com/alecthomas/kong" ) var cli struct { Configure ConfigureCmd `cmd:"" help:"Configure podscript with API keys"` YTT YTTCmd `cmd:"" help:"Transcribe YouTube videos from autogenerated captions"` Deepgram DeepgramCmd `cmd:"" help:"Transcribe audio using Deepgram API"` AssemblyAI AssemblyAICmd `cmd:"" help:"Transcribe audio using AssemblyAI"` Groq GroqCmd `cmd:"" help:"Transcribe audio using Groq's Whisper API"` Web WebCmd `cmd:"" help:"Run web based UI server locally"` } func main() { ctx := kong.Parse(&cli, kong.Configuration(ConfLoader, "~/.podscript.toml")) err := ctx.Run() if err != nil { fmt.Fprintf(os.Stderr, "%s\n", err) os.Exit(1) } } ================================================ FILE: renovate.json ================================================ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ "config:recommended" ] } ================================================ FILE: types.go ================================================ package main const ( BedrockAnthropicVersion = "bedrock-2023-05-31" BedrockContentType = "application/json" ) type BedrockMetrics struct { InvocationMetrics struct { InputTokenCount int `json:"inputTokenCount"` OutputTokenCount int `json:"outputTokenCount"` } `json:"invocationMetrics"` } type BedrockMessageBlock struct { Type string `json:"type"` Text string `json:"text"` } type BedrockMessage struct { Role string `json:"role"` Content []BedrockMessageBlock `json:"content"` } type BedrockCompletionRequest struct { AnthropicVersion string `json:"anthropic_version"` MaxTokens int `json:"max_tokens"` Temperature float32 `json:"temperature"` System string `json:"system,omitempty"` Messages []BedrockMessage `json:"messages"` } type BedrockCompletionResponse struct { Content []struct { Text string `json:"text"` } `json:"content"` StopReason string `json:"stop_reason"` Model string `json:"model"` Metrics *BedrockMetrics `json:"amazon-bedrock-invocationMetrics"` } type BedrockStreamCompletionResponse struct { Type string `json:"type"` Index int `json:"index"` Delta struct { Type string `json:"type"` Text string `json:"text"` } `json:"delta"` } type BedrockConfig struct { Region string AccessKeyID string SecretKey string SessionToken string Temperature float32 DefaultSystem string } ================================================ FILE: web/Caddyfile ================================================ # Caddyfile for podscript web server development. # # For the backend server, we proxy requests to the Go backend server running on port 5170. # # For the frontend app, we proxy to the Vite dev server running on port 5173. # # To run the web server, do the following: # # - npm run dev in the frontend directory # - podscript web --dev in the backend directory # - caddy run # # Then you can access the web server at http://localhost:8080 :8080 { # Define a path matcher for the backend API routes @paths { path_regexp ^/(settings|models.*|audio|ytt)$ } # Handle all backend API routes - proxy to Go backend server handle @paths { reverse_proxy localhost:5170 } # Handle all other routes - proxy to Vite dev server handle { reverse_proxy localhost:5173 } } ================================================ FILE: web/frontend/.gitignore ================================================ # Logs logs *.log npm-debug.log* yarn-debug.log* yarn-error.log* pnpm-debug.log* lerna-debug.log* node_modules ./dist dist-ssr *.local # Editor directories and files .vscode/* !.vscode/extensions.json .idea .DS_Store *.suo *.ntvs* *.njsproj *.sln *.sw? ================================================ FILE: web/frontend/.prettierignore ================================================ dist node_modules build coverage src/components/ui/** .vite ================================================ FILE: web/frontend/.prettierrc ================================================ { "semi": false, "singleQuote": true, "trailingComma": "all", "tabWidth": 2, "printWidth": 100, "bracketSpacing": true, "arrowParens": "avoid", "endOfLine": "lf", "jsxSingleQuote": false, "bracketSameLine": false, "plugins": ["prettier-plugin-tailwindcss"] } ================================================ FILE: web/frontend/README.md ================================================ # React + TypeScript + Vite This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. Currently, two official plugins are available: - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh ## Expanding the ESLint configuration If you are developing a production application, we recommend updating the configuration to enable type aware lint rules: - Configure the top-level `parserOptions` property like this: ```js export default tseslint.config({ languageOptions: { // other options... parserOptions: { project: ['./tsconfig.node.json', './tsconfig.app.json'], tsconfigRootDir: import.meta.dirname, }, }, }) ``` - Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked` - Optionally add `...tseslint.configs.stylisticTypeChecked` - Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config: ```js // eslint.config.js import react from 'eslint-plugin-react' export default tseslint.config({ // Set the react version settings: { react: { version: '18.3' } }, plugins: { // Add the react plugin react, }, rules: { // other rules... // Enable its recommended rules ...react.configs.recommended.rules, ...react.configs['jsx-runtime'].rules, }, }) ``` ================================================ FILE: web/frontend/components.json ================================================ { "$schema": "https://ui.shadcn.com/schema.json", "style": "new-york", "rsc": false, "tsx": true, "tailwind": { "config": "", "css": "src/index.css", "baseColor": "gray", "cssVariables": true, "prefix": "" }, "aliases": { "components": "@/components", "utils": "@/lib/utils", "ui": "@/components/ui", "lib": "@/lib", "hooks": "@/hooks" }, "iconLibrary": "lucide" } ================================================ FILE: web/frontend/dist/assets/index-BW_J7set.css ================================================ /*! tailwindcss v4.0.0 | MIT License | https://tailwindcss.com */@layer theme{:root{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-serif:ui-serif,Georgia,Cambria,"Times New Roman",Times,serif;--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(.971 .013 17.38);--color-red-100:oklch(.936 .032 17.717);--color-red-200:oklch(.885 .062 18.334);--color-red-300:oklch(.808 .114 19.571);--color-red-400:oklch(.704 .191 22.216);--color-red-500:oklch(.637 .237 25.331);--color-red-600:oklch(.577 .245 27.325);--color-red-700:oklch(.505 .213 27.518);--color-red-800:oklch(.444 .177 26.899);--color-red-900:oklch(.396 .141 25.723);--color-red-950:oklch(.258 .092 26.042);--color-orange-50:oklch(.98 .016 73.684);--color-orange-100:oklch(.954 .038 75.164);--color-orange-200:oklch(.901 .076 70.697);--color-orange-300:oklch(.837 .128 66.29);--color-orange-400:oklch(.75 .183 55.934);--color-orange-500:oklch(.705 .213 47.604);--color-orange-600:oklch(.646 .222 41.116);--color-orange-700:oklch(.553 .195 38.402);--color-orange-800:oklch(.47 .157 37.304);--color-orange-900:oklch(.408 .123 38.172);--color-orange-950:oklch(.266 .079 36.259);--color-amber-50:oklch(.987 .022 95.277);--color-amber-100:oklch(.962 .059 95.617);--color-amber-200:oklch(.924 .12 95.746);--color-amber-300:oklch(.879 .169 91.605);--color-amber-400:oklch(.828 .189 84.429);--color-amber-500:oklch(.769 .188 70.08);--color-amber-600:oklch(.666 .179 58.318);--color-amber-700:oklch(.555 .163 48.998);--color-amber-800:oklch(.473 .137 46.201);--color-amber-900:oklch(.414 .112 45.904);--color-amber-950:oklch(.279 .077 45.635);--color-yellow-50:oklch(.987 .026 102.212);--color-yellow-100:oklch(.973 .071 103.193);--color-yellow-200:oklch(.945 .129 101.54);--color-yellow-300:oklch(.905 .182 98.111);--color-yellow-400:oklch(.852 .199 91.936);--color-yellow-500:oklch(.795 .184 86.047);--color-yellow-600:oklch(.681 .162 75.834);--color-yellow-700:oklch(.554 .135 66.442);--color-yellow-800:oklch(.476 .114 61.907);--color-yellow-900:oklch(.421 .095 57.708);--color-yellow-950:oklch(.286 .066 53.813);--color-lime-50:oklch(.986 .031 120.757);--color-lime-100:oklch(.967 .067 122.328);--color-lime-200:oklch(.938 .127 124.321);--color-lime-300:oklch(.897 .196 126.665);--color-lime-400:oklch(.841 .238 128.85);--color-lime-500:oklch(.768 .233 130.85);--color-lime-600:oklch(.648 .2 131.684);--color-lime-700:oklch(.532 .157 131.589);--color-lime-800:oklch(.453 .124 130.933);--color-lime-900:oklch(.405 .101 131.063);--color-lime-950:oklch(.274 .072 132.109);--color-green-50:oklch(.982 .018 155.826);--color-green-100:oklch(.962 .044 156.743);--color-green-200:oklch(.925 .084 155.995);--color-green-300:oklch(.871 .15 154.449);--color-green-400:oklch(.792 .209 151.711);--color-green-500:oklch(.723 .219 149.579);--color-green-600:oklch(.627 .194 149.214);--color-green-700:oklch(.527 .154 150.069);--color-green-800:oklch(.448 .119 151.328);--color-green-900:oklch(.393 .095 152.535);--color-green-950:oklch(.266 .065 152.934);--color-emerald-50:oklch(.979 .021 166.113);--color-emerald-100:oklch(.95 .052 163.051);--color-emerald-200:oklch(.905 .093 164.15);--color-emerald-300:oklch(.845 .143 164.978);--color-emerald-400:oklch(.765 .177 163.223);--color-emerald-500:oklch(.696 .17 162.48);--color-emerald-600:oklch(.596 .145 163.225);--color-emerald-700:oklch(.508 .118 165.612);--color-emerald-800:oklch(.432 .095 166.913);--color-emerald-900:oklch(.378 .077 168.94);--color-emerald-950:oklch(.262 .051 172.552);--color-teal-50:oklch(.984 .014 180.72);--color-teal-100:oklch(.953 .051 180.801);--color-teal-200:oklch(.91 .096 180.426);--color-teal-300:oklch(.855 .138 181.071);--color-teal-400:oklch(.777 .152 181.912);--color-teal-500:oklch(.704 .14 182.503);--color-teal-600:oklch(.6 .118 184.704);--color-teal-700:oklch(.511 .096 186.391);--color-teal-800:oklch(.437 .078 188.216);--color-teal-900:oklch(.386 .063 188.416);--color-teal-950:oklch(.277 .046 192.524);--color-cyan-50:oklch(.984 .019 200.873);--color-cyan-100:oklch(.956 .045 203.388);--color-cyan-200:oklch(.917 .08 205.041);--color-cyan-300:oklch(.865 .127 207.078);--color-cyan-400:oklch(.789 .154 211.53);--color-cyan-500:oklch(.715 .143 215.221);--color-cyan-600:oklch(.609 .126 221.723);--color-cyan-700:oklch(.52 .105 223.128);--color-cyan-800:oklch(.45 .085 224.283);--color-cyan-900:oklch(.398 .07 227.392);--color-cyan-950:oklch(.302 .056 229.695);--color-sky-50:oklch(.977 .013 236.62);--color-sky-100:oklch(.951 .026 236.824);--color-sky-200:oklch(.901 .058 230.902);--color-sky-300:oklch(.828 .111 230.318);--color-sky-400:oklch(.746 .16 232.661);--color-sky-500:oklch(.685 .169 237.323);--color-sky-600:oklch(.588 .158 241.966);--color-sky-700:oklch(.5 .134 242.749);--color-sky-800:oklch(.443 .11 240.79);--color-sky-900:oklch(.391 .09 240.876);--color-sky-950:oklch(.293 .066 243.157);--color-blue-50:oklch(.97 .014 254.604);--color-blue-100:oklch(.932 .032 255.585);--color-blue-200:oklch(.882 .059 254.128);--color-blue-300:oklch(.809 .105 251.813);--color-blue-400:oklch(.707 .165 254.624);--color-blue-500:oklch(.623 .214 259.815);--color-blue-600:oklch(.546 .245 262.881);--color-blue-700:oklch(.488 .243 264.376);--color-blue-800:oklch(.424 .199 265.638);--color-blue-900:oklch(.379 .146 265.522);--color-blue-950:oklch(.282 .091 267.935);--color-indigo-50:oklch(.962 .018 272.314);--color-indigo-100:oklch(.93 .034 272.788);--color-indigo-200:oklch(.87 .065 274.039);--color-indigo-300:oklch(.785 .115 274.713);--color-indigo-400:oklch(.673 .182 276.935);--color-indigo-500:oklch(.585 .233 277.117);--color-indigo-600:oklch(.511 .262 276.966);--color-indigo-700:oklch(.457 .24 277.023);--color-indigo-800:oklch(.398 .195 277.366);--color-indigo-900:oklch(.359 .144 278.697);--color-indigo-950:oklch(.257 .09 281.288);--color-violet-50:oklch(.969 .016 293.756);--color-violet-100:oklch(.943 .029 294.588);--color-violet-200:oklch(.894 .057 293.283);--color-violet-300:oklch(.811 .111 293.571);--color-violet-400:oklch(.702 .183 293.541);--color-violet-500:oklch(.606 .25 292.717);--color-violet-600:oklch(.541 .281 293.009);--color-violet-700:oklch(.491 .27 292.581);--color-violet-800:oklch(.432 .232 292.759);--color-violet-900:oklch(.38 .189 293.745);--color-violet-950:oklch(.283 .141 291.089);--color-purple-50:oklch(.977 .014 308.299);--color-purple-100:oklch(.946 .033 307.174);--color-purple-200:oklch(.902 .063 306.703);--color-purple-300:oklch(.827 .119 306.383);--color-purple-400:oklch(.714 .203 305.504);--color-purple-500:oklch(.627 .265 303.9);--color-purple-600:oklch(.558 .288 302.321);--color-purple-700:oklch(.496 .265 301.924);--color-purple-800:oklch(.438 .218 303.724);--color-purple-900:oklch(.381 .176 304.987);--color-purple-950:oklch(.291 .149 302.717);--color-fuchsia-50:oklch(.977 .017 320.058);--color-fuchsia-100:oklch(.952 .037 318.852);--color-fuchsia-200:oklch(.903 .076 319.62);--color-fuchsia-300:oklch(.833 .145 321.434);--color-fuchsia-400:oklch(.74 .238 322.16);--color-fuchsia-500:oklch(.667 .295 322.15);--color-fuchsia-600:oklch(.591 .293 322.896);--color-fuchsia-700:oklch(.518 .253 323.949);--color-fuchsia-800:oklch(.452 .211 324.591);--color-fuchsia-900:oklch(.401 .17 325.612);--color-fuchsia-950:oklch(.293 .136 325.661);--color-pink-50:oklch(.971 .014 343.198);--color-pink-100:oklch(.948 .028 342.258);--color-pink-200:oklch(.899 .061 343.231);--color-pink-300:oklch(.823 .12 346.018);--color-pink-400:oklch(.718 .202 349.761);--color-pink-500:oklch(.656 .241 354.308);--color-pink-600:oklch(.592 .249 .584);--color-pink-700:oklch(.525 .223 3.958);--color-pink-800:oklch(.459 .187 3.815);--color-pink-900:oklch(.408 .153 2.432);--color-pink-950:oklch(.284 .109 3.907);--color-rose-50:oklch(.969 .015 12.422);--color-rose-100:oklch(.941 .03 12.58);--color-rose-200:oklch(.892 .058 10.001);--color-rose-300:oklch(.81 .117 11.638);--color-rose-400:oklch(.712 .194 13.428);--color-rose-500:oklch(.645 .246 16.439);--color-rose-600:oklch(.586 .253 17.585);--color-rose-700:oklch(.514 .222 16.935);--color-rose-800:oklch(.455 .188 13.697);--color-rose-900:oklch(.41 .159 10.272);--color-rose-950:oklch(.271 .105 12.094);--color-slate-50:oklch(.984 .003 247.858);--color-slate-100:oklch(.968 .007 247.896);--color-slate-200:oklch(.929 .013 255.508);--color-slate-300:oklch(.869 .022 252.894);--color-slate-400:oklch(.704 .04 256.788);--color-slate-500:oklch(.554 .046 257.417);--color-slate-600:oklch(.446 .043 257.281);--color-slate-700:oklch(.372 .044 257.287);--color-slate-800:oklch(.279 .041 260.031);--color-slate-900:oklch(.208 .042 265.755);--color-slate-950:oklch(.129 .042 264.695);--color-gray-50:oklch(.985 .002 247.839);--color-gray-100:oklch(.967 .003 264.542);--color-gray-200:oklch(.928 .006 264.531);--color-gray-300:oklch(.872 .01 258.338);--color-gray-400:oklch(.707 .022 261.325);--color-gray-500:oklch(.551 .027 264.364);--color-gray-600:oklch(.446 .03 256.802);--color-gray-700:oklch(.373 .034 259.733);--color-gray-800:oklch(.278 .033 256.848);--color-gray-900:oklch(.21 .034 264.665);--color-gray-950:oklch(.13 .028 261.692);--color-zinc-50:oklch(.985 0 0);--color-zinc-100:oklch(.967 .001 286.375);--color-zinc-200:oklch(.92 .004 286.32);--color-zinc-300:oklch(.871 .006 286.286);--color-zinc-400:oklch(.705 .015 286.067);--color-zinc-500:oklch(.552 .016 285.938);--color-zinc-600:oklch(.442 .017 285.786);--color-zinc-700:oklch(.37 .013 285.805);--color-zinc-800:oklch(.274 .006 286.033);--color-zinc-900:oklch(.21 .006 285.885);--color-zinc-950:oklch(.141 .005 285.823);--color-neutral-50:oklch(.985 0 0);--color-neutral-100:oklch(.97 0 0);--color-neutral-200:oklch(.922 0 0);--color-neutral-300:oklch(.87 0 0);--color-neutral-400:oklch(.708 0 0);--color-neutral-500:oklch(.556 0 0);--color-neutral-600:oklch(.439 0 0);--color-neutral-700:oklch(.371 0 0);--color-neutral-800:oklch(.269 0 0);--color-neutral-900:oklch(.205 0 0);--color-neutral-950:oklch(.145 0 0);--color-stone-50:oklch(.985 .001 106.423);--color-stone-100:oklch(.97 .001 106.424);--color-stone-200:oklch(.923 .003 48.717);--color-stone-300:oklch(.869 .005 56.366);--color-stone-400:oklch(.709 .01 56.259);--color-stone-500:oklch(.553 .013 58.071);--color-stone-600:oklch(.444 .011 73.639);--color-stone-700:oklch(.374 .01 67.558);--color-stone-800:oklch(.268 .007 34.298);--color-stone-900:oklch(.216 .006 56.043);--color-stone-950:oklch(.147 .004 49.25);--color-black:#000;--color-white:#fff;--spacing:.25rem;--breakpoint-sm:40rem;--breakpoint-md:48rem;--breakpoint-lg:64rem;--breakpoint-xl:80rem;--breakpoint-2xl:96rem;--container-3xs:16rem;--container-2xs:18rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5/2.25);--text-5xl:3rem;--text-5xl--line-height:1;--text-6xl:3.75rem;--text-6xl--line-height:1;--text-7xl:4.5rem;--text-7xl--line-height:1;--text-8xl:6rem;--text-8xl--line-height:1;--text-9xl:8rem;--text-9xl--line-height:1;--font-weight-thin:100;--font-weight-extralight:200;--font-weight-light:300;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-extrabold:800;--font-weight-black:900;--tracking-tighter:-.05em;--tracking-tight:-.025em;--tracking-normal:0em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-normal:1.5;--leading-relaxed:1.625;--leading-loose:2;--radius-xs:.125rem;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--radius-3xl:1.5rem;--radius-4xl:2rem;--shadow-2xs:0 1px #0000000d;--shadow-xs:0 1px 2px 0 #0000000d;--shadow-sm:0 1px 3px 0 #0000001a,0 1px 2px -1px #0000001a;--shadow-md:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a;--shadow-lg:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a;--shadow-xl:0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a;--shadow-2xl:0 25px 50px -12px #00000040;--inset-shadow-2xs:inset 0 1px #0000000d;--inset-shadow-xs:inset 0 1px 1px #0000000d;--inset-shadow-sm:inset 0 2px 4px #0000000d;--drop-shadow-xs:0 1px 1px #0000000d;--drop-shadow-sm:0 1px 2px #00000026;--drop-shadow-md:0 3px 3px #0000001f;--drop-shadow-lg:0 4px 4px #00000026;--drop-shadow-xl:0 9px 7px #0000001a;--drop-shadow-2xl:0 25px 25px #00000026;--ease-in:cubic-bezier(.4,0,1,1);--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0,0,.2,1)infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--animate-bounce:bounce 1s infinite;--blur-xs:4px;--blur-sm:8px;--blur-md:12px;--blur-lg:16px;--blur-xl:24px;--blur-2xl:40px;--blur-3xl:64px;--perspective-dramatic:100px;--perspective-near:300px;--perspective-normal:500px;--perspective-midrange:800px;--perspective-distant:1200px;--aspect-video:16/9;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-font-feature-settings:var(--font-sans--font-feature-settings);--default-font-variation-settings:var(--font-sans--font-variation-settings);--default-mono-font-family:var(--font-mono);--default-mono-font-feature-settings:var(--font-mono--font-feature-settings);--default-mono-font-variation-settings:var(--font-mono--font-variation-settings)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}body{line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1;color:color-mix(in oklab,currentColor 50%,transparent)}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.collapse{visibility:collapse}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.-top-8{top:calc(var(--spacing)*-8)}.top-1\/2{top:50%}.-right-2{right:calc(var(--spacing)*-2)}.right-2{right:calc(var(--spacing)*2)}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing)*.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-8{margin-top:calc(var(--spacing)*8)}.mr-2{margin-right:calc(var(--spacing)*2)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.table{display:table}.h-5{height:calc(var(--spacing)*5)}.h-16{height:calc(var(--spacing)*16)}.w-1\/2{width:50%}.w-5{width:calc(var(--spacing)*5)}.w-full{width:100%}.max-w-3xl{max-width:var(--container-3xl)}.max-w-md{max-width:var(--container-md)}.shrink{flex-shrink:1}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.scale-3d{scale:var(--tw-scale-x)var(--tw-scale-y)var(--tw-scale-z)}.transform{transform:var(--tw-rotate-x)var(--tw-rotate-y)var(--tw-rotate-z)var(--tw-skew-x)var(--tw-skew-y)}.animate-spin{animation:var(--animate-spin)}.resize{resize:both}.columns-2{columns:2}.columns-3{columns:3}.columns-4{columns:4}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-x-1>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*1)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-800{background-color:var(--color-gray-800)}.bg-red-50{background-color:var(--color-red-50)}.bg-white{background-color:var(--color-white)}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-4{padding:calc(var(--spacing)*4)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-4{padding-inline:calc(var(--spacing)*4)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-4{padding-block:calc(var(--spacing)*4)}.pr-10{padding-right:calc(var(--spacing)*10)}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-5{--tw-leading:calc(var(--spacing)*5);line-height:calc(var(--spacing)*5)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.whitespace-pre-wrap{white-space:pre-wrap}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-gray-400{color:var(--color-gray-400)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-red-700{color:var(--color-red-700)}.text-white{color:var(--color-white)}.italic{font-style:italic}.underline{text-decoration-line:underline}.opacity-25{opacity:.25}.opacity-75{opacity:.75}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}@media (hover:hover){.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\:bg-white\/\[0\.12\]:hover{background-color:color-mix(in oklab,var(--color-white)12%,transparent)}.hover\:text-blue-800:hover{color:var(--color-blue-800)}.hover\:text-gray-600:hover{color:var(--color-gray-600)}.hover\:text-gray-800:hover{color:var(--color-gray-800)}}.disabled\:bg-blue-300:disabled{background-color:var(--color-blue-300)}.disabled\:opacity-50:disabled{opacity:.5}}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}}@keyframes bounce{0%,to{animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false;initial-value:rotateX(0)}@property --tw-rotate-y{syntax:"*";inherits:false;initial-value:rotateY(0)}@property --tw-rotate-z{syntax:"*";inherits:false;initial-value:rotateZ(0)}@property --tw-skew-x{syntax:"*";inherits:false;initial-value:skewX(0)}@property --tw-skew-y{syntax:"*";inherits:false;initial-value:skewY(0)}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false} ================================================ FILE: web/frontend/dist/assets/index-bX8PDyqL.js ================================================ (function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const h of document.querySelectorAll('link[rel="modulepreload"]'))d(h);new MutationObserver(h=>{for(const w of h)if(w.type==="childList")for(const x of w.addedNodes)x.tagName==="LINK"&&x.rel==="modulepreload"&&d(x)}).observe(document,{childList:!0,subtree:!0});function s(h){const w={};return h.integrity&&(w.integrity=h.integrity),h.referrerPolicy&&(w.referrerPolicy=h.referrerPolicy),h.crossOrigin==="use-credentials"?w.credentials="include":h.crossOrigin==="anonymous"?w.credentials="omit":w.credentials="same-origin",w}function d(h){if(h.ep)return;h.ep=!0;const w=s(h);fetch(h.href,w)}})();function Vd(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var Xo={exports:{}},Rr={},Zo={exports:{}},b={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var sc;function Bd(){if(sc)return b;sc=1;var o=Symbol.for("react.element"),a=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),w=Symbol.for("react.provider"),x=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),I=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),R=Symbol.iterator;function D(m){return m===null||typeof m!="object"?null:(m=R&&m[R]||m["@@iterator"],typeof m=="function"?m:null)}var z={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},V=Object.assign,G={};function Z(m,S,J){this.props=m,this.context=S,this.refs=G,this.updater=J||z}Z.prototype.isReactComponent={},Z.prototype.setState=function(m,S){if(typeof m!="object"&&typeof m!="function"&&m!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,m,S,"setState")},Z.prototype.forceUpdate=function(m){this.updater.enqueueForceUpdate(this,m,"forceUpdate")};function X(){}X.prototype=Z.prototype;function B(m,S,J){this.props=m,this.context=S,this.refs=G,this.updater=J||z}var ve=B.prototype=new X;ve.constructor=B,V(ve,Z.prototype),ve.isPureReactComponent=!0;var de=Array.isArray,ye=Object.prototype.hasOwnProperty,oe={current:null},Se={key:!0,ref:!0,__self:!0,__source:!0};function Re(m,S,J){var q,ee={},ne=null,se=null;if(S!=null)for(q in S.ref!==void 0&&(se=S.ref),S.key!==void 0&&(ne=""+S.key),S)ye.call(S,q)&&!Se.hasOwnProperty(q)&&(ee[q]=S[q]);var le=arguments.length-2;if(le===1)ee.children=J;else if(1 >>1,S=$[m];if(0 >>1;m h(ee,F))ne h(se,ee)?($[m]=se,$[ne]=F,m=ne):($[m]=ee,$[q]=F,m=q);else if(neh(se,F))$[m]=se,$[ne]=F,m=ne;else break e}}return K}function h($,K){var F=$.sortIndex-K.sortIndex;return F!==0?F:$.id-K.id}if(typeof performance=="object"&&typeof performance.now=="function"){var w=performance;o.unstable_now=function(){return w.now()}}else{var x=Date,N=x.now();o.unstable_now=function(){return x.now()-N}}var T=[],I=[],j=1,R=null,D=3,z=!1,V=!1,G=!1,Z=typeof setTimeout=="function"?setTimeout:null,X=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function ve($){for(var K=s(I);K!==null;){if(K.callback===null)d(I);else if(K.startTime<=$)d(I),K.sortIndex=K.expirationTime,a(T,K);else break;K=s(I)}}function de($){if(G=!1,ve($),!V)if(s(T)!==null)V=!0,Fe(ye);else{var K=s(I);K!==null&&pe(de,K.startTime-$)}}function ye($,K){V=!1,G&&(G=!1,X(Re),Re=-1),z=!0;var F=D;try{for(ve(K),R=s(T);R!==null&&(!(R.expirationTime>K)||$&&!Me());){var m=R.callback;if(typeof m=="function"){R.callback=null,D=R.priorityLevel;var S=m(R.expirationTime<=K);K=o.unstable_now(),typeof S=="function"?R.callback=S:R===s(T)&&d(T),ve(K)}else d(T);R=s(T)}if(R!==null)var J=!0;else{var q=s(I);q!==null&&pe(de,q.startTime-K),J=!1}return J}finally{R=null,D=F,z=!1}}var oe=!1,Se=null,Re=-1,Be=5,ie=-1;function Me(){return!(o.unstable_now()-ie$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Be=0<$?Math.floor(1e3/$):5},o.unstable_getCurrentPriorityLevel=function(){return D},o.unstable_getFirstCallbackNode=function(){return s(T)},o.unstable_next=function($){switch(D){case 1:case 2:case 3:var K=3;break;default:K=D}var F=D;D=K;try{return $()}finally{D=F}},o.unstable_pauseExecution=function(){},o.unstable_requestPaint=function(){},o.unstable_runWithPriority=function($,K){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var F=D;D=$;try{return K()}finally{D=F}},o.unstable_scheduleCallback=function($,K,F){var m=o.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0 m?($.sortIndex=F,a(I,$),s(T)===null&&$===s(I)&&(G?(X(Re),Re=-1):G=!0,pe(de,F-m))):($.sortIndex=S,a(T,$),V||z||(V=!0,Fe(ye))),$},o.unstable_shouldYield=Me,o.unstable_wrapCallback=function($){var K=D;return function(){var F=D;D=K;try{return $.apply(this,arguments)}finally{D=F}}}}(bo)),bo}var pc;function Yd(){return pc||(pc=1,qo.exports=Kd()),qo.exports}/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var mc;function Gd(){if(mc)return Ze;mc=1;var o=ai(),a=Yd();function s(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n "u"||typeof window.document>"u"||typeof window.document.createElement>"u"),T=Object.prototype.hasOwnProperty,I=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,j={},R={};function D(e){return T.call(R,e)?!0:T.call(j,e)?!1:I.test(e)?R[e]=!0:(j[e]=!0,!1)}function z(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function V(e,t,n,r){if(t===null||typeof t>"u"||z(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function G(e,t,n,r,l,u,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=u,this.removeEmptyString=i}var Z={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Z[e]=new G(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Z[t]=new G(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){Z[e]=new G(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Z[e]=new G(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Z[e]=new G(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){Z[e]=new G(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){Z[e]=new G(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){Z[e]=new G(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){Z[e]=new G(e,5,!1,e.toLowerCase(),null,!1,!1)});var X=/[\-:]([a-z])/g;function B(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(X,B);Z[t]=new G(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(X,B);Z[t]=new G(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(X,B);Z[t]=new G(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){Z[e]=new G(e,1,!1,e.toLowerCase(),null,!1,!1)}),Z.xlinkHref=new G("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){Z[e]=new G(e,1,!1,e.toLowerCase(),null,!0,!0)});function ve(e,t,n,r){var l=Z.hasOwnProperty(t)?Z[t]:null;(l!==null?l.type!==0:r||!(2 c||l[i]!==u[c]){var f=` `+l[i].replace(" at new "," at ");return e.displayName&&f.includes(" ")&&(f=f.replace(" ",e.displayName)),f}while(1<=i&&0<=c);break}}}finally{J=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?S(e):""}function ee(e){switch(e.tag){case 5:return S(e.type);case 16:return S("Lazy");case 13:return S("Suspense");case 19:return S("SuspenseList");case 0:case 2:case 15:return e=q(e.type,!1),e;case 11:return e=q(e.type.render,!1),e;case 1:return e=q(e.type,!0),e;default:return""}}function ne(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Se:return"Fragment";case oe:return"Portal";case Be:return"Profiler";case Re:return"StrictMode";case Ue:return"Suspense";case We:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Me:return(e.displayName||"Context")+".Consumer";case ie:return(e._context.displayName||"Context")+".Provider";case Pe:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case nt:return t=e.displayName||null,t!==null?t:ne(e.type)||"Memo";case Fe:t=e._payload,e=e._init;try{return ne(e(t))}catch{}}return null}function se(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ne(t);case 8:return t===Re?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function le(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function me(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Je(e){var t=me(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,u=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){r=""+i,u.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Hr(e){e._valueTracker||(e._valueTracker=Je(e))}function mi(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=me(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Vr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function tu(e,t){var n=t.checked;return F({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function hi(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=le(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function vi(e,t){t=t.checked,t!=null&&ve(e,"checked",t,!1)}function nu(e,t){vi(e,t);var n=le(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ru(e,t.type,n):t.hasOwnProperty("defaultValue")&&ru(e,t.type,le(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function yi(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ru(e,t,n){(t!=="number"||Vr(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Xn=Array.isArray;function vn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l "+t.valueOf().toString()+"",t=Br.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Zn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Jn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Kc=["Webkit","ms","Moz","O"];Object.keys(Jn).forEach(function(e){Kc.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Jn[t]=Jn[e]})});function Ei(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Jn.hasOwnProperty(e)&&Jn[e]?(""+t).trim():t+"px"}function Ci(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Ei(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Yc=F({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ou(e,t){if(t){if(Yc[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(s(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(s(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(s(61))}if(t.style!=null&&typeof t.style!="object")throw Error(s(62))}}function iu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var su=null;function au(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var cu=null,yn=null,gn=null;function _i(e){if(e=wr(e)){if(typeof cu!="function")throw Error(s(280));var t=e.stateNode;t&&(t=dl(t),cu(e.stateNode,e.type,t))}}function Ni(e){yn?gn?gn.push(e):gn=[e]:yn=e}function Pi(){if(yn){var e=yn,t=gn;if(gn=yn=null,_i(e),t)for(e=0;e >>=0,e===0?32:31-(lf(e)/uf|0)|0}var Gr=64,Xr=4194304;function tr(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Zr(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,u=e.pingedLanes,i=n&268435455;if(i!==0){var c=i&~l;c!==0?r=tr(c):(u&=i,u!==0&&(r=tr(u)))}else i=n&~l,i!==0?r=tr(i):u!==0&&(r=tr(u));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,u=t&-t,l>=u||l===16&&(u&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0 n;n++)t.push(e);return t}function nr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ct(t),e[t]=n}function cf(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0 =cr),ts=" ",ns=!1;function rs(e,t){switch(e){case"keyup":return Df.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ls(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var xn=!1;function Uf(e,t){switch(e){case"compositionend":return ls(t);case"keypress":return t.which!==32?null:(ns=!0,ts);case"textInput":return e=t.data,e===ts&&ns?null:e;default:return null}}function Hf(e,t){if(xn)return e==="compositionend"||!Tu&&rs(e,t)?(e=Xi(),tl=ku=Dt=null,xn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1 =t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=fs(n)}}function ps(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ps(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ms(){for(var e=window,t=Vr();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Vr(e.document)}return t}function Fu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Zf(e){var t=ms(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ps(n.ownerDocument.documentElement,n)){if(r!==null&&Fu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,u=Math.min(r.start,l);r=r.end===void 0?u:Math.min(r.end,l),!e.extend&&u>r&&(l=r,r=u,u=l),l=ds(n,u);var i=ds(n,r);l&&i&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),u>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n =document.documentMode,kn=null,zu=null,mr=null,$u=!1;function hs(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;$u||kn==null||kn!==Vr(r)||(r=kn,"selectionStart"in r&&Fu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),mr&&pr(mr,r)||(mr=r,r=al(zu,"onSelect"),0 Pn||(e.current=Qu[Pn],Qu[Pn]=null,Pn--)}function ae(e,t){Pn++,Qu[Pn]=e.current,e.current=t}var Vt={},Ie=Ht(Vt),Qe=Ht(!1),tn=Vt;function Tn(e,t){var n=e.type.contextTypes;if(!n)return Vt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},u;for(u in n)l[u]=t[u];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Ke(e){return e=e.childContextTypes,e!=null}function pl(){fe(Qe),fe(Ie)}function js(e,t,n){if(Ie.current!==Vt)throw Error(s(168));ae(Ie,t),ae(Qe,n)}function Fs(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(s(108,se(e)||"Unknown",l));return F({},n,r)}function ml(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Vt,tn=Ie.current,ae(Ie,e),ae(Qe,Qe.current),!0}function zs(e,t,n){var r=e.stateNode;if(!r)throw Error(s(169));n?(e=Fs(e,t,tn),r.__reactInternalMemoizedMergedChildContext=e,fe(Qe),fe(Ie),ae(Ie,e)):fe(Qe),ae(Qe,n)}var Nt=null,hl=!1,Ku=!1;function $s(e){Nt===null?Nt=[e]:Nt.push(e)}function sd(e){hl=!0,$s(e)}function Bt(){if(!Ku&&Nt!==null){Ku=!0;var e=0,t=ue;try{var n=Nt;for(ue=1;e >=i,l-=i,Pt=1<<32-ct(t)+l|n< Y?(je=Q,Q=null):je=Q.sibling;var re=k(v,Q,y[Y],L);if(re===null){Q===null&&(Q=je);break}e&&Q&&re.alternate===null&&t(v,Q),p=u(re,p,Y),W===null?H=re:W.sibling=re,W=re,Q=je}if(Y===y.length)return n(v,Q),he&&rn(v,Y),H;if(Q===null){for(;Y Y?(je=Q,Q=null):je=Q.sibling;var qt=k(v,Q,re.value,L);if(qt===null){Q===null&&(Q=je);break}e&&Q&&qt.alternate===null&&t(v,Q),p=u(qt,p,Y),W===null?H=qt:W.sibling=qt,W=qt,Q=je}if(re.done)return n(v,Q),he&&rn(v,Y),H;if(Q===null){for(;!re.done;Y++,re=y.next())re=_(v,re.value,L),re!==null&&(p=u(re,p,Y),W===null?H=re:W.sibling=re,W=re);return he&&rn(v,Y),H}for(Q=r(v,Q);!re.done;Y++,re=y.next())re=M(Q,v,Y,re.value,L),re!==null&&(e&&re.alternate!==null&&Q.delete(re.key===null?Y:re.key),p=u(re,p,Y),W===null?H=re:W.sibling=re,W=re);return e&&Q.forEach(function(Hd){return t(v,Hd)}),he&&rn(v,Y),H}function Ee(v,p,y,L){if(typeof y=="object"&&y!==null&&y.type===Se&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case ye:e:{for(var H=y.key,W=p;W!==null;){if(W.key===H){if(H=y.type,H===Se){if(W.tag===7){n(v,W.sibling),p=l(W,y.props.children),p.return=v,v=p;break e}}else if(W.elementType===H||typeof H=="object"&&H!==null&&H.$$typeof===Fe&&As(H)===W.type){n(v,W.sibling),p=l(W,y.props),p.ref=Sr(v,W,y),p.return=v,v=p;break e}n(v,W);break}else t(v,W);W=W.sibling}y.type===Se?(p=dn(y.props.children,v.mode,L,y.key),p.return=v,v=p):(L=Bl(y.type,y.key,y.props,null,v.mode,L),L.ref=Sr(v,p,y),L.return=v,v=L)}return i(v);case oe:e:{for(W=y.key;p!==null;){if(p.key===W)if(p.tag===4&&p.stateNode.containerInfo===y.containerInfo&&p.stateNode.implementation===y.implementation){n(v,p.sibling),p=l(p,y.children||[]),p.return=v,v=p;break e}else{n(v,p);break}else t(v,p);p=p.sibling}p=Wo(y,v.mode,L),p.return=v,v=p}return i(v);case Fe:return W=y._init,Ee(v,p,W(y._payload),L)}if(Xn(y))return A(v,p,y,L);if(K(y))return U(v,p,y,L);wl(v,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,p!==null&&p.tag===6?(n(v,p.sibling),p=l(p,y),p.return=v,v=p):(n(v,p),p=Bo(y,v.mode,L),p.return=v,v=p),i(v)):n(v,p)}return Ee}var zn=Us(!0),Hs=Us(!1),Sl=Ht(null),xl=null,$n=null,qu=null;function bu(){qu=$n=xl=null}function eo(e){var t=Sl.current;fe(Sl),e._currentValue=t}function to(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Rn(e,t){xl=e,qu=$n=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ye=!0),e.firstContext=null)}function ut(e){var t=e._currentValue;if(qu!==e)if(e={context:e,memoizedValue:t,next:null},$n===null){if(xl===null)throw Error(s(308));$n=e,xl.dependencies={lanes:0,firstContext:e}}else $n=$n.next=e;return t}var ln=null;function no(e){ln===null?ln=[e]:ln.push(e)}function Vs(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,no(t)):(n.next=l.next,l.next=n),t.interleaved=n,Lt(e,r)}function Lt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Wt=!1;function ro(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Bs(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function jt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Qt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,te&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Lt(e,n)}return l=r.interleaved,l===null?(t.next=t,no(r)):(t.next=l.next,l.next=t),r.interleaved=t,Lt(e,n)}function kl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yu(e,n)}}function Ws(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};u===null?l=u=i:u=u.next=i,n=n.next}while(n!==null);u===null?l=u=t:u=u.next=t}else l=u=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:u,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function El(e,t,n,r){var l=e.updateQueue;Wt=!1;var u=l.firstBaseUpdate,i=l.lastBaseUpdate,c=l.shared.pending;if(c!==null){l.shared.pending=null;var f=c,g=f.next;f.next=null,i===null?u=g:i.next=g,i=f;var E=e.alternate;E!==null&&(E=E.updateQueue,c=E.lastBaseUpdate,c!==i&&(c===null?E.firstBaseUpdate=g:c.next=g,E.lastBaseUpdate=f))}if(u!==null){var _=l.baseState;i=0,E=g=f=null,c=u;do{var k=c.lane,M=c.eventTime;if((r&k)===k){E!==null&&(E=E.next={eventTime:M,lane:0,tag:c.tag,payload:c.payload,callback:c.callback,next:null});e:{var A=e,U=c;switch(k=t,M=n,U.tag){case 1:if(A=U.payload,typeof A=="function"){_=A.call(M,_,k);break e}_=A;break e;case 3:A.flags=A.flags&-65537|128;case 0:if(A=U.payload,k=typeof A=="function"?A.call(M,_,k):A,k==null)break e;_=F({},_,k);break e;case 2:Wt=!0}}c.callback!==null&&c.lane!==0&&(e.flags|=64,k=l.effects,k===null?l.effects=[c]:k.push(c))}else M={eventTime:M,lane:k,tag:c.tag,payload:c.payload,callback:c.callback,next:null},E===null?(g=E=M,f=_):E=E.next=M,i|=k;if(c=c.next,c===null){if(c=l.shared.pending,c===null)break;k=c,c=k.next,k.next=null,l.lastBaseUpdate=k,l.shared.pending=null}}while(!0);if(E===null&&(f=_),l.baseState=f,l.firstBaseUpdate=g,l.lastBaseUpdate=E,t=l.shared.interleaved,t!==null){l=t;do i|=l.lane,l=l.next;while(l!==t)}else u===null&&(l.shared.lanes=0);sn|=i,e.lanes=i,e.memoizedState=_}}function Qs(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t n?n:4,e(!0);var r=so.transition;so.transition={};try{e(!1),t()}finally{ue=n,so.transition=r}}function ca(){return ot().memoizedState}function dd(e,t,n){var r=Xt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},fa(e))da(t,n);else if(n=Vs(e,t,n,r),n!==null){var l=Ve();vt(n,e,r,l),pa(n,t,r)}}function pd(e,t,n){var r=Xt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(fa(e))da(t,l);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var i=t.lastRenderedState,c=u(i,n);if(l.hasEagerState=!0,l.eagerState=c,ft(c,i)){var f=t.interleaved;f===null?(l.next=l,no(t)):(l.next=f.next,f.next=l),t.interleaved=l;return}}catch{}finally{}n=Vs(e,t,l,r),n!==null&&(l=Ve(),vt(n,e,r,l),pa(n,t,r))}}function fa(e){var t=e.alternate;return e===we||t!==null&&t===we}function da(e,t){Cr=Nl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function pa(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yu(e,n)}}var Ll={readContext:ut,useCallback:Oe,useContext:Oe,useEffect:Oe,useImperativeHandle:Oe,useInsertionEffect:Oe,useLayoutEffect:Oe,useMemo:Oe,useReducer:Oe,useRef:Oe,useState:Oe,useDebugValue:Oe,useDeferredValue:Oe,useTransition:Oe,useMutableSource:Oe,useSyncExternalStore:Oe,useId:Oe,unstable_isNewReconciler:!1},md={readContext:ut,useCallback:function(e,t){return kt().memoizedState=[e,t===void 0?null:t],e},useContext:ut,useEffect:na,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Pl(4194308,4,ua.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Pl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Pl(4,2,e,t)},useMemo:function(e,t){var n=kt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=kt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=dd.bind(null,we,e),[r.memoizedState,e]},useRef:function(e){var t=kt();return e={current:e},t.memoizedState=e},useState:ea,useDebugValue:vo,useDeferredValue:function(e){return kt().memoizedState=e},useTransition:function(){var e=ea(!1),t=e[0];return e=fd.bind(null,e[1]),kt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=we,l=kt();if(he){if(n===void 0)throw Error(s(407));n=n()}else{if(n=t(),Le===null)throw Error(s(349));on&30||Xs(r,t,n)}l.memoizedState=n;var u={value:n,getSnapshot:t};return l.queue=u,na(Js.bind(null,r,u,e),[e]),r.flags|=2048,Pr(9,Zs.bind(null,r,u,n,t),void 0,null),n},useId:function(){var e=kt(),t=Le.identifierPrefix;if(he){var n=Tt,r=Pt;n=(r&~(1<<32-ct(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=_r++,0 <\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[St]=t,e[gr]=r,$a(e,t,!1,!1),t.stateNode=e;e:{switch(i=iu(n,r),n){case"dialog":ce("cancel",e),ce("close",e),l=r;break;case"iframe":case"object":case"embed":ce("load",e),l=r;break;case"video":case"audio":for(l=0;l An&&(t.flags|=128,r=!0,Tr(u,!1),t.lanes=4194304)}else{if(!r)if(e=Cl(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Tr(u,!0),u.tail===null&&u.tailMode==="hidden"&&!i.alternate&&!he)return De(t),null}else 2*ke()-u.renderingStartTime>An&&n!==1073741824&&(t.flags|=128,r=!0,Tr(u,!1),t.lanes=4194304);u.isBackwards?(i.sibling=t.child,t.child=i):(n=u.last,n!==null?n.sibling=i:t.child=i,u.last=i)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=ke(),t.sibling=null,n=ge.current,ae(ge,r?n&1|2:n&1),t):(De(t),null);case 22:case 23:return Uo(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?tt&1073741824&&(De(t),t.subtreeFlags&6&&(t.flags|=8192)):De(t),null;case 24:return null;case 25:return null}throw Error(s(156,t.tag))}function kd(e,t){switch(Gu(t),t.tag){case 1:return Ke(t.type)&&pl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Mn(),fe(Qe),fe(Ie),io(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return uo(t),null;case 13:if(fe(ge),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));Fn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return fe(ge),null;case 4:return Mn(),null;case 10:return eo(t.type._context),null;case 22:case 23:return Uo(),null;case 24:return null;default:return null}}var $l=!1,Ae=!1,Ed=typeof WeakSet=="function"?WeakSet:Set,O=null;function On(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){xe(e,t,r)}else n.current=null}function To(e,t,n){try{n()}catch(r){xe(e,t,r)}}var Ia=!1;function Cd(e,t){if(Au=br,e=ms(),Fu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,u=r.focusNode;r=r.focusOffset;try{n.nodeType,u.nodeType}catch{n=null;break e}var i=0,c=-1,f=-1,g=0,E=0,_=e,k=null;t:for(;;){for(var M;_!==n||l!==0&&_.nodeType!==3||(c=i+l),_!==u||r!==0&&_.nodeType!==3||(f=i+r),_.nodeType===3&&(i+=_.nodeValue.length),(M=_.firstChild)!==null;)k=_,_=M;for(;;){if(_===e)break t;if(k===n&&++g===l&&(c=i),k===u&&++E===r&&(f=i),(M=_.nextSibling)!==null)break;_=k,k=_.parentNode}_=M}n=c===-1||f===-1?null:{start:c,end:f}}else n=null}n=n||{start:0,end:0}}else n=null;for(Uu={focusedElem:e,selectionRange:n},br=!1,O=t;O!==null;)if(t=O,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,O=e;else for(;O!==null;){t=O;try{var A=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(A!==null){var U=A.memoizedProps,Ee=A.memoizedState,v=t.stateNode,p=v.getSnapshotBeforeUpdate(t.elementType===t.type?U:pt(t.type,U),Ee);v.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(L){xe(t,t.return,L)}if(e=t.sibling,e!==null){e.return=t.return,O=e;break}O=t.return}return A=Ia,Ia=!1,A}function Lr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var u=l.destroy;l.destroy=void 0,u!==void 0&&To(t,n,u)}l=l.next}while(l!==r)}}function Rl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Lo(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Oa(e){var t=e.alternate;t!==null&&(e.alternate=null,Oa(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[St],delete t[gr],delete t[Wu],delete t[od],delete t[id])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Da(e){return e.tag===5||e.tag===3||e.tag===4}function Aa(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Da(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function jo(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=fl));else if(r!==4&&(e=e.child,e!==null))for(jo(e,t,n),e=e.sibling;e!==null;)jo(e,t,n),e=e.sibling}function Fo(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Fo(e,t,n),e=e.sibling;e!==null;)Fo(e,t,n),e=e.sibling}var ze=null,mt=!1;function Kt(e,t,n){for(n=n.child;n!==null;)Ua(e,t,n),n=n.sibling}function Ua(e,t,n){if(wt&&typeof wt.onCommitFiberUnmount=="function")try{wt.onCommitFiberUnmount(Yr,n)}catch{}switch(n.tag){case 5:Ae||On(n,t);case 6:var r=ze,l=mt;ze=null,Kt(e,t,n),ze=r,mt=l,ze!==null&&(mt?(e=ze,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ze.removeChild(n.stateNode));break;case 18:ze!==null&&(mt?(e=ze,n=n.stateNode,e.nodeType===8?Bu(e.parentNode,n):e.nodeType===1&&Bu(e,n),ir(e)):Bu(ze,n.stateNode));break;case 4:r=ze,l=mt,ze=n.stateNode.containerInfo,mt=!0,Kt(e,t,n),ze=r,mt=l;break;case 0:case 11:case 14:case 15:if(!Ae&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var u=l,i=u.destroy;u=u.tag,i!==void 0&&(u&2||u&4)&&To(n,t,i),l=l.next}while(l!==r)}Kt(e,t,n);break;case 1:if(!Ae&&(On(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(c){xe(n,t,c)}Kt(e,t,n);break;case 21:Kt(e,t,n);break;case 22:n.mode&1?(Ae=(r=Ae)||n.memoizedState!==null,Kt(e,t,n),Ae=r):Kt(e,t,n);break;default:Kt(e,t,n)}}function Ha(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Ed),t.forEach(function(r){var l=$d.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function ht(e,t){var n=t.deletions;if(n!==null)for(var r=0;r l&&(l=i),r&=~u}if(r=l,r=ke()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Nd(r/1960))-r,10 e?16:e,Gt===null)var r=!1;else{if(e=Gt,Gt=null,Al=0,te&6)throw Error(s(331));var l=te;for(te|=4,O=e.current;O!==null;){var u=O,i=u.child;if(O.flags&16){var c=u.deletions;if(c!==null){for(var f=0;f ke()-Ro?cn(e,0):$o|=n),Xe(e,t)}function ec(e,t){t===0&&(e.mode&1?(t=Xr,Xr<<=1,!(Xr&130023424)&&(Xr=4194304)):t=1);var n=Ve();e=Lt(e,t),e!==null&&(nr(e,t,n),Xe(e,n))}function zd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ec(e,n)}function $d(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(s(314))}r!==null&&r.delete(t),ec(e,n)}var tc;tc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Qe.current)Ye=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ye=!1,Sd(e,t,n);Ye=!!(e.flags&131072)}else Ye=!1,he&&t.flags&1048576&&Rs(t,yl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;zl(e,t),e=t.pendingProps;var l=Tn(t,Ie.current);Rn(t,n),l=co(null,t,r,e,l,n);var u=fo();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ke(r)?(u=!0,ml(t)):u=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,ro(t),l.updater=jl,t.stateNode=l,l._reactInternals=t,go(t,r,e,n),t=ko(null,t,r,!0,u,n)):(t.tag=0,he&&u&&Yu(t),He(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(zl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Md(r),e=pt(r,e),l){case 0:t=xo(null,t,r,e,n);break e;case 1:t=Pa(null,t,r,e,n);break e;case 11:t=ka(null,t,r,e,n);break e;case 14:t=Ea(null,t,r,pt(r.type,e),n);break e}throw Error(s(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:pt(r,l),xo(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:pt(r,l),Pa(e,t,r,l,n);case 3:e:{if(Ta(t),e===null)throw Error(s(387));r=t.pendingProps,u=t.memoizedState,l=u.element,Bs(e,t),El(t,r,null,n);var i=t.memoizedState;if(r=i.element,u.isDehydrated)if(u={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){l=In(Error(s(423)),t),t=La(e,t,r,n,l);break e}else if(r!==l){l=In(Error(s(424)),t),t=La(e,t,r,n,l);break e}else for(et=Ut(t.stateNode.containerInfo.firstChild),be=t,he=!0,dt=null,n=Hs(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Fn(),r===l){t=Ft(e,t,n);break e}He(e,t,r,n)}t=t.child}return t;case 5:return Ks(t),e===null&&Zu(t),r=t.type,l=t.pendingProps,u=e!==null?e.memoizedProps:null,i=l.children,Hu(r,l)?i=null:u!==null&&Hu(r,u)&&(t.flags|=32),Na(e,t),He(e,t,i,n),t.child;case 6:return e===null&&Zu(t),null;case 13:return ja(e,t,n);case 4:return lo(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=zn(t,null,r,n):He(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:pt(r,l),ka(e,t,r,l,n);case 7:return He(e,t,t.pendingProps,n),t.child;case 8:return He(e,t,t.pendingProps.children,n),t.child;case 12:return He(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,u=t.memoizedProps,i=l.value,ae(Sl,r._currentValue),r._currentValue=i,u!==null)if(ft(u.value,i)){if(u.children===l.children&&!Qe.current){t=Ft(e,t,n);break e}}else for(u=t.child,u!==null&&(u.return=t);u!==null;){var c=u.dependencies;if(c!==null){i=u.child;for(var f=c.firstContext;f!==null;){if(f.context===r){if(u.tag===1){f=jt(-1,n&-n),f.tag=2;var g=u.updateQueue;if(g!==null){g=g.shared;var E=g.pending;E===null?f.next=f:(f.next=E.next,E.next=f),g.pending=f}}u.lanes|=n,f=u.alternate,f!==null&&(f.lanes|=n),to(u.return,n,t),c.lanes|=n;break}f=f.next}}else if(u.tag===10)i=u.type===t.type?null:u.child;else if(u.tag===18){if(i=u.return,i===null)throw Error(s(341));i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),to(i,n,t),i=u.sibling}else i=u.child;if(i!==null)i.return=u;else for(i=u;i!==null;){if(i===t){i=null;break}if(u=i.sibling,u!==null){u.return=i.return,i=u;break}i=i.return}u=i}He(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Rn(t,n),l=ut(l),r=r(l),t.flags|=1,He(e,t,r,n),t.child;case 14:return r=t.type,l=pt(r,t.pendingProps),l=pt(r.type,l),Ea(e,t,r,l,n);case 15:return Ca(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:pt(r,l),zl(e,t),t.tag=1,Ke(r)?(e=!0,ml(t)):e=!1,Rn(t,n),ha(t,r,l),go(t,r,l,n),ko(null,t,r,!0,e,n);case 19:return za(e,t,n);case 22:return _a(e,t,n)}throw Error(s(156,t.tag))};function nc(e,t){return Mi(e,t)}function Rd(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function st(e,t,n,r){return new Rd(e,t,n,r)}function Vo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Md(e){if(typeof e=="function")return Vo(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Pe)return 11;if(e===nt)return 14}return 2}function Jt(e,t){var n=e.alternate;return n===null?(n=st(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Bl(e,t,n,r,l,u){var i=2;if(r=e,typeof e=="function")Vo(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Se:return dn(n.children,l,u,t);case Re:i=8,l|=8;break;case Be:return e=st(12,n,t,l|2),e.elementType=Be,e.lanes=u,e;case Ue:return e=st(13,n,t,l),e.elementType=Ue,e.lanes=u,e;case We:return e=st(19,n,t,l),e.elementType=We,e.lanes=u,e;case pe:return Wl(n,l,u,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ie:i=10;break e;case Me:i=9;break e;case Pe:i=11;break e;case nt:i=14;break e;case Fe:i=16,r=null;break e}throw Error(s(130,e==null?e:typeof e,""))}return t=st(i,n,t,l),t.elementType=e,t.type=r,t.lanes=u,t}function dn(e,t,n,r){return e=st(7,e,r,t),e.lanes=n,e}function Wl(e,t,n,r){return e=st(22,e,r,t),e.elementType=pe,e.lanes=n,e.stateNode={isHidden:!1},e}function Bo(e,t,n){return e=st(6,e,null,t),e.lanes=n,e}function Wo(e,t,n){return t=st(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Id(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=vu(0),this.expirationTimes=vu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vu(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Qo(e,t,n,r,l,u,i,c,f){return e=new Id(e,t,n,c,f),t===1?(t=1,u===!0&&(t|=8)):t=0,u=st(3,null,null,t),e.current=u,u.stateNode=e,u.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ro(u),e}function Od(e,t,n){var r=3 "u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(a){console.error(a)}}return o(),Jo.exports=Gd(),Jo.exports}var vc;function Zd(){if(vc)return Jl;vc=1;var o=Xd();return Jl.createRoot=o.createRoot,Jl.hydrateRoot=o.hydrateRoot,Jl}var Jd=Zd();const xc=typeof document<"u"?$t.useLayoutEffect:()=>{};function qd(o){const a=C.useRef(null);return xc(()=>{a.current=o},[o]),C.useCallback((...s)=>{const d=a.current;return d==null?void 0:d(...s)},[])}const Dr=o=>{var a;return(a=o==null?void 0:o.ownerDocument)!==null&&a!==void 0?a:document},pn=o=>o&&"window"in o&&o.window===o?o:Dr(o).defaultView||window;function bd(o){var a;return typeof window>"u"||window.navigator==null?!1:((a=window.navigator.userAgentData)===null||a===void 0?void 0:a.brands.some(s=>o.test(s.brand)))||o.test(window.navigator.userAgent)}function ep(o){var a;return typeof window<"u"&&window.navigator!=null?o.test(((a=window.navigator.userAgentData)===null||a===void 0?void 0:a.platform)||window.navigator.platform):!1}function kc(o){let a=null;return()=>(a==null&&(a=o()),a)}const tp=kc(function(){return ep(/^Mac/i)}),np=kc(function(){return bd(/Android/i)});function rp(o){return o.mozInputSource===0&&o.isTrusted?!0:np()&&o.pointerType?o.type==="click"&&o.buttons===1:o.detail===0&&!o.pointerType}class lp{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(a,s){this.nativeEvent=s,this.target=s.target,this.currentTarget=s.currentTarget,this.relatedTarget=s.relatedTarget,this.bubbles=s.bubbles,this.cancelable=s.cancelable,this.defaultPrevented=s.defaultPrevented,this.eventPhase=s.eventPhase,this.isTrusted=s.isTrusted,this.timeStamp=s.timeStamp,this.type=a}}function Ec(o){let a=C.useRef({isFocused:!1,observer:null});xc(()=>{const d=a.current;return()=>{d.observer&&(d.observer.disconnect(),d.observer=null)}},[]);let s=qd(d=>{o==null||o(d)});return C.useCallback(d=>{if(d.target instanceof HTMLButtonElement||d.target instanceof HTMLInputElement||d.target instanceof HTMLTextAreaElement||d.target instanceof HTMLSelectElement){a.current.isFocused=!0;let h=d.target,w=x=>{a.current.isFocused=!1,h.disabled&&s(new lp("blur",x)),a.current.observer&&(a.current.observer.disconnect(),a.current.observer=null)};h.addEventListener("focusout",w,{once:!0}),a.current.observer=new MutationObserver(()=>{if(a.current.isFocused&&h.disabled){var x;(x=a.current.observer)===null||x===void 0||x.disconnect();let N=h===document.activeElement?null:document.activeElement;h.dispatchEvent(new FocusEvent("blur",{relatedTarget:N})),h.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:N}))}}),a.current.observer.observe(h,{attributes:!0,attributeFilter:["disabled"]})}},[s])}function up(o){let{isDisabled:a,onFocus:s,onBlur:d,onFocusChange:h}=o;const w=C.useCallback(T=>{if(T.target===T.currentTarget)return d&&d(T),h&&h(!1),!0},[d,h]),x=Ec(w),N=C.useCallback(T=>{const I=Dr(T.target);T.target===T.currentTarget&&I.activeElement===T.target&&(s&&s(T),h&&h(!0),x(T))},[h,s,x]);return{focusProps:{onFocus:!a&&(s||h||d)?N:void 0,onBlur:!a&&(d||h)?w:void 0}}}let Ar=null,ri=new Set,Or=new Map,hn=!1,li=!1;const op={Tab:!0,Escape:!0};function ci(o,a){for(let s of ri)s(o,a)}function ip(o){return!(o.metaKey||!tp()&&o.altKey||o.ctrlKey||o.key==="Control"||o.key==="Shift"||o.key==="Meta")}function bl(o){hn=!0,ip(o)&&(Ar="keyboard",ci("keyboard",o))}function at(o){Ar="pointer",(o.type==="mousedown"||o.type==="pointerdown")&&(hn=!0,ci("pointer",o))}function Cc(o){rp(o)&&(hn=!0,Ar="virtual")}function _c(o){o.target===window||o.target===document||(!hn&&!li&&(Ar="virtual",ci("virtual",o)),hn=!1,li=!1)}function Nc(){hn=!1,li=!0}function ui(o){if(typeof window>"u"||Or.get(pn(o)))return;const a=pn(o),s=Dr(o);let d=a.HTMLElement.prototype.focus;a.HTMLElement.prototype.focus=function(){hn=!0,d.apply(this,arguments)},s.addEventListener("keydown",bl,!0),s.addEventListener("keyup",bl,!0),s.addEventListener("click",Cc,!0),a.addEventListener("focus",_c,!0),a.addEventListener("blur",Nc,!1),typeof PointerEvent<"u"?(s.addEventListener("pointerdown",at,!0),s.addEventListener("pointermove",at,!0),s.addEventListener("pointerup",at,!0)):(s.addEventListener("mousedown",at,!0),s.addEventListener("mousemove",at,!0),s.addEventListener("mouseup",at,!0)),a.addEventListener("beforeunload",()=>{Pc(o)},{once:!0}),Or.set(a,{focus:d})}const Pc=(o,a)=>{const s=pn(o),d=Dr(o);a&&d.removeEventListener("DOMContentLoaded",a),Or.has(s)&&(s.HTMLElement.prototype.focus=Or.get(s).focus,d.removeEventListener("keydown",bl,!0),d.removeEventListener("keyup",bl,!0),d.removeEventListener("click",Cc,!0),s.removeEventListener("focus",_c,!0),s.removeEventListener("blur",Nc,!1),typeof PointerEvent<"u"?(d.removeEventListener("pointerdown",at,!0),d.removeEventListener("pointermove",at,!0),d.removeEventListener("pointerup",at,!0)):(d.removeEventListener("mousedown",at,!0),d.removeEventListener("mousemove",at,!0),d.removeEventListener("mouseup",at,!0)),Or.delete(s))};function sp(o){const a=Dr(o);let s;return a.readyState!=="loading"?ui(o):(s=()=>{ui(o)},a.addEventListener("DOMContentLoaded",s)),()=>Pc(o,s)}typeof document<"u"&&sp();function Tc(){return Ar!=="pointer"}const ap=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function cp(o,a,s){var d;const h=typeof window<"u"?pn(s==null?void 0:s.target).HTMLInputElement:HTMLInputElement,w=typeof window<"u"?pn(s==null?void 0:s.target).HTMLTextAreaElement:HTMLTextAreaElement,x=typeof window<"u"?pn(s==null?void 0:s.target).HTMLElement:HTMLElement,N=typeof window<"u"?pn(s==null?void 0:s.target).KeyboardEvent:KeyboardEvent;return o=o||(s==null?void 0:s.target)instanceof h&&!ap.has(s==null||(d=s.target)===null||d===void 0?void 0:d.type)||(s==null?void 0:s.target)instanceof w||(s==null?void 0:s.target)instanceof x&&(s==null?void 0:s.target.isContentEditable),!(o&&a==="keyboard"&&s instanceof N&&!op[s.key])}function fp(o,a,s){ui(),C.useEffect(()=>{let d=(h,w)=>{cp(!!(s!=null&&s.isTextInput),h,w)&&o(Tc())};return ri.add(d),()=>{ri.delete(d)}},a)}function dp(o){let{isDisabled:a,onBlurWithin:s,onFocusWithin:d,onFocusWithinChange:h}=o,w=C.useRef({isFocusWithin:!1}),x=C.useCallback(I=>{w.current.isFocusWithin&&!I.currentTarget.contains(I.relatedTarget)&&(w.current.isFocusWithin=!1,s&&s(I),h&&h(!1))},[s,h,w]),N=Ec(x),T=C.useCallback(I=>{!w.current.isFocusWithin&&document.activeElement===I.target&&(d&&d(I),h&&h(!0),w.current.isFocusWithin=!0,N(I))},[d,h,N]);return a?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:T,onBlur:x}}}let eu=!1,ei=0;function oi(){eu=!0,setTimeout(()=>{eu=!1},50)}function yc(o){o.pointerType==="touch"&&oi()}function pp(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",yc):document.addEventListener("touchend",oi),ei++,()=>{ei--,!(ei>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",yc):document.removeEventListener("touchend",oi))}}function mp(o){let{onHoverStart:a,onHoverChange:s,onHoverEnd:d,isDisabled:h}=o,[w,x]=C.useState(!1),N=C.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;C.useEffect(pp,[]);let{hoverProps:T,triggerHoverEnd:I}=C.useMemo(()=>{let j=(z,V)=>{if(N.pointerType=V,h||V==="touch"||N.isHovered||!z.currentTarget.contains(z.target))return;N.isHovered=!0;let G=z.currentTarget;N.target=G,a&&a({type:"hoverstart",target:G,pointerType:V}),s&&s(!0),x(!0)},R=(z,V)=>{if(N.pointerType="",N.target=null,V==="touch"||!N.isHovered)return;N.isHovered=!1;let G=z.currentTarget;d&&d({type:"hoverend",target:G,pointerType:V}),s&&s(!1),x(!1)},D={};return typeof PointerEvent<"u"?(D.onPointerEnter=z=>{eu&&z.pointerType==="mouse"||j(z,z.pointerType)},D.onPointerLeave=z=>{!h&&z.currentTarget.contains(z.target)&&R(z,z.pointerType)}):(D.onTouchStart=()=>{N.ignoreEmulatedMouseEvents=!0},D.onMouseEnter=z=>{!N.ignoreEmulatedMouseEvents&&!eu&&j(z,"mouse"),N.ignoreEmulatedMouseEvents=!1},D.onMouseLeave=z=>{!h&&z.currentTarget.contains(z.target)&&R(z,"mouse")}),{hoverProps:D,triggerHoverEnd:R}},[a,s,d,h,N]);return C.useEffect(()=>{h&&I({currentTarget:N.target},N.pointerType)},[h]),{hoverProps:T,isHovered:w}}function Lc(o={}){let{autoFocus:a=!1,isTextInput:s,within:d}=o,h=C.useRef({isFocused:!1,isFocusVisible:a||Tc()}),[w,x]=C.useState(!1),[N,T]=C.useState(()=>h.current.isFocused&&h.current.isFocusVisible),I=C.useCallback(()=>T(h.current.isFocused&&h.current.isFocusVisible),[]),j=C.useCallback(z=>{h.current.isFocused=z,x(z),I()},[I]);fp(z=>{h.current.isFocusVisible=z,I()},[],{isTextInput:s});let{focusProps:R}=up({isDisabled:d,onFocusChange:j}),{focusWithinProps:D}=dp({isDisabled:!d,onFocusWithinChange:j});return{isFocused:w,isFocusVisible:N,focusProps:d?D:R}}var hp=Object.defineProperty,vp=(o,a,s)=>a in o?hp(o,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[a]=s,ti=(o,a,s)=>(vp(o,typeof a!="symbol"?a+"":a,s),s);let yp=class{constructor(){ti(this,"current",this.detect()),ti(this,"handoffState","pending"),ti(this,"currentId",0)}set(a){this.current!==a&&(this.handoffState="pending",this.currentId=0,this.current=a)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},jc=new yp;function Fc(o){return jc.isServer?null:o instanceof Node?o.ownerDocument:o!=null&&o.hasOwnProperty("current")&&o.current instanceof Node?o.current.ownerDocument:document}function zc(o){typeof queueMicrotask=="function"?queueMicrotask(o):Promise.resolve().then(o).catch(a=>setTimeout(()=>{throw a}))}function $c(){let o=[],a={addEventListener(s,d,h,w){return s.addEventListener(d,h,w),a.add(()=>s.removeEventListener(d,h,w))},requestAnimationFrame(...s){let d=requestAnimationFrame(...s);return a.add(()=>cancelAnimationFrame(d))},nextFrame(...s){return a.requestAnimationFrame(()=>a.requestAnimationFrame(...s))},setTimeout(...s){let d=setTimeout(...s);return a.add(()=>clearTimeout(d))},microTask(...s){let d={current:!0};return zc(()=>{d.current&&s[0]()}),a.add(()=>{d.current=!1})},style(s,d,h){let w=s.style.getPropertyValue(d);return Object.assign(s.style,{[d]:h}),this.add(()=>{Object.assign(s.style,{[d]:w})})},group(s){let d=$c();return s(d),this.add(()=>d.dispose())},add(s){return o.includes(s)||o.push(s),()=>{let d=o.indexOf(s);if(d>=0)for(let h of o.splice(d,1))h()}},dispose(){for(let s of o.splice(0))s()}};return a}function gp(){let[o]=C.useState($c);return C.useEffect(()=>()=>o.dispose(),[o]),o}let Wn=(o,a)=>{jc.isServer?C.useEffect(o,a):C.useLayoutEffect(o,a)};function Mr(o){let a=C.useRef(o);return Wn(()=>{a.current=o},[o]),a}let Ct=function(o){let a=Mr(o);return $t.useCallback((...s)=>a.current(...s),[a])};function wp(o){let a=o.width/2,s=o.height/2;return{top:o.clientY-s,right:o.clientX+a,bottom:o.clientY+s,left:o.clientX-a}}function Sp(o,a){return!(!o||!a||o.right a.right||o.bottom a.bottom)}function xp({disabled:o=!1}={}){let a=C.useRef(null),[s,d]=C.useState(!1),h=gp(),w=Ct(()=>{a.current=null,d(!1),h.dispose()}),x=Ct(N=>{if(h.dispose(),a.current===null){a.current=N.currentTarget,d(!0);{let T=Fc(N.currentTarget);h.addEventListener(T,"pointerup",w,!1),h.addEventListener(T,"pointermove",I=>{if(a.current){let j=wp(I);d(Sp(j,a.current.getBoundingClientRect()))}},!1),h.addEventListener(T,"pointercancel",w,!1)}}});return{pressed:s,pressProps:o?{}:{onPointerDown:x,onPointerUp:w,onClick:w}}}function gc(...o){return Array.from(new Set(o.flatMap(a=>typeof a=="string"?a.split(" "):[]))).filter(Boolean).join(" ")}function mn(o,a,...s){if(o in a){let h=a[o];return typeof h=="function"?h(...s):h}let d=new Error(`Tried to handle "${o}" but there is no handler defined. Only defined handlers are: ${Object.keys(a).map(h=>`"${h}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(d,mn),d}var ii=(o=>(o[o.None=0]="None",o[o.RenderStrategy=1]="RenderStrategy",o[o.Static=2]="Static",o))(ii||{}),kp=(o=>(o[o.Unmount=0]="Unmount",o[o.Hidden=1]="Hidden",o))(kp||{});function Kn(){let o=Cp();return C.useCallback(a=>Ep({mergeRefs:o,...a}),[o])}function Ep({ourProps:o,theirProps:a,slot:s,defaultTag:d,features:h,visible:w=!0,name:x,mergeRefs:N}){N=N??_p;let T=Rc(a,o);if(w)return ql(T,s,d,x,N);let I=h??0;if(I&2){let{static:j=!1,...R}=T;if(j)return ql(R,s,d,x,N)}if(I&1){let{unmount:j=!0,...R}=T;return mn(j?0:1,{0(){return null},1(){return ql({...R,hidden:!0,style:{display:"none"}},s,d,x,N)}})}return ql(T,s,d,x,N)}function ql(o,a={},s,d,h){let{as:w=s,children:x,refName:N="ref",...T}=ni(o,["unmount","static"]),I=o.ref!==void 0?{[N]:o.ref}:{},j=typeof x=="function"?x(a):x;"className"in T&&T.className&&typeof T.className=="function"&&(T.className=T.className(a)),T["aria-labelledby"]&&T["aria-labelledby"]===T.id&&(T["aria-labelledby"]=void 0);let R={};if(a){let D=!1,z=[];for(let[V,G]of Object.entries(a))typeof G=="boolean"&&(D=!0),G===!0&&z.push(V.replace(/([A-Z])/g,Z=>`-${Z.toLowerCase()}`));if(D){R["data-headlessui-state"]=z.join(" ");for(let V of z)R[`data-${V}`]=""}}if(w===C.Fragment&&(Object.keys(Hn(T)).length>0||Object.keys(Hn(R)).length>0))if(!C.isValidElement(j)||Array.isArray(j)&&j.length>1){if(Object.keys(Hn(T)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${d} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(Hn(T)).concat(Object.keys(Hn(R))).map(D=>` - ${D}`).join(` `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(D=>` - ${D}`).join(` `)].join(` `))}else{let D=j.props,z=D==null?void 0:D.className,V=typeof z=="function"?(...X)=>gc(z(...X),T.className):gc(z,T.className),G=V?{className:V}:{},Z=Rc(j.props,Hn(ni(T,["ref"])));for(let X in R)X in Z&&delete R[X];return C.cloneElement(j,Object.assign({},Z,R,I,{ref:h(Np(j),I.ref)},G))}return C.createElement(w,Object.assign({},ni(T,["ref"]),w!==C.Fragment&&I,w!==C.Fragment&&R),j)}function Cp(){let o=C.useRef([]),a=C.useCallback(s=>{for(let d of o.current)d!=null&&(typeof d=="function"?d(s):d.current=s)},[]);return(...s)=>{if(!s.every(d=>d==null))return o.current=s,a}}function _p(...o){return o.every(a=>a==null)?void 0:a=>{for(let s of o)s!=null&&(typeof s=="function"?s(a):s.current=a)}}function Rc(...o){if(o.length===0)return{};if(o.length===1)return o[0];let a={},s={};for(let d of o)for(let h in d)h.startsWith("on")&&typeof d[h]=="function"?(s[h]!=null||(s[h]=[]),s[h].push(d[h])):a[h]=d[h];if(a.disabled||a["aria-disabled"])for(let d in s)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(d)&&(s[d]=[h=>{var w;return(w=h==null?void 0:h.preventDefault)==null?void 0:w.call(h)}]);for(let d in s)Object.assign(a,{[d](h,...w){let x=s[d];for(let N of x){if((h instanceof Event||(h==null?void 0:h.nativeEvent)instanceof Event)&&h.defaultPrevented)return;N(h,...w)}}});return a}function Mc(...o){if(o.length===0)return{};if(o.length===1)return o[0];let a={},s={};for(let d of o)for(let h in d)h.startsWith("on")&&typeof d[h]=="function"?(s[h]!=null||(s[h]=[]),s[h].push(d[h])):a[h]=d[h];for(let d in s)Object.assign(a,{[d](...h){let w=s[d];for(let x of w)x==null||x(...h)}});return a}function Yn(o){var a;return Object.assign(C.forwardRef(o),{displayName:(a=o.displayName)!=null?a:o.name})}function Hn(o){let a=Object.assign({},o);for(let s in a)a[s]===void 0&&delete a[s];return a}function ni(o,a=[]){let s=Object.assign({},o);for(let d of a)d in s&&delete s[d];return s}function Np(o){return $t.version.split(".")[0]>="19"?o.props.ref:o.ref}let Pp="span";var Ic=(o=>(o[o.None=1]="None",o[o.Focusable=2]="Focusable",o[o.Hidden=4]="Hidden",o))(Ic||{});function Tp(o,a){var s;let{features:d=1,...h}=o,w={ref:a,"aria-hidden":(d&2)===2?!0:(s=h["aria-hidden"])!=null?s:void 0,hidden:(d&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(d&4)===4&&(d&2)!==2&&{display:"none"}}};return Kn()({ourProps:w,theirProps:h,slot:{},defaultTag:Pp,name:"Hidden"})}let Oc=Yn(Tp),Lp=Symbol();function Ur(...o){let a=C.useRef(o);C.useEffect(()=>{a.current=o},[o]);let s=Ct(d=>{for(let h of a.current)h!=null&&(typeof h=="function"?h(d):h.current=d)});return o.every(d=>d==null||(d==null?void 0:d[Lp]))?void 0:s}var yt=(o=>(o.Space=" ",o.Enter="Enter",o.Escape="Escape",o.Backspace="Backspace",o.Delete="Delete",o.ArrowLeft="ArrowLeft",o.ArrowUp="ArrowUp",o.ArrowRight="ArrowRight",o.ArrowDown="ArrowDown",o.Home="Home",o.End="End",o.PageUp="PageUp",o.PageDown="PageDown",o.Tab="Tab",o))(yt||{});let jp=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(o=>`${o}:not([tabindex='-1'])`).join(","),Fp=["[data-autofocus]"].map(o=>`${o}:not([tabindex='-1'])`).join(",");var gt=(o=>(o[o.First=1]="First",o[o.Previous=2]="Previous",o[o.Next=4]="Next",o[o.Last=8]="Last",o[o.WrapAround=16]="WrapAround",o[o.NoScroll=32]="NoScroll",o[o.AutoFocus=64]="AutoFocus",o))(gt||{}),Ir=(o=>(o[o.Error=0]="Error",o[o.Overflow=1]="Overflow",o[o.Success=2]="Success",o[o.Underflow=3]="Underflow",o))(Ir||{}),zp=(o=>(o[o.Previous=-1]="Previous",o[o.Next=1]="Next",o))(zp||{});function $p(o=document.body){return o==null?[]:Array.from(o.querySelectorAll(jp)).sort((a,s)=>Math.sign((a.tabIndex||Number.MAX_SAFE_INTEGER)-(s.tabIndex||Number.MAX_SAFE_INTEGER)))}function Rp(o=document.body){return o==null?[]:Array.from(o.querySelectorAll(Fp)).sort((a,s)=>Math.sign((a.tabIndex||Number.MAX_SAFE_INTEGER)-(s.tabIndex||Number.MAX_SAFE_INTEGER)))}var Mp=(o=>(o[o.Strict=0]="Strict",o[o.Loose=1]="Loose",o))(Mp||{}),Ip=(o=>(o[o.Keyboard=0]="Keyboard",o[o.Mouse=1]="Mouse",o))(Ip||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",o=>{o.metaKey||o.altKey||o.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",o=>{o.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:o.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let Op=["textarea","input"].join(",");function Dp(o){var a,s;return(s=(a=o==null?void 0:o.matches)==null?void 0:a.call(o,Op))!=null?s:!1}function Bn(o,a=s=>s){return o.slice().sort((s,d)=>{let h=a(s),w=a(d);if(h===null||w===null)return 0;let x=h.compareDocumentPosition(w);return x&Node.DOCUMENT_POSITION_FOLLOWING?-1:x&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Vn(o,a,{sorted:s=!0,relativeTo:d=null,skipElements:h=[]}={}){let w=Array.isArray(o)?o.length>0?o[0].ownerDocument:document:o.ownerDocument,x=Array.isArray(o)?s?Bn(o):o:a&64?Rp(o):$p(o);h.length>0&&x.length>1&&(x=x.filter(z=>!h.some(V=>V!=null&&"current"in V?(V==null?void 0:V.current)===z:V===z))),d=d??w.activeElement;let N=(()=>{if(a&5)return 1;if(a&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),T=(()=>{if(a&1)return 0;if(a&2)return Math.max(0,x.indexOf(d))-1;if(a&4)return Math.max(0,x.indexOf(d))+1;if(a&8)return x.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),I=a&32?{preventScroll:!0}:{},j=0,R=x.length,D;do{if(j>=R||j+R<=0)return 0;let z=T+j;if(a&16)z=(z+R)%R;else{if(z<0)return 3;if(z>=R)return 1}D=x[z],D==null||D.focus(I),j+=N}while(D!==w.activeElement);return a&6&&Dp(D)&&D.select(),2}function Ap(o,a){return C.useMemo(()=>{var s;if(o.type)return o.type;let d=(s=o.as)!=null?s:"button";if(typeof d=="string"&&d.toLowerCase()==="button"||(a==null?void 0:a.tagName)==="BUTTON"&&!a.hasAttribute("type"))return"button"},[o.type,o.as,a])}function Up(){let o=C.useRef(!1);return Wn(()=>(o.current=!0,()=>{o.current=!1}),[]),o}function Hp({onFocus:o}){let[a,s]=C.useState(!0),d=Up();return a?$t.createElement(Oc,{as:"button",type:"button",features:Ic.Focusable,onFocus:h=>{h.preventDefault();let w,x=50;function N(){if(x--<=0){w&&cancelAnimationFrame(w);return}if(o()){if(cancelAnimationFrame(w),!d.current)return;s(!1);return}w=requestAnimationFrame(N)}w=requestAnimationFrame(N)}}):null}const Dc=C.createContext(null);function Vp(){return{groups:new Map,get(o,a){var s;let d=this.groups.get(o);d||(d=new Map,this.groups.set(o,d));let h=(s=d.get(a))!=null?s:0;d.set(a,h+1);let w=Array.from(d.keys()).indexOf(a);function x(){let N=d.get(a);N>1?d.set(a,N-1):d.delete(a)}return[w,x]}}}function Bp({children:o}){let a=C.useRef(Vp());return C.createElement(Dc.Provider,{value:a},o)}function Ac(o){let a=C.useContext(Dc);if(!a)throw new Error("You must wrap your component in a ");let s=C.useId(),[d,h]=a.current.get(o,s);return C.useEffect(()=>h,[]),d}var Wp=(o=>(o[o.Forwards=0]="Forwards",o[o.Backwards=1]="Backwards",o))(Wp||{}),Qp=(o=>(o[o.Less=-1]="Less",o[o.Equal=0]="Equal",o[o.Greater=1]="Greater",o))(Qp||{}),Kp=(o=>(o[o.SetSelectedIndex=0]="SetSelectedIndex",o[o.RegisterTab=1]="RegisterTab",o[o.UnregisterTab=2]="UnregisterTab",o[o.RegisterPanel=3]="RegisterPanel",o[o.UnregisterPanel=4]="UnregisterPanel",o))(Kp||{});let Yp={0(o,a){var s;let d=Bn(o.tabs,j=>j.current),h=Bn(o.panels,j=>j.current),w=d.filter(j=>{var R;return!((R=j.current)!=null&&R.hasAttribute("disabled"))}),x={...o,tabs:d,panels:h};if(a.index<0||a.index>d.length-1){let j=mn(Math.sign(a.index-o.selectedIndex),{[-1]:()=>1,0:()=>mn(Math.sign(a.index),{[-1]:()=>0,0:()=>0,1:()=>1}),1:()=>0});if(w.length===0)return x;let R=mn(j,{0:()=>d.indexOf(w[0]),1:()=>d.indexOf(w[w.length-1])});return{...x,selectedIndex:R===-1?o.selectedIndex:R}}let N=d.slice(0,a.index),T=[...d.slice(a.index),...N].find(j=>w.includes(j));if(!T)return x;let I=(s=d.indexOf(T))!=null?s:o.selectedIndex;return I===-1&&(I=o.selectedIndex),{...x,selectedIndex:I}},1(o,a){if(o.tabs.includes(a.tab))return o;let s=o.tabs[o.selectedIndex],d=Bn([...o.tabs,a.tab],w=>w.current),h=o.selectedIndex;return o.info.current.isControlled||(h=d.indexOf(s),h===-1&&(h=o.selectedIndex)),{...o,tabs:d,selectedIndex:h}},2(o,a){return{...o,tabs:o.tabs.filter(s=>s!==a.tab)}},3(o,a){return o.panels.includes(a.panel)?o:{...o,panels:Bn([...o.panels,a.panel],s=>s.current)}},4(o,a){return{...o,panels:o.panels.filter(s=>s!==a.panel)}}},fi=C.createContext(null);fi.displayName="TabsDataContext";function Qn(o){let a=C.useContext(fi);if(a===null){let s=new Error(`<${o} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(s,Qn),s}return a}let di=C.createContext(null);di.displayName="TabsActionsContext";function pi(o){let a=C.useContext(di);if(a===null){let s=new Error(`<${o} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(s,pi),s}return a}function Gp(o,a){return mn(a.type,Yp,o,a)}let Xp="div";function Zp(o,a){let{defaultIndex:s=0,vertical:d=!1,manual:h=!1,onChange:w,selectedIndex:x=null,...N}=o;const T=d?"vertical":"horizontal",I=h?"manual":"auto";let j=x!==null,R=Mr({isControlled:j}),D=Ur(a),[z,V]=C.useReducer(Gp,{info:R,selectedIndex:x??s,tabs:[],panels:[]}),G=C.useMemo(()=>({selectedIndex:z.selectedIndex}),[z.selectedIndex]),Z=Mr(w||(()=>{})),X=Mr(z.tabs),B=C.useMemo(()=>({orientation:T,activation:I,...z}),[T,I,z]),ve=Ct(ie=>(V({type:1,tab:ie}),()=>V({type:2,tab:ie}))),de=Ct(ie=>(V({type:3,panel:ie}),()=>V({type:4,panel:ie}))),ye=Ct(ie=>{oe.current!==ie&&Z.current(ie),j||V({type:0,index:ie})}),oe=Mr(j?o.selectedIndex:z.selectedIndex),Se=C.useMemo(()=>({registerTab:ve,registerPanel:de,change:ye}),[]);Wn(()=>{V({type:0,index:x??s})},[x]),Wn(()=>{if(oe.current===void 0||z.tabs.length<=0)return;let ie=Bn(z.tabs,Me=>Me.current);ie.some((Me,Pe)=>z.tabs[Pe]!==Me)&&ye(ie.indexOf(z.tabs[oe.current]))});let Re={ref:D},Be=Kn();return $t.createElement(Bp,null,$t.createElement(di.Provider,{value:Se},$t.createElement(fi.Provider,{value:B},B.tabs.length<=0&&$t.createElement(Hp,{onFocus:()=>{var ie,Me;for(let Pe of X.current)if(((ie=Pe.current)==null?void 0:ie.tabIndex)===0)return(Me=Pe.current)==null||Me.focus(),!0;return!1}}),Be({ourProps:Re,theirProps:N,slot:G,defaultTag:Xp,name:"Tabs"}))))}let Jp="div";function qp(o,a){let{orientation:s,selectedIndex:d}=Qn("Tab.List"),h=Ur(a),w=C.useMemo(()=>({selectedIndex:d}),[d]),x=o,N={ref:h,role:"tablist","aria-orientation":s};return Kn()({ourProps:N,theirProps:x,slot:w,defaultTag:Jp,name:"Tabs.List"})}let bp="button";function em(o,a){var s,d;let h=C.useId(),{id:w=`headlessui-tabs-tab-${h}`,disabled:x=!1,autoFocus:N=!1,...T}=o,{orientation:I,activation:j,selectedIndex:R,tabs:D,panels:z}=Qn("Tab"),V=pi("Tab"),G=Qn("Tab"),[Z,X]=C.useState(null),B=C.useRef(null),ve=Ur(B,a,X);Wn(()=>V.registerTab(B),[V,B]);let de=Ac("tabs"),ye=D.indexOf(B);ye===-1&&(ye=de);let oe=ye===R,Se=Ct(F=>{var m;let S=F();if(S===Ir.Success&&j==="auto"){let J=(m=Fc(B))==null?void 0:m.activeElement,q=G.tabs.findIndex(ee=>ee.current===J);q!==-1&&V.change(q)}return S}),Re=Ct(F=>{let m=D.map(S=>S.current).filter(Boolean);if(F.key===yt.Space||F.key===yt.Enter){F.preventDefault(),F.stopPropagation(),V.change(ye);return}switch(F.key){case yt.Home:case yt.PageUp:return F.preventDefault(),F.stopPropagation(),Se(()=>Vn(m,gt.First));case yt.End:case yt.PageDown:return F.preventDefault(),F.stopPropagation(),Se(()=>Vn(m,gt.Last))}if(Se(()=>mn(I,{vertical(){return F.key===yt.ArrowUp?Vn(m,gt.Previous|gt.WrapAround):F.key===yt.ArrowDown?Vn(m,gt.Next|gt.WrapAround):Ir.Error},horizontal(){return F.key===yt.ArrowLeft?Vn(m,gt.Previous|gt.WrapAround):F.key===yt.ArrowRight?Vn(m,gt.Next|gt.WrapAround):Ir.Error}}))===Ir.Success)return F.preventDefault()}),Be=C.useRef(!1),ie=Ct(()=>{var F;Be.current||(Be.current=!0,(F=B.current)==null||F.focus({preventScroll:!0}),V.change(ye),zc(()=>{Be.current=!1}))}),Me=Ct(F=>{F.preventDefault()}),{isFocusVisible:Pe,focusProps:Ue}=Lc({autoFocus:N}),{isHovered:We,hoverProps:nt}=mp({isDisabled:x}),{pressed:Fe,pressProps:pe}=xp({disabled:x}),$=C.useMemo(()=>({selected:oe,hover:We,active:Fe,focus:Pe,autofocus:N,disabled:x}),[oe,We,Pe,Fe,N,x]),K=Mc({ref:ve,onKeyDown:Re,onMouseDown:Me,onClick:ie,id:w,role:"tab",type:Ap(o,Z),"aria-controls":(d=(s=z[ye])==null?void 0:s.current)==null?void 0:d.id,"aria-selected":oe,tabIndex:oe?0:-1,disabled:x||void 0,autoFocus:N},Ue,nt,pe);return Kn()({ourProps:K,theirProps:T,slot:$,defaultTag:bp,name:"Tabs.Tab"})}let tm="div";function nm(o,a){let{selectedIndex:s}=Qn("Tab.Panels"),d=Ur(a),h=C.useMemo(()=>({selectedIndex:s}),[s]),w=o,x={ref:d};return Kn()({ourProps:x,theirProps:w,slot:h,defaultTag:tm,name:"Tabs.Panels"})}let rm="div",lm=ii.RenderStrategy|ii.Static;function um(o,a){var s,d,h,w;let x=C.useId(),{id:N=`headlessui-tabs-panel-${x}`,tabIndex:T=0,...I}=o,{selectedIndex:j,tabs:R,panels:D}=Qn("Tab.Panel"),z=pi("Tab.Panel"),V=C.useRef(null),G=Ur(V,a);Wn(()=>z.registerPanel(V),[z,V]);let Z=Ac("panels"),X=D.indexOf(V);X===-1&&(X=Z);let B=X===j,{isFocusVisible:ve,focusProps:de}=Lc(),ye=C.useMemo(()=>({selected:B,focus:ve}),[B,ve]),oe=Mc({ref:G,id:N,role:"tabpanel","aria-labelledby":(d=(s=R[X])==null?void 0:s.current)==null?void 0:d.id,tabIndex:B?T:-1},de),Se=Kn();return!B&&((h=I.unmount)==null||h)&&!((w=I.static)!=null&&w)?$t.createElement(Oc,{"aria-hidden":"true",...oe}):Se({ourProps:oe,theirProps:I,slot:ye,defaultTag:rm,features:lm,visible:B,name:"Tabs.Panel"})}let om=Yn(em),Uc=Yn(Zp),Hc=Yn(qp),Vc=Yn(nm),si=Yn(um),wc=Object.assign(om,{Group:Uc,List:Hc,Panels:Vc,Panel:si});/** * @license lucide-react v0.474.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const im=o=>o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Bc=(...o)=>o.filter((a,s,d)=>!!a&&a.trim()!==""&&d.indexOf(a)===s).join(" ").trim();/** * @license lucide-react v0.474.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var sm={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.474.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const am=C.forwardRef(({color:o="currentColor",size:a=24,strokeWidth:s=2,absoluteStrokeWidth:d,className:h="",children:w,iconNode:x,...N},T)=>C.createElement("svg",{ref:T,...sm,width:a,height:a,stroke:o,strokeWidth:d?Number(s)*24/Number(a):s,className:Bc("lucide",h),...N},[...x.map(([I,j])=>C.createElement(I,j)),...Array.isArray(w)?w:[w]]));/** * @license lucide-react v0.474.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Gn=(o,a)=>{const s=C.forwardRef(({className:d,...h},w)=>C.createElement(am,{ref:w,iconNode:a,className:Bc(`lucide-${im(o)}`,d),...h}));return s.displayName=`${o}`,s};/** * @license lucide-react v0.474.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const cm=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],fm=Gn("ArrowLeft",cm);/** * @license lucide-react v0.474.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const dm=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Wc=Gn("Copy",dm);/** * @license lucide-react v0.474.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const pm=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],mm=Gn("EyeOff",pm);/** * @license lucide-react v0.474.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const hm=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],vm=Gn("Eye",hm);/** * @license lucide-react v0.474.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ym=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Qc=Gn("Info",ym);/** * @license lucide-react v0.474.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const gm=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],wm=Gn("Settings",gm),Sc={openai_api_key:"OpenAI API Key",anthropic_api_key:"Anthropic API Key",assembly_ai_api_key:"AssemblyAI API Key",deepgram_api_key:"Deepgram API Key",groq_api_key:"Groq API Key"};function Sm({onClose:o}){const[a,s]=C.useState(Object.keys(Sc).reduce((j,R)=>({...j,[R]:!1}),{})),[d,h]=C.useState({}),[w,x]=C.useState(""),[N,T]=C.useState(!1);C.useEffect(()=>{fetch("/settings").then(j=>j.json()).then(j=>h(j)).catch(()=>x("Failed to load settings"))},[]);const I=async()=>{x(""),T(!0);try{if(!(await fetch("/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)})).ok)throw new Error("Failed to save settings");o()}catch(j){console.error(j),x("Failed to save settings. Please try again.")}finally{T(!1)}};return P.jsxs(P.Fragment,{children:[P.jsx("div",{className:"py-4",children:P.jsx("button",{onClick:o,className:"rounded-full p-2 hover:bg-gray-100",children:P.jsx(fm,{size:24})})}),P.jsxs("div",{className:"mx-auto mt-8 max-w-md space-y-6",children:[Object.keys(d).map(j=>P.jsxs("div",{children:[P.jsx("label",{className:"mb-2 block text-sm font-medium",children:Sc[j]}),P.jsxs("div",{className:"relative",children:[P.jsx("input",{type:a[j]?"text":"password",value:d[j],onChange:R=>h(D=>({...D,[j]:R.target.value})),className:"w-full rounded-lg border px-4 py-2 pr-10"}),P.jsx("button",{onClick:()=>s(R=>({...R,[j]:!R[j]})),className:"absolute top-1/2 right-2 -translate-y-1/2",children:a[j]?P.jsx(mm,{size:20}):P.jsx(vm,{size:20})})]})]},j)),w&&P.jsx("div",{className:"rounded-md bg-red-50 p-4",children:P.jsx("p",{className:"text-sm text-red-700",children:w})}),P.jsx("div",{className:"flex justify-center",children:P.jsx("button",{onClick:()=>void I(),disabled:N,className:"w-1/2 rounded-lg bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 disabled:opacity-50",children:N?"Saving...":"Save Settings"})})]})]})}function xm(){const[o,a]=C.useState(""),[s,d]=C.useState([]),[h,w]=C.useState(""),[x,N]=C.useState(!1),[T,I]=C.useState(""),[j,R]=C.useState(""),[D,z]=C.useState(!1),V=C.useRef("");C.useEffect(()=>{fetch("/models/ytt").then(X=>X.json()).then(X=>{d(X.models),w(X.default)}).catch(console.error)},[]);const G=()=>{N(!0),I(""),V.current="",R("");try{const X=new URLSearchParams({url:o,model:h}),B=new EventSource(`/ytt?${X}`);B.onmessage=ve=>{if(ve.data==="error"){I("Transcription failed"),B.close();return}V.current+=ve.data,R(V.current)},B.onerror=()=>{I("Connection error"),B.close(),N(!1)},B.addEventListener("done",()=>{B.close(),N(!1)})}catch(X){I(X instanceof Error?X.message:"An error occurred"),N(!1)}},Z=()=>{navigator.clipboard.writeText(j),z(!0),setTimeout(()=>z(!1),2e3)};return P.jsxs("div",{className:"space-y-4 p-4",children:[P.jsx("p",{className:"mb-4 text-lg text-gray-600",children:"Generate transcripts from YouTube podcasts."}),P.jsxs("div",{children:[P.jsx("label",{className:"mb-2 block text-sm font-medium",children:"YouTube URL"}),P.jsx("input",{type:"text",value:o,onChange:X=>a(X.target.value),placeholder:"Enter YouTube URL",className:"w-full rounded-lg border px-4 py-2"}),P.jsxs("div",{className:"mt-2 flex items-start space-x-2 rounded-lg bg-blue-50 p-4",children:[P.jsx(Qc,{className:"mt-0.5 h-5 w-5 text-blue-600"}),P.jsx("p",{className:"text-sm text-blue-700",children:"Transcripts are generated by formatting autogenerated captions"})]})]}),P.jsxs("div",{children:[P.jsx("label",{className:"mb-2 block text-sm font-medium",children:"Model"}),P.jsx("select",{value:h,onChange:X=>w(X.target.value),className:"w-full rounded-lg border px-4 py-2",children:s.map(X=>P.jsx("option",{value:X,children:X},X))})]}),P.jsx("div",{className:"flex justify-center",children:P.jsx("button",{onClick:G,disabled:x||!o,className:"w-1/2 rounded-lg bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 disabled:bg-blue-300",children:x?P.jsxs("span",{className:"flex items-center justify-center",children:[P.jsxs("svg",{className:"mr-2 h-5 w-5 animate-spin",viewBox:"0 0 24 24",children:[P.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),P.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Transcribing..."]}):"Transcribe"})}),T&&P.jsx("div",{className:"rounded-lg bg-red-50 p-4 text-red-700",children:T}),j&&P.jsxs("div",{className:"mt-4 rounded-lg border p-4",children:[P.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[P.jsx("h3",{className:"font-medium",children:"Transcript"}),P.jsxs("button",{onClick:()=>void Z(),className:"relative text-gray-400 hover:text-gray-600","aria-label":"Copy transcript",children:[P.jsx(Wc,{className:"h-5 w-5"}),D&&P.jsx("span",{className:"absolute -top-8 -right-2 rounded bg-gray-800 px-2 py-1 text-xs text-white",children:"Copied"})]})]}),P.jsx("div",{className:"whitespace-pre-wrap text-gray-700",children:j})]})]})}function km(){const[o,a]=C.useState(""),[s,d]=C.useState("deepgram"),[h,w]=C.useState([]),[x,N]=C.useState(""),[T,I]=C.useState(!1),[j,R]=C.useState(""),[D,z]=C.useState(""),[V,G]=C.useState(!1);C.useEffect(()=>{fetch(`/models/${s}`).then(B=>B.json()).then(B=>{w(B.models),N(B.default)}).catch(console.error)},[s]);const Z=()=>{(async()=>{I(!0),R(""),z("");try{const B=await fetch("/audio",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:o,service:s,model:x})});if(!B.ok){const de=await B.json();throw new Error(de.error??"Failed to transcribe audio")}const ve=await B.json();z(ve.text)}catch(B){R(B instanceof Error?B.message:"An error occurred")}finally{I(!1)}})()},X=()=>{navigator.clipboard.writeText(D),G(!0),setTimeout(()=>G(!1),2e3)};return P.jsxs("div",{className:"space-y-4 p-4",children:[P.jsx("p",{className:"mb-4 text-lg text-gray-600",children:"Generate transcripts for audio files online."}),P.jsxs("div",{children:[P.jsx("label",{className:"mb-2 block text-sm font-medium",children:"Audio URL"}),P.jsx("input",{type:"text",value:o,onChange:B=>a(B.target.value),placeholder:"Enter Audio URL",className:"w-full rounded-lg border px-4 py-2"}),P.jsxs("div",{className:"mt-2 flex items-start space-x-2 rounded-lg bg-blue-50 p-4",children:[P.jsx(Qc,{className:"mt-0.5 h-5 w-5 text-blue-600"}),P.jsxs("p",{className:"text-sm text-blue-700",children:["You can find the audio download link for a podcast on"," ",P.jsx("a",{href:"https://www.listennotes.com/",className:"underline hover:text-blue-800",children:"ListenNotes"})]})]})]}),P.jsxs("div",{children:[P.jsx("label",{className:"mb-2 block text-sm font-medium",children:"Speech-to-Text (STT) API Service"}),P.jsxs("select",{value:s,onChange:B=>d(B.target.value),className:"w-full rounded-lg border px-4 py-2",children:[P.jsx("option",{value:"deepgram",children:"Deepgram"}),P.jsx("option",{value:"aai",children:"AssemblyAI"})]})]}),P.jsxs("div",{children:[P.jsx("label",{className:"mb-2 block text-sm font-medium",children:"Model"}),P.jsx("select",{value:x,onChange:B=>N(B.target.value),className:"w-full rounded-lg border px-4 py-2",children:h.map(B=>P.jsx("option",{value:B,children:B},B))})]}),P.jsx("div",{className:"flex justify-center",children:P.jsx("button",{onClick:()=>Z(),disabled:T||!o,className:"w-1/2 rounded-lg bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 disabled:bg-blue-300",children:T?P.jsxs("span",{className:"flex items-center justify-center",children:[P.jsxs("svg",{className:"mr-2 h-5 w-5 animate-spin",viewBox:"0 0 24 24",children:[P.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),P.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Transcribing..."]}):"Transcribe"})}),j&&P.jsx("div",{className:"rounded-lg bg-red-50 p-4 text-red-700",children:j}),D&&P.jsxs("div",{className:"mt-4 rounded-lg border p-4",children:[P.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[P.jsx("h3",{className:"font-medium",children:"Transcript"}),P.jsxs("button",{onClick:()=>void X(),className:"relative text-gray-400 hover:text-gray-600","aria-label":"Copy transcript",children:[P.jsx(Wc,{className:"h-5 w-5"}),V&&P.jsx("span",{className:"absolute -top-8 -right-2 rounded bg-gray-800 px-2 py-1 text-xs text-white",children:"Copied"})]})]}),P.jsx("div",{className:"whitespace-pre-wrap text-gray-700",children:D})]})]})}function Em(){const[o,a]=C.useState(!1);return P.jsx(P.Fragment,{children:P.jsxs("div",{className:"mx-auto max-w-3xl px-4",children:[P.jsxs("div",{className:"flex h-16 items-center justify-between py-4",children:[P.jsx("h1",{className:"font-mono text-2xl font-bold",children:"podscript"}),!o&&P.jsx("button",{onClick:()=>a(!0),className:"rounded-full p-2 hover:bg-gray-100",children:P.jsx(wm,{size:24})})]}),o?P.jsx(Sm,{onClose:()=>a(!1)}):P.jsxs(Uc,{children:[P.jsxs(Hc,{className:"flex space-x-1 rounded-xl bg-gray-100 p-1",children:[P.jsx(wc,{className:({selected:s})=>`w-full rounded-lg py-2.5 text-sm leading-5 font-medium ${s?"bg-white shadow":"text-gray-700 hover:bg-white/[0.12] hover:text-gray-800"}`,children:"YouTube URL"}),P.jsx(wc,{className:({selected:s})=>`w-full rounded-lg py-2.5 text-sm leading-5 font-medium ${s?"bg-white shadow":"text-gray-700 hover:bg-white/[0.12] hover:text-gray-800"}`,children:"Audio URL"})]}),P.jsxs(Vc,{className:"mt-4",children:[P.jsx(si,{children:P.jsx(xm,{})}),P.jsx(si,{children:P.jsx(km,{})})]})]})]})})}Jd.createRoot(document.getElementById("root")).render(P.jsx(C.StrictMode,{children:P.jsx(Em,{})})); ================================================ FILE: web/frontend/dist/index.html ================================================ Podscript ================================================ FILE: web/frontend/eslint.config.js ================================================ import js from '@eslint/js' import globals from 'globals' import reactHooks from 'eslint-plugin-react-hooks' import reactRefresh from 'eslint-plugin-react-refresh' import react from 'eslint-plugin-react' import tseslint from 'typescript-eslint' import prettier from 'eslint-plugin-prettier' export default tseslint.config( { ignores: ['dist', 'src/components/ui/**', 'eslint.config.js'] }, // Base configuration for all files { files: ['**/*.{js,jsx,ts,tsx}'], extends: [js.configs.recommended], plugins: { react, prettier, 'react-hooks': reactHooks, 'react-refresh': reactRefresh, }, settings: { react: { version: '18.3', }, }, rules: { 'no-unused-vars': 'error', 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }], ...reactHooks.configs.recommended.rules, ...react.configs.recommended.rules, ...react.configs['jsx-runtime'].rules, ...prettier.configs.recommended.rules, }, }, // TypeScript-specific configuration { files: ['**/*.{ts,tsx}'], extends: [...tseslint.configs.recommendedTypeChecked, ...tseslint.configs.stylisticTypeChecked], languageOptions: { ecmaVersion: 2020, globals: globals.browser, parserOptions: { project: ['./tsconfig.node.json', './tsconfig.app.json'], tsconfigRootDir: import.meta.dirname, }, }, }, ) ================================================ FILE: web/frontend/index.html ================================================Podscript ================================================ FILE: web/frontend/package.json ================================================ { "name": "frontend", "private": true, "version": "0.0.0", "type": "module", "scripts": { "dev": "vite --host", "build": "tsc -b && vite build", "lint": "eslint .", "preview": "vite preview" }, "devDependencies": { "@eslint/js": "^9.39.2", "@radix-ui/react-dialog": "^1.1.15", "@radix-ui/react-form": "^0.1.8", "@radix-ui/react-label": "^2.1.8", "@radix-ui/react-select": "^2.2.6", "@radix-ui/react-slot": "^1.2.4", "@radix-ui/react-tabs": "^1.1.13", "@tailwindcss/vite": "^4.1.18", "@types/node": "^25.0.3", "@types/react": "^19.2.7", "@types/react-dom": "^19.2.3", "@vitejs/plugin-react": "^5.1.2", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "eslint": "^9.39.2", "eslint-config-prettier": "^10.1.8", "eslint-plugin-prettier": "^5.5.4", "eslint-plugin-react": "^7.37.4", "eslint-plugin-react-hooks": "^7.0.1", "eslint-plugin-react-refresh": "^0.4.26", "globals": "^16.5.0", "lucide-react": "^0.562.0", "next-themes": "^0.4.4", "prettier": "^3.7.4", "prettier-plugin-tailwindcss": "^0.7.2", "react": "^19.2.3", "react-dom": "^19.2.3", "react-hook-form": "^7.69.0", "tailwind-merge": "^3.4.0", "tailwindcss": "^4.0.0", "tailwindcss-animate": "^1.0.7", "typescript": "^5.9.3", "typescript-eslint": "^8.50.0", "vite": "^7.3.0" }, "dependencies": { "@hookform/resolvers": "^5.2.2", "@radix-ui/react-accordion": "^1.2.12", "sonner": "^2.0.7", "zod": "^4.2.1" } } ================================================ FILE: web/frontend/src/App.tsx ================================================ import { useState, useEffect } from 'react' import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs' import { Button } from '@/components/ui/button' import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from '@/components/ui/sheet' import { Moon, Sun, Settings, Mic, Youtube, AlertCircle } from 'lucide-react' import YouTubeTranscription, { YouTubeTranscriptionState } from '@/components/YouTubeTranscription' import AudioTranscription, { AudioTranscriptionState, AudioProvider, } from '@/components/AudioTranscription' import SettingsPanel from '@/components/SettingsPanel' import { Toaster, toast } from 'sonner' import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert' import { Loader2 } from 'lucide-react' // Speech-to-Text providers const STT_PROVIDERS = [ { value: 'deepgram', label: 'Deepgram' }, { value: 'aai', label: 'AssemblyAI' }, ] interface ModelsResponse { models: string[] default: string } interface ProviderResult { provider: string models: { value: string; label: string }[] defaultModel: string } const App = () => { const [theme, setTheme] = useState('dark') const [ytModels, setYtModels] = useState<{ value: string; label: string }[]>([]) const [audioProviders, setAudioProviders] = useState([]) const [modelsError, setModelsError] = useState('') const [isLoadingModels, setIsLoadingModels] = useState(true) const [youtubeState, setYoutubeState] = useState ({ url: '', model: '', transcript: '', error: '', isTranscribing: false, }) const [audioState, setAudioState] = useState ({ url: '', source: 'deepgram', model: '', transcript: '', error: '', isTranscribing: false, }) // Fetch models on mount useEffect(() => { const fetchModels = async () => { try { // Fetch YouTube models const ytResponse = await fetch('/models/ytt') const ytData = (await ytResponse.json()) as ModelsResponse const ytModelOptions = ytData.models.map(model => ({ value: model, label: model })) setYtModels(ytModelOptions) // Set initial YouTube model setYoutubeState(prev => ({ ...prev, model: ytData.default || (ytData.models.length > 0 ? ytData.models[0] : ''), })) // Fetch audio models for all providers const audioResults = await Promise.all( STT_PROVIDERS.map(async provider => { try { const response = await fetch(`/models/${provider.value}`) const data = (await response.json()) as ModelsResponse return { provider: provider.value, models: data.models.map(model => ({ value: model, label: model })), defaultModel: data.default, } as ProviderResult } catch (error: unknown) { console.error(`Error fetching models for ${provider.value}:`, error) return { provider: provider.value, models: [], defaultModel: '' } as ProviderResult } }), ) // Process audio providers const providers: AudioProvider[] = audioResults .filter(result => result.models.length > 0) .map(result => ({ provider: { value: result.provider, label: STT_PROVIDERS.find(p => p.value === result.provider)?.label ?? result.provider, }, models: result.models, })) setAudioProviders(providers) // Set initial audio model const initialProvider = providers.find(p => p.provider.value === 'deepgram') if (initialProvider?.models.length) { setAudioState(prev => ({ ...prev, model: initialProvider.models[0].value })) } setIsLoadingModels(false) } catch (error: unknown) { console.error('Error fetching models:', error) setModelsError('Failed to load models. Please refresh the page and try again.') setIsLoadingModels(false) } } void fetchModels() }, []) // Update theme when it changes useEffect(() => { document.documentElement.classList.toggle('dark', theme === 'dark') }, [theme]) // Header component const Header = () => ( ) // Loading state if (isLoadingModels) { return ( podscript
Settings ) } // Error state if (modelsError) { return (Loading models...
) } // Main app return (Error {modelsError} ) } export default App ================================================ FILE: web/frontend/src/components/AudioTranscription.tsx ================================================ import { Card, CardContent, CardFooter, CardHeader, CardTitle } from '@/components/ui/card' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '@/components/ui/select' import { Loader2, Copy, Info, Trash2 } from 'lucide-react' import { useCallback } from 'react' import { toast } from 'sonner' export interface AudioTranscriptionState { url: string source: string model: string transcript: string error: string isTranscribing: boolean } export interface ProviderModel { value: string label: string } export interface AudioProvider { provider: ProviderModel models: ProviderModel[] } export interface AudioTranscriptionProps { audioState: AudioTranscriptionState setAudioState: React.Dispatch{ if (youtubeState.isTranscribing || audioState.isTranscribing) { toast.error( 'Please wait for the active transcription to complete before switching tabs', ) return false } }} > YouTube URL Audio URL > providers: AudioProvider[] } // Define response types for better type safety interface TranscriptResponse { text: string error?: string } const AudioTranscription = ({ audioState, setAudioState, providers }: AudioTranscriptionProps) => { // Get models for the current or specified provider const getModels = (providerValue = audioState.source) => { return providers.find(p => p.provider.value === providerValue)?.models ?? [] } // Handle provider selection changes const handleProviderChange = (provider: string) => { const models = getModels(provider) setAudioState(prev => ({ ...prev, source: provider, model: models.length > 0 ? models[0].value : '', })) } // Start transcription const startTranscription = useCallback(async () => { if (!audioState.url || !audioState.source) return setAudioState(prev => ({ ...prev, error: '', transcript: '', isTranscribing: true })) try { const response = await fetch('/audio', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ url: audioState.url, service: audioState.source, model: audioState.model, }), }) const data = (await response.json()) as TranscriptResponse if (!response.ok) { throw new Error(data.error ?? 'Failed to transcribe audio') } setAudioState(prev => ({ ...prev, transcript: data.text, isTranscribing: false })) toast.success('Transcription completed') } catch (e) { const errorMessage = e instanceof Error ? e.message : 'An error occurred' setAudioState(prev => ({ ...prev, error: errorMessage, isTranscribing: false })) toast.error('Transcription failed') } }, [audioState.url, audioState.source, audioState.model, setAudioState]) // Get current models for rendering const currentModels = getModels() return ( ) } export default AudioTranscription ================================================ FILE: web/frontend/src/components/SettingsPanel.tsx ================================================ import { useState, useEffect } from 'react' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' import { Alert, AlertDescription } from '@/components/ui/alert' import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, } from '@/components/ui/accordion' import { AlertCircle, Save, Loader2, Eye, EyeOff } from 'lucide-react' // Define API response type to match backend structure interface ApiSettingsResponse { openai_api_key?: string anthropic_api_key?: string groq_api_key?: string deepgram_api_key?: string assembly_ai_api_key?: string gemini_api_key?: string aws_region?: string aws_access_key_id?: string aws_secret_access_key?: string aws_session_token?: string } // Custom password input component with toggle visibility interface PasswordInputProps { id: string value: string onChange: (e: React.ChangeEvent{audioState.error && ( Generate Transcript from Audio URLs )} {audioState.transcript && ( {audioState.error}
)} Transcript {audioState.transcript}) => void placeholder?: string label: string } const PasswordInput = ({ id, value, onChange, placeholder, label }: PasswordInputProps) => { const [showPassword, setShowPassword] = useState(false) return ( ) } const SettingsPanel = () => { // Initial settings state const [settings, setSettings] = useState({ openai: { apiKey: '' }, anthropic: { apiKey: '' }, groq: { apiKey: '' }, deepgram: { apiKey: '' }, assemblyai: { apiKey: '' }, google: { apiKey: '' }, aws: { accessKeyId: '', secretAccessKey: '', sessionToken: '', region: 'us-east-1', }, }) const [status, setStatus] = useState({ message: '', isError: false }) const [saving, setSaving] = useState(false) const [loading, setLoading] = useState(true) // Fetch settings on component mount useEffect(() => { const fetchSettings = async () => { setLoading(true) try { const response = await fetch('/settings') if (!response.ok) throw new Error('Failed to load settings') // Explicitly type the response data const data = (await response.json()) as ApiSettingsResponse // Map the API response to our settings structure setSettings({ openai: { apiKey: data.openai_api_key ?? '' }, anthropic: { apiKey: data.anthropic_api_key ?? '' }, groq: { apiKey: data.groq_api_key ?? '' }, deepgram: { apiKey: data.deepgram_api_key ?? '' }, assemblyai: { apiKey: data.assembly_ai_api_key ?? '' }, google: { apiKey: data.gemini_api_key ?? '' }, aws: { accessKeyId: data.aws_access_key_id ?? '', secretAccessKey: data.aws_secret_access_key ?? '', sessionToken: data.aws_session_token ?? '', region: data.aws_region ?? 'us-east-1', }, }) } catch (error: unknown) { console.error('Error fetching settings:', error) setStatus({ message: 'Failed to load settings. Please refresh the page.', isError: true, }) } finally { setLoading(false) } } void fetchSettings() }, []) // Handle input changes const handleChange = (provider: string, field: string, value: string) => { setSettings(prev => ({ ...prev, [provider]: { ...prev[provider as keyof typeof prev], [field]: value, }, })) } // Handle form submission const handleSubmit = async (e: React.FormEvent) => { e.preventDefault() setSaving(true) setStatus({ message: '', isError: false }) try { // Map our settings structure to the API expected format const apiPayload: ApiSettingsResponse = { openai_api_key: settings.openai.apiKey, anthropic_api_key: settings.anthropic.apiKey, groq_api_key: settings.groq.apiKey, deepgram_api_key: settings.deepgram.apiKey, assembly_ai_api_key: settings.assemblyai.apiKey, gemini_api_key: settings.google.apiKey, aws_region: settings.aws.region, aws_access_key_id: settings.aws.accessKeyId, aws_secret_access_key: settings.aws.secretAccessKey, aws_session_token: settings.aws.sessionToken, } const response = await fetch('/settings', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(apiPayload), }) if (!response.ok) throw new Error('Failed to save settings') setStatus({ message: 'Settings saved successfully!', isError: false, }) } catch (error: unknown) { console.error('Error saving settings:', error) setStatus({ message: 'Error saving settings. Please try again.', isError: true, }) } finally { setSaving(false) // Clear success message after 3 seconds (keep error messages visible) if (!status.isError) { setTimeout(() => { setStatus({ message: '', isError: false }) }, 3000) } } } if (loading) { return () } return (Loading settings... ) } export default SettingsPanel ================================================ FILE: web/frontend/src/components/YouTubeTranscription.tsx ================================================ import { Card, CardContent, CardFooter, CardHeader, CardTitle } from '@/components/ui/card' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '@/components/ui/select' import { Loader2, Copy, Info, Trash2, X } from 'lucide-react' import { useRef, useEffect, useCallback } from 'react' import { toast } from 'sonner' export interface YouTubeTranscriptionState { url: string model: string transcript: string error: string isTranscribing: boolean } export interface YouTubeTranscriptionProps { youtubeState: YouTubeTranscriptionState setYoutubeState: React.Dispatch{/* Save button that matches the width of the panel */}{' '} {/* Added extra padding at bottom to ensure content doesn't get hidden behind the button */} {status.message && ()} {status.message} > models: { value: string; label: string }[] } // Custom hook for managing YouTube transcription with EventSource function useYouTubeTranscription( youtubeState: YouTubeTranscriptionState, setYoutubeState: React.Dispatch >, ) { const eventSourceRef = useRef (null) // Cleanup function for EventSource const cleanupEventSource = useCallback(() => { if (eventSourceRef.current) { eventSourceRef.current.close() eventSourceRef.current = null } }, []) // Cancel transcription const cancelTranscription = useCallback(() => { cleanupEventSource() setYoutubeState(prev => ({ ...prev, isTranscribing: false, error: 'Transcription cancelled', })) toast.info('Transcription cancelled') }, [cleanupEventSource, setYoutubeState]) // Start transcription const startTranscription = useCallback( (url: string, model: string) => { if (!url) return setYoutubeState(prev => ({ ...prev, error: '', transcript: '', isTranscribing: true, })) try { const params = new URLSearchParams({ url, model }) // Create EventSource const eventSource = new EventSource(`/ytt?${params}`) eventSourceRef.current = eventSource eventSource.onmessage = event => { if (event.data === 'error') { setYoutubeState(prev => ({ ...prev, error: 'Transcription failed', isTranscribing: false, })) cleanupEventSource() return } // Update transcript state with new content setYoutubeState(prev => ({ ...prev, transcript: prev.transcript + event.data, })) } eventSource.onerror = () => { setYoutubeState(prev => ({ ...prev, error: 'Connection error', isTranscribing: false, })) cleanupEventSource() toast.error('Transcription failed') } eventSource.addEventListener('done', () => { cleanupEventSource() setYoutubeState(prev => ({ ...prev, isTranscribing: false, })) toast.success('Transcription completed') }) } catch (e) { setYoutubeState(prev => ({ ...prev, error: e instanceof Error ? e.message : 'An error occurred', isTranscribing: false, })) toast.error('Transcription failed') } }, [cleanupEventSource, setYoutubeState], ) // Cleanup on unmount useEffect(() => { return () => { cleanupEventSource() } }, [cleanupEventSource]) return { startTranscription, cancelTranscription, isTranscribing: youtubeState.isTranscribing, } } const YouTubeTranscription = ({ youtubeState, setYoutubeState, models, }: YouTubeTranscriptionProps) => { const { startTranscription, cancelTranscription, isTranscribing } = useYouTubeTranscription( youtubeState, setYoutubeState, ) // Handle URL input changes const handleUrlChange = (e: React.ChangeEvent ) => { setYoutubeState(prev => ({ ...prev, url: e.target.value, })) } // Handle model selection changes const handleModelChange = (value: string) => { setYoutubeState(prev => ({ ...prev, model: value, })) } // Handle transcription submission const handleTranscribe = (e: React.FormEvent) => { e.preventDefault() startTranscription(youtubeState.url, youtubeState.model) } // Copy transcript to clipboard const copyToClipboard = () => { void navigator.clipboard.writeText(youtubeState.transcript) toast.success('Copied to clipboard') } // Clear transcript and related data const clearTranscript = () => { setYoutubeState(prev => ({ ...prev, transcript: '', error: '', })) toast.success('Transcript cleared') } return ( ) } export default YouTubeTranscription ================================================ FILE: web/frontend/src/components/ui/accordion.tsx ================================================ import * as React from "react" import * as AccordionPrimitive from "@radix-ui/react-accordion" import { ChevronDownIcon } from "lucide-react" import { cn } from "@/lib/utils" function Accordion({ ...props }: React.ComponentProps{youtubeState.error && ( Generate Transcript from YouTube Videos {isTranscribing ? ( ) : ( )})} {youtubeState.transcript && ( {youtubeState.error}
)} Transcript {youtubeState.transcript}) { return } function AccordionItem({ className, ...props }: React.ComponentProps ) { return ( ) } function AccordionTrigger({ className, children, ...props }: React.ComponentProps ) { return ( ) } function AccordionContent({ className, children, ...props }: React.ComponentProps svg]:rotate-180", className )} {...props} > {children} ) { return ( ) } export { Accordion, AccordionItem, AccordionTrigger, AccordionContent } ================================================ FILE: web/frontend/src/components/ui/alert.tsx ================================================ import * as React from "react" import { cva, type VariantProps } from "class-variance-authority" import { cn } from "@/lib/utils" const alertVariants = cva( "relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current", { variants: { variant: { default: "bg-background text-foreground", destructive: "text-destructive-foreground [&>svg]:text-current *:data-[slot=alert-description]:text-destructive-foreground/80", }, }, defaultVariants: { variant: "default", }, } ) function Alert({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps {children}) { return ( ) } function AlertTitle({ className, ...props }: React.ComponentProps<"div">) { return ( ) } function AlertDescription({ className, ...props }: React.ComponentProps<"div">) { return ( ) } export { Alert, AlertTitle, AlertDescription } ================================================ FILE: web/frontend/src/components/ui/button.tsx ================================================ import * as React from "react" import { Slot } from "@radix-ui/react-slot" import { cva, type VariantProps } from "class-variance-authority" import { cn } from "@/lib/utils" const buttonVariants = cva( "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", { variants: { variant: { default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90", destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40", outline: "border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground", secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80", ghost: "hover:bg-accent hover:text-accent-foreground", link: "text-primary underline-offset-4 hover:underline", }, size: { default: "h-9 px-4 py-2 has-[>svg]:px-3", sm: "h-8 rounded-md px-3 has-[>svg]:px-2.5", lg: "h-10 rounded-md px-6 has-[>svg]:px-4", icon: "size-9", }, }, defaultVariants: { variant: "default", size: "default", }, } ) function Button({ className, variant, size, asChild = false, ...props }: React.ComponentProps<"button"> & VariantProps & { asChild?: boolean }) { const Comp = asChild ? Slot : "button" return ( ) } export { Button, buttonVariants } ================================================ FILE: web/frontend/src/components/ui/card.tsx ================================================ import * as React from "react" import { cn } from "@/lib/utils" function Card({ className, ...props }: React.ComponentProps<"div">) { return ( ) } function CardHeader({ className, ...props }: React.ComponentProps<"div">) { return ( ) } function CardTitle({ className, ...props }: React.ComponentProps<"div">) { return ( ) } function CardDescription({ className, ...props }: React.ComponentProps<"div">) { return ( ) } function CardContent({ className, ...props }: React.ComponentProps<"div">) { return ( ) } function CardFooter({ className, ...props }: React.ComponentProps<"div">) { return ( ) } export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } ================================================ FILE: web/frontend/src/components/ui/form.tsx ================================================ import * as React from "react" import * as LabelPrimitive from "@radix-ui/react-label" import { Slot } from "@radix-ui/react-slot" import { Controller, ControllerProps, FieldPath, FieldValues, FormProvider, useFormContext, useFormState, } from "react-hook-form" import { cn } from "@/lib/utils" import { Label } from "@/components/ui/label" const Form = FormProvider type FormFieldContextValue< TFieldValues extends FieldValues = FieldValues, TName extends FieldPath = FieldPath , > = { name: TName } const FormFieldContext = React.createContext ( {} as FormFieldContextValue ) const FormField = < TFieldValues extends FieldValues = FieldValues, TName extends FieldPath = FieldPath , >({ ...props }: ControllerProps ) => { return ( ) } const useFormField = () => { const fieldContext = React.useContext(FormFieldContext) const itemContext = React.useContext(FormItemContext) const { getFieldState } = useFormContext() const formState = useFormState({ name: fieldContext.name }) const fieldState = getFieldState(fieldContext.name, formState) if (!fieldContext) { throw new Error("useFormField should be used within ") } const { id } = itemContext return { id, name: fieldContext.name, formItemId: `${id}-form-item`, formDescriptionId: `${id}-form-item-description`, formMessageId: `${id}-form-item-message`, ...fieldState, } } type FormItemContextValue = { id: string } const FormItemContext = React.createContext ( {} as FormItemContextValue ) function FormItem({ className, ...props }: React.ComponentProps<"div">) { const id = React.useId() return ( ) } function FormLabel({ className, ...props }: React.ComponentProps ) { const { error, formItemId } = useFormField() return ( ) } function FormControl({ ...props }: React.ComponentProps ) { const { error, formItemId, formDescriptionId, formMessageId } = useFormField() return ( ) } function FormDescription({ className, ...props }: React.ComponentProps<"p">) { const { formDescriptionId } = useFormField() return ( ) } function FormMessage({ className, ...props }: React.ComponentProps<"p">) { const { error, formMessageId } = useFormField() const body = error ? String(error?.message) : props.children if (!body) { return null } return ( {body}
) } export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, } ================================================ FILE: web/frontend/src/components/ui/input.tsx ================================================ import * as React from "react" import { cn } from "@/lib/utils" function Input({ className, type, ...props }: React.ComponentProps<"input">) { return ( ) } export { Input } ================================================ FILE: web/frontend/src/components/ui/label.tsx ================================================ "use client" import * as React from "react" import * as LabelPrimitive from "@radix-ui/react-label" import { cn } from "@/lib/utils" function Label({ className, ...props }: React.ComponentProps) { return ( ) } export { Label } ================================================ FILE: web/frontend/src/components/ui/select.tsx ================================================ import * as React from "react" import * as SelectPrimitive from "@radix-ui/react-select" import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react" import { cn } from "@/lib/utils" function Select({ ...props }: React.ComponentProps ) { return } function SelectGroup({ ...props }: React.ComponentProps ) { return } function SelectValue({ ...props }: React.ComponentProps ) { return } function SelectTrigger({ className, children, ...props }: React.ComponentProps ) { return ( span]:line-clamp-1", className )} {...props} > {children} ) } function SelectContent({ className, children, position = "popper", ...props }: React.ComponentProps) { return ( ) } function SelectLabel({ className, ...props }: React.ComponentProps {children} ) { return ( ) } function SelectItem({ className, children, ...props }: React.ComponentProps ) { return ( ) } function SelectSeparator({ className, ...props }: React.ComponentProps {children} ) { return ( ) } function SelectScrollUpButton({ className, ...props }: React.ComponentProps ) { return ( ) } function SelectScrollDownButton({ className, ...props }: React.ComponentProps ) { return ( ) } export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, } ================================================ FILE: web/frontend/src/components/ui/sheet.tsx ================================================ import * as React from "react" import * as SheetPrimitive from "@radix-ui/react-dialog" import { XIcon } from "lucide-react" import { cn } from "@/lib/utils" function Sheet({ ...props }: React.ComponentProps ) { return } function SheetTrigger({ ...props }: React.ComponentProps ) { return } function SheetClose({ ...props }: React.ComponentProps ) { return } function SheetPortal({ ...props }: React.ComponentProps ) { return } function SheetOverlay({ className, ...props }: React.ComponentProps ) { return ( ) } function SheetContent({ className, children, side = "right", ...props }: React.ComponentProps & { side?: "top" | "right" | "bottom" | "left" }) { return ( ) } function SheetHeader({ className, ...props }: React.ComponentProps<"div">) { return ( ) } function SheetFooter({ className, ...props }: React.ComponentProps<"div">) { return ( ) } function SheetTitle({ className, ...props }: React.ComponentProps {children} Close ) { return ( ) } function SheetDescription({ className, ...props }: React.ComponentProps ) { return ( ) } export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, } ================================================ FILE: web/frontend/src/components/ui/sonner.tsx ================================================ import { useTheme } from "next-themes" import { Toaster as Sonner, ToasterProps } from "sonner" const Toaster = ({ ...props }: ToasterProps) => { const { theme = "system" } = useTheme() return ( ) } export { Toaster } ================================================ FILE: web/frontend/src/components/ui/tabs.tsx ================================================ "use client" import * as React from "react" import * as TabsPrimitive from "@radix-ui/react-tabs" import { cn } from "@/lib/utils" function Tabs({ className, ...props }: React.ComponentProps ) { return ( ) } function TabsList({ className, ...props }: React.ComponentProps ) { return ( ) } function TabsTrigger({ className, ...props }: React.ComponentProps ) { return ( ) } function TabsContent({ className, ...props }: React.ComponentProps ) { return ( ) } export { Tabs, TabsList, TabsTrigger, TabsContent } ================================================ FILE: web/frontend/src/index.css ================================================ @import 'tailwindcss'; @plugin 'tailwindcss-animate'; @custom-variant dark (&:is(.dark *)); :root { --background: oklch(1 0 0); --foreground: oklch(0.13 0.028 261.692); --card: oklch(1 0 0); --card-foreground: oklch(0.13 0.028 261.692); --popover: oklch(1 0 0); --popover-foreground: oklch(0.13 0.028 261.692); --primary: oklch(0.21 0.034 264.665); --primary-foreground: oklch(0.985 0.002 247.839); --secondary: oklch(0.967 0.003 264.542); --secondary-foreground: oklch(0.21 0.034 264.665); --muted: oklch(0.967 0.003 264.542); --muted-foreground: oklch(0.551 0.027 264.364); --accent: oklch(0.967 0.003 264.542); --accent-foreground: oklch(0.21 0.034 264.665); --destructive: oklch(0.577 0.245 27.325); --destructive-foreground: oklch(0.577 0.245 27.325); --border: oklch(0.928 0.006 264.531); --input: oklch(0.928 0.006 264.531); --ring: oklch(0.872 0.01 258.338); --chart-1: oklch(0.646 0.222 41.116); --chart-2: oklch(0.6 0.118 184.704); --chart-3: oklch(0.398 0.07 227.392); --chart-4: oklch(0.828 0.189 84.429); --chart-5: oklch(0.769 0.188 70.08); --radius: 0.625rem; --sidebar: oklch(0.985 0.002 247.839); --sidebar-foreground: oklch(0.13 0.028 261.692); --sidebar-primary: oklch(0.21 0.034 264.665); --sidebar-primary-foreground: oklch(0.985 0.002 247.839); --sidebar-accent: oklch(0.967 0.003 264.542); --sidebar-accent-foreground: oklch(0.21 0.034 264.665); --sidebar-border: oklch(0.928 0.006 264.531); --sidebar-ring: oklch(0.872 0.01 258.338); } .dark { --background: oklch(0.13 0.028 261.692); --foreground: oklch(0.985 0.002 247.839); --card: oklch(0.13 0.028 261.692); --card-foreground: oklch(0.985 0.002 247.839); --popover: oklch(0.13 0.028 261.692); --popover-foreground: oklch(0.985 0.002 247.839); --primary: oklch(0.985 0.002 247.839); --primary-foreground: oklch(0.21 0.034 264.665); --secondary: oklch(0.278 0.033 256.848); --secondary-foreground: oklch(0.985 0.002 247.839); --muted: oklch(0.278 0.033 256.848); --muted-foreground: oklch(0.707 0.022 261.325); --accent: oklch(0.278 0.033 256.848); --accent-foreground: oklch(0.985 0.002 247.839); --destructive: oklch(0.396 0.141 25.723); --destructive-foreground: oklch(0.637 0.237 25.331); --border: oklch(0.278 0.033 256.848); --input: oklch(0.278 0.033 256.848); --ring: oklch(0.446 0.03 256.802); --chart-1: oklch(0.488 0.243 264.376); --chart-2: oklch(0.696 0.17 162.48); --chart-3: oklch(0.769 0.188 70.08); --chart-4: oklch(0.627 0.265 303.9); --chart-5: oklch(0.645 0.246 16.439); --sidebar: oklch(0.21 0.034 264.665); --sidebar-foreground: oklch(0.985 0.002 247.839); --sidebar-primary: oklch(0.488 0.243 264.376); --sidebar-primary-foreground: oklch(0.985 0.002 247.839); --sidebar-accent: oklch(0.278 0.033 256.848); --sidebar-accent-foreground: oklch(0.985 0.002 247.839); --sidebar-border: oklch(0.278 0.033 256.848); --sidebar-ring: oklch(0.446 0.03 256.802); } @theme inline { --color-background: var(--background); --color-foreground: var(--foreground); --color-card: var(--card); --color-card-foreground: var(--card-foreground); --color-popover: var(--popover); --color-popover-foreground: var(--popover-foreground); --color-primary: var(--primary); --color-primary-foreground: var(--primary-foreground); --color-secondary: var(--secondary); --color-secondary-foreground: var(--secondary-foreground); --color-muted: var(--muted); --color-muted-foreground: var(--muted-foreground); --color-accent: var(--accent); --color-accent-foreground: var(--accent-foreground); --color-destructive: var(--destructive); --color-destructive-foreground: var(--destructive-foreground); --color-border: var(--border); --color-input: var(--input); --color-ring: var(--ring); --color-chart-1: var(--chart-1); --color-chart-2: var(--chart-2); --color-chart-3: var(--chart-3); --color-chart-4: var(--chart-4); --color-chart-5: var(--chart-5); --radius-sm: calc(var(--radius) - 4px); --radius-md: calc(var(--radius) - 2px); --radius-lg: var(--radius); --radius-xl: calc(var(--radius) + 4px); --color-sidebar: var(--sidebar); --color-sidebar-foreground: var(--sidebar-foreground); --color-sidebar-primary: var(--sidebar-primary); --color-sidebar-primary-foreground: var(--sidebar-primary-foreground); --color-sidebar-accent: var(--sidebar-accent); --color-sidebar-accent-foreground: var(--sidebar-accent-foreground); --color-sidebar-border: var(--sidebar-border); --color-sidebar-ring: var(--sidebar-ring); } @layer base { * { @apply border-border outline-ring/50; } body { @apply bg-background text-foreground; } } ================================================ FILE: web/frontend/src/lib/utils.ts ================================================ import { clsx, type ClassValue } from 'clsx' import { twMerge } from 'tailwind-merge' export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)) } ================================================ FILE: web/frontend/src/main.tsx ================================================ import { StrictMode } from 'react' import { createRoot } from 'react-dom/client' import './index.css' import App from './App.tsx' createRoot(document.getElementById('root')!).render( , ) ================================================ FILE: web/frontend/src/vite-env.d.ts ================================================ /// ================================================ FILE: web/frontend/tsconfig.app.json ================================================ { "compilerOptions": { "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", "incremental": true, "target": "ES2020", "useDefineForClassFields": true, "lib": ["ES2020", "DOM", "DOM.Iterable"], "module": "ESNext", "skipLibCheck": true, /* Bundler mode */ "moduleResolution": "bundler", "allowImportingTsExtensions": true, "isolatedModules": true, "moduleDetection": "force", "noEmit": true, "jsx": "react-jsx", /* Linting */ "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, "noFallthroughCasesInSwitch": true, "noUncheckedSideEffectImports": true, /* Path Aliases */ "baseUrl": ".", "paths": { "@/*": ["./src/*"] } }, "include": ["src"] } ================================================ FILE: web/frontend/tsconfig.json ================================================ { "files": [], "references": [{ "path": "./tsconfig.app.json" }, { "path": "./tsconfig.node.json" }], "compilerOptions": { "baseUrl": ".", "paths": { "@/*": ["./src/*"] } } } ================================================ FILE: web/frontend/tsconfig.node.json ================================================ { "compilerOptions": { "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", "incremental": true, "target": "ES2022", "lib": ["ES2023"], "module": "ESNext", "skipLibCheck": true, /* Bundler mode */ "moduleResolution": "bundler", "allowImportingTsExtensions": true, "isolatedModules": true, "moduleDetection": "force", "noEmit": true, /* Linting */ "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, "noFallthroughCasesInSwitch": true, "noUncheckedSideEffectImports": true }, "include": ["vite.config.ts"] } ================================================ FILE: web/frontend/vite.config.ts ================================================ import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' import tailwindcss from '@tailwindcss/vite' // https://vite.dev/config/ export default defineConfig({ plugins: [react(), tailwindcss()], resolve: { alias: { '@': '/src', }, }, build: { outDir: '../../dist', emptyOutDir: true, }, }) ================================================ FILE: web.go ================================================ package main import ( "embed" "encoding/json" "fmt" "io/fs" "net/http" "strings" aai "github.com/AssemblyAI/assemblyai-go-sdk" restapi "github.com/deepgram/deepgram-go-sdk/v2/pkg/api/listen/v1/rest" clientinterfaces "github.com/deepgram/deepgram-go-sdk/v2/pkg/client/interfaces/v1" client "github.com/deepgram/deepgram-go-sdk/v2/pkg/client/listen/v1/rest" ) //go:embed dist var frontend embed.FS type WebCmd struct { Dev bool `help:"Run in development mode" default:"false"` Port int `help:"Preferred port to run the server on" default:"8080"` } var modelConfigs = map[string]struct { Models []string Default string }{ "ytt": { Models: []string{ string(GPT4o), string(GPT4oMini), string(Claude37Sonnet), string(Claude35Haiku), string(Llama3370b), string(Llama318b), string(Gemini2Flash), string(BedrockClaude37Sonnet), string(BedrockClaude35Haiku), }, Default: string(GPT4o), }, "aai": { Models: []string{"best", "nano"}, Default: "best", }, "deepgram": { Models: []string{"nova-2", "phonecall", "finance", "video"}, Default: "nova-2", }, } func (c *WebCmd) Run() error { if c.Dev && c.Port == 8080 { c.Port = 5170 } mux := http.NewServeMux() mux.HandleFunc("GET /settings", handleGetSettings) mux.HandleFunc("POST /settings", handlePostSettings) mux.HandleFunc("GET /models/{subcommand}", handleModels) mux.HandleFunc("GET /ytt", handleYTT) mux.HandleFunc("POST /audio", handleAudioTranscription) if !c.Dev { dist, err := fs.Sub(frontend, "dist") if err != nil { return fmt.Errorf("failed to get dist subfolder: %w", err) } mux.Handle("/", http.FileServer(http.FS(dist))) } fmt.Printf("Starting server on port %d\n", c.Port) return http.ListenAndServe(fmt.Sprintf(":%d", c.Port), mux) } func handleGetSettings(w http.ResponseWriter, r *http.Request) { config, err := ReadConfig() if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return } w.Header().Set("Content-Type", "application/json") json.NewEncoder(w).Encode(config) } func handlePostSettings(w http.ResponseWriter, r *http.Request) { var config Config if err := json.NewDecoder(r.Body).Decode(&config); err != nil { http.Error(w, err.Error(), http.StatusBadRequest) return } if err := WriteConfig(&config); err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return } w.WriteHeader(http.StatusOK) } func handleModels(w http.ResponseWriter, r *http.Request) { subcommand := r.PathValue("subcommand") config, exists := modelConfigs[subcommand] if !exists { http.Error(w, "Subcommand not found", http.StatusNotFound) return } w.Header().Set("Content-Type", "application/json") json.NewEncoder(w).Encode(map[string]interface{}{ "models": config.Models, "default": config.Default, }) } type AudioURLTranscriptionRequest struct { URL string `json:"url"` Service string `json:"service"` Model string `json:"model"` } type AudioURLTranscriptionResponse struct { Text string `json:"text"` } func jsonError(w http.ResponseWriter, message string, code int) { w.Header().Set("Content-Type", "application/json") w.WriteHeader(code) json.NewEncoder(w).Encode(map[string]string{"error": message}) } func handleAudioTranscription(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json") var req AudioURLTranscriptionRequest if err := json.NewDecoder(r.Body).Decode(&req); err != nil { jsonError(w, "Invalid request body", http.StatusBadRequest) return } config, err := ReadConfig() if err != nil { jsonError(w, "Failed to read config", http.StatusInternalServerError) return } var text string switch req.Service { case "deepgram": if config.DeepgramAPIKey == "" { jsonError(w, "Deepgram API key not configured", http.StatusUnauthorized) return } c := client.New(config.DeepgramAPIKey, &clientinterfaces.ClientOptions{}) dg := restapi.New(c) options := &clientinterfaces.PreRecordedTranscriptionOptions{ Model: req.Model, SmartFormat: true, Punctuate: true, Diarize: true, Utterances: true, } res, err := dg.FromURL(r.Context(), req.URL, options) if err != nil { jsonError(w, fmt.Sprintf("Transcription failed: %v", err), http.StatusInternalServerError) return } text = res.Results.Channels[0].Alternatives[0].Paragraphs.Transcript case "aai": if config.AssemblyAIAPIKey == "" { jsonError(w, "AssemblyAI API key not configured", http.StatusUnauthorized) return } client := aai.NewClient(config.AssemblyAIAPIKey) params := &aai.TranscriptOptionalParams{ SpeakerLabels: aai.Bool(true), Punctuate: aai.Bool(true), FormatText: aai.Bool(true), SpeechModel: aai.SpeechModel(req.Model), } transcript, err := client.Transcripts.TranscribeFromURL(r.Context(), req.URL, params) if err != nil { jsonError(w, fmt.Sprintf("Transcription failed: %v", err), http.StatusInternalServerError) return } var builder strings.Builder for _, utterance := range transcript.Utterances { fmt.Fprintf(&builder, "Speaker %s: %s\n\n", aai.ToString(utterance.Speaker), aai.ToString(utterance.Text)) } text = builder.String() default: jsonError(w, "Unsupported transcription service", http.StatusBadRequest) return } json.NewEncoder(w).Encode(AudioURLTranscriptionResponse{Text: text}) } ================================================ FILE: youtube_transcriber.go ================================================ package main import ( "context" "fmt" "strings" "github.com/deepakjois/ytt" ) const ( userPrompt = `You will be given auto-generated captions from a YouTube video. These may be full captions, or a segment of the full transcript if it is too large. Your task is to transform these captions into a clean, readable transcript. Here are the auto-generated captions: %s Follow these steps to create a clean transcript: 1. Correct any spelling errors you encounter. Use your knowledge of common words and context to determine the correct spelling. 2. Add appropriate punctuation throughout the text. This includes commas, periods, question marks, and exclamation points where necessary. 3. Capitalize the first letter of each sentence and proper nouns. 4. Break the text into logical paragraphs. Start a new paragraph when there's a shift in topic or speaker. 5. Remove any unnecessary filler words, repetitions, or false starts. 6. Maintain the original meaning and intent of the transcript. Do not remove any content even if it is unrelated to the main topic. Once you have completed these steps, provide the clean transcript . Ensure that the transcript is well-formatted, easy to read, and accurately represents the original content of the video. Do not include any additional text in your response.` ) type TranscriptionCallback func(text string, done bool) error type YouTubeTranscriber struct { client LLMClient model LLMModel } func NewYouTubeTranscriber(client LLMClient, model LLMModel) *YouTubeTranscriber { return &YouTubeTranscriber{ client: client, model: model, } } func (yt *YouTubeTranscriber) Transcribe(ctx context.Context, videoURL string, callback TranscriptionCallback) error { videoID, err := ytt.ExtractVideoID(videoURL) if err != nil { return fmt.Errorf("failed to extract video ID: %w", err) } transcriptList, err := ytt.ListTranscripts(videoID) if err != nil { return fmt.Errorf("failed to list transcripts: %w", err) } transcript, err := transcriptList.FindTranscript("en") if err != nil { return fmt.Errorf("failed to find English transcript: %w", err) } entries, err := transcript.Fetch() if err != nil { return fmt.Errorf("failed to fetch transcript: %w", err) } var transcriptTxt strings.Builder for i, entry := range entries { if i > 0 { transcriptTxt.WriteString(" ") } transcriptTxt.WriteString(entry.Text) } chunks := yt.splitText(transcriptTxt.String()) for _, chunk := range chunks { respCh, errCh := yt.client.CompleteStream(ctx, CompletionRequest{ UserPrompt: fmt.Sprintf(userPrompt, chunk), Model: yt.model, }) for resp := range respCh { if err := callback(resp.Text, resp.Done); err != nil { return fmt.Errorf("callback error: %w", err) } } if err := <-errCh; err != nil { return fmt.Errorf("error from LLM: %w", err) } } return nil } // Approximate words from token count (typically 0.75 tokens per word) func calcWordsFromTokens(tokens int) int { return int(float64(tokens) * 0.75) } func (yt *YouTubeTranscriber) splitText(text string) []string { maxWords := calcWordsFromTokens(modelTokenLimits[yt.model]) words := strings.Fields(text) var chunks []string var currentChunk strings.Builder currentWordCount := 0 for i, word := range words { if i > 0 { currentChunk.WriteString(" ") } currentChunk.WriteString(word) currentWordCount++ if currentWordCount >= maxWords { chunks = append(chunks, currentChunk.String()) currentChunk.Reset() currentWordCount = 0 } } if currentChunk.Len() > 0 { chunks = append(chunks, currentChunk.String()) } return chunks } ================================================ FILE: ytt.go ================================================ package main import ( "context" "fmt" "net/url" "os" "sort" "github.com/alecthomas/kong" ) type YTTCmd struct { OpenAIAPIKey string `name:"openai-api-key" help:"OpenAI API key" env:"OPENAI_API_KEY" hidden:""` AnthropicAPIKey string `help:"Anthropic API key" env:"ANTHROPIC_API_KEY" hidden:""` GroqAPIKey string `help:"Groq API key" env:"GROQ_API_KEY" hidden:""` GeminiAPIKey string `help:"Gemini API key" env:"GEMINI_API_KEY" hidden:""` AWSRegion string `help:"AWS Region" env:"AWS_REGION" hidden:""` AWSAccessKeyID string `help:"AWS Access Key ID" env:"AWS_ACCESS_KEY_ID" hidden:""` AWSSecretAccessKey string `help:"AWS Secret Access Key ID" env:"AWS_SECRET_ACCESS_KEY" hidden:""` AWSSessionToken string `help:"AWS Session Token" env:"AWS_SESSION_TOKEN" hidden:""` Model LLMModel `help:"Model to use" default:"gpt-4o" short:"m"` VideoURL *url.URL `arg:"" help:"YouTube video URL" short:"u" optional:""` Output string `help:"Path to output transcript file (default: stdout)" short:"o"` ListModels bool `help:"List available models" short:"l"` } func (cmd *YTTCmd) getLLMClient() (LLMClient, error) { var provider LLMProvider config := Config{ OpenAIAPIKey: cmd.OpenAIAPIKey, AnthropicAPIKey: cmd.AnthropicAPIKey, GroqAPIKey: cmd.GroqAPIKey, GeminiAPIKey: cmd.GeminiAPIKey, AWSRegion: cmd.AWSRegion, AWSAccessKeyID: cmd.AWSAccessKeyID, AWSSecretAccessKey: cmd.AWSSecretAccessKey, AWSSessionToken: cmd.AWSSessionToken, } switch cmd.Model { case GPT4o, GPT4oMini: if config.OpenAIAPIKey == "" { return nil, fmt.Errorf("OpenAI API key required for model %s", cmd.Model) } provider = OpenAI case Claude35Haiku, Claude37Sonnet: if config.AnthropicAPIKey == "" { return nil, fmt.Errorf("Anthropic API key required for model %s", cmd.Model) } provider = Claude case Llama3370b, Llama318b: if config.GroqAPIKey == "" { return nil, fmt.Errorf("Groq API key required for model %s", cmd.Model) } provider = Groq case Gemini2Flash: if config.GeminiAPIKey == "" { return nil, fmt.Errorf("Gemini API key required for model %s", cmd.Model) } provider = Gemini case BedrockClaude37Sonnet, BedrockClaude35Haiku: if config.AWSRegion == "" || config.AWSAccessKeyID == "" || config.AWSSecretAccessKey == "" || config.AWSSessionToken == "" { return nil, fmt.Errorf("AWS credentials required for model %s", cmd.Model) } provider = Bedrock default: return nil, fmt.Errorf("unsupported model: %s", cmd.Model) } return NewLLMClient(provider, config) } func (cmd *YTTCmd) Validate(kctx *kong.Context) error { if cmd.VideoURL == nil { return fmt.Errorf("YouTube video URL is required") } return nil } func (cmd *YTTCmd) Run() error { if cmd.ListModels { fmt.Println("Available models:") models := make([]string, 0, len(modelTokenLimits)) for model := range modelTokenLimits { models = append(models, string(model)) } sort.Strings(models) for _, model := range models { fmt.Printf(" %s\n", model) } return nil } client, err := cmd.getLLMClient() if err != nil { return err } out := os.Stdout if cmd.Output != "" { f, err := os.Create(cmd.Output) if err != nil { return fmt.Errorf("failed to create output file: %w", err) } defer f.Close() out = f } transcriber := NewYouTubeTranscriber(client, cmd.Model) err = transcriber.Transcribe(context.Background(), cmd.VideoURL.String(), func(text string, done bool) error { _, err := fmt.Fprint(out, text) return err }) fmt.Println() return err } ================================================ FILE: ytt_web.go ================================================ package main import ( "fmt" "net/http" "strings" ) func handleYTT(w http.ResponseWriter, r *http.Request) { url := r.URL.Query().Get("url") if url == "" { http.Error(w, "URL parameter is required", http.StatusBadRequest) return } modelStr := r.URL.Query().Get("model") if modelStr == "" { http.Error(w, "Model parameter is required", http.StatusBadRequest) return } model := LLMModel(modelStr) config, err := ReadConfig() if err != nil { http.Error(w, "Failed to read config", http.StatusInternalServerError) return } provider := getProviderForModel(model) if provider == "" { http.Error(w, "Unsupported model", http.StatusBadRequest) return } // Validate required credentials switch provider { case OpenAI: if config.OpenAIAPIKey == "" { http.Error(w, fmt.Sprintf("OpenAI API key required for model %s", model), http.StatusBadRequest) return } case Claude: if config.AnthropicAPIKey == "" { http.Error(w, fmt.Sprintf("Anthropic API key required for model %s", model), http.StatusBadRequest) return } case Groq: if config.GroqAPIKey == "" { http.Error(w, fmt.Sprintf("Groq API key required for model %s", model), http.StatusBadRequest) return } case Bedrock: if config.AWSRegion == "" || config.AWSAccessKeyID == "" || config.AWSSecretAccessKey == "" { http.Error(w, fmt.Sprintf("AWS credentials required for model %s. Run 'podscript configure' to set them up", model), http.StatusBadRequest) return } case Gemini: if config.GeminiAPIKey == "" { http.Error(w, fmt.Sprintf("Gemini API key required for model %s", model), http.StatusBadRequest) return } default: http.Error(w, "Unsupported model", http.StatusBadRequest) return } client, err := NewLLMClient(provider, *config) if err != nil { http.Error(w, "Failed to initialize LLM client", http.StatusInternalServerError) return } // Set up SSE headers w.Header().Set("Content-Type", "text/event-stream") w.Header().Set("Cache-Control", "no-cache") w.Header().Set("Connection", "keep-alive") flusher, ok := w.(http.Flusher) if !ok { http.Error(w, "Streaming unsupported", http.StatusInternalServerError) return } transcriber := NewYouTubeTranscriber(client, model) err = transcriber.Transcribe(r.Context(), url, func(text string, done bool) error { // Format multi-line SSE message by prefixing each line with "data: " // fmt.Printf("text (with whitespace): %q\n", text) lines := strings.Split(text, "\n") for i, line := range lines { if i > 0 { _, err := fmt.Fprint(w, "\n") if err != nil { return err } } _, err := fmt.Fprintf(w, "data: %s", line) if err != nil { return err } } _, err := fmt.Fprint(w, "\n\n") if err != nil { return err } if done { _, err := fmt.Fprint(w, "event: done\ndata: \n\n") if err != nil { return err } } flusher.Flush() return nil }) if err != nil { // Log the error server-side fmt.Printf("[ERROR] Transcription failed: %v\n", err) fmt.Fprintf(w, "event: error\ndata: %s\n\n", err.Error()) flusher.Flush() } } func getProviderForModel(model LLMModel) LLMProvider { switch model { case GPT4o, GPT4oMini: return OpenAI case Claude37Sonnet, Claude35Haiku: return Claude case Llama3370b, Llama318b: return Groq case Gemini2Flash: return Gemini case BedrockClaude37Sonnet, BedrockClaude35Haiku: return Bedrock default: return "" } }