react-aichatbot-widget 1.5.1 → 1.5.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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- *** Copyright (c) 2025 Prashanta Pandit ***
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ MIT License
2
+
3
+ *** Copyright (c) 2025 Prashanta Pandit ***
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
package/README.md CHANGED
@@ -1,71 +1,71 @@
1
- # React AI Chatbot Widget
2
-
3
- A React chatbot widget using **React**, **Axios**, and **Lucide Icons**.
4
-
5
- ---
6
-
7
- ## Installation
8
-
9
- ### Step 1: Install the Widget
10
-
11
- ```bash
12
- npm install react-aichatbot-widget
13
- ```
14
-
15
- > `axios` is included with the widget and does not need to be installed separately.
16
-
17
- ### Step 2: Install Peer Dependencies
18
-
19
- ```bash
20
- npm install react react-dom tailwindcss lucide-react
21
- ```
22
-
23
- > Ensure versions match your project.
24
-
25
- | Package | Version | | |
26
- | -------------- | -------- | - | ------- |
27
- | `react` | ^18.0.0 | | ^19.0.0 |
28
- | `react-dom` | ^18.0.0 | | ^19.0.0 |
29
- | `tailwindcss` | ^4.1.17 | | |
30
- | `lucide-react` | ^0.554.0 | | |
31
- | `axios` | ^1.6.0 | | |
32
-
33
- ---
34
-
35
- ## Usage Example
36
-
37
- ```jsx
38
- import React from "react";
39
- import ChatBotWidget from "react-aichatbot-widget";
40
-
41
- function App() {
42
- return (
43
- <div className="App">
44
- {/*add a namespace for chatbot and chatbot url*/}
45
- <ChatBotWidget
46
- pineconeNamespace=''
47
- url=''
48
- chatMessageUrl=''
49
- primaryColor="" // hex color code
50
- secondaryColor="" // hex color code
51
- fontColor="" // hex color code
52
- backgroundColor="" // hex color code
53
- position="" // left or right
54
- name="" // any name
55
- subTitle="" // any subtitle
56
- welcomeText="" // any welcome text
57
- />
58
- </div>
59
- );
60
- }
61
-
62
- export default App;
63
- ```
64
-
65
- ---
66
-
67
- ## Notes
68
-
69
- * `axios` is bundled; no extra installation required.
70
- * TailwindCSS is required if you want to customize styles.
71
- * React and ReactDOM must match the versions listed above.
1
+ # React AI Chatbot Widget
2
+
3
+ A React chatbot widget using **React**, **Axios**, and **Lucide Icons**.
4
+
5
+ ---
6
+
7
+ ## Installation
8
+
9
+ ### Step 1: Install the Widget
10
+
11
+ ```bash
12
+ npm install react-aichatbot-widget
13
+ ```
14
+
15
+ > `axios` is included with the widget and does not need to be installed separately.
16
+
17
+ ### Step 2: Install Peer Dependencies
18
+
19
+ ```bash
20
+ npm install react react-dom tailwindcss lucide-react
21
+ ```
22
+
23
+ > Ensure versions match your project.
24
+
25
+ | Package | Version | | |
26
+ | -------------- | -------- | - | ------- |
27
+ | `react` | ^18.0.0 | | ^19.0.0 |
28
+ | `react-dom` | ^18.0.0 | | ^19.0.0 |
29
+ | `tailwindcss` | ^4.1.17 | | |
30
+ | `lucide-react` | ^0.554.0 | | |
31
+ | `axios` | ^1.6.0 | | |
32
+
33
+ ---
34
+
35
+ ## Usage Example
36
+
37
+ ```jsx
38
+ import React from "react";
39
+ import ChatBotWidget from "react-aichatbot-widget";
40
+
41
+ function App() {
42
+ return (
43
+ <div className="App">
44
+ {/*add a namespace for chatbot and chatbot url*/}
45
+ <ChatBotWidget
46
+ pineconeNamespace=''
47
+ url=''
48
+ chatMessageUrl=''
49
+ primaryColor="" // hex color code
50
+ secondaryColor="" // hex color code
51
+ fontColor="" // hex color code
52
+ backgroundColor="" // hex color code
53
+ position="" // left or right
54
+ name="" // any name
55
+ subTitle="" // any subtitle
56
+ welcomeText="" // any welcome text
57
+ />
58
+ </div>
59
+ );
60
+ }
61
+
62
+ export default App;
63
+ ```
64
+
65
+ ---
66
+
67
+ ## Notes
68
+
69
+ * `axios` is bundled; no extra installation required.
70
+ * TailwindCSS is required if you want to customize styles.
71
+ * React and ReactDOM must match the versions listed above.
package/dist/index.cjs CHANGED
@@ -1,18 +1,11 @@
1
- "use strict";const h=require("react/jsx-runtime"),N=require("react"),D=require("lucide-react"),bt=({onMinimise:e,isOpen:t,theme:n,chatBotData:r})=>{const s=r.position==="left",l={position:"fixed",bottom:"32px",left:s?"32px":"auto",right:s?"auto":"32px",background:`linear-gradient(135deg, ${n.primaryColor}, ${n.secondaryColor})`,color:n.fontColor,width:"64px",height:"64px",borderRadius:"50%",border:"none",boxShadow:"0 20px 25px -5px rgba(0,0,0,0.15), 0 10px 10px -5px rgba(0,0,0,0.1)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",pointerEvents:"auto",transition:"all 300ms ease",outline:"none"},p={transform:"scale(1.10)",boxShadow:"0 25px 35px -5px rgba(0,0,0,0.2)"},d={position:"absolute",top:"-4px",right:"-4px",width:"16px",height:"16px",backgroundColor:"#34d399",borderRadius:"50%",border:"4px solid white",animation:"pulse 2s infinite"};return h.jsxs("button",{onClick:e,style:l,onMouseEnter:c=>Object.assign(c.currentTarget.style,p),onMouseLeave:c=>Object.keys(p).forEach(u=>c.currentTarget.style[u]=l[u]||""),onFocus:c=>Object.assign(c.currentTarget.style,p),onBlur:c=>Object.keys(p).forEach(u=>c.currentTarget.style[u]=l[u]||""),children:[t?h.jsx(D.Minus,{size:20,strokeWidth:2.5}):h.jsx(D.MessageCircle,{size:20,strokeWidth:2.5}),!t&&h.jsx("span",{style:d}),h.jsx("style",{jsx:!0,children:`
2
- @keyframes pulse {
3
- 0% {
4
- box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
1
+ "use strict";const p=require("react/jsx-runtime"),N=require("react"),L=require("lucide-react"),gt=({onMinimise:e,isOpen:t,theme:n,chatBotData:r})=>{const s=r.position==="left",l={position:"fixed",bottom:"32px",left:s?"32px":"auto",right:s?"auto":"32px",background:`linear-gradient(135deg, ${n.primaryColor}, ${n.secondaryColor})`,color:n.fontColor,width:"64px",height:"64px",borderRadius:"50%",border:"none",boxShadow:"0 20px 25px -5px rgba(0,0,0,0.15), 0 10px 10px -5px rgba(0,0,0,0.1)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",pointerEvents:"auto",transition:"all 300ms ease",outline:"none"},h={position:"absolute",top:"-4px",right:"-4px",width:"16px",height:"16px",backgroundColor:"#34d399",borderRadius:"50%",border:"4px solid white",animation:"pulse 2s infinite"};return p.jsxs("button",{onClick:e,style:l,children:[t?p.jsx(L.Minus,{size:20,strokeWidth:2.5}):p.jsx(L.MessageCircle,{size:20,strokeWidth:2.5}),!t&&p.jsx("span",{style:h})]})},xt=({onSendMessage:e,isLoading:t,theme:n})=>{const[r,s]=N.useState(""),i=()=>{!r.trim()||t||(e(r.trim()),s(""))},o=d=>{d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),i())},l={padding:"16px",borderTop:"1px solid rgba(255, 255, 255, 0.2)",borderColor:n.fontColor,background:n.backgroundColor,flexShrink:0},h={display:"flex",gap:"12px",alignItems:"center"},u={flex:1,padding:"12px 16px",background:n.inputBackgroundColor||n.backgroundColor,color:n.fontColor,border:`1px solid ${n.fontColor}`,borderRadius:"12px",fontSize:"14px",outline:"none",transition:"all 0.2s ease",opacity:t?.5:1,cursor:t?"not-allowed":"text",boxShadow:"none"},c={padding:"12px 20px",borderRadius:"12px",background:`linear-gradient(135deg, ${n.primaryColor}, ${n.secondaryColor})`,color:n.fontColor,border:"none",cursor:t||!r.trim()?"not-allowed":"pointer",opacity:t||!r.trim()?.5:1,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",fontWeight:"600",fontSize:"14px",transition:"all 0.2s ease",minWidth:"48px"};return p.jsx("div",{style:l,children:p.jsxs("div",{style:h,children:[p.jsx("input",{type:"text",placeholder:"Type a message...",value:r,onChange:d=>s(d.target.value),onKeyDown:o,disabled:t,style:u,onFocus:d=>{d.target.style.boxShadow="0 0 0 3px rgba(100, 150, 255, 0.3)",d.target.style.borderColor="#60a5fa"},onBlur:d=>{d.target.style.boxShadow="none",d.target.style.borderColor=n.fontColor}}),p.jsx("button",{onClick:i,disabled:t||!r.trim(),style:c,"aria-label":"Send message",onMouseEnter:d=>{!t&&r.trim()&&(d.currentTarget.style.transform="translateY(-2px)",d.currentTarget.style.boxShadow="0 8px 16px rgba(0,0,0,0.15)")},onMouseLeave:d=>{d.currentTarget.style.transform="translateY(0)",d.currentTarget.style.boxShadow="none"},children:p.jsx(L.Send,{size:18})})]})})},bt=({messages:e,isLoading:t,theme:n})=>{console.log("messages",e);const r=N.useRef(null),s=()=>{r.current?.scrollIntoView({behavior:"smooth"})};function i(d){return new Date(d).toLocaleString("en-AU",{day:"numeric",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"})}N.useEffect(()=>{s()},[e,t]);const o={flex:1,overflowY:"auto",padding:"20px",background:n.backgroundColor,color:n.fontColor,borderTop:"1px solid rgba(255, 255, 255, 0.2)",display:"flex",flexDirection:"column",gap:"16px"},l=d=>({display:"flex",justifyContent:d==="user"?"flex-end":"flex-start",width:"100%"}),h={display:"flex",flexDirection:"column",maxWidth:"80%"},u=d=>({padding:"12px 16px",borderRadius:"16px",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)",border:"1px solid #e4e4e7",fontSize:"14px",lineHeight:"1.5",background:d==="user"?n.primaryColor:n.backgroundColor,color:n.fontColor,wordWrap:"break-word"}),c={...u("bot"),animation:"fadeIn 0.3s ease-in-out, pulse 1.5s ease-in-out infinite",animationDelay:"0s, 0.3s"};return p.jsxs("div",{style:o,children:[e.map((d,x)=>p.jsx("div",{style:l(d.sender_type),children:p.jsxs("div",{style:h,children:[d.sender_type==="bot"&&d.created_at&&p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"flex-start",marginLeft:"4px",marginBottom:"2px"},children:[p.jsx(L.Bot,{size:14,color:n.fontColor}),p.jsx("span",{style:{fontSize:"10px",opacity:.55,color:n.fontColor},children:i(d.created_at)})]}),d.sender_type==="user"&&p.jsx("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"flex-end",marginRight:"4px",marginBottom:"2px"},children:p.jsx("span",{style:{fontSize:"10px",opacity:.55,color:n.fontColor},children:"You"})}),p.jsx("div",{style:u(d.sender_type),children:d.message})]})},x)),t&&p.jsx("div",{style:l("bot"),children:p.jsxs("div",{style:{...c,display:"flex",alignItems:"center",gap:"8px"},children:[p.jsx(L.Bot,{size:24}),p.jsx("span",{children:"Typing..."})]})}),p.jsx("div",{ref:r})]})};function Je(e,t){return function(){return e.apply(t,arguments)}}const{toString:wt}=Object.prototype,{getPrototypeOf:Ce}=Object,{iterator:ue,toStringTag:Ve}=Symbol,de=(e=>t=>{const n=wt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),B=e=>(e=e.toLowerCase(),t=>de(t)===e),fe=e=>t=>typeof t===e,{isArray:X}=Array,K=fe("undefined");function Z(e){return e!==null&&!K(e)&&e.constructor!==null&&!K(e.constructor)&&P(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ke=B("ArrayBuffer");function St(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ke(e.buffer),t}const Et=fe("string"),P=fe("function"),Xe=fe("number"),ee=e=>e!==null&&typeof e=="object",Ct=e=>e===!0||e===!1,ie=e=>{if(de(e)!=="object")return!1;const t=Ce(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Ve in e)&&!(ue in e)},Rt=e=>{if(!ee(e)||Z(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Tt=B("Date"),Ot=B("File"),At=B("Blob"),jt=B("FileList"),kt=e=>ee(e)&&P(e.pipe),Ft=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||P(e.append)&&((t=de(e))==="formdata"||t==="object"&&P(e.toString)&&e.toString()==="[object FormData]"))},Nt=B("URLSearchParams"),[Pt,_t,Ut,Lt]=["ReadableStream","Request","Response","Headers"].map(B),Bt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function te(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),X(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Z(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let l;for(r=0;r<o;r++)l=i[r],t.call(null,e[l],l,e)}}function Ge(e,t){if(Z(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const q=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ye=e=>!K(e)&&e!==q;function be(){const{caseless:e,skipUndefined:t}=Ye(this)&&this||{},n={},r=(s,i)=>{const o=e&&Ge(n,i)||i;ie(n[o])&&ie(s)?n[o]=be(n[o],s):ie(s)?n[o]=be({},s):X(s)?n[o]=s.slice():(!t||!K(s))&&(n[o]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&te(arguments[s],r);return n}const It=(e,t,n,{allOwnKeys:r}={})=>(te(t,(s,i)=>{n&&P(s)?e[i]=Je(s,n):e[i]=s},{allOwnKeys:r}),e),Dt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),vt=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},zt=(e,t,n,r)=>{let s,i,o;const l={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!r||r(o,e,t))&&!l[o]&&(t[o]=e[o],l[o]=!0);e=n!==!1&&Ce(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Ht=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},qt=e=>{if(!e)return null;if(X(e))return e;let t=e.length;if(!Xe(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Mt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ce(Uint8Array)),$t=(e,t)=>{const r=(e&&e[ue]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},Wt=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Jt=B("HTMLFormElement"),Vt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Fe=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Kt=B("RegExp"),Qe=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};te(n,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(r[i]=o||s)}),Object.defineProperties(e,r)},Xt=e=>{Qe(e,(t,n)=>{if(P(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(P(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Gt=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return X(e)?r(e):r(String(e).split(t)),n},Yt=()=>{},Qt=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Zt(e){return!!(e&&P(e.append)&&e[Ve]==="FormData"&&e[ue])}const en=e=>{const t=new Array(10),n=(r,s)=>{if(ee(r)){if(t.indexOf(r)>=0)return;if(Z(r))return r;if(!("toJSON"in r)){t[s]=r;const i=X(r)?[]:{};return te(r,(o,l)=>{const h=n(o,s+1);!K(h)&&(i[l]=h)}),t[s]=void 0,i}}return r};return n(e,0)},tn=B("AsyncFunction"),nn=e=>e&&(ee(e)||P(e))&&P(e.then)&&P(e.catch),Ze=((e,t)=>e?setImmediate:t?((n,r)=>(q.addEventListener("message",({source:s,data:i})=>{s===q&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),q.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",P(q.postMessage)),rn=typeof queueMicrotask<"u"?queueMicrotask.bind(q):typeof process<"u"&&process.nextTick||Ze,sn=e=>e!=null&&P(e[ue]),a={isArray:X,isArrayBuffer:Ke,isBuffer:Z,isFormData:Ft,isArrayBufferView:St,isString:Et,isNumber:Xe,isBoolean:Ct,isObject:ee,isPlainObject:ie,isEmptyObject:Rt,isReadableStream:Pt,isRequest:_t,isResponse:Ut,isHeaders:Lt,isUndefined:K,isDate:Tt,isFile:Ot,isBlob:At,isRegExp:Kt,isFunction:P,isStream:kt,isURLSearchParams:Nt,isTypedArray:Mt,isFileList:jt,forEach:te,merge:be,extend:It,trim:Bt,stripBOM:Dt,inherits:vt,toFlatObject:zt,kindOf:de,kindOfTest:B,endsWith:Ht,toArray:qt,forEachEntry:$t,matchAll:Wt,isHTMLForm:Jt,hasOwnProperty:Fe,hasOwnProp:Fe,reduceDescriptors:Qe,freezeMethods:Xt,toObjectSet:Gt,toCamelCase:Vt,noop:Yt,toFiniteNumber:Qt,findKey:Ge,global:q,isContextDefined:Ye,isSpecCompliantForm:Zt,toJSONObject:en,isAsyncFn:tn,isThenable:nn,setImmediate:Ze,asap:rn,isIterable:sn};function g(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(g,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}});const et=g.prototype,tt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{tt[e]={value:e}});Object.defineProperties(g,tt);Object.defineProperty(et,"isAxiosError",{value:!0});g.from=(e,t,n,r,s,i)=>{const o=Object.create(et);a.toFlatObject(e,o,function(c){return c!==Error.prototype},u=>u!=="isAxiosError");const l=e&&e.message?e.message:"Error",h=t==null&&e?e.code:t;return g.call(o,l,h,n,r,s),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",i&&Object.assign(o,i),o};const on=null;function we(e){return a.isPlainObject(e)||a.isArray(e)}function nt(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Ne(e,t,n){return e?e.concat(t).map(function(s,i){return s=nt(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function an(e){return a.isArray(e)&&!e.some(we)}const ln=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function pe(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,m){return!a.isUndefined(m[y])});const r=n.metaTokens,s=n.visitor||c,i=n.dots,o=n.indexes,h=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function u(f){if(f===null)return"";if(a.isDate(f))return f.toISOString();if(a.isBoolean(f))return f.toString();if(!h&&a.isBlob(f))throw new g("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?h&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function c(f,y,m){let S=f;if(f&&!m&&typeof f=="object"){if(a.endsWith(y,"{}"))y=r?y:y.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&an(f)||(a.isFileList(f)||a.endsWith(y,"[]"))&&(S=a.toArray(f)))return y=nt(y),S.forEach(function(w,A){!(a.isUndefined(w)||w===null)&&t.append(o===!0?Ne([y],A,i):o===null?y:y+"[]",u(w))}),!1}return we(f)?!0:(t.append(Ne(m,y,i),u(f)),!1)}const d=[],x=Object.assign(ln,{defaultVisitor:c,convertValue:u,isVisitable:we});function C(f,y){if(!a.isUndefined(f)){if(d.indexOf(f)!==-1)throw Error("Circular reference detected in "+y.join("."));d.push(f),a.forEach(f,function(S,O){(!(a.isUndefined(S)||S===null)&&s.call(t,S,a.isString(O)?O.trim():O,y,x))===!0&&C(S,y?y.concat(O):[O])}),d.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return C(e),t}function Pe(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Re(e,t){this._pairs=[],e&&pe(e,this,t)}const rt=Re.prototype;rt.append=function(t,n){this._pairs.push([t,n])};rt.toString=function(t){const n=t?function(r){return t.call(this,r,Pe)}:Pe;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function cn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function st(e,t,n){if(!t)return e;const r=n&&n.encode||cn;a.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(t,n):i=a.isURLSearchParams(t)?t.toString():new Re(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class _e{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const ot={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},un=typeof URLSearchParams<"u"?URLSearchParams:Re,dn=typeof FormData<"u"?FormData:null,fn=typeof Blob<"u"?Blob:null,pn={isBrowser:!0,classes:{URLSearchParams:un,FormData:dn,Blob:fn},protocols:["http","https","file","blob","url","data"]},Te=typeof window<"u"&&typeof document<"u",Se=typeof navigator=="object"&&navigator||void 0,hn=Te&&(!Se||["ReactNative","NativeScript","NS"].indexOf(Se.product)<0),mn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",yn=Te&&window.location.href||"http://localhost",gn=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Te,hasStandardBrowserEnv:hn,hasStandardBrowserWebWorkerEnv:mn,navigator:Se,origin:yn},Symbol.toStringTag,{value:"Module"})),k={...gn,...pn};function xn(e,t){return pe(e,new k.classes.URLSearchParams,{visitor:function(n,r,s,i){return k.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function bn(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function wn(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function it(e){function t(n,r,s,i){let o=n[i++];if(o==="__proto__")return!0;const l=Number.isFinite(+o),h=i>=n.length;return o=!o&&a.isArray(s)?s.length:o,h?(a.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!l):((!s[o]||!a.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],i)&&a.isArray(s[o])&&(s[o]=wn(s[o])),!l)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(bn(r),s,n,0)}),n}return null}function Sn(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const ne={transitional:ot,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=a.isObject(t);if(i&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(it(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return xn(t,this.formSerializer).toString();if((l=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return pe(l?{"files[]":t}:t,h&&new h,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),Sn(t)):t}],transformResponse:[function(t){const n=this.transitional||ne.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(l){if(o)throw l.name==="SyntaxError"?g.from(l,g.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:k.classes.FormData,Blob:k.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{ne.headers[e]={}});const En=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Cn=e=>{const t={};let n,r,s;return e&&e.split(`
2
+ `).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&En[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Ue=Symbol("internals");function Q(e){return e&&String(e).trim().toLowerCase()}function ae(e){return e===!1||e==null?e:a.isArray(e)?e.map(ae):String(e)}function Rn(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Tn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ye(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function On(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function An(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,i,o){return this[r].call(this,t,s,i,o)},configurable:!0})})}let _=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(l,h,u){const c=Q(h);if(!c)throw new Error("header name must be a non-empty string");const d=a.findKey(s,c);(!d||s[d]===void 0||u===!0||u===void 0&&s[d]!==!1)&&(s[d||h]=ae(l))}const o=(l,h)=>a.forEach(l,(u,c)=>i(u,c,h));if(a.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(a.isString(t)&&(t=t.trim())&&!Tn(t))o(Cn(t),n);else if(a.isObject(t)&&a.isIterable(t)){let l={},h,u;for(const c of t){if(!a.isArray(c))throw TypeError("Object iterator must return a key-value pair");l[u=c[0]]=(h=l[u])?a.isArray(h)?[...h,c[1]]:[h,c[1]]:c[1]}o(l,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=Q(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Rn(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Q(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ye(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(o){if(o=Q(o),o){const l=a.findKey(r,o);l&&(!n||ye(r,r[l],l,n))&&(delete r[l],s=!0)}}return a.isArray(t)?t.forEach(i):i(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!t||ye(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,i)=>{const o=a.findKey(r,i);if(o){n[o]=ae(s),delete n[i];return}const l=t?On(i):String(i).trim();l!==i&&delete n[i],n[l]=ae(s),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
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[Ue]=this[Ue]={accessors:{}}).accessors,s=this.prototype;function i(o){const l=Q(o);r[l]||(An(s,o),r[l]=!0)}return a.isArray(t)?t.forEach(i):i(t),this}};_.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(_.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});a.freezeMethods(_);function ge(e,t){const n=this||ne,r=t||n,s=_.from(r.headers);let i=r.data;return a.forEach(e,function(l){i=l.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function at(e){return!!(e&&e.__CANCEL__)}function G(e,t,n){g.call(this,e??"canceled",g.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(G,g,{__CANCEL__:!0});function lt(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new g("Request failed with status code "+n.status,[g.ERR_BAD_REQUEST,g.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function jn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function kn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,o;return t=t!==void 0?t:1e3,function(h){const u=Date.now(),c=r[i];o||(o=u),n[s]=h,r[s]=u;let d=i,x=0;for(;d!==s;)x+=n[d++],d=d%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),u-o<t)return;const C=c&&u-c;return C?Math.round(x*1e3/C):void 0}}function Fn(e,t){let n=0,r=1e3/t,s,i;const o=(u,c=Date.now())=>{n=c,s=null,i&&(clearTimeout(i),i=null),e(...u)};return[(...u)=>{const c=Date.now(),d=c-n;d>=r?o(u,c):(s=u,i||(i=setTimeout(()=>{i=null,o(s)},r-d)))},()=>s&&o(s)]}const ce=(e,t,n=3)=>{let r=0;const s=kn(50,250);return Fn(i=>{const o=i.loaded,l=i.lengthComputable?i.total:void 0,h=o-r,u=s(h),c=o<=l;r=o;const d={loaded:o,total:l,progress:l?o/l:void 0,bytes:h,rate:u||void 0,estimated:u&&l&&c?(l-o)/u:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(d)},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)),Nn=k.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,k.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(k.origin),k.navigator&&/(msie|trident)/i.test(k.navigator.userAgent)):()=>!0,Pn=k.hasStandardBrowserEnv?{write(e,t,n,r,s,i,o){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}`),i===!0&&l.push("secure"),a.isString(o)&&l.push(`SameSite=${o}`),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 _n(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Un(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ct(e,t,n){let r=!_n(t);return e&&(r||n==!1)?Un(e,t):t}const Ie=e=>e instanceof _?{...e}:e;function $(e,t){t=t||{};const n={};function r(u,c,d,x){return a.isPlainObject(u)&&a.isPlainObject(c)?a.merge.call({caseless:x},u,c):a.isPlainObject(c)?a.merge({},c):a.isArray(c)?c.slice():c}function s(u,c,d,x){if(a.isUndefined(c)){if(!a.isUndefined(u))return r(void 0,u,d,x)}else return r(u,c,d,x)}function i(u,c){if(!a.isUndefined(c))return r(void 0,c)}function o(u,c){if(a.isUndefined(c)){if(!a.isUndefined(u))return r(void 0,u)}else return r(void 0,c)}function l(u,c,d){if(d in t)return r(u,c);if(d in e)return r(void 0,u)}const h={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l,headers:(u,c,d)=>s(Ie(u),Ie(c),d,!0)};return a.forEach(Object.keys({...e,...t}),function(c){const d=h[c]||s,x=d(e[c],t[c],c);a.isUndefined(x)&&d!==l||(n[c]=x)}),n}const ut=e=>{const t=$({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:l}=t;if(t.headers=o=_.from(o),t.url=st(ct(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&o.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),a.isFormData(n)){if(k.hasStandardBrowserEnv||k.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(a.isFunction(n.getHeaders)){const h=n.getHeaders(),u=["content-type","content-length"];Object.entries(h).forEach(([c,d])=>{u.includes(c.toLowerCase())&&o.set(c,d)})}}if(k.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&Nn(t.url))){const h=s&&i&&Pn.read(i);h&&o.set(s,h)}return t},Ln=typeof XMLHttpRequest<"u",Bn=Ln&&function(e){return new Promise(function(n,r){const s=ut(e);let i=s.data;const o=_.from(s.headers).normalize();let{responseType:l,onUploadProgress:h,onDownloadProgress:u}=s,c,d,x,C,f;function y(){C&&C(),f&&f(),s.cancelToken&&s.cancelToken.unsubscribe(c),s.signal&&s.signal.removeEventListener("abort",c)}let m=new XMLHttpRequest;m.open(s.method.toUpperCase(),s.url,!0),m.timeout=s.timeout;function S(){if(!m)return;const w=_.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),j={data:!l||l==="text"||l==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:w,config:e,request:m};lt(function(R){n(R),y()},function(R){r(R),y()},j),m=null}"onloadend"in m?m.onloadend=S:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(S)},m.onabort=function(){m&&(r(new g("Request aborted",g.ECONNABORTED,e,m)),m=null)},m.onerror=function(A){const j=A&&A.message?A.message:"Network Error",E=new g(j,g.ERR_NETWORK,e,m);E.event=A||null,r(E),m=null},m.ontimeout=function(){let A=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const j=s.transitional||ot;s.timeoutErrorMessage&&(A=s.timeoutErrorMessage),r(new g(A,j.clarifyTimeoutError?g.ETIMEDOUT:g.ECONNABORTED,e,m)),m=null},i===void 0&&o.setContentType(null),"setRequestHeader"in m&&a.forEach(o.toJSON(),function(A,j){m.setRequestHeader(j,A)}),a.isUndefined(s.withCredentials)||(m.withCredentials=!!s.withCredentials),l&&l!=="json"&&(m.responseType=s.responseType),u&&([x,f]=ce(u,!0),m.addEventListener("progress",x)),h&&m.upload&&([d,C]=ce(h),m.upload.addEventListener("progress",d),m.upload.addEventListener("loadend",C)),(s.cancelToken||s.signal)&&(c=w=>{m&&(r(!w||w.type?new G(null,e,m):w),m.abort(),m=null)},s.cancelToken&&s.cancelToken.subscribe(c),s.signal&&(s.signal.aborted?c():s.signal.addEventListener("abort",c)));const O=jn(s.url);if(O&&k.protocols.indexOf(O)===-1){r(new g("Unsupported protocol "+O+":",g.ERR_BAD_REQUEST,e));return}m.send(i||null)})},In=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const i=function(u){if(!s){s=!0,l();const c=u instanceof Error?u:this.reason;r.abort(c instanceof g?c:new G(c instanceof Error?c.message:c))}};let o=t&&setTimeout(()=>{o=null,i(new g(`timeout ${t} of ms exceeded`,g.ETIMEDOUT))},t);const l=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),e=null)};e.forEach(u=>u.addEventListener("abort",i));const{signal:h}=r;return h.unsubscribe=()=>a.asap(l),h}},Dn=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 zn(e))yield*Dn(n,t)},zn=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()}},De=(e,t,n,r)=>{const s=vn(e,t);let i=0,o,l=h=>{o||(o=!0,r&&r(h))};return new ReadableStream({async pull(h){try{const{done:u,value:c}=await s.next();if(u){l(),h.close();return}let d=c.byteLength;if(n){let x=i+=d;n(x)}h.enqueue(new Uint8Array(c))}catch(u){throw l(u),u}},cancel(h){return l(h),s.return()}},{highWaterMark:2})},ve=64*1024,{isFunction:oe}=a,Hn=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:ze,TextEncoder:He}=a.global,qe=(e,...t)=>{try{return!!e(...t)}catch{return!1}},qn=e=>{e=a.merge.call({skipUndefined:!0},Hn,e);const{fetch:t,Request:n,Response:r}=e,s=t?oe(t):typeof fetch=="function",i=oe(n),o=oe(r);if(!s)return!1;const l=s&&oe(ze),h=s&&(typeof He=="function"?(f=>y=>f.encode(y))(new He):async f=>new Uint8Array(await new n(f).arrayBuffer())),u=i&&l&&qe(()=>{let f=!1;const y=new n(k.origin,{body:new ze,method:"POST",get duplex(){return f=!0,"half"}}).headers.has("Content-Type");return f&&!y}),c=o&&l&&qe(()=>a.isReadableStream(new r("").body)),d={stream:c&&(f=>f.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!d[f]&&(d[f]=(y,m)=>{let S=y&&y[f];if(S)return S.call(y);throw new g(`Response type '${f}' is not supported`,g.ERR_NOT_SUPPORT,m)})});const x=async f=>{if(f==null)return 0;if(a.isBlob(f))return f.size;if(a.isSpecCompliantForm(f))return(await new n(k.origin,{method:"POST",body:f}).arrayBuffer()).byteLength;if(a.isArrayBufferView(f)||a.isArrayBuffer(f))return f.byteLength;if(a.isURLSearchParams(f)&&(f=f+""),a.isString(f))return(await h(f)).byteLength},C=async(f,y)=>{const m=a.toFiniteNumber(f.getContentLength());return m??x(y)};return async f=>{let{url:y,method:m,data:S,signal:O,cancelToken:w,timeout:A,onDownloadProgress:j,onUploadProgress:E,responseType:R,headers:Y,withCredentials:W="same-origin",fetchOptions:re}=ut(f),z=t||fetch;R=R?(R+"").toLowerCase():"text";let J=In([O,w&&w.toAbortSignal()],A),H=null;const b=J&&J.unsubscribe&&(()=>{J.unsubscribe()});let U;try{if(E&&u&&m!=="get"&&m!=="head"&&(U=await C(Y,S))!==0){let v=new n(y,{method:"POST",body:S,duplex:"half"}),V;if(a.isFormData(S)&&(V=v.headers.get("content-type"))&&Y.setContentType(V),v.body){const[me,se]=Le(U,ce(Be(E)));S=De(v.body,ve,me,se)}}a.isString(W)||(W=W?"include":"omit");const F=i&&"credentials"in n.prototype,Ae={...re,signal:J,method:m.toUpperCase(),headers:Y.normalize().toJSON(),body:S,duplex:"half",credentials:F?W:void 0};H=i&&new n(y,Ae);let D=await(i?z(H,re):z(y,Ae));const je=c&&(R==="stream"||R==="response");if(c&&(j||je&&b)){const v={};["status","statusText","headers"].forEach(ke=>{v[ke]=D[ke]});const V=a.toFiniteNumber(D.headers.get("content-length")),[me,se]=j&&Le(V,ce(Be(j),!0))||[];D=new r(De(D.body,ve,me,()=>{se&&se(),b&&b()}),v)}R=R||"text";let yt=await d[a.findKey(d,R)||"text"](D,f);return!je&&b&&b(),await new Promise((v,V)=>{lt(v,V,{data:yt,headers:_.from(D.headers),status:D.status,statusText:D.statusText,config:f,request:H})})}catch(F){throw b&&b(),F&&F.name==="TypeError"&&/Load failed|fetch/i.test(F.message)?Object.assign(new g("Network Error",g.ERR_NETWORK,f,H),{cause:F.cause||F}):g.from(F,F&&F.code,f,H)}}},Mn=new Map,dt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,i=[r,s,n];let o=i.length,l=o,h,u,c=Mn;for(;l--;)h=i[l],u=c.get(h),u===void 0&&c.set(h,u=l?new Map:qn(t)),c=u;return u};dt();const Oe={http:on,xhr:Bn,fetch:{get:dt}};a.forEach(Oe,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Me=e=>`- ${e}`,$n=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 i={};for(let o=0;o<n;o++){r=e[o];let l;if(s=r,!$n(r)&&(s=Oe[(l=String(r)).toLowerCase()],s===void 0))throw new g(`Unknown adapter '${l}'`);if(s&&(a.isFunction(s)||(s=s.get(t))))break;i[l||"#"+o]=s}if(!s){const o=Object.entries(i).map(([h,u])=>`adapter ${h} `+(u===!1?"is not supported by the environment":"is not available in the build"));let l=n?o.length>1?`since :
4
+ `+o.map(Me).join(`
5
+ `):" "+Me(o[0]):"as no adapter specified";throw new g("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return s}const ft={getAdapter:Wn,adapters:Oe};function xe(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new G(null,e)}function $e(e){return xe(e),e.headers=_.from(e.headers),e.data=ge.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ft.getAdapter(e.adapter||ne.adapter,e)(e).then(function(r){return xe(e),r.data=ge.call(e,e.transformResponse,r),r.headers=_.from(r.headers),r},function(r){return at(r)||(xe(e),r&&r.response&&(r.response.data=ge.call(e,e.transformResponse,r.response),r.response.headers=_.from(r.response.headers))),Promise.reject(r)})}const pt="1.13.2",he={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{he[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const We={};he.transitional=function(t,n,r){function s(i,o){return"[Axios v"+pt+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,l)=>{if(t===!1)throw new g(s(o," has been removed"+(n?" in "+n:"")),g.ERR_DEPRECATED);return n&&!We[o]&&(We[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,l):!0}};he.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Jn(e,t,n){if(typeof e!="object")throw new g("options must be an object",g.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],o=t[i];if(o){const l=e[i],h=l===void 0||o(l,i,e);if(h!==!0)throw new g("option "+i+" must be "+h,g.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new g("Unknown option "+i,g.ERR_BAD_OPTION)}}const le={assertOptions:Jn,validators:he},I=le.validators;let M=class{constructor(t){this.defaults=t||{},this.interceptors={request:new _e,response:new _e}}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 i=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
+ `+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=$(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&le.assertOptions(r,{silentJSONParsing:I.transitional(I.boolean),forcedJSONParsing:I.transitional(I.boolean),clarifyTimeoutError:I.transitional(I.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:le.assertOptions(s,{encode:I.function,serialize:I.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),le.assertOptions(n,{baseUrl:I.spelling("baseURL"),withXsrfToken:I.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&a.merge(i.common,i[n.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],f=>{delete i[f]}),n.headers=_.concat(o,i);const l=[];let h=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(h=h&&y.synchronous,l.unshift(y.fulfilled,y.rejected))});const u=[];this.interceptors.response.forEach(function(y){u.push(y.fulfilled,y.rejected)});let c,d=0,x;if(!h){const f=[$e.bind(this),void 0];for(f.unshift(...l),f.push(...u),x=f.length,c=Promise.resolve(n);d<x;)c=c.then(f[d++],f[d++]);return c}x=l.length;let C=n;for(;d<x;){const f=l[d++],y=l[d++];try{C=f(C)}catch(m){y.call(this,m);break}}try{c=$e.call(this,C)}catch(f){return Promise.reject(f)}for(d=0,x=u.length;d<x;)c=c.then(u[d++],u[d++]);return c}getUri(t){t=$(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){M.prototype[t]=function(n,r){return this.request($(r||{},{method:t,url:n,data:(r||{}).data}))}});a.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,l){return this.request($(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}M.prototype[t]=n(),M.prototype[t+"Form"]=n(!0)});let Vn=class ht{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(l=>{r.subscribe(l),i=l}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,l){r.reason||(r.reason=new G(i,o,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 Kn(e){return function(n){return e.apply(null,n)}}function Xn(e){return a.isObject(e)&&e.isAxiosError===!0}const Ee={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(Ee).forEach(([e,t])=>{Ee[t]=e});function mt(e){const t=new M(e),n=Je(M.prototype.request,t);return a.extend(n,M.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return mt($(e,s))},n}const T=mt(ne);T.Axios=M;T.CanceledError=G;T.CancelToken=Vn;T.isCancel=at;T.VERSION=pt;T.toFormData=pe;T.AxiosError=g;T.Cancel=T.CanceledError;T.all=function(t){return Promise.all(t)};T.spread=Kn;T.isAxiosError=Xn;T.mergeConfig=$;T.AxiosHeaders=_;T.formToJSON=e=>it(a.isHTMLForm(e)?new FormData(e):e);T.getAdapter=ft.getAdapter;T.HttpStatusCode=Ee;T.default=T;const{Axios:sr,AxiosError:or,CanceledError:ir,isCancel:ar,CancelToken:lr,VERSION:cr,all:ur,Cancel:dr,isAxiosError:fr,spread:pr,toFormData:hr,AxiosHeaders:mr,HttpStatusCode:yr,formToJSON:gr,getAdapter:xr,mergeConfig:br}=T,Gn=async(e,t,n,r,s)=>{const i={chatInput:e,metadata:{pinecone_namespace:t,name:r,email:s}};try{return(await T.post(n,i,{headers:{"Content-Type":"application/json"}})).data}catch(o){throw console.error("Error communicating with chat API:",o),o}},Yn=async(e,t,n,r)=>{const s={chatInput:e,metadata:{pinecone_namespace:t},sessionId:r};try{return(await T.post(n,s,{headers:{"Content-Type":"application/json"}})).data}catch(i){throw console.error("Error communicating with chat API:",i),i}},Qn=async(e,t)=>{const n={sessionId:e};try{const r=await T.post(t,n,{headers:{"Content-Type":"application/json"}});return r.data.n8n.message_found?r.data.n8n.chats:null}catch(r){throw console.error("Error fetching with chat API:",r),r}},Zn=({theme:e,chatBotData:t,trackFormSubmission:n})=>{const[r,s]=N.useState(""),[i,o]=N.useState(""),[l,h]=N.useState(""),[u,c]=N.useState(""),[d,x]=N.useState(!1),C=async E=>{if(E.preventDefault(),x(!0),c(""),!r.trim()||!i.trim()){c("Name and email are required"),x(!1);return}try{const R=await Gn(l,t.pineconeNamespace,t.initiateChatUrl,r,i);localStorage.setItem("clone67ChatSessionId",R.n8n.session_id),n(!0)}catch(R){console.log("error sending user details",R),c("Failed to submit. Please try again.")}finally{x(!1)}s(""),o(""),h("")},f={padding:"20px",flexShrink:0,background:e.backgroundColor,fontFamily:"system-ui, -apple-system, sans-serif"},y={display:"flex",flexDirection:"column",gap:"24px"},m={fontSize:"14px",fontWeight:"500",color:e.fontColor,margin:0,lineHeight:"1.4"},S={display:"flex",flexDirection:"column",gap:"20px"},O={fontSize:"14px",color:e.fontColor,fontWeight:"500"},w={width:"100%",padding:"12px 16px",background:e.backgroundColor,color:e.fontColor,border:"1px solid #a1a1aa",borderRadius:"12px",fontSize:"15px",outline:"none",boxSizing:"border-box"},A={padding:"12px 20px",borderRadius:"12px",fontWeight:"600",fontSize:"15px",border:"none",cursor:r.trim()&&i.trim()&&!d?"pointer":"not-allowed",opacity:r.trim()&&i.trim()&&!d?1:.5,background:`linear-gradient(135deg, ${e.primaryColor}, ${e.secondaryColor})`,color:e.fontColor,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.2s ease"},j={backgroundColor:"#fee2e2",color:"#713f12",padding:"8px 12px",borderRadius:"8px",fontSize:"13px",textAlign:"center",fontWeight:"500"};return p.jsx("div",{style:f,children:p.jsxs("form",{onSubmit:C,style:y,children:[u&&p.jsx("div",{style:j,role:"alert",children:u}),p.jsx("p",{style:m,children:t.welcomeText}),p.jsxs("div",{style:S,children:[p.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[p.jsx("label",{style:O,children:"Full Name"}),p.jsx("input",{type:"text",placeholder:"Enter your full name",value:r,onChange:E=>{s(E.target.value),c("")},style:w,required:!0})]}),p.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[p.jsx("label",{style:O,children:"Email Address"}),p.jsx("input",{type:"email",placeholder:"Enter your email",value:i,onChange:E=>{o(E.target.value),c("")},style:w,required:!0})]}),p.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[p.jsx("label",{style:O,children:"Message"}),p.jsx("textarea",{placeholder:"Enter your message",value:l,onChange:E=>{h(E.target.value),c("")},style:{...w,minHeight:"60px",maxHeight:"80px",resize:"vertical"},required:!0})]})]}),p.jsx("button",{type:"submit",disabled:!r.trim()||!i.trim()||d,style:A,onMouseEnter:E=>{r.trim()&&i.trim()&&!d&&(E.currentTarget.style.transform="translateY(-2px)",E.currentTarget.style.boxShadow="0 10px 20px rgba(0,0,0,0.15)")},onMouseLeave:E=>{E.currentTarget.style.transform="translateY(0)",E.currentTarget.style.boxShadow="none"},children:d?"Submitting...":p.jsxs(p.Fragment,{children:[p.jsx(L.Send,{size:18}),"Submit"]})})]})})},er=({onClose:e,theme:t,chatBotData:n})=>{const[r,s]=N.useState([]),[i,o]=N.useState(!1),[l,h]=N.useState(!1),[u,c]=N.useState(!1),d=n.position==="left",x=localStorage.getItem("clone67ChatSessionId"),C=b=>{c(b)},f=async()=>{if(x){o(!0);try{const b=await Qn(x,n.fetchChatHistoryUrl);Array.isArray(b)?s(b):s(b?[b]:[]),console.log("chat history in layout",b)}catch(b){console.log("Error fetching chat history",b)}finally{o(!1)}}};N.useEffect(()=>{f()},[u,x]);const y=async b=>{o(!0),s(U=>[...U,{sender_type:"user",message:b}]);try{const U=await Yn(b,n.pineconeNamespace,n.onGoingChatUrl,x);s(F=>[...F,{sender_type:"bot",message:U.n8n.response,created_at:U.n8n.created_at,suggested_prompts:U.n8n.suggested_prompt}])}catch(U){console.error("Chat error:",U),s(F=>[...F,{sender_type:"bot",message:"Sorry, something went wrong."}])}finally{o(!1)}},m={position:"fixed",bottom:"112px",[d?"left":"right"]:"32px",zIndex:50,width:l?"684px":"384px",height:l?"620px":"520px",background:`${t.backgroundColor}cc`,backdropFilter:"blur(16px)",WebkitBackdropFilter:"blur(16px)",borderRadius:"16px",border:"1px solid rgba(255, 255, 255, 0.3)",display:"flex",flexDirection:"column",overflow:"hidden",fontFamily:"system-ui, -apple-system, sans-serif"},S={padding:"16px 20px",background:`linear-gradient(135deg, ${t.primaryColor}, ${t.secondaryColor})`,color:t.fontColor,borderRadius:"16px 16px 0 0",display:"flex",alignItems:"center",justifyContent:"space-between",boxShadow:"0 4px 6px -1px rgba(0,0,0,0.1)"},O={position:"relative"},w={width:"44px",height:"44px",borderRadius:"50%",background:"rgba(255,255,255,0.2)",display:"flex",alignItems:"center",justifyContent:"center"},A={position:"absolute",bottom:0,right:0,width:"14px",height:"14px",backgroundColor:"#34d399",borderRadius:"50%",border:"3px solid white"},j={fontSize:"18px",fontWeight:"600",margin:0,lineHeight:"1.2"},E={fontSize:"12px",opacity:.9,margin:0,lineHeight:"1.3"},R={padding:"8px",borderRadius:"50%",background:"transparent",border:"none",cursor:"pointer",transition:"background 0.2s"},Y={padding:"12px 20px",borderTop:"1px solid rgba(255,255,255,0.2)",background:t.backgroundColor,textAlign:"center"},W={fontSize:"11px",color:t.fontColor,letterSpacing:"0.5px"},re={fontWeight:"600"},z=(b,U)=>{b.currentTarget.style.background=U?"rgba(255,255,255,0.2)":"transparent"},J={flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",color:t.fontColor,opacity:.9,fontSize:"14px"},H={animation:"spin 1s linear infinite"};return p.jsxs("div",{style:m,children:[p.jsx("style",{children:`
7
+ @keyframes spin {
8
+ from { transform: rotate(0deg); }
9
+ to { transform: rotate(360deg); }
5
10
  }
6
- 70% {
7
- box-shadow: 0 0 0 10px rgba(52, 211, 153, 0);
8
- }
9
- 100% {
10
- box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
11
- }
12
- }
13
- `})]})},xt=({onSendMessage:e,isLoading:t,theme:n})=>{const[r,s]=N.useState(""),i=()=>{!r.trim()||t||(e(r.trim()),s(""))},o=u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),i())},l={padding:"16px",borderTop:"1px solid rgba(255, 255, 255, 0.2)",borderColor:n.fontColor,background:n.backgroundColor,flexShrink:0},p={display:"flex",gap:"12px",alignItems:"center"},d={flex:1,padding:"12px 16px",background:n.inputBackgroundColor||n.backgroundColor,color:n.fontColor,border:`1px solid ${n.fontColor}`,borderRadius:"12px",fontSize:"14px",outline:"none",transition:"all 0.2s ease",opacity:t?.5:1,cursor:t?"not-allowed":"text",boxShadow:"none"},c={padding:"12px 20px",borderRadius:"12px",background:`linear-gradient(135deg, ${n.primaryColor}, ${n.secondaryColor})`,color:n.fontColor,border:"none",cursor:t||!r.trim()?"not-allowed":"pointer",opacity:t||!r.trim()?.5:1,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",fontWeight:"600",fontSize:"14px",transition:"all 0.2s ease",minWidth:"48px"};return h.jsx("div",{style:l,children:h.jsxs("div",{style:p,children:[h.jsx("input",{type:"text",placeholder:"Type a message...",value:r,onChange:u=>s(u.target.value),onKeyDown:o,disabled:t,style:d,onFocus:u=>{u.target.style.boxShadow="0 0 0 3px rgba(100, 150, 255, 0.3)",u.target.style.borderColor="#60a5fa"},onBlur:u=>{u.target.style.boxShadow="none",u.target.style.borderColor=n.fontColor}}),h.jsx("button",{onClick:i,disabled:t||!r.trim(),style:c,"aria-label":"Send message",onMouseEnter:u=>{!t&&r.trim()&&(u.currentTarget.style.transform="translateY(-2px)",u.currentTarget.style.boxShadow="0 8px 16px rgba(0,0,0,0.15)")},onMouseLeave:u=>{u.currentTarget.style.transform="translateY(0)",u.currentTarget.style.boxShadow="none"},children:h.jsx(D.Send,{size:18})})]})})},gt=({messages:e,isLoading:t,theme:n})=>{const r=N.useRef(null),s=()=>{r.current?.scrollIntoView({behavior:"smooth"})};function i(u){return new Date(u).toLocaleString("en-AU",{day:"numeric",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"})}N.useEffect(()=>{s()},[e,t]);const o={flex:1,overflowY:"auto",padding:"20px",background:n.backgroundColor,color:n.fontColor,borderTop:"1px solid rgba(255, 255, 255, 0.2)",display:"flex",flexDirection:"column",gap:"16px"},l=u=>({display:"flex",justifyContent:u==="user"?"flex-end":"flex-start",width:"100%"}),p={display:"flex",flexDirection:"column",maxWidth:"80%"},d=u=>({padding:"12px 16px",borderRadius:"16px",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)",border:"1px solid #e4e4e7",fontSize:"14px",lineHeight:"1.5",background:u==="user"?n.primaryColor:n.backgroundColor,color:n.fontColor,wordWrap:"break-word"}),c={...d("bot"),animation:"fadeIn 0.3s ease-in-out, pulse 1.5s ease-in-out infinite",animationDelay:"0s, 0.3s"};return h.jsxs("div",{style:o,children:[e.map((u,x)=>h.jsx("div",{style:l(u.type),children:h.jsxs("div",{style:p,children:[u.type==="bot"&&h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"flex-start",marginLeft:"4px",marginBottom:"2px"},children:[h.jsx(D.Bot,{size:14,color:n.fontColor}),h.jsx("span",{style:{fontSize:"10px",opacity:.55,color:n.fontColor},children:i(u.response_timestamp)})]}),u.type==="user"&&h.jsx("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"flex-end",marginRight:"4px",marginBottom:"2px"},children:h.jsx("span",{style:{fontSize:"10px",opacity:.55,color:n.fontColor},children:"You"})}),h.jsx("div",{style:d(u.type),children:u.text})]})},x)),t&&h.jsx("div",{style:l("bot"),children:h.jsxs("div",{style:{typingBubbleStyle:c,display:"flex",alignItems:"center",gap:"8px"},children:[h.jsx(D.Bot,{size:24}),h.jsx("span",{children:"Typing..."})]})}),h.jsx("div",{ref:r})]})};function Je(e,t){return function(){return e.apply(t,arguments)}}const{toString:wt}=Object.prototype,{getPrototypeOf:Re}=Object,{iterator:ue,toStringTag:Ve}=Symbol,de=(e=>t=>{const n=wt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),L=e=>(e=e.toLowerCase(),t=>de(t)===e),fe=e=>t=>typeof t===e,{isArray:G}=Array,X=fe("undefined");function Z(e){return e!==null&&!X(e)&&e.constructor!==null&&!X(e.constructor)&&P(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ke=L("ArrayBuffer");function St(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ke(e.buffer),t}const Et=fe("string"),P=fe("function"),Xe=fe("number"),ee=e=>e!==null&&typeof e=="object",Rt=e=>e===!0||e===!1,ie=e=>{if(de(e)!=="object")return!1;const t=Re(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Ve in e)&&!(ue in e)},Ct=e=>{if(!ee(e)||Z(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Tt=L("Date"),Ot=L("File"),At=L("Blob"),jt=L("FileList"),kt=e=>ee(e)&&P(e.pipe),Ft=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||P(e.append)&&((t=de(e))==="formdata"||t==="object"&&P(e.toString)&&e.toString()==="[object FormData]"))},Nt=L("URLSearchParams"),[Pt,_t,Ut,Lt]=["ReadableStream","Request","Response","Headers"].map(L),Bt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function te(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),G(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Z(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let l;for(r=0;r<o;r++)l=i[r],t.call(null,e[l],l,e)}}function Ge(e,t){if(Z(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const q=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ye=e=>!X(e)&&e!==q;function ge(){const{caseless:e,skipUndefined:t}=Ye(this)&&this||{},n={},r=(s,i)=>{const o=e&&Ge(n,i)||i;ie(n[o])&&ie(s)?n[o]=ge(n[o],s):ie(s)?n[o]=ge({},s):G(s)?n[o]=s.slice():(!t||!X(s))&&(n[o]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&te(arguments[s],r);return n}const It=(e,t,n,{allOwnKeys:r}={})=>(te(t,(s,i)=>{n&&P(s)?e[i]=Je(s,n):e[i]=s},{allOwnKeys:r}),e),Dt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),vt=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Mt=(e,t,n,r)=>{let s,i,o;const l={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!r||r(o,e,t))&&!l[o]&&(t[o]=e[o],l[o]=!0);e=n!==!1&&Re(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},zt=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},qt=e=>{if(!e)return null;if(G(e))return e;let t=e.length;if(!Xe(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Ht=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Re(Uint8Array)),$t=(e,t)=>{const r=(e&&e[ue]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},Wt=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Jt=L("HTMLFormElement"),Vt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Fe=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Kt=L("RegExp"),Qe=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};te(n,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(r[i]=o||s)}),Object.defineProperties(e,r)},Xt=e=>{Qe(e,(t,n)=>{if(P(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(P(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Gt=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return G(e)?r(e):r(String(e).split(t)),n},Yt=()=>{},Qt=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Zt(e){return!!(e&&P(e.append)&&e[Ve]==="FormData"&&e[ue])}const en=e=>{const t=new Array(10),n=(r,s)=>{if(ee(r)){if(t.indexOf(r)>=0)return;if(Z(r))return r;if(!("toJSON"in r)){t[s]=r;const i=G(r)?[]:{};return te(r,(o,l)=>{const p=n(o,s+1);!X(p)&&(i[l]=p)}),t[s]=void 0,i}}return r};return n(e,0)},tn=L("AsyncFunction"),nn=e=>e&&(ee(e)||P(e))&&P(e.then)&&P(e.catch),Ze=((e,t)=>e?setImmediate:t?((n,r)=>(q.addEventListener("message",({source:s,data:i})=>{s===q&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),q.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",P(q.postMessage)),rn=typeof queueMicrotask<"u"?queueMicrotask.bind(q):typeof process<"u"&&process.nextTick||Ze,sn=e=>e!=null&&P(e[ue]),a={isArray:G,isArrayBuffer:Ke,isBuffer:Z,isFormData:Ft,isArrayBufferView:St,isString:Et,isNumber:Xe,isBoolean:Rt,isObject:ee,isPlainObject:ie,isEmptyObject:Ct,isReadableStream:Pt,isRequest:_t,isResponse:Ut,isHeaders:Lt,isUndefined:X,isDate:Tt,isFile:Ot,isBlob:At,isRegExp:Kt,isFunction:P,isStream:kt,isURLSearchParams:Nt,isTypedArray:Ht,isFileList:jt,forEach:te,merge:ge,extend:It,trim:Bt,stripBOM:Dt,inherits:vt,toFlatObject:Mt,kindOf:de,kindOfTest:L,endsWith:zt,toArray:qt,forEachEntry:$t,matchAll:Wt,isHTMLForm:Jt,hasOwnProperty:Fe,hasOwnProp:Fe,reduceDescriptors:Qe,freezeMethods:Xt,toObjectSet:Gt,toCamelCase:Vt,noop:Yt,toFiniteNumber:Qt,findKey:Ge,global:q,isContextDefined:Ye,isSpecCompliantForm:Zt,toJSONObject:en,isAsyncFn:tn,isThenable:nn,setImmediate:Ze,asap:rn,isIterable:sn};function b(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(b,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}});const et=b.prototype,tt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{tt[e]={value:e}});Object.defineProperties(b,tt);Object.defineProperty(et,"isAxiosError",{value:!0});b.from=(e,t,n,r,s,i)=>{const o=Object.create(et);a.toFlatObject(e,o,function(c){return c!==Error.prototype},d=>d!=="isAxiosError");const l=e&&e.message?e.message:"Error",p=t==null&&e?e.code:t;return b.call(o,l,p,n,r,s),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",i&&Object.assign(o,i),o};const on=null;function we(e){return a.isPlainObject(e)||a.isArray(e)}function nt(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Ne(e,t,n){return e?e.concat(t).map(function(s,i){return s=nt(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function an(e){return a.isArray(e)&&!e.some(we)}const ln=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function pe(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,m){return!a.isUndefined(m[y])});const r=n.metaTokens,s=n.visitor||c,i=n.dots,o=n.indexes,p=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function d(f){if(f===null)return"";if(a.isDate(f))return f.toISOString();if(a.isBoolean(f))return f.toString();if(!p&&a.isBlob(f))throw new b("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?p&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function c(f,y,m){let S=f;if(f&&!m&&typeof f=="object"){if(a.endsWith(y,"{}"))y=r?y:y.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&an(f)||(a.isFileList(f)||a.endsWith(y,"[]"))&&(S=a.toArray(f)))return y=nt(y),S.forEach(function(w,C){!(a.isUndefined(w)||w===null)&&t.append(o===!0?Ne([y],C,i):o===null?y:y+"[]",d(w))}),!1}return we(f)?!0:(t.append(Ne(m,y,i),d(f)),!1)}const u=[],x=Object.assign(ln,{defaultVisitor:c,convertValue:d,isVisitable:we});function E(f,y){if(!a.isUndefined(f)){if(u.indexOf(f)!==-1)throw Error("Circular reference detected in "+y.join("."));u.push(f),a.forEach(f,function(S,O){(!(a.isUndefined(S)||S===null)&&s.call(t,S,a.isString(O)?O.trim():O,y,x))===!0&&E(S,y?y.concat(O):[O])}),u.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return E(e),t}function Pe(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Ce(e,t){this._pairs=[],e&&pe(e,this,t)}const rt=Ce.prototype;rt.append=function(t,n){this._pairs.push([t,n])};rt.toString=function(t){const n=t?function(r){return t.call(this,r,Pe)}:Pe;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function cn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function st(e,t,n){if(!t)return e;const r=n&&n.encode||cn;a.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(t,n):i=a.isURLSearchParams(t)?t.toString():new Ce(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class _e{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const ot={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},un=typeof URLSearchParams<"u"?URLSearchParams:Ce,dn=typeof FormData<"u"?FormData:null,fn=typeof Blob<"u"?Blob:null,pn={isBrowser:!0,classes:{URLSearchParams:un,FormData:dn,Blob:fn},protocols:["http","https","file","blob","url","data"]},Te=typeof window<"u"&&typeof document<"u",Se=typeof navigator=="object"&&navigator||void 0,hn=Te&&(!Se||["ReactNative","NativeScript","NS"].indexOf(Se.product)<0),mn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",yn=Te&&window.location.href||"http://localhost",bn=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Te,hasStandardBrowserEnv:hn,hasStandardBrowserWebWorkerEnv:mn,navigator:Se,origin:yn},Symbol.toStringTag,{value:"Module"})),F={...bn,...pn};function xn(e,t){return pe(e,new F.classes.URLSearchParams,{visitor:function(n,r,s,i){return F.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function gn(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function wn(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function it(e){function t(n,r,s,i){let o=n[i++];if(o==="__proto__")return!0;const l=Number.isFinite(+o),p=i>=n.length;return o=!o&&a.isArray(s)?s.length:o,p?(a.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!l):((!s[o]||!a.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],i)&&a.isArray(s[o])&&(s[o]=wn(s[o])),!l)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(gn(r),s,n,0)}),n}return null}function Sn(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const ne={transitional:ot,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=a.isObject(t);if(i&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(it(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return xn(t,this.formSerializer).toString();if((l=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const p=this.env&&this.env.FormData;return pe(l?{"files[]":t}:t,p&&new p,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),Sn(t)):t}],transformResponse:[function(t){const n=this.transitional||ne.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(l){if(o)throw l.name==="SyntaxError"?b.from(l,b.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:F.classes.FormData,Blob:F.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{ne.headers[e]={}});const En=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Rn=e=>{const t={};let n,r,s;return e&&e.split(`
14
- `).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&En[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Ue=Symbol("internals");function Q(e){return e&&String(e).trim().toLowerCase()}function ae(e){return e===!1||e==null?e:a.isArray(e)?e.map(ae):String(e)}function Cn(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Tn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ye(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function On(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function An(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,i,o){return this[r].call(this,t,s,i,o)},configurable:!0})})}let _=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(l,p,d){const c=Q(p);if(!c)throw new Error("header name must be a non-empty string");const u=a.findKey(s,c);(!u||s[u]===void 0||d===!0||d===void 0&&s[u]!==!1)&&(s[u||p]=ae(l))}const o=(l,p)=>a.forEach(l,(d,c)=>i(d,c,p));if(a.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(a.isString(t)&&(t=t.trim())&&!Tn(t))o(Rn(t),n);else if(a.isObject(t)&&a.isIterable(t)){let l={},p,d;for(const c of t){if(!a.isArray(c))throw TypeError("Object iterator must return a key-value pair");l[d=c[0]]=(p=l[d])?a.isArray(p)?[...p,c[1]]:[p,c[1]]:c[1]}o(l,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=Q(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Cn(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Q(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ye(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(o){if(o=Q(o),o){const l=a.findKey(r,o);l&&(!n||ye(r,r[l],l,n))&&(delete r[l],s=!0)}}return a.isArray(t)?t.forEach(i):i(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!t||ye(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,i)=>{const o=a.findKey(r,i);if(o){n[o]=ae(s),delete n[i];return}const l=t?On(i):String(i).trim();l!==i&&delete n[i],n[l]=ae(s),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
15
- `)}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[Ue]=this[Ue]={accessors:{}}).accessors,s=this.prototype;function i(o){const l=Q(o);r[l]||(An(s,o),r[l]=!0)}return a.isArray(t)?t.forEach(i):i(t),this}};_.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(_.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});a.freezeMethods(_);function be(e,t){const n=this||ne,r=t||n,s=_.from(r.headers);let i=r.data;return a.forEach(e,function(l){i=l.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function at(e){return!!(e&&e.__CANCEL__)}function Y(e,t,n){b.call(this,e??"canceled",b.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(Y,b,{__CANCEL__:!0});function lt(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new b("Request failed with status code "+n.status,[b.ERR_BAD_REQUEST,b.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function jn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function kn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,o;return t=t!==void 0?t:1e3,function(p){const d=Date.now(),c=r[i];o||(o=d),n[s]=p,r[s]=d;let u=i,x=0;for(;u!==s;)x+=n[u++],u=u%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),d-o<t)return;const E=c&&d-c;return E?Math.round(x*1e3/E):void 0}}function Fn(e,t){let n=0,r=1e3/t,s,i;const o=(d,c=Date.now())=>{n=c,s=null,i&&(clearTimeout(i),i=null),e(...d)};return[(...d)=>{const c=Date.now(),u=c-n;u>=r?o(d,c):(s=d,i||(i=setTimeout(()=>{i=null,o(s)},r-u)))},()=>s&&o(s)]}const ce=(e,t,n=3)=>{let r=0;const s=kn(50,250);return Fn(i=>{const o=i.loaded,l=i.lengthComputable?i.total:void 0,p=o-r,d=s(p),c=o<=l;r=o;const u={loaded:o,total:l,progress:l?o/l:void 0,bytes:p,rate:d||void 0,estimated:d&&l&&c?(l-o)/d:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(u)},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)),Nn=F.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,F.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(F.origin),F.navigator&&/(msie|trident)/i.test(F.navigator.userAgent)):()=>!0,Pn=F.hasStandardBrowserEnv?{write(e,t,n,r,s,i,o){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}`),i===!0&&l.push("secure"),a.isString(o)&&l.push(`SameSite=${o}`),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 _n(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Un(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ct(e,t,n){let r=!_n(t);return e&&(r||n==!1)?Un(e,t):t}const Ie=e=>e instanceof _?{...e}:e;function $(e,t){t=t||{};const n={};function r(d,c,u,x){return a.isPlainObject(d)&&a.isPlainObject(c)?a.merge.call({caseless:x},d,c):a.isPlainObject(c)?a.merge({},c):a.isArray(c)?c.slice():c}function s(d,c,u,x){if(a.isUndefined(c)){if(!a.isUndefined(d))return r(void 0,d,u,x)}else return r(d,c,u,x)}function i(d,c){if(!a.isUndefined(c))return r(void 0,c)}function o(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,u){if(u in t)return r(d,c);if(u in e)return r(void 0,d)}const p={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l,headers:(d,c,u)=>s(Ie(d),Ie(c),u,!0)};return a.forEach(Object.keys({...e,...t}),function(c){const u=p[c]||s,x=u(e[c],t[c],c);a.isUndefined(x)&&u!==l||(n[c]=x)}),n}const ut=e=>{const t=$({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:l}=t;if(t.headers=o=_.from(o),t.url=st(ct(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&o.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),a.isFormData(n)){if(F.hasStandardBrowserEnv||F.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(a.isFunction(n.getHeaders)){const p=n.getHeaders(),d=["content-type","content-length"];Object.entries(p).forEach(([c,u])=>{d.includes(c.toLowerCase())&&o.set(c,u)})}}if(F.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&Nn(t.url))){const p=s&&i&&Pn.read(i);p&&o.set(s,p)}return t},Ln=typeof XMLHttpRequest<"u",Bn=Ln&&function(e){return new Promise(function(n,r){const s=ut(e);let i=s.data;const o=_.from(s.headers).normalize();let{responseType:l,onUploadProgress:p,onDownloadProgress:d}=s,c,u,x,E,f;function y(){E&&E(),f&&f(),s.cancelToken&&s.cancelToken.unsubscribe(c),s.signal&&s.signal.removeEventListener("abort",c)}let m=new XMLHttpRequest;m.open(s.method.toUpperCase(),s.url,!0),m.timeout=s.timeout;function S(){if(!m)return;const w=_.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),A={data:!l||l==="text"||l==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:w,config:e,request:m};lt(function(g){n(g),y()},function(g){r(g),y()},A),m=null}"onloadend"in m?m.onloadend=S:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(S)},m.onabort=function(){m&&(r(new b("Request aborted",b.ECONNABORTED,e,m)),m=null)},m.onerror=function(C){const A=C&&C.message?C.message:"Network Error",k=new b(A,b.ERR_NETWORK,e,m);k.event=C||null,r(k),m=null},m.ontimeout=function(){let C=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const A=s.transitional||ot;s.timeoutErrorMessage&&(C=s.timeoutErrorMessage),r(new b(C,A.clarifyTimeoutError?b.ETIMEDOUT:b.ECONNABORTED,e,m)),m=null},i===void 0&&o.setContentType(null),"setRequestHeader"in m&&a.forEach(o.toJSON(),function(C,A){m.setRequestHeader(A,C)}),a.isUndefined(s.withCredentials)||(m.withCredentials=!!s.withCredentials),l&&l!=="json"&&(m.responseType=s.responseType),d&&([x,f]=ce(d,!0),m.addEventListener("progress",x)),p&&m.upload&&([u,E]=ce(p),m.upload.addEventListener("progress",u),m.upload.addEventListener("loadend",E)),(s.cancelToken||s.signal)&&(c=w=>{m&&(r(!w||w.type?new Y(null,e,m):w),m.abort(),m=null)},s.cancelToken&&s.cancelToken.subscribe(c),s.signal&&(s.signal.aborted?c():s.signal.addEventListener("abort",c)));const O=jn(s.url);if(O&&F.protocols.indexOf(O)===-1){r(new b("Unsupported protocol "+O+":",b.ERR_BAD_REQUEST,e));return}m.send(i||null)})},In=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const i=function(d){if(!s){s=!0,l();const c=d instanceof Error?d:this.reason;r.abort(c instanceof b?c:new Y(c instanceof Error?c.message:c))}};let o=t&&setTimeout(()=>{o=null,i(new b(`timeout ${t} of ms exceeded`,b.ETIMEDOUT))},t);const l=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i)}),e=null)};e.forEach(d=>d.addEventListener("abort",i));const{signal:p}=r;return p.unsubscribe=()=>a.asap(l),p}},Dn=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 Mn(e))yield*Dn(n,t)},Mn=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()}},De=(e,t,n,r)=>{const s=vn(e,t);let i=0,o,l=p=>{o||(o=!0,r&&r(p))};return new ReadableStream({async pull(p){try{const{done:d,value:c}=await s.next();if(d){l(),p.close();return}let u=c.byteLength;if(n){let x=i+=u;n(x)}p.enqueue(new Uint8Array(c))}catch(d){throw l(d),d}},cancel(p){return l(p),s.return()}},{highWaterMark:2})},ve=64*1024,{isFunction:oe}=a,zn=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:Me,TextEncoder:ze}=a.global,qe=(e,...t)=>{try{return!!e(...t)}catch{return!1}},qn=e=>{e=a.merge.call({skipUndefined:!0},zn,e);const{fetch:t,Request:n,Response:r}=e,s=t?oe(t):typeof fetch=="function",i=oe(n),o=oe(r);if(!s)return!1;const l=s&&oe(Me),p=s&&(typeof ze=="function"?(f=>y=>f.encode(y))(new ze):async f=>new Uint8Array(await new n(f).arrayBuffer())),d=i&&l&&qe(()=>{let f=!1;const y=new n(F.origin,{body:new Me,method:"POST",get duplex(){return f=!0,"half"}}).headers.has("Content-Type");return f&&!y}),c=o&&l&&qe(()=>a.isReadableStream(new r("").body)),u={stream:c&&(f=>f.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!u[f]&&(u[f]=(y,m)=>{let S=y&&y[f];if(S)return S.call(y);throw new b(`Response type '${f}' is not supported`,b.ERR_NOT_SUPPORT,m)})});const x=async f=>{if(f==null)return 0;if(a.isBlob(f))return f.size;if(a.isSpecCompliantForm(f))return(await new n(F.origin,{method:"POST",body:f}).arrayBuffer()).byteLength;if(a.isArrayBufferView(f)||a.isArrayBuffer(f))return f.byteLength;if(a.isURLSearchParams(f)&&(f=f+""),a.isString(f))return(await p(f)).byteLength},E=async(f,y)=>{const m=a.toFiniteNumber(f.getContentLength());return m??x(y)};return async f=>{let{url:y,method:m,data:S,signal:O,cancelToken:w,timeout:C,onDownloadProgress:A,onUploadProgress:k,responseType:g,headers:U,withCredentials:W="same-origin",fetchOptions:z}=ut(f),re=t||fetch;g=g?(g+"").toLowerCase():"text";let J=In([O,w&&w.toAbortSignal()],C),R=null;const j=J&&J.unsubscribe&&(()=>{J.unsubscribe()});let V;try{if(k&&d&&m!=="get"&&m!=="head"&&(V=await E(U,S))!==0){let M=new n(y,{method:"POST",body:S,duplex:"half"}),K;if(a.isFormData(S)&&(K=M.headers.get("content-type"))&&U.setContentType(K),M.body){const[me,se]=Le(V,ce(Be(k)));S=De(M.body,ve,me,se)}}a.isString(W)||(W=W?"include":"omit");const B=i&&"credentials"in n.prototype,Ae={...z,signal:J,method:m.toUpperCase(),headers:U.normalize().toJSON(),body:S,duplex:"half",credentials:B?W:void 0};R=i&&new n(y,Ae);let v=await(i?re(R,z):re(y,Ae));const je=c&&(g==="stream"||g==="response");if(c&&(A||je&&j)){const M={};["status","statusText","headers"].forEach(ke=>{M[ke]=v[ke]});const K=a.toFiniteNumber(v.headers.get("content-length")),[me,se]=A&&Le(K,ce(Be(A),!0))||[];v=new r(De(v.body,ve,me,()=>{se&&se(),j&&j()}),M)}g=g||"text";let yt=await u[a.findKey(u,g)||"text"](v,f);return!je&&j&&j(),await new Promise((M,K)=>{lt(M,K,{data:yt,headers:_.from(v.headers),status:v.status,statusText:v.statusText,config:f,request:R})})}catch(B){throw j&&j(),B&&B.name==="TypeError"&&/Load failed|fetch/i.test(B.message)?Object.assign(new b("Network Error",b.ERR_NETWORK,f,R),{cause:B.cause||B}):b.from(B,B&&B.code,f,R)}}},Hn=new Map,dt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,i=[r,s,n];let o=i.length,l=o,p,d,c=Hn;for(;l--;)p=i[l],d=c.get(p),d===void 0&&c.set(p,d=l?new Map:qn(t)),c=d;return d};dt();const Oe={http:on,xhr:Bn,fetch:{get:dt}};a.forEach(Oe,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const He=e=>`- ${e}`,$n=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 i={};for(let o=0;o<n;o++){r=e[o];let l;if(s=r,!$n(r)&&(s=Oe[(l=String(r)).toLowerCase()],s===void 0))throw new b(`Unknown adapter '${l}'`);if(s&&(a.isFunction(s)||(s=s.get(t))))break;i[l||"#"+o]=s}if(!s){const o=Object.entries(i).map(([p,d])=>`adapter ${p} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=n?o.length>1?`since :
16
- `+o.map(He).join(`
17
- `):" "+He(o[0]):"as no adapter specified";throw new b("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return s}const ft={getAdapter:Wn,adapters:Oe};function xe(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Y(null,e)}function $e(e){return xe(e),e.headers=_.from(e.headers),e.data=be.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ft.getAdapter(e.adapter||ne.adapter,e)(e).then(function(r){return xe(e),r.data=be.call(e,e.transformResponse,r),r.headers=_.from(r.headers),r},function(r){return at(r)||(xe(e),r&&r.response&&(r.response.data=be.call(e,e.transformResponse,r.response),r.response.headers=_.from(r.response.headers))),Promise.reject(r)})}const pt="1.13.2",he={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{he[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const We={};he.transitional=function(t,n,r){function s(i,o){return"[Axios v"+pt+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,l)=>{if(t===!1)throw new b(s(o," has been removed"+(n?" in "+n:"")),b.ERR_DEPRECATED);return n&&!We[o]&&(We[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,l):!0}};he.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Jn(e,t,n){if(typeof e!="object")throw new b("options must be an object",b.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],o=t[i];if(o){const l=e[i],p=l===void 0||o(l,i,e);if(p!==!0)throw new b("option "+i+" must be "+p,b.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new b("Unknown option "+i,b.ERR_BAD_OPTION)}}const le={assertOptions:Jn,validators:he},I=le.validators;let H=class{constructor(t){this.defaults=t||{},this.interceptors={request:new _e,response:new _e}}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 i=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
18
- `+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=$(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&le.assertOptions(r,{silentJSONParsing:I.transitional(I.boolean),forcedJSONParsing:I.transitional(I.boolean),clarifyTimeoutError:I.transitional(I.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:le.assertOptions(s,{encode:I.function,serialize:I.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),le.assertOptions(n,{baseUrl:I.spelling("baseURL"),withXsrfToken:I.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&a.merge(i.common,i[n.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],f=>{delete i[f]}),n.headers=_.concat(o,i);const l=[];let p=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(p=p&&y.synchronous,l.unshift(y.fulfilled,y.rejected))});const d=[];this.interceptors.response.forEach(function(y){d.push(y.fulfilled,y.rejected)});let c,u=0,x;if(!p){const f=[$e.bind(this),void 0];for(f.unshift(...l),f.push(...d),x=f.length,c=Promise.resolve(n);u<x;)c=c.then(f[u++],f[u++]);return c}x=l.length;let E=n;for(;u<x;){const f=l[u++],y=l[u++];try{E=f(E)}catch(m){y.call(this,m);break}}try{c=$e.call(this,E)}catch(f){return Promise.reject(f)}for(u=0,x=d.length;u<x;)c=c.then(d[u++],d[u++]);return c}getUri(t){t=$(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){H.prototype[t]=function(n,r){return this.request($(r||{},{method:t,url:n,data:(r||{}).data}))}});a.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,l){return this.request($(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}H.prototype[t]=n(),H.prototype[t+"Form"]=n(!0)});let Vn=class ht{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(l=>{r.subscribe(l),i=l}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,l){r.reason||(r.reason=new Y(i,o,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 Kn(e){return function(n){return e.apply(null,n)}}function Xn(e){return a.isObject(e)&&e.isAxiosError===!0}const Ee={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(Ee).forEach(([e,t])=>{Ee[t]=e});function mt(e){const t=new H(e),n=Je(H.prototype.request,t);return a.extend(n,H.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return mt($(e,s))},n}const T=mt(ne);T.Axios=H;T.CanceledError=Y;T.CancelToken=Vn;T.isCancel=at;T.VERSION=pt;T.toFormData=pe;T.AxiosError=b;T.Cancel=T.CanceledError;T.all=function(t){return Promise.all(t)};T.spread=Kn;T.isAxiosError=Xn;T.mergeConfig=$;T.AxiosHeaders=_;T.formToJSON=e=>it(a.isHTMLForm(e)?new FormData(e):e);T.getAdapter=ft.getAdapter;T.HttpStatusCode=Ee;T.default=T;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:yr,getAdapter:br,mergeConfig:xr}=T,Gn=async(e,t,n,r,s)=>{const i={chatInput:e,metadata:{pinecone_namespace:t,name:r,email:s}};try{return(await T.post(n,i,{headers:{"Content-Type":"application/json"}})).data}catch(o){throw console.error("Error communicating with chat API:",o),o}},Yn=async(e,t,n,r)=>{const s={chatInput:e,metadata:{pinecone_namespace:t},sessionId:r};try{return(await T.post(n,s,{headers:{"Content-Type":"application/json"}})).data}catch(i){throw console.error("Error communicating with chat API:",i),i}},Qn=({handleMessageFromForm:e,theme:t,chatBotData:n,setChatSessionId:r})=>{const[s,i]=N.useState(""),[o,l]=N.useState(""),[p,d]=N.useState(""),[c,u]=N.useState(""),[x,E]=N.useState(!1),f=async g=>{if(g.preventDefault(),E(!0),u(""),!s.trim()||!o.trim()){u("Name and email are required"),E(!1);return}try{const U=await Gn(p,n.pineconeNamespace,n.initiateChatUrl,s,o);e([{type:"user",text:p},{type:"bot",text:U.n8n.response,response_timestamp:U.n8n.response_timestamp,sessionId:U.n8n.sessionId}]),r(U.n8n.sessionId)}catch(U){console.log("error sending user details",U),u("Failed to submit. Please try again.")}finally{E(!1)}i(""),l(""),d("")},y={padding:"20px",flexShrink:0,background:t.backgroundColor,fontFamily:"system-ui, -apple-system, sans-serif"},m={display:"flex",flexDirection:"column",gap:"24px"},S={fontSize:"14px",fontWeight:"500",color:t.fontColor,margin:0,lineHeight:"1.4"},O={display:"flex",flexDirection:"column",gap:"20px"},w={fontSize:"14px",color:t.fontColor,fontWeight:"500"},C={width:"100%",padding:"12px 16px",background:t.backgroundColor,color:t.fontColor,border:"1px solid #a1a1aa",borderRadius:"12px",fontSize:"15px",outline:"none",boxSizing:"border-box"},A={padding:"12px 20px",borderRadius:"12px",fontWeight:"600",fontSize:"15px",border:"none",cursor:s.trim()&&o.trim()&&!x?"pointer":"not-allowed",opacity:s.trim()&&o.trim()&&!x?1:.5,background:`linear-gradient(135deg, ${t.primaryColor}, ${t.secondaryColor})`,color:t.fontColor,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.2s ease"},k={backgroundColor:"#fee2e2",color:"#713f12",padding:"8px 12px",borderRadius:"8px",fontSize:"13px",textAlign:"center",fontWeight:"500"};return h.jsx("div",{style:y,children:h.jsxs("form",{onSubmit:f,style:m,children:[c&&h.jsx("div",{style:k,role:"alert",children:c}),h.jsx("p",{style:S,children:n.welcomeText}),h.jsxs("div",{style:O,children:[h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[h.jsx("label",{style:w,children:"Full Name"}),h.jsx("input",{type:"text",placeholder:"Enter your full name",value:s,onChange:g=>{i(g.target.value),u("")},style:C,required:!0})]}),h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[h.jsx("label",{style:w,children:"Email Address"}),h.jsx("input",{type:"email",placeholder:"Enter your email",value:o,onChange:g=>{l(g.target.value),u("")},style:C,required:!0})]}),h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[h.jsx("label",{style:w,children:"Message"}),h.jsx("textarea",{placeholder:"Enter your message",value:p,onChange:g=>{d(g.target.value),u("")},style:{...C,minHeight:"60px",resize:"vertical"},required:!0})]})]}),h.jsx("button",{type:"submit",disabled:!s.trim()||!o.trim()||x,style:A,onMouseEnter:g=>{s.trim()&&o.trim()&&!x&&(g.currentTarget.style.transform="translateY(-2px)",g.currentTarget.style.boxShadow="0 10px 20px rgba(0,0,0,0.15)")},onMouseLeave:g=>{g.currentTarget.style.transform="translateY(0)",g.currentTarget.style.boxShadow="none"},children:x?"Submitting...":h.jsxs(h.Fragment,{children:[h.jsx(D.Send,{size:18}),"Submit"]})})]})})},Zn=({onClose:e,theme:t,chatBotData:n})=>{const[r,s]=N.useState([]),[i,o]=N.useState(!1),[l,p]=N.useState(!1),[d,c]=N.useState(!1),[u,x]=N.useState(null),E=n.position==="left",f=R=>{x(R)},y={position:"fixed",bottom:"112px",[E?"left":"right"]:"32px",zIndex:50,width:d?"684px":"384px",height:d?"620px":"520px",background:`${t.backgroundColor}cc`,backdropFilter:"blur(16px)",WebkitBackdropFilter:"blur(16px)",borderRadius:"16px",border:"1px solid rgba(255, 255, 255, 0.3)",boxShadow:"0 20px 25px -5px rgba(0,0,0,0.15), 0 10px 10px -5px rgba(0,0,0,0.1)",display:"flex",flexDirection:"column",overflow:"hidden",fontFamily:"system-ui, -apple-system, sans-serif"},m={padding:"16px 20px",background:`linear-gradient(135deg, ${t.primaryColor}, ${t.secondaryColor})`,color:t.fontColor,borderRadius:"16px 16px 0 0",display:"flex",alignItems:"center",justifyContent:"space-between",boxShadow:"0 4px 6px -1px rgba(0,0,0,0.1)"},S={position:"relative"},O={width:"44px",height:"44px",borderRadius:"50%",background:"rgba(255,255,255,0.2)",display:"flex",alignItems:"center",justifyContent:"center"},w={position:"absolute",bottom:0,right:0,width:"14px",height:"14px",backgroundColor:"#34d399",borderRadius:"50%",border:"3px solid white"},C={fontSize:"18px",fontWeight:"600",margin:0,lineHeight:"1.2"},A={fontSize:"12px",opacity:.9,margin:0,lineHeight:"1.3"},k={padding:"8px",borderRadius:"50%",background:"transparent",border:"none",cursor:"pointer",transition:"background 0.2s"},g={padding:"12px 20px",borderTop:"1px solid rgba(255,255,255,0.2)",background:t.backgroundColor,textAlign:"center"},U={fontSize:"11px",color:t.fontColor,letterSpacing:"0.5px"},W={fontWeight:"600"},z=(R,j)=>{R.currentTarget.style.background=j?"rgba(255,255,255,0.2)":"transparent"},re=R=>{s(R),p(!0)},J=async R=>{o(!0),s(j=>[...j,{type:"user",text:R}]);try{const j=await Yn(R,n.pineconeNamespace,n.onGoingChatUrl,u);s(V=>[...V,{type:"bot",text:j.n8n.response,response_timestamp:j.n8n.response_timestamp,suggested_prompts:j.n8n.suggested_prompt}])}catch(j){console.error("Chat error:",j),s(V=>[...V,{type:"bot",text:"Sorry, something went wrong."}])}finally{o(!1)}};return h.jsxs("div",{style:y,children:[h.jsxs("div",{style:m,children:[h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[h.jsxs("div",{style:S,children:[h.jsx("div",{style:O,children:h.jsx(D.MessageCircle,{size:22})}),h.jsx("span",{style:w})]}),h.jsxs("div",{children:[h.jsx("h3",{style:C,children:n.name}),h.jsx("p",{style:A,children:n.subTitle})]})]}),h.jsxs("div",{style:{display:"flex",alignItems:"left"},children:[h.jsx("button",{onClick:()=>c(R=>!R),"aria-label":"expand chat",style:k,onMouseEnter:R=>z(R,!0),onMouseLeave:R=>z(R,!1),children:d?h.jsx(D.Minimize2,{size:20}):h.jsx(D.Maximize2,{size:20})}),h.jsx("button",{onClick:e,"aria-label":"close chat",style:k,onMouseEnter:R=>z(R,!0),onMouseLeave:R=>z(R,!1),children:h.jsx(D.X,{size:20})})]})]}),u?h.jsxs(h.Fragment,{children:[h.jsx(gt,{messages:r,isLoading:i,theme:t}),h.jsx(xt,{onSendMessage:J,isLoading:i,theme:t,messages:r})]}):h.jsx(Qn,{handleMessageFromForm:re,theme:t,chatBotData:n,setChatSessionId:f}),h.jsx("div",{style:g,children:h.jsxs("p",{style:U,children:["powered by"," ",h.jsx("span",{style:W,children:"clone67.com"})]})})]})},er=({pineconeNamespace:e,onGoingChatUrl:t,initiateChatUrl:n,primaryColor:r="#3b82f6",secondaryColor:s="#8b5cf6",backgroundColor:i="#ffffff",fontColor:o="#1f2937",placeholderColor:l="#9ca3af",position:p="right",name:d="Assistant",subTitle:c="Typically replies instantly",welcomeText:u="Hi! How can I help you today?"})=>{const[x,E]=N.useState(!1),f=()=>E(k=>!k),y=()=>E(k=>!k),m={primaryColor:r,secondaryColor:s,backgroundColor:i,fontColor:o,placeholderColor:l,inputBackgroundColor:i},S={name:d,subTitle:c,welcomeText:u,onGoingChatUrl:t,initiateChatUrl:n,pineconeNamespace:e,position:p},O=p==="left",w="32px",C={position:"fixed",bottom:"104px",[O?"left":"right"]:w,zIndex:9999,pointerEvents:"auto"},A={position:"fixed",bottom:"32px",[O?"left":"right"]:w,zIndex:1e4,pointerEvents:"auto"};return h.jsxs(h.Fragment,{children:[x&&h.jsx("div",{style:C,children:h.jsx(Zn,{onClose:f,theme:m,chatBotData:S})}),h.jsx("div",{style:A,children:h.jsx(bt,{onMinimise:y,isOpen:x,theme:m,chatBotData:S})})]})};module.exports=er;
11
+ `}),p.jsxs("div",{style:S,children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[p.jsxs("div",{style:O,children:[p.jsx("div",{style:w,children:p.jsx(L.MessageCircle,{size:22})}),p.jsx("span",{style:A})]}),p.jsxs("div",{children:[p.jsx("h3",{style:j,children:n.name}),p.jsx("p",{style:E,children:n.subTitle})]})]}),p.jsxs("div",{style:{display:"flex",alignItems:"left"},children:[p.jsx("button",{onClick:()=>h(b=>!b),"aria-label":"expand chat",style:R,onMouseEnter:b=>z(b,!0),onMouseLeave:b=>z(b,!1),children:l?p.jsx(L.Minimize2,{size:20}):p.jsx(L.Maximize2,{size:20})}),p.jsx("button",{onClick:e,"aria-label":"close chat",style:R,onMouseEnter:b=>z(b,!0),onMouseLeave:b=>z(b,!1),children:p.jsx(L.X,{size:20})})]})]}),x?p.jsx(p.Fragment,{children:i&&r.length===0?p.jsxs("div",{style:J,children:[p.jsx(L.Loader2,{size:18,style:H}),p.jsx("span",{children:"Checking server…"})]}):p.jsxs(p.Fragment,{children:[p.jsx(bt,{messages:r,isLoading:i,theme:t}),p.jsx(xt,{onSendMessage:y,isLoading:i,theme:t})]})}):p.jsx(Zn,{theme:t,chatBotData:n,trackFormSubmission:C}),p.jsx("div",{style:Y,children:p.jsxs("p",{style:W,children:["powered by ",p.jsx("span",{style:re,children:"clone67.com"})]})})]})},tr=({pineconeNamespace:e,onGoingChatUrl:t,initiateChatUrl:n,fetchChatHistoryUrl:r,primaryColor:s="#3b82f6",secondaryColor:i="#8b5cf6",backgroundColor:o="#ffffff",fontColor:l="#1f2937",placeholderColor:h="#9ca3af",position:u="right",name:c="Assistant",subTitle:d="Typically replies instantly",welcomeText:x="Hi! How can I help you today?"})=>{const[C,f]=N.useState(!1),y=()=>{f(R=>!R),localStorage.removeItem("clone67ChatSessionId")},m=()=>f(R=>!R),S={primaryColor:s,secondaryColor:i,backgroundColor:o,fontColor:l,placeholderColor:h,inputBackgroundColor:o},O={name:c,subTitle:d,welcomeText:x,onGoingChatUrl:t,fetchChatHistoryUrl:r,initiateChatUrl:n,pineconeNamespace:e,position:u},w=u==="left",A="32px",j={position:"fixed",bottom:"104px",[w?"left":"right"]:A,zIndex:9999,pointerEvents:"auto"},E={position:"fixed",bottom:"32px",[w?"left":"right"]:A,zIndex:1e4,pointerEvents:"auto"};return p.jsxs(p.Fragment,{children:[C&&p.jsx("div",{style:j,children:p.jsx(er,{onClose:y,theme:S,chatBotData:O})}),p.jsx("div",{style:E,children:p.jsx(gt,{onMinimise:m,isOpen:C,theme:S,chatBotData:O})})]})};module.exports=tr;