@opencx/widget-react 4.0.8 → 4.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,24 +1,24 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),kt=require("@radix-ui/react-popover"),w=require("react"),l=require("@opencx/widget-react-headless"),Ct=require("@radix-ui/react-dialog"),m=require("lucide-react"),zt=require("clsx"),Nt=require("tailwind-merge"),St=require("react-dom"),ce=require("@uiw/react-iframe"),_t=require("@radix-ui/react-slot"),It=require("class-variance-authority"),Ze=require("remark-gfm"),Tt=require("react-markdown"),Je=require("rehype-raw"),D=require("@opencx/widget-core"),N=require("framer-motion"),Mt=require("@radix-ui/react-avatar"),Dt=require("@radix-ui/react-tooltip"),Ue=require("tinycolor2"),Rt=require("react-dropzone"),Pt=require("react-use/lib/useAsyncFn"),oe=require("zod");function K(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(o,s,r.get?r:{enumerable:!0,get:()=>t[s]})}}return o.default=t,Object.freeze(o)}const ee=K(kt),E=K(w),R=K(Ct),Y=K(Mt),G=K(Dt);function g(t){return{"data-component":t}}function d(...t){return Nt.twMerge(zt.clsx(t))}const Qe="opencx-widget-portal";function te(){return null}function Et({children:t}){var s,r;const o=(r=(s=ce.useFrame())==null?void 0:s.document)==null?void 0:r.getElementById(Qe);return o?St.createPortal(t,o):(console.error("Portal container not found!"),null)}function Ot(){return e.jsx("div",{id:Qe,className:"absolute size-full top-0 start-0"})}te.Portal=Et;te.Container=Ot;const $={x:2,y:2},A=w.memo(w.forwardRef(({children:t,className:o,scale:s=1.02,off:r=!1},n)=>{const[a,i]=w.useState(!1),[c,p]=w.useState({x:0,y:0});if(r||/translate/.test(t.props.className||""))return t;const z=x=>{var C,H;const{clientX:y,clientY:I}=x,k=x.currentTarget.getBoundingClientRect(),T=y-(k.left+k.width/2),M=I-(k.top+k.height/2),O=Math.max(-1,Math.min(1,T/(k.width/2))),W=Math.max(-1,Math.min(1,M/(k.height/2))),P=O*$.x,v=W*$.y;p({x:P,y:v}),(H=(C=t.props).onMouseMove)==null||H.call(C,x)},j=()=>{var x,y;i(!0),(y=(x=t.props).onMouseEnter)==null||y.call(x)},h=()=>{var x,y;i(!1),p({x:0,y:0}),(y=(x=t.props).onMouseLeave)==null||y.call(x)},b={"--wobble-x":a?`${c.x}px`:"0px","--wobble-y":a?`${c.y}px`:"0px","--scale":1-(s-1)};return w.cloneElement(t,{ref:n,onMouseMove:z,onMouseEnter:j,onMouseLeave:h,style:{...b,...t.props.style},className:d("translate-x-[var(--wobble-x)]","translate-y-[var(--wobble-y)]","hover:scale-[var(--scale)] active:hover:scale-[calc(var(--scale)-0.02)]",o,t.props.className,"transition-all ease-out")})}));A.displayName="Wobble";const Wt=It.cva(d("inline-flex shrink-0 items-center justify-center gap-2","text-sm font-medium whitespace-nowrap","ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50","active:scale-95 hover:active:scale-95","rounded-xl","transition"),{variants:{variant:{default:"bg-primary text-primary-foreground",destructive:"bg-destructive text-destructive-foreground",outline:"bg-background",secondary:"bg-secondary text-secondary-foreground",ghost:"hover:bg-secondary",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"py-2 px-3.5 text-xs",lg:"min-h-12 px-4 rounded-[20px]",icon:"h-10 w-10",fit:"size-fit p-2",free:"p-2",selfless:"p-0"}},defaultVariants:{variant:"default",size:"default"}}),S=E.forwardRef(({className:t,variant:o="default",size:s,asChild:r=!1,...n},a)=>{const i=r?_t.Slot:"button";return e.jsx(A,{ref:a,children:e.jsx(i,{...g("ui_lib/btn"),"data-variant":o,className:d(Wt({variant:o,size:s,className:t})),...n})})});S.displayName="Button";const et=R.Root,tt=R.Trigger,st=E.forwardRef(({className:t,...o},s)=>e.jsx(R.Overlay,{ref:s,className:d("fixed inset-0 z-50 bg-black/60 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...o}));st.displayName=R.Overlay.displayName;const de=E.forwardRef(({className:t,children:o,withClose:s=!1,...r},n)=>e.jsxs(te.Portal,{children:[e.jsx(st,{}),e.jsxs(R.Content,{ref:n,className:d("fixed left-[50%] top-[50%] z-50 flex flex-col gap-4 w-full max-w-[61.8%] translate-x-[-50%] translate-y-[-50%] border bg-background p-4 duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-3xl",t),...r,children:[o,s&&e.jsx(R.Close,{asChild:!0,className:"absolute end-4 top-4 opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:e.jsxs(S,{size:"fit",className:"rounded-full",variant:"secondary",children:[e.jsx(m.X,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})})]})]}));de.displayName=R.Content.displayName;const ot=({className:t,...o})=>e.jsx("div",{className:d("flex flex-col gap-2 text-center pt-2",t),...o});ot.displayName="DialogHeader";const rt=({className:t,...o})=>e.jsx("div",{className:d("flex flex-col gap-2 text-center",t),...o});rt.displayName="DialogBody";const nt=({className:t,...o})=>e.jsx("div",{className:d("flex flex-col gap-2",t),...o});nt.displayName="DialogFooter";const pe=E.forwardRef(({className:t,...o},s)=>e.jsx(R.Title,{ref:s,className:d("text-lg font-semibold leading-none tracking-tight",t),...o}));pe.displayName=R.Title.displayName;const at=E.forwardRef(({className:t,...o},s)=>e.jsx(R.Description,{ref:s,className:d("text-sm text-muted-foreground",t),...o}));at.displayName=R.Description.displayName;function it({attachment:t}){const{name:o,size:s,type:r,url:n}=t,a=r.startsWith("image/"),i=r.startsWith("video/"),c=r.startsWith("audio/");return c?e.jsx(A,{children:e.jsx("div",{className:"w-full shrink-0 overflow-hidden",children:e.jsxs("audio",{controls:!0,className:"w-full",children:[e.jsx("source",{src:n,type:r}),"Your browser does not support the audio tag."]})})}):i?e.jsx(A,{children:e.jsx("div",{className:"w-full border shrink-0 rounded-2xl overflow-hidden",children:e.jsxs("video",{controls:!0,children:[e.jsx("source",{src:n,type:r}),"Your browser does not support the video tag."]})})}):!a&&!i&&!c?e.jsx(A,{children:e.jsx("div",{className:"size-fit border shrink-0 rounded-2xl overflow-hidden",children:e.jsxs("div",{className:"flex items-end gap-2 p-2",children:[e.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:d("text-xs text-blue-500 line-clamp-2 underline hover:text-blue-600","break-words [word-break:break-word]"),children:o}),e.jsxs("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:[(s/1024).toFixed(2)," KB"]})]})})}):e.jsxs(et,{children:[e.jsx(A,{children:e.jsx(tt,{children:e.jsx("div",{className:"size-fit border shrink-0 rounded-2xl overflow-hidden",children:a&&e.jsx("img",{src:n,className:"object-cover size-16",alt:o})})})}),e.jsxs(de,{"aria-describedby":void 0,className:"size-full max-w-full rounded-3xl flex items-center justify-center bg-transparent border-none gap-0",withClose:!0,children:[e.jsx(pe,{className:"sr-only",children:"Image preview"}),a&&e.jsx("div",{className:"size-fit shrink-0 rounded-2xl overflow-hidden max-h-full",children:e.jsx("img",{src:n,className:"object-cover size-auto",alt:o})})]})]})}const lt=w.memo(Tt,(t,o)=>t.children===o.children&&t.className===o.className);function ct({children:t,messageType:o,messageId:s}){const{anchorTarget:r}=l.useConfig();return e.jsx(lt,{"data-type":o,"data-id":s,remarkPlugins:[Ze],rehypePlugins:[Je],components:{a:({children:n,...a})=>e.jsx("a",{target:r??"_top",...a,children:n})},children:t})}function ne({data:t,id:o,type:s,attachments:r,isFirstInGroup:n,isLastInGroup:a,isAloneInGroup:i,dataComponentNames:c,classNames:p}){const{message:u,variant:z="default"}=t;return z==="error"?e.jsx("div",{children:e.jsx("div",{className:"flex flex-row flex-wrap items-center justify-start",children:e.jsx("div",{className:"leading-snug text-sm text-destructive",children:u})})}):e.jsxs("div",{...g((c==null?void 0:c.messageContainer)??"chat/agent_msg/root"),className:d("w-5/6 flex flex-col items-start gap-1",p==null?void 0:p.messageContainer),children:[r&&r.length>0&&e.jsx("div",{className:"w-full gap-1 flex flex-row flex-wrap items-center justify-start",children:r==null?void 0:r.map(j=>e.jsx(it,{attachment:j},j.id))}),u.length>0&&e.jsx("div",{...g((c==null?void 0:c.message)??"chat/agent_msg/msg"),"data-first":n,"data-last":a,"data-alone":i,className:d("transition-all","w-fit py-3 px-4 rounded-3xl bg-secondary text-secondary-foreground","leading-snug text-sm prose prose-sm prose-a:decoration-primary prose-a:underline","break-words [word-break:break-word]",n&&!i&&"rounded-bl-md",a&&!i&&"rounded-tl-md",!n&&!a&&!i&&"rounded-l-md",p==null?void 0:p.message),children:e.jsx(ct,{messageType:s,messageId:o,children:u})})]})}function At(t){return e.jsx("div",{className:"w-full max-w-full overflow-auto shrink-0",children:e.jsx("pre",{className:"text-xs leading-tight whitespace-pre-wrap break-word",children:JSON.stringify(t,null,1)})})}const he=E.forwardRef(({className:t,...o},s)=>e.jsx(Y.Root,{ref:s,className:d("relative flex size-6 aspect-square shrink-0 overflow-hidden rounded-full bg-secondary",t),...o}));he.displayName=Y.Root.displayName;const me=E.forwardRef(({className:t,...o},s)=>e.jsx(Y.Image,{ref:s,className:d("aspect-square h-full w-full",t),...o}));me.displayName=Y.Image.displayName;const ue=E.forwardRef(({className:t,...o},s)=>e.jsx(Y.Fallback,{ref:s,className:d("flex size-full text-xs items-center justify-center rounded-lg",t),...o}));ue.displayName=Y.Fallback.displayName;function ae({agent:t,...o}){var s,r;return e.jsxs(he,{...o,children:[e.jsx(me,{src:(t==null?void 0:t.avatar)??"",alt:"Agent Icon"}),(t==null?void 0:t.name)&&e.jsx(ue,{children:(r=(s=t==null?void 0:t.name)==null?void 0:s.slice(0,1))==null?void 0:r.toUpperCase()})]})}const Ft=10,Ht=(t,o,s)=>({initial:{opacity:0,x:-t,...o.initial},animate:{opacity:1,x:0,...o.animate,transition:{delay:s}},exit:{opacity:0,x:t,...o.exit}}),qt=(t,o,s)=>({initial:{opacity:0,x:t,...o.initial},animate:{opacity:1,x:0,...o.animate,transition:{delay:s}},exit:{opacity:0,x:-t,...o.exit}}),Bt=(t,o,s)=>({initial:{opacity:0,y:t,...o.initial},animate:{opacity:1,y:0,...o.animate,transition:{delay:s}},exit:{opacity:0,y:-t,...o.exit}}),Lt=(t,o,s)=>({initial:{opacity:0,y:-t,...o.initial},animate:{opacity:1,y:0,...o.animate,transition:{delay:s}},exit:{opacity:0,y:t,...o.exit}}),$t={right:Ht,left:qt,up:Bt,down:Lt},f=w.forwardRef(({fadeIn:t="down",distance:o=Ft,children:s,snapExit:r=!1,overrides:n={},delay:a=0,...i},c)=>{const p=t?$t[t](o,n,a):{};return r&&p.exit&&typeof p.exit=="object"&&!Array.isArray(p.exit)&&(p.exit.transition={duration:0}),e.jsx(N.motion.div,{ref:c,...i,...p,children:s})});f.displayName="MotionDiv";function Yt({agent:t}){return e.jsx(N.AnimatePresence,{children:e.jsxs(f,{...g("chat/bot_loading/root"),className:"flex flex-row items-end w-full gap-2 animate-pulse",children:[e.jsx(ae,{agent:t}),e.jsxs("div",{...g("chat/bot_loading/bouncing_dots_container"),className:d("flex items-center [&_span]:bg-secondary-foreground [&_span]:size-1 gap-1 p-2 rounded-xl bg-secondary"),children:[e.jsx(N.motion.span,{className:"rounded-full animate-bounce [animation-delay:-0.3s]"}),e.jsx(N.motion.span,{className:"rounded-full animate-bounce [animation-delay:-0.15s]"}),e.jsx(N.motion.span,{className:"rounded-full animate-bounce"})]})]})})}const dt='@import"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..700;1,14..32,100..700&display=swap";@import"https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap";*,: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;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]){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::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}*{-ms-overflow-style:none;scrollbar-width:none}*::-webkit-scrollbar{display:none}*{border-color:hsl(var(--opencx-border))}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:800;color:inherit}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:"`"}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-sm{font-size:.875rem;line-height:1.7142857}.prose-sm :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;line-height:1.5555556;margin-top:.8888889em;margin-bottom:.8888889em}.prose-sm :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-inline-start:1.1111111em}.prose-sm :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.1428571em;margin-top:0;margin-bottom:.8em;line-height:1.2}.prose-sm :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.4285714em;margin-top:1.6em;margin-bottom:.8em;line-height:1.4}.prose-sm :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;margin-top:1.5555556em;margin-bottom:.4444444em;line-height:1.5555556}.prose-sm :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.4285714em;margin-bottom:.5714286em;line-height:1.4285714}.prose-sm :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;border-radius:.3125rem;padding-top:.1428571em;padding-inline-end:.3571429em;padding-bottom:.1428571em;padding-inline-start:.3571429em}.prose-sm :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em}.prose-sm :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.prose-sm :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}.prose-sm :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.6666667;margin-top:1.6666667em;margin-bottom:1.6666667em;border-radius:.25rem;padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;margin-bottom:.2857143em}.prose-sm :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(.prose-sm>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(.prose-sm>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;padding-inline-start:1.5714286em}.prose-sm :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.8571429em;margin-bottom:2.8571429em}.prose-sm :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.5}.prose-sm :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.3333333;margin-top:.6666667em}.prose-sm :where(.prose-sm>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(.prose-sm>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.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}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.end-4{inset-inline-end:1rem}.end-6{inset-inline-end:1.5rem}.left-2{left:.5rem}.left-\\[50\\%\\]{left:50%}.start-0{inset-inline-start:0px}.top-0{top:0}.top-4{top:1rem}.top-6{top:1.5rem}.top-\\[50\\%\\]{top:50%}.z-10{z-index:10}.z-50{z-index:50}.m-2{margin:.5rem}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.ms-auto{margin-inline-start:auto}.mt-0\\.5{margin-top:.125rem}.mt-auto{margin-top:auto}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.size-10{width:2.5rem;height:2.5rem}.size-12{width:3rem;height:3rem}.size-16{width:4rem;height:4rem}.size-3{width:.75rem;height:.75rem}.size-4{width:1rem;height:1rem}.size-6{width:1.5rem;height:1.5rem}.size-8{width:2rem;height:2rem}.size-auto{width:auto;height:auto}.size-fit{width:fit-content;height:fit-content}.size-full{width:100%;height:100%}.h-10{height:2.5rem}.h-2{height:.5rem}.h-3\\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-full{height:100%}.h-px{height:1px}.max-h-16{max-height:4rem}.max-h-full{max-height:100%}.min-h-12{min-height:3rem}.w-0{width:0px}.w-1\\/2{width:50%}.w-10{width:2.5rem}.w-2{width:.5rem}.w-2\\/5{width:40%}.w-3\\.5{width:.875rem}.w-3\\/5{width:60%}.w-4{width:1rem}.w-5\\/6{width:83.333333%}.w-60{width:15rem}.w-9{width:2.25rem}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.min-w-\\[8rem\\]{min-width:8rem}.max-w-\\[61\\.8\\%\\]{max-width:61.8%}.max-w-full{max-width:100%}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 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-x-\\[var\\(--wobble-x\\)\\]{--tw-translate-x: var(--wobble-x);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))}.translate-y-\\[var\\(--wobble-y\\)\\]{--tw-translate-y: var(--wobble-y);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 bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@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;user-select:none}.resize-none{resize:none}.resize{resize:both}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.gap-\\[1px\\]{gap:1px}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * 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))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-scroll{overflow:scroll}.scroll-smooth{scroll-behavior:smooth}.text-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.5rem}.rounded-\\[20px\\]{border-radius:20px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-l-md{border-top-left-radius:.375rem;border-bottom-left-radius:.375rem}.rounded-r-md{border-top-right-radius:.375rem;border-bottom-right-radius:.375rem}.rounded-bl-md{border-bottom-left-radius:.375rem}.rounded-br-md{border-bottom-right-radius:.375rem}.rounded-tl-md{border-top-left-radius:.375rem}.rounded-tr-md{border-top-right-radius:.375rem}.border{border-width:1px}.border-2{border-width:2px}.border-none{border-style:none}.border-transparent{border-color:transparent}.bg-\\[white\\]{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-background{background-color:hsl(var(--opencx-background))}.bg-black\\/50{background-color:#00000080}.bg-black\\/60{background-color:#0009}.bg-destructive{background-color:hsl(var(--opencx-destructive))}.bg-muted{background-color:hsl(var(--opencx-muted))}.bg-primary{background-color:hsl(var(--opencx-primary))}.bg-secondary{background-color:hsl(var(--opencx-secondary))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-\\[radial-gradient\\(ellipse_at_top_left\\,hsl\\(var\\(--opencx-primary\\)\\)\\,transparent\\)\\,radial-gradient\\(ellipse_at_top_right\\,hsl\\(var\\(--opencx-primary\\)\\)\\,transparent\\)\\]{background-image:radial-gradient(ellipse at top left,hsl(var(--opencx-primary)),transparent),radial-gradient(ellipse at top right,hsl(var(--opencx-primary)),transparent)}.fill-current{fill:currentColor}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-4{padding:1rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3\\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.pb-0{padding-bottom:0}.pe-2{padding-inline-end:.5rem}.pe-4{padding-inline-end:1rem}.ps-2{padding-inline-start:.5rem}.ps-4{padding-inline-start:1rem}.ps-8{padding-inline-start:2rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.text-center{text-align:center}.text-start{text-align:start}.align-middle{vertical-align:middle}.text-\\[1\\.75rem\\]{font-size:1.75rem}.text-\\[10px\\]{font-size:10px}.text-\\[16px\\]{font-size:16px}.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}.uppercase{text-transform:uppercase}.leading-none{line-height:1}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-destructive{color:hsl(var(--opencx-destructive))}.text-destructive-foreground{color:hsl(var(--opencx-destructive-foreground))}.text-emerald-600{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--opencx-foreground))}.text-muted-foreground{color:hsl(var(--opencx-muted-foreground))}.text-muted-foreground\\/70{color:hsl(var(--opencx-muted-foreground) / .7)}.text-muted-foreground\\/75{color:hsl(var(--opencx-muted-foreground) / .75)}.text-primary{color:hsl(var(--opencx-primary))}.text-primary-foreground{color:hsl(var(--opencx-primary-foreground))}.text-secondary-foreground{color:hsl(var(--opencx-secondary-foreground))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-95{opacity:.95}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px 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-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-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}.outline-8{outline-width:8px}.outline-background{outline-color:hsl(var(--opencx-background))}.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(--opencx-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{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.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}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@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}.fade-in-0{--tw-enter-opacity: 0}.zoom-in-95{--tw-enter-scale: .95}.duration-200{animation-duration:.2s}.ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.\\[animation-delay\\:-0\\.15s\\]{animation-delay:-.15s}.\\[animation-delay\\:-0\\.3s\\]{animation-delay:-.3s}.\\[field-sizing\\:content\\;\\],.\\[field-sizing\\:content\\]{field-sizing:content}.\\[word-break\\:break-word\\]{word-break:break-word}.required:after{content:" *";color:red}.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}.file\\:text-primary-foreground::file-selector-button{color:hsl(var(--opencx-primary-foreground))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--opencx-muted-foreground))}.placeholder\\:text-muted-foreground\\/75::placeholder{color:hsl(var(--opencx-muted-foreground) / .75)}.focus-within\\:border-primary:focus-within{border-color:hsl(var(--opencx-primary))}.hover\\:scale-\\[var\\(--scale\\)\\]:hover{--tw-scale-x: var(--scale);--tw-scale-y: var(--scale);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\\:border-primary:hover{border-color:hsl(var(--opencx-primary))}.hover\\:bg-secondary:hover{background-color:hsl(var(--opencx-secondary))}.hover\\:text-blue-600:hover{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.hover\\:text-primary:hover{color:hsl(var(--opencx-primary))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.focus\\:bg-accent:focus{background-color:hsl(var(--opencx-accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--opencx-accent-foreground))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.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(--opencx-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-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(--opencx-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(--opencx-background))}.active\\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;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))}.active\\:hover\\:scale-\\[calc\\(var\\(--scale\\)-0\\.02\\)\\]:hover:active{--tw-scale-x: calc(var(--scale) - .02);--tw-scale-y: calc(var(--scale) - .02);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\\:active\\:scale-95:active:hover{--tw-scale-x: .95;--tw-scale-y: .95;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))}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\\:opacity-100{opacity:1}.group:hover .group-hover\\:active\\:scale-90:active,.group:active .group-active\\:scale-90{--tw-scale-x: .9;--tw-scale-y: .9;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-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[state\\=checked\\]\\:translate-x-4[data-state=checked]{--tw-translate-x: 1rem;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\\=checked\\]\\:bg-primary[data-state=checked]{background-color:hsl(var(--opencx-primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open]{background-color:hsl(var(--opencx-accent))}.data-\\[state\\=unchecked\\]\\:bg-input[data-state=unchecked]{background-color:hsl(var(--opencx-input))}.data-\\[state\\=open\\]\\:text-muted-foreground[data-state=open]{color:hsl(var(--opencx-muted-foreground))}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.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%}.prose-a\\:underline :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){text-decoration-line:underline}.prose-a\\:decoration-primary :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){text-decoration-color:hsl(var(--opencx-primary))}.rtl\\:-scale-100:where([dir=rtl],[dir=rtl] *){--tw-scale-x: -1;--tw-scale-y: -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))}.\\[\\&_span\\]\\:size-1 span{width:.25rem;height:.25rem}.\\[\\&_span\\]\\:bg-secondary-foreground span{background-color:hsl(var(--opencx-secondary-foreground))}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:size-4 svg{width:1rem;height:1rem}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&_svg\\]\\:text-muted-foreground\\/70 svg{color:hsl(var(--opencx-muted-foreground) / .7)}.\\[\\&_svg\\]\\:hover\\:text-primary:hover svg{color:hsl(var(--opencx-primary))}',Xt=G.Provider,Ut=G.Root,Vt=G.Trigger,pt=E.forwardRef(({className:t,sideOffset:o=4,...s},r)=>e.jsx(G.Content,{ref:r,sideOffset:o,className:d("z-50 overflow-hidden max-w-xs rounded-xl bg-primary border text-primary-foreground p-2 text-center align-middle text-xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",t),...s}));pt.displayName=G.Content.displayName;function U({children:t,content:o,side:s,align:r}){const{disableTooltips:n}=l.useConfig();return!o||n?t:e.jsxs(Ut,{children:[e.jsx(Vt,{asChild:!0,children:t}),e.jsx(pt,{side:s,align:r,collisionPadding:8,avoidCollisions:!0,children:o})]})}const Ve=450;function F(){const[t,o]=w.useState(()=>(window.top||window).innerWidth<Ve);return w.useEffect(()=>{const s=window.top||window,r=()=>{o(s.innerWidth<Ve)};return r(),s.addEventListener("resize",r),()=>{s.removeEventListener("resize",r)}},[]),{isSmallScreen:t}}const J={transitionTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",transitionDuration:"1000ms"};function L(){var j,h,b,x,y,I,k,T,M,O,W,P,v,C,H,_,q,Z,xe,ve,be,ye,je,ke,Ce,ze,Ne,Se,_e,Ie,Te,Me,De,Re,Pe,Ee,Oe,We,Ae,Fe,He,qe,Be,Le,$e,Ye,Xe;const{dir:t}=l.useDocumentDir(),{isSmallScreen:o}=F(),{theme:s,inline:r}=l.useConfig(),n=B=>r?"100%":B,a=(B,se)=>o?`100dv${B}`:se,i=(B,se)=>n(a(B,se)),c={zIndex:((j=s==null?void 0:s.widgetTrigger)==null?void 0:j.zIndex)??1e7,offset:{bottom:((b=(h=s==null?void 0:s.widgetTrigger)==null?void 0:h.offset)==null?void 0:b.bottom)??20,right:((y=(x=s==null?void 0:s.widgetTrigger)==null?void 0:x.offset)==null?void 0:y.right)??(t==="ltr"?20:"initial"),left:((k=(I=s==null?void 0:s.widgetTrigger)==null?void 0:I.offset)==null?void 0:k.left)??(t==="rtl"?20:"initial")},size:{button:((M=(T=s==null?void 0:s.widgetTrigger)==null?void 0:T.size)==null?void 0:M.button)??48,icon:((W=(O=s==null?void 0:s.widgetTrigger)==null?void 0:O.size)==null?void 0:W.icon)??24}},p=(()=>{const B=t==="ltr"?c.offset.right:c.offset.left;return typeof B!="number"?0:B})(),u={palette:(s==null?void 0:s.palette)??"neutral",primaryColor:(s==null?void 0:s.primaryColor)??"hsl(0 0% 9%)",widgetTrigger:c,widgetContentContainer:{borderRadius:o?"0px":((P=s==null?void 0:s.widgetContentContainer)==null?void 0:P.borderRadius)??"32px",zIndex:((v=s==null?void 0:s.widgetContentContainer)==null?void 0:v.zIndex)??c.zIndex+1,outline:((C=s==null?void 0:s.widgetContentContainer)==null?void 0:C.outline)??"none",outlineColor:((H=s==null?void 0:s.widgetContentContainer)==null?void 0:H.outlineColor)??"hsl(0 0% 50% / .5)",boxShadow:((_=s==null?void 0:s.widgetContentContainer)==null?void 0:_.boxShadow)??"0 0px 100px 0px rgb(0 0 0 / 0.25)",transitionProperty:((q=s==null?void 0:s.widgetContentContainer)==null?void 0:q.transitionProperty)??"all",transitionTimingFunction:((Z=s==null?void 0:s.widgetContentContainer)==null?void 0:Z.transitionTimingFunction)??J.transitionTimingFunction,transitionDuration:((xe=s==null?void 0:s.widgetContentContainer)==null?void 0:xe.transitionDuration)??J.transitionDuration,offset:{side:o?0:c.offset.bottom+c.size.button+$.y*2+(((be=(ve=s==null?void 0:s.widgetContentContainer)==null?void 0:ve.offset)==null?void 0:be.side)??10),align:o?0:p+(((je=(ye=s==null?void 0:s.widgetContentContainer)==null?void 0:ye.offset)==null?void 0:je.align)??0)}},screens:{welcome:{width:i("w",((Ce=(ke=s==null?void 0:s.screens)==null?void 0:ke.welcome)==null?void 0:Ce.width)??"400px"),minHeight:i("h",((Ne=(ze=s==null?void 0:s.screens)==null?void 0:ze.welcome)==null?void 0:Ne.minHeight)??"1px")},sessions:{width:i("w",((_e=(Se=s==null?void 0:s.screens)==null?void 0:Se.sessions)==null?void 0:_e.width)??"450px"),height:i("h",((Te=(Ie=s==null?void 0:s.screens)==null?void 0:Ie.sessions)==null?void 0:Te.height)??"600px")},chat:{width:i("w",((De=(Me=s==null?void 0:s.screens)==null?void 0:Me.chat)==null?void 0:De.width)??"525px"),height:i("h",((Pe=(Re=s==null?void 0:s.screens)==null?void 0:Re.chat)==null?void 0:Pe.height)??"700px"),withCanvas:{width:i("w",((We=(Oe=(Ee=s==null?void 0:s.screens)==null?void 0:Ee.chat)==null?void 0:Oe.withCanvas)==null?void 0:We.width)??"min(1050px, 100vw)"),height:i("h",((He=(Fe=(Ae=s==null?void 0:s.screens)==null?void 0:Ae.chat)==null?void 0:Fe.withCanvas)==null?void 0:He.height)??"min(800px, 100vh)"),transitionTimingFunction:((Le=(Be=(qe=s==null?void 0:s.screens)==null?void 0:qe.chat)==null?void 0:Be.withCanvas)==null?void 0:Le.transitionTimingFunction)??J.transitionTimingFunction,transitionDuration:((Xe=(Ye=($e=s==null?void 0:s.screens)==null?void 0:$e.chat)==null?void 0:Ye.withCanvas)==null?void 0:Xe.transitionDuration)??J.transitionDuration}}}},z={maxHeight:i("h",`calc(
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),bt=require("@radix-ui/react-popover"),m=require("react"),l=require("@opencx/widget-react-headless"),yt=require("clsx"),jt=require("tailwind-merge"),N=require("framer-motion"),kt=require("@radix-ui/react-slot"),Ct=require("class-variance-authority"),u=require("lucide-react"),Ue=require("remark-gfm"),zt=require("react-markdown"),Ve=require("rehype-raw"),M=require("@opencx/widget-core"),Nt=require("@radix-ui/react-avatar"),Ke=require("@uiw/react-iframe"),St=require("@radix-ui/react-tooltip"),Le=require("tinycolor2"),_t=require("react-dropzone"),Tt=require("react-use/lib/useAsyncFn"),se=require("zod");function J(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(o,s,r.get?r:{enumerable:!0,get:()=>t[s]})}}return o.default=t,Object.freeze(o)}const Q=J(bt),L=J(m),$=J(Nt),V=J(St);function g(t){return{"data-component":t}}function p(...t){return jt.twMerge(yt.clsx(t))}const B={x:2,y:2},W=m.memo(m.forwardRef(({children:t,className:o,scale:s=1.02,off:r=!1},n)=>{const[a,i]=m.useState(!1),[c,d]=m.useState({x:0,y:0});if(r||/translate/.test(t.props.className||""))return t;const k=x=>{var z,A;const{clientX:y,clientY:T}=x,C=x.currentTarget.getBoundingClientRect(),I=y-(C.left+C.width/2),E=T-(C.top+C.height/2),P=Math.max(-1,Math.min(1,I/(C.width/2))),R=Math.max(-1,Math.min(1,E/(C.height/2))),D=P*B.x,v=R*B.y;d({x:D,y:v}),(A=(z=t.props).onMouseMove)==null||A.call(z,x)},j=()=>{var x,y;i(!0),(y=(x=t.props).onMouseEnter)==null||y.call(x)},h=()=>{var x,y;i(!1),d({x:0,y:0}),(y=(x=t.props).onMouseLeave)==null||y.call(x)},b={"--wobble-x":a?`${c.x}px`:"0px","--wobble-y":a?`${c.y}px`:"0px","--scale":1-(s-1)};return m.cloneElement(t,{ref:n,onMouseMove:k,onMouseEnter:j,onMouseLeave:h,style:{...b,...t.props.style},className:p("translate-x-[var(--wobble-x)]","translate-y-[var(--wobble-y)]","hover:scale-[var(--scale)] active:hover:scale-[calc(var(--scale)-0.02)]",o,t.props.className,"transition-all ease-out")})}));W.displayName="Wobble";const It=10,Mt=(t,o,s)=>({initial:{opacity:0,x:-t,...o.initial},animate:{opacity:1,x:0,...o.animate,transition:{delay:s}},exit:{opacity:0,x:t,...o.exit}}),Dt=(t,o,s)=>({initial:{opacity:0,x:t,...o.initial},animate:{opacity:1,x:0,...o.animate,transition:{delay:s}},exit:{opacity:0,x:-t,...o.exit}}),Et=(t,o,s)=>({initial:{opacity:0,y:t,...o.initial},animate:{opacity:1,y:0,...o.animate,transition:{delay:s}},exit:{opacity:0,y:-t,...o.exit}}),Pt=(t,o,s)=>({initial:{opacity:0,y:-t,...o.initial},animate:{opacity:1,y:0,...o.animate,transition:{delay:s}},exit:{opacity:0,y:t,...o.exit}}),Rt={right:Mt,left:Dt,up:Et,down:Pt},f=m.forwardRef(({fadeIn:t="down",distance:o=It,children:s,snapExit:r=!1,overrides:n={},delay:a=0,...i},c)=>{const d=t?Rt[t](o,n,a):{};return r&&d.exit&&typeof d.exit=="object"&&!Array.isArray(d.exit)&&(d.exit.transition={duration:0}),e.jsx(N.motion.div,{ref:c,...i,...d,children:s})});f.displayName="MotionDiv";const Wt=Ct.cva(p("inline-flex shrink-0 items-center justify-center gap-2","text-sm font-medium whitespace-nowrap","ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50","active:scale-95 hover:active:scale-95","rounded-xl","transition"),{variants:{variant:{default:"bg-primary text-primary-foreground",destructive:"bg-destructive text-destructive-foreground",outline:"bg-background",secondary:"bg-secondary text-secondary-foreground",ghost:"hover:bg-secondary",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"py-2 px-3.5 text-xs",lg:"min-h-12 px-4 rounded-[20px]",icon:"h-10 w-10",fit:"size-fit p-2",free:"p-2",selfless:"p-0"}},defaultVariants:{variant:"default",size:"default"}}),S=L.forwardRef(({className:t,variant:o="default",size:s,asChild:r=!1,...n},a)=>{const i=r?kt.Slot:"button";return e.jsx(W,{ref:a,children:e.jsx(i,{...g("ui_lib/btn"),"data-variant":o,className:p(Wt({variant:o,size:s,className:t})),...n})})});S.displayName="Button";const Ge=m.createContext(null);function Ot({children:t}){const[o,s]=m.useState(!1),[r,n]=m.useState(null),a=c=>{n(c),s(!0)},i=()=>{s(!1),setTimeout(()=>{n(null)},200)};return e.jsxs(Ge.Provider,{value:{open:a,close:i,isOpen:o,content:r},children:[e.jsx(At,{}),t]})}function ee(){const t=m.useContext(Ge);return t||(console.error("useDialoger must be used within a DialogerProvider"),{open:()=>{},close:()=>{},isOpen:!1,content:null})}function At(){const{contentIframeRef:t}=l.useWidget(),{isOpen:o,content:s,close:r}=ee();return m.useEffect(()=>{var a,i;const n=c=>{c.key==="Escape"&&r()};return(i=(a=t==null?void 0:t.current)==null?void 0:a.contentWindow)==null||i.document.addEventListener("keydown",n),()=>{var c,d;return(d=(c=t==null?void 0:t.current)==null?void 0:c.contentWindow)==null?void 0:d.document.removeEventListener("keydown",n)}},[]),e.jsx(N.AnimatePresence,{mode:"wait",children:o&&s&&e.jsx(f,{overrides:{initial:{y:0},exit:{y:0}},className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm",tabIndex:-1,onClick:r,children:s},"dialog-content")})}function Ze({children:t,className:o,withClose:s=!1}){const{close:r}=ee();return e.jsxs("div",{className:p("fixed left-[50%] top-[50%] z-50 flex flex-col gap-4 w-full max-w-[61.8%] translate-x-[-50%] translate-y-[-50%] border bg-background p-4 rounded-3xl",o),onClick:n=>n.stopPropagation(),children:[t,s&&e.jsxs(S,{size:"fit",className:"rounded-full absolute top-4 right-4",variant:"secondary",onClick:r,children:[e.jsx(u.X,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})}const Je=({className:t,...o})=>e.jsx("div",{className:p("flex flex-col gap-2 text-center pt-2",t),...o});Je.displayName="DialogerHeader";const Qe=({className:t,...o})=>e.jsx("div",{className:p("flex flex-col gap-2 text-center",t),...o});Qe.displayName="DialogerBody";const et=({className:t,...o})=>e.jsx("div",{className:p("flex flex-col gap-2",t),...o});et.displayName="DialogerFooter";const tt=m.forwardRef(({className:t,...o},s)=>e.jsx("p",{ref:s,className:p("text-lg font-semibold leading-none tracking-tight",t),...o}));tt.displayName="DialogerTitle";const st=m.forwardRef(({className:t,...o},s)=>e.jsx("p",{ref:s,className:p("text-sm text-muted-foreground",t),...o}));st.displayName="DialogerDescription";function ot({children:t,trigger:o}){const{open:s}=ee();return m.cloneElement(o,{onClick:()=>s(t)})}function rt({attachment:t}){const{name:o,size:s,type:r,url:n}=t,a=r.startsWith("image/"),i=r.startsWith("video/"),c=r.startsWith("audio/");return c?e.jsx(W,{children:e.jsx("div",{className:"w-full shrink-0 overflow-hidden",children:e.jsxs("audio",{controls:!0,className:"w-full",children:[e.jsx("source",{src:n,type:r}),"Your browser does not support the audio tag."]})})}):i?e.jsx(W,{children:e.jsx("div",{className:"w-full border shrink-0 rounded-2xl overflow-hidden",children:e.jsxs("video",{controls:!0,children:[e.jsx("source",{src:n,type:r}),"Your browser does not support the video tag."]})})}):!a&&!i&&!c?e.jsx(W,{children:e.jsx("div",{className:"size-fit border shrink-0 rounded-2xl overflow-hidden",children:e.jsxs("div",{className:"flex items-end gap-2 p-2",children:[e.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:p("text-xs text-blue-500 line-clamp-2 underline hover:text-blue-600","break-words [word-break:break-word]"),children:o}),e.jsxs("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:[(s/1024).toFixed(2)," KB"]})]})})}):e.jsx(ot,{trigger:e.jsx("div",{children:e.jsx(W,{children:e.jsx("div",{className:"size-fit border shrink-0 rounded-2xl overflow-hidden",children:a&&e.jsx("img",{src:n,className:"object-cover size-16",alt:o})})})}),children:e.jsx(Ze,{className:"size-full max-w-full rounded-3xl flex items-center justify-center bg-transparent border-none gap-0",withClose:!0,children:a&&e.jsx("div",{className:"size-fit shrink-0 rounded-2xl overflow-hidden max-h-full",children:e.jsx("img",{src:n,className:"object-cover size-auto",alt:o})})})})}const nt=m.memo(zt,(t,o)=>t.children===o.children&&t.className===o.className);function at({children:t,messageType:o,messageId:s}){const{anchorTarget:r}=l.useConfig();return e.jsx(nt,{"data-type":o,"data-id":s,remarkPlugins:[Ue],rehypePlugins:[Ve],components:{a:({children:n,...a})=>e.jsx("a",{target:r??"_top",...a,children:n})},children:t})}function re({data:t,id:o,type:s,attachments:r,isFirstInGroup:n,isLastInGroup:a,isAloneInGroup:i,dataComponentNames:c,classNames:d}){const{message:w,variant:k="default"}=t;return k==="error"?e.jsx("div",{children:e.jsx("div",{className:"flex flex-row flex-wrap items-center justify-start",children:e.jsx("div",{className:"leading-snug text-sm text-destructive",children:w})})}):e.jsxs("div",{...g((c==null?void 0:c.messageContainer)??"chat/agent_msg/root"),className:p("w-5/6 flex flex-col items-start gap-1",d==null?void 0:d.messageContainer),children:[r&&r.length>0&&e.jsx("div",{className:"w-full gap-1 flex flex-row flex-wrap items-center justify-start",children:r==null?void 0:r.map(j=>e.jsx(rt,{attachment:j},j.id))}),w.length>0&&e.jsx("div",{...g((c==null?void 0:c.message)??"chat/agent_msg/msg"),"data-first":n,"data-last":a,"data-alone":i,className:p("transition-all","w-fit py-3 px-4 rounded-3xl bg-secondary text-secondary-foreground","leading-snug text-sm prose prose-sm prose-a:decoration-primary prose-a:underline","break-words [word-break:break-word]",n&&!i&&"rounded-bl-md",a&&!i&&"rounded-tl-md",!n&&!a&&!i&&"rounded-l-md",d==null?void 0:d.message),children:e.jsx(at,{messageType:s,messageId:o,children:w})})]})}function Ft(t){return e.jsx("div",{className:"w-full max-w-full overflow-auto shrink-0",children:e.jsx("pre",{className:"text-xs leading-tight whitespace-pre-wrap break-word",children:JSON.stringify(t,null,1)})})}const le=L.forwardRef(({className:t,...o},s)=>e.jsx($.Root,{ref:s,className:p("relative flex size-6 aspect-square shrink-0 overflow-hidden rounded-full bg-secondary",t),...o}));le.displayName=$.Root.displayName;const ce=L.forwardRef(({className:t,...o},s)=>e.jsx($.Image,{ref:s,className:p("aspect-square h-full w-full",t),...o}));ce.displayName=$.Image.displayName;const de=L.forwardRef(({className:t,...o},s)=>e.jsx($.Fallback,{ref:s,className:p("flex size-full text-xs items-center justify-center rounded-lg",t),...o}));de.displayName=$.Fallback.displayName;function ne({agent:t,...o}){var s,r;return e.jsxs(le,{...o,children:[e.jsx(ce,{src:(t==null?void 0:t.avatar)??"",alt:"Agent Icon"}),(t==null?void 0:t.name)&&e.jsx(de,{children:(r=(s=t==null?void 0:t.name)==null?void 0:s.slice(0,1))==null?void 0:r.toUpperCase()})]})}function Ht({agent:t}){return e.jsx(N.AnimatePresence,{children:e.jsxs(f,{...g("chat/bot_loading/root"),className:"flex flex-row items-end w-full gap-2 animate-pulse",children:[e.jsx(ne,{agent:t}),e.jsxs("div",{...g("chat/bot_loading/bouncing_dots_container"),className:p("flex items-center [&_span]:bg-secondary-foreground [&_span]:size-1 gap-1 p-2 rounded-xl bg-secondary"),children:[e.jsx(N.motion.span,{className:"rounded-full animate-bounce [animation-delay:-0.3s]"}),e.jsx(N.motion.span,{className:"rounded-full animate-bounce [animation-delay:-0.15s]"}),e.jsx(N.motion.span,{className:"rounded-full animate-bounce"})]})]})})}const it='@import"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..700;1,14..32,100..700&display=swap";@import"https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap";*,: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;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]){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::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}*{-ms-overflow-style:none;scrollbar-width:none}*::-webkit-scrollbar{display:none}*{border-color:hsl(var(--opencx-border))}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:800;color:inherit}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:"`"}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-sm{font-size:.875rem;line-height:1.7142857}.prose-sm :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;line-height:1.5555556;margin-top:.8888889em;margin-bottom:.8888889em}.prose-sm :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-inline-start:1.1111111em}.prose-sm :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.1428571em;margin-top:0;margin-bottom:.8em;line-height:1.2}.prose-sm :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.4285714em;margin-top:1.6em;margin-bottom:.8em;line-height:1.4}.prose-sm :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;margin-top:1.5555556em;margin-bottom:.4444444em;line-height:1.5555556}.prose-sm :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.4285714em;margin-bottom:.5714286em;line-height:1.4285714}.prose-sm :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;border-radius:.3125rem;padding-top:.1428571em;padding-inline-end:.3571429em;padding-bottom:.1428571em;padding-inline-start:.3571429em}.prose-sm :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em}.prose-sm :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.prose-sm :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}.prose-sm :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.6666667;margin-top:1.6666667em;margin-bottom:1.6666667em;border-radius:.25rem;padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;margin-bottom:.2857143em}.prose-sm :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(.prose-sm>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(.prose-sm>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;padding-inline-start:1.5714286em}.prose-sm :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.8571429em;margin-bottom:2.8571429em}.prose-sm :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.5}.prose-sm :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.3333333;margin-top:.6666667em}.prose-sm :where(.prose-sm>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(.prose-sm>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.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}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.end-6{inset-inline-end:1.5rem}.left-2{left:.5rem}.left-\\[50\\%\\]{left:50%}.right-4{right:1rem}.top-4{top:1rem}.top-6{top:1.5rem}.top-\\[50\\%\\]{top:50%}.isolate{isolation:isolate}.z-10{z-index:10}.z-50{z-index:50}.m-2{margin:.5rem}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.ms-auto{margin-inline-start:auto}.mt-0\\.5{margin-top:.125rem}.mt-auto{margin-top:auto}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.size-10{width:2.5rem;height:2.5rem}.size-12{width:3rem;height:3rem}.size-16{width:4rem;height:4rem}.size-3{width:.75rem;height:.75rem}.size-4{width:1rem;height:1rem}.size-6{width:1.5rem;height:1.5rem}.size-8{width:2rem;height:2rem}.size-auto{width:auto;height:auto}.size-fit{width:fit-content;height:fit-content}.size-full{width:100%;height:100%}.h-10{height:2.5rem}.h-2{height:.5rem}.h-3\\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-full{height:100%}.h-px{height:1px}.max-h-16{max-height:4rem}.max-h-full{max-height:100%}.min-h-12{min-height:3rem}.w-0{width:0px}.w-1\\/2{width:50%}.w-10{width:2.5rem}.w-2{width:.5rem}.w-2\\/5{width:40%}.w-3\\.5{width:.875rem}.w-3\\/5{width:60%}.w-4{width:1rem}.w-5\\/6{width:83.333333%}.w-60{width:15rem}.w-9{width:2.25rem}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.min-w-\\[8rem\\]{min-width:8rem}.max-w-\\[61\\.8\\%\\]{max-width:61.8%}.max-w-full{max-width:100%}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 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-x-\\[var\\(--wobble-x\\)\\]{--tw-translate-x: var(--wobble-x);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))}.translate-y-\\[var\\(--wobble-y\\)\\]{--tw-translate-y: var(--wobble-y);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 bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@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;user-select:none}.resize-none{resize:none}.resize{resize:both}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.gap-\\[1px\\]{gap:1px}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * 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))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-scroll{overflow:scroll}.scroll-smooth{scroll-behavior:smooth}.text-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.5rem}.rounded-\\[20px\\]{border-radius:20px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-l-md{border-top-left-radius:.375rem;border-bottom-left-radius:.375rem}.rounded-r-md{border-top-right-radius:.375rem;border-bottom-right-radius:.375rem}.rounded-bl-md{border-bottom-left-radius:.375rem}.rounded-br-md{border-bottom-right-radius:.375rem}.rounded-tl-md{border-top-left-radius:.375rem}.rounded-tr-md{border-top-right-radius:.375rem}.border{border-width:1px}.border-2{border-width:2px}.border-none{border-style:none}.border-transparent{border-color:transparent}.bg-\\[white\\]{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-background{background-color:hsl(var(--opencx-background))}.bg-black\\/50{background-color:#00000080}.bg-black\\/60{background-color:#0009}.bg-destructive{background-color:hsl(var(--opencx-destructive))}.bg-muted{background-color:hsl(var(--opencx-muted))}.bg-primary{background-color:hsl(var(--opencx-primary))}.bg-secondary{background-color:hsl(var(--opencx-secondary))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-\\[radial-gradient\\(ellipse_at_top_left\\,hsl\\(var\\(--opencx-primary\\)\\)\\,transparent\\)\\,radial-gradient\\(ellipse_at_top_right\\,hsl\\(var\\(--opencx-primary\\)\\)\\,transparent\\)\\]{background-image:radial-gradient(ellipse at top left,hsl(var(--opencx-primary)),transparent),radial-gradient(ellipse at top right,hsl(var(--opencx-primary)),transparent)}.fill-current{fill:currentColor}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-4{padding:1rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3\\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.pb-0{padding-bottom:0}.pe-2{padding-inline-end:.5rem}.pe-4{padding-inline-end:1rem}.ps-2{padding-inline-start:.5rem}.ps-4{padding-inline-start:1rem}.ps-8{padding-inline-start:2rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.text-center{text-align:center}.text-start{text-align:start}.align-middle{vertical-align:middle}.text-\\[1\\.75rem\\]{font-size:1.75rem}.text-\\[10px\\]{font-size:10px}.text-\\[16px\\]{font-size:16px}.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}.uppercase{text-transform:uppercase}.leading-none{line-height:1}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-destructive{color:hsl(var(--opencx-destructive))}.text-destructive-foreground{color:hsl(var(--opencx-destructive-foreground))}.text-emerald-600{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--opencx-foreground))}.text-muted-foreground{color:hsl(var(--opencx-muted-foreground))}.text-muted-foreground\\/70{color:hsl(var(--opencx-muted-foreground) / .7)}.text-muted-foreground\\/75{color:hsl(var(--opencx-muted-foreground) / .75)}.text-primary{color:hsl(var(--opencx-primary))}.text-primary-foreground{color:hsl(var(--opencx-primary-foreground))}.text-secondary-foreground{color:hsl(var(--opencx-secondary-foreground))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-95{opacity:.95}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px 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-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-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}.outline-8{outline-width:8px}.outline-background{outline-color:hsl(var(--opencx-background))}.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(--opencx-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{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.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-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@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}.fade-in-0{--tw-enter-opacity: 0}.zoom-in-95{--tw-enter-scale: .95}.ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.\\[animation-delay\\:-0\\.15s\\]{animation-delay:-.15s}.\\[animation-delay\\:-0\\.3s\\]{animation-delay:-.3s}.\\[field-sizing\\:content\\;\\],.\\[field-sizing\\:content\\]{field-sizing:content}.\\[word-break\\:break-word\\]{word-break:break-word}.required:after{content:" *";color:red}.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}.file\\:text-primary-foreground::file-selector-button{color:hsl(var(--opencx-primary-foreground))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--opencx-muted-foreground))}.placeholder\\:text-muted-foreground\\/75::placeholder{color:hsl(var(--opencx-muted-foreground) / .75)}.focus-within\\:border-primary:focus-within{border-color:hsl(var(--opencx-primary))}.hover\\:scale-\\[var\\(--scale\\)\\]:hover{--tw-scale-x: var(--scale);--tw-scale-y: var(--scale);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\\:border-primary:hover{border-color:hsl(var(--opencx-primary))}.hover\\:bg-secondary:hover{background-color:hsl(var(--opencx-secondary))}.hover\\:text-blue-600:hover{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.hover\\:text-primary:hover{color:hsl(var(--opencx-primary))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.focus\\:bg-accent:focus{background-color:hsl(var(--opencx-accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--opencx-accent-foreground))}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.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(--opencx-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(--opencx-background))}.active\\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;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))}.active\\:hover\\:scale-\\[calc\\(var\\(--scale\\)-0\\.02\\)\\]:hover:active{--tw-scale-x: calc(var(--scale) - .02);--tw-scale-y: calc(var(--scale) - .02);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\\:active\\:scale-95:active:hover{--tw-scale-x: .95;--tw-scale-y: .95;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))}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\\:opacity-100{opacity:1}.group:hover .group-hover\\:active\\:scale-90:active,.group:active .group-active\\:scale-90{--tw-scale-x: .9;--tw-scale-y: .9;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-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[state\\=checked\\]\\:translate-x-4[data-state=checked]{--tw-translate-x: 1rem;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\\=checked\\]\\:bg-primary[data-state=checked]{background-color:hsl(var(--opencx-primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open]{background-color:hsl(var(--opencx-accent))}.data-\\[state\\=unchecked\\]\\:bg-input[data-state=unchecked]{background-color:hsl(var(--opencx-input))}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.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}.prose-a\\:underline :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){text-decoration-line:underline}.prose-a\\:decoration-primary :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){text-decoration-color:hsl(var(--opencx-primary))}.rtl\\:-scale-100:where([dir=rtl],[dir=rtl] *){--tw-scale-x: -1;--tw-scale-y: -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))}.\\[\\&_span\\]\\:size-1 span{width:.25rem;height:.25rem}.\\[\\&_span\\]\\:bg-secondary-foreground span{background-color:hsl(var(--opencx-secondary-foreground))}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:size-4 svg{width:1rem;height:1rem}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&_svg\\]\\:text-muted-foreground\\/70 svg{color:hsl(var(--opencx-muted-foreground) / .7)}.\\[\\&_svg\\]\\:hover\\:text-primary:hover svg{color:hsl(var(--opencx-primary))}',qt=V.Provider,Bt=V.Root,Lt=V.Trigger,lt=L.forwardRef(({className:t,sideOffset:o=4,...s},r)=>e.jsx(V.Content,{ref:r,sideOffset:o,className:p("z-50 overflow-hidden max-w-xs rounded-xl bg-primary border text-primary-foreground p-2 text-center align-middle text-xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",t),...s}));lt.displayName=V.Content.displayName;function X({children:t,content:o,side:s,align:r}){const{disableTooltips:n}=l.useConfig();return!o||n?t:e.jsxs(Bt,{children:[e.jsx(Lt,{asChild:!0,children:t}),e.jsx(lt,{side:s,align:r,collisionPadding:8,avoidCollisions:!0,children:o})]})}const $e=450;function O(){const[t,o]=m.useState(()=>(window.top||window).innerWidth<$e);return m.useEffect(()=>{const s=window.top||window,r=()=>{o(s.innerWidth<$e)};return r(),s.addEventListener("resize",r),()=>{s.removeEventListener("resize",r)}},[]),{isSmallScreen:t}}const G={transitionTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",transitionDuration:"1000ms"};function q(){var j,h,b,x,y,T,C,I,E,P,R,D,v,z,A,_,F,K,ue,ge,we,fe,xe,ve,be,ye,je,ke,Ce,ze,Ne,Se,_e,Te,Ie,Me,De,Ee,Pe,Re,We,Oe,Ae,Fe,He,qe,Be;const{dir:t}=l.useDocumentDir(),{isSmallScreen:o}=O(),{theme:s,inline:r}=l.useConfig(),n=H=>r?"100%":H,a=(H,te)=>o?`100dv${H}`:te,i=(H,te)=>n(a(H,te)),c={zIndex:((j=s==null?void 0:s.widgetTrigger)==null?void 0:j.zIndex)??1e7,offset:{bottom:((b=(h=s==null?void 0:s.widgetTrigger)==null?void 0:h.offset)==null?void 0:b.bottom)??20,right:((y=(x=s==null?void 0:s.widgetTrigger)==null?void 0:x.offset)==null?void 0:y.right)??(t==="ltr"?20:"initial"),left:((C=(T=s==null?void 0:s.widgetTrigger)==null?void 0:T.offset)==null?void 0:C.left)??(t==="rtl"?20:"initial")},size:{button:((E=(I=s==null?void 0:s.widgetTrigger)==null?void 0:I.size)==null?void 0:E.button)??48,icon:((R=(P=s==null?void 0:s.widgetTrigger)==null?void 0:P.size)==null?void 0:R.icon)??24}},d=(()=>{const H=t==="ltr"?c.offset.right:c.offset.left;return typeof H!="number"?0:H})(),w={palette:(s==null?void 0:s.palette)??"neutral",primaryColor:(s==null?void 0:s.primaryColor)??"hsl(0 0% 9%)",widgetTrigger:c,widgetContentContainer:{borderRadius:o?"0px":((D=s==null?void 0:s.widgetContentContainer)==null?void 0:D.borderRadius)??"32px",zIndex:((v=s==null?void 0:s.widgetContentContainer)==null?void 0:v.zIndex)??c.zIndex+1,outline:((z=s==null?void 0:s.widgetContentContainer)==null?void 0:z.outline)??"none",outlineColor:((A=s==null?void 0:s.widgetContentContainer)==null?void 0:A.outlineColor)??"hsl(0 0% 50% / .5)",boxShadow:((_=s==null?void 0:s.widgetContentContainer)==null?void 0:_.boxShadow)??"0 0px 100px 0px rgb(0 0 0 / 0.25)",transitionProperty:((F=s==null?void 0:s.widgetContentContainer)==null?void 0:F.transitionProperty)??"all",transitionTimingFunction:((K=s==null?void 0:s.widgetContentContainer)==null?void 0:K.transitionTimingFunction)??G.transitionTimingFunction,transitionDuration:((ue=s==null?void 0:s.widgetContentContainer)==null?void 0:ue.transitionDuration)??G.transitionDuration,offset:{side:o?0:c.offset.bottom+c.size.button+B.y*2+(((we=(ge=s==null?void 0:s.widgetContentContainer)==null?void 0:ge.offset)==null?void 0:we.side)??10),align:o?0:d+(((xe=(fe=s==null?void 0:s.widgetContentContainer)==null?void 0:fe.offset)==null?void 0:xe.align)??0)}},screens:{welcome:{width:i("w",((be=(ve=s==null?void 0:s.screens)==null?void 0:ve.welcome)==null?void 0:be.width)??"400px"),minHeight:i("h",((je=(ye=s==null?void 0:s.screens)==null?void 0:ye.welcome)==null?void 0:je.minHeight)??"1px")},sessions:{width:i("w",((Ce=(ke=s==null?void 0:s.screens)==null?void 0:ke.sessions)==null?void 0:Ce.width)??"450px"),height:i("h",((Ne=(ze=s==null?void 0:s.screens)==null?void 0:ze.sessions)==null?void 0:Ne.height)??"600px")},chat:{width:i("w",((_e=(Se=s==null?void 0:s.screens)==null?void 0:Se.chat)==null?void 0:_e.width)??"525px"),height:i("h",((Ie=(Te=s==null?void 0:s.screens)==null?void 0:Te.chat)==null?void 0:Ie.height)??"700px"),withCanvas:{width:i("w",((Ee=(De=(Me=s==null?void 0:s.screens)==null?void 0:Me.chat)==null?void 0:De.withCanvas)==null?void 0:Ee.width)??"min(1050px, 100vw)"),height:i("h",((We=(Re=(Pe=s==null?void 0:s.screens)==null?void 0:Pe.chat)==null?void 0:Re.withCanvas)==null?void 0:We.height)??"min(800px, 100vh)"),transitionTimingFunction:((Fe=(Ae=(Oe=s==null?void 0:s.screens)==null?void 0:Oe.chat)==null?void 0:Ae.withCanvas)==null?void 0:Fe.transitionTimingFunction)??G.transitionTimingFunction,transitionDuration:((Be=(qe=(He=s==null?void 0:s.screens)==null?void 0:He.chat)==null?void 0:qe.withCanvas)==null?void 0:Be.transitionDuration)??G.transitionDuration}}}},k={maxHeight:i("h",`calc(
2
2
  100vh
3
- - ${u.widgetTrigger.offset.bottom}px
4
- - ${u.widgetContentContainer.offset.side}px
5
- - ${$.y*2}px
3
+ - ${w.widgetTrigger.offset.bottom}px
4
+ - ${w.widgetContentContainer.offset.side}px
5
+ - ${B.y*2}px
6
6
  )`),maxWidth:i("w",`calc(
7
7
  100vw
8
- - ${p*2}px
8
+ - ${d*2}px
9
9
  )`),minHeight:i("h",`min(
10
- ${u.screens.welcome.minHeight},
11
- ${u.screens.sessions.height},
12
- ${u.screens.chat.height}
10
+ ${w.screens.welcome.minHeight},
11
+ ${w.screens.sessions.height},
12
+ ${w.screens.chat.height}
13
13
  )`),minWidth:i("w",`min(
14
- ${u.screens.welcome.width},
15
- ${u.screens.sessions.width},
16
- ${u.screens.chat.width}
17
- )`)};return{theme:u,computed:z,cssVars:Kt({palette:u.palette,primary:u.primaryColor})}}function Kt({palette:t,primary:o}){const s=ht(t),r=Ue(o).toHsl(),n=Ue(o).isLight()?s[950]:s[50];return{"--opencx-primary":`${r.h} ${r.s*100}% ${r.l*100}%`,"--opencx-primary-foreground":n,"--opencx-background":s[100],"--opencx-foreground":s[950],"--opencx-destructive":"0 72.2% 50.6%","--opencx-destructive-foreground":s[50],"--opencx-accent":s[200],"--opencx-accent-foreground":"var(--opencx-foreground)","--opencx-secondary":s[200],"--opencx-secondary-foreground":"var(--opencx-foreground)","--opencx-muted":s[200],"--opencx-muted-foreground":s[500],"--opencx-input":s[300],"--opencx-border":s[300],"--opencx-ring":"var(--opencx-foreground)"}}function ht(t){const o={50:"0 0% 98%",100:"0 0% 96.1%",200:"0 0% 89.8%",300:"0 0% 83.1%",400:"0 0% 63.9%",500:"0 0% 45.1%",600:"0 0% 32.2%",700:"0 0% 25.1%",800:"0 0% 14.9%",900:"0 0% 9%",950:"0 0% 3.9%"},s={50:"60 9.1% 97.8%",100:"60 4.8% 95.9%",200:"20 5.9% 90%",300:"24 5.7% 82.9%",400:"24 5.4% 63.9%",500:"25 5.3% 44.7%",600:"33.3 5.5% 32.4%",700:"30 6.3% 25.1%",800:"12 6.5% 15.1%",900:"24 9.8% 10%",950:"20 14.3% 4.1%"},r={50:"0 0% 98%",100:"240 4.8% 95.9%",200:"240 5.9% 90%",300:"240 4.9% 83.9%",400:"240 5% 64.9%",500:"240 3.8% 46.1%",600:"240 5.2% 33.9%",700:"240 5.3% 26.1%",800:"240 3.7% 15.9%",900:"240 5.9% 10%",950:"240 10% 3.9%"},n={50:"210 40% 98%",100:"210 40% 96.1%",200:"214.3 31.8% 91.4%",300:"212.7 26.8% 83.9%",400:"215 20.2% 65.1%",500:"215.4 16.3% 46.9%",600:"215.3 19.3% 34.5%",700:"215.3 25% 26.7%",800:"217.2 32.6% 17.5%",900:"222.2 47.4% 11.2%",950:"222.2 84% 4.9%"};switch(t){case"neutral":return o;case"stone":return s;case"zinc":return r;case"slate":return n;default:return D.isExhaustive(t,ht.name),o}}function mt(){const{contentIframeRef:t}=l.useWidget(),{inline:o}=l.useConfig();return{setWidth:s=>{var r;(r=t==null?void 0:t.current)==null||r.style.setProperty("--opencx-widget-width",o?"100%":s)},setHeight:s=>{var r;(r=t==null?void 0:t.current)==null||r.style.setProperty("--opencx-widget-height",o?"100%":s)}}}function ge({width:t,height:o}){const{isSmallScreen:s}=F(),{setWidth:r,setHeight:n}=mt();w.useEffect(()=>{t&&r(t),o&&n(o)},[s,o,t,r,n])}const Ke=m.CircleDashedIcon;function V({name:t,className:o}){const s=(()=>{switch(t){case"Check":return m.CheckIcon;case"CheckCheck":return m.CheckCheckIcon;case"CircleCheck":return m.CircleCheckIcon;case"CircleCheckBig":return m.CircleCheckBigIcon;case"CircleX":return m.CircleXIcon;case"Expand":return m.ExpandIcon;case"Maximize":return m.MaximizeIcon;case"Maximize2":return m.Maximize2Icon;case"Minimize":return m.MinimizeIcon;case"Minimize2":return m.Minimize2Icon;case"Shrink":return m.ShrinkIcon;case"SquareCheck":return m.SquareCheckIcon;case"SquareCheckBig":return m.SquareCheckBigIcon;case"SquareX":return m.SquareXIcon;case"X":return m.XIcon;case void 0:return Ke;default:return D.isExhaustive(t,V.name),Ke}})();return e.jsx(s,{className:d("size-4",o)})}function ut({className:t,...o}){return e.jsx("div",{className:d("animate-pulse rounded-md bg-secondary",t),...o})}function we(){var n;const{data:t}=l.usePreludeData(),{routerState:{screen:o}}=l.useWidgetRouter(),{textContent:s}=l.useConfig();return(()=>{var a,i;switch(o){case"chat":return(a=s==null?void 0:s.chatScreen)==null?void 0:a.headerTitle;case"sessions":return(i=s==null?void 0:s.sessionsScreen)==null?void 0:i.headerTitle;case"welcome":return;default:D.isExhaustive(o,we.name);return}})()??((n=t==null?void 0:t.data)==null?void 0:n.organizationName)??"Chat"}function Gt(t){switch(t){case"chat":return g("chat/header");case"sessions":return g("sessions/header");case"welcome":return;default:D.isExhaustive(t,we.name);return}}function Zt(){const{router:t}=l.useConfig(),{routerState:{screen:o},toSessionsScreen:s}=l.useWidgetRouter();return o!=="chat"||t!=null&&t.chatScreenOnly?null:e.jsx(S,{variant:"ghost",size:"fit",className:"rounded-full",onClick:s,children:e.jsx(m.ChevronLeftIcon,{className:"size-4 rtl:-scale-100"})})}function Jt({button:t}){const{setIsOpen:o}=l.useWidgetTrigger(),{isSmallScreen:s}=F();if(s&&t.hideOnSmallScreen||!s&&t.hideOnLargeScreen)return null;const r=()=>{if(t.handleClick)return t.handleClick();o(!1)};return e.jsx(S,{variant:"ghost",size:"fit",className:"rounded-full",onClick:r,children:e.jsx(V,{name:t.icon})})}function ie({button:t}){const[o,s]=w.useState(!1),{routerState:{screen:r}}=l.useWidgetRouter(),{isSmallScreen:n}=F(),{theme:a}=L(),{setWidth:i,setHeight:c}=mt();if(r!=="chat"&&r!=="sessions")return null;const p=(()=>{switch(r){case"chat":return a.screens.chat.height;case"sessions":return a.screens.sessions.height;default:return D.isExhaustive(r,ie.name),a.screens.chat.height}})(),u=(()=>{switch(r){case"chat":return a.screens.chat.width;case"sessions":return a.screens.sessions.width;default:return D.isExhaustive(r,ie.name),a.screens.chat.width}})(),z=()=>{s(j=>{const h=!j;return c(h?"100vh":p),i(h?`max(40vw, ${u})`:u),h})};return n&&t.hideOnSmallScreen||!n&&t.hideOnLargeScreen?null:e.jsx(S,{variant:"ghost",size:"fit",className:"rounded-full",onClick:z,children:e.jsx(V,{name:t.icon||(o?t.shrinkIcon:t.expandIcon)})})}function gt({button:t}){var I,k;const[o,s]=w.useState(!1),{widgetCtx:r}=l.useWidget(),{setIsOpen:n}=l.useWidgetTrigger(),{resolveSession:a,sessionState:i}=l.useSessions(),{isSmallScreen:c}=F(),p=!i.session,u=((I=i.session)==null?void 0:I.isOpened)===!1,z=t.onResolved||"stay-in-chat",j=t.behaviorBeforeSessionCreation||"disabled",h=t.behaviorIfSessionIsResolved||"disabled",b=!!(i.isResolvingSession||p&&j==="disabled"||u&&h==="disabled"),x=async()=>{const{success:T,error:M}=await a();if(s(!1),!T)return console.error(M);switch(z){case"stay-in-chat":return;case"close-widget":n(!1);break;case"reset-chat":r.resetChat();break;case"reset-chat-and-close-widget":n(!1),r.resetChat();break;default:D.isExhaustive(z,gt.name);break}},y=()=>{if(p)switch(j){case"disabled":return;case"close-widget":n(!1);break;default:D.isExhaustive(j,y.name)}if(u)switch(h){case"disabled":return;case"close-widget":n(!1);break;case"reset-chat":r.resetChat();break;case"reset-chat-and-close-widget":n(!1),r.resetChat();break;default:D.isExhaustive(h,y.name)}};return c&&t.hideOnSmallScreen||!c&&t.hideOnLargeScreen?null:((k=t.confirmation)==null?void 0:k.type)==="modal"&&!u&&!p?e.jsxs(et,{open:o,onOpenChange:s,children:[e.jsx(tt,{asChild:!0,children:e.jsx(S,{variant:"ghost",size:"fit",className:"rounded-full",disabled:b,children:e.jsx(V,{name:t.icon})})}),e.jsxs(de,{children:[e.jsx(ot,{children:e.jsx(pe,{children:t.confirmation.title||"Close conversation"})}),e.jsx(rt,{children:e.jsx(at,{children:t.confirmation.description||"Are you sure you want to close this conversation?"})}),e.jsxs(nt,{children:[e.jsx(S,{variant:"secondary",onClick:()=>s(!1),disabled:i.isResolvingSession,children:t.confirmation.cancelButtonText||"No"}),e.jsx(S,{variant:"destructive",onClick:x,disabled:i.isResolvingSession,children:t.confirmation.confirmButtonText||"Yes"})]})]})]}):e.jsx(S,{variant:"ghost",size:"fit",className:"rounded-full",onClick:u||p?y:x,disabled:b,children:e.jsx(V,{name:t.icon})})}function le({button:t}){switch(t.functionality){case"close-widget":return e.jsx(Jt,{button:t});case"expand-shrink":return e.jsx(ie,{button:t});case"resolve-session":return e.jsx(gt,{button:t});default:return D.isExhaustive(t,le.name),null}}const Qt={functionality:"close-widget",hideOnLargeScreen:!0,icon:"X"};function es(){const{routerState:{screen:t}}=l.useWidgetRouter(),{headerButtons:o}=l.useConfig(),s=t==="chat"?o==null?void 0:o.chatScreen:t==="sessions"?o==null?void 0:o.sessionsScreen:[];return!s||s.length===0?e.jsx(le,{button:Qt}):e.jsx(e.Fragment,{children:s.map(r=>e.jsx(le,{button:r},`${r.functionality}-${r.icon}`))})}function wt(){const{routerState:{screen:t}}=l.useWidgetRouter(),{isLoading:o}=l.usePreludeData(),s=Gt(t),r=we();return e.jsx("header",{...s,className:"py-2 px-4 shrink-0",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Zt,{}),e.jsx("div",{className:d("flex-1 h-8 flex items-center",t==="sessions"&&"ps-2"),children:e.jsx(N.AnimatePresence,{mode:"wait",children:o?e.jsx(f,{snapExit:!0,children:e.jsx(ut,{className:"h-5 w-1/2"})},"skeleton"):e.jsx(f,{children:e.jsx("h2",{className:"font-semibold",children:r})},"organization-name")})}),e.jsx(es,{})]})})}function ft({className:t}){return e.jsx(m.LoaderIcon,{className:d("size-4 animate-spin",t)})}function ts(){const{messagesState:{isInitialFetchLoading:t}}=l.useMessages(),{isSmallScreen:o}=F(),{activeMode:s,Component:r}=l.useModes();return{isCanvasOpen:!t&&!o&&!!s&&!!r}}function ss(){const{activeMode:t,Component:o}=l.useModes(),{sendMessage:s}=l.useMessages(),{createStateCheckpoint:r}=l.useSessions(),[n,a]=w.useState(!1),i=async c=>{try{a(!0),await s(c)}catch(p){console.error(p)}finally{a(!1)}};return!t||!o?null:e.jsx(o,{react:w,mode:t,createStateCheckpoint:r,sendMessage:i,isSendingMessage:n})}const os={"write-a-message":"اكتب رسالة...","session-closed-lead":"تم حل مشكلتك!","new-conversation":"محادثة جديدة","welcome-title":"مرحبًا بك في دردشة الدعم الخاصة بنا","welcome-description":"نحن هنا للمساعدة! ابدأ محادثة وسنرد عليك في أقرب وقت ممكن.","your-name":"اسمك","your-email":"عنوان بريدك الإلكتروني","start-chat":"تحدث إلى الدعم","starting-chat":"جاري الاتصال...","i-need-more-help":"أحتاج المزيد من المساعدة","this-was-helpful":"كان هذا مفيدًا",optional:"اختياري","no-conversations-yet":"لا يوجد محادثات","back-to-conversations":"العودة إلى المحادثات","closed-conversations":"المحادثات المغلقة"},rs={"write-a-message":"Nachricht schreiben...","session-closed-lead":"Ihr Problem wurde gelöst!","new-conversation":"Neue Konversation","welcome-title":"Willkommen in unserem Support-Chat","welcome-description":"Wir sind hier, um zu helfen! Beginnen Sie ein Gesprách und wir werden so schnell wie mogelijk antworten.","your-name":"Ihr Name","your-email":"Ihre E-Mail-Adresse","start-chat":"Mit dem Support sprechen","starting-chat":"Verbindung wird hergestellt...","i-need-more-help":"Ich brauche weitere Hilfe","this-was-helpful":"Dies war hilfreich",optional:"Optional","no-conversations-yet":"noch keine Gespräche","back-to-conversations":"Zurück zur Konversationen","closed-conversations":"Geschlossene Konversationen"},ns={"write-a-message":"Write a message...","session-closed-lead":"Your issue has been resolved!","new-conversation":"New conversation","welcome-title":"Welcome to our support chat","welcome-description":"We're here to help! Start a conversation and we'll get back to you as soon as possible.","your-name":"Your name","your-email":"Your email address","start-chat":"Talk to support","starting-chat":"Connecting...","i-need-more-help":"I need more help","this-was-helpful":"This was helpful",optional:"Optional","no-conversations-yet":"No conversations yet","back-to-conversations":"Back to conversations","closed-conversations":"Closed conversations"},as={"write-a-message":"Écrivez un message...","session-closed-lead":"Votre problème a été résolu !","new-conversation":"Nouvelle conversation","welcome-title":"Bienvenue dans notre chat de support","welcome-description":"Nous sommes là pour vous aider ! Commencez une conversation et nous vous répondrons dès que possible.","your-name":"Votre nom","your-email":"Votre adresse e-mail","start-chat":"Parler au support","starting-chat":"Connexion...","i-need-more-help":"Je besoin d'aide plus","this-was-helpful":"C'était utile",optional:"Optionnel","no-conversations-yet":"Aucune conversation pour le moment","back-to-conversations":"Retour aux conversations","closed-conversations":"Conversations fermées"},is={"write-a-message":"Schrijf een bericht...","session-closed-lead":"Uw probleem is opgelost!","new-conversation":"Nieuw gesprek","welcome-title":"Welkom bij onze supportchat","welcome-description":"We zijn hier om te helpen! Begin een gesprek en we nemen zo snel mogelijk contact met u op.","your-name":"Uw naam","your-email":"Uw e-mailadres","start-chat":"Praat met ondersteuning","starting-chat":"Verbinding maken...","i-need-more-help":"Ik heb nog meer hulp nodig","this-was-helpful":"Mijn vraag is opgelost",optional:"Optioneel","no-conversations-yet":"Nog geen gesprekken","back-to-conversations":"Terug naar gesprekken","closed-conversations":"Afgesloten gesprekken"},ls={"write-a-message":"Escreva uma mensagem...","session-closed-lead":"Seu problema foi resolvido!","new-conversation":"Nova conversa","welcome-title":"Bem-vindo ao nosso chat de suporte","welcome-description":"Estamos aqui para ajudar! Inicie uma conversa e responderemos o mais rápido possível.","your-name":"Seu nome","your-email":"Seu endereço de email","start-chat":"Falar com o suporte","starting-chat":"Conectando...","i-need-more-help":"preciso de mais ajuda","this-was-helpful":"Isso foi útil",optional:"Opcional","no-conversations-yet":"Nenhuma conversa ainda","back-to-conversations":"Voltar para conversas","closed-conversations":"Conversas fechadas"},cs={"write-a-message":"Escribe un mensaje...","session-closed-lead":"¡Tu problema fue resuelto!","new-conversation":"Nueva conversación","welcome-title":"Bienvenido a nuestro chat de soporte","welcome-description":"¡Estamos aquí para ayudarte! Inicia una conversación y responderemos lo antes posible.","your-name":"Tu nombre","your-email":"Tu correo electrónico","start-chat":"Hablar con soporte","starting-chat":"Conectando...","i-need-more-help":"Necesito más ayuda","this-was-helpful":"Esto fue útil",optional:"Opcional","no-conversations-yet":"Sin conversaciones aún","back-to-conversations":"Volver a conversaciones","closed-conversations":"Conversaciones cerradas"},ds={"write-a-message":"Bir mesaj yazın...","session-closed-lead":"Sorununuz çözüldü!","new-conversation":"Yeni konuşma","welcome-title":"Destek sohbetimize hoş geldiniz","welcome-description":"Yardım etmek için buradayız! Bir konuşma başlatın, en kısa sürede size geri döneceğiz.","your-name":"Adınız","your-email":"E-posta adresiniz","start-chat":"Destekle konuş","starting-chat":"Bağlanıyor...","i-need-more-help":"Daha fazla yardıma ihtiyacım var","this-was-helpful":"Bu yardımcı oldu",optional:"İsteğe bağlı","no-conversations-yet":"Henüz konuşma yok","back-to-conversations":"Konuşmalara geri dön","closed-conversations":"Kapatılan konuşmalar"},xt={en:ns,ar:os,nl:is,fr:as,de:rs,pt:ls,es:cs,tr:ds},ps=Object.keys(xt);function hs(t){return ps.includes(t)}function ms(t,o){const s=xt[o];return s&&s[t]||""}function X(){const{dir:t}=l.useDocumentDir(),o=l.useConfig();return w.useMemo(()=>{const s=hs(o.language)?o.language:"en";return{t:r=>ms(r,s),language:s,dir:s==="ar"?"rtl":"ltr",hostDocumentDir:t}},[o.language,t])}function fe({suggestion:t,className:o,...s}){const{sendMessage:r}=l.useMessages(),n=()=>{const a=t.trim();a&&r({content:a})};return e.jsx(S,{...g("chat/suggested_reply_btn"),size:"sm",className:d("rounded-xl w-fit",o),...s,onClick:n,children:t})}function us(){const{t}=X(),o=[t("i-need-more-help"),t("this-was-helpful")];return e.jsx("div",{...g("chat/might_solve_user_issue_suggested_replies_container"),className:"flex items-center gap-2 p-2 pb-0 flex-wrap",children:o.map(s=>e.jsx(fe,{suggestion:s,className:"flex-1"},s))})}function gs({file:{status:t,file:o,error:s},onCancel:r}){const[n,a]=w.useState(null);w.useEffect(()=>{if(!o.type.startsWith("image/"))return;const p=new FileReader;return p.onload=()=>a(p.result),p.onerror=()=>console.error("Error reading file"),p.readAsDataURL(o),()=>p.abort()},[o]);const i=()=>{switch(t){case"uploading":return e.jsx(m.Loader2,{className:"size-4 animate-spin"});case"error":return e.jsx(m.AlertCircle,{className:"size-4 text-destructive"});default:return null}},c=()=>{const p=o.type.split("/")[0];return p==="image"&&n?e.jsx("img",{src:typeof n=="string"?n:"",className:"object-cover bg-secondary size-full",alt:o.name}):p==="audio"?e.jsx(m.FileAudio2Icon,{}):p==="video"?e.jsx(m.FileVideo2Icon,{}):e.jsx(m.FileIcon,{})};return e.jsx(U,{side:"bottom",content:t==="error"?e.jsxs("span",{className:"text-destructive",children:["Failed to upload: ",s]}):o.name,children:e.jsxs("div",{className:d(t==="uploading"&&"opacity-50","group","size-12 border rounded-2xl overflow-hidden relative","flex items-center justify-center shrink-0"),children:[e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:i()}),e.jsx("button",{type:"button",className:d("absolute bg-black/50 inset-0 size-full z-10 opacity-0","flex items-center justify-center","opacity-0 group-hover:opacity-100 transition"),onClick:r,children:e.jsx(m.XIcon,{className:"size-4 text-primary-foreground"})}),e.jsx(c,{})]})})}function ws(){var P;const{isSmallScreen:t}=F(),o=w.useRef(null),{sendMessage:s}=l.useMessages(),{sessionState:r}=l.useSessions(),{t:n}=X(),[a,i]=w.useState(""),{allFiles:c,emptyTheFiles:p,handleCancelUpload:u,appendFiles:z,isUploading:j,successFiles:h}=l.useUploadFiles(),b=!!((P=r.session)!=null&&P.isHandedOff),{isAwaitingBotReply:x}=l.useIsAwaitingBotReply(),y=v=>{z(v)},I=!a.trim()&&h.length===0,k=async()=>{if(x||I)return;j&&console.info("please wait for the file(s) to upload");const v=a.trim();s({content:v,attachments:h.flatMap(C=>C.fileUrl?[{url:C.fileUrl,type:C.file.type,name:C.file.name,id:C.id,size:C.file.size}]:[])}),i(""),p()},{getRootProps:T,getInputProps:M,open:O}=Rt.useDropzone({onDrop:y,noClick:!0,onDropRejected(){console.error("unsupported file type, or the file is too large")},maxSize:5*1024*1024,accept:b?{"text/*":[".txt"],"image/*":[".png",".jpg",".jpeg",".gif"],"application/pdf":[".pdf"]}:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg"],"image/gif":[".gif"],"image/webp":[".webp"]}}),W=v=>{const C=v.clipboardData;C&&C.files.length>0&&y(Array.from(C.files))};return e.jsxs("div",{...g("chat/input_box/root"),className:"p-2 relative space-y-1",...T(),children:[e.jsx("input",{...M()}),e.jsxs("div",{...g("chat/input_box/inner_root"),className:d("transition-all","bg-white","relative rounded-3xl flex flex-col gap-2 p-2","hover:border-primary focus-within:border-primary"),children:[e.jsxs("div",{...g("chat/input_box/textarea_and_attachments_container"),className:"flex flex-col gap-2",children:[c.length>0&&e.jsx("div",{...g("chat/input_box/attachments_container"),className:"flex items-center gap-1",children:e.jsx(N.AnimatePresence,{mode:"popLayout",children:c.map(v=>e.jsx(f,{snapExit:!0,children:e.jsx(gs,{onCancel:()=>u(v.id),file:v})},v.id))})}),e.jsx("textarea",{...g("chat/input_box/textarea"),onPaste:W,ref:o,id:"chat-input",value:a,rows:3,className:d("max-h-16 [field-sizing:content]","w-full resize-none px-2",c.length===0&&"pt-1","bg-transparent outline-none","placeholder:text-muted-foreground",t?"text-[16px]":"text-sm"),onChange:v=>i(v.target.value),onKeyDown:async v=>{v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),k())},placeholder:n("write-a-message")})]}),e.jsxs("div",{className:"gap-2 flex justify-between",children:[e.jsx(U,{side:"top",align:"start",content:"attach files, (maximum size 5mb)",children:e.jsx(S,{onClick:O,size:"fit",variant:"ghost",className:d("rounded-full size-8 flex items-center justify-center p-0 overflow-hidden"),children:e.jsx(N.AnimatePresence,{mode:"wait",children:b?e.jsx(f,{children:e.jsx(m.PaperclipIcon,{className:"size-4"})},"paper-clip"):e.jsx(f,{children:e.jsx(m.ImageIcon,{className:"size-4"})},"image-icon")})})}),e.jsx(U,{content:"send message",side:"top",align:"end",children:e.jsx(S,{size:"fit",onClick:k,disabled:x||j||I,className:"rounded-full size-8 flex items-center justify-center p-0",children:e.jsx(N.AnimatePresence,{mode:"wait",children:x||j?e.jsx(f,{snapExit:!0,children:e.jsx(m.CircleDashed,{className:"size-4 animate-spin animate-iteration-infinite"})},"loading"):e.jsx(f,{snapExit:!0,children:e.jsx(m.ArrowUpIcon,{className:"size-4"})},"send")})})})]})]})]})}function fs(){const{widgetCtx:t}=l.useWidget(),{router:o}=l.useConfig(),{canCreateNewSession:s}=l.useSessions(),{toSessionsScreen:r}=l.useWidgetRouter(),{t:n}=X();return e.jsx("div",{className:"p-2",children:e.jsxs("div",{className:"p-2 bg-muted rounded-3xl space-y-2",children:[e.jsxs("div",{className:"ps-2 flex items-center gap-1",children:[e.jsx(m.CircleCheckIcon,{className:"size-4 text-emerald-600"}),e.jsx("h2",{className:"text-sm font-medium",children:n("session-closed-lead")})]}),e.jsx("div",{children:s||o!=null&&o.chatScreenOnly?e.jsx(S,{onClick:t.resetChat,className:"rounded-2xl w-full",children:n("new-conversation")}):e.jsx(S,{onClick:r,className:"rounded-2xl w-full",children:n("back-to-conversations")})})]})})}function xs(){var i;const{initialQuestions:t,initialQuestionsPosition:o,thisWasHelpfulOrNot:s}=l.useConfig(),{sessionState:r}=l.useSessions(),{messagesState:n}=l.useMessages(),a=n.messages.length===0;return e.jsx("footer",{children:e.jsx("div",{children:e.jsx(N.AnimatePresence,{mode:"wait",children:r.session&&!((i=r.session)!=null&&i.isOpened)?e.jsx(f,{className:"overflow-hidden",overrides:{initial:{height:0},animate:{height:"auto"},exit:{height:0}},children:e.jsx(fs,{})},"session-closed"):e.jsxs(f,{className:"overflow-hidden",overrides:{initial:{height:0},animate:{height:"auto"},exit:{height:0}},children:[n.lastAIResMightSolveUserIssue&&(s==null?void 0:s.enabled)!==!1&&e.jsx(us,{}),a&&t&&o!=="below-initial-messages"&&e.jsx("div",{className:"flex items-center flex-row justify-end gap-2 flex-wrap px-2",children:t==null?void 0:t.map((c,p)=>e.jsx(fe,{suggestion:c},`${c}-${p}`))}),e.jsx(ws,{})]},"chat-input")})})})}function vs({isFirstInGroup:t,isLastInGroup:o,isAloneInGroup:s,...r}){const{componentStore:n}=l.useWidget();if(r.data.action){const i=n.getComponent(r.data.action.name);if(i)return e.jsx(i,{...r,id:r.id,isFirstInGroup:t,isLastInGroup:o,isAloneInGroup:s})}const a=n.getComponent(r.component);return a?e.jsx(a,{...r,id:r.id,isFirstInGroup:t,isLastInGroup:o,isAloneInGroup:s}):e.jsx(ne,{...r,isFirstInGroup:t,isLastInGroup:o,isAloneInGroup:s})}function vt({messages:t,className:o,containerClassName:s}){var i,c;const{timestamps:r}=l.useConfig();if(!((i=r==null?void 0:r.perMessageGroup)!=null&&i.enabled))return null;const n=(c=t[t.length-1])==null?void 0:c.timestamp;if(!n)return null;const a=(()=>{try{return new Date(n).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!0})}catch(p){return console.error(p),null}})();return a?e.jsx("div",{className:s,children:e.jsx("span",{className:d("text-xs text-muted-foreground",o),children:a})}):null}function re({messages:t,agent:o,suggestedReplies:s}){return e.jsxs("div",{...g("chat/agent_msg_group/root"),className:d("flex items-end gap-2"),children:[e.jsx(U,{content:o==null?void 0:o.name,side:"right",align:"end",children:e.jsx(ae,{...g("chat/agent_msg_group/root/avatar"),agent:o,className:"hidden"})}),e.jsxs("div",{className:d("flex-1 flex flex-col gap-1"),children:[e.jsxs("div",{...g("chat/agent_msg_group/avatar_and_msgs/root"),className:d("flex items-end gap-2"),children:[e.jsx(U,{content:o==null?void 0:o.name,side:"right",align:"end",children:e.jsx(ae,{...g("chat/agent_msg_group/avatar_and_msgs/avatar"),agent:o})}),e.jsxs("div",{...g("chat/agent_msg_group/avatar_and_msgs/msgs"),className:d("flex-1 flex flex-col gap-1"),children:[t.map((r,n,a)=>e.jsx(vs,{isFirstInGroup:n===0,isLastInGroup:n===a.length-1,isAloneInGroup:a.length===1,...r},r.id)),e.jsx(vt,{messages:t})]})]}),s&&s.length>0&&e.jsx("div",{...g("chat/agent_msg_group/suggestions"),className:d("flex flex-col gap-1 ps-8"),children:s==null?void 0:s.map((r,n)=>e.jsx(fe,{suggestion:r},`${r}-${n}`))})]})]})}function bs({message:t,isFirstInGroup:o,isLastInGroup:s,isAloneInGroup:r}){var n;return e.jsxs("div",{...g("chat/user_msg/root"),className:"w-5/6 flex flex-col items-end gap-1",children:[t.attachments&&t.attachments.length>0&&e.jsx("div",{className:"w-full flex gap-1 flex-wrap justify-end",children:(n=t.attachments)==null?void 0:n.map(a=>e.jsx(it,{attachment:a},a.id))}),t.content.length>0&&e.jsx("div",{...g("chat/user_msg/msg"),"data-first":o,"data-last":s,"data-alone":r,className:d("transition-all","w-fit py-3 px-4 rounded-3xl text-sm","bg-primary text-primary-foreground","break-words [word-break:break-word]","whitespace-pre-wrap",o&&!r&&"rounded-br-md",s&&!r&&"rounded-tr-md",!o&&!s&&!r&&"rounded-r-md"),children:t.content})]})}function ys({messages:t}){return e.jsxs("div",{...g("chat/user_msg_group/root"),className:d("group","flex flex-col gap-1 justify-end items-end"),children:[t.map((o,s,r)=>e.jsx(bs,{message:o,isFirstInGroup:s===0,isLastInGroup:s===r.length-1,isAloneInGroup:r.length===1},o.id)),e.jsx(vt,{messages:t,containerClassName:"ms-auto"})]})}function js(t){const o=[];let s=null;return t.forEach(r=>{var n,a,i,c;(!s||((n=s[0])==null?void 0:n.type)!==r.type)&&(s=[],o.push(s)),((a=s[0])==null?void 0:a.type)==="FROM_AGENT"&&r.type==="FROM_AGENT"&&((i=r.agent)==null?void 0:i.id)!==((c=s[0].agent)==null?void 0:c.id)&&(s=[],o.push(s)),s.push(r)}),o}function ks(t){var o;return((o=t==null?void 0:t[0])==null?void 0:o.type)==="FROM_USER"}function Cs(t){var o;return((o=t==null?void 0:t[0])==null?void 0:o.type)==="FROM_BOT"}function zs(t){var o;return((o=t==null?void 0:t[0])==null?void 0:o.type)==="FROM_AGENT"}function Ns(){const{messagesState:{messages:t}}=l.useMessages(),{chatBannerItems:o}=l.useConfig();return!(o!=null&&o.length)||t.length>0&&o.every(s=>!s.persistent)?null:e.jsx("div",{className:"w-full text-center text-xs",children:o.map(({message:s,persistent:r},n)=>t.length>0&&!r?null:e.jsx("div",{children:e.jsx(ct,{children:s})},`${s}-${n}`))})}function Ss(){const{messagesState:{messages:t}}=l.useMessages(),{isAwaitingBotReply:o}=l.useIsAwaitingBotReply(),{componentStore:s}=l.useWidget(),r=l.useConfig(),{initialQuestions:n,initialQuestionsPosition:a}=r,i=w.useMemo(()=>js(t),[t]),c=(()=>{var h;return t.length?((h=r.advancedInitialMessages)==null?void 0:h.filter(b=>!!b.persistent))||[]:r.advancedInitialMessages||[]})(),p=(()=>{var h;return c.length?[]:t.length?[]:(h=r.initialMessages)!=null&&h.length?r.initialMessages:["Hello, how can I help you?"]})(),u=s.getComponent("loading"),z=w.useRef(null);function j(){setTimeout(()=>{const h=z.current;h&&(h.scrollTop=h.scrollHeight)},0)}return w.useEffect(()=>{j()},[t]),e.jsxs("div",{...g("chat/msgs/root"),ref:z,className:"max-h-full scroll-smooth relative flex-1 py-2 px-4 flex flex-col gap-2 overflow-auto",children:[e.jsx(Ns,{}),c.length>0&&e.jsx(re,{messages:c.map(({message:h},b)=>({component:"bot_message",data:{message:h},id:`${b}-${h}`,type:"FROM_BOT",timestamp:null})),suggestedReplies:t.length===0&&a==="below-initial-messages"?n:void 0,agent:r.bot?{...r.bot,isAi:!0,id:null}:void 0}),t.length===0&&p.length>0&&e.jsx(re,{messages:p.map((h,b)=>({component:"bot_message",data:{message:h},id:`${b}-${h}`,type:"FROM_BOT",timestamp:null})),suggestedReplies:a==="below-initial-messages"?n:void 0,agent:r.bot?{...r.bot,isAi:!0,id:null}:void 0}),i.map(h=>{var y,I,k;const b=(y=h==null?void 0:h[0])==null?void 0:y.type,x=(I=h[0])==null?void 0:I.id;if(!b||!x)return null;if(ks(h))return e.jsx(ys,{messages:h},x);if(Cs(h)||zs(h)){const T=(k=h[0])==null?void 0:k.agent;return e.jsx(re,{messages:h,agent:T},x)}return null}),o&&u&&e.jsx(u,{agent:r.bot})]})}function _s(){const{messagesState:{isInitialFetchLoading:t}}=l.useMessages(),{sessionState:{session:o}}=l.useSessions(),{isCanvasOpen:s}=ts(),{theme:r}=L();ge({width:s?r.screens.chat.withCanvas.width:r.screens.chat.width,height:s?r.screens.chat.withCanvas.height:r.screens.chat.height});const n=w.useRef((o==null?void 0:o.id)||"chat").current;return e.jsx("div",{...g("chat/root"),className:d("flex flex-col overflow-hidden"),style:{width:"100vw",maxWidth:"100vw",height:"100vh",maxHeight:"100vh"},children:e.jsxs("div",{className:"size-full justify-between flex flex-col",children:[e.jsx(wt,{}),e.jsx(N.AnimatePresence,{mode:"wait",children:t?e.jsx(f,{className:"flex flex-col items-center justify-center w-full flex-1",children:e.jsx(ft,{})},"loading"):e.jsxs(f,{className:"flex items-start h-full flex-1 overflow-auto",snapExit:!0,children:[e.jsxs("div",{...g("chat/main/root"),className:d("flex flex-col h-full overflow-auto transition-all",s?"w-2/5":"w-full"),style:{transitionTimingFunction:r.screens.chat.withCanvas.transitionTimingFunction,transitionDuration:r.screens.chat.withCanvas.transitionDuration},children:[e.jsx(Ss,{}),e.jsx(xs,{})]}),e.jsx("div",{...g("chat/canvas/root"),className:d("h-full overflow-auto transition-all",s?"w-3/5":"w-0"),style:{transitionTimingFunction:r.screens.chat.withCanvas.transitionTimingFunction,transitionDuration:r.screens.chat.withCanvas.transitionDuration},children:e.jsx(ss,{})})]},n)})]})})}function Is({className:t}){return e.jsx("svg",{width:"26",height:"32",viewBox:"0 0 26 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:d("text-primary-foreground",t),children:e.jsx("path",{d:"M1.34103 25.6132H5.44245C5.74203 25.6228 6.02673 25.7462 6.23867 25.9582C6.45062 26.1703 6.5739 26.4551 6.58348 26.7548V30.8584C6.59305 31.1581 6.71634 31.443 6.92828 31.655C7.14023 31.8671 7.42492 31.9904 7.7245 32H18.2894C18.589 31.9904 18.8737 31.8671 19.0856 31.655C19.2976 31.443 19.4209 31.1581 19.4304 30.8584V26.7548C19.4401 26.4545 19.5638 26.1692 19.7765 25.957C19.9892 25.7449 20.2748 25.6219 20.5749 25.6132H24.659C24.9586 25.6036 25.2433 25.4803 25.4552 25.2682C25.6671 25.0562 25.7904 24.7713 25.8 24.4716V7.52839C25.7904 7.22865 25.6671 6.94381 25.4552 6.73176C25.2433 6.5197 24.9586 6.39635 24.659 6.38677H20.561C20.2603 6.37802 19.9742 6.25457 19.7614 6.04169C19.5487 5.82881 19.4253 5.54261 19.4165 5.24168V1.14161C19.4072 0.84419 19.2858 0.561291 19.0768 0.349589C18.8678 0.137887 18.5865 0.0130193 18.2894 0L7.7245 0C7.42492 0.00957792 7.14023 0.132929 6.92828 0.344983C6.71634 0.557036 6.59305 0.841878 6.58348 1.14161V5.24168C6.57477 5.54203 6.45187 5.82773 6.23983 6.04052C6.0278 6.25331 5.74262 6.37715 5.44245 6.38677H1.34103C1.04144 6.39635 0.756749 6.5197 0.544805 6.73176C0.332861 6.94381 0.209574 7.22865 0.200001 7.52839V24.4716C0.209574 24.7713 0.332861 25.0562 0.544805 25.2682C0.756749 25.4803 1.04144 25.6036 1.34103 25.6132ZM6.58348 24.4716V7.52839C6.59305 7.22865 6.71634 6.94381 6.92828 6.73176C7.14023 6.5197 7.42492 6.39635 7.7245 6.38677H18.2894C18.589 6.39635 18.8737 6.5197 19.0856 6.73176C19.2976 6.94381 19.4209 7.22865 19.4304 7.52839V24.4716C19.4209 24.7713 19.2976 25.0562 19.0856 25.2682C18.8737 25.4803 18.589 25.6036 18.2894 25.6132H7.7245C7.42492 25.6036 7.14023 25.4803 6.92828 25.2682C6.71634 25.0562 6.59305 24.7713 6.58348 24.4716Z",fill:"currentColor"})})}function bt({className:t}){const{token:o}=l.useConfig();return e.jsx("div",{className:d("flex items-center justify-center gap-2 p-2 pt-0",t),children:e.jsx(A,{children:e.jsxs("a",{href:`https://open.cx/?ref=${o}`,target:"_blank",rel:"noreferrer",className:d("text-[10px] flex items-center","text-muted-foreground/70 [&_svg]:text-muted-foreground/70","hover:text-primary [&_svg]:hover:text-primary"),children:[e.jsx("span",{children:"Powered by"}),e.jsx("span",{children:" "}),e.jsxs("span",{className:"flex items-center gap-[1px]",children:[e.jsx("span",{children:e.jsx(Is,{className:"size-3 inline-block"})}),e.jsx("span",{className:"font-semibold",children:"open"})]})]})})})}function Ts({children:t}){return e.jsx("p",{className:"ps-4 text-xs text-muted-foreground/75 uppercase font-semibold tracking-tight",children:t})}function Ge({session:t,className:o}){const{bot:s}=l.useConfig(),{toChatScreen:r}=l.useWidgetRouter(),n=t.assignee.kind==="human"?t.assignee.name||"Support Agent":(s==null?void 0:s.name)||"AI Support Agent",a=t.assignee.kind==="human"?t.assignee.avatarUrl||"":(s==null?void 0:s.avatar)||"";return e.jsxs(S,{variant:"ghost",size:"lg",className:d("rounded-full p-2 pe-4 flex text-start justify-between w-full whitespace-normal",o),onClick:()=>r(t.id),children:[e.jsxs("div",{className:"flex-1 flex gap-2 items-center",children:[e.jsx(N.AnimatePresence,{mode:"wait",children:e.jsx(f,{snapExit:!0,children:e.jsxs(he,{className:"size-10",children:[e.jsx(me,{src:a,alt:"Agent Icon"}),e.jsx(ue,{children:e.jsx(m.UserRoundIcon,{className:"size-4"})})]})})}),e.jsxs("div",{className:"flex-1",children:[e.jsx(N.AnimatePresence,{mode:"wait",children:e.jsx(f,{snapExit:!0,children:n},n)}),e.jsx(N.AnimatePresence,{mode:"wait",children:t.lastMessage?e.jsx(f,{snapExit:!0,children:e.jsx(lt,{remarkPlugins:[Ze],rehypePlugins:[Je],className:"line-clamp-1 overflow-hidden text-ellipsis text-xs text-muted-foreground",children:t.lastMessage})},t.lastMessage||"content"):e.jsx(f,{className:"w-1/2",snapExit:!0,children:e.jsx(ut,{className:"h-4 w-full"})},"skeleton")})]})]}),e.jsx(m.ChevronRightIcon,{className:"size-4 text-muted-foreground shrink-0 rtl:-scale-100"})]})}function Ms(){const{t}=X(),{toChatScreen:o}=l.useWidgetRouter(),{sessionsState:{data:s,isInitialFetchLoading:r},openSessions:n,closedSessions:a,canCreateNewSession:i}=l.useSessions();return e.jsx("div",{className:"flex-1 flex flex-col overflow-scroll py-2 px-2",children:e.jsx(N.AnimatePresence,{mode:"wait",children:r?e.jsx(f,{className:"flex-1 flex items-center justify-center",children:e.jsx(ft,{})},"loading"):e.jsx(f,{className:"flex-1 flex flex-col gap-2 relative",children:s.length?e.jsxs(e.Fragment,{children:[e.jsxs(N.AnimatePresence,{children:[n.length>0&&e.jsx(f,{fadeIn:"up",delay:.2,className:"space-y-2",snapExit:!0,children:n.map(c=>e.jsx(Ge,{session:c},c.id))},"open-sessions"),a.length>0&&e.jsxs(f,{className:"space-y-2",delay:.2,snapExit:!0,children:[e.jsx(Ts,{children:t("closed-conversations")}),a.map(c=>e.jsx(Ge,{session:c,className:"opacity-50 hover:opacity-100"},c.id))]},"closed-sessions")]}),i&&e.jsx("div",{className:"mt-auto w-full rounded-3xl sticky bottom-0 outline outline-8 outline-background bg-background",children:w.createElement(S,{...g("sessions/new_conversation_btn"),size:"lg",key:"new-session",className:"w-full",onClick:()=>o()},t("new-conversation"))})]}):e.jsxs("div",{className:"flex-1 flex flex-col gap-2 items-center",children:[e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx("p",{className:"text-muted-foreground",children:t("no-conversations-yet")})}),w.createElement(S,{...g("sessions/new_conversation_btn"),size:"lg",key:"new-session",className:"w-full",onClick:()=>o()},t("new-conversation"))]})},"sessions")})})}function Ds(){const{theme:t}=L();return ge({width:t.screens.sessions.width,height:t.screens.sessions.height}),e.jsx("div",{...g("sessions/root"),className:d("flex flex-col overflow-hidden bg-background"),style:{width:"100vw",maxWidth:"100vw",height:"100vh",maxHeight:"100vh"},children:e.jsxs("div",{className:"size-full flex flex-col",children:[e.jsx(wt,{}),e.jsx(Ms,{}),e.jsx(bt,{})]})})}const Q=E.forwardRef(({className:t,type:o,...s},r)=>{const{isSmallScreen:n}=F();return e.jsx(A,{ref:r,children:e.jsx("input",{type:o,className:d(n?"text-[16px]":"text-sm","flex w-full rounded-xl p-2 ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-primary-foreground placeholder:text-muted-foreground/75 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 transition","rounded-2xl px-4","border shadow-sm",t),...s})})});Q.displayName="Input";function Rs(){const{contentIframeRef:t}=l.useWidget(),{inline:o}=l.useConfig(),s=w.useRef(null);return w.useEffect(()=>{const r=t==null?void 0:t.current;if(r&&s.current){const n=s.current;let a;const i=new ResizeObserver(()=>{a=requestAnimationFrame(()=>{const c=n.offsetHeight;r.style.setProperty("--opencx-widget-height",o?"100%":`${c.toFixed(1)}px`)})});return i.observe(n),()=>{cancelAnimationFrame(a),i.unobserve(n)}}},[t,o]),{observedElementRef:s}}const Ps=oe.z.object({name:oe.z.string().min(2),email:oe.z.string().email()});function Es(){var k,T,M,O,W,P,v,C,H;const{setIsOpen:t}=l.useWidgetTrigger(),{createUnverifiedContact:o}=l.useContact(),{isSmallScreen:s}=F(),r=l.useConfig(),{theme:n}=L(),{t:a}=X(),{data:i}=l.usePreludeData(),{observedElementRef:c}=Rs();ge({height:void 0,width:n.screens.welcome.width});const[p,u]=w.useState(((k=r.prefillUserData)==null?void 0:k.name)||""),[z,j]=w.useState(((T=r.prefillUserData)==null?void 0:T.email)||""),h=(r.extraDataCollectionFields||[]).filter(_=>_!=="name"&&_!=="email"&&!!_),[b,x]=w.useState({}),[y,I]=Pt(async _=>{_.preventDefault();const q=Ps.safeParse({name:p,email:z});q.success&&await o({email:q.data.email,non_verified_name:q.data.name},Object.values(b).filter(Boolean).length?b:void 0)},[p,z,b]);return e.jsx("div",{style:{width:"100vw",maxWidth:"100vw",minHeight:n.screens.welcome.minHeight,height:"100vh",maxHeight:"100vh",overflowY:"auto"},children:e.jsxs("div",{ref:c,className:d("flex flex-col",s&&"h-full","bg-[radial-gradient(ellipse_at_top_left,hsl(var(--opencx-primary)),transparent),radial-gradient(ellipse_at_top_right,hsl(var(--opencx-primary)),transparent)]"),children:[e.jsxs("div",{className:d("flex-1 flex flex-col px-4 py-12 text-start space-y-4 relative z-10","text-primary-foreground"),children:[s&&e.jsx(f,{className:"absolute top-6 end-6",children:e.jsx(S,{size:"selfless",onClick:()=>t(!1),children:e.jsx(m.XIcon,{className:"size-4"})})}),e.jsx("div",{className:"flex items-center justify-between w-full mb-2",children:(M=r.assets)!=null&&M.organizationLogo?e.jsx("img",{src:(O=r.assets)==null?void 0:O.organizationLogo,alt:"Company Logo",className:"h-8 w-auto object-contain"}):e.jsx("h2",{className:"font-bold text-sm",children:(W=i==null?void 0:i.data)==null?void 0:W.organizationName})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-[1.75rem] font-semibold tracking-tight leading-none",children:((v=(P=r.textContent)==null?void 0:P.welcomeScreen)==null?void 0:v.title)||a("welcome-title")}),e.jsx("p",{className:"text-sm",children:((H=(C=r.textContent)==null?void 0:C.welcomeScreen)==null?void 0:H.description)||a("welcome-description")})]})]}),e.jsxs("div",{className:d("z-10 m-2 px-2 pt-2 bp-0 space-y-2","bg-[white]","border shadow","rounded-3xl"),children:[e.jsxs("form",{onSubmit:I,className:"space-y-2",children:[e.jsx(Q,{value:p,onChange:_=>u(_.target.value),required:!0,placeholder:a("your-name"),name:"name"}),e.jsx(Q,{required:!0,value:z,onChange:_=>j(_.target.value),type:"email",placeholder:a("your-email"),name:"email"}),h.map(_=>e.jsx(Q,{value:b[_],onChange:q=>x(Z=>({...Z,[_]:q.target.value})),placeholder:`${_} (${a("optional")})`},_)),e.jsxs(S,{disabled:y.loading,className:"w-full",size:"lg",children:[y.loading?a("starting-chat"):a("start-chat"),e.jsx(m.SendHorizontal,{className:"size-4 rtl:-scale-100"})]})]}),e.jsx(bt,{})]})]})})}function yt(){l.usePreludeData();const{routerState:{screen:t}}=l.useWidgetRouter();return e.jsxs(e.Fragment,{children:[e.jsx(te.Container,{}),e.jsx("div",{className:"relative bg-background size-full",children:e.jsx(N.AnimatePresence,{mode:"wait",children:(()=>{switch(t){case"welcome":return e.jsx(f,{fadeIn:"right",className:"size-full",snapExit:!0,children:e.jsx(Es,{})},t);case"sessions":return e.jsx(f,{fadeIn:"right",className:"size-full",snapExit:!0,children:e.jsx(Ds,{})},t);case"chat":return e.jsx(f,{fadeIn:"right",className:"size-full",snapExit:!0,children:e.jsx(_s,{})},t);default:return D.isExhaustive(t,yt.name),null}})()})})]})}const Os="4.0.8",Ws=`<!DOCTYPE html>
14
+ ${w.screens.welcome.width},
15
+ ${w.screens.sessions.width},
16
+ ${w.screens.chat.width}
17
+ )`)};return{theme:w,computed:k,cssVars:$t({palette:w.palette,primary:w.primaryColor})}}function $t({palette:t,primary:o}){const s=ct(t),r=Le(o).toHsl(),n=Le(o).isLight()?s[950]:s[50];return{"--opencx-primary":`${r.h} ${r.s*100}% ${r.l*100}%`,"--opencx-primary-foreground":n,"--opencx-background":s[100],"--opencx-foreground":s[950],"--opencx-destructive":"0 72.2% 50.6%","--opencx-destructive-foreground":s[50],"--opencx-accent":s[200],"--opencx-accent-foreground":"var(--opencx-foreground)","--opencx-secondary":s[200],"--opencx-secondary-foreground":"var(--opencx-foreground)","--opencx-muted":s[200],"--opencx-muted-foreground":s[500],"--opencx-input":s[300],"--opencx-border":s[300],"--opencx-ring":"var(--opencx-foreground)"}}function ct(t){const o={50:"0 0% 98%",100:"0 0% 96.1%",200:"0 0% 89.8%",300:"0 0% 83.1%",400:"0 0% 63.9%",500:"0 0% 45.1%",600:"0 0% 32.2%",700:"0 0% 25.1%",800:"0 0% 14.9%",900:"0 0% 9%",950:"0 0% 3.9%"},s={50:"60 9.1% 97.8%",100:"60 4.8% 95.9%",200:"20 5.9% 90%",300:"24 5.7% 82.9%",400:"24 5.4% 63.9%",500:"25 5.3% 44.7%",600:"33.3 5.5% 32.4%",700:"30 6.3% 25.1%",800:"12 6.5% 15.1%",900:"24 9.8% 10%",950:"20 14.3% 4.1%"},r={50:"0 0% 98%",100:"240 4.8% 95.9%",200:"240 5.9% 90%",300:"240 4.9% 83.9%",400:"240 5% 64.9%",500:"240 3.8% 46.1%",600:"240 5.2% 33.9%",700:"240 5.3% 26.1%",800:"240 3.7% 15.9%",900:"240 5.9% 10%",950:"240 10% 3.9%"},n={50:"210 40% 98%",100:"210 40% 96.1%",200:"214.3 31.8% 91.4%",300:"212.7 26.8% 83.9%",400:"215 20.2% 65.1%",500:"215.4 16.3% 46.9%",600:"215.3 19.3% 34.5%",700:"215.3 25% 26.7%",800:"217.2 32.6% 17.5%",900:"222.2 47.4% 11.2%",950:"222.2 84% 4.9%"};switch(t){case"neutral":return o;case"stone":return s;case"zinc":return r;case"slate":return n;default:return M.isExhaustive(t,ct.name),o}}function dt(){const{contentIframeRef:t}=l.useWidget(),{inline:o}=l.useConfig();return{setWidth:s=>{var r;(r=t==null?void 0:t.current)==null||r.style.setProperty("--opencx-widget-width",o?"100%":s)},setHeight:s=>{var r;(r=t==null?void 0:t.current)==null||r.style.setProperty("--opencx-widget-height",o?"100%":s)}}}function pe({width:t,height:o}){const{isSmallScreen:s}=O(),{setWidth:r,setHeight:n}=dt();m.useEffect(()=>{t&&r(t),o&&n(o)},[s,o,t,r,n])}const Ye=u.CircleDashedIcon;function U({name:t,className:o}){const s=(()=>{switch(t){case"Check":return u.CheckIcon;case"CheckCheck":return u.CheckCheckIcon;case"CircleCheck":return u.CircleCheckIcon;case"CircleCheckBig":return u.CircleCheckBigIcon;case"CircleX":return u.CircleXIcon;case"Expand":return u.ExpandIcon;case"Maximize":return u.MaximizeIcon;case"Maximize2":return u.Maximize2Icon;case"Minimize":return u.MinimizeIcon;case"Minimize2":return u.Minimize2Icon;case"Shrink":return u.ShrinkIcon;case"SquareCheck":return u.SquareCheckIcon;case"SquareCheckBig":return u.SquareCheckBigIcon;case"SquareX":return u.SquareXIcon;case"X":return u.XIcon;case void 0:return Ye;default:return M.isExhaustive(t,U.name),Ye}})();return e.jsx(s,{className:p("size-4",o)})}function pt({className:t,...o}){return e.jsx("div",{className:p("animate-pulse rounded-md bg-secondary",t),...o})}function he(){var n;const{data:t}=l.usePreludeData(),{routerState:{screen:o}}=l.useWidgetRouter(),{textContent:s}=l.useConfig();return(()=>{var a,i;switch(o){case"chat":return(a=s==null?void 0:s.chatScreen)==null?void 0:a.headerTitle;case"sessions":return(i=s==null?void 0:s.sessionsScreen)==null?void 0:i.headerTitle;case"welcome":return;default:M.isExhaustive(o,he.name);return}})()??((n=t==null?void 0:t.data)==null?void 0:n.organizationName)??"Chat"}function Yt(t){switch(t){case"chat":return g("chat/header");case"sessions":return g("sessions/header");case"welcome":return;default:M.isExhaustive(t,he.name);return}}function Xt(){const{router:t}=l.useConfig(),{routerState:{screen:o},toSessionsScreen:s}=l.useWidgetRouter();return o!=="chat"||t!=null&&t.chatScreenOnly?null:e.jsx(S,{variant:"ghost",size:"fit",className:"rounded-full",onClick:s,children:e.jsx(u.ChevronLeftIcon,{className:"size-4 rtl:-scale-100"})})}function Ut({button:t}){const{setIsOpen:o}=l.useWidgetTrigger(),{isSmallScreen:s}=O();if(s&&t.hideOnSmallScreen||!s&&t.hideOnLargeScreen)return null;const r=()=>{if(t.handleClick)return t.handleClick();o(!1)};return e.jsx(S,{variant:"ghost",size:"fit",className:"rounded-full",onClick:r,children:e.jsx(U,{name:t.icon})})}function ae({button:t}){const[o,s]=m.useState(!1),{routerState:{screen:r}}=l.useWidgetRouter(),{isSmallScreen:n}=O(),{theme:a}=q(),{setWidth:i,setHeight:c}=dt();if(r!=="chat"&&r!=="sessions")return null;const d=(()=>{switch(r){case"chat":return a.screens.chat.height;case"sessions":return a.screens.sessions.height;default:return M.isExhaustive(r,ae.name),a.screens.chat.height}})(),w=(()=>{switch(r){case"chat":return a.screens.chat.width;case"sessions":return a.screens.sessions.width;default:return M.isExhaustive(r,ae.name),a.screens.chat.width}})(),k=()=>{s(j=>{const h=!j;return c(h?"100vh":d),i(h?`max(40vw, ${w})`:w),h})};return n&&t.hideOnSmallScreen||!n&&t.hideOnLargeScreen?null:e.jsx(S,{variant:"ghost",size:"fit",className:"rounded-full",onClick:k,children:e.jsx(U,{name:t.icon||(o?t.shrinkIcon:t.expandIcon)})})}function ht({button:t}){var y,T;const{close:o}=ee(),{widgetCtx:s}=l.useWidget(),{setIsOpen:r}=l.useWidgetTrigger(),{resolveSession:n,sessionState:a}=l.useSessions(),{isSmallScreen:i}=O(),c=!a.session,d=((y=a.session)==null?void 0:y.isOpened)===!1,w=t.onResolved||"stay-in-chat",k=t.behaviorBeforeSessionCreation||"disabled",j=t.behaviorIfSessionIsResolved||"disabled",h=!!(a.isResolvingSession||c&&k==="disabled"||d&&j==="disabled"),b=async()=>{const{success:C,error:I}=await n();if(o(),!C)return console.error(I);switch(w){case"stay-in-chat":return;case"close-widget":r(!1);break;case"reset-chat":s.resetChat();break;case"reset-chat-and-close-widget":r(!1),s.resetChat();break;default:M.isExhaustive(w,ht.name);break}},x=()=>{if(c)switch(k){case"disabled":return;case"close-widget":r(!1);break;default:M.isExhaustive(k,x.name)}if(d)switch(j){case"disabled":return;case"close-widget":r(!1);break;case"reset-chat":s.resetChat();break;case"reset-chat-and-close-widget":r(!1),setTimeout(()=>{s.resetChat()},200);break;default:M.isExhaustive(j,x.name)}};return i&&t.hideOnSmallScreen||!i&&t.hideOnLargeScreen?null:((T=t.confirmation)==null?void 0:T.type)==="modal"&&!d&&!c?e.jsx(ot,{trigger:e.jsx(S,{variant:"ghost",size:"fit",className:"rounded-full",disabled:h,children:e.jsx(U,{name:t.icon})}),children:e.jsxs(Ze,{children:[e.jsx(Je,{children:e.jsx(tt,{children:t.confirmation.title||"Close conversation"})}),e.jsx(Qe,{children:e.jsx(st,{children:t.confirmation.description||"Are you sure you want to close this conversation?"})}),e.jsxs(et,{children:[e.jsx(S,{variant:"secondary",onClick:o,disabled:a.isResolvingSession,children:t.confirmation.cancelButtonText||"No"}),e.jsx(S,{variant:"destructive",onClick:b,disabled:a.isResolvingSession,children:t.confirmation.confirmButtonText||"Yes"})]})]})}):e.jsx(S,{variant:"ghost",size:"fit",className:"rounded-full",onClick:d||c?x:b,disabled:h,children:e.jsx(U,{name:t.icon})})}function ie({button:t}){switch(t.functionality){case"close-widget":return e.jsx(Ut,{button:t});case"expand-shrink":return e.jsx(ae,{button:t});case"resolve-session":return e.jsx(ht,{button:t});default:return M.isExhaustive(t,ie.name),null}}const Vt={functionality:"close-widget",hideOnLargeScreen:!0,icon:"X"};function Kt(){const{routerState:{screen:t}}=l.useWidgetRouter(),{headerButtons:o}=l.useConfig(),s=t==="chat"?o==null?void 0:o.chatScreen:t==="sessions"?o==null?void 0:o.sessionsScreen:[];return!s||s.length===0?e.jsx(ie,{button:Vt}):e.jsx(e.Fragment,{children:s.map(r=>e.jsx(ie,{button:r},`${r.functionality}-${r.icon}`))})}function mt(){const{routerState:{screen:t}}=l.useWidgetRouter(),{isLoading:o}=l.usePreludeData(),s=Yt(t),r=he();return e.jsx("header",{...s,className:"py-2 px-4 shrink-0",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Xt,{}),e.jsx("div",{className:p("flex-1 h-8 flex items-center",t==="sessions"&&"ps-2"),children:e.jsx(N.AnimatePresence,{mode:"wait",children:o?e.jsx(f,{snapExit:!0,children:e.jsx(pt,{className:"h-5 w-1/2"})},"skeleton"):e.jsx(f,{children:e.jsx("h2",{className:"font-semibold",children:r})},"organization-name")})}),e.jsx(Kt,{})]})})}function ut({className:t}){return e.jsx(u.LoaderIcon,{className:p("size-4 animate-spin",t)})}function Gt(){const{messagesState:{isInitialFetchLoading:t}}=l.useMessages(),{isSmallScreen:o}=O(),{activeMode:s,Component:r}=l.useModes();return{isCanvasOpen:!t&&!o&&!!s&&!!r}}function Zt(){const{activeMode:t,Component:o}=l.useModes(),{sendMessage:s}=l.useMessages(),{createStateCheckpoint:r}=l.useSessions(),[n,a]=m.useState(!1),i=async c=>{try{a(!0),await s(c)}catch(d){console.error(d)}finally{a(!1)}};return!t||!o?null:e.jsx(o,{react:m,mode:t,createStateCheckpoint:r,sendMessage:i,isSendingMessage:n})}const Jt={"write-a-message":"اكتب رسالة...","session-closed-lead":"تم حل مشكلتك!","new-conversation":"محادثة جديدة","welcome-title":"مرحبًا بك في دردشة الدعم الخاصة بنا","welcome-description":"نحن هنا للمساعدة! ابدأ محادثة وسنرد عليك في أقرب وقت ممكن.","your-name":"اسمك","your-email":"عنوان بريدك الإلكتروني","start-chat":"تحدث إلى الدعم","starting-chat":"جاري الاتصال...","i-need-more-help":"أحتاج المزيد من المساعدة","this-was-helpful":"كان هذا مفيدًا",optional:"اختياري","no-conversations-yet":"لا يوجد محادثات","back-to-conversations":"العودة إلى المحادثات","closed-conversations":"المحادثات المغلقة"},Qt={"write-a-message":"Nachricht schreiben...","session-closed-lead":"Ihr Problem wurde gelöst!","new-conversation":"Neue Konversation","welcome-title":"Willkommen in unserem Support-Chat","welcome-description":"Wir sind hier, um zu helfen! Beginnen Sie ein Gesprách und wir werden so schnell wie mogelijk antworten.","your-name":"Ihr Name","your-email":"Ihre E-Mail-Adresse","start-chat":"Mit dem Support sprechen","starting-chat":"Verbindung wird hergestellt...","i-need-more-help":"Ich brauche weitere Hilfe","this-was-helpful":"Dies war hilfreich",optional:"Optional","no-conversations-yet":"noch keine Gespräche","back-to-conversations":"Zurück zur Konversationen","closed-conversations":"Geschlossene Konversationen"},es={"write-a-message":"Write a message...","session-closed-lead":"Your issue has been resolved!","new-conversation":"New conversation","welcome-title":"Welcome to our support chat","welcome-description":"We're here to help! Start a conversation and we'll get back to you as soon as possible.","your-name":"Your name","your-email":"Your email address","start-chat":"Talk to support","starting-chat":"Connecting...","i-need-more-help":"I need more help","this-was-helpful":"This was helpful",optional:"Optional","no-conversations-yet":"No conversations yet","back-to-conversations":"Back to conversations","closed-conversations":"Closed conversations"},ts={"write-a-message":"Écrivez un message...","session-closed-lead":"Votre problème a été résolu !","new-conversation":"Nouvelle conversation","welcome-title":"Bienvenue dans notre chat de support","welcome-description":"Nous sommes là pour vous aider ! Commencez une conversation et nous vous répondrons dès que possible.","your-name":"Votre nom","your-email":"Votre adresse e-mail","start-chat":"Parler au support","starting-chat":"Connexion...","i-need-more-help":"Je besoin d'aide plus","this-was-helpful":"C'était utile",optional:"Optionnel","no-conversations-yet":"Aucune conversation pour le moment","back-to-conversations":"Retour aux conversations","closed-conversations":"Conversations fermées"},ss={"write-a-message":"Schrijf een bericht...","session-closed-lead":"Uw probleem is opgelost!","new-conversation":"Nieuw gesprek","welcome-title":"Welkom bij onze supportchat","welcome-description":"We zijn hier om te helpen! Begin een gesprek en we nemen zo snel mogelijk contact met u op.","your-name":"Uw naam","your-email":"Uw e-mailadres","start-chat":"Praat met ondersteuning","starting-chat":"Verbinding maken...","i-need-more-help":"Ik heb nog meer hulp nodig","this-was-helpful":"Mijn vraag is opgelost",optional:"Optioneel","no-conversations-yet":"Nog geen gesprekken","back-to-conversations":"Terug naar gesprekken","closed-conversations":"Afgesloten gesprekken"},os={"write-a-message":"Escreva uma mensagem...","session-closed-lead":"Seu problema foi resolvido!","new-conversation":"Nova conversa","welcome-title":"Bem-vindo ao nosso chat de suporte","welcome-description":"Estamos aqui para ajudar! Inicie uma conversa e responderemos o mais rápido possível.","your-name":"Seu nome","your-email":"Seu endereço de email","start-chat":"Falar com o suporte","starting-chat":"Conectando...","i-need-more-help":"preciso de mais ajuda","this-was-helpful":"Isso foi útil",optional:"Opcional","no-conversations-yet":"Nenhuma conversa ainda","back-to-conversations":"Voltar para conversas","closed-conversations":"Conversas fechadas"},rs={"write-a-message":"Escribe un mensaje...","session-closed-lead":"¡Tu problema fue resuelto!","new-conversation":"Nueva conversación","welcome-title":"Bienvenido a nuestro chat de soporte","welcome-description":"¡Estamos aquí para ayudarte! Inicia una conversación y responderemos lo antes posible.","your-name":"Tu nombre","your-email":"Tu correo electrónico","start-chat":"Hablar con soporte","starting-chat":"Conectando...","i-need-more-help":"Necesito más ayuda","this-was-helpful":"Esto fue útil",optional:"Opcional","no-conversations-yet":"Sin conversaciones aún","back-to-conversations":"Volver a conversaciones","closed-conversations":"Conversaciones cerradas"},ns={"write-a-message":"Bir mesaj yazın...","session-closed-lead":"Sorununuz çözüldü!","new-conversation":"Yeni konuşma","welcome-title":"Destek sohbetimize hoş geldiniz","welcome-description":"Yardım etmek için buradayız! Bir konuşma başlatın, en kısa sürede size geri döneceğiz.","your-name":"Adınız","your-email":"E-posta adresiniz","start-chat":"Destekle konuş","starting-chat":"Bağlanıyor...","i-need-more-help":"Daha fazla yardıma ihtiyacım var","this-was-helpful":"Bu yardımcı oldu",optional:"İsteğe bağlı","no-conversations-yet":"Henüz konuşma yok","back-to-conversations":"Konuşmalara geri dön","closed-conversations":"Kapatılan konuşmalar"},gt={en:es,ar:Jt,nl:ss,fr:ts,de:Qt,pt:os,es:rs,tr:ns},as=Object.keys(gt);function is(t){return as.includes(t)}function ls(t,o){const s=gt[o];return s&&s[t]||""}function Y(){const{dir:t}=l.useDocumentDir(),o=l.useConfig();return m.useMemo(()=>{const s=is(o.language)?o.language:"en";return{t:r=>ls(r,s),language:s,dir:s==="ar"?"rtl":"ltr",hostDocumentDir:t}},[o.language,t])}function me({suggestion:t,className:o,...s}){const{sendMessage:r}=l.useMessages(),n=()=>{const a=t.trim();a&&r({content:a})};return e.jsx(S,{...g("chat/suggested_reply_btn"),size:"sm",className:p("rounded-xl w-fit",o),...s,onClick:n,children:t})}function cs(){const{t}=Y(),o=[t("i-need-more-help"),t("this-was-helpful")];return e.jsx("div",{...g("chat/might_solve_user_issue_suggested_replies_container"),className:"flex items-center gap-2 p-2 pb-0 flex-wrap",children:o.map(s=>e.jsx(me,{suggestion:s,className:"flex-1"},s))})}function ds({file:{status:t,file:o,error:s},onCancel:r}){const[n,a]=m.useState(null);m.useEffect(()=>{if(!o.type.startsWith("image/"))return;const d=new FileReader;return d.onload=()=>a(d.result),d.onerror=()=>console.error("Error reading file"),d.readAsDataURL(o),()=>d.abort()},[o]);const i=()=>{switch(t){case"uploading":return e.jsx(u.Loader2,{className:"size-4 animate-spin"});case"error":return e.jsx(u.AlertCircle,{className:"size-4 text-destructive"});default:return null}},c=()=>{const d=o.type.split("/")[0];return d==="image"&&n?e.jsx("img",{src:typeof n=="string"?n:"",className:"object-cover bg-secondary size-full",alt:o.name}):d==="audio"?e.jsx(u.FileAudio2Icon,{}):d==="video"?e.jsx(u.FileVideo2Icon,{}):e.jsx(u.FileIcon,{})};return e.jsx(X,{side:"bottom",content:t==="error"?e.jsxs("span",{className:"text-destructive",children:["Failed to upload: ",s]}):o.name,children:e.jsxs("div",{className:p(t==="uploading"&&"opacity-50","group","size-12 border rounded-2xl overflow-hidden relative","flex items-center justify-center shrink-0"),children:[e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:i()}),e.jsx("button",{type:"button",className:p("absolute bg-black/50 inset-0 size-full z-10 opacity-0","flex items-center justify-center","opacity-0 group-hover:opacity-100 transition"),onClick:r,children:e.jsx(u.XIcon,{className:"size-4 text-primary-foreground"})}),e.jsx(c,{})]})})}function ps(){var D;const{isSmallScreen:t}=O(),o=m.useRef(null),{sendMessage:s}=l.useMessages(),{sessionState:r}=l.useSessions(),{t:n}=Y(),[a,i]=m.useState(""),{allFiles:c,emptyTheFiles:d,handleCancelUpload:w,appendFiles:k,isUploading:j,successFiles:h}=l.useUploadFiles(),b=!!((D=r.session)!=null&&D.isHandedOff),{isAwaitingBotReply:x}=l.useIsAwaitingBotReply(),y=v=>{k(v)},T=!a.trim()&&h.length===0,C=async()=>{if(x||T)return;j&&console.info("please wait for the file(s) to upload");const v=a.trim();s({content:v,attachments:h.flatMap(z=>z.fileUrl?[{url:z.fileUrl,type:z.file.type,name:z.file.name,id:z.id,size:z.file.size}]:[])}),i(""),d()},{getRootProps:I,getInputProps:E,open:P}=_t.useDropzone({onDrop:y,noClick:!0,onDropRejected(){console.error("unsupported file type, or the file is too large")},maxSize:5*1024*1024,accept:b?{"text/*":[".txt"],"image/*":[".png",".jpg",".jpeg",".gif"],"application/pdf":[".pdf"]}:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg"],"image/gif":[".gif"],"image/webp":[".webp"]}}),R=v=>{const z=v.clipboardData;z&&z.files.length>0&&y(Array.from(z.files))};return e.jsxs("div",{...g("chat/input_box/root"),className:"p-2 relative space-y-1",...I(),children:[e.jsx("input",{...E()}),e.jsxs("div",{...g("chat/input_box/inner_root"),className:p("transition-all","bg-white","relative rounded-3xl flex flex-col gap-2 p-2","hover:border-primary focus-within:border-primary"),children:[e.jsxs("div",{...g("chat/input_box/textarea_and_attachments_container"),className:"flex flex-col gap-2",children:[c.length>0&&e.jsx("div",{...g("chat/input_box/attachments_container"),className:"flex items-center gap-1",children:e.jsx(N.AnimatePresence,{mode:"popLayout",children:c.map(v=>e.jsx(f,{snapExit:!0,children:e.jsx(ds,{onCancel:()=>w(v.id),file:v})},v.id))})}),e.jsx("textarea",{...g("chat/input_box/textarea"),onPaste:R,ref:o,id:"chat-input",value:a,rows:3,className:p("max-h-16 [field-sizing:content]","w-full resize-none px-2",c.length===0&&"pt-1","bg-transparent outline-none","placeholder:text-muted-foreground",t?"text-[16px]":"text-sm"),onChange:v=>i(v.target.value),onKeyDown:async v=>{v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),C())},placeholder:n("write-a-message")})]}),e.jsxs("div",{className:"gap-2 flex justify-between",children:[e.jsx(X,{side:"top",align:"start",content:"attach files, (maximum size 5mb)",children:e.jsx(S,{onClick:P,size:"fit",variant:"ghost",className:p("rounded-full size-8 flex items-center justify-center p-0 overflow-hidden"),children:e.jsx(N.AnimatePresence,{mode:"wait",children:b?e.jsx(f,{children:e.jsx(u.PaperclipIcon,{className:"size-4"})},"paper-clip"):e.jsx(f,{children:e.jsx(u.ImageIcon,{className:"size-4"})},"image-icon")})})}),e.jsx(X,{content:"send message",side:"top",align:"end",children:e.jsx(S,{size:"fit",onClick:C,disabled:x||j||T,className:"rounded-full size-8 flex items-center justify-center p-0",children:e.jsx(N.AnimatePresence,{mode:"wait",children:x||j?e.jsx(f,{snapExit:!0,children:e.jsx(u.CircleDashed,{className:"size-4 animate-spin animate-iteration-infinite"})},"loading"):e.jsx(f,{snapExit:!0,children:e.jsx(u.ArrowUpIcon,{className:"size-4"})},"send")})})})]})]})]})}function hs(){const{widgetCtx:t}=l.useWidget(),{router:o}=l.useConfig(),{canCreateNewSession:s}=l.useSessions(),{toSessionsScreen:r}=l.useWidgetRouter(),{t:n}=Y();return e.jsx("div",{className:"p-2",children:e.jsxs("div",{className:"p-2 bg-muted rounded-3xl space-y-2",children:[e.jsxs("div",{className:"ps-2 flex items-center gap-1",children:[e.jsx(u.CircleCheckIcon,{className:"size-4 text-emerald-600"}),e.jsx("h2",{className:"text-sm font-medium",children:n("session-closed-lead")})]}),e.jsx("div",{children:s||o!=null&&o.chatScreenOnly?e.jsx(S,{onClick:t.resetChat,className:"rounded-2xl w-full",children:n("new-conversation")}):e.jsx(S,{onClick:r,className:"rounded-2xl w-full",children:n("back-to-conversations")})})]})})}function ms(){var i;const{initialQuestions:t,initialQuestionsPosition:o,thisWasHelpfulOrNot:s}=l.useConfig(),{sessionState:r}=l.useSessions(),{messagesState:n}=l.useMessages(),a=n.messages.length===0;return e.jsx("footer",{children:e.jsx("div",{children:e.jsx(N.AnimatePresence,{mode:"wait",children:r.session&&!((i=r.session)!=null&&i.isOpened)?e.jsx(f,{className:"overflow-hidden",overrides:{initial:{height:0},animate:{height:"auto"},exit:{height:0}},children:e.jsx(hs,{})},"session-closed"):e.jsxs(f,{className:"overflow-hidden",overrides:{initial:{height:0},animate:{height:"auto"},exit:{height:0}},children:[n.lastAIResMightSolveUserIssue&&(s==null?void 0:s.enabled)!==!1&&e.jsx(cs,{}),a&&t&&o!=="below-initial-messages"&&e.jsx("div",{className:"flex items-center flex-row justify-end gap-2 flex-wrap px-2",children:t==null?void 0:t.map((c,d)=>e.jsx(me,{suggestion:c},`${c}-${d}`))}),e.jsx(ps,{})]},"chat-input")})})})}function us({isFirstInGroup:t,isLastInGroup:o,isAloneInGroup:s,...r}){const{componentStore:n}=l.useWidget();if(r.data.action){const i=n.getComponent(r.data.action.name);if(i)return e.jsx(i,{...r,id:r.id,isFirstInGroup:t,isLastInGroup:o,isAloneInGroup:s})}const a=n.getComponent(r.component);return a?e.jsx(a,{...r,id:r.id,isFirstInGroup:t,isLastInGroup:o,isAloneInGroup:s}):e.jsx(re,{...r,isFirstInGroup:t,isLastInGroup:o,isAloneInGroup:s})}function wt({messages:t,className:o,containerClassName:s}){var i,c;const{timestamps:r}=l.useConfig();if(!((i=r==null?void 0:r.perMessageGroup)!=null&&i.enabled))return null;const n=(c=t[t.length-1])==null?void 0:c.timestamp;if(!n)return null;const a=(()=>{try{return new Date(n).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!0})}catch(d){return console.error(d),null}})();return a?e.jsx("div",{className:s,children:e.jsx("span",{className:p("text-xs text-muted-foreground",o),children:a})}):null}function oe({messages:t,agent:o,suggestedReplies:s}){return e.jsxs("div",{...g("chat/agent_msg_group/root"),className:p("flex items-end gap-2"),children:[e.jsx(X,{content:o==null?void 0:o.name,side:"right",align:"end",children:e.jsx(ne,{...g("chat/agent_msg_group/root/avatar"),agent:o,className:"hidden"})}),e.jsxs("div",{className:p("flex-1 flex flex-col gap-1"),children:[e.jsxs("div",{...g("chat/agent_msg_group/avatar_and_msgs/root"),className:p("flex items-end gap-2"),children:[e.jsx(X,{content:o==null?void 0:o.name,side:"right",align:"end",children:e.jsx(ne,{...g("chat/agent_msg_group/avatar_and_msgs/avatar"),agent:o})}),e.jsxs("div",{...g("chat/agent_msg_group/avatar_and_msgs/msgs"),className:p("flex-1 flex flex-col gap-1"),children:[t.map((r,n,a)=>e.jsx(us,{isFirstInGroup:n===0,isLastInGroup:n===a.length-1,isAloneInGroup:a.length===1,...r},r.id)),e.jsx(wt,{messages:t})]})]}),s&&s.length>0&&e.jsx("div",{...g("chat/agent_msg_group/suggestions"),className:p("flex flex-col gap-1 ps-8"),children:s==null?void 0:s.map((r,n)=>e.jsx(me,{suggestion:r},`${r}-${n}`))})]})]})}function gs({message:t,isFirstInGroup:o,isLastInGroup:s,isAloneInGroup:r}){var n;return e.jsxs("div",{...g("chat/user_msg/root"),className:"w-5/6 flex flex-col items-end gap-1",children:[t.attachments&&t.attachments.length>0&&e.jsx("div",{className:"w-full flex gap-1 flex-wrap justify-end",children:(n=t.attachments)==null?void 0:n.map(a=>e.jsx(rt,{attachment:a},a.id))}),t.content.length>0&&e.jsx("div",{...g("chat/user_msg/msg"),"data-first":o,"data-last":s,"data-alone":r,className:p("transition-all","w-fit py-3 px-4 rounded-3xl text-sm","bg-primary text-primary-foreground","break-words [word-break:break-word]","whitespace-pre-wrap",o&&!r&&"rounded-br-md",s&&!r&&"rounded-tr-md",!o&&!s&&!r&&"rounded-r-md"),children:t.content})]})}function ws({messages:t}){return e.jsxs("div",{...g("chat/user_msg_group/root"),className:p("group","flex flex-col gap-1 justify-end items-end"),children:[t.map((o,s,r)=>e.jsx(gs,{message:o,isFirstInGroup:s===0,isLastInGroup:s===r.length-1,isAloneInGroup:r.length===1},o.id)),e.jsx(wt,{messages:t,containerClassName:"ms-auto"})]})}function fs(t){const o=[];let s=null;return t.forEach(r=>{var n,a,i,c;(!s||((n=s[0])==null?void 0:n.type)!==r.type)&&(s=[],o.push(s)),((a=s[0])==null?void 0:a.type)==="FROM_AGENT"&&r.type==="FROM_AGENT"&&((i=r.agent)==null?void 0:i.id)!==((c=s[0].agent)==null?void 0:c.id)&&(s=[],o.push(s)),s.push(r)}),o}function xs(t){var o;return((o=t==null?void 0:t[0])==null?void 0:o.type)==="FROM_USER"}function vs(t){var o;return((o=t==null?void 0:t[0])==null?void 0:o.type)==="FROM_BOT"}function bs(t){var o;return((o=t==null?void 0:t[0])==null?void 0:o.type)==="FROM_AGENT"}function ys(){const{messagesState:{messages:t}}=l.useMessages(),{chatBannerItems:o}=l.useConfig();return!(o!=null&&o.length)||t.length>0&&o.every(s=>!s.persistent)?null:e.jsx("div",{className:"w-full text-center text-xs",children:o.map(({message:s,persistent:r},n)=>t.length>0&&!r?null:e.jsx("div",{children:e.jsx(at,{children:s})},`${s}-${n}`))})}function js(){const{messagesState:{messages:t}}=l.useMessages(),{isAwaitingBotReply:o}=l.useIsAwaitingBotReply(),{componentStore:s}=l.useWidget(),r=l.useConfig(),{initialQuestions:n,initialQuestionsPosition:a}=r,i=m.useMemo(()=>fs(t),[t]),c=(()=>{var h;return t.length?((h=r.advancedInitialMessages)==null?void 0:h.filter(b=>!!b.persistent))||[]:r.advancedInitialMessages||[]})(),d=(()=>{var h;return c.length?[]:t.length?[]:(h=r.initialMessages)!=null&&h.length?r.initialMessages:["Hello, how can I help you?"]})(),w=s.getComponent("loading"),k=m.useRef(null);function j(){setTimeout(()=>{const h=k.current;h&&(h.scrollTop=h.scrollHeight)},0)}return m.useEffect(()=>{j()},[t]),e.jsxs("div",{...g("chat/msgs/root"),ref:k,className:"max-h-full scroll-smooth relative flex-1 py-2 px-4 flex flex-col gap-2 overflow-auto",children:[e.jsx(ys,{}),c.length>0&&e.jsx(oe,{messages:c.map(({message:h},b)=>({component:"bot_message",data:{message:h},id:`${b}-${h}`,type:"FROM_BOT",timestamp:null})),suggestedReplies:t.length===0&&a==="below-initial-messages"?n:void 0,agent:r.bot?{...r.bot,isAi:!0,id:null}:void 0}),t.length===0&&d.length>0&&e.jsx(oe,{messages:d.map((h,b)=>({component:"bot_message",data:{message:h},id:`${b}-${h}`,type:"FROM_BOT",timestamp:null})),suggestedReplies:a==="below-initial-messages"?n:void 0,agent:r.bot?{...r.bot,isAi:!0,id:null}:void 0}),i.map(h=>{var y,T,C;const b=(y=h==null?void 0:h[0])==null?void 0:y.type,x=(T=h[0])==null?void 0:T.id;if(!b||!x)return null;if(xs(h))return e.jsx(ws,{messages:h},x);if(vs(h)||bs(h)){const I=(C=h[0])==null?void 0:C.agent;return e.jsx(oe,{messages:h,agent:I},x)}return null}),o&&w&&e.jsx(w,{agent:r.bot})]})}function ks(){const{messagesState:{isInitialFetchLoading:t}}=l.useMessages(),{sessionState:{session:o}}=l.useSessions(),{isCanvasOpen:s}=Gt(),{theme:r}=q();pe({width:s?r.screens.chat.withCanvas.width:r.screens.chat.width,height:s?r.screens.chat.withCanvas.height:r.screens.chat.height});const n=m.useRef((o==null?void 0:o.id)||"chat").current;return e.jsx("div",{...g("chat/root"),className:p("flex flex-col overflow-hidden"),style:{width:"100vw",maxWidth:"100vw",height:"100vh",maxHeight:"100vh"},children:e.jsxs("div",{className:"size-full justify-between flex flex-col",children:[e.jsx(mt,{}),e.jsx(N.AnimatePresence,{mode:"wait",children:t?e.jsx(f,{className:"flex flex-col items-center justify-center w-full flex-1",children:e.jsx(ut,{})},"loading"):e.jsxs(f,{className:"flex items-start h-full flex-1 overflow-auto",snapExit:!0,children:[e.jsxs("div",{...g("chat/main/root"),className:p("flex flex-col h-full overflow-auto transition-all",s?"w-2/5":"w-full"),style:{transitionTimingFunction:r.screens.chat.withCanvas.transitionTimingFunction,transitionDuration:r.screens.chat.withCanvas.transitionDuration},children:[e.jsx(js,{}),e.jsx(ms,{})]}),e.jsx("div",{...g("chat/canvas/root"),className:p("h-full overflow-auto transition-all",s?"w-3/5":"w-0"),style:{transitionTimingFunction:r.screens.chat.withCanvas.transitionTimingFunction,transitionDuration:r.screens.chat.withCanvas.transitionDuration},children:e.jsx(Zt,{})})]},n)})]})})}function Cs({className:t}){return e.jsx("svg",{width:"26",height:"32",viewBox:"0 0 26 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:p("text-primary-foreground",t),children:e.jsx("path",{d:"M1.34103 25.6132H5.44245C5.74203 25.6228 6.02673 25.7462 6.23867 25.9582C6.45062 26.1703 6.5739 26.4551 6.58348 26.7548V30.8584C6.59305 31.1581 6.71634 31.443 6.92828 31.655C7.14023 31.8671 7.42492 31.9904 7.7245 32H18.2894C18.589 31.9904 18.8737 31.8671 19.0856 31.655C19.2976 31.443 19.4209 31.1581 19.4304 30.8584V26.7548C19.4401 26.4545 19.5638 26.1692 19.7765 25.957C19.9892 25.7449 20.2748 25.6219 20.5749 25.6132H24.659C24.9586 25.6036 25.2433 25.4803 25.4552 25.2682C25.6671 25.0562 25.7904 24.7713 25.8 24.4716V7.52839C25.7904 7.22865 25.6671 6.94381 25.4552 6.73176C25.2433 6.5197 24.9586 6.39635 24.659 6.38677H20.561C20.2603 6.37802 19.9742 6.25457 19.7614 6.04169C19.5487 5.82881 19.4253 5.54261 19.4165 5.24168V1.14161C19.4072 0.84419 19.2858 0.561291 19.0768 0.349589C18.8678 0.137887 18.5865 0.0130193 18.2894 0L7.7245 0C7.42492 0.00957792 7.14023 0.132929 6.92828 0.344983C6.71634 0.557036 6.59305 0.841878 6.58348 1.14161V5.24168C6.57477 5.54203 6.45187 5.82773 6.23983 6.04052C6.0278 6.25331 5.74262 6.37715 5.44245 6.38677H1.34103C1.04144 6.39635 0.756749 6.5197 0.544805 6.73176C0.332861 6.94381 0.209574 7.22865 0.200001 7.52839V24.4716C0.209574 24.7713 0.332861 25.0562 0.544805 25.2682C0.756749 25.4803 1.04144 25.6036 1.34103 25.6132ZM6.58348 24.4716V7.52839C6.59305 7.22865 6.71634 6.94381 6.92828 6.73176C7.14023 6.5197 7.42492 6.39635 7.7245 6.38677H18.2894C18.589 6.39635 18.8737 6.5197 19.0856 6.73176C19.2976 6.94381 19.4209 7.22865 19.4304 7.52839V24.4716C19.4209 24.7713 19.2976 25.0562 19.0856 25.2682C18.8737 25.4803 18.589 25.6036 18.2894 25.6132H7.7245C7.42492 25.6036 7.14023 25.4803 6.92828 25.2682C6.71634 25.0562 6.59305 24.7713 6.58348 24.4716Z",fill:"currentColor"})})}function ft({className:t}){const{token:o}=l.useConfig();return e.jsx("div",{className:p("flex items-center justify-center gap-2 p-2 pt-0",t),children:e.jsx(W,{children:e.jsxs("a",{href:`https://open.cx/?ref=${o}`,target:"_blank",rel:"noreferrer",className:p("text-[10px] flex items-center","text-muted-foreground/70 [&_svg]:text-muted-foreground/70","hover:text-primary [&_svg]:hover:text-primary"),children:[e.jsx("span",{children:"Powered by"}),e.jsx("span",{children:" "}),e.jsxs("span",{className:"flex items-center gap-[1px]",children:[e.jsx("span",{children:e.jsx(Cs,{className:"size-3 inline-block"})}),e.jsx("span",{className:"font-semibold",children:"open"})]})]})})})}function zs({children:t}){return e.jsx("p",{className:"ps-4 text-xs text-muted-foreground/75 uppercase font-semibold tracking-tight",children:t})}function Xe({session:t,className:o}){const{bot:s}=l.useConfig(),{toChatScreen:r}=l.useWidgetRouter(),n=t.assignee.kind==="human"?t.assignee.name||"Support Agent":(s==null?void 0:s.name)||"AI Support Agent",a=t.assignee.kind==="human"?t.assignee.avatarUrl||"":(s==null?void 0:s.avatar)||"";return e.jsxs(S,{variant:"ghost",size:"lg",className:p("rounded-full p-2 pe-4 flex text-start justify-between w-full whitespace-normal",o),onClick:()=>r(t.id),children:[e.jsxs("div",{className:"flex-1 flex gap-2 items-center",children:[e.jsx(N.AnimatePresence,{mode:"wait",children:e.jsx(f,{snapExit:!0,children:e.jsxs(le,{className:"size-10",children:[e.jsx(ce,{src:a,alt:"Agent Icon"}),e.jsx(de,{children:e.jsx(u.UserRoundIcon,{className:"size-4"})})]})})}),e.jsxs("div",{className:"flex-1",children:[e.jsx(N.AnimatePresence,{mode:"wait",children:e.jsx(f,{snapExit:!0,children:n},n)}),e.jsx(N.AnimatePresence,{mode:"wait",children:t.lastMessage?e.jsx(f,{snapExit:!0,children:e.jsx(nt,{remarkPlugins:[Ue],rehypePlugins:[Ve],className:"line-clamp-1 overflow-hidden text-ellipsis text-xs text-muted-foreground",children:t.lastMessage})},t.lastMessage||"content"):e.jsx(f,{className:"w-1/2",snapExit:!0,children:e.jsx(pt,{className:"h-4 w-full"})},"skeleton")})]})]}),e.jsx(u.ChevronRightIcon,{className:"size-4 text-muted-foreground shrink-0 rtl:-scale-100"})]})}function Ns(){const{t}=Y(),{toChatScreen:o}=l.useWidgetRouter(),{sessionsState:{data:s,isInitialFetchLoading:r},openSessions:n,closedSessions:a,canCreateNewSession:i}=l.useSessions();return e.jsx("div",{className:"flex-1 flex flex-col overflow-scroll py-2 px-2",children:e.jsx(N.AnimatePresence,{mode:"wait",children:r?e.jsx(f,{className:"flex-1 flex items-center justify-center",children:e.jsx(ut,{})},"loading"):e.jsx(f,{className:"flex-1 flex flex-col gap-2 relative",children:s.length?e.jsxs(e.Fragment,{children:[e.jsxs(N.AnimatePresence,{children:[n.length>0&&e.jsx(f,{fadeIn:"up",delay:.2,className:"space-y-2",snapExit:!0,children:n.map(c=>e.jsx(Xe,{session:c},c.id))},"open-sessions"),a.length>0&&e.jsxs(f,{className:"space-y-2",delay:.2,snapExit:!0,children:[e.jsx(zs,{children:t("closed-conversations")}),a.map(c=>e.jsx(Xe,{session:c,className:"opacity-50 hover:opacity-100"},c.id))]},"closed-sessions")]}),i&&e.jsx("div",{className:"mt-auto w-full rounded-3xl sticky bottom-0 outline outline-8 outline-background bg-background",children:m.createElement(S,{...g("sessions/new_conversation_btn"),size:"lg",key:"new-session",className:"w-full",onClick:()=>o()},t("new-conversation"))})]}):e.jsxs("div",{className:"flex-1 flex flex-col gap-2 items-center",children:[e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx("p",{className:"text-muted-foreground",children:t("no-conversations-yet")})}),m.createElement(S,{...g("sessions/new_conversation_btn"),size:"lg",key:"new-session",className:"w-full",onClick:()=>o()},t("new-conversation"))]})},"sessions")})})}function Ss(){const{theme:t}=q();return pe({width:t.screens.sessions.width,height:t.screens.sessions.height}),e.jsx("div",{...g("sessions/root"),className:p("flex flex-col overflow-hidden bg-background"),style:{width:"100vw",maxWidth:"100vw",height:"100vh",maxHeight:"100vh"},children:e.jsxs("div",{className:"size-full flex flex-col",children:[e.jsx(mt,{}),e.jsx(Ns,{}),e.jsx(ft,{})]})})}const Z=L.forwardRef(({className:t,type:o,...s},r)=>{const{isSmallScreen:n}=O();return e.jsx(W,{ref:r,children:e.jsx("input",{type:o,className:p(n?"text-[16px]":"text-sm","flex w-full rounded-xl p-2 ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-primary-foreground placeholder:text-muted-foreground/75 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 transition","rounded-2xl px-4","border shadow-sm",t),...s})})});Z.displayName="Input";function _s(){const{contentIframeRef:t}=l.useWidget(),{inline:o}=l.useConfig(),s=m.useRef(null);return m.useEffect(()=>{const r=t==null?void 0:t.current;if(r&&s.current){const n=s.current;let a;const i=new ResizeObserver(()=>{a=requestAnimationFrame(()=>{const c=n.offsetHeight;r.style.setProperty("--opencx-widget-height",o?"100%":`${c.toFixed(1)}px`)})});return i.observe(n),()=>{cancelAnimationFrame(a),i.unobserve(n)}}},[t,o]),{observedElementRef:s}}const Ts=se.z.object({name:se.z.string().min(2),email:se.z.string().email()});function Is(){var C,I,E,P,R,D,v,z,A;const{setIsOpen:t}=l.useWidgetTrigger(),{createUnverifiedContact:o}=l.useContact(),{isSmallScreen:s}=O(),r=l.useConfig(),{theme:n}=q(),{t:a}=Y(),{data:i}=l.usePreludeData(),{observedElementRef:c}=_s();pe({height:void 0,width:n.screens.welcome.width});const[d,w]=m.useState(((C=r.prefillUserData)==null?void 0:C.name)||""),[k,j]=m.useState(((I=r.prefillUserData)==null?void 0:I.email)||""),h=(r.extraDataCollectionFields||[]).filter(_=>_!=="name"&&_!=="email"&&!!_),[b,x]=m.useState({}),[y,T]=Tt(async _=>{_.preventDefault();const F=Ts.safeParse({name:d,email:k});F.success&&await o({email:F.data.email,non_verified_name:F.data.name},Object.values(b).filter(Boolean).length?b:void 0)},[d,k,b]);return e.jsx("div",{style:{width:"100vw",maxWidth:"100vw",minHeight:n.screens.welcome.minHeight,height:"100vh",maxHeight:"100vh",overflowY:"auto"},children:e.jsxs("div",{ref:c,className:p("flex flex-col",s&&"h-full","bg-[radial-gradient(ellipse_at_top_left,hsl(var(--opencx-primary)),transparent),radial-gradient(ellipse_at_top_right,hsl(var(--opencx-primary)),transparent)]"),children:[e.jsxs("div",{className:p("flex-1 flex flex-col px-4 py-12 text-start space-y-4 relative z-10","text-primary-foreground"),children:[s&&e.jsx(f,{className:"absolute top-6 end-6",children:e.jsx(S,{size:"selfless",onClick:()=>t(!1),children:e.jsx(u.XIcon,{className:"size-4"})})}),e.jsx("div",{className:"flex items-center justify-between w-full mb-2",children:(E=r.assets)!=null&&E.organizationLogo?e.jsx("img",{src:(P=r.assets)==null?void 0:P.organizationLogo,alt:"Company Logo",className:"h-8 w-auto object-contain"}):e.jsx("h2",{className:"font-bold text-sm",children:(R=i==null?void 0:i.data)==null?void 0:R.organizationName})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-[1.75rem] font-semibold tracking-tight leading-none",children:((v=(D=r.textContent)==null?void 0:D.welcomeScreen)==null?void 0:v.title)||a("welcome-title")}),e.jsx("p",{className:"text-sm",children:((A=(z=r.textContent)==null?void 0:z.welcomeScreen)==null?void 0:A.description)||a("welcome-description")})]})]}),e.jsxs("div",{className:p("z-10 m-2 px-2 pt-2 bp-0 space-y-2","bg-[white]","border shadow","rounded-3xl"),children:[e.jsxs("form",{onSubmit:T,className:"space-y-2",children:[e.jsx(Z,{value:d,onChange:_=>w(_.target.value),required:!0,placeholder:a("your-name"),name:"name"}),e.jsx(Z,{required:!0,value:k,onChange:_=>j(_.target.value),type:"email",placeholder:a("your-email"),name:"email"}),h.map(_=>e.jsx(Z,{value:b[_],onChange:F=>x(K=>({...K,[_]:F.target.value})),placeholder:`${_} (${a("optional")})`},_)),e.jsxs(S,{disabled:y.loading,className:"w-full",size:"lg",children:[y.loading?a("starting-chat"):a("start-chat"),e.jsx(u.SendHorizontal,{className:"size-4 rtl:-scale-100"})]})]}),e.jsx(ft,{})]})]})})}function xt(){l.usePreludeData();const{routerState:{screen:t}}=l.useWidgetRouter();return e.jsx("div",{className:"relative bg-background size-full",children:e.jsx(N.AnimatePresence,{mode:"wait",children:(()=>{switch(t){case"welcome":return e.jsx(f,{fadeIn:"right",className:"size-full",snapExit:!0,children:e.jsx(Is,{})},t);case"sessions":return e.jsx(f,{fadeIn:"right",className:"size-full",snapExit:!0,children:e.jsx(Ss,{})},t);case"chat":return e.jsx(f,{fadeIn:"right",className:"size-full",snapExit:!0,children:e.jsx(ks,{})},t);default:return M.isExhaustive(t,xt.name),null}})()})})}const Ms="4.0.9",Ds=`<!DOCTYPE html>
18
18
  <html>
19
19
  <head>
20
20
  <style>
21
- ${dt}
21
+ ${it}
22
22
  html, body {
23
23
  height: 100%;
24
24
  width: 100%;
@@ -31,11 +31,11 @@ html, body {
31
31
  </head>
32
32
  <body>
33
33
  </body>
34
- </html>`;function jt(){const{isOpen:t}=l.useWidgetTrigger(),{contentIframeRef:o}=l.useWidget(),{cssOverrides:s,inline:r}=l.useConfig(),{theme:n,cssVars:a,computed:i}=L(),{dir:c}=X();return e.jsx(N.motion.div,{animate:t?"visible":"hidden",initial:"hidden",variants:{hidden:{opacity:0,y:8,transitionEnd:{display:"none"},transition:{duration:.15}},visible:{opacity:1,y:0,display:"block",height:r?"100%":void 0}},children:e.jsxs(ce,{ref:o,initialContent:Ws,allowFullScreen:!0,title:"OpenCX Live Chat",style:{"--opencx-widget-width":i.minWidth,"--opencx-widget-height":i.minHeight,minWidth:i.minWidth,width:"var(--opencx-widget-width)",maxWidth:i.maxWidth,minHeight:i.minHeight,height:"var(--opencx-widget-height)",maxHeight:i.maxHeight,overflow:"hidden",outline:n.widgetContentContainer.outline,outlineColor:n.widgetContentContainer.outlineColor,borderRadius:n.widgetContentContainer.borderRadius,boxShadow:n.widgetContentContainer.boxShadow,transitionProperty:n.widgetContentContainer.transitionProperty,transitionTimingFunction:n.widgetContentContainer.transitionTimingFunction,transitionDuration:n.widgetContentContainer.transitionDuration,boxSizing:"border-box",borderWidth:"0px"},children:[s&&e.jsx("style",{children:s}),e.jsx(Xt,{delayDuration:200,disableHoverableContent:!0,children:e.jsx("div",{style:{...a},"data-version":Os,className:d("antialiased font-sans size-full overflow-hidden relative text-secondary-foreground"),dir:c,children:e.jsx(yt,{})})})]})})}function As(){const{theme:t}=L();return e.jsx(ee.Content,{onInteractOutside:o=>o.preventDefault(),forceMount:!0,style:{zIndex:t.widgetContentContainer.zIndex,fontSize:"16px"},side:"top",align:"end",sideOffset:t.widgetContentContainer.offset.side,alignOffset:t.widgetContentContainer.offset.align,avoidCollisions:!1,children:e.jsx(jt,{})})}function Fs({className:t,style:o}){return e.jsxs("svg",{width:"32",height:"30",viewBox:"0 0 32 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:d("text-primary-foreground",t),style:o,children:[e.jsx("path",{d:"M0 6.94263C0 3.62892 2.68629 0.942627 6 0.942627H26C29.3137 0.942627 32 3.62892 32 6.94263V17.9426C32 21.2563 29.3137 23.9426 26 23.9426H6C2.68629 23.9426 0 21.2563 0 17.9426V6.94263Z",fill:"currentColor"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.9945 23.8935L26.237 23.8934C26.1982 24.3557 26.1712 25.2778 26.1704 26.2318C26.1688 28.2839 26.1376 28.7041 25.974 28.868C25.583 29.2598 25.2686 29.0967 24.0616 27.8754C23.4162 27.2222 22.1141 25.9522 21.1682 25.0531L19.9945 23.8935Z",fill:"currentColor"})]})}const Hs=`<!DOCTYPE html>
34
+ </html>`;function vt(){const{isOpen:t}=l.useWidgetTrigger(),{contentIframeRef:o}=l.useWidget(),{cssOverrides:s,inline:r}=l.useConfig(),{theme:n,cssVars:a,computed:i}=q(),{dir:c}=Y();return e.jsx(N.motion.div,{animate:t?"visible":"hidden",initial:"hidden",variants:{hidden:{opacity:0,y:8,transitionEnd:{display:"none"},transition:{duration:.15}},visible:{opacity:1,y:0,display:"block",height:r?"100%":void 0}},children:e.jsxs(Ke,{ref:o,initialContent:Ds,allowFullScreen:!0,title:"OpenCX Live Chat",style:{"--opencx-widget-width":i.minWidth,"--opencx-widget-height":i.minHeight,minWidth:i.minWidth,width:"var(--opencx-widget-width)",maxWidth:i.maxWidth,minHeight:i.minHeight,height:"var(--opencx-widget-height)",maxHeight:i.maxHeight,overflow:"hidden",outline:n.widgetContentContainer.outline,outlineColor:n.widgetContentContainer.outlineColor,borderRadius:n.widgetContentContainer.borderRadius,boxShadow:n.widgetContentContainer.boxShadow,transitionProperty:n.widgetContentContainer.transitionProperty,transitionTimingFunction:n.widgetContentContainer.transitionTimingFunction,transitionDuration:n.widgetContentContainer.transitionDuration,boxSizing:"border-box",borderWidth:"0px"},children:[s&&e.jsx("style",{children:s}),e.jsx("div",{style:{...a,zIndex:n.widgetContentContainer.zIndex},"data-version":Ms,className:p("antialiased font-sans size-full overflow-hidden relative text-secondary-foreground isolate"),dir:c,children:e.jsx(qt,{delayDuration:200,disableHoverableContent:!0,children:e.jsx(Ot,{children:e.jsx(xt,{})})})})]})})}function Es(){const{theme:t}=q();return e.jsx(Q.Content,{onInteractOutside:o=>o.preventDefault(),forceMount:!0,style:{zIndex:t.widgetContentContainer.zIndex,fontSize:"16px"},side:"top",align:"end",sideOffset:t.widgetContentContainer.offset.side,alignOffset:t.widgetContentContainer.offset.align,avoidCollisions:!1,children:e.jsx(vt,{})})}function Ps({className:t,style:o}){return e.jsxs("svg",{width:"32",height:"30",viewBox:"0 0 32 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:p("text-primary-foreground",t),style:o,children:[e.jsx("path",{d:"M0 6.94263C0 3.62892 2.68629 0.942627 6 0.942627H26C29.3137 0.942627 32 3.62892 32 6.94263V17.9426C32 21.2563 29.3137 23.9426 26 23.9426H6C2.68629 23.9426 0 21.2563 0 17.9426V6.94263Z",fill:"currentColor"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.9945 23.8935L26.237 23.8934C26.1982 24.3557 26.1712 25.2778 26.1704 26.2318C26.1688 28.2839 26.1376 28.7041 25.974 28.868C25.583 29.2598 25.2686 29.0967 24.0616 27.8754C23.4162 27.2222 22.1141 25.9522 21.1682 25.0531L19.9945 23.8935Z",fill:"currentColor"})]})}const Rs=`<!DOCTYPE html>
35
35
  <html>
36
36
  <head>
37
37
  <style>
38
- ${dt}
38
+ ${it}
39
39
  html, body {
40
40
  height: 100%;
41
41
  width: 100%;
@@ -47,5 +47,5 @@ html, body {
47
47
  </head>
48
48
  <body>
49
49
  </body>
50
- </html>`;function qs(){var a,i;const{isOpen:t}=l.useWidgetTrigger(),{cssOverrides:o,assets:s}=l.useConfig(),{theme:r,cssVars:n}=L();return e.jsxs(ce,{initialContent:Hs,style:{height:`calc(${r.widgetTrigger.size.button}px + ${$.x*2}px)`,width:`calc(${r.widgetTrigger.size.button}px + ${$.y*2}px)`,fontSize:"16px",position:"fixed",zIndex:r.widgetTrigger.zIndex,right:r.widgetTrigger.offset.right,bottom:r.widgetTrigger.offset.bottom,left:r.widgetTrigger.offset.left,boxSizing:"border-box",borderWidth:"0px",borderRadius:"100%"},children:[o&&e.jsx("style",{children:o}),e.jsx("div",{style:{...n,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(ee.PopoverTrigger,{className:d("font-sans flex items-center justify-center rounded-full"),style:{height:r.widgetTrigger.size.button,width:r.widgetTrigger.size.button},children:e.jsx(A,{children:e.jsx("div",{...g("trigger/btn"),className:d("relative size-full rounded-full","flex items-center justify-center","overflow-hidden","transition-all","bg-primary","text-primary-foreground"),children:e.jsx(N.AnimatePresence,{mode:"wait",children:t?e.jsx(f,{snapExit:!0,fadeIn:"up",overrides:{initial:{rotate:45},animate:{rotate:0}},children:(a=s==null?void 0:s.widgetTrigger)!=null&&a.closeIcon?e.jsx("img",{src:s.widgetTrigger.closeIcon,alt:"Widget trigger close icon",style:{width:r.widgetTrigger.size.icon,height:r.widgetTrigger.size.icon}}):e.jsx(m.ChevronDownIcon,{style:{width:r.widgetTrigger.size.icon,height:r.widgetTrigger.size.icon}})},"x-icon"):e.jsx(f,{snapExit:!0,overrides:{initial:{rotate:45},animate:{rotate:0}},children:(i=s==null?void 0:s.widgetTrigger)!=null&&i.openIcon?e.jsx("img",{src:s.widgetTrigger.openIcon,alt:"Widget trigger open icon",style:{width:r.widgetTrigger.size.icon,height:r.widgetTrigger.size.icon}}):e.jsx(Fs,{style:{width:r.widgetTrigger.size.icon,height:r.widgetTrigger.size.icon},className:"mt-0.5 opacity-95"})},"message-icon")})})})})})]})}function Bs(){const{dir:t}=l.useDocumentDir();return e.jsx(ee.Anchor,{style:{position:"fixed",bottom:0,right:t==="ltr"?0:void 0,left:t==="rtl"?0:void 0}})}function Ls(){const{isOpen:t,setIsOpen:o}=l.useWidgetTrigger();return e.jsxs(ee.Root,{open:t,onOpenChange:o,children:[e.jsx(Bs,{}),e.jsx(qs,{}),e.jsx(As,{})]})}const $s=[{key:"loading",component:Yt},{key:"fallback",component:At},{key:"bot_message",component:ne},{key:"agent_message",component:ne}],Ys={get:async t=>localStorage.getItem(t),set:async(t,o)=>{localStorage.setItem(t,o)},remove:async t=>{localStorage.removeItem(t)}};function Xs({options:t,components:o=[],loadingComponent:s}){return e.jsx(l.WidgetProvider,{components:[...$s,...o],options:t,storage:Ys,loadingComponent:s,children:e.jsx(l.WidgetTriggerProvider,{children:t.inline?e.jsx(jt,{}):e.jsx(Ls,{})})})}exports.Widget=Xs;
50
+ </html>`;function Ws(){var a,i;const{isOpen:t}=l.useWidgetTrigger(),{cssOverrides:o,assets:s}=l.useConfig(),{theme:r,cssVars:n}=q();return e.jsxs(Ke,{initialContent:Rs,style:{height:`calc(${r.widgetTrigger.size.button}px + ${B.x*2}px)`,width:`calc(${r.widgetTrigger.size.button}px + ${B.y*2}px)`,fontSize:"16px",position:"fixed",zIndex:r.widgetTrigger.zIndex,right:r.widgetTrigger.offset.right,bottom:r.widgetTrigger.offset.bottom,left:r.widgetTrigger.offset.left,boxSizing:"border-box",borderWidth:"0px",borderRadius:"100%"},children:[o&&e.jsx("style",{children:o}),e.jsx("div",{style:{...n,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(Q.PopoverTrigger,{className:p("font-sans flex items-center justify-center rounded-full"),style:{height:r.widgetTrigger.size.button,width:r.widgetTrigger.size.button},children:e.jsx(W,{children:e.jsx("div",{...g("trigger/btn"),className:p("relative size-full rounded-full","flex items-center justify-center","overflow-hidden","transition-all","bg-primary","text-primary-foreground"),children:e.jsx(N.AnimatePresence,{mode:"wait",children:t?e.jsx(f,{snapExit:!0,fadeIn:"up",overrides:{initial:{rotate:45},animate:{rotate:0}},children:(a=s==null?void 0:s.widgetTrigger)!=null&&a.closeIcon?e.jsx("img",{src:s.widgetTrigger.closeIcon,alt:"Widget trigger close icon",style:{width:r.widgetTrigger.size.icon,height:r.widgetTrigger.size.icon}}):e.jsx(u.ChevronDownIcon,{style:{width:r.widgetTrigger.size.icon,height:r.widgetTrigger.size.icon}})},"x-icon"):e.jsx(f,{snapExit:!0,overrides:{initial:{rotate:45},animate:{rotate:0}},children:(i=s==null?void 0:s.widgetTrigger)!=null&&i.openIcon?e.jsx("img",{src:s.widgetTrigger.openIcon,alt:"Widget trigger open icon",style:{width:r.widgetTrigger.size.icon,height:r.widgetTrigger.size.icon}}):e.jsx(Ps,{style:{width:r.widgetTrigger.size.icon,height:r.widgetTrigger.size.icon},className:"mt-0.5 opacity-95"})},"message-icon")})})})})})]})}function Os(){const{dir:t}=l.useDocumentDir();return e.jsx(Q.Anchor,{style:{position:"fixed",bottom:0,right:t==="ltr"?0:void 0,left:t==="rtl"?0:void 0}})}function As(){const{isOpen:t,setIsOpen:o}=l.useWidgetTrigger();return e.jsxs(Q.Root,{open:t,onOpenChange:o,children:[e.jsx(Os,{}),e.jsx(Ws,{}),e.jsx(Es,{})]})}const Fs=[{key:"loading",component:Ht},{key:"fallback",component:Ft},{key:"bot_message",component:re},{key:"agent_message",component:re}],Hs={get:async t=>localStorage.getItem(t),set:async(t,o)=>{localStorage.setItem(t,o)},remove:async t=>{localStorage.removeItem(t)}};function qs({options:t,components:o=[],loadingComponent:s}){return e.jsx(l.WidgetProvider,{components:[...Fs,...o],options:t,storage:Hs,loadingComponent:s,children:e.jsx(l.WidgetTriggerProvider,{children:t.inline?e.jsx(vt,{}):e.jsx(As,{})})})}exports.Widget=qs;
51
51
  //# sourceMappingURL=index.cjs.map