Plugin Directory

Changeset 3394690


Ignore:
Timestamp:
11/12/2025 11:08:54 PM (4 months ago)
Author:
pulsechat
Message:

Release version 2.2.0 - Complete license validation system with Supabase integration

Location:
pulse-chat-ai
Files:
146 added
6 edited

Legend:

Unmodified
Added
Removed
  • pulse-chat-ai/trunk/dist/admin/admin.js

    r3392240 r3394690  
    1 import{r as l,j as c,c as z,a as qr,b as Gr,d as nn,R as Se,u as q,e as Ct,f as Wn,g as Kr,h as on,i as Ne,T as Yr,B as Xe,k as Ht,X as Xr,l as Qr,m as Zr,n as Jr}from"../chunks/globals-nr5uMcZd.js";const Re=l.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:z("rounded-lg border bg-muted text-card-foreground shadow-sm",e),...t}));Re.displayName="Card";const Ae=l.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:z("flex flex-col space-y-1.5 p-6",e),...t}));Ae.displayName="CardHeader";const Te=l.forwardRef(({className:e,...t},n)=>c.jsx("h3",{ref:n,className:z("text-2xl font-semibold leading-none tracking-tight",e),...t}));Te.displayName="CardTitle";const et=l.forwardRef(({className:e,...t},n)=>c.jsx("p",{ref:n,className:z("text-sm text-muted-foreground",e),...t}));et.displayName="CardDescription";const je=l.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:z("p-6 pt-0",e),...t}));je.displayName="CardContent";const es=l.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:z("flex items-center p-6 pt-0",e),...t}));es.displayName="CardFooter";var ts=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ns=ts.reduce((e,t)=>{const n=qr(`Primitive.${t}`),o=l.forwardRef((r,s)=>{const{asChild:i,...a}=r,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...a,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),os="Label",Hn=l.forwardRef((e,t)=>c.jsx(ns.label,{...e,ref:t,onMouseDown:n=>{var r;n.target.closest("button, input, select, textarea")||((r=e.onMouseDown)==null||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Hn.displayName=os;var zn=Hn;const rs=Gr("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),G=l.forwardRef(({className:e,...t},n)=>c.jsx(zn,{ref:n,className:z(rs(),e),...t}));G.displayName=zn.displayName;const te=l.forwardRef(({className:e,type:t,...n},o)=>c.jsx("input",{type:t,className:z("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...n}));te.displayName="Input";function vn(e,[t,n]){return Math.min(n,Math.max(t,e))}function M(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function Fe(e,t=[]){let n=[];function o(s,i){const a=l.createContext(i),u=n.length;n=[...n,i];const d=p=>{var b;const{scope:h,children:v,...w}=p,m=((b=h==null?void 0:h[e])==null?void 0:b[u])||a,g=l.useMemo(()=>w,Object.values(w));return c.jsx(m.Provider,{value:g,children:v})};d.displayName=s+"Provider";function f(p,h){var m;const v=((m=h==null?void 0:h[e])==null?void 0:m[u])||a,w=l.useContext(v);if(w)return w;if(i!==void 0)return i;throw new Error(`\`${p}\` must be used within \`${s}\``)}return[d,f]}const r=()=>{const s=n.map(i=>l.createContext(i));return function(a){const u=(a==null?void 0:a[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return r.scopeName=e,[o,ss(r,...t)]}function ss(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const i=o.reduce((a,{useScope:u,scopeName:d})=>{const p=u(s)[`__scope${d}`];return{...a,...p}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function xn(e){const t=is(e),n=l.forwardRef((o,r)=>{const{children:s,...i}=o,a=l.Children.toArray(s),u=a.find(cs);if(u){const d=u.props.children,f=a.map(p=>p===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:p);return c.jsx(t,{...i,ref:r,children:l.isValidElement(d)?l.cloneElement(d,void 0,f):null})}return c.jsx(t,{...i,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function is(e){const t=l.forwardRef((n,o)=>{const{children:r,...s}=n;if(l.isValidElement(r)){const i=us(r),a=ls(s,r.props);return r.type!==l.Fragment&&(a.ref=o?nn(o,i):i),l.cloneElement(r,a)}return l.Children.count(r)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var as=Symbol("radix.slottable");function cs(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===as}function ls(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...a)=>{const u=s(...a);return r(...a),u}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function us(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function qn(e){const t=e+"CollectionProvider",[n,o]=Fe(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:g,children:b}=m,x=Se.useRef(null),y=Se.useRef(new Map).current;return c.jsx(r,{scope:g,itemMap:y,collectionRef:x,children:b})};i.displayName=t;const a=e+"CollectionSlot",u=xn(a),d=Se.forwardRef((m,g)=>{const{scope:b,children:x}=m,y=s(a,b),S=q(g,y.collectionRef);return c.jsx(u,{ref:S,children:x})});d.displayName=a;const f=e+"CollectionItemSlot",p="data-radix-collection-item",h=xn(f),v=Se.forwardRef((m,g)=>{const{scope:b,children:x,...y}=m,S=Se.useRef(null),C=q(g,S),N=s(f,b);return Se.useEffect(()=>(N.itemMap.set(S,{ref:S,...y}),()=>void N.itemMap.delete(S))),c.jsx(h,{[p]:"",ref:C,children:x})});v.displayName=f;function w(m){const g=s(e+"CollectionConsumer",m);return Se.useCallback(()=>{const x=g.collectionRef.current;if(!x)return[];const y=Array.from(x.querySelectorAll(`[${p}]`));return Array.from(g.itemMap.values()).sort((N,E)=>y.indexOf(N.ref.current)-y.indexOf(E.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:i,Slot:d,ItemSlot:v},w,o]}var ds=l.createContext(void 0);function rn(e){const t=l.useContext(ds);return e||t||"ltr"}function fs(e){const t=ps(e),n=l.forwardRef((o,r)=>{const{children:s,...i}=o,a=l.Children.toArray(s),u=a.find(hs);if(u){const d=u.props.children,f=a.map(p=>p===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:p);return c.jsx(t,{...i,ref:r,children:l.isValidElement(d)?l.cloneElement(d,void 0,f):null})}return c.jsx(t,{...i,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function ps(e){const t=l.forwardRef((n,o)=>{const{children:r,...s}=n;if(l.isValidElement(r)){const i=vs(r),a=gs(s,r.props);return r.type!==l.Fragment&&(a.ref=o?nn(o,i):i),l.cloneElement(r,a)}return l.Children.count(r)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ms=Symbol("radix.slottable");function hs(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ms}function gs(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...a)=>{const u=s(...a);return r(...a),u}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function vs(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var xs=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],L=xs.reduce((e,t)=>{const n=fs(`Primitive.${t}`),o=l.forwardRef((r,s)=>{const{asChild:i,...a}=r,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...a,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function bs(e,t){e&&Ct.flushSync(()=>e.dispatchEvent(t))}function ge(e){const t=l.useRef(e);return l.useEffect(()=>{t.current=e}),l.useMemo(()=>(...n)=>{var o;return(o=t.current)==null?void 0:o.call(t,...n)},[])}function ys(e,t=globalThis==null?void 0:globalThis.document){const n=ge(e);l.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var ws="DismissableLayer",zt="dismissableLayer.update",Ss="dismissableLayer.pointerDownOutside",Cs="dismissableLayer.focusOutside",bn,Gn=l.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Kn=l.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...u}=e,d=l.useContext(Gn),[f,p]=l.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=l.useState({}),w=q(t,E=>p(E)),m=Array.from(d.layers),[g]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(g),x=f?m.indexOf(f):-1,y=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=Ns(E=>{const P=E.target,_=[...d.branches].some(j=>j.contains(P));!S||_||(r==null||r(E),i==null||i(E),E.defaultPrevented||a==null||a())},h),N=Rs(E=>{const P=E.target;[...d.branches].some(j=>j.contains(P))||(s==null||s(E),i==null||i(E),E.defaultPrevented||a==null||a())},h);return ys(E=>{x===d.layers.size-1&&(o==null||o(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},h),l.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(bn=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),yn(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=bn)}},[f,h,n,d]),l.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),yn())},[f,d]),l.useEffect(()=>{const E=()=>v({});return document.addEventListener(zt,E),()=>document.removeEventListener(zt,E)},[]),c.jsx(L.div,{...u,ref:w,style:{pointerEvents:y?S?"auto":"none":void 0,...e.style},onFocusCapture:M(e.onFocusCapture,N.onFocusCapture),onBlurCapture:M(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:M(e.onPointerDownCapture,C.onPointerDownCapture)})});Kn.displayName=ws;var Es="DismissableLayerBranch",Ps=l.forwardRef((e,t)=>{const n=l.useContext(Gn),o=l.useRef(null),r=q(t,o);return l.useEffect(()=>{const s=o.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),c.jsx(L.div,{...e,ref:r})});Ps.displayName=Es;function Ns(e,t=globalThis==null?void 0:globalThis.document){const n=ge(e),o=l.useRef(!1),r=l.useRef(()=>{});return l.useEffect(()=>{const s=a=>{if(a.target&&!o.current){let u=function(){Yn(Ss,n,d,{discrete:!0})};const d={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=u,t.addEventListener("click",r.current,{once:!0})):u()}else t.removeEventListener("click",r.current);o.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function Rs(e,t=globalThis==null?void 0:globalThis.document){const n=ge(e),o=l.useRef(!1);return l.useEffect(()=>{const r=s=>{s.target&&!o.current&&Yn(Cs,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function yn(){const e=new CustomEvent(zt);document.dispatchEvent(e)}function Yn(e,t,n,{discrete:o}){const r=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?bs(r,s):r.dispatchEvent(s)}var Dt=0;function As(){l.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??wn()),document.body.insertAdjacentElement("beforeend",e[1]??wn()),Dt++,()=>{Dt===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Dt--}},[])}function wn(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Mt="focusScope.autoFocusOnMount",kt="focusScope.autoFocusOnUnmount",Sn={bubbles:!1,cancelable:!0},Ts="FocusScope",Xn=l.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:s,...i}=e,[a,u]=l.useState(null),d=ge(r),f=ge(s),p=l.useRef(null),h=q(t,m=>u(m)),v=l.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;l.useEffect(()=>{if(o){let m=function(y){if(v.paused||!a)return;const S=y.target;a.contains(S)?p.current=S:he(p.current,{select:!0})},g=function(y){if(v.paused||!a)return;const S=y.relatedTarget;S!==null&&(a.contains(S)||he(p.current,{select:!0}))},b=function(y){if(document.activeElement===document.body)for(const C of y)C.removedNodes.length>0&&he(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",g);const x=new MutationObserver(b);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",g),x.disconnect()}}},[o,a,v.paused]),l.useEffect(()=>{if(a){En.add(v);const m=document.activeElement;if(!a.contains(m)){const b=new CustomEvent(Mt,Sn);a.addEventListener(Mt,d),a.dispatchEvent(b),b.defaultPrevented||(js(Ms(Qn(a)),{select:!0}),document.activeElement===m&&he(a))}return()=>{a.removeEventListener(Mt,d),setTimeout(()=>{const b=new CustomEvent(kt,Sn);a.addEventListener(kt,f),a.dispatchEvent(b),b.defaultPrevented||he(m??document.body,{select:!0}),a.removeEventListener(kt,f),En.remove(v)},0)}}},[a,d,f,v]);const w=l.useCallback(m=>{if(!n&&!o||v.paused)return;const g=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(g&&b){const x=m.currentTarget,[y,S]=Is(x);y&&S?!m.shiftKey&&b===S?(m.preventDefault(),n&&he(y,{select:!0})):m.shiftKey&&b===y&&(m.preventDefault(),n&&he(S,{select:!0})):b===x&&m.preventDefault()}},[n,o,v.paused]);return c.jsx(L.div,{tabIndex:-1,...i,ref:h,onKeyDown:w})});Xn.displayName=Ts;function js(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(he(o,{select:t}),document.activeElement!==n)return}function Is(e){const t=Qn(e),n=Cn(t,e),o=Cn(t.reverse(),e);return[n,o]}function Qn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Cn(e,t){for(const n of e)if(!_s(n,{upTo:t}))return n}function _s(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Os(e){return e instanceof HTMLInputElement&&"select"in e}function he(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Os(e)&&t&&e.select()}}var En=Ds();function Ds(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Pn(e,t),e.unshift(t)},remove(t){var n;e=Pn(e,t),(n=e[0])==null||n.resume()}}}function Pn(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function Ms(e){return e.filter(t=>t.tagName!=="A")}var Y=globalThis!=null&&globalThis.document?l.useLayoutEffect:()=>{},ks=Wn[" useId ".trim().toString()]||(()=>{}),Ls=0;function tt(e){const[t,n]=l.useState(ks());return Y(()=>{n(o=>o??String(Ls++))},[e]),t?`radix-${t}`:""}const Fs=["top","right","bottom","left"],ve=Math.min,Z=Math.max,xt=Math.round,st=Math.floor,ce=e=>({x:e,y:e}),Bs={left:"right",right:"left",bottom:"top",top:"bottom"},$s={start:"end",end:"start"};function qt(e,t,n){return Z(e,ve(t,n))}function fe(e,t){return typeof e=="function"?e(t):e}function pe(e){return e.split("-")[0]}function Be(e){return e.split("-")[1]}function sn(e){return e==="x"?"y":"x"}function an(e){return e==="y"?"height":"width"}const Us=new Set(["top","bottom"]);function ae(e){return Us.has(pe(e))?"y":"x"}function cn(e){return sn(ae(e))}function Vs(e,t,n){n===void 0&&(n=!1);const o=Be(e),r=cn(e),s=an(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=bt(i)),[i,bt(i)]}function Ws(e){const t=bt(e);return[Gt(e),t,Gt(t)]}function Gt(e){return e.replace(/start|end/g,t=>$s[t])}const Nn=["left","right"],Rn=["right","left"],Hs=["top","bottom"],zs=["bottom","top"];function qs(e,t,n){switch(e){case"top":case"bottom":return n?t?Rn:Nn:t?Nn:Rn;case"left":case"right":return t?Hs:zs;default:return[]}}function Gs(e,t,n,o){const r=Be(e);let s=qs(pe(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(Gt)))),s}function bt(e){return e.replace(/left|right|bottom|top/g,t=>Bs[t])}function Ks(e){return{top:0,right:0,bottom:0,left:0,...e}}function Zn(e){return typeof e!="number"?Ks(e):{top:e,right:e,bottom:e,left:e}}function yt(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function An(e,t,n){let{reference:o,floating:r}=e;const s=ae(t),i=cn(t),a=an(i),u=pe(t),d=s==="y",f=o.x+o.width/2-r.width/2,p=o.y+o.height/2-r.height/2,h=o[a]/2-r[a]/2;let v;switch(u){case"top":v={x:f,y:o.y-r.height};break;case"bottom":v={x:f,y:o.y+o.height};break;case"right":v={x:o.x+o.width,y:p};break;case"left":v={x:o.x-r.width,y:p};break;default:v={x:o.x,y:o.y}}switch(Be(t)){case"start":v[i]-=h*(n&&d?-1:1);break;case"end":v[i]+=h*(n&&d?-1:1);break}return v}const Ys=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),u=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:f,y:p}=An(d,o,u),h=o,v={},w=0;for(let m=0;m<a.length;m++){const{name:g,fn:b}=a[m],{x,y,data:S,reset:C}=await b({x:f,y:p,initialPlacement:o,placement:h,strategy:r,middlewareData:v,rects:d,platform:i,elements:{reference:e,floating:t}});f=x??f,p=y??p,v={...v,[g]:{...v[g],...S}},C&&w<=50&&(w++,typeof C=="object"&&(C.placement&&(h=C.placement),C.rects&&(d=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):C.rects),{x:f,y:p}=An(d,h,u)),m=-1)}return{x:f,y:p,placement:h,strategy:r,middlewareData:v}};async function Qe(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:a,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:h=!1,padding:v=0}=fe(t,e),w=Zn(v),g=a[h?p==="floating"?"reference":"floating":p],b=yt(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(g)))==null||n?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:d,rootBoundary:f,strategy:u})),x=p==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(y))?await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1}:{x:1,y:1},C=yt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:y,strategy:u}):x);return{top:(b.top-C.top+w.top)/S.y,bottom:(C.bottom-b.bottom+w.bottom)/S.y,left:(b.left-C.left+w.left)/S.x,right:(C.right-b.right+w.right)/S.x}}const Xs=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:a,middlewareData:u}=t,{element:d,padding:f=0}=fe(e,t)||{};if(d==null)return{};const p=Zn(f),h={x:n,y:o},v=cn(r),w=an(v),m=await i.getDimensions(d),g=v==="y",b=g?"top":"left",x=g?"bottom":"right",y=g?"clientHeight":"clientWidth",S=s.reference[w]+s.reference[v]-h[v]-s.floating[w],C=h[v]-s.reference[v],N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let E=N?N[y]:0;(!E||!await(i.isElement==null?void 0:i.isElement(N)))&&(E=a.floating[y]||s.floating[w]);const P=S/2-C/2,_=E/2-m[w]/2-1,j=ve(p[b],_),k=ve(p[x],_),$=j,O=E-m[w]-k,I=E/2-m[w]/2+P,V=qt($,I,O),T=!u.arrow&&Be(r)!=null&&I!==V&&s.reference[w]/2-(I<$?j:k)-m[w]/2<0,D=T?I<$?I-$:I-O:0;return{[v]:h[v]+D,data:{[v]:V,centerOffset:I-V-D,...T&&{alignmentOffset:D}},reset:T}}}),Qs=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:a,platform:u,elements:d}=t,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:m=!0,...g}=fe(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=pe(r),x=ae(a),y=pe(a)===a,S=await(u.isRTL==null?void 0:u.isRTL(d.floating)),C=h||(y||!m?[bt(a)]:Ws(a)),N=w!=="none";!h&&N&&C.push(...Gs(a,m,w,S));const E=[a,...C],P=await Qe(t,g),_=[];let j=((o=s.flip)==null?void 0:o.overflows)||[];if(f&&_.push(P[b]),p){const I=Vs(r,i,S);_.push(P[I[0]],P[I[1]])}if(j=[...j,{placement:r,overflows:_}],!_.every(I=>I<=0)){var k,$;const I=(((k=s.flip)==null?void 0:k.index)||0)+1,V=E[I];if(V&&(!(p==="alignment"?x!==ae(V):!1)||j.every(R=>ae(R.placement)===x?R.overflows[0]>0:!0)))return{data:{index:I,overflows:j},reset:{placement:V}};let T=($=j.filter(D=>D.overflows[0]<=0).sort((D,R)=>D.overflows[1]-R.overflows[1])[0])==null?void 0:$.placement;if(!T)switch(v){case"bestFit":{var O;const D=(O=j.filter(R=>{if(N){const W=ae(R.placement);return W===x||W==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(W=>W>0).reduce((W,X)=>W+X,0)]).sort((R,W)=>R[1]-W[1])[0])==null?void 0:O[0];D&&(T=D);break}case"initialPlacement":T=a;break}if(r!==T)return{reset:{placement:T}}}return{}}}};function Tn(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function jn(e){return Fs.some(t=>e[t]>=0)}const Zs=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=fe(e,t);switch(o){case"referenceHidden":{const s=await Qe(t,{...r,elementContext:"reference"}),i=Tn(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:jn(i)}}}case"escaped":{const s=await Qe(t,{...r,altBoundary:!0}),i=Tn(s,n.floating);return{data:{escapedOffsets:i,escaped:jn(i)}}}default:return{}}}}},Jn=new Set(["left","top"]);async function Js(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=pe(n),a=Be(n),u=ae(n)==="y",d=Jn.has(i)?-1:1,f=s&&u?-1:1,p=fe(t,e);let{mainAxis:h,crossAxis:v,alignmentAxis:w}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return a&&typeof w=="number"&&(v=a==="end"?w*-1:w),u?{x:v*f,y:h*d}:{x:h*d,y:v*f}}const ei=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:a}=t,u=await Js(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+u.x,y:s+u.y,data:{...u,placement:i}}}}},ti=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:g=>{let{x:b,y:x}=g;return{x:b,y:x}}},...u}=fe(e,t),d={x:n,y:o},f=await Qe(t,u),p=ae(pe(r)),h=sn(p);let v=d[h],w=d[p];if(s){const g=h==="y"?"top":"left",b=h==="y"?"bottom":"right",x=v+f[g],y=v-f[b];v=qt(x,v,y)}if(i){const g=p==="y"?"top":"left",b=p==="y"?"bottom":"right",x=w+f[g],y=w-f[b];w=qt(x,w,y)}const m=a.fn({...t,[h]:v,[p]:w});return{...m,data:{x:m.x-n,y:m.y-o,enabled:{[h]:s,[p]:i}}}}}},ni=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:u=!0,crossAxis:d=!0}=fe(e,t),f={x:n,y:o},p=ae(r),h=sn(p);let v=f[h],w=f[p];const m=fe(a,t),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(u){const y=h==="y"?"height":"width",S=s.reference[h]-s.floating[y]+g.mainAxis,C=s.reference[h]+s.reference[y]-g.mainAxis;v<S?v=S:v>C&&(v=C)}if(d){var b,x;const y=h==="y"?"width":"height",S=Jn.has(pe(r)),C=s.reference[p]-s.floating[y]+(S&&((b=i.offset)==null?void 0:b[p])||0)+(S?0:g.crossAxis),N=s.reference[p]+s.reference[y]+(S?0:((x=i.offset)==null?void 0:x[p])||0)-(S?g.crossAxis:0);w<C?w=C:w>N&&(w=N)}return{[h]:v,[p]:w}}}},oi=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:i,elements:a}=t,{apply:u=()=>{},...d}=fe(e,t),f=await Qe(t,d),p=pe(r),h=Be(r),v=ae(r)==="y",{width:w,height:m}=s.floating;let g,b;p==="top"||p==="bottom"?(g=p,b=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(b=p,g=h==="end"?"top":"bottom");const x=m-f.top-f.bottom,y=w-f.left-f.right,S=ve(m-f[g],x),C=ve(w-f[b],y),N=!t.middlewareData.shift;let E=S,P=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=y),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(E=x),N&&!h){const j=Z(f.left,0),k=Z(f.right,0),$=Z(f.top,0),O=Z(f.bottom,0);v?P=w-2*(j!==0||k!==0?j+k:Z(f.left,f.right)):E=m-2*($!==0||O!==0?$+O:Z(f.top,f.bottom))}await u({...t,availableWidth:P,availableHeight:E});const _=await i.getDimensions(a.floating);return w!==_.width||m!==_.height?{reset:{rects:!0}}:{}}}};function Et(){return typeof window<"u"}function $e(e){return eo(e)?(e.nodeName||"").toLowerCase():"#document"}function J(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ue(e){var t;return(t=(eo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function eo(e){return Et()?e instanceof Node||e instanceof J(e).Node:!1}function ne(e){return Et()?e instanceof Element||e instanceof J(e).Element:!1}function le(e){return Et()?e instanceof HTMLElement||e instanceof J(e).HTMLElement:!1}function In(e){return!Et()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof J(e).ShadowRoot}const ri=new Set(["inline","contents"]);function nt(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=oe(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!ri.has(r)}const si=new Set(["table","td","th"]);function ii(e){return si.has($e(e))}const ai=[":popover-open",":modal"];function Pt(e){return ai.some(t=>{try{return e.matches(t)}catch{return!1}})}const ci=["transform","translate","scale","rotate","perspective"],li=["transform","translate","scale","rotate","perspective","filter"],ui=["paint","layout","strict","content"];function ln(e){const t=un(),n=ne(e)?oe(e):e;return ci.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||li.some(o=>(n.willChange||"").includes(o))||ui.some(o=>(n.contain||"").includes(o))}function di(e){let t=xe(e);for(;le(t)&&!Le(t);){if(ln(t))return t;if(Pt(t))return null;t=xe(t)}return null}function un(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const fi=new Set(["html","body","#document"]);function Le(e){return fi.has($e(e))}function oe(e){return J(e).getComputedStyle(e)}function Nt(e){return ne(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xe(e){if($e(e)==="html")return e;const t=e.assignedSlot||e.parentNode||In(e)&&e.host||ue(e);return In(t)?t.host:t}function to(e){const t=xe(e);return Le(t)?e.ownerDocument?e.ownerDocument.body:e.body:le(t)&&nt(t)?t:to(t)}function Ze(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=to(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),i=J(r);if(s){const a=Kt(i);return t.concat(i,i.visualViewport||[],nt(r)?r:[],a&&n?Ze(a):[])}return t.concat(r,Ze(r,[],n))}function Kt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function no(e){const t=oe(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=le(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,a=xt(n)!==s||xt(o)!==i;return a&&(n=s,o=i),{width:n,height:o,$:a}}function dn(e){return ne(e)?e:e.contextElement}function Me(e){const t=dn(e);if(!le(t))return ce(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=no(t);let i=(s?xt(n.width):n.width)/o,a=(s?xt(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const pi=ce(0);function oo(e){const t=J(e);return!un()||!t.visualViewport?pi:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function mi(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==J(e)?!1:t}function Ce(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=dn(e);let i=ce(1);t&&(o?ne(o)&&(i=Me(o)):i=Me(e));const a=mi(s,n,o)?oo(s):ce(0);let u=(r.left+a.x)/i.x,d=(r.top+a.y)/i.y,f=r.width/i.x,p=r.height/i.y;if(s){const h=J(s),v=o&&ne(o)?J(o):o;let w=h,m=Kt(w);for(;m&&o&&v!==w;){const g=Me(m),b=m.getBoundingClientRect(),x=oe(m),y=b.left+(m.clientLeft+parseFloat(x.paddingLeft))*g.x,S=b.top+(m.clientTop+parseFloat(x.paddingTop))*g.y;u*=g.x,d*=g.y,f*=g.x,p*=g.y,u+=y,d+=S,w=J(m),m=Kt(w)}}return yt({width:f,height:p,x:u,y:d})}function Rt(e,t){const n=Nt(e).scrollLeft;return t?t.left+n:Ce(ue(e)).left+n}function ro(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Rt(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function hi(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=ue(o),a=t?Pt(t.floating):!1;if(o===i||a&&s)return n;let u={scrollLeft:0,scrollTop:0},d=ce(1);const f=ce(0),p=le(o);if((p||!p&&!s)&&(($e(o)!=="body"||nt(i))&&(u=Nt(o)),le(o))){const v=Ce(o);d=Me(o),f.x=v.x+o.clientLeft,f.y=v.y+o.clientTop}const h=i&&!p&&!s?ro(i,u):ce(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+f.x+h.x,y:n.y*d.y-u.scrollTop*d.y+f.y+h.y}}function gi(e){return Array.from(e.getClientRects())}function vi(e){const t=ue(e),n=Nt(e),o=e.ownerDocument.body,r=Z(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=Z(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+Rt(e);const a=-n.scrollTop;return oe(o).direction==="rtl"&&(i+=Z(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:a}}const _n=25;function xi(e,t){const n=J(e),o=ue(e),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,a=0,u=0;if(r){s=r.width,i=r.height;const f=un();(!f||f&&t==="fixed")&&(a=r.offsetLeft,u=r.offsetTop)}const d=Rt(o);if(d<=0){const f=o.ownerDocument,p=f.body,h=getComputedStyle(p),v=f.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,w=Math.abs(o.clientWidth-p.clientWidth-v);w<=_n&&(s-=w)}else d<=_n&&(s+=d);return{width:s,height:i,x:a,y:u}}const bi=new Set(["absolute","fixed"]);function yi(e,t){const n=Ce(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=le(e)?Me(e):ce(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,u=r*s.x,d=o*s.y;return{width:i,height:a,x:u,y:d}}function On(e,t,n){let o;if(t==="viewport")o=xi(e,n);else if(t==="document")o=vi(ue(e));else if(ne(t))o=yi(t,n);else{const r=oo(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return yt(o)}function so(e,t){const n=xe(e);return n===t||!ne(n)||Le(n)?!1:oe(n).position==="fixed"||so(n,t)}function wi(e,t){const n=t.get(e);if(n)return n;let o=Ze(e,[],!1).filter(a=>ne(a)&&$e(a)!=="body"),r=null;const s=oe(e).position==="fixed";let i=s?xe(e):e;for(;ne(i)&&!Le(i);){const a=oe(i),u=ln(i);!u&&a.position==="fixed"&&(r=null),(s?!u&&!r:!u&&a.position==="static"&&!!r&&bi.has(r.position)||nt(i)&&!u&&so(e,i))?o=o.filter(f=>f!==i):r=a,i=xe(i)}return t.set(e,o),o}function Si(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?Pt(t)?[]:wi(t,this._c):[].concat(n),o],a=i[0],u=i.reduce((d,f)=>{const p=On(t,f,r);return d.top=Z(p.top,d.top),d.right=ve(p.right,d.right),d.bottom=ve(p.bottom,d.bottom),d.left=Z(p.left,d.left),d},On(t,a,r));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Ci(e){const{width:t,height:n}=no(e);return{width:t,height:n}}function Ei(e,t,n){const o=le(t),r=ue(t),s=n==="fixed",i=Ce(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const u=ce(0);function d(){u.x=Rt(r)}if(o||!o&&!s)if(($e(t)!=="body"||nt(r))&&(a=Nt(t)),o){const v=Ce(t,!0,s,t);u.x=v.x+t.clientLeft,u.y=v.y+t.clientTop}else r&&d();s&&!o&&r&&d();const f=r&&!o&&!s?ro(r,a):ce(0),p=i.left+a.scrollLeft-u.x-f.x,h=i.top+a.scrollTop-u.y-f.y;return{x:p,y:h,width:i.width,height:i.height}}function Lt(e){return oe(e).position==="static"}function Dn(e,t){if(!le(e)||oe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ue(e)===n&&(n=n.ownerDocument.body),n}function io(e,t){const n=J(e);if(Pt(e))return n;if(!le(e)){let r=xe(e);for(;r&&!Le(r);){if(ne(r)&&!Lt(r))return r;r=xe(r)}return n}let o=Dn(e,t);for(;o&&ii(o)&&Lt(o);)o=Dn(o,t);return o&&Le(o)&&Lt(o)&&!ln(o)?n:o||di(e)||n}const Pi=async function(e){const t=this.getOffsetParent||io,n=this.getDimensions,o=await n(e.floating);return{reference:Ei(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ni(e){return oe(e).direction==="rtl"}const Ri={convertOffsetParentRelativeRectToViewportRelativeRect:hi,getDocumentElement:ue,getClippingRect:Si,getOffsetParent:io,getElementRects:Pi,getClientRects:gi,getDimensions:Ci,getScale:Me,isElement:ne,isRTL:Ni};function ao(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ai(e,t){let n=null,o;const r=ue(e);function s(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function i(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),s();const d=e.getBoundingClientRect(),{left:f,top:p,width:h,height:v}=d;if(a||t(),!h||!v)return;const w=st(p),m=st(r.clientWidth-(f+h)),g=st(r.clientHeight-(p+v)),b=st(f),y={rootMargin:-w+"px "+-m+"px "+-g+"px "+-b+"px",threshold:Z(0,ve(1,u))||1};let S=!0;function C(N){const E=N[0].intersectionRatio;if(E!==u){if(!S)return i();E?i(!1,E):o=setTimeout(()=>{i(!1,1e-7)},1e3)}E===1&&!ao(d,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(C,{...y,root:r.ownerDocument})}catch{n=new IntersectionObserver(C,y)}n.observe(e)}return i(!0),s}function Ti(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,d=dn(e),f=r||s?[...d?Ze(d):[],...Ze(t)]:[];f.forEach(b=>{r&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const p=d&&a?Ai(d,n):null;let h=-1,v=null;i&&(v=new ResizeObserver(b=>{let[x]=b;x&&x.target===d&&v&&(v.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var y;(y=v)==null||y.observe(t)})),n()}),d&&!u&&v.observe(d),v.observe(t));let w,m=u?Ce(e):null;u&&g();function g(){const b=Ce(e);m&&!ao(m,b)&&n(),m=b,w=requestAnimationFrame(g)}return n(),()=>{var b;f.forEach(x=>{r&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),p==null||p(),(b=v)==null||b.disconnect(),v=null,u&&cancelAnimationFrame(w)}}const ji=ei,Ii=ti,_i=Qs,Oi=oi,Di=Zs,Mn=Xs,Mi=ni,ki=(e,t,n)=>{const o=new Map,r={platform:Ri,...n},s={...r.platform,_c:o};return Ys(e,t,{...r,platform:s})};var Li=typeof document<"u",Fi=function(){},dt=Li?l.useLayoutEffect:Fi;function wt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!wt(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!wt(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function co(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function kn(e,t){const n=co(e);return Math.round(t*n)/n}function Ft(e){const t=l.useRef(e);return dt(()=>{t.current=e}),t}function Bi(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:u,open:d}=e,[f,p]=l.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,v]=l.useState(o);wt(h,o)||v(o);const[w,m]=l.useState(null),[g,b]=l.useState(null),x=l.useCallback(R=>{R!==N.current&&(N.current=R,m(R))},[]),y=l.useCallback(R=>{R!==E.current&&(E.current=R,b(R))},[]),S=s||w,C=i||g,N=l.useRef(null),E=l.useRef(null),P=l.useRef(f),_=u!=null,j=Ft(u),k=Ft(r),$=Ft(d),O=l.useCallback(()=>{if(!N.current||!E.current)return;const R={placement:t,strategy:n,middleware:h};k.current&&(R.platform=k.current),ki(N.current,E.current,R).then(W=>{const X={...W,isPositioned:$.current!==!1};I.current&&!wt(P.current,X)&&(P.current=X,Ct.flushSync(()=>{p(X)}))})},[h,t,n,k,$]);dt(()=>{d===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,p(R=>({...R,isPositioned:!1})))},[d]);const I=l.useRef(!1);dt(()=>(I.current=!0,()=>{I.current=!1}),[]),dt(()=>{if(S&&(N.current=S),C&&(E.current=C),S&&C){if(j.current)return j.current(S,C,O);O()}},[S,C,O,j,_]);const V=l.useMemo(()=>({reference:N,floating:E,setReference:x,setFloating:y}),[x,y]),T=l.useMemo(()=>({reference:S,floating:C}),[S,C]),D=l.useMemo(()=>{const R={position:n,left:0,top:0};if(!T.floating)return R;const W=kn(T.floating,f.x),X=kn(T.floating,f.y);return a?{...R,transform:"translate("+W+"px, "+X+"px)",...co(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:X}},[n,a,T.floating,f.x,f.y]);return l.useMemo(()=>({...f,update:O,refs:V,elements:T,floatingStyles:D}),[f,O,V,T,D])}const $i=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?Mn({element:o.current,padding:r}).fn(n):{}:o?Mn({element:o,padding:r}).fn(n):{}}}},Ui=(e,t)=>({...ji(e),options:[e,t]}),Vi=(e,t)=>({...Ii(e),options:[e,t]}),Wi=(e,t)=>({...Mi(e),options:[e,t]}),Hi=(e,t)=>({..._i(e),options:[e,t]}),zi=(e,t)=>({...Oi(e),options:[e,t]}),qi=(e,t)=>({...Di(e),options:[e,t]}),Gi=(e,t)=>({...$i(e),options:[e,t]});var Ki="Arrow",lo=l.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...s}=e;return c.jsx(L.svg,{...s,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});lo.displayName=Ki;var Yi=lo;function uo(e){const[t,n]=l.useState(void 0);return Y(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let i,a;if("borderBoxSize"in s){const u=s.borderBoxSize,d=Array.isArray(u)?u[0]:u;i=d.inlineSize,a=d.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var fn="Popper",[fo,po]=Fe(fn),[Xi,mo]=fo(fn),ho=e=>{const{__scopePopper:t,children:n}=e,[o,r]=l.useState(null);return c.jsx(Xi,{scope:t,anchor:o,onAnchorChange:r,children:n})};ho.displayName=fn;var go="PopperAnchor",vo=l.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,s=mo(go,n),i=l.useRef(null),a=q(t,i),u=l.useRef(null);return l.useEffect(()=>{const d=u.current;u.current=(o==null?void 0:o.current)||i.current,d!==u.current&&s.onAnchorChange(u.current)}),o?null:c.jsx(L.div,{...r,ref:a})});vo.displayName=go;var pn="PopperContent",[Qi,Zi]=fo(pn),xo=l.forwardRef((e,t)=>{var A,H,K,U,F,B;const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:h=!1,updatePositionStrategy:v="optimized",onPlaced:w,...m}=e,g=mo(pn,n),[b,x]=l.useState(null),y=q(t,Q=>x(Q)),[S,C]=l.useState(null),N=uo(S),E=(N==null?void 0:N.width)??0,P=(N==null?void 0:N.height)??0,_=o+(s!=="center"?"-"+s:""),j=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},k=Array.isArray(d)?d:[d],$=k.length>0,O={padding:j,boundary:k.filter(ea),altBoundary:$},{refs:I,floatingStyles:V,placement:T,isPositioned:D,middlewareData:R}=Bi({strategy:"fixed",placement:_,whileElementsMounted:(...Q)=>Ti(...Q,{animationFrame:v==="always"}),elements:{reference:g.anchor},middleware:[Ui({mainAxis:r+P,alignmentAxis:i}),u&&Vi({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Wi():void 0,...O}),u&&Hi({...O}),zi({...O,apply:({elements:Q,rects:re,availableWidth:He,availableHeight:ze})=>{const{width:qe,height:zr}=re.reference,rt=Q.floating.style;rt.setProperty("--radix-popper-available-width",`${He}px`),rt.setProperty("--radix-popper-available-height",`${ze}px`),rt.setProperty("--radix-popper-anchor-width",`${qe}px`),rt.setProperty("--radix-popper-anchor-height",`${zr}px`)}}),S&&Gi({element:S,padding:a}),ta({arrowWidth:E,arrowHeight:P}),h&&qi({strategy:"referenceHidden",...O})]}),[W,X]=wo(T),de=ge(w);Y(()=>{D&&(de==null||de())},[D,de]);const Ve=(A=R.arrow)==null?void 0:A.x,We=(H=R.arrow)==null?void 0:H.y,me=((K=R.arrow)==null?void 0:K.centerOffset)!==0,[Ie,we]=l.useState();return Y(()=>{b&&we(window.getComputedStyle(b).zIndex)},[b]),c.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:D?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ie,"--radix-popper-transform-origin":[(U=R.transformOrigin)==null?void 0:U.x,(F=R.transformOrigin)==null?void 0:F.y].join(" "),...((B=R.hide)==null?void 0:B.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(Qi,{scope:n,placedSide:W,onArrowChange:C,arrowX:Ve,arrowY:We,shouldHideArrow:me,children:c.jsx(L.div,{"data-side":W,"data-align":X,...m,ref:y,style:{...m.style,animation:D?void 0:"none"}})})})});xo.displayName=pn;var bo="PopperArrow",Ji={top:"bottom",right:"left",bottom:"top",left:"right"},yo=l.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,s=Zi(bo,o),i=Ji[s.placedSide];return c.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:c.jsx(Yi,{...r,ref:n,style:{...r.style,display:"block"}})})});yo.displayName=bo;function ea(e){return e!==null}var ta=e=>({name:"transformOrigin",options:e,fn(t){var g,b,x;const{placement:n,rects:o,middlewareData:r}=t,i=((g=r.arrow)==null?void 0:g.centerOffset)!==0,a=i?0:e.arrowWidth,u=i?0:e.arrowHeight,[d,f]=wo(n),p={start:"0%",center:"50%",end:"100%"}[f],h=(((b=r.arrow)==null?void 0:b.x)??0)+a/2,v=(((x=r.arrow)==null?void 0:x.y)??0)+u/2;let w="",m="";return d==="bottom"?(w=i?p:`${h}px`,m=`${-u}px`):d==="top"?(w=i?p:`${h}px`,m=`${o.floating.height+u}px`):d==="right"?(w=`${-u}px`,m=i?p:`${v}px`):d==="left"&&(w=`${o.floating.width+u}px`,m=i?p:`${v}px`),{data:{x:w,y:m}}}});function wo(e){const[t,n="center"]=e.split("-");return[t,n]}var na=ho,oa=vo,ra=xo,sa=yo,ia="Portal",So=l.forwardRef((e,t)=>{var a;const{container:n,...o}=e,[r,s]=l.useState(!1);Y(()=>s(!0),[]);const i=n||r&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Kr.createPortal(c.jsx(L.div,{...o,ref:t}),i):null});So.displayName=ia;function aa(e){const t=ca(e),n=l.forwardRef((o,r)=>{const{children:s,...i}=o,a=l.Children.toArray(s),u=a.find(ua);if(u){const d=u.props.children,f=a.map(p=>p===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:p);return c.jsx(t,{...i,ref:r,children:l.isValidElement(d)?l.cloneElement(d,void 0,f):null})}return c.jsx(t,{...i,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function ca(e){const t=l.forwardRef((n,o)=>{const{children:r,...s}=n;if(l.isValidElement(r)){const i=fa(r),a=da(s,r.props);return r.type!==l.Fragment&&(a.ref=o?nn(o,i):i),l.cloneElement(r,a)}return l.Children.count(r)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var la=Symbol("radix.slottable");function ua(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===la}function da(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...a)=>{const u=s(...a);return r(...a),u}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function fa(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var pa=Wn[" useInsertionEffect ".trim().toString()]||Y;function Je({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,s,i]=ma({defaultProp:t,onChange:n}),a=e!==void 0,u=a?e:r;{const f=l.useRef(e!==void 0);l.useEffect(()=>{const p=f.current;p!==a&&console.warn(`${o} is changing from ${p?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,o])}const d=l.useCallback(f=>{var p;if(a){const h=ha(f)?f(e):f;h!==e&&((p=i.current)==null||p.call(i,h))}else s(f)},[a,e,s,i]);return[u,d]}function ma({defaultProp:e,onChange:t}){const[n,o]=l.useState(e),r=l.useRef(n),s=l.useRef(t);return pa(()=>{s.current=t},[t]),l.useEffect(()=>{var i;r.current!==n&&((i=s.current)==null||i.call(s,n),r.current=n)},[n,r]),[n,o,s]}function ha(e){return typeof e=="function"}function Co(e){const t=l.useRef({value:e,previous:e});return l.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Eo=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"}),ga="VisuallyHidden",va=l.forwardRef((e,t)=>c.jsx(L.span,{...e,ref:t,style:{...Eo,...e.style}}));va.displayName=ga;var xa=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},_e=new WeakMap,it=new WeakMap,at={},Bt=0,Po=function(e){return e&&(e.host||Po(e.parentNode))},ba=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=Po(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ya=function(e,t,n,o){var r=ba(t,Array.isArray(e)?e:[e]);at[n]||(at[n]=new WeakMap);var s=at[n],i=[],a=new Set,u=new Set(r),d=function(p){!p||a.has(p)||(a.add(p),d(p.parentNode))};r.forEach(d);var f=function(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,function(h){if(a.has(h))f(h);else try{var v=h.getAttribute(o),w=v!==null&&v!=="false",m=(_e.get(h)||0)+1,g=(s.get(h)||0)+1;_e.set(h,m),s.set(h,g),i.push(h),m===1&&w&&it.set(h,!0),g===1&&h.setAttribute(n,"true"),w||h.setAttribute(o,"true")}catch(b){console.error("aria-hidden: cannot operate on ",h,b)}})};return f(t),a.clear(),Bt++,function(){i.forEach(function(p){var h=_e.get(p)-1,v=s.get(p)-1;_e.set(p,h),s.set(p,v),h||(it.has(p)||p.removeAttribute(o),it.delete(p)),v||p.removeAttribute(n)}),Bt--,Bt||(_e=new WeakMap,_e=new WeakMap,it=new WeakMap,at={})}},wa=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=xa(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),ya(o,r,n,"aria-hidden")):function(){return null}},ie=function(){return ie=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},ie.apply(this,arguments)};function No(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function Sa(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,s;o<r;o++)(s||!(o in t))&&(s||(s=Array.prototype.slice.call(t,0,o)),s[o]=t[o]);return e.concat(s||Array.prototype.slice.call(t))}var ft="right-scroll-bar-position",pt="width-before-scroll-bar",Ca="with-scroll-bars-hidden",Ea="--removed-body-scroll-bar-size";function $t(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Pa(e,t){var n=l.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(o){var r=n.value;r!==o&&(n.value=o,n.callback(o,r))}}}})[0];return n.callback=t,n.facade}var Na=typeof window<"u"?l.useLayoutEffect:l.useEffect,Ln=new WeakMap;function Ra(e,t){var n=Pa(null,function(o){return e.forEach(function(r){return $t(r,o)})});return Na(function(){var o=Ln.get(n);if(o){var r=new Set(o),s=new Set(e),i=n.current;r.forEach(function(a){s.has(a)||$t(a,null)}),s.forEach(function(a){r.has(a)||$t(a,i)})}Ln.set(n,e)},[e]),n}function Aa(e){return e}function Ta(e,t){t===void 0&&(t=Aa);var n=[],o=!1,r={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,o);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(o=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){o=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var u=function(){var f=i;i=[],f.forEach(s)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(f){i.push(f),d()},filter:function(f){return i=i.filter(f),n}}}};return r}function ja(e){e===void 0&&(e={});var t=Ta(null);return t.options=ie({async:!0,ssr:!1},e),t}var Ro=function(e){var t=e.sideCar,n=No(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return l.createElement(o,ie({},n))};Ro.isSideCarExport=!0;function Ia(e,t){return e.useMedium(t),Ro}var Ao=ja(),Ut=function(){},At=l.forwardRef(function(e,t){var n=l.useRef(null),o=l.useState({onScrollCapture:Ut,onWheelCapture:Ut,onTouchMoveCapture:Ut}),r=o[0],s=o[1],i=e.forwardProps,a=e.children,u=e.className,d=e.removeScrollBar,f=e.enabled,p=e.shards,h=e.sideCar,v=e.noRelative,w=e.noIsolation,m=e.inert,g=e.allowPinchZoom,b=e.as,x=b===void 0?"div":b,y=e.gapMode,S=No(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=h,N=Ra([n,t]),E=ie(ie({},S),r);return l.createElement(l.Fragment,null,f&&l.createElement(C,{sideCar:Ao,removeScrollBar:d,shards:p,noRelative:v,noIsolation:w,inert:m,setCallbacks:s,allowPinchZoom:!!g,lockRef:n,gapMode:y}),i?l.cloneElement(l.Children.only(a),ie(ie({},E),{ref:N})):l.createElement(x,ie({},E,{className:u,ref:N}),a))});At.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};At.classNames={fullWidth:pt,zeroRight:ft};var _a=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Oa(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=_a();return t&&e.setAttribute("nonce",t),e}function Da(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ma(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var ka=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Oa())&&(Da(t,n),Ma(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},La=function(){var e=ka();return function(t,n){l.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},To=function(){var e=La(),t=function(n){var o=n.styles,r=n.dynamic;return e(o,r),null};return t},Fa={left:0,top:0,right:0,gap:0},Vt=function(e){return parseInt(e||"",10)||0},Ba=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[Vt(n),Vt(o),Vt(r)]},$a=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Fa;var t=Ba(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},Ua=To(),ke="data-scroll-locked",Va=function(e,t,n,o){var r=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
    2   .`.concat(Ca,` {
     1import{r as l,j as s,c as z,a as ns,b as os,d as rn,R as Ee,u as q,e as St,f as Zn,g as rs,h as we,i as Re,T as kt,B as K,X as ss,k as sn,M as is,l as bn,m as wn,n as Sn,o as as,v as Cn,p as cs,q as ls,s as Dt}from"../chunks/globals-B-Fr2V0D.js";const oe=l.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:z("rounded-lg border bg-muted text-card-foreground shadow-sm",e),...t}));oe.displayName="Card";const an=l.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:z("flex flex-col space-y-1.5 p-6",e),...t}));an.displayName="CardHeader";const cn=l.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:z("text-2xl font-semibold leading-none tracking-tight",e),...t}));cn.displayName="CardTitle";const Jn=l.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:z("text-sm text-muted-foreground",e),...t}));Jn.displayName="CardDescription";const et=l.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:z("p-6 pt-0",e),...t}));et.displayName="CardContent";const ds=l.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:z("flex items-center p-6 pt-0",e),...t}));ds.displayName="CardFooter";var us=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],fs=us.reduce((e,t)=>{const n=ns(`Primitive.${t}`),o=l.forwardRef((r,i)=>{const{asChild:a,...c}=r,d=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),ms="Label",eo=l.forwardRef((e,t)=>s.jsx(fs.label,{...e,ref:t,onMouseDown:n=>{var r;n.target.closest("button, input, select, textarea")||((r=e.onMouseDown)==null||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));eo.displayName=ms;var to=eo;const ps=os("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),H=l.forwardRef(({className:e,...t},n)=>s.jsx(to,{ref:n,className:z(ps(),e),...t}));H.displayName=to.displayName;const ae=l.forwardRef(({className:e,type:t,...n},o)=>s.jsx("input",{type:t,className:z("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...n}));ae.displayName="Input";function Nn(e,[t,n]){return Math.min(n,Math.max(t,e))}function L(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function Ve(e,t=[]){let n=[];function o(i,a){const c=l.createContext(a),d=n.length;n=[...n,a];const u=m=>{var b;const{scope:h,children:x,...w}=m,p=((b=h==null?void 0:h[e])==null?void 0:b[d])||c,g=l.useMemo(()=>w,Object.values(w));return s.jsx(p.Provider,{value:g,children:x})};u.displayName=i+"Provider";function f(m,h){var p;const x=((p=h==null?void 0:h[e])==null?void 0:p[d])||c,w=l.useContext(x);if(w)return w;if(a!==void 0)return a;throw new Error(`\`${m}\` must be used within \`${i}\``)}return[u,f]}const r=()=>{const i=n.map(a=>l.createContext(a));return function(c){const d=(c==null?void 0:c[e])||i;return l.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return r.scopeName=e,[o,hs(r,...t)]}function hs(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const a=o.reduce((c,{useScope:d,scopeName:u})=>{const m=d(i)[`__scope${u}`];return{...c,...m}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function En(e){const t=gs(e),n=l.forwardRef((o,r)=>{const{children:i,...a}=o,c=l.Children.toArray(i),d=c.find(xs);if(d){const u=d.props.children,f=c.map(m=>m===d?l.Children.count(u)>1?l.Children.only(null):l.isValidElement(u)?u.props.children:null:m);return s.jsx(t,{...a,ref:r,children:l.isValidElement(u)?l.cloneElement(u,void 0,f):null})}return s.jsx(t,{...a,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function gs(e){const t=l.forwardRef((n,o)=>{const{children:r,...i}=n;if(l.isValidElement(r)){const a=bs(r),c=ys(i,r.props);return r.type!==l.Fragment&&(c.ref=o?rn(o,a):a),l.cloneElement(r,c)}return l.Children.count(r)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var vs=Symbol("radix.slottable");function xs(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===vs}function ys(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...c)=>{const d=i(...c);return r(...c),d}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function bs(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function no(e){const t=e+"CollectionProvider",[n,o]=Ve(t),[r,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:g,children:b}=p,v=Ee.useRef(null),y=Ee.useRef(new Map).current;return s.jsx(r,{scope:g,itemMap:y,collectionRef:v,children:b})};a.displayName=t;const c=e+"CollectionSlot",d=En(c),u=Ee.forwardRef((p,g)=>{const{scope:b,children:v}=p,y=i(c,b),C=q(g,y.collectionRef);return s.jsx(d,{ref:C,children:v})});u.displayName=c;const f=e+"CollectionItemSlot",m="data-radix-collection-item",h=En(f),x=Ee.forwardRef((p,g)=>{const{scope:b,children:v,...y}=p,C=Ee.useRef(null),N=q(g,C),j=i(f,b);return Ee.useEffect(()=>(j.itemMap.set(C,{ref:C,...y}),()=>void j.itemMap.delete(C))),s.jsx(h,{[m]:"",ref:N,children:v})});x.displayName=f;function w(p){const g=i(e+"CollectionConsumer",p);return Ee.useCallback(()=>{const v=g.collectionRef.current;if(!v)return[];const y=Array.from(v.querySelectorAll(`[${m}]`));return Array.from(g.itemMap.values()).sort((j,S)=>y.indexOf(j.ref.current)-y.indexOf(S.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:a,Slot:u,ItemSlot:x},w,o]}var ws=l.createContext(void 0);function ln(e){const t=l.useContext(ws);return e||t||"ltr"}function Ss(e){const t=Cs(e),n=l.forwardRef((o,r)=>{const{children:i,...a}=o,c=l.Children.toArray(i),d=c.find(Es);if(d){const u=d.props.children,f=c.map(m=>m===d?l.Children.count(u)>1?l.Children.only(null):l.isValidElement(u)?u.props.children:null:m);return s.jsx(t,{...a,ref:r,children:l.isValidElement(u)?l.cloneElement(u,void 0,f):null})}return s.jsx(t,{...a,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function Cs(e){const t=l.forwardRef((n,o)=>{const{children:r,...i}=n;if(l.isValidElement(r)){const a=Ps(r),c=js(i,r.props);return r.type!==l.Fragment&&(c.ref=o?rn(o,a):a),l.cloneElement(r,c)}return l.Children.count(r)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ns=Symbol("radix.slottable");function Es(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ns}function js(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...c)=>{const d=i(...c);return r(...c),d}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function Ps(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var As=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],F=As.reduce((e,t)=>{const n=Ss(`Primitive.${t}`),o=l.forwardRef((r,i)=>{const{asChild:a,...c}=r,d=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function Rs(e,t){e&&St.flushSync(()=>e.dispatchEvent(t))}function xe(e){const t=l.useRef(e);return l.useEffect(()=>{t.current=e}),l.useMemo(()=>(...n)=>{var o;return(o=t.current)==null?void 0:o.call(t,...n)},[])}function Ts(e,t=globalThis==null?void 0:globalThis.document){const n=xe(e);l.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var _s="DismissableLayer",qt="dismissableLayer.update",Is="dismissableLayer.pointerDownOutside",ks="dismissableLayer.focusOutside",jn,oo=l.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ro=l.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:a,onDismiss:c,...d}=e,u=l.useContext(oo),[f,m]=l.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=l.useState({}),w=q(t,S=>m(S)),p=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=p.indexOf(g),v=f?p.indexOf(f):-1,y=u.layersWithOutsidePointerEventsDisabled.size>0,C=v>=b,N=Os(S=>{const E=S.target,P=[...u.branches].some(A=>A.contains(E));!C||P||(r==null||r(S),a==null||a(S),S.defaultPrevented||c==null||c())},h),j=Ls(S=>{const E=S.target;[...u.branches].some(A=>A.contains(E))||(i==null||i(S),a==null||a(S),S.defaultPrevented||c==null||c())},h);return Ts(S=>{v===u.layers.size-1&&(o==null||o(S),!S.defaultPrevented&&c&&(S.preventDefault(),c()))},h),l.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(jn=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Pn(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=jn)}},[f,h,n,u]),l.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Pn())},[f,u]),l.useEffect(()=>{const S=()=>x({});return document.addEventListener(qt,S),()=>document.removeEventListener(qt,S)},[]),s.jsx(F.div,{...d,ref:w,style:{pointerEvents:y?C?"auto":"none":void 0,...e.style},onFocusCapture:L(e.onFocusCapture,j.onFocusCapture),onBlurCapture:L(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:L(e.onPointerDownCapture,N.onPointerDownCapture)})});ro.displayName=_s;var Ds="DismissableLayerBranch",Ms=l.forwardRef((e,t)=>{const n=l.useContext(oo),o=l.useRef(null),r=q(t,o);return l.useEffect(()=>{const i=o.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),s.jsx(F.div,{...e,ref:r})});Ms.displayName=Ds;function Os(e,t=globalThis==null?void 0:globalThis.document){const n=xe(e),o=l.useRef(!1),r=l.useRef(()=>{});return l.useEffect(()=>{const i=c=>{if(c.target&&!o.current){let d=function(){so(Is,n,u,{discrete:!0})};const u={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=d,t.addEventListener("click",r.current,{once:!0})):d()}else t.removeEventListener("click",r.current);o.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function Ls(e,t=globalThis==null?void 0:globalThis.document){const n=xe(e),o=l.useRef(!1);return l.useEffect(()=>{const r=i=>{i.target&&!o.current&&so(ks,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Pn(){const e=new CustomEvent(qt);document.dispatchEvent(e)}function so(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?Rs(r,i):r.dispatchEvent(i)}var Mt=0;function Fs(){l.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??An()),document.body.insertAdjacentElement("beforeend",e[1]??An()),Mt++,()=>{Mt===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Mt--}},[])}function An(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ot="focusScope.autoFocusOnMount",Lt="focusScope.autoFocusOnUnmount",Rn={bubbles:!1,cancelable:!0},Bs="FocusScope",io=l.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:i,...a}=e,[c,d]=l.useState(null),u=xe(r),f=xe(i),m=l.useRef(null),h=q(t,p=>d(p)),x=l.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;l.useEffect(()=>{if(o){let p=function(y){if(x.paused||!c)return;const C=y.target;c.contains(C)?m.current=C:ve(m.current,{select:!0})},g=function(y){if(x.paused||!c)return;const C=y.relatedTarget;C!==null&&(c.contains(C)||ve(m.current,{select:!0}))},b=function(y){if(document.activeElement===document.body)for(const N of y)N.removedNodes.length>0&&ve(c)};document.addEventListener("focusin",p),document.addEventListener("focusout",g);const v=new MutationObserver(b);return c&&v.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",g),v.disconnect()}}},[o,c,x.paused]),l.useEffect(()=>{if(c){_n.add(x);const p=document.activeElement;if(!c.contains(p)){const b=new CustomEvent(Ot,Rn);c.addEventListener(Ot,u),c.dispatchEvent(b),b.defaultPrevented||(Vs(Hs(ao(c)),{select:!0}),document.activeElement===p&&ve(c))}return()=>{c.removeEventListener(Ot,u),setTimeout(()=>{const b=new CustomEvent(Lt,Rn);c.addEventListener(Lt,f),c.dispatchEvent(b),b.defaultPrevented||ve(p??document.body,{select:!0}),c.removeEventListener(Lt,f),_n.remove(x)},0)}}},[c,u,f,x]);const w=l.useCallback(p=>{if(!n&&!o||x.paused)return;const g=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,b=document.activeElement;if(g&&b){const v=p.currentTarget,[y,C]=$s(v);y&&C?!p.shiftKey&&b===C?(p.preventDefault(),n&&ve(y,{select:!0})):p.shiftKey&&b===y&&(p.preventDefault(),n&&ve(C,{select:!0})):b===v&&p.preventDefault()}},[n,o,x.paused]);return s.jsx(F.div,{tabIndex:-1,...a,ref:h,onKeyDown:w})});io.displayName=Bs;function Vs(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(ve(o,{select:t}),document.activeElement!==n)return}function $s(e){const t=ao(e),n=Tn(t,e),o=Tn(t.reverse(),e);return[n,o]}function ao(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Tn(e,t){for(const n of e)if(!Us(n,{upTo:t}))return n}function Us(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Xs(e){return e instanceof HTMLInputElement&&"select"in e}function ve(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Xs(e)&&t&&e.select()}}var _n=Ws();function Ws(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=In(e,t),e.unshift(t)},remove(t){var n;e=In(e,t),(n=e[0])==null||n.resume()}}}function In(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function Hs(e){return e.filter(t=>t.tagName!=="A")}var Y=globalThis!=null&&globalThis.document?l.useLayoutEffect:()=>{},zs=Zn[" useId ".trim().toString()]||(()=>{}),qs=0;function rt(e){const[t,n]=l.useState(zs());return Y(()=>{n(o=>o??String(qs++))},[e]),t?`radix-${t}`:""}const Gs=["top","right","bottom","left"],ye=Math.min,ee=Math.max,vt=Math.round,ct=Math.floor,de=e=>({x:e,y:e}),Ks={left:"right",right:"left",bottom:"top",top:"bottom"},Ys={start:"end",end:"start"};function Gt(e,t,n){return ee(e,ye(t,n))}function pe(e,t){return typeof e=="function"?e(t):e}function he(e){return e.split("-")[0]}function $e(e){return e.split("-")[1]}function dn(e){return e==="x"?"y":"x"}function un(e){return e==="y"?"height":"width"}const Qs=new Set(["top","bottom"]);function le(e){return Qs.has(he(e))?"y":"x"}function fn(e){return dn(le(e))}function Zs(e,t,n){n===void 0&&(n=!1);const o=$e(e),r=fn(e),i=un(r);let a=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=xt(a)),[a,xt(a)]}function Js(e){const t=xt(e);return[Kt(e),t,Kt(t)]}function Kt(e){return e.replace(/start|end/g,t=>Ys[t])}const kn=["left","right"],Dn=["right","left"],ei=["top","bottom"],ti=["bottom","top"];function ni(e,t,n){switch(e){case"top":case"bottom":return n?t?Dn:kn:t?kn:Dn;case"left":case"right":return t?ei:ti;default:return[]}}function oi(e,t,n,o){const r=$e(e);let i=ni(he(e),n==="start",o);return r&&(i=i.map(a=>a+"-"+r),t&&(i=i.concat(i.map(Kt)))),i}function xt(e){return e.replace(/left|right|bottom|top/g,t=>Ks[t])}function ri(e){return{top:0,right:0,bottom:0,left:0,...e}}function co(e){return typeof e!="number"?ri(e):{top:e,right:e,bottom:e,left:e}}function yt(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Mn(e,t,n){let{reference:o,floating:r}=e;const i=le(t),a=fn(t),c=un(a),d=he(t),u=i==="y",f=o.x+o.width/2-r.width/2,m=o.y+o.height/2-r.height/2,h=o[c]/2-r[c]/2;let x;switch(d){case"top":x={x:f,y:o.y-r.height};break;case"bottom":x={x:f,y:o.y+o.height};break;case"right":x={x:o.x+o.width,y:m};break;case"left":x={x:o.x-r.width,y:m};break;default:x={x:o.x,y:o.y}}switch($e(t)){case"start":x[a]-=h*(n&&u?-1:1);break;case"end":x[a]+=h*(n&&u?-1:1);break}return x}const si=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:a}=n,c=i.filter(Boolean),d=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:f,y:m}=Mn(u,o,d),h=o,x={},w=0;for(let p=0;p<c.length;p++){const{name:g,fn:b}=c[p],{x:v,y,data:C,reset:N}=await b({x:f,y:m,initialPlacement:o,placement:h,strategy:r,middlewareData:x,rects:u,platform:a,elements:{reference:e,floating:t}});f=v??f,m=y??m,x={...x,[g]:{...x[g],...C}},N&&w<=50&&(w++,typeof N=="object"&&(N.placement&&(h=N.placement),N.rects&&(u=N.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:r}):N.rects),{x:f,y:m}=Mn(u,h,d)),p=-1)}return{x:f,y:m,placement:h,strategy:r,middlewareData:x}};async function tt(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:a,elements:c,strategy:d}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:m="floating",altBoundary:h=!1,padding:x=0}=pe(t,e),w=co(x),g=c[h?m==="floating"?"reference":"floating":m],b=yt(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(g)))==null||n?g:g.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:u,rootBoundary:f,strategy:d})),v=m==="floating"?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,y=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),C=await(i.isElement==null?void 0:i.isElement(y))?await(i.getScale==null?void 0:i.getScale(y))||{x:1,y:1}:{x:1,y:1},N=yt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:v,offsetParent:y,strategy:d}):v);return{top:(b.top-N.top+w.top)/C.y,bottom:(N.bottom-b.bottom+w.bottom)/C.y,left:(b.left-N.left+w.left)/C.x,right:(N.right-b.right+w.right)/C.x}}const ii=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:a,elements:c,middlewareData:d}=t,{element:u,padding:f=0}=pe(e,t)||{};if(u==null)return{};const m=co(f),h={x:n,y:o},x=fn(r),w=un(x),p=await a.getDimensions(u),g=x==="y",b=g?"top":"left",v=g?"bottom":"right",y=g?"clientHeight":"clientWidth",C=i.reference[w]+i.reference[x]-h[x]-i.floating[w],N=h[x]-i.reference[x],j=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let S=j?j[y]:0;(!S||!await(a.isElement==null?void 0:a.isElement(j)))&&(S=c.floating[y]||i.floating[w]);const E=C/2-N/2,P=S/2-p[w]/2-1,A=ye(m[b],P),R=ye(m[v],P),D=A,I=S-p[w]-R,M=S/2-p[w]/2+E,U=Gt(D,M,I),k=!d.arrow&&$e(r)!=null&&M!==U&&i.reference[w]/2-(M<D?A:R)-p[w]/2<0,O=k?M<D?M-D:M-I:0;return{[x]:h[x]+O,data:{[x]:U,centerOffset:M-U-O,...k&&{alignmentOffset:O}},reset:k}}}),ai=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:a,initialPlacement:c,platform:d,elements:u}=t,{mainAxis:f=!0,crossAxis:m=!0,fallbackPlacements:h,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:p=!0,...g}=pe(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=he(r),v=le(c),y=he(c)===c,C=await(d.isRTL==null?void 0:d.isRTL(u.floating)),N=h||(y||!p?[xt(c)]:Js(c)),j=w!=="none";!h&&j&&N.push(...oi(c,p,w,C));const S=[c,...N],E=await tt(t,g),P=[];let A=((o=i.flip)==null?void 0:o.overflows)||[];if(f&&P.push(E[b]),m){const M=Zs(r,a,C);P.push(E[M[0]],E[M[1]])}if(A=[...A,{placement:r,overflows:P}],!P.every(M=>M<=0)){var R,D;const M=(((R=i.flip)==null?void 0:R.index)||0)+1,U=S[M];if(U&&(!(m==="alignment"?v!==le(U):!1)||A.every(T=>le(T.placement)===v?T.overflows[0]>0:!0)))return{data:{index:M,overflows:A},reset:{placement:U}};let k=(D=A.filter(O=>O.overflows[0]<=0).sort((O,T)=>O.overflows[1]-T.overflows[1])[0])==null?void 0:D.placement;if(!k)switch(x){case"bestFit":{var I;const O=(I=A.filter(T=>{if(j){const X=le(T.placement);return X===v||X==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(X=>X>0).reduce((X,Z)=>X+Z,0)]).sort((T,X)=>T[1]-X[1])[0])==null?void 0:I[0];O&&(k=O);break}case"initialPlacement":k=c;break}if(r!==k)return{reset:{placement:k}}}return{}}}};function On(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ln(e){return Gs.some(t=>e[t]>=0)}const ci=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=pe(e,t);switch(o){case"referenceHidden":{const i=await tt(t,{...r,elementContext:"reference"}),a=On(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Ln(a)}}}case"escaped":{const i=await tt(t,{...r,altBoundary:!0}),a=On(i,n.floating);return{data:{escapedOffsets:a,escaped:Ln(a)}}}default:return{}}}}},lo=new Set(["left","top"]);async function li(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),a=he(n),c=$e(n),d=le(n)==="y",u=lo.has(a)?-1:1,f=i&&d?-1:1,m=pe(t,e);let{mainAxis:h,crossAxis:x,alignmentAxis:w}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&typeof w=="number"&&(x=c==="end"?w*-1:w),d?{x:x*f,y:h*u}:{x:h*u,y:x*f}}const di=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:a,middlewareData:c}=t,d=await li(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+d.x,y:i+d.y,data:{...d,placement:a}}}}},ui=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:g=>{let{x:b,y:v}=g;return{x:b,y:v}}},...d}=pe(e,t),u={x:n,y:o},f=await tt(t,d),m=le(he(r)),h=dn(m);let x=u[h],w=u[m];if(i){const g=h==="y"?"top":"left",b=h==="y"?"bottom":"right",v=x+f[g],y=x-f[b];x=Gt(v,x,y)}if(a){const g=m==="y"?"top":"left",b=m==="y"?"bottom":"right",v=w+f[g],y=w-f[b];w=Gt(v,w,y)}const p=c.fn({...t,[h]:x,[m]:w});return{...p,data:{x:p.x-n,y:p.y-o,enabled:{[h]:i,[m]:a}}}}}},fi=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:i,middlewareData:a}=t,{offset:c=0,mainAxis:d=!0,crossAxis:u=!0}=pe(e,t),f={x:n,y:o},m=le(r),h=dn(m);let x=f[h],w=f[m];const p=pe(c,t),g=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(d){const y=h==="y"?"height":"width",C=i.reference[h]-i.floating[y]+g.mainAxis,N=i.reference[h]+i.reference[y]-g.mainAxis;x<C?x=C:x>N&&(x=N)}if(u){var b,v;const y=h==="y"?"width":"height",C=lo.has(he(r)),N=i.reference[m]-i.floating[y]+(C&&((b=a.offset)==null?void 0:b[m])||0)+(C?0:g.crossAxis),j=i.reference[m]+i.reference[y]+(C?0:((v=a.offset)==null?void 0:v[m])||0)-(C?g.crossAxis:0);w<N?w=N:w>j&&(w=j)}return{[h]:x,[m]:w}}}},mi=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:a,elements:c}=t,{apply:d=()=>{},...u}=pe(e,t),f=await tt(t,u),m=he(r),h=$e(r),x=le(r)==="y",{width:w,height:p}=i.floating;let g,b;m==="top"||m==="bottom"?(g=m,b=h===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(b=m,g=h==="end"?"top":"bottom");const v=p-f.top-f.bottom,y=w-f.left-f.right,C=ye(p-f[g],v),N=ye(w-f[b],y),j=!t.middlewareData.shift;let S=C,E=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(E=y),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(S=v),j&&!h){const A=ee(f.left,0),R=ee(f.right,0),D=ee(f.top,0),I=ee(f.bottom,0);x?E=w-2*(A!==0||R!==0?A+R:ee(f.left,f.right)):S=p-2*(D!==0||I!==0?D+I:ee(f.top,f.bottom))}await d({...t,availableWidth:E,availableHeight:S});const P=await a.getDimensions(c.floating);return w!==P.width||p!==P.height?{reset:{rects:!0}}:{}}}};function Ct(){return typeof window<"u"}function Ue(e){return uo(e)?(e.nodeName||"").toLowerCase():"#document"}function te(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function fe(e){var t;return(t=(uo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function uo(e){return Ct()?e instanceof Node||e instanceof te(e).Node:!1}function re(e){return Ct()?e instanceof Element||e instanceof te(e).Element:!1}function ue(e){return Ct()?e instanceof HTMLElement||e instanceof te(e).HTMLElement:!1}function Fn(e){return!Ct()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof te(e).ShadowRoot}const pi=new Set(["inline","contents"]);function st(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=se(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!pi.has(r)}const hi=new Set(["table","td","th"]);function gi(e){return hi.has(Ue(e))}const vi=[":popover-open",":modal"];function Nt(e){return vi.some(t=>{try{return e.matches(t)}catch{return!1}})}const xi=["transform","translate","scale","rotate","perspective"],yi=["transform","translate","scale","rotate","perspective","filter"],bi=["paint","layout","strict","content"];function mn(e){const t=pn(),n=re(e)?se(e):e;return xi.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||yi.some(o=>(n.willChange||"").includes(o))||bi.some(o=>(n.contain||"").includes(o))}function wi(e){let t=be(e);for(;ue(t)&&!Be(t);){if(mn(t))return t;if(Nt(t))return null;t=be(t)}return null}function pn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Si=new Set(["html","body","#document"]);function Be(e){return Si.has(Ue(e))}function se(e){return te(e).getComputedStyle(e)}function Et(e){return re(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function be(e){if(Ue(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Fn(e)&&e.host||fe(e);return Fn(t)?t.host:t}function fo(e){const t=be(e);return Be(t)?e.ownerDocument?e.ownerDocument.body:e.body:ue(t)&&st(t)?t:fo(t)}function nt(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=fo(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),a=te(r);if(i){const c=Yt(a);return t.concat(a,a.visualViewport||[],st(r)?r:[],c&&n?nt(c):[])}return t.concat(r,nt(r,[],n))}function Yt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function mo(e){const t=se(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=ue(e),i=r?e.offsetWidth:n,a=r?e.offsetHeight:o,c=vt(n)!==i||vt(o)!==a;return c&&(n=i,o=a),{width:n,height:o,$:c}}function hn(e){return re(e)?e:e.contextElement}function Me(e){const t=hn(e);if(!ue(t))return de(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=mo(t);let a=(i?vt(n.width):n.width)/o,c=(i?vt(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const Ci=de(0);function po(e){const t=te(e);return!pn()||!t.visualViewport?Ci:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ni(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==te(e)?!1:t}function je(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=hn(e);let a=de(1);t&&(o?re(o)&&(a=Me(o)):a=Me(e));const c=Ni(i,n,o)?po(i):de(0);let d=(r.left+c.x)/a.x,u=(r.top+c.y)/a.y,f=r.width/a.x,m=r.height/a.y;if(i){const h=te(i),x=o&&re(o)?te(o):o;let w=h,p=Yt(w);for(;p&&o&&x!==w;){const g=Me(p),b=p.getBoundingClientRect(),v=se(p),y=b.left+(p.clientLeft+parseFloat(v.paddingLeft))*g.x,C=b.top+(p.clientTop+parseFloat(v.paddingTop))*g.y;d*=g.x,u*=g.y,f*=g.x,m*=g.y,d+=y,u+=C,w=te(p),p=Yt(w)}}return yt({width:f,height:m,x:d,y:u})}function jt(e,t){const n=Et(e).scrollLeft;return t?t.left+n:je(fe(e)).left+n}function ho(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-jt(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function Ei(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",a=fe(o),c=t?Nt(t.floating):!1;if(o===a||c&&i)return n;let d={scrollLeft:0,scrollTop:0},u=de(1);const f=de(0),m=ue(o);if((m||!m&&!i)&&((Ue(o)!=="body"||st(a))&&(d=Et(o)),ue(o))){const x=je(o);u=Me(o),f.x=x.x+o.clientLeft,f.y=x.y+o.clientTop}const h=a&&!m&&!i?ho(a,d):de(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-d.scrollLeft*u.x+f.x+h.x,y:n.y*u.y-d.scrollTop*u.y+f.y+h.y}}function ji(e){return Array.from(e.getClientRects())}function Pi(e){const t=fe(e),n=Et(e),o=e.ownerDocument.body,r=ee(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=ee(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+jt(e);const c=-n.scrollTop;return se(o).direction==="rtl"&&(a+=ee(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:a,y:c}}const Bn=25;function Ai(e,t){const n=te(e),o=fe(e),r=n.visualViewport;let i=o.clientWidth,a=o.clientHeight,c=0,d=0;if(r){i=r.width,a=r.height;const f=pn();(!f||f&&t==="fixed")&&(c=r.offsetLeft,d=r.offsetTop)}const u=jt(o);if(u<=0){const f=o.ownerDocument,m=f.body,h=getComputedStyle(m),x=f.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,w=Math.abs(o.clientWidth-m.clientWidth-x);w<=Bn&&(i-=w)}else u<=Bn&&(i+=u);return{width:i,height:a,x:c,y:d}}const Ri=new Set(["absolute","fixed"]);function Ti(e,t){const n=je(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=ue(e)?Me(e):de(1),a=e.clientWidth*i.x,c=e.clientHeight*i.y,d=r*i.x,u=o*i.y;return{width:a,height:c,x:d,y:u}}function Vn(e,t,n){let o;if(t==="viewport")o=Ai(e,n);else if(t==="document")o=Pi(fe(e));else if(re(t))o=Ti(t,n);else{const r=po(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return yt(o)}function go(e,t){const n=be(e);return n===t||!re(n)||Be(n)?!1:se(n).position==="fixed"||go(n,t)}function _i(e,t){const n=t.get(e);if(n)return n;let o=nt(e,[],!1).filter(c=>re(c)&&Ue(c)!=="body"),r=null;const i=se(e).position==="fixed";let a=i?be(e):e;for(;re(a)&&!Be(a);){const c=se(a),d=mn(a);!d&&c.position==="fixed"&&(r=null),(i?!d&&!r:!d&&c.position==="static"&&!!r&&Ri.has(r.position)||st(a)&&!d&&go(e,a))?o=o.filter(f=>f!==a):r=c,a=be(a)}return t.set(e,o),o}function Ii(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const a=[...n==="clippingAncestors"?Nt(t)?[]:_i(t,this._c):[].concat(n),o],c=a[0],d=a.reduce((u,f)=>{const m=Vn(t,f,r);return u.top=ee(m.top,u.top),u.right=ye(m.right,u.right),u.bottom=ye(m.bottom,u.bottom),u.left=ee(m.left,u.left),u},Vn(t,c,r));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function ki(e){const{width:t,height:n}=mo(e);return{width:t,height:n}}function Di(e,t,n){const o=ue(t),r=fe(t),i=n==="fixed",a=je(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const d=de(0);function u(){d.x=jt(r)}if(o||!o&&!i)if((Ue(t)!=="body"||st(r))&&(c=Et(t)),o){const x=je(t,!0,i,t);d.x=x.x+t.clientLeft,d.y=x.y+t.clientTop}else r&&u();i&&!o&&r&&u();const f=r&&!o&&!i?ho(r,c):de(0),m=a.left+c.scrollLeft-d.x-f.x,h=a.top+c.scrollTop-d.y-f.y;return{x:m,y:h,width:a.width,height:a.height}}function Ft(e){return se(e).position==="static"}function $n(e,t){if(!ue(e)||se(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return fe(e)===n&&(n=n.ownerDocument.body),n}function vo(e,t){const n=te(e);if(Nt(e))return n;if(!ue(e)){let r=be(e);for(;r&&!Be(r);){if(re(r)&&!Ft(r))return r;r=be(r)}return n}let o=$n(e,t);for(;o&&gi(o)&&Ft(o);)o=$n(o,t);return o&&Be(o)&&Ft(o)&&!mn(o)?n:o||wi(e)||n}const Mi=async function(e){const t=this.getOffsetParent||vo,n=this.getDimensions,o=await n(e.floating);return{reference:Di(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Oi(e){return se(e).direction==="rtl"}const Li={convertOffsetParentRelativeRectToViewportRelativeRect:Ei,getDocumentElement:fe,getClippingRect:Ii,getOffsetParent:vo,getElementRects:Mi,getClientRects:ji,getDimensions:ki,getScale:Me,isElement:re,isRTL:Oi};function xo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Fi(e,t){let n=null,o;const r=fe(e);function i(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function a(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),i();const u=e.getBoundingClientRect(),{left:f,top:m,width:h,height:x}=u;if(c||t(),!h||!x)return;const w=ct(m),p=ct(r.clientWidth-(f+h)),g=ct(r.clientHeight-(m+x)),b=ct(f),y={rootMargin:-w+"px "+-p+"px "+-g+"px "+-b+"px",threshold:ee(0,ye(1,d))||1};let C=!0;function N(j){const S=j[0].intersectionRatio;if(S!==d){if(!C)return a();S?a(!1,S):o=setTimeout(()=>{a(!1,1e-7)},1e3)}S===1&&!xo(u,e.getBoundingClientRect())&&a(),C=!1}try{n=new IntersectionObserver(N,{...y,root:r.ownerDocument})}catch{n=new IntersectionObserver(N,y)}n.observe(e)}return a(!0),i}function Bi(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,u=hn(e),f=r||i?[...u?nt(u):[],...nt(t)]:[];f.forEach(b=>{r&&b.addEventListener("scroll",n,{passive:!0}),i&&b.addEventListener("resize",n)});const m=u&&c?Fi(u,n):null;let h=-1,x=null;a&&(x=new ResizeObserver(b=>{let[v]=b;v&&v.target===u&&x&&(x.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var y;(y=x)==null||y.observe(t)})),n()}),u&&!d&&x.observe(u),x.observe(t));let w,p=d?je(e):null;d&&g();function g(){const b=je(e);p&&!xo(p,b)&&n(),p=b,w=requestAnimationFrame(g)}return n(),()=>{var b;f.forEach(v=>{r&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),m==null||m(),(b=x)==null||b.disconnect(),x=null,d&&cancelAnimationFrame(w)}}const Vi=di,$i=ui,Ui=ai,Xi=mi,Wi=ci,Un=ii,Hi=fi,zi=(e,t,n)=>{const o=new Map,r={platform:Li,...n},i={...r.platform,_c:o};return si(e,t,{...r,platform:i})};var qi=typeof document<"u",Gi=function(){},pt=qi?l.useLayoutEffect:Gi;function bt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!bt(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!bt(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function yo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Xn(e,t){const n=yo(e);return Math.round(t*n)/n}function Bt(e){const t=l.useRef(e);return pt(()=>{t.current=e}),t}function Ki(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:a}={},transform:c=!0,whileElementsMounted:d,open:u}=e,[f,m]=l.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,x]=l.useState(o);bt(h,o)||x(o);const[w,p]=l.useState(null),[g,b]=l.useState(null),v=l.useCallback(T=>{T!==j.current&&(j.current=T,p(T))},[]),y=l.useCallback(T=>{T!==S.current&&(S.current=T,b(T))},[]),C=i||w,N=a||g,j=l.useRef(null),S=l.useRef(null),E=l.useRef(f),P=d!=null,A=Bt(d),R=Bt(r),D=Bt(u),I=l.useCallback(()=>{if(!j.current||!S.current)return;const T={placement:t,strategy:n,middleware:h};R.current&&(T.platform=R.current),zi(j.current,S.current,T).then(X=>{const Z={...X,isPositioned:D.current!==!1};M.current&&!bt(E.current,Z)&&(E.current=Z,St.flushSync(()=>{m(Z)}))})},[h,t,n,R,D]);pt(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,m(T=>({...T,isPositioned:!1})))},[u]);const M=l.useRef(!1);pt(()=>(M.current=!0,()=>{M.current=!1}),[]),pt(()=>{if(C&&(j.current=C),N&&(S.current=N),C&&N){if(A.current)return A.current(C,N,I);I()}},[C,N,I,A,P]);const U=l.useMemo(()=>({reference:j,floating:S,setReference:v,setFloating:y}),[v,y]),k=l.useMemo(()=>({reference:C,floating:N}),[C,N]),O=l.useMemo(()=>{const T={position:n,left:0,top:0};if(!k.floating)return T;const X=Xn(k.floating,f.x),Z=Xn(k.floating,f.y);return c?{...T,transform:"translate("+X+"px, "+Z+"px)",...yo(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:X,top:Z}},[n,c,k.floating,f.x,f.y]);return l.useMemo(()=>({...f,update:I,refs:U,elements:k,floatingStyles:O}),[f,I,U,k,O])}const Yi=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?Un({element:o.current,padding:r}).fn(n):{}:o?Un({element:o,padding:r}).fn(n):{}}}},Qi=(e,t)=>({...Vi(e),options:[e,t]}),Zi=(e,t)=>({...$i(e),options:[e,t]}),Ji=(e,t)=>({...Hi(e),options:[e,t]}),ea=(e,t)=>({...Ui(e),options:[e,t]}),ta=(e,t)=>({...Xi(e),options:[e,t]}),na=(e,t)=>({...Wi(e),options:[e,t]}),oa=(e,t)=>({...Yi(e),options:[e,t]});var ra="Arrow",bo=l.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...i}=e;return s.jsx(F.svg,{...i,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});bo.displayName=ra;var sa=bo;function wo(e){const[t,n]=l.useState(void 0);return Y(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let a,c;if("borderBoxSize"in i){const d=i.borderBoxSize,u=Array.isArray(d)?d[0]:d;a=u.inlineSize,c=u.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var gn="Popper",[So,Co]=Ve(gn),[ia,No]=So(gn),Eo=e=>{const{__scopePopper:t,children:n}=e,[o,r]=l.useState(null);return s.jsx(ia,{scope:t,anchor:o,onAnchorChange:r,children:n})};Eo.displayName=gn;var jo="PopperAnchor",Po=l.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,i=No(jo,n),a=l.useRef(null),c=q(t,a),d=l.useRef(null);return l.useEffect(()=>{const u=d.current;d.current=(o==null?void 0:o.current)||a.current,u!==d.current&&i.onAnchorChange(d.current)}),o?null:s.jsx(F.div,{...r,ref:c})});Po.displayName=jo;var vn="PopperContent",[aa,ca]=So(vn),Ao=l.forwardRef((e,t)=>{var _,W,G,$,B,V;const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:i="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:m="partial",hideWhenDetached:h=!1,updatePositionStrategy:x="optimized",onPlaced:w,...p}=e,g=No(vn,n),[b,v]=l.useState(null),y=q(t,J=>v(J)),[C,N]=l.useState(null),j=wo(C),S=(j==null?void 0:j.width)??0,E=(j==null?void 0:j.height)??0,P=o+(i!=="center"?"-"+i:""),A=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},R=Array.isArray(u)?u:[u],D=R.length>0,I={padding:A,boundary:R.filter(da),altBoundary:D},{refs:M,floatingStyles:U,placement:k,isPositioned:O,middlewareData:T}=Ki({strategy:"fixed",placement:P,whileElementsMounted:(...J)=>Bi(...J,{animationFrame:x==="always"}),elements:{reference:g.anchor},middleware:[Qi({mainAxis:r+E,alignmentAxis:a}),d&&Zi({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?Ji():void 0,...I}),d&&ea({...I}),ta({...I,apply:({elements:J,rects:ie,availableWidth:ze,availableHeight:qe})=>{const{width:Ge,height:ts}=ie.reference,at=J.floating.style;at.setProperty("--radix-popper-available-width",`${ze}px`),at.setProperty("--radix-popper-available-height",`${qe}px`),at.setProperty("--radix-popper-anchor-width",`${Ge}px`),at.setProperty("--radix-popper-anchor-height",`${ts}px`)}}),C&&oa({element:C,padding:c}),ua({arrowWidth:S,arrowHeight:E}),h&&na({strategy:"referenceHidden",...I})]}),[X,Z]=_o(k),me=xe(w);Y(()=>{O&&(me==null||me())},[O,me]);const We=(_=T.arrow)==null?void 0:_.x,He=(W=T.arrow)==null?void 0:W.y,ge=((G=T.arrow)==null?void 0:G.centerOffset)!==0,[Te,Ne]=l.useState();return Y(()=>{b&&Ne(window.getComputedStyle(b).zIndex)},[b]),s.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:O?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Te,"--radix-popper-transform-origin":[($=T.transformOrigin)==null?void 0:$.x,(B=T.transformOrigin)==null?void 0:B.y].join(" "),...((V=T.hide)==null?void 0:V.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(aa,{scope:n,placedSide:X,onArrowChange:N,arrowX:We,arrowY:He,shouldHideArrow:ge,children:s.jsx(F.div,{"data-side":X,"data-align":Z,...p,ref:y,style:{...p.style,animation:O?void 0:"none"}})})})});Ao.displayName=vn;var Ro="PopperArrow",la={top:"bottom",right:"left",bottom:"top",left:"right"},To=l.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,i=ca(Ro,o),a=la[i.placedSide];return s.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:s.jsx(sa,{...r,ref:n,style:{...r.style,display:"block"}})})});To.displayName=Ro;function da(e){return e!==null}var ua=e=>({name:"transformOrigin",options:e,fn(t){var g,b,v;const{placement:n,rects:o,middlewareData:r}=t,a=((g=r.arrow)==null?void 0:g.centerOffset)!==0,c=a?0:e.arrowWidth,d=a?0:e.arrowHeight,[u,f]=_o(n),m={start:"0%",center:"50%",end:"100%"}[f],h=(((b=r.arrow)==null?void 0:b.x)??0)+c/2,x=(((v=r.arrow)==null?void 0:v.y)??0)+d/2;let w="",p="";return u==="bottom"?(w=a?m:`${h}px`,p=`${-d}px`):u==="top"?(w=a?m:`${h}px`,p=`${o.floating.height+d}px`):u==="right"?(w=`${-d}px`,p=a?m:`${x}px`):u==="left"&&(w=`${o.floating.width+d}px`,p=a?m:`${x}px`),{data:{x:w,y:p}}}});function _o(e){const[t,n="center"]=e.split("-");return[t,n]}var fa=Eo,ma=Po,pa=Ao,ha=To,ga="Portal",Io=l.forwardRef((e,t)=>{var c;const{container:n,...o}=e,[r,i]=l.useState(!1);Y(()=>i(!0),[]);const a=n||r&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?rs.createPortal(s.jsx(F.div,{...o,ref:t}),a):null});Io.displayName=ga;function va(e){const t=xa(e),n=l.forwardRef((o,r)=>{const{children:i,...a}=o,c=l.Children.toArray(i),d=c.find(ba);if(d){const u=d.props.children,f=c.map(m=>m===d?l.Children.count(u)>1?l.Children.only(null):l.isValidElement(u)?u.props.children:null:m);return s.jsx(t,{...a,ref:r,children:l.isValidElement(u)?l.cloneElement(u,void 0,f):null})}return s.jsx(t,{...a,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function xa(e){const t=l.forwardRef((n,o)=>{const{children:r,...i}=n;if(l.isValidElement(r)){const a=Sa(r),c=wa(i,r.props);return r.type!==l.Fragment&&(c.ref=o?rn(o,a):a),l.cloneElement(r,c)}return l.Children.count(r)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ya=Symbol("radix.slottable");function ba(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ya}function wa(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...c)=>{const d=i(...c);return r(...c),d}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function Sa(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ca=Zn[" useInsertionEffect ".trim().toString()]||Y;function ot({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,i,a]=Na({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:r;{const f=l.useRef(e!==void 0);l.useEffect(()=>{const m=f.current;m!==c&&console.warn(`${o} is changing from ${m?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=c},[c,o])}const u=l.useCallback(f=>{var m;if(c){const h=Ea(f)?f(e):f;h!==e&&((m=a.current)==null||m.call(a,h))}else i(f)},[c,e,i,a]);return[d,u]}function Na({defaultProp:e,onChange:t}){const[n,o]=l.useState(e),r=l.useRef(n),i=l.useRef(t);return Ca(()=>{i.current=t},[t]),l.useEffect(()=>{var a;r.current!==n&&((a=i.current)==null||a.call(i,n),r.current=n)},[n,r]),[n,o,i]}function Ea(e){return typeof e=="function"}function ko(e){const t=l.useRef({value:e,previous:e});return l.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Do=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"}),ja="VisuallyHidden",Pa=l.forwardRef((e,t)=>s.jsx(F.span,{...e,ref:t,style:{...Do,...e.style}}));Pa.displayName=ja;var Aa=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},_e=new WeakMap,lt=new WeakMap,dt={},Vt=0,Mo=function(e){return e&&(e.host||Mo(e.parentNode))},Ra=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=Mo(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Ta=function(e,t,n,o){var r=Ra(t,Array.isArray(e)?e:[e]);dt[n]||(dt[n]=new WeakMap);var i=dt[n],a=[],c=new Set,d=new Set(r),u=function(m){!m||c.has(m)||(c.add(m),u(m.parentNode))};r.forEach(u);var f=function(m){!m||d.has(m)||Array.prototype.forEach.call(m.children,function(h){if(c.has(h))f(h);else try{var x=h.getAttribute(o),w=x!==null&&x!=="false",p=(_e.get(h)||0)+1,g=(i.get(h)||0)+1;_e.set(h,p),i.set(h,g),a.push(h),p===1&&w&&lt.set(h,!0),g===1&&h.setAttribute(n,"true"),w||h.setAttribute(o,"true")}catch(b){console.error("aria-hidden: cannot operate on ",h,b)}})};return f(t),c.clear(),Vt++,function(){a.forEach(function(m){var h=_e.get(m)-1,x=i.get(m)-1;_e.set(m,h),i.set(m,x),h||(lt.has(m)||m.removeAttribute(o),lt.delete(m)),x||m.removeAttribute(n)}),Vt--,Vt||(_e=new WeakMap,_e=new WeakMap,lt=new WeakMap,dt={})}},_a=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=Aa(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),Ta(o,r,n,"aria-hidden")):function(){return null}},ce=function(){return ce=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},ce.apply(this,arguments)};function Oo(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function Ia(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}var ht="right-scroll-bar-position",gt="width-before-scroll-bar",ka="with-scroll-bars-hidden",Da="--removed-body-scroll-bar-size";function $t(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Ma(e,t){var n=l.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(o){var r=n.value;r!==o&&(n.value=o,n.callback(o,r))}}}})[0];return n.callback=t,n.facade}var Oa=typeof window<"u"?l.useLayoutEffect:l.useEffect,Wn=new WeakMap;function La(e,t){var n=Ma(null,function(o){return e.forEach(function(r){return $t(r,o)})});return Oa(function(){var o=Wn.get(n);if(o){var r=new Set(o),i=new Set(e),a=n.current;r.forEach(function(c){i.has(c)||$t(c,null)}),i.forEach(function(c){r.has(c)||$t(c,a)})}Wn.set(n,e)},[e]),n}function Fa(e){return e}function Ba(e,t){t===void 0&&(t=Fa);var n=[],o=!1,r={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var a=t(i,o);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(i){for(o=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(c){return i(c)},filter:function(){return n}}},assignMedium:function(i){o=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(i),a=n}var d=function(){var f=a;a=[],f.forEach(i)},u=function(){return Promise.resolve().then(d)};u(),n={push:function(f){a.push(f),u()},filter:function(f){return a=a.filter(f),n}}}};return r}function Va(e){e===void 0&&(e={});var t=Ba(null);return t.options=ce({async:!0,ssr:!1},e),t}var Lo=function(e){var t=e.sideCar,n=Oo(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return l.createElement(o,ce({},n))};Lo.isSideCarExport=!0;function $a(e,t){return e.useMedium(t),Lo}var Fo=Va(),Ut=function(){},Pt=l.forwardRef(function(e,t){var n=l.useRef(null),o=l.useState({onScrollCapture:Ut,onWheelCapture:Ut,onTouchMoveCapture:Ut}),r=o[0],i=o[1],a=e.forwardProps,c=e.children,d=e.className,u=e.removeScrollBar,f=e.enabled,m=e.shards,h=e.sideCar,x=e.noRelative,w=e.noIsolation,p=e.inert,g=e.allowPinchZoom,b=e.as,v=b===void 0?"div":b,y=e.gapMode,C=Oo(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=h,j=La([n,t]),S=ce(ce({},C),r);return l.createElement(l.Fragment,null,f&&l.createElement(N,{sideCar:Fo,removeScrollBar:u,shards:m,noRelative:x,noIsolation:w,inert:p,setCallbacks:i,allowPinchZoom:!!g,lockRef:n,gapMode:y}),a?l.cloneElement(l.Children.only(c),ce(ce({},S),{ref:j})):l.createElement(v,ce({},S,{className:d,ref:j}),c))});Pt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Pt.classNames={fullWidth:gt,zeroRight:ht};var Ua=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Xa(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Ua();return t&&e.setAttribute("nonce",t),e}function Wa(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ha(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var za=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Xa())&&(Wa(t,n),Ha(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},qa=function(){var e=za();return function(t,n){l.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Bo=function(){var e=qa(),t=function(n){var o=n.styles,r=n.dynamic;return e(o,r),null};return t},Ga={left:0,top:0,right:0,gap:0},Xt=function(e){return parseInt(e||"",10)||0},Ka=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[Xt(n),Xt(o),Xt(r)]},Ya=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Ga;var t=Ka(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},Qa=Bo(),Oe="data-scroll-locked",Za=function(e,t,n,o){var r=e.left,i=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),`
     2  .`.concat(ka,` {
    33   overflow: hidden `).concat(o,`;
    4    padding-right: `).concat(a,"px ").concat(o,`;
     4   padding-right: `).concat(c,"px ").concat(o,`;
    55  }
    6   body[`).concat(ke,`] {
     6  body[`).concat(Oe,`] {
    77    overflow: hidden `).concat(o,`;
    88    overscroll-behavior: contain;
    99    `).concat([t&&"position: relative ".concat(o,";"),n==="margin"&&`
    1010    padding-left: `.concat(r,`px;
    11     padding-top: `).concat(s,`px;
    12     padding-right: `).concat(i,`px;
     11    padding-top: `).concat(i,`px;
     12    padding-right: `).concat(a,`px;
    1313    margin-left:0;
    1414    margin-top:0;
    15     margin-right: `).concat(a,"px ").concat(o,`;
    16     `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(o,";")].filter(Boolean).join(""),`
     15    margin-right: `).concat(c,"px ").concat(o,`;
     16    `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(o,";")].filter(Boolean).join(""),`
    1717  }
    1818 
    19   .`).concat(ft,` {
    20     right: `).concat(a,"px ").concat(o,`;
     19  .`).concat(ht,` {
     20    right: `).concat(c,"px ").concat(o,`;
    2121  }
    2222 
    23   .`).concat(pt,` {
    24     margin-right: `).concat(a,"px ").concat(o,`;
     23  .`).concat(gt,` {
     24    margin-right: `).concat(c,"px ").concat(o,`;
    2525  }
    2626 
    27   .`).concat(ft," .").concat(ft,` {
     27  .`).concat(ht," .").concat(ht,` {
    2828    right: 0 `).concat(o,`;
    2929  }
    3030 
    31   .`).concat(pt," .").concat(pt,` {
     31  .`).concat(gt," .").concat(gt,` {
    3232    margin-right: 0 `).concat(o,`;
    3333  }
    3434 
    35   body[`).concat(ke,`] {
    36     `).concat(Ea,": ").concat(a,`px;
     35  body[`).concat(Oe,`] {
     36    `).concat(Da,": ").concat(c,`px;
    3737  }
    38 `)},Fn=function(){var e=parseInt(document.body.getAttribute(ke)||"0",10);return isFinite(e)?e:0},Wa=function(){l.useEffect(function(){return document.body.setAttribute(ke,(Fn()+1).toString()),function(){var e=Fn()-1;e<=0?document.body.removeAttribute(ke):document.body.setAttribute(ke,e.toString())}},[])},Ha=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,r=o===void 0?"margin":o;Wa();var s=l.useMemo(function(){return $a(r)},[r]);return l.createElement(Ua,{styles:Va(s,!t,r,n?"":"!important")})},Yt=!1;if(typeof window<"u")try{var ct=Object.defineProperty({},"passive",{get:function(){return Yt=!0,!0}});window.addEventListener("test",ct,ct),window.removeEventListener("test",ct,ct)}catch{Yt=!1}var Oe=Yt?{passive:!1}:!1,za=function(e){return e.tagName==="TEXTAREA"},jo=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!za(e)&&n[t]==="visible")},qa=function(e){return jo(e,"overflowY")},Ga=function(e){return jo(e,"overflowX")},Bn=function(e,t){var n=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var r=Io(e,o);if(r){var s=_o(e,o),i=s[1],a=s[2];if(i>a)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},Ka=function(e){var t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},Ya=function(e){var t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},Io=function(e,t){return e==="v"?qa(t):Ga(t)},_o=function(e,t){return e==="v"?Ka(t):Ya(t)},Xa=function(e,t){return e==="h"&&t==="rtl"?-1:1},Qa=function(e,t,n,o,r){var s=Xa(e,window.getComputedStyle(t).direction),i=s*o,a=n.target,u=t.contains(a),d=!1,f=i>0,p=0,h=0;do{if(!a)break;var v=_o(e,a),w=v[0],m=v[1],g=v[2],b=m-g-s*w;(w||b)&&Io(e,a)&&(p+=b,h+=w);var x=a.parentNode;a=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!u&&a!==document.body||u&&(t.contains(a)||t===a));return(f&&Math.abs(p)<1||!f&&Math.abs(h)<1)&&(d=!0),d},lt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$n=function(e){return[e.deltaX,e.deltaY]},Un=function(e){return e&&"current"in e?e.current:e},Za=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ja=function(e){return`
     38`)},Hn=function(){var e=parseInt(document.body.getAttribute(Oe)||"0",10);return isFinite(e)?e:0},Ja=function(){l.useEffect(function(){return document.body.setAttribute(Oe,(Hn()+1).toString()),function(){var e=Hn()-1;e<=0?document.body.removeAttribute(Oe):document.body.setAttribute(Oe,e.toString())}},[])},ec=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,r=o===void 0?"margin":o;Ja();var i=l.useMemo(function(){return Ya(r)},[r]);return l.createElement(Qa,{styles:Za(i,!t,r,n?"":"!important")})},Qt=!1;if(typeof window<"u")try{var ut=Object.defineProperty({},"passive",{get:function(){return Qt=!0,!0}});window.addEventListener("test",ut,ut),window.removeEventListener("test",ut,ut)}catch{Qt=!1}var Ie=Qt?{passive:!1}:!1,tc=function(e){return e.tagName==="TEXTAREA"},Vo=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!tc(e)&&n[t]==="visible")},nc=function(e){return Vo(e,"overflowY")},oc=function(e){return Vo(e,"overflowX")},zn=function(e,t){var n=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var r=$o(e,o);if(r){var i=Uo(e,o),a=i[1],c=i[2];if(a>c)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},rc=function(e){var t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},sc=function(e){var t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},$o=function(e,t){return e==="v"?nc(t):oc(t)},Uo=function(e,t){return e==="v"?rc(t):sc(t)},ic=function(e,t){return e==="h"&&t==="rtl"?-1:1},ac=function(e,t,n,o,r){var i=ic(e,window.getComputedStyle(t).direction),a=i*o,c=n.target,d=t.contains(c),u=!1,f=a>0,m=0,h=0;do{if(!c)break;var x=Uo(e,c),w=x[0],p=x[1],g=x[2],b=p-g-i*w;(w||b)&&$o(e,c)&&(m+=b,h+=w);var v=c.parentNode;c=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(f&&Math.abs(m)<1||!f&&Math.abs(h)<1)&&(u=!0),u},ft=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},qn=function(e){return[e.deltaX,e.deltaY]},Gn=function(e){return e&&"current"in e?e.current:e},cc=function(e,t){return e[0]===t[0]&&e[1]===t[1]},lc=function(e){return`
    3939  .block-interactivity-`.concat(e,` {pointer-events: none;}
    4040  .allow-interactivity-`).concat(e,` {pointer-events: all;}
    41 `)},ec=0,De=[];function tc(e){var t=l.useRef([]),n=l.useRef([0,0]),o=l.useRef(),r=l.useState(ec++)[0],s=l.useState(To)[0],i=l.useRef(e);l.useEffect(function(){i.current=e},[e]),l.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var m=Sa([e.lockRef.current],(e.shards||[]).map(Un),!0).filter(Boolean);return m.forEach(function(g){return g.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),m.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var a=l.useCallback(function(m,g){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!i.current.allowPinchZoom;var b=lt(m),x=n.current,y="deltaX"in m?m.deltaX:x[0]-b[0],S="deltaY"in m?m.deltaY:x[1]-b[1],C,N=m.target,E=Math.abs(y)>Math.abs(S)?"h":"v";if("touches"in m&&E==="h"&&N.type==="range")return!1;var P=Bn(E,N);if(!P)return!0;if(P?C=E:(C=E==="v"?"h":"v",P=Bn(E,N)),!P)return!1;if(!o.current&&"changedTouches"in m&&(y||S)&&(o.current=C),!C)return!0;var _=o.current||C;return Qa(_,g,m,_==="h"?y:S)},[]),u=l.useCallback(function(m){var g=m;if(!(!De.length||De[De.length-1]!==s)){var b="deltaY"in g?$n(g):lt(g),x=t.current.filter(function(C){return C.name===g.type&&(C.target===g.target||g.target===C.shadowParent)&&Za(C.delta,b)})[0];if(x&&x.should){g.cancelable&&g.preventDefault();return}if(!x){var y=(i.current.shards||[]).map(Un).filter(Boolean).filter(function(C){return C.contains(g.target)}),S=y.length>0?a(g,y[0]):!i.current.noIsolation;S&&g.cancelable&&g.preventDefault()}}},[]),d=l.useCallback(function(m,g,b,x){var y={name:m,delta:g,target:b,should:x,shadowParent:nc(b)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(S){return S!==y})},1)},[]),f=l.useCallback(function(m){n.current=lt(m),o.current=void 0},[]),p=l.useCallback(function(m){d(m.type,$n(m),m.target,a(m,e.lockRef.current))},[]),h=l.useCallback(function(m){d(m.type,lt(m),m.target,a(m,e.lockRef.current))},[]);l.useEffect(function(){return De.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",u,Oe),document.addEventListener("touchmove",u,Oe),document.addEventListener("touchstart",f,Oe),function(){De=De.filter(function(m){return m!==s}),document.removeEventListener("wheel",u,Oe),document.removeEventListener("touchmove",u,Oe),document.removeEventListener("touchstart",f,Oe)}},[]);var v=e.removeScrollBar,w=e.inert;return l.createElement(l.Fragment,null,w?l.createElement(s,{styles:Ja(r)}):null,v?l.createElement(Ha,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function nc(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const oc=Ia(Ao,tc);var Oo=l.forwardRef(function(e,t){return l.createElement(At,ie({},e,{ref:t,sideCar:oc}))});Oo.classNames=At.classNames;var rc=[" ","Enter","ArrowUp","ArrowDown"],sc=[" ","Enter"],Ee="Select",[Tt,jt,ic]=qn(Ee),[Ue]=Fe(Ee,[ic,po]),It=po(),[ac,be]=Ue(Ee),[cc,lc]=Ue(Ee),Do=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:s,value:i,defaultValue:a,onValueChange:u,dir:d,name:f,autoComplete:p,disabled:h,required:v,form:w}=e,m=It(t),[g,b]=l.useState(null),[x,y]=l.useState(null),[S,C]=l.useState(!1),N=rn(d),[E,P]=Je({prop:o,defaultProp:r??!1,onChange:s,caller:Ee}),[_,j]=Je({prop:i,defaultProp:a,onChange:u,caller:Ee}),k=l.useRef(null),$=g?w||!!g.closest("form"):!0,[O,I]=l.useState(new Set),V=Array.from(O).map(T=>T.props.value).join(";");return c.jsx(na,{...m,children:c.jsxs(ac,{required:v,scope:t,trigger:g,onTriggerChange:b,valueNode:x,onValueNodeChange:y,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:tt(),value:_,onValueChange:j,open:E,onOpenChange:P,dir:N,triggerPointerDownPosRef:k,disabled:h,children:[c.jsx(Tt.Provider,{scope:t,children:c.jsx(cc,{scope:e.__scopeSelect,onNativeOptionAdd:l.useCallback(T=>{I(D=>new Set(D).add(T))},[]),onNativeOptionRemove:l.useCallback(T=>{I(D=>{const R=new Set(D);return R.delete(T),R})},[]),children:n})}),$?c.jsxs(rr,{"aria-hidden":!0,required:v,tabIndex:-1,name:f,autoComplete:p,value:_,onChange:T=>j(T.target.value),disabled:h,form:w,children:[_===void 0?c.jsx("option",{value:""}):null,Array.from(O)]},V):null]})})};Do.displayName=Ee;var Mo="SelectTrigger",ko=l.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...r}=e,s=It(n),i=be(Mo,n),a=i.disabled||o,u=q(t,i.onTriggerChange),d=jt(n),f=l.useRef("touch"),[p,h,v]=ir(m=>{const g=d().filter(y=>!y.disabled),b=g.find(y=>y.value===i.value),x=ar(g,m,b);x!==void 0&&i.onValueChange(x.value)}),w=m=>{a||(i.onOpenChange(!0),v()),m&&(i.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return c.jsx(oa,{asChild:!0,...s,children:c.jsx(L.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":sr(i.value)?"":void 0,...r,ref:u,onClick:M(r.onClick,m=>{m.currentTarget.focus(),f.current!=="mouse"&&w(m)}),onPointerDown:M(r.onPointerDown,m=>{f.current=m.pointerType;const g=m.target;g.hasPointerCapture(m.pointerId)&&g.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(w(m),m.preventDefault())}),onKeyDown:M(r.onKeyDown,m=>{const g=p.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&h(m.key),!(g&&m.key===" ")&&rc.includes(m.key)&&(w(),m.preventDefault())})})})});ko.displayName=Mo;var Lo="SelectValue",Fo=l.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:s,placeholder:i="",...a}=e,u=be(Lo,n),{onValueNodeHasChildrenChange:d}=u,f=s!==void 0,p=q(t,u.onValueNodeChange);return Y(()=>{d(f)},[d,f]),c.jsx(L.span,{...a,ref:p,style:{pointerEvents:"none"},children:sr(u.value)?c.jsx(c.Fragment,{children:i}):s})});Fo.displayName=Lo;var uc="SelectIcon",Bo=l.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return c.jsx(L.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});Bo.displayName=uc;var dc="SelectPortal",$o=e=>c.jsx(So,{asChild:!0,...e});$o.displayName=dc;var Pe="SelectContent",Uo=l.forwardRef((e,t)=>{const n=be(Pe,e.__scopeSelect),[o,r]=l.useState();if(Y(()=>{r(new DocumentFragment)},[]),!n.open){const s=o;return s?Ct.createPortal(c.jsx(Vo,{scope:e.__scopeSelect,children:c.jsx(Tt.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),s):null}return c.jsx(Wo,{...e,ref:t})});Uo.displayName=Pe;var ee=10,[Vo,ye]=Ue(Pe),fc="SelectContentImpl",pc=aa("SelectContent.RemoveScroll"),Wo=l.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:h,collisionPadding:v,sticky:w,hideWhenDetached:m,avoidCollisions:g,...b}=e,x=be(Pe,n),[y,S]=l.useState(null),[C,N]=l.useState(null),E=q(t,A=>S(A)),[P,_]=l.useState(null),[j,k]=l.useState(null),$=jt(n),[O,I]=l.useState(!1),V=l.useRef(!1);l.useEffect(()=>{if(y)return wa(y)},[y]),As();const T=l.useCallback(A=>{const[H,...K]=$().map(B=>B.ref.current),[U]=K.slice(-1),F=document.activeElement;for(const B of A)if(B===F||(B==null||B.scrollIntoView({block:"nearest"}),B===H&&C&&(C.scrollTop=0),B===U&&C&&(C.scrollTop=C.scrollHeight),B==null||B.focus(),document.activeElement!==F))return},[$,C]),D=l.useCallback(()=>T([P,y]),[T,P,y]);l.useEffect(()=>{O&&D()},[O,D]);const{onOpenChange:R,triggerPointerDownPosRef:W}=x;l.useEffect(()=>{if(y){let A={x:0,y:0};const H=U=>{var F,B;A={x:Math.abs(Math.round(U.pageX)-(((F=W.current)==null?void 0:F.x)??0)),y:Math.abs(Math.round(U.pageY)-(((B=W.current)==null?void 0:B.y)??0))}},K=U=>{A.x<=10&&A.y<=10?U.preventDefault():y.contains(U.target)||R(!1),document.removeEventListener("pointermove",H),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",H),document.addEventListener("pointerup",K,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",H),document.removeEventListener("pointerup",K,{capture:!0})}}},[y,R,W]),l.useEffect(()=>{const A=()=>R(!1);return window.addEventListener("blur",A),window.addEventListener("resize",A),()=>{window.removeEventListener("blur",A),window.removeEventListener("resize",A)}},[R]);const[X,de]=ir(A=>{const H=$().filter(F=>!F.disabled),K=H.find(F=>F.ref.current===document.activeElement),U=ar(H,A,K);U&&setTimeout(()=>U.ref.current.focus())}),Ve=l.useCallback((A,H,K)=>{const U=!V.current&&!K;(x.value!==void 0&&x.value===H||U)&&(_(A),U&&(V.current=!0))},[x.value]),We=l.useCallback(()=>y==null?void 0:y.focus(),[y]),me=l.useCallback((A,H,K)=>{const U=!V.current&&!K;(x.value!==void 0&&x.value===H||U)&&k(A)},[x.value]),Ie=o==="popper"?Xt:Ho,we=Ie===Xt?{side:a,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:h,collisionPadding:v,sticky:w,hideWhenDetached:m,avoidCollisions:g}:{};return c.jsx(Vo,{scope:n,content:y,viewport:C,onViewportChange:N,itemRefCallback:Ve,selectedItem:P,onItemLeave:We,itemTextRefCallback:me,focusSelectedItem:D,selectedItemText:j,position:o,isPositioned:O,searchRef:X,children:c.jsx(Oo,{as:pc,allowPinchZoom:!0,children:c.jsx(Xn,{asChild:!0,trapped:x.open,onMountAutoFocus:A=>{A.preventDefault()},onUnmountAutoFocus:M(r,A=>{var H;(H=x.trigger)==null||H.focus({preventScroll:!0}),A.preventDefault()}),children:c.jsx(Kn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:A=>A.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:c.jsx(Ie,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:A=>A.preventDefault(),...b,...we,onPlaced:()=>I(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:M(b.onKeyDown,A=>{const H=A.ctrlKey||A.altKey||A.metaKey;if(A.key==="Tab"&&A.preventDefault(),!H&&A.key.length===1&&de(A.key),["ArrowUp","ArrowDown","Home","End"].includes(A.key)){let U=$().filter(F=>!F.disabled).map(F=>F.ref.current);if(["ArrowUp","End"].includes(A.key)&&(U=U.slice().reverse()),["ArrowUp","ArrowDown"].includes(A.key)){const F=A.target,B=U.indexOf(F);U=U.slice(B+1)}setTimeout(()=>T(U)),A.preventDefault()}})})})})})})});Wo.displayName=fc;var mc="SelectItemAlignedPosition",Ho=l.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...r}=e,s=be(Pe,n),i=ye(Pe,n),[a,u]=l.useState(null),[d,f]=l.useState(null),p=q(t,E=>f(E)),h=jt(n),v=l.useRef(!1),w=l.useRef(!0),{viewport:m,selectedItem:g,selectedItemText:b,focusSelectedItem:x}=i,y=l.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&d&&m&&g&&b){const E=s.trigger.getBoundingClientRect(),P=d.getBoundingClientRect(),_=s.valueNode.getBoundingClientRect(),j=b.getBoundingClientRect();if(s.dir!=="rtl"){const F=j.left-P.left,B=_.left-F,Q=E.left-B,re=E.width+Q,He=Math.max(re,P.width),ze=window.innerWidth-ee,qe=vn(B,[ee,Math.max(ee,ze-He)]);a.style.minWidth=re+"px",a.style.left=qe+"px"}else{const F=P.right-j.right,B=window.innerWidth-_.right-F,Q=window.innerWidth-E.right-B,re=E.width+Q,He=Math.max(re,P.width),ze=window.innerWidth-ee,qe=vn(B,[ee,Math.max(ee,ze-He)]);a.style.minWidth=re+"px",a.style.right=qe+"px"}const k=h(),$=window.innerHeight-ee*2,O=m.scrollHeight,I=window.getComputedStyle(d),V=parseInt(I.borderTopWidth,10),T=parseInt(I.paddingTop,10),D=parseInt(I.borderBottomWidth,10),R=parseInt(I.paddingBottom,10),W=V+T+O+R+D,X=Math.min(g.offsetHeight*5,W),de=window.getComputedStyle(m),Ve=parseInt(de.paddingTop,10),We=parseInt(de.paddingBottom,10),me=E.top+E.height/2-ee,Ie=$-me,we=g.offsetHeight/2,A=g.offsetTop+we,H=V+T+A,K=W-H;if(H<=me){const F=k.length>0&&g===k[k.length-1].ref.current;a.style.bottom="0px";const B=d.clientHeight-m.offsetTop-m.offsetHeight,Q=Math.max(Ie,we+(F?We:0)+B+D),re=H+Q;a.style.height=re+"px"}else{const F=k.length>0&&g===k[0].ref.current;a.style.top="0px";const Q=Math.max(me,V+m.offsetTop+(F?Ve:0)+we)+K;a.style.height=Q+"px",m.scrollTop=H-me+m.offsetTop}a.style.margin=`${ee}px 0`,a.style.minHeight=X+"px",a.style.maxHeight=$+"px",o==null||o(),requestAnimationFrame(()=>v.current=!0)}},[h,s.trigger,s.valueNode,a,d,m,g,b,s.dir,o]);Y(()=>y(),[y]);const[S,C]=l.useState();Y(()=>{d&&C(window.getComputedStyle(d).zIndex)},[d]);const N=l.useCallback(E=>{E&&w.current===!0&&(y(),x==null||x(),w.current=!1)},[y,x]);return c.jsx(gc,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:v,onScrollButtonChange:N,children:c.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:c.jsx(L.div,{...r,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});Ho.displayName=mc;var hc="SelectPopperPosition",Xt=l.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=ee,...s}=e,i=It(n);return c.jsx(ra,{...i,...s,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...s.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)"}})});Xt.displayName=hc;var[gc,mn]=Ue(Pe,{}),Qt="SelectViewport",zo=l.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...r}=e,s=ye(Qt,n),i=mn(Qt,n),a=q(t,s.onViewportChange),u=l.useRef(0);return c.jsxs(c.Fragment,{children:[c.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:o}),c.jsx(Tt.Slot,{scope:n,children:c.jsx(L.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:M(r.onScroll,d=>{const f=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:h}=i;if(h!=null&&h.current&&p){const v=Math.abs(u.current-f.scrollTop);if(v>0){const w=window.innerHeight-ee*2,m=parseFloat(p.style.minHeight),g=parseFloat(p.style.height),b=Math.max(m,g);if(b<w){const x=b+v,y=Math.min(w,x),S=x-y;p.style.height=y+"px",p.style.bottom==="0px"&&(f.scrollTop=S>0?S:0,p.style.justifyContent="flex-end")}}}u.current=f.scrollTop})})})]})});zo.displayName=Qt;var qo="SelectGroup",[vc,xc]=Ue(qo),bc=l.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=tt();return c.jsx(vc,{scope:n,id:r,children:c.jsx(L.div,{role:"group","aria-labelledby":r,...o,ref:t})})});bc.displayName=qo;var Go="SelectLabel",Ko=l.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=xc(Go,n);return c.jsx(L.div,{id:r.id,...o,ref:t})});Ko.displayName=Go;var St="SelectItem",[yc,Yo]=Ue(St),Xo=l.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:r=!1,textValue:s,...i}=e,a=be(St,n),u=ye(St,n),d=a.value===o,[f,p]=l.useState(s??""),[h,v]=l.useState(!1),w=q(t,x=>{var y;return(y=u.itemRefCallback)==null?void 0:y.call(u,x,o,r)}),m=tt(),g=l.useRef("touch"),b=()=>{r||(a.onValueChange(o),a.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> 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 c.jsx(yc,{scope:n,value:o,disabled:r,textId:m,isSelected:d,onItemTextChange:l.useCallback(x=>{p(y=>y||((x==null?void 0:x.textContent)??"").trim())},[]),children:c.jsx(Tt.ItemSlot,{scope:n,value:o,disabled:r,textValue:f,children:c.jsx(L.div,{role:"option","aria-labelledby":m,"data-highlighted":h?"":void 0,"aria-selected":d&&h,"data-state":d?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...i,ref:w,onFocus:M(i.onFocus,()=>v(!0)),onBlur:M(i.onBlur,()=>v(!1)),onClick:M(i.onClick,()=>{g.current!=="mouse"&&b()}),onPointerUp:M(i.onPointerUp,()=>{g.current==="mouse"&&b()}),onPointerDown:M(i.onPointerDown,x=>{g.current=x.pointerType}),onPointerMove:M(i.onPointerMove,x=>{var y;g.current=x.pointerType,r?(y=u.onItemLeave)==null||y.call(u):g.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:M(i.onPointerLeave,x=>{var y;x.currentTarget===document.activeElement&&((y=u.onItemLeave)==null||y.call(u))}),onKeyDown:M(i.onKeyDown,x=>{var S;((S=u.searchRef)==null?void 0:S.current)!==""&&x.key===" "||(sc.includes(x.key)&&b(),x.key===" "&&x.preventDefault())})})})})});Xo.displayName=St;var Ge="SelectItemText",Qo=l.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,...s}=e,i=be(Ge,n),a=ye(Ge,n),u=Yo(Ge,n),d=lc(Ge,n),[f,p]=l.useState(null),h=q(t,b=>p(b),u.onItemTextChange,b=>{var x;return(x=a.itemTextRefCallback)==null?void 0:x.call(a,b,u.value,u.disabled)}),v=f==null?void 0:f.textContent,w=l.useMemo(()=>c.jsx("option",{value:u.value,disabled:u.disabled,children:v},u.value),[u.disabled,u.value,v]),{onNativeOptionAdd:m,onNativeOptionRemove:g}=d;return Y(()=>(m(w),()=>g(w)),[m,g,w]),c.jsxs(c.Fragment,{children:[c.jsx(L.span,{id:u.textId,...s,ref:h}),u.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Ct.createPortal(s.children,i.valueNode):null]})});Qo.displayName=Ge;var Zo="SelectItemIndicator",Jo=l.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return Yo(Zo,n).isSelected?c.jsx(L.span,{"aria-hidden":!0,...o,ref:t}):null});Jo.displayName=Zo;var Zt="SelectScrollUpButton",er=l.forwardRef((e,t)=>{const n=ye(Zt,e.__scopeSelect),o=mn(Zt,e.__scopeSelect),[r,s]=l.useState(!1),i=q(t,o.onScrollButtonChange);return Y(()=>{if(n.viewport&&n.isPositioned){let a=function(){const d=u.scrollTop>0;s(d)};const u=n.viewport;return a(),u.addEventListener("scroll",a),()=>u.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),r?c.jsx(nr,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:u}=n;a&&u&&(a.scrollTop=a.scrollTop-u.offsetHeight)}}):null});er.displayName=Zt;var Jt="SelectScrollDownButton",tr=l.forwardRef((e,t)=>{const n=ye(Jt,e.__scopeSelect),o=mn(Jt,e.__scopeSelect),[r,s]=l.useState(!1),i=q(t,o.onScrollButtonChange);return Y(()=>{if(n.viewport&&n.isPositioned){let a=function(){const d=u.scrollHeight-u.clientHeight,f=Math.ceil(u.scrollTop)<d;s(f)};const u=n.viewport;return a(),u.addEventListener("scroll",a),()=>u.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),r?c.jsx(nr,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:u}=n;a&&u&&(a.scrollTop=a.scrollTop+u.offsetHeight)}}):null});tr.displayName=Jt;var nr=l.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...r}=e,s=ye("SelectScrollButton",n),i=l.useRef(null),a=jt(n),u=l.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return l.useEffect(()=>()=>u(),[u]),Y(()=>{var f;const d=a().find(p=>p.ref.current===document.activeElement);(f=d==null?void 0:d.ref.current)==null||f.scrollIntoView({block:"nearest"})},[a]),c.jsx(L.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:M(r.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(o,50))}),onPointerMove:M(r.onPointerMove,()=>{var d;(d=s.onItemLeave)==null||d.call(s),i.current===null&&(i.current=window.setInterval(o,50))}),onPointerLeave:M(r.onPointerLeave,()=>{u()})})}),wc="SelectSeparator",or=l.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return c.jsx(L.div,{"aria-hidden":!0,...o,ref:t})});or.displayName=wc;var en="SelectArrow",Sc=l.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=It(n),s=be(en,n),i=ye(en,n);return s.open&&i.position==="popper"?c.jsx(sa,{...r,...o,ref:t}):null});Sc.displayName=en;var Cc="SelectBubbleInput",rr=l.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const r=l.useRef(null),s=q(o,r),i=Co(t);return l.useEffect(()=>{const a=r.current;if(!a)return;const u=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(u,"value").set;if(i!==t&&f){const p=new Event("change",{bubbles:!0});f.call(a,t),a.dispatchEvent(p)}},[i,t]),c.jsx(L.select,{...n,style:{...Eo,...n.style},ref:s,defaultValue:t})});rr.displayName=Cc;function sr(e){return e===""||e===void 0}function ir(e){const t=ge(e),n=l.useRef(""),o=l.useRef(0),r=l.useCallback(i=>{const a=n.current+i;t(a),function u(d){n.current=d,window.clearTimeout(o.current),d!==""&&(o.current=window.setTimeout(()=>u(""),1e3))}(a)},[t]),s=l.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return l.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,s]}function ar(e,t,n){const r=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=Ec(e,Math.max(s,0));r.length===1&&(i=i.filter(d=>d!==n));const u=i.find(d=>d.textValue.toLowerCase().startsWith(r.toLowerCase()));return u!==n?u:void 0}function Ec(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var Pc=Do,cr=ko,Nc=Fo,Rc=Bo,Ac=$o,lr=Uo,Tc=zo,ur=Ko,dr=Xo,jc=Qo,Ic=Jo,fr=er,pr=tr,mr=or;/**
     41`)},dc=0,ke=[];function uc(e){var t=l.useRef([]),n=l.useRef([0,0]),o=l.useRef(),r=l.useState(dc++)[0],i=l.useState(Bo)[0],a=l.useRef(e);l.useEffect(function(){a.current=e},[e]),l.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var p=Ia([e.lockRef.current],(e.shards||[]).map(Gn),!0).filter(Boolean);return p.forEach(function(g){return g.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),p.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var c=l.useCallback(function(p,g){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!a.current.allowPinchZoom;var b=ft(p),v=n.current,y="deltaX"in p?p.deltaX:v[0]-b[0],C="deltaY"in p?p.deltaY:v[1]-b[1],N,j=p.target,S=Math.abs(y)>Math.abs(C)?"h":"v";if("touches"in p&&S==="h"&&j.type==="range")return!1;var E=zn(S,j);if(!E)return!0;if(E?N=S:(N=S==="v"?"h":"v",E=zn(S,j)),!E)return!1;if(!o.current&&"changedTouches"in p&&(y||C)&&(o.current=N),!N)return!0;var P=o.current||N;return ac(P,g,p,P==="h"?y:C)},[]),d=l.useCallback(function(p){var g=p;if(!(!ke.length||ke[ke.length-1]!==i)){var b="deltaY"in g?qn(g):ft(g),v=t.current.filter(function(N){return N.name===g.type&&(N.target===g.target||g.target===N.shadowParent)&&cc(N.delta,b)})[0];if(v&&v.should){g.cancelable&&g.preventDefault();return}if(!v){var y=(a.current.shards||[]).map(Gn).filter(Boolean).filter(function(N){return N.contains(g.target)}),C=y.length>0?c(g,y[0]):!a.current.noIsolation;C&&g.cancelable&&g.preventDefault()}}},[]),u=l.useCallback(function(p,g,b,v){var y={name:p,delta:g,target:b,should:v,shadowParent:fc(b)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(C){return C!==y})},1)},[]),f=l.useCallback(function(p){n.current=ft(p),o.current=void 0},[]),m=l.useCallback(function(p){u(p.type,qn(p),p.target,c(p,e.lockRef.current))},[]),h=l.useCallback(function(p){u(p.type,ft(p),p.target,c(p,e.lockRef.current))},[]);l.useEffect(function(){return ke.push(i),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:h}),document.addEventListener("wheel",d,Ie),document.addEventListener("touchmove",d,Ie),document.addEventListener("touchstart",f,Ie),function(){ke=ke.filter(function(p){return p!==i}),document.removeEventListener("wheel",d,Ie),document.removeEventListener("touchmove",d,Ie),document.removeEventListener("touchstart",f,Ie)}},[]);var x=e.removeScrollBar,w=e.inert;return l.createElement(l.Fragment,null,w?l.createElement(i,{styles:lc(r)}):null,x?l.createElement(ec,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function fc(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const mc=$a(Fo,uc);var Xo=l.forwardRef(function(e,t){return l.createElement(Pt,ce({},e,{ref:t,sideCar:mc}))});Xo.classNames=Pt.classNames;var pc=[" ","Enter","ArrowUp","ArrowDown"],hc=[" ","Enter"],Pe="Select",[At,Rt,gc]=no(Pe),[Xe]=Ve(Pe,[gc,Co]),Tt=Co(),[vc,Se]=Xe(Pe),[xc,yc]=Xe(Pe),Wo=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:i,value:a,defaultValue:c,onValueChange:d,dir:u,name:f,autoComplete:m,disabled:h,required:x,form:w}=e,p=Tt(t),[g,b]=l.useState(null),[v,y]=l.useState(null),[C,N]=l.useState(!1),j=ln(u),[S,E]=ot({prop:o,defaultProp:r??!1,onChange:i,caller:Pe}),[P,A]=ot({prop:a,defaultProp:c,onChange:d,caller:Pe}),R=l.useRef(null),D=g?w||!!g.closest("form"):!0,[I,M]=l.useState(new Set),U=Array.from(I).map(k=>k.props.value).join(";");return s.jsx(fa,{...p,children:s.jsxs(vc,{required:x,scope:t,trigger:g,onTriggerChange:b,valueNode:v,onValueNodeChange:y,valueNodeHasChildren:C,onValueNodeHasChildrenChange:N,contentId:rt(),value:P,onValueChange:A,open:S,onOpenChange:E,dir:j,triggerPointerDownPosRef:R,disabled:h,children:[s.jsx(At.Provider,{scope:t,children:s.jsx(xc,{scope:e.__scopeSelect,onNativeOptionAdd:l.useCallback(k=>{M(O=>new Set(O).add(k))},[]),onNativeOptionRemove:l.useCallback(k=>{M(O=>{const T=new Set(O);return T.delete(k),T})},[]),children:n})}),D?s.jsxs(pr,{"aria-hidden":!0,required:x,tabIndex:-1,name:f,autoComplete:m,value:P,onChange:k=>A(k.target.value),disabled:h,form:w,children:[P===void 0?s.jsx("option",{value:""}):null,Array.from(I)]},U):null]})})};Wo.displayName=Pe;var Ho="SelectTrigger",zo=l.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...r}=e,i=Tt(n),a=Se(Ho,n),c=a.disabled||o,d=q(t,a.onTriggerChange),u=Rt(n),f=l.useRef("touch"),[m,h,x]=gr(p=>{const g=u().filter(y=>!y.disabled),b=g.find(y=>y.value===a.value),v=vr(g,p,b);v!==void 0&&a.onValueChange(v.value)}),w=p=>{c||(a.onOpenChange(!0),x()),p&&(a.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return s.jsx(ma,{asChild:!0,...i,children:s.jsx(F.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":hr(a.value)?"":void 0,...r,ref:d,onClick:L(r.onClick,p=>{p.currentTarget.focus(),f.current!=="mouse"&&w(p)}),onPointerDown:L(r.onPointerDown,p=>{f.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(w(p),p.preventDefault())}),onKeyDown:L(r.onKeyDown,p=>{const g=m.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&h(p.key),!(g&&p.key===" ")&&pc.includes(p.key)&&(w(),p.preventDefault())})})})});zo.displayName=Ho;var qo="SelectValue",Go=l.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:i,placeholder:a="",...c}=e,d=Se(qo,n),{onValueNodeHasChildrenChange:u}=d,f=i!==void 0,m=q(t,d.onValueNodeChange);return Y(()=>{u(f)},[u,f]),s.jsx(F.span,{...c,ref:m,style:{pointerEvents:"none"},children:hr(d.value)?s.jsx(s.Fragment,{children:a}):i})});Go.displayName=qo;var bc="SelectIcon",Ko=l.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return s.jsx(F.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});Ko.displayName=bc;var wc="SelectPortal",Yo=e=>s.jsx(Io,{asChild:!0,...e});Yo.displayName=wc;var Ae="SelectContent",Qo=l.forwardRef((e,t)=>{const n=Se(Ae,e.__scopeSelect),[o,r]=l.useState();if(Y(()=>{r(new DocumentFragment)},[]),!n.open){const i=o;return i?St.createPortal(s.jsx(Zo,{scope:e.__scopeSelect,children:s.jsx(At.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),i):null}return s.jsx(Jo,{...e,ref:t})});Qo.displayName=Ae;var ne=10,[Zo,Ce]=Xe(Ae),Sc="SelectContentImpl",Cc=va("SelectContent.RemoveScroll"),Jo=l.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:i,onPointerDownOutside:a,side:c,sideOffset:d,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:h,collisionPadding:x,sticky:w,hideWhenDetached:p,avoidCollisions:g,...b}=e,v=Se(Ae,n),[y,C]=l.useState(null),[N,j]=l.useState(null),S=q(t,_=>C(_)),[E,P]=l.useState(null),[A,R]=l.useState(null),D=Rt(n),[I,M]=l.useState(!1),U=l.useRef(!1);l.useEffect(()=>{if(y)return _a(y)},[y]),Fs();const k=l.useCallback(_=>{const[W,...G]=D().map(V=>V.ref.current),[$]=G.slice(-1),B=document.activeElement;for(const V of _)if(V===B||(V==null||V.scrollIntoView({block:"nearest"}),V===W&&N&&(N.scrollTop=0),V===$&&N&&(N.scrollTop=N.scrollHeight),V==null||V.focus(),document.activeElement!==B))return},[D,N]),O=l.useCallback(()=>k([E,y]),[k,E,y]);l.useEffect(()=>{I&&O()},[I,O]);const{onOpenChange:T,triggerPointerDownPosRef:X}=v;l.useEffect(()=>{if(y){let _={x:0,y:0};const W=$=>{var B,V;_={x:Math.abs(Math.round($.pageX)-(((B=X.current)==null?void 0:B.x)??0)),y:Math.abs(Math.round($.pageY)-(((V=X.current)==null?void 0:V.y)??0))}},G=$=>{_.x<=10&&_.y<=10?$.preventDefault():y.contains($.target)||T(!1),document.removeEventListener("pointermove",W),X.current=null};return X.current!==null&&(document.addEventListener("pointermove",W),document.addEventListener("pointerup",G,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",W),document.removeEventListener("pointerup",G,{capture:!0})}}},[y,T,X]),l.useEffect(()=>{const _=()=>T(!1);return window.addEventListener("blur",_),window.addEventListener("resize",_),()=>{window.removeEventListener("blur",_),window.removeEventListener("resize",_)}},[T]);const[Z,me]=gr(_=>{const W=D().filter(B=>!B.disabled),G=W.find(B=>B.ref.current===document.activeElement),$=vr(W,_,G);$&&setTimeout(()=>$.ref.current.focus())}),We=l.useCallback((_,W,G)=>{const $=!U.current&&!G;(v.value!==void 0&&v.value===W||$)&&(P(_),$&&(U.current=!0))},[v.value]),He=l.useCallback(()=>y==null?void 0:y.focus(),[y]),ge=l.useCallback((_,W,G)=>{const $=!U.current&&!G;(v.value!==void 0&&v.value===W||$)&&R(_)},[v.value]),Te=o==="popper"?Zt:er,Ne=Te===Zt?{side:c,sideOffset:d,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:h,collisionPadding:x,sticky:w,hideWhenDetached:p,avoidCollisions:g}:{};return s.jsx(Zo,{scope:n,content:y,viewport:N,onViewportChange:j,itemRefCallback:We,selectedItem:E,onItemLeave:He,itemTextRefCallback:ge,focusSelectedItem:O,selectedItemText:A,position:o,isPositioned:I,searchRef:Z,children:s.jsx(Xo,{as:Cc,allowPinchZoom:!0,children:s.jsx(io,{asChild:!0,trapped:v.open,onMountAutoFocus:_=>{_.preventDefault()},onUnmountAutoFocus:L(r,_=>{var W;(W=v.trigger)==null||W.focus({preventScroll:!0}),_.preventDefault()}),children:s.jsx(ro,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:_=>_.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:s.jsx(Te,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:_=>_.preventDefault(),...b,...Ne,onPlaced:()=>M(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:L(b.onKeyDown,_=>{const W=_.ctrlKey||_.altKey||_.metaKey;if(_.key==="Tab"&&_.preventDefault(),!W&&_.key.length===1&&me(_.key),["ArrowUp","ArrowDown","Home","End"].includes(_.key)){let $=D().filter(B=>!B.disabled).map(B=>B.ref.current);if(["ArrowUp","End"].includes(_.key)&&($=$.slice().reverse()),["ArrowUp","ArrowDown"].includes(_.key)){const B=_.target,V=$.indexOf(B);$=$.slice(V+1)}setTimeout(()=>k($)),_.preventDefault()}})})})})})})});Jo.displayName=Sc;var Nc="SelectItemAlignedPosition",er=l.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...r}=e,i=Se(Ae,n),a=Ce(Ae,n),[c,d]=l.useState(null),[u,f]=l.useState(null),m=q(t,S=>f(S)),h=Rt(n),x=l.useRef(!1),w=l.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:b,focusSelectedItem:v}=a,y=l.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&u&&p&&g&&b){const S=i.trigger.getBoundingClientRect(),E=u.getBoundingClientRect(),P=i.valueNode.getBoundingClientRect(),A=b.getBoundingClientRect();if(i.dir!=="rtl"){const B=A.left-E.left,V=P.left-B,J=S.left-V,ie=S.width+J,ze=Math.max(ie,E.width),qe=window.innerWidth-ne,Ge=Nn(V,[ne,Math.max(ne,qe-ze)]);c.style.minWidth=ie+"px",c.style.left=Ge+"px"}else{const B=E.right-A.right,V=window.innerWidth-P.right-B,J=window.innerWidth-S.right-V,ie=S.width+J,ze=Math.max(ie,E.width),qe=window.innerWidth-ne,Ge=Nn(V,[ne,Math.max(ne,qe-ze)]);c.style.minWidth=ie+"px",c.style.right=Ge+"px"}const R=h(),D=window.innerHeight-ne*2,I=p.scrollHeight,M=window.getComputedStyle(u),U=parseInt(M.borderTopWidth,10),k=parseInt(M.paddingTop,10),O=parseInt(M.borderBottomWidth,10),T=parseInt(M.paddingBottom,10),X=U+k+I+T+O,Z=Math.min(g.offsetHeight*5,X),me=window.getComputedStyle(p),We=parseInt(me.paddingTop,10),He=parseInt(me.paddingBottom,10),ge=S.top+S.height/2-ne,Te=D-ge,Ne=g.offsetHeight/2,_=g.offsetTop+Ne,W=U+k+_,G=X-W;if(W<=ge){const B=R.length>0&&g===R[R.length-1].ref.current;c.style.bottom="0px";const V=u.clientHeight-p.offsetTop-p.offsetHeight,J=Math.max(Te,Ne+(B?He:0)+V+O),ie=W+J;c.style.height=ie+"px"}else{const B=R.length>0&&g===R[0].ref.current;c.style.top="0px";const J=Math.max(ge,U+p.offsetTop+(B?We:0)+Ne)+G;c.style.height=J+"px",p.scrollTop=W-ge+p.offsetTop}c.style.margin=`${ne}px 0`,c.style.minHeight=Z+"px",c.style.maxHeight=D+"px",o==null||o(),requestAnimationFrame(()=>x.current=!0)}},[h,i.trigger,i.valueNode,c,u,p,g,b,i.dir,o]);Y(()=>y(),[y]);const[C,N]=l.useState();Y(()=>{u&&N(window.getComputedStyle(u).zIndex)},[u]);const j=l.useCallback(S=>{S&&w.current===!0&&(y(),v==null||v(),w.current=!1)},[y,v]);return s.jsx(jc,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:x,onScrollButtonChange:j,children:s.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:s.jsx(F.div,{...r,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});er.displayName=Nc;var Ec="SelectPopperPosition",Zt=l.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=ne,...i}=e,a=Tt(n);return s.jsx(pa,{...a,...i,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...i.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)"}})});Zt.displayName=Ec;var[jc,xn]=Xe(Ae,{}),Jt="SelectViewport",tr=l.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...r}=e,i=Ce(Jt,n),a=xn(Jt,n),c=q(t,i.onViewportChange),d=l.useRef(0);return s.jsxs(s.Fragment,{children:[s.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:o}),s.jsx(At.Slot,{scope:n,children:s.jsx(F.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:L(r.onScroll,u=>{const f=u.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:h}=a;if(h!=null&&h.current&&m){const x=Math.abs(d.current-f.scrollTop);if(x>0){const w=window.innerHeight-ne*2,p=parseFloat(m.style.minHeight),g=parseFloat(m.style.height),b=Math.max(p,g);if(b<w){const v=b+x,y=Math.min(w,v),C=v-y;m.style.height=y+"px",m.style.bottom==="0px"&&(f.scrollTop=C>0?C:0,m.style.justifyContent="flex-end")}}}d.current=f.scrollTop})})})]})});tr.displayName=Jt;var nr="SelectGroup",[Pc,Ac]=Xe(nr),Rc=l.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=rt();return s.jsx(Pc,{scope:n,id:r,children:s.jsx(F.div,{role:"group","aria-labelledby":r,...o,ref:t})})});Rc.displayName=nr;var or="SelectLabel",rr=l.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Ac(or,n);return s.jsx(F.div,{id:r.id,...o,ref:t})});rr.displayName=or;var wt="SelectItem",[Tc,sr]=Xe(wt),ir=l.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:r=!1,textValue:i,...a}=e,c=Se(wt,n),d=Ce(wt,n),u=c.value===o,[f,m]=l.useState(i??""),[h,x]=l.useState(!1),w=q(t,v=>{var y;return(y=d.itemRefCallback)==null?void 0:y.call(d,v,o,r)}),p=rt(),g=l.useRef("touch"),b=()=>{r||(c.onValueChange(o),c.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> 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 s.jsx(Tc,{scope:n,value:o,disabled:r,textId:p,isSelected:u,onItemTextChange:l.useCallback(v=>{m(y=>y||((v==null?void 0:v.textContent)??"").trim())},[]),children:s.jsx(At.ItemSlot,{scope:n,value:o,disabled:r,textValue:f,children:s.jsx(F.div,{role:"option","aria-labelledby":p,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...a,ref:w,onFocus:L(a.onFocus,()=>x(!0)),onBlur:L(a.onBlur,()=>x(!1)),onClick:L(a.onClick,()=>{g.current!=="mouse"&&b()}),onPointerUp:L(a.onPointerUp,()=>{g.current==="mouse"&&b()}),onPointerDown:L(a.onPointerDown,v=>{g.current=v.pointerType}),onPointerMove:L(a.onPointerMove,v=>{var y;g.current=v.pointerType,r?(y=d.onItemLeave)==null||y.call(d):g.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:L(a.onPointerLeave,v=>{var y;v.currentTarget===document.activeElement&&((y=d.onItemLeave)==null||y.call(d))}),onKeyDown:L(a.onKeyDown,v=>{var C;((C=d.searchRef)==null?void 0:C.current)!==""&&v.key===" "||(hc.includes(v.key)&&b(),v.key===" "&&v.preventDefault())})})})})});ir.displayName=wt;var Ke="SelectItemText",ar=l.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,...i}=e,a=Se(Ke,n),c=Ce(Ke,n),d=sr(Ke,n),u=yc(Ke,n),[f,m]=l.useState(null),h=q(t,b=>m(b),d.onItemTextChange,b=>{var v;return(v=c.itemTextRefCallback)==null?void 0:v.call(c,b,d.value,d.disabled)}),x=f==null?void 0:f.textContent,w=l.useMemo(()=>s.jsx("option",{value:d.value,disabled:d.disabled,children:x},d.value),[d.disabled,d.value,x]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return Y(()=>(p(w),()=>g(w)),[p,g,w]),s.jsxs(s.Fragment,{children:[s.jsx(F.span,{id:d.textId,...i,ref:h}),d.isSelected&&a.valueNode&&!a.valueNodeHasChildren?St.createPortal(i.children,a.valueNode):null]})});ar.displayName=Ke;var cr="SelectItemIndicator",lr=l.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return sr(cr,n).isSelected?s.jsx(F.span,{"aria-hidden":!0,...o,ref:t}):null});lr.displayName=cr;var en="SelectScrollUpButton",dr=l.forwardRef((e,t)=>{const n=Ce(en,e.__scopeSelect),o=xn(en,e.__scopeSelect),[r,i]=l.useState(!1),a=q(t,o.onScrollButtonChange);return Y(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=d.scrollTop>0;i(u)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?s.jsx(fr,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});dr.displayName=en;var tn="SelectScrollDownButton",ur=l.forwardRef((e,t)=>{const n=Ce(tn,e.__scopeSelect),o=xn(tn,e.__scopeSelect),[r,i]=l.useState(!1),a=q(t,o.onScrollButtonChange);return Y(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=d.scrollHeight-d.clientHeight,f=Math.ceil(d.scrollTop)<u;i(f)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?s.jsx(fr,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});ur.displayName=tn;var fr=l.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...r}=e,i=Ce("SelectScrollButton",n),a=l.useRef(null),c=Rt(n),d=l.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return l.useEffect(()=>()=>d(),[d]),Y(()=>{var f;const u=c().find(m=>m.ref.current===document.activeElement);(f=u==null?void 0:u.ref.current)==null||f.scrollIntoView({block:"nearest"})},[c]),s.jsx(F.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:L(r.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(o,50))}),onPointerMove:L(r.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),a.current===null&&(a.current=window.setInterval(o,50))}),onPointerLeave:L(r.onPointerLeave,()=>{d()})})}),_c="SelectSeparator",mr=l.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return s.jsx(F.div,{"aria-hidden":!0,...o,ref:t})});mr.displayName=_c;var nn="SelectArrow",Ic=l.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Tt(n),i=Se(nn,n),a=Ce(nn,n);return i.open&&a.position==="popper"?s.jsx(ha,{...r,...o,ref:t}):null});Ic.displayName=nn;var kc="SelectBubbleInput",pr=l.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const r=l.useRef(null),i=q(o,r),a=ko(t);return l.useEffect(()=>{const c=r.current;if(!c)return;const d=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(d,"value").set;if(a!==t&&f){const m=new Event("change",{bubbles:!0});f.call(c,t),c.dispatchEvent(m)}},[a,t]),s.jsx(F.select,{...n,style:{...Do,...n.style},ref:i,defaultValue:t})});pr.displayName=kc;function hr(e){return e===""||e===void 0}function gr(e){const t=xe(e),n=l.useRef(""),o=l.useRef(0),r=l.useCallback(a=>{const c=n.current+a;t(c),function d(u){n.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>d(""),1e3))}(c)},[t]),i=l.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return l.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,i]}function vr(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=Dc(e,Math.max(i,0));r.length===1&&(a=a.filter(u=>u!==n));const d=a.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return d!==n?d:void 0}function Dc(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var Mc=Wo,xr=zo,Oc=Go,Lc=Ko,Fc=Yo,yr=Qo,Bc=tr,br=rr,wr=ir,Vc=ar,$c=lr,Sr=dr,Cr=ur,Nr=mr;/**
    4242 * @license lucide-react v0.309.0 - ISC
    4343 *
    4444 * This source code is licensed under the ISC license.
    4545 * See the LICENSE file in the root directory of this source tree.
    46  */const _c=on("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
     46 */const Uc=we("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
    4747 * @license lucide-react v0.309.0 - ISC
    4848 *
    4949 * This source code is licensed under the ISC license.
    5050 * See the LICENSE file in the root directory of this source tree.
    51  */const hr=on("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
     51 */const Xc=we("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
    5252 * @license lucide-react v0.309.0 - ISC
    5353 *
    5454 * This source code is licensed under the ISC license.
    5555 * See the LICENSE file in the root directory of this source tree.
    56  */const Oc=on("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),mt=Pc,ht=Nc,Ke=l.forwardRef(({className:e,children:t,...n},o)=>c.jsxs(cr,{ref:o,className:z("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,c.jsx(Rc,{asChild:!0,children:c.jsx(hr,{className:"h-4 w-4 opacity-50"})})]}));Ke.displayName=cr.displayName;const gr=l.forwardRef(({className:e,...t},n)=>c.jsx(fr,{ref:n,className:z("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(Oc,{className:"h-4 w-4"})}));gr.displayName=fr.displayName;const vr=l.forwardRef(({className:e,...t},n)=>c.jsx(pr,{ref:n,className:z("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(hr,{className:"h-4 w-4"})}));vr.displayName=pr.displayName;const Ye=l.forwardRef(({className:e,children:t,position:n="popper",...o},r)=>c.jsx(Ac,{children:c.jsxs(lr,{ref:r,className:z("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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",n==="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",e),position:n,...o,children:[c.jsx(gr,{}),c.jsx(Tc,{className:z("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),c.jsx(vr,{})]})}));Ye.displayName=lr.displayName;const Dc=l.forwardRef(({className:e,...t},n)=>c.jsx(ur,{ref:n,className:z("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Dc.displayName=ur.displayName;const se=l.forwardRef(({className:e,children:t,...n},o)=>c.jsxs(dr,{ref:o,className:z("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(Ic,{children:c.jsx(_c,{className:"h-4 w-4"})})}),c.jsx(jc,{children:t})]}));se.displayName=dr.displayName;const Mc=l.forwardRef(({className:e,...t},n)=>c.jsx(mr,{ref:n,className:z("-mx-1 my-1 h-px bg-muted",e),...t}));Mc.displayName=mr.displayName;var _t="Switch",[kc]=Fe(_t),[Lc,Fc]=kc(_t),xr=l.forwardRef((e,t)=>{const{__scopeSwitch:n,name:o,checked:r,defaultChecked:s,required:i,disabled:a,value:u="on",onCheckedChange:d,form:f,...p}=e,[h,v]=l.useState(null),w=q(t,y=>v(y)),m=l.useRef(!1),g=h?f||!!h.closest("form"):!0,[b,x]=Je({prop:r,defaultProp:s??!1,onChange:d,caller:_t});return c.jsxs(Lc,{scope:n,checked:b,disabled:a,children:[c.jsx(L.button,{type:"button",role:"switch","aria-checked":b,"aria-required":i,"data-state":Sr(b),"data-disabled":a?"":void 0,disabled:a,value:u,...p,ref:w,onClick:M(e.onClick,y=>{x(S=>!S),g&&(m.current=y.isPropagationStopped(),m.current||y.stopPropagation())})}),g&&c.jsx(wr,{control:h,bubbles:!m.current,name:o,value:u,checked:b,required:i,disabled:a,form:f,style:{transform:"translateX(-100%)"}})]})});xr.displayName=_t;var br="SwitchThumb",yr=l.forwardRef((e,t)=>{const{__scopeSwitch:n,...o}=e,r=Fc(br,n);return c.jsx(L.span,{"data-state":Sr(r.checked),"data-disabled":r.disabled?"":void 0,...o,ref:t})});yr.displayName=br;var Bc="SwitchBubbleInput",wr=l.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:o=!0,...r},s)=>{const i=l.useRef(null),a=q(i,s),u=Co(n),d=uo(t);return l.useEffect(()=>{const f=i.current;if(!f)return;const p=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(p,"checked").set;if(u!==n&&v){const w=new Event("click",{bubbles:o});v.call(f,n),f.dispatchEvent(w)}},[u,n,o]),c.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...r,tabIndex:-1,ref:a,style:{...r.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});wr.displayName=Bc;function Sr(e){return e?"checked":"unchecked"}var Cr=xr,$c=yr;const hn=l.forwardRef(({className:e,...t},n)=>c.jsx(Cr,{className:z("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:c.jsx($c,{className:z("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));hn.displayName=Cr.displayName;function Uc(){const{t:e}=Ne();return c.jsxs(Re,{children:[c.jsx(Ae,{children:c.jsx(Te,{children:e("shortcode.title")})}),c.jsxs(je,{children:[c.jsx("p",{className:"mb-2",children:e("shortcode.description")}),c.jsx("code",{className:"block bg-muted p-3 rounded-md text-lg mb-2",children:e("shortcode.code")}),c.jsx("p",{className:"text-sm text-muted-foreground italic",children:e("shortcode.note")})]})]})}function Vc({initialOptions:e,onSave:t,onChange:n}){const{t:o}=Ne(),[r,s]=l.useState(e),[i,a]=l.useState(!1),[u,d]=l.useState(null);l.useEffect(()=>{s(e)},[e]);const f=h=>{s(h),n==null||n(h)},p=async()=>{a(!0),d(null);try{const h=await Ht(r);h.success?(d(o("settings.saved")),t==null||t(),setTimeout(()=>d(null),3e3)):d(h.message||"Error saving settings")}catch(h){d(h instanceof Error?h.message:"Error saving settings")}finally{a(!1)}};return c.jsx("form",{onSubmit:h=>{h.preventDefault(),p()},children:c.jsxs(Re,{children:[c.jsxs(Ae,{children:[c.jsx(Te,{children:o("settings.mainSettings")}),c.jsx(et,{children:o("settings.description")})]}),c.jsxs(je,{className:"space-y-6",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(G,{htmlFor:"model",children:o("settings.model")}),c.jsxs(mt,{value:r.model,onValueChange:h=>f({...r,model:h}),children:[c.jsx(Ke,{id:"model",children:c.jsx(ht,{})}),c.jsxs(Ye,{children:[c.jsx(se,{value:"gpt-5-nano",children:"GPT-5 nano — Fast and economical"}),c.jsxs(se,{value:"gpt-5-mini",disabled:!r.pro_enabled,children:["GPT-5 mini — Perfect balance ",r.pro_enabled?"":"(🔒 Pro only)"]}),c.jsxs(se,{value:"gpt-5",disabled:!r.pro_enabled,children:["GPT-5 — Maximum quality ",r.pro_enabled?"":"(🔒 Pro only)"]})]})]}),c.jsx("p",{className:"text-sm text-muted-foreground",children:r.pro_enabled?o("settings.modelDescription"):`${o("settings.modelDescription")} ${o("settings.upgradeToPro")}: https://pulsechatai.com`})]}),c.jsx(Uc,{}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(G,{htmlFor:"welcome_text_floating",children:o("settings.welcomeText")}),c.jsx(te,{id:"welcome_text_floating",value:r.welcome_text_floating,onChange:h=>f({...r,welcome_text_floating:h.target.value})}),c.jsx("p",{className:"text-sm text-muted-foreground",children:o("settings.welcomeTextDescription")})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(G,{htmlFor:"system_prompt",children:o("settings.systemPrompt")}),c.jsx(Yr,{id:"system_prompt",rows:4,value:r.system_prompt,onChange:h=>f({...r,system_prompt:h.target.value})}),c.jsx("p",{className:"text-sm text-muted-foreground",children:o("settings.systemPromptDescription")})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(G,{htmlFor:"chat_height",children:o("settings.chatHeight")}),c.jsx(te,{id:"chat_height",value:r.chat_height,onChange:h=>f({...r,chat_height:h.target.value})}),c.jsx("p",{className:"text-sm text-muted-foreground",children:o("settings.chatHeightDescription")})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(G,{htmlFor:"chat_placeholder",children:o("settings.placeholder")}),c.jsx(te,{id:"chat_placeholder",value:r.chat_placeholder,onChange:h=>f({...r,chat_placeholder:h.target.value})}),c.jsx("p",{className:"text-sm text-muted-foreground",children:o("settings.placeholderDescription")})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"space-y-0.5",children:[c.jsx(G,{htmlFor:"floating_chat_enabled",children:o("settings.floatingChat")}),c.jsx("p",{className:"text-sm text-muted-foreground",children:o("settings.floatingChatDescription")})]}),c.jsx(hn,{id:"floating_chat_enabled",checked:r.floating_chat_enabled,onCheckedChange:h=>f({...r,floating_chat_enabled:h})})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsx(G,{children:"Quick Questions"}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(G,{htmlFor:"quick_question_1",children:o("settings.quickQuestion1")}),c.jsx(te,{id:"quick_question_1",value:r.quick_question_1,onChange:h=>f({...r,quick_question_1:h.target.value})}),c.jsx("p",{className:"text-sm text-muted-foreground",children:o("settings.quickQuestion1Description")})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(G,{htmlFor:"quick_question_2",children:o("settings.quickQuestion2")}),c.jsx(te,{id:"quick_question_2",value:r.quick_question_2,onChange:h=>f({...r,quick_question_2:h.target.value})}),c.jsx("p",{className:"text-sm text-muted-foreground",children:o("settings.quickQuestion2Description")})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(G,{htmlFor:"quick_question_3",children:o("settings.quickQuestion3")}),c.jsx(te,{id:"quick_question_3",value:r.quick_question_3,onChange:h=>f({...r,quick_question_3:h.target.value})}),c.jsx("p",{className:"text-sm text-muted-foreground",children:o("settings.quickQuestion3Description")})]})]}),c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx(Xe,{type:"submit",disabled:i,children:i?"Saving...":o("settings.save")}),u&&c.jsx("span",{className:"text-sm text-green-600",children:u})]})]})]})})}function Wc({stats:e}){const{t}=Ne();return c.jsxs(Re,{children:[c.jsx(Ae,{children:c.jsx(Te,{children:t("usage.title")})}),c.jsxs(je,{children:[c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[c.jsxs("div",{className:"text-center p-4 bg-muted rounded-lg",children:[c.jsx("div",{className:"text-2xl font-bold text-primary",children:e.messages_today}),c.jsx("div",{className:"text-sm text-muted-foreground",children:t("usage.messagesToday")})]}),c.jsxs("div",{className:"text-center p-4 bg-muted rounded-lg",children:[c.jsx("div",{className:"text-2xl font-bold text-primary",children:e.messages_month}),c.jsx("div",{className:"text-sm text-muted-foreground",children:t("usage.messagesMonth")})]}),c.jsxs("div",{className:"text-center p-4 bg-muted rounded-lg",children:[c.jsx("div",{className:"text-2xl font-bold text-primary",children:e.active_users_today??0}),c.jsx("div",{className:"text-sm text-muted-foreground",children:t("usage.activeUsers")})]})]}),c.jsxs("p",{className:"mt-4 text-sm text-center text-muted-foreground",children:[t("usage.freePlanLimits")," ",c.jsx("a",{href:"https://pulsechatai.com/",target:"_blank",rel:"noopener noreferrer",className:"text-primary font-semibold hover:underline",children:t("usage.upgrade")})]})]})]})}function Hc({show:e=!0}){const{t}=Ne();return e?c.jsxs(Re,{className:"border-orange-200 bg-orange-50/50",children:[c.jsxs(Ae,{children:[c.jsx(Te,{className:"text-lg",children:"Unlock Pro Features"}),c.jsx(et,{children:"Get access to advanced models and powerful features"})]}),c.jsxs(je,{className:"space-y-4",children:[c.jsxs("ul",{className:"list-disc list-inside space-y-2 text-sm text-muted-foreground",children:[c.jsx("li",{children:"GPT-5 Mini and GPT-5 models for faster, smarter responses"}),c.jsx("li",{children:"Advanced branding and customization options"}),c.jsx("li",{children:"Training with your own documents (RAG)"}),c.jsx("li",{children:"Save and analyze conversations"}),c.jsx("li",{children:"Advanced analytics and insights"}),c.jsx("li",{children:"Webhooks and integrations"})]}),c.jsx(Xe,{asChild:!0,className:"w-full",variant:"default",children:c.jsx("a",{href:"https://pulsechatai.com/",target:"_blank",rel:"noopener noreferrer",children:t("settings.upgradeToPro")})})]})]}):null}function zc({branding:e,onChange:t}){const{t:n}=Ne(),o=r=>{t({...e,...r})};return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(G,{htmlFor:"theme",children:n("branding.theme","Theme")}),c.jsxs(mt,{value:e.theme||"light",onValueChange:r=>o({theme:r}),children:[c.jsx(Ke,{id:"theme",children:c.jsx(ht,{})}),c.jsxs(Ye,{children:[c.jsx(se,{value:"light",children:n("branding.themeLight","Light")}),c.jsx(se,{value:"dark",children:n("branding.themeDark","Dark")})]})]}),c.jsx("p",{className:"text-sm text-muted-foreground",children:n("branding.themeDescription","Choose a base theme for your chat widgets")})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(G,{htmlFor:"accent_color",children:n("branding.accentColor","Accent Color")}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(te,{id:"accent_color",type:"color",value:e.accent_color||"#155dfc",onChange:r=>o({accent_color:r.target.value}),className:"w-20 h-10"}),c.jsx(te,{type:"text",value:e.accent_color||"#155dfc",onChange:r=>o({accent_color:r.target.value}),placeholder:"#155dfc"})]}),c.jsx("p",{className:"text-sm text-muted-foreground",children:n("branding.accentColorDescription","Customize buttons, links, and highlights")})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(G,{htmlFor:"avatar_url",children:n("branding.avatar","AI Assistant Avatar")}),c.jsxs("div",{className:"flex items-center gap-4",children:[e.avatar_url?c.jsxs("div",{className:"relative",children:[c.jsx("img",{src:e.avatar_url,alt:"Avatar",className:"h-16 w-16 rounded-full object-cover border-2 border-border"}),c.jsx(Xe,{type:"button",variant:"ghost",size:"icon",className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>o({avatar_url:""}),children:c.jsx(Xr,{className:"h-4 w-4"})})]}):c.jsx("div",{className:"h-16 w-16 rounded-full bg-muted border-2 border-border flex items-center justify-center",children:c.jsx("span",{className:"text-xs text-muted-foreground",children:n("branding.avatarPlaceholder","Default")})}),c.jsx(Xe,{type:"button",variant:"outline",onClick:()=>{var r;if(typeof window<"u"&&((r=window.wp)!=null&&r.media)){const s=window.wp.media({title:n("branding.selectAvatar","Select Avatar Image"),button:{text:n("branding.useThisImage","Use this image")},multiple:!1,library:{type:"image"}});s.on("select",()=>{const i=s.state().get("selection").first().toJSON();i.url&&o({avatar_url:i.url})}),s.open()}else{const s=document.createElement("input");s.type="file",s.accept="image/png,image/svg+xml,image/jpeg",s.onchange=i=>{var u;const a=(u=i.target.files)==null?void 0:u[0];if(a){const d=new FileReader;d.onload=f=>{var h;const p=(h=f.target)==null?void 0:h.result;p&&o({avatar_url:p})},d.readAsDataURL(a)}},s.click()}},children:e.avatar_url?n("branding.changeAvatar","Change Avatar"):n("branding.uploadAvatar","Upload Avatar")})]}),c.jsx("p",{className:"text-sm text-muted-foreground",children:n("branding.avatarDescription","Upload a custom avatar for the AI assistant. Recommended: Square image (PNG or SVG). Default robot icon will be used if not set.")})]}),c.jsxs("div",{className:"space-y-4 pt-4 border-t",children:[c.jsx("h3",{className:"text-sm font-semibold",children:n("branding.floatingChat","Floating Chat")}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(G,{htmlFor:"bubble_position",children:n("branding.bubblePosition","Bubble Position")}),c.jsxs(mt,{value:e.bubble_position||"bottom-right",onValueChange:r=>o({bubble_position:r}),children:[c.jsx(Ke,{id:"bubble_position",children:c.jsx(ht,{})}),c.jsxs(Ye,{children:[c.jsx(se,{value:"bottom-right",children:n("branding.positionBottomRight","Bottom Right")}),c.jsx(se,{value:"bottom-left",children:n("branding.positionBottomLeft","Bottom Left")})]})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(G,{htmlFor:"bubble_offset_x",children:n("branding.offsetX","Horizontal Offset (px)")}),c.jsx(te,{id:"bubble_offset_x",type:"number",value:e.bubble_offset_x||24,onChange:r=>o({bubble_offset_x:parseInt(r.target.value)||24}),min:0})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(G,{htmlFor:"bubble_offset_y",children:n("branding.offsetY","Vertical Offset (px)")}),c.jsx(te,{id:"bubble_offset_y",type:"number",value:e.bubble_offset_y||24,onChange:r=>o({bubble_offset_y:parseInt(r.target.value)||24}),min:0})]})]})]}),c.jsxs("div",{className:"space-y-4 pt-4 border-t",children:[c.jsx("h3",{className:"text-sm font-semibold",children:n("branding.shortcodeChat","Shortcode / Full-Screen Chat")}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(G,{htmlFor:"fullscreen_enabled",children:n("branding.fullscreenEnabled","Enable Full-Screen Mode")}),c.jsx("p",{className:"text-sm text-muted-foreground",children:n("branding.fullscreenEnabledDescription","Allow shortcode to display in full-screen mode")}),c.jsxs(mt,{value:e.fullscreen_enabled?"enabled":"disabled",onValueChange:r=>o({fullscreen_enabled:r==="enabled"}),children:[c.jsx(Ke,{id:"fullscreen_enabled",children:c.jsx(ht,{})}),c.jsxs(Ye,{children:[c.jsx(se,{value:"disabled",children:n("branding.disabled","Disabled")}),c.jsx(se,{value:"enabled",children:n("branding.enabled","Enabled")})]})]})]})]})]})}function qc({branding:e,onSave:t}){const{t:n}=Ne(),[o,r]=l.useState(e||{}),[s,i]=l.useState(!1),[a,u]=l.useState(null);l.useEffect(()=>{r(e||{})},[e]);const d=async()=>{i(!0),u(null);try{await t(o),u(n("settings.saved","Settings saved successfully")),setTimeout(()=>u(null),3e3)}catch(f){u(f instanceof Error?f.message:"Error saving settings")}finally{i(!1)}};return c.jsxs(Re,{children:[c.jsxs(Ae,{children:[c.jsx(Te,{children:n("branding.title","Branding & UI")}),c.jsx(et,{children:n("branding.description","Customize theme and accent color for all chat widgets")})]}),c.jsxs(je,{children:[c.jsx(zc,{branding:o,onChange:f=>r(f)}),c.jsxs("div",{className:"flex items-center justify-between mt-6 pt-6 border-t",children:[c.jsx("div",{children:a&&c.jsx("span",{className:`text-sm ${a.includes("Error")?"text-red-600":"text-green-600"}`,children:a})}),c.jsx(Xe,{onClick:d,disabled:s,children:s?n("settings.saving","Saving..."):n("settings.save","Save Settings")})]})]})]})}function Gc({options:e,onChange:t}){const{t:n}=Ne(),[o,r]=l.useState(e),[s,i]=l.useState(!1);l.useEffect(()=>{r(e)},[e]);const a=async u=>{const d={...o,pro_enabled:u};!u&&(o.model==="gpt-5-mini"||o.model==="gpt-5")&&(d.model="gpt-5-nano"),r(d),t(d),i(!0);try{await Ht(d)}catch(f){console.error("Error saving Pro settings:",f)}finally{i(!1)}};return c.jsxs("div",{className:"space-y-6",children:[!o.pro_enabled&&c.jsx(Hc,{}),c.jsxs(Re,{children:[c.jsxs(Ae,{children:[c.jsx(Te,{children:n("pro.title","Pulse Chat Pro")}),c.jsx(et,{children:n("pro.description","Unlock advanced features and customization options")})]}),c.jsx(je,{className:"space-y-6",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"space-y-0.5",children:[c.jsx(G,{htmlFor:"pro_enabled",children:n("settings.proEnabled")}),c.jsx("p",{className:"text-sm text-muted-foreground",children:n("settings.proEnabledDescription")})]}),c.jsx(hn,{id:"pro_enabled",checked:o.pro_enabled,onCheckedChange:a,disabled:s}),s&&c.jsx("span",{className:"text-sm text-muted-foreground ml-2",children:"Saving..."})]})})]}),o.pro_enabled&&c.jsx(qc,{branding:o.branding,onSave:async u=>{const d={...o,branding:u};r(d),t(d);try{await Ht(d)}catch(f){throw f}}})]})}var Wt="rovingFocusGroup.onEntryFocus",Kc={bubbles:!1,cancelable:!0},ot="RovingFocusGroup",[tn,Er,Yc]=qn(ot),[Xc,Pr]=Fe(ot,[Yc]),[Qc,Zc]=Xc(ot),Nr=l.forwardRef((e,t)=>c.jsx(tn.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(tn.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Jc,{...e,ref:t})})}));Nr.displayName=ot;var Jc=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,h=l.useRef(null),v=q(t,h),w=rn(s),[m,g]=Je({prop:i,defaultProp:a??null,onChange:u,caller:ot}),[b,x]=l.useState(!1),y=ge(d),S=Er(n),C=l.useRef(!1),[N,E]=l.useState(0);return l.useEffect(()=>{const P=h.current;if(P)return P.addEventListener(Wt,y),()=>P.removeEventListener(Wt,y)},[y]),c.jsx(Qc,{scope:n,orientation:o,dir:w,loop:r,currentTabStopId:m,onItemFocus:l.useCallback(P=>g(P),[g]),onItemShiftTab:l.useCallback(()=>x(!0),[]),onFocusableItemAdd:l.useCallback(()=>E(P=>P+1),[]),onFocusableItemRemove:l.useCallback(()=>E(P=>P-1),[]),children:c.jsx(L.div,{tabIndex:b||N===0?-1:0,"data-orientation":o,...p,ref:v,style:{outline:"none",...e.style},onMouseDown:M(e.onMouseDown,()=>{C.current=!0}),onFocus:M(e.onFocus,P=>{const _=!C.current;if(P.target===P.currentTarget&&_&&!b){const j=new CustomEvent(Wt,Kc);if(P.currentTarget.dispatchEvent(j),!j.defaultPrevented){const k=S().filter(T=>T.focusable),$=k.find(T=>T.active),O=k.find(T=>T.id===m),V=[$,O,...k].filter(Boolean).map(T=>T.ref.current);Tr(V,f)}}C.current=!1}),onBlur:M(e.onBlur,()=>x(!1))})})}),Rr="RovingFocusGroupItem",Ar=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:s,children:i,...a}=e,u=tt(),d=s||u,f=Zc(Rr,n),p=f.currentTabStopId===d,h=Er(n),{onFocusableItemAdd:v,onFocusableItemRemove:w,currentTabStopId:m}=f;return l.useEffect(()=>{if(o)return v(),()=>w()},[o,v,w]),c.jsx(tn.ItemSlot,{scope:n,id:d,focusable:o,active:r,children:c.jsx(L.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...a,ref:t,onMouseDown:M(e.onMouseDown,g=>{o?f.onItemFocus(d):g.preventDefault()}),onFocus:M(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:M(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){f.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const b=nl(g,f.orientation,f.dir);if(b!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let y=h().filter(S=>S.focusable).map(S=>S.ref.current);if(b==="last")y.reverse();else if(b==="prev"||b==="next"){b==="prev"&&y.reverse();const S=y.indexOf(g.currentTarget);y=f.loop?ol(y,S+1):y.slice(S+1)}setTimeout(()=>Tr(y))}}),children:typeof i=="function"?i({isCurrentTabStop:p,hasTabStop:m!=null}):i})})});Ar.displayName=Rr;var el={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function tl(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function nl(e,t,n){const o=tl(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return el[o]}function Tr(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function ol(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var rl=Nr,sl=Ar;function il(e,t){return l.useReducer((n,o)=>t[n][o]??n,e)}var jr=e=>{const{present:t,children:n}=e,o=al(t),r=typeof n=="function"?n({present:o.isPresent}):l.Children.only(n),s=q(o.ref,cl(r));return typeof n=="function"||o.isPresent?l.cloneElement(r,{ref:s}):null};jr.displayName="Presence";function al(e){const[t,n]=l.useState(),o=l.useRef(null),r=l.useRef(e),s=l.useRef("none"),i=e?"mounted":"unmounted",[a,u]=il(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return l.useEffect(()=>{const d=ut(o.current);s.current=a==="mounted"?d:"none"},[a]),Y(()=>{const d=o.current,f=r.current;if(f!==e){const h=s.current,v=ut(d);e?u("MOUNT"):v==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&h!==v?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,u]),Y(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,p=v=>{const m=ut(o.current).includes(CSS.escape(v.animationName));if(v.target===t&&m&&(u("ANIMATION_END"),!r.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},h=v=>{v.target===t&&(s.current=ut(o.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:l.useCallback(d=>{o.current=d?getComputedStyle(d):null,n(d)},[])}}function ut(e){return(e==null?void 0:e.animationName)||"none"}function cl(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ot="Tabs",[ll]=Fe(Ot,[Pr]),Ir=Pr(),[ul,gn]=ll(Ot),_r=l.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:r,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:u="automatic",...d}=e,f=rn(a),[p,h]=Je({prop:o,onChange:r,defaultProp:s??"",caller:Ot});return c.jsx(ul,{scope:n,baseId:tt(),value:p,onValueChange:h,orientation:i,dir:f,activationMode:u,children:c.jsx(L.div,{dir:f,"data-orientation":i,...d,ref:t})})});_r.displayName=Ot;var Or="TabsList",Dr=l.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...r}=e,s=gn(Or,n),i=Ir(n);return c.jsx(rl,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:o,children:c.jsx(L.div,{role:"tablist","aria-orientation":s.orientation,...r,ref:t})})});Dr.displayName=Or;var Mr="TabsTrigger",kr=l.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:r=!1,...s}=e,i=gn(Mr,n),a=Ir(n),u=Br(i.baseId,o),d=$r(i.baseId,o),f=o===i.value;return c.jsx(sl,{asChild:!0,...a,focusable:!r,active:f,children:c.jsx(L.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":d,"data-state":f?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:u,...s,ref:t,onMouseDown:M(e.onMouseDown,p=>{!r&&p.button===0&&p.ctrlKey===!1?i.onValueChange(o):p.preventDefault()}),onKeyDown:M(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&i.onValueChange(o)}),onFocus:M(e.onFocus,()=>{const p=i.activationMode!=="manual";!f&&!r&&p&&i.onValueChange(o)})})})});kr.displayName=Mr;var Lr="TabsContent",Fr=l.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:r,children:s,...i}=e,a=gn(Lr,n),u=Br(a.baseId,o),d=$r(a.baseId,o),f=o===a.value,p=l.useRef(f);return l.useEffect(()=>{const h=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(h)},[]),c.jsx(jr,{present:r||f,children:({present:h})=>c.jsx(L.div,{"data-state":f?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":u,hidden:!h,id:d,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:h&&s})})});Fr.displayName=Lr;function Br(e,t){return`${e}-trigger-${t}`}function $r(e,t){return`${e}-content-${t}`}var dl=_r,Ur=Dr,Vr=kr,Wr=Fr;const fl=dl,Hr=l.forwardRef(({className:e,...t},n)=>c.jsx(Ur,{ref:n,className:z("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Hr.displayName=Ur.displayName;const gt=l.forwardRef(({className:e,...t},n)=>c.jsx(Vr,{ref:n,className:z("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));gt.displayName=Vr.displayName;const vt=l.forwardRef(({className:e,...t},n)=>c.jsx(Wr,{ref:n,className:z("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));vt.displayName=Wr.displayName;function pl({options:e,usage:t}){const[n,o]=l.useState(e);return c.jsxs("div",{className:"p-6 space-y-6",children:[c.jsx("h1",{className:"text-3xl font-bold",children:"Pulse Chat AI Settings"}),c.jsxs(fl,{defaultValue:"main",className:"w-full",children:[c.jsxs(Hr,{className:"grid w-full grid-cols-3",children:[c.jsx(gt,{value:"main",children:"Main Settings"}),c.jsx(gt,{value:"usage",children:"Usage Statistics"}),c.jsx(gt,{value:"pro",children:"Pulse Chat Pro"})]}),c.jsx(vt,{value:"main",className:"mt-6",children:c.jsx(Vc,{initialOptions:n,onChange:o})}),c.jsx(vt,{value:"usage",className:"mt-6",children:c.jsx(Wc,{stats:t})}),c.jsx(vt,{value:"pro",className:"mt-6",children:c.jsx(Gc,{options:n,onChange:r=>{o(r)}})})]})]})}const ml={title:"Pulse Chat AI Settings",mainSettings:"Main Settings",description:"Configure AI chat parameters. The plugin connects to a secure API endpoint.",model:"Model",modelDescription:"Select the OpenAI model that best fits your use case. Upgrade to Pro for access to GPT-5 and GPT-5 mini.",welcomeText:"Welcome Text (Floating Chat)",welcomeTextDescription:"Text displayed in the floating chat welcome message.",systemPrompt:"System Prompt",systemPromptDescription:"Initial instructions for the assistant behavior. Note: Responses are limited to ~10 lines to optimize token usage.",chatHeight:"Chat Height",chatHeightDescription:"Chat container height (e.g.: 50vh, 100dvh, 500px).",placeholder:"Placeholder Text",placeholderDescription:"Text that appears in the input field when empty.",floatingChat:"Enable Floating Chat",floatingChatDescription:"Show floating chat bubble on all pages",proEnabled:"Enable Pro Features",proEnabledDescription:"Unlock GPT-5 Mini and GPT-5 models, plus advanced features",upgradeToPro:"Upgrade to Pro",proBadge:"Pro",quickQuestion1:"Quick Question 1",quickQuestion1Description:"First quick question button that users can click.",quickQuestion2:"Quick Question 2",quickQuestion2Description:"Second quick question button that users can click.",quickQuestion3:"Quick Question 3",quickQuestion3Description:"Third quick question button that users can click.",save:"Save Changes",saving:"Saving...",saved:"Settings saved successfully"},hl={title:"Usage Statistics",messagesToday:"Messages Today",messagesMonth:"Messages This Month",activeUsers:"Active Users Today",freePlanLimits:"Free plan limits: 40 messages/day per site, 100 messages/month per site",upgrade:"Upgrade for unlimited access"},gl={title:"Shortcode Usage",description:"Use this shortcode to display the chat on any page, post, or widget:",code:"[pulse_chat_ai]",note:"All chat parameters are configured below. The shortcode does not accept additional parameters."},vl={title:"Branding & UI",description:"Customize colors, avatar, and appearance of your chat widgets",floatingChat:"Floating Chat",shortcodeChat:"Shortcode / Full-Screen Chat",theme:"Theme",themeLight:"Light",themeDark:"Dark",themeDescription:"Choose a base theme for your chat widgets",disabled:"Disabled",enabled:"Enabled",accentColor:"Accent Color",accentColorDescription:"Customize buttons, links, and highlights",colors:"Colors",avatar:"AI Assistant Avatar",avatarPlaceholder:"Default",selectAvatar:"Select Avatar Image",useThisImage:"Use this image",changeAvatar:"Change Avatar",uploadAvatar:"Upload Avatar",avatarDescription:"Upload a custom avatar for the AI assistant. Recommended: Square image (PNG or SVG), max 500KB. Default robot icon will be used if not set.",avatarSizeError:"Image size must be less than 500KB",position:"Position",advanced:"Advanced",colorBackground:"Background Color",colorAccent:"Accent Color",colorBubble:"Bubble Color",colorButton:"Button Color",colorUserMessage:"User Message Color",colorAssistantMessage:"Assistant Message Color",avatarEnabled:"Enable Custom Avatar",avatarEnabledDescription:"Upload a custom avatar/logo for the chat assistant",avatarUrl:"Avatar URL",avatarUrlDescription:"Enter the full URL to your avatar image (PNG, JPG, SVG)",bubblePosition:"Bubble Position",positionBottomRight:"Bottom Right",positionBottomLeft:"Bottom Left",positionTopRight:"Top Right",positionTopLeft:"Top Left",offsetX:"Horizontal Offset (px)",offsetY:"Vertical Offset (px)",useThemeFont:"Use Theme Font",useThemeFontDescription:"Use your WordPress theme font instead of default",fontFamily:"Custom Font Family",fontFamilyDescription:'Enter CSS font-family value (e.g., "Arial, sans-serif")',fullscreenEnabled:"Enable Full-Screen Mode",fullscreenEnabledDescription:"Allow shortcode to display in full-screen mode",customCss:"Custom CSS",customCssDescription:"Add custom CSS scoped to the chat widget. Use .pulse-chat-ai-container selector."},xl={settings:ml,usage:hl,shortcode:gl,branding:vl},bl={title:"Configuración de Pulse Chat AI",mainSettings:"Configuración Principal",description:"Configura los parámetros del chat de IA. El plugin se conecta a un endpoint de API seguro.",model:"Modelo",modelDescription:"Selecciona el modelo de OpenAI que mejor se adapte a tu caso de uso. Actualiza a Pro para acceder a GPT-5 y GPT-5 mini.",welcomeText:"Texto de Bienvenida (Chat Flotante)",welcomeTextDescription:"Texto mostrado en el mensaje de bienvenida del chat flotante.",systemPrompt:"Prompt del Sistema",systemPromptDescription:"Instrucciones iniciales para el comportamiento del asistente. Nota: Las respuestas están limitadas a ~10 líneas para optimizar el uso de tokens.",chatHeight:"Altura del Chat",chatHeightDescription:"Altura del contenedor del chat (ej.: 50vh, 100dvh, 500px).",placeholder:"Texto de Placeholder",placeholderDescription:"Texto que aparece en el campo de entrada cuando está vacío.",floatingChat:"Habilitar Chat Flotante",floatingChatDescription:"Mostrar burbuja de chat flotante en todas las páginas",proEnabled:"Habilitar Funciones Pro",proEnabledDescription:"Desbloquear modelos GPT-5 Mini y GPT-5, además de funciones avanzadas",upgradeToPro:"Actualizar a Pro",proBadge:"Pro",quickQuestion1:"Pregunta Rápida 1",quickQuestion1Description:"Primer botón de pregunta rápida que los usuarios pueden hacer clic.",quickQuestion2:"Pregunta Rápida 2",quickQuestion2Description:"Segundo botón de pregunta rápida que los usuarios pueden hacer clic.",quickQuestion3:"Pregunta Rápida 3",quickQuestion3Description:"Tercer botón de pregunta rápida que los usuarios pueden hacer clic.",save:"Guardar Cambios",saving:"Guardando...",saved:"Configuración guardada exitosamente"},yl={title:"Estadísticas de Uso",messagesToday:"Mensajes Hoy",messagesMonth:"Mensajes Este Mes",activeUsers:"Usuarios Activos Hoy",freePlanLimits:"Límites del plan gratuito: 40 mensajes/día por sitio, 100 mensajes/mes por sitio",upgrade:"Actualizar para acceso ilimitado"},wl={title:"Uso del Shortcode",description:"Usa este shortcode para mostrar el chat en cualquier página, entrada o widget:",code:"[pulse_chat_ai]",note:"Todos los parámetros del chat se configuran a continuación. El shortcode no acepta parámetros adicionales."},Sl={title:"Branding e Interfaz",description:"Personaliza colores, avatar y apariencia de tus widgets de chat",floatingChat:"Chat Flotante",shortcodeChat:"Chat Shortcode / Pantalla Completa",theme:"Tema",themeLight:"Claro",themeDark:"Oscuro",themeDescription:"Elige un tema base para tus widgets de chat",disabled:"Deshabilitado",enabled:"Habilitado",accentColor:"Color de Acento",accentColorDescription:"Personaliza botones, enlaces y elementos destacados",colors:"Colores",avatar:"Avatar del Asistente IA",avatarPlaceholder:"Por Defecto",selectAvatar:"Seleccionar Imagen de Avatar",useThisImage:"Usar esta imagen",changeAvatar:"Cambiar Avatar",uploadAvatar:"Subir Avatar",avatarDescription:"Sube un avatar personalizado para el asistente de IA. Recomendado: Imagen cuadrada (PNG o SVG), máximo 500KB. Se usará el icono de robot por defecto si no se establece.",avatarSizeError:"El tamaño de la imagen debe ser menor a 500KB",position:"Posición",advanced:"Avanzado",colorBackground:"Color de Fondo",colorAccent:"Color de Acento",colorBubble:"Color de Burbuja",colorButton:"Color de Botón",colorUserMessage:"Color de Mensaje de Usuario",colorAssistantMessage:"Color de Mensaje de Asistente",avatarEnabled:"Habilitar Avatar Personalizado",avatarEnabledDescription:"Sube un avatar/logo personalizado para el asistente de chat",avatarUrl:"URL del Avatar",avatarUrlDescription:"Ingresa la URL completa de tu imagen de avatar (PNG, JPG, SVG)",bubblePosition:"Posición de la Burbuja",positionBottomRight:"Inferior Derecha",positionBottomLeft:"Inferior Izquierda",positionTopRight:"Superior Derecha",positionTopLeft:"Superior Izquierda",offsetX:"Desplazamiento Horizontal (px)",offsetY:"Desplazamiento Vertical (px)",useThemeFont:"Usar Fuente del Tema",useThemeFontDescription:"Usa la fuente de tu tema de WordPress en lugar de la predeterminada",fontFamily:"Familia de Fuente Personalizada",fontFamilyDescription:'Ingresa el valor CSS de font-family (ej.: "Arial, sans-serif")',fullscreenEnabled:"Habilitar Modo Pantalla Completa",fullscreenEnabledDescription:"Permitir que el shortcode se muestre en modo pantalla completa",customCss:"CSS Personalizado",customCssDescription:"Agrega CSS personalizado para el widget de chat. Usa el selector .pulse-chat-ai-container."},Cl={settings:bl,usage:yl,shortcode:wl,branding:Sl},El=()=>{var t;if(typeof window<"u"&&((t=window.pulseChatAI)!=null&&t.locale))return window.pulseChatAI.locale;const e=navigator.language.split("-")[0];return["en","es"].includes(e)?e:"en"};Qr.use(Zr).init({resources:{en:{translation:xl},es:{translation:Cl}},lng:El(),fallbackLng:"en",interpolation:{escapeValue:!1}});const Pl=()=>{const e=window.pulseChatAI;return{options:(e==null?void 0:e.options)||{},usage:(e==null?void 0:e.usage)||{messages_today:0,messages_month:0,active_users_today:0}}},Vn=document.getElementById("pulse-chat-ai-admin-root");if(Vn){const e=Jr(Vn),{options:t,usage:n}=Pl();e.render(c.jsx(l.StrictMode,{children:c.jsx(pl,{options:t,usage:n})}))}
     56 */const Er=we("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
     57 * @license lucide-react v0.309.0 - ISC
     58 *
     59 * This source code is licensed under the ISC license.
     60 * See the LICENSE file in the root directory of this source tree.
     61 */const Wc=we("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
     62 * @license lucide-react v0.309.0 - ISC
     63 *
     64 * This source code is licensed under the ISC license.
     65 * See the LICENSE file in the root directory of this source tree.
     66 */const Kn=we("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
     67 * @license lucide-react v0.309.0 - ISC
     68 *
     69 * This source code is licensed under the ISC license.
     70 * See the LICENSE file in the root directory of this source tree.
     71 */const Hc=we("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
     72 * @license lucide-react v0.309.0 - ISC
     73 *
     74 * This source code is licensed under the ISC license.
     75 * See the LICENSE file in the root directory of this source tree.
     76 */const zc=we("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
     77 * @license lucide-react v0.309.0 - ISC
     78 *
     79 * This source code is licensed under the ISC license.
     80 * See the LICENSE file in the root directory of this source tree.
     81 */const qc=we("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),Ze=Mc,Je=Oc,Le=l.forwardRef(({className:e,children:t,...n},o)=>s.jsxs(xr,{ref:o,className:z("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,s.jsx(Lc,{asChild:!0,children:s.jsx(Er,{className:"h-4 w-4 opacity-50"})})]}));Le.displayName=xr.displayName;const jr=l.forwardRef(({className:e,...t},n)=>s.jsx(Sr,{ref:n,className:z("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Wc,{className:"h-4 w-4"})}));jr.displayName=Sr.displayName;const Pr=l.forwardRef(({className:e,...t},n)=>s.jsx(Cr,{ref:n,className:z("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Er,{className:"h-4 w-4"})}));Pr.displayName=Cr.displayName;const Fe=l.forwardRef(({className:e,children:t,position:n="popper",...o},r)=>s.jsx(Fc,{children:s.jsxs(yr,{ref:r,className:z("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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",n==="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",e),position:n,...o,children:[s.jsx(jr,{}),s.jsx(Bc,{className:z("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(Pr,{})]})}));Fe.displayName=yr.displayName;const Gc=l.forwardRef(({className:e,...t},n)=>s.jsx(br,{ref:n,className:z("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Gc.displayName=br.displayName;const Q=l.forwardRef(({className:e,children:t,...n},o)=>s.jsxs(wr,{ref:o,className:z("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx($c,{children:s.jsx(Xc,{className:"h-4 w-4"})})}),s.jsx(Vc,{children:t})]}));Q.displayName=wr.displayName;const Kc=l.forwardRef(({className:e,...t},n)=>s.jsx(Nr,{ref:n,className:z("-mx-1 my-1 h-px bg-muted",e),...t}));Kc.displayName=Nr.displayName;var _t="Switch",[Yc]=Ve(_t),[Qc,Zc]=Yc(_t),Ar=l.forwardRef((e,t)=>{const{__scopeSwitch:n,name:o,checked:r,defaultChecked:i,required:a,disabled:c,value:d="on",onCheckedChange:u,form:f,...m}=e,[h,x]=l.useState(null),w=q(t,y=>x(y)),p=l.useRef(!1),g=h?f||!!h.closest("form"):!0,[b,v]=ot({prop:r,defaultProp:i??!1,onChange:u,caller:_t});return s.jsxs(Qc,{scope:n,checked:b,disabled:c,children:[s.jsx(F.button,{type:"button",role:"switch","aria-checked":b,"aria-required":a,"data-state":Ir(b),"data-disabled":c?"":void 0,disabled:c,value:d,...m,ref:w,onClick:L(e.onClick,y=>{v(C=>!C),g&&(p.current=y.isPropagationStopped(),p.current||y.stopPropagation())})}),g&&s.jsx(_r,{control:h,bubbles:!p.current,name:o,value:d,checked:b,required:a,disabled:c,form:f,style:{transform:"translateX(-100%)"}})]})});Ar.displayName=_t;var Rr="SwitchThumb",Tr=l.forwardRef((e,t)=>{const{__scopeSwitch:n,...o}=e,r=Zc(Rr,n);return s.jsx(F.span,{"data-state":Ir(r.checked),"data-disabled":r.disabled?"":void 0,...o,ref:t})});Tr.displayName=Rr;var Jc="SwitchBubbleInput",_r=l.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:o=!0,...r},i)=>{const a=l.useRef(null),c=q(a,i),d=ko(n),u=wo(t);return l.useEffect(()=>{const f=a.current;if(!f)return;const m=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(m,"checked").set;if(d!==n&&x){const w=new Event("click",{bubbles:o});x.call(f,n),f.dispatchEvent(w)}},[d,n,o]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...r,tabIndex:-1,ref:c,style:{...r.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});_r.displayName=Jc;function Ir(e){return e?"checked":"unchecked"}var kr=Ar,el=Tr;const De=l.forwardRef(({className:e,...t},n)=>s.jsx(kr,{className:z("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:s.jsx(el,{className:z("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));De.displayName=kr.displayName;function tl(e){var n,o,r;const t=[];return t.push("You are a helpful and friendly assistant."),e.system_prompt_concise!==!1&&t.push("Keep your answers concise."),e.system_prompt_same_language&&t.push("Always reply in the same language as the user."),e.system_prompt_use_emojis&&t.push("You can use emojis in your responses when appropriate."),(n=e.system_prompt_business)!=null&&n.trim()&&t.push(e.system_prompt_business.trim()),(o=e.system_prompt_topics)!=null&&o.trim()&&t.push(e.system_prompt_topics.trim()),(r=e.system_prompt_restrictions)!=null&&r.trim()&&t.push(e.system_prompt_restrictions.trim()),t.join(" ").trim()}function Wt(e){const t=l.useRef(null);return l.useEffect(()=>{const n=t.current;if(!n)return;const o=()=>{n.style.height="auto";const r=n.scrollHeight,i=120;n.style.height=`${Math.max(r,i)}px`};return o(),n.addEventListener("input",o),()=>{n.removeEventListener("input",o)}},[e]),t}function Yn({initialOptions:e,onChange:t,showOnlySystemPrompt:n=!1}){const{t:o}=Re(),[r,i]=l.useState(e),a=Wt(r.system_prompt_business),c=Wt(r.system_prompt_topics),d=Wt(r.system_prompt_restrictions);l.useEffect(()=>{i(e)},[e]);const u=f=>{const m={...f};(m.system_prompt_business!==void 0||m.system_prompt_topics!==void 0||m.system_prompt_restrictions!==void 0||m.system_prompt_concise!==void 0||m.system_prompt_same_language!==void 0||m.system_prompt_use_emojis!==void 0)&&(m.system_prompt=tl(m)),i(m),t==null||t(m)};return n?s.jsxs(oe,{className:"bg-white p-6 space-y-5",children:[s.jsxs("div",{className:"bg-muted p-5 rounded-md border space-y-5",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(H,{htmlFor:"welcome_text_floating",children:"Welcome Text"}),s.jsx(ae,{id:"welcome_text_floating",value:r.welcome_text_floating,onChange:f=>u({...r,welcome_text_floating:f.target.value})}),s.jsx("p",{className:"text-sm text-muted-foreground",children:o("settings.welcomeTextDescription")})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(H,{htmlFor:"chat_placeholder",children:o("settings.placeholder")}),s.jsx(ae,{id:"chat_placeholder",value:r.chat_placeholder,onChange:f=>u({...r,chat_placeholder:f.target.value})}),s.jsx("p",{className:"text-sm text-muted-foreground",children:o("settings.placeholderDescription")})]})]}),s.jsxs("div",{className:"bg-muted p-5 rounded-md border space-y-2",children:[s.jsx(H,{htmlFor:"system_prompt_business",children:"Describe your company or service"}),s.jsx(kt,{ref:a,id:"system_prompt_business",rows:6,value:r.system_prompt_business||"",onChange:f=>u({...r,system_prompt_business:f.target.value}),placeholder:"Example: We are ZapatoX, an online shoe store based in Madrid. We sell high-quality leather shoes for men and women.",className:"bg-white min-h-[120px] resize-none overflow-hidden",style:{backgroundColor:"#ffffff"}}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Tell the AI who you are, what you do, and what your visitors usually ask. This helps the assistant sound more natural."})]}),s.jsxs("div",{className:"bg-muted p-5 rounded-md border space-y-2",children:[s.jsx(H,{htmlFor:"system_prompt_topics",children:"Topics and tone"}),s.jsx(kt,{ref:c,id:"system_prompt_topics",rows:6,value:r.system_prompt_topics||"",onChange:f=>u({...r,system_prompt_topics:f.target.value}),placeholder:"Example: Answer only questions related to our products, shipping, and returns. Use a friendly and concise tone.",className:"bg-white min-h-[120px] resize-none overflow-hidden",style:{backgroundColor:"#ffffff"}}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Describe what the chatbot should talk about and how it should respond."})]}),s.jsxs("div",{className:"bg-muted p-5 rounded-md border space-y-2",children:[s.jsx(H,{htmlFor:"system_prompt_restrictions",children:"Restricted topics"}),s.jsx(kt,{ref:d,id:"system_prompt_restrictions",rows:6,value:r.system_prompt_restrictions||"",onChange:f=>u({...r,system_prompt_restrictions:f.target.value}),placeholder:"Example: If someone asks about topics unrelated to our store (politics, weather, etc.), respond with: 'I'm here to help only with ZapatoX products and orders.'",className:"bg-white min-h-[120px] resize-none overflow-hidden",style:{backgroundColor:"#ffffff"}}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Write what the chatbot should avoid or politely decline."})]}),s.jsxs("div",{className:"bg-muted p-5 rounded-md border space-y-4",children:[s.jsx("h3",{className:"text-base font-semibold",children:"Behavior Settings"}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(H,{htmlFor:"system_prompt_concise",className:"text-base font-medium",children:"Keep answers concise"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Limit responses to a maximum of 10 lines"})]}),s.jsx(De,{id:"system_prompt_concise",checked:r.system_prompt_concise!==!1,onCheckedChange:f=>u({...r,system_prompt_concise:f})})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(H,{htmlFor:"system_prompt_same_language",className:"text-base font-medium",children:"Reply in the same language as the user"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Automatically detect and match the user's language"})]}),s.jsx(De,{id:"system_prompt_same_language",checked:r.system_prompt_same_language||!1,onCheckedChange:f=>u({...r,system_prompt_same_language:f})})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(H,{htmlFor:"system_prompt_use_emojis",className:"text-base font-medium",children:"Use emojis in answers"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Optional, useful for e-commerce and friendly interactions"})]}),s.jsx(De,{id:"system_prompt_use_emojis",checked:r.system_prompt_use_emojis||!1,onCheckedChange:f=>u({...r,system_prompt_use_emojis:f})})]})]})]}),s.jsxs("div",{className:"bg-muted p-5 rounded-md border space-y-4",children:[s.jsx("h3",{className:"text-base font-semibold",children:"Quick Questions"}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(H,{htmlFor:"quick_question_1",children:o("settings.quickQuestion1")}),s.jsx(ae,{id:"quick_question_1",value:r.quick_question_1,onChange:f=>u({...r,quick_question_1:f.target.value})}),s.jsx("p",{className:"text-sm text-muted-foreground",children:o("settings.quickQuestion1Description")})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(H,{htmlFor:"quick_question_2",children:o("settings.quickQuestion2")}),s.jsx(ae,{id:"quick_question_2",value:r.quick_question_2,onChange:f=>u({...r,quick_question_2:f.target.value})}),s.jsx("p",{className:"text-sm text-muted-foreground",children:o("settings.quickQuestion2Description")})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(H,{htmlFor:"quick_question_3",children:o("settings.quickQuestion3")}),s.jsx(ae,{id:"quick_question_3",value:r.quick_question_3,onChange:f=>u({...r,quick_question_3:f.target.value})}),s.jsx("p",{className:"text-sm text-muted-foreground",children:o("settings.quickQuestion3Description")})]})]})]}):s.jsx("div",{children:s.jsxs(oe,{className:"bg-white p-6 space-y-5",children:[s.jsxs("div",{className:"bg-muted p-5 rounded-md border space-y-5",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(H,{htmlFor:"model",children:o("settings.model")}),s.jsxs(Ze,{value:r.model,onValueChange:f=>u({...r,model:f}),children:[s.jsx(Le,{id:"model",children:s.jsx(Je,{})}),s.jsxs(Fe,{children:[s.jsx(Q,{value:"gpt-5-nano",children:"GPT-5 nano — Fast and economical"}),s.jsxs(Q,{value:"gpt-5-mini",disabled:!r.pro_enabled,children:["GPT-5 mini — Perfect balance ",r.pro_enabled?"":"(🔒 Pro only)"]}),s.jsxs(Q,{value:"gpt-5",disabled:!r.pro_enabled,children:["GPT-5 — Maximum quality ",r.pro_enabled?"":"(🔒 Pro only)"]})]})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:r.pro_enabled?o("settings.modelDescription"):`${o("settings.modelDescription")} ${o("settings.upgradeToPro")}: https://pulsechatai.com`})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(H,{htmlFor:"chat_height",children:o("settings.chatHeight")}),s.jsx(ae,{id:"chat_height",value:r.chat_height,onChange:f=>u({...r,chat_height:f.target.value})}),s.jsx("p",{className:"text-sm text-muted-foreground",children:o("settings.chatHeightDescription")})]})]}),s.jsx("div",{className:"bg-muted p-5 rounded-md border space-y-5",children:s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("h3",{className:"text-base font-semibold",children:o("settings.floatingChat")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:o("settings.floatingChatDescription")})]}),s.jsx(De,{id:"floating_chat_enabled",checked:r.floating_chat_enabled,onCheckedChange:f=>u({...r,floating_chat_enabled:f})})]}),s.jsxs("p",{className:"text-sm text-muted-foreground italic mt-2",children:["To hide the floating chat on specific pages, add ",s.jsxs("code",{className:"bg-white px-1 py-0.5 rounded text-xs",children:["#pulse-chat-ai-floating-root ","{"," display: none; ","}"]})," to your page styles."]})]}),s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("h3",{className:"text-base font-semibold",children:"Enable Full Width Chat"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:o("shortcode.description")}),s.jsx("code",{className:"block bg-white p-2 rounded-md text-sm mt-2",style:{fontSize:"16px"},children:o("shortcode.code")}),s.jsx("p",{className:"text-sm text-muted-foreground italic mt-2",children:o("shortcode.note")})]})]})})]})})}function nl({stats:e,onReset:t}){const{t:n}=Re(),[o,r]=l.useState(!1),i=async()=>{var a,c;if(confirm("Are you sure you want to reset all usage statistics? This action cannot be undone.")){r(!0);try{const d=((a=window.pulseChatAI)==null?void 0:a.restUrl)||"/wp-json/pulse-chat-ai/v1",u=((c=window.pulseChatAI)==null?void 0:c.nonce)||"",f=await fetch(`${d}/usage/reset`,{method:"POST",headers:{"X-WP-Nonce":u}});if(f.ok)(await f.json()).success&&(alert("Usage statistics reset successfully!"),t?t():window.location.reload());else throw new Error("Failed to reset statistics")}catch(d){console.error("Error resetting statistics:",d),alert("Failed to reset statistics. Please try again.")}finally{r(!1)}}};return s.jsxs(oe,{children:[s.jsx(an,{children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(cn,{children:n("usage.title")}),s.jsxs(K,{variant:"outline",size:"sm",onClick:i,disabled:o,children:[s.jsx(zc,{className:"h-4 w-4 mr-2"}),o?"Resetting...":"Reset Stats"]})]})}),s.jsxs(et,{children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[s.jsxs("div",{className:"text-center p-4 bg-white rounded-lg border",children:[s.jsx("div",{className:"text-2xl font-bold text-primary",children:e.messages_today}),s.jsx("div",{className:"text-sm text-muted-foreground",children:n("usage.messagesToday")})]}),s.jsxs("div",{className:"text-center p-4 bg-white rounded-lg border",children:[s.jsx("div",{className:"text-2xl font-bold text-primary",children:e.messages_month}),s.jsx("div",{className:"text-sm text-muted-foreground",children:n("usage.messagesMonth")})]}),s.jsxs("div",{className:"text-center p-4 bg-white rounded-lg border",children:[s.jsx("div",{className:"text-2xl font-bold text-primary",children:e.active_users_today??0}),s.jsx("div",{className:"text-sm text-muted-foreground",children:n("usage.activeUsers")})]})]}),s.jsxs("p",{className:"mt-4 text-sm text-center text-muted-foreground",children:[n("usage.freePlanLimits")," ",s.jsx("a",{href:"https://pulsechatai.com/",target:"_blank",rel:"noopener noreferrer",className:"text-primary font-semibold hover:underline",children:n("usage.upgrade")})]})]})]})}function ol({show:e=!0}){const{t}=Re();return e?s.jsxs(oe,{className:"border-orange-200 bg-orange-50/50",children:[s.jsxs(an,{children:[s.jsx(cn,{className:"text-lg",children:"Unlock Pro Features"}),s.jsx(Jn,{children:"Get access to advanced models and powerful features"})]}),s.jsxs(et,{className:"space-y-4",children:[s.jsxs("ul",{className:"list-disc list-inside space-y-2 text-sm text-muted-foreground",children:[s.jsx("li",{children:"GPT-5 Mini and GPT-5 models for faster, smarter responses"}),s.jsx("li",{children:"Advanced branding and customization options"}),s.jsx("li",{children:"Training with your own documents (RAG)"}),s.jsx("li",{children:"Save and analyze conversations"}),s.jsx("li",{children:"Advanced analytics and insights"}),s.jsx("li",{children:"Webhooks and integrations"})]}),s.jsx(K,{asChild:!0,className:"w-full",variant:"default",children:s.jsx("a",{href:"https://pulsechatai.com/",target:"_blank",rel:"noopener noreferrer",children:t("settings.upgradeToPro")})})]})]}):null}function rl({branding:e,onChange:t}){const{t:n}=Re(),o=r=>{t({...e,...r})};return s.jsxs("div",{className:"space-y-5",children:[s.jsxs("div",{className:"bg-muted p-5 rounded-md border space-y-5",children:[s.jsx("h2",{className:"text-lg font-semibold",children:n("branding.description","Customize colors, avatar, and appearance of your chat widgets")}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(H,{htmlFor:"avatar_url",children:n("branding.avatar","AI Assistant Avatar")}),s.jsxs("div",{className:"flex items-center gap-4",children:[e.avatar_url?s.jsxs("div",{className:"relative",children:[s.jsx("img",{src:e.avatar_url,alt:"Avatar",className:"h-16 w-16 rounded-full object-cover border-2 border-border"}),s.jsx(K,{type:"button",variant:"ghost",size:"icon",className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>o({avatar_url:""}),children:s.jsx(ss,{className:"h-4 w-4"})})]}):s.jsx("div",{className:"h-16 w-16 rounded-full bg-white border-2 border-border flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-muted-foreground",children:n("branding.avatarPlaceholder","Default")})}),s.jsx(K,{type:"button",variant:"outline",onClick:()=>{var r;if(typeof window<"u"&&((r=window.wp)!=null&&r.media)){const i=window.wp.media({title:n("branding.selectAvatar","Select Avatar Image"),button:{text:n("branding.useThisImage","Use this image")},multiple:!1,library:{type:"image"}});i.on("select",()=>{const a=i.state().get("selection").first().toJSON();a.url&&o({avatar_url:a.url})}),i.open()}else{const i=document.createElement("input");i.type="file",i.accept="image/png,image/svg+xml,image/jpeg",i.onchange=a=>{var d;const c=(d=a.target.files)==null?void 0:d[0];if(c){const u=new FileReader;u.onload=f=>{var h;const m=(h=f.target)==null?void 0:h.result;m&&o({avatar_url:m})},u.readAsDataURL(c)}},i.click()}},children:e.avatar_url?n("branding.changeAvatar","Change Avatar"):n("branding.uploadAvatar","Upload Avatar")})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:n("branding.avatarDescription","Upload a custom avatar for the AI assistant. Recommended: Square image (PNG or SVG), max 500KB. Default robot icon will be used if not set.")})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(H,{htmlFor:"theme",children:n("branding.theme","Theme")}),s.jsxs(Ze,{value:e.theme||"light",onValueChange:r=>o({theme:r}),children:[s.jsx(Le,{id:"theme",children:s.jsx(Je,{})}),s.jsxs(Fe,{children:[s.jsx(Q,{value:"light",children:n("branding.themeLight","Light")}),s.jsx(Q,{value:"dark",children:n("branding.themeDark","Dark")})]})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:n("branding.themeDescription","Choose a base theme for your chat widgets")})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(H,{htmlFor:"accent_color",children:n("branding.accentColor","Accent Color")}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ae,{id:"accent_color",type:"color",value:e.accent_color||"#155dfc",onChange:r=>o({accent_color:r.target.value}),className:"w-20 h-10"}),s.jsx(ae,{type:"text",value:e.accent_color||"#155dfc",onChange:r=>o({accent_color:r.target.value}),placeholder:"#155dfc",className:"bg-white",style:{backgroundColor:"#ffffff"}})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:n("branding.accentColorDescription","Customize buttons, links, and highlights")})]})]})]}),s.jsxs("div",{className:"bg-muted p-5 rounded-md border space-y-4",children:[s.jsx("h2",{className:"text-lg font-semibold",children:n("branding.floatingChat","Floating Chat")}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(H,{children:n("branding.bubblePosition","Bubble Position")}),s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsx(K,{type:"button",variant:(e.bubble_position||"bottom-right")==="bottom-left"?"default":"outline",className:"w-full",onClick:()=>o({bubble_position:"bottom-left"}),children:n("branding.positionBottomLeft","Bottom Left")}),s.jsx(K,{type:"button",variant:(e.bubble_position||"bottom-right")==="bottom-right"?"default":"outline",className:"w-full",onClick:()=>o({bubble_position:"bottom-right"}),children:n("branding.positionBottomRight","Bottom Right")})]})]})]}),s.jsxs("div",{className:"bg-muted p-5 rounded-md border space-y-4",children:[s.jsx("h2",{className:"text-lg font-semibold",children:n("branding.shortcodeChat","Shortcode / Full-Screen Chat")}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(H,{children:n("branding.fullscreenEnabled","Enable Full-Screen Mode")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:n("branding.fullscreenEnabledDescription","Allow shortcode to display in full-screen mode")}),s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsx(K,{type:"button",variant:e.fullscreen_enabled?"outline":"default",className:"w-full",onClick:()=>o({fullscreen_enabled:!1}),children:n("branding.disabled","Disabled")}),s.jsx(K,{type:"button",variant:e.fullscreen_enabled?"default":"outline",className:"w-full",onClick:()=>o({fullscreen_enabled:!0}),children:n("branding.enabled","Enabled")})]})]})]})]})}function sl({branding:e,onSave:t}){const[n,o]=l.useState(e||{});return l.useEffect(()=>{o(e||{})},[e]),l.useEffect(()=>{t(n)},[n,t]),s.jsx(oe,{className:"bg-white p-6 space-y-5",children:s.jsx(rl,{branding:n,onChange:r=>o(r)})})}function il({options:e,onChange:t}){const[n,o]=l.useState(e);return l.useEffect(()=>{o(e)},[e]),s.jsxs("div",{className:"space-y-6",children:[!n.pro_enabled&&s.jsx(ol,{}),n.pro_enabled&&s.jsx(sl,{branding:n.branding,onSave:r=>{const i={...n,branding:r};o(i),t(i)}})]})}var Ht="rovingFocusGroup.onEntryFocus",al={bubbles:!1,cancelable:!0},it="RovingFocusGroup",[on,Dr,cl]=no(it),[ll,Mr]=Ve(it,[cl]),[dl,ul]=ll(it),Or=l.forwardRef((e,t)=>s.jsx(on.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(on.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(fl,{...e,ref:t})})}));Or.displayName=it;var fl=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...m}=e,h=l.useRef(null),x=q(t,h),w=ln(i),[p,g]=ot({prop:a,defaultProp:c??null,onChange:d,caller:it}),[b,v]=l.useState(!1),y=xe(u),C=Dr(n),N=l.useRef(!1),[j,S]=l.useState(0);return l.useEffect(()=>{const E=h.current;if(E)return E.addEventListener(Ht,y),()=>E.removeEventListener(Ht,y)},[y]),s.jsx(dl,{scope:n,orientation:o,dir:w,loop:r,currentTabStopId:p,onItemFocus:l.useCallback(E=>g(E),[g]),onItemShiftTab:l.useCallback(()=>v(!0),[]),onFocusableItemAdd:l.useCallback(()=>S(E=>E+1),[]),onFocusableItemRemove:l.useCallback(()=>S(E=>E-1),[]),children:s.jsx(F.div,{tabIndex:b||j===0?-1:0,"data-orientation":o,...m,ref:x,style:{outline:"none",...e.style},onMouseDown:L(e.onMouseDown,()=>{N.current=!0}),onFocus:L(e.onFocus,E=>{const P=!N.current;if(E.target===E.currentTarget&&P&&!b){const A=new CustomEvent(Ht,al);if(E.currentTarget.dispatchEvent(A),!A.defaultPrevented){const R=C().filter(k=>k.focusable),D=R.find(k=>k.active),I=R.find(k=>k.id===p),U=[D,I,...R].filter(Boolean).map(k=>k.ref.current);Br(U,f)}}N.current=!1}),onBlur:L(e.onBlur,()=>v(!1))})})}),Lr="RovingFocusGroupItem",Fr=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:i,children:a,...c}=e,d=rt(),u=i||d,f=ul(Lr,n),m=f.currentTabStopId===u,h=Dr(n),{onFocusableItemAdd:x,onFocusableItemRemove:w,currentTabStopId:p}=f;return l.useEffect(()=>{if(o)return x(),()=>w()},[o,x,w]),s.jsx(on.ItemSlot,{scope:n,id:u,focusable:o,active:r,children:s.jsx(F.span,{tabIndex:m?0:-1,"data-orientation":f.orientation,...c,ref:t,onMouseDown:L(e.onMouseDown,g=>{o?f.onItemFocus(u):g.preventDefault()}),onFocus:L(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:L(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){f.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const b=hl(g,f.orientation,f.dir);if(b!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let y=h().filter(C=>C.focusable).map(C=>C.ref.current);if(b==="last")y.reverse();else if(b==="prev"||b==="next"){b==="prev"&&y.reverse();const C=y.indexOf(g.currentTarget);y=f.loop?gl(y,C+1):y.slice(C+1)}setTimeout(()=>Br(y))}}),children:typeof a=="function"?a({isCurrentTabStop:m,hasTabStop:p!=null}):a})})});Fr.displayName=Lr;var ml={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function pl(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function hl(e,t,n){const o=pl(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return ml[o]}function Br(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function gl(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var vl=Or,xl=Fr;function yl(e,t){return l.useReducer((n,o)=>t[n][o]??n,e)}var Vr=e=>{const{present:t,children:n}=e,o=bl(t),r=typeof n=="function"?n({present:o.isPresent}):l.Children.only(n),i=q(o.ref,wl(r));return typeof n=="function"||o.isPresent?l.cloneElement(r,{ref:i}):null};Vr.displayName="Presence";function bl(e){const[t,n]=l.useState(),o=l.useRef(null),r=l.useRef(e),i=l.useRef("none"),a=e?"mounted":"unmounted",[c,d]=yl(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return l.useEffect(()=>{const u=mt(o.current);i.current=c==="mounted"?u:"none"},[c]),Y(()=>{const u=o.current,f=r.current;if(f!==e){const h=i.current,x=mt(u);e?d("MOUNT"):x==="none"||(u==null?void 0:u.display)==="none"?d("UNMOUNT"):d(f&&h!==x?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,d]),Y(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,m=x=>{const p=mt(o.current).includes(CSS.escape(x.animationName));if(x.target===t&&p&&(d("ANIMATION_END"),!r.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},h=x=>{x.target===t&&(i.current=mt(o.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:l.useCallback(u=>{o.current=u?getComputedStyle(u):null,n(u)},[])}}function mt(e){return(e==null?void 0:e.animationName)||"none"}function wl(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var It="Tabs",[Sl]=Ve(It,[Mr]),$r=Mr(),[Cl,yn]=Sl(It),Ur=l.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:r,defaultValue:i,orientation:a="horizontal",dir:c,activationMode:d="automatic",...u}=e,f=ln(c),[m,h]=ot({prop:o,onChange:r,defaultProp:i??"",caller:It});return s.jsx(Cl,{scope:n,baseId:rt(),value:m,onValueChange:h,orientation:a,dir:f,activationMode:d,children:s.jsx(F.div,{dir:f,"data-orientation":a,...u,ref:t})})});Ur.displayName=It;var Xr="TabsList",Wr=l.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...r}=e,i=yn(Xr,n),a=$r(n);return s.jsx(vl,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:o,children:s.jsx(F.div,{role:"tablist","aria-orientation":i.orientation,...r,ref:t})})});Wr.displayName=Xr;var Hr="TabsTrigger",zr=l.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:r=!1,...i}=e,a=yn(Hr,n),c=$r(n),d=Kr(a.baseId,o),u=Yr(a.baseId,o),f=o===a.value;return s.jsx(xl,{asChild:!0,...c,focusable:!r,active:f,children:s.jsx(F.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":u,"data-state":f?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:d,...i,ref:t,onMouseDown:L(e.onMouseDown,m=>{!r&&m.button===0&&m.ctrlKey===!1?a.onValueChange(o):m.preventDefault()}),onKeyDown:L(e.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&a.onValueChange(o)}),onFocus:L(e.onFocus,()=>{const m=a.activationMode!=="manual";!f&&!r&&m&&a.onValueChange(o)})})})});zr.displayName=Hr;var qr="TabsContent",Gr=l.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:r,children:i,...a}=e,c=yn(qr,n),d=Kr(c.baseId,o),u=Yr(c.baseId,o),f=o===c.value,m=l.useRef(f);return l.useEffect(()=>{const h=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(h)},[]),s.jsx(Vr,{present:r||f,children:({present:h})=>s.jsx(F.div,{"data-state":f?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!h,id:u,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:m.current?"0s":void 0},children:h&&i})})});Gr.displayName=qr;function Kr(e,t){return`${e}-trigger-${t}`}function Yr(e,t){return`${e}-content-${t}`}var Nl=Ur,Qr=Wr,Zr=zr,Jr=Gr;const El=Nl,es=l.forwardRef(({className:e,...t},n)=>s.jsx(Qr,{ref:n,className:z("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));es.displayName=Qr.displayName;const Ye=l.forwardRef(({className:e,...t},n)=>s.jsx(Zr,{ref:n,className:z("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Ye.displayName=Zr.displayName;const Qe=l.forwardRef(({className:e,...t},n)=>s.jsx(Jr,{ref:n,className:z("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Qe.displayName=Jr.displayName;function jl({options:e,usage:t}){const{t:n}=Re(),[o,r]=l.useState(e),[i,a]=l.useState(!1),[c,d]=l.useState(null),u=async()=>{var f;a(!0),d(null);try{const m=await sn(o);m.success?(d(n("settings.saved","Settings saved successfully")),setTimeout(()=>d(null),3e3)):d(((f=m.data)==null?void 0:f.message)||"Error saving settings")}catch(m){d(m instanceof Error?m.message:"Error saving settings")}finally{a(!1)}};return s.jsxs("div",{className:"p-6 space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h1",{className:"text-3xl font-medium",children:"Pulse Chat AI Settings"}),s.jsxs("div",{className:"flex items-center gap-4",children:[c&&s.jsx("span",{className:`text-sm ${c.includes("Error")?"text-red-600":"text-green-600"}`,children:c}),s.jsx(K,{onClick:u,disabled:i,children:i?n("settings.saving","Saving..."):n("settings.save","Save Changes")})]})]}),s.jsxs(El,{defaultValue:"main",className:"w-full",children:[s.jsxs(es,{className:"grid w-full grid-cols-4",children:[s.jsx(Ye,{value:"main",children:"Settings"}),s.jsx(Ye,{value:"system",children:"System Prompt"}),s.jsx(Ye,{value:"usage",children:"Usage Statistics"}),s.jsx(Ye,{value:"pro",children:"Pulse Chat Pro"})]}),s.jsx(Qe,{value:"main",className:"mt-6",children:s.jsx(Yn,{initialOptions:o,onChange:r})}),s.jsx(Qe,{value:"system",className:"mt-6",children:s.jsx(Yn,{initialOptions:o,onChange:r,showOnlySystemPrompt:!0})}),s.jsx(Qe,{value:"usage",className:"mt-6",children:s.jsx(nl,{stats:t})}),s.jsx(Qe,{value:"pro",className:"mt-6",children:s.jsx(il,{options:o,onChange:f=>{r(f)}})})]})]})}function Pl({proEnabled:e,conversationsEnabled:t,onToggleConversations:n}){const{t:o}=Re(),[r,i]=l.useState([]),[a,c]=l.useState(!0),[d,u]=l.useState(null),[f,m]=l.useState("all"),[h,x]=l.useState("all"),[w,p]=l.useState("all"),[g,b]=l.useState(!1);l.useEffect(()=>{const E=new URLSearchParams(window.location.search).get("conversation_id");E&&e&&t&&v().then(()=>{const P=r.find(A=>A.id===parseInt(E));P&&u(P)})},[]),l.useEffect(()=>{e&&t&&!d&&v()},[e,t,f,h,w]),l.useEffect(()=>{const S=()=>{const P=new URLSearchParams(window.location.search).get("conversation_id");if(P){const A=r.find(R=>R.id===parseInt(P));u(A||null)}else u(null)};return window.addEventListener("popstate",S),()=>window.removeEventListener("popstate",S)},[r]);const v=async()=>{var S,E;c(!0);try{const P=((S=window.pulseChatAI)==null?void 0:S.restUrl)||"/wp-json/pulse-chat-ai/v1",A=((E=window.pulseChatAI)==null?void 0:E.nonce)||"",R=new URLSearchParams;f!=="all"&&R.append("date",f),h!=="all"&&R.append("page",h),w!=="all"&&R.append("model",w);const D=await fetch(`${P}/conversations?${R.toString()}`,{headers:{"X-WP-Nonce":A}});if(D.ok){const I=await D.json();i(I.conversations||[])}else i([])}catch(P){console.error("Error loading conversations:",P),i([])}finally{c(!1)}},y=async S=>{var E,P;if(confirm(o("conversations.deleteConfirm")))try{const A=((E=window.pulseChatAI)==null?void 0:E.restUrl)||"/wp-json/pulse-chat-ai/v1",R=((P=window.pulseChatAI)==null?void 0:P.nonce)||"";(await fetch(`${A}/conversations/${S}`,{method:"DELETE",headers:{"X-WP-Nonce":R}})).ok&&(i(r.filter(I=>I.id!==S)),(d==null?void 0:d.id)===S&&u(null))}catch(A){console.error("Error deleting conversation:",A)}},C=S=>{const E=JSON.stringify(S,null,2),P=new Blob([E],{type:"application/json"}),A=URL.createObjectURL(P),R=document.createElement("a");R.href=A,R.download=`conversation-${S.id}.json`,R.click(),URL.revokeObjectURL(A)},N=S=>{const E=S.messages.map(I=>({role:I.role,content:I.content.replace(/"/g,'""'),timestamp:I.timestamp?new Date(I.timestamp*1e3).toISOString():""})),P=[["Role","Content","Timestamp"].join(","),...E.map(I=>`"${I.role}","${I.content}","${I.timestamp}"`)].join(`
     82`),A=new Blob([P],{type:"text/csv"}),R=URL.createObjectURL(A),D=document.createElement("a");D.href=R,D.download=`conversation-${S.id}.csv`,D.click(),URL.revokeObjectURL(R)};if(!e)return s.jsx(oe,{children:s.jsx(et,{children:s.jsxs("p",{className:"text-sm text-muted-foreground",children:[o("conversations.enableConversationsDescription")," ",o("settings.upgradeToPro"),":"," ",s.jsx("a",{href:"https://pulsechatai.com/",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"pulsechatai.com"})]})})});const j=async S=>{b(!0);try{await n(S)}catch(E){console.error("Error toggling conversations:",E)}finally{b(!1)}};return d?s.jsxs("div",{className:"space-y-6",children:[s.jsxs(K,{variant:"outline",onClick:()=>{const S=new URL(window.location.href);S.searchParams.delete("conversation_id"),window.history.pushState({},"",S.toString()),u(null)},className:"mb-4",children:[s.jsx(Uc,{className:"h-4 w-4 mr-2"}),o("conversations.backToList","Back to Conversations")]}),s.jsx(oe,{children:s.jsxs(et,{className:"space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 p-4 bg-muted rounded-lg",children:[d.page_id&&s.jsxs("div",{children:[s.jsxs("span",{className:"font-semibold",children:[o("conversations.page"),":"]})," ",d.page_id]}),d.model&&s.jsxs("div",{children:[s.jsxs("span",{className:"font-semibold",children:[o("conversations.model"),":"]})," ",d.model]}),d.start_time&&s.jsxs("div",{children:[s.jsxs("span",{className:"font-semibold",children:[o("conversations.startTime"),":"]})," ",new Date(d.start_time*1e3).toLocaleString()]}),d.end_time&&s.jsxs("div",{children:[s.jsxs("span",{className:"font-semibold",children:[o("conversations.endTime"),":"]})," ",new Date(d.end_time*1e3).toLocaleString()]})]}),s.jsx("div",{className:"space-y-4 border-t pt-4",children:d.messages.map((S,E)=>s.jsx(is,{from:S.role,children:S.role==="user"?s.jsxs(s.Fragment,{children:[s.jsx(bn,{className:"bg-primary/20 text-foreground",children:s.jsx(wn,{children:S.content})}),s.jsx(Sn,{from:"user"})]}):s.jsxs(s.Fragment,{children:[s.jsx(Sn,{from:"assistant"}),s.jsx(bn,{className:"bg-muted text-foreground border",children:s.jsx(wn,{children:S.content})})]})},E))})]})})]}):s.jsxs(s.Fragment,{children:[s.jsx(oe,{children:s.jsxs("div",{className:"flex items-center justify-between bg-white p-4 rounded-md border",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(H,{htmlFor:"conversations_enabled",children:o("conversations.enableConversations","Save Conversations")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:o("conversations.enableConversationsDescription","Automatically save all chat conversations for review and analysis")})]}),s.jsx(De,{id:"conversations_enabled",checked:t,onCheckedChange:j,disabled:g}),g&&s.jsx("span",{className:"text-sm text-muted-foreground ml-2",children:"Saving..."})]})}),t&&s.jsxs(oe,{children:[s.jsxs("div",{className:"p-6 grid grid-cols-1 md:grid-cols-3 gap-4 mb-6",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium",children:o("conversations.filterByDate")}),s.jsxs(Ze,{value:f,onValueChange:m,children:[s.jsx(Le,{children:s.jsx(Je,{})}),s.jsxs(Fe,{children:[s.jsx(Q,{value:"all",children:o("conversations.allDates")}),s.jsx(Q,{value:"today",children:"Today"}),s.jsx(Q,{value:"week",children:"This Week"}),s.jsx(Q,{value:"month",children:"This Month"})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium",children:o("conversations.filterByPage")}),s.jsxs(Ze,{value:h,onValueChange:x,children:[s.jsx(Le,{children:s.jsx(Je,{})}),s.jsx(Fe,{children:s.jsx(Q,{value:"all",children:o("conversations.allPages")})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium",children:o("conversations.filterByModel")}),s.jsxs(Ze,{value:w,onValueChange:p,children:[s.jsx(Le,{children:s.jsx(Je,{})}),s.jsxs(Fe,{children:[s.jsx(Q,{value:"all",children:o("conversations.allModels")}),s.jsx(Q,{value:"gpt-5-nano",children:"GPT-5 nano"}),s.jsx(Q,{value:"gpt-5-mini",children:"GPT-5 mini"}),s.jsx(Q,{value:"gpt-5",children:"GPT-5"})]})]})]})]}),s.jsx("div",{className:"p-6 pt-0",children:a?s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"Loading..."}):r.length===0?s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:o("conversations.noConversations")}):s.jsx("div",{className:"space-y-2",children:r.map(S=>s.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg bg-white hover:bg-muted/50",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("h3",{className:"font-semibold",children:S.title}),s.jsxs("div",{className:"text-sm text-muted-foreground mt-1",children:[S.messages.length," ",o("conversations.messageCount")," •"," ",S.model||"N/A"," • ",new Date(S.created_at).toLocaleString()]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(K,{variant:"outline",size:"sm",onClick:()=>{const E=new URL(window.location.href);E.searchParams.set("conversation_id",S.id.toString()),window.history.pushState({},"",E.toString()),u(S)},children:[s.jsx(Hc,{className:"h-4 w-4 mr-2"}),o("conversations.viewConversation")]}),s.jsxs(K,{variant:"outline",size:"sm",onClick:()=>C(S),children:[s.jsx(Kn,{className:"h-4 w-4 mr-2"}),"JSON"]}),s.jsxs(K,{variant:"outline",size:"sm",onClick:()=>N(S),children:[s.jsx(Kn,{className:"h-4 w-4 mr-2"}),"CSV"]}),s.jsx(K,{variant:"outline",size:"sm",onClick:()=>y(S.id),children:s.jsx(qc,{className:"h-4 w-4"})})]})]},S.id))})})]})]})}function Al({options:e}){const t=async n=>{const o={...e,conversations_enabled:n};try{await sn(o),window.location.reload()}catch(r){console.error("Error saving conversations setting:",r),alert("Error saving setting. Please try again.")}};return s.jsxs("div",{className:"p-6 space-y-6",children:[s.jsx("h1",{className:"text-3xl font-medium",children:"Conversations"}),s.jsx(Pl,{proEnabled:e.pro_enabled||!1,conversationsEnabled:e.conversations_enabled||!1,onToggleConversations:t})]})}function Rl({options:e,onChange:t}){const{t:n}=Re(),[o,r]=l.useState(e.license_key||""),[i,a]=l.useState(null),[c,d]=l.useState(!1),[u,f]=l.useState(!1),[m,h]=l.useState(null);l.useEffect(()=>{x()},[]);const x=async()=>{d(!0);try{const v=await as();r(v.license_key||""),a(v.license_data||null)}catch(v){console.error("Error loading license status:",v)}finally{d(!1)}},w=async()=>{var v;if(!o.trim()){h({type:"error",text:n("settings.licenseNoLicense","No active license. Please enter your license key.")});return}f(!0),h(null);try{const y={...e,license_key:o.trim()};await sn(y);const C=await Cn(o.trim());if(a(C),C.valid){h({type:"success",text:n("settings.licenseValidated","License validated successfully")+` (Plan: ${((v=C.plan)==null?void 0:v.toUpperCase())||"N/A"})`});const N={...y,pro_enabled:!0};r(N.license_key||""),t==null||t(N),setTimeout(()=>{window.location.reload()},1500)}else{const N=g(C.reason||"unknown");h({type:"error",text:N});const j={...y,pro_enabled:!1};t==null||t(j)}}catch(y){console.error("Error saving license:",y),h({type:"error",text:y instanceof Error?y.message:n("settings.licenseConnectionError","Connection error. Please check your internet connection.")})}finally{f(!1)}},p=async()=>{var v;if(!o.trim()){h({type:"error",text:n("settings.licenseNoLicense","No active license. Please enter your license key.")});return}f(!0),h(null);try{const y=await Cn(o.trim());if(a(y),y.valid)h({type:"success",text:n("settings.licenseValidated","License validated successfully")+` (Plan: ${((v=y.plan)==null?void 0:v.toUpperCase())||"N/A"})`});else{const C=g(y.reason||"unknown");h({type:"error",text:C})}}catch(y){console.error("Error validating license:",y),h({type:"error",text:y instanceof Error?y.message:n("settings.licenseConnectionError","Connection error. Please check your internet connection.")})}finally{f(!1)}},g=v=>({no_license:n("settings.licenseNoLicense","No active license. Please enter your license key."),not_found:n("settings.licenseNotFound","License not found. Please verify that the key is correct."),expired:n("settings.licenseExpired","Your license has expired. Please renew your subscription."),disabled:n("settings.licenseDisabled","Your license is disabled. Please contact support."),domain_mismatch:n("settings.licenseDomainMismatch","This license is not valid for this domain."),product_mismatch:n("settings.licenseProductMismatch","This license is not for this product."),connection_error:n("settings.licenseConnectionError","Connection error. Please check your internet connection."),server_error:n("settings.licenseServerError","Server error. Please try again later.")})[v]||n("settings.licenseServerError","Server error. Please try again later."),b=v=>{if(!v)return"N/A";try{return new Date(v).toLocaleDateString()}catch{return v}};return s.jsx("div",{className:"wrap",children:s.jsxs("div",{className:"p-6 space-y-6",children:[s.jsx("h1",{className:"text-3xl font-medium",children:"License"}),s.jsxs(oe,{className:"bg-white p-6 space-y-6",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(H,{htmlFor:"license_key",children:n("settings.licenseKey","License Key")}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ae,{id:"license_key",type:"text",value:o,onChange:v=>r(v.target.value),placeholder:n("settings.licenseKeyPlaceholder","XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX"),className:"flex-1",disabled:u||c}),s.jsx(K,{onClick:w,disabled:u||c,children:u?n("settings.licenseValidating","Validating..."):n("settings.saveLicense","Save License")}),s.jsx(K,{variant:"outline",onClick:p,disabled:u||c||!o.trim(),children:n("settings.validateLicense","Validate")})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:n("settings.licenseKeyDescription","Enter your license key to activate Pro features. You can find your license key in your account after purchase.")})]}),m&&s.jsx("div",{className:`p-4 rounded-md ${m.type==="success"?"bg-green-50 text-green-800 border border-green-200":"bg-red-50 text-red-800 border border-red-200"}`,children:m.text}),i&&s.jsxs("div",{className:"space-y-4 pt-4 border-t",children:[s.jsx("h3",{className:"text-lg font-semibold",children:n("settings.licenseStatus","License Status")}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx(H,{className:"text-sm font-medium text-muted-foreground",children:n("settings.licenseValid","Status")}),s.jsx("div",{className:"mt-1",children:i.valid?s.jsxs("span",{className:"text-green-600 font-medium",children:["✓ ",n("settings.licenseValid","Valid")]}):s.jsxs("span",{className:"text-red-600 font-medium",children:["✗ ",n("settings.licenseInvalid","Invalid")]})})]}),i.plan&&s.jsxs("div",{children:[s.jsx(H,{className:"text-sm font-medium text-muted-foreground",children:n("settings.licensePlan","Plan")}),s.jsx("div",{className:"mt-1 font-medium",children:i.plan.toUpperCase()})]}),i.expires_at&&s.jsxs("div",{children:[s.jsx(H,{className:"text-sm font-medium text-muted-foreground",children:n("settings.licenseExpires","Expires")}),s.jsx("div",{className:"mt-1",children:b(i.expires_at)})]}),i.registered_domain&&s.jsxs("div",{children:[s.jsx(H,{className:"text-sm font-medium text-muted-foreground",children:n("settings.licenseDomain","Registered Domain")}),s.jsx("div",{className:"mt-1",children:i.registered_domain})]})]})]}),c&&s.jsx("div",{className:"text-center py-4 text-muted-foreground",children:n("settings.licenseValidating","Loading license status...")})]})]})})}const Tl={title:"Pulse Chat AI Settings",mainSettings:"Main Settings",description:"Configure AI chat parameters. The plugin connects to a secure API endpoint.",model:"Model",modelDescription:"Select the OpenAI model that best fits your use case. Upgrade to Pro for access to GPT-5 and GPT-5 mini.",welcomeText:"Welcome Text (Floating Chat)",welcomeTextDescription:"Text displayed in the floating chat welcome message.",systemPrompt:"System Prompt",systemPromptDescription:"Initial instructions for the assistant behavior. Note: Responses are limited to ~10 lines to optimize token usage.",chatHeight:"Chat Height",chatHeightDescription:"Chat container height (e.g.: 50vh, 100dvh, 500px).",placeholder:"Placeholder Text",placeholderDescription:"Text that appears in the input field when empty.",floatingChat:"Enable Floating Chat",floatingChatDescription:"Show floating chat bubble on all pages",proEnabled:"Enable Pro Features",proEnabledDescription:"Unlock GPT-5 Mini and GPT-5 models, plus advanced features",upgradeToPro:"Upgrade to Pro",licenseKey:"License Key",licenseKeyDescription:"Enter your license key to activate Pro features. You can find your license key in your account after purchase.",licenseKeyPlaceholder:"XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX",saveLicense:"Save License",validateLicense:"Validate License",licenseStatus:"License Status",licenseValid:"Valid",licenseInvalid:"Invalid",licensePlan:"Plan",licenseExpires:"Expires",licenseDomain:"Registered Domain",licenseNoLicense:"No active license. Please enter your license key.",licenseNotFound:"License not found. Please verify that the key is correct.",licenseExpired:"Your license has expired. Please renew your subscription.",licenseDisabled:"Your license is disabled. Please contact support.",licenseDomainMismatch:"This license is not valid for this domain.",licenseProductMismatch:"This license is not for this product.",licenseConnectionError:"Connection error. Please check your internet connection.",licenseServerError:"Server error. Please try again later.",licenseValidating:"Validating license...",licenseValidated:"License validated successfully",proBadge:"Pro",quickQuestion1:"Quick Question 1",quickQuestion1Description:"First quick question button that users can click.",quickQuestion2:"Quick Question 2",quickQuestion2Description:"Second quick question button that users can click.",quickQuestion3:"Quick Question 3",quickQuestion3Description:"Third quick question button that users can click.",save:"Save Changes",saving:"Saving...",saved:"Settings saved successfully"},_l={title:"Usage Statistics",messagesToday:"Messages Today",messagesMonth:"Messages This Month",activeUsers:"Active Users Today",freePlanLimits:"Free plan limits: 40 messages/day per site, 100 messages/month per site",upgrade:"Upgrade for unlimited access"},Il={title:"Conversations",description:"View and manage saved chat conversations",enableConversations:"Save Conversations",enableConversationsDescription:"Automatically save all chat conversations for review and analysis",noConversations:"No conversations found",viewConversation:"View Conversation",export:"Export",exportJson:"Export as JSON",exportCsv:"Export as CSV",filterByDate:"Filter by Date",filterByPage:"Filter by Page",filterByModel:"Filter by Model",allDates:"All Dates",allPages:"All Pages",allModels:"All Models",conversationDetails:"Conversation Details",page:"Page",model:"Model",startTime:"Start Time",endTime:"End Time",messageCount:"Messages",close:"Close",delete:"Delete",deleteConfirm:"Are you sure you want to delete this conversation?",deleted:"Conversation deleted successfully"},kl={title:"Shortcode Usage",description:"Use this shortcode to display the chat on any page, post, or widget:",code:"[pulse_chat_ai]",note:"All chat parameters are configured below. The shortcode does not accept additional parameters."},Dl={title:"Branding & UI",description:"Customize colors, avatar, and appearance of your chat widgets",floatingChat:"Floating Chat",shortcodeChat:"Shortcode / Full-Screen Chat",theme:"Theme",themeLight:"Light",themeDark:"Dark",themeDescription:"Choose a base theme for your chat widgets",disabled:"Disabled",enabled:"Enabled",accentColor:"Accent Color",accentColorDescription:"Customize buttons, links, and highlights",colors:"Colors",avatar:"AI Assistant Avatar",avatarPlaceholder:"Default",selectAvatar:"Select Avatar Image",useThisImage:"Use this image",changeAvatar:"Change Avatar",uploadAvatar:"Upload Avatar",avatarDescription:"Upload a custom avatar for the AI assistant. Recommended: Square image (PNG or SVG), max 500KB. Default robot icon will be used if not set.",avatarSizeError:"Image size must be less than 500KB",position:"Position",advanced:"Advanced",colorBackground:"Background Color",colorAccent:"Accent Color",colorBubble:"Bubble Color",colorButton:"Button Color",colorUserMessage:"User Message Color",colorAssistantMessage:"Assistant Message Color",avatarEnabled:"Enable Custom Avatar",avatarEnabledDescription:"Upload a custom avatar/logo for the chat assistant",avatarUrl:"Avatar URL",avatarUrlDescription:"Enter the full URL to your avatar image (PNG, JPG, SVG)",bubblePosition:"Bubble Position",positionBottomRight:"Bottom Right",positionBottomLeft:"Bottom Left",positionTopRight:"Top Right",positionTopLeft:"Top Left",offsetX:"Horizontal Offset (px)",offsetY:"Vertical Offset (px)",useThemeFont:"Use Theme Font",useThemeFontDescription:"Use your WordPress theme font instead of default",fontFamily:"Custom Font Family",fontFamilyDescription:'Enter CSS font-family value (e.g., "Arial, sans-serif")',fullscreenEnabled:"Enable Full-Screen Mode",fullscreenEnabledDescription:"Allow shortcode to display in full-screen mode",customCss:"Custom CSS",customCssDescription:"Add custom CSS scoped to the chat widget. Use .pulse-chat-ai-container selector."},Ml={settings:Tl,usage:_l,conversations:Il,shortcode:kl,branding:Dl},Ol={title:"Configuración de Pulse Chat AI",mainSettings:"Configuración Principal",description:"Configura los parámetros del chat de IA. El plugin se conecta a un endpoint de API seguro.",model:"Modelo",modelDescription:"Selecciona el modelo de OpenAI que mejor se adapte a tu caso de uso. Actualiza a Pro para acceder a GPT-5 y GPT-5 mini.",welcomeText:"Texto de Bienvenida (Chat Flotante)",welcomeTextDescription:"Texto mostrado en el mensaje de bienvenida del chat flotante.",systemPrompt:"Prompt del Sistema",systemPromptDescription:"Instrucciones iniciales para el comportamiento del asistente. Nota: Las respuestas están limitadas a ~10 líneas para optimizar el uso de tokens.",chatHeight:"Altura del Chat",chatHeightDescription:"Altura del contenedor del chat (ej.: 50vh, 100dvh, 500px).",placeholder:"Texto de Placeholder",placeholderDescription:"Texto que aparece en el campo de entrada cuando está vacío.",floatingChat:"Habilitar Chat Flotante",floatingChatDescription:"Mostrar burbuja de chat flotante en todas las páginas",proEnabled:"Habilitar Funciones Pro",proEnabledDescription:"Desbloquear modelos GPT-5 Mini y GPT-5, además de funciones avanzadas",upgradeToPro:"Actualizar a Pro",licenseKey:"Clave de Licencia",licenseKeyDescription:"Ingresa tu clave de licencia para activar las funciones Pro. Puedes encontrar tu clave de licencia en tu cuenta después de la compra.",licenseKeyPlaceholder:"XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX",saveLicense:"Guardar Licencia",validateLicense:"Validar Licencia",licenseStatus:"Estado de la Licencia",licenseValid:"Válida",licenseInvalid:"Inválida",licensePlan:"Plan",licenseExpires:"Expira",licenseDomain:"Dominio Registrado",licenseNoLicense:"No hay licencia activa. Por favor, ingresa tu clave de licencia.",licenseNotFound:"Licencia no encontrada. Por favor, verifica que la clave sea correcta.",licenseExpired:"Tu licencia ha expirado. Por favor, renueva tu suscripción.",licenseDisabled:"Tu licencia está desactivada. Contacta con soporte.",licenseDomainMismatch:"Esta licencia no es válida para este dominio.",licenseProductMismatch:"Esta licencia no es para este producto.",licenseConnectionError:"Error de conexión. Verifica tu conexión a internet.",licenseServerError:"Error del servidor. Intenta más tarde.",licenseValidating:"Validando licencia...",licenseValidated:"Licencia validada exitosamente",proBadge:"Pro",quickQuestion1:"Pregunta Rápida 1",quickQuestion1Description:"Primer botón de pregunta rápida que los usuarios pueden hacer clic.",quickQuestion2:"Pregunta Rápida 2",quickQuestion2Description:"Segundo botón de pregunta rápida que los usuarios pueden hacer clic.",quickQuestion3:"Pregunta Rápida 3",quickQuestion3Description:"Tercer botón de pregunta rápida que los usuarios pueden hacer clic.",save:"Guardar Cambios",saving:"Guardando...",saved:"Configuración guardada exitosamente"},Ll={title:"Estadísticas de Uso",messagesToday:"Mensajes Hoy",messagesMonth:"Mensajes Este Mes",activeUsers:"Usuarios Activos Hoy",freePlanLimits:"Límites del plan gratuito: 40 mensajes/día por sitio, 100 mensajes/mes por sitio",upgrade:"Actualizar para acceso ilimitado"},Fl={title:"Conversaciones",description:"Ver y gestionar conversaciones de chat guardadas",enableConversations:"Guardar Conversaciones",enableConversationsDescription:"Guardar automáticamente todas las conversaciones de chat para revisión y análisis",noConversations:"No se encontraron conversaciones",viewConversation:"Ver Conversación",export:"Exportar",exportJson:"Exportar como JSON",exportCsv:"Exportar como CSV",filterByDate:"Filtrar por Fecha",filterByPage:"Filtrar por Página",filterByModel:"Filtrar por Modelo",allDates:"Todas las Fechas",allPages:"Todas las Páginas",allModels:"Todos los Modelos",conversationDetails:"Detalles de la Conversación",page:"Página",model:"Modelo",startTime:"Hora de Inicio",endTime:"Hora de Fin",messageCount:"Mensajes",close:"Cerrar",delete:"Eliminar",deleteConfirm:"¿Estás seguro de que quieres eliminar esta conversación?",deleted:"Conversación eliminada exitosamente"},Bl={title:"Uso del Shortcode",description:"Usa este shortcode para mostrar el chat en cualquier página, entrada o widget:",code:"[pulse_chat_ai]",note:"Todos los parámetros del chat se configuran a continuación. El shortcode no acepta parámetros adicionales."},Vl={title:"Branding e Interfaz",description:"Personaliza colores, avatar y apariencia de tus widgets de chat",floatingChat:"Chat Flotante",shortcodeChat:"Chat Shortcode / Pantalla Completa",theme:"Tema",themeLight:"Claro",themeDark:"Oscuro",themeDescription:"Elige un tema base para tus widgets de chat",disabled:"Deshabilitado",enabled:"Habilitado",accentColor:"Color de Acento",accentColorDescription:"Personaliza botones, enlaces y elementos destacados",colors:"Colores",avatar:"Avatar del Asistente IA",avatarPlaceholder:"Por Defecto",selectAvatar:"Seleccionar Imagen de Avatar",useThisImage:"Usar esta imagen",changeAvatar:"Cambiar Avatar",uploadAvatar:"Subir Avatar",avatarDescription:"Sube un avatar personalizado para el asistente de IA. Recomendado: Imagen cuadrada (PNG o SVG), máximo 500KB. Se usará el icono de robot por defecto si no se establece.",avatarSizeError:"El tamaño de la imagen debe ser menor a 500KB",position:"Posición",advanced:"Avanzado",colorBackground:"Color de Fondo",colorAccent:"Color de Acento",colorBubble:"Color de Burbuja",colorButton:"Color de Botón",colorUserMessage:"Color de Mensaje de Usuario",colorAssistantMessage:"Color de Mensaje de Asistente",avatarEnabled:"Habilitar Avatar Personalizado",avatarEnabledDescription:"Sube un avatar/logo personalizado para el asistente de chat",avatarUrl:"URL del Avatar",avatarUrlDescription:"Ingresa la URL completa de tu imagen de avatar (PNG, JPG, SVG)",bubblePosition:"Posición de la Burbuja",positionBottomRight:"Inferior Derecha",positionBottomLeft:"Inferior Izquierda",positionTopRight:"Superior Derecha",positionTopLeft:"Superior Izquierda",offsetX:"Desplazamiento Horizontal (px)",offsetY:"Desplazamiento Vertical (px)",useThemeFont:"Usar Fuente del Tema",useThemeFontDescription:"Usa la fuente de tu tema de WordPress en lugar de la predeterminada",fontFamily:"Familia de Fuente Personalizada",fontFamilyDescription:'Ingresa el valor CSS de font-family (ej.: "Arial, sans-serif")',fullscreenEnabled:"Habilitar Modo Pantalla Completa",fullscreenEnabledDescription:"Permitir que el shortcode se muestre en modo pantalla completa",customCss:"CSS Personalizado",customCssDescription:"Agrega CSS personalizado para el widget de chat. Usa el selector .pulse-chat-ai-container."},$l={settings:Ol,usage:Ll,conversations:Fl,shortcode:Bl,branding:Vl},Ul=()=>{var t;if(typeof window<"u"&&((t=window.pulseChatAI)!=null&&t.locale))return window.pulseChatAI.locale;const e=navigator.language.split("-")[0];return["en","es"].includes(e)?e:"en"};cs.use(ls).init({resources:{en:{translation:Ml},es:{translation:$l}},lng:Ul(),fallbackLng:"en",interpolation:{escapeValue:!1}});const zt=()=>{const e=window.pulseChatAI;return{options:(e==null?void 0:e.options)||{},usage:(e==null?void 0:e.usage)||{messages_today:0,messages_month:0,active_users_today:0},currentPage:(e==null?void 0:e.currentPage)||""}};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Qn):Qn();function Qn(){console.log("Pulse Chat AI: Initializing React apps..."),console.log("Pulse Chat AI: window.pulseChatAI =",window.pulseChatAI);const e=document.getElementById("pulse-chat-ai-admin-root");if(e){console.log("Pulse Chat AI: Found main container");const o=Dt(e),{options:r,usage:i}=zt();o.render(s.jsx(l.StrictMode,{children:s.jsx(jl,{options:r,usage:i})}));return}const t=document.getElementById("pulse-chat-ai-conversations-root");if(t){console.log("Pulse Chat AI: Found conversations container");const o=Dt(t),{options:r}=zt();o.render(s.jsx(l.StrictMode,{children:s.jsx(Al,{options:r})}));return}const n=document.getElementById("pulse-chat-ai-license-root");if(n){console.log("Pulse Chat AI: Found license container"),console.log("Pulse Chat AI: Container parent:",n.parentElement);const o=Dt(n),{options:r}=zt();console.log("Pulse Chat AI: License page options:",r),console.log("Pulse Chat AI: License page pro_enabled:",r.pro_enabled);const i=a=>{console.log("License options updated:",a),window.location.reload()};o.render(s.jsx(l.StrictMode,{children:s.jsx(Rl,{options:r,onChange:i})})),console.log("Pulse Chat AI: License page rendered");return}else console.warn("Pulse Chat AI: License container NOT found!");console.warn("Pulse Chat AI: No container found! Available containers:",{main:!!e,conversations:!!t,license:!!n})}
  • pulse-chat-ai/trunk/dist/assets/globals.css

    r3392240 r3394690  
    1 *,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;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;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--primary: 221.2 83.2% 53.3%;--primary-foreground: 210 40% 98%;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 40% 98%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 221.2 83.2% 53.3%;--radius: .5rem}.dark{--background: 222.2 84% 4.9%;--foreground: 210 40% 98%;--card: 222.2 84% 4.9%;--card-foreground: 210 40% 98%;--popover: 222.2 84% 4.9%;--popover-foreground: 210 40% 98%;--primary: 217.2 91.2% 59.8%;--primary-foreground: 222.2 47.4% 11.2%;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--accent: 217.2 32.6% 17.5%;--accent-foreground: 210 40% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 210 40% 98%;--border: 217.2 32.6% 17.5%;--input: 217.2 32.6% 17.5%;--ring: 224.3 76.3% 48%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width: 1400px){.container{max-width:1400px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.-right-2{right:-.5rem}.-top-2{top:-.5rem}.left-2{left:.5rem}.left-\[50\%\]{left:50%}.right-4{right:1rem}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-50{z-index:50}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[600px\]{height:600px}.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:24rem}.max-h-\[120px\]{max-height:120px}.max-h-\[80vh\]{max-height:80vh}.min-h-0{min-height:0px}.min-h-\[44px\]{min-height:44px}.min-h-\[80px\]{min-height:80px}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-20{width:5rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-\[420px\]{width:420px}.w-auto{width:auto}.w-full{width:100%}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.max-w-\[80\%\]{max-width:80%}.max-w-\[calc\(100vw-2rem\)\]{max-width:calc(100vw - 2rem)}.max-w-lg{max-width:32rem}.max-w-none{max-width:none}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-t-lg{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius)}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-border{border-color:hsl(var(--border))}.border-current{border-color:currentColor}.border-destructive\/20{border-color:hsl(var(--destructive) / .2)}.border-input{border-color:hsl(var(--input))}.border-orange-200{--tw-border-opacity: 1;border-color:rgb(254 215 170 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-background{background-color:hsl(var(--background))}.bg-background\/80{background-color:hsl(var(--background) / .8)}.bg-current{background-color:currentColor}.bg-destructive{background-color:hsl(var(--destructive))}.bg-destructive\/10{background-color:hsl(var(--destructive) / .1)}.bg-muted{background-color:hsl(var(--muted))}.bg-orange-50\/50{background-color:#fff7ed80}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.pt-0{padding-top:0}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.text-center{text-align:center}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.text-card-foreground{color:hsl(var(--card-foreground))}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.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)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}@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))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.animate-out{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.fade-out-0{--tw-exit-opacity: 0}.zoom-in-95{--tw-enter-scale: .95}.zoom-out-95{--tw-exit-scale: .95}.slide-in-from-bottom-2{--tw-enter-translate-y: .5rem}.slide-out-to-bottom-2{--tw-exit-translate-y: .5rem}.duration-200{animation-duration:.2s}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.hover\:scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-muted:hover{background-color:hsl(var(--muted))}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-0:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-0:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-5[data-state=checked]{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}@media (min-width: 640px){.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:text-left{text-align:left}}@media (min-width: 768px){.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:p-8{padding:2rem}}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}
     1*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;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;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--primary: 221.2 83.2% 53.3%;--primary-foreground: 210 40% 98%;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--muted: 0 0% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 40% 98%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 221.2 83.2% 53.3%;--radius: .5rem}.dark{--background: 222.2 84% 4.9%;--foreground: 210 40% 98%;--card: 222.2 84% 4.9%;--card-foreground: 210 40% 98%;--popover: 222.2 84% 4.9%;--popover-foreground: 210 40% 98%;--primary: 217.2 91.2% 59.8%;--primary-foreground: 222.2 47.4% 11.2%;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--accent: 217.2 32.6% 17.5%;--accent-foreground: 210 40% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 210 40% 98%;--border: 217.2 32.6% 17.5%;--input: 217.2 32.6% 17.5%;--ring: 224.3 76.3% 48%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width: 1400px){.container{max-width:1400px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.-right-2{right:-.5rem}.-top-2{top:-.5rem}.left-2{left:.5rem}.left-\[50\%\]{left:50%}.right-4{right:1rem}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-50{z-index:50}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.mr-2{margin-right:.5rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[600px\]{height:600px}.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:24rem}.max-h-\[120px\]{max-height:120px}.max-h-\[80vh\]{max-height:80vh}.min-h-0{min-height:0px}.min-h-\[120px\]{min-height:120px}.min-h-\[44px\]{min-height:44px}.min-h-\[80px\]{min-height:80px}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-20{width:5rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-\[420px\]{width:420px}.w-auto{width:auto}.w-full{width:100%}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.max-w-\[80\%\]{max-width:80%}.max-w-\[calc\(100vw-2rem\)\]{max-width:calc(100vw - 2rem)}.max-w-lg{max-width:32rem}.max-w-none{max-width:none}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-t-lg{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius)}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-border{border-color:hsl(var(--border))}.border-current{border-color:currentColor}.border-destructive\/20{border-color:hsl(var(--destructive) / .2)}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.border-orange-200{--tw-border-opacity: 1;border-color:rgb(254 215 170 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-background{background-color:hsl(var(--background))}.bg-background\/80{background-color:hsl(var(--background) / .8)}.bg-current{background-color:currentColor}.bg-destructive{background-color:hsl(var(--destructive))}.bg-destructive\/10{background-color:hsl(var(--destructive) / .1)}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-muted{background-color:hsl(var(--muted))}.bg-orange-50\/50{background-color:#fff7ed80}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/20{background-color:hsl(var(--primary) / .2)}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.pt-0{padding-top:0}.pt-4{padding-top:1rem}.text-center{text-align:center}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.text-card-foreground{color:hsl(var(--card-foreground))}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.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)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}@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))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.animate-out{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.fade-out-0{--tw-exit-opacity: 0}.zoom-in-95{--tw-enter-scale: .95}.zoom-out-95{--tw-exit-scale: .95}.slide-in-from-bottom-2{--tw-enter-translate-y: .5rem}.slide-out-to-bottom-2{--tw-exit-translate-y: .5rem}.duration-200{animation-duration:.2s}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.hover\:scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-muted:hover{background-color:hsl(var(--muted))}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-0:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-0:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-5[data-state=checked]{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}@media (min-width: 640px){.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:text-left{text-align:left}}@media (min-width: 768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:p-8{padding:2rem}}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}
  • pulse-chat-ai/trunk/dist/frontend/frontend.js

    r3392240 r3394690  
    1 import{h as Yt,r as W,j as A,c as ne,o as ut,p as xr,T as qi,B as st,i as yr,s as Ui,X as kn,l as Vi,m as Wi,n as kr}from"../chunks/globals-nr5uMcZd.js";/**
     1import{h as W,r as d,j as o,c as g,T as G,B as M,i as B,M as I,n as N,l as S,m as T,t as J,X as z,w as U,p as ee,q as te,s as H}from"../chunks/globals-B-Fr2V0D.js";/**
    22 * @license lucide-react v0.309.0 - ISC
    33 *
    44 * This source code is licensed under the ISC license.
    55 * See the LICENSE file in the root directory of this source tree.
    6  */const br=Yt("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
    7  * @license lucide-react v0.309.0 - ISC
    8  *
    9  * This source code is licensed under the ISC license.
    10  * See the LICENSE file in the root directory of this source tree.
    11  */const Yi=Yt("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
    12  * @license lucide-react v0.309.0 - ISC
    13  *
    14  * This source code is licensed under the ISC license.
    15  * See the LICENSE file in the root directory of this source tree.
    16  */const Qi=Yt("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),wr=W.forwardRef(({className:e,...n},t)=>A.jsx("div",{ref:t,className:ne("flex flex-col h-full",e),...n}));wr.displayName="Conversation";const Cr=W.forwardRef(({className:e,...n},t)=>A.jsx("div",{ref:t,className:ne("flex-1 overflow-y-auto p-4 md:p-8 space-y-4",e),...n}));Cr.displayName="ConversationContent";const Fe=W.forwardRef(({className:e,src:n,name:t,from:r="assistant",...i},l)=>A.jsx("div",{ref:l,className:ne("flex h-8 w-8 shrink-0 items-center justify-center rounded-full border",r==="user"?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground",e),...i,children:n?A.jsx("img",{src:n,alt:t||r,className:"h-full w-full rounded-full object-cover"}):A.jsx("div",{className:"flex items-center justify-center",children:r==="user"?A.jsx(Qi,{className:"h-4 w-4"}):A.jsx(br,{className:"h-4 w-4"})})}));Fe.displayName="MessageAvatar";const Ve=W.forwardRef(({className:e,from:n,children:t,...r},i)=>A.jsx("div",{ref:i,"data-role":n,className:ne("flex gap-3 items-start",n==="user"?"flex-row-reverse":"flex-row",e),...r,children:t}));Ve.displayName="Message";const Re=W.forwardRef(({className:e,...n},t)=>A.jsx("div",{ref:t,className:ne("flex flex-col gap-2 max-w-[80%] px-4 py-3 rounded-lg break-words",e),...n}));Re.displayName="MessageContent";function Xi(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const Gi=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ki=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ji={};function bn(e,n){return(Ji.jsx?Ki:Gi).test(e)}const Zi=/[ \t\n\f\r]/g;function el(e){return typeof e=="object"?e.type==="text"?wn(e.value):!1:wn(e)}function wn(e){return e.replace(Zi,"")===""}class Ke{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}Ke.prototype.normal={};Ke.prototype.property={};Ke.prototype.space=void 0;function Sr(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new Ke(t,r,n)}function _t(e){return e.toLowerCase()}class re{constructor(n,t){this.attribute=t,this.property=n}}re.prototype.attribute="";re.prototype.booleanish=!1;re.prototype.boolean=!1;re.prototype.commaOrSpaceSeparated=!1;re.prototype.commaSeparated=!1;re.prototype.defined=!1;re.prototype.mustUseProperty=!1;re.prototype.number=!1;re.prototype.overloadedBoolean=!1;re.prototype.property="";re.prototype.spaceSeparated=!1;re.prototype.space=void 0;let tl=0;const F=Te(),Q=Te(),Mt=Te(),S=Te(),V=Te(),Me=Te(),le=Te();function Te(){return 2**++tl}const Nt=Object.freeze(Object.defineProperty({__proto__:null,boolean:F,booleanish:Q,commaOrSpaceSeparated:le,commaSeparated:Me,number:S,overloadedBoolean:Mt,spaceSeparated:V},Symbol.toStringTag,{value:"Module"})),bt=Object.keys(Nt);class Qt extends re{constructor(n,t,r,i){let l=-1;if(super(n,t),Cn(this,"space",i),typeof r=="number")for(;++l<bt.length;){const o=bt[l];Cn(this,bt[l],(r&Nt[o])===Nt[o])}}}Qt.prototype.defined=!0;function Cn(e,n,t){t&&(e[n]=t)}function Oe(e){const n={},t={};for(const[r,i]of Object.entries(e.properties)){const l=new Qt(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),n[r]=l,t[_t(r)]=r,t[_t(l.attribute)]=r}return new Ke(n,t,e.space)}const Er=Oe({properties:{ariaActiveDescendant:null,ariaAtomic:Q,ariaAutoComplete:null,ariaBusy:Q,ariaChecked:Q,ariaColCount:S,ariaColIndex:S,ariaColSpan:S,ariaControls:V,ariaCurrent:null,ariaDescribedBy:V,ariaDetails:null,ariaDisabled:Q,ariaDropEffect:V,ariaErrorMessage:null,ariaExpanded:Q,ariaFlowTo:V,ariaGrabbed:Q,ariaHasPopup:null,ariaHidden:Q,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:V,ariaLevel:S,ariaLive:null,ariaModal:Q,ariaMultiLine:Q,ariaMultiSelectable:Q,ariaOrientation:null,ariaOwns:V,ariaPlaceholder:null,ariaPosInSet:S,ariaPressed:Q,ariaReadOnly:Q,ariaRelevant:null,ariaRequired:Q,ariaRoleDescription:V,ariaRowCount:S,ariaRowIndex:S,ariaRowSpan:S,ariaSelected:Q,ariaSetSize:S,ariaSort:null,ariaValueMax:S,ariaValueMin:S,ariaValueNow:S,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function Ir(e,n){return n in e?e[n]:n}function vr(e,n){return Ir(e,n.toLowerCase())}const nl=Oe({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Me,acceptCharset:V,accessKey:V,action:null,allow:null,allowFullScreen:F,allowPaymentRequest:F,allowUserMedia:F,alt:null,as:null,async:F,autoCapitalize:null,autoComplete:V,autoFocus:F,autoPlay:F,blocking:V,capture:null,charSet:null,checked:F,cite:null,className:V,cols:S,colSpan:null,content:null,contentEditable:Q,controls:F,controlsList:V,coords:S|Me,crossOrigin:null,data:null,dateTime:null,decoding:null,default:F,defer:F,dir:null,dirName:null,disabled:F,download:Mt,draggable:Q,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:F,formTarget:null,headers:V,height:S,hidden:Mt,high:S,href:null,hrefLang:null,htmlFor:V,httpEquiv:V,id:null,imageSizes:null,imageSrcSet:null,inert:F,inputMode:null,integrity:null,is:null,isMap:F,itemId:null,itemProp:V,itemRef:V,itemScope:F,itemType:V,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:F,low:S,manifest:null,max:null,maxLength:S,media:null,method:null,min:null,minLength:S,multiple:F,muted:F,name:null,nonce:null,noModule:F,noValidate:F,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:F,optimum:S,pattern:null,ping:V,placeholder:null,playsInline:F,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:F,referrerPolicy:null,rel:V,required:F,reversed:F,rows:S,rowSpan:S,sandbox:V,scope:null,scoped:F,seamless:F,selected:F,shadowRootClonable:F,shadowRootDelegatesFocus:F,shadowRootMode:null,shape:null,size:S,sizes:null,slot:null,span:S,spellCheck:Q,src:null,srcDoc:null,srcLang:null,srcSet:null,start:S,step:null,style:null,tabIndex:S,target:null,title:null,translate:null,type:null,typeMustMatch:F,useMap:null,value:Q,width:S,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:V,axis:null,background:null,bgColor:null,border:S,borderColor:null,bottomMargin:S,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:F,declare:F,event:null,face:null,frame:null,frameBorder:null,hSpace:S,leftMargin:S,link:null,longDesc:null,lowSrc:null,marginHeight:S,marginWidth:S,noResize:F,noHref:F,noShade:F,noWrap:F,object:null,profile:null,prompt:null,rev:null,rightMargin:S,rules:null,scheme:null,scrolling:Q,standby:null,summary:null,text:null,topMargin:S,valueType:null,version:null,vAlign:null,vLink:null,vSpace:S,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:F,disableRemotePlayback:F,prefix:null,property:null,results:S,security:null,unselectable:null},space:"html",transform:vr}),rl=Oe({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:le,accentHeight:S,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:S,amplitude:S,arabicForm:null,ascent:S,attributeName:null,attributeType:null,azimuth:S,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:S,by:null,calcMode:null,capHeight:S,className:V,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:S,diffuseConstant:S,direction:null,display:null,dur:null,divisor:S,dominantBaseline:null,download:F,dx:null,dy:null,edgeMode:null,editable:null,elevation:S,enableBackground:null,end:null,event:null,exponent:S,externalResourcesRequired:null,fill:null,fillOpacity:S,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Me,g2:Me,glyphName:Me,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:S,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:S,horizOriginX:S,horizOriginY:S,id:null,ideographic:S,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:S,k:S,k1:S,k2:S,k3:S,k4:S,kernelMatrix:le,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:S,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:S,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:S,overlineThickness:S,paintOrder:null,panose1:null,path:null,pathLength:S,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:V,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:S,pointsAtY:S,pointsAtZ:S,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:le,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:le,rev:le,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:le,requiredFeatures:le,requiredFonts:le,requiredFormats:le,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:S,specularExponent:S,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:S,strikethroughThickness:S,string:null,stroke:null,strokeDashArray:le,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:S,strokeOpacity:S,strokeWidth:null,style:null,surfaceScale:S,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:le,tabIndex:S,tableValues:null,target:null,targetX:S,targetY:S,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:le,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:S,underlineThickness:S,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:S,values:null,vAlphabetic:S,vMathematical:S,vectorEffect:null,vHanging:S,vIdeographic:S,version:null,vertAdvY:S,vertOriginX:S,vertOriginY:S,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:S,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ir}),Ar=Oe({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),Tr=Oe({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:vr}),Pr=Oe({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),il={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},ll=/[A-Z]/g,Sn=/-[a-z]/g,ol=/^data[-\w.:]+$/i;function al(e,n){const t=_t(n);let r=n,i=re;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&ol.test(n)){if(n.charAt(4)==="-"){const l=n.slice(5).replace(Sn,sl);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=n.slice(4);if(!Sn.test(l)){let o=l.replace(ll,ul);o.charAt(0)!=="-"&&(o="-"+o),n="data"+o}}i=Qt}return new i(r,n)}function ul(e){return"-"+e.toLowerCase()}function sl(e){return e.charAt(1).toUpperCase()}const cl=Sr([Er,nl,Ar,Tr,Pr],"html"),Xt=Sr([Er,rl,Ar,Tr,Pr],"svg");function fl(e){return e.join(" ").trim()}var Gt={},En=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,hl=/\n/g,pl=/^\s*/,ml=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,dl=/^:\s*/,gl=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,xl=/^[;\s]*/,yl=/^\s+|\s+$/g,kl=`
    17 `,In="/",vn="*",ve="",bl="comment",wl="declaration";function Cl(e,n){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];n=n||{};var t=1,r=1;function i(g){var y=g.match(hl);y&&(t+=y.length);var C=g.lastIndexOf(kl);r=~C?g.length-C:r+g.length}function l(){var g={line:t,column:r};return function(y){return y.position=new o(g),s(),y}}function o(g){this.start=g,this.end={line:t,column:r},this.source=n.source}o.prototype.content=e;function a(g){var y=new Error(n.source+":"+t+":"+r+": "+g);if(y.reason=g,y.filename=n.source,y.line=t,y.column=r,y.source=e,!n.silent)throw y}function u(g){var y=g.exec(e);if(y){var C=y[0];return i(C),e=e.slice(C.length),y}}function s(){u(pl)}function f(g){var y;for(g=g||[];y=c();)y!==!1&&g.push(y);return g}function c(){var g=l();if(!(In!=e.charAt(0)||vn!=e.charAt(1))){for(var y=2;ve!=e.charAt(y)&&(vn!=e.charAt(y)||In!=e.charAt(y+1));)++y;if(y+=2,ve===e.charAt(y-1))return a("End of comment missing");var C=e.slice(2,y-2);return r+=2,i(C),e=e.slice(y),r+=2,g({type:bl,comment:C})}}function p(){var g=l(),y=u(ml);if(y){if(c(),!u(dl))return a("property missing ':'");var C=u(gl),x=g({type:wl,property:An(y[0].replace(En,ve)),value:C?An(C[0].replace(En,ve)):ve});return u(xl),x}}function h(){var g=[];f(g);for(var y;y=p();)y!==!1&&(g.push(y),f(g));return g}return s(),h()}function An(e){return e?e.replace(yl,ve):ve}var Sl=Cl,El=ut&&ut.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Gt,"__esModule",{value:!0});Gt.default=vl;const Il=El(Sl);function vl(e,n){let t=null;if(!e||typeof e!="string")return t;const r=(0,Il.default)(e),i=typeof n=="function";return r.forEach(l=>{if(l.type!=="declaration")return;const{property:o,value:a}=l;i?n(o,a,l):a&&(t=t||{},t[o]=a)}),t}var mt={};Object.defineProperty(mt,"__esModule",{value:!0});mt.camelCase=void 0;var Al=/^--[a-zA-Z0-9_-]+$/,Tl=/-([a-z])/g,Pl=/^[^-]+$/,zl=/^-(webkit|moz|ms|o|khtml)-/,Ll=/^-(ms)-/,Dl=function(e){return!e||Pl.test(e)||Al.test(e)},Fl=function(e,n){return n.toUpperCase()},Tn=function(e,n){return"".concat(n,"-")},Rl=function(e,n){return n===void 0&&(n={}),Dl(e)?e:(e=e.toLowerCase(),n.reactCompat?e=e.replace(Ll,Tn):e=e.replace(zl,Tn),e.replace(Tl,Fl))};mt.camelCase=Rl;var _l=ut&&ut.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Ml=_l(Gt),Nl=mt;function Ot(e,n){var t={};return!e||typeof e!="string"||(0,Ml.default)(e,function(r,i){r&&i&&(t[(0,Nl.camelCase)(r,n)]=i)}),t}Ot.default=Ot;var Ol=Ot;const $l=xr(Ol),zr=Lr("end"),Kt=Lr("start");function Lr(e){return n;function n(t){const r=t&&t.position&&t.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function jl(e){const n=Kt(e),t=zr(e);if(n&&t)return{start:n,end:t}}function We(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Pn(e.position):"start"in e||"end"in e?Pn(e):"line"in e||"column"in e?$t(e):""}function $t(e){return zn(e&&e.line)+":"+zn(e&&e.column)}function Pn(e){return $t(e&&e.start)+"-"+$t(e&&e.end)}function zn(e){return e&&typeof e=="number"?e:1}class Z extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",l={},o=!1;if(t&&("line"in t&&"column"in t?l={place:t}:"start"in t&&"end"in t?l={place:t}:"type"in t?l={ancestors:[t],place:t.position}:l={...t}),typeof n=="string"?i=n:!l.cause&&n&&(o=!0,i=n.message,l.cause=n),!l.ruleId&&!l.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?l.ruleId=r:(l.source=r.slice(0,u),l.ruleId=r.slice(u+1))}if(!l.place&&l.ancestors&&l.ancestors){const u=l.ancestors[l.ancestors.length-1];u&&(l.place=u.position)}const a=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=We(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=o&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Z.prototype.file="";Z.prototype.name="";Z.prototype.reason="";Z.prototype.message="";Z.prototype.stack="";Z.prototype.column=void 0;Z.prototype.line=void 0;Z.prototype.ancestors=void 0;Z.prototype.cause=void 0;Z.prototype.fatal=void 0;Z.prototype.place=void 0;Z.prototype.ruleId=void 0;Z.prototype.source=void 0;const Jt={}.hasOwnProperty,Bl=new Map,Hl=/[A-Z]/g,ql=new Set(["table","tbody","thead","tfoot","tr"]),Ul=new Set(["td","th"]),Dr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Vl(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Zl(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Jl(t,n.jsx,n.jsxs)}const i={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Xt:cl,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},l=Fr(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function Fr(e,n,t){if(n.type==="element")return Wl(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Yl(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Xl(e,n,t);if(n.type==="mdxjsEsm")return Ql(e,n);if(n.type==="root")return Gl(e,n,t);if(n.type==="text")return Kl(e,n)}function Wl(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Xt,e.schema=i),e.ancestors.push(n);const l=_r(e,n.tagName,!1),o=eo(e,n);let a=en(e,n);return ql.has(n.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!el(u):!0})),Rr(e,o,l,n),Zt(o,a),e.ancestors.pop(),e.schema=r,e.create(n,l,o,t)}function Yl(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Xe(e,n.position)}function Ql(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);Xe(e,n.position)}function Xl(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=Xt,e.schema=i),e.ancestors.push(n);const l=n.name===null?e.Fragment:_r(e,n.name,!0),o=to(e,n),a=en(e,n);return Rr(e,o,l,n),Zt(o,a),e.ancestors.pop(),e.schema=r,e.create(n,l,o,t)}function Gl(e,n,t){const r={};return Zt(r,en(e,n)),e.create(n,e.Fragment,r,t)}function Kl(e,n){return n.value}function Rr(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function Zt(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function Jl(e,n,t){return r;function r(i,l,o,a){const s=Array.isArray(o.children)?t:n;return a?s(l,o,a):s(l,o)}}function Zl(e,n){return t;function t(r,i,l,o){const a=Array.isArray(l.children),u=Kt(r);return n(i,l,o,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function eo(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&Jt.call(n.properties,i)){const l=no(e,i,n.properties[i]);if(l){const[o,a]=l;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&Ul.has(n.tagName)?r=a:t[o]=a}}if(r){const l=t.style||(t.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function to(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const o=l.expression;o.type;const a=o.properties[0];a.type,Object.assign(t,e.evaluater.evaluateExpression(a.argument))}else Xe(e,n.position);else{const i=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,l=e.evaluater.evaluateExpression(a.expression)}else Xe(e,n.position);else l=r.value===null?!0:r.value;t[i]=l}return t}function en(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:Bl;for(;++r<n.children.length;){const l=n.children[r];let o;if(e.passKeys){const u=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(u){const s=i.get(u)||0;o=u+"-"+s,i.set(u,s+1)}}const a=Fr(e,l,o);a!==void 0&&t.push(a)}return t}function no(e,n,t){const r=al(e.schema,n);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?Xi(t):fl(t)),r.property==="style"){let i=typeof t=="object"?t:ro(e,String(t));return e.stylePropertyNameCase==="css"&&(i=io(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?il[r.property]||r.property:r.attribute,t]}}function ro(e,n){try{return $l(n,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const r=t,i=new Z("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Dr+"#cannot-parse-style-attribute",i}}function _r(e,n,t){let r;if(!t)r={type:"Literal",value:n};else if(n.includes(".")){const i=n.split(".");let l=-1,o;for(;++l<i.length;){const a=bn(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(l&&a.type==="Literal"),optional:!1}:a}r=o}else r=bn(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const i=r.value;return Jt.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Xe(e)}function Xe(e,n){const t=new Z("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=Dr+"#cannot-handle-mdx-estrees-without-createevaluater",t}function io(e){const n={};let t;for(t in e)Jt.call(e,t)&&(n[lo(t)]=e[t]);return n}function lo(e){let n=e.replace(Hl,oo);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function oo(e){return"-"+e.toLowerCase()}const wt={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},ao={};function tn(e,n){const t=ao,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return Mr(e,r,i)}function Mr(e,n,t){if(uo(e)){if("value"in e)return e.type==="html"&&!t?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Ln(e.children,n,t)}return Array.isArray(e)?Ln(e,n,t):""}function Ln(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=Mr(e[i],n,t);return r.join("")}function uo(e){return!!(e&&typeof e=="object")}const Dn=document.createElement("i");function nn(e){const n="&"+e+";";Dn.innerHTML=n;const t=Dn.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function oe(e,n,t,r){const i=e.length;let l=0,o;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)o=Array.from(r),o.unshift(n,t),e.splice(...o);else for(t&&e.splice(n,t);l<r.length;)o=r.slice(l,l+1e4),o.unshift(n,0),e.splice(...o),l+=1e4,n+=1e4}function ae(e,n){return e.length>0?(oe(e,e.length,0,n),e):n}const Fn={}.hasOwnProperty;function Nr(e){const n={};let t=-1;for(;++t<e.length;)so(n,e[t]);return n}function so(e,n){let t;for(t in n){const i=(Fn.call(e,t)?e[t]:void 0)||(e[t]={}),l=n[t];let o;if(l)for(o in l){Fn.call(i,o)||(i[o]=[]);const a=l[o];co(i[o],Array.isArray(a)?a:a?[a]:[])}}}function co(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);oe(e,0,0,r)}function Or(e,n){const t=Number.parseInt(e,n);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function he(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ee=Ce(/[A-Za-z]/),J=Ce(/[\dA-Za-z]/),fo=Ce(/[#-'*+\--9=?A-Z^-~]/);function ct(e){return e!==null&&(e<32||e===127)}const jt=Ce(/\d/),ho=Ce(/[\dA-Fa-f]/),po=Ce(/[!-/:-@[-`{-~]/);function z(e){return e!==null&&e<-2}function U(e){return e!==null&&(e<0||e===32)}function M(e){return e===-2||e===-1||e===32}const dt=Ce(new RegExp("\\p{P}|\\p{S}","u")),Ae=Ce(/\s/);function Ce(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function $e(e){const n=[];let t=-1,r=0,i=0;for(;++t<e.length;){const l=e.charCodeAt(t);let o="";if(l===37&&J(e.charCodeAt(t+1))&&J(e.charCodeAt(t+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(o=String.fromCharCode(l));else if(l>55295&&l<57344){const a=e.charCodeAt(t+1);l<56320&&a>56319&&a<57344?(o=String.fromCharCode(l,a),i=1):o="�"}else o=String.fromCharCode(l);o&&(n.push(e.slice(r,t),encodeURIComponent(o)),r=t+i+1,o=""),i&&(t+=i,i=0)}return n.join("")+e.slice(r)}function O(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return o;function o(u){return M(u)?(e.enter(t),a(u)):n(u)}function a(u){return M(u)&&l++<i?(e.consume(u),a):(e.exit(t),n(u))}}const mo={tokenize:go};function go(e){const n=e.attempt(this.parser.constructs.contentInitial,r,i);let t;return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),O(e,n,"linePrefix")}function i(a){return e.enter("paragraph"),l(a)}function l(a){const u=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=u),t=u,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return z(a)?(e.consume(a),e.exit("chunkText"),l):(e.consume(a),o)}}const xo={tokenize:yo},Rn={tokenize:ko};function yo(e){const n=this,t=[];let r=0,i,l,o;return a;function a(E){if(r<t.length){const R=t[r];return n.containerState=R[1],e.attempt(R[0].continuation,u,s)(E)}return s(E)}function u(E){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&I();const R=n.events.length;let L=R,b;for(;L--;)if(n.events[L][0]==="exit"&&n.events[L][1].type==="chunkFlow"){b=n.events[L][1].end;break}x(r);let _=R;for(;_<n.events.length;)n.events[_][1].end={...b},_++;return oe(n.events,L+1,0,n.events.slice(R)),n.events.length=_,s(E)}return a(E)}function s(E){if(r===t.length){if(!i)return p(E);if(i.currentConstruct&&i.currentConstruct.concrete)return g(E);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(Rn,f,c)(E)}function f(E){return i&&I(),x(r),p(E)}function c(E){return n.parser.lazy[n.now().line]=r!==t.length,o=n.now().offset,g(E)}function p(E){return n.containerState={},e.attempt(Rn,h,g)(E)}function h(E){return r++,t.push([n.currentConstruct,n.containerState]),p(E)}function g(E){if(E===null){i&&I(),x(0),e.consume(E);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),y(E)}function y(E){if(E===null){C(e.exit("chunkFlow"),!0),x(0),e.consume(E);return}return z(E)?(e.consume(E),C(e.exit("chunkFlow")),r=0,n.interrupt=void 0,a):(e.consume(E),y)}function C(E,R){const L=n.sliceStream(E);if(R&&L.push(null),E.previous=l,l&&(l.next=E),l=E,i.defineSkip(E.start),i.write(L),n.parser.lazy[E.start.line]){let b=i.events.length;for(;b--;)if(i.events[b][1].start.offset<o&&(!i.events[b][1].end||i.events[b][1].end.offset>o))return;const _=n.events.length;let B=_,j,k;for(;B--;)if(n.events[B][0]==="exit"&&n.events[B][1].type==="chunkFlow"){if(j){k=n.events[B][1].end;break}j=!0}for(x(r),b=_;b<n.events.length;)n.events[b][1].end={...k},b++;oe(n.events,B+1,0,n.events.slice(_)),n.events.length=b}}function x(E){let R=t.length;for(;R-- >E;){const L=t[R];n.containerState=L[1],L[0].exit.call(n,e)}t.length=E}function I(){i.write([null]),l=void 0,i=void 0,n.containerState._closeFlow=void 0}}function ko(e,n,t){return O(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ne(e){if(e===null||U(e)||Ae(e))return 1;if(dt(e))return 2}function gt(e,n,t){const r=[];let i=-1;for(;++i<e.length;){const l=e[i].resolveAll;l&&!r.includes(l)&&(n=l(n,t),r.push(l))}return n}const Bt={name:"attention",resolveAll:bo,tokenize:wo};function bo(e,n){let t=-1,r,i,l,o,a,u,s,f;for(;++t<e.length;)if(e[t][0]==="enter"&&e[t][1].type==="attentionSequence"&&e[t][1]._close){for(r=t;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[t][1]).charCodeAt(0)){if((e[r][1]._close||e[t][1]._open)&&(e[t][1].end.offset-e[t][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[t][1].end.offset-e[t][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const c={...e[r][1].end},p={...e[t][1].start};_n(c,-u),_n(p,u),o={type:u>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},l={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:u>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[t][1].start={...a.end},s=[],e[r][1].end.offset-e[r][1].start.offset&&(s=ae(s,[["enter",e[r][1],n],["exit",e[r][1],n]])),s=ae(s,[["enter",i,n],["enter",o,n],["exit",o,n],["enter",l,n]]),s=ae(s,gt(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),s=ae(s,[["exit",l,n],["enter",a,n],["exit",a,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(f=2,s=ae(s,[["enter",e[t][1],n],["exit",e[t][1],n]])):f=0,oe(e,r-1,t-r+3,s),t=r+s.length-f-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function wo(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ne(r);let l;return o;function o(u){return l=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===l)return e.consume(u),a;const s=e.exit("attentionSequence"),f=Ne(u),c=!f||f===2&&i||t.includes(u),p=!i||i===2&&f||t.includes(r);return s._open=!!(l===42?c:c&&(i||!p)),s._close=!!(l===42?p:p&&(f||!c)),n(u)}}function _n(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const Co={name:"autolink",tokenize:So};function So(e,n,t){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(h){return ee(h)?(e.consume(h),o):h===64?t(h):s(h)}function o(h){return h===43||h===45||h===46||J(h)?(r=1,a(h)):s(h)}function a(h){return h===58?(e.consume(h),r=0,u):(h===43||h===45||h===46||J(h))&&r++<32?(e.consume(h),a):(r=0,s(h))}function u(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):h===null||h===32||h===60||ct(h)?t(h):(e.consume(h),u)}function s(h){return h===64?(e.consume(h),f):fo(h)?(e.consume(h),s):t(h)}function f(h){return J(h)?c(h):t(h)}function c(h){return h===46?(e.consume(h),r=0,f):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):p(h)}function p(h){if((h===45||J(h))&&r++<63){const g=h===45?p:c;return e.consume(h),g}return t(h)}}const Je={partial:!0,tokenize:Eo};function Eo(e,n,t){return r;function r(l){return M(l)?O(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||z(l)?n(l):t(l)}}const $r={continuation:{tokenize:vo},exit:Ao,name:"blockQuote",tokenize:Io};function Io(e,n,t){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),l}return t(o)}function l(o){return M(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(o))}}function vo(e,n,t){const r=this;return i;function i(o){return M(o)?O(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):l(o)}function l(o){return e.attempt($r,n,t)(o)}}function Ao(e){e.exit("blockQuote")}const jr={name:"characterEscape",tokenize:To};function To(e,n,t){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),i}function i(l){return po(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(l)}}const Br={name:"characterReference",tokenize:Po};function Po(e,n,t){const r=this;let i=0,l,o;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),u}function u(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),l=31,o=J,f(c))}function s(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,o=ho,f):(e.enter("characterReferenceValue"),l=7,o=jt,f(c))}function f(c){if(c===59&&i){const p=e.exit("characterReferenceValue");return o===J&&!nn(r.sliceSerialize(p))?t(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return o(c)&&i++<l?(e.consume(c),f):t(c)}}const Mn={partial:!0,tokenize:Lo},Nn={concrete:!0,name:"codeFenced",tokenize:zo};function zo(e,n,t){const r=this,i={partial:!0,tokenize:L};let l=0,o=0,a;return u;function u(b){return s(b)}function s(b){const _=r.events[r.events.length-1];return l=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,a=b,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(b)}function f(b){return b===a?(o++,e.consume(b),f):o<3?t(b):(e.exit("codeFencedFenceSequence"),M(b)?O(e,c,"whitespace")(b):c(b))}function c(b){return b===null||z(b)?(e.exit("codeFencedFence"),r.interrupt?n(b):e.check(Mn,y,R)(b)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===null||z(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(b)):M(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),O(e,h,"whitespace")(b)):b===96&&b===a?t(b):(e.consume(b),p)}function h(b){return b===null||z(b)?c(b):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===null||z(b)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(b)):b===96&&b===a?t(b):(e.consume(b),g)}function y(b){return e.attempt(i,R,C)(b)}function C(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),x}function x(b){return l>0&&M(b)?O(e,I,"linePrefix",l+1)(b):I(b)}function I(b){return b===null||z(b)?e.check(Mn,y,R)(b):(e.enter("codeFlowValue"),E(b))}function E(b){return b===null||z(b)?(e.exit("codeFlowValue"),I(b)):(e.consume(b),E)}function R(b){return e.exit("codeFenced"),n(b)}function L(b,_,B){let j=0;return k;function k($){return b.enter("lineEnding"),b.consume($),b.exit("lineEnding"),T}function T($){return b.enter("codeFencedFence"),M($)?O(b,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):P($)}function P($){return $===a?(b.enter("codeFencedFenceSequence"),H($)):B($)}function H($){return $===a?(j++,b.consume($),H):j>=o?(b.exit("codeFencedFenceSequence"),M($)?O(b,Y,"whitespace")($):Y($)):B($)}function Y($){return $===null||z($)?(b.exit("codeFencedFence"),_($)):B($)}}}function Lo(e,n,t){const r=this;return i;function i(o){return o===null?t(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l)}function l(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}const Ct={name:"codeIndented",tokenize:Fo},Do={partial:!0,tokenize:Ro};function Fo(e,n,t){const r=this;return i;function i(s){return e.enter("codeIndented"),O(e,l,"linePrefix",5)(s)}function l(s){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?o(s):t(s)}function o(s){return s===null?u(s):z(s)?e.attempt(Do,o,u)(s):(e.enter("codeFlowValue"),a(s))}function a(s){return s===null||z(s)?(e.exit("codeFlowValue"),o(s)):(e.consume(s),a)}function u(s){return e.exit("codeIndented"),n(s)}}function Ro(e,n,t){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?t(o):z(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):O(e,l,"linePrefix",5)(o)}function l(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(o):z(o)?i(o):t(o)}}const _o={name:"codeText",previous:No,resolve:Mo,tokenize:Oo};function Mo(e){let n=e.length-4,t=3,r,i;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r<n;)if(e[r][1].type==="codeTextData"){e[t][1].type="codeTextPadding",e[n][1].type="codeTextPadding",t+=2,n-=2;break}}for(r=t-1,n++;++r<=n;)i===void 0?r!==n&&e[r][1].type!=="lineEnding"&&(i=r):(r===n||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),n-=r-i-2,r=i+2),i=void 0);return e}function No(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Oo(e,n,t){let r=0,i,l;return o;function o(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),r++,a):(e.exit("codeTextSequence"),u(c))}function u(c){return c===null?t(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),u):c===96?(l=e.enter("codeTextSequence"),i=0,f(c)):z(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u):(e.enter("codeTextData"),s(c))}function s(c){return c===null||c===32||c===96||z(c)?(e.exit("codeTextData"),u(c)):(e.consume(c),s)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(c)):(l.type="codeTextData",s(c))}}class $o{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,t){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const i=t||0;this.setCursor(Math.trunc(n));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&qe(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),qe(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),qe(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const t=this.left.splice(n,Number.POSITIVE_INFINITY);qe(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);qe(this.left,t.reverse())}}}function qe(e,n){let t=0;if(n.length<1e4)e.push(...n);else for(;t<n.length;)e.push(...n.slice(t,t+1e4)),t+=1e4}function Hr(e){const n={};let t=-1,r,i,l,o,a,u,s;const f=new $o(e);for(;++t<f.length;){for(;t in n;)t=n[t];if(r=f.get(t),t&&r[1].type==="chunkFlow"&&f.get(t-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,l=0,l<u.length&&u[l][1].type==="lineEndingBlank"&&(l+=2),l<u.length&&u[l][1].type==="content"))for(;++l<u.length&&u[l][1].type!=="content";)u[l][1].type==="chunkText"&&(u[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,jo(f,t)),t=n[t],s=!0);else if(r[1]._container){for(l=t,i=void 0;l--;)if(o=f.get(l),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=l);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,t),a.unshift(r),f.splice(i,t-i+1,a))}}return oe(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!s}function jo(e,n){const t=e.get(n)[1],r=e.get(n)[2];let i=n-1;const l=[];let o=t._tokenizer;o||(o=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,u=[],s={};let f,c,p=-1,h=t,g=0,y=0;const C=[y];for(;h;){for(;e.get(++i)[1]!==h;);l.push(i),h._tokenizer||(f=r.sliceStream(h),h.next||f.push(null),c&&o.defineSkip(h.start),h._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(f),h._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),c=h,h=h.next}for(h=t;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(y=p+1,C.push(y),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(o.events=[],h?(h._tokenizer=void 0,h.previous=void 0):C.pop(),p=C.length;p--;){const x=a.slice(C[p],C[p+1]),I=l.pop();u.push([I,I+x.length-1]),e.splice(I,2,x)}for(u.reverse(),p=-1;++p<u.length;)s[g+u[p][0]]=g+u[p][1],g+=u[p][1]-u[p][0]-1;return s}const Bo={resolve:qo,tokenize:Uo},Ho={partial:!0,tokenize:Vo};function qo(e){return Hr(e),e}function Uo(e,n){let t;return r;function r(a){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?l(a):z(a)?e.check(Ho,o,l)(a):(e.consume(a),i)}function l(a){return e.exit("chunkContent"),e.exit("content"),n(a)}function o(a){return e.consume(a),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function Vo(e,n,t){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),O(e,l,"linePrefix")}function l(o){if(o===null||z(o))return t(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(o):e.interrupt(r.parser.constructs.flow,t,n)(o)}}function qr(e,n,t,r,i,l,o,a,u){const s=u||Number.POSITIVE_INFINITY;let f=0;return c;function c(x){return x===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(x),e.exit(l),p):x===null||x===32||x===41||ct(x)?t(x):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),y(x))}function p(x){return x===62?(e.enter(l),e.consume(x),e.exit(l),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(x))}function h(x){return x===62?(e.exit("chunkString"),e.exit(a),p(x)):x===null||x===60||z(x)?t(x):(e.consume(x),x===92?g:h)}function g(x){return x===60||x===62||x===92?(e.consume(x),h):h(x)}function y(x){return!f&&(x===null||x===41||U(x))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),n(x)):f<s&&x===40?(e.consume(x),f++,y):x===41?(e.consume(x),f--,y):x===null||x===32||x===40||ct(x)?t(x):(e.consume(x),x===92?C:y)}function C(x){return x===40||x===41||x===92?(e.consume(x),y):y(x)}}function Ur(e,n,t,r,i,l){const o=this;let a=0,u;return s;function s(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(l),f}function f(h){return a>999||h===null||h===91||h===93&&!u||h===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?t(h):h===93?(e.exit(l),e.enter(i),e.consume(h),e.exit(i),e.exit(r),n):z(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===null||h===91||h===93||z(h)||a++>999?(e.exit("chunkString"),f(h)):(e.consume(h),u||(u=!M(h)),h===92?p:c)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,c):c(h)}}function Vr(e,n,t,r,i,l){let o;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),o=p===40?41:p,u):t(p)}function u(p){return p===o?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),n):(e.enter(l),s(p))}function s(p){return p===o?(e.exit(l),u(o)):p===null?t(p):z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),O(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===o||p===null||z(p)?(e.exit("chunkString"),s(p)):(e.consume(p),p===92?c:f)}function c(p){return p===o||p===92?(e.consume(p),f):f(p)}}function Ye(e,n){let t;return r;function r(i){return z(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):M(i)?O(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const Wo={name:"definition",tokenize:Qo},Yo={partial:!0,tokenize:Xo};function Qo(e,n,t){const r=this;let i;return l;function l(h){return e.enter("definition"),o(h)}function o(h){return Ur.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=he(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),u):t(h)}function u(h){return U(h)?Ye(e,s)(h):s(h)}function s(h){return qr(e,f,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(Yo,c,c)(h)}function c(h){return M(h)?O(e,p,"whitespace")(h):p(h)}function p(h){return h===null||z(h)?(e.exit("definition"),r.parser.defined.push(i),n(h)):t(h)}}function Xo(e,n,t){return r;function r(a){return U(a)?Ye(e,i)(a):t(a)}function i(a){return Vr(e,l,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function l(a){return M(a)?O(e,o,"whitespace")(a):o(a)}function o(a){return a===null||z(a)?n(a):t(a)}}const Go={name:"hardBreakEscape",tokenize:Ko};function Ko(e,n,t){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return z(l)?(e.exit("hardBreakEscape"),n(l)):t(l)}}const Jo={name:"headingAtx",resolve:Zo,tokenize:ea};function Zo(e,n){let t=e.length-2,r=3,i,l;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},l={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},oe(e,r,t-r+1,[["enter",i,n],["enter",l,n],["exit",l,n],["exit",i,n]])),e}function ea(e,n,t){let r=0;return i;function i(f){return e.enter("atxHeading"),l(f)}function l(f){return e.enter("atxHeadingSequence"),o(f)}function o(f){return f===35&&r++<6?(e.consume(f),o):f===null||U(f)?(e.exit("atxHeadingSequence"),a(f)):t(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||z(f)?(e.exit("atxHeading"),n(f)):M(f)?O(e,a,"whitespace")(f):(e.enter("atxHeadingText"),s(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),a(f))}function s(f){return f===null||f===35||U(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),s)}}const ta=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],On=["pre","script","style","textarea"],na={concrete:!0,name:"htmlFlow",resolveTo:la,tokenize:oa},ra={partial:!0,tokenize:ua},ia={partial:!0,tokenize:aa};function la(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function oa(e,n,t){const r=this;let i,l,o,a,u;return s;function s(d){return f(d)}function f(d){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(d),c}function c(d){return d===33?(e.consume(d),p):d===47?(e.consume(d),l=!0,y):d===63?(e.consume(d),i=3,r.interrupt?n:m):ee(d)?(e.consume(d),o=String.fromCharCode(d),C):t(d)}function p(d){return d===45?(e.consume(d),i=2,h):d===91?(e.consume(d),i=5,a=0,g):ee(d)?(e.consume(d),i=4,r.interrupt?n:m):t(d)}function h(d){return d===45?(e.consume(d),r.interrupt?n:m):t(d)}function g(d){const ce="CDATA[";return d===ce.charCodeAt(a++)?(e.consume(d),a===ce.length?r.interrupt?n:P:g):t(d)}function y(d){return ee(d)?(e.consume(d),o=String.fromCharCode(d),C):t(d)}function C(d){if(d===null||d===47||d===62||U(d)){const ce=d===47,Se=o.toLowerCase();return!ce&&!l&&On.includes(Se)?(i=1,r.interrupt?n(d):P(d)):ta.includes(o.toLowerCase())?(i=6,ce?(e.consume(d),x):r.interrupt?n(d):P(d)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(d):l?I(d):E(d))}return d===45||J(d)?(e.consume(d),o+=String.fromCharCode(d),C):t(d)}function x(d){return d===62?(e.consume(d),r.interrupt?n:P):t(d)}function I(d){return M(d)?(e.consume(d),I):k(d)}function E(d){return d===47?(e.consume(d),k):d===58||d===95||ee(d)?(e.consume(d),R):M(d)?(e.consume(d),E):k(d)}function R(d){return d===45||d===46||d===58||d===95||J(d)?(e.consume(d),R):L(d)}function L(d){return d===61?(e.consume(d),b):M(d)?(e.consume(d),L):E(d)}function b(d){return d===null||d===60||d===61||d===62||d===96?t(d):d===34||d===39?(e.consume(d),u=d,_):M(d)?(e.consume(d),b):B(d)}function _(d){return d===u?(e.consume(d),u=null,j):d===null||z(d)?t(d):(e.consume(d),_)}function B(d){return d===null||d===34||d===39||d===47||d===60||d===61||d===62||d===96||U(d)?L(d):(e.consume(d),B)}function j(d){return d===47||d===62||M(d)?E(d):t(d)}function k(d){return d===62?(e.consume(d),T):t(d)}function T(d){return d===null||z(d)?P(d):M(d)?(e.consume(d),T):t(d)}function P(d){return d===45&&i===2?(e.consume(d),K):d===60&&i===1?(e.consume(d),X):d===62&&i===4?(e.consume(d),se):d===63&&i===3?(e.consume(d),m):d===93&&i===5?(e.consume(d),de):z(d)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(ra,ge,H)(d)):d===null||z(d)?(e.exit("htmlFlowData"),H(d)):(e.consume(d),P)}function H(d){return e.check(ia,Y,ge)(d)}function Y(d){return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),$}function $(d){return d===null||z(d)?H(d):(e.enter("htmlFlowData"),P(d))}function K(d){return d===45?(e.consume(d),m):P(d)}function X(d){return d===47?(e.consume(d),o="",ue):P(d)}function ue(d){if(d===62){const ce=o.toLowerCase();return On.includes(ce)?(e.consume(d),se):P(d)}return ee(d)&&o.length<8?(e.consume(d),o+=String.fromCharCode(d),ue):P(d)}function de(d){return d===93?(e.consume(d),m):P(d)}function m(d){return d===62?(e.consume(d),se):d===45&&i===2?(e.consume(d),m):P(d)}function se(d){return d===null||z(d)?(e.exit("htmlFlowData"),ge(d)):(e.consume(d),se)}function ge(d){return e.exit("htmlFlow"),n(d)}}function aa(e,n,t){const r=this;return i;function i(o){return z(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l):t(o)}function l(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}function ua(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Je,n,t)}}const sa={name:"htmlText",tokenize:ca};function ca(e,n,t){const r=this;let i,l,o;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),u}function u(m){return m===33?(e.consume(m),s):m===47?(e.consume(m),L):m===63?(e.consume(m),E):ee(m)?(e.consume(m),B):t(m)}function s(m){return m===45?(e.consume(m),f):m===91?(e.consume(m),l=0,g):ee(m)?(e.consume(m),I):t(m)}function f(m){return m===45?(e.consume(m),h):t(m)}function c(m){return m===null?t(m):m===45?(e.consume(m),p):z(m)?(o=c,X(m)):(e.consume(m),c)}function p(m){return m===45?(e.consume(m),h):c(m)}function h(m){return m===62?K(m):m===45?p(m):c(m)}function g(m){const se="CDATA[";return m===se.charCodeAt(l++)?(e.consume(m),l===se.length?y:g):t(m)}function y(m){return m===null?t(m):m===93?(e.consume(m),C):z(m)?(o=y,X(m)):(e.consume(m),y)}function C(m){return m===93?(e.consume(m),x):y(m)}function x(m){return m===62?K(m):m===93?(e.consume(m),x):y(m)}function I(m){return m===null||m===62?K(m):z(m)?(o=I,X(m)):(e.consume(m),I)}function E(m){return m===null?t(m):m===63?(e.consume(m),R):z(m)?(o=E,X(m)):(e.consume(m),E)}function R(m){return m===62?K(m):E(m)}function L(m){return ee(m)?(e.consume(m),b):t(m)}function b(m){return m===45||J(m)?(e.consume(m),b):_(m)}function _(m){return z(m)?(o=_,X(m)):M(m)?(e.consume(m),_):K(m)}function B(m){return m===45||J(m)?(e.consume(m),B):m===47||m===62||U(m)?j(m):t(m)}function j(m){return m===47?(e.consume(m),K):m===58||m===95||ee(m)?(e.consume(m),k):z(m)?(o=j,X(m)):M(m)?(e.consume(m),j):K(m)}function k(m){return m===45||m===46||m===58||m===95||J(m)?(e.consume(m),k):T(m)}function T(m){return m===61?(e.consume(m),P):z(m)?(o=T,X(m)):M(m)?(e.consume(m),T):j(m)}function P(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),i=m,H):z(m)?(o=P,X(m)):M(m)?(e.consume(m),P):(e.consume(m),Y)}function H(m){return m===i?(e.consume(m),i=void 0,$):m===null?t(m):z(m)?(o=H,X(m)):(e.consume(m),H)}function Y(m){return m===null||m===34||m===39||m===60||m===61||m===96?t(m):m===47||m===62||U(m)?j(m):(e.consume(m),Y)}function $(m){return m===47||m===62||U(m)?j(m):t(m)}function K(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),n):t(m)}function X(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),ue}function ue(m){return M(m)?O(e,de,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):de(m)}function de(m){return e.enter("htmlTextData"),o(m)}}const rn={name:"labelEnd",resolveAll:ma,resolveTo:da,tokenize:ga},fa={tokenize:xa},ha={tokenize:ya},pa={tokenize:ka};function ma(e){let n=-1;const t=[];for(;++n<e.length;){const r=e[n][1];if(t.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",n+=i}}return e.length!==t.length&&oe(e,0,e.length,t),e}function da(e,n){let t=e.length,r=0,i,l,o,a;for(;t--;)if(i=e[t][1],l){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(l=t,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=t);const u={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},s={type:"label",start:{...e[l][1].start},end:{...e[o][1].end}},f={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",u,n],["enter",s,n]],a=ae(a,e.slice(l+1,l+r+3)),a=ae(a,[["enter",f,n]]),a=ae(a,gt(n.parser.constructs.insideSpan.null,e.slice(l+r+4,o-3),n)),a=ae(a,[["exit",f,n],e[o-2],e[o-1],["exit",s,n]]),a=ae(a,e.slice(o+1)),a=ae(a,[["exit",u,n]]),oe(e,l,e.length,a),e}function ga(e,n,t){const r=this;let i=r.events.length,l,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){l=r.events[i][1];break}return a;function a(p){return l?l._inactive?c(p):(o=r.parser.defined.includes(he(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),u):t(p)}function u(p){return p===40?e.attempt(fa,f,o?f:c)(p):p===91?e.attempt(ha,f,o?s:c)(p):o?f(p):c(p)}function s(p){return e.attempt(pa,f,c)(p)}function f(p){return n(p)}function c(p){return l._balanced=!0,t(p)}}function xa(e,n,t){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return U(c)?Ye(e,l)(c):l(c)}function l(c){return c===41?f(c):qr(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function o(c){return U(c)?Ye(e,u)(c):f(c)}function a(c){return t(c)}function u(c){return c===34||c===39||c===40?Vr(e,s,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function s(c){return U(c)?Ye(e,f)(c):f(c)}function f(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),n):t(c)}}function ya(e,n,t){const r=this;return i;function i(a){return Ur.call(r,e,l,o,"reference","referenceMarker","referenceString")(a)}function l(a){return r.parser.defined.includes(he(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(a):t(a)}function o(a){return t(a)}}function ka(e,n,t){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),i}function i(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),n):t(l)}}const ba={name:"labelStartImage",resolveAll:rn.resolveAll,tokenize:wa};function wa(e,n,t){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),l}function l(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):t(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):n(a)}}const Ca={name:"labelStartLink",resolveAll:rn.resolveAll,tokenize:Sa};function Sa(e,n,t){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),l}function l(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(o):n(o)}}const St={name:"lineEnding",tokenize:Ea};function Ea(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),O(e,n,"linePrefix")}}const lt={name:"thematicBreak",tokenize:Ia};function Ia(e,n,t){let r=0,i;return l;function l(s){return e.enter("thematicBreak"),o(s)}function o(s){return i=s,a(s)}function a(s){return s===i?(e.enter("thematicBreakSequence"),u(s)):r>=3&&(s===null||z(s))?(e.exit("thematicBreak"),n(s)):t(s)}function u(s){return s===i?(e.consume(s),r++,u):(e.exit("thematicBreakSequence"),M(s)?O(e,a,"whitespace")(s):a(s))}}const te={continuation:{tokenize:Pa},exit:La,name:"list",tokenize:Ta},va={partial:!0,tokenize:Da},Aa={partial:!0,tokenize:za};function Ta(e,n,t){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(h){const g=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:jt(h)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(lt,t,s)(h):s(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(h)}return t(h)}function u(h){return jt(h)&&++o<10?(e.consume(h),u):(!r.interrupt||o<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),s(h)):t(h)}function s(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Je,r.interrupt?t:f,e.attempt(va,p,c))}function f(h){return r.containerState.initialBlankLine=!0,l++,p(h)}function c(h){return M(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):t(h)}function p(h){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(h)}}function Pa(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(Je,i,l);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,O(e,n,"listItemIndent",r.containerState.size+1)(a)}function l(a){return r.containerState.furtherBlankLines||!M(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Aa,n,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,O(e,e.attempt(te,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function za(e,n,t){const r=this;return O(e,i,"listItemIndent",r.containerState.size+1);function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?n(l):t(l)}}function La(e){e.exit(this.containerState.type)}function Da(e,n,t){const r=this;return O(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const o=r.events[r.events.length-1];return!M(l)&&o&&o[1].type==="listItemPrefixWhitespace"?n(l):t(l)}}const $n={name:"setextUnderline",resolveTo:Fa,tokenize:Ra};function Fa(e,n){let t=e.length,r,i,l;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(i=t)}else e[t][1].type==="content"&&e.splice(t,1),!l&&e[t][1].type==="definition"&&(l=t);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",l?(e.splice(i,0,["enter",o,n]),e.splice(l+1,0,["exit",e[r][1],n]),e[r][1].end={...e[l][1].end}):e[r][1]=o,e.push(["exit",o,n]),e}function Ra(e,n,t){const r=this;let i;return l;function l(s){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=s,o(s)):t(s)}function o(s){return e.enter("setextHeadingLineSequence"),a(s)}function a(s){return s===i?(e.consume(s),a):(e.exit("setextHeadingLineSequence"),M(s)?O(e,u,"lineSuffix")(s):u(s))}function u(s){return s===null||z(s)?(e.exit("setextHeadingLine"),n(s)):t(s)}}const _a={tokenize:Ma};function Ma(e){const n=this,t=e.attempt(Je,r,e.attempt(this.parser.constructs.flowInitial,i,O(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Bo,i)),"linePrefix")));return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const Na={resolveAll:Yr()},Oa=Wr("string"),$a=Wr("text");function Wr(e){return{resolveAll:Yr(e==="text"?ja:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],l=t.attempt(i,o,a);return o;function o(f){return s(f)?l(f):a(f)}function a(f){if(f===null){t.consume(f);return}return t.enter("data"),t.consume(f),u}function u(f){return s(f)?(t.exit("data"),l(f)):(t.consume(f),u)}function s(f){if(f===null)return!0;const c=i[f];let p=-1;if(c)for(;++p<c.length;){const h=c[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function Yr(e){return n;function n(t,r){let i=-1,l;for(;++i<=t.length;)l===void 0?t[i]&&t[i][1].type==="data"&&(l=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==l+2&&(t[l][1].end=t[i-1][1].end,t.splice(l+2,i-l-2),i=l+2),l=void 0);return e?e(t,r):t}}function ja(e,n){let t=0;for(;++t<=e.length;)if((t===e.length||e[t][1].type==="lineEnding")&&e[t-1][1].type==="data"){const r=e[t-1][1],i=n.sliceStream(r);let l=i.length,o=-1,a=0,u;for(;l--;){const s=i[l];if(typeof s=="string"){for(o=s.length;s.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(s===-2)u=!0,a++;else if(s!==-1){l++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(a=0),a){const s={type:t===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?o:r.start._bufferIndex+o,_index:r.start._index+l,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...s.start},r.start.offset===r.end.offset?Object.assign(r,s):(e.splice(t,0,["enter",s,n],["exit",s,n]),t+=2)}t++}return e}const Ba={42:te,43:te,45:te,48:te,49:te,50:te,51:te,52:te,53:te,54:te,55:te,56:te,57:te,62:$r},Ha={91:Wo},qa={[-2]:Ct,[-1]:Ct,32:Ct},Ua={35:Jo,42:lt,45:[$n,lt],60:na,61:$n,95:lt,96:Nn,126:Nn},Va={38:Br,92:jr},Wa={[-5]:St,[-4]:St,[-3]:St,33:ba,38:Br,42:Bt,60:[Co,sa],91:Ca,92:[Go,jr],93:rn,95:Bt,96:_o},Ya={null:[Bt,Na]},Qa={null:[42,95]},Xa={null:[]},Ga=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Qa,contentInitial:Ha,disable:Xa,document:Ba,flow:Ua,flowInitial:qa,insideSpan:Ya,string:Va,text:Wa},Symbol.toStringTag,{value:"Module"}));function Ka(e,n,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const i={},l=[];let o=[],a=[];const u={attempt:_(L),check:_(b),consume:I,enter:E,exit:R,interrupt:_(b,{interrupt:!0})},s={code:null,containerState:{},defineSkip:y,events:[],now:g,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:c};let f=n.tokenize.call(s,u);return n.resolveAll&&l.push(n),s;function c(T){return o=ae(o,T),C(),o[o.length-1]!==null?[]:(B(n,0),s.events=gt(l,s.events,s),s.events)}function p(T,P){return Za(h(T),P)}function h(T){return Ja(o,T)}function g(){const{_bufferIndex:T,_index:P,line:H,column:Y,offset:$}=r;return{_bufferIndex:T,_index:P,line:H,column:Y,offset:$}}function y(T){i[T.line]=T.column,k()}function C(){let T;for(;r._index<o.length;){const P=o[r._index];if(typeof P=="string")for(T=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===T&&r._bufferIndex<P.length;)x(P.charCodeAt(r._bufferIndex));else x(P)}}function x(T){f=f(T)}function I(T){z(T)?(r.line++,r.column=1,r.offset+=T===-3?2:1,k()):T!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),s.previous=T}function E(T,P){const H=P||{};return H.type=T,H.start=g(),s.events.push(["enter",H,s]),a.push(H),H}function R(T){const P=a.pop();return P.end=g(),s.events.push(["exit",P,s]),P}function L(T,P){B(T,P.from)}function b(T,P){P.restore()}function _(T,P){return H;function H(Y,$,K){let X,ue,de,m;return Array.isArray(Y)?ge(Y):"tokenize"in Y?ge([Y]):se(Y);function se(G){return je;function je(be){const Pe=be!==null&&G[be],ze=be!==null&&G.null,et=[...Array.isArray(Pe)?Pe:Pe?[Pe]:[],...Array.isArray(ze)?ze:ze?[ze]:[]];return ge(et)(be)}}function ge(G){return X=G,ue=0,G.length===0?K:d(G[ue])}function d(G){return je;function je(be){return m=j(),de=G,G.partial||(s.currentConstruct=G),G.name&&s.parser.constructs.disable.null.includes(G.name)?Se():G.tokenize.call(P?Object.assign(Object.create(s),P):s,u,ce,Se)(be)}}function ce(G){return T(de,m),$}function Se(G){return m.restore(),++ue<X.length?d(X[ue]):K}}}function B(T,P){T.resolveAll&&!l.includes(T)&&l.push(T),T.resolve&&oe(s.events,P,s.events.length-P,T.resolve(s.events.slice(P),s)),T.resolveTo&&(s.events=T.resolveTo(s.events,s))}function j(){const T=g(),P=s.previous,H=s.currentConstruct,Y=s.events.length,$=Array.from(a);return{from:Y,restore:K};function K(){r=T,s.previous=P,s.currentConstruct=H,s.events.length=Y,a=$,k()}}function k(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ja(e,n){const t=n.start._index,r=n.start._bufferIndex,i=n.end._index,l=n.end._bufferIndex;let o;if(t===i)o=[e[t].slice(r,l)];else{if(o=e.slice(t,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}l>0&&o.push(e[i].slice(0,l))}return o}function Za(e,n){let t=-1;const r=[];let i;for(;++t<e.length;){const l=e[t];let o;if(typeof l=="string")o=l;else switch(l){case-5:{o="\r";break}case-4:{o=`
    18 `;break}case-3:{o=`\r
    19 `;break}case-2:{o=n?" ":"   ";break}case-1:{if(!n&&i)continue;o=" ";break}default:o=String.fromCharCode(l)}i=l===-2,r.push(o)}return r.join("")}function eu(e){const r={constructs:Nr([Ga,...(e||{}).extensions||[]]),content:i(mo),defined:[],document:i(xo),flow:i(_a),lazy:{},string:i(Oa),text:i($a)};return r;function i(l){return o;function o(a){return Ka(r,l,a)}}}function tu(e){for(;!Hr(e););return e}const jn=/[\0\t\n\r]/g;function nu(){let e=1,n="",t=!0,r;return i;function i(l,o,a){const u=[];let s,f,c,p,h;for(l=n+(typeof l=="string"?l.toString():new TextDecoder(o||void 0).decode(l)),c=0,n="",t&&(l.charCodeAt(0)===65279&&c++,t=void 0);c<l.length;){if(jn.lastIndex=c,s=jn.exec(l),p=s&&s.index!==void 0?s.index:l.length,h=l.charCodeAt(p),!s){n=l.slice(c);break}if(h===10&&c===p&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),c<p&&(u.push(l.slice(c,p)),e+=p-c),h){case 0:{u.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,u.push(-2);e++<f;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}c=p+1}return a&&(r&&u.push(-5),n&&u.push(n),u.push(null)),u}}const ru=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function iu(e){return e.replace(ru,lu)}function lu(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),l=i===120||i===88;return Or(t.slice(l?2:1),l?16:10)}return nn(t)||e}const Qr={}.hasOwnProperty;function ou(e,n,t){return typeof n!="string"&&(t=n,n=void 0),au(t)(tu(eu(t).document().write(nu()(e,n,!0))))}function au(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(xn),autolinkProtocol:j,autolinkEmail:j,atxHeading:l(mn),blockQuote:l(ze),characterEscape:j,characterReference:j,codeFenced:l(et),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:l(et,o),codeText:l(Ri,o),codeTextData:j,data:j,codeFlowValue:j,definition:l(_i),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:l(Mi),hardBreakEscape:l(dn),hardBreakTrailing:l(dn),htmlFlow:l(gn,o),htmlFlowData:j,htmlText:l(gn,o),htmlTextData:j,image:l(Ni),label:o,link:l(xn),listItem:l(Oi),listItemValue:p,listOrdered:l(yn,c),listUnordered:l(yn),paragraph:l($i),reference:d,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:l(mn),strong:l(ji),thematicBreak:l(Hi)},exit:{atxHeading:u(),atxHeadingSequence:L,autolink:u(),autolinkEmail:Pe,autolinkProtocol:be,blockQuote:u(),characterEscapeValue:k,characterReferenceMarkerHexadecimal:Se,characterReferenceMarkerNumeric:Se,characterReferenceValue:G,characterReference:je,codeFenced:u(C),codeFencedFence:y,codeFencedFenceInfo:h,codeFencedFenceMeta:g,codeFlowValue:k,codeIndented:u(x),codeText:u($),codeTextData:k,data:k,definition:u(),definitionDestinationString:R,definitionLabelString:I,definitionTitleString:E,emphasis:u(),hardBreakEscape:u(P),hardBreakTrailing:u(P),htmlFlow:u(H),htmlFlowData:k,htmlText:u(Y),htmlTextData:k,image:u(X),label:de,labelText:ue,lineEnding:T,link:u(K),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ce,resourceDestinationString:m,resourceTitleString:se,resource:ge,setextHeading:u(B),setextHeadingLineSequence:_,setextHeadingText:b,strong:u(),thematicBreak:u()}};Xr(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(w){let v={type:"root",children:[]};const D={stack:[v],tokenStack:[],config:n,enter:a,exit:s,buffer:o,resume:f,data:t},N=[];let q=-1;for(;++q<w.length;)if(w[q][1].type==="listOrdered"||w[q][1].type==="listUnordered")if(w[q][0]==="enter")N.push(q);else{const fe=N.pop();q=i(w,fe,q)}for(q=-1;++q<w.length;){const fe=n[w[q][0]];Qr.call(fe,w[q][1].type)&&fe[w[q][1].type].call(Object.assign({sliceSerialize:w[q][2].sliceSerialize},D),w[q][1])}if(D.tokenStack.length>0){const fe=D.tokenStack[D.tokenStack.length-1];(fe[1]||Bn).call(D,void 0,fe[0])}for(v.position={start:we(w.length>0?w[0][1].start:{line:1,column:1,offset:0}),end:we(w.length>0?w[w.length-2][1].end:{line:1,column:1,offset:0})},q=-1;++q<n.transforms.length;)v=n.transforms[q](v)||v;return v}function i(w,v,D){let N=v-1,q=-1,fe=!1,Ee,xe,Be,He;for(;++N<=D;){const ie=w[N];switch(ie[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ie[0]==="enter"?q++:q--,He=void 0;break}case"lineEndingBlank":{ie[0]==="enter"&&(Ee&&!He&&!q&&!Be&&(Be=N),He=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:He=void 0}if(!q&&ie[0]==="enter"&&ie[1].type==="listItemPrefix"||q===-1&&ie[0]==="exit"&&(ie[1].type==="listUnordered"||ie[1].type==="listOrdered")){if(Ee){let Le=N;for(xe=void 0;Le--;){const ye=w[Le];if(ye[1].type==="lineEnding"||ye[1].type==="lineEndingBlank"){if(ye[0]==="exit")continue;xe&&(w[xe][1].type="lineEndingBlank",fe=!0),ye[1].type="lineEnding",xe=Le}else if(!(ye[1].type==="linePrefix"||ye[1].type==="blockQuotePrefix"||ye[1].type==="blockQuotePrefixWhitespace"||ye[1].type==="blockQuoteMarker"||ye[1].type==="listItemIndent"))break}Be&&(!xe||Be<xe)&&(Ee._spread=!0),Ee.end=Object.assign({},xe?w[xe][1].start:ie[1].end),w.splice(xe||N,0,["exit",Ee,ie[2]]),N++,D++}if(ie[1].type==="listItemPrefix"){const Le={type:"listItem",_spread:!1,start:Object.assign({},ie[1].start),end:void 0};Ee=Le,w.splice(N,0,["enter",Le,ie[2]]),N++,D++,Be=void 0,He=!0}}}return w[v][1]._spread=fe,D}function l(w,v){return D;function D(N){a.call(this,w(N),N),v&&v.call(this,N)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(w,v,D){this.stack[this.stack.length-1].children.push(w),this.stack.push(w),this.tokenStack.push([v,D||void 0]),w.position={start:we(v.start),end:void 0}}function u(w){return v;function v(D){w&&w.call(this,D),s.call(this,D)}}function s(w,v){const D=this.stack.pop(),N=this.tokenStack.pop();if(N)N[0].type!==w.type&&(v?v.call(this,w,N[0]):(N[1]||Bn).call(this,w,N[0]));else throw new Error("Cannot close `"+w.type+"` ("+We({start:w.start,end:w.end})+"): it’s not open");D.position.end=we(w.end)}function f(){return tn(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function p(w){if(this.data.expectingFirstListItemValue){const v=this.stack[this.stack.length-2];v.start=Number.parseInt(this.sliceSerialize(w),10),this.data.expectingFirstListItemValue=void 0}}function h(){const w=this.resume(),v=this.stack[this.stack.length-1];v.lang=w}function g(){const w=this.resume(),v=this.stack[this.stack.length-1];v.meta=w}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const w=this.resume(),v=this.stack[this.stack.length-1];v.value=w.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const w=this.resume(),v=this.stack[this.stack.length-1];v.value=w.replace(/(\r?\n|\r)$/g,"")}function I(w){const v=this.resume(),D=this.stack[this.stack.length-1];D.label=v,D.identifier=he(this.sliceSerialize(w)).toLowerCase()}function E(){const w=this.resume(),v=this.stack[this.stack.length-1];v.title=w}function R(){const w=this.resume(),v=this.stack[this.stack.length-1];v.url=w}function L(w){const v=this.stack[this.stack.length-1];if(!v.depth){const D=this.sliceSerialize(w).length;v.depth=D}}function b(){this.data.setextHeadingSlurpLineEnding=!0}function _(w){const v=this.stack[this.stack.length-1];v.depth=this.sliceSerialize(w).codePointAt(0)===61?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function j(w){const D=this.stack[this.stack.length-1].children;let N=D[D.length-1];(!N||N.type!=="text")&&(N=Bi(),N.position={start:we(w.start),end:void 0},D.push(N)),this.stack.push(N)}function k(w){const v=this.stack.pop();v.value+=this.sliceSerialize(w),v.position.end=we(w.end)}function T(w){const v=this.stack[this.stack.length-1];if(this.data.atHardBreak){const D=v.children[v.children.length-1];D.position.end=we(w.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(v.type)&&(j.call(this,w),k.call(this,w))}function P(){this.data.atHardBreak=!0}function H(){const w=this.resume(),v=this.stack[this.stack.length-1];v.value=w}function Y(){const w=this.resume(),v=this.stack[this.stack.length-1];v.value=w}function $(){const w=this.resume(),v=this.stack[this.stack.length-1];v.value=w}function K(){const w=this.stack[this.stack.length-1];if(this.data.inReference){const v=this.data.referenceType||"shortcut";w.type+="Reference",w.referenceType=v,delete w.url,delete w.title}else delete w.identifier,delete w.label;this.data.referenceType=void 0}function X(){const w=this.stack[this.stack.length-1];if(this.data.inReference){const v=this.data.referenceType||"shortcut";w.type+="Reference",w.referenceType=v,delete w.url,delete w.title}else delete w.identifier,delete w.label;this.data.referenceType=void 0}function ue(w){const v=this.sliceSerialize(w),D=this.stack[this.stack.length-2];D.label=iu(v),D.identifier=he(v).toLowerCase()}function de(){const w=this.stack[this.stack.length-1],v=this.resume(),D=this.stack[this.stack.length-1];if(this.data.inReference=!0,D.type==="link"){const N=w.children;D.children=N}else D.alt=v}function m(){const w=this.resume(),v=this.stack[this.stack.length-1];v.url=w}function se(){const w=this.resume(),v=this.stack[this.stack.length-1];v.title=w}function ge(){this.data.inReference=void 0}function d(){this.data.referenceType="collapsed"}function ce(w){const v=this.resume(),D=this.stack[this.stack.length-1];D.label=v,D.identifier=he(this.sliceSerialize(w)).toLowerCase(),this.data.referenceType="full"}function Se(w){this.data.characterReferenceType=w.type}function G(w){const v=this.sliceSerialize(w),D=this.data.characterReferenceType;let N;D?(N=Or(v,D==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):N=nn(v);const q=this.stack[this.stack.length-1];q.value+=N}function je(w){const v=this.stack.pop();v.position.end=we(w.end)}function be(w){k.call(this,w);const v=this.stack[this.stack.length-1];v.url=this.sliceSerialize(w)}function Pe(w){k.call(this,w);const v=this.stack[this.stack.length-1];v.url="mailto:"+this.sliceSerialize(w)}function ze(){return{type:"blockquote",children:[]}}function et(){return{type:"code",lang:null,meta:null,value:""}}function Ri(){return{type:"inlineCode",value:""}}function _i(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Mi(){return{type:"emphasis",children:[]}}function mn(){return{type:"heading",depth:0,children:[]}}function dn(){return{type:"break"}}function gn(){return{type:"html",value:""}}function Ni(){return{type:"image",title:null,url:"",alt:null}}function xn(){return{type:"link",title:null,url:"",children:[]}}function yn(w){return{type:"list",ordered:w.type==="listOrdered",start:null,spread:w._spread,children:[]}}function Oi(w){return{type:"listItem",spread:w._spread,checked:null,children:[]}}function $i(){return{type:"paragraph",children:[]}}function ji(){return{type:"strong",children:[]}}function Bi(){return{type:"text",value:""}}function Hi(){return{type:"thematicBreak"}}}function we(e){return{line:e.line,column:e.column,offset:e.offset}}function Xr(e,n){let t=-1;for(;++t<n.length;){const r=n[t];Array.isArray(r)?Xr(e,r):uu(e,r)}}function uu(e,n){let t;for(t in n)if(Qr.call(n,t))switch(t){case"canContainEols":{const r=n[t];r&&e[t].push(...r);break}case"transforms":{const r=n[t];r&&e[t].push(...r);break}case"enter":case"exit":{const r=n[t];r&&Object.assign(e[t],r);break}}}function Bn(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+We({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+We({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+We({start:n.start,end:n.end})+") is still open")}function su(e){const n=this;n.parser=t;function t(r){return ou(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function cu(e,n){const t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,t),e.applyData(n,t)}function fu(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:`
    20 `}]}function hu(e,n){const t=n.value?n.value+`
    21 `:"",r={};n.lang&&(r.className=["language-"+n.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(i.data={meta:n.meta}),e.patch(n,i),i=e.applyData(n,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(n,i),i}function pu(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function mu(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function du(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),i=$e(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=l+1,a+=1,e.footnoteCounts.set(r,a);const u={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+i,id:t+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(n,u);const s={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(n,s),e.applyData(n,s)}function gu(e,n){const t={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function xu(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function Gr(e,n){const t=n.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const i=e.all(n),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function yu(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return Gr(e,n);const i={src:$e(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,l),e.applyData(n,l)}function ku(e,n){const t={src:$e(n.url)};n.alt!==null&&n.alt!==void 0&&(t.alt=n.alt),n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,r),e.applyData(n,r)}function bu(e,n){const t={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,t);const r={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(n,r),e.applyData(n,r)}function wu(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return Gr(e,n);const i={href:$e(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}function Cu(e,n){const t={href:$e(n.url)};n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function Su(e,n,t){const r=e.all(n),i=t?Eu(t):Kr(n),l={},o=[];if(typeof n.checked=="boolean"){const f=r[0];let c;f&&f.type==="element"&&f.tagName==="p"?c=f:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const f=r[a];(i||a!==0||f.type!=="element"||f.tagName!=="p")&&o.push({type:"text",value:`
    22 `}),f.type==="element"&&f.tagName==="p"&&!i?o.push(...f.children):o.push(f)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
    23 `});const s={type:"element",tagName:"li",properties:l,children:o};return e.patch(n,s),e.applyData(n,s)}function Eu(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const t=e.children;let r=-1;for(;!n&&++r<t.length;)n=Kr(t[r])}return n}function Kr(e){const n=e.spread;return n??e.children.length>1}function Iu(e,n){const t={},r=e.all(n);let i=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){t.className=["contains-task-list"];break}}const l={type:"element",tagName:n.ordered?"ol":"ul",properties:t,children:e.wrap(r,!0)};return e.patch(n,l),e.applyData(n,l)}function vu(e,n){const t={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Au(e,n){const t={type:"root",children:e.wrap(e.all(n))};return e.patch(n,t),e.applyData(n,t)}function Tu(e,n){const t={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Pu(e,n){const t=e.all(n),r=t.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],o),i.push(o)}if(t.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},a=Kt(n.children[1]),u=zr(n.children[n.children.length-1]);a&&u&&(o.position={start:a,end:u}),i.push(o)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(n,l),e.applyData(n,l)}function zu(e,n,t){const r=t?t.children:void 0,l=(r?r.indexOf(n):1)===0?"th":"td",o=t&&t.type==="table"?t.align:void 0,a=o?o.length:n.children.length;let u=-1;const s=[];for(;++u<a;){const c=n.children[u],p={},h=o?o[u]:void 0;h&&(p.align=h);let g={type:"element",tagName:l,properties:p,children:[]};c&&(g.children=e.all(c),e.patch(c,g),g=e.applyData(c,g)),s.push(g)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(s,!0)};return e.patch(n,f),e.applyData(n,f)}function Lu(e,n){const t={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const Hn=9,qn=32;function Du(e){const n=String(e),t=/\r?\n|\r/g;let r=t.exec(n),i=0;const l=[];for(;r;)l.push(Un(n.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=t.exec(n);return l.push(Un(n.slice(i),i>0,!1)),l.join("")}function Un(e,n,t){let r=0,i=e.length;if(n){let l=e.codePointAt(r);for(;l===Hn||l===qn;)r++,l=e.codePointAt(r)}if(t){let l=e.codePointAt(i-1);for(;l===Hn||l===qn;)i--,l=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Fu(e,n){const t={type:"text",value:Du(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function Ru(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const _u={blockquote:cu,break:fu,code:hu,delete:pu,emphasis:mu,footnoteReference:du,heading:gu,html:xu,imageReference:yu,image:ku,inlineCode:bu,linkReference:wu,link:Cu,listItem:Su,list:Iu,paragraph:vu,root:Au,strong:Tu,table:Pu,tableCell:Lu,tableRow:zu,text:Fu,thematicBreak:Ru,toml:tt,yaml:tt,definition:tt,footnoteDefinition:tt};function tt(){}const Jr=-1,xt=0,Qe=1,ft=2,ln=3,on=4,an=5,un=6,Zr=7,ei=8,Vn=typeof self=="object"?self:globalThis,Mu=(e,n)=>{const t=(i,l)=>(e.set(l,i),i),r=i=>{if(e.has(i))return e.get(i);const[l,o]=n[i];switch(l){case xt:case Jr:return t(o,i);case Qe:{const a=t([],i);for(const u of o)a.push(r(u));return a}case ft:{const a=t({},i);for(const[u,s]of o)a[r(u)]=r(s);return a}case ln:return t(new Date(o),i);case on:{const{source:a,flags:u}=o;return t(new RegExp(a,u),i)}case an:{const a=t(new Map,i);for(const[u,s]of o)a.set(r(u),r(s));return a}case un:{const a=t(new Set,i);for(const u of o)a.add(r(u));return a}case Zr:{const{name:a,message:u}=o;return t(new Vn[a](u),i)}case ei:return t(BigInt(o),i);case"BigInt":return t(Object(BigInt(o)),i);case"ArrayBuffer":return t(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return t(new DataView(a),o)}}return t(new Vn[l](o),i)};return r},Wn=e=>Mu(new Map,e)(0),De="",{toString:Nu}={},{keys:Ou}=Object,Ue=e=>{const n=typeof e;if(n!=="object"||!e)return[xt,n];const t=Nu.call(e).slice(8,-1);switch(t){case"Array":return[Qe,De];case"Object":return[ft,De];case"Date":return[ln,De];case"RegExp":return[on,De];case"Map":return[an,De];case"Set":return[un,De];case"DataView":return[Qe,t]}return t.includes("Array")?[Qe,t]:t.includes("Error")?[Zr,t]:[ft,t]},nt=([e,n])=>e===xt&&(n==="function"||n==="symbol"),$u=(e,n,t,r)=>{const i=(o,a)=>{const u=r.push(o)-1;return t.set(a,u),u},l=o=>{if(t.has(o))return t.get(o);let[a,u]=Ue(o);switch(a){case xt:{let f=o;switch(u){case"bigint":a=ei,f=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);f=null;break;case"undefined":return i([Jr],o)}return i([a,f],o)}case Qe:{if(u){let p=o;return u==="DataView"?p=new Uint8Array(o.buffer):u==="ArrayBuffer"&&(p=new Uint8Array(o)),i([u,[...p]],o)}const f=[],c=i([a,f],o);for(const p of o)f.push(l(p));return c}case ft:{if(u)switch(u){case"BigInt":return i([u,o.toString()],o);case"Boolean":case"Number":case"String":return i([u,o.valueOf()],o)}if(n&&"toJSON"in o)return l(o.toJSON());const f=[],c=i([a,f],o);for(const p of Ou(o))(e||!nt(Ue(o[p])))&&f.push([l(p),l(o[p])]);return c}case ln:return i([a,o.toISOString()],o);case on:{const{source:f,flags:c}=o;return i([a,{source:f,flags:c}],o)}case an:{const f=[],c=i([a,f],o);for(const[p,h]of o)(e||!(nt(Ue(p))||nt(Ue(h))))&&f.push([l(p),l(h)]);return c}case un:{const f=[],c=i([a,f],o);for(const p of o)(e||!nt(Ue(p)))&&f.push(l(p));return c}}const{message:s}=o;return i([a,{name:u,message:s}],o)};return l},Yn=(e,{json:n,lossy:t}={})=>{const r=[];return $u(!(n||t),!!n,new Map,r)(e),r},ht=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?Wn(Yn(e,n)):structuredClone(e):(e,n)=>Wn(Yn(e,n));function ju(e,n){const t=[{type:"text",value:"↩"}];return n>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),t}function Bu(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function Hu(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||ju,r=e.options.footnoteBackLabel||Bu,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let u=-1;for(;++u<e.footnoteOrder.length;){const s=e.footnoteById.get(e.footnoteOrder[u]);if(!s)continue;const f=e.all(s),c=String(s.identifier).toUpperCase(),p=$e(c.toLowerCase());let h=0;const g=[],y=e.footnoteCounts.get(c);for(;y!==void 0&&++h<=y;){g.length>0&&g.push({type:"text",value:" "});let I=typeof t=="string"?t:t(u,h);typeof I=="string"&&(I={type:"text",value:I}),g.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,h),className:["data-footnote-backref"]},children:Array.isArray(I)?I:[I]})}const C=f[f.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const I=C.children[C.children.length-1];I&&I.type==="text"?I.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...g)}else f.push(...g);const x={type:"element",tagName:"li",properties:{id:n+"fn-"+p},children:e.wrap(f,!0)};e.patch(s,x),a.push(x)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...ht(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
    24 `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
    25 `}]}}const yt=function(e){if(e==null)return Wu;if(typeof e=="function")return kt(e);if(typeof e=="object")return Array.isArray(e)?qu(e):Uu(e);if(typeof e=="string")return Vu(e);throw new Error("Expected function, string, or object as test")};function qu(e){const n=[];let t=-1;for(;++t<e.length;)n[t]=yt(e[t]);return kt(r);function r(...i){let l=-1;for(;++l<n.length;)if(n[l].apply(this,i))return!0;return!1}}function Uu(e){const n=e;return kt(t);function t(r){const i=r;let l;for(l in e)if(i[l]!==n[l])return!1;return!0}}function Vu(e){return kt(n);function n(t){return t&&t.type===e}}function kt(e){return n;function n(t,r,i){return!!(Yu(t)&&e.call(this,t,typeof r=="number"?r:void 0,i||void 0))}}function Wu(){return!0}function Yu(e){return e!==null&&typeof e=="object"&&"type"in e}const ti=[],Qu=!0,Ht=!1,Xu="skip";function ni(e,n,t,r){let i;typeof n=="function"&&typeof t!="function"?(r=t,t=n):i=n;const l=yt(i),o=r?-1:1;a(e,void 0,[])();function a(u,s,f){const c=u&&typeof u=="object"?u:{};if(typeof c.type=="string"){const h=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(u.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=ti,g,y,C;if((!n||l(u,s,f[f.length-1]||void 0))&&(h=Gu(t(u,f)),h[0]===Ht))return h;if("children"in u&&u.children){const x=u;if(x.children&&h[0]!==Xu)for(y=(r?x.children.length:-1)+o,C=f.concat(x);y>-1&&y<x.children.length;){const I=x.children[y];if(g=a(I,y,C)(),g[0]===Ht)return g;y=typeof g[1]=="number"?g[1]:y+o}}return h}}}function Gu(e){return Array.isArray(e)?e:typeof e=="number"?[Qu,e]:e==null?ti:[e]}function sn(e,n,t,r){let i,l,o;typeof n=="function"&&typeof t!="function"?(l=void 0,o=n,i=t):(l=n,o=t,i=r),ni(e,l,a,i);function a(u,s){const f=s[s.length-1],c=f?f.children.indexOf(u):void 0;return o(u,c,f)}}const qt={}.hasOwnProperty,Ku={};function Ju(e,n){const t=n||Ku,r=new Map,i=new Map,l=new Map,o={..._u,...t.handlers},a={all:s,applyData:es,definitionById:r,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:o,one:u,options:t,patch:Zu,wrap:ns};return sn(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const c=f.type==="definition"?r:i,p=String(f.identifier).toUpperCase();c.has(p)||c.set(p,f)}}),a;function u(f,c){const p=f.type,h=a.handlers[p];if(qt.call(a.handlers,p)&&h)return h(a,f,c);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in f){const{children:y,...C}=f,x=ht(C);return x.children=a.all(f),x}return ht(f)}return(a.options.unknownHandler||ts)(a,f,c)}function s(f){const c=[];if("children"in f){const p=f.children;let h=-1;for(;++h<p.length;){const g=a.one(p[h],f);if(g){if(h&&p[h-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=Qn(g.value)),!Array.isArray(g)&&g.type==="element")){const y=g.children[0];y&&y.type==="text"&&(y.value=Qn(y.value))}Array.isArray(g)?c.push(...g):c.push(g)}}}return c}}function Zu(e,n){e.position&&(n.position=jl(e))}function es(e,n){let t=n;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,l=e.data.hProperties;if(typeof r=="string")if(t.type==="element")t.tagName=r;else{const o="children"in t?t.children:[t];t={type:"element",tagName:r,properties:{},children:o}}t.type==="element"&&l&&Object.assign(t.properties,ht(l)),"children"in t&&t.children&&i!==null&&i!==void 0&&(t.children=i)}return t}function ts(e,n){const t=n.data||{},r="value"in n&&!(qt.call(t,"hProperties")||qt.call(t,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function ns(e,n){const t=[];let r=-1;for(n&&t.push({type:"text",value:`
    26 `});++r<e.length;)r&&t.push({type:"text",value:`
    27 `}),t.push(e[r]);return n&&e.length>0&&t.push({type:"text",value:`
    28 `}),t}function Qn(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function Xn(e,n){const t=Ju(e,n),r=t.one(e,void 0),i=Hu(t),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&l.children.push({type:"text",value:`
    29 `},i),l}function rs(e,n){return e&&"run"in e?async function(t,r){const i=Xn(t,{file:r,...n});await e.run(i,r)}:function(t,r){return Xn(t,{file:r,...e||n})}}function Gn(e){if(e)throw e}var ot=Object.prototype.hasOwnProperty,ri=Object.prototype.toString,Kn=Object.defineProperty,Jn=Object.getOwnPropertyDescriptor,Zn=function(n){return typeof Array.isArray=="function"?Array.isArray(n):ri.call(n)==="[object Array]"},er=function(n){if(!n||ri.call(n)!=="[object Object]")return!1;var t=ot.call(n,"constructor"),r=n.constructor&&n.constructor.prototype&&ot.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!t&&!r)return!1;var i;for(i in n);return typeof i>"u"||ot.call(n,i)},tr=function(n,t){Kn&&t.name==="__proto__"?Kn(n,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):n[t.name]=t.newValue},nr=function(n,t){if(t==="__proto__")if(ot.call(n,t)){if(Jn)return Jn(n,t).value}else return;return n[t]},is=function e(){var n,t,r,i,l,o,a=arguments[0],u=1,s=arguments.length,f=!1;for(typeof a=="boolean"&&(f=a,a=arguments[1]||{},u=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});u<s;++u)if(n=arguments[u],n!=null)for(t in n)r=nr(a,t),i=nr(n,t),a!==i&&(f&&i&&(er(i)||(l=Zn(i)))?(l?(l=!1,o=r&&Zn(r)?r:[]):o=r&&er(r)?r:{},tr(a,{name:t,newValue:e(f,o,i)})):typeof i<"u"&&tr(a,{name:t,newValue:i}));return a};const Et=xr(is);function Ut(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function ls(){const e=[],n={run:t,use:r};return n;function t(...i){let l=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...i);function a(u,...s){const f=e[++l];let c=-1;if(u){o(u);return}for(;++c<i.length;)(s[c]===null||s[c]===void 0)&&(s[c]=i[c]);i=s,f?os(f,a)(...s):o(null,...s)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),n}}function os(e,n){let t;return r;function r(...o){const a=e.length>o.length;let u;a&&o.push(i);try{u=e.apply(this,o)}catch(s){const f=s;if(a&&t)throw f;return i(f)}a||(u&&u.then&&typeof u.then=="function"?u.then(l,i):u instanceof Error?i(u):l(u))}function i(o,...a){t||(t=!0,n(o,...a))}function l(o){i(null,o)}}const pe={basename:as,dirname:us,extname:ss,join:cs,sep:"/"};function as(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Ze(e);let t=0,r=-1,i=e.length,l;if(n===void 0||n.length===0||n.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(l){t=i+1;break}}else r<0&&(l=!0,r=i+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let o=-1,a=n.length-1;for(;i--;)if(e.codePointAt(i)===47){if(l){t=i+1;break}}else o<0&&(l=!0,o=i+1),a>-1&&(e.codePointAt(i)===n.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return t===r?r=o:r<0&&(r=e.length),e.slice(t,r)}function us(e){if(Ze(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function ss(e){Ze(e);let n=e.length,t=-1,r=0,i=-1,l=0,o;for(;n--;){const a=e.codePointAt(n);if(a===47){if(o){r=n+1;break}continue}t<0&&(o=!0,t=n+1),a===46?i<0?i=n:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||t<0||l===0||l===1&&i===t-1&&i===r+1?"":e.slice(i,t)}function cs(...e){let n=-1,t;for(;++n<e.length;)Ze(e[n]),e[n]&&(t=t===void 0?e[n]:t+"/"+e[n]);return t===void 0?".":fs(t)}function fs(e){Ze(e);const n=e.codePointAt(0)===47;let t=hs(e,!n);return t.length===0&&!n&&(t="."),t.length>0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function hs(e,n){let t="",r=0,i=-1,l=0,o=-1,a,u;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(i===o-1||l===1))if(i!==o-1&&l===2){if(t.length<2||r!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(u=t.lastIndexOf("/"),u!==t.length-1){u<0?(t="",r=0):(t=t.slice(0,u),r=t.length-1-t.lastIndexOf("/")),i=o,l=0;continue}}else if(t.length>0){t="",r=0,i=o,l=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(i+1,o):t=e.slice(i+1,o),r=o-i-1;i=o,l=0}else a===46&&l>-1?l++:l=-1}return t}function Ze(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const ps={cwd:ms};function ms(){return"/"}function Vt(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function ds(e){if(typeof e=="string")e=new URL(e);else if(!Vt(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return gs(e)}function gs(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let t=-1;for(;++t<n.length;)if(n.codePointAt(t)===37&&n.codePointAt(t+1)===50){const r=n.codePointAt(t+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(n)}const It=["history","path","basename","stem","extname","dirname"];class ii{constructor(n){let t;n?Vt(n)?t={path:n}:typeof n=="string"||xs(n)?t={value:n}:t=n:t={},this.cwd="cwd"in t?"":ps.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<It.length;){const l=It[r];l in t&&t[l]!==void 0&&t[l]!==null&&(this[l]=l==="history"?[...t[l]]:t[l])}let i;for(i in t)It.includes(i)||(this[i]=t[i])}get basename(){return typeof this.path=="string"?pe.basename(this.path):void 0}set basename(n){At(n,"basename"),vt(n,"basename"),this.path=pe.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?pe.dirname(this.path):void 0}set dirname(n){rr(this.basename,"dirname"),this.path=pe.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?pe.extname(this.path):void 0}set extname(n){if(vt(n,"extname"),rr(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=pe.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){Vt(n)&&(n=ds(n)),At(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?pe.basename(this.path,this.extname):void 0}set stem(n){At(n,"stem"),vt(n,"stem"),this.path=pe.join(this.dirname||"",n+(this.extname||""))}fail(n,t,r){const i=this.message(n,t,r);throw i.fatal=!0,i}info(n,t,r){const i=this.message(n,t,r);return i.fatal=void 0,i}message(n,t,r){const i=new Z(n,t,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function vt(e,n){if(e&&e.includes(pe.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+pe.sep+"`")}function At(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function rr(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function xs(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ys=function(e){const r=this.constructor.prototype,i=r[e],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,r),l},ks={}.hasOwnProperty;class cn extends ys{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=ls()}copy(){const n=new cn;let t=-1;for(;++t<this.attachers.length;){const r=this.attachers[t];n.use(...r)}return n.data(Et(!0,{},this.namespace)),n}data(n,t){return typeof n=="string"?arguments.length===2?(zt("data",this.frozen),this.namespace[n]=t,this):ks.call(this.namespace,n)&&this.namespace[n]||void 0:n?(zt("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=t.call(n,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const t=rt(n),r=this.parser||this.Parser;return Tt("parse",r),r(String(t),t)}process(n,t){const r=this;return this.freeze(),Tt("process",this.parser||this.Parser),Pt("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(l,o){const a=rt(n),u=r.parse(a);r.run(u,a,function(f,c,p){if(f||!c||!p)return s(f);const h=c,g=r.stringify(h,p);Cs(g)?p.value=g:p.result=g,s(f,p)});function s(f,c){f||!c?o(f):l?l(c):t(void 0,c)}}}processSync(n){let t=!1,r;return this.freeze(),Tt("processSync",this.parser||this.Parser),Pt("processSync",this.compiler||this.Compiler),this.process(n,i),lr("processSync","process",t),r;function i(l,o){t=!0,Gn(l),r=o}}run(n,t,r){ir(n),this.freeze();const i=this.transformers;return!r&&typeof t=="function"&&(r=t,t=void 0),r?l(void 0,r):new Promise(l);function l(o,a){const u=rt(t);i.run(n,u,s);function s(f,c,p){const h=c||n;f?a(f):o?o(h):r(void 0,h,p)}}}runSync(n,t){let r=!1,i;return this.run(n,t,l),lr("runSync","run",r),i;function l(o,a){Gn(o),i=a,r=!0}}stringify(n,t){this.freeze();const r=rt(t),i=this.compiler||this.Compiler;return Pt("stringify",i),ir(n),i(n,r)}use(n,...t){const r=this.attachers,i=this.namespace;if(zt("use",this.frozen),n!=null)if(typeof n=="function")u(n,t);else if(typeof n=="object")Array.isArray(n)?a(n):o(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function l(s){if(typeof s=="function")u(s,[]);else if(typeof s=="object")if(Array.isArray(s)){const[f,...c]=s;u(f,c)}else o(s);else throw new TypeError("Expected usable value, not `"+s+"`")}function o(s){if(!("plugins"in s)&&!("settings"in s))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(s.plugins),s.settings&&(i.settings=Et(!0,i.settings,s.settings))}function a(s){let f=-1;if(s!=null)if(Array.isArray(s))for(;++f<s.length;){const c=s[f];l(c)}else throw new TypeError("Expected a list of plugins, not `"+s+"`")}function u(s,f){let c=-1,p=-1;for(;++c<r.length;)if(r[c][0]===s){p=c;break}if(p===-1)r.push([s,...f]);else if(f.length>0){let[h,...g]=f;const y=r[p][1];Ut(y)&&Ut(h)&&(h=Et(!0,y,h)),r[p]=[s,h,...g]}}}}const bs=new cn().freeze();function Tt(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Pt(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function zt(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ir(e){if(!Ut(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function lr(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function rt(e){return ws(e)?e:new ii(e)}function ws(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Cs(e){return typeof e=="string"||Ss(e)}function Ss(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Es="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",or=[],ar={allowDangerousHtml:!0},Is=/^(https?|ircs?|mailto|xmpp)$/i,vs=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function As(e){const n=Ts(e),t=Ps(e);return zs(n.runSync(n.parse(t),t),e)}function Ts(e){const n=e.rehypePlugins||or,t=e.remarkPlugins||or,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...ar}:ar;return bs().use(su).use(t).use(rs,r).use(n)}function Ps(e){const n=e.children||"",t=new ii;return typeof n=="string"&&(t.value=n),t}function zs(e,n){const t=n.allowedElements,r=n.allowElement,i=n.components,l=n.disallowedElements,o=n.skipHtml,a=n.unwrapDisallowed,u=n.urlTransform||Ls;for(const f of vs)Object.hasOwn(n,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+Es+f.id,void 0);return n.className&&(e={type:"element",tagName:"div",properties:{className:n.className},children:e.type==="root"?e.children:[e]}),sn(e,s),Vl(e,{Fragment:A.Fragment,components:i,ignoreInvalidStyle:!0,jsx:A.jsx,jsxs:A.jsxs,passKeys:!0,passNode:!0});function s(f,c,p){if(f.type==="raw"&&p&&typeof c=="number")return o?p.children.splice(c,1):p.children[c]={type:"text",value:f.value},c;if(f.type==="element"){let h;for(h in wt)if(Object.hasOwn(wt,h)&&Object.hasOwn(f.properties,h)){const g=f.properties[h],y=wt[h];(y===null||y.includes(f.tagName))&&(f.properties[h]=u(String(g||""),h,f))}}if(f.type==="element"){let h=t?!t.includes(f.tagName):l?l.includes(f.tagName):!1;if(!h&&r&&typeof c=="number"&&(h=!r(f,c,p)),h&&p&&typeof c=="number")return a&&f.children?p.children.splice(c,1,...f.children):p.children.splice(c,1),c}}}function Ls(e){const n=e.indexOf(":"),t=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return n===-1||i!==-1&&n>i||t!==-1&&n>t||r!==-1&&n>r||Is.test(e.slice(0,n))?e:""}function ur(e,n){const t=String(e);if(typeof n!="string")throw new TypeError("Expected character");let r=0,i=t.indexOf(n);for(;i!==-1;)r++,i=t.indexOf(n,i+n.length);return r}function Ds(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Fs(e,n,t){const i=yt((t||{}).ignore||[]),l=Rs(n);let o=-1;for(;++o<l.length;)ni(e,"text",a);function a(s,f){let c=-1,p;for(;++c<f.length;){const h=f[c],g=p?p.children:void 0;if(i(h,g?g.indexOf(h):void 0,p))return;p=h}if(p)return u(s,f)}function u(s,f){const c=f[f.length-1],p=l[o][0],h=l[o][1];let g=0;const C=c.children.indexOf(s);let x=!1,I=[];p.lastIndex=0;let E=p.exec(s.value);for(;E;){const R=E.index,L={index:E.index,input:E.input,stack:[...f,s]};let b=h(...E,L);if(typeof b=="string"&&(b=b.length>0?{type:"text",value:b}:void 0),b===!1?p.lastIndex=R+1:(g!==R&&I.push({type:"text",value:s.value.slice(g,R)}),Array.isArray(b)?I.push(...b):b&&I.push(b),g=R+E[0].length,x=!0),!p.global)break;E=p.exec(s.value)}return x?(g<s.value.length&&I.push({type:"text",value:s.value.slice(g)}),c.children.splice(C,1,...I)):I=[s],C+I.length}}function Rs(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const t=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<t.length;){const i=t[r];n.push([_s(i[0]),Ms(i[1])])}return n}function _s(e){return typeof e=="string"?new RegExp(Ds(e),"g"):e}function Ms(e){return typeof e=="function"?e:function(){return e}}const Lt="phrasing",Dt=["autolink","link","image","label"];function Ns(){return{transforms:[Us],enter:{literalAutolink:$s,literalAutolinkEmail:Ft,literalAutolinkHttp:Ft,literalAutolinkWww:Ft},exit:{literalAutolink:qs,literalAutolinkEmail:Hs,literalAutolinkHttp:js,literalAutolinkWww:Bs}}}function Os(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Lt,notInConstruct:Dt},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Lt,notInConstruct:Dt},{character:":",before:"[ps]",after:"\\/",inConstruct:Lt,notInConstruct:Dt}]}}function $s(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ft(e){this.config.enter.autolinkProtocol.call(this,e)}function js(e){this.config.exit.autolinkProtocol.call(this,e)}function Bs(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function Hs(e){this.config.exit.autolinkEmail.call(this,e)}function qs(e){this.exit(e)}function Us(e){Fs(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Vs],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Ws]],{ignore:["link","linkReference"]})}function Vs(e,n,t,r,i){let l="";if(!li(i)||(/^w/i.test(n)&&(t=n+t,n="",l="http://"),!Ys(t)))return!1;const o=Qs(t+r);if(!o[0])return!1;const a={type:"link",title:null,url:l+n+o[0],children:[{type:"text",value:n+o[0]}]};return o[1]?[a,{type:"text",value:o[1]}]:a}function Ws(e,n,t,r){return!li(r,!0)||/[-\d_]$/.test(t)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+t,children:[{type:"text",value:n+"@"+t}]}}function Ys(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function Qs(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],r=t.indexOf(")");const i=ur(e,"(");let l=ur(e,")");for(;r!==-1&&i>l;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),l++;return[e,t]}function li(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||Ae(t)||dt(t))&&(!n||t!==47)}oi.peek=rc;function Xs(){this.buffer()}function Gs(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Ks(){this.buffer()}function Js(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Zs(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=he(this.sliceSerialize(e)).toLowerCase(),t.label=n}function ec(e){this.exit(e)}function tc(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=he(this.sliceSerialize(e)).toLowerCase(),t.label=n}function nc(e){this.exit(e)}function rc(){return"["}function oi(e,n,t,r){const i=t.createTracker(r);let l=i.move("[^");const o=t.enter("footnoteReference"),a=t.enter("reference");return l+=i.move(t.safe(t.associationId(e),{after:"]",before:l})),a(),o(),l+=i.move("]"),l}function ic(){return{enter:{gfmFootnoteCallString:Xs,gfmFootnoteCall:Gs,gfmFootnoteDefinitionLabelString:Ks,gfmFootnoteDefinition:Js},exit:{gfmFootnoteCallString:Zs,gfmFootnoteCall:ec,gfmFootnoteDefinitionLabelString:tc,gfmFootnoteDefinition:nc}}}function lc(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:oi},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,i,l,o){const a=l.createTracker(o);let u=a.move("[^");const s=l.enter("footnoteDefinition"),f=l.enter("label");return u+=a.move(l.safe(l.associationId(r),{before:u,after:"]"})),f(),u+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),u+=a.move((n?`
    30 `:" ")+l.indentLines(l.containerFlow(r,a.current()),n?ai:oc))),s(),u}}function oc(e,n,t){return n===0?e:ai(e,n,t)}function ai(e,n,t){return(t?"":"    ")+e}const ac=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ui.peek=hc;function uc(){return{canContainEols:["delete"],enter:{strikethrough:cc},exit:{strikethrough:fc}}}function sc(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:ac}],handlers:{delete:ui}}}function cc(e){this.enter({type:"delete",children:[]},e)}function fc(e){this.exit(e)}function ui(e,n,t,r){const i=t.createTracker(r),l=t.enter("strikethrough");let o=i.move("~~");return o+=t.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),l(),o}function hc(){return"~"}function pc(e){return e.length}function mc(e,n){const t=n||{},r=(t.align||[]).concat(),i=t.stringLength||pc,l=[],o=[],a=[],u=[];let s=0,f=-1;for(;++f<e.length;){const y=[],C=[];let x=-1;for(e[f].length>s&&(s=e[f].length);++x<e[f].length;){const I=dc(e[f][x]);if(t.alignDelimiters!==!1){const E=i(I);C[x]=E,(u[x]===void 0||E>u[x])&&(u[x]=E)}y.push(I)}o[f]=y,a[f]=C}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<s;)l[c]=sr(r[c]);else{const y=sr(r);for(;++c<s;)l[c]=y}c=-1;const p=[],h=[];for(;++c<s;){const y=l[c];let C="",x="";y===99?(C=":",x=":"):y===108?C=":":y===114&&(x=":");let I=t.alignDelimiters===!1?1:Math.max(1,u[c]-C.length-x.length);const E=C+"-".repeat(I)+x;t.alignDelimiters!==!1&&(I=C.length+I+x.length,I>u[c]&&(u[c]=I),h[c]=I),p[c]=E}o.splice(1,0,p),a.splice(1,0,h),f=-1;const g=[];for(;++f<o.length;){const y=o[f],C=a[f];c=-1;const x=[];for(;++c<s;){const I=y[c]||"";let E="",R="";if(t.alignDelimiters!==!1){const L=u[c]-(C[c]||0),b=l[c];b===114?E=" ".repeat(L):b===99?L%2?(E=" ".repeat(L/2+.5),R=" ".repeat(L/2-.5)):(E=" ".repeat(L/2),R=E):R=" ".repeat(L)}t.delimiterStart!==!1&&!c&&x.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&I==="")&&(t.delimiterStart!==!1||c)&&x.push(" "),t.alignDelimiters!==!1&&x.push(E),x.push(I),t.alignDelimiters!==!1&&x.push(R),t.padding!==!1&&x.push(" "),(t.delimiterEnd!==!1||c!==s-1)&&x.push("|")}g.push(t.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return g.join(`
    31 `)}function dc(e){return e==null?"":String(e)}function sr(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}function gc(e,n,t,r){const i=t.enter("blockquote"),l=t.createTracker(r);l.move("> "),l.shift(2);const o=t.indentLines(t.containerFlow(e,l.current()),xc);return i(),o}function xc(e,n,t){return">"+(t?"":" ")+e}function yc(e,n){return cr(e,n.inConstruct,!0)&&!cr(e,n.notInConstruct,!1)}function cr(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let r=-1;for(;++r<n.length;)if(e.includes(n[r]))return!0;return!1}function fr(e,n,t,r){let i=-1;for(;++i<t.unsafe.length;)if(t.unsafe[i].character===`
    32 `&&yc(t.stack,t.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
    33 `}function kc(e,n){const t=String(e);let r=t.indexOf(n),i=r,l=0,o=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++l>o&&(o=l):l=1,i=r+n.length,r=t.indexOf(n,i);return o}function bc(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function wc(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function Cc(e,n,t,r){const i=wc(t),l=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(bc(e,t)){const c=t.enter("codeIndented"),p=t.indentLines(l,Sc);return c(),p}const a=t.createTracker(r),u=i.repeat(Math.max(kc(l,i)+1,3)),s=t.enter("codeFenced");let f=a.move(u);if(e.lang){const c=t.enter(`codeFencedLang${o}`);f+=a.move(t.safe(e.lang,{before:f,after:" ",encode:["`"],...a.current()})),c()}if(e.lang&&e.meta){const c=t.enter(`codeFencedMeta${o}`);f+=a.move(" "),f+=a.move(t.safe(e.meta,{before:f,after:`
    34 `,encode:["`"],...a.current()})),c()}return f+=a.move(`
    35 `),l&&(f+=a.move(l+`
    36 `)),f+=a.move(u),s(),f}function Sc(e,n,t){return(t?"":"    ")+e}function fn(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function Ec(e,n,t,r){const i=fn(t),l=i==='"'?"Quote":"Apostrophe",o=t.enter("definition");let a=t.enter("label");const u=t.createTracker(r);let s=u.move("[");return s+=u.move(t.safe(t.associationId(e),{before:s,after:"]",...u.current()})),s+=u.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=t.enter("destinationLiteral"),s+=u.move("<"),s+=u.move(t.safe(e.url,{before:s,after:">",...u.current()})),s+=u.move(">")):(a=t.enter("destinationRaw"),s+=u.move(t.safe(e.url,{before:s,after:e.title?" ":`
    37 `,...u.current()}))),a(),e.title&&(a=t.enter(`title${l}`),s+=u.move(" "+i),s+=u.move(t.safe(e.title,{before:s,after:i,...u.current()})),s+=u.move(i),a()),o(),s}function Ic(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function Ge(e){return"&#x"+e.toString(16).toUpperCase()+";"}function pt(e,n,t){const r=Ne(e),i=Ne(n);return r===void 0?i===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}si.peek=vc;function si(e,n,t,r){const i=Ic(t),l=t.enter("emphasis"),o=t.createTracker(r),a=o.move(i);let u=o.move(t.containerPhrasing(e,{after:i,before:a,...o.current()}));const s=u.charCodeAt(0),f=pt(r.before.charCodeAt(r.before.length-1),s,i);f.inside&&(u=Ge(s)+u.slice(1));const c=u.charCodeAt(u.length-1),p=pt(r.after.charCodeAt(0),c,i);p.inside&&(u=u.slice(0,-1)+Ge(c));const h=o.move(i);return l(),t.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},a+u+h}function vc(e,n,t){return t.options.emphasis||"*"}function Ac(e,n){let t=!1;return sn(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,Ht}),!!((!e.depth||e.depth<3)&&tn(e)&&(n.options.setext||t))}function Tc(e,n,t,r){const i=Math.max(Math.min(6,e.depth||1),1),l=t.createTracker(r);if(Ac(e,t)){const f=t.enter("headingSetext"),c=t.enter("phrasing"),p=t.containerPhrasing(e,{...l.current(),before:`
    38 `,after:`
    39 `});return c(),f(),p+`
    40 `+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
    41 `))+1))}const o="#".repeat(i),a=t.enter("headingAtx"),u=t.enter("phrasing");l.move(o+" ");let s=t.containerPhrasing(e,{before:"# ",after:`
    42 `,...l.current()});return/^[\t ]/.test(s)&&(s=Ge(s.charCodeAt(0))+s.slice(1)),s=s?o+" "+s:o,t.options.closeAtx&&(s+=" "+o),u(),a(),s}ci.peek=Pc;function ci(e){return e.value||""}function Pc(){return"<"}fi.peek=zc;function fi(e,n,t,r){const i=fn(t),l=i==='"'?"Quote":"Apostrophe",o=t.enter("image");let a=t.enter("label");const u=t.createTracker(r);let s=u.move("![");return s+=u.move(t.safe(e.alt,{before:s,after:"]",...u.current()})),s+=u.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=t.enter("destinationLiteral"),s+=u.move("<"),s+=u.move(t.safe(e.url,{before:s,after:">",...u.current()})),s+=u.move(">")):(a=t.enter("destinationRaw"),s+=u.move(t.safe(e.url,{before:s,after:e.title?" ":")",...u.current()}))),a(),e.title&&(a=t.enter(`title${l}`),s+=u.move(" "+i),s+=u.move(t.safe(e.title,{before:s,after:i,...u.current()})),s+=u.move(i),a()),s+=u.move(")"),o(),s}function zc(){return"!"}hi.peek=Lc;function hi(e,n,t,r){const i=e.referenceType,l=t.enter("imageReference");let o=t.enter("label");const a=t.createTracker(r);let u=a.move("![");const s=t.safe(e.alt,{before:u,after:"]",...a.current()});u+=a.move(s+"]["),o();const f=t.stack;t.stack=[],o=t.enter("reference");const c=t.safe(t.associationId(e),{before:u,after:"]",...a.current()});return o(),t.stack=f,l(),i==="full"||!s||s!==c?u+=a.move(c+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function Lc(){return"!"}pi.peek=Dc;function pi(e,n,t){let r=e.value||"",i="`",l=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<t.unsafe.length;){const o=t.unsafe[l],a=t.compilePattern(o);let u;if(o.atBreak)for(;u=a.exec(r);){let s=u.index;r.charCodeAt(s)===10&&r.charCodeAt(s-1)===13&&s--,r=r.slice(0,s)+" "+r.slice(u.index+1)}}return i+r+i}function Dc(){return"`"}function mi(e,n){const t=tn(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(t===e.url||"mailto:"+t===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}di.peek=Fc;function di(e,n,t,r){const i=fn(t),l=i==='"'?"Quote":"Apostrophe",o=t.createTracker(r);let a,u;if(mi(e,t)){const f=t.stack;t.stack=[],a=t.enter("autolink");let c=o.move("<");return c+=o.move(t.containerPhrasing(e,{before:c,after:">",...o.current()})),c+=o.move(">"),a(),t.stack=f,c}a=t.enter("link"),u=t.enter("label");let s=o.move("[");return s+=o.move(t.containerPhrasing(e,{before:s,after:"](",...o.current()})),s+=o.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=t.enter("destinationLiteral"),s+=o.move("<"),s+=o.move(t.safe(e.url,{before:s,after:">",...o.current()})),s+=o.move(">")):(u=t.enter("destinationRaw"),s+=o.move(t.safe(e.url,{before:s,after:e.title?" ":")",...o.current()}))),u(),e.title&&(u=t.enter(`title${l}`),s+=o.move(" "+i),s+=o.move(t.safe(e.title,{before:s,after:i,...o.current()})),s+=o.move(i),u()),s+=o.move(")"),a(),s}function Fc(e,n,t){return mi(e,t)?"<":"["}gi.peek=Rc;function gi(e,n,t,r){const i=e.referenceType,l=t.enter("linkReference");let o=t.enter("label");const a=t.createTracker(r);let u=a.move("[");const s=t.containerPhrasing(e,{before:u,after:"]",...a.current()});u+=a.move(s+"]["),o();const f=t.stack;t.stack=[],o=t.enter("reference");const c=t.safe(t.associationId(e),{before:u,after:"]",...a.current()});return o(),t.stack=f,l(),i==="full"||!s||s!==c?u+=a.move(c+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function Rc(){return"["}function hn(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function _c(e){const n=hn(e),t=e.options.bulletOther;if(!t)return n==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+t+"`) to be different");return t}function Mc(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function xi(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function Nc(e,n,t,r){const i=t.enter("list"),l=t.bulletCurrent;let o=e.ordered?Mc(t):hn(t);const a=e.ordered?o==="."?")":".":_c(t);let u=n&&t.bulletLastUsed?o===t.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&f&&(!f.children||!f.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(u=!0),xi(t)===o&&f){let c=-1;for(;++c<e.children.length;){const p=e.children[c];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(o=a),t.bulletCurrent=o;const s=t.containerFlow(e,r);return t.bulletLastUsed=o,t.bulletCurrent=l,i(),s}function Oc(e){const n=e.options.listItemIndent||"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function $c(e,n,t,r){const i=Oc(t);let l=t.bulletCurrent||hn(t);n&&n.type==="list"&&n.ordered&&(l=(typeof n.start=="number"&&n.start>-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+l);let o=l.length+1;(i==="tab"||i==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(o=Math.ceil(o/4)*4);const a=t.createTracker(r);a.move(l+" ".repeat(o-l.length)),a.shift(o);const u=t.enter("listItem"),s=t.indentLines(t.containerFlow(e,a.current()),f);return u(),s;function f(c,p,h){return p?(h?"":" ".repeat(o))+c:(h?l:l+" ".repeat(o-l.length))+c}}function jc(e,n,t,r){const i=t.enter("paragraph"),l=t.enter("phrasing"),o=t.containerPhrasing(e,r);return l(),i(),o}const Bc=yt(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Hc(e,n,t,r){return(e.children.some(function(o){return Bc(o)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function qc(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}yi.peek=Uc;function yi(e,n,t,r){const i=qc(t),l=t.enter("strong"),o=t.createTracker(r),a=o.move(i+i);let u=o.move(t.containerPhrasing(e,{after:i,before:a,...o.current()}));const s=u.charCodeAt(0),f=pt(r.before.charCodeAt(r.before.length-1),s,i);f.inside&&(u=Ge(s)+u.slice(1));const c=u.charCodeAt(u.length-1),p=pt(r.after.charCodeAt(0),c,i);p.inside&&(u=u.slice(0,-1)+Ge(c));const h=o.move(i+i);return l(),t.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},a+u+h}function Uc(e,n,t){return t.options.strong||"*"}function Vc(e,n,t,r){return t.safe(e.value,r)}function Wc(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function Yc(e,n,t){const r=(xi(t)+(t.options.ruleSpaces?" ":"")).repeat(Wc(t));return t.options.ruleSpaces?r.slice(0,-1):r}const ki={blockquote:gc,break:fr,code:Cc,definition:Ec,emphasis:si,hardBreak:fr,heading:Tc,html:ci,image:fi,imageReference:hi,inlineCode:pi,link:di,linkReference:gi,list:Nc,listItem:$c,paragraph:jc,root:Hc,strong:yi,text:Vc,thematicBreak:Yc};function Qc(){return{enter:{table:Xc,tableData:hr,tableHeader:hr,tableRow:Kc},exit:{codeText:Jc,table:Gc,tableData:Rt,tableHeader:Rt,tableRow:Rt}}}function Xc(e){const n=e._align;this.enter({type:"table",align:n.map(function(t){return t==="none"?null:t}),children:[]},e),this.data.inTable=!0}function Gc(e){this.exit(e),this.data.inTable=void 0}function Kc(e){this.enter({type:"tableRow",children:[]},e)}function Rt(e){this.exit(e)}function hr(e){this.enter({type:"tableCell",children:[]},e)}function Jc(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,Zc));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function Zc(e,n){return n==="|"?n:e}function ef(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,i=n.stringLength,l=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
    43 `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[    :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:o,tableCell:u,tableRow:a}};function o(h,g,y,C){return s(f(h,y,C),h.align)}function a(h,g,y,C){const x=c(h,y,C),I=s([x]);return I.slice(0,I.indexOf(`
    44 `))}function u(h,g,y,C){const x=y.enter("tableCell"),I=y.enter("phrasing"),E=y.containerPhrasing(h,{...C,before:l,after:l});return I(),x(),E}function s(h,g){return mc(h,{align:g,alignDelimiters:r,padding:t,stringLength:i})}function f(h,g,y){const C=h.children;let x=-1;const I=[],E=g.enter("table");for(;++x<C.length;)I[x]=c(C[x],g,y);return E(),I}function c(h,g,y){const C=h.children;let x=-1;const I=[],E=g.enter("tableRow");for(;++x<C.length;)I[x]=u(C[x],h,g,y);return E(),I}function p(h,g,y){let C=ki.inlineCode(h,g,y);return y.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function tf(){return{exit:{taskListCheckValueChecked:pr,taskListCheckValueUnchecked:pr,paragraph:rf}}}function nf(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:lf}}}function pr(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function rf(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const t=this.stack[this.stack.length-1];t.type;const r=t.children[0];if(r&&r.type==="text"){const i=n.children;let l=-1,o;for(;++l<i.length;){const a=i[l];if(a.type==="paragraph"){o=a;break}}o===t&&(r.value=r.value.slice(1),r.value.length===0?t.children.shift():t.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,t.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function lf(e,n,t,r){const i=e.children[0],l=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",a=t.createTracker(r);l&&a.move(o);let u=ki.listItem(e,n,t,{...r,...a.current()});return l&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,s)),u;function s(f){return f+o}}function of(){return[Ns(),ic(),uc(),Qc(),tf()]}function af(e){return{extensions:[Os(),lc(e),sc(),ef(e),nf()]}}const uf={tokenize:mf,partial:!0},bi={tokenize:df,partial:!0},wi={tokenize:gf,partial:!0},Ci={tokenize:xf,partial:!0},sf={tokenize:yf,partial:!0},Si={name:"wwwAutolink",tokenize:hf,previous:Ii},Ei={name:"protocolAutolink",tokenize:pf,previous:vi},ke={name:"emailAutolink",tokenize:ff,previous:Ai},me={};function cf(){return{text:me}}let Ie=48;for(;Ie<123;)me[Ie]=ke,Ie++,Ie===58?Ie=65:Ie===91&&(Ie=97);me[43]=ke;me[45]=ke;me[46]=ke;me[95]=ke;me[72]=[ke,Ei];me[104]=[ke,Ei];me[87]=[ke,Si];me[119]=[ke,Si];function ff(e,n,t){const r=this;let i,l;return o;function o(c){return!Wt(c)||!Ai.call(r,r.previous)||pn(r.events)?t(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return Wt(c)?(e.consume(c),a):c===64?(e.consume(c),u):t(c)}function u(c){return c===46?e.check(sf,f,s)(c):c===45||c===95||J(c)?(l=!0,e.consume(c),u):f(c)}function s(c){return e.consume(c),i=!0,u}function f(c){return l&&i&&ee(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(c)):t(c)}}function hf(e,n,t){const r=this;return i;function i(o){return o!==87&&o!==119||!Ii.call(r,r.previous)||pn(r.events)?t(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(uf,e.attempt(bi,e.attempt(wi,l),t),t)(o))}function l(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(o)}}function pf(e,n,t){const r=this;let i="",l=!1;return o;function o(c){return(c===72||c===104)&&vi.call(r,r.previous)&&!pn(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),a):t(c)}function a(c){if(ee(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),a;if(c===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(c),u}return t(c)}function u(c){return c===47?(e.consume(c),l?s:(l=!0,u)):t(c)}function s(c){return c===null||ct(c)||U(c)||Ae(c)||dt(c)?t(c):e.attempt(bi,e.attempt(wi,f),t)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(c)}}function mf(e,n,t){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),l):t(o)}function l(o){return o===null?t(o):n(o)}}function df(e,n,t){let r,i,l;return o;function o(s){return s===46||s===95?e.check(Ci,u,a)(s):s===null||U(s)||Ae(s)||s!==45&&dt(s)?u(s):(l=!0,e.consume(s),o)}function a(s){return s===95?r=!0:(i=r,r=void 0),e.consume(s),o}function u(s){return i||r||!l?t(s):n(s)}}function gf(e,n){let t=0,r=0;return i;function i(o){return o===40?(t++,e.consume(o),i):o===41&&r<t?l(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Ci,n,l)(o):o===null||U(o)||Ae(o)?n(o):(e.consume(o),i)}function l(o){return o===41&&r++,e.consume(o),i}}function xf(e,n,t){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),l):a===93?(e.consume(a),i):a===60||a===null||U(a)||Ae(a)?n(a):t(a)}function i(a){return a===null||a===40||a===91||U(a)||Ae(a)?n(a):r(a)}function l(a){return ee(a)?o(a):t(a)}function o(a){return a===59?(e.consume(a),r):ee(a)?(e.consume(a),o):t(a)}}function yf(e,n,t){return r;function r(l){return e.consume(l),i}function i(l){return J(l)?t(l):n(l)}}function Ii(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||U(e)}function vi(e){return!ee(e)}function Ai(e){return!(e===47||Wt(e))}function Wt(e){return e===43||e===45||e===46||e===95||J(e)}function pn(e){let n=e.length,t=!1;for(;n--;){const r=e[n][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){t=!0;break}if(r._gfmAutolinkLiteralWalkedInto){t=!1;break}}return e.length>0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const kf={tokenize:Af,partial:!0};function bf(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Ef,continuation:{tokenize:If},exit:vf}},text:{91:{name:"gfmFootnoteCall",tokenize:Sf},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:wf,resolveTo:Cf}}}}function wf(e,n,t){const r=this;let i=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){o=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return a;function a(u){if(!o||!o._balanced)return t(u);const s=he(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!l.includes(s.slice(1))?t(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),n(u))}}function Cf(e,n){let t=e.length;for(;t--;)if(e[t][1].type==="labelImage"&&e[t][0]==="enter"){e[t][1];break}e[t+1][1].type="data",e[t+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[t+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},a=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",i,n],["exit",i,n],["enter",l,n],["enter",o,n],["exit",o,n],["exit",l,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...a),e}function Sf(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,o;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),u}function u(c){return c!==94?t(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",s)}function s(c){if(l>999||c===93&&!o||c===null||c===91||U(c))return t(c);if(c===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(he(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(c)}return U(c)||(o=!0),l++,e.consume(c),c===92?f:s}function f(c){return c===91||c===92||c===93?(e.consume(c),l++,s):s(c)}}function Ef(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,o=0,a;return u;function u(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),s}function s(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):t(g)}function f(g){if(o>999||g===93&&!a||g===null||g===91||U(g))return t(g);if(g===93){e.exit("chunkString");const y=e.exit("gfmFootnoteDefinitionLabelString");return l=he(r.sliceSerialize(y)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return U(g)||(a=!0),o++,e.consume(g),g===92?c:f}function c(g){return g===91||g===92||g===93?(e.consume(g),o++,f):f(g)}function p(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(l)||i.push(l),O(e,h,"gfmFootnoteDefinitionWhitespace")):t(g)}function h(g){return n(g)}}function If(e,n,t){return e.check(Je,n,e.attempt(kf,n,t))}function vf(e){e.exit("gfmFootnoteDefinition")}function Af(e,n,t){const r=this;return O(e,i,"gfmFootnoteDefinitionIndent",5);function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?n(l):t(l)}}function Tf(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:i};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,a){let u=-1;for(;++u<o.length;)if(o[u][0]==="enter"&&o[u][1].type==="strikethroughSequenceTemporary"&&o[u][1]._close){let s=u;for(;s--;)if(o[s][0]==="exit"&&o[s][1].type==="strikethroughSequenceTemporary"&&o[s][1]._open&&o[u][1].end.offset-o[u][1].start.offset===o[s][1].end.offset-o[s][1].start.offset){o[u][1].type="strikethroughSequence",o[s][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},o[s][1].start),end:Object.assign({},o[u][1].end)},c={type:"strikethroughText",start:Object.assign({},o[s][1].end),end:Object.assign({},o[u][1].start)},p=[["enter",f,a],["enter",o[s][1],a],["exit",o[s][1],a],["enter",c,a]],h=a.parser.constructs.insideSpan.null;h&&oe(p,p.length,0,gt(h,o.slice(s+1,u),a)),oe(p,p.length,0,[["exit",c,a],["enter",o[u][1],a],["exit",o[u][1],a],["exit",f,a]]),oe(o,s-1,u-s+3,p),u=s+p.length-2;break}}for(u=-1;++u<o.length;)o[u][1].type==="strikethroughSequenceTemporary"&&(o[u][1].type="data");return o}function l(o,a,u){const s=this.previous,f=this.events;let c=0;return p;function p(g){return s===126&&f[f.length-1][1].type!=="characterEscape"?u(g):(o.enter("strikethroughSequenceTemporary"),h(g))}function h(g){const y=Ne(s);if(g===126)return c>1?u(g):(o.consume(g),c++,h);if(c<2&&!t)return u(g);const C=o.exit("strikethroughSequenceTemporary"),x=Ne(g);return C._open=!x||x===2&&!!y,C._close=!y||y===2&&!!x,a(g)}}}class Pf{constructor(){this.map=[]}add(n,t,r){zf(this,n,t,r)}consume(n){if(this.map.sort(function(l,o){return l[0]-o[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];r.push(n.slice()),n.length=0;let i=r.pop();for(;i;){for(const l of i)n.push(l);i=r.pop()}this.map.length=0}}function zf(e,n,t,r){let i=0;if(!(t===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===n){e.map[i][1]+=t,e.map[i][2].push(...r);return}i+=1}e.map.push([n,t,r])}}function Lf(e,n){let t=!1;const r=[];for(;n<e.length;){const i=e[n];if(t){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(t=!0);n+=1}return r}function Df(){return{flow:{null:{name:"table",tokenize:Ff,resolveAll:Rf}}}}function Ff(e,n,t){const r=this;let i=0,l=0,o;return a;function a(k){let T=r.events.length-1;for(;T>-1;){const Y=r.events[T][1].type;if(Y==="lineEnding"||Y==="linePrefix")T--;else break}const P=T>-1?r.events[T][1].type:null,H=P==="tableHead"||P==="tableRow"?b:u;return H===b&&r.parser.lazy[r.now().line]?t(k):H(k)}function u(k){return e.enter("tableHead"),e.enter("tableRow"),s(k)}function s(k){return k===124||(o=!0,l+=1),f(k)}function f(k){return k===null?t(k):z(k)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),h):t(k):M(k)?O(e,f,"whitespace")(k):(l+=1,o&&(o=!1,i+=1),k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),o=!0,f):(e.enter("data"),c(k)))}function c(k){return k===null||k===124||U(k)?(e.exit("data"),f(k)):(e.consume(k),k===92?p:c)}function p(k){return k===92||k===124?(e.consume(k),c):c(k)}function h(k){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(k):(e.enter("tableDelimiterRow"),o=!1,M(k)?O(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):g(k))}function g(k){return k===45||k===58?C(k):k===124?(o=!0,e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),y):L(k)}function y(k){return M(k)?O(e,C,"whitespace")(k):C(k)}function C(k){return k===58?(l+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),x):k===45?(l+=1,x(k)):k===null||z(k)?R(k):L(k)}function x(k){return k===45?(e.enter("tableDelimiterFiller"),I(k)):L(k)}function I(k){return k===45?(e.consume(k),I):k===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),E):(e.exit("tableDelimiterFiller"),E(k))}function E(k){return M(k)?O(e,R,"whitespace")(k):R(k)}function R(k){return k===124?g(k):k===null||z(k)?!o||i!==l?L(k):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(k)):L(k)}function L(k){return t(k)}function b(k){return e.enter("tableRow"),_(k)}function _(k){return k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),_):k===null||z(k)?(e.exit("tableRow"),n(k)):M(k)?O(e,_,"whitespace")(k):(e.enter("data"),B(k))}function B(k){return k===null||k===124||U(k)?(e.exit("data"),_(k)):(e.consume(k),k===92?j:B)}function j(k){return k===92||k===124?(e.consume(k),B):B(k)}}function Rf(e,n){let t=-1,r=!0,i=0,l=[0,0,0,0],o=[0,0,0,0],a=!1,u=0,s,f,c;const p=new Pf;for(;++t<e.length;){const h=e[t],g=h[1];h[0]==="enter"?g.type==="tableHead"?(a=!1,u!==0&&(mr(p,n,u,s,f),f=void 0,u=0),s={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(t,0,[["enter",s,n]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,c=void 0,l=[0,0,0,0],o=[0,t+1,0,0],a&&(a=!1,f={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(t,0,[["enter",f,n]])),i=g.type==="tableDelimiterRow"?2:f?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(l[1]!==0&&(o[0]=o[1],c=it(p,n,l,i,void 0,c),l=[0,0,0,0]),o[2]=t)):g.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(o[0]=o[1],c=it(p,n,l,i,void 0,c)),l=o,o=[l[1],t,0,0])):g.type==="tableHead"?(a=!0,u=t):g.type==="tableRow"||g.type==="tableDelimiterRow"?(u=t,l[1]!==0?(o[0]=o[1],c=it(p,n,l,i,t,c)):o[1]!==0&&(c=it(p,n,o,i,t,c)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(o[3]=t)}for(u!==0&&mr(p,n,u,s,f),p.consume(n.events),t=-1;++t<n.events.length;){const h=n.events[t];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=Lf(n.events,t))}return e}function it(e,n,t,r,i,l){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";t[0]!==0&&(l.end=Object.assign({},_e(n.events,t[0])),e.add(t[0],0,[["exit",l,n]]));const u=_e(n.events,t[1]);if(l={type:o,start:Object.assign({},u),end:Object.assign({},u)},e.add(t[1],0,[["enter",l,n]]),t[2]!==0){const s=_e(n.events,t[2]),f=_e(n.events,t[3]),c={type:a,start:Object.assign({},s),end:Object.assign({},f)};if(e.add(t[2],0,[["enter",c,n]]),r!==2){const p=n.events[t[2]],h=n.events[t[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",t[3]>t[2]+1){const g=t[2]+1,y=t[3]-t[2]-1;e.add(g,y,[])}}e.add(t[3]+1,0,[["exit",c,n]])}return i!==void 0&&(l.end=Object.assign({},_e(n.events,i)),e.add(i,0,[["exit",l,n]]),l=void 0),l}function mr(e,n,t,r,i){const l=[],o=_e(n.events,t);i&&(i.end=Object.assign({},o),l.push(["exit",i,n])),r.end=Object.assign({},o),l.push(["exit",r,n]),e.add(t+1,0,l)}function _e(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const _f={name:"tasklistCheck",tokenize:Nf};function Mf(){return{text:{91:_f}}}function Nf(e,n,t){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),l)}function l(u){return U(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),o):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),o):t(u)}function o(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):t(u)}function a(u){return z(u)?n(u):M(u)?e.check({tokenize:Of},n,t)(u):t(u)}}function Of(e,n,t){return O(e,r,"whitespace");function r(i){return i===null?t(i):n(i)}}function $f(e){return Nr([cf(),bf(),Tf(e),Df(),Mf()])}const jf={};function Bf(e){const n=this,t=e||jf,r=n.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push($f(t)),l.push(of()),o.push(af(t))}const at=W.forwardRef(({className:e,children:n,isStreaming:t=!1,...r},i)=>A.jsxs("div",{ref:i,className:ne("prose prose-sm dark:prose-invert max-w-none text-sm",e),...r,children:[A.jsx(As,{remarkPlugins:[Bf],children:n}),t&&A.jsx("span",{className:"inline-block w-2 h-4 ml-1 bg-current animate-pulse"})]}));at.displayName="Response";const Ti=W.forwardRef(({className:e,value:n,onChange:t,onSubmit:r,placeholder:i="Type your message...",disabled:l=!1,isLoading:o=!1,...a},u)=>{const s=W.useRef(null);W.useEffect(()=>{s.current&&!l&&!o&&s.current.focus()},[l,o]);const f=c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),n.trim()&&!l&&!o&&(r(),setTimeout(()=>{s.current&&s.current.focus()},0)))};return W.useEffect(()=>{s.current&&(s.current.style.height="auto",s.current.style.height=`${s.current.scrollHeight}px`)},[n]),A.jsxs("div",{ref:u,className:ne("flex gap-2 items-end border-t p-4 bg-background",e),...a,children:[A.jsx(qi,{ref:s,value:n,onChange:c=>t(c.target.value),onKeyDown:f,placeholder:i,disabled:l||o,rows:1,className:"min-h-[44px] max-h-[120px] resize-none focus:outline-none focus:ring-0 focus-visible:outline-none focus-visible:ring-0"}),A.jsxs(st,{onClick:()=>{r(),setTimeout(()=>{s.current&&s.current.focus()},0)},disabled:!n.trim()||l||o,size:"icon",className:"h-11 w-11 shrink-0",children:[A.jsx(Yi,{className:"h-4 w-4"}),A.jsx("span",{className:"sr-only",children:"Send message"})]})]})});Ti.displayName="PromptInput";const Pi=W.forwardRef(({className:e,size:n="md",...t},r)=>{const i={sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"};return A.jsxs("div",{ref:r,className:ne("flex items-center gap-2 text-muted-foreground",e),...t,children:[A.jsx("div",{className:ne("animate-spin rounded-full border-2 border-current border-t-transparent",i[n])}),A.jsx("span",{className:"text-sm italic",children:"Thinking..."})]})});Pi.displayName="Loader";const zi=W.forwardRef(({className:e,suggestions:n,onSelect:t,...r},i)=>!n||n.length===0?null:A.jsx("div",{ref:i,className:ne("flex flex-wrap gap-2 p-4",e),"data-suggestion-container":!0,...r,children:n.map((l,o)=>A.jsx(st,{variant:"outline",size:"sm",onClick:()=>t(l),className:"text-sm","data-suggestion-button":!0,children:l},o))}));zi.displayName="Suggestion";function Li({welcomeText:e,quickQuestions:n=[],placeholder:t,className:r,assistantAvatarUrl:i}){const{t:l}=yr(),[o,a]=W.useState([]),[u,s]=W.useState(""),[f,c]=W.useState(!1),[p,h]=W.useState(null),g=W.useRef(null),y=e||l("chat.welcome");W.useEffect(()=>{g.current&&(g.current.scrollTop=g.current.scrollHeight)},[o,f]);const C=async I=>{const E=I||u.trim();if(!E||f)return;const R={role:"user",content:E,timestamp:Date.now()};a(L=>[...L,R]),s(""),c(!0),h(null);try{const L=o.map(_=>({role:_.role,content:_.content})),b=await Ui({message:E,history:L});if(b.success&&b.message){const _={role:"assistant",content:b.message,timestamp:Date.now()};a(B=>[...B,_])}else throw new Error(b.message||l("chat.error"))}catch(L){const b=L instanceof Error?L.message:l("chat.error");b.includes("daily message limit")||b.includes("daily limit")?h(l("chat.dailyLimitReached")):b.includes("monthly message limit")||b.includes("monthly limit")?h(l("chat.monthlyLimitReached")):b.includes("exceeded")&&b.includes("minute")?h(l("chat.rateLimit")):h(b)}finally{c(!1),setTimeout(()=>{const L=document.querySelector(".pulse-chat-ai-container textarea, .pulse-chat-ai-floating-widget textarea");L&&!L.disabled&&L.focus()},100)}},x=I=>{C(I)};return A.jsxs(wr,{className:ne("h-full flex flex-col",r),children:[A.jsxs(Cr,{ref:g,children:[o.length===0&&A.jsxs(A.Fragment,{children:[A.jsxs(Ve,{from:"assistant",children:[A.jsx(Fe,{from:"assistant",name:"AI Assistant",src:i}),A.jsx(Re,{className:"bg-muted text-foreground border",children:A.jsx(at,{children:y})})]}),n.length>0&&A.jsx(zi,{suggestions:n,onSelect:x})]}),o.map((I,E)=>A.jsx(Ve,{from:I.role,children:I.role==="user"?A.jsxs(A.Fragment,{children:[A.jsx(Re,{className:ne("bg-primary text-primary-foreground"),children:A.jsx(at,{isStreaming:!1,children:I.content})}),A.jsx(Fe,{from:"user",name:"User"})]}):A.jsxs(A.Fragment,{children:[A.jsx(Fe,{from:"assistant",name:"AI Assistant",src:i}),A.jsx(Re,{className:ne("bg-muted text-foreground border"),children:A.jsx(at,{isStreaming:!1,children:I.content})})]})},E)),f&&A.jsxs(Ve,{from:"assistant",children:[A.jsx(Fe,{from:"assistant",name:"AI Assistant",src:i}),A.jsx(Re,{className:"bg-muted text-foreground border",children:A.jsx(Pi,{})})]}),p&&A.jsxs(Ve,{from:"assistant",children:[A.jsx(Fe,{from:"assistant",name:"AI Assistant",src:i}),A.jsx(Re,{className:"bg-destructive/10 text-destructive border border-destructive/20",children:A.jsx("div",{className:"text-sm",children:p})})]})]}),A.jsx(Ti,{value:u,onChange:s,onSubmit:()=>C(),placeholder:t||l("chat.placeholder"),disabled:f,isLoading:f})]})}function dr(e,n){const t=e.replace("#",""),r=parseInt(t.substring(0,2),16),i=parseInt(t.substring(2,4),16),l=parseInt(t.substring(4,6),16);return`rgba(${r}, ${i}, ${l}, ${n})`}const Hf={light:{background:"#ffffff",surface:"#fafafa",text:"#1a1a1a",textSecondary:"#666666",border:"#e5e5e5",userMessage:"#155dfc",assistantMessage:"#ffffff",assistantMessageBorder:"#e5e5e5"},dark:{background:"#0f0f0f",surface:"#1a1a1a",text:"#ffffff",textSecondary:"#b0b0b0",border:"#333333",userMessage:"#3b82f6",assistantMessage:"#1a1a1a",assistantMessageBorder:"#333333"}};function Di(e,n="shortcode"){W.useEffect(()=>{if(!e)return;const t=`pulse-chat-ai-branding-styles-${n}`;let r=document.getElementById(t);r||(r=document.createElement("style"),r.id=t,document.head.appendChild(r));let i="";const l=n==="floating"?".pulse-chat-ai-floating-widget":".pulse-chat-ai-container",o=n==="floating"?".pulse-chat-ai-floating-widget [data-role]":".pulse-chat-ai-container [data-role]",a=e.theme||"light",u=Hf[a],s=e.accent_color||u.userMessage;if(n==="floating"){i+=`${l}, ${l}.border {
    45 `,i+=`  background-color: ${u.background} !important;
    46 `,i+=`  color: ${u.text} !important;
    47 `,i+=`  font-size: 14px !important;
    48 `,i+=`  border-color: ${u.border} !important;
    49 `,i+=`}
    50 
    51 `,i+=`${l} p, ${l} span, ${l} div, ${l} button, ${l} textarea, ${l} input {
    52 `,i+=`  font-size: 14px !important;
    53 `,i+=`}
    54 
    55 `,i+=`${l} h1, ${l} h2, ${l} h3, ${l} h4 {
    56 `,i+=`  font-size: 15px !important;
    57 `,i+=`}
    58 
    59 `,i+=`${l} > div:first-child {
    60 `,i+=`  background-color: ${u.background} !important;
    61 `,i+=`  color: ${u.text} !important;
    62 `,i+=`  border-color: ${u.border} !important;
    63 `,i+=`}
    64 
    65 `,i+=`${l} > div:first-child h3,
    66 `,i+=`${l} > div:first-child svg,
    67 `,i+=`${l} > div:first-child button {
    68 `,i+=`  color: ${u.text} !important;
    69 `,i+=`}
    70 
    71 `,i+=`${o}[data-role="user"], ${o}[data-role="assistant"] {
    72 `,i+=`  background-color: transparent !important;
    73 `,i+=`}
    74 
    75 `;const f=dr(s,.2);i+=`${o}[data-role="user"] .bg-primary {
    76 `,i+=`  background-color: ${f} !important;
    77 `,i+=`  color: ${u.text} !important;
    78 `,i+=`}
    79 
    80 `,i+=`${o}[data-role="assistant"] .bg-muted, ${l} .bg-muted {
    81 `,i+=`  background-color: transparent !important;
    82 `,i+=`  color: ${u.text} !important;
    83 `,i+=`  border-color: transparent !important;
    84 `,i+=`}
    85 
    86 `,i+=`${l} p, ${l} .prose p, ${l} .prose, ${l} .prose * {
    87 `,i+=`  color: ${u.text} !important;
    88 `,i+=`}
    89 
    90 `,i+=`${l} [data-role="assistant"] div.bg-muted.border {
    91 `,i+=`  background-color: ${u.surface} !important;
    92 `,i+=`  border-color: ${u.border} !important;
    93 `,i+=`  color: ${u.textSecondary} !important;
    94 `,i+=`}
    95 
    96 `,i+=`${l} [data-role="user"] div.bg-primary {
    97 `,i+=`  background-color: ${s} !important;
    98 `,i+=`  color: ${u.background} !important;
    99 `,i+=`}
    100 
    101 `,i+=`${l} div.border-t button:not([variant="ghost"]):not([data-suggestion-button]), ${l} button[type="submit"] {
    102 `,i+=`  background-color: ${s} !important;
    103 `,i+=`  color: ${u.background} !important;
    104 `,i+=`  border-color: ${s} !important;
    105 `,i+=`}
    106 
    107 `,i+=`${l} button[data-suggestion-button] {
    108 `,i+=`  border-color: ${u.border} !important;
    109 `,i+=`  color: ${u.text} !important;
    110 `,i+=`  background-color: transparent !important;
    111 `,i+=`}
    112 
    113 `,i+=`${l} button[data-suggestion-button]:hover {
    114 `,i+=`  background-color: ${u.surface} !important;
    115 `,i+=`  color: ${u.text} !important;
    116 `,i+=`  border-color: ${u.border} !important;
    117 `,i+=`}
    118 
    119 `,i+=`${l} .border-t.bg-background, ${l} div.border-t {
    120 `,i+=`  background-color: ${u.background} !important;
    121 `,i+=`  border-color: ${u.border} !important;
    122 `,i+=`}
    123 
    124 `,i+=`${l} textarea, ${l} input {
    125 `,i+=`  background-color: ${u.surface} !important;
    126 `,i+=`  color: ${u.text} !important;
    127 `,i+=`  border-color: ${u.border} !important;
    128 `,i+=`  outline: none !important;
    129 `,i+=`  box-shadow: none !important;
    130 `,i+=`}
    131 
    132 `,i+=`${l} textarea:focus, ${l} textarea:focus-visible, ${l} input:focus, ${l} input:focus-visible {
    133 `,i+=`  outline: none !important;
    134 `,i+=`  box-shadow: none !important;
    135 `,i+=`  ring: none !important;
    136 `,i+=`  border-color: ${u.border} !important;
    137 `,i+=`}
    138 
    139 `,i+=`${l} textarea::placeholder, ${l} input::placeholder {
    140 `,i+=`  color: ${u.textSecondary} !important;
    141 `,i+=`}
    142 
    143 `,i+=`.pulse-chat-ai-bubble-button {
    144 `,i+=`  background-color: ${s} !important;
    145 `,i+=`  border: none !important;
    146 `,i+=`  outline: none !important;
    147 `,i+=`}
    148 
    149 `,i+=`${l} .border-0,
    150 `,i+=`${l} button.border-0,
    151 `,i+=`${l} .text-primary-foreground button,
    152 `,i+=`${l} button:has(svg.lucide-x) {
    153 `,i+=`  border: none !important;
    154 `,i+=`  outline: none !important;
    155 `,i+=`}
    156 
    157 `,i+=`${l} a {
    158 `,i+=`  color: ${s} !important;
    159 `,i+=`}
    160 
    161 `}else{i+=`${l} {
    162 `,i+=`  background-color: ${u.background} !important;
    163 `,i+=`  color: ${u.text} !important;
    164 `,i+=`  font-size: 14px !important;
    165 `,i+=`}
    166 
    167 `,i+=`${l} p, ${l} span, ${l} div, ${l} button, ${l} textarea, ${l} input {
    168 `,i+=`  font-size: 14px !important;
    169 `,i+=`}
    170 
    171 `,i+=`${l} h1, ${l} h2, ${l} h3, ${l} h4 {
    172 `,i+=`  font-size: 15px !important;
    173 `,i+=`}
    174 
    175 `,i+=`${o}[data-role="user"], ${o}[data-role="assistant"] {
    176 `,i+=`  background-color: transparent !important;
    177 `,i+=`}
    178 
    179 `;const f=dr(s,.2);i+=`${o}[data-role="user"] .bg-primary {
    180 `,i+=`  background-color: ${f} !important;
    181 `,i+=`  color: ${u.text} !important;
    182 `,i+=`}
    183 
    184 `,i+=`${o}[data-role="assistant"] .bg-muted, ${l} .bg-muted {
    185 `,i+=`  background-color: transparent !important;
    186 `,i+=`  color: ${u.text} !important;
    187 `,i+=`  border-color: transparent !important;
    188 `,i+=`}
    189 
    190 `,i+=`${l} p, ${l} .prose p, ${l} .prose, ${l} .prose * {
    191 `,i+=`  color: ${u.text} !important;
    192 `,i+=`}
    193 
    194 `,i+=`${l} [data-role="assistant"] div.bg-muted.border {
    195 `,i+=`  background-color: ${u.surface} !important;
    196 `,i+=`  border-color: ${u.border} !important;
    197 `,i+=`  color: ${u.textSecondary} !important;
    198 `,i+=`}
    199 
    200 `,i+=`${l} [data-role="user"] div.bg-primary {
    201 `,i+=`  background-color: ${s} !important;
    202 `,i+=`  color: ${u.background} !important;
    203 `,i+=`}
    204 
    205 `,i+=`${l} div.border-t button:not([variant="ghost"]):not([data-suggestion-button]), ${l} button[type="submit"] {
    206 `,i+=`  background-color: ${s} !important;
    207 `,i+=`  color: ${u.background} !important;
    208 `,i+=`  border-color: ${s} !important;
    209 `,i+=`}
    210 
    211 `,i+=`${l} button[data-suggestion-button] {
    212 `,i+=`  border-color: ${u.border} !important;
    213 `,i+=`  color: ${u.text} !important;
    214 `,i+=`  background-color: transparent !important;
    215 `,i+=`}
    216 
    217 `,i+=`${l} button[data-suggestion-button]:hover {
    218 `,i+=`  background-color: ${u.surface} !important;
    219 `,i+=`  color: ${u.text} !important;
    220 `,i+=`  border-color: ${u.border} !important;
    221 `,i+=`}
    222 
    223 `,i+=`${l} .border-t.bg-background, ${l} div.border-t {
    224 `,i+=`  background-color: ${u.background} !important;
    225 `,i+=`  border-color: ${u.border} !important;
    226 `,i+=`}
    227 
    228 `,i+=`${l} textarea, ${l} input {
    229 `,i+=`  background-color: ${u.surface} !important;
    230 `,i+=`  color: ${u.text} !important;
    231 `,i+=`  border-color: ${u.border} !important;
    232 `,i+=`  outline: none !important;
    233 `,i+=`  box-shadow: none !important;
    234 `,i+=`}
    235 
    236 `,i+=`${l} textarea:focus, ${l} textarea:focus-visible, ${l} input:focus, ${l} input:focus-visible {
    237 `,i+=`  outline: none !important;
    238 `,i+=`  box-shadow: none !important;
    239 `,i+=`  ring: none !important;
    240 `,i+=`  border-color: ${u.border} !important;
    241 `,i+=`}
    242 
    243 `,i+=`${l} textarea::placeholder, ${l} input::placeholder {
    244 `,i+=`  color: ${u.textSecondary} !important;
    245 `,i+=`}
    246 
    247 `,i+=`${l} a {
    248 `,i+=`  color: ${s} !important;
    249 `,i+=`}
    250 
    251 `}return r.textContent=i,()=>{const f=document.getElementById(t);f&&f.remove()}},[e,n])}function qf({options:e}){const{t:n}=yr(),[t,r]=W.useState(!1),[i,l]=W.useState(!1),o=W.useRef(null);Di(e.branding,"floating");const a=()=>{l(!0),setTimeout(()=>{r(!1),l(!1)},200)};if(W.useEffect(()=>{const C=x=>{t&&!i&&o.current&&!o.current.contains(x.target)&&!x.target.closest(".pulse-chat-ai-bubble-button")&&a()};if(t&&!i)return document.addEventListener("mousedown",C),()=>{document.removeEventListener("mousedown",C)}},[t,i]),!e.floating_chat_enabled)return null;const u=[e.quick_question_1,e.quick_question_2,e.quick_question_3].filter(C=>C&&C.trim()),s=e.branding,f=(s==null?void 0:s.bubble_position)||"bottom-right",c=(s==null?void 0:s.bubble_offset_x)||24,p=(s==null?void 0:s.bubble_offset_y)||24,h=(s==null?void 0:s.accent_color)||"#155dfc",g={[f.includes("bottom")?"bottom":"top"]:`${p}px`,[f.includes("right")?"right":"left"]:`${c}px`,backgroundColor:h},y=W.useMemo(()=>{const C=f.includes("bottom"),x=f.includes("right");return{[C?"bottom":"top"]:C?`${p+64}px`:`${p+64}px`,[x?"right":"left"]:`${c}px`,maxWidth:"calc(100vw - 2rem)"}},[f,c,p]);return A.jsxs(A.Fragment,{children:[A.jsx(st,{onClick:()=>{t?a():r(!0)},className:"fixed h-14 w-14 rounded-full shadow-lg z-50 pulse-chat-ai-bubble-button transition-transform hover:scale-110 border-0",style:g,size:"icon",children:t?A.jsx(kn,{className:"h-5 w-5 text-white"}):A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",fill:"white",children:A.jsx("path",{d:"M12 1.75C14.9929 1.75 17.7745 1.87521 20.0723 2.09082C21.3077 2.2068 22.3055 3.16404 22.4434 4.41113C22.6381 6.17328 22.75 8.26308 22.75 10.5C22.75 12.7369 22.6381 14.8267 22.4434 16.5889C22.3055 17.8359 21.3078 18.7932 20.0723 18.9092C19.0518 19.0049 17.9363 19.0806 16.75 19.1377V20.7705C16.7498 21.5875 16.0875 22.2498 15.2705 22.25C14.9171 22.25 14.5749 22.1236 14.3066 21.8936L11.2197 19.2461C8.52443 19.2263 6.02473 19.106 3.92773 18.9092C2.69204 18.7932 1.69445 17.8358 1.55664 16.5889C1.36191 14.8267 1.25 12.7369 1.25 10.5C1.25 8.26308 1.36191 6.17328 1.55664 4.41113C1.69447 3.16404 2.69226 2.20681 3.92773 2.09082C6.22548 1.87521 9.00709 1.75 12 1.75ZM8.00879 9.5C7.45662 9.50013 7.00879 9.9478 7.00879 10.5C7.00879 11.0522 7.45662 11.4999 8.00879 11.5H8.01758L8.12012 11.4951C8.62432 11.4439 9.01758 11.0177 9.01758 10.5C9.01758 9.98227 8.62432 9.55615 8.12012 9.50488L8.01758 9.5H8.00879ZM12.0039 9.5C11.4519 9.50032 11.0039 9.94791 11.0039 10.5C11.0039 11.0521 11.4519 11.4997 12.0039 11.5H12.0137C12.5658 11.4998 13.0137 11.0521 13.0137 10.5C13.0137 9.94785 12.5658 9.50022 12.0137 9.5H12.0039ZM16 9.5C15.4478 9.50013 15 9.9478 15 10.5C15 11.0522 15.4478 11.4999 16 11.5H16.0088C16.5611 11.5 17.0088 11.0523 17.0088 10.5C17.0088 9.94773 16.5611 9.50002 16.0088 9.5H16Z"})})}),t&&A.jsxs("div",{ref:o,className:ne("pulse-chat-ai-floating-widget","fixed z-50 w-[420px] max-w-[calc(100vw-2rem)] h-[600px] max-h-[80vh]","bg-background border rounded-lg shadow-2xl","flex flex-col overflow-hidden",i?"animate-out fade-out-0 zoom-out-95 slide-out-to-bottom-2":"animate-in fade-in-0 zoom-in-95 slide-in-from-bottom-2","duration-200"),style:y,children:[A.jsx("div",{className:"px-6 py-2 border-b bg-background text-foreground rounded-t-lg flex-shrink-0",children:A.jsxs("div",{className:"flex items-center justify-between gap-3",children:[A.jsxs("div",{className:"flex items-center gap-2",children:[A.jsx(br,{className:"h-5 w-5 text-foreground"}),A.jsx("h3",{className:"text-base font-semibold text-foreground",children:n("chat.chatTitle")})]}),A.jsx(st,{variant:"ghost",size:"icon",onClick:a,className:"text-foreground hover:bg-muted h-auto w-auto p-0 border-0",children:A.jsx(kn,{className:"h-5 w-5"})})]})}),A.jsx("div",{className:"flex-1 overflow-hidden min-h-0",children:A.jsx(Li,{welcomeText:e.welcome_text_floating,quickQuestions:u,placeholder:e.chat_placeholder,className:"h-full",assistantAvatarUrl:s==null?void 0:s.avatar_url})})]})]})}function Uf({options:e,height:n="400px"}){Di(e.branding,"shortcode");const t=[e.quick_question_1,e.quick_question_2,e.quick_question_3].filter(a=>a&&a.trim()),r=e.branding,i=(r==null?void 0:r.fullscreen_enabled)||!1,l={height:i?"100vh":n},o=i?"pulse-chat-ai-container fixed inset-0 z-50 border-0 rounded-none bg-background flex flex-col overflow-hidden":"pulse-chat-ai-container border rounded-lg bg-background flex flex-col overflow-hidden";return A.jsx("div",{className:o,style:l,children:A.jsx(Li,{welcomeText:e.welcome_text_floating,quickQuestions:t,placeholder:e.chat_placeholder,className:"flex-1",assistantAvatarUrl:r==null?void 0:r.avatar_url})})}function Fi({options:e,mode:n,height:t}){return n==="floating"?A.jsx(qf,{options:e}):A.jsx(Uf,{options:e,height:t})}const Vf={placeholder:"Type your message...",send:"Send",thinking:"Thinking...",error:"Error sending message",rateLimit:"You have exceeded the message limit per minute. For security reasons, please wait 1 minute before trying again.",dailyLimitReached:"This site has reached its daily message limit. Please contact us via email for assistance.",monthlyLimitReached:"This site has reached its monthly message limit. Please contact us via email for assistance.",welcome:"Hello! I'm your AI assistant. How can I help you today?",timeout:"Request timeout. Please try again.",chatTitle:"AI Assistant",close:"Close",upgradeLink:"upgrade for unlimited access",messagesRemaining:"messages remaining"},Wf={chat:Vf},Yf={placeholder:"Escribe tu mensaje...",send:"Enviar",thinking:"Pensando...",error:"Error al enviar el mensaje",rateLimit:"Te has excedido del límite de mensajes por minuto. Por razones de seguridad, espera 1 minuto antes de intentar de nuevo.",dailyLimitReached:"Este sitio ha alcanzado su límite diario de mensajes. Por favor, contáctanos por correo electrónico para obtener ayuda.",monthlyLimitReached:"Este sitio ha alcanzado su límite mensual de mensajes. Por favor, contáctanos por correo electrónico para obtener ayuda.",welcome:"¡Hola! Soy tu asistente de IA. ¿Cómo puedo ayudarte hoy?",timeout:"Tiempo de espera agotado. Por favor intenta de nuevo.",chatTitle:"Asistente de IA",close:"Cerrar",upgradeLink:"actualiza para acceso ilimitado",messagesRemaining:"mensajes restantes"},Qf={chat:Yf},Xf=()=>{var n;if(typeof window<"u"&&((n=window.pulseChatAI)!=null&&n.locale))return window.pulseChatAI.locale;const e=navigator.language.split("-")[0];return["en","es"].includes(e)?e:"en"};Vi.use(Wi).init({resources:{en:{translation:Wf},es:{translation:Qf}},lng:Xf(),fallbackLng:"en",interpolation:{escapeValue:!1}});const gr=document.getElementById("pulse-chat-ai-floating-root");if(gr){const e=window.pulseChatAI,n=(e==null?void 0:e.options)||{};kr(gr).render(A.jsx(W.StrictMode,{children:A.jsx(Fi,{options:n,mode:"floating"})}))}const Gf=document.querySelectorAll("[data-pulse-chat-ai-shortcode]");Gf.forEach(e=>{const n=window.pulseChatAI,t=(n==null?void 0:n.options)||{},r=e.getAttribute("data-height")||"400px";kr(e).render(A.jsx(W.StrictMode,{children:A.jsx(Fi,{options:t,mode:"shortcode",height:r})}))});
     6 */const oe=W("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]),P=d.forwardRef(({className:n,...s},i)=>o.jsx("div",{ref:i,className:g("flex flex-col h-full",n),...s}));P.displayName="Conversation";const D=d.forwardRef(({className:n,...s},i)=>o.jsx("div",{ref:i,className:g("flex-1 overflow-y-auto p-4 md:p-8 space-y-4",n),...s}));D.displayName="ConversationContent";const F=d.forwardRef(({className:n,value:s,onChange:i,onSubmit:c,placeholder:e="Type your message...",disabled:t=!1,isLoading:l=!1,...m},r)=>{const a=d.useRef(null);d.useEffect(()=>{a.current&&!t&&!l&&a.current.focus()},[t,l]);const u=p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),s.trim()&&!t&&!l&&(c(),setTimeout(()=>{a.current&&a.current.focus()},0)))};return d.useEffect(()=>{a.current&&(a.current.style.height="auto",a.current.style.height=`${a.current.scrollHeight}px`)},[s]),o.jsxs("div",{ref:r,className:g("flex gap-2 items-end border-t p-4 bg-background",n),...m,children:[o.jsx(G,{ref:a,value:s,onChange:p=>i(p.target.value),onKeyDown:u,placeholder:e,disabled:t||l,rows:1,className:"min-h-[44px] max-h-[120px] resize-none focus:outline-none focus:ring-0 focus-visible:outline-none focus-visible:ring-0"}),o.jsxs(M,{onClick:()=>{c(),setTimeout(()=>{a.current&&a.current.focus()},0)},disabled:!s.trim()||t||l,size:"icon",className:"h-11 w-11 shrink-0",children:[o.jsx(oe,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Send message"})]})]})});F.displayName="PromptInput";const Z=d.forwardRef(({className:n,size:s="md",...i},c)=>{const e={sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"};return o.jsxs("div",{ref:c,className:g("flex items-center gap-2 text-muted-foreground",n),...i,children:[o.jsx("div",{className:g("animate-spin rounded-full border-2 border-current border-t-transparent",e[s])}),o.jsx("span",{className:"text-sm italic",children:"Thinking..."})]})});Z.displayName="Loader";const K=d.forwardRef(({className:n,suggestions:s,onSelect:i,...c},e)=>!s||s.length===0?null:o.jsx("div",{ref:e,className:g("flex flex-wrap gap-2",n),"data-suggestion-container":!0,...c,children:s.map((t,l)=>o.jsx(M,{variant:"outline",size:"sm",onClick:()=>i(t),className:"text-sm","data-suggestion-button":!0,children:t},l))}));K.displayName="Suggestion";function O({welcomeText:n,quickQuestions:s=[],placeholder:i,className:c,assistantAvatarUrl:e}){const{t}=B(),[l,m]=d.useState([]),[r,a]=d.useState(""),[u,p]=d.useState(!1),[w,v]=d.useState(null),y=d.useRef(null),E=n||t("chat.welcome");d.useEffect(()=>{y.current&&setTimeout(()=>{y.current&&(y.current.scrollTop=y.current.scrollHeight)},50)},[l,u]);const f=async b=>{const C=b||r.trim();if(!C||u)return;const X={role:"user",content:C,timestamp:Date.now()},R=[...l,X];m(R),a(""),v(null),p(!0);const A=Date.now(),_=300;try{const x=R.map($=>({role:$.role,content:$.content})),j=await J({message:C,history:x}),h=Date.now()-A;if(h<_&&await new Promise($=>setTimeout($,_-h)),j.success&&j.message){const $={role:"assistant",content:j.message,timestamp:Date.now()};m(Y=>[...Y,$])}else throw new Error(j.message||t("chat.error"))}catch(x){const j=Date.now()-A;j<_&&await new Promise($=>setTimeout($,_-j));const h=x instanceof Error?x.message:t("chat.error");h.includes("daily message limit")||h.includes("daily limit")?v(t("chat.dailyLimitReached")):h.includes("monthly message limit")||h.includes("monthly limit")?v(t("chat.monthlyLimitReached")):h.includes("exceeded")&&h.includes("minute")?v(t("chat.rateLimit")):v(h)}finally{p(!1),setTimeout(()=>{const x=document.querySelector(".pulse-chat-ai-container textarea, .pulse-chat-ai-floating-widget textarea");x&&!x.disabled&&x.focus()},100)}},k=b=>{f(b)};return o.jsxs(P,{className:g("h-full flex flex-col",c),children:[o.jsxs(D,{ref:y,children:[l.length===0&&o.jsxs(o.Fragment,{children:[o.jsxs(I,{from:"assistant",children:[o.jsx(N,{from:"assistant",name:"AI Assistant",src:e}),o.jsx(S,{className:"bg-muted text-foreground border",children:o.jsx(T,{children:E})})]}),s.length>0&&o.jsx(K,{suggestions:s,onSelect:k})]}),l.map((b,C)=>o.jsx(I,{from:b.role,children:b.role==="user"?o.jsxs(o.Fragment,{children:[o.jsx(S,{className:g("bg-primary text-primary-foreground"),children:o.jsx(T,{isStreaming:!1,children:b.content})}),o.jsx(N,{from:"user",name:"User"})]}):o.jsxs(o.Fragment,{children:[o.jsx(N,{from:"assistant",name:"AI Assistant",src:e}),o.jsx(S,{className:g("bg-muted text-foreground border"),children:o.jsx(T,{isStreaming:!1,children:b.content})})]})},C)),u&&o.jsxs(I,{from:"assistant",children:[o.jsx(N,{from:"assistant",name:"AI Assistant",src:e}),o.jsx(S,{className:"bg-muted text-foreground border",children:o.jsx(Z,{})})]}),w&&o.jsxs(I,{from:"assistant",children:[o.jsx(N,{from:"assistant",name:"AI Assistant",src:e}),o.jsx(S,{className:"bg-destructive/10 text-destructive border border-destructive/20",children:o.jsx("div",{className:"text-sm",children:w})})]})]}),o.jsx(F,{value:r,onChange:a,onSubmit:()=>f(),placeholder:i||t("chat.placeholder"),disabled:u,isLoading:u})]})}function L(n,s){const i=n.replace("#",""),c=parseInt(i.substring(0,2),16),e=parseInt(i.substring(2,4),16),t=parseInt(i.substring(4,6),16);return`rgba(${c}, ${e}, ${t}, ${s})`}const re={light:{background:"#ffffff",surface:"#fafafa",text:"#1a1a1a",textSecondary:"#666666",border:"#e5e5e5",userMessage:"#155dfc",assistantMessage:"#ffffff",assistantMessageBorder:"#e5e5e5"},dark:{background:"#0f0f0f",surface:"#1a1a1a",text:"#ffffff",textSecondary:"#b0b0b0",border:"#333333",userMessage:"#3b82f6",assistantMessage:"#1a1a1a",assistantMessageBorder:"#333333"}};function Q(n,s="shortcode"){d.useEffect(()=>{if(!n)return;const i=`pulse-chat-ai-branding-styles-${s}`;let c=document.getElementById(i);c||(c=document.createElement("style"),c.id=i,document.head.appendChild(c));let e="";const t=s==="floating"?".pulse-chat-ai-floating-widget":".pulse-chat-ai-container",l=s==="floating"?".pulse-chat-ai-floating-widget [data-role]":".pulse-chat-ai-container [data-role]",m=n.theme||"light",r=re[m],a=n.accent_color||r.userMessage;if(s==="floating"){e+=`${t}, ${t}.border {
     7`,e+=`  background-color: ${r.background} !important;
     8`,e+=`  color: ${r.text} !important;
     9`,e+=`  font-size: 14px !important;
     10`,e+=`  border-color: ${r.border} !important;
     11`,e+=`}
     12
     13`,e+=`${t} p, ${t} span, ${t} div, ${t} button, ${t} textarea, ${t} input {
     14`,e+=`  font-size: 14px !important;
     15`,e+=`}
     16
     17`,e+=`${t} h1, ${t} h2, ${t} h3, ${t} h4 {
     18`,e+=`  font-size: 15px !important;
     19`,e+=`}
     20
     21`,e+=`${t} > div:first-child {
     22`,e+=`  background-color: ${r.background} !important;
     23`,e+=`  color: ${r.text} !important;
     24`,e+=`  border-color: ${r.border} !important;
     25`,e+=`}
     26
     27`,e+=`${t} > div:first-child h3,
     28`,e+=`${t} > div:first-child svg,
     29`,e+=`${t} > div:first-child button {
     30`,e+=`  color: ${r.text} !important;
     31`,e+=`}
     32
     33`,e+=`${l}[data-role="user"], ${l}[data-role="assistant"] {
     34`,e+=`  background-color: transparent !important;
     35`,e+=`}
     36
     37`;const u=L(a,.2);e+=`${l}[data-role="user"] .bg-primary {
     38`,e+=`  background-color: ${u} !important;
     39`,e+=`  color: ${r.text} !important;
     40`,e+=`}
     41
     42`,e+=`${l}[data-role="assistant"] .bg-muted, ${t} .bg-muted {
     43`,e+=`  background-color: transparent !important;
     44`,e+=`  color: ${r.text} !important;
     45`,e+=`  border-color: transparent !important;
     46`,e+=`}
     47
     48`,e+=`${t} p, ${t} .prose p, ${t} .prose, ${t} .prose * {
     49`,e+=`  color: ${r.text} !important;
     50`,e+=`}
     51
     52`,e+=`${t} [data-role="assistant"] div.bg-muted.border {
     53`,e+=`  background-color: ${r.surface} !important;
     54`,e+=`  border-color: ${r.border} !important;
     55`,e+=`  color: ${r.textSecondary} !important;
     56`,e+=`}
     57
     58`,e+=`${t} [data-role="user"] div.bg-primary {
     59`,e+=`  background-color: ${a} !important;
     60`,e+=`  color: ${r.background} !important;
     61`,e+=`}
     62
     63`,e+=`${t} div.border-t button:not([variant="ghost"]):not([data-suggestion-button]), ${t} button[type="submit"] {
     64`,e+=`  background-color: ${a} !important;
     65`,e+=`  color: ${r.background} !important;
     66`,e+=`  border-color: ${a} !important;
     67`,e+=`}
     68
     69`,e+=`${t} button[data-suggestion-button] {
     70`,e+=`  border-color: ${r.border} !important;
     71`,e+=`  color: ${r.text} !important;
     72`,e+=`  background-color: transparent !important;
     73`,e+=`}
     74
     75`,e+=`${t} button[data-suggestion-button]:hover {
     76`,e+=`  background-color: ${r.surface} !important;
     77`,e+=`  color: ${r.text} !important;
     78`,e+=`  border-color: ${r.border} !important;
     79`,e+=`}
     80
     81`,e+=`${t} .border-t.bg-background, ${t} div.border-t {
     82`,e+=`  background-color: ${r.background} !important;
     83`,e+=`  border-color: ${r.border} !important;
     84`,e+=`}
     85
     86`,e+=`${t} textarea, ${t} input {
     87`,e+=`  background-color: ${r.surface} !important;
     88`,e+=`  color: ${r.text} !important;
     89`,e+=`  border-color: ${r.border} !important;
     90`,e+=`  outline: none !important;
     91`,e+=`  box-shadow: none !important;
     92`,e+=`}
     93
     94`,e+=`${t} textarea:focus, ${t} textarea:focus-visible, ${t} input:focus, ${t} input:focus-visible {
     95`,e+=`  outline: none !important;
     96`,e+=`  box-shadow: none !important;
     97`,e+=`  ring: none !important;
     98`,e+=`  border-color: ${r.border} !important;
     99`,e+=`}
     100
     101`,e+=`${t} textarea::placeholder, ${t} input::placeholder {
     102`,e+=`  color: ${r.textSecondary} !important;
     103`,e+=`}
     104
     105`,e+=`.pulse-chat-ai-bubble-button {
     106`,e+=`  background-color: ${a} !important;
     107`,e+=`  border: none !important;
     108`,e+=`  outline: none !important;
     109`,e+=`}
     110
     111`,e+=`${t} .border-0,
     112`,e+=`${t} button.border-0,
     113`,e+=`${t} .text-primary-foreground button,
     114`,e+=`${t} button:has(svg.lucide-x) {
     115`,e+=`  border: none !important;
     116`,e+=`  outline: none !important;
     117`,e+=`}
     118
     119`,e+=`${t} a {
     120`,e+=`  color: ${a} !important;
     121`,e+=`}
     122
     123`}else{e+=`${t} {
     124`,e+=`  background-color: ${r.background} !important;
     125`,e+=`  color: ${r.text} !important;
     126`,e+=`  font-size: 14px !important;
     127`,e+=`}
     128
     129`,e+=`${t} p, ${t} span, ${t} div, ${t} button, ${t} textarea, ${t} input {
     130`,e+=`  font-size: 14px !important;
     131`,e+=`}
     132
     133`,e+=`${t} h1, ${t} h2, ${t} h3, ${t} h4 {
     134`,e+=`  font-size: 15px !important;
     135`,e+=`}
     136
     137`,e+=`${l}[data-role="user"], ${l}[data-role="assistant"] {
     138`,e+=`  background-color: transparent !important;
     139`,e+=`}
     140
     141`;const u=L(a,.2);e+=`${l}[data-role="user"] .bg-primary {
     142`,e+=`  background-color: ${u} !important;
     143`,e+=`  color: ${r.text} !important;
     144`,e+=`}
     145
     146`,e+=`${l}[data-role="assistant"] .bg-muted, ${t} .bg-muted {
     147`,e+=`  background-color: transparent !important;
     148`,e+=`  color: ${r.text} !important;
     149`,e+=`  border-color: transparent !important;
     150`,e+=`}
     151
     152`,e+=`${t} p, ${t} .prose p, ${t} .prose, ${t} .prose * {
     153`,e+=`  color: ${r.text} !important;
     154`,e+=`}
     155
     156`,e+=`${t} [data-role="assistant"] div.bg-muted.border {
     157`,e+=`  background-color: ${r.surface} !important;
     158`,e+=`  border-color: ${r.border} !important;
     159`,e+=`  color: ${r.textSecondary} !important;
     160`,e+=`}
     161
     162`,e+=`${t} [data-role="user"] div.bg-primary {
     163`,e+=`  background-color: ${a} !important;
     164`,e+=`  color: ${r.background} !important;
     165`,e+=`}
     166
     167`,e+=`${t} div.border-t button:not([variant="ghost"]):not([data-suggestion-button]), ${t} button[type="submit"] {
     168`,e+=`  background-color: ${a} !important;
     169`,e+=`  color: ${r.background} !important;
     170`,e+=`  border-color: ${a} !important;
     171`,e+=`}
     172
     173`,e+=`${t} button[data-suggestion-button] {
     174`,e+=`  border-color: ${r.border} !important;
     175`,e+=`  color: ${r.text} !important;
     176`,e+=`  background-color: transparent !important;
     177`,e+=`}
     178
     179`,e+=`${t} button[data-suggestion-button]:hover {
     180`,e+=`  background-color: ${r.surface} !important;
     181`,e+=`  color: ${r.text} !important;
     182`,e+=`  border-color: ${r.border} !important;
     183`,e+=`}
     184
     185`,e+=`${t} .border-t.bg-background, ${t} div.border-t {
     186`,e+=`  background-color: ${r.background} !important;
     187`,e+=`  border-color: ${r.border} !important;
     188`,e+=`}
     189
     190`,e+=`${t} textarea, ${t} input {
     191`,e+=`  background-color: ${r.surface} !important;
     192`,e+=`  color: ${r.text} !important;
     193`,e+=`  border-color: ${r.border} !important;
     194`,e+=`  outline: none !important;
     195`,e+=`  box-shadow: none !important;
     196`,e+=`}
     197
     198`,e+=`${t} textarea:focus, ${t} textarea:focus-visible, ${t} input:focus, ${t} input:focus-visible {
     199`,e+=`  outline: none !important;
     200`,e+=`  box-shadow: none !important;
     201`,e+=`  ring: none !important;
     202`,e+=`  border-color: ${r.border} !important;
     203`,e+=`}
     204
     205`,e+=`${t} textarea::placeholder, ${t} input::placeholder {
     206`,e+=`  color: ${r.textSecondary} !important;
     207`,e+=`}
     208
     209`,e+=`${t} a {
     210`,e+=`  color: ${a} !important;
     211`,e+=`}
     212
     213`}return c.textContent=e,()=>{const u=document.getElementById(i);u&&u.remove()}},[n,s])}function ne({options:n}){const{t:s}=B(),[i,c]=d.useState(!1),[e,t]=d.useState(!1),l=d.useRef(null);Q(n.branding,"floating");const m=()=>{t(!0),setTimeout(()=>{c(!1),t(!1)},200)};if(d.useEffect(()=>{const f=k=>{i&&!e&&l.current&&!l.current.contains(k.target)&&!k.target.closest(".pulse-chat-ai-bubble-button")&&m()};if(i&&!e)return document.addEventListener("mousedown",f),()=>{document.removeEventListener("mousedown",f)}},[i,e]),!n.floating_chat_enabled)return null;const r=[n.quick_question_1,n.quick_question_2,n.quick_question_3].filter(f=>f&&f.trim()),a=n.branding,u=(a==null?void 0:a.bubble_position)||"bottom-right",p=(a==null?void 0:a.bubble_offset_x)||24,w=(a==null?void 0:a.bubble_offset_y)||24,v=(a==null?void 0:a.accent_color)||"#155dfc",y={[u.includes("bottom")?"bottom":"top"]:`${w}px`,[u.includes("right")?"right":"left"]:`${p}px`,backgroundColor:v},E=d.useMemo(()=>{const f=u.includes("bottom"),k=u.includes("right");return{[f?"bottom":"top"]:f?`${w+64}px`:`${w+64}px`,[k?"right":"left"]:`${p}px`,maxWidth:"calc(100vw - 2rem)"}},[u,p,w]);return o.jsxs(o.Fragment,{children:[o.jsx(M,{onClick:()=>{i?m():c(!0)},className:"fixed h-14 w-14 rounded-full shadow-lg z-50 pulse-chat-ai-bubble-button transition-transform hover:scale-110 border-0",style:y,size:"icon",children:i?o.jsx(z,{className:"h-5 w-5 text-white"}):o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",fill:"white",children:o.jsx("path",{d:"M12 1.75C14.9929 1.75 17.7745 1.87521 20.0723 2.09082C21.3077 2.2068 22.3055 3.16404 22.4434 4.41113C22.6381 6.17328 22.75 8.26308 22.75 10.5C22.75 12.7369 22.6381 14.8267 22.4434 16.5889C22.3055 17.8359 21.3078 18.7932 20.0723 18.9092C19.0518 19.0049 17.9363 19.0806 16.75 19.1377V20.7705C16.7498 21.5875 16.0875 22.2498 15.2705 22.25C14.9171 22.25 14.5749 22.1236 14.3066 21.8936L11.2197 19.2461C8.52443 19.2263 6.02473 19.106 3.92773 18.9092C2.69204 18.7932 1.69445 17.8358 1.55664 16.5889C1.36191 14.8267 1.25 12.7369 1.25 10.5C1.25 8.26308 1.36191 6.17328 1.55664 4.41113C1.69447 3.16404 2.69226 2.20681 3.92773 2.09082C6.22548 1.87521 9.00709 1.75 12 1.75ZM8.00879 9.5C7.45662 9.50013 7.00879 9.9478 7.00879 10.5C7.00879 11.0522 7.45662 11.4999 8.00879 11.5H8.01758L8.12012 11.4951C8.62432 11.4439 9.01758 11.0177 9.01758 10.5C9.01758 9.98227 8.62432 9.55615 8.12012 9.50488L8.01758 9.5H8.00879ZM12.0039 9.5C11.4519 9.50032 11.0039 9.94791 11.0039 10.5C11.0039 11.0521 11.4519 11.4997 12.0039 11.5H12.0137C12.5658 11.4998 13.0137 11.0521 13.0137 10.5C13.0137 9.94785 12.5658 9.50022 12.0137 9.5H12.0039ZM16 9.5C15.4478 9.50013 15 9.9478 15 10.5C15 11.0522 15.4478 11.4999 16 11.5H16.0088C16.5611 11.5 17.0088 11.0523 17.0088 10.5C17.0088 9.94773 16.5611 9.50002 16.0088 9.5H16Z"})})}),i&&o.jsxs("div",{ref:l,className:g("pulse-chat-ai-floating-widget","fixed z-50 w-[420px] max-w-[calc(100vw-2rem)] h-[600px] max-h-[80vh]","bg-background border rounded-lg shadow-2xl","flex flex-col overflow-hidden",e?"animate-out fade-out-0 zoom-out-95 slide-out-to-bottom-2":"animate-in fade-in-0 zoom-in-95 slide-in-from-bottom-2","duration-200"),style:E,children:[o.jsx("div",{className:"px-6 py-3 border-b bg-background text-foreground rounded-t-lg flex-shrink-0",children:o.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[a!=null&&a.avatar_url?o.jsx("img",{src:a.avatar_url,alt:"AI Assistant",className:"h-5 w-5 rounded-full object-cover"}):o.jsx(U,{className:"h-5 w-5 text-foreground"}),o.jsx("h3",{className:"text-base font-semibold text-foreground font-sans",children:s("chat.chatTitle")})]}),o.jsx(M,{variant:"ghost",size:"icon",onClick:m,className:"text-foreground hover:bg-muted h-auto w-auto p-0 border-0",children:o.jsx(z,{className:"h-5 w-5"})})]})}),o.jsx("div",{className:"flex-1 overflow-hidden min-h-0",children:o.jsx(O,{welcomeText:n.welcome_text_floating,quickQuestions:r,placeholder:n.chat_placeholder,className:"h-full",assistantAvatarUrl:a==null?void 0:a.avatar_url})})]})]})}function ae({options:n,height:s="400px"}){Q(n.branding,"shortcode");const i=[n.quick_question_1,n.quick_question_2,n.quick_question_3].filter(m=>m&&m.trim()),c=n.branding,e=(c==null?void 0:c.fullscreen_enabled)||!1,t={height:e?"100vh":s},l=e?"pulse-chat-ai-container fixed inset-0 z-50 border-0 rounded-none bg-background flex flex-col overflow-hidden":"pulse-chat-ai-container rounded-lg bg-background flex flex-col overflow-hidden";return o.jsx("div",{className:l,style:t,children:o.jsx(O,{welcomeText:n.welcome_text_floating,quickQuestions:i,placeholder:n.chat_placeholder,className:"flex-1",assistantAvatarUrl:c==null?void 0:c.avatar_url})})}function V({options:n,mode:s,height:i}){return s==="floating"?o.jsx(ne,{options:n}):o.jsx(ae,{options:n,height:i})}const se={placeholder:"Type your message...",send:"Send",thinking:"Thinking...",error:"Error sending message",rateLimit:"You have exceeded the message limit per minute. For security reasons, please wait 1 minute before trying again.",dailyLimitReached:"This site has reached its daily message limit. Please contact us via email for assistance.",monthlyLimitReached:"This site has reached its monthly message limit. Please contact us via email for assistance.",welcome:"Hello! I'm your AI assistant. How can I help you today?",timeout:"Request timeout. Please try again.",chatTitle:"AI Assistant",close:"Close",upgradeLink:"upgrade for unlimited access",messagesRemaining:"messages remaining"},ie={chat:se},ce={placeholder:"Escribe tu mensaje...",send:"Enviar",thinking:"Pensando...",error:"Error al enviar el mensaje",rateLimit:"Te has excedido del límite de mensajes por minuto. Por razones de seguridad, espera 1 minuto antes de intentar de nuevo.",dailyLimitReached:"Este sitio ha alcanzado su límite diario de mensajes. Por favor, contáctanos por correo electrónico para obtener ayuda.",monthlyLimitReached:"Este sitio ha alcanzado su límite mensual de mensajes. Por favor, contáctanos por correo electrónico para obtener ayuda.",welcome:"¡Hola! Soy tu asistente de IA. ¿Cómo puedo ayudarte hoy?",timeout:"Tiempo de espera agotado. Por favor intenta de nuevo.",chatTitle:"Asistente de IA",close:"Cerrar",upgradeLink:"actualiza para acceso ilimitado",messagesRemaining:"mensajes restantes"},le={chat:ce},de=()=>{var s;if(typeof window<"u"&&((s=window.pulseChatAI)!=null&&s.locale))return window.pulseChatAI.locale;const n=navigator.language.split("-")[0];return["en","es"].includes(n)?n:"en"};ee.use(te).init({resources:{en:{translation:ie},es:{translation:le}},lng:de(),fallbackLng:"en",interpolation:{escapeValue:!1}});const q=document.getElementById("pulse-chat-ai-floating-root");if(q){const n=window.pulseChatAI,s=(n==null?void 0:n.options)||{};H(q).render(o.jsx(d.StrictMode,{children:o.jsx(V,{options:s,mode:"floating"})}))}const ue=document.querySelectorAll("[data-pulse-chat-ai-shortcode]");ue.forEach(n=>{const s=window.pulseChatAI,i=(s==null?void 0:s.options)||{},c=n.getAttribute("data-height")||"400px";H(n).render(o.jsx(d.StrictMode,{children:o.jsx(V,{options:i,mode:"shortcode",height:c})}))});
  • pulse-chat-ai/trunk/package.json

    r3392240 r3394690  
    11{
    22  "name": "pulse-chat-ai",
    3   "version": "2.0.0",
     3  "version": "2.2.0",
    44  "description": "AI-powered chat assistant for WordPress",
    55  "type": "module",
  • pulse-chat-ai/trunk/pulse-chat-ai.php

    r3392240 r3394690  
    11<?php
    22/**
    3  * Plugin Name: Pulse Chat AI
     3 * Plugin Name: Pulse Chat AI — ChatGPT 5 Chatbot for WordPress
    44 * Plugin URI: https://pulsechatai.com
    5  * Description: AI-powered chat assistant for WordPress. Perfect for customer support and engagement.
    6  * Version: 2.0.0
     5 * Description: AI-powered ChatGPT 5 chat assistant for WordPress. Perfect for customer support and engagement.
     6 * Version: 2.2.0
    77 * Requires at least: 5.0
    88 * Requires PHP: 7.4
     
    2222
    2323// Define plugin constants
    24 define('PULSE_CHAT_AI_VERSION', '2.0.0');
     24define('PULSE_CHAT_AI_VERSION', '2.2.0');
    2525define('PULSE_CHAT_AI_PLUGIN_URL', plugin_dir_url(__FILE__));
    2626define('PULSE_CHAT_AI_PLUGIN_PATH', plugin_dir_path(__FILE__));
     
    2828// Include Asset Loader
    2929require_once PULSE_CHAT_AI_PLUGIN_PATH . 'includes/class-asset-loader.php';
     30
     31// Include License Manager
     32require_once PULSE_CHAT_AI_PLUGIN_PATH . 'includes/class-license-manager.php';
    3033
    3134/**
     
    3538   
    3639    private static $instance = null;
     40    private $license_manager = null;
    3741   
    3842    public static function get_instance() {
     
    4448   
    4549    private function __construct() {
     50        // Initialize License Manager
     51        $this->license_manager = new Pulse_Chat_AI_License_Manager();
     52       
    4653        add_action('init', array($this, 'init'));
    4754        add_action('rest_api_init', array($this, 'register_rest_routes'));
     
    7077        // Translations are automatically loaded by WordPress.org for plugins hosted there
    7178        // No need to manually call load_plugin_textdomain() since WordPress 4.6+
     79       
     80        // Register Custom Post Type for conversations (Pro feature)
     81        $this->register_conversation_cpt();
    7282    }
    7383   
     
    8696            'floating_chat_enabled' => false,
    8797            'pro_enabled' => false,
     98            'conversations_enabled' => false,
    8899            'welcome_text_floating' => 'Hello! I\'m your AI assistant. How can I help you today?',
    89100            'quick_question_1' => 'How can I train my chatbot?',
     
    119130   
    120131    /**
     132     * Register Custom Post Type for conversations
     133     */
     134    private function register_conversation_cpt() {
     135        $labels = array(
     136            'name' => __('Conversations', 'pulse-chat-ai'),
     137            'singular_name' => __('Conversation', 'pulse-chat-ai'),
     138            'menu_name' => __('Conversations', 'pulse-chat-ai'),
     139            'add_new' => __('Add New', 'pulse-chat-ai'),
     140            'add_new_item' => __('Add New Conversation', 'pulse-chat-ai'),
     141            'edit_item' => __('View Conversation', 'pulse-chat-ai'),
     142            'new_item' => __('New Conversation', 'pulse-chat-ai'),
     143            'view_item' => __('View Conversation', 'pulse-chat-ai'),
     144            'search_items' => __('Search Conversations', 'pulse-chat-ai'),
     145            'not_found' => __('No conversations found', 'pulse-chat-ai'),
     146            'not_found_in_trash' => __('No conversations found in trash', 'pulse-chat-ai'),
     147            'all_items' => __('All Conversations', 'pulse-chat-ai'),
     148        );
     149       
     150        $args = array(
     151            'labels' => $labels,
     152            'public' => false,
     153            'publicly_queryable' => false,
     154            'show_ui' => true,
     155            'show_in_menu' => false, // We'll add it to our custom menu
     156            'query_var' => true,
     157            'rewrite' => false,
     158            'capability_type' => 'post',
     159            'capabilities' => array(
     160                'create_posts' => 'manage_options', // Only admins can create
     161                'edit_posts' => 'manage_options',
     162                'edit_others_posts' => 'manage_options',
     163                'publish_posts' => 'manage_options',
     164                'read_private_posts' => 'manage_options',
     165                'delete_posts' => 'manage_options',
     166                'delete_private_posts' => 'manage_options',
     167                'delete_published_posts' => 'manage_options',
     168                'delete_others_posts' => 'manage_options',
     169                'edit_private_posts' => 'manage_options',
     170                'edit_published_posts' => 'manage_options',
     171            ),
     172            'has_archive' => false,
     173            'hierarchical' => false,
     174            'supports' => array('title', 'editor'),
     175            'show_in_rest' => false, // We'll use our custom REST endpoints if needed
     176        );
     177       
     178        register_post_type('pulse_conversation', $args);
     179    }
     180   
     181    /**
    121182     * Create rate limiting table
    122183     */
     
    173234            'methods' => 'POST',
    174235            'callback' => array($this, 'handle_chat_request'),
    175             'permission_callback' => array($this, 'check_chat_permissions'),
     236            'permission_callback' => function($request) {
     237                return $this->check_chat_permissions($request);
     238            },
    176239            'args' => array(
    177240                'message' => array(
     
    188251            )
    189252        ));
     253       
     254        // Conversations endpoints (Pro feature)
     255        register_rest_route('pulse-chat-ai/v1', '/conversations', array(
     256            'methods' => 'GET',
     257            'callback' => array($this, 'get_conversations'),
     258            'permission_callback' => array($this, 'check_admin_permissions'),
     259        ));
     260       
     261        register_rest_route('pulse-chat-ai/v1', '/conversations/(?P<id>\d+)', array(
     262            'methods' => 'DELETE',
     263            'callback' => array($this, 'delete_conversation'),
     264            'permission_callback' => array($this, 'check_admin_permissions'),
     265            'args' => array(
     266                'id' => array(
     267                    'required' => true,
     268                    'type' => 'integer',
     269                ),
     270            ),
     271        ));
     272       
     273        // Reset usage statistics endpoint
     274        register_rest_route('pulse-chat-ai/v1', '/usage/reset', array(
     275            'methods' => 'POST',
     276            'callback' => array($this, 'reset_usage_stats'),
     277            'permission_callback' => array($this, 'check_admin_permissions'),
     278        ));
     279       
     280        // License validation endpoint
     281        register_rest_route('pulse-chat-ai/v1', '/license/validate', array(
     282            'methods' => 'POST',
     283            'callback' => array($this, 'validate_license_endpoint'),
     284            'permission_callback' => array($this, 'check_admin_permissions'),
     285            'args' => array(
     286                'license_key' => array(
     287                    'required' => true,
     288                    'type' => 'string',
     289                    'sanitize_callback' => 'sanitize_text_field',
     290                ),
     291            ),
     292        ));
     293       
     294        // License status endpoint
     295        register_rest_route('pulse-chat-ai/v1', '/license/status', array(
     296            'methods' => 'GET',
     297            'callback' => array($this, 'get_license_status'),
     298            'permission_callback' => array($this, 'check_admin_permissions'),
     299        ));
     300    }
     301   
     302    /**
     303     * Check admin permissions for REST API
     304     */
     305    public function check_admin_permissions() {
     306        return current_user_can('manage_options');
     307    }
     308   
     309    /**
     310     * Get conversations (REST API endpoint)
     311     */
     312    public function get_conversations($request) {
     313        // Check if Pro is enabled
     314        $options = get_option('pulse_chat_ai_options');
     315        if (!isset($options['pro_enabled']) || !$options['pro_enabled']) {
     316            return new WP_Error('pro_required', 'Pro features are required to access conversations', array('status' => 403));
     317        }
     318       
     319        $date_filter = $request->get_param('date');
     320        $page_filter = $request->get_param('page');
     321        $model_filter = $request->get_param('model');
     322       
     323        $args = array(
     324            'post_type' => 'pulse_conversation',
     325            'posts_per_page' => 100,
     326            'orderby' => 'date',
     327            'order' => 'DESC',
     328            'post_status' => 'publish',
     329        );
     330       
     331        // Apply date filter
     332        if ($date_filter && $date_filter !== 'all') {
     333            $date_query = array();
     334            switch ($date_filter) {
     335                case 'today':
     336                    $date_query = array(
     337                        'after' => 'today',
     338                    );
     339                    break;
     340                case 'week':
     341                    $date_query = array(
     342                        'after' => '1 week ago',
     343                    );
     344                    break;
     345                case 'month':
     346                    $date_query = array(
     347                        'after' => '1 month ago',
     348                    );
     349                    break;
     350            }
     351            if (!empty($date_query)) {
     352                $args['date_query'] = array($date_query);
     353            }
     354        }
     355       
     356        // Apply page filter
     357        if ($page_filter && $page_filter !== 'all') {
     358            $args['meta_query'] = array(
     359                array(
     360                    'key' => '_conversation_page_id',
     361                    'value' => intval($page_filter),
     362                    'compare' => '=',
     363                ),
     364            );
     365        }
     366       
     367        // Apply model filter
     368        if ($model_filter && $model_filter !== 'all') {
     369            if (!isset($args['meta_query'])) {
     370                $args['meta_query'] = array();
     371            }
     372            $args['meta_query'][] = array(
     373                'key' => '_conversation_model',
     374                'value' => sanitize_text_field($model_filter),
     375                'compare' => '=',
     376            );
     377        }
     378       
     379        $posts = get_posts($args);
     380        $conversations = array();
     381       
     382        foreach ($posts as $post) {
     383            $messages = get_post_meta($post->ID, '_conversation_messages', true);
     384            if (!is_array($messages)) {
     385                $messages = array();
     386            }
     387           
     388            $conversations[] = array(
     389                'id' => $post->ID,
     390                'title' => $post->post_title,
     391                'messages' => $messages,
     392                'page_id' => get_post_meta($post->ID, '_conversation_page_id', true),
     393                'model' => get_post_meta($post->ID, '_conversation_model', true),
     394                'start_time' => get_post_meta($post->ID, '_conversation_start_time', true),
     395                'end_time' => get_post_meta($post->ID, '_conversation_end_time', true),
     396                'created_at' => $post->post_date,
     397            );
     398        }
     399       
     400        return array('conversations' => $conversations);
     401    }
     402   
     403    /**
     404     * Delete conversation (REST API endpoint)
     405     */
     406    public function delete_conversation($request) {
     407        // Check if Pro is enabled
     408        $options = get_option('pulse_chat_ai_options');
     409        if (!isset($options['pro_enabled']) || !$options['pro_enabled']) {
     410            return new WP_Error('pro_required', 'Pro features are required to delete conversations', array('status' => 403));
     411        }
     412       
     413        $id = intval($request->get_param('id'));
     414       
     415        if (!$id) {
     416            return new WP_Error('invalid_id', 'Invalid conversation ID', array('status' => 400));
     417        }
     418       
     419        // Verify post exists and is a conversation
     420        $post = get_post($id);
     421        if (!$post || $post->post_type !== 'pulse_conversation') {
     422            return new WP_Error('not_found', 'Conversation not found', array('status' => 404));
     423        }
     424       
     425        // Delete the post
     426        $result = wp_delete_post($id, true);
     427       
     428        if (!$result) {
     429            return new WP_Error('delete_failed', 'Failed to delete conversation', array('status' => 500));
     430        }
     431       
     432        return array('success' => true);
    190433    }
    191434   
     
    200443     * Check chat permissions
    201444     */
    202     public function check_chat_permissions() {
     445    public function check_chat_permissions($request = null) {
    203446        try {
     447            // Verify REST API nonce
     448            $nonce = '';
     449            if ($request instanceof WP_REST_Request) {
     450                $nonce = $request->get_header('X-WP-Nonce');
     451            } else {
     452                // Fallback: get from headers directly
     453                $nonce = isset($_SERVER['HTTP_X_WP_NONCE']) ? sanitize_text_field(wp_unslash($_SERVER['HTTP_X_WP_NONCE'])) : '';
     454            }
     455           
     456            if (empty($nonce) || !wp_verify_nonce($nonce, 'wp_rest')) {
     457                if (defined('WP_DEBUG') && WP_DEBUG) {
     458                    error_log('Pulse Chat AI: Invalid or missing nonce');
     459                }
     460                return new WP_Error('rest_forbidden', 'Invalid or missing nonce', array('status' => 403));
     461            }
     462           
    204463            // Check usage limits (daily + monthly)
    205464            $usage_check = $this->check_usage_limits();
     
    409668   
    410669    /**
     670     * Validate license endpoint (REST API)
     671     */
     672    public function validate_license_endpoint($request) {
     673        $license_key = $request->get_param('license_key');
     674       
     675        if (empty($license_key)) {
     676            return new WP_Error('missing_license', 'License key is required', array('status' => 400));
     677        }
     678       
     679        // Validate license
     680        $result = $this->license_manager->validate_license($license_key, true);
     681       
     682        return rest_ensure_response($result);
     683    }
     684   
     685    /**
     686     * Get license status endpoint (REST API)
     687     */
     688    public function get_license_status($request) {
     689        $license_data = $this->license_manager->get_license_data();
     690        $license_key = $this->license_manager->get_license_key();
     691       
     692        return rest_ensure_response(array(
     693            'license_key' => $license_key,
     694            'license_data' => $license_data,
     695            'is_pro_active' => $this->license_manager->is_pro_active(),
     696            'plan' => $this->license_manager->get_license_plan()
     697        ));
     698    }
     699   
     700    /**
     701     * Reset usage statistics (REST API endpoint)
     702     */
     703    public function reset_usage_stats($request) {
     704        global $wpdb;
     705       
     706        $site_key = 'site_global';
     707        $table_name = $wpdb->prefix . 'pulse_chat_ai_usage';
     708        $today = current_time('Y-m-d');
     709        $current_month = current_time('Y-m');
     710       
     711        // Reset usage counters
     712        $result = $wpdb->query($wpdb->prepare(
     713            "UPDATE `{$table_name}`
     714             SET messages_today = 0,
     715                 messages_month = 0,
     716                 last_message_date = %s,
     717                 current_month = %s
     718             WHERE ip_address = %s",
     719            $today, $current_month, $site_key
     720        ));
     721       
     722        // Also reset rate limit table
     723        $rate_limit_table = $wpdb->prefix . 'pulse_chat_ai_rate_limit';
     724        if ($wpdb->get_var($wpdb->prepare("SHOW TABLES LIKE %s", $rate_limit_table)) == $rate_limit_table) {
     725            $wpdb->query("TRUNCATE TABLE `{$rate_limit_table}`");
     726        }
     727       
     728        if ($result === false) {
     729            return new WP_Error('reset_failed', 'Failed to reset usage statistics', array('status' => 500));
     730        }
     731       
     732        return array(
     733            'success' => true,
     734            'message' => 'Usage statistics reset successfully',
     735            'stats' => $this->get_usage_stats()
     736        );
     737    }
     738   
     739    /**
    411740     * Check rate limiting
    412741     */
     
    491820            $this->update_usage_counters();
    492821           
     822            // Save conversation if Pro is enabled and conversations are enabled
     823            if (isset($options['pro_enabled']) && $options['pro_enabled'] &&
     824                isset($options['conversations_enabled']) && $options['conversations_enabled']) {
     825                if (defined('WP_DEBUG') && WP_DEBUG) {
     826                    error_log('Pulse Chat AI: Saving conversation (pro_enabled: ' . ($options['pro_enabled'] ? 'true' : 'false') . ', conversations_enabled: ' . ($options['conversations_enabled'] ? 'true' : 'false') . ')');
     827                }
     828                $this->save_conversation($message, $history, $response, $options);
     829            } else {
     830                if (defined('WP_DEBUG') && WP_DEBUG) {
     831                    error_log('Pulse Chat AI: Conversation NOT saved (pro_enabled: ' . (isset($options['pro_enabled']) && $options['pro_enabled'] ? 'true' : 'false') . ', conversations_enabled: ' . (isset($options['conversations_enabled']) && $options['conversations_enabled'] ? 'true' : 'false') . ')');
     832                }
     833            }
     834           
    493835            // Get updated usage stats
    494836            $usage_stats = $this->get_usage_stats();
     
    508850            return new WP_Error('openai_error', $e->getMessage(), array('status' => 500));
    509851        }
     852    }
     853   
     854    /**
     855     * Save conversation to CPT
     856     */
     857    private function save_conversation($user_message, $history, $assistant_response, $options) {
     858        // Get current page ID if available
     859        $page_id = 0;
     860        $referer = wp_get_referer();
     861        if ($referer) {
     862            $page_id = url_to_postid($referer);
     863        }
     864       
     865        // Prepare all messages including the new ones
     866        $all_messages = array();
     867       
     868        // Add history messages
     869        if (!empty($history) && is_array($history)) {
     870            foreach ($history as $msg) {
     871                if (isset($msg['role']) && isset($msg['content'])) {
     872                    $all_messages[] = array(
     873                        'role' => sanitize_text_field($msg['role']),
     874                        'content' => sanitize_textarea_field($msg['content']),
     875                        'timestamp' => isset($msg['timestamp']) ? intval($msg['timestamp']) : current_time('timestamp')
     876                    );
     877                }
     878            }
     879        }
     880       
     881        // Add current user message
     882        $all_messages[] = array(
     883            'role' => 'user',
     884            'content' => sanitize_textarea_field($user_message),
     885            'timestamp' => current_time('timestamp')
     886        );
     887       
     888        // Add assistant response
     889        $all_messages[] = array(
     890            'role' => 'assistant',
     891            'content' => sanitize_textarea_field($assistant_response),
     892            'timestamp' => current_time('timestamp')
     893        );
     894       
     895        // Determine if this is a new conversation or continuation
     896        $is_new_conversation = empty($history) || count($history) === 0;
     897       
     898        if ($is_new_conversation) {
     899            // Create new conversation post
     900            $post_title = sprintf(
     901                __('Conversation - %s', 'pulse-chat-ai'),
     902                current_time('Y-m-d H:i:s')
     903            );
     904           
     905            $post_data = array(
     906                'post_title' => $post_title,
     907                'post_content' => '',
     908                'post_status' => 'publish',
     909                'post_type' => 'pulse_conversation',
     910                'post_author' => 1, // System user
     911            );
     912           
     913            $conversation_id = wp_insert_post($post_data);
     914           
     915            if (is_wp_error($conversation_id)) {
     916                error_log('Pulse Chat AI: Error creating conversation: ' . $conversation_id->get_error_message());
     917                return;
     918            }
     919        } else {
     920            // Find existing conversation by checking recent posts
     921            // For simplicity, we'll use the most recent conversation from today
     922            // In a more advanced implementation, you'd track conversation sessions
     923            $recent_conversations = get_posts(array(
     924                'post_type' => 'pulse_conversation',
     925                'posts_per_page' => 1,
     926                'orderby' => 'date',
     927                'order' => 'DESC',
     928                'date_query' => array(
     929                    array(
     930                        'after' => '1 hour ago',
     931                    ),
     932                ),
     933            ));
     934           
     935            if (!empty($recent_conversations)) {
     936                $conversation_id = $recent_conversations[0]->ID;
     937               
     938                // Get existing messages and merge
     939                $existing_messages = get_post_meta($conversation_id, '_conversation_messages', true);
     940                if (is_array($existing_messages)) {
     941                    // Merge messages, avoiding duplicates
     942                    $all_messages = array_merge($existing_messages, $all_messages);
     943                }
     944            } else {
     945                // Create new conversation if no recent one found
     946                $post_title = sprintf(
     947                    __('Conversation - %s', 'pulse-chat-ai'),
     948                    current_time('Y-m-d H:i:s')
     949                );
     950               
     951                $post_data = array(
     952                    'post_title' => $post_title,
     953                    'post_content' => '',
     954                    'post_status' => 'publish',
     955                    'post_type' => 'pulse_conversation',
     956                    'post_author' => 1,
     957                );
     958               
     959                $conversation_id = wp_insert_post($post_data);
     960               
     961                if (is_wp_error($conversation_id)) {
     962                    error_log('Pulse Chat AI: Error creating conversation: ' . $conversation_id->get_error_message());
     963                    return;
     964                }
     965            }
     966        }
     967       
     968        // Save messages as post meta
     969        update_post_meta($conversation_id, '_conversation_messages', $all_messages);
     970       
     971        // Save metadata
     972        if ($page_id > 0) {
     973            update_post_meta($conversation_id, '_conversation_page_id', $page_id);
     974        }
     975       
     976        $model = isset($options['model']) ? sanitize_text_field($options['model']) : 'gpt-5-nano';
     977        update_post_meta($conversation_id, '_conversation_model', $model);
     978       
     979        // Update timestamps
     980        if ($is_new_conversation) {
     981            update_post_meta($conversation_id, '_conversation_start_time', current_time('timestamp'));
     982        }
     983        update_post_meta($conversation_id, '_conversation_end_time', current_time('timestamp'));
    510984    }
    511985   
     
    5631037                'messages' => $messages,
    5641038                'model' => isset($options['model']) ? $options['model'] : 'gpt-5-nano',
    565                 'max_tokens' => 300, // Limit responses to ~10 lines (free tier optimization)
     1039                'max_completion_tokens' => 300, // GPT-5 uses max_completion_tokens instead of max_tokens. Limit responses to ~10 lines (free tier optimization)
    5661040                'site_url' => get_site_url() // For tracking purposes
    5671041            )),
     
    6051079     */
    6061080    public function enqueue_admin_scripts($hook) {
    607         // Only load on our settings page
    608         // Hook changes from 'settings_page_pulse-chat-ai' to 'toplevel_page_pulse-chat-ai' when using add_menu_page
    609         if ($hook !== 'toplevel_page_pulse-chat-ai') {
     1081        // Load on our settings pages
     1082        $allowed_hooks = array(
     1083            'toplevel_page_pulse-chat-ai',
     1084            'pulse-chat-ai_page_pulse-chat-ai-conversations',
     1085            'pulse-chat-ai_page_pulse-chat-ai-license',
     1086        );
     1087       
     1088        if (!in_array($hook, $allowed_hooks)) {
    6101089            return;
    6111090        }
     
    6181097        $options = get_option('pulse_chat_ai_options', array());
    6191098        $usage_stats = $this->get_usage_stats();
     1099       
     1100        // Add license_key to options if available
     1101        if (!isset($options['license_key'])) {
     1102            $license_key = $this->license_manager->get_license_key();
     1103            if (!empty($license_key)) {
     1104                $options['license_key'] = $license_key;
     1105            }
     1106        }
    6201107
    6211108        // Localize script with initial data
    622         wp_localize_script('pulse-chat-ai-admin', 'pulseChatAI', array(
    623             'nonce' => wp_create_nonce('wp_rest'),
    624             'ajaxUrl' => admin_url('admin-ajax.php'),
    625             'restUrl' => rest_url('pulse-chat-ai/v1'),
    626             'locale' => get_locale(),
    627             'options' => $options,
    628             'usage' => $usage_stats,
    629         ));
     1109        // Use admin_footer to ensure script is loaded first, then add inline script
     1110        add_action('admin_footer', function() use ($hook, $options, $usage_stats) {
     1111            ?>
     1112            <script type="text/javascript">
     1113            if (typeof window.pulseChatAI === 'undefined') {
     1114                window.pulseChatAI = {};
     1115            }
     1116            window.pulseChatAI = <?php echo json_encode(array(
     1117                'nonce' => wp_create_nonce('wp_rest'),
     1118                'ajaxUrl' => admin_url('admin-ajax.php'),
     1119                'restUrl' => rest_url('pulse-chat-ai/v1'),
     1120                'locale' => get_locale(),
     1121                'options' => $options,
     1122                'usage' => $usage_stats,
     1123                'currentPage' => $hook,
     1124            )); ?>;
     1125            </script>
     1126            <?php
     1127        }, 1);
     1128    }
     1129   
     1130    /**
     1131     * Admin page callback
     1132     */
     1133    public function admin_page() {
     1134        // Check user capabilities
     1135        if (!current_user_can('manage_options')) {
     1136            wp_die(esc_html__('You do not have sufficient permissions to access this page.', 'pulse-chat-ai'));
     1137        }
     1138        echo '<div id="pulse-chat-ai-admin-root"></div>';
     1139    }
     1140   
     1141    /**
     1142     * Conversations page callback
     1143     */
     1144    public function conversations_page() {
     1145        // Check user capabilities
     1146        if (!current_user_can('manage_options')) {
     1147            wp_die(esc_html__('You do not have sufficient permissions to access this page.', 'pulse-chat-ai'));
     1148        }
     1149        echo '<div id="pulse-chat-ai-conversations-root"></div>';
     1150    }
     1151   
     1152    /**
     1153     * License page callback
     1154     */
     1155    public function license_page() {
     1156        // Check user capabilities
     1157        if (!current_user_can('manage_options')) {
     1158            wp_die(esc_html__('You do not have sufficient permissions to access this page.', 'pulse-chat-ai'));
     1159        }
     1160        echo '<div id="pulse-chat-ai-license-root"></div>';
    6301161    }
    6311162   
     
    7341265     */
    7351266    public function add_admin_menu() {
     1267        // Main menu page - Title shown in menu bar
    7361268        add_menu_page(
    737             __('Pulse Chat AI Settings', 'pulse-chat-ai'),
    738             __('Pulse Chat AI', 'pulse-chat-ai'),
     1269            __('Pulse Chat AI Settings', 'pulse-chat-ai'), // Page title
     1270            __('Pulse Chat AI', 'pulse-chat-ai'), // Menu name (shown in sidebar)
    7391271            'manage_options',
    7401272            'pulse-chat-ai',
     
    7421274            'data:image/svg+xml;base64,' . base64_encode('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" fill="currentColor"><path d="M12 1.75C14.9929 1.75 17.7745 1.87521 20.0723 2.09082C21.3077 2.2068 22.3055 3.16404 22.4434 4.41113C22.6381 6.17328 22.75 8.26308 22.75 10.5C22.75 12.7369 22.6381 14.8267 22.4434 16.5889C22.3055 17.8359 21.3078 18.7932 20.0723 18.9092C19.0518 19.0049 17.9363 19.0806 16.75 19.1377V20.7705C16.7498 21.5875 16.0875 22.2498 15.2705 22.25C14.9171 22.25 14.5749 22.1236 14.3066 21.8936L11.2197 19.2461C8.52443 19.2263 6.02473 19.106 3.92773 18.9092C2.69204 18.7932 1.69445 17.8358 1.55664 16.5889C1.36191 14.8267 1.25 12.7369 1.25 10.5C1.25 8.26308 1.36191 6.17328 1.55664 4.41113C1.69447 3.16404 2.69226 2.20681 3.92773 2.09082C6.22548 1.87521 9.00709 1.75 12 1.75ZM8.00879 9.5C7.45662 9.50013 7.00879 9.9478 7.00879 10.5C7.00879 11.0522 7.45662 11.4999 8.00879 11.5H8.01758L8.12012 11.4951C8.62432 11.4439 9.01758 11.0177 9.01758 10.5C9.01758 9.98227 8.62432 9.55615 8.12012 9.50488L8.01758 9.5H8.00879ZM12.0039 9.5C11.4519 9.50032 11.0039 9.94791 11.0039 10.5C11.0039 11.0521 11.4519 11.4997 12.0039 11.5H12.0137C12.5658 11.4998 13.0137 11.0521 13.0137 10.5C13.0137 9.94785 12.5658 9.50022 12.0137 9.5H12.0039ZM16 9.5C15.4478 9.50013 15 9.9478 15 10.5C15 11.0522 15.4478 11.4999 16 11.5H16.0088C16.5611 11.5 17.0088 11.0523 17.0088 10.5C17.0088 9.94773 16.5611 9.50002 16.0088 9.5H16Z"/></svg>'),
    7431275            30
     1276        );
     1277       
     1278        // First submenu: Settings (points to same page as main menu)
     1279        add_submenu_page(
     1280            'pulse-chat-ai',
     1281            __('Pulse Chat AI Settings', 'pulse-chat-ai'), // Page title
     1282            __('Settings', 'pulse-chat-ai'), // Submenu name (shown in sidebar)
     1283            'manage_options',
     1284            'pulse-chat-ai', // Same slug as main menu
     1285            array($this, 'admin_page')
     1286        );
     1287       
     1288        // Submenu: Conversations
     1289        add_submenu_page(
     1290            'pulse-chat-ai',
     1291            __('Conversations', 'pulse-chat-ai'),
     1292            __('Conversations', 'pulse-chat-ai'),
     1293            'manage_options',
     1294            'pulse-chat-ai-conversations',
     1295            array($this, 'conversations_page')
     1296        );
     1297       
     1298        // Submenu: License
     1299        add_submenu_page(
     1300            'pulse-chat-ai',
     1301            __('License', 'pulse-chat-ai'),
     1302            __('License', 'pulse-chat-ai'),
     1303            'manage_options',
     1304            'pulse-chat-ai-license',
     1305            array($this, 'license_page')
    7441306        );
    7451307    }
     
    9681530        // API key is now in wp-config.php (not user-configurable)
    9691531       
    970         // Validate pro_enabled first
     1532        // Handle license_key if provided
     1533        if (isset($input['license_key'])) {
     1534            $license_key = sanitize_text_field($input['license_key']);
     1535            $this->license_manager->save_license_key($license_key);
     1536           
     1537            // Validate license and auto-activate pro_enabled if valid
     1538            if (!empty($license_key)) {
     1539                $license_result = $this->license_manager->validate_license($license_key, true);
     1540                if (isset($license_result['valid']) && $license_result['valid']) {
     1541                    $output['pro_enabled'] = true;
     1542                } else {
     1543                    $output['pro_enabled'] = false;
     1544                }
     1545            } else {
     1546                // Empty license key means disable Pro
     1547                $output['pro_enabled'] = false;
     1548            }
     1549        } else {
     1550            // If license_key not provided, check current license status
     1551            $is_pro_active = $this->license_manager->is_pro_active();
     1552            $output['pro_enabled'] = $is_pro_active;
     1553        }
     1554       
     1555        // Validate pro_enabled (can be overridden by license validation above)
    9711556        if (isset($input['pro_enabled'])) {
    972             $output['pro_enabled'] = (bool) $input['pro_enabled'];
     1557            // Only allow manual override if license is valid
     1558            $is_pro_active = $this->license_manager->is_pro_active();
     1559            if ($is_pro_active) {
     1560                $output['pro_enabled'] = (bool) $input['pro_enabled'];
     1561            } else {
     1562                // If license is invalid, force pro_enabled to false
     1563                $output['pro_enabled'] = false;
     1564            }
     1565        }
     1566       
     1567        // Conversations enabled (only if Pro is enabled)
     1568        if (isset($input['conversations_enabled'])) {
     1569            $output['conversations_enabled'] = (bool) $input['conversations_enabled'];
     1570            // Disable conversations if Pro is disabled
     1571            if (!$output['pro_enabled']) {
     1572                $output['conversations_enabled'] = false;
     1573            }
    9731574        } else {
    974             $output['pro_enabled'] = false;
     1575            $output['conversations_enabled'] = false;
    9751576        }
    9761577       
     
    9951596        if (isset($input['system_prompt'])) {
    9961597            $output['system_prompt'] = sanitize_textarea_field($input['system_prompt']);
     1598        }
     1599       
     1600        // System Prompt Builder fields
     1601        if (isset($input['system_prompt_business'])) {
     1602            $output['system_prompt_business'] = sanitize_textarea_field($input['system_prompt_business']);
     1603        }
     1604        if (isset($input['system_prompt_topics'])) {
     1605            $output['system_prompt_topics'] = sanitize_textarea_field($input['system_prompt_topics']);
     1606        }
     1607        if (isset($input['system_prompt_restrictions'])) {
     1608            $output['system_prompt_restrictions'] = sanitize_textarea_field($input['system_prompt_restrictions']);
     1609        }
     1610        if (isset($input['system_prompt_concise'])) {
     1611            $output['system_prompt_concise'] = (bool) $input['system_prompt_concise'];
     1612        }
     1613        if (isset($input['system_prompt_same_language'])) {
     1614            $output['system_prompt_same_language'] = (bool) $input['system_prompt_same_language'];
     1615        }
     1616        if (isset($input['system_prompt_use_emojis'])) {
     1617            $output['system_prompt_use_emojis'] = (bool) $input['system_prompt_use_emojis'];
    9971618        }
    9981619       
     
    10161637       
    10171638        if (isset($input['welcome_text_floating'])) {
    1018             $output['welcome_text_floating'] = sanitize_text_field($input['welcome_text_floating']);
     1639            // Use sanitize_textarea_field to preserve text content while sanitizing HTML
     1640            $output['welcome_text_floating'] = sanitize_textarea_field($input['welcome_text_floating']);
    10191641        }
    10201642       
     
    10291651        }
    10301652       
     1653        // Helper function to sanitize quick questions and remove dangerous protocols
     1654        $sanitize_quick_question = function($value) {
     1655            $sanitized = sanitize_text_field($value);
     1656            // Remove dangerous protocols (javascript:, data:, vbscript:, etc.)
     1657            $sanitized = preg_replace('/^(javascript|data|vbscript|file|about):/i', '', $sanitized);
     1658            return trim($sanitized);
     1659        };
     1660       
    10311661        if (isset($input['quick_question_1'])) {
    1032             $output['quick_question_1'] = sanitize_text_field($input['quick_question_1']);
     1662            $output['quick_question_1'] = $sanitize_quick_question($input['quick_question_1']);
    10331663        }
    10341664       
    10351665        if (isset($input['quick_question_2'])) {
    1036             $output['quick_question_2'] = sanitize_text_field($input['quick_question_2']);
     1666            $output['quick_question_2'] = $sanitize_quick_question($input['quick_question_2']);
    10371667        }
    10381668       
    10391669        if (isset($input['quick_question_3'])) {
    1040             $output['quick_question_3'] = sanitize_text_field($input['quick_question_3']);
     1670            $output['quick_question_3'] = $sanitize_quick_question($input['quick_question_3']);
    10411671        }
    10421672       
     
    10961726       
    10971727        return $output;
    1098     }
    1099    
    1100     /**
    1101      * Admin page
    1102      */
    1103     public function admin_page() {
    1104         // Check user capabilities
    1105         if (!current_user_can('manage_options')) {
    1106             wp_die(esc_html__('You do not have sufficient permissions to access this page.', 'pulse-chat-ai'));
    1107         }
    1108         ?>
    1109         <div class="wrap">
    1110             <div id="pulse-chat-ai-admin-root"></div>
    1111         </div>
    1112         <?php
    11131728    }
    11141729   
     
    11911806        }
    11921807
     1808        // Handle license_key separately if provided
     1809        if (isset($options['license_key'])) {
     1810            $license_key = sanitize_text_field($options['license_key']);
     1811            $this->license_manager->save_license_key($license_key);
     1812           
     1813            // Validate license immediately
     1814            if (!empty($license_key)) {
     1815                $license_result = $this->license_manager->validate_license($license_key, true);
     1816               
     1817                // Auto-activate pro_enabled if license is valid
     1818                if (isset($license_result['valid']) && $license_result['valid']) {
     1819                    $options['pro_enabled'] = true;
     1820                } else {
     1821                    $options['pro_enabled'] = false;
     1822                }
     1823            } else {
     1824                // Empty license key means disable Pro
     1825                $options['pro_enabled'] = false;
     1826            }
     1827           
     1828            // Remove license_key from options (it's stored separately)
     1829            unset($options['license_key']);
     1830        }
     1831
    11931832        // Validate and sanitize options
    11941833        $validated = $this->validate_options($options);
  • pulse-chat-ai/trunk/readme.txt

    r3392240 r3394690  
    22Contributors: jorgemunoz
    33Donate link: https://pulsechatai.com/
    4 Tags: chat, ai, openai, assistant, chatbot
     4Tags: chatai, chatgpt, openai, assistant, chatbot
    55Requires at least: 5.0
    66Tested up to: 6.8
    77Requires PHP: 7.4
    8 Stable tag: 2.0.0
     8Stable tag: 2.2.0
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
    1111
    12 AI-powered chat assistant for WordPress powered by an advanced GPT-based AI model. Zero configuration required - works immediately after installation.
     12AI-powered chat assistant for WordPress powered by an advanced ChatGPT 5 AI models. Zero configuration required - works immediately after installation.
    1313
    1414== Description ==
    1515
    16 Pulse Chat AI integrates a powerful AI chat assistant into your WordPress site using an advanced GPT-based AI model. The plugin works immediately after installation - no API keys, no configuration required. Simply install, activate, and add the shortcode to start chatting with your visitors.
     16Pulse Chat AI integrates a powerful AI chat assistant into your WordPress site using an advanced ChatGPT 5 AI models. The plugin works immediately after installation - no API keys, no configuration required. Simply install, activate, and add the shortcode to start chatting with your visitors.
    1717
    1818Features include customizable chat interface, floating chat bubble, usage limits, rate limiting, and full control over conversation behavior. Perfect for customer support, FAQs, and visitor engagement.
    1919
    2020The plugin provides a seamless way to add AI-powered conversations to any page, post, or widget using a simple shortcode. With built-in security features, usage tracking, and a freemium model, it's ideal for businesses looking to enhance user engagement.
     21
     22**Version 2.2 Highlights:**
     23* NEW: Complete license validation system with Supabase integration
     24* NEW: License key replaces manual Pro toggle
     25* NEW: Automatic license validation and Pro features activation
     26* NEW: License status display with plan, expiration, and domain info
     27
     28**Version 2.1 Highlights:**
     29* NEW: Conversation saving and management system (Pro feature)
     30* NEW: Full conversation history with export capabilities
     31* NEW: License activation page
     32* Improved admin menu organization
    2133
    2234**Version 2.0 Highlights:**
     
    4759* Custom branding options (Pro feature)
    4860* Custom avatar for AI assistant (Pro feature)
     61* Conversation saving and history (Pro feature)
     62* Export conversations as JSON or CSV (Pro feature)
    4963
    5064
     
    6680* Full-screen chat mode
    6781* Advanced positioning options for floating chat
     82* Conversation saving and history management
     83* Export conversations as JSON or CSV
     84* Filter conversations by date, page, and model
    6885
    6986== Frequently Asked Questions ==
     
    110127
    111128== Changelog ==
     129
     130= 2.2.0 - January 2026 =
     131* NEW: Complete license validation system integrated with Supabase Edge Function
     132* NEW: License key input field replaces manual Pro toggle
     133* NEW: Automatic license validation on save
     134* NEW: License status display (plan, expiration date, registered domain)
     135* NEW: REST API endpoints for license validation (/license/validate, /license/status)
     136* NEW: License Manager PHP class with caching and periodic validation
     137* NEW: Automatic Pro features activation based on license validation
     138* NEW: License error messages with specific reasons (expired, domain mismatch, etc.)
     139* IMPROVED: License page UI with real-time validation feedback
     140* IMPROVED: License validation caching (24 hours) for better performance
     141* IMPROVED: Automatic periodic license validation in background
     142* CHANGED: Pro Features toggle replaced by license key system
     143* CHANGED: License key stored separately from plugin options
     144* FIXED: License validation integrated with existing Pro features system
     145
     146= 2.1.0 - November 2025 =
     147* NEW: Conversation saving feature (Pro feature) - automatically save all chat conversations
     148* NEW: Conversations admin page with full conversation history
     149* NEW: Toggle to enable/disable conversation saving in Conversations page
     150* NEW: Full-page conversation detail view (replaces modal for better WordPress compatibility)
     151* NEW: URL-based navigation for conversations (shareable conversation links)
     152* NEW: License activation page (submenu under Pulse Chat AI)
     153* NEW: Pro Features toggle moved to License page
     154* NEW: Export conversations as JSON or CSV
     155* NEW: Filter conversations by date, page, and model
     156* IMPROVED: Admin menu reorganization - main menu "Pulse Chat AI" with submenus: Settings, Conversations, License
     157* IMPROVED: Better conversation management interface
     158* IMPROVED: Conversation detail view optimized for long conversations
     159* IMPROVED: Browser navigation support (back/forward buttons work correctly)
     160* CHANGED: Pro Features toggle now only available in License page
     161* CHANGED: Conversation saving requires both Pro enabled and conversations toggle enabled
     162* FIXED: Various UI improvements and bug fixes
    112163
    113164= 2.0.0 - November 8, 2025 =
     
    154205== Upgrade Notice ==
    155206
     207= 2.2.0 =
     208New features: Complete license validation system with Supabase integration. License key replaces manual Pro toggle. Automatic validation and Pro features activation. All existing settings will be preserved during upgrade.
     209
     210= 2.1.0 =
     211New features: Conversation saving system, full conversation history management, and improved admin menu organization. Pro Features toggle moved to License page. All existing settings will be preserved during upgrade.
     212
    156213= 2.0.0 =
    157214Major update: Complete redesign with modern React interface, new branding system, and improved UX. The admin panel has been reorganized with tabs. Custom avatars and advanced branding are now Pro features. All existing settings will be preserved during upgrade.
Note: See TracChangeset for help on using the changeset viewer.