diff --git a/assets/index-2a695437.js b/assets/index-2a695437.js index 64aab1c..fd7f13e 100644 --- a/assets/index-2a695437.js +++ b/assets/index-2a695437.js @@ -387,4 +387,4 @@ Error generating stack: `+i.message+` `)},ZO=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=b.useMemo(function(){return qO(o)},[o]);return b.createElement(XO,{styles:QO(i,!t,o,n?"":"!important")})},bh=!1;if(typeof window<"u")try{var tl=Object.defineProperty({},"passive",{get:function(){return bh=!0,!0}});window.addEventListener("test",tl,tl),window.removeEventListener("test",tl,tl)}catch{bh=!1}var So=bh?{passive:!1}:!1,JO=function(e){return e.tagName==="TEXTAREA"},ik=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!JO(e)&&n[t]==="visible")},eB=function(e){return ik(e,"overflowY")},tB=function(e){return ik(e,"overflowX")},ky=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=ak(e,r);if(o){var i=sk(e,r),a=i[1],s=i[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},nB=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},rB=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ak=function(e,t){return e==="v"?eB(t):tB(t)},sk=function(e,t){return e==="v"?nB(t):rB(t)},oB=function(e,t){return e==="h"&&t==="rtl"?-1:1},iB=function(e,t,n,r,o){var i=oB(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,l=t.contains(s),u=!1,c=a>0,d=0,f=0;do{var h=sk(e,s),m=h[0],v=h[1],x=h[2],g=v-x-i*m;(m||g)&&ak(e,s)&&(d+=g,f+=m),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(c&&(o&&d===0||!o&&a>d)||!c&&(o&&f===0||!o&&-a>f))&&(u=!0),u},nl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Cy=function(e){return[e.deltaX,e.deltaY]},_y=function(e){return e&&"current"in e?e.current:e},aB=function(e,t){return e[0]===t[0]&&e[1]===t[1]},sB=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},lB=0,xo=[];function uB(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),o=b.useState(lB++)[0],i=b.useState(ok)[0],a=b.useRef(e);b.useEffect(function(){a.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=JL([e.lockRef.current],(e.shards||[]).map(_y),!0).filter(Boolean);return v.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=b.useCallback(function(v,x){if("touches"in v&&v.touches.length===2)return!a.current.allowPinchZoom;var g=nl(v),p=n.current,y="deltaX"in v?v.deltaX:p[0]-g[0],w="deltaY"in v?v.deltaY:p[1]-g[1],P,R=v.target,T=Math.abs(y)>Math.abs(w)?"h":"v";if("touches"in v&&T==="h"&&R.type==="range")return!1;var E=ky(T,R);if(!E)return!0;if(E?P=T:(P=T==="v"?"h":"v",E=ky(T,R)),!E)return!1;if(!r.current&&"changedTouches"in v&&(y||w)&&(r.current=P),!P)return!0;var F=r.current||P;return iB(F,x,v,F==="h"?y:w,!0)},[]),l=b.useCallback(function(v){var x=v;if(!(!xo.length||xo[xo.length-1]!==i)){var g="deltaY"in x?Cy(x):nl(x),p=t.current.filter(function(P){return P.name===x.type&&P.target===x.target&&aB(P.delta,g)})[0];if(p&&p.should){x.cancelable&&x.preventDefault();return}if(!p){var y=(a.current.shards||[]).map(_y).filter(Boolean).filter(function(P){return P.contains(x.target)}),w=y.length>0?s(x,y[0]):!a.current.noIsolation;w&&x.cancelable&&x.preventDefault()}}},[]),u=b.useCallback(function(v,x,g,p){var y={name:v,delta:x,target:g,should:p};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(w){return w!==y})},1)},[]),c=b.useCallback(function(v){n.current=nl(v),r.current=void 0},[]),d=b.useCallback(function(v){u(v.type,Cy(v),v.target,s(v,e.lockRef.current))},[]),f=b.useCallback(function(v){u(v.type,nl(v),v.target,s(v,e.lockRef.current))},[]);b.useEffect(function(){return xo.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,So),document.addEventListener("touchmove",l,So),document.addEventListener("touchstart",c,So),function(){xo=xo.filter(function(v){return v!==i}),document.removeEventListener("wheel",l,So),document.removeEventListener("touchmove",l,So),document.removeEventListener("touchstart",c,So)}},[]);var h=e.removeScrollBar,m=e.inert;return b.createElement(b.Fragment,null,m?b.createElement(i,{styles:sB(o)}):null,h?b.createElement(ZO,{gapMode:e.gapMode}):null)}const cB=e6(rk,uB);var lk=b.forwardRef(function(e,t){return b.createElement(dc,mn({},e,{ref:t,sideCar:cB}))});lk.classNames=dc.classNames;const dB=lk;function fB(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:i,allowPinchZoom:a,finalFocusRef:s,returnFocusOnClose:l,preserveScrollBarGap:u,lockFocusAcrossFrames:c,isOpen:d}=xm(),[f,h]=Nx();b.useEffect(()=>{!f&&h&&setTimeout(h)},[f,h]);const m=Jw(r,d);return k(Hw,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:s,restoreFocus:l,contentRef:r,lockFocusAcrossFrames:c,children:k(dB,{removeScrollBar:!u,allowPinchZoom:a,enabled:m===1&&i,forwardProps:!0,children:e.children})})}var[hB,pB]=Ot(),mB={start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}};function gB(e,t){var n,r;if(e)return(r=(n=mB[e])==null?void 0:n[t])!=null?r:e}function vB(e){var t;const{isOpen:n,onClose:r,placement:o="right",children:i,...a}=e,s=os(),l=(t=s.components)==null?void 0:t.Drawer,u=gB(o,s.direction);return k(hB,{value:{placement:u},children:k(nk,{isOpen:n,onClose:r,styleConfig:l,...a,children:i})})}var yB=W(sw),uk=ne((e,t)=>{const{className:n,children:r,motionProps:o,containerProps:i,...a}=e,{getDialogProps:s,getDialogContainerProps:l,isOpen:u}=xm(),c=s(a,t),d=l(i),f=Se("chakra-modal__content",n),h=tk(),m={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...h.dialog},v={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...h.dialogContainer},{placement:x}=pB();return k(fB,{children:k(W.div,{...d,className:"chakra-modal__content-container",__css:v,children:k(yB,{motionProps:o,direction:x,in:u,className:f,...c,__css:m,children:r})})})});uk.displayName="DrawerContent";var bB=W(ac.div),ck=ne((e,t)=>{const{className:n,transition:r,motionProps:o,...i}=e,a=Se("chakra-modal__overlay",n),l={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...tk().overlay},{motionPreset:u}=xm();return k(bB,{...o||(u==="none"?{}:aw),__css:l,ref:t,className:a,...i})});ck.displayName="ModalOverlay";function SB(e){return e&&at(e)&&at(e.target)}function xB(e={}){const{onChange:t,value:n,defaultValue:r,name:o,isDisabled:i,isFocusable:a,isNative:s,...l}=e,[u,c]=b.useState(r||""),d=typeof n<"u",f=d?n:u,h=b.useRef(null),m=b.useCallback(()=>{const P=h.current;if(!P)return;let R="input:not(:disabled):checked";const T=P.querySelector(R);if(T){T.focus();return}R="input:not(:disabled)";const E=P.querySelector(R);E==null||E.focus()},[]),x=`radio-${b.useId()}`,g=o||x,p=b.useCallback(P=>{const R=SB(P)?P.target.value:P;d||c(R),t==null||t(String(R))},[t,d]),y=b.useCallback((P={},R=null)=>({...P,ref:_r(R,h),role:"radiogroup"}),[]),w=b.useCallback((P={},R=null)=>({...P,ref:R,name:g,[s?"checked":"isChecked"]:f!=null?P.value===f:void 0,onChange(E){p(E)},"data-radiogroup":!0}),[s,g,p,f]);return{getRootProps:y,getRadioProps:w,name:g,ref:h,focus:m,setValue:c,value:f,onChange:p,isDisabled:i,isFocusable:a,htmlProps:l}}var[wB,dk]=Ot({name:"RadioGroupContext",strict:!1}),fk=ne((e,t)=>{const{colorScheme:n,size:r,variant:o,children:i,className:a,isDisabled:s,isFocusable:l,...u}=e,{value:c,onChange:d,getRootProps:f,name:h,htmlProps:m}=xB(u),v=b.useMemo(()=>({name:h,size:r,onChange:d,colorScheme:n,value:c,variant:o,isDisabled:s,isFocusable:l}),[h,r,d,n,c,o,s,l]);return k(wB,{value:v,children:k(W.div,{...f(m,t),className:Se("chakra-radio-group",a),children:i})})});fk.displayName="RadioGroup";var kB={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function CB(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:o,isReadOnly:i,isRequired:a,onChange:s,isInvalid:l,name:u,value:c,id:d,"data-radiogroup":f,"aria-describedby":h,...m}=e,v=`radio-${b.useId()}`,x=im(),p=!!dk()||!!f;let w=!!x&&!p?x.id:v;w=d??w;const P=o??(x==null?void 0:x.isDisabled),R=i??(x==null?void 0:x.isReadOnly),T=a??(x==null?void 0:x.isRequired),E=l??(x==null?void 0:x.isInvalid),[F,I]=b.useState(!1),[U,re]=b.useState(!1),[j,K]=b.useState(!1),[oe,me]=b.useState(!1),[$e,M]=b.useState(!!t),L=typeof n<"u",O=L?n:$e;b.useEffect(()=>fw(I),[]);const B=b.useCallback(Y=>{if(R||P){Y.preventDefault();return}L||M(Y.target.checked),s==null||s(Y)},[L,P,R,s]),Q=b.useCallback(Y=>{Y.key===" "&&me(!0)},[me]),H=b.useCallback(Y=>{Y.key===" "&&me(!1)},[me]),ie=b.useCallback((Y={},lt=null)=>({...Y,ref:lt,"data-active":q(oe),"data-hover":q(j),"data-disabled":q(P),"data-invalid":q(E),"data-checked":q(O),"data-focus":q(U),"data-focus-visible":q(U&&F),"data-readonly":q(R),"aria-hidden":!0,onMouseDown:ye(Y.onMouseDown,()=>me(!0)),onMouseUp:ye(Y.onMouseUp,()=>me(!1)),onMouseEnter:ye(Y.onMouseEnter,()=>K(!0)),onMouseLeave:ye(Y.onMouseLeave,()=>K(!1))}),[oe,j,P,E,O,U,R,F]),{onFocus:tt,onBlur:ge}=x??{},Re=b.useCallback((Y={},lt=null)=>{const qn=P&&!r;return{...Y,id:w,ref:lt,type:"radio",name:u,value:c,onChange:ye(Y.onChange,B),onBlur:ye(ge,Y.onBlur,()=>re(!1)),onFocus:ye(tt,Y.onFocus,()=>re(!0)),onKeyDown:ye(Y.onKeyDown,Q),onKeyUp:ye(Y.onKeyUp,H),checked:O,disabled:qn,readOnly:R,required:T,"aria-invalid":Yo(E),"aria-disabled":Yo(qn),"aria-required":Yo(T),"data-readonly":q(R),"aria-describedby":h,style:kB}},[P,r,w,u,c,B,ge,tt,Q,H,O,R,T,E,h]);return{state:{isInvalid:E,isFocused:U,isChecked:O,isActive:oe,isHovered:j,isDisabled:P,isReadOnly:R,isRequired:T},getCheckboxProps:ie,getRadioProps:ie,getInputProps:Re,getLabelProps:(Y={},lt=null)=>({...Y,ref:lt,onMouseDown:ye(Y.onMouseDown,_B),"data-disabled":q(P),"data-checked":q(O),"data-invalid":q(E)}),getRootProps:(Y,lt=null)=>({...Y,ref:lt,"data-disabled":q(P),"data-checked":q(O),"data-invalid":q(E)}),htmlProps:m}}function _B(e){e.preventDefault(),e.stopPropagation()}function PB(e,t){const n={},r={};for(const[o,i]of Object.entries(e))t.includes(o)?n[o]=i:r[o]=i;return[n,r]}var Sh=ne((e,t)=>{var n;const r=dk(),{onChange:o,value:i}=e,a=uo("Radio",{...r,...e}),s=Bt(e),{spacing:l="0.5rem",children:u,isDisabled:c=r==null?void 0:r.isDisabled,isFocusable:d=r==null?void 0:r.isFocusable,inputProps:f,...h}=s;let m=e.isChecked;(r==null?void 0:r.value)!=null&&i!=null&&(m=r.value===i);let v=o;r!=null&&r.onChange&&i!=null&&(v=gT(r.onChange,o));const x=(n=e==null?void 0:e.name)!=null?n:r==null?void 0:r.name,{getInputProps:g,getCheckboxProps:p,getLabelProps:y,getRootProps:w,htmlProps:P}=CB({...h,isChecked:m,isFocusable:d,isDisabled:c,onChange:v,name:x}),[R,T]=PB(P,SE),E=p(T),F=g(f,t),I=y(),U=Object.assign({},R,w()),re={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...a.container},j={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...a.control},K={userSelect:"none",marginStart:l,...a.label};return fe(W.label,{className:"chakra-radio",...U,__css:re,children:[k("input",{className:"chakra-radio__input",...F}),k(W.span,{className:"chakra-radio__control",...E,__css:j}),u&&k(W.span,{className:"chakra-radio__label",...I,__css:K,children:u})]})});Sh.displayName="Radio";var hk=ne(function(t,n){const r=uo("Switch",t),{spacing:o="0.5rem",children:i,...a}=Bt(t),{state:s,getInputProps:l,getCheckboxProps:u,getRootProps:c,getLabelProps:d}=UL(a),f=b.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),h=b.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),m=b.useMemo(()=>({userSelect:"none",marginStart:o,...r.label}),[o,r.label]);return fe(W.label,{...c(),className:Se("chakra-switch",t.className),__css:f,children:[k("input",{className:"chakra-switch__input",...l({},n)}),k(W.span,{...u(),className:"chakra-switch__track",__css:h,children:k(W.span,{__css:r.thumb,className:"chakra-switch__thumb","data-checked":q(s.isChecked),"data-hover":q(s.isHovered)})}),i&&k(W.span,{className:"chakra-switch__label",...d(),__css:m,children:i})]})});hk.displayName="Switch";var pk={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Py=St.createContext&&St.createContext(pk),Sr=globalThis&&globalThis.__assign||function(){return Sr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{const{toggleColorMode:e,colorMode:t}=is(),n=kr("yellow.500","blue.700");return fe(ps,{bg:n,padding:1,paddingRight:3,paddingLeft:3,borderRadius:3,w:"120px",children:[k(xn,{w:"50x",mt:"-1px",alignItems:"center",px:"1",children:k(Vn,{color:"white",fontWeight:t==="dark"?"semibold":"bold",children:t==="dark"?"Night":"Day"})}),k(hk,{colorScheme:"blue",isChecked:t=="dark",onChange:e})]})},RB=({onOpen:e})=>{const t=cc({base:"base",md:"md"});return fe(ps,{justifyContent:"space-between",justify:"center",children:[k(Gr,{below:"md",children:k(bi,{colorScheme:"none",onClick:e,children:k($B,{color:"white"})})}),k(Gr,{above:"md",children:k(xn,{w:"120px"})}),k(gh,{}),k(Vn,{fontSize:t==="md"?"4xl":"2xl",fontWeight:"bold",color:"#FFFFFF",children:"AkinatorGPT"}),k(Gr,{below:"md",children:k(Xa,{boxSize:"48px"})}),k(gh,{}),k(Gr,{above:"md",children:k(xn,{width:"fit-content",children:k(gk,{})})})]})},AB="/assets/akinatorLogo-7a0a4a06.png",MB="/assets/userLogo-8bc85902.png",FB=({sender:e,text:t})=>{const n=kr("#FFFFFF","#343541"),r=kr("#F7F7F8","#444654");return k(ao,{children:fe(ps,{bg:e===0?r:n,w:"100%",h:"fit-content",padding:5,justifyContent:"center",alignItems:"top",children:[k(Xa,{boxSize:"50px",borderRadius:5,overflow:"hidden",boxShadow:e===0?"lg":"",children:e===0&&k(sh,{boxSize:"50px",objectFit:"cover",src:AB,border:"0px"})}),k(Vn,{w:"calc(100% - 120px)",textAlign:e===0?"left":"right",wordBreak:"break-word",padding:3,children:t}),k(Xa,{boxSize:"50px",bg:r,borderRadius:5,overflow:"hidden",boxShadow:e===1?"lg":"",children:e===1&&k(sh,{boxSize:"50px",objectFit:"cover",src:MB,border:"0px"})})]})})},IB=({chat:e})=>fe(pi,{h:"100%",w:"100%",overflowY:"scroll",overflowX:"hidden",sx:{"&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar:hover":{width:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"gray.300",borderRadius:"md"},position:"relative",zIndex:"2"},children:[e.map(t=>k(FB,{sender:t.who,text:t.dialog},t.ID)),"console.log(dummyChat)"]});function zB(e){return Si({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M1.946 9.315c-.522-.174-.527-.455.01-.634l19.087-6.362c.529-.176.832.12.684.638l-5.454 19.086c-.15.529-.455.547-.679.045L12 14l6-8-8 6-8.054-2.685z"}}]}]})(e)}const DB=({inputValue:e,handleInputChange:t,handleButtonClick:n,handleInputEnter:r})=>{const o=kr("black","white");return k(ao,{children:fe(am,{padding:5,children:[fe(Uw,{children:[k(vm,{value:e,onChange:t,onKeyDown:r,type:"string",placeholder:"Send a message...",boxShadow:"lg",p:6,rounded:"md",border:"0px",w:"100%"}),k(gm,{mr:2,mt:1,children:k(bi,{colorScheme:"none",size:"sm",onClick:n,children:k(zB,{color:o,size:"40px"})})})]}),k(cw,{padding:2,children:"Did you know that a group of flamingos is called a flamboyance?"})]})})},LB=({inputValue:e,setInputValue:t,outputValue:n,setOutputValue:r,handleInputChange:o,handleButtonClick:i,handleInputEnter:a,chat:s,onOpen:l})=>{const u=kr("#202123","#343541"),c=kr("#202123","#FFFFFF"),d=cc({base:"base",md:"md"});return k(ao,{children:fe(ym,{templateAreas:'"topBar" "chatContainer" "inputContainer"',w:"100%",h:"100%",children:[k(ri,{area:"topBar",borderBottom:"1px",borderColor:c,bg:u,h:"fit-content",w:"100%",children:k(RB,{onOpen:l})}),k(ri,{area:"chatContainer",h:d==="md"?"calc(100vh - 186px)":"calc(100vh - 180px)",w:"100%",alignContent:"flex-start",children:k(IB,{chat:s})}),k(ri,{area:"inputContainer",borderTop:"1px",borderColor:c,h:"fit-content",w:"100%",children:k(DB,{inputValue:e,setInputValue:t,outputValue:n,setOutputValue:r,handleInputChange:o,handleButtonClick:i,handleInputEnter:a})})]})})};function OB(e){return Si({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M416 277.333H277.333V416h-42.666V277.333H96v-42.666h138.667V96h42.666v138.667H416v42.666z"}}]})(e)}function BB(e){return Si({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.496 6.033h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.286a.237.237 0 0 0 .241.247zm2.325 6.443c.61 0 1.029-.394 1.029-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94 0 .533.425.927 1.01.927z"}}]})(e)}function NB(e){return Si({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 1a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4.414A2 2 0 0 0 3 11.586l-2 2V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12.793a.5.5 0 0 0 .854.353l2.853-2.853A1 1 0 0 1 4.414 12H14a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"}}]})(e)}function VB({hist:e,selectedId:t,handleSelectList:n,switchChatHistory:r}){const o=i=>{n(i),r(i)};return k(xn,{ml:"-6",children:e.map(i=>k(bi,{variant:i.ID===t?"solid":"ghost",height:"48px",width:"235px",borderRadius:"8px",justifyContent:"flex-start",leftIcon:k(NB,{color:"white"}),_active:{bg:"#343541",transform:"scale(0.98)"},overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",onClick:()=>{o(i.ID)},children:k(xn,{style:{WebkitMaskImage:"linear-gradient(to left, transparent 0%, black 10%, black 100%)"},marginLeft:-4,w:"calc(100% - 10px)",children:k(Vn,{marginLeft:2,marginBottom:1,fontWeight:"normal",children:i.title})})},i.ID))})}const jB=({selectedVal:e,handleChage:t})=>k(am,{as:"fieldset",children:k(fk,{value:e,onChange:t,children:fe(pi,{spacing:"2",align:"flex-start",marginLeft:"75px",marginBottom:2,children:[k(Sh,{value:"KMP",children:"KMP"}),k(Sh,{value:"BM",children:"BM"})]})})});function WB(e){return Si({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M511.6 76.3C264.3 76.2 64 276.4 64 523.5 64 718.9 189.3 885 363.8 946c23.5 5.9 19.9-10.8 19.9-22.2v-77.5c-135.7 15.9-141.2-73.9-150.3-88.9C215 726 171.5 718 184.5 703c30.9-15.9 62.4 4 98.9 57.9 26.4 39.1 77.9 32.5 104 26 5.7-23.5 17.9-44.5 34.7-60.8-140.6-25.2-199.2-111-199.2-213 0-49.5 16.3-95 48.3-131.7-20.4-60.5 1.9-112.3 4.9-120 58.1-5.2 118.5 41.6 123.2 45.3 33-8.9 70.7-13.6 112.9-13.6 42.4 0 80.2 4.9 113.5 13.9 11.3-8.6 67.3-48.8 121.3-43.9 2.9 7.7 24.7 58.3 5.5 118 32.4 36.8 48.9 82.7 48.9 132.3 0 102.2-59 188.1-200 212.9a127.5 127.5 0 0 1 38.1 91v112.5c.8 9 0 17.9 15 17.9 177.1-59.7 304.6-227 304.6-424.1 0-247.2-200.4-447.3-447.5-447.3z"}}]})(e)}const HB=({selectedVal:e,handleChage:t})=>fe(ao,{children:[fe(pi,{bg:"#40414F",borderRadius:"10",children:[k(Vn,{fontSize:"24",fontWeight:"semibold",marginTop:2,marginBottom:1,children:"Algorithm"}),k(Qw,{borderWidth:2,overflow:"hidden"}),k(jB,{selectedVal:e,handleChage:t})]}),fe(pi,{marginTop:1,spacing:"0px",children:[k(Gr,{below:"md",children:k(xn,{px:"0",marginLeft:"52px",marginTop:2,children:k(gk,{})})}),fe(ps,{padding:2,children:[k(Vn,{fontSize:18,marginTop:-.5,children:"How to use"}),k(uw,{icon:k(BB,{color:"white"}),"aria-label":"Home",colorScheme:"none",size:"none"})]}),k(Xw,{href:"https://github.com/farhanfahreezy/Tubes3_13521058",display:"flex",alignItems:"center",target:"_blank",_hover:{color:"green.300"},children:k(WB,{size:"40px"})}),k(Vn,{children:"v1.0"})]})]});function Ty({selectedId:e,handleSelectList:t,selectedVal:n,handleChage:r,switchChatHistory:o,historyList:i,addHistoryList:a}){const s=cc({base:"base",md:"md"});return k(ao,{children:fe(pi,{textColor:"#FFFFFF",children:[k(xn,{h:"auto",mt:"2",ml:"-2",children:k(bi,{variant:"outline",height:"48px",width:"235px",border:"1px",borderRadius:"8px",justifyContent:"flex-start",_active:{bg:"#343541",transform:"scale(0.98)"},leftIcon:k(OB,{color:"white"}),marginLeft:0,onClick:a,children:k(Vn,{marginLeft:0,marginBottom:1,children:"New Chat"})})}),k(xn,{h:s=="md"?"calc(100vh - 338px)":"calc(100vh - 374px)",overflowY:"scroll",overflowX:"hidden",sx:{"&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar:hover":{width:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"gray.300",borderRadius:"md"},position:"relative",zIndex:"2"},children:k(VB,{hist:i,selectedId:e,handleSelectList:t,switchChatHistory:o})}),k(xn,{h:"auto",padding:3,borderTop:"1px",children:k(HB,{selectedVal:n,handleChage:r})})]})})}function UB(){const[e,t]=b.useState(-1),[n,r]=b.useState("KMP"),[o,i]=b.useState(""),[a,s]=b.useState(""),[l,u]=b.useState([]),[c,d]=b.useState([]),[f,h]=b.useState(0),{isOpen:m,onOpen:v,onClose:x}=pO(),g=kr("#202123","#202123"),p=kr("FFFFFF","#343541"),y=cc({base:"base",md:"md"}),w=()=>{h(f+1)},P=()=>{const j={title:"New Chat",ID:f};w(),d([...c,j])},R=j=>{if(j!==""){const K={ID:2,number:0,who:1,dialog:j};u([...l,K])}},T=j=>{u([{ID:2,number:0,who:1,dialog:"Hi there, hows your day going?"},{ID:3,number:0,who:0,dialog:"It’s going pretty well, thanks for asking. How about you?"},{ID:4,number:0,who:1,dialog:"I’m doing pretty good, thanks. Have you done anything fun today?"},{ID:5,number:0,who:0,dialog:"Yeah, I went for a hike in the mountains earlier. It was beautiful."},{ID:6,number:0,who:1,dialog:"That sounds like a great way to spend the day. Did you take any pictures?"},{ID:7,number:0,who:0,dialog:"Yeah, I did. I can show them to you later if you want."},{ID:8,number:0,who:1,dialog:"Sure, that would be great. What kind of camera do you use?"},{ID:23,number:0,who:0,dialog:"Yeah, I’ve played a few shows at local bars and cafes. It’s a great way to connect with other musicians."}])},E=j=>{t(j)},F=j=>{r(j)};return fe(ao,{children:[fe(ym,{templateAreas:{base:'"mainWindow"',md:'"sidebar mainWindow"'},children:[k(Gr,{above:"md",children:k(ri,{area:"sidebar",bg:g,h:"100vh",w:"250px",children:k(Ty,{selectedId:e,handleSelectList:E,selectedVal:n,handleChage:F,switchChatHistory:T,historyList:c,addHistoryList:P})})}),k(ri,{area:"mainWindow",bg:p,h:"100vh",w:y==="md"?"calc(100vw - 250px)":"100vw",overflowX:"hidden",overflowY:"hidden",children:k(LB,{inputValue:o,setInputValue:i,outputValue:a,setOutputValue:s,handleInputChange:j=>{i(j.target.value)},handleButtonClick:()=>{s(o),R(o),i("")},handleInputEnter:j=>{j.key==="Enter"&&(s(o),R(o),i(""))},chat:l,onOpen:v})})]}),fe(vB,{placement:"left",onClose:x,isOpen:m,children:[k(ck,{}),k(uk,{bg:g,maxW:"250px",children:k(Ty,{selectedId:e,handleSelectList:E,selectedVal:n,handleChage:F,switchChatHistory:T,historyList:c,addHistoryList:P})})]})]})}const GB={initialColorMode:"dark"},Ey=nM({config:GB});Id.createRoot(document.getElementById("root")).render(k(St.StrictMode,{children:fe(SL,{theme:Ey,children:[k(hT,{initialColorMode:Ey.config.initialColorMode}),k(UB,{})]})})); +`)},lB=0,xo=[];function uB(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),o=b.useState(lB++)[0],i=b.useState(ok)[0],a=b.useRef(e);b.useEffect(function(){a.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=JL([e.lockRef.current],(e.shards||[]).map(_y),!0).filter(Boolean);return v.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=b.useCallback(function(v,x){if("touches"in v&&v.touches.length===2)return!a.current.allowPinchZoom;var g=nl(v),p=n.current,y="deltaX"in v?v.deltaX:p[0]-g[0],w="deltaY"in v?v.deltaY:p[1]-g[1],P,R=v.target,T=Math.abs(y)>Math.abs(w)?"h":"v";if("touches"in v&&T==="h"&&R.type==="range")return!1;var E=ky(T,R);if(!E)return!0;if(E?P=T:(P=T==="v"?"h":"v",E=ky(T,R)),!E)return!1;if(!r.current&&"changedTouches"in v&&(y||w)&&(r.current=P),!P)return!0;var F=r.current||P;return iB(F,x,v,F==="h"?y:w,!0)},[]),l=b.useCallback(function(v){var x=v;if(!(!xo.length||xo[xo.length-1]!==i)){var g="deltaY"in x?Cy(x):nl(x),p=t.current.filter(function(P){return P.name===x.type&&P.target===x.target&&aB(P.delta,g)})[0];if(p&&p.should){x.cancelable&&x.preventDefault();return}if(!p){var y=(a.current.shards||[]).map(_y).filter(Boolean).filter(function(P){return P.contains(x.target)}),w=y.length>0?s(x,y[0]):!a.current.noIsolation;w&&x.cancelable&&x.preventDefault()}}},[]),u=b.useCallback(function(v,x,g,p){var y={name:v,delta:x,target:g,should:p};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(w){return w!==y})},1)},[]),c=b.useCallback(function(v){n.current=nl(v),r.current=void 0},[]),d=b.useCallback(function(v){u(v.type,Cy(v),v.target,s(v,e.lockRef.current))},[]),f=b.useCallback(function(v){u(v.type,nl(v),v.target,s(v,e.lockRef.current))},[]);b.useEffect(function(){return xo.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,So),document.addEventListener("touchmove",l,So),document.addEventListener("touchstart",c,So),function(){xo=xo.filter(function(v){return v!==i}),document.removeEventListener("wheel",l,So),document.removeEventListener("touchmove",l,So),document.removeEventListener("touchstart",c,So)}},[]);var h=e.removeScrollBar,m=e.inert;return b.createElement(b.Fragment,null,m?b.createElement(i,{styles:sB(o)}):null,h?b.createElement(ZO,{gapMode:e.gapMode}):null)}const cB=e6(rk,uB);var lk=b.forwardRef(function(e,t){return b.createElement(dc,mn({},e,{ref:t,sideCar:cB}))});lk.classNames=dc.classNames;const dB=lk;function fB(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:i,allowPinchZoom:a,finalFocusRef:s,returnFocusOnClose:l,preserveScrollBarGap:u,lockFocusAcrossFrames:c,isOpen:d}=xm(),[f,h]=Nx();b.useEffect(()=>{!f&&h&&setTimeout(h)},[f,h]);const m=Jw(r,d);return k(Hw,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:s,restoreFocus:l,contentRef:r,lockFocusAcrossFrames:c,children:k(dB,{removeScrollBar:!u,allowPinchZoom:a,enabled:m===1&&i,forwardProps:!0,children:e.children})})}var[hB,pB]=Ot(),mB={start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}};function gB(e,t){var n,r;if(e)return(r=(n=mB[e])==null?void 0:n[t])!=null?r:e}function vB(e){var t;const{isOpen:n,onClose:r,placement:o="right",children:i,...a}=e,s=os(),l=(t=s.components)==null?void 0:t.Drawer,u=gB(o,s.direction);return k(hB,{value:{placement:u},children:k(nk,{isOpen:n,onClose:r,styleConfig:l,...a,children:i})})}var yB=W(sw),uk=ne((e,t)=>{const{className:n,children:r,motionProps:o,containerProps:i,...a}=e,{getDialogProps:s,getDialogContainerProps:l,isOpen:u}=xm(),c=s(a,t),d=l(i),f=Se("chakra-modal__content",n),h=tk(),m={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...h.dialog},v={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...h.dialogContainer},{placement:x}=pB();return k(fB,{children:k(W.div,{...d,className:"chakra-modal__content-container",__css:v,children:k(yB,{motionProps:o,direction:x,in:u,className:f,...c,__css:m,children:r})})})});uk.displayName="DrawerContent";var bB=W(ac.div),ck=ne((e,t)=>{const{className:n,transition:r,motionProps:o,...i}=e,a=Se("chakra-modal__overlay",n),l={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...tk().overlay},{motionPreset:u}=xm();return k(bB,{...o||(u==="none"?{}:aw),__css:l,ref:t,className:a,...i})});ck.displayName="ModalOverlay";function SB(e){return e&&at(e)&&at(e.target)}function xB(e={}){const{onChange:t,value:n,defaultValue:r,name:o,isDisabled:i,isFocusable:a,isNative:s,...l}=e,[u,c]=b.useState(r||""),d=typeof n<"u",f=d?n:u,h=b.useRef(null),m=b.useCallback(()=>{const P=h.current;if(!P)return;let R="input:not(:disabled):checked";const T=P.querySelector(R);if(T){T.focus();return}R="input:not(:disabled)";const E=P.querySelector(R);E==null||E.focus()},[]),x=`radio-${b.useId()}`,g=o||x,p=b.useCallback(P=>{const R=SB(P)?P.target.value:P;d||c(R),t==null||t(String(R))},[t,d]),y=b.useCallback((P={},R=null)=>({...P,ref:_r(R,h),role:"radiogroup"}),[]),w=b.useCallback((P={},R=null)=>({...P,ref:R,name:g,[s?"checked":"isChecked"]:f!=null?P.value===f:void 0,onChange(E){p(E)},"data-radiogroup":!0}),[s,g,p,f]);return{getRootProps:y,getRadioProps:w,name:g,ref:h,focus:m,setValue:c,value:f,onChange:p,isDisabled:i,isFocusable:a,htmlProps:l}}var[wB,dk]=Ot({name:"RadioGroupContext",strict:!1}),fk=ne((e,t)=>{const{colorScheme:n,size:r,variant:o,children:i,className:a,isDisabled:s,isFocusable:l,...u}=e,{value:c,onChange:d,getRootProps:f,name:h,htmlProps:m}=xB(u),v=b.useMemo(()=>({name:h,size:r,onChange:d,colorScheme:n,value:c,variant:o,isDisabled:s,isFocusable:l}),[h,r,d,n,c,o,s,l]);return k(wB,{value:v,children:k(W.div,{...f(m,t),className:Se("chakra-radio-group",a),children:i})})});fk.displayName="RadioGroup";var kB={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function CB(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:o,isReadOnly:i,isRequired:a,onChange:s,isInvalid:l,name:u,value:c,id:d,"data-radiogroup":f,"aria-describedby":h,...m}=e,v=`radio-${b.useId()}`,x=im(),p=!!dk()||!!f;let w=!!x&&!p?x.id:v;w=d??w;const P=o??(x==null?void 0:x.isDisabled),R=i??(x==null?void 0:x.isReadOnly),T=a??(x==null?void 0:x.isRequired),E=l??(x==null?void 0:x.isInvalid),[F,I]=b.useState(!1),[U,re]=b.useState(!1),[j,K]=b.useState(!1),[oe,me]=b.useState(!1),[$e,M]=b.useState(!!t),L=typeof n<"u",O=L?n:$e;b.useEffect(()=>fw(I),[]);const B=b.useCallback(Y=>{if(R||P){Y.preventDefault();return}L||M(Y.target.checked),s==null||s(Y)},[L,P,R,s]),Q=b.useCallback(Y=>{Y.key===" "&&me(!0)},[me]),H=b.useCallback(Y=>{Y.key===" "&&me(!1)},[me]),ie=b.useCallback((Y={},lt=null)=>({...Y,ref:lt,"data-active":q(oe),"data-hover":q(j),"data-disabled":q(P),"data-invalid":q(E),"data-checked":q(O),"data-focus":q(U),"data-focus-visible":q(U&&F),"data-readonly":q(R),"aria-hidden":!0,onMouseDown:ye(Y.onMouseDown,()=>me(!0)),onMouseUp:ye(Y.onMouseUp,()=>me(!1)),onMouseEnter:ye(Y.onMouseEnter,()=>K(!0)),onMouseLeave:ye(Y.onMouseLeave,()=>K(!1))}),[oe,j,P,E,O,U,R,F]),{onFocus:tt,onBlur:ge}=x??{},Re=b.useCallback((Y={},lt=null)=>{const qn=P&&!r;return{...Y,id:w,ref:lt,type:"radio",name:u,value:c,onChange:ye(Y.onChange,B),onBlur:ye(ge,Y.onBlur,()=>re(!1)),onFocus:ye(tt,Y.onFocus,()=>re(!0)),onKeyDown:ye(Y.onKeyDown,Q),onKeyUp:ye(Y.onKeyUp,H),checked:O,disabled:qn,readOnly:R,required:T,"aria-invalid":Yo(E),"aria-disabled":Yo(qn),"aria-required":Yo(T),"data-readonly":q(R),"aria-describedby":h,style:kB}},[P,r,w,u,c,B,ge,tt,Q,H,O,R,T,E,h]);return{state:{isInvalid:E,isFocused:U,isChecked:O,isActive:oe,isHovered:j,isDisabled:P,isReadOnly:R,isRequired:T},getCheckboxProps:ie,getRadioProps:ie,getInputProps:Re,getLabelProps:(Y={},lt=null)=>({...Y,ref:lt,onMouseDown:ye(Y.onMouseDown,_B),"data-disabled":q(P),"data-checked":q(O),"data-invalid":q(E)}),getRootProps:(Y,lt=null)=>({...Y,ref:lt,"data-disabled":q(P),"data-checked":q(O),"data-invalid":q(E)}),htmlProps:m}}function _B(e){e.preventDefault(),e.stopPropagation()}function PB(e,t){const n={},r={};for(const[o,i]of Object.entries(e))t.includes(o)?n[o]=i:r[o]=i;return[n,r]}var Sh=ne((e,t)=>{var n;const r=dk(),{onChange:o,value:i}=e,a=uo("Radio",{...r,...e}),s=Bt(e),{spacing:l="0.5rem",children:u,isDisabled:c=r==null?void 0:r.isDisabled,isFocusable:d=r==null?void 0:r.isFocusable,inputProps:f,...h}=s;let m=e.isChecked;(r==null?void 0:r.value)!=null&&i!=null&&(m=r.value===i);let v=o;r!=null&&r.onChange&&i!=null&&(v=gT(r.onChange,o));const x=(n=e==null?void 0:e.name)!=null?n:r==null?void 0:r.name,{getInputProps:g,getCheckboxProps:p,getLabelProps:y,getRootProps:w,htmlProps:P}=CB({...h,isChecked:m,isFocusable:d,isDisabled:c,onChange:v,name:x}),[R,T]=PB(P,SE),E=p(T),F=g(f,t),I=y(),U=Object.assign({},R,w()),re={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...a.container},j={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...a.control},K={userSelect:"none",marginStart:l,...a.label};return fe(W.label,{className:"chakra-radio",...U,__css:re,children:[k("input",{className:"chakra-radio__input",...F}),k(W.span,{className:"chakra-radio__control",...E,__css:j}),u&&k(W.span,{className:"chakra-radio__label",...I,__css:K,children:u})]})});Sh.displayName="Radio";var hk=ne(function(t,n){const r=uo("Switch",t),{spacing:o="0.5rem",children:i,...a}=Bt(t),{state:s,getInputProps:l,getCheckboxProps:u,getRootProps:c,getLabelProps:d}=UL(a),f=b.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),h=b.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),m=b.useMemo(()=>({userSelect:"none",marginStart:o,...r.label}),[o,r.label]);return fe(W.label,{...c(),className:Se("chakra-switch",t.className),__css:f,children:[k("input",{className:"chakra-switch__input",...l({},n)}),k(W.span,{...u(),className:"chakra-switch__track",__css:h,children:k(W.span,{__css:r.thumb,className:"chakra-switch__thumb","data-checked":q(s.isChecked),"data-hover":q(s.isHovered)})}),i&&k(W.span,{className:"chakra-switch__label",...d(),__css:m,children:i})]})});hk.displayName="Switch";var pk={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Py=St.createContext&&St.createContext(pk),Sr=globalThis&&globalThis.__assign||function(){return Sr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{const{toggleColorMode:e,colorMode:t}=is(),n=kr("yellow.500","blue.700");return fe(ps,{bg:n,padding:1,paddingRight:3,paddingLeft:3,borderRadius:3,w:"120px",children:[k(xn,{w:"50x",mt:"-1px",alignItems:"center",px:"1",children:k(Vn,{color:"white",fontWeight:t==="dark"?"semibold":"bold",children:t==="dark"?"Night":"Day"})}),k(hk,{colorScheme:"blue",isChecked:t=="dark",onChange:e})]})},RB=({onOpen:e})=>{const t=cc({base:"base",md:"md"});return fe(ps,{justifyContent:"space-between",justify:"center",children:[k(Gr,{below:"md",children:k(bi,{colorScheme:"none",onClick:e,children:k($B,{color:"white"})})}),k(Gr,{above:"md",children:k(xn,{w:"120px"})}),k(gh,{}),k(Vn,{fontSize:t==="md"?"4xl":"2xl",fontWeight:"bold",color:"#FFFFFF",children:"AkinatorGPT"}),k(Gr,{below:"md",children:k(Xa,{boxSize:"48px"})}),k(gh,{}),k(Gr,{above:"md",children:k(xn,{width:"fit-content",children:k(gk,{})})})]})},AB="./assets/akinatorLogo-7a0a4a06.png",MB="./assets/userLogo-8bc85902.png",FB=({sender:e,text:t})=>{const n=kr("#FFFFFF","#343541"),r=kr("#F7F7F8","#444654");return k(ao,{children:fe(ps,{bg:e===0?r:n,w:"100%",h:"fit-content",padding:5,justifyContent:"center",alignItems:"top",children:[k(Xa,{boxSize:"50px",borderRadius:5,overflow:"hidden",boxShadow:e===0?"lg":"",children:e===0&&k(sh,{boxSize:"50px",objectFit:"cover",src:AB,border:"0px"})}),k(Vn,{w:"calc(100% - 120px)",textAlign:e===0?"left":"right",wordBreak:"break-word",padding:3,children:t}),k(Xa,{boxSize:"50px",bg:r,borderRadius:5,overflow:"hidden",boxShadow:e===1?"lg":"",children:e===1&&k(sh,{boxSize:"50px",objectFit:"cover",src:MB,border:"0px"})})]})})},IB=({chat:e})=>fe(pi,{h:"100%",w:"100%",overflowY:"scroll",overflowX:"hidden",sx:{"&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar:hover":{width:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"gray.300",borderRadius:"md"},position:"relative",zIndex:"2"},children:[e.map(t=>k(FB,{sender:t.who,text:t.dialog},t.ID)),"console.log(dummyChat)"]});function zB(e){return Si({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M1.946 9.315c-.522-.174-.527-.455.01-.634l19.087-6.362c.529-.176.832.12.684.638l-5.454 19.086c-.15.529-.455.547-.679.045L12 14l6-8-8 6-8.054-2.685z"}}]}]})(e)}const DB=({inputValue:e,handleInputChange:t,handleButtonClick:n,handleInputEnter:r})=>{const o=kr("black","white");return k(ao,{children:fe(am,{padding:5,children:[fe(Uw,{children:[k(vm,{value:e,onChange:t,onKeyDown:r,type:"string",placeholder:"Send a message...",boxShadow:"lg",p:6,rounded:"md",border:"0px",w:"100%"}),k(gm,{mr:2,mt:1,children:k(bi,{colorScheme:"none",size:"sm",onClick:n,children:k(zB,{color:o,size:"40px"})})})]}),k(cw,{padding:2,children:"Did you know that a group of flamingos is called a flamboyance?"})]})})},LB=({inputValue:e,setInputValue:t,outputValue:n,setOutputValue:r,handleInputChange:o,handleButtonClick:i,handleInputEnter:a,chat:s,onOpen:l})=>{const u=kr("#202123","#343541"),c=kr("#202123","#FFFFFF"),d=cc({base:"base",md:"md"});return k(ao,{children:fe(ym,{templateAreas:'"topBar" "chatContainer" "inputContainer"',w:"100%",h:"100%",children:[k(ri,{area:"topBar",borderBottom:"1px",borderColor:c,bg:u,h:"fit-content",w:"100%",children:k(RB,{onOpen:l})}),k(ri,{area:"chatContainer",h:d==="md"?"calc(100vh - 186px)":"calc(100vh - 180px)",w:"100%",alignContent:"flex-start",children:k(IB,{chat:s})}),k(ri,{area:"inputContainer",borderTop:"1px",borderColor:c,h:"fit-content",w:"100%",children:k(DB,{inputValue:e,setInputValue:t,outputValue:n,setOutputValue:r,handleInputChange:o,handleButtonClick:i,handleInputEnter:a})})]})})};function OB(e){return Si({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M416 277.333H277.333V416h-42.666V277.333H96v-42.666h138.667V96h42.666v138.667H416v42.666z"}}]})(e)}function BB(e){return Si({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.496 6.033h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.286a.237.237 0 0 0 .241.247zm2.325 6.443c.61 0 1.029-.394 1.029-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94 0 .533.425.927 1.01.927z"}}]})(e)}function NB(e){return Si({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 1a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4.414A2 2 0 0 0 3 11.586l-2 2V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12.793a.5.5 0 0 0 .854.353l2.853-2.853A1 1 0 0 1 4.414 12H14a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"}}]})(e)}function VB({hist:e,selectedId:t,handleSelectList:n,switchChatHistory:r}){const o=i=>{n(i),r(i)};return k(xn,{ml:"-6",children:e.map(i=>k(bi,{variant:i.ID===t?"solid":"ghost",height:"48px",width:"235px",borderRadius:"8px",justifyContent:"flex-start",leftIcon:k(NB,{color:"white"}),_active:{bg:"#343541",transform:"scale(0.98)"},overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",onClick:()=>{o(i.ID)},children:k(xn,{style:{WebkitMaskImage:"linear-gradient(to left, transparent 0%, black 10%, black 100%)"},marginLeft:-4,w:"calc(100% - 10px)",children:k(Vn,{marginLeft:2,marginBottom:1,fontWeight:"normal",children:i.title})})},i.ID))})}const jB=({selectedVal:e,handleChage:t})=>k(am,{as:"fieldset",children:k(fk,{value:e,onChange:t,children:fe(pi,{spacing:"2",align:"flex-start",marginLeft:"75px",marginBottom:2,children:[k(Sh,{value:"KMP",children:"KMP"}),k(Sh,{value:"BM",children:"BM"})]})})});function WB(e){return Si({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M511.6 76.3C264.3 76.2 64 276.4 64 523.5 64 718.9 189.3 885 363.8 946c23.5 5.9 19.9-10.8 19.9-22.2v-77.5c-135.7 15.9-141.2-73.9-150.3-88.9C215 726 171.5 718 184.5 703c30.9-15.9 62.4 4 98.9 57.9 26.4 39.1 77.9 32.5 104 26 5.7-23.5 17.9-44.5 34.7-60.8-140.6-25.2-199.2-111-199.2-213 0-49.5 16.3-95 48.3-131.7-20.4-60.5 1.9-112.3 4.9-120 58.1-5.2 118.5 41.6 123.2 45.3 33-8.9 70.7-13.6 112.9-13.6 42.4 0 80.2 4.9 113.5 13.9 11.3-8.6 67.3-48.8 121.3-43.9 2.9 7.7 24.7 58.3 5.5 118 32.4 36.8 48.9 82.7 48.9 132.3 0 102.2-59 188.1-200 212.9a127.5 127.5 0 0 1 38.1 91v112.5c.8 9 0 17.9 15 17.9 177.1-59.7 304.6-227 304.6-424.1 0-247.2-200.4-447.3-447.5-447.3z"}}]})(e)}const HB=({selectedVal:e,handleChage:t})=>fe(ao,{children:[fe(pi,{bg:"#40414F",borderRadius:"10",children:[k(Vn,{fontSize:"24",fontWeight:"semibold",marginTop:2,marginBottom:1,children:"Algorithm"}),k(Qw,{borderWidth:2,overflow:"hidden"}),k(jB,{selectedVal:e,handleChage:t})]}),fe(pi,{marginTop:1,spacing:"0px",children:[k(Gr,{below:"md",children:k(xn,{px:"0",marginLeft:"52px",marginTop:2,children:k(gk,{})})}),fe(ps,{padding:2,children:[k(Vn,{fontSize:18,marginTop:-.5,children:"How to use"}),k(uw,{icon:k(BB,{color:"white"}),"aria-label":"Home",colorScheme:"none",size:"none"})]}),k(Xw,{href:"https://github.com/farhanfahreezy/Tubes3_13521058",display:"flex",alignItems:"center",target:"_blank",_hover:{color:"green.300"},children:k(WB,{size:"40px"})}),k(Vn,{children:"v1.0"})]})]});function Ty({selectedId:e,handleSelectList:t,selectedVal:n,handleChage:r,switchChatHistory:o,historyList:i,addHistoryList:a}){const s=cc({base:"base",md:"md"});return k(ao,{children:fe(pi,{textColor:"#FFFFFF",children:[k(xn,{h:"auto",mt:"2",ml:"-2",children:k(bi,{variant:"outline",height:"48px",width:"235px",border:"1px",borderRadius:"8px",justifyContent:"flex-start",_active:{bg:"#343541",transform:"scale(0.98)"},leftIcon:k(OB,{color:"white"}),marginLeft:0,onClick:a,children:k(Vn,{marginLeft:0,marginBottom:1,children:"New Chat"})})}),k(xn,{h:s=="md"?"calc(100vh - 338px)":"calc(100vh - 374px)",overflowY:"scroll",overflowX:"hidden",sx:{"&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar:hover":{width:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"gray.300",borderRadius:"md"},position:"relative",zIndex:"2"},children:k(VB,{hist:i,selectedId:e,handleSelectList:t,switchChatHistory:o})}),k(xn,{h:"auto",padding:3,borderTop:"1px",children:k(HB,{selectedVal:n,handleChage:r})})]})})}function UB(){const[e,t]=b.useState(-1),[n,r]=b.useState("KMP"),[o,i]=b.useState(""),[a,s]=b.useState(""),[l,u]=b.useState([]),[c,d]=b.useState([]),[f,h]=b.useState(0),{isOpen:m,onOpen:v,onClose:x}=pO(),g=kr("#202123","#202123"),p=kr("FFFFFF","#343541"),y=cc({base:"base",md:"md"}),w=()=>{h(f+1)},P=()=>{const j={title:"New Chat",ID:f};w(),d([...c,j])},R=j=>{if(j!==""){const K={ID:2,number:0,who:1,dialog:j};u([...l,K])}},T=j=>{u([{ID:2,number:0,who:1,dialog:"Hi there, hows your day going?"},{ID:3,number:0,who:0,dialog:"It’s going pretty well, thanks for asking. How about you?"},{ID:4,number:0,who:1,dialog:"I’m doing pretty good, thanks. Have you done anything fun today?"},{ID:5,number:0,who:0,dialog:"Yeah, I went for a hike in the mountains earlier. It was beautiful."},{ID:6,number:0,who:1,dialog:"That sounds like a great way to spend the day. Did you take any pictures?"},{ID:7,number:0,who:0,dialog:"Yeah, I did. I can show them to you later if you want."},{ID:8,number:0,who:1,dialog:"Sure, that would be great. What kind of camera do you use?"},{ID:23,number:0,who:0,dialog:"Yeah, I’ve played a few shows at local bars and cafes. It’s a great way to connect with other musicians."}])},E=j=>{t(j)},F=j=>{r(j)};return fe(ao,{children:[fe(ym,{templateAreas:{base:'"mainWindow"',md:'"sidebar mainWindow"'},children:[k(Gr,{above:"md",children:k(ri,{area:"sidebar",bg:g,h:"100vh",w:"250px",children:k(Ty,{selectedId:e,handleSelectList:E,selectedVal:n,handleChage:F,switchChatHistory:T,historyList:c,addHistoryList:P})})}),k(ri,{area:"mainWindow",bg:p,h:"100vh",w:y==="md"?"calc(100vw - 250px)":"100vw",overflowX:"hidden",overflowY:"hidden",children:k(LB,{inputValue:o,setInputValue:i,outputValue:a,setOutputValue:s,handleInputChange:j=>{i(j.target.value)},handleButtonClick:()=>{s(o),R(o),i("")},handleInputEnter:j=>{j.key==="Enter"&&(s(o),R(o),i(""))},chat:l,onOpen:v})})]}),fe(vB,{placement:"left",onClose:x,isOpen:m,children:[k(ck,{}),k(uk,{bg:g,maxW:"250px",children:k(Ty,{selectedId:e,handleSelectList:E,selectedVal:n,handleChage:F,switchChatHistory:T,historyList:c,addHistoryList:P})})]})]})}const GB={initialColorMode:"dark"},Ey=nM({config:GB});Id.createRoot(document.getElementById("root")).render(k(St.StrictMode,{children:fe(SL,{theme:Ey,children:[k(hT,{initialColorMode:Ey.config.initialColorMode}),k(UB,{})]})}));