react-aichatbot-widget 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -3,4 +3,4 @@
3
3
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[_e]=this[_e]={accessors:{}}).accessors,s=this.prototype;function o(i){const l=W(i);r[l]||(jn(s,i),r[l]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}};A.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(A.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});a.freezeMethods(A);function he(e,t){const n=this||Q,r=t||n,s=A.from(r.headers);let o=r.data;return a.forEach(e,function(l){o=l.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function at(e){return!!(e&&e.__CANCEL__)}function J(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(J,y,{__CANCEL__:!0});function lt(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new y("Request failed with status code "+n.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function kn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Pn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(f){const d=Date.now(),c=r[o];i||(i=d),n[s]=f,r[s]=d;let h=o,g=0;for(;h!==s;)g+=n[h++],h=h%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),d-i<t)return;const x=c&&d-c;return x?Math.round(g*1e3/x):void 0}}function Fn(e,t){let n=0,r=1e3/t,s,o;const i=(d,c=Date.now())=>{n=c,s=null,o&&(clearTimeout(o),o=null),e(...d)};return[(...d)=>{const c=Date.now(),h=c-n;h>=r?i(d,c):(s=d,o||(o=setTimeout(()=>{o=null,i(s)},r-h)))},()=>s&&i(s)]}const oe=(e,t,n=3)=>{let r=0;const s=Pn(50,250);return Fn(o=>{const i=o.loaded,l=o.lengthComputable?o.total:void 0,f=i-r,d=s(f),c=i<=l;r=i;const h={loaded:i,total:l,progress:l?i/l:void 0,bytes:f,rate:d||void 0,estimated:d&&l&&c?(l-i)/d:void 0,event:o,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(h)},n)},Le=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Be=e=>(...t)=>a.asap(()=>e(...t)),Un=C.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,C.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(C.origin),C.navigator&&/(msie|trident)/i.test(C.navigator.userAgent)):()=>!0,_n=C.hasStandardBrowserEnv?{write(e,t,n,r,s,o,i){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];a.isNumber(n)&&l.push(`expires=${new Date(n).toUTCString()}`),a.isString(r)&&l.push(`path=${r}`),a.isString(s)&&l.push(`domain=${s}`),o===!0&&l.push("secure"),a.isString(i)&&l.push(`SameSite=${i}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Ln(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Bn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ct(e,t,n){let r=!Ln(t);return e&&(r||n==!1)?Bn(e,t):t}const De=e=>e instanceof A?{...e}:e;function v(e,t){t=t||{};const n={};function r(d,c,h,g){return a.isPlainObject(d)&&a.isPlainObject(c)?a.merge.call({caseless:g},d,c):a.isPlainObject(c)?a.merge({},c):a.isArray(c)?c.slice():c}function s(d,c,h,g){if(a.isUndefined(c)){if(!a.isUndefined(d))return r(void 0,d,h,g)}else return r(d,c,h,g)}function o(d,c){if(!a.isUndefined(c))return r(void 0,c)}function i(d,c){if(a.isUndefined(c)){if(!a.isUndefined(d))return r(void 0,d)}else return r(void 0,c)}function l(d,c,h){if(h in t)return r(d,c);if(h in e)return r(void 0,d)}const f={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:l,headers:(d,c,h)=>s(De(d),De(c),h,!0)};return a.forEach(Object.keys({...e,...t}),function(c){const h=f[c]||s,g=h(e[c],t[c],c);a.isUndefined(g)&&h!==l||(n[c]=g)}),n}const ut=e=>{const t=v({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:l}=t;if(t.headers=i=A.from(i),t.url=st(ct(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&i.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),a.isFormData(n)){if(C.hasStandardBrowserEnv||C.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(a.isFunction(n.getHeaders)){const f=n.getHeaders(),d=["content-type","content-length"];Object.entries(f).forEach(([c,h])=>{d.includes(c.toLowerCase())&&i.set(c,h)})}}if(C.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&Un(t.url))){const f=s&&o&&_n.read(o);f&&i.set(s,f)}return t},Dn=typeof XMLHttpRequest<"u",$n=Dn&&function(e){return new Promise(function(n,r){const s=ut(e);let o=s.data;const i=A.from(s.headers).normalize();let{responseType:l,onUploadProgress:f,onDownloadProgress:d}=s,c,h,g,x,u;function m(){x&&x(),u&&u(),s.cancelToken&&s.cancelToken.unsubscribe(c),s.signal&&s.signal.removeEventListener("abort",c)}let p=new XMLHttpRequest;p.open(s.method.toUpperCase(),s.url,!0),p.timeout=s.timeout;function w(){if(!p)return;const S=A.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),k={data:!l||l==="text"||l==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:S,config:e,request:p};lt(function(j){n(j),m()},function(j){r(j),m()},k),p=null}"onloadend"in p?p.onloadend=w:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(w)},p.onabort=function(){p&&(r(new y("Request aborted",y.ECONNABORTED,e,p)),p=null)},p.onerror=function(O){const k=O&&O.message?O.message:"Network Error",B=new y(k,y.ERR_NETWORK,e,p);B.event=O||null,r(B),p=null},p.ontimeout=function(){let O=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const k=s.transitional||ot;s.timeoutErrorMessage&&(O=s.timeoutErrorMessage),r(new y(O,k.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,e,p)),p=null},o===void 0&&i.setContentType(null),"setRequestHeader"in p&&a.forEach(i.toJSON(),function(O,k){p.setRequestHeader(k,O)}),a.isUndefined(s.withCredentials)||(p.withCredentials=!!s.withCredentials),l&&l!=="json"&&(p.responseType=s.responseType),d&&([g,u]=oe(d,!0),p.addEventListener("progress",g)),f&&p.upload&&([h,x]=oe(f),p.upload.addEventListener("progress",h),p.upload.addEventListener("loadend",x)),(s.cancelToken||s.signal)&&(c=S=>{p&&(r(!S||S.type?new J(null,e,p):S),p.abort(),p=null)},s.cancelToken&&s.cancelToken.subscribe(c),s.signal&&(s.signal.aborted?c():s.signal.addEventListener("abort",c)));const R=kn(s.url);if(R&&C.protocols.indexOf(R)===-1){r(new y("Unsupported protocol "+R+":",y.ERR_BAD_REQUEST,e));return}p.send(o||null)})},In=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(d){if(!s){s=!0,l();const c=d instanceof Error?d:this.reason;r.abort(c instanceof y?c:new J(c instanceof Error?c.message:c))}};let i=t&&setTimeout(()=>{i=null,o(new y(`timeout ${t} of ms exceeded`,y.ETIMEDOUT))},t);const l=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(o):d.removeEventListener("abort",o)}),e=null)};e.forEach(d=>d.addEventListener("abort",o));const{signal:f}=r;return f.unsubscribe=()=>a.asap(l),f}},qn=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},vn=async function*(e,t){for await(const n of Hn(e))yield*qn(n,t)},Hn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},$e=(e,t,n,r)=>{const s=vn(e,t);let o=0,i,l=f=>{i||(i=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:d,value:c}=await s.next();if(d){l(),f.close();return}let h=c.byteLength;if(n){let g=o+=h;n(g)}f.enqueue(new Uint8Array(c))}catch(d){throw l(d),d}},cancel(f){return l(f),s.return()}},{highWaterMark:2})},Ie=64*1024,{isFunction:te}=a,Mn=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:qe,TextEncoder:ve}=a.global,He=(e,...t)=>{try{return!!e(...t)}catch{return!1}},zn=e=>{e=a.merge.call({skipUndefined:!0},Mn,e);const{fetch:t,Request:n,Response:r}=e,s=t?te(t):typeof fetch=="function",o=te(n),i=te(r);if(!s)return!1;const l=s&&te(qe),f=s&&(typeof ve=="function"?(u=>m=>u.encode(m))(new ve):async u=>new Uint8Array(await new n(u).arrayBuffer())),d=o&&l&&He(()=>{let u=!1;const m=new n(C.origin,{body:new qe,method:"POST",get duplex(){return u=!0,"half"}}).headers.has("Content-Type");return u&&!m}),c=i&&l&&He(()=>a.isReadableStream(new r("").body)),h={stream:c&&(u=>u.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(u=>{!h[u]&&(h[u]=(m,p)=>{let w=m&&m[u];if(w)return w.call(m);throw new y(`Response type '${u}' is not supported`,y.ERR_NOT_SUPPORT,p)})});const g=async u=>{if(u==null)return 0;if(a.isBlob(u))return u.size;if(a.isSpecCompliantForm(u))return(await new n(C.origin,{method:"POST",body:u}).arrayBuffer()).byteLength;if(a.isArrayBufferView(u)||a.isArrayBuffer(u))return u.byteLength;if(a.isURLSearchParams(u)&&(u=u+""),a.isString(u))return(await f(u)).byteLength},x=async(u,m)=>{const p=a.toFiniteNumber(u.getContentLength());return p??g(m)};return async u=>{let{url:m,method:p,data:w,signal:R,cancelToken:S,timeout:O,onDownloadProgress:k,onUploadProgress:B,responseType:j,headers:de,withCredentials:Z="same-origin",fetchOptions:Ce}=ut(u),Oe=t||fetch;j=j?(j+"").toLowerCase():"text";let Y=In([R,S&&S.toAbortSignal()],O),V=null;const D=Y&&Y.unsubscribe&&(()=>{Y.unsubscribe()});let Te;try{if(B&&d&&p!=="get"&&p!=="head"&&(Te=await x(de,w))!==0){let L=new n(m,{method:"POST",body:w,duplex:"half"}),H;if(a.isFormData(w)&&(H=L.headers.get("content-type"))&&de.setContentType(H),L.body){const[fe,ee]=Le(Te,oe(Be(B)));w=$e(L.body,Ie,fe,ee)}}a.isString(Z)||(Z=Z?"include":"omit");const F=o&&"credentials"in n.prototype,Ae={...Ce,signal:Y,method:p.toUpperCase(),headers:de.normalize().toJSON(),body:w,duplex:"half",credentials:F?Z:void 0};V=o&&new n(m,Ae);let _=await(o?Oe(V,Ce):Oe(m,Ae));const Ne=c&&(j==="stream"||j==="response");if(c&&(k||Ne&&D)){const L={};["status","statusText","headers"].forEach(je=>{L[je]=_[je]});const H=a.toFiniteNumber(_.headers.get("content-length")),[fe,ee]=k&&Le(H,oe(Be(k),!0))||[];_=new r($e(_.body,Ie,fe,()=>{ee&&ee(),D&&D()}),L)}j=j||"text";let yt=await h[a.findKey(h,j)||"text"](_,u);return!Ne&&D&&D(),await new Promise((L,H)=>{lt(L,H,{data:yt,headers:A.from(_.headers),status:_.status,statusText:_.statusText,config:u,request:V})})}catch(F){throw D&&D(),F&&F.name==="TypeError"&&/Load failed|fetch/i.test(F.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,u,V),{cause:F.cause||F}):y.from(F,F&&F.code,u,V)}}},Jn=new Map,dt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,o=[r,s,n];let i=o.length,l=i,f,d,c=Jn;for(;l--;)f=o[l],d=c.get(f),d===void 0&&c.set(f,d=l?new Map:zn(t)),c=d;return d};dt();const Re={http:ln,xhr:$n,fetch:{get:dt}};a.forEach(Re,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Me=e=>`- ${e}`,Vn=e=>a.isFunction(e)||e===null||e===!1;function Wn(e,t){e=a.isArray(e)?e:[e];const{length:n}=e;let r,s;const o={};for(let i=0;i<n;i++){r=e[i];let l;if(s=r,!Vn(r)&&(s=Re[(l=String(r)).toLowerCase()],s===void 0))throw new y(`Unknown adapter '${l}'`);if(s&&(a.isFunction(s)||(s=s.get(t))))break;o[l||"#"+i]=s}if(!s){const i=Object.entries(o).map(([f,d])=>`adapter ${f} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=n?i.length>1?`since :
4
4
  `+i.map(Me).join(`
5
5
  `):" "+Me(i[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return s}const ft={getAdapter:Wn,adapters:Re};function me(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new J(null,e)}function ze(e){return me(e),e.headers=A.from(e.headers),e.data=he.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ft.getAdapter(e.adapter||Q.adapter,e)(e).then(function(r){return me(e),r.data=he.call(e,e.transformResponse,r),r.headers=A.from(r.headers),r},function(r){return at(r)||(me(e),r&&r.response&&(r.response.data=he.call(e,e.transformResponse,r.response),r.response.headers=A.from(r.response.headers))),Promise.reject(r)})}const pt="1.13.2",ue={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ue[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Je={};ue.transitional=function(t,n,r){function s(o,i){return"[Axios v"+pt+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,l)=>{if(t===!1)throw new y(s(i," has been removed"+(n?" in "+n:"")),y.ERR_DEPRECATED);return n&&!Je[i]&&(Je[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,l):!0}};ue.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Kn(e,t,n){if(typeof e!="object")throw new y("options must be an object",y.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const l=e[o],f=l===void 0||i(l,o,e);if(f!==!0)throw new y("option "+o+" must be "+f,y.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new y("Unknown option "+o,y.ERR_BAD_OPTION)}}const se={assertOptions:Kn,validators:ue},U=se.validators;let I=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ue,response:new Ue}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
- `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=v(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&se.assertOptions(r,{silentJSONParsing:U.transitional(U.boolean),forcedJSONParsing:U.transitional(U.boolean),clarifyTimeoutError:U.transitional(U.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:se.assertOptions(s,{encode:U.function,serialize:U.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),se.assertOptions(n,{baseUrl:U.spelling("baseURL"),withXsrfToken:U.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],u=>{delete o[u]}),n.headers=A.concat(i,o);const l=[];let f=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(f=f&&m.synchronous,l.unshift(m.fulfilled,m.rejected))});const d=[];this.interceptors.response.forEach(function(m){d.push(m.fulfilled,m.rejected)});let c,h=0,g;if(!f){const u=[ze.bind(this),void 0];for(u.unshift(...l),u.push(...d),g=u.length,c=Promise.resolve(n);h<g;)c=c.then(u[h++],u[h++]);return c}g=l.length;let x=n;for(;h<g;){const u=l[h++],m=l[h++];try{x=u(x)}catch(p){m.call(this,p);break}}try{c=ze.call(this,x)}catch(u){return Promise.reject(u)}for(h=0,g=d.length;h<g;)c=c.then(d[h++],d[h++]);return c}getUri(t){t=v(this.defaults,t);const n=ct(t.baseURL,t.url,t.allowAbsoluteUrls);return st(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){I.prototype[t]=function(n,r){return this.request(v(r||{},{method:t,url:n,data:(r||{}).data}))}});a.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,l){return this.request(v(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}I.prototype[t]=n(),I.prototype[t+"Form"]=n(!0)});let Xn=class ht{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(l=>{r.subscribe(l),o=l}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,l){r.reason||(r.reason=new J(o,i,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new ht(function(s){t=s}),cancel:t}}};function Gn(e){return function(n){return e.apply(null,n)}}function Qn(e){return a.isObject(e)&&e.isAxiosError===!0}const we={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(we).forEach(([e,t])=>{we[t]=e});function mt(e){const t=new I(e),n=Ve(I.prototype.request,t);return a.extend(n,I.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return mt(v(e,s))},n}const E=mt(Q);E.Axios=I;E.CanceledError=J;E.CancelToken=Xn;E.isCancel=at;E.VERSION=pt;E.toFormData=ce;E.AxiosError=y;E.Cancel=E.CanceledError;E.all=function(t){return Promise.all(t)};E.spread=Gn;E.isAxiosError=Qn;E.mergeConfig=v;E.AxiosHeaders=A;E.formToJSON=e=>it(a.isHTMLForm(e)?new FormData(e):e);E.getAdapter=ft.getAdapter;E.HttpStatusCode=we;E.default=E;const{Axios:rr,AxiosError:sr,CanceledError:or,isCancel:ir,CancelToken:ar,VERSION:lr,all:cr,Cancel:ur,isAxiosError:dr,spread:fr,toFormData:pr,AxiosHeaders:hr,HttpStatusCode:mr,formToJSON:br,getAdapter:yr,mergeConfig:gr}=E,bt=async(e,t,n,r)=>{const s={chatInput:e,sessionId:t,metadata:{pinecone_namespace:n}};try{return(await E.post(r,s,{headers:{"Content-Type":"application/json"}})).data.output}catch(o){throw console.error("Error communicating with chat API:",o),o}},Zn=({handleMessageFromForm:e,theme:t,chatBotData:n})=>{const[r,s]=N.useState(""),[o,i]=N.useState(""),[l,f]=N.useState(""),[d,c]=N.useState(!1),h=async g=>{if(g.preventDefault(),c(!0),f(""),!r.trim()||!o.trim()){f("Name and email are required");return}const x=`Hi, I am ${r} and my email is ${o}`;try{const m=(await bt(x,n.sessionId,n.pineconeNamespace,n.url)).response;e([{type:"user",text:x},{type:"bot",text:m}])}catch(u){console.log("error sending user details",u),f("Failed to submit. Please try again.")}finally{c(!1)}s(""),i("")};return b.jsx("div",{className:"p-5 flex-shrink-0",style:{background:t.backgroundColor},children:b.jsxs("form",{onSubmit:h,className:"flex flex-col gap-6",children:[l&&b.jsx("div",{className:"bg-red-100 text-neutral-800 p-2 rounded relative text-center text-sm",role:"alert",children:l}),b.jsx("p",{className:" text-sm font-medium",style:{color:`${t.fontColor}`},children:n.welcomeText}),b.jsxs("div",{className:"flex flex-col gap-5",children:[b.jsxs("div",{className:"flex flex-col gap-1",children:[b.jsx("label",{className:"text-sm",style:{color:`${t.fontColor}`},children:"Full Name"}),b.jsx("input",{type:"text",placeholder:"Enter your full name",value:r,onChange:g=>{s(g.target.value),f("")},className:"w-full px-3 py-2 border border-neutral-300 rounded-xl",style:{background:`${t.backgroundColor}`,color:`${t.fontColor}`},required:!0})]}),b.jsxs("div",{className:"flex flex-col gap-1",children:[b.jsx("label",{className:"text-sm",style:{color:`${t.fontColor}`},children:"Email Address"}),b.jsx("input",{type:"email",placeholder:"Enter your email",value:o,onChange:g=>{i(g.target.value),f("")},className:"w-full px-3 py-2 border border-neutral-300 rounded-xl",style:{background:`${t.backgroundColor}`,color:`${t.fontColor}`},required:!0})]})]}),b.jsx("button",{type:"submit",disabled:!r.trim()||!o.trim()||d,className:"disabled:opacity-50 disabled:cursor-not-allowed px-5 py-3 rounded-xl font-medium flex items-center justify-center gap-2 mt-20",style:{background:`linear-gradient(135deg, ${t.primaryColor}, ${t.secondaryColor})`,color:t.fontColor},children:d?"Submitting...":b.jsxs(b.Fragment,{children:[b.jsx(q.Send,{size:18})," Submit"]})})]})})},Yn=({onClose:e,theme:t,chatBotData:n})=>{const[r,s]=N.useState([]),[o,i]=N.useState(!1),[l,f]=N.useState(!1),d=n.position==="left"?"left-8":"right-8",c={boxShadow:"0 20px 25px -5px rgba(0,0,0,0.15)",background:t.backgroundColor},h={background:`linear-gradient(135deg, ${t.primaryColor}, ${t.secondaryColor})`,color:t.fontColor},g={background:t.backgroundColor,color:t.fontColor},x=m=>{s(m),f(!0)},u=async m=>{i(!0),s(p=>[...p,{type:"user",text:m}]);try{const w=(await bt(m,n.sessionId,n.pineconeNamespace,n.url)).response;s(R=>[...R,{type:"bot",text:w}])}catch(p){console.error("Chat error:",p),s(w=>[...w,{type:"bot",text:"Sorry, something went wrong."}])}finally{i(!1)}};return b.jsxs("div",{className:`fixed bottom-28 ${d} z-50 w-96 h-[520px] bg-white/90 backdrop-blur-xl rounded-2xl border border-white flex flex-col overflow-hidden`,style:c,children:[b.jsxs("div",{className:"bg-gradient-to-r px-5 py-4 rounded-t-2xl flex items-center justify-between shadow-md",style:h,children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsxs("div",{className:"relative",children:[b.jsx("div",{className:"w-11 h-11 rounded-full flex items-center justify-center",children:b.jsx(q.MessageCircle,{size:22})}),b.jsx("span",{className:"absolute bottom-0 right-0 w-3.5 h-3.5 bg-emerald-400 rounded-full border-1 border-white"})]}),b.jsxs("div",{children:[b.jsx("h3",{className:"font-semibold text-lg",children:n.name}),b.jsx("p",{className:"text-xs opacity-90",children:n.subTitle})]})]}),b.jsx("button",{onClick:e,"aria-label":"Close chat",className:"p-2 hover:bg-white/20 rounded-full",children:b.jsx(q.X,{size:20})})]}),!l&&b.jsx(Zn,{handleMessageFromForm:x,theme:t,chatBotData:n}),l&&b.jsxs(b.Fragment,{children:[b.jsx(Et,{messages:r,isLoading:o,theme:t}),b.jsx(xt,{onSendMessage:u,isLoading:o,theme:t})]}),b.jsx("div",{className:"border-t border-neutral-200 px-5 py-3 text-center",style:g,children:b.jsxs("p",{className:"text-[11px] tracking-wide",style:{color:`${t.fontColor}`},children:["powered by ",b.jsx("span",{className:"font-semibold ",style:{color:`${t.fontColor}`},children:"clone67.com"})]})})]})},er=({pineconeNamespace:e,url:t,primaryColor:n,secondaryColor:r,backgroundColor:s,fontColor:o,placeholderColor:i,position:l,name:f,subTitle:d,welcomeText:c})=>{const[h,g]=N.useState(!1),[x,u]=N.useState("");N.useEffect(()=>{u(gt.v4())},[]);const m=()=>g(R=>!R),p={primaryColor:n,secondaryColor:r,backgroundColor:s,fontColor:o,placeholderColor:i},w={name:f,subTitle:d,welcomeText:c,url:t,pineconeNamespace:e,position:l,sessionId:x};return b.jsxs("div",{className:"fixed inset-0 pointer-events-auto z-[9999]",children:[h&&b.jsx(Yn,{onClose:m,sessionId:x,pineconeNamespace:e,url:t,theme:p,chatBotData:w}),b.jsx(wt,{onClick:m,isOpen:h,theme:p,chatBotData:w})]})};module.exports=er;
6
+ `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=v(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&se.assertOptions(r,{silentJSONParsing:U.transitional(U.boolean),forcedJSONParsing:U.transitional(U.boolean),clarifyTimeoutError:U.transitional(U.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:se.assertOptions(s,{encode:U.function,serialize:U.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),se.assertOptions(n,{baseUrl:U.spelling("baseURL"),withXsrfToken:U.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],u=>{delete o[u]}),n.headers=A.concat(i,o);const l=[];let f=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(f=f&&m.synchronous,l.unshift(m.fulfilled,m.rejected))});const d=[];this.interceptors.response.forEach(function(m){d.push(m.fulfilled,m.rejected)});let c,h=0,g;if(!f){const u=[ze.bind(this),void 0];for(u.unshift(...l),u.push(...d),g=u.length,c=Promise.resolve(n);h<g;)c=c.then(u[h++],u[h++]);return c}g=l.length;let x=n;for(;h<g;){const u=l[h++],m=l[h++];try{x=u(x)}catch(p){m.call(this,p);break}}try{c=ze.call(this,x)}catch(u){return Promise.reject(u)}for(h=0,g=d.length;h<g;)c=c.then(d[h++],d[h++]);return c}getUri(t){t=v(this.defaults,t);const n=ct(t.baseURL,t.url,t.allowAbsoluteUrls);return st(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){I.prototype[t]=function(n,r){return this.request(v(r||{},{method:t,url:n,data:(r||{}).data}))}});a.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,l){return this.request(v(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}I.prototype[t]=n(),I.prototype[t+"Form"]=n(!0)});let Xn=class ht{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(l=>{r.subscribe(l),o=l}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,l){r.reason||(r.reason=new J(o,i,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new ht(function(s){t=s}),cancel:t}}};function Gn(e){return function(n){return e.apply(null,n)}}function Qn(e){return a.isObject(e)&&e.isAxiosError===!0}const we={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(we).forEach(([e,t])=>{we[t]=e});function mt(e){const t=new I(e),n=Ve(I.prototype.request,t);return a.extend(n,I.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return mt(v(e,s))},n}const E=mt(Q);E.Axios=I;E.CanceledError=J;E.CancelToken=Xn;E.isCancel=at;E.VERSION=pt;E.toFormData=ce;E.AxiosError=y;E.Cancel=E.CanceledError;E.all=function(t){return Promise.all(t)};E.spread=Gn;E.isAxiosError=Qn;E.mergeConfig=v;E.AxiosHeaders=A;E.formToJSON=e=>it(a.isHTMLForm(e)?new FormData(e):e);E.getAdapter=ft.getAdapter;E.HttpStatusCode=we;E.default=E;const{Axios:rr,AxiosError:sr,CanceledError:or,isCancel:ir,CancelToken:ar,VERSION:lr,all:cr,Cancel:ur,isAxiosError:dr,spread:fr,toFormData:pr,AxiosHeaders:hr,HttpStatusCode:mr,formToJSON:br,getAdapter:yr,mergeConfig:gr}=E,bt=async(e,t,n,r)=>{const s={chatInput:e,sessionId:t,metadata:{pinecone_namespace:n}};try{return(await E.post(r,s,{headers:{"Content-Type":"application/json"}})).data.output}catch(o){throw console.error("Error communicating with chat API:",o),o}},Zn=({handleMessageFromForm:e,theme:t,chatBotData:n})=>{const[r,s]=N.useState(""),[o,i]=N.useState(""),[l,f]=N.useState(""),[d,c]=N.useState(!1),h=async g=>{if(g.preventDefault(),c(!0),f(""),!r.trim()||!o.trim()){f("Name and email are required");return}const x=`Hi, I am ${r} and my email is ${o}`;try{const m=(await bt(x,n.sessionId,n.pineconeNamespace,n.url)).response;e([{type:"user",text:x},{type:"bot",text:m}])}catch(u){console.log("error sending user details",u),f("Failed to submit. Please try again.")}finally{c(!1)}s(""),i("")};return b.jsx("div",{className:"p-5 flex-shrink-0",style:{background:t.backgroundColor},children:b.jsxs("form",{onSubmit:h,className:"flex flex-col gap-6",children:[l&&b.jsx("div",{className:"bg-red-100 text-neutral-800 p-2 rounded relative text-center text-sm",role:"alert",children:l}),b.jsx("p",{className:" text-sm font-medium",style:{color:`${t.fontColor}`},children:n.welcomeText}),b.jsxs("div",{className:"flex flex-col gap-5",children:[b.jsxs("div",{className:"flex flex-col gap-1",children:[b.jsx("label",{className:"text-sm",style:{color:`${t.fontColor}`},children:"Full Name"}),b.jsx("input",{type:"text",placeholder:"Enter your full name",value:r,onChange:g=>{s(g.target.value),f("")},className:"w-full px-3 py-2 border border-neutral-300 rounded-xl",style:{background:`${t.backgroundColor}`,color:`${t.fontColor}`},required:!0})]}),b.jsxs("div",{className:"flex flex-col gap-1",children:[b.jsx("label",{className:"text-sm",style:{color:`${t.fontColor}`},children:"Email Address"}),b.jsx("input",{type:"email",placeholder:"Enter your email",value:o,onChange:g=>{i(g.target.value),f("")},className:"w-full px-3 py-2 border border-neutral-300 rounded-xl",style:{background:`${t.backgroundColor}`,color:`${t.fontColor}`},required:!0})]})]}),b.jsx("button",{type:"submit",disabled:!r.trim()||!o.trim()||d,className:"disabled:opacity-50 disabled:cursor-not-allowed px-5 py-3 rounded-xl font-medium flex items-center justify-center gap-2 mt-20",style:{background:`linear-gradient(135deg, ${t.primaryColor}, ${t.secondaryColor})`,color:t.fontColor},children:d?"Submitting...":b.jsxs(b.Fragment,{children:[b.jsx(q.Send,{size:18})," Submit"]})})]})})},Yn=({onClose:e,theme:t,chatBotData:n})=>{const[r,s]=N.useState([]),[o,i]=N.useState(!1),[l,f]=N.useState(!1),d=n.position==="left"?"left-8":"right-8",c={boxShadow:"0 20px 25px -5px rgba(0,0,0,0.15)",background:t.backgroundColor},h={background:`linear-gradient(135deg, ${t.primaryColor}, ${t.secondaryColor})`,color:t.fontColor},g={background:t.backgroundColor,color:t.fontColor},x=m=>{s(m),f(!0)},u=async m=>{i(!0),s(p=>[...p,{type:"user",text:m}]);try{const w=(await bt(m,n.sessionId,n.pineconeNamespace,n.url)).response;s(R=>[...R,{type:"bot",text:w}])}catch(p){console.error("Chat error:",p),s(w=>[...w,{type:"bot",text:"Sorry, something went wrong."}])}finally{i(!1)}};return b.jsxs("div",{className:`fixed bottom-28 ${d} z-50 w-96 h-[520px] bg-white/90 backdrop-blur-xl rounded-2xl border border-white flex flex-col overflow-hidden`,style:c,children:[b.jsxs("div",{className:"bg-gradient-to-r px-5 py-4 rounded-t-2xl flex items-center justify-between shadow-md",style:h,children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsxs("div",{className:"relative",children:[b.jsx("div",{className:"w-11 h-11 rounded-full flex items-center justify-center",children:b.jsx(q.MessageCircle,{size:22})}),b.jsx("span",{className:"absolute bottom-0 right-0 w-3.5 h-3.5 bg-emerald-400 rounded-full border-1 border-white"})]}),b.jsxs("div",{children:[b.jsx("h3",{className:"font-semibold text-lg",children:n.name}),b.jsx("p",{className:"text-xs opacity-90",children:n.subTitle})]})]}),b.jsx("button",{onClick:e,"aria-label":"Close chat",className:"p-2 hover:bg-white/20 rounded-full",children:b.jsx(q.X,{size:20})})]}),!l&&b.jsx(Zn,{handleMessageFromForm:x,theme:t,chatBotData:n}),l&&b.jsxs(b.Fragment,{children:[b.jsx(Et,{messages:r,isLoading:o,theme:t}),b.jsx(xt,{onSendMessage:u,isLoading:o,theme:t})]}),b.jsx("div",{className:"border-t border-neutral-200 px-5 py-3 text-center",style:g,children:b.jsxs("p",{className:"text-[11px] tracking-wide",style:{color:`${t.fontColor}`},children:["powered by ",b.jsx("span",{className:"font-semibold ",style:{color:`${t.fontColor}`},children:"clone67.com"})]})})]})},er=({pineconeNamespace:e,url:t,primaryColor:n,secondaryColor:r,backgroundColor:s,fontColor:o,placeholderColor:i,position:l,name:f,subTitle:d,welcomeText:c})=>{const[h,g]=N.useState(!1),[x,u]=N.useState("");N.useEffect(()=>{u(gt.v4())},[]);const m=()=>g(R=>!R),p={primaryColor:n,secondaryColor:r,backgroundColor:s,fontColor:o,placeholderColor:i},w={name:f,subTitle:d,welcomeText:c,url:t,pineconeNamespace:e,position:l,sessionId:x};return b.jsxs(b.Fragment,{children:[h&&b.jsx("div",{className:`fixed bottom-24 ${l==="left"?"left-8":"right-8"} z-[9999] pointer-events-auto`,children:b.jsx(Yn,{onClose:m,sessionId:x,pineconeNamespace:e,url:t,theme:p,chatBotData:w})}),b.jsx("div",{className:`fixed bottom-8 ${l==="left"?"left-8":"right-8"} z-[10000] pointer-events-auto`,children:b.jsx(wt,{onClick:m,isOpen:h,theme:p,chatBotData:w})})]})};module.exports=er;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { jsxs as C, jsx as g, Fragment as Ve } from "react/jsx-runtime";
1
+ import { jsxs as C, jsx as y, Fragment as Ee } from "react/jsx-runtime";
2
2
  import { useState as L, useRef as Rt, useEffect as We } from "react";
3
3
  import { X as Ke, MessageCircle as Xe, Send as Ge, Ellipsis as Ct } from "lucide-react";
4
4
  import { v4 as Ot } from "uuid";
@@ -16,8 +16,8 @@ const Tt = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
16
16
  className: `fixed bottom-8 ${s} hover:cursor-pointer pointer-events-auto w-16 h-16 rounded-full shadow-2xl flex items-center justify-center transition-all duration-300 hover:scale-110 focus:outline-none focus:ring-4 focus:ring-offset-2`,
17
17
  style: o,
18
18
  children: [
19
- t ? /* @__PURE__ */ g(Ke, { size: 30, strokeWidth: 2.5 }) : /* @__PURE__ */ g(Xe, { size: 30, strokeWidth: 2.5 }),
20
- !t && /* @__PURE__ */ g("span", { className: "absolute -top-1 -right-1 w-4 h-4 bg-emerald-400 rounded-full border-4 border-white animate-pulse" })
19
+ t ? /* @__PURE__ */ y(Ke, { size: 30, strokeWidth: 2.5 }) : /* @__PURE__ */ y(Xe, { size: 30, strokeWidth: 2.5 }),
20
+ !t && /* @__PURE__ */ y("span", { className: "absolute -top-1 -right-1 w-4 h-4 bg-emerald-400 rounded-full border-4 border-white animate-pulse" })
21
21
  ]
22
22
  }
23
23
  );
@@ -27,13 +27,13 @@ const Tt = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
27
27
  }, i = (l) => {
28
28
  l.key === "Enter" && !l.shiftKey && (l.preventDefault(), o());
29
29
  };
30
- return /* @__PURE__ */ g(
30
+ return /* @__PURE__ */ y(
31
31
  "div",
32
32
  {
33
33
  className: "p-4 border-t border-white flex-shrink-0",
34
34
  style: { background: n.backgroundColor },
35
35
  children: /* @__PURE__ */ C("div", { className: "flex gap-3", children: [
36
- /* @__PURE__ */ g(
36
+ /* @__PURE__ */ y(
37
37
  "input",
38
38
  {
39
39
  type: "text",
@@ -50,7 +50,7 @@ const Tt = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
50
50
  }
51
51
  }
52
52
  ),
53
- /* @__PURE__ */ g(
53
+ /* @__PURE__ */ y(
54
54
  "button",
55
55
  {
56
56
  onClick: o,
@@ -61,7 +61,7 @@ const Tt = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
61
61
  color: n.fontColor
62
62
  },
63
63
  "aria-label": "Send message",
64
- children: /* @__PURE__ */ g(Ge, { size: 18 })
64
+ children: /* @__PURE__ */ y(Ge, { size: 18 })
65
65
  }
66
66
  )
67
67
  ] })
@@ -80,7 +80,7 @@ const Tt = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
80
80
  className: "flex-1 overflow-y-auto p-5 space-y-4 border-t border-white",
81
81
  style: { background: n.backgroundColor, color: n.fontColor },
82
82
  children: [
83
- e.map((o, i) => /* @__PURE__ */ g("div", { className: `flex ${o.type === "user" ? "justify-end" : ""}`, children: /* @__PURE__ */ g(
83
+ e.map((o, i) => /* @__PURE__ */ y("div", { className: `flex ${o.type === "user" ? "justify-end" : ""}`, children: /* @__PURE__ */ y(
84
84
  "div",
85
85
  {
86
86
  className: "px-4 py-3 rounded-2xl shadow-sm border border-neutral-200 max-w-[80%] text-sm leading-relaxed",
@@ -91,15 +91,15 @@ const Tt = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
91
91
  children: o.text
92
92
  }
93
93
  ) }, i)),
94
- t && /* @__PURE__ */ g("div", { className: "flex", children: /* @__PURE__ */ g(
94
+ t && /* @__PURE__ */ y("div", { className: "flex", children: /* @__PURE__ */ y(
95
95
  "div",
96
96
  {
97
97
  className: "px-4 py-3 rounded-2xl rounded-bl-none shadow-sm border border-neutral-200 max-w-[80%] text-sm leading-relaxed",
98
98
  style: { background: n.backgroundColor, color: n.fontColor },
99
- children: /* @__PURE__ */ g(Ct, { className: "animate-pulse" })
99
+ children: /* @__PURE__ */ y(Ct, { className: "animate-pulse" })
100
100
  }
101
101
  ) }),
102
- /* @__PURE__ */ g("div", { ref: r })
102
+ /* @__PURE__ */ y("div", { ref: r })
103
103
  ]
104
104
  }
105
105
  );
@@ -109,7 +109,7 @@ function Qe(e, t) {
109
109
  return e.apply(t, arguments);
110
110
  };
111
111
  }
112
- const { toString: kt } = Object.prototype, { getPrototypeOf: Ee } = Object, { iterator: ie, toStringTag: Ze } = Symbol, ae = /* @__PURE__ */ ((e) => (t) => {
112
+ const { toString: kt } = Object.prototype, { getPrototypeOf: xe } = Object, { iterator: ie, toStringTag: Ze } = Symbol, ae = /* @__PURE__ */ ((e) => (t) => {
113
113
  const n = kt.call(t);
114
114
  return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
115
115
  })(/* @__PURE__ */ Object.create(null)), F = (e) => (e = e.toLowerCase(), (t) => ae(t) === e), le = (e) => (t) => typeof t === e, { isArray: z } = Array, M = le("undefined");
@@ -124,7 +124,7 @@ function Pt(e) {
124
124
  const Ft = le("string"), A = le("function"), et = le("number"), X = (e) => e !== null && typeof e == "object", Ut = (e) => e === !0 || e === !1, ne = (e) => {
125
125
  if (ae(e) !== "object")
126
126
  return !1;
127
- const t = Ee(e);
127
+ const t = xe(e);
128
128
  return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Ze in e) && !(ie in e);
129
129
  }, _t = (e) => {
130
130
  if (!X(e) || K(e))
@@ -189,7 +189,7 @@ const Vt = (e, t, n, { allOwnKeys: r } = {}) => (G(t, (s, o) => {
189
189
  do {
190
190
  for (s = Object.getOwnPropertyNames(e), o = s.length; o-- > 0; )
191
191
  i = s[o], (!r || r(i, e, t)) && !l[i] && (t[i] = e[i], l[i] = !0);
192
- e = n !== !1 && Ee(e);
192
+ e = n !== !1 && xe(e);
193
193
  } while (e && (!n || n(e, t)) && e !== Object.prototype);
194
194
  return t;
195
195
  }, Gt = (e, t, n) => {
@@ -205,7 +205,7 @@ const Vt = (e, t, n, { allOwnKeys: r } = {}) => (G(t, (s, o) => {
205
205
  for (; t-- > 0; )
206
206
  n[t] = e[t];
207
207
  return n;
208
- }, Zt = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Ee(Uint8Array)), Yt = (e, t) => {
208
+ }, Zt = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && xe(Uint8Array)), Yt = (e, t) => {
209
209
  const r = (e && e[ie]).call(e);
210
210
  let s;
211
211
  for (; (s = r.next()) && !s.done; ) {
@@ -223,7 +223,7 @@ const Vt = (e, t, n, { allOwnKeys: r } = {}) => (G(t, (s, o) => {
223
223
  function(n, r, s) {
224
224
  return r.toUpperCase() + s;
225
225
  }
226
- ), Pe = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), rn = F("RegExp"), rt = (e, t) => {
226
+ ), Fe = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), rn = F("RegExp"), rt = (e, t) => {
227
227
  const n = Object.getOwnPropertyDescriptors(e), r = {};
228
228
  G(n, (s, o) => {
229
229
  let i;
@@ -322,8 +322,8 @@ const un = (e) => {
322
322
  forEachEntry: Yt,
323
323
  matchAll: en,
324
324
  isHTMLForm: tn,
325
- hasOwnProperty: Pe,
326
- hasOwnProp: Pe,
325
+ hasOwnProperty: Fe,
326
+ hasOwnProp: Fe,
327
327
  // an alias to avoid ESLint no-prototype-builtins detection
328
328
  reduceDescriptors: rt,
329
329
  freezeMethods: sn,
@@ -401,7 +401,7 @@ function ye(e) {
401
401
  function at(e) {
402
402
  return a.endsWith(e, "[]") ? e.slice(0, -2) : e;
403
403
  }
404
- function Fe(e, t, n) {
404
+ function Ue(e, t, n) {
405
405
  return e ? e.concat(t).map(function(s, o) {
406
406
  return s = at(s), !n && o ? "[" + s + "]" : s;
407
407
  }).join(n ? "." : "") : t;
@@ -444,14 +444,14 @@ function ce(e, t, n) {
444
444
  return m = at(m), w.forEach(function(S, T) {
445
445
  !(a.isUndefined(S) || S === null) && t.append(
446
446
  // eslint-disable-next-line no-nested-ternary
447
- i === !0 ? Fe([m], T, o) : i === null ? m : m + "[]",
447
+ i === !0 ? Ue([m], T, o) : i === null ? m : m + "[]",
448
448
  d(S)
449
449
  );
450
450
  }), !1;
451
451
  }
452
- return ye(u) ? !0 : (t.append(Fe(p, m, o), d(u)), !1);
452
+ return ye(u) ? !0 : (t.append(Ue(p, m, o), d(u)), !1);
453
453
  }
454
- const h = [], y = Object.assign(yn, {
454
+ const h = [], g = Object.assign(yn, {
455
455
  defaultVisitor: c,
456
456
  convertValue: d,
457
457
  isVisitable: ye
@@ -466,7 +466,7 @@ function ce(e, t, n) {
466
466
  w,
467
467
  a.isString(R) ? R.trim() : R,
468
468
  m,
469
- y
469
+ g
470
470
  )) === !0 && E(w, m ? m.concat(R) : [R]);
471
471
  }), h.pop();
472
472
  }
@@ -475,7 +475,7 @@ function ce(e, t, n) {
475
475
  throw new TypeError("data must be an object");
476
476
  return E(e), t;
477
477
  }
478
- function Ue(e) {
478
+ function _e(e) {
479
479
  const t = {
480
480
  "!": "%21",
481
481
  "'": "%27",
@@ -489,17 +489,17 @@ function Ue(e) {
489
489
  return t[r];
490
490
  });
491
491
  }
492
- function xe(e, t) {
492
+ function Se(e, t) {
493
493
  this._pairs = [], e && ce(e, this, t);
494
494
  }
495
- const lt = xe.prototype;
495
+ const lt = Se.prototype;
496
496
  lt.append = function(t, n) {
497
497
  this._pairs.push([t, n]);
498
498
  };
499
499
  lt.toString = function(t) {
500
500
  const n = t ? function(r) {
501
- return t.call(this, r, Ue);
502
- } : Ue;
501
+ return t.call(this, r, _e);
502
+ } : _e;
503
503
  return this._pairs.map(function(s) {
504
504
  return n(s[0]) + "=" + n(s[1]);
505
505
  }, "").join("&");
@@ -516,13 +516,13 @@ function ct(e, t, n) {
516
516
  });
517
517
  const s = n && n.serialize;
518
518
  let o;
519
- if (s ? o = s(t, n) : o = a.isURLSearchParams(t) ? t.toString() : new xe(t, n).toString(r), o) {
519
+ if (s ? o = s(t, n) : o = a.isURLSearchParams(t) ? t.toString() : new Se(t, n).toString(r), o) {
520
520
  const i = e.indexOf("#");
521
521
  i !== -1 && (e = e.slice(0, i)), e += (e.indexOf("?") === -1 ? "?" : "&") + o;
522
522
  }
523
523
  return e;
524
524
  }
525
- class _e {
525
+ class Le {
526
526
  constructor() {
527
527
  this.handlers = [];
528
528
  }
@@ -580,7 +580,7 @@ const ut = {
580
580
  silentJSONParsing: !0,
581
581
  forcedJSONParsing: !0,
582
582
  clarifyTimeoutError: !1
583
- }, wn = typeof URLSearchParams < "u" ? URLSearchParams : xe, En = typeof FormData < "u" ? FormData : null, xn = typeof Blob < "u" ? Blob : null, Sn = {
583
+ }, wn = typeof URLSearchParams < "u" ? URLSearchParams : Se, En = typeof FormData < "u" ? FormData : null, xn = typeof Blob < "u" ? Blob : null, Sn = {
584
584
  isBrowser: !0,
585
585
  classes: {
586
586
  URLSearchParams: wn,
@@ -588,10 +588,10 @@ const ut = {
588
588
  Blob: xn
589
589
  },
590
590
  protocols: ["http", "https", "file", "blob", "url", "data"]
591
- }, Se = typeof window < "u" && typeof document < "u", ge = typeof navigator == "object" && navigator || void 0, Rn = Se && (!ge || ["ReactNative", "NativeScript", "NS"].indexOf(ge.product) < 0), Cn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
592
- self instanceof WorkerGlobalScope && typeof self.importScripts == "function", On = Se && window.location.href || "http://localhost", Tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
591
+ }, Re = typeof window < "u" && typeof document < "u", ge = typeof navigator == "object" && navigator || void 0, Rn = Re && (!ge || ["ReactNative", "NativeScript", "NS"].indexOf(ge.product) < 0), Cn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
592
+ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", On = Re && window.location.href || "http://localhost", Tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
593
593
  __proto__: null,
594
- hasBrowserEnv: Se,
594
+ hasBrowserEnv: Re,
595
595
  hasStandardBrowserEnv: Rn,
596
596
  hasStandardBrowserWebWorkerEnv: Cn,
597
597
  navigator: ge,
@@ -739,7 +739,7 @@ const Fn = a.toObjectSet([
739
739
  `).forEach(function(i) {
740
740
  s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] && Fn[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
741
741
  }), t;
742
- }, Le = Symbol("internals");
742
+ }, Be = Symbol("internals");
743
743
  function W(e) {
744
744
  return e && String(e).trim().toLowerCase();
745
745
  }
@@ -894,7 +894,7 @@ let N = class {
894
894
  return n.forEach((s) => r.set(s)), r;
895
895
  }
896
896
  static accessor(t) {
897
- const r = (this[Le] = this[Le] = {
897
+ const r = (this[Be] = this[Be] = {
898
898
  accessors: {}
899
899
  }).accessors, s = this.prototype;
900
900
  function o(i) {
@@ -952,13 +952,13 @@ function $n(e, t) {
952
952
  return t = t !== void 0 ? t : 1e3, function(f) {
953
953
  const d = Date.now(), c = r[o];
954
954
  i || (i = d), n[s] = f, r[s] = d;
955
- let h = o, y = 0;
955
+ let h = o, g = 0;
956
956
  for (; h !== s; )
957
- y += n[h++], h = h % e;
957
+ g += n[h++], h = h % e;
958
958
  if (s = (s + 1) % e, s === o && (o = (o + 1) % e), d - i < t)
959
959
  return;
960
960
  const E = c && d - c;
961
- return E ? Math.round(y * 1e3 / E) : void 0;
961
+ return E ? Math.round(g * 1e3 / E) : void 0;
962
962
  };
963
963
  }
964
964
  function In(e, t) {
@@ -992,14 +992,14 @@ const oe = (e, t, n = 3) => {
992
992
  };
993
993
  e(h);
994
994
  }, n);
995
- }, Be = (e, t) => {
995
+ }, De = (e, t) => {
996
996
  const n = e != null;
997
997
  return [(r) => t[0]({
998
998
  lengthComputable: n,
999
999
  total: e,
1000
1000
  loaded: r
1001
1001
  }), t[1]];
1002
- }, De = (e) => (...t) => a.asap(() => e(...t)), qn = O.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, O.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
1002
+ }, je = (e) => (...t) => a.asap(() => e(...t)), qn = O.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, O.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
1003
1003
  new URL(O.origin),
1004
1004
  O.navigator && /(msie|trident)/i.test(O.navigator.userAgent)
1005
1005
  ) : () => !0, vn = O.hasStandardBrowserEnv ? (
@@ -1041,18 +1041,18 @@ function ht(e, t, n) {
1041
1041
  let r = !Hn(t);
1042
1042
  return e && (r || n == !1) ? Mn(e, t) : t;
1043
1043
  }
1044
- const je = (e) => e instanceof N ? { ...e } : e;
1044
+ const $e = (e) => e instanceof N ? { ...e } : e;
1045
1045
  function v(e, t) {
1046
1046
  t = t || {};
1047
1047
  const n = {};
1048
- function r(d, c, h, y) {
1049
- return a.isPlainObject(d) && a.isPlainObject(c) ? a.merge.call({ caseless: y }, d, c) : a.isPlainObject(c) ? a.merge({}, c) : a.isArray(c) ? c.slice() : c;
1048
+ function r(d, c, h, g) {
1049
+ return a.isPlainObject(d) && a.isPlainObject(c) ? a.merge.call({ caseless: g }, d, c) : a.isPlainObject(c) ? a.merge({}, c) : a.isArray(c) ? c.slice() : c;
1050
1050
  }
1051
- function s(d, c, h, y) {
1051
+ function s(d, c, h, g) {
1052
1052
  if (a.isUndefined(c)) {
1053
1053
  if (!a.isUndefined(d))
1054
- return r(void 0, d, h, y);
1055
- } else return r(d, c, h, y);
1054
+ return r(void 0, d, h, g);
1055
+ } else return r(d, c, h, g);
1056
1056
  }
1057
1057
  function o(d, c) {
1058
1058
  if (!a.isUndefined(c))
@@ -1099,11 +1099,11 @@ function v(e, t) {
1099
1099
  socketPath: i,
1100
1100
  responseEncoding: i,
1101
1101
  validateStatus: l,
1102
- headers: (d, c, h) => s(je(d), je(c), h, !0)
1102
+ headers: (d, c, h) => s($e(d), $e(c), h, !0)
1103
1103
  };
1104
1104
  return a.forEach(Object.keys({ ...e, ...t }), function(c) {
1105
- const h = f[c] || s, y = h(e[c], t[c], c);
1106
- a.isUndefined(y) && h !== l || (n[c] = y);
1105
+ const h = f[c] || s, g = h(e[c], t[c], c);
1106
+ a.isUndefined(g) && h !== l || (n[c] = g);
1107
1107
  }), n;
1108
1108
  }
1109
1109
  const mt = (e) => {
@@ -1132,7 +1132,7 @@ const mt = (e) => {
1132
1132
  const s = mt(e);
1133
1133
  let o = s.data;
1134
1134
  const i = N.from(s.headers).normalize();
1135
- let { responseType: l, onUploadProgress: f, onDownloadProgress: d } = s, c, h, y, E, u;
1135
+ let { responseType: l, onUploadProgress: f, onDownloadProgress: d } = s, c, h, g, E, u;
1136
1136
  function m() {
1137
1137
  E && E(), u && u(), s.cancelToken && s.cancelToken.unsubscribe(c), s.signal && s.signal.removeEventListener("abort", c);
1138
1138
  }
@@ -1175,7 +1175,7 @@ const mt = (e) => {
1175
1175
  )), p = null;
1176
1176
  }, o === void 0 && i.setContentType(null), "setRequestHeader" in p && a.forEach(i.toJSON(), function(T, P) {
1177
1177
  p.setRequestHeader(P, T);
1178
- }), a.isUndefined(s.withCredentials) || (p.withCredentials = !!s.withCredentials), l && l !== "json" && (p.responseType = s.responseType), d && ([y, u] = oe(d, !0), p.addEventListener("progress", y)), f && p.upload && ([h, E] = oe(f), p.upload.addEventListener("progress", h), p.upload.addEventListener("loadend", E)), (s.cancelToken || s.signal) && (c = (S) => {
1178
+ }), a.isUndefined(s.withCredentials) || (p.withCredentials = !!s.withCredentials), l && l !== "json" && (p.responseType = s.responseType), d && ([g, u] = oe(d, !0), p.addEventListener("progress", g)), f && p.upload && ([h, E] = oe(f), p.upload.addEventListener("progress", h), p.upload.addEventListener("loadend", E)), (s.cancelToken || s.signal) && (c = (S) => {
1179
1179
  p && (r(!S || S.type ? new J(null, e, p) : S), p.abort(), p = null);
1180
1180
  }, s.cancelToken && s.cancelToken.subscribe(c), s.signal && (s.signal.aborted ? c() : s.signal.addEventListener("abort", c)));
1181
1181
  const R = jn(s.url);
@@ -1236,7 +1236,7 @@ const mt = (e) => {
1236
1236
  } finally {
1237
1237
  await t.cancel();
1238
1238
  }
1239
- }, $e = (e, t, n, r) => {
1239
+ }, Ie = (e, t, n, r) => {
1240
1240
  const s = Kn(e, t);
1241
1241
  let o = 0, i, l = (f) => {
1242
1242
  i || (i = !0, r && r(f));
@@ -1251,8 +1251,8 @@ const mt = (e) => {
1251
1251
  }
1252
1252
  let h = c.byteLength;
1253
1253
  if (n) {
1254
- let y = o += h;
1255
- n(y);
1254
+ let g = o += h;
1255
+ n(g);
1256
1256
  }
1257
1257
  f.enqueue(new Uint8Array(c));
1258
1258
  } catch (d) {
@@ -1265,13 +1265,13 @@ const mt = (e) => {
1265
1265
  }, {
1266
1266
  highWaterMark: 2
1267
1267
  });
1268
- }, Ie = 64 * 1024, { isFunction: te } = a, Gn = (({ Request: e, Response: t }) => ({
1268
+ }, qe = 64 * 1024, { isFunction: te } = a, Gn = (({ Request: e, Response: t }) => ({
1269
1269
  Request: e,
1270
1270
  Response: t
1271
1271
  }))(a.global), {
1272
- ReadableStream: qe,
1273
- TextEncoder: ve
1274
- } = a.global, He = (e, ...t) => {
1272
+ ReadableStream: ve,
1273
+ TextEncoder: He
1274
+ } = a.global, Me = (e, ...t) => {
1275
1275
  try {
1276
1276
  return !!e(...t);
1277
1277
  } catch {
@@ -1284,17 +1284,17 @@ const mt = (e) => {
1284
1284
  const { fetch: t, Request: n, Response: r } = e, s = t ? te(t) : typeof fetch == "function", o = te(n), i = te(r);
1285
1285
  if (!s)
1286
1286
  return !1;
1287
- const l = s && te(qe), f = s && (typeof ve == "function" ? /* @__PURE__ */ ((u) => (m) => u.encode(m))(new ve()) : async (u) => new Uint8Array(await new n(u).arrayBuffer())), d = o && l && He(() => {
1287
+ const l = s && te(ve), f = s && (typeof He == "function" ? /* @__PURE__ */ ((u) => (m) => u.encode(m))(new He()) : async (u) => new Uint8Array(await new n(u).arrayBuffer())), d = o && l && Me(() => {
1288
1288
  let u = !1;
1289
1289
  const m = new n(O.origin, {
1290
- body: new qe(),
1290
+ body: new ve(),
1291
1291
  method: "POST",
1292
1292
  get duplex() {
1293
1293
  return u = !0, "half";
1294
1294
  }
1295
1295
  }).headers.has("Content-Type");
1296
1296
  return u && !m;
1297
- }), c = i && l && He(() => a.isReadableStream(new r("").body)), h = {
1297
+ }), c = i && l && Me(() => a.isReadableStream(new r("").body)), h = {
1298
1298
  stream: c && ((u) => u.body)
1299
1299
  };
1300
1300
  s && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((u) => {
@@ -1305,7 +1305,7 @@ const mt = (e) => {
1305
1305
  throw new b(`Response type '${u}' is not supported`, b.ERR_NOT_SUPPORT, p);
1306
1306
  });
1307
1307
  });
1308
- const y = async (u) => {
1308
+ const g = async (u) => {
1309
1309
  if (u == null)
1310
1310
  return 0;
1311
1311
  if (a.isBlob(u))
@@ -1321,7 +1321,7 @@ const mt = (e) => {
1321
1321
  return (await f(u)).byteLength;
1322
1322
  }, E = async (u, m) => {
1323
1323
  const p = a.toFiniteNumber(u.getContentLength());
1324
- return p ?? y(m);
1324
+ return p ?? g(m);
1325
1325
  };
1326
1326
  return async (u) => {
1327
1327
  let {
@@ -1336,32 +1336,32 @@ const mt = (e) => {
1336
1336
  responseType: k,
1337
1337
  headers: de,
1338
1338
  withCredentials: Z = "same-origin",
1339
- fetchOptions: Ce
1340
- } = mt(u), Oe = t || fetch;
1339
+ fetchOptions: Oe
1340
+ } = mt(u), Te = t || fetch;
1341
1341
  k = k ? (k + "").toLowerCase() : "text";
1342
1342
  let Y = Vn([R, S && S.toAbortSignal()], T), V = null;
1343
1343
  const $ = Y && Y.unsubscribe && (() => {
1344
1344
  Y.unsubscribe();
1345
1345
  });
1346
- let Te;
1346
+ let Ae;
1347
1347
  try {
1348
- if (j && d && p !== "get" && p !== "head" && (Te = await E(de, w)) !== 0) {
1348
+ if (j && d && p !== "get" && p !== "head" && (Ae = await E(de, w)) !== 0) {
1349
1349
  let D = new n(m, {
1350
1350
  method: "POST",
1351
1351
  body: w,
1352
1352
  duplex: "half"
1353
1353
  }), H;
1354
1354
  if (a.isFormData(w) && (H = D.headers.get("content-type")) && de.setContentType(H), D.body) {
1355
- const [fe, ee] = Be(
1356
- Te,
1357
- oe(De(j))
1355
+ const [fe, ee] = De(
1356
+ Ae,
1357
+ oe(je(j))
1358
1358
  );
1359
- w = $e(D.body, Ie, fe, ee);
1359
+ w = Ie(D.body, qe, fe, ee);
1360
1360
  }
1361
1361
  }
1362
1362
  a.isString(Z) || (Z = Z ? "include" : "omit");
1363
- const U = o && "credentials" in n.prototype, Ae = {
1364
- ...Ce,
1363
+ const U = o && "credentials" in n.prototype, Ne = {
1364
+ ...Oe,
1365
1365
  signal: Y,
1366
1366
  method: p.toUpperCase(),
1367
1367
  headers: de.normalize().toJSON(),
@@ -1369,20 +1369,20 @@ const mt = (e) => {
1369
1369
  duplex: "half",
1370
1370
  credentials: U ? Z : void 0
1371
1371
  };
1372
- V = o && new n(m, Ae);
1373
- let B = await (o ? Oe(V, Ce) : Oe(m, Ae));
1374
- const Ne = c && (k === "stream" || k === "response");
1375
- if (c && (P || Ne && $)) {
1372
+ V = o && new n(m, Ne);
1373
+ let B = await (o ? Te(V, Oe) : Te(m, Ne));
1374
+ const ke = c && (k === "stream" || k === "response");
1375
+ if (c && (P || ke && $)) {
1376
1376
  const D = {};
1377
- ["status", "statusText", "headers"].forEach((ke) => {
1378
- D[ke] = B[ke];
1377
+ ["status", "statusText", "headers"].forEach((Pe) => {
1378
+ D[Pe] = B[Pe];
1379
1379
  });
1380
- const H = a.toFiniteNumber(B.headers.get("content-length")), [fe, ee] = P && Be(
1380
+ const H = a.toFiniteNumber(B.headers.get("content-length")), [fe, ee] = P && De(
1381
1381
  H,
1382
- oe(De(P), !0)
1382
+ oe(je(P), !0)
1383
1383
  ) || [];
1384
1384
  B = new r(
1385
- $e(B.body, Ie, fe, () => {
1385
+ Ie(B.body, qe, fe, () => {
1386
1386
  ee && ee(), $ && $();
1387
1387
  }),
1388
1388
  D
@@ -1390,7 +1390,7 @@ const mt = (e) => {
1390
1390
  }
1391
1391
  k = k || "text";
1392
1392
  let St = await h[a.findKey(h, k) || "text"](B, u);
1393
- return !Ne && $ && $(), await new Promise((D, H) => {
1393
+ return !ke && $ && $(), await new Promise((D, H) => {
1394
1394
  pt(D, H, {
1395
1395
  data: St,
1396
1396
  headers: N.from(B.headers),
@@ -1422,14 +1422,14 @@ const mt = (e) => {
1422
1422
  return d;
1423
1423
  };
1424
1424
  bt();
1425
- const Re = {
1425
+ const Ce = {
1426
1426
  http: mn,
1427
1427
  xhr: Jn,
1428
1428
  fetch: {
1429
1429
  get: bt
1430
1430
  }
1431
1431
  };
1432
- a.forEach(Re, (e, t) => {
1432
+ a.forEach(Ce, (e, t) => {
1433
1433
  if (e) {
1434
1434
  try {
1435
1435
  Object.defineProperty(e, "name", { value: t });
@@ -1438,7 +1438,7 @@ a.forEach(Re, (e, t) => {
1438
1438
  Object.defineProperty(e, "adapterName", { value: t });
1439
1439
  }
1440
1440
  });
1441
- const Me = (e) => `- ${e}`, Yn = (e) => a.isFunction(e) || e === null || e === !1;
1441
+ const ze = (e) => `- ${e}`, Yn = (e) => a.isFunction(e) || e === null || e === !1;
1442
1442
  function er(e, t) {
1443
1443
  e = a.isArray(e) ? e : [e];
1444
1444
  const { length: n } = e;
@@ -1447,7 +1447,7 @@ function er(e, t) {
1447
1447
  for (let i = 0; i < n; i++) {
1448
1448
  r = e[i];
1449
1449
  let l;
1450
- if (s = r, !Yn(r) && (s = Re[(l = String(r)).toLowerCase()], s === void 0))
1450
+ if (s = r, !Yn(r) && (s = Ce[(l = String(r)).toLowerCase()], s === void 0))
1451
1451
  throw new b(`Unknown adapter '${l}'`);
1452
1452
  if (s && (a.isFunction(s) || (s = s.get(t))))
1453
1453
  break;
@@ -1458,8 +1458,8 @@ function er(e, t) {
1458
1458
  ([f, d]) => `adapter ${f} ` + (d === !1 ? "is not supported by the environment" : "is not available in the build")
1459
1459
  );
1460
1460
  let l = n ? i.length > 1 ? `since :
1461
- ` + i.map(Me).join(`
1462
- `) : " " + Me(i[0]) : "as no adapter specified";
1461
+ ` + i.map(ze).join(`
1462
+ `) : " " + ze(i[0]) : "as no adapter specified";
1463
1463
  throw new b(
1464
1464
  "There is no suitable adapter to dispatch the request " + l,
1465
1465
  "ERR_NOT_SUPPORT"
@@ -1477,13 +1477,13 @@ const yt = {
1477
1477
  * Exposes all known adapters
1478
1478
  * @type {Object<string, Function|Object>}
1479
1479
  */
1480
- adapters: Re
1480
+ adapters: Ce
1481
1481
  };
1482
1482
  function me(e) {
1483
1483
  if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
1484
1484
  throw new J(null, e);
1485
1485
  }
1486
- function ze(e) {
1486
+ function Je(e) {
1487
1487
  return me(e), e.headers = N.from(e.headers), e.data = he.call(
1488
1488
  e,
1489
1489
  e.transformRequest
@@ -1507,7 +1507,7 @@ const gt = "1.13.2", ue = {};
1507
1507
  return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
1508
1508
  };
1509
1509
  });
1510
- const Je = {};
1510
+ const Ve = {};
1511
1511
  ue.transitional = function(t, n, r) {
1512
1512
  function s(o, i) {
1513
1513
  return "[Axios v" + gt + "] Transitional option '" + o + "'" + i + (r ? ". " + r : "");
@@ -1518,7 +1518,7 @@ ue.transitional = function(t, n, r) {
1518
1518
  s(i, " has been removed" + (n ? " in " + n : "")),
1519
1519
  b.ERR_DEPRECATED
1520
1520
  );
1521
- return n && !Je[i] && (Je[i] = !0, console.warn(
1521
+ return n && !Ve[i] && (Ve[i] = !0, console.warn(
1522
1522
  s(
1523
1523
  i,
1524
1524
  " has been deprecated since v" + n + " and will be removed in the near future"
@@ -1553,8 +1553,8 @@ const se = {
1553
1553
  let q = class {
1554
1554
  constructor(t) {
1555
1555
  this.defaults = t || {}, this.interceptors = {
1556
- request: new _e(),
1557
- response: new _e()
1556
+ request: new Le(),
1557
+ response: new Le()
1558
1558
  };
1559
1559
  }
1560
1560
  /**
@@ -1617,16 +1617,16 @@ let q = class {
1617
1617
  this.interceptors.response.forEach(function(m) {
1618
1618
  d.push(m.fulfilled, m.rejected);
1619
1619
  });
1620
- let c, h = 0, y;
1620
+ let c, h = 0, g;
1621
1621
  if (!f) {
1622
- const u = [ze.bind(this), void 0];
1623
- for (u.unshift(...l), u.push(...d), y = u.length, c = Promise.resolve(n); h < y; )
1622
+ const u = [Je.bind(this), void 0];
1623
+ for (u.unshift(...l), u.push(...d), g = u.length, c = Promise.resolve(n); h < g; )
1624
1624
  c = c.then(u[h++], u[h++]);
1625
1625
  return c;
1626
1626
  }
1627
- y = l.length;
1627
+ g = l.length;
1628
1628
  let E = n;
1629
- for (; h < y; ) {
1629
+ for (; h < g; ) {
1630
1630
  const u = l[h++], m = l[h++];
1631
1631
  try {
1632
1632
  E = u(E);
@@ -1636,11 +1636,11 @@ let q = class {
1636
1636
  }
1637
1637
  }
1638
1638
  try {
1639
- c = ze.call(this, E);
1639
+ c = Je.call(this, E);
1640
1640
  } catch (u) {
1641
1641
  return Promise.reject(u);
1642
1642
  }
1643
- for (h = 0, y = d.length; h < y; )
1643
+ for (h = 0, g = d.length; h < g; )
1644
1644
  c = c.then(d[h++], d[h++]);
1645
1645
  return c;
1646
1646
  }
@@ -1894,8 +1894,8 @@ const {
1894
1894
  throw console.error("Error communicating with chat API:", o), o;
1895
1895
  }
1896
1896
  }, or = ({ handleMessageFromForm: e, theme: t, chatBotData: n }) => {
1897
- const [r, s] = L(""), [o, i] = L(""), [l, f] = L(""), [d, c] = L(!1), h = async (y) => {
1898
- if (y.preventDefault(), c(!0), f(""), !r.trim() || !o.trim()) {
1897
+ const [r, s] = L(""), [o, i] = L(""), [l, f] = L(""), [d, c] = L(!1), h = async (g) => {
1898
+ if (g.preventDefault(), c(!0), f(""), !r.trim() || !o.trim()) {
1899
1899
  f("Name and email are required");
1900
1900
  return;
1901
1901
  }
@@ -1913,14 +1913,14 @@ const {
1913
1913
  }
1914
1914
  s(""), i("");
1915
1915
  };
1916
- return /* @__PURE__ */ g(
1916
+ return /* @__PURE__ */ y(
1917
1917
  "div",
1918
1918
  {
1919
1919
  className: "p-5 flex-shrink-0",
1920
1920
  style: { background: t.backgroundColor },
1921
1921
  children: /* @__PURE__ */ C("form", { onSubmit: h, className: "flex flex-col gap-6", children: [
1922
- l && /* @__PURE__ */ g("div", { className: "bg-red-100 text-neutral-800 p-2 rounded relative text-center text-sm", role: "alert", children: l }),
1923
- /* @__PURE__ */ g(
1922
+ l && /* @__PURE__ */ y("div", { className: "bg-red-100 text-neutral-800 p-2 rounded relative text-center text-sm", role: "alert", children: l }),
1923
+ /* @__PURE__ */ y(
1924
1924
  "p",
1925
1925
  {
1926
1926
  className: " text-sm font-medium",
@@ -1930,7 +1930,7 @@ const {
1930
1930
  ),
1931
1931
  /* @__PURE__ */ C("div", { className: "flex flex-col gap-5", children: [
1932
1932
  /* @__PURE__ */ C("div", { className: "flex flex-col gap-1", children: [
1933
- /* @__PURE__ */ g(
1933
+ /* @__PURE__ */ y(
1934
1934
  "label",
1935
1935
  {
1936
1936
  className: "text-sm",
@@ -1938,14 +1938,14 @@ const {
1938
1938
  children: "Full Name"
1939
1939
  }
1940
1940
  ),
1941
- /* @__PURE__ */ g(
1941
+ /* @__PURE__ */ y(
1942
1942
  "input",
1943
1943
  {
1944
1944
  type: "text",
1945
1945
  placeholder: "Enter your full name",
1946
1946
  value: r,
1947
- onChange: (y) => {
1948
- s(y.target.value), f("");
1947
+ onChange: (g) => {
1948
+ s(g.target.value), f("");
1949
1949
  },
1950
1950
  className: "w-full px-3 py-2 border border-neutral-300 rounded-xl",
1951
1951
  style: { background: `${t.backgroundColor}`, color: `${t.fontColor}` },
@@ -1954,7 +1954,7 @@ const {
1954
1954
  )
1955
1955
  ] }),
1956
1956
  /* @__PURE__ */ C("div", { className: "flex flex-col gap-1", children: [
1957
- /* @__PURE__ */ g(
1957
+ /* @__PURE__ */ y(
1958
1958
  "label",
1959
1959
  {
1960
1960
  className: "text-sm",
@@ -1962,14 +1962,14 @@ const {
1962
1962
  children: "Email Address"
1963
1963
  }
1964
1964
  ),
1965
- /* @__PURE__ */ g(
1965
+ /* @__PURE__ */ y(
1966
1966
  "input",
1967
1967
  {
1968
1968
  type: "email",
1969
1969
  placeholder: "Enter your email",
1970
1970
  value: o,
1971
- onChange: (y) => {
1972
- i(y.target.value), f("");
1971
+ onChange: (g) => {
1972
+ i(g.target.value), f("");
1973
1973
  },
1974
1974
  className: "w-full px-3 py-2 border border-neutral-300 rounded-xl",
1975
1975
  style: { background: `${t.backgroundColor}`, color: `${t.fontColor}` },
@@ -1978,7 +1978,7 @@ const {
1978
1978
  )
1979
1979
  ] })
1980
1980
  ] }),
1981
- /* @__PURE__ */ g(
1981
+ /* @__PURE__ */ y(
1982
1982
  "button",
1983
1983
  {
1984
1984
  type: "submit",
@@ -1988,8 +1988,8 @@ const {
1988
1988
  background: `linear-gradient(135deg, ${t.primaryColor}, ${t.secondaryColor})`,
1989
1989
  color: t.fontColor
1990
1990
  },
1991
- children: d ? "Submitting..." : /* @__PURE__ */ C(Ve, { children: [
1992
- /* @__PURE__ */ g(Ge, { size: 18 }),
1991
+ children: d ? "Submitting..." : /* @__PURE__ */ C(Ee, { children: [
1992
+ /* @__PURE__ */ y(Ge, { size: 18 }),
1993
1993
  " Submit"
1994
1994
  ] })
1995
1995
  }
@@ -2004,7 +2004,7 @@ const {
2004
2004
  }, h = {
2005
2005
  background: `linear-gradient(135deg, ${t.primaryColor}, ${t.secondaryColor})`,
2006
2006
  color: t.fontColor
2007
- }, y = {
2007
+ }, g = {
2008
2008
  background: t.backgroundColor,
2009
2009
  color: t.fontColor
2010
2010
  }, E = (m) => {
@@ -2037,27 +2037,27 @@ const {
2037
2037
  children: [
2038
2038
  /* @__PURE__ */ C("div", { className: "flex items-center gap-3", children: [
2039
2039
  /* @__PURE__ */ C("div", { className: "relative", children: [
2040
- /* @__PURE__ */ g("div", { className: "w-11 h-11 rounded-full flex items-center justify-center", children: /* @__PURE__ */ g(Xe, { size: 22 }) }),
2041
- /* @__PURE__ */ g("span", { className: "absolute bottom-0 right-0 w-3.5 h-3.5 bg-emerald-400 rounded-full border-1 border-white" })
2040
+ /* @__PURE__ */ y("div", { className: "w-11 h-11 rounded-full flex items-center justify-center", children: /* @__PURE__ */ y(Xe, { size: 22 }) }),
2041
+ /* @__PURE__ */ y("span", { className: "absolute bottom-0 right-0 w-3.5 h-3.5 bg-emerald-400 rounded-full border-1 border-white" })
2042
2042
  ] }),
2043
2043
  /* @__PURE__ */ C("div", { children: [
2044
- /* @__PURE__ */ g("h3", { className: "font-semibold text-lg", children: n.name }),
2045
- /* @__PURE__ */ g("p", { className: "text-xs opacity-90", children: n.subTitle })
2044
+ /* @__PURE__ */ y("h3", { className: "font-semibold text-lg", children: n.name }),
2045
+ /* @__PURE__ */ y("p", { className: "text-xs opacity-90", children: n.subTitle })
2046
2046
  ] })
2047
2047
  ] }),
2048
- /* @__PURE__ */ g(
2048
+ /* @__PURE__ */ y(
2049
2049
  "button",
2050
2050
  {
2051
2051
  onClick: e,
2052
2052
  "aria-label": "Close chat",
2053
2053
  className: "p-2 hover:bg-white/20 rounded-full",
2054
- children: /* @__PURE__ */ g(Ke, { size: 20 })
2054
+ children: /* @__PURE__ */ y(Ke, { size: 20 })
2055
2055
  }
2056
2056
  )
2057
2057
  ]
2058
2058
  }
2059
2059
  ),
2060
- !l && /* @__PURE__ */ g(
2060
+ !l && /* @__PURE__ */ y(
2061
2061
  or,
2062
2062
  {
2063
2063
  handleMessageFromForm: E,
@@ -2065,15 +2065,15 @@ const {
2065
2065
  chatBotData: n
2066
2066
  }
2067
2067
  ),
2068
- l && /* @__PURE__ */ C(Ve, { children: [
2069
- /* @__PURE__ */ g(Nt, { messages: r, isLoading: o, theme: t }),
2070
- /* @__PURE__ */ g(At, { onSendMessage: u, isLoading: o, theme: t })
2068
+ l && /* @__PURE__ */ C(Ee, { children: [
2069
+ /* @__PURE__ */ y(Nt, { messages: r, isLoading: o, theme: t }),
2070
+ /* @__PURE__ */ y(At, { onSendMessage: u, isLoading: o, theme: t })
2071
2071
  ] }),
2072
- /* @__PURE__ */ g(
2072
+ /* @__PURE__ */ y(
2073
2073
  "div",
2074
2074
  {
2075
2075
  className: "border-t border-neutral-200 px-5 py-3 text-center",
2076
- style: y,
2076
+ style: g,
2077
2077
  children: /* @__PURE__ */ C(
2078
2078
  "p",
2079
2079
  {
@@ -2081,7 +2081,7 @@ const {
2081
2081
  style: { color: `${t.fontColor}` },
2082
2082
  children: [
2083
2083
  "powered by ",
2084
- /* @__PURE__ */ g(
2084
+ /* @__PURE__ */ y(
2085
2085
  "span",
2086
2086
  {
2087
2087
  className: "font-semibold ",
@@ -2110,30 +2110,56 @@ const {
2110
2110
  subTitle: d,
2111
2111
  welcomeText: c
2112
2112
  }) => {
2113
- const [h, y] = L(!1), [E, u] = L("");
2113
+ const [h, g] = L(!1), [E, u] = L("");
2114
2114
  We(() => {
2115
2115
  u(Ot());
2116
2116
  }, []);
2117
- const m = () => y((R) => !R), p = { primaryColor: n, secondaryColor: r, backgroundColor: s, fontColor: o, placeholderColor: i }, w = { name: f, subTitle: d, welcomeText: c, url: t, pineconeNamespace: e, position: l, sessionId: E };
2118
- return /* @__PURE__ */ C("div", { className: "fixed inset-0 pointer-events-auto z-[9999]", children: [
2119
- h && /* @__PURE__ */ g(
2120
- ir,
2117
+ const m = () => g((R) => !R), p = {
2118
+ primaryColor: n,
2119
+ secondaryColor: r,
2120
+ backgroundColor: s,
2121
+ fontColor: o,
2122
+ placeholderColor: i
2123
+ }, w = {
2124
+ name: f,
2125
+ subTitle: d,
2126
+ welcomeText: c,
2127
+ url: t,
2128
+ pineconeNamespace: e,
2129
+ position: l,
2130
+ sessionId: E
2131
+ };
2132
+ return /* @__PURE__ */ C(Ee, { children: [
2133
+ h && /* @__PURE__ */ y(
2134
+ "div",
2121
2135
  {
2122
- onClose: m,
2123
- sessionId: E,
2124
- pineconeNamespace: e,
2125
- url: t,
2126
- theme: p,
2127
- chatBotData: w
2136
+ className: `fixed bottom-24 ${l === "left" ? "left-8" : "right-8"} z-[9999] pointer-events-auto`,
2137
+ children: /* @__PURE__ */ y(
2138
+ ir,
2139
+ {
2140
+ onClose: m,
2141
+ sessionId: E,
2142
+ pineconeNamespace: e,
2143
+ url: t,
2144
+ theme: p,
2145
+ chatBotData: w
2146
+ }
2147
+ )
2128
2148
  }
2129
2149
  ),
2130
- /* @__PURE__ */ g(
2131
- Tt,
2150
+ /* @__PURE__ */ y(
2151
+ "div",
2132
2152
  {
2133
- onClick: m,
2134
- isOpen: h,
2135
- theme: p,
2136
- chatBotData: w
2153
+ className: `fixed bottom-8 ${l === "left" ? "left-8" : "right-8"} z-[10000] pointer-events-auto`,
2154
+ children: /* @__PURE__ */ y(
2155
+ Tt,
2156
+ {
2157
+ onClick: m,
2158
+ isOpen: h,
2159
+ theme: p,
2160
+ chatBotData: w
2161
+ }
2162
+ )
2137
2163
  }
2138
2164
  )
2139
2165
  ] });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-aichatbot-widget",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "A React ChatBot Widget",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",