@opencx/widget 3.0.57 → 3.0.58

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/designs.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react/jsx-runtime"),J=require("react"),sa=require("tinycolor2"),ge=require("framer-motion"),Ii=require("clsx"),de=require("lucide-react"),su=require("react-dropzone"),X=require("./useUploadFiles-BWQeisCa.cjs"),ou=require("@radix-ui/react-tooltip"),uu=require("@radix-ui/react-slot"),lu=require("@radix-ui/react-dropdown-menu"),cu=require("@radix-ui/react-dialog"),dr=require("react-dom"),du=require("@radix-ui/react-avatar"),Wn=require("zod"),hu=require("@radix-ui/react-popover");function kt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const xe=kt(J),tn=kt(ou),pe=kt(lu),He=kt(cu),Nt=kt(du),hr=kt(hu),pu=350,Si=400,Oi=600,Lr={widgetMinHeight:"min-h-[400px]",widgetMaxHeight:"max-h-[600px]",widgetHeight:"h-[600px]"},Li=({primary:e="hsl(0, 0%, 0%)"})=>{const t=sa(e).toHsl(),n=sa(e).isLight()?"240 10% 3.9%":"0 0% 100%";return{"--opencx-primary":`${t.h} ${t.s*100}% ${t.l*100}%`,"--opencx-primary-foreground":n,"--opencx-background":"0 0% 100%","--opencx-foreground":"240 10% 3.9%","--opencx-accent":"240 4.8% 95.9%","--opencx-accent-foreground":"240 5.9% 10%","--opencx-destructive":"0 84.2% 60.2%","--opencx-destructive-foreground":"0 0% 98%","--opencx-secondary":"240 4.8% 95.9%","--opencx-secondary-foreground":"240 5.9% 10%","--opencx-muted":"240 4.8% 95.9%","--opencx-muted-foreground":"240 3.8% 46.1%","--opencx-input":"240 5.9% 90%","--opencx-border":"240 5.9% 90%","--opencx-ring":"240 5.9% 10%"}},Rr="-",fu=e=>{const t=gu(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const u=s.split(Rr);return u[0]===""&&u.length!==1&&u.shift(),Ri(u,t)||mu(s)},getConflictingClassGroupIds:(s,u)=>{const l=n[s]||[];return u&&r[s]?[...l,...r[s]]:l}}},Ri=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?Ri(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(Rr);return(s=t.validators.find(({validator:u})=>u(i)))==null?void 0:s.classGroupId},oa=/^\[(.+)\]$/,mu=e=>{if(oa.test(e)){const t=oa.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},gu=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Eu(Object.entries(e.classGroups),n).forEach(([i,s])=>{pr(s,r,i,t)}),r},pr=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:ua(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(bu(a)){pr(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,s])=>{pr(s,ua(t,i),n,r)})})},ua=(e,t)=>{let n=e;return t.split(Rr).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},bu=e=>e.isThemeGetter,Eu=(e,t)=>t?e.map(([n,r])=>{const a=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,u])=>[t+s,u])):i);return[n,a]}):e,xu=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return a(i,s),s},set(i,s){n.has(i)?n.set(i,s):a(i,s)}}},Di="!",wu=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,a=t[0],i=t.length,s=u=>{const l=[];let c=0,d=0,h;for(let C=0;C<u.length;C++){let A=u[C];if(c===0){if(A===a&&(r||u.slice(C,C+i)===t)){l.push(u.slice(d,C)),d=C+i;continue}if(A==="/"){h=C;continue}}A==="["?c++:A==="]"&&c--}const b=l.length===0?u:u.substring(d),p=b.startsWith(Di),E=p?b.substring(1):b,y=h&&h>d?h-d:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:E,maybePostfixModifierPosition:y}};return n?u=>n({className:u,parseClassName:s}):s},Tu=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},yu=e=>({cache:xu(e.cacheSize),parseClassName:wu(e),...fu(e)}),_u=/\s+/,Au=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],s=e.trim().split(_u);let u="";for(let l=s.length-1;l>=0;l-=1){const c=s[l],{modifiers:d,hasImportantModifier:h,baseClassName:b,maybePostfixModifierPosition:p}=n(c);let E=!!p,y=r(E?b.substring(0,p):b);if(!y){if(!E){u=c+(u.length>0?" "+u:u);continue}if(y=r(b),!y){u=c+(u.length>0?" "+u:u);continue}E=!1}const C=Tu(d).join(":"),A=h?C+Di:C,O=A+y;if(i.includes(O))continue;i.push(O);const L=a(y,E);for(let P=0;P<L.length;++P){const H=L[P];i.push(A+H)}u=c+(u.length>0?" "+u:u)}return u};function Cu(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=vi(t))&&(r&&(r+=" "),r+=n);return r}const vi=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=vi(e[r]))&&(n&&(n+=" "),n+=t);return n};function ku(e,...t){let n,r,a,i=s;function s(l){const c=t.reduce((d,h)=>h(d),e());return n=yu(c),r=n.cache.get,a=n.cache.set,i=u,u(l)}function u(l){const c=r(l);if(c)return c;const d=Au(l,n);return a(l,d),d}return function(){return i(Cu.apply(null,arguments))}}const se=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Pi=/^\[(?:([a-z-]+):)?(.+)\]$/i,Nu=/^\d+\/\d+$/,Iu=new Set(["px","full","screen"]),Su=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ou=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Lu=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Ru=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Du=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Qe=e=>yt(e)||Iu.has(e)||Nu.test(e),Je=e=>It(e,"length",zu),yt=e=>!!e&&!Number.isNaN(Number(e)),Vn=e=>It(e,"number",yt),Ft=e=>!!e&&Number.isInteger(Number(e)),vu=e=>e.endsWith("%")&&yt(e.slice(0,-1)),W=e=>Pi.test(e),Ze=e=>Su.test(e),Pu=new Set(["length","size","percentage"]),Mu=e=>It(e,Pu,Mi),Bu=e=>It(e,"position",Mi),Fu=new Set(["image","url"]),Hu=e=>It(e,Fu,Yu),Uu=e=>It(e,"",ju),Ht=()=>!0,It=(e,t,n)=>{const r=Pi.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},zu=e=>Ou.test(e)&&!Lu.test(e),Mi=()=>!1,ju=e=>Ru.test(e),Yu=e=>Du.test(e),qu=()=>{const e=se("colors"),t=se("spacing"),n=se("blur"),r=se("brightness"),a=se("borderColor"),i=se("borderRadius"),s=se("borderSpacing"),u=se("borderWidth"),l=se("contrast"),c=se("grayscale"),d=se("hueRotate"),h=se("invert"),b=se("gap"),p=se("gradientColorStops"),E=se("gradientColorStopPositions"),y=se("inset"),C=se("margin"),A=se("opacity"),O=se("padding"),L=se("saturate"),P=se("scale"),H=se("sepia"),I=se("skew"),F=se("space"),j=se("translate"),G=()=>["auto","contain","none"],N=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto",W,t],M=()=>[W,t],te=()=>["",Qe,Je],ne=()=>["auto",yt,W],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],le=()=>["solid","dashed","dotted","double","none"],fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ae=()=>["start","end","center","between","around","evenly","stretch"],Ce=()=>["","0",W],w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ce=()=>[yt,W];return{cacheSize:500,separator:":",theme:{colors:[Ht],spacing:[Qe,Je],blur:["none","",Ze,W],brightness:ce(),borderColor:[e],borderRadius:["none","","full",Ze,W],borderSpacing:M(),borderWidth:te(),contrast:ce(),grayscale:Ce(),hueRotate:ce(),invert:Ce(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[vu,Je],inset:U(),margin:U(),opacity:ce(),padding:M(),saturate:ce(),scale:ce(),sepia:Ce(),skew:ce(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",W]}],container:["container"],columns:[{columns:[Ze]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...$(),W]}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:G()}],"overscroll-x":[{"overscroll-x":G()}],"overscroll-y":[{"overscroll-y":G()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ft,W]}],basis:[{basis:U()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",W]}],grow:[{grow:Ce()}],shrink:[{shrink:Ce()}],order:[{order:["first","last","none",Ft,W]}],"grid-cols":[{"grid-cols":[Ht]}],"col-start-end":[{col:["auto",{span:["full",Ft,W]},W]}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":[Ht]}],"row-start-end":[{row:["auto",{span:[Ft,W]},W]}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",W]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",W]}],gap:[{gap:[b]}],"gap-x":[{"gap-x":[b]}],"gap-y":[{"gap-y":[b]}],"justify-content":[{justify:["normal",...Ae()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Ae(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Ae(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[O]}],px:[{px:[O]}],py:[{py:[O]}],ps:[{ps:[O]}],pe:[{pe:[O]}],pt:[{pt:[O]}],pr:[{pr:[O]}],pb:[{pb:[O]}],pl:[{pl:[O]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[F]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[F]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",W,t]}],"min-w":[{"min-w":[W,t,"min","max","fit"]}],"max-w":[{"max-w":[W,t,"none","full","min","max","fit","prose",{screen:[Ze]},Ze]}],h:[{h:[W,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[W,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[W,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[W,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ze,Je]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Vn]}],"font-family":[{font:[Ht]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",W]}],"line-clamp":[{"line-clamp":["none",yt,Vn]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Qe,W]}],"list-image":[{"list-image":["none",W]}],"list-style-type":[{list:["none","disc","decimal",W]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[A]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[A]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Qe,Je]}],"underline-offset":[{"underline-offset":["auto",Qe,W]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",W]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",W]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[A]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$(),Bu]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Mu]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Hu]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[E]}],"gradient-via-pos":[{via:[E]}],"gradient-to-pos":[{to:[E]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[u]}],"border-w-x":[{"border-x":[u]}],"border-w-y":[{"border-y":[u]}],"border-w-s":[{"border-s":[u]}],"border-w-e":[{"border-e":[u]}],"border-w-t":[{"border-t":[u]}],"border-w-r":[{"border-r":[u]}],"border-w-b":[{"border-b":[u]}],"border-w-l":[{"border-l":[u]}],"border-opacity":[{"border-opacity":[A]}],"border-style":[{border:[...le(),"hidden"]}],"divide-x":[{"divide-x":[u]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[u]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[A]}],"divide-style":[{divide:le()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...le()]}],"outline-offset":[{"outline-offset":[Qe,W]}],"outline-w":[{outline:[Qe,Je]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[A]}],"ring-offset-w":[{"ring-offset":[Qe,Je]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ze,Uu]}],"shadow-color":[{shadow:[Ht]}],opacity:[{opacity:[A]}],"mix-blend":[{"mix-blend":[...fe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":fe()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ze,W]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[L]}],sepia:[{sepia:[H]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[A]}],"backdrop-saturate":[{"backdrop-saturate":[L]}],"backdrop-sepia":[{"backdrop-sepia":[H]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",W]}],duration:[{duration:ce()}],ease:[{ease:["linear","in","out","in-out",W]}],delay:[{delay:ce()}],animate:[{animate:["none","spin","ping","pulse","bounce",W]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[P]}],"scale-x":[{"scale-x":[P]}],"scale-y":[{"scale-y":[P]}],rotate:[{rotate:[Ft,W]}],"translate-x":[{"translate-x":[j]}],"translate-y":[{"translate-y":[j]}],"skew-x":[{"skew-x":[I]}],"skew-y":[{"skew-y":[I]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",W]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",W]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",W]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Qe,Je,Vn]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Wu=ku(qu);function V(...e){return Wu(Ii.clsx(e))}const Vu="[data-opencx-widget-content-root]";function Dr({fallbackHeight:e}){const t=J.useRef(null);return J.useEffect(()=>{const n=document.querySelector(Vu);if(n&&t.current){const r=t.current;let a;const i=new ResizeObserver(()=>{a=requestAnimationFrame(()=>{const s=Math.max(r.offsetHeight,e);n.style.setProperty("--opencx-widget-height",`${s.toFixed(1)}px`)})});return i.observe(r),()=>{cancelAnimationFrame(a),i.unobserve(r)}}},[e]),{observedElementRef:t}}const Gu=tn.Provider,Qu=tn.Root,Xu=tn.Trigger,Bi=xe.forwardRef(({className:e,sideOffset:t=4,...n},r)=>m.jsx(tn.Content,{ref:r,sideOffset:t,className:V("z-50 overflow-hidden max-w-xs rounded-xl bg-primary border text-primary-foreground p-2 text-center align-middle text-xs shadow-md 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",e),...n}));Bi.displayName=tn.Content.displayName;function Tn({children:e,content:t,side:n,align:r}){return t?m.jsxs(Qu,{children:[m.jsx(Xu,{asChild:!0,children:e}),m.jsx(Bi,{side:n,align:r,collisionPadding:8,avoidCollisions:!0,children:t})]}):e}const Ku={ok:"حسنا",yes:"نعم",no:"لا",agree:"موافق",cancel:"إلغاء","yes-exit":"نعم، اخرج","yes-reset":"نعم، إعادة تعيين","no-cancel":"لا، إلغاء","are-you-sure":"هل أنت متأكد؟",recording:"تسجيل","thank-you":"شكرا","sorry-try-again":"عذرا، حاول مرة أخرى","error-occurred":"حدث خطأ","please-try-again":"يرجى المحاولة مرة أخرى","write-a-message":"اكتب رسالة...","send-message":"إرسال رسالة",connected:"متصل",connecting:"جاري الاتصال",reconnecting:"جاري إعادة الاتصال",reconnected:"تم إعادة الاتصال",disconnecting:"جاري قطع الاتصال",disconnected:"قطع الاتصال",error:"خطأ","persist-session":"حفظ الجلسة",settings:"إعدادات",close:"إغلاق",help:"مساعدة",chat:"محادثة",send:"إرسال",copy:"نسخ",copied:"تم النسخ","sound-effects":"التاثيرات الصوتية",language:"اللغة",select:"اختر",agent:"الوكيل",user:"المستخدم",bot:"البوت","close-widget":"إغلاق الودجة","got-any-questions":"هل لديك أي أسئلة؟ تحدث معنا!","typical-response-time":"عادة ما نرد في أقل من دقيقة واحدة","session-closed-lead":"تم حل مشكلتك!",exit:"خروج","create-new-ticket":"إنشاء تذكرة جديدة","reset-conversation":"إعادة تعيين المحادثة","new-conversation":"محادثة جديدة","welcome-title":"مرحبًا بك في دردشة الدعم الخاصة بنا","welcome-description":"نحن هنا للمساعدة! ابدأ محادثة وسنرد عليك في أقرب وقت ممكن.","your-name":"اسمك","your-email":"عنوان بريدك الإلكتروني","start-chat":"تحدث إلى الدعم","starting-chat":"جاري الاتصال...","hello-greeting":"مرحبًا! كيف يمكننا مساعدتك اليوم؟","i-need-more-help":"أحتاج المزيد من المساعدة","this-was-helpful":"كان هذا مفيدًا",optional:"اختياري"},$u={ok:"OK",yes:"Ja",no:"Nein",agree:"Zustimmen",cancel:"Stornieren","yes-exit":"Ja, beenden","yes-reset":"Ja, zurücksetzen","no-cancel":"Nein, abbrechen","are-you-sure":"Sind Sie sicher?",recording:"Aufnahme läuft","thank-you":"Vielen Dank","sorry-try-again":"Entschuldigung, bitte versuchen Sie es erneut","error-occurred":"Ein Fehler ist aufgetreten","please-try-again":"Bitte versuchen Sie es erneut","write-a-message":"Nachricht schreiben...","send-message":"Nachricht senden",connected:"Verbunden",connecting:"Verbindung wird hergestellt",reconnecting:"Verbindung wird wiederhergestellt",reconnected:"Wieder verbunden",disconnecting:"Verbindung wird getrennt",disconnected:"Verbindung getrennt",error:"Fehler","persist-session":"Sitzung beibehalten",settings:"Einstellungen",close:"Schließen",help:"Hilfe",chat:"Chat",send:"Senden",copy:"Kopieren",copied:"Kopiert","sound-effects":"Soundeffekte",language:"Sprache",select:"Auswählen",agent:"Agent",user:"Benutzer",bot:"Bot","got-any-questions":"Haben Sie Fragen? Chatten Sie mit uns!","typical-response-time":"Üblicherweise antworten wir in weniger als 1 Minute","close-widget":"Widget schließen","session-closed-lead":"Ihr Problem wurde gelöst!","create-new-ticket":"Neues Ticket erstellen",exit:"Beenden","reset-conversation":"Konversation zurücksetzen","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...","hello-greeting":"Hallo! Wie können wir Ihnen heute helfen?","i-need-more-help":"Ich brauche weitere Hilfe","this-was-helpful":"Dies war hilfreich",optional:"Optional"},Ju={ok:"OK",yes:"Yes",no:"No",agree:"Agree",cancel:"Cancel","yes-exit":"Yes, exit","yes-reset":"Yes, reset","no-cancel":"No, cancel","are-you-sure":"Are you sure?",recording:"Recording...","thank-you":"Thank you","sorry-try-again":"Sorry, please try again","error-occurred":"An error occurred","please-try-again":"Please try again","write-a-message":"Write a message...","send-message":"Send message",connected:"Connected",connecting:"Connecting",reconnecting:"Reconnecting",reconnected:"Reconnected",disconnecting:"Disconnecting",disconnected:"Disconnected",error:"Error","persist-session":"Persist session",settings:"Settings",close:"Close",help:"Help",chat:"Chat",send:"Send",copy:"Copy",copied:"Copied","sound-effects":"Sound effects",language:"Language",select:"Select",agent:"Agent",user:"User",bot:"Bot","close-widget":"Close widget","got-any-questions":"Got any questions? Chat with us!","typical-response-time":"Typically respond in less than 1 minute","session-closed-lead":"Your issue has been resolved!","create-new-ticket":"Create new ticket",exit:"Exit","reset-conversation":"Reset conversation","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...","hello-greeting":"Hi there!","i-need-more-help":"I need more help","this-was-helpful":"This was helpful",optional:"Optional"},Zu={ok:"D'accord",yes:"Oui",no:"Non",agree:"Accepter",cancel:"Annuler","yes-exit":"Oui, quitter","yes-reset":"Oui, réinitialiser","no-cancel":"Non, annuler","are-you-sure":"Êtes-vous sûr ?",recording:"Enregistrement...","thank-you":"Merci","sorry-try-again":"Désolé, veuillez réessayer","error-occurred":"Une erreur s'est produite","please-try-again":"Veuillez réessayer","write-a-message":"Écrivez un message...","send-message":"Envoyer le message",connected:"Connecté",connecting:"Connexion en cours",reconnecting:"Reconnexion en cours",reconnected:"Reconnecté",disconnecting:"Déconnexion en cours",disconnected:"Déconnecté",error:"Erreur","persist-session":"Conserver la session",settings:"Paramètres",close:"Fermer",help:"Aide",chat:"Chat",send:"Envoyer",copy:"Copier",copied:"Copié","sound-effects":"Effets sonores",language:"Langue",select:"Sélectionner",agent:"Agent",user:"Utilisateur",bot:"Bot","close-widget":"Fermer le widget","got-any-questions":"Vous avez des questions ? Chattez avec nous !","typical-response-time":"Nous répondons généralement en moins d'une minute","session-closed-lead":"Votre problème a été résolu !","create-new-ticket":"Créer un nouveau ticket",exit:"Sortie","reset-conversation":"Réinitialiser la conversation","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...","hello-greeting":"Bonjour ! Comment pouvons-nous vous aider aujourd'hui ?","i-need-more-help":"Je besoin d'aide plus","this-was-helpful":"C'était utile",optional:"Optionnel"},el={ok:"OK",yes:"Ja",no:"Nee",agree:"Akkoord",cancel:"Annuleren","yes-exit":"Ja, afsluiten","yes-reset":"Ja, resetten","no-cancel":"Nee, annuleren","are-you-sure":"Weet u het zeker?",recording:"Opname...","thank-you":"Dank u","sorry-try-again":"Sorry, probeer het opnieuw","error-occurred":"Er is een fout opgetreden","please-try-again":"Probeer het opnieuw","write-a-message":"Schrijf een bericht...","send-message":"Bericht verzenden",connected:"Verbonden",connecting:"Verbinding maken",reconnecting:"Opnieuw verbinding maken",reconnected:"Opnieuw verbonden",disconnecting:"Verbinding verbreken",disconnected:"Verbinding verbroken",error:"Fout","persist-session":"Sessie behouden",settings:"Instellingen",close:"Sluiten",help:"Help",chat:"Chat",send:"Verzenden",copy:"Kopiëren",copied:"Gekopieerd","sound-effects":"Geluidseffecten",language:"Taal",select:"Selecteren",agent:"Agent",user:"Gebruiker",bot:"Bot","close-widget":"Widget sluiten","got-any-questions":"Heeft u vragen? Chat met ons!","typical-response-time":"We reageren doorgaans binnen 1 minuut","session-closed-lead":"Uw probleem is opgelost!","create-new-ticket":"Nieuw ticket aanmaken",exit:"Afsluiten","reset-conversation":"Gesprek resetten","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...","hello-greeting":"Hallo! Hoe kunnen we u vandaag helpen?","i-need-more-help":"Ik heb nog meer hulp nodig","this-was-helpful":"Mijn vraag is opgelost",optional:"Optioneel"},tl={ok:"OK",yes:"Sim",no:"Não",agree:"Concordo",cancel:"Cancelar","yes-exit":"Sim, sair","yes-reset":"Sim, redefinir","no-cancel":"Não, cancelar","are-you-sure":"Você tem certeza?",recording:"Gravando...","thank-you":"Obrigado","sorry-try-again":"Desculpe, tente novamente","error-occurred":"Ocorreu um erro","please-try-again":"Por favor, tente novamente","write-a-message":"Escreva uma mensagem...","send-message":"Enviar mensagem",connected:"Conectado",connecting:"Conectando",reconnecting:"Reconectando",reconnected:"Reconectado",disconnecting:"Desconectando",disconnected:"Desconectado",error:"Erro","persist-session":"Persistir sessão",settings:"Configurações",close:"Fechar",help:"Ajuda",chat:"Bate-papo",send:"Enviar",copy:"Copiar",copied:"Copiado","sound-effects":"Efeitos sonoros",language:"Idioma",select:"Selecionar",agent:"Agente",user:"Usuário",bot:"Bot","close-widget":"Fechar widget","got-any-questions":"Tem alguma dúvida? Converse conosco!","typical-response-time":"Geralmente respondemos em menos de 1 minuto","session-closed-lead":"Seu problema foi resolvido!","create-new-ticket":"Criar novo ticket",exit:"Sair","reset-conversation":"Redefinir conversa","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...","hello-greeting":"Olá! Como podemos ajudar você hoje?","i-need-more-help":"preciso de mais ajuda","this-was-helpful":"Isso foi útil",optional:"Opcional"},Fi={en:Ju,ar:Ku,nl:el,fr:Zu,de:$u,pt:tl},nl=Object.keys(Fi),rl=e=>nl.includes(e);function al(e,t){const n=Fi[t];return n&&n[e]||""}function St(){const{widgetCtx:{config:e}}=X.useWidget();return J.useMemo(()=>{const n=rl(e.language)?e.language:"en";return{get:r=>al(r,n),lang:n}},[e.language])}const il=10,sl=(e,t)=>({initial:{opacity:0,x:-e,...t.initial},animate:{opacity:1,x:0,...t.animate},exit:{opacity:0,x:e,...t.exit}}),ol=(e,t)=>({initial:{opacity:0,x:e,...t.initial},animate:{opacity:1,x:0,...t.animate},exit:{opacity:0,x:-e,...t.exit}}),ul=(e,t)=>({initial:{opacity:0,y:e,...t.initial},animate:{opacity:1,y:0,...t.animate},exit:{opacity:0,y:-e,...t.exit}}),ll=(e,t)=>({initial:{opacity:0,y:-e,...t.initial},animate:{opacity:1,y:0,...t.animate},exit:{opacity:0,y:e,...t.exit}}),cl={right:sl,left:ol,up:ul,down:ll},ue=J.forwardRef(({fadeIn:e="down",distance:t=il,children:n,snapExit:r=!1,overrides:a={},...i},s)=>{const u=e?cl[e](t,a):{};return r&&u.exit&&typeof u.exit=="object"&&!Array.isArray(u.exit)&&(u.exit.transition={duration:0}),m.jsx(ge.motion.div,{ref:s,...i,...u,children:n})});ue.displayName="MotionDiv";const la=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,ca=Ii.clsx,dl=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return ca(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:i}=t,s=Object.keys(a).map(c=>{const d=n==null?void 0:n[c],h=i==null?void 0:i[c];if(d===null)return null;const b=la(d)||la(h);return a[c][b]}),u=n&&Object.entries(n).reduce((c,d)=>{let[h,b]=d;return b===void 0||(c[h]=b),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:h,className:b,...p}=d;return Object.entries(p).every(E=>{let[y,C]=E;return Array.isArray(C)?C.includes({...i,...u}[y]):{...i,...u}[y]===C})?[...c,h,b]:c},[]);return ca(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},da={x:2,y:2},hl={1:"scale-[1]","1.01":"scale-[1.01]","1.02":"scale-[1.02]","1.1":"scale-[1.1]"},rt=J.memo(J.forwardRef(({children:e,className:t,scale:n="1.02",off:r=!1},a)=>{const[i,s]=J.useState(!1),[u,l]=J.useState({x:0,y:0});if(r||/translate/.test(e.props.className||""))return e;const d=E=>{var j,G;const{clientX:y,clientY:C}=E,A=E.currentTarget.getBoundingClientRect(),O=y-(A.left+A.width/2),L=C-(A.top+A.height/2),P=Math.max(-1,Math.min(1,O/(A.width/2))),H=Math.max(-1,Math.min(1,L/(A.height/2))),I=P*da.x,F=H*da.y;l({x:I,y:F}),(G=(j=e.props).onMouseMove)==null||G.call(j,E)},h=()=>{var E,y;s(!0),(y=(E=e.props).onMouseEnter)==null||y.call(E)},b=()=>{var E,y;s(!1),l({x:0,y:0}),(y=(E=e.props).onMouseLeave)==null||y.call(E)},p={"--opencx-wobble-x":i?`${u.x}px`:"0px","--opencx-wobble-y":i?`${u.y}px`:"0px"};return J.cloneElement(e,{ref:a,onMouseMove:d,onMouseEnter:h,onMouseLeave:b,style:{...p,...e.props.style},className:V("translate-x-[var(--opencx-wobble-x)]","translate-y-[var(--opencx-wobble-y)]",`hover:${hl[n]}`,t,e.props.className,"transition-all ease-out")})}));rt.displayName="Wobble";const pl=dl(V("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","shadow-sm active:shadow-none active:scale-95 hover:active:scale-95","rounded-xl","border","transition"),{variants:{variant:{default:"border-primary bg-primary text-primary-foreground",destructive:"border-destructive bg-destructive text-destructive-foreground",outline:"bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground",ghost:"border-transparent shadow-none hover:bg-accent hover:text-accent-foreground",link:"border-transparent shadow-none text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-8 px-3 text-xs",lg:"min-h-12 px-4",icon:"h-10 w-10",fit:"size-fit p-2",free:"p-2"}},defaultVariants:{variant:"default",size:"default"}}),Le=xe.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},i)=>{const s=r?uu.Slot:"button";return m.jsx(rt,{ref:i,children:m.jsx(s,{className:V(pl({variant:t,size:n,className:e})),...a})})});Le.displayName="Button";const Sn=()=>{const[e,t]=J.useState("ltr");return J.useEffect(()=>{const n=()=>{typeof document>"u"||t(window.getComputedStyle(document.body).direction)};n();const r=new MutationObserver(n);return r.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]}),r.observe(document.body,{attributes:!0,attributeFilter:["dir"]}),window.addEventListener("languagechange",n),()=>{r.disconnect(),window.removeEventListener("languagechange",n)}},[]),e};function fl(){const{sendMessage:e}=X.useMessages(),t=St(),n=[t.get("i-need-more-help"),t.get("this-was-helpful")],r=a=>{const i=a.trim();i&&e({content:i})};return m.jsx("div",{className:"flex items-center gap-2 p-2 pb-0 flex-wrap",children:n.map(a=>m.jsx(Le,{onClick:()=>r(a),className:"flex-1 rounded-full",size:"sm",children:a},a))})}function ml({file:{status:e,file:t,error:n},onCancel:r}){const[a,i]=J.useState(null);J.useEffect(()=>{if(!t.type.startsWith("image/"))return;const l=new FileReader;return l.onload=()=>i(l.result),l.onerror=()=>console.error("Error reading file"),l.readAsDataURL(t),()=>l.abort()},[t]);const s=()=>{switch(e){case"uploading":return m.jsx(de.Loader2,{className:"size-4 animate-spin"});case"error":return m.jsx(de.AlertCircle,{className:"size-4 text-destructive"});default:return null}},u=()=>{const l=t.type.split("/")[0];return l==="image"&&a?m.jsx("img",{src:typeof a=="string"?a:"",className:"object-cover bg-secondary size-full",alt:t.name}):l==="audio"?m.jsx(de.FileAudio2Icon,{}):l==="video"?m.jsx(de.FileVideo2Icon,{}):m.jsx(de.FileIcon,{})};return m.jsx(Tn,{side:"bottom",content:e==="error"?m.jsxs("span",{className:"text-destructive",children:["Failed to upload: ",n]}):t.name,children:m.jsxs("div",{className:V(e==="uploading"&&"opacity-50","group","size-12 border rounded-2xl overflow-hidden relative","flex items-center justify-center shrink-0"),children:[m.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:s()}),m.jsx("button",{type:"button",className:V("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:m.jsx(de.XIcon,{className:"size-4 text-primary-foreground"})}),m.jsx(u,{})]})})}const ha=V("rounded-3xl");function gl(){var I;const e=J.useRef(null),{sendMessage:t}=X.useMessages(),{sessionState:n}=X.useSessions(),r=St(),a=Sn(),[i,s]=J.useState(""),{allFiles:u,emptyTheFiles:l,handleCancelUpload:c,appendFiles:d,isUploading:h,successFiles:b}=X.useUploadFiles(),p=!!((I=n.session)!=null&&I.isHandedOff),{isAwaitingBotReply:E}=X.useIsAwaitingBotReply(),y=F=>{p&&d(F)},C=!i.trim()&&b.length===0,A=async()=>{if(E||C)return;h&&console.info("please wait for the file(s) to upload");const F=i.trim();t({content:F,attachments:b.flatMap(j=>j.fileUrl?[{url:j.fileUrl,type:j.file.type,name:j.file.name,id:j.id,size:j.file.size}]:[])}),s(""),l()},{getRootProps:O,getInputProps:L,open:P}=su.useDropzone({onDrop:y,noClick:!0,onDropRejected(){p&&console.error("unsupported file type, or the file is too large")},maxSize:5*1024*1024,accept:{"text/*":[".txt"],"image/*":[".png",".jpg",".jpeg",".gif"],"application/pdf":[".pdf"]}}),H=F=>{const j=F.clipboardData;j&&j.files.length>0&&y(Array.from(j.files))};return m.jsxs("div",{className:"p-2 relative space-y-1",...O(),children:[m.jsx("input",{...L()}),m.jsxs("div",{className:V(ha,"relative space-y-2 border transition-all shadow py-2"),children:[m.jsx("div",{className:"flex items-center gap-1 px-2",children:m.jsx(ge.AnimatePresence,{mode:"popLayout",children:u.map(F=>m.jsx(ue,{snapExit:!0,children:m.jsx(ml,{onCancel:()=>c(F.id),file:F})},F.id))})}),m.jsx("textarea",{onPaste:H,ref:e,id:"chat-input",dir:a,value:i,rows:3,className:V(ha,"w-full resize-none px-3","text-sm rtl:placeholder:text-right bg-transparent outline-none"),onChange:F=>s(F.target.value),onKeyDown:async F=>{F.key==="Enter"&&!F.shiftKey&&(F.preventDefault(),A())},placeholder:r.get("write-a-message")}),m.jsxs("div",{dir:a,className:"px-2 flex justify-between rtl:text-right",children:[m.jsx(Tn,{side:"top",align:"start",content:"attach files, (maximum size 5mb)",children:m.jsx(Le,{onClick:()=>{p&&P()},size:"fit",variant:"outline",className:V("disabled:opacity-0","rounded-full size-8 flex items-center justify-center p-0"),disabled:!p,children:m.jsx(de.PaperclipIcon,{className:"size-4"})})}),m.jsx(Tn,{content:"send message",side:"top",align:"end",children:m.jsx(Le,{size:"fit",onClick:A,disabled:E||h||C,className:"rounded-full size-8 flex items-center justify-center p-0",children:m.jsx(ge.AnimatePresence,{mode:"wait",children:E||h?m.jsx(ue,{snapExit:!0,children:m.jsx(de.CircleDashed,{className:"size-4 animate-spin animate-iteration-infinite"})},"loading"):m.jsx(ue,{snapExit:!0,children:m.jsx(de.SendHorizonal,{className:"size-4 rtl:-scale-100"})},"send")})})})]})]})]})}function bl(){const{widgetCtx:e}=X.useWidget(),t=St();return m.jsx("div",{className:"p-2",children:m.jsxs("div",{className:"p-2 bg-background rounded-3xl border shadow-2xl space-y-2",children:[m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx(de.CheckCheckIcon,{className:"size-4 text-emerald-500"}),m.jsx("h2",{className:"text-sm font-medium",dir:"auto",children:t.get("session-closed-lead")})]}),m.jsx("div",{children:m.jsx(Le,{onClick:e.resetChat,className:"rounded-2xl w-full",children:t.get("new-conversation")})})]})})}function El(){var s,u,l;const{sessionState:e}=X.useSessions(),{messagesState:t,sendMessage:n}=X.useMessages(),a=(u=(s=X.usePreludeData().data)==null?void 0:s.data)==null?void 0:u.initialQuestions,i=t.messages.length===0;return m.jsx("footer",{children:m.jsx("div",{children:m.jsx(ge.AnimatePresence,{mode:"wait",children:e.session&&!((l=e.session)!=null&&l.isOpened)?m.jsx(ue,{className:"overflow-hidden",overrides:{initial:{height:0},animate:{height:"auto"},exit:{height:0}},children:m.jsx(bl,{})},"session-closed"):m.jsxs(ue,{className:"overflow-hidden",overrides:{initial:{height:0},animate:{height:"auto"},exit:{height:0}},children:[t.lastAIResMightSolveUserIssue&&m.jsx(fl,{}),i&&a&&m.jsx("div",{className:"flex items-center flex-row justify-end gap-2 flex-wrap px-2",children:a==null?void 0:a.map(c=>m.jsx(Le,{dir:"auto",variant:"outline",size:"sm",onClick:()=>{n({content:c})},children:c},c))}),m.jsx(gl,{})]},"chat-input")})})})}const xl=pe.Root,wl=pe.Trigger,Tl=pe.Group,yl=xe.forwardRef(({className:e,inset:t,children:n,...r},a)=>m.jsxs(pe.SubTrigger,{ref:a,className:V("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r,children:[n,m.jsx(de.ChevronRight,{className:"ml-auto"})]}));yl.displayName=pe.SubTrigger.displayName;const _l=xe.forwardRef(({className:e,...t},n)=>m.jsx(pe.SubContent,{ref:n,className:V("z-50 min-w-[8rem] overflow-hidden rounded-2xl border bg-background p-1 text-foreground shadow-2xl data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));_l.displayName=pe.SubContent.displayName;const Hi=xe.forwardRef(({className:e,sideOffset:t=4,...n},r)=>m.jsx(pe.Content,{ref:r,sideOffset:t,className:V("z-50 min-w-[8rem] overflow-hidden rounded-2xl border bg-background p-1 text-foreground shadow-2xl","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));Hi.displayName=pe.Content.displayName;const Ui=xe.forwardRef(({className:e,inset:t,...n},r)=>m.jsx(ue,{children:m.jsx(pe.Item,{ref:r,className:V("relative flex cursor-default select-none items-center gap-2 rounded-xl px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...n})}));Ui.displayName=pe.Item.displayName;const Al=xe.forwardRef(({className:e,children:t,checked:n,...r},a)=>m.jsxs(pe.CheckboxItem,{ref:a,className:V("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(pe.ItemIndicator,{children:m.jsx(de.Check,{className:"h-4 w-4"})})}),t]}));Al.displayName=pe.CheckboxItem.displayName;const Cl=xe.forwardRef(({className:e,children:t,...n},r)=>m.jsxs(pe.RadioItem,{ref:r,className:V("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(pe.ItemIndicator,{children:m.jsx(de.Circle,{className:"h-2 w-2 fill-current"})})}),t]}));Cl.displayName=pe.RadioItem.displayName;const kl=xe.forwardRef(({className:e,inset:t,...n},r)=>m.jsx(pe.Label,{ref:r,className:V("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));kl.displayName=pe.Label.displayName;const Nl=xe.forwardRef(({className:e,...t},n)=>m.jsx(pe.Separator,{ref:n,className:V("-mx-1 my-1 h-px bg-muted",e),...t}));Nl.displayName=pe.Separator.displayName;function zi({className:e,...t}){return m.jsx("div",{className:V("animate-pulse rounded-md bg-secondary",e),...t})}function Il(){const e=St(),[t,n]=J.useState(!1),{toChatScreen:r}=X.useWidgetRouter();return m.jsxs(xl,{open:t,onOpenChange:n,children:[m.jsx(wl,{asChild:!0,children:m.jsx(Le,{variant:"ghost",size:"fit",className:"rounded-full",children:m.jsx(de.EllipsisVerticalIcon,{className:"size-4"})})}),m.jsx(Hi,{align:"end",className:"min-w-56",children:m.jsx(Tl,{children:m.jsxs(Ui,{onSelect:()=>{n(!1),r()},children:[m.jsx(ge.motion.div,{initial:{opacity:0,x:-4,rotate:360},animate:{opacity:1,x:0,rotate:0},children:m.jsx(de.MessageCirclePlusIcon,{})}),e.get("new-conversation")]})})})]})}function ji(){var i,s;const{routerState:{screen:e},toSessionsScreen:t}=X.useWidgetRouter(),{data:n,isLoading:r}=X.usePreludeData(),a=Sn();return m.jsx("header",{className:"p-2 border-b bg-background",children:m.jsxs("div",{dir:a,className:"flex items-center rtl:flex-row-reverse gap-2",children:[e==="chat"&&m.jsx(Le,{variant:"ghost",size:"fit",className:"rounded-full",onClick:t,children:m.jsx(de.ChevronLeftIcon,{className:"size-4"})}),m.jsx("div",{className:V("flex-1",e==="sessions"&&"pl-2"),children:m.jsx(ge.AnimatePresence,{mode:"wait",children:r||!((i=n==null?void 0:n.data)!=null&&i.organizationName)?m.jsx(ue,{snapExit:!0,children:m.jsx(zi,{className:"h-5 w-1/2"})},"skeleton"):m.jsx(ue,{children:m.jsx("h2",{className:"font-semibold",children:(s=n==null?void 0:n.data)==null?void 0:s.organizationName})},"organization-name")})}),m.jsx(Il,{})]})})}function Sl(e){const t=[];let n=null;return e.forEach(r=>{var a,i,s,u;(!n||((a=n[0])==null?void 0:a.type)!==r.type)&&(n=[],t.push(n)),((i=n[0])==null?void 0:i.type)==="FROM_AGENT"&&r.type==="FROM_AGENT"&&((s=r.agent)==null?void 0:s.id)!==((u=n[0].agent)==null?void 0:u.id)&&(n=[],t.push(n)),n.push(r)}),t}function Ol(e){var t;return((t=e==null?void 0:e[0])==null?void 0:t.type)==="FROM_USER"}function Ll(e){var t;return((t=e==null?void 0:e[0])==null?void 0:t.type)==="FROM_BOT"}function Rl(e){var t;return((t=e==null?void 0:e[0])==null?void 0:t.type)==="FROM_AGENT"}function pa(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}const ke=it(/[A-Za-z]/),Te=it(/[\dA-Za-z]/),Dl=it(/[#-'*+\--9=?A-Z^-~]/);function yn(e){return e!==null&&(e<32||e===127)}const fr=it(/\d/),vl=it(/[\dA-Fa-f]/),Pl=it(/[!-/:-@[-`{-~]/);function z(e){return e!==null&&e<-2}function ae(e){return e!==null&&(e<0||e===32)}function K(e){return e===-2||e===-1||e===32}const On=it(new RegExp("\\p{P}|\\p{S}","u")),pt=it(/\s/);function it(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ml(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const Ln=function(e){if(e==null)return Ul;if(typeof e=="function")return Rn(e);if(typeof e=="object")return Array.isArray(e)?Bl(e):Fl(e);if(typeof e=="string")return Hl(e);throw new Error("Expected function, string, or object as test")};function Bl(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ln(e[n]);return Rn(r);function r(...a){let i=-1;for(;++i<t.length;)if(t[i].apply(this,a))return!0;return!1}}function Fl(e){const t=e;return Rn(n);function n(r){const a=r;let i;for(i in e)if(a[i]!==t[i])return!1;return!0}}function Hl(e){return Rn(t);function t(n){return n&&n.type===e}}function Rn(e){return t;function t(n,r,a){return!!(zl(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function Ul(){return!0}function zl(e){return e!==null&&typeof e=="object"&&"type"in e}const Yi=[],jl=!0,mr=!1,Yl="skip";function qi(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const i=Ln(a),s=r?-1:1;u(e,void 0,[])();function u(l,c,d){const h=l&&typeof l=="object"?l:{};if(typeof h.type=="string"){const p=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return b;function b(){let p=Yi,E,y,C;if((!t||i(l,c,d[d.length-1]||void 0))&&(p=ql(n(l,d)),p[0]===mr))return p;if("children"in l&&l.children){const A=l;if(A.children&&p[0]!==Yl)for(y=(r?A.children.length:-1)+s,C=d.concat(A);y>-1&&y<A.children.length;){const O=A.children[y];if(E=u(O,y,C)(),E[0]===mr)return E;y=typeof E[1]=="number"?E[1]:y+s}}return p}}}function ql(e){return Array.isArray(e)?e:typeof e=="number"?[jl,e]:e==null?Yi:[e]}function Wl(e,t,n){const a=Ln((n||{}).ignore||[]),i=Vl(t);let s=-1;for(;++s<i.length;)qi(e,"text",u);function u(c,d){let h=-1,b;for(;++h<d.length;){const p=d[h],E=b?b.children:void 0;if(a(p,E?E.indexOf(p):void 0,b))return;b=p}if(b)return l(c,d)}function l(c,d){const h=d[d.length-1],b=i[s][0],p=i[s][1];let E=0;const C=h.children.indexOf(c);let A=!1,O=[];b.lastIndex=0;let L=b.exec(c.value);for(;L;){const P=L.index,H={index:L.index,input:L.input,stack:[...d,c]};let I=p(...L,H);if(typeof I=="string"&&(I=I.length>0?{type:"text",value:I}:void 0),I===!1?b.lastIndex=P+1:(E!==P&&O.push({type:"text",value:c.value.slice(E,P)}),Array.isArray(I)?O.push(...I):I&&O.push(I),E=P+L[0].length,A=!0),!b.global)break;L=b.exec(c.value)}return A?(E<c.value.length&&O.push({type:"text",value:c.value.slice(E)}),h.children.splice(C,1,...O)):O=[c],C+O.length}}function Vl(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const a=n[r];t.push([Gl(a[0]),Ql(a[1])])}return t}function Gl(e){return typeof e=="string"?new RegExp(Ml(e),"g"):e}function Ql(e){return typeof e=="function"?e:function(){return e}}const Gn="phrasing",Qn=["autolink","link","image","label"];function Xl(){return{transforms:[nc],enter:{literalAutolink:$l,literalAutolinkEmail:Xn,literalAutolinkHttp:Xn,literalAutolinkWww:Xn},exit:{literalAutolink:tc,literalAutolinkEmail:ec,literalAutolinkHttp:Jl,literalAutolinkWww:Zl}}}function Kl(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Gn,notInConstruct:Qn},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Gn,notInConstruct:Qn},{character:":",before:"[ps]",after:"\\/",inConstruct:Gn,notInConstruct:Qn}]}}function $l(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Xn(e){this.config.enter.autolinkProtocol.call(this,e)}function Jl(e){this.config.exit.autolinkProtocol.call(this,e)}function Zl(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function ec(e){this.config.exit.autolinkEmail.call(this,e)}function tc(e){this.exit(e)}function nc(e){Wl(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,rc],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),ac]],{ignore:["link","linkReference"]})}function rc(e,t,n,r,a){let i="";if(!Wi(a)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!ic(n)))return!1;const s=sc(n+r);if(!s[0])return!1;const u={type:"link",title:null,url:i+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[u,{type:"text",value:s[1]}]:u}function ac(e,t,n,r){return!Wi(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function ic(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function sc(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const a=pa(e,"(");let i=pa(e,")");for(;r!==-1&&a>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}function Wi(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||pt(n)||On(n))&&(!t||n!==47)}function Fe(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}Vi.peek=bc;function oc(){return{enter:{gfmFootnoteDefinition:lc,gfmFootnoteDefinitionLabelString:cc,gfmFootnoteCall:pc,gfmFootnoteCallString:fc},exit:{gfmFootnoteDefinition:hc,gfmFootnoteDefinitionLabelString:dc,gfmFootnoteCall:gc,gfmFootnoteCallString:mc}}}function uc(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:Ec,footnoteReference:Vi}}}function lc(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function cc(){this.buffer()}function dc(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=Fe(this.sliceSerialize(e)).toLowerCase()}function hc(e){this.exit(e)}function pc(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function fc(){this.buffer()}function mc(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=Fe(this.sliceSerialize(e)).toLowerCase()}function gc(e){this.exit(e)}function Vi(e,t,n,r){const a=n.createTracker(r);let i=a.move("[^");const s=n.enter("footnoteReference"),u=n.enter("reference");return i+=a.move(n.safe(n.associationId(e),{...a.current(),before:i,after:"]"})),u(),s(),i+=a.move("]"),i}function bc(){return"["}function Ec(e,t,n,r){const a=n.createTracker(r);let i=a.move("[^");const s=n.enter("footnoteDefinition"),u=n.enter("label");return i+=a.move(n.safe(n.associationId(e),{...a.current(),before:i,after:"]"})),u(),i+=a.move("]:"+(e.children&&e.children.length>0?" ":"")),a.shift(4),i+=a.move(n.indentLines(n.containerFlow(e,a.current()),xc)),s(),i}function xc(e,t,n){return t===0?e:(n?"":" ")+e}const wc=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Gi.peek=Cc;function Tc(){return{canContainEols:["delete"],enter:{strikethrough:_c},exit:{strikethrough:Ac}}}function yc(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:wc}],handlers:{delete:Gi}}}function _c(e){this.enter({type:"delete",children:[]},e)}function Ac(e){this.exit(e)}function Gi(e,t,n,r){const a=n.createTracker(r),i=n.enter("strikethrough");let s=a.move("~~");return s+=n.containerPhrasing(e,{...a.current(),before:s,after:"~"}),s+=a.move("~~"),i(),s}function Cc(){return"~"}function kc(e,t={}){const n=(t.align||[]).concat(),r=t.stringLength||Ic,a=[],i=[],s=[],u=[];let l=0,c=-1;for(;++c<e.length;){const E=[],y=[];let C=-1;for(e[c].length>l&&(l=e[c].length);++C<e[c].length;){const A=Nc(e[c][C]);if(t.alignDelimiters!==!1){const O=r(A);y[C]=O,(u[C]===void 0||O>u[C])&&(u[C]=O)}E.push(A)}i[c]=E,s[c]=y}let d=-1;if(typeof n=="object"&&"length"in n)for(;++d<l;)a[d]=fa(n[d]);else{const E=fa(n);for(;++d<l;)a[d]=E}d=-1;const h=[],b=[];for(;++d<l;){const E=a[d];let y="",C="";E===99?(y=":",C=":"):E===108?y=":":E===114&&(C=":");let A=t.alignDelimiters===!1?1:Math.max(1,u[d]-y.length-C.length);const O=y+"-".repeat(A)+C;t.alignDelimiters!==!1&&(A=y.length+A+C.length,A>u[d]&&(u[d]=A),b[d]=A),h[d]=O}i.splice(1,0,h),s.splice(1,0,b),c=-1;const p=[];for(;++c<i.length;){const E=i[c],y=s[c];d=-1;const C=[];for(;++d<l;){const A=E[d]||"";let O="",L="";if(t.alignDelimiters!==!1){const P=u[d]-(y[d]||0),H=a[d];H===114?O=" ".repeat(P):H===99?P%2?(O=" ".repeat(P/2+.5),L=" ".repeat(P/2-.5)):(O=" ".repeat(P/2),L=O):L=" ".repeat(P)}t.delimiterStart!==!1&&!d&&C.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&A==="")&&(t.delimiterStart!==!1||d)&&C.push(" "),t.alignDelimiters!==!1&&C.push(O),C.push(A),t.alignDelimiters!==!1&&C.push(L),t.padding!==!1&&C.push(" "),(t.delimiterEnd!==!1||d!==l-1)&&C.push("|")}p.push(t.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return p.join(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react/jsx-runtime"),J=require("react"),sa=require("tinycolor2"),ge=require("framer-motion"),Ii=require("clsx"),de=require("lucide-react"),su=require("react-dropzone"),X=require("./useUploadFiles-YqK_0IBo.cjs"),ou=require("@radix-ui/react-tooltip"),uu=require("@radix-ui/react-slot"),lu=require("@radix-ui/react-dropdown-menu"),cu=require("@radix-ui/react-dialog"),dr=require("react-dom"),du=require("@radix-ui/react-avatar"),Wn=require("zod"),hu=require("@radix-ui/react-popover");function kt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const xe=kt(J),tn=kt(ou),pe=kt(lu),He=kt(cu),Nt=kt(du),hr=kt(hu),pu=350,Si=400,Oi=600,Lr={widgetMinHeight:"min-h-[400px]",widgetMaxHeight:"max-h-[600px]",widgetHeight:"h-[600px]"},Li=({primary:e="hsl(0, 0%, 0%)"})=>{const t=sa(e).toHsl(),n=sa(e).isLight()?"240 10% 3.9%":"0 0% 100%";return{"--opencx-primary":`${t.h} ${t.s*100}% ${t.l*100}%`,"--opencx-primary-foreground":n,"--opencx-background":"0 0% 100%","--opencx-foreground":"240 10% 3.9%","--opencx-accent":"240 4.8% 95.9%","--opencx-accent-foreground":"240 5.9% 10%","--opencx-destructive":"0 84.2% 60.2%","--opencx-destructive-foreground":"0 0% 98%","--opencx-secondary":"240 4.8% 95.9%","--opencx-secondary-foreground":"240 5.9% 10%","--opencx-muted":"240 4.8% 95.9%","--opencx-muted-foreground":"240 3.8% 46.1%","--opencx-input":"240 5.9% 90%","--opencx-border":"240 5.9% 90%","--opencx-ring":"240 5.9% 10%"}},Rr="-",fu=e=>{const t=gu(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const u=s.split(Rr);return u[0]===""&&u.length!==1&&u.shift(),Ri(u,t)||mu(s)},getConflictingClassGroupIds:(s,u)=>{const l=n[s]||[];return u&&r[s]?[...l,...r[s]]:l}}},Ri=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?Ri(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(Rr);return(s=t.validators.find(({validator:u})=>u(i)))==null?void 0:s.classGroupId},oa=/^\[(.+)\]$/,mu=e=>{if(oa.test(e)){const t=oa.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},gu=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Eu(Object.entries(e.classGroups),n).forEach(([i,s])=>{pr(s,r,i,t)}),r},pr=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:ua(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(bu(a)){pr(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,s])=>{pr(s,ua(t,i),n,r)})})},ua=(e,t)=>{let n=e;return t.split(Rr).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},bu=e=>e.isThemeGetter,Eu=(e,t)=>t?e.map(([n,r])=>{const a=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,u])=>[t+s,u])):i);return[n,a]}):e,xu=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return a(i,s),s},set(i,s){n.has(i)?n.set(i,s):a(i,s)}}},Di="!",wu=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,a=t[0],i=t.length,s=u=>{const l=[];let c=0,d=0,h;for(let C=0;C<u.length;C++){let A=u[C];if(c===0){if(A===a&&(r||u.slice(C,C+i)===t)){l.push(u.slice(d,C)),d=C+i;continue}if(A==="/"){h=C;continue}}A==="["?c++:A==="]"&&c--}const b=l.length===0?u:u.substring(d),p=b.startsWith(Di),E=p?b.substring(1):b,y=h&&h>d?h-d:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:E,maybePostfixModifierPosition:y}};return n?u=>n({className:u,parseClassName:s}):s},Tu=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},yu=e=>({cache:xu(e.cacheSize),parseClassName:wu(e),...fu(e)}),_u=/\s+/,Au=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],s=e.trim().split(_u);let u="";for(let l=s.length-1;l>=0;l-=1){const c=s[l],{modifiers:d,hasImportantModifier:h,baseClassName:b,maybePostfixModifierPosition:p}=n(c);let E=!!p,y=r(E?b.substring(0,p):b);if(!y){if(!E){u=c+(u.length>0?" "+u:u);continue}if(y=r(b),!y){u=c+(u.length>0?" "+u:u);continue}E=!1}const C=Tu(d).join(":"),A=h?C+Di:C,O=A+y;if(i.includes(O))continue;i.push(O);const L=a(y,E);for(let P=0;P<L.length;++P){const H=L[P];i.push(A+H)}u=c+(u.length>0?" "+u:u)}return u};function Cu(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=vi(t))&&(r&&(r+=" "),r+=n);return r}const vi=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=vi(e[r]))&&(n&&(n+=" "),n+=t);return n};function ku(e,...t){let n,r,a,i=s;function s(l){const c=t.reduce((d,h)=>h(d),e());return n=yu(c),r=n.cache.get,a=n.cache.set,i=u,u(l)}function u(l){const c=r(l);if(c)return c;const d=Au(l,n);return a(l,d),d}return function(){return i(Cu.apply(null,arguments))}}const se=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Pi=/^\[(?:([a-z-]+):)?(.+)\]$/i,Nu=/^\d+\/\d+$/,Iu=new Set(["px","full","screen"]),Su=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ou=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Lu=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Ru=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Du=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Qe=e=>yt(e)||Iu.has(e)||Nu.test(e),Je=e=>It(e,"length",zu),yt=e=>!!e&&!Number.isNaN(Number(e)),Vn=e=>It(e,"number",yt),Ft=e=>!!e&&Number.isInteger(Number(e)),vu=e=>e.endsWith("%")&&yt(e.slice(0,-1)),W=e=>Pi.test(e),Ze=e=>Su.test(e),Pu=new Set(["length","size","percentage"]),Mu=e=>It(e,Pu,Mi),Bu=e=>It(e,"position",Mi),Fu=new Set(["image","url"]),Hu=e=>It(e,Fu,Yu),Uu=e=>It(e,"",ju),Ht=()=>!0,It=(e,t,n)=>{const r=Pi.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},zu=e=>Ou.test(e)&&!Lu.test(e),Mi=()=>!1,ju=e=>Ru.test(e),Yu=e=>Du.test(e),qu=()=>{const e=se("colors"),t=se("spacing"),n=se("blur"),r=se("brightness"),a=se("borderColor"),i=se("borderRadius"),s=se("borderSpacing"),u=se("borderWidth"),l=se("contrast"),c=se("grayscale"),d=se("hueRotate"),h=se("invert"),b=se("gap"),p=se("gradientColorStops"),E=se("gradientColorStopPositions"),y=se("inset"),C=se("margin"),A=se("opacity"),O=se("padding"),L=se("saturate"),P=se("scale"),H=se("sepia"),I=se("skew"),F=se("space"),j=se("translate"),G=()=>["auto","contain","none"],N=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto",W,t],M=()=>[W,t],te=()=>["",Qe,Je],ne=()=>["auto",yt,W],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],le=()=>["solid","dashed","dotted","double","none"],fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ae=()=>["start","end","center","between","around","evenly","stretch"],Ce=()=>["","0",W],w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ce=()=>[yt,W];return{cacheSize:500,separator:":",theme:{colors:[Ht],spacing:[Qe,Je],blur:["none","",Ze,W],brightness:ce(),borderColor:[e],borderRadius:["none","","full",Ze,W],borderSpacing:M(),borderWidth:te(),contrast:ce(),grayscale:Ce(),hueRotate:ce(),invert:Ce(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[vu,Je],inset:U(),margin:U(),opacity:ce(),padding:M(),saturate:ce(),scale:ce(),sepia:Ce(),skew:ce(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",W]}],container:["container"],columns:[{columns:[Ze]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...$(),W]}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:G()}],"overscroll-x":[{"overscroll-x":G()}],"overscroll-y":[{"overscroll-y":G()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ft,W]}],basis:[{basis:U()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",W]}],grow:[{grow:Ce()}],shrink:[{shrink:Ce()}],order:[{order:["first","last","none",Ft,W]}],"grid-cols":[{"grid-cols":[Ht]}],"col-start-end":[{col:["auto",{span:["full",Ft,W]},W]}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":[Ht]}],"row-start-end":[{row:["auto",{span:[Ft,W]},W]}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",W]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",W]}],gap:[{gap:[b]}],"gap-x":[{"gap-x":[b]}],"gap-y":[{"gap-y":[b]}],"justify-content":[{justify:["normal",...Ae()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Ae(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Ae(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[O]}],px:[{px:[O]}],py:[{py:[O]}],ps:[{ps:[O]}],pe:[{pe:[O]}],pt:[{pt:[O]}],pr:[{pr:[O]}],pb:[{pb:[O]}],pl:[{pl:[O]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[F]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[F]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",W,t]}],"min-w":[{"min-w":[W,t,"min","max","fit"]}],"max-w":[{"max-w":[W,t,"none","full","min","max","fit","prose",{screen:[Ze]},Ze]}],h:[{h:[W,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[W,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[W,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[W,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ze,Je]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Vn]}],"font-family":[{font:[Ht]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",W]}],"line-clamp":[{"line-clamp":["none",yt,Vn]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Qe,W]}],"list-image":[{"list-image":["none",W]}],"list-style-type":[{list:["none","disc","decimal",W]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[A]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[A]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Qe,Je]}],"underline-offset":[{"underline-offset":["auto",Qe,W]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",W]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",W]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[A]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$(),Bu]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Mu]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Hu]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[E]}],"gradient-via-pos":[{via:[E]}],"gradient-to-pos":[{to:[E]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[u]}],"border-w-x":[{"border-x":[u]}],"border-w-y":[{"border-y":[u]}],"border-w-s":[{"border-s":[u]}],"border-w-e":[{"border-e":[u]}],"border-w-t":[{"border-t":[u]}],"border-w-r":[{"border-r":[u]}],"border-w-b":[{"border-b":[u]}],"border-w-l":[{"border-l":[u]}],"border-opacity":[{"border-opacity":[A]}],"border-style":[{border:[...le(),"hidden"]}],"divide-x":[{"divide-x":[u]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[u]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[A]}],"divide-style":[{divide:le()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...le()]}],"outline-offset":[{"outline-offset":[Qe,W]}],"outline-w":[{outline:[Qe,Je]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[A]}],"ring-offset-w":[{"ring-offset":[Qe,Je]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ze,Uu]}],"shadow-color":[{shadow:[Ht]}],opacity:[{opacity:[A]}],"mix-blend":[{"mix-blend":[...fe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":fe()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ze,W]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[L]}],sepia:[{sepia:[H]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[A]}],"backdrop-saturate":[{"backdrop-saturate":[L]}],"backdrop-sepia":[{"backdrop-sepia":[H]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",W]}],duration:[{duration:ce()}],ease:[{ease:["linear","in","out","in-out",W]}],delay:[{delay:ce()}],animate:[{animate:["none","spin","ping","pulse","bounce",W]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[P]}],"scale-x":[{"scale-x":[P]}],"scale-y":[{"scale-y":[P]}],rotate:[{rotate:[Ft,W]}],"translate-x":[{"translate-x":[j]}],"translate-y":[{"translate-y":[j]}],"skew-x":[{"skew-x":[I]}],"skew-y":[{"skew-y":[I]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",W]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",W]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",W]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Qe,Je,Vn]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Wu=ku(qu);function V(...e){return Wu(Ii.clsx(e))}const Vu="[data-opencx-widget-content-root]";function Dr({fallbackHeight:e}){const t=J.useRef(null);return J.useEffect(()=>{const n=document.querySelector(Vu);if(n&&t.current){const r=t.current;let a;const i=new ResizeObserver(()=>{a=requestAnimationFrame(()=>{const s=Math.max(r.offsetHeight,e);n.style.setProperty("--opencx-widget-height",`${s.toFixed(1)}px`)})});return i.observe(r),()=>{cancelAnimationFrame(a),i.unobserve(r)}}},[e]),{observedElementRef:t}}const Gu=tn.Provider,Qu=tn.Root,Xu=tn.Trigger,Bi=xe.forwardRef(({className:e,sideOffset:t=4,...n},r)=>m.jsx(tn.Content,{ref:r,sideOffset:t,className:V("z-50 overflow-hidden max-w-xs rounded-xl bg-primary border text-primary-foreground p-2 text-center align-middle text-xs shadow-md 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",e),...n}));Bi.displayName=tn.Content.displayName;function Tn({children:e,content:t,side:n,align:r}){return t?m.jsxs(Qu,{children:[m.jsx(Xu,{asChild:!0,children:e}),m.jsx(Bi,{side:n,align:r,collisionPadding:8,avoidCollisions:!0,children:t})]}):e}const Ku={ok:"حسنا",yes:"نعم",no:"لا",agree:"موافق",cancel:"إلغاء","yes-exit":"نعم، اخرج","yes-reset":"نعم، إعادة تعيين","no-cancel":"لا، إلغاء","are-you-sure":"هل أنت متأكد؟",recording:"تسجيل","thank-you":"شكرا","sorry-try-again":"عذرا، حاول مرة أخرى","error-occurred":"حدث خطأ","please-try-again":"يرجى المحاولة مرة أخرى","write-a-message":"اكتب رسالة...","send-message":"إرسال رسالة",connected:"متصل",connecting:"جاري الاتصال",reconnecting:"جاري إعادة الاتصال",reconnected:"تم إعادة الاتصال",disconnecting:"جاري قطع الاتصال",disconnected:"قطع الاتصال",error:"خطأ","persist-session":"حفظ الجلسة",settings:"إعدادات",close:"إغلاق",help:"مساعدة",chat:"محادثة",send:"إرسال",copy:"نسخ",copied:"تم النسخ","sound-effects":"التاثيرات الصوتية",language:"اللغة",select:"اختر",agent:"الوكيل",user:"المستخدم",bot:"البوت","close-widget":"إغلاق الودجة","got-any-questions":"هل لديك أي أسئلة؟ تحدث معنا!","typical-response-time":"عادة ما نرد في أقل من دقيقة واحدة","session-closed-lead":"تم حل مشكلتك!",exit:"خروج","create-new-ticket":"إنشاء تذكرة جديدة","reset-conversation":"إعادة تعيين المحادثة","new-conversation":"محادثة جديدة","welcome-title":"مرحبًا بك في دردشة الدعم الخاصة بنا","welcome-description":"نحن هنا للمساعدة! ابدأ محادثة وسنرد عليك في أقرب وقت ممكن.","your-name":"اسمك","your-email":"عنوان بريدك الإلكتروني","start-chat":"تحدث إلى الدعم","starting-chat":"جاري الاتصال...","hello-greeting":"مرحبًا! كيف يمكننا مساعدتك اليوم؟","i-need-more-help":"أحتاج المزيد من المساعدة","this-was-helpful":"كان هذا مفيدًا",optional:"اختياري"},$u={ok:"OK",yes:"Ja",no:"Nein",agree:"Zustimmen",cancel:"Stornieren","yes-exit":"Ja, beenden","yes-reset":"Ja, zurücksetzen","no-cancel":"Nein, abbrechen","are-you-sure":"Sind Sie sicher?",recording:"Aufnahme läuft","thank-you":"Vielen Dank","sorry-try-again":"Entschuldigung, bitte versuchen Sie es erneut","error-occurred":"Ein Fehler ist aufgetreten","please-try-again":"Bitte versuchen Sie es erneut","write-a-message":"Nachricht schreiben...","send-message":"Nachricht senden",connected:"Verbunden",connecting:"Verbindung wird hergestellt",reconnecting:"Verbindung wird wiederhergestellt",reconnected:"Wieder verbunden",disconnecting:"Verbindung wird getrennt",disconnected:"Verbindung getrennt",error:"Fehler","persist-session":"Sitzung beibehalten",settings:"Einstellungen",close:"Schließen",help:"Hilfe",chat:"Chat",send:"Senden",copy:"Kopieren",copied:"Kopiert","sound-effects":"Soundeffekte",language:"Sprache",select:"Auswählen",agent:"Agent",user:"Benutzer",bot:"Bot","got-any-questions":"Haben Sie Fragen? Chatten Sie mit uns!","typical-response-time":"Üblicherweise antworten wir in weniger als 1 Minute","close-widget":"Widget schließen","session-closed-lead":"Ihr Problem wurde gelöst!","create-new-ticket":"Neues Ticket erstellen",exit:"Beenden","reset-conversation":"Konversation zurücksetzen","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...","hello-greeting":"Hallo! Wie können wir Ihnen heute helfen?","i-need-more-help":"Ich brauche weitere Hilfe","this-was-helpful":"Dies war hilfreich",optional:"Optional"},Ju={ok:"OK",yes:"Yes",no:"No",agree:"Agree",cancel:"Cancel","yes-exit":"Yes, exit","yes-reset":"Yes, reset","no-cancel":"No, cancel","are-you-sure":"Are you sure?",recording:"Recording...","thank-you":"Thank you","sorry-try-again":"Sorry, please try again","error-occurred":"An error occurred","please-try-again":"Please try again","write-a-message":"Write a message...","send-message":"Send message",connected:"Connected",connecting:"Connecting",reconnecting:"Reconnecting",reconnected:"Reconnected",disconnecting:"Disconnecting",disconnected:"Disconnected",error:"Error","persist-session":"Persist session",settings:"Settings",close:"Close",help:"Help",chat:"Chat",send:"Send",copy:"Copy",copied:"Copied","sound-effects":"Sound effects",language:"Language",select:"Select",agent:"Agent",user:"User",bot:"Bot","close-widget":"Close widget","got-any-questions":"Got any questions? Chat with us!","typical-response-time":"Typically respond in less than 1 minute","session-closed-lead":"Your issue has been resolved!","create-new-ticket":"Create new ticket",exit:"Exit","reset-conversation":"Reset conversation","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...","hello-greeting":"Hi there!","i-need-more-help":"I need more help","this-was-helpful":"This was helpful",optional:"Optional"},Zu={ok:"D'accord",yes:"Oui",no:"Non",agree:"Accepter",cancel:"Annuler","yes-exit":"Oui, quitter","yes-reset":"Oui, réinitialiser","no-cancel":"Non, annuler","are-you-sure":"Êtes-vous sûr ?",recording:"Enregistrement...","thank-you":"Merci","sorry-try-again":"Désolé, veuillez réessayer","error-occurred":"Une erreur s'est produite","please-try-again":"Veuillez réessayer","write-a-message":"Écrivez un message...","send-message":"Envoyer le message",connected:"Connecté",connecting:"Connexion en cours",reconnecting:"Reconnexion en cours",reconnected:"Reconnecté",disconnecting:"Déconnexion en cours",disconnected:"Déconnecté",error:"Erreur","persist-session":"Conserver la session",settings:"Paramètres",close:"Fermer",help:"Aide",chat:"Chat",send:"Envoyer",copy:"Copier",copied:"Copié","sound-effects":"Effets sonores",language:"Langue",select:"Sélectionner",agent:"Agent",user:"Utilisateur",bot:"Bot","close-widget":"Fermer le widget","got-any-questions":"Vous avez des questions ? Chattez avec nous !","typical-response-time":"Nous répondons généralement en moins d'une minute","session-closed-lead":"Votre problème a été résolu !","create-new-ticket":"Créer un nouveau ticket",exit:"Sortie","reset-conversation":"Réinitialiser la conversation","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...","hello-greeting":"Bonjour ! Comment pouvons-nous vous aider aujourd'hui ?","i-need-more-help":"Je besoin d'aide plus","this-was-helpful":"C'était utile",optional:"Optionnel"},el={ok:"OK",yes:"Ja",no:"Nee",agree:"Akkoord",cancel:"Annuleren","yes-exit":"Ja, afsluiten","yes-reset":"Ja, resetten","no-cancel":"Nee, annuleren","are-you-sure":"Weet u het zeker?",recording:"Opname...","thank-you":"Dank u","sorry-try-again":"Sorry, probeer het opnieuw","error-occurred":"Er is een fout opgetreden","please-try-again":"Probeer het opnieuw","write-a-message":"Schrijf een bericht...","send-message":"Bericht verzenden",connected:"Verbonden",connecting:"Verbinding maken",reconnecting:"Opnieuw verbinding maken",reconnected:"Opnieuw verbonden",disconnecting:"Verbinding verbreken",disconnected:"Verbinding verbroken",error:"Fout","persist-session":"Sessie behouden",settings:"Instellingen",close:"Sluiten",help:"Help",chat:"Chat",send:"Verzenden",copy:"Kopiëren",copied:"Gekopieerd","sound-effects":"Geluidseffecten",language:"Taal",select:"Selecteren",agent:"Agent",user:"Gebruiker",bot:"Bot","close-widget":"Widget sluiten","got-any-questions":"Heeft u vragen? Chat met ons!","typical-response-time":"We reageren doorgaans binnen 1 minuut","session-closed-lead":"Uw probleem is opgelost!","create-new-ticket":"Nieuw ticket aanmaken",exit:"Afsluiten","reset-conversation":"Gesprek resetten","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...","hello-greeting":"Hallo! Hoe kunnen we u vandaag helpen?","i-need-more-help":"Ik heb nog meer hulp nodig","this-was-helpful":"Mijn vraag is opgelost",optional:"Optioneel"},tl={ok:"OK",yes:"Sim",no:"Não",agree:"Concordo",cancel:"Cancelar","yes-exit":"Sim, sair","yes-reset":"Sim, redefinir","no-cancel":"Não, cancelar","are-you-sure":"Você tem certeza?",recording:"Gravando...","thank-you":"Obrigado","sorry-try-again":"Desculpe, tente novamente","error-occurred":"Ocorreu um erro","please-try-again":"Por favor, tente novamente","write-a-message":"Escreva uma mensagem...","send-message":"Enviar mensagem",connected:"Conectado",connecting:"Conectando",reconnecting:"Reconectando",reconnected:"Reconectado",disconnecting:"Desconectando",disconnected:"Desconectado",error:"Erro","persist-session":"Persistir sessão",settings:"Configurações",close:"Fechar",help:"Ajuda",chat:"Bate-papo",send:"Enviar",copy:"Copiar",copied:"Copiado","sound-effects":"Efeitos sonoros",language:"Idioma",select:"Selecionar",agent:"Agente",user:"Usuário",bot:"Bot","close-widget":"Fechar widget","got-any-questions":"Tem alguma dúvida? Converse conosco!","typical-response-time":"Geralmente respondemos em menos de 1 minuto","session-closed-lead":"Seu problema foi resolvido!","create-new-ticket":"Criar novo ticket",exit:"Sair","reset-conversation":"Redefinir conversa","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...","hello-greeting":"Olá! Como podemos ajudar você hoje?","i-need-more-help":"preciso de mais ajuda","this-was-helpful":"Isso foi útil",optional:"Opcional"},Fi={en:Ju,ar:Ku,nl:el,fr:Zu,de:$u,pt:tl},nl=Object.keys(Fi),rl=e=>nl.includes(e);function al(e,t){const n=Fi[t];return n&&n[e]||""}function St(){const{widgetCtx:{config:e}}=X.useWidget();return J.useMemo(()=>{const n=rl(e.language)?e.language:"en";return{get:r=>al(r,n),lang:n}},[e.language])}const il=10,sl=(e,t)=>({initial:{opacity:0,x:-e,...t.initial},animate:{opacity:1,x:0,...t.animate},exit:{opacity:0,x:e,...t.exit}}),ol=(e,t)=>({initial:{opacity:0,x:e,...t.initial},animate:{opacity:1,x:0,...t.animate},exit:{opacity:0,x:-e,...t.exit}}),ul=(e,t)=>({initial:{opacity:0,y:e,...t.initial},animate:{opacity:1,y:0,...t.animate},exit:{opacity:0,y:-e,...t.exit}}),ll=(e,t)=>({initial:{opacity:0,y:-e,...t.initial},animate:{opacity:1,y:0,...t.animate},exit:{opacity:0,y:e,...t.exit}}),cl={right:sl,left:ol,up:ul,down:ll},ue=J.forwardRef(({fadeIn:e="down",distance:t=il,children:n,snapExit:r=!1,overrides:a={},...i},s)=>{const u=e?cl[e](t,a):{};return r&&u.exit&&typeof u.exit=="object"&&!Array.isArray(u.exit)&&(u.exit.transition={duration:0}),m.jsx(ge.motion.div,{ref:s,...i,...u,children:n})});ue.displayName="MotionDiv";const la=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,ca=Ii.clsx,dl=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return ca(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:i}=t,s=Object.keys(a).map(c=>{const d=n==null?void 0:n[c],h=i==null?void 0:i[c];if(d===null)return null;const b=la(d)||la(h);return a[c][b]}),u=n&&Object.entries(n).reduce((c,d)=>{let[h,b]=d;return b===void 0||(c[h]=b),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:h,className:b,...p}=d;return Object.entries(p).every(E=>{let[y,C]=E;return Array.isArray(C)?C.includes({...i,...u}[y]):{...i,...u}[y]===C})?[...c,h,b]:c},[]);return ca(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},da={x:2,y:2},hl={1:"scale-[1]","1.01":"scale-[1.01]","1.02":"scale-[1.02]","1.1":"scale-[1.1]"},rt=J.memo(J.forwardRef(({children:e,className:t,scale:n="1.02",off:r=!1},a)=>{const[i,s]=J.useState(!1),[u,l]=J.useState({x:0,y:0});if(r||/translate/.test(e.props.className||""))return e;const d=E=>{var j,G;const{clientX:y,clientY:C}=E,A=E.currentTarget.getBoundingClientRect(),O=y-(A.left+A.width/2),L=C-(A.top+A.height/2),P=Math.max(-1,Math.min(1,O/(A.width/2))),H=Math.max(-1,Math.min(1,L/(A.height/2))),I=P*da.x,F=H*da.y;l({x:I,y:F}),(G=(j=e.props).onMouseMove)==null||G.call(j,E)},h=()=>{var E,y;s(!0),(y=(E=e.props).onMouseEnter)==null||y.call(E)},b=()=>{var E,y;s(!1),l({x:0,y:0}),(y=(E=e.props).onMouseLeave)==null||y.call(E)},p={"--opencx-wobble-x":i?`${u.x}px`:"0px","--opencx-wobble-y":i?`${u.y}px`:"0px"};return J.cloneElement(e,{ref:a,onMouseMove:d,onMouseEnter:h,onMouseLeave:b,style:{...p,...e.props.style},className:V("translate-x-[var(--opencx-wobble-x)]","translate-y-[var(--opencx-wobble-y)]",`hover:${hl[n]}`,t,e.props.className,"transition-all ease-out")})}));rt.displayName="Wobble";const pl=dl(V("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","shadow-sm active:shadow-none active:scale-95 hover:active:scale-95","rounded-xl","border","transition"),{variants:{variant:{default:"border-primary bg-primary text-primary-foreground",destructive:"border-destructive bg-destructive text-destructive-foreground",outline:"bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground",ghost:"border-transparent shadow-none hover:bg-accent hover:text-accent-foreground",link:"border-transparent shadow-none text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-8 px-3 text-xs",lg:"min-h-12 px-4",icon:"h-10 w-10",fit:"size-fit p-2",free:"p-2"}},defaultVariants:{variant:"default",size:"default"}}),Le=xe.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},i)=>{const s=r?uu.Slot:"button";return m.jsx(rt,{ref:i,children:m.jsx(s,{className:V(pl({variant:t,size:n,className:e})),...a})})});Le.displayName="Button";const Sn=()=>{const[e,t]=J.useState("ltr");return J.useEffect(()=>{const n=()=>{typeof document>"u"||t(window.getComputedStyle(document.body).direction)};n();const r=new MutationObserver(n);return r.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]}),r.observe(document.body,{attributes:!0,attributeFilter:["dir"]}),window.addEventListener("languagechange",n),()=>{r.disconnect(),window.removeEventListener("languagechange",n)}},[]),e};function fl(){const{sendMessage:e}=X.useMessages(),t=St(),n=[t.get("i-need-more-help"),t.get("this-was-helpful")],r=a=>{const i=a.trim();i&&e({content:i})};return m.jsx("div",{className:"flex items-center gap-2 p-2 pb-0 flex-wrap",children:n.map(a=>m.jsx(Le,{onClick:()=>r(a),className:"flex-1 rounded-full",size:"sm",children:a},a))})}function ml({file:{status:e,file:t,error:n},onCancel:r}){const[a,i]=J.useState(null);J.useEffect(()=>{if(!t.type.startsWith("image/"))return;const l=new FileReader;return l.onload=()=>i(l.result),l.onerror=()=>console.error("Error reading file"),l.readAsDataURL(t),()=>l.abort()},[t]);const s=()=>{switch(e){case"uploading":return m.jsx(de.Loader2,{className:"size-4 animate-spin"});case"error":return m.jsx(de.AlertCircle,{className:"size-4 text-destructive"});default:return null}},u=()=>{const l=t.type.split("/")[0];return l==="image"&&a?m.jsx("img",{src:typeof a=="string"?a:"",className:"object-cover bg-secondary size-full",alt:t.name}):l==="audio"?m.jsx(de.FileAudio2Icon,{}):l==="video"?m.jsx(de.FileVideo2Icon,{}):m.jsx(de.FileIcon,{})};return m.jsx(Tn,{side:"bottom",content:e==="error"?m.jsxs("span",{className:"text-destructive",children:["Failed to upload: ",n]}):t.name,children:m.jsxs("div",{className:V(e==="uploading"&&"opacity-50","group","size-12 border rounded-2xl overflow-hidden relative","flex items-center justify-center shrink-0"),children:[m.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:s()}),m.jsx("button",{type:"button",className:V("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:m.jsx(de.XIcon,{className:"size-4 text-primary-foreground"})}),m.jsx(u,{})]})})}const ha=V("rounded-3xl");function gl(){var I;const e=J.useRef(null),{sendMessage:t}=X.useMessages(),{sessionState:n}=X.useSessions(),r=St(),a=Sn(),[i,s]=J.useState(""),{allFiles:u,emptyTheFiles:l,handleCancelUpload:c,appendFiles:d,isUploading:h,successFiles:b}=X.useUploadFiles(),p=!!((I=n.session)!=null&&I.isHandedOff),{isAwaitingBotReply:E}=X.useIsAwaitingBotReply(),y=F=>{p&&d(F)},C=!i.trim()&&b.length===0,A=async()=>{if(E||C)return;h&&console.info("please wait for the file(s) to upload");const F=i.trim();t({content:F,attachments:b.flatMap(j=>j.fileUrl?[{url:j.fileUrl,type:j.file.type,name:j.file.name,id:j.id,size:j.file.size}]:[])}),s(""),l()},{getRootProps:O,getInputProps:L,open:P}=su.useDropzone({onDrop:y,noClick:!0,onDropRejected(){p&&console.error("unsupported file type, or the file is too large")},maxSize:5*1024*1024,accept:{"text/*":[".txt"],"image/*":[".png",".jpg",".jpeg",".gif"],"application/pdf":[".pdf"]}}),H=F=>{const j=F.clipboardData;j&&j.files.length>0&&y(Array.from(j.files))};return m.jsxs("div",{className:"p-2 relative space-y-1",...O(),children:[m.jsx("input",{...L()}),m.jsxs("div",{className:V(ha,"relative space-y-2 border transition-all shadow py-2"),children:[m.jsx("div",{className:"flex items-center gap-1 px-2",children:m.jsx(ge.AnimatePresence,{mode:"popLayout",children:u.map(F=>m.jsx(ue,{snapExit:!0,children:m.jsx(ml,{onCancel:()=>c(F.id),file:F})},F.id))})}),m.jsx("textarea",{onPaste:H,ref:e,id:"chat-input",dir:a,value:i,rows:3,className:V(ha,"w-full resize-none px-3","text-sm rtl:placeholder:text-right bg-transparent outline-none"),onChange:F=>s(F.target.value),onKeyDown:async F=>{F.key==="Enter"&&!F.shiftKey&&(F.preventDefault(),A())},placeholder:r.get("write-a-message")}),m.jsxs("div",{dir:a,className:"px-2 flex justify-between rtl:text-right",children:[m.jsx(Tn,{side:"top",align:"start",content:"attach files, (maximum size 5mb)",children:m.jsx(Le,{onClick:()=>{p&&P()},size:"fit",variant:"outline",className:V("disabled:opacity-0","rounded-full size-8 flex items-center justify-center p-0"),disabled:!p,children:m.jsx(de.PaperclipIcon,{className:"size-4"})})}),m.jsx(Tn,{content:"send message",side:"top",align:"end",children:m.jsx(Le,{size:"fit",onClick:A,disabled:E||h||C,className:"rounded-full size-8 flex items-center justify-center p-0",children:m.jsx(ge.AnimatePresence,{mode:"wait",children:E||h?m.jsx(ue,{snapExit:!0,children:m.jsx(de.CircleDashed,{className:"size-4 animate-spin animate-iteration-infinite"})},"loading"):m.jsx(ue,{snapExit:!0,children:m.jsx(de.SendHorizonal,{className:"size-4 rtl:-scale-100"})},"send")})})})]})]})]})}function bl(){const{widgetCtx:e}=X.useWidget(),t=St();return m.jsx("div",{className:"p-2",children:m.jsxs("div",{className:"p-2 bg-background rounded-3xl border shadow-2xl space-y-2",children:[m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx(de.CheckCheckIcon,{className:"size-4 text-emerald-500"}),m.jsx("h2",{className:"text-sm font-medium",dir:"auto",children:t.get("session-closed-lead")})]}),m.jsx("div",{children:m.jsx(Le,{onClick:e.resetChat,className:"rounded-2xl w-full",children:t.get("new-conversation")})})]})})}function El(){var s,u,l;const{sessionState:e}=X.useSessions(),{messagesState:t,sendMessage:n}=X.useMessages(),a=(u=(s=X.usePreludeData().data)==null?void 0:s.data)==null?void 0:u.initialQuestions,i=t.messages.length===0;return m.jsx("footer",{children:m.jsx("div",{children:m.jsx(ge.AnimatePresence,{mode:"wait",children:e.session&&!((l=e.session)!=null&&l.isOpened)?m.jsx(ue,{className:"overflow-hidden",overrides:{initial:{height:0},animate:{height:"auto"},exit:{height:0}},children:m.jsx(bl,{})},"session-closed"):m.jsxs(ue,{className:"overflow-hidden",overrides:{initial:{height:0},animate:{height:"auto"},exit:{height:0}},children:[t.lastAIResMightSolveUserIssue&&m.jsx(fl,{}),i&&a&&m.jsx("div",{className:"flex items-center flex-row justify-end gap-2 flex-wrap px-2",children:a==null?void 0:a.map(c=>m.jsx(Le,{dir:"auto",variant:"outline",size:"sm",onClick:()=>{n({content:c})},children:c},c))}),m.jsx(gl,{})]},"chat-input")})})})}const xl=pe.Root,wl=pe.Trigger,Tl=pe.Group,yl=xe.forwardRef(({className:e,inset:t,children:n,...r},a)=>m.jsxs(pe.SubTrigger,{ref:a,className:V("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r,children:[n,m.jsx(de.ChevronRight,{className:"ml-auto"})]}));yl.displayName=pe.SubTrigger.displayName;const _l=xe.forwardRef(({className:e,...t},n)=>m.jsx(pe.SubContent,{ref:n,className:V("z-50 min-w-[8rem] overflow-hidden rounded-2xl border bg-background p-1 text-foreground shadow-2xl data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));_l.displayName=pe.SubContent.displayName;const Hi=xe.forwardRef(({className:e,sideOffset:t=4,...n},r)=>m.jsx(pe.Content,{ref:r,sideOffset:t,className:V("z-50 min-w-[8rem] overflow-hidden rounded-2xl border bg-background p-1 text-foreground shadow-2xl","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));Hi.displayName=pe.Content.displayName;const Ui=xe.forwardRef(({className:e,inset:t,...n},r)=>m.jsx(ue,{children:m.jsx(pe.Item,{ref:r,className:V("relative flex cursor-default select-none items-center gap-2 rounded-xl px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...n})}));Ui.displayName=pe.Item.displayName;const Al=xe.forwardRef(({className:e,children:t,checked:n,...r},a)=>m.jsxs(pe.CheckboxItem,{ref:a,className:V("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(pe.ItemIndicator,{children:m.jsx(de.Check,{className:"h-4 w-4"})})}),t]}));Al.displayName=pe.CheckboxItem.displayName;const Cl=xe.forwardRef(({className:e,children:t,...n},r)=>m.jsxs(pe.RadioItem,{ref:r,className:V("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(pe.ItemIndicator,{children:m.jsx(de.Circle,{className:"h-2 w-2 fill-current"})})}),t]}));Cl.displayName=pe.RadioItem.displayName;const kl=xe.forwardRef(({className:e,inset:t,...n},r)=>m.jsx(pe.Label,{ref:r,className:V("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));kl.displayName=pe.Label.displayName;const Nl=xe.forwardRef(({className:e,...t},n)=>m.jsx(pe.Separator,{ref:n,className:V("-mx-1 my-1 h-px bg-muted",e),...t}));Nl.displayName=pe.Separator.displayName;function zi({className:e,...t}){return m.jsx("div",{className:V("animate-pulse rounded-md bg-secondary",e),...t})}function Il(){const e=St(),[t,n]=J.useState(!1),{toChatScreen:r}=X.useWidgetRouter();return m.jsxs(xl,{open:t,onOpenChange:n,children:[m.jsx(wl,{asChild:!0,children:m.jsx(Le,{variant:"ghost",size:"fit",className:"rounded-full",children:m.jsx(de.EllipsisVerticalIcon,{className:"size-4"})})}),m.jsx(Hi,{align:"end",className:"min-w-56",children:m.jsx(Tl,{children:m.jsxs(Ui,{onSelect:()=>{n(!1),r()},children:[m.jsx(ge.motion.div,{initial:{opacity:0,x:-4,rotate:360},animate:{opacity:1,x:0,rotate:0},children:m.jsx(de.MessageCirclePlusIcon,{})}),e.get("new-conversation")]})})})]})}function ji(){var i,s;const{routerState:{screen:e},toSessionsScreen:t}=X.useWidgetRouter(),{data:n,isLoading:r}=X.usePreludeData(),a=Sn();return m.jsx("header",{className:"p-2 border-b bg-background",children:m.jsxs("div",{dir:a,className:"flex items-center rtl:flex-row-reverse gap-2",children:[e==="chat"&&m.jsx(Le,{variant:"ghost",size:"fit",className:"rounded-full",onClick:t,children:m.jsx(de.ChevronLeftIcon,{className:"size-4"})}),m.jsx("div",{className:V("flex-1",e==="sessions"&&"pl-2"),children:m.jsx(ge.AnimatePresence,{mode:"wait",children:r||!((i=n==null?void 0:n.data)!=null&&i.organizationName)?m.jsx(ue,{snapExit:!0,children:m.jsx(zi,{className:"h-5 w-1/2"})},"skeleton"):m.jsx(ue,{children:m.jsx("h2",{className:"font-semibold",children:(s=n==null?void 0:n.data)==null?void 0:s.organizationName})},"organization-name")})}),m.jsx(Il,{})]})})}function Sl(e){const t=[];let n=null;return e.forEach(r=>{var a,i,s,u;(!n||((a=n[0])==null?void 0:a.type)!==r.type)&&(n=[],t.push(n)),((i=n[0])==null?void 0:i.type)==="FROM_AGENT"&&r.type==="FROM_AGENT"&&((s=r.agent)==null?void 0:s.id)!==((u=n[0].agent)==null?void 0:u.id)&&(n=[],t.push(n)),n.push(r)}),t}function Ol(e){var t;return((t=e==null?void 0:e[0])==null?void 0:t.type)==="FROM_USER"}function Ll(e){var t;return((t=e==null?void 0:e[0])==null?void 0:t.type)==="FROM_BOT"}function Rl(e){var t;return((t=e==null?void 0:e[0])==null?void 0:t.type)==="FROM_AGENT"}function pa(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}const ke=it(/[A-Za-z]/),Te=it(/[\dA-Za-z]/),Dl=it(/[#-'*+\--9=?A-Z^-~]/);function yn(e){return e!==null&&(e<32||e===127)}const fr=it(/\d/),vl=it(/[\dA-Fa-f]/),Pl=it(/[!-/:-@[-`{-~]/);function z(e){return e!==null&&e<-2}function ae(e){return e!==null&&(e<0||e===32)}function K(e){return e===-2||e===-1||e===32}const On=it(new RegExp("\\p{P}|\\p{S}","u")),pt=it(/\s/);function it(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ml(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const Ln=function(e){if(e==null)return Ul;if(typeof e=="function")return Rn(e);if(typeof e=="object")return Array.isArray(e)?Bl(e):Fl(e);if(typeof e=="string")return Hl(e);throw new Error("Expected function, string, or object as test")};function Bl(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ln(e[n]);return Rn(r);function r(...a){let i=-1;for(;++i<t.length;)if(t[i].apply(this,a))return!0;return!1}}function Fl(e){const t=e;return Rn(n);function n(r){const a=r;let i;for(i in e)if(a[i]!==t[i])return!1;return!0}}function Hl(e){return Rn(t);function t(n){return n&&n.type===e}}function Rn(e){return t;function t(n,r,a){return!!(zl(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function Ul(){return!0}function zl(e){return e!==null&&typeof e=="object"&&"type"in e}const Yi=[],jl=!0,mr=!1,Yl="skip";function qi(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const i=Ln(a),s=r?-1:1;u(e,void 0,[])();function u(l,c,d){const h=l&&typeof l=="object"?l:{};if(typeof h.type=="string"){const p=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return b;function b(){let p=Yi,E,y,C;if((!t||i(l,c,d[d.length-1]||void 0))&&(p=ql(n(l,d)),p[0]===mr))return p;if("children"in l&&l.children){const A=l;if(A.children&&p[0]!==Yl)for(y=(r?A.children.length:-1)+s,C=d.concat(A);y>-1&&y<A.children.length;){const O=A.children[y];if(E=u(O,y,C)(),E[0]===mr)return E;y=typeof E[1]=="number"?E[1]:y+s}}return p}}}function ql(e){return Array.isArray(e)?e:typeof e=="number"?[jl,e]:e==null?Yi:[e]}function Wl(e,t,n){const a=Ln((n||{}).ignore||[]),i=Vl(t);let s=-1;for(;++s<i.length;)qi(e,"text",u);function u(c,d){let h=-1,b;for(;++h<d.length;){const p=d[h],E=b?b.children:void 0;if(a(p,E?E.indexOf(p):void 0,b))return;b=p}if(b)return l(c,d)}function l(c,d){const h=d[d.length-1],b=i[s][0],p=i[s][1];let E=0;const C=h.children.indexOf(c);let A=!1,O=[];b.lastIndex=0;let L=b.exec(c.value);for(;L;){const P=L.index,H={index:L.index,input:L.input,stack:[...d,c]};let I=p(...L,H);if(typeof I=="string"&&(I=I.length>0?{type:"text",value:I}:void 0),I===!1?b.lastIndex=P+1:(E!==P&&O.push({type:"text",value:c.value.slice(E,P)}),Array.isArray(I)?O.push(...I):I&&O.push(I),E=P+L[0].length,A=!0),!b.global)break;L=b.exec(c.value)}return A?(E<c.value.length&&O.push({type:"text",value:c.value.slice(E)}),h.children.splice(C,1,...O)):O=[c],C+O.length}}function Vl(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const a=n[r];t.push([Gl(a[0]),Ql(a[1])])}return t}function Gl(e){return typeof e=="string"?new RegExp(Ml(e),"g"):e}function Ql(e){return typeof e=="function"?e:function(){return e}}const Gn="phrasing",Qn=["autolink","link","image","label"];function Xl(){return{transforms:[nc],enter:{literalAutolink:$l,literalAutolinkEmail:Xn,literalAutolinkHttp:Xn,literalAutolinkWww:Xn},exit:{literalAutolink:tc,literalAutolinkEmail:ec,literalAutolinkHttp:Jl,literalAutolinkWww:Zl}}}function Kl(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Gn,notInConstruct:Qn},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Gn,notInConstruct:Qn},{character:":",before:"[ps]",after:"\\/",inConstruct:Gn,notInConstruct:Qn}]}}function $l(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Xn(e){this.config.enter.autolinkProtocol.call(this,e)}function Jl(e){this.config.exit.autolinkProtocol.call(this,e)}function Zl(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function ec(e){this.config.exit.autolinkEmail.call(this,e)}function tc(e){this.exit(e)}function nc(e){Wl(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,rc],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),ac]],{ignore:["link","linkReference"]})}function rc(e,t,n,r,a){let i="";if(!Wi(a)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!ic(n)))return!1;const s=sc(n+r);if(!s[0])return!1;const u={type:"link",title:null,url:i+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[u,{type:"text",value:s[1]}]:u}function ac(e,t,n,r){return!Wi(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function ic(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function sc(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const a=pa(e,"(");let i=pa(e,")");for(;r!==-1&&a>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}function Wi(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||pt(n)||On(n))&&(!t||n!==47)}function Fe(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}Vi.peek=bc;function oc(){return{enter:{gfmFootnoteDefinition:lc,gfmFootnoteDefinitionLabelString:cc,gfmFootnoteCall:pc,gfmFootnoteCallString:fc},exit:{gfmFootnoteDefinition:hc,gfmFootnoteDefinitionLabelString:dc,gfmFootnoteCall:gc,gfmFootnoteCallString:mc}}}function uc(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:Ec,footnoteReference:Vi}}}function lc(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function cc(){this.buffer()}function dc(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=Fe(this.sliceSerialize(e)).toLowerCase()}function hc(e){this.exit(e)}function pc(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function fc(){this.buffer()}function mc(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=Fe(this.sliceSerialize(e)).toLowerCase()}function gc(e){this.exit(e)}function Vi(e,t,n,r){const a=n.createTracker(r);let i=a.move("[^");const s=n.enter("footnoteReference"),u=n.enter("reference");return i+=a.move(n.safe(n.associationId(e),{...a.current(),before:i,after:"]"})),u(),s(),i+=a.move("]"),i}function bc(){return"["}function Ec(e,t,n,r){const a=n.createTracker(r);let i=a.move("[^");const s=n.enter("footnoteDefinition"),u=n.enter("label");return i+=a.move(n.safe(n.associationId(e),{...a.current(),before:i,after:"]"})),u(),i+=a.move("]:"+(e.children&&e.children.length>0?" ":"")),a.shift(4),i+=a.move(n.indentLines(n.containerFlow(e,a.current()),xc)),s(),i}function xc(e,t,n){return t===0?e:(n?"":" ")+e}const wc=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Gi.peek=Cc;function Tc(){return{canContainEols:["delete"],enter:{strikethrough:_c},exit:{strikethrough:Ac}}}function yc(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:wc}],handlers:{delete:Gi}}}function _c(e){this.enter({type:"delete",children:[]},e)}function Ac(e){this.exit(e)}function Gi(e,t,n,r){const a=n.createTracker(r),i=n.enter("strikethrough");let s=a.move("~~");return s+=n.containerPhrasing(e,{...a.current(),before:s,after:"~"}),s+=a.move("~~"),i(),s}function Cc(){return"~"}function kc(e,t={}){const n=(t.align||[]).concat(),r=t.stringLength||Ic,a=[],i=[],s=[],u=[];let l=0,c=-1;for(;++c<e.length;){const E=[],y=[];let C=-1;for(e[c].length>l&&(l=e[c].length);++C<e[c].length;){const A=Nc(e[c][C]);if(t.alignDelimiters!==!1){const O=r(A);y[C]=O,(u[C]===void 0||O>u[C])&&(u[C]=O)}E.push(A)}i[c]=E,s[c]=y}let d=-1;if(typeof n=="object"&&"length"in n)for(;++d<l;)a[d]=fa(n[d]);else{const E=fa(n);for(;++d<l;)a[d]=E}d=-1;const h=[],b=[];for(;++d<l;){const E=a[d];let y="",C="";E===99?(y=":",C=":"):E===108?y=":":E===114&&(C=":");let A=t.alignDelimiters===!1?1:Math.max(1,u[d]-y.length-C.length);const O=y+"-".repeat(A)+C;t.alignDelimiters!==!1&&(A=y.length+A+C.length,A>u[d]&&(u[d]=A),b[d]=A),h[d]=O}i.splice(1,0,h),s.splice(1,0,b),c=-1;const p=[];for(;++c<i.length;){const E=i[c],y=s[c];d=-1;const C=[];for(;++d<l;){const A=E[d]||"";let O="",L="";if(t.alignDelimiters!==!1){const P=u[d]-(y[d]||0),H=a[d];H===114?O=" ".repeat(P):H===99?P%2?(O=" ".repeat(P/2+.5),L=" ".repeat(P/2-.5)):(O=" ".repeat(P/2),L=O):L=" ".repeat(P)}t.delimiterStart!==!1&&!d&&C.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&A==="")&&(t.delimiterStart!==!1||d)&&C.push(" "),t.alignDelimiters!==!1&&C.push(O),C.push(A),t.alignDelimiters!==!1&&C.push(L),t.padding!==!1&&C.push(" "),(t.delimiterEnd!==!1||d!==l-1)&&C.push("|")}p.push(t.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return p.join(`
2
2
  `)}function Nc(e){return e==null?"":String(e)}function Ic(e){return e.length}function fa(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}const ma={}.hasOwnProperty;function Qi(e,t){const n=t||{};function r(a,...i){let s=r.invalid;const u=r.handlers;if(a&&ma.call(a,e)){const l=String(a[e]);s=ma.call(u,l)?u[l]:r.unknown}if(s)return s.call(this,a,...i)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}function Sc(e,t,n,r){const a=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const s=n.indentLines(n.containerFlow(e,i.current()),Oc);return a(),s}function Oc(e,t,n){return">"+(n?"":" ")+e}function Lc(e,t){return ga(e,t.inConstruct,!0)&&!ga(e,t.notInConstruct,!1)}function ga(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function ba(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
3
3
  `&&Lc(n.stack,n.unsafe[a]))return/[ \t]/.test(r.before)?"":" ";return`\\
4
4
  `}function Rc(e,t){const n=String(e);let r=n.indexOf(t),a=r,i=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===a?++i>s&&(s=i):i=1,a=r+t.length,r=n.indexOf(t,a);return s}function Dc(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function vc(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Pc(e,t,n,r){const a=vc(n),i=e.value||"",s=a==="`"?"GraveAccent":"Tilde";if(Dc(e,n)){const h=n.enter("codeIndented"),b=n.indentLines(i,Mc);return h(),b}const u=n.createTracker(r),l=a.repeat(Math.max(Rc(i,a)+1,3)),c=n.enter("codeFenced");let d=u.move(l);if(e.lang){const h=n.enter(`codeFencedLang${s}`);d+=u.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...u.current()})),h()}if(e.lang&&e.meta){const h=n.enter(`codeFencedMeta${s}`);d+=u.move(" "),d+=u.move(n.safe(e.meta,{before:d,after:`
package/dist/designs.js CHANGED
@@ -6,7 +6,7 @@ import { motion as xt, AnimatePresence as Ie } from "framer-motion";
6
6
  import { clsx as Ui } from "clsx";
7
7
  import { PaperclipIcon as Au, CircleDashed as Cu, SendHorizonal as ku, CheckCheckIcon as Nu, XIcon as zi, AlertCircle as Iu, Loader2 as Su, FileAudio2Icon as Ou, FileVideo2Icon as Lu, FileIcon as Ru, ChevronRight as Du, Check as vu, Circle as Pu, ChevronLeftIcon as Mu, EllipsisVerticalIcon as Bu, MessageCirclePlusIcon as Fu, X as Hu, LoaderIcon as Uu, SendHorizontal as zu, ChevronRightIcon as Yu } from "lucide-react";
8
8
  import { useDropzone as ju } from "react-dropzone";
9
- import { u as rn, d as an, g as vn, e as Pn, i as qu, c as Yi, h as on, j as ba, k as Vu, a as kt, b as Wu, _ as Gu, W as Qu } from "./useUploadFiles-CrnVSGnL.js";
9
+ import { u as rn, d as an, g as vn, e as Pn, i as qu, c as Yi, h as on, j as ba, k as Vu, a as kt, b as Wu, _ as Gu, W as Qu } from "./useUploadFiles-CH6GsXdo.js";
10
10
  import * as sn from "@radix-ui/react-tooltip";
11
11
  import { Slot as Xu } from "@radix-ui/react-slot";
12
12
  import * as de from "@radix-ui/react-dropdown-menu";
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./widget.ctx-CKRA-jh1.cjs");exports.PrimitiveState=t.PrimitiveState;exports.WidgetCtx=t.WidgetCtx;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./widget.ctx-DUaeXkNb.cjs");exports.PrimitiveState=t.PrimitiveState;exports.WidgetCtx=t.WidgetCtx;
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { P as i, W as a } from "./widget.ctx-DJ72-NkO.js";
1
+ import { P as i, W as a } from "./widget.ctx-_0XFPUpq.js";
2
2
  export {
3
3
  i as PrimitiveState,
4
4
  a as WidgetCtx
package/dist/react.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useUploadFiles-BWQeisCa.cjs");function a(t,s,u){const{widgetCtx:{api:i}}=e.useWidget();return e._default(async o=>i.vote({action:o==="up"?"upvote":"downvote",messagePublicId:t,sessionId:s}).then(u),[i,t,s,u])}exports.WidgetProvider=e.WidgetProvider;exports.useConfig=e.useConfig;exports.useContact=e.useContact;exports.useIsAwaitingBotReply=e.useIsAwaitingBotReply;exports.useMessages=e.useMessages;exports.usePreludeData=e.usePreludeData;exports.usePrimitiveState=e.usePrimitiveState;exports.useSessions=e.useSessions;exports.useUploadFiles=e.useUploadFiles;exports.useWidget=e.useWidget;exports.useWidgetRouter=e.useWidgetRouter;exports.useVote=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useUploadFiles-YqK_0IBo.cjs");function a(t,s,u){const{widgetCtx:{api:i}}=e.useWidget();return e._default(async o=>i.vote({action:o==="up"?"upvote":"downvote",messagePublicId:t,sessionId:s}).then(u),[i,t,s,u])}exports.WidgetProvider=e.WidgetProvider;exports.useConfig=e.useConfig;exports.useContact=e.useContact;exports.useIsAwaitingBotReply=e.useIsAwaitingBotReply;exports.useMessages=e.useMessages;exports.usePreludeData=e.usePreludeData;exports.usePrimitiveState=e.usePrimitiveState;exports.useSessions=e.useSessions;exports.useUploadFiles=e.useUploadFiles;exports.useWidget=e.useWidget;exports.useWidgetRouter=e.useWidgetRouter;exports.useVote=a;
2
2
  //# sourceMappingURL=react.cjs.map
package/dist/react.js CHANGED
@@ -1,5 +1,5 @@
1
- import { u as o, _ as i } from "./useUploadFiles-CrnVSGnL.js";
2
- import { W as p, a as f, b as l, c, d as m, e as v, f as P, g as W, i as w, h as x } from "./useUploadFiles-CrnVSGnL.js";
1
+ import { u as o, _ as i } from "./useUploadFiles-CH6GsXdo.js";
2
+ import { W as p, a as f, b as l, c, d as m, e as v, f as P, g as W, i as w, h as x } from "./useUploadFiles-CH6GsXdo.js";
3
3
  function n(e, s, t) {
4
4
  const {
5
5
  widgetCtx: { api: a }
@@ -1,6 +1,6 @@
1
1
  import z, { createContext as rt, useContext as ot, useRef as H, useState as st, useMemo as Ve, useEffect as Fe, useSyncExternalStore as Kt, useLayoutEffect as zt, useCallback as Ee, useDebugValue as Yt } from "react";
2
2
  import { jsx as kt } from "react/jsx-runtime";
3
- import { W as Jt } from "./widget.ctx-DJ72-NkO.js";
3
+ import { W as Jt } from "./widget.ctx-_0XFPUpq.js";
4
4
  import { v4 as Xt } from "uuid";
5
5
  class Qt {
6
6
  constructor(t) {
@@ -36,7 +36,7 @@ function Zt(e) {
36
36
  return r;
37
37
  }, t.Provider];
38
38
  }
39
- const en = "3.0.57", [Y, tn] = Zt();
39
+ const en = "3.0.58", [Y, tn] = Zt();
40
40
  function Xn({
41
41
  options: e,
42
42
  children: t,
@@ -1330,4 +1330,4 @@ export {
1330
1330
  nr as k,
1331
1331
  Y as u
1332
1332
  };
1333
- //# sourceMappingURL=useUploadFiles-CrnVSGnL.js.map
1333
+ //# sourceMappingURL=useUploadFiles-CH6GsXdo.js.map