react-sigma-chatbox 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(R,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],f):(R=typeof globalThis<"u"?globalThis:R||self,f(R.ReactSigmaChatbox={},R.React))})(this,(function(R,f){"use strict";var H={exports:{}},Y={};/**
1
+ (function(R,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],m):(R=typeof globalThis<"u"?globalThis:R||self,m(R.ReactSigmaChatbox={},R.React))})(this,(function(R,m){"use strict";var B={exports:{}},Y={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var q;function oe(){if(q)return Y;q=1;var r=Symbol.for("react.transitional.element"),u=Symbol.for("react.fragment");function s(o,l,c){var x=null;if(c!==void 0&&(x=""+c),l.key!==void 0&&(x=""+l.key),"key"in l){c={};for(var i in l)i!=="key"&&(c[i]=l[i])}else c=l;return l=c.ref,{$$typeof:r,type:o,key:x,ref:l!==void 0?l:null,props:c}}return Y.Fragment=u,Y.jsx=s,Y.jsxs=s,Y}var U={};/**
9
+ */var q;function oe(){if(q)return Y;q=1;var r=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function s(o,l,d){var p=null;if(d!==void 0&&(p=""+d),l.key!==void 0&&(p=""+l.key),"key"in l){d={};for(var i in l)i!=="key"&&(d[i]=l[i])}else d=l;return l=d.ref,{$$typeof:r,type:o,key:p,ref:l!==void 0?l:null,props:d}}return Y.Fragment=c,Y.jsx=s,Y.jsxs=s,Y}var U={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,14 +14,14 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var ee;function le(){return ee||(ee=1,process.env.NODE_ENV!=="production"&&(function(){function r(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===k?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case _:return"Fragment";case B:return"Profiler";case C:return"StrictMode";case G:return"Suspense";case Q:return"SuspenseList";case Z:return"Activity"}if(typeof t=="object")switch(typeof t.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case S:return"Portal";case J:return t.displayName||"Context";case V:return(t._context.displayName||"Context")+".Consumer";case X:var a=t.render;return t=t.displayName,t||(t=a.displayName||a.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case w:return a=t.displayName||null,a!==null?a:r(t.type)||"Memo";case A:a=t._payload,t=t._init;try{return r(t(a))}catch{}}return null}function u(t){return""+t}function s(t){try{u(t);var a=!1}catch{a=!0}if(a){a=console;var p=a.error,g=typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return p.call(a,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",g),u(t)}}function o(t){if(t===_)return"<>";if(typeof t=="object"&&t!==null&&t.$$typeof===A)return"<...>";try{var a=r(t);return a?"<"+a+">":"<...>"}catch{return"<...>"}}function l(){var t=N.A;return t===null?null:t.getOwner()}function c(){return Error("react-stack-top-frame")}function x(t){if(E.call(t,"key")){var a=Object.getOwnPropertyDescriptor(t,"key").get;if(a&&a.isReactWarning)return!1}return t.key!==void 0}function i(t,a){function p(){L||(L=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",a))}p.isReactWarning=!0,Object.defineProperty(t,"key",{get:p,configurable:!0})}function h(){var t=r(this.type);return D[t]||(D[t]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),t=this.props.ref,t!==void 0?t:null}function n(t,a,p,g,z,K){var b=p.ref;return t={$$typeof:M,type:t,key:a,props:p,_owner:g},(b!==void 0?b:null)!==null?Object.defineProperty(t,"ref",{enumerable:!1,get:h}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(t,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:z}),Object.defineProperty(t,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:K}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}function d(t,a,p,g,z,K){var b=a.children;if(b!==void 0)if(g)if(P(b)){for(g=0;g<b.length;g++)m(b[g]);Object.freeze&&Object.freeze(b)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else m(b);if(E.call(a,"key")){b=r(t);var W=Object.keys(a).filter(function(pe){return pe!=="key"});g=0<W.length?"{key: someKey, "+W.join(": ..., ")+": ...}":"{key: someKey}",ae[b+g]||(W=0<W.length?"{"+W.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var ee;function le(){return ee||(ee=1,process.env.NODE_ENV!=="production"&&(function(){function r(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===k?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case _:return"Fragment";case X:return"Profiler";case S:return"StrictMode";case G:return"Suspense";case Q:return"SuspenseList";case Z:return"Activity"}if(typeof t=="object")switch(typeof t.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case C:return"Portal";case J:return t.displayName||"Context";case z:return(t._context.displayName||"Context")+".Consumer";case H:var a=t.render;return t=t.displayName,t||(t=a.displayName||a.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case w:return a=t.displayName||null,a!==null?a:r(t.type)||"Memo";case A:a=t._payload,t=t._init;try{return r(t(a))}catch{}}return null}function c(t){return""+t}function s(t){try{c(t);var a=!1}catch{a=!0}if(a){a=console;var f=a.error,g=typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return f.call(a,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",g),c(t)}}function o(t){if(t===_)return"<>";if(typeof t=="object"&&t!==null&&t.$$typeof===A)return"<...>";try{var a=r(t);return a?"<"+a+">":"<...>"}catch{return"<...>"}}function l(){var t=N.A;return t===null?null:t.getOwner()}function d(){return Error("react-stack-top-frame")}function p(t){if(E.call(t,"key")){var a=Object.getOwnPropertyDescriptor(t,"key").get;if(a&&a.isReactWarning)return!1}return t.key!==void 0}function i(t,a){function f(){L||(L=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",a))}f.isReactWarning=!0,Object.defineProperty(t,"key",{get:f,configurable:!0})}function h(){var t=r(this.type);return D[t]||(D[t]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),t=this.props.ref,t!==void 0?t:null}function n(t,a,f,g,V,K){var b=f.ref;return t={$$typeof:I,type:t,key:a,props:f,_owner:g},(b!==void 0?b:null)!==null?Object.defineProperty(t,"ref",{enumerable:!1,get:h}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(t,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:V}),Object.defineProperty(t,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:K}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}function u(t,a,f,g,V,K){var b=a.children;if(b!==void 0)if(g)if(P(b)){for(g=0;g<b.length;g++)x(b[g]);Object.freeze&&Object.freeze(b)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else x(b);if(E.call(a,"key")){b=r(t);var W=Object.keys(a).filter(function(ge){return ge!=="key"});g=0<W.length?"{key: someKey, "+W.join(": ..., ")+": ...}":"{key: someKey}",ae[b+g]||(W=0<W.length?"{"+W.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
18
  let props = %s;
19
19
  <%s {...props} />
20
20
  React keys must be passed directly to JSX without using spread:
21
21
  let props = %s;
22
- <%s key={someKey} {...props} />`,g,b,W,b),ae[b+g]=!0)}if(b=null,p!==void 0&&(s(p),b=""+p),x(a)&&(s(a.key),b=""+a.key),"key"in a){p={};for(var $ in a)$!=="key"&&(p[$]=a[$])}else p=a;return b&&i(p,typeof t=="function"?t.displayName||t.name||"Unknown":t),n(t,b,p,l(),z,K)}function m(t){y(t)?t._store&&(t._store.validated=1):typeof t=="object"&&t!==null&&t.$$typeof===A&&(t._payload.status==="fulfilled"?y(t._payload.value)&&t._payload.value._store&&(t._payload.value._store.validated=1):t._store&&(t._store.validated=1))}function y(t){return typeof t=="object"&&t!==null&&t.$$typeof===M}var j=f,M=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),V=Symbol.for("react.consumer"),J=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),k=Symbol.for("react.client.reference"),N=j.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,E=Object.prototype.hasOwnProperty,P=Array.isArray,F=console.createTask?console.createTask:function(){return null};j={react_stack_bottom_frame:function(t){return t()}};var L,D={},ne=j.react_stack_bottom_frame.bind(j,c)(),se=F(o(c)),ae={};U.Fragment=_,U.jsx=function(t,a,p){var g=1e4>N.recentlyCreatedOwnerStacks++;return d(t,a,p,!1,g?Error("react-stack-top-frame"):ne,g?F(o(t)):se)},U.jsxs=function(t,a,p){var g=1e4>N.recentlyCreatedOwnerStacks++;return d(t,a,p,!0,g?Error("react-stack-top-frame"):ne,g?F(o(t)):se)}})()),U}var te;function ie(){return te||(te=1,process.env.NODE_ENV==="production"?H.exports=oe():H.exports=le()),H.exports}var e=ie(),T=(r=>(r.TEXT="text",r.PRODUCT_LIST="product_list",r.LOADING="loading",r))(T||{}),v=(r=>(r.USER="user",r.AI="ai",r))(v||{});const ce=({title:r,primaryColor:u,onClose:s,onReset:o,onToggleExpand:l,isExpanded:c,language:x,onLanguageChange:i})=>{const h=[{value:"en",label:"EN"},{value:"vi",label:"VI"},{value:"ja",label:"JA"}];return e.jsxs("div",{className:"px-4 py-3 flex items-center justify-between border-b border-red-50/50 sticky top-0 z-10 bg-[#fff1f2]/90 backdrop-blur-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-full overflow-hidden bg-white p-0.5 shadow-sm",children:e.jsx("img",{src:"https://fptshop.com.vn/img/bitu/bitu-avatar.png",onError:n=>n.currentTarget.src="https://cdn-icons-png.flaticon.com/512/4712/4712035.png",className:"w-full h-full object-contain",alt:"Bot Icon"})}),e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("h3",{className:"font-bold text-[#1a2b56] text-[14px] leading-tight tracking-tight flex items-center gap-1",children:[r," ",e.jsx("span",{className:"text-red-400 text-[10px]",children:"✨"})]}),e.jsxs("span",{className:"text-[10px] text-green-500 font-medium flex items-center gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 bg-green-500 rounded-full animate-pulse"}),"Online"]})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs("div",{className:"relative group mr-1",children:[e.jsx("select",{value:x,onChange:n=>i(n.target.value),className:"appearance-none bg-white/50 border border-gray-200 rounded-lg px-2 pr-5 py-1 text-[10px] font-black text-indigo-600 cursor-pointer hover:bg-white transition-all focus:outline-none focus:ring-2 focus:ring-indigo-100 uppercase",title:"Select language",children:h.map(n=>e.jsx("option",{value:n.value,className:"font-sans font-bold",children:n.label},n.value))}),e.jsx("div",{className:"absolute right-1.5 top-1/2 -translate-y-1/2 pointer-events-none text-indigo-400",children:e.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),e.jsx("button",{onClick:o,className:"w-8 h-8 flex items-center justify-center rounded-lg hover:bg-white/60 text-gray-500 hover:text-indigo-600 transition-all",title:"Reset chat",children:e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),e.jsx("path",{d:"M21 3v5h-5"}),e.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),e.jsx("path",{d:"M8 16H3v5"})]})}),e.jsx("button",{onClick:l,className:"w-8 h-8 hidden md:flex items-center justify-center rounded-lg hover:bg-white/60 text-gray-500 hover:text-indigo-600 transition-all",title:c?"Collapse":"Expand",children:c?e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M4 14h6v6"}),e.jsx("path",{d:"M20 10h-6V4"}),e.jsx("path",{d:"M14 10l7-7"}),e.jsx("path",{d:"M10 14l-7 7"})]}):e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M15 3h6v6"}),e.jsx("path",{d:"M9 21H3v-6"}),e.jsx("path",{d:"M21 3l-7 7"}),e.jsx("path",{d:"M3 21l7-7"})]})}),e.jsx("button",{onClick:s,className:"w-8 h-8 flex items-center justify-center rounded-lg hover:bg-red-50 text-gray-500 hover:text-red-500 transition-all",title:"Close",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M18 6 6 18"}),e.jsx("path",{d:"M6 6l12 12"})]})})]})]})},de=({product:r,primaryColor:u})=>e.jsxs("div",{className:"min-w-[170px] max-w-[170px] bg-white rounded-xl border border-gray-50 shadow-sm overflow-hidden flex flex-col hover:shadow-lg transition-all duration-300 group",children:[e.jsxs("div",{className:"relative h-32 w-full bg-white flex items-center justify-center p-2",children:[e.jsx("img",{src:r.image,alt:r.name,className:"h-full w-full object-contain group-hover:scale-105 transition-transform duration-500"}),r.discount&&e.jsx("div",{className:"absolute top-2 left-2 bg-red-600 text-white text-[9px] font-bold px-1.5 py-0.5 rounded-md shadow-sm",children:r.discount})]}),e.jsxs("div",{className:"p-3 flex-1 flex flex-col justify-between border-t border-gray-50",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-[11px] font-bold text-gray-800 line-clamp-2 min-h-[30px] mb-1.5 group-hover:text-red-600 transition-colors",children:r.name}),e.jsxs("div",{className:"mb-2",children:[e.jsx("span",{className:"text-red-600 font-extrabold text-[13px]",children:r.price}),r.oldPrice&&e.jsx("span",{className:"text-[10px] text-gray-400 line-through ml-1 block opacity-60",children:r.oldPrice})]})]}),e.jsx("button",{className:"w-full py-1.5 rounded-lg text-[11px] font-bold border transition-all duration-300 active:scale-95 shadow-sm",style:{borderColor:u,color:u},onMouseEnter:s=>{s.currentTarget.style.backgroundColor=u,s.currentTarget.style.color="white"},onMouseLeave:s=>{s.currentTarget.style.backgroundColor="transparent",s.currentTarget.style.color=u},children:"Chọn mua"})]})]}),O=r=>{const u=/(\*\*.*?\*\*|\[.*?\]\(.*?\))/g;return r.split(u).map((o,l)=>{if(o.startsWith("**")&&o.endsWith("**")){const x=o.slice(2,-2);return e.jsx("strong",{className:"font-bold text-gray-900",children:x},l)}const c=o.match(/\[(.*?)\]\((.*?)\)/);if(c){const[x,i,h]=c;return e.jsx("a",{href:h,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline break-all font-semibold",children:i},l)}return o})},ue=({text:r})=>{const u=r.replace(/\r/g,"").split(`
23
- `),s=[];let o=[],l=!1;const c=x=>{if(o.length>0){const h=o.length>1&&o[1].every(n=>n.trim().match(/^:?-+:?$/))?[o[0],...o.slice(2)]:o;h.length>0&&s.push(e.jsx("div",{className:"my-4 overflow-x-auto border border-slate-200 rounded-xl shadow-sm bg-white",children:e.jsxs("table",{className:"min-w-full border-collapse text-[13px] leading-normal",children:[e.jsx("thead",{className:"bg-slate-50 border-b border-slate-200",children:e.jsx("tr",{children:h[0].map((n,d)=>e.jsx("th",{className:"px-4 py-3 text-left font-bold text-slate-700 border-r last:border-r-0 border-slate-200 whitespace-nowrap",children:O(n.trim())},d))})}),e.jsx("tbody",{className:"divide-y divide-slate-100",children:h.slice(1).map((n,d)=>e.jsx("tr",{className:"hover:bg-slate-50/50 transition-colors",children:n.map((m,y)=>e.jsx("td",{className:"px-4 py-3 text-slate-600 border-r last:border-r-0 border-slate-200 align-top",children:O(m.trim())},y))},d))})]})},`table-wrapper-${x}`)),o=[],l=!1}};return u.forEach((x,i)=>{const h=x.trim();if(h.includes("|")&&(h.startsWith("|")||h.split("|").length>1)){let m=h.split("|");h.startsWith("|")&&m.shift(),h.endsWith("|")&&m.pop(),o.push(m),l=!0;return}else l&&c(i);const n=h.match(/^(#{1,4})\s+(.*)$/);if(n){const m=n[1].length,y=n[2],j=m===1?"text-xl font-bold mb-4 mt-6 first:mt-1":m===2?"text-lg font-bold mb-3 mt-5":"text-[13px] font-black mb-2 mt-5 text-indigo-600 uppercase tracking-widest";s.push(e.jsx("div",{className:j,children:O(y)},i));return}const d=h.match(/^[*+-]\s+(.*)$/);if(d){const m=d[1];s.push(e.jsxs("div",{className:"flex gap-3 pl-1 mb-2 items-start group",children:[e.jsx("span",{className:"text-indigo-400 flex-shrink-0 mt-2 w-1.5 h-1.5 bg-indigo-400 rounded-full group-hover:scale-125 transition-transform"}),e.jsx("div",{className:"flex-1 leading-relaxed text-slate-700",children:O(m)})]},i));return}if(h===""){s.push(e.jsx("div",{className:"h-3"},i));return}s.push(e.jsx("div",{className:"mb-1.5 leading-relaxed text-slate-700",children:O(x)},i))}),l&&c(u.length),e.jsx("div",{className:"markdown-render w-full",children:s})},he=({messages:r,isLoading:u,description:s,quickReplies:o,onQuickReply:l,primaryColor:c,renderMarkdown:x=!1})=>{const i="https://fptshop.com.vn/img/bitu/bitu-avatar.png",h="https://cdn-icons-png.flaticon.com/512/4712/4712035.png";return e.jsxs("div",{className:"flex flex-col gap-8 pb-4",children:[e.jsxs("div",{className:"flex flex-col items-center justify-center pt-4 text-center animate-msg",children:[e.jsx("div",{className:"relative mb-5",children:e.jsx("div",{className:"w-20 h-20 flex items-center justify-center",children:e.jsx("img",{src:i,onError:n=>n.currentTarget.src=h,className:"w-full h-full object-contain",alt:"Sigma AI Hero"})})}),e.jsxs("h2",{className:"text-xl font-bold text-[#1a2b56] flex items-center justify-center gap-1",children:["Sigma ",e.jsx("span",{className:"bg-indigo-600 text-white text-[10px] px-1.5 py-0.5 rounded-md leading-none ml-1 uppercase font-bold tracking-tight",children:"AI"})]}),e.jsx("div",{className:"text-[14px] text-gray-600 mt-3 leading-relaxed px-4 max-w-[280px]",children:s&&e.jsx("div",{className:"bot-description",children:O(s)})})]}),r.map((n,d)=>e.jsxs("div",{className:`flex flex-col animate-msg ${n.sender===v.USER?"items-end":"items-start"}`,style:{animationDelay:`${d*.05}s`},children:[n.sender===v.AI&&e.jsxs("div",{className:"flex items-center gap-1.5 mb-2 ml-1",children:[e.jsx("img",{src:i,onError:m=>m.currentTarget.src=h,className:"w-4 h-4 object-contain",alt:"AI"}),e.jsx("span",{className:"text-[11px] font-bold text-gray-400 uppercase tracking-widest",children:"AI Agent"})]}),e.jsxs("div",{className:`flex flex-col ${n.sender===v.USER?"items-end":"items-start"} w-full max-w-[96%]`,children:[e.jsx("div",{className:`px-4 py-3 rounded-[20px] shadow-sm border border-black/[0.02] overflow-hidden ${n.sender===v.USER?"bg-indigo-600 text-white rounded-tr-none whitespace-pre-line shadow-indigo-100/50":"bg-white text-slate-800 border-none rounded-tl-none"} ${!x||n.sender===v.USER?"whitespace-pre-line":""}`,children:x&&n.sender===v.AI?e.jsx(ue,{text:n.content}):n.content}),n.type===T.PRODUCT_LIST&&n.products&&e.jsx("div",{className:"w-full mt-4 flex gap-4 overflow-x-auto pb-4 pt-1 no-scrollbar snap-x",children:n.products.map(m=>e.jsx("div",{className:"product-card-snap",children:e.jsx(de,{product:m,primaryColor:c})},m.id))}),d===0&&r.length===1&&n.sender===v.AI&&e.jsx("div",{className:"mt-5 flex flex-wrap gap-2.5 w-full",children:o.map((m,y)=>e.jsx("button",{onClick:()=>l(m),className:"px-4 py-2 rounded-full text-[13px] font-semibold border border-transparent bg-white text-gray-600 hover:text-indigo-600 hover:border-indigo-100 transition-all duration-200 shadow-sm active:scale-95",children:m},y))})]})]},n.id)),u&&e.jsxs("div",{className:"flex flex-col gap-1.5 items-start animate-msg",children:[e.jsx("div",{className:"flex items-center gap-1.5 ml-1",children:e.jsx("img",{src:i,onError:n=>n.currentTarget.src=h,className:"w-4 h-4 object-contain",alt:"AI Loading"})}),e.jsxs("div",{className:"flex gap-1.5 bg-white px-4 py-3 rounded-[18px] rounded-tl-none border-none shadow-sm",children:[e.jsx("span",{className:"w-2 h-2 bg-indigo-300 rounded-full animate-sigma-bounce"}),e.jsx("span",{className:"w-2 h-2 bg-indigo-300 rounded-full animate-sigma-bounce [animation-delay:0.2s]"}),e.jsx("span",{className:"w-2 h-2 bg-indigo-300 rounded-full animate-sigma-bounce [animation-delay:0.4s]"})]})]})]})},me=({placeholder:r,onSendMessage:u,primaryColor:s})=>{const[o,l]=f.useState(""),c=()=>{o.trim()&&(u(o),l(""))},x=i=>{i.key==="Enter"&&!i.shiftKey&&(i.preventDefault(),c())};return e.jsx("div",{className:"p-1",children:e.jsxs("div",{className:"relative flex items-center bg-gray-50/50 rounded-2xl border border-gray-100 focus-within:border-indigo-100 focus-within:bg-white transition-all duration-200 pr-2 pl-3 py-1",children:[e.jsx("textarea",{value:o,onChange:i=>l(i.target.value),onKeyDown:x,placeholder:r,rows:1,className:"w-full bg-transparent border-none outline-none focus:ring-0 text-[14px] text-gray-700 font-normal py-3 px-1 resize-none chat-scrollbar min-h-[44px] max-h-[120px] leading-relaxed placeholder:text-gray-400",style:{fontWeight:400}}),e.jsx("button",{onClick:c,disabled:!o.trim(),className:`w-9 h-9 rounded-xl flex-shrink-0 flex items-center justify-center transition-all duration-300 shadow-sm ${o.trim()?"bg-indigo-600 text-white hover:bg-indigo-700 active:scale-95":"bg-gray-200 text-gray-400 cursor-not-allowed"}`,children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"m5 12 7-7 7 7"}),e.jsx("path",{d:"M12 19V5"})]})})]})})},fe=({isOpen:r,onClick:u,primaryColor:s,className:o=""})=>e.jsx("div",{className:`fixed bottom-4 right-4 md:bottom-6 md:right-6 z-[100] ${o}`,children:e.jsx("button",{onClick:u,className:`w-12 h-12 bg-white rounded-2xl shadow-lg flex items-center justify-center border transition-all duration-300 overflow-hidden ${r?"border-indigo-500 ring-4 ring-indigo-50 scale-105 rotate-0":"border-slate-100 hover:scale-110 hover:shadow-xl"}`,children:e.jsx("img",{src:"https://fptshop.com.vn/img/bitu/bitu-avatar.png",className:"w-10 h-10 object-contain",alt:"Bitu",onError:l=>l.currentTarget.src="https://cdn-icons-png.flaticon.com/512/4712/4712035.png"})})}),re=()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),I=(r,u,s)=>typeof r=="object"&&r!==null&&!Array.isArray(r)?r[u]||r.en||Object.values(r)[0]||s:r??s,xe=({config:r,onGetAiResponse:u})=>{const[s,o]=f.useState(!1),[l,c]=f.useState(!1),[x,i]=f.useState(!1),[h,n]=f.useState(re()),[d,m]=f.useState("en"),[y,j]=f.useState([]),[M,S]=f.useState(!1),_=f.useRef(null),C=f.useRef(0);f.useEffect(()=>{const w=I(r.welcomeMessage,d,"Hello!");j([{id:"welcome",type:T.TEXT,sender:v.AI,content:w,timestamp:new Date}])},[]);const B=f.useMemo(()=>I(r.placeholder,d,"Type a message..."),[r.placeholder,d]),V=f.useMemo(()=>I(r.quickReplies,d,[]),[r.quickReplies,d]),J=f.useMemo(()=>I(r.description,d,""),[r.description,d]);f.useEffect(()=>{if(y.length===1&&y[0].id==="welcome"){const w=I(r.welcomeMessage,d,"Hello!");j([{...y[0],content:w}])}},[d]),f.useEffect(()=>{if(s){const w=setTimeout(()=>i(!0),50);return()=>clearTimeout(w)}else i(!1)},[s]),f.useEffect(()=>{_.current&&s&&(_.current.scrollTop=_.current.scrollHeight)},[y,s,M]);const X=async w=>{if(!w.trim()||M)return;const A=++C.current,Z={id:`user-${Date.now()}`,type:T.TEXT,sender:v.USER,content:w,timestamp:new Date};j(k=>[...k,Z]),S(!0);try{const k=u(w,h,d);if(k&&typeof k=="object"&&Symbol.asyncIterator in k){let N="",E=!1;const P=`ai-${Date.now()}`;for await(const F of k){if(A!==C.current)return;E||(j(L=>[...L,{id:P,type:T.TEXT,sender:v.AI,content:"",timestamp:new Date}]),S(!1),E=!0),N+=F,j(L=>L.map(D=>D.id===P?{...D,content:N}:D))}}else{const N=await k;if(A!==C.current)return;S(!1);const E=typeof N=="string"?{text:N,products:void 0}:N;j(P=>[...P,{id:`ai-${Date.now()}`,type:E.products?T.PRODUCT_LIST:T.TEXT,sender:v.AI,content:E.text,products:E.products,timestamp:new Date}])}}catch(k){if(A!==C.current)return;console.error("Chatbox Error:",k),S(!1);const N=d==="vi"?"Hệ thống đang bận, vui lòng thử lại sau.":"System is busy, please try again later.";j(E=>[...E,{id:`err-${Date.now()}`,type:T.TEXT,sender:v.AI,content:N,timestamp:new Date}])}},G=()=>{C.current++,n(re());const w=I(r.welcomeMessage,d,"Hello!");j([{id:"welcome",type:T.TEXT,sender:v.AI,content:w,timestamp:new Date}]),S(!1),c(!1)},Q=`
22
+ <%s key={someKey} {...props} />`,g,b,W,b),ae[b+g]=!0)}if(b=null,f!==void 0&&(s(f),b=""+f),p(a)&&(s(a.key),b=""+a.key),"key"in a){f={};for(var $ in a)$!=="key"&&(f[$]=a[$])}else f=a;return b&&i(f,typeof t=="function"?t.displayName||t.name||"Unknown":t),n(t,b,f,l(),V,K)}function x(t){y(t)?t._store&&(t._store.validated=1):typeof t=="object"&&t!==null&&t.$$typeof===A&&(t._payload.status==="fulfilled"?y(t._payload.value)&&t._payload.value._store&&(t._payload.value._store.validated=1):t._store&&(t._store.validated=1))}function y(t){return typeof t=="object"&&t!==null&&t.$$typeof===I}var j=m,I=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),X=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),J=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),k=Symbol.for("react.client.reference"),N=j.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,E=Object.prototype.hasOwnProperty,P=Array.isArray,F=console.createTask?console.createTask:function(){return null};j={react_stack_bottom_frame:function(t){return t()}};var L,D={},se=j.react_stack_bottom_frame.bind(j,d)(),ne=F(o(d)),ae={};U.Fragment=_,U.jsx=function(t,a,f){var g=1e4>N.recentlyCreatedOwnerStacks++;return u(t,a,f,!1,g?Error("react-stack-top-frame"):se,g?F(o(t)):ne)},U.jsxs=function(t,a,f){var g=1e4>N.recentlyCreatedOwnerStacks++;return u(t,a,f,!0,g?Error("react-stack-top-frame"):se,g?F(o(t)):ne)}})()),U}var te;function ie(){return te||(te=1,process.env.NODE_ENV==="production"?B.exports=oe():B.exports=le()),B.exports}var e=ie(),T=(r=>(r.TEXT="text",r.PRODUCT_LIST="product_list",r.LOADING="loading",r))(T||{}),v=(r=>(r.USER="user",r.AI="ai",r))(v||{});const ce=({title:r,primaryColor:c,onClose:s,onReset:o,onToggleExpand:l,isExpanded:d,language:p,onLanguageChange:i})=>{const h=[{value:"en",label:"EN"},{value:"vi",label:"VI"},{value:"ja",label:"JA"}];return e.jsxs("div",{className:"px-4 py-3 flex items-center justify-between border-b border-red-50/50 sticky top-0 z-10 bg-[#fff1f2]/90 backdrop-blur-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-full overflow-hidden bg-white p-0.5 shadow-sm",children:e.jsx("img",{src:"https://fptshop.com.vn/img/bitu/bitu-avatar.png",onError:n=>n.currentTarget.src="https://cdn-icons-png.flaticon.com/512/4712/4712035.png",className:"w-full h-full object-contain",alt:"Bot Icon"})}),e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("h3",{className:"font-bold text-[#1a2b56] text-[14px] leading-tight tracking-tight flex items-center gap-1",children:[r," ",e.jsx("span",{className:"text-red-400 text-[10px]",children:"✨"})]}),e.jsxs("span",{className:"text-[10px] text-green-500 font-medium flex items-center gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 bg-green-500 rounded-full animate-pulse"}),"Online"]})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs("div",{className:"relative group mr-1",children:[e.jsx("select",{value:p,onChange:n=>i(n.target.value),className:"appearance-none bg-white/50 border border-gray-200 rounded-lg px-2 pr-5 py-1 text-[10px] font-black text-indigo-600 cursor-pointer hover:bg-white transition-all focus:outline-none focus:ring-2 focus:ring-indigo-100 uppercase",title:"Select language",children:h.map(n=>e.jsx("option",{value:n.value,className:"font-sans font-bold",children:n.label},n.value))}),e.jsx("div",{className:"absolute right-1.5 top-1/2 -translate-y-1/2 pointer-events-none text-indigo-400",children:e.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),e.jsx("button",{onClick:o,className:"w-8 h-8 flex items-center justify-center rounded-lg hover:bg-white/60 text-gray-500 hover:text-indigo-600 transition-all",title:"Reset chat",children:e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),e.jsx("path",{d:"M21 3v5h-5"}),e.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),e.jsx("path",{d:"M8 16H3v5"})]})}),e.jsx("button",{onClick:l,className:"w-8 h-8 hidden md:flex items-center justify-center rounded-lg hover:bg-white/60 text-gray-500 hover:text-indigo-600 transition-all",title:d?"Collapse":"Expand",children:d?e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M4 14h6v6"}),e.jsx("path",{d:"M20 10h-6V4"}),e.jsx("path",{d:"M14 10l7-7"}),e.jsx("path",{d:"M10 14l-7 7"})]}):e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M15 3h6v6"}),e.jsx("path",{d:"M9 21H3v-6"}),e.jsx("path",{d:"M21 3l-7 7"}),e.jsx("path",{d:"M3 21l7-7"})]})}),e.jsx("button",{onClick:s,className:"w-8 h-8 flex items-center justify-center rounded-lg hover:bg-red-50 text-gray-500 hover:text-red-500 transition-all",title:"Close",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M18 6 6 18"}),e.jsx("path",{d:"M6 6l12 12"})]})})]})]})},de=({product:r,primaryColor:c})=>e.jsxs("div",{className:"min-w-[170px] max-w-[170px] bg-white rounded-xl border border-gray-50 shadow-sm overflow-hidden flex flex-col hover:shadow-lg transition-all duration-300 group",children:[e.jsxs("div",{className:"relative h-32 w-full bg-white flex items-center justify-center p-2",children:[e.jsx("img",{src:r.image,alt:r.name,className:"h-full w-full object-contain group-hover:scale-105 transition-transform duration-500"}),r.discount&&e.jsx("div",{className:"absolute top-2 left-2 bg-red-600 text-white text-[9px] font-bold px-1.5 py-0.5 rounded-md shadow-sm",children:r.discount})]}),e.jsxs("div",{className:"p-3 flex-1 flex flex-col justify-between border-t border-gray-50",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-[11px] font-bold text-gray-800 line-clamp-2 min-h-[30px] mb-1.5 group-hover:text-red-600 transition-colors",children:r.name}),e.jsxs("div",{className:"mb-2",children:[e.jsx("span",{className:"text-red-600 font-extrabold text-[13px]",children:r.price}),r.oldPrice&&e.jsx("span",{className:"text-[10px] text-gray-400 line-through ml-1 block opacity-60",children:r.oldPrice})]})]}),e.jsx("button",{className:"w-full py-1.5 rounded-lg text-[11px] font-bold border transition-all duration-300 active:scale-95 shadow-sm",style:{borderColor:c,color:c},onMouseEnter:s=>{s.currentTarget.style.backgroundColor=c,s.currentTarget.style.color="white"},onMouseLeave:s=>{s.currentTarget.style.backgroundColor="transparent",s.currentTarget.style.color=c},children:"Chọn mua"})]})]}),ue=({text:r})=>{const[c,s]=m.useState(!1),o=async()=>{try{await navigator.clipboard.writeText(r),s(!0),setTimeout(()=>s(!1),2e3)}catch(l){console.error("Failed to copy text: ",l)}};return e.jsx("button",{onClick:o,className:"p-1.5 rounded-md hover:bg-slate-100 text-slate-400 hover:text-indigo-600 transition-all active:scale-90 flex items-center gap-1 group/copy",title:"Copy message",children:c?e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",className:"text-green-500",children:e.jsx("path",{d:"M20 6 9 17l-5-5"})}):e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1"}),e.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"})]})})},M=r=>{const c=/(\*\*.*?\*\*|\[.*?\]\(.*?\))/g;return r.split(c).map((o,l)=>{if(o.startsWith("**")&&o.endsWith("**")){const p=o.slice(2,-2);return e.jsx("strong",{className:"font-bold text-gray-900",children:p},l)}const d=o.match(/\[(.*?)\]\((.*?)\)/);if(d){const[p,i,h]=d;return e.jsx("a",{href:h,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline break-all font-semibold",children:i},l)}return o})},he=({text:r})=>{const c=r.replace(/\r/g,"").split(`
23
+ `),s=[];let o=[],l=!1;const d=p=>{if(o.length>0){const h=o.length>1&&o[1].every(n=>n.trim().match(/^:?-+:?$/))?[o[0],...o.slice(2)]:o;h.length>0&&s.push(e.jsxs("div",{className:"my-4 relative group/table",children:[e.jsx("div",{className:"overflow-x-auto border border-slate-200 rounded-xl shadow-sm bg-white chat-scrollbar custom-table-scroll",children:e.jsxs("table",{className:"min-w-full border-collapse text-[13px] leading-normal",children:[e.jsx("thead",{className:"bg-slate-50 border-b border-slate-200",children:e.jsx("tr",{children:h[0].map((n,u)=>e.jsx("th",{className:"px-4 py-3 text-left font-bold text-slate-700 border-r last:border-r-0 border-slate-200 whitespace-nowrap",children:M(n.trim())},u))})}),e.jsx("tbody",{className:"divide-y divide-slate-100",children:h.slice(1).map((n,u)=>e.jsx("tr",{className:"hover:bg-slate-50/50 transition-colors",children:n.map((x,y)=>e.jsx("td",{className:"px-4 py-3 text-slate-600 border-r last:border-r-0 border-slate-200 align-top",children:M(x.trim())},y))},u))})]})}),e.jsx("div",{className:"absolute right-0 top-0 bottom-0 w-8 bg-gradient-to-l from-white/80 to-transparent pointer-events-none md:hidden opacity-0 group-hover/table:opacity-100 transition-opacity"})]},`table-wrapper-${p}`)),o=[],l=!1}};return c.forEach((p,i)=>{const h=p.trim();if(h.includes("|")&&(h.startsWith("|")||h.split("|").length>1)){let x=h.split("|");h.startsWith("|")&&x.shift(),h.endsWith("|")&&x.pop(),o.push(x),l=!0;return}else l&&d(i);const n=h.match(/^(#{1,4})\s+(.*)$/);if(n){const x=n[1].length,y=n[2],j=x===1?"text-xl font-bold mb-4 mt-6 first:mt-1":x===2?"text-lg font-bold mb-3 mt-5":"text-[13px] font-black mb-2 mt-5 text-indigo-600 uppercase tracking-widest";s.push(e.jsx("div",{className:j,children:M(y)},i));return}const u=h.match(/^[*+-]\s+(.*)$/);if(u){const x=u[1];s.push(e.jsxs("div",{className:"flex gap-3 pl-1 mb-2 items-start group",children:[e.jsx("span",{className:"text-indigo-400 flex-shrink-0 mt-2 w-1.5 h-1.5 bg-indigo-400 rounded-full group-hover:scale-125 transition-transform"}),e.jsx("div",{className:"flex-1 leading-relaxed text-slate-700",children:M(x)})]},i));return}if(h===""){s.push(e.jsx("div",{className:"h-3"},i));return}s.push(e.jsx("div",{className:"mb-1.5 leading-relaxed text-slate-700",children:M(p)},i))}),l&&d(c.length),e.jsx("div",{className:"markdown-render w-full",children:s})},me=({messages:r,isLoading:c,description:s,quickReplies:o,onQuickReply:l,primaryColor:d,renderMarkdown:p=!1})=>{const i="https://fptshop.com.vn/img/bitu/bitu-avatar.png",h="https://cdn-icons-png.flaticon.com/512/4712/4712035.png";return e.jsxs("div",{className:"flex flex-col gap-8 pb-4",children:[e.jsxs("div",{className:"flex flex-col items-center justify-center pt-4 text-center animate-msg",children:[e.jsx("div",{className:"relative mb-5",children:e.jsx("div",{className:"w-20 h-20 flex items-center justify-center",children:e.jsx("img",{src:i,onError:n=>n.currentTarget.src=h,className:"w-full h-full object-contain",alt:"Sigma AI Hero"})})}),e.jsxs("h2",{className:"text-xl font-bold text-[#1a2b56] flex items-center justify-center gap-1",children:["Sigma ",e.jsx("span",{className:"bg-indigo-600 text-white text-[10px] px-1.5 py-0.5 rounded-md leading-none ml-1 uppercase font-bold tracking-tight",children:"AI"})]}),e.jsx("div",{className:"text-[14px] text-gray-600 mt-3 leading-relaxed px-4 max-w-[280px]",children:s&&e.jsx("div",{className:"bot-description",children:M(s)})})]}),r.map((n,u)=>e.jsxs("div",{className:`flex flex-col animate-msg group ${n.sender===v.USER?"items-end":"items-start"}`,style:{animationDelay:`${u*.05}s`},children:[n.sender===v.AI&&e.jsxs("div",{className:"flex items-center justify-between w-full max-w-[96%] mb-2 ml-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("img",{src:i,onError:x=>x.currentTarget.src=h,className:"w-4 h-4 object-contain",alt:"AI"}),e.jsx("span",{className:"text-[11px] font-bold text-gray-400 uppercase tracking-widest",children:"AI Agent"})]}),e.jsx("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity duration-200",children:e.jsx(ue,{text:n.content})})]}),e.jsxs("div",{className:`flex flex-col ${n.sender===v.USER?"items-end":"items-start"} w-full max-w-[96%]`,children:[e.jsx("div",{className:`px-4 py-3 rounded-[20px] shadow-sm border border-black/[0.02] overflow-hidden transition-all duration-300 ${n.sender===v.USER?"bg-indigo-600 text-white rounded-tr-none whitespace-pre-line shadow-indigo-100/50":"bg-white text-slate-800 border-none rounded-tl-none hover:shadow-md"} ${!p||n.sender===v.USER?"whitespace-pre-line":""}`,children:p&&n.sender===v.AI?e.jsx(he,{text:n.content}):n.content}),n.type===T.PRODUCT_LIST&&n.products&&e.jsx("div",{className:"w-full mt-4 flex gap-4 overflow-x-auto pb-4 pt-1 no-scrollbar snap-x",children:n.products.map(x=>e.jsx("div",{className:"product-card-snap",children:e.jsx(de,{product:x,primaryColor:d})},x.id))}),u===0&&r.length===1&&n.sender===v.AI&&e.jsx("div",{className:"mt-5 flex flex-wrap gap-2.5 w-full",children:o.map((x,y)=>e.jsx("button",{onClick:()=>l(x),className:"px-4 py-2 rounded-full text-[13px] font-semibold border border-transparent bg-white text-gray-600 hover:text-indigo-600 hover:border-indigo-100 transition-all duration-200 shadow-sm active:scale-95",children:x},y))})]})]},n.id)),c&&e.jsxs("div",{className:"flex flex-col gap-1.5 items-start animate-msg",children:[e.jsx("div",{className:"flex items-center gap-1.5 ml-1",children:e.jsx("img",{src:i,onError:n=>n.currentTarget.src=h,className:"w-4 h-4 object-contain",alt:"AI Loading"})}),e.jsxs("div",{className:"flex gap-1.5 bg-white px-4 py-3 rounded-[18px] rounded-tl-none border-none shadow-sm",children:[e.jsx("span",{className:"w-2 h-2 bg-indigo-300 rounded-full animate-sigma-bounce"}),e.jsx("span",{className:"w-2 h-2 bg-indigo-300 rounded-full animate-sigma-bounce [animation-delay:0.2s]"}),e.jsx("span",{className:"w-2 h-2 bg-indigo-300 rounded-full animate-sigma-bounce [animation-delay:0.4s]"})]})]})]})},xe=({placeholder:r,onSendMessage:c,primaryColor:s})=>{const[o,l]=m.useState(""),d=()=>{o.trim()&&(c(o),l(""))},p=i=>{i.key==="Enter"&&!i.shiftKey&&(i.preventDefault(),d())};return e.jsx("div",{className:"p-1",children:e.jsxs("div",{className:"relative flex items-center bg-gray-50/50 rounded-2xl border border-gray-100 focus-within:border-indigo-100 focus-within:bg-white transition-all duration-200 pr-2 pl-3 py-1",children:[e.jsx("textarea",{value:o,onChange:i=>l(i.target.value),onKeyDown:p,placeholder:r,rows:1,className:"w-full bg-transparent border-none outline-none focus:ring-0 text-[14px] text-gray-700 font-normal py-3 px-1 resize-none chat-scrollbar min-h-[44px] max-h-[120px] leading-relaxed placeholder:text-gray-400",style:{fontWeight:400}}),e.jsx("button",{onClick:d,disabled:!o.trim(),className:`w-9 h-9 rounded-xl flex-shrink-0 flex items-center justify-center transition-all duration-300 shadow-sm ${o.trim()?"bg-indigo-600 text-white hover:bg-indigo-700 active:scale-95":"bg-gray-200 text-gray-400 cursor-not-allowed"}`,children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"m5 12 7-7 7 7"}),e.jsx("path",{d:"M12 19V5"})]})})]})})},pe=({isOpen:r,onClick:c,primaryColor:s,className:o=""})=>e.jsx("div",{className:`fixed bottom-4 right-4 md:bottom-6 md:right-6 z-[100] ${o}`,children:e.jsx("button",{onClick:c,className:`w-12 h-12 bg-white rounded-2xl shadow-lg flex items-center justify-center border transition-all duration-300 overflow-hidden ${r?"border-indigo-500 ring-4 ring-indigo-50 scale-105 rotate-0":"border-slate-100 hover:scale-110 hover:shadow-xl"}`,children:e.jsx("img",{src:"https://fptshop.com.vn/img/bitu/bitu-avatar.png",className:"w-10 h-10 object-contain",alt:"Bitu",onError:l=>l.currentTarget.src="https://cdn-icons-png.flaticon.com/512/4712/4712035.png"})})}),re=()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),O=(r,c,s)=>typeof r=="object"&&r!==null&&!Array.isArray(r)?r[c]||r.en||Object.values(r)[0]||s:r??s,fe=({config:r,onGetAiResponse:c})=>{const[s,o]=m.useState(!1),[l,d]=m.useState(!1),[p,i]=m.useState(!1),[h,n]=m.useState(re()),[u,x]=m.useState("en"),[y,j]=m.useState([]),[I,C]=m.useState(!1),_=m.useRef(null),S=m.useRef(0);m.useEffect(()=>{const w=O(r.welcomeMessage,u,"Hello!");j([{id:"welcome",type:T.TEXT,sender:v.AI,content:w,timestamp:new Date}])},[]);const X=m.useMemo(()=>O(r.placeholder,u,"Type a message..."),[r.placeholder,u]),z=m.useMemo(()=>O(r.quickReplies,u,[]),[r.quickReplies,u]),J=m.useMemo(()=>O(r.description,u,""),[r.description,u]);m.useEffect(()=>{if(y.length===1&&y[0].id==="welcome"){const w=O(r.welcomeMessage,u,"Hello!");j([{...y[0],content:w}])}},[u]),m.useEffect(()=>{if(s){const w=setTimeout(()=>i(!0),50);return()=>clearTimeout(w)}else i(!1)},[s]),m.useEffect(()=>{_.current&&s&&(_.current.scrollTop=_.current.scrollHeight)},[y,s,I]);const H=async w=>{if(!w.trim()||I)return;const A=++S.current,Z={id:`user-${Date.now()}`,type:T.TEXT,sender:v.USER,content:w,timestamp:new Date};j(k=>[...k,Z]),C(!0);try{const k=c(w,h,u);if(k&&typeof k=="object"&&Symbol.asyncIterator in k){let N="",E=!1;const P=`ai-${Date.now()}`;for await(const F of k){if(A!==S.current)return;E||(j(L=>[...L,{id:P,type:T.TEXT,sender:v.AI,content:"",timestamp:new Date}]),C(!1),E=!0),N+=F,j(L=>L.map(D=>D.id===P?{...D,content:N}:D))}}else{const N=await k;if(A!==S.current)return;C(!1);const E=typeof N=="string"?{text:N,products:void 0}:N;j(P=>[...P,{id:`ai-${Date.now()}`,type:E.products?T.PRODUCT_LIST:T.TEXT,sender:v.AI,content:E.text,products:E.products,timestamp:new Date}])}}catch(k){if(A!==S.current)return;console.error("Chatbox Error:",k),C(!1);const N=u==="vi"?"Hệ thống đang bận, vui lòng thử lại sau.":"System is busy, please try again later.";j(E=>[...E,{id:`err-${Date.now()}`,type:T.TEXT,sender:v.AI,content:N,timestamp:new Date}])}},G=()=>{S.current++,n(re());const w=O(r.welcomeMessage,u,"Hello!");j([{id:"welcome",type:T.TEXT,sender:v.AI,content:w,timestamp:new Date}]),C(!1),d(!1)},Q=`
24
24
  fixed z-[99] overflow-hidden flex flex-col border border-white/40 shadow-2xl bg-white animate-chat-pop
25
- ${x?"transition-[width,height,border-radius,right,bottom] duration-300 ease-in-out":""}
25
+ ${p?"transition-[width,height,border-radius,right,bottom] duration-300 ease-in-out":""}
26
26
  ${l?"bottom-0 right-0 w-full h-full md:bottom-6 md:right-28 md:w-[850px] md:h-[85vh] rounded-none md:rounded-[32px]":"bottom-0 right-0 w-full h-[80vh] md:bottom-6 md:right-28 md:w-[420px] md:h-[580px] rounded-t-[28px] md:rounded-[28px]"}
27
- `;return e.jsxs(e.Fragment,{children:[e.jsx(fe,{isOpen:s,onClick:()=>o(!s),primaryColor:r.primaryColor,className:s?"hidden md:flex":"flex"}),s&&e.jsxs("div",{className:Q,style:{left:"auto"},children:[e.jsx(ce,{title:r.botName,primaryColor:r.primaryColor,onClose:()=>o(!1),onReset:G,onToggleExpand:()=>c(!l),isExpanded:l,language:d,onLanguageChange:m}),e.jsx("div",{className:"flex-1 overflow-y-auto chat-scrollbar px-5 py-5 bg-slate-50/30",ref:_,children:e.jsx(he,{messages:y,isLoading:M,description:J,quickReplies:V,onQuickReply:w=>X(w),primaryColor:r.primaryColor,renderMarkdown:r.renderMarkdown})}),e.jsx("div",{className:"bg-white p-3 border-t border-slate-100",children:e.jsx(me,{placeholder:B,onSendMessage:X,primaryColor:r.primaryColor})})]})]})};R.Chatbox=xe,R.MessageType=T,R.SenderType=v,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})}));
27
+ `;return e.jsxs(e.Fragment,{children:[e.jsx(pe,{isOpen:s,onClick:()=>o(!s),primaryColor:r.primaryColor,className:s?"hidden md:flex":"flex"}),s&&e.jsxs("div",{className:Q,style:{left:"auto"},children:[e.jsx(ce,{title:r.botName,primaryColor:r.primaryColor,onClose:()=>o(!1),onReset:G,onToggleExpand:()=>d(!l),isExpanded:l,language:u,onLanguageChange:x}),e.jsx("div",{className:"flex-1 overflow-y-auto chat-scrollbar px-5 py-5 bg-slate-50/30",ref:_,children:e.jsx(me,{messages:y,isLoading:I,description:J,quickReplies:z,onQuickReply:w=>H(w),primaryColor:r.primaryColor,renderMarkdown:r.renderMarkdown})}),e.jsx("div",{className:"bg-white p-3 border-t border-slate-100",children:e.jsx(xe,{placeholder:X,onSendMessage:H,primaryColor:r.primaryColor})})]})]})};R.Chatbox=fe,R.MessageType=T,R.SenderType=v,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})}));
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import ce, { useState as R, useRef as ne, useEffect as q, useMemo as K } from "react";
1
+ import ce, { useState as E, useRef as ne, useEffect as B, useMemo as K } from "react";
2
2
  var H = { exports: {} }, W = {};
3
3
  /**
4
4
  * @license React
@@ -13,23 +13,23 @@ var se;
13
13
  function de() {
14
14
  if (se) return W;
15
15
  se = 1;
16
- var r = Symbol.for("react.transitional.element"), u = Symbol.for("react.fragment");
17
- function s(o, l, c) {
16
+ var r = Symbol.for("react.transitional.element"), c = Symbol.for("react.fragment");
17
+ function n(o, l, d) {
18
18
  var x = null;
19
- if (c !== void 0 && (x = "" + c), l.key !== void 0 && (x = "" + l.key), "key" in l) {
20
- c = {};
19
+ if (d !== void 0 && (x = "" + d), l.key !== void 0 && (x = "" + l.key), "key" in l) {
20
+ d = {};
21
21
  for (var i in l)
22
- i !== "key" && (c[i] = l[i]);
23
- } else c = l;
24
- return l = c.ref, {
22
+ i !== "key" && (d[i] = l[i]);
23
+ } else d = l;
24
+ return l = d.ref, {
25
25
  $$typeof: r,
26
26
  type: o,
27
27
  key: x,
28
28
  ref: l !== void 0 ? l : null,
29
- props: c
29
+ props: d
30
30
  };
31
31
  }
32
- return W.Fragment = u, W.jsx = s, W.jsxs = s, W;
32
+ return W.Fragment = c, W.jsx = n, W.jsxs = n, W;
33
33
  }
34
34
  var Y = {};
35
35
  /**
@@ -50,13 +50,13 @@ function ue() {
50
50
  return t.$$typeof === N ? null : t.displayName || t.name || null;
51
51
  if (typeof t == "string") return t;
52
52
  switch (t) {
53
- case T:
53
+ case R:
54
54
  return "Fragment";
55
- case X:
55
+ case q:
56
56
  return "Profiler";
57
57
  case C:
58
58
  return "StrictMode";
59
- case V:
59
+ case z:
60
60
  return "Suspense";
61
61
  case J:
62
62
  return "SuspenseList";
@@ -69,9 +69,9 @@ function ue() {
69
69
  ), t.$$typeof) {
70
70
  case _:
71
71
  return "Portal";
72
- case B:
72
+ case X:
73
73
  return t.displayName || "Context";
74
- case z:
74
+ case V:
75
75
  return (t._context.displayName || "Context") + ".Consumer";
76
76
  case U:
77
77
  var a = t.render;
@@ -87,28 +87,28 @@ function ue() {
87
87
  }
88
88
  return null;
89
89
  }
90
- function u(t) {
90
+ function c(t) {
91
91
  return "" + t;
92
92
  }
93
- function s(t) {
93
+ function n(t) {
94
94
  try {
95
- u(t);
95
+ c(t);
96
96
  var a = !1;
97
97
  } catch {
98
98
  a = !0;
99
99
  }
100
100
  if (a) {
101
101
  a = console;
102
- var f = a.error, p = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
103
- return f.call(
102
+ var p = a.error, f = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
103
+ return p.call(
104
104
  a,
105
105
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
106
- p
107
- ), u(t);
106
+ f
107
+ ), c(t);
108
108
  }
109
109
  }
110
110
  function o(t) {
111
- if (t === T) return "<>";
111
+ if (t === R) return "<>";
112
112
  if (typeof t == "object" && t !== null && t.$$typeof === A)
113
113
  return "<...>";
114
114
  try {
@@ -122,7 +122,7 @@ function ue() {
122
122
  var t = y.A;
123
123
  return t === null ? null : t.getOwner();
124
124
  }
125
- function c() {
125
+ function d() {
126
126
  return Error("react-stack-top-frame");
127
127
  }
128
128
  function x(t) {
@@ -133,14 +133,14 @@ function ue() {
133
133
  return t.key !== void 0;
134
134
  }
135
135
  function i(t, a) {
136
- function f() {
136
+ function p() {
137
137
  I || (I = !0, console.error(
138
138
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
139
139
  a
140
140
  ));
141
141
  }
142
- f.isReactWarning = !0, Object.defineProperty(t, "key", {
143
- get: f,
142
+ p.isReactWarning = !0, Object.defineProperty(t, "key", {
143
+ get: p,
144
144
  configurable: !0
145
145
  });
146
146
  }
@@ -150,14 +150,14 @@ function ue() {
150
150
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
151
151
  )), t = this.props.ref, t !== void 0 ? t : null;
152
152
  }
153
- function n(t, a, f, p, F, Q) {
154
- var g = f.ref;
153
+ function s(t, a, p, f, F, Q) {
154
+ var g = p.ref;
155
155
  return t = {
156
156
  $$typeof: S,
157
157
  type: t,
158
158
  key: a,
159
- props: f,
160
- _owner: p
159
+ props: p,
160
+ _owner: f
161
161
  }, (g !== void 0 ? g : null) !== null ? Object.defineProperty(t, "ref", {
162
162
  enumerable: !1,
163
163
  get: h
@@ -183,13 +183,13 @@ function ue() {
183
183
  value: Q
184
184
  }), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
185
185
  }
186
- function d(t, a, f, p, F, Q) {
186
+ function u(t, a, p, f, F, Q) {
187
187
  var g = a.children;
188
188
  if (g !== void 0)
189
- if (p)
189
+ if (f)
190
190
  if (O(g)) {
191
- for (p = 0; p < g.length; p++)
192
- m(g[p]);
191
+ for (f = 0; f < g.length; f++)
192
+ m(g[f]);
193
193
  Object.freeze && Object.freeze(g);
194
194
  } else
195
195
  console.error(
@@ -201,31 +201,31 @@ function ue() {
201
201
  var P = Object.keys(a).filter(function(ie) {
202
202
  return ie !== "key";
203
203
  });
204
- p = 0 < P.length ? "{key: someKey, " + P.join(": ..., ") + ": ...}" : "{key: someKey}", re[g + p] || (P = 0 < P.length ? "{" + P.join(": ..., ") + ": ...}" : "{}", console.error(
204
+ f = 0 < P.length ? "{key: someKey, " + P.join(": ..., ") + ": ...}" : "{key: someKey}", re[g + f] || (P = 0 < P.length ? "{" + P.join(": ..., ") + ": ...}" : "{}", console.error(
205
205
  `A props object containing a "key" prop is being spread into JSX:
206
206
  let props = %s;
207
207
  <%s {...props} />
208
208
  React keys must be passed directly to JSX without using spread:
209
209
  let props = %s;
210
210
  <%s key={someKey} {...props} />`,
211
- p,
211
+ f,
212
212
  g,
213
213
  P,
214
214
  g
215
- ), re[g + p] = !0);
215
+ ), re[g + f] = !0);
216
216
  }
217
- if (g = null, f !== void 0 && (s(f), g = "" + f), x(a) && (s(a.key), g = "" + a.key), "key" in a) {
218
- f = {};
217
+ if (g = null, p !== void 0 && (n(p), g = "" + p), x(a) && (n(a.key), g = "" + a.key), "key" in a) {
218
+ p = {};
219
219
  for (var Z in a)
220
- Z !== "key" && (f[Z] = a[Z]);
221
- } else f = a;
220
+ Z !== "key" && (p[Z] = a[Z]);
221
+ } else p = a;
222
222
  return g && i(
223
- f,
223
+ p,
224
224
  typeof t == "function" ? t.displayName || t.name || "Unknown" : t
225
- ), n(
225
+ ), s(
226
226
  t,
227
227
  g,
228
- f,
228
+ p,
229
229
  l(),
230
230
  F,
231
231
  Q
@@ -237,7 +237,7 @@ React keys must be passed directly to JSX without using spread:
237
237
  function j(t) {
238
238
  return typeof t == "object" && t !== null && t.$$typeof === S;
239
239
  }
240
- var b = ce, S = Symbol.for("react.transitional.element"), _ = Symbol.for("react.portal"), T = Symbol.for("react.fragment"), C = Symbol.for("react.strict_mode"), X = Symbol.for("react.profiler"), z = Symbol.for("react.consumer"), B = Symbol.for("react.context"), U = Symbol.for("react.forward_ref"), V = Symbol.for("react.suspense"), J = Symbol.for("react.suspense_list"), v = Symbol.for("react.memo"), A = Symbol.for("react.lazy"), G = Symbol.for("react.activity"), N = Symbol.for("react.client.reference"), y = b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, k = Object.prototype.hasOwnProperty, O = Array.isArray, D = console.createTask ? console.createTask : function() {
240
+ var b = ce, S = Symbol.for("react.transitional.element"), _ = Symbol.for("react.portal"), R = Symbol.for("react.fragment"), C = Symbol.for("react.strict_mode"), q = Symbol.for("react.profiler"), V = Symbol.for("react.consumer"), X = Symbol.for("react.context"), U = Symbol.for("react.forward_ref"), z = Symbol.for("react.suspense"), J = Symbol.for("react.suspense_list"), v = Symbol.for("react.memo"), A = Symbol.for("react.lazy"), G = Symbol.for("react.activity"), N = Symbol.for("react.client.reference"), y = b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, k = Object.prototype.hasOwnProperty, O = Array.isArray, D = console.createTask ? console.createTask : function() {
241
241
  return null;
242
242
  };
243
243
  b = {
@@ -247,27 +247,27 @@ React keys must be passed directly to JSX without using spread:
247
247
  };
248
248
  var I, M = {}, ee = b.react_stack_bottom_frame.bind(
249
249
  b,
250
- c
251
- )(), te = D(o(c)), re = {};
252
- Y.Fragment = T, Y.jsx = function(t, a, f) {
253
- var p = 1e4 > y.recentlyCreatedOwnerStacks++;
254
- return d(
250
+ d
251
+ )(), te = D(o(d)), re = {};
252
+ Y.Fragment = R, Y.jsx = function(t, a, p) {
253
+ var f = 1e4 > y.recentlyCreatedOwnerStacks++;
254
+ return u(
255
255
  t,
256
256
  a,
257
- f,
257
+ p,
258
258
  !1,
259
- p ? Error("react-stack-top-frame") : ee,
260
- p ? D(o(t)) : te
259
+ f ? Error("react-stack-top-frame") : ee,
260
+ f ? D(o(t)) : te
261
261
  );
262
- }, Y.jsxs = function(t, a, f) {
263
- var p = 1e4 > y.recentlyCreatedOwnerStacks++;
264
- return d(
262
+ }, Y.jsxs = function(t, a, p) {
263
+ var f = 1e4 > y.recentlyCreatedOwnerStacks++;
264
+ return u(
265
265
  t,
266
266
  a,
267
- f,
267
+ p,
268
268
  !0,
269
- p ? Error("react-stack-top-frame") : ee,
270
- p ? D(o(t)) : te
269
+ f ? Error("react-stack-top-frame") : ee,
270
+ f ? D(o(t)) : te
271
271
  );
272
272
  };
273
273
  })()), Y;
@@ -276,14 +276,14 @@ var oe;
276
276
  function he() {
277
277
  return oe || (oe = 1, process.env.NODE_ENV === "production" ? H.exports = de() : H.exports = ue()), H.exports;
278
278
  }
279
- var e = he(), E = /* @__PURE__ */ ((r) => (r.TEXT = "text", r.PRODUCT_LIST = "product_list", r.LOADING = "loading", r))(E || {}), w = /* @__PURE__ */ ((r) => (r.USER = "user", r.AI = "ai", r))(w || {});
279
+ var e = he(), T = /* @__PURE__ */ ((r) => (r.TEXT = "text", r.PRODUCT_LIST = "product_list", r.LOADING = "loading", r))(T || {}), w = /* @__PURE__ */ ((r) => (r.USER = "user", r.AI = "ai", r))(w || {});
280
280
  const me = ({
281
281
  title: r,
282
- primaryColor: u,
283
- onClose: s,
282
+ primaryColor: c,
283
+ onClose: n,
284
284
  onReset: o,
285
285
  onToggleExpand: l,
286
- isExpanded: c,
286
+ isExpanded: d,
287
287
  language: x,
288
288
  onLanguageChange: i
289
289
  }) => {
@@ -302,7 +302,7 @@ const me = ({
302
302
  "img",
303
303
  {
304
304
  src: "https://fptshop.com.vn/img/bitu/bitu-avatar.png",
305
- onError: (n) => n.currentTarget.src = "https://cdn-icons-png.flaticon.com/512/4712/4712035.png",
305
+ onError: (s) => s.currentTarget.src = "https://cdn-icons-png.flaticon.com/512/4712/4712035.png",
306
306
  className: "w-full h-full object-contain",
307
307
  alt: "Bot Icon"
308
308
  }
@@ -325,10 +325,10 @@ const me = ({
325
325
  "select",
326
326
  {
327
327
  value: x,
328
- onChange: (n) => i(n.target.value),
328
+ onChange: (s) => i(s.target.value),
329
329
  className: "appearance-none bg-white/50 border border-gray-200 rounded-lg px-2 pr-5 py-1 text-[10px] font-black text-indigo-600 cursor-pointer hover:bg-white transition-all focus:outline-none focus:ring-2 focus:ring-indigo-100 uppercase",
330
330
  title: "Select language",
331
- children: h.map((n) => /* @__PURE__ */ e.jsx("option", { value: n.value, className: "font-sans font-bold", children: n.label }, n.value))
331
+ children: h.map((s) => /* @__PURE__ */ e.jsx("option", { value: s.value, className: "font-sans font-bold", children: s.label }, s.value))
332
332
  }
333
333
  ),
334
334
  /* @__PURE__ */ e.jsx("div", { className: "absolute right-1.5 top-1/2 -translate-y-1/2 pointer-events-none text-indigo-400", children: /* @__PURE__ */ e.jsx("svg", { width: "8", height: "8", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "4", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e.jsx("path", { d: "m6 9 6 6 6-6" }) }) })
@@ -352,8 +352,8 @@ const me = ({
352
352
  {
353
353
  onClick: l,
354
354
  className: "w-8 h-8 hidden md:flex items-center justify-center rounded-lg hover:bg-white/60 text-gray-500 hover:text-indigo-600 transition-all",
355
- title: c ? "Collapse" : "Expand",
356
- children: c ? /* @__PURE__ */ e.jsxs("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
355
+ title: d ? "Collapse" : "Expand",
356
+ children: d ? /* @__PURE__ */ e.jsxs("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
357
357
  /* @__PURE__ */ e.jsx("path", { d: "M4 14h6v6" }),
358
358
  /* @__PURE__ */ e.jsx("path", { d: "M20 10h-6V4" }),
359
359
  /* @__PURE__ */ e.jsx("path", { d: "M14 10l7-7" }),
@@ -369,7 +369,7 @@ const me = ({
369
369
  /* @__PURE__ */ e.jsx(
370
370
  "button",
371
371
  {
372
- onClick: s,
372
+ onClick: n,
373
373
  className: "w-8 h-8 flex items-center justify-center rounded-lg hover:bg-red-50 text-gray-500 hover:text-red-500 transition-all",
374
374
  title: "Close",
375
375
  children: /* @__PURE__ */ e.jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
@@ -382,7 +382,7 @@ const me = ({
382
382
  ]
383
383
  }
384
384
  );
385
- }, xe = ({ product: r, primaryColor: u }) => /* @__PURE__ */ e.jsxs("div", { className: "min-w-[170px] max-w-[170px] bg-white rounded-xl border border-gray-50 shadow-sm overflow-hidden flex flex-col hover:shadow-lg transition-all duration-300 group", children: [
385
+ }, xe = ({ product: r, primaryColor: c }) => /* @__PURE__ */ e.jsxs("div", { className: "min-w-[170px] max-w-[170px] bg-white rounded-xl border border-gray-50 shadow-sm overflow-hidden flex flex-col hover:shadow-lg transition-all duration-300 group", children: [
386
386
  /* @__PURE__ */ e.jsxs("div", { className: "relative h-32 w-full bg-white flex items-center justify-center p-2", children: [
387
387
  /* @__PURE__ */ e.jsx(
388
388
  "img",
@@ -406,27 +406,47 @@ const me = ({
406
406
  "button",
407
407
  {
408
408
  className: "w-full py-1.5 rounded-lg text-[11px] font-bold border transition-all duration-300 active:scale-95 shadow-sm",
409
- style: { borderColor: u, color: u },
410
- onMouseEnter: (s) => {
411
- s.currentTarget.style.backgroundColor = u, s.currentTarget.style.color = "white";
409
+ style: { borderColor: c, color: c },
410
+ onMouseEnter: (n) => {
411
+ n.currentTarget.style.backgroundColor = c, n.currentTarget.style.color = "white";
412
412
  },
413
- onMouseLeave: (s) => {
414
- s.currentTarget.style.backgroundColor = "transparent", s.currentTarget.style.color = u;
413
+ onMouseLeave: (n) => {
414
+ n.currentTarget.style.backgroundColor = "transparent", n.currentTarget.style.color = c;
415
415
  },
416
416
  children: "Chọn mua"
417
417
  }
418
418
  )
419
419
  ] })
420
- ] }), $ = (r) => {
421
- const u = /(\*\*.*?\*\*|\[.*?\]\(.*?\))/g;
422
- return r.split(u).map((o, l) => {
420
+ ] }), pe = ({ text: r }) => {
421
+ const [c, n] = E(!1), o = async () => {
422
+ try {
423
+ await navigator.clipboard.writeText(r), n(!0), setTimeout(() => n(!1), 2e3);
424
+ } catch (l) {
425
+ console.error("Failed to copy text: ", l);
426
+ }
427
+ };
428
+ return /* @__PURE__ */ e.jsx(
429
+ "button",
430
+ {
431
+ onClick: o,
432
+ className: "p-1.5 rounded-md hover:bg-slate-100 text-slate-400 hover:text-indigo-600 transition-all active:scale-90 flex items-center gap-1 group/copy",
433
+ title: "Copy message",
434
+ children: c ? /* @__PURE__ */ e.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", className: "text-green-500", children: /* @__PURE__ */ e.jsx("path", { d: "M20 6 9 17l-5-5" }) }) : /* @__PURE__ */ e.jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
435
+ /* @__PURE__ */ e.jsx("rect", { width: "8", height: "4", x: "8", y: "2", rx: "1", ry: "1" }),
436
+ /* @__PURE__ */ e.jsx("path", { d: "M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2" })
437
+ ] })
438
+ }
439
+ );
440
+ }, $ = (r) => {
441
+ const c = /(\*\*.*?\*\*|\[.*?\]\(.*?\))/g;
442
+ return r.split(c).map((o, l) => {
423
443
  if (o.startsWith("**") && o.endsWith("**")) {
424
444
  const x = o.slice(2, -2);
425
445
  return /* @__PURE__ */ e.jsx("strong", { className: "font-bold text-gray-900", children: x }, l);
426
446
  }
427
- const c = o.match(/\[(.*?)\]\((.*?)\)/);
428
- if (c) {
429
- const [x, i, h] = c;
447
+ const d = o.match(/\[(.*?)\]\((.*?)\)/);
448
+ if (d) {
449
+ const [x, i, h] = d;
430
450
  return /* @__PURE__ */ e.jsx(
431
451
  "a",
432
452
  {
@@ -442,37 +462,40 @@ const me = ({
442
462
  return o;
443
463
  });
444
464
  }, fe = ({ text: r }) => {
445
- const u = r.replace(/\r/g, "").split(`
446
- `), s = [];
465
+ const c = r.replace(/\r/g, "").split(`
466
+ `), n = [];
447
467
  let o = [], l = !1;
448
- const c = (x) => {
468
+ const d = (x) => {
449
469
  if (o.length > 0) {
450
- const h = o.length > 1 && o[1].every((n) => n.trim().match(/^:?-+:?$/)) ? [o[0], ...o.slice(2)] : o;
451
- h.length > 0 && s.push(
452
- /* @__PURE__ */ e.jsx("div", { className: "my-4 overflow-x-auto border border-slate-200 rounded-xl shadow-sm bg-white", children: /* @__PURE__ */ e.jsxs("table", { className: "min-w-full border-collapse text-[13px] leading-normal", children: [
453
- /* @__PURE__ */ e.jsx("thead", { className: "bg-slate-50 border-b border-slate-200", children: /* @__PURE__ */ e.jsx("tr", { children: h[0].map((n, d) => /* @__PURE__ */ e.jsx("th", { className: "px-4 py-3 text-left font-bold text-slate-700 border-r last:border-r-0 border-slate-200 whitespace-nowrap", children: $(n.trim()) }, d)) }) }),
454
- /* @__PURE__ */ e.jsx("tbody", { className: "divide-y divide-slate-100", children: h.slice(1).map((n, d) => /* @__PURE__ */ e.jsx("tr", { className: "hover:bg-slate-50/50 transition-colors", children: n.map((m, j) => /* @__PURE__ */ e.jsx("td", { className: "px-4 py-3 text-slate-600 border-r last:border-r-0 border-slate-200 align-top", children: $(m.trim()) }, j)) }, d)) })
455
- ] }) }, `table-wrapper-${x}`)
470
+ const h = o.length > 1 && o[1].every((s) => s.trim().match(/^:?-+:?$/)) ? [o[0], ...o.slice(2)] : o;
471
+ h.length > 0 && n.push(
472
+ /* @__PURE__ */ e.jsxs("div", { className: "my-4 relative group/table", children: [
473
+ /* @__PURE__ */ e.jsx("div", { className: "overflow-x-auto border border-slate-200 rounded-xl shadow-sm bg-white chat-scrollbar custom-table-scroll", children: /* @__PURE__ */ e.jsxs("table", { className: "min-w-full border-collapse text-[13px] leading-normal", children: [
474
+ /* @__PURE__ */ e.jsx("thead", { className: "bg-slate-50 border-b border-slate-200", children: /* @__PURE__ */ e.jsx("tr", { children: h[0].map((s, u) => /* @__PURE__ */ e.jsx("th", { className: "px-4 py-3 text-left font-bold text-slate-700 border-r last:border-r-0 border-slate-200 whitespace-nowrap", children: $(s.trim()) }, u)) }) }),
475
+ /* @__PURE__ */ e.jsx("tbody", { className: "divide-y divide-slate-100", children: h.slice(1).map((s, u) => /* @__PURE__ */ e.jsx("tr", { className: "hover:bg-slate-50/50 transition-colors", children: s.map((m, j) => /* @__PURE__ */ e.jsx("td", { className: "px-4 py-3 text-slate-600 border-r last:border-r-0 border-slate-200 align-top", children: $(m.trim()) }, j)) }, u)) })
476
+ ] }) }),
477
+ /* @__PURE__ */ e.jsx("div", { className: "absolute right-0 top-0 bottom-0 w-8 bg-gradient-to-l from-white/80 to-transparent pointer-events-none md:hidden opacity-0 group-hover/table:opacity-100 transition-opacity" })
478
+ ] }, `table-wrapper-${x}`)
456
479
  ), o = [], l = !1;
457
480
  }
458
481
  };
459
- return u.forEach((x, i) => {
482
+ return c.forEach((x, i) => {
460
483
  const h = x.trim();
461
484
  if (h.includes("|") && (h.startsWith("|") || h.split("|").length > 1)) {
462
485
  let m = h.split("|");
463
486
  h.startsWith("|") && m.shift(), h.endsWith("|") && m.pop(), o.push(m), l = !0;
464
487
  return;
465
- } else l && c(i);
466
- const n = h.match(/^(#{1,4})\s+(.*)$/);
467
- if (n) {
468
- const m = n[1].length, j = n[2], b = m === 1 ? "text-xl font-bold mb-4 mt-6 first:mt-1" : m === 2 ? "text-lg font-bold mb-3 mt-5" : "text-[13px] font-black mb-2 mt-5 text-indigo-600 uppercase tracking-widest";
469
- s.push(/* @__PURE__ */ e.jsx("div", { className: b, children: $(j) }, i));
488
+ } else l && d(i);
489
+ const s = h.match(/^(#{1,4})\s+(.*)$/);
490
+ if (s) {
491
+ const m = s[1].length, j = s[2], b = m === 1 ? "text-xl font-bold mb-4 mt-6 first:mt-1" : m === 2 ? "text-lg font-bold mb-3 mt-5" : "text-[13px] font-black mb-2 mt-5 text-indigo-600 uppercase tracking-widest";
492
+ n.push(/* @__PURE__ */ e.jsx("div", { className: b, children: $(j) }, i));
470
493
  return;
471
494
  }
472
- const d = h.match(/^[*+-]\s+(.*)$/);
473
- if (d) {
474
- const m = d[1];
475
- s.push(
495
+ const u = h.match(/^[*+-]\s+(.*)$/);
496
+ if (u) {
497
+ const m = u[1];
498
+ n.push(
476
499
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-3 pl-1 mb-2 items-start group", children: [
477
500
  /* @__PURE__ */ e.jsx("span", { className: "text-indigo-400 flex-shrink-0 mt-2 w-1.5 h-1.5 bg-indigo-400 rounded-full group-hover:scale-125 transition-transform" }),
478
501
  /* @__PURE__ */ e.jsx("div", { className: "flex-1 leading-relaxed text-slate-700", children: $(m) })
@@ -481,20 +504,20 @@ const me = ({
481
504
  return;
482
505
  }
483
506
  if (h === "") {
484
- s.push(/* @__PURE__ */ e.jsx("div", { className: "h-3" }, i));
507
+ n.push(/* @__PURE__ */ e.jsx("div", { className: "h-3" }, i));
485
508
  return;
486
509
  }
487
- s.push(
510
+ n.push(
488
511
  /* @__PURE__ */ e.jsx("div", { className: "mb-1.5 leading-relaxed text-slate-700", children: $(x) }, i)
489
512
  );
490
- }), l && c(u.length), /* @__PURE__ */ e.jsx("div", { className: "markdown-render w-full", children: s });
491
- }, pe = ({
513
+ }), l && d(c.length), /* @__PURE__ */ e.jsx("div", { className: "markdown-render w-full", children: n });
514
+ }, ge = ({
492
515
  messages: r,
493
- isLoading: u,
494
- description: s,
516
+ isLoading: c,
517
+ description: n,
495
518
  quickReplies: o,
496
519
  onQuickReply: l,
497
- primaryColor: c,
520
+ primaryColor: d,
498
521
  renderMarkdown: x = !1
499
522
  }) => {
500
523
  const i = "https://fptshop.com.vn/img/bitu/bitu-avatar.png", h = "https://cdn-icons-png.flaticon.com/512/4712/4712035.png";
@@ -504,7 +527,7 @@ const me = ({
504
527
  "img",
505
528
  {
506
529
  src: i,
507
- onError: (n) => n.currentTarget.src = h,
530
+ onError: (s) => s.currentTarget.src = h,
508
531
  className: "w-full h-full object-contain",
509
532
  alt: "Sigma AI Hero"
510
533
  }
@@ -513,36 +536,39 @@ const me = ({
513
536
  "Sigma ",
514
537
  /* @__PURE__ */ e.jsx("span", { className: "bg-indigo-600 text-white text-[10px] px-1.5 py-0.5 rounded-md leading-none ml-1 uppercase font-bold tracking-tight", children: "AI" })
515
538
  ] }),
516
- /* @__PURE__ */ e.jsx("div", { className: "text-[14px] text-gray-600 mt-3 leading-relaxed px-4 max-w-[280px]", children: s && /* @__PURE__ */ e.jsx("div", { className: "bot-description", children: $(s) }) })
539
+ /* @__PURE__ */ e.jsx("div", { className: "text-[14px] text-gray-600 mt-3 leading-relaxed px-4 max-w-[280px]", children: n && /* @__PURE__ */ e.jsx("div", { className: "bot-description", children: $(n) }) })
517
540
  ] }),
518
- r.map((n, d) => /* @__PURE__ */ e.jsxs(
541
+ r.map((s, u) => /* @__PURE__ */ e.jsxs(
519
542
  "div",
520
543
  {
521
- className: `flex flex-col animate-msg ${n.sender === w.USER ? "items-end" : "items-start"}`,
522
- style: { animationDelay: `${d * 0.05}s` },
544
+ className: `flex flex-col animate-msg group ${s.sender === w.USER ? "items-end" : "items-start"}`,
545
+ style: { animationDelay: `${u * 0.05}s` },
523
546
  children: [
524
- n.sender === w.AI && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1.5 mb-2 ml-1", children: [
525
- /* @__PURE__ */ e.jsx(
526
- "img",
527
- {
528
- src: i,
529
- onError: (m) => m.currentTarget.src = h,
530
- className: "w-4 h-4 object-contain",
531
- alt: "AI"
532
- }
533
- ),
534
- /* @__PURE__ */ e.jsx("span", { className: "text-[11px] font-bold text-gray-400 uppercase tracking-widest", children: "AI Agent" })
547
+ s.sender === w.AI && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between w-full max-w-[96%] mb-2 ml-1", children: [
548
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1.5", children: [
549
+ /* @__PURE__ */ e.jsx(
550
+ "img",
551
+ {
552
+ src: i,
553
+ onError: (m) => m.currentTarget.src = h,
554
+ className: "w-4 h-4 object-contain",
555
+ alt: "AI"
556
+ }
557
+ ),
558
+ /* @__PURE__ */ e.jsx("span", { className: "text-[11px] font-bold text-gray-400 uppercase tracking-widest", children: "AI Agent" })
559
+ ] }),
560
+ /* @__PURE__ */ e.jsx("div", { className: "opacity-0 group-hover:opacity-100 transition-opacity duration-200", children: /* @__PURE__ */ e.jsx(pe, { text: s.content }) })
535
561
  ] }),
536
- /* @__PURE__ */ e.jsxs("div", { className: `flex flex-col ${n.sender === w.USER ? "items-end" : "items-start"} w-full max-w-[96%]`, children: [
562
+ /* @__PURE__ */ e.jsxs("div", { className: `flex flex-col ${s.sender === w.USER ? "items-end" : "items-start"} w-full max-w-[96%]`, children: [
537
563
  /* @__PURE__ */ e.jsx(
538
564
  "div",
539
565
  {
540
- className: `px-4 py-3 rounded-[20px] shadow-sm border border-black/[0.02] overflow-hidden ${n.sender === w.USER ? "bg-indigo-600 text-white rounded-tr-none whitespace-pre-line shadow-indigo-100/50" : "bg-white text-slate-800 border-none rounded-tl-none"} ${!x || n.sender === w.USER ? "whitespace-pre-line" : ""}`,
541
- children: x && n.sender === w.AI ? /* @__PURE__ */ e.jsx(fe, { text: n.content }) : n.content
566
+ className: `px-4 py-3 rounded-[20px] shadow-sm border border-black/[0.02] overflow-hidden transition-all duration-300 ${s.sender === w.USER ? "bg-indigo-600 text-white rounded-tr-none whitespace-pre-line shadow-indigo-100/50" : "bg-white text-slate-800 border-none rounded-tl-none hover:shadow-md"} ${!x || s.sender === w.USER ? "whitespace-pre-line" : ""}`,
567
+ children: x && s.sender === w.AI ? /* @__PURE__ */ e.jsx(fe, { text: s.content }) : s.content
542
568
  }
543
569
  ),
544
- n.type === E.PRODUCT_LIST && n.products && /* @__PURE__ */ e.jsx("div", { className: "w-full mt-4 flex gap-4 overflow-x-auto pb-4 pt-1 no-scrollbar snap-x", children: n.products.map((m) => /* @__PURE__ */ e.jsx("div", { className: "product-card-snap", children: /* @__PURE__ */ e.jsx(xe, { product: m, primaryColor: c }) }, m.id)) }),
545
- d === 0 && r.length === 1 && n.sender === w.AI && /* @__PURE__ */ e.jsx("div", { className: "mt-5 flex flex-wrap gap-2.5 w-full", children: o.map((m, j) => /* @__PURE__ */ e.jsx(
570
+ s.type === T.PRODUCT_LIST && s.products && /* @__PURE__ */ e.jsx("div", { className: "w-full mt-4 flex gap-4 overflow-x-auto pb-4 pt-1 no-scrollbar snap-x", children: s.products.map((m) => /* @__PURE__ */ e.jsx("div", { className: "product-card-snap", children: /* @__PURE__ */ e.jsx(xe, { product: m, primaryColor: d }) }, m.id)) }),
571
+ u === 0 && r.length === 1 && s.sender === w.AI && /* @__PURE__ */ e.jsx("div", { className: "mt-5 flex flex-wrap gap-2.5 w-full", children: o.map((m, j) => /* @__PURE__ */ e.jsx(
546
572
  "button",
547
573
  {
548
574
  onClick: () => l(m),
@@ -554,14 +580,14 @@ const me = ({
554
580
  ] })
555
581
  ]
556
582
  },
557
- n.id
583
+ s.id
558
584
  )),
559
- u && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1.5 items-start animate-msg", children: [
585
+ c && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1.5 items-start animate-msg", children: [
560
586
  /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-1.5 ml-1", children: /* @__PURE__ */ e.jsx(
561
587
  "img",
562
588
  {
563
589
  src: i,
564
- onError: (n) => n.currentTarget.src = h,
590
+ onError: (s) => s.currentTarget.src = h,
565
591
  className: "w-4 h-4 object-contain",
566
592
  alt: "AI Loading"
567
593
  }
@@ -573,11 +599,11 @@ const me = ({
573
599
  ] })
574
600
  ] })
575
601
  ] });
576
- }, ge = ({ placeholder: r, onSendMessage: u, primaryColor: s }) => {
577
- const [o, l] = R(""), c = () => {
578
- o.trim() && (u(o), l(""));
602
+ }, be = ({ placeholder: r, onSendMessage: c, primaryColor: n }) => {
603
+ const [o, l] = E(""), d = () => {
604
+ o.trim() && (c(o), l(""));
579
605
  }, x = (i) => {
580
- i.key === "Enter" && !i.shiftKey && (i.preventDefault(), c());
606
+ i.key === "Enter" && !i.shiftKey && (i.preventDefault(), d());
581
607
  };
582
608
  return /* @__PURE__ */ e.jsx("div", { className: "p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "relative flex items-center bg-gray-50/50 rounded-2xl border border-gray-100 focus-within:border-indigo-100 focus-within:bg-white transition-all duration-200 pr-2 pl-3 py-1", children: [
583
609
  /* @__PURE__ */ e.jsx(
@@ -595,7 +621,7 @@ const me = ({
595
621
  /* @__PURE__ */ e.jsx(
596
622
  "button",
597
623
  {
598
- onClick: c,
624
+ onClick: d,
599
625
  disabled: !o.trim(),
600
626
  className: `w-9 h-9 rounded-xl flex-shrink-0 flex items-center justify-center transition-all duration-300 shadow-sm ${o.trim() ? "bg-indigo-600 text-white hover:bg-indigo-700 active:scale-95" : "bg-gray-200 text-gray-400 cursor-not-allowed"}`,
601
627
  children: /* @__PURE__ */ e.jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", children: [
@@ -605,10 +631,10 @@ const me = ({
605
631
  }
606
632
  )
607
633
  ] }) });
608
- }, be = ({ isOpen: r, onClick: u, primaryColor: s, className: o = "" }) => /* @__PURE__ */ e.jsx("div", { className: `fixed bottom-4 right-4 md:bottom-6 md:right-6 z-[100] ${o}`, children: /* @__PURE__ */ e.jsx(
634
+ }, ve = ({ isOpen: r, onClick: c, primaryColor: n, className: o = "" }) => /* @__PURE__ */ e.jsx("div", { className: `fixed bottom-4 right-4 md:bottom-6 md:right-6 z-[100] ${o}`, children: /* @__PURE__ */ e.jsx(
609
635
  "button",
610
636
  {
611
- onClick: u,
637
+ onClick: c,
612
638
  className: `w-12 h-12 bg-white rounded-2xl shadow-lg flex items-center justify-center border transition-all duration-300 overflow-hidden ${r ? "border-indigo-500 ring-4 ring-indigo-50 scale-105 rotate-0" : "border-slate-100 hover:scale-110 hover:shadow-xl"}`,
613
639
  children: /* @__PURE__ */ e.jsx(
614
640
  "img",
@@ -620,45 +646,45 @@ const me = ({
620
646
  }
621
647
  )
622
648
  }
623
- ) }), le = () => Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15), L = (r, u, s) => typeof r == "object" && r !== null && !Array.isArray(r) ? r[u] || r.en || Object.values(r)[0] || s : r ?? s, je = ({ config: r, onGetAiResponse: u }) => {
624
- const [s, o] = R(!1), [l, c] = R(!1), [x, i] = R(!1), [h, n] = R(le()), [d, m] = R("en"), [j, b] = R([]), [S, _] = R(!1), T = ne(null), C = ne(0);
625
- q(() => {
626
- const v = L(r.welcomeMessage, d, "Hello!");
649
+ ) }), le = () => Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15), L = (r, c, n) => typeof r == "object" && r !== null && !Array.isArray(r) ? r[c] || r.en || Object.values(r)[0] || n : r ?? n, we = ({ config: r, onGetAiResponse: c }) => {
650
+ const [n, o] = E(!1), [l, d] = E(!1), [x, i] = E(!1), [h, s] = E(le()), [u, m] = E("en"), [j, b] = E([]), [S, _] = E(!1), R = ne(null), C = ne(0);
651
+ B(() => {
652
+ const v = L(r.welcomeMessage, u, "Hello!");
627
653
  b([{
628
654
  id: "welcome",
629
- type: E.TEXT,
655
+ type: T.TEXT,
630
656
  sender: w.AI,
631
657
  content: v,
632
658
  timestamp: /* @__PURE__ */ new Date()
633
659
  }]);
634
660
  }, []);
635
- const X = K(() => L(r.placeholder, d, "Type a message..."), [r.placeholder, d]), z = K(() => L(r.quickReplies, d, []), [r.quickReplies, d]), B = K(() => L(r.description, d, ""), [r.description, d]);
636
- q(() => {
661
+ const q = K(() => L(r.placeholder, u, "Type a message..."), [r.placeholder, u]), V = K(() => L(r.quickReplies, u, []), [r.quickReplies, u]), X = K(() => L(r.description, u, ""), [r.description, u]);
662
+ B(() => {
637
663
  if (j.length === 1 && j[0].id === "welcome") {
638
- const v = L(r.welcomeMessage, d, "Hello!");
664
+ const v = L(r.welcomeMessage, u, "Hello!");
639
665
  b([{ ...j[0], content: v }]);
640
666
  }
641
- }, [d]), q(() => {
642
- if (s) {
667
+ }, [u]), B(() => {
668
+ if (n) {
643
669
  const v = setTimeout(() => i(!0), 50);
644
670
  return () => clearTimeout(v);
645
671
  } else
646
672
  i(!1);
647
- }, [s]), q(() => {
648
- T.current && s && (T.current.scrollTop = T.current.scrollHeight);
649
- }, [j, s, S]);
673
+ }, [n]), B(() => {
674
+ R.current && n && (R.current.scrollTop = R.current.scrollHeight);
675
+ }, [j, n, S]);
650
676
  const U = async (v) => {
651
677
  if (!v.trim() || S) return;
652
678
  const A = ++C.current, G = {
653
679
  id: `user-${Date.now()}`,
654
- type: E.TEXT,
680
+ type: T.TEXT,
655
681
  sender: w.USER,
656
682
  content: v,
657
683
  timestamp: /* @__PURE__ */ new Date()
658
684
  };
659
685
  b((N) => [...N, G]), _(!0);
660
686
  try {
661
- const N = u(v, h, d);
687
+ const N = c(v, h, u);
662
688
  if (N && typeof N == "object" && Symbol.asyncIterator in N) {
663
689
  let y = "", k = !1;
664
690
  const O = `ai-${Date.now()}`;
@@ -666,7 +692,7 @@ const me = ({
666
692
  if (A !== C.current) return;
667
693
  k || (b((I) => [...I, {
668
694
  id: O,
669
- type: E.TEXT,
695
+ type: T.TEXT,
670
696
  sender: w.AI,
671
697
  content: "",
672
698
  timestamp: /* @__PURE__ */ new Date()
@@ -681,7 +707,7 @@ const me = ({
681
707
  const k = typeof y == "string" ? { text: y, products: void 0 } : y;
682
708
  b((O) => [...O, {
683
709
  id: `ai-${Date.now()}`,
684
- type: k.products ? E.PRODUCT_LIST : E.TEXT,
710
+ type: k.products ? T.PRODUCT_LIST : T.TEXT,
685
711
  sender: w.AI,
686
712
  content: k.text,
687
713
  products: k.products,
@@ -691,25 +717,25 @@ const me = ({
691
717
  } catch (N) {
692
718
  if (A !== C.current) return;
693
719
  console.error("Chatbox Error:", N), _(!1);
694
- const y = d === "vi" ? "Hệ thống đang bận, vui lòng thử lại sau." : "System is busy, please try again later.";
720
+ const y = u === "vi" ? "Hệ thống đang bận, vui lòng thử lại sau." : "System is busy, please try again later.";
695
721
  b((k) => [...k, {
696
722
  id: `err-${Date.now()}`,
697
- type: E.TEXT,
723
+ type: T.TEXT,
698
724
  sender: w.AI,
699
725
  content: y,
700
726
  timestamp: /* @__PURE__ */ new Date()
701
727
  }]);
702
728
  }
703
- }, V = () => {
704
- C.current++, n(le());
705
- const v = L(r.welcomeMessage, d, "Hello!");
729
+ }, z = () => {
730
+ C.current++, s(le());
731
+ const v = L(r.welcomeMessage, u, "Hello!");
706
732
  b([{
707
733
  id: "welcome",
708
- type: E.TEXT,
734
+ type: T.TEXT,
709
735
  sender: w.AI,
710
736
  content: v,
711
737
  timestamp: /* @__PURE__ */ new Date()
712
- }]), _(!1), c(!1);
738
+ }]), _(!1), d(!1);
713
739
  }, J = `
714
740
  fixed z-[99] overflow-hidden flex flex-col border border-white/40 shadow-2xl bg-white animate-chat-pop
715
741
  ${x ? "transition-[width,height,border-radius,right,bottom] duration-300 ease-in-out" : ""}
@@ -717,44 +743,44 @@ const me = ({
717
743
  `;
718
744
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
719
745
  /* @__PURE__ */ e.jsx(
720
- be,
746
+ ve,
721
747
  {
722
- isOpen: s,
723
- onClick: () => o(!s),
748
+ isOpen: n,
749
+ onClick: () => o(!n),
724
750
  primaryColor: r.primaryColor,
725
- className: s ? "hidden md:flex" : "flex"
751
+ className: n ? "hidden md:flex" : "flex"
726
752
  }
727
753
  ),
728
- s && /* @__PURE__ */ e.jsxs("div", { className: J, style: { left: "auto" }, children: [
754
+ n && /* @__PURE__ */ e.jsxs("div", { className: J, style: { left: "auto" }, children: [
729
755
  /* @__PURE__ */ e.jsx(
730
756
  me,
731
757
  {
732
758
  title: r.botName,
733
759
  primaryColor: r.primaryColor,
734
760
  onClose: () => o(!1),
735
- onReset: V,
736
- onToggleExpand: () => c(!l),
761
+ onReset: z,
762
+ onToggleExpand: () => d(!l),
737
763
  isExpanded: l,
738
- language: d,
764
+ language: u,
739
765
  onLanguageChange: m
740
766
  }
741
767
  ),
742
- /* @__PURE__ */ e.jsx("div", { className: "flex-1 overflow-y-auto chat-scrollbar px-5 py-5 bg-slate-50/30", ref: T, children: /* @__PURE__ */ e.jsx(
743
- pe,
768
+ /* @__PURE__ */ e.jsx("div", { className: "flex-1 overflow-y-auto chat-scrollbar px-5 py-5 bg-slate-50/30", ref: R, children: /* @__PURE__ */ e.jsx(
769
+ ge,
744
770
  {
745
771
  messages: j,
746
772
  isLoading: S,
747
- description: B,
748
- quickReplies: z,
773
+ description: X,
774
+ quickReplies: V,
749
775
  onQuickReply: (v) => U(v),
750
776
  primaryColor: r.primaryColor,
751
777
  renderMarkdown: r.renderMarkdown
752
778
  }
753
779
  ) }),
754
780
  /* @__PURE__ */ e.jsx("div", { className: "bg-white p-3 border-t border-slate-100", children: /* @__PURE__ */ e.jsx(
755
- ge,
781
+ be,
756
782
  {
757
- placeholder: X,
783
+ placeholder: q,
758
784
  onSendMessage: U,
759
785
  primaryColor: r.primaryColor
760
786
  }
@@ -763,7 +789,7 @@ const me = ({
763
789
  ] });
764
790
  };
765
791
  export {
766
- je as Chatbox,
767
- E as MessageType,
792
+ we as Chatbox,
793
+ T as MessageType,
768
794
  w as SenderType
769
795
  };
@@ -1 +1 @@
1
- *,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.chat-scrollbar::-webkit-scrollbar{width:4px}.chat-scrollbar::-webkit-scrollbar-track{background:transparent}.chat-scrollbar::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:10px}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}.pointer-events-none{pointer-events:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.left-2{left:.5rem}.right-0{right:0}.right-1\.5{right:.375rem}.right-4{right:1rem}.top-0{top:0}.top-1\/2{top:50%}.top-2{top:.5rem}.z-10{z-index:10}.z-\[100\]{z-index:100}.z-\[99\]{z-index:99}.my-4{margin-top:1rem;margin-bottom:1rem}.mb-1\.5{margin-bottom:.375rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.ml-1{margin-left:.25rem}.mr-1{margin-right:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.flex{display:flex}.table{display:table}.hidden{display:none}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-2{height:.5rem}.h-20{height:5rem}.h-3{height:.75rem}.h-32{height:8rem}.h-4{height:1rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[80vh\]{height:80vh}.h-full{height:100%}.max-h-\[120px\]{max-height:120px}.min-h-\[30px\]{min-height:30px}.min-h-\[44px\]{min-height:44px}.min-h-screen{min-height:100vh}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-2{width:.5rem}.w-20{width:5rem}.w-4{width:1rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-full{width:100%}.min-w-\[170px\]{min-width:170px}.min-w-full{min-width:100%}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-\[170px\]{max-width:170px}.max-w-\[280px\]{max-width:280px}.max-w-\[96\%\]{max-width:96%}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-0{--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-slate-100>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(241 245 249 / var(--tw-divide-opacity, 1))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.break-all{word-break:break-all}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.5rem}.rounded-\[18px\]{border-radius:18px}.rounded-\[20px\]{border-radius:20px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-none{border-radius:0}.rounded-xl{border-radius:.75rem}.rounded-t-\[28px\]{border-top-left-radius:28px;border-top-right-radius:28px}.rounded-tl-none{border-top-left-radius:0}.rounded-tr-none{border-top-right-radius:0}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-none{border-style:none}.border-black\/\[0\.02\]{border-color:#00000005}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-50{--tw-border-opacity: 1;border-color:rgb(249 250 251 / var(--tw-border-opacity, 1))}.border-indigo-500{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1))}.border-red-50\/50{border-color:#fef2f280}.border-slate-100{--tw-border-opacity: 1;border-color:rgb(241 245 249 / var(--tw-border-opacity, 1))}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-white\/40{border-color:#fff6}.bg-\[\#fff1f2\]\/90{background-color:#fff1f2e6}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-50\/50{background-color:#f9fafb80}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-indigo-300{--tw-bg-opacity: 1;background-color:rgb(165 180 252 / var(--tw-bg-opacity, 1))}.bg-indigo-400{--tw-bg-opacity: 1;background-color:rgb(129 140 248 / var(--tw-bg-opacity, 1))}.bg-indigo-600{--tw-bg-opacity: 1;background-color:rgb(79 70 229 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-slate-50\/30{background-color:#f8fafc4d}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/50{background-color:#ffffff80}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.pb-4{padding-bottom:1rem}.pl-1{padding-left:.25rem}.pl-3{padding-left:.75rem}.pr-2{padding-right:.5rem}.pr-5{padding-right:1.25rem}.pt-1{padding-top:.25rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.align-top{vertical-align:top}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.text-\[9px\]{font-size:9px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.font-black{font-weight:900}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-none{line-height:1}.leading-normal{line-height:1.5}.leading-relaxed{line-height:1.625}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-\[\#1a2b56\]{--tw-text-opacity: 1;color:rgb(26 43 86 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-indigo-400{--tw-text-opacity: 1;color:rgb(129 140 248 / var(--tw-text-opacity, 1))}.text-indigo-500{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.text-indigo-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-slate-800{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.text-slate-900{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.line-through{text-decoration-line:line-through}.opacity-60{opacity:.6}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-indigo-100\/50{--tw-shadow-color: rgb(224 231 255 / .5);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-indigo-50{--tw-ring-opacity: 1;--tw-ring-color: rgb(238 242 255 / var(--tw-ring-opacity, 1))}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-\[width\,height\,border-radius\,right\,bottom\]{transition-property:width,height,border-radius,right,bottom;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.product-card-snap{scroll-snap-align:start}.\[animation-delay\:0\.2s\]{animation-delay:.2s}.\[animation-delay\:0\.4s\]{animation-delay:.4s}@keyframes chat-pop{0%{transform:scale(.9) translateY(20px);opacity:0}to{transform:scale(1) translateY(0);opacity:1}}@keyframes msg-fade-in{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes sigma-bounce{0%,to{transform:translateY(0)}50%{transform:translateY(-4px)}}.animate-chat-pop{animation:chat-pop .4s cubic-bezier(.34,1.56,.64,1) forwards}.animate-msg{animation:msg-fade-in .3s ease-out forwards}.animate-sigma-bounce{animation:sigma-bounce .6s infinite}.placeholder\:text-gray-400::-moz-placeholder{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.placeholder\:text-gray-400::placeholder{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.first\:mt-1:first-child{margin-top:.25rem}.last\:border-r-0:last-child{border-right-width:0px}.focus-within\:border-indigo-100:focus-within{--tw-border-opacity: 1;border-color:rgb(224 231 255 / var(--tw-border-opacity, 1))}.focus-within\:bg-white:focus-within{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.hover\:scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-indigo-100:hover{--tw-border-opacity: 1;border-color:rgb(224 231 255 / var(--tw-border-opacity, 1))}.hover\:bg-indigo-700:hover{--tw-bg-opacity: 1;background-color:rgb(67 56 202 / var(--tw-bg-opacity, 1))}.hover\:bg-red-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-50\/50:hover{background-color:#f8fafc80}.hover\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.hover\:bg-white\/60:hover{background-color:#fff9}.hover\:text-indigo-600:hover{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-xl:hover{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-0:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-indigo-100:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(224 231 255 / var(--tw-ring-opacity, 1))}.active\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:scale-125{--tw-scale-x: 1.25;--tw-scale-y: 1.25;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}@media(min-width:768px){.md\:bottom-6{bottom:1.5rem}.md\:right-28{right:7rem}.md\:right-6{right:1.5rem}.md\:flex{display:flex}.md\:h-\[580px\]{height:580px}.md\:h-\[85vh\]{height:85vh}.md\:w-\[420px\]{width:420px}.md\:w-\[850px\]{width:850px}.md\:rounded-\[28px\]{border-radius:28px}.md\:rounded-\[32px\]{border-radius:32px}.md\:text-6xl{font-size:3.75rem;line-height:1}}
1
+ *,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.chat-scrollbar::-webkit-scrollbar{width:4px;height:4px}.chat-scrollbar::-webkit-scrollbar-track{background:transparent}.chat-scrollbar::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:10px}.custom-table-scroll::-webkit-scrollbar{height:6px}.custom-table-scroll::-webkit-scrollbar-thumb{background:#e2e8f0}.custom-table-scroll::-webkit-scrollbar-thumb:hover{background:#cbd5e1}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}.markdown-render table{border-collapse:collapse;width:100%;margin:10px 0}.markdown-render th,.markdown-render td{border:1px solid #f1f5f9}.bot-description strong{color:#4f46e5}.pointer-events-none{pointer-events:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.left-2{left:.5rem}.right-0{right:0}.right-1\.5{right:.375rem}.right-4{right:1rem}.top-0{top:0}.top-1\/2{top:50%}.top-2{top:.5rem}.z-10{z-index:10}.z-\[100\]{z-index:100}.z-\[99\]{z-index:99}.my-4{margin-top:1rem;margin-bottom:1rem}.mb-1\.5{margin-bottom:.375rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.ml-1{margin-left:.25rem}.mr-1{margin-right:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.flex{display:flex}.table{display:table}.hidden{display:none}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-2{height:.5rem}.h-20{height:5rem}.h-3{height:.75rem}.h-32{height:8rem}.h-4{height:1rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[80vh\]{height:80vh}.h-full{height:100%}.max-h-\[120px\]{max-height:120px}.min-h-\[30px\]{min-height:30px}.min-h-\[44px\]{min-height:44px}.min-h-screen{min-height:100vh}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-2{width:.5rem}.w-20{width:5rem}.w-4{width:1rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-full{width:100%}.min-w-\[170px\]{min-width:170px}.min-w-full{min-width:100%}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-\[170px\]{max-width:170px}.max-w-\[280px\]{max-width:280px}.max-w-\[96\%\]{max-width:96%}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-0{--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-slate-100>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(241 245 249 / var(--tw-divide-opacity, 1))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.break-all{word-break:break-all}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.5rem}.rounded-\[18px\]{border-radius:18px}.rounded-\[20px\]{border-radius:20px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-none{border-radius:0}.rounded-xl{border-radius:.75rem}.rounded-t-\[28px\]{border-top-left-radius:28px;border-top-right-radius:28px}.rounded-tl-none{border-top-left-radius:0}.rounded-tr-none{border-top-right-radius:0}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-none{border-style:none}.border-black\/\[0\.02\]{border-color:#00000005}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-50{--tw-border-opacity: 1;border-color:rgb(249 250 251 / var(--tw-border-opacity, 1))}.border-indigo-500{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1))}.border-red-50\/50{border-color:#fef2f280}.border-slate-100{--tw-border-opacity: 1;border-color:rgb(241 245 249 / var(--tw-border-opacity, 1))}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-white\/40{border-color:#fff6}.bg-\[\#fff1f2\]\/90{background-color:#fff1f2e6}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-50\/50{background-color:#f9fafb80}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-indigo-300{--tw-bg-opacity: 1;background-color:rgb(165 180 252 / var(--tw-bg-opacity, 1))}.bg-indigo-400{--tw-bg-opacity: 1;background-color:rgb(129 140 248 / var(--tw-bg-opacity, 1))}.bg-indigo-600{--tw-bg-opacity: 1;background-color:rgb(79 70 229 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-slate-50\/30{background-color:#f8fafc4d}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/50{background-color:#ffffff80}.bg-gradient-to-l{background-image:linear-gradient(to left,var(--tw-gradient-stops))}.from-white\/80{--tw-gradient-from: rgb(255 255 255 / .8) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.pb-4{padding-bottom:1rem}.pl-1{padding-left:.25rem}.pl-3{padding-left:.75rem}.pr-2{padding-right:.5rem}.pr-5{padding-right:1.25rem}.pt-1{padding-top:.25rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.align-top{vertical-align:top}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.text-\[9px\]{font-size:9px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.font-black{font-weight:900}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-none{line-height:1}.leading-normal{line-height:1.5}.leading-relaxed{line-height:1.625}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-\[\#1a2b56\]{--tw-text-opacity: 1;color:rgb(26 43 86 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-indigo-400{--tw-text-opacity: 1;color:rgb(129 140 248 / var(--tw-text-opacity, 1))}.text-indigo-500{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.text-indigo-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-slate-800{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.text-slate-900{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.line-through{text-decoration-line:line-through}.opacity-0{opacity:0}.opacity-60{opacity:.6}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-indigo-100\/50{--tw-shadow-color: rgb(224 231 255 / .5);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-indigo-50{--tw-ring-opacity: 1;--tw-ring-color: rgb(238 242 255 / var(--tw-ring-opacity, 1))}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-\[width\,height\,border-radius\,right\,bottom\]{transition-property:width,height,border-radius,right,bottom;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.product-card-snap{scroll-snap-align:start}.\[animation-delay\:0\.2s\]{animation-delay:.2s}.\[animation-delay\:0\.4s\]{animation-delay:.4s}@keyframes chat-pop{0%{transform:scale(.9) translateY(20px);opacity:0}to{transform:scale(1) translateY(0);opacity:1}}@keyframes msg-fade-in{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes sigma-bounce{0%,to{transform:translateY(0)}50%{transform:translateY(-4px)}}.animate-chat-pop{animation:chat-pop .4s cubic-bezier(.34,1.56,.64,1) forwards}.animate-msg{animation:msg-fade-in .3s ease-out forwards}.animate-sigma-bounce{animation:sigma-bounce .6s infinite}.placeholder\:text-gray-400::-moz-placeholder{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.placeholder\:text-gray-400::placeholder{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.first\:mt-1:first-child{margin-top:.25rem}.last\:border-r-0:last-child{border-right-width:0px}.focus-within\:border-indigo-100:focus-within{--tw-border-opacity: 1;border-color:rgb(224 231 255 / var(--tw-border-opacity, 1))}.focus-within\:bg-white:focus-within{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.hover\:scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-indigo-100:hover{--tw-border-opacity: 1;border-color:rgb(224 231 255 / var(--tw-border-opacity, 1))}.hover\:bg-indigo-700:hover{--tw-bg-opacity: 1;background-color:rgb(67 56 202 / var(--tw-bg-opacity, 1))}.hover\:bg-red-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-100:hover{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-50\/50:hover{background-color:#f8fafc80}.hover\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.hover\:bg-white\/60:hover{background-color:#fff9}.hover\:text-indigo-600:hover{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-xl:hover{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-0:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-indigo-100:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(224 231 255 / var(--tw-ring-opacity, 1))}.active\:scale-90:active{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:scale-125{--tw-scale-x: 1.25;--tw-scale-y: 1.25;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.group\/table:hover .group-hover\/table\:opacity-100,.group:hover .group-hover\:opacity-100{opacity:1}@media(min-width:768px){.md\:bottom-6{bottom:1.5rem}.md\:right-28{right:7rem}.md\:right-6{right:1.5rem}.md\:flex{display:flex}.md\:hidden{display:none}.md\:h-\[580px\]{height:580px}.md\:h-\[85vh\]{height:85vh}.md\:w-\[420px\]{width:420px}.md\:w-\[850px\]{width:850px}.md\:rounded-\[28px\]{border-radius:28px}.md\:rounded-\[32px\]{border-radius:32px}.md\:text-6xl{font-size:3.75rem;line-height:1}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-sigma-chatbox",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "type": "module",
5
5
  "description": "A high-quality React chatbox library featuring product cards, quick replies, and AI integration.",
6
6
  "main": "dist/index.js",
@@ -52,4 +52,4 @@
52
52
  "autoprefixer": "^10.4.0",
53
53
  "postcss": "^8.4.0"
54
54
  }
55
- }
55
+ }