@tarxemo/customer_support 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +1107 -1384
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +15 -36
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,73 +1,52 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Me;function Ut(){if(Me)return te;Me=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,s,o){var i=null;if(o!==void 0&&(i=""+o),s.key!==void 0&&(i=""+s.key),"key"in s){o={};for(var a in s)a!=="key"&&(o[a]=s[a])}else o=s;return s=o.ref,{$$typeof:e,type:n,key:i,ref:s!==void 0?s:null,props:o}}return te.Fragment=t,te.jsx=r,te.jsxs=r,te}var re={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.development.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var He;function vt(){return He||(He=1,process.env.NODE_ENV!=="production"&&(function(){function e(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===Te?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case h:return"Fragment";case C:return"Profiler";case _:return"StrictMode";case B:return"Suspense";case U:return"SuspenseList";case _e:return"Activity"}if(typeof l=="object")switch(typeof l.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),l.$$typeof){case y:return"Portal";case T:return l.displayName||"Context";case w:return(l._context.displayName||"Context")+".Consumer";case j:var E=l.render;return l=l.displayName,l||(l=E.displayName||E.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case ue:return E=l.displayName||null,E!==null?E:e(l.type)||"Memo";case $:E=l._payload,l=l._init;try{return e(l(E))}catch{}}return null}function t(l){return""+l}function r(l){try{t(l);var E=!1}catch{E=!0}if(E){E=console;var O=E.error,x=typeof Symbol=="function"&&Symbol.toStringTag&&l[Symbol.toStringTag]||l.constructor.name||"Object";return O.call(E,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",x),t(l)}}function n(l){if(l===h)return"<>";if(typeof l=="object"&&l!==null&&l.$$typeof===$)return"<...>";try{var E=e(l);return E?"<"+E+">":"<...>"}catch{return"<...>"}}function s(){var l=J.A;return l===null?null:l.getOwner()}function o(){return Error("react-stack-top-frame")}function i(l){if(V.call(l,"key")){var E=Object.getOwnPropertyDescriptor(l,"key").get;if(E&&E.isReactWarning)return!1}return l.key!==void 0}function a(l,E){function O(){v||(v=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",E))}O.isReactWarning=!0,Object.defineProperty(l,"key",{get:O,configurable:!0})}function p(){var l=e(this.type);return fe[l]||(fe[l]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),l=this.props.ref,l!==void 0?l:null}function f(l,E,O,x,X,Ie){var k=O.ref;return l={$$typeof:d,type:l,key:E,props:O,_owner:x},(k!==void 0?k:null)!==null?Object.defineProperty(l,"ref",{enumerable:!1,get:p}):Object.defineProperty(l,"ref",{enumerable:!1,value:null}),l._store={},Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(l,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(l,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.defineProperty(l,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Ie}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}function u(l,E,O,x,X,Ie){var k=E.children;if(k!==void 0)if(x)if(z(k)){for(x=0;x<k.length;x++)m(k[x]);Object.freeze&&Object.freeze(k)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else m(k);if(V.call(E,"key")){k=e(l);var ee=Object.keys(E).filter(function(Rn){return Rn!=="key"});x=0<ee.length?"{key: someKey, "+ee.join(": ..., ")+": ...}":"{key: someKey}",Oe[k+x]||(ee=0<ee.length?"{"+ee.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
|
-
let props = %s;
|
|
19
|
-
<%s {...props} />
|
|
20
|
-
React keys must be passed directly to JSX without using spread:
|
|
21
|
-
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,x,k,ee,k),Oe[k+x]=!0)}if(k=null,O!==void 0&&(r(O),k=""+O),i(E)&&(r(E.key),k=""+E.key),"key"in E){O={};for(var Be in E)Be!=="key"&&(O[Be]=E[Be])}else O=E;return k&&a(O,typeof l=="function"?l.displayName||l.name||"Unknown":l),f(l,k,O,s(),X,Ie)}function m(l){g(l)?l._store&&(l._store.validated=1):typeof l=="object"&&l!==null&&l.$$typeof===$&&(l._payload.status==="fulfilled"?g(l._payload.value)&&l._payload.value._store&&(l._payload.value._store.validated=1):l._store&&(l._store.validated=1))}function g(l){return typeof l=="object"&&l!==null&&l.$$typeof===d}var A=S,d=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),T=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),ue=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),_e=Symbol.for("react.activity"),Te=Symbol.for("react.client.reference"),J=A.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=Object.prototype.hasOwnProperty,z=Array.isArray,Q=console.createTask?console.createTask:function(){return null};A={react_stack_bottom_frame:function(l){return l()}};var v,fe={},M=A.react_stack_bottom_frame.bind(A,o)(),de=Q(n(o)),Oe={};re.Fragment=h,re.jsx=function(l,E,O){var x=1e4>J.recentlyCreatedOwnerStacks++;return u(l,E,O,!1,x?Error("react-stack-top-frame"):M,x?Q(n(l)):de)},re.jsxs=function(l,E,O){var x=1e4>J.recentlyCreatedOwnerStacks++;return u(l,E,O,!0,x?Error("react-stack-top-frame"):M,x?Q(n(l)):de)}})()),re}var qe;function It(){return qe||(qe=1,process.env.NODE_ENV==="production"?q.exports=Ut():q.exports=vt()),q.exports}var R=It();/**
|
|
1
|
+
(function(_,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],w):(_=typeof globalThis<"u"?globalThis:_||self,w(_.CustomerSupport={},_.jsxRuntime,_.React))})(this,(function(_,w,R){"use strict";var cr=Object.defineProperty;var lr=(_,w,R)=>w in _?cr(_,w,{enumerable:!0,configurable:!0,writable:!0,value:R}):_[w]=R;var Rt=(_,w,R)=>lr(_,typeof w!="symbol"?w+"":w,R);/**
|
|
23
2
|
* @license lucide-react v0.469.0 - ISC
|
|
24
3
|
*
|
|
25
4
|
* This source code is licensed under the ISC license.
|
|
26
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/const
|
|
6
|
+
*/const _t=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ce=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
28
7
|
* @license lucide-react v0.469.0 - ISC
|
|
29
8
|
*
|
|
30
9
|
* This source code is licensed under the ISC license.
|
|
31
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
32
|
-
*/var
|
|
11
|
+
*/var Ct={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
33
12
|
* @license lucide-react v0.469.0 - ISC
|
|
34
13
|
*
|
|
35
14
|
* This source code is licensed under the ISC license.
|
|
36
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
37
|
-
*/const
|
|
16
|
+
*/const Tt=R.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:i,...a},d)=>R.createElement("svg",{ref:d,...Ct,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Ce("lucide",s),...a},[...i.map(([u,l])=>R.createElement(u,l)),...Array.isArray(o)?o:[o]]));/**
|
|
38
17
|
* @license lucide-react v0.469.0 - ISC
|
|
39
18
|
*
|
|
40
19
|
* This source code is licensed under the ISC license.
|
|
41
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/const
|
|
21
|
+
*/const J=(e,t)=>{const n=R.forwardRef(({className:r,...s},o)=>R.createElement(Tt,{ref:o,iconNode:t,className:Ce(`lucide-${_t(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
|
|
43
22
|
* @license lucide-react v0.469.0 - ISC
|
|
44
23
|
*
|
|
45
24
|
* This source code is licensed under the ISC license.
|
|
46
25
|
* See the LICENSE file in the root directory of this source tree.
|
|
47
|
-
*/const
|
|
26
|
+
*/const Nt=J("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
48
27
|
* @license lucide-react v0.469.0 - ISC
|
|
49
28
|
*
|
|
50
29
|
* This source code is licensed under the ISC license.
|
|
51
30
|
* See the LICENSE file in the root directory of this source tree.
|
|
52
|
-
*/const
|
|
31
|
+
*/const xt=J("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
53
32
|
* @license lucide-react v0.469.0 - ISC
|
|
54
33
|
*
|
|
55
34
|
* This source code is licensed under the ISC license.
|
|
56
35
|
* See the LICENSE file in the root directory of this source tree.
|
|
57
|
-
*/const
|
|
36
|
+
*/const Pt=J("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
|
|
58
37
|
* @license lucide-react v0.469.0 - ISC
|
|
59
38
|
*
|
|
60
39
|
* This source code is licensed under the ISC license.
|
|
61
40
|
* See the LICENSE file in the root directory of this source tree.
|
|
62
|
-
*/const
|
|
41
|
+
*/const Dt=J("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
|
|
63
42
|
* @license lucide-react v0.469.0 - ISC
|
|
64
43
|
*
|
|
65
44
|
* This source code is licensed under the ISC license.
|
|
66
45
|
* See the LICENSE file in the root directory of this source tree.
|
|
67
|
-
*/const Vt=ne("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function $e(e,t){return function(){return e.apply(t,arguments)}}const{toString:Wt}=Object.prototype,{getPrototypeOf:Ae}=Object,{iterator:pe,toStringTag:Je}=Symbol,he=(e=>t=>{const r=Wt.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),I=e=>(e=e.toLowerCase(),t=>he(t)===e),me=e=>t=>typeof t===e,{isArray:G}=Array,Z=me("undefined");function se(e){return e!==null&&!Z(e)&&e.constructor!==null&&!Z(e.constructor)&&D(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ve=I("ArrayBuffer");function Kt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ve(e.buffer),t}const Yt=me("string"),D=me("function"),We=me("number"),oe=e=>e!==null&&typeof e=="object",Xt=e=>e===!0||e===!1,ye=e=>{if(he(e)!=="object")return!1;const t=Ae(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Je in e)&&!(pe in e)},Gt=e=>{if(!oe(e)||se(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Zt=I("Date"),Qt=I("File"),er=I("Blob"),tr=I("FileList"),rr=e=>oe(e)&&D(e.pipe),nr=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||D(e.append)&&((t=he(e))==="formdata"||t==="object"&&D(e.toString)&&e.toString()==="[object FormData]"))},sr=I("URLSearchParams"),[or,ir,ar,cr]=["ReadableStream","Request","Response","Headers"].map(I),lr=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ie(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,s;if(typeof e!="object"&&(e=[e]),G(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(se(e))return;const o=r?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let a;for(n=0;n<i;n++)a=o[n],t.call(null,e[a],a,e)}}function Ke(e,t){if(se(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,s;for(;n-- >0;)if(s=r[n],t===s.toLowerCase())return s;return null}const W=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ye=e=>!Z(e)&&e!==W;function xe(){const{caseless:e,skipUndefined:t}=Ye(this)&&this||{},r={},n=(s,o)=>{const i=e&&Ke(r,o)||o;ye(r[i])&&ye(s)?r[i]=xe(r[i],s):ye(s)?r[i]=xe({},s):G(s)?r[i]=s.slice():(!t||!Z(s))&&(r[i]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&ie(arguments[s],n);return r}const ur=(e,t,r,{allOwnKeys:n}={})=>(ie(t,(s,o)=>{r&&D(s)?Object.defineProperty(e,o,{value:$e(s,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),fr=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),dr=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},pr=(e,t,r,n)=>{let s,o,i;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!n||n(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=r!==!1&&Ae(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},hr=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},mr=e=>{if(!e)return null;if(G(e))return e;let t=e.length;if(!We(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},yr=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ae(Uint8Array)),wr=(e,t)=>{const n=(e&&e[pe]).call(e);let s;for(;(s=n.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},br=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Er=I("HTMLFormElement"),gr=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),Xe=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Rr=I("RegExp"),Ge=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ie(r,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(n[o]=i||s)}),Object.defineProperties(e,n)},Sr=e=>{Ge(e,(t,r)=>{if(D(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(D(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},_r=(e,t)=>{const r={},n=s=>{s.forEach(o=>{r[o]=!0})};return G(e)?n(e):n(String(e).split(t)),r},Tr=()=>{},Or=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Ar(e){return!!(e&&D(e.append)&&e[Je]==="FormData"&&e[pe])}const xr=e=>{const t=new Array(10),r=(n,s)=>{if(oe(n)){if(t.indexOf(n)>=0)return;if(se(n))return n;if(!("toJSON"in n)){t[s]=n;const o=G(n)?[]:{};return ie(n,(i,a)=>{const p=r(i,s+1);!Z(p)&&(o[a]=p)}),t[s]=void 0,o}}return n};return r(e,0)},Cr=I("AsyncFunction"),Nr=e=>e&&(oe(e)||D(e))&&D(e.then)&&D(e.catch),Ze=((e,t)=>e?setImmediate:t?((r,n)=>(W.addEventListener("message",({source:s,data:o})=>{s===W&&o===r&&n.length&&n.shift()()},!1),s=>{n.push(s),W.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",D(W.postMessage)),Pr=typeof queueMicrotask<"u"?queueMicrotask.bind(W):typeof process<"u"&&process.nextTick||Ze,c={isArray:G,isArrayBuffer:Ve,isBuffer:se,isFormData:nr,isArrayBufferView:Kt,isString:Yt,isNumber:We,isBoolean:Xt,isObject:oe,isPlainObject:ye,isEmptyObject:Gt,isReadableStream:or,isRequest:ir,isResponse:ar,isHeaders:cr,isUndefined:Z,isDate:Zt,isFile:Qt,isBlob:er,isRegExp:Rr,isFunction:D,isStream:rr,isURLSearchParams:sr,isTypedArray:yr,isFileList:tr,forEach:ie,merge:xe,extend:ur,trim:lr,stripBOM:fr,inherits:dr,toFlatObject:pr,kindOf:he,kindOfTest:I,endsWith:hr,toArray:mr,forEachEntry:wr,matchAll:br,isHTMLForm:Er,hasOwnProperty:Xe,hasOwnProp:Xe,reduceDescriptors:Ge,freezeMethods:Sr,toObjectSet:_r,toCamelCase:gr,noop:Tr,toFiniteNumber:Or,findKey:Ke,global:W,isContextDefined:Ye,isSpecCompliantForm:Ar,toJSONObject:xr,isAsyncFn:Cr,isThenable:Nr,setImmediate:Ze,asap:Pr,isIterable:e=>e!=null&&D(e[pe])};let b=class Dt extends Error{static from(t,r,n,s,o,i){const a=new Dt(t.message,r||t.code,n,s,o);return a.cause=t,a.name=t.name,i&&Object.assign(a,i),a}constructor(t,r,n,s,o){super(t),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),n&&(this.config=n),s&&(this.request=s),o&&(this.response=o,this.status=o.status)}toJSON(){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:c.toJSONObject(this.config),code:this.code,status:this.status}}};b.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",b.ERR_BAD_OPTION="ERR_BAD_OPTION",b.ECONNABORTED="ECONNABORTED",b.ETIMEDOUT="ETIMEDOUT",b.ERR_NETWORK="ERR_NETWORK",b.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",b.ERR_DEPRECATED="ERR_DEPRECATED",b.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",b.ERR_BAD_REQUEST="ERR_BAD_REQUEST",b.ERR_CANCELED="ERR_CANCELED",b.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",b.ERR_INVALID_URL="ERR_INVALID_URL";const kr=null;function Ce(e){return c.isPlainObject(e)||c.isArray(e)}function Qe(e){return c.endsWith(e,"[]")?e.slice(0,-2):e}function et(e,t,r){return e?e.concat(t).map(function(s,o){return s=Qe(s),!r&&o?"["+s+"]":s}).join(r?".":""):t}function jr(e){return c.isArray(e)&&!e.some(Ce)}const Fr=c.toFlatObject(c,{},null,function(t){return/^is[A-Z]/.test(t)});function we(e,t,r){if(!c.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=c.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,h){return!c.isUndefined(h[y])});const n=r.metaTokens,s=r.visitor||u,o=r.dots,i=r.indexes,p=(r.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(t);if(!c.isFunction(s))throw new TypeError("visitor must be a function");function f(d){if(d===null)return"";if(c.isDate(d))return d.toISOString();if(c.isBoolean(d))return d.toString();if(!p&&c.isBlob(d))throw new b("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(d)||c.isTypedArray(d)?p&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function u(d,y,h){let _=d;if(d&&!h&&typeof d=="object"){if(c.endsWith(y,"{}"))y=n?y:y.slice(0,-2),d=JSON.stringify(d);else if(c.isArray(d)&&jr(d)||(c.isFileList(d)||c.endsWith(y,"[]"))&&(_=c.toArray(d)))return y=Qe(y),_.forEach(function(w,T){!(c.isUndefined(w)||w===null)&&t.append(i===!0?et([y],T,o):i===null?y:y+"[]",f(w))}),!1}return Ce(d)?!0:(t.append(et(h,y,o),f(d)),!1)}const m=[],g=Object.assign(Fr,{defaultVisitor:u,convertValue:f,isVisitable:Ce});function A(d,y){if(!c.isUndefined(d)){if(m.indexOf(d)!==-1)throw Error("Circular reference detected in "+y.join("."));m.push(d),c.forEach(d,function(_,C){(!(c.isUndefined(_)||_===null)&&s.call(t,_,c.isString(C)?C.trim():C,y,g))===!0&&A(_,y?y.concat(C):[C])}),m.pop()}}if(!c.isObject(e))throw new TypeError("data must be an object");return A(e),t}function tt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Ne(e,t){this._pairs=[],e&&we(e,this,t)}const rt=Ne.prototype;rt.append=function(t,r){this._pairs.push([t,r])},rt.toString=function(t){const r=t?function(n){return t.call(this,n,tt)}:tt;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function Dr(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function nt(e,t,r){if(!t)return e;const n=r&&r.encode||Dr,s=c.isFunction(r)?{serialize:r}:r,o=s&&s.serialize;let i;if(o?i=o(t,s):i=c.isURLSearchParams(t)?t.toString():new Ne(t,s).toString(n),i){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class st{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){c.forEach(this.handlers,function(n){n!==null&&t(n)})}}const ot={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Lr={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Ne,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Pe=typeof window<"u"&&typeof document<"u",ke=typeof navigator=="object"&&navigator||void 0,Ur=Pe&&(!ke||["ReactNative","NativeScript","NS"].indexOf(ke.product)<0),vr=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ir=Pe&&window.location.href||"http://localhost",F={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Pe,hasStandardBrowserEnv:Ur,hasStandardBrowserWebWorkerEnv:vr,navigator:ke,origin:Ir},Symbol.toStringTag,{value:"Module"})),...Lr};function Br(e,t){return we(e,new F.classes.URLSearchParams,{visitor:function(r,n,s,o){return F.isNode&&c.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function Mr(e){return c.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Hr(e){const t={},r=Object.keys(e);let n;const s=r.length;let o;for(n=0;n<s;n++)o=r[n],t[o]=e[o];return t}function it(e){function t(r,n,s,o){let i=r[o++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),p=o>=r.length;return i=!i&&c.isArray(s)?s.length:i,p?(c.hasOwnProp(s,i)?s[i]=[s[i],n]:s[i]=n,!a):((!s[i]||!c.isObject(s[i]))&&(s[i]=[]),t(r,n,s[i],o)&&c.isArray(s[i])&&(s[i]=Hr(s[i])),!a)}if(c.isFormData(e)&&c.isFunction(e.entries)){const r={};return c.forEachEntry(e,(n,s)=>{t(Mr(n),s,r,0)}),r}return null}function qr(e,t,r){if(c.isString(e))try{return(t||JSON.parse)(e),c.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const ae={transitional:ot,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",s=n.indexOf("application/json")>-1,o=c.isObject(t);if(o&&c.isHTMLForm(t)&&(t=new FormData(t)),c.isFormData(t))return s?JSON.stringify(it(t)):t;if(c.isArrayBuffer(t)||c.isBuffer(t)||c.isStream(t)||c.isFile(t)||c.isBlob(t)||c.isReadableStream(t))return t;if(c.isArrayBufferView(t))return t.buffer;if(c.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Br(t,this.formSerializer).toString();if((a=c.isFileList(t))||n.indexOf("multipart/form-data")>-1){const p=this.env&&this.env.FormData;return we(a?{"files[]":t}:t,p&&new p,this.formSerializer)}}return o||s?(r.setContentType("application/json",!1),qr(t)):t}],transformResponse:[function(t){const r=this.transitional||ae.transitional,n=r&&r.forcedJSONParsing,s=this.responseType==="json";if(c.isResponse(t)||c.isReadableStream(t))return t;if(t&&c.isString(t)&&(n&&!this.responseType||s)){const i=!(r&&r.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(a){if(i)throw a.name==="SyntaxError"?b.from(a,b.ERR_BAD_RESPONSE,this,null,this.response):a}}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}}};c.forEach(["delete","get","head","post","put","patch"],e=>{ae.headers[e]={}});const zr=c.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"]),$r=e=>{const t={};let r,n,s;return e&&e.split(`
|
|
68
|
-
`).forEach(function(i){s=i.indexOf(":"),
|
|
69
|
-
`)}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,...r){const n=new this(t);return r.forEach(s=>n.set(s)),n}static accessor(t){const n=(this[at]=this[at]={accessors:{}}).accessors,s=this.prototype;function o(i){const a=ce(i);n[a]||(Kr(s,i),n[a]=!0)}return c.isArray(t)?t.forEach(o):o(t),this}};L.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),c.reduceDescriptors(L.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),c.freezeMethods(L);function Fe(e,t){const r=this||ae,n=t||r,s=L.from(n.headers);let o=n.data;return c.forEach(e,function(a){o=a.call(r,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function ct(e){return!!(e&&e.__CANCEL__)}let le=class extends b{constructor(t,r,n){super(t??"canceled",b.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}};function lt(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new b("Request failed with status code "+r.status,[b.ERR_BAD_REQUEST,b.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Yr(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Xr(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(p){const f=Date.now(),u=n[o];i||(i=f),r[s]=p,n[s]=f;let m=o,g=0;for(;m!==s;)g+=r[m++],m=m%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),f-i<t)return;const A=u&&f-u;return A?Math.round(g*1e3/A):void 0}}function Gr(e,t){let r=0,n=1e3/t,s,o;const i=(f,u=Date.now())=>{r=u,s=null,o&&(clearTimeout(o),o=null),e(...f)};return[(...f)=>{const u=Date.now(),m=u-r;m>=n?i(f,u):(s=f,o||(o=setTimeout(()=>{o=null,i(s)},n-m)))},()=>s&&i(s)]}const Ee=(e,t,r=3)=>{let n=0;const s=Xr(50,250);return Gr(o=>{const i=o.loaded,a=o.lengthComputable?o.total:void 0,p=i-n,f=s(p),u=i<=a;n=i;const m={loaded:i,total:a,progress:a?i/a:void 0,bytes:p,rate:f||void 0,estimated:f&&a&&u?(a-i)/f:void 0,event:o,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(m)},r)},ut=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},ft=e=>(...t)=>c.asap(()=>e(...t)),Zr=F.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,F.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(F.origin),F.navigator&&/(msie|trident)/i.test(F.navigator.userAgent)):()=>!0,Qr=F.hasStandardBrowserEnv?{write(e,t,r,n,s,o,i){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];c.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),c.isString(n)&&a.push(`path=${n}`),c.isString(s)&&a.push(`domain=${s}`),o===!0&&a.push("secure"),c.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.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 en(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function tn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function dt(e,t,r){let n=!en(t);return e&&(n||r==!1)?tn(e,t):t}const pt=e=>e instanceof L?{...e}:e;function K(e,t){t=t||{};const r={};function n(f,u,m,g){return c.isPlainObject(f)&&c.isPlainObject(u)?c.merge.call({caseless:g},f,u):c.isPlainObject(u)?c.merge({},u):c.isArray(u)?u.slice():u}function s(f,u,m,g){if(c.isUndefined(u)){if(!c.isUndefined(f))return n(void 0,f,m,g)}else return n(f,u,m,g)}function o(f,u){if(!c.isUndefined(u))return n(void 0,u)}function i(f,u){if(c.isUndefined(u)){if(!c.isUndefined(f))return n(void 0,f)}else return n(void 0,u)}function a(f,u,m){if(m in t)return n(f,u);if(m in e)return n(void 0,f)}const p={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(f,u,m)=>s(pt(f),pt(u),m,!0)};return c.forEach(Object.keys({...e,...t}),function(u){const m=p[u]||s,g=m(e[u],t[u],u);c.isUndefined(g)&&m!==a||(r[u]=g)}),r}const ht=e=>{const t=K({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:a}=t;if(t.headers=i=L.from(i),t.url=nt(dt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),c.isFormData(r)){if(F.hasStandardBrowserEnv||F.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(c.isFunction(r.getHeaders)){const p=r.getHeaders(),f=["content-type","content-length"];Object.entries(p).forEach(([u,m])=>{f.includes(u.toLowerCase())&&i.set(u,m)})}}if(F.hasStandardBrowserEnv&&(n&&c.isFunction(n)&&(n=n(t)),n||n!==!1&&Zr(t.url))){const p=s&&o&&Qr.read(o);p&&i.set(s,p)}return t},rn=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const s=ht(e);let o=s.data;const i=L.from(s.headers).normalize();let{responseType:a,onUploadProgress:p,onDownloadProgress:f}=s,u,m,g,A,d;function y(){A&&A(),d&&d(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let h=new XMLHttpRequest;h.open(s.method.toUpperCase(),s.url,!0),h.timeout=s.timeout;function _(){if(!h)return;const w=L.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),j={data:!a||a==="text"||a==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:w,config:e,request:h};lt(function(U){r(U),y()},function(U){n(U),y()},j),h=null}"onloadend"in h?h.onloadend=_:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(_)},h.onabort=function(){h&&(n(new b("Request aborted",b.ECONNABORTED,e,h)),h=null)},h.onerror=function(T){const j=T&&T.message?T.message:"Network Error",B=new b(j,b.ERR_NETWORK,e,h);B.event=T||null,n(B),h=null},h.ontimeout=function(){let T=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const j=s.transitional||ot;s.timeoutErrorMessage&&(T=s.timeoutErrorMessage),n(new b(T,j.clarifyTimeoutError?b.ETIMEDOUT:b.ECONNABORTED,e,h)),h=null},o===void 0&&i.setContentType(null),"setRequestHeader"in h&&c.forEach(i.toJSON(),function(T,j){h.setRequestHeader(j,T)}),c.isUndefined(s.withCredentials)||(h.withCredentials=!!s.withCredentials),a&&a!=="json"&&(h.responseType=s.responseType),f&&([g,d]=Ee(f,!0),h.addEventListener("progress",g)),p&&h.upload&&([m,A]=Ee(p),h.upload.addEventListener("progress",m),h.upload.addEventListener("loadend",A)),(s.cancelToken||s.signal)&&(u=w=>{h&&(n(!w||w.type?new le(null,e,h):w),h.abort(),h=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const C=Yr(s.url);if(C&&F.protocols.indexOf(C)===-1){n(new b("Unsupported protocol "+C+":",b.ERR_BAD_REQUEST,e));return}h.send(o||null)})},nn=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,s;const o=function(f){if(!s){s=!0,a();const u=f instanceof Error?f:this.reason;n.abort(u instanceof b?u:new le(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,o(new b(`timeout of ${t}ms exceeded`,b.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(o):f.removeEventListener("abort",o)}),e=null)};e.forEach(f=>f.addEventListener("abort",o));const{signal:p}=n;return p.unsubscribe=()=>c.asap(a),p}},sn=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,s;for(;n<r;)s=n+t,yield e.slice(n,s),n=s},on=async function*(e,t){for await(const r of an(e))yield*sn(r,t)},an=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},mt=(e,t,r,n)=>{const s=on(e,t);let o=0,i,a=p=>{i||(i=!0,n&&n(p))};return new ReadableStream({async pull(p){try{const{done:f,value:u}=await s.next();if(f){a(),p.close();return}let m=u.byteLength;if(r){let g=o+=m;r(g)}p.enqueue(new Uint8Array(u))}catch(f){throw a(f),f}},cancel(p){return a(p),s.return()}},{highWaterMark:2})},yt=64*1024,{isFunction:ge}=c,cn=(({Request:e,Response:t})=>({Request:e,Response:t}))(c.global),{ReadableStream:wt,TextEncoder:bt}=c.global,Et=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ln=e=>{e=c.merge.call({skipUndefined:!0},cn,e);const{fetch:t,Request:r,Response:n}=e,s=t?ge(t):typeof fetch=="function",o=ge(r),i=ge(n);if(!s)return!1;const a=s&&ge(wt),p=s&&(typeof bt=="function"?(d=>y=>d.encode(y))(new bt):async d=>new Uint8Array(await new r(d).arrayBuffer())),f=o&&a&&Et(()=>{let d=!1;const y=new r(F.origin,{body:new wt,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!y}),u=i&&a&&Et(()=>c.isReadableStream(new n("").body)),m={stream:u&&(d=>d.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!m[d]&&(m[d]=(y,h)=>{let _=y&&y[d];if(_)return _.call(y);throw new b(`Response type '${d}' is not supported`,b.ERR_NOT_SUPPORT,h)})});const g=async d=>{if(d==null)return 0;if(c.isBlob(d))return d.size;if(c.isSpecCompliantForm(d))return(await new r(F.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(c.isArrayBufferView(d)||c.isArrayBuffer(d))return d.byteLength;if(c.isURLSearchParams(d)&&(d=d+""),c.isString(d))return(await p(d)).byteLength},A=async(d,y)=>{const h=c.toFiniteNumber(d.getContentLength());return h??g(y)};return async d=>{let{url:y,method:h,data:_,signal:C,cancelToken:w,timeout:T,onDownloadProgress:j,onUploadProgress:B,responseType:U,headers:ue,withCredentials:$="same-origin",fetchOptions:_e}=ht(d),Te=t||fetch;U=U?(U+"").toLowerCase():"text";let J=nn([C,w&&w.toAbortSignal()],T),V=null;const z=J&&J.unsubscribe&&(()=>{J.unsubscribe()});let Q;try{if(B&&f&&h!=="get"&&h!=="head"&&(Q=await A(ue,_))!==0){let l=new r(y,{method:"POST",body:_,duplex:"half"}),E;if(c.isFormData(_)&&(E=l.headers.get("content-type"))&&ue.setContentType(E),l.body){const[O,x]=ut(Q,Ee(ft(B)));_=mt(l.body,yt,O,x)}}c.isString($)||($=$?"include":"omit");const v=o&&"credentials"in r.prototype,fe={..._e,signal:J,method:h.toUpperCase(),headers:ue.normalize().toJSON(),body:_,duplex:"half",credentials:v?$:void 0};V=o&&new r(y,fe);let M=await(o?Te(V,_e):Te(y,fe));const de=u&&(U==="stream"||U==="response");if(u&&(j||de&&z)){const l={};["status","statusText","headers"].forEach(X=>{l[X]=M[X]});const E=c.toFiniteNumber(M.headers.get("content-length")),[O,x]=j&&ut(E,Ee(ft(j),!0))||[];M=new n(mt(M.body,yt,O,()=>{x&&x(),z&&z()}),l)}U=U||"text";let Oe=await m[c.findKey(m,U)||"text"](M,d);return!de&&z&&z(),await new Promise((l,E)=>{lt(l,E,{data:Oe,headers:L.from(M.headers),status:M.status,statusText:M.statusText,config:d,request:V})})}catch(v){throw z&&z(),v&&v.name==="TypeError"&&/Load failed|fetch/i.test(v.message)?Object.assign(new b("Network Error",b.ERR_NETWORK,d,V),{cause:v.cause||v}):b.from(v,v&&v.code,d,V)}}},un=new Map,gt=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:s}=t,o=[n,s,r];let i=o.length,a=i,p,f,u=un;for(;a--;)p=o[a],f=u.get(p),f===void 0&&u.set(p,f=a?new Map:ln(t)),u=f;return f};gt();const De={http:kr,xhr:rn,fetch:{get:gt}};c.forEach(De,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Rt=e=>`- ${e}`,fn=e=>c.isFunction(e)||e===null||e===!1;function dn(e,t){e=c.isArray(e)?e:[e];const{length:r}=e;let n,s;const o={};for(let i=0;i<r;i++){n=e[i];let a;if(s=n,!fn(n)&&(s=De[(a=String(n)).toLowerCase()],s===void 0))throw new b(`Unknown adapter '${a}'`);if(s&&(c.isFunction(s)||(s=s.get(t))))break;o[a||"#"+i]=s}if(!s){const i=Object.entries(o).map(([p,f])=>`adapter ${p} `+(f===!1?"is not supported by the environment":"is not available in the build"));let a=r?i.length>1?`since :
|
|
70
|
-
`+i.map(
|
|
71
|
-
`):" "+
|
|
72
|
-
`+o):n.stack=o}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=K(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:o}=r;n!==void 0&&Se.assertOptions(n,{silentJSONParsing:H.transitional(H.boolean),forcedJSONParsing:H.transitional(H.boolean),clarifyTimeoutError:H.transitional(H.boolean)},!1),s!=null&&(c.isFunction(s)?r.paramsSerializer={serialize:s}:Se.assertOptions(s,{encode:H.function,serialize:H.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Se.assertOptions(r,{baseUrl:H.spelling("baseURL"),withXsrfToken:H.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=o&&c.merge(o.common,o[r.method]);o&&c.forEach(["delete","get","head","post","put","patch","common"],d=>{delete o[d]}),r.headers=L.concat(i,o);const a=[];let p=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(r)===!1||(p=p&&y.synchronous,a.unshift(y.fulfilled,y.rejected))});const f=[];this.interceptors.response.forEach(function(y){f.push(y.fulfilled,y.rejected)});let u,m=0,g;if(!p){const d=[_t.bind(this),void 0];for(d.unshift(...a),d.push(...f),g=d.length,u=Promise.resolve(r);m<g;)u=u.then(d[m++],d[m++]);return u}g=a.length;let A=r;for(;m<g;){const d=a[m++],y=a[m++];try{A=d(A)}catch(h){y.call(this,h);break}}try{u=_t.call(this,A)}catch(d){return Promise.reject(d)}for(m=0,g=f.length;m<g;)u=u.then(f[m++],f[m++]);return u}getUri(t){t=K(this.defaults,t);const r=dt(t.baseURL,t.url,t.allowAbsoluteUrls);return nt(r,t.params,t.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(t){Y.prototype[t]=function(r,n){return this.request(K(n||{},{method:t,url:r,data:(n||{}).data}))}}),c.forEach(["post","put","patch"],function(t){function r(n){return function(o,i,a){return this.request(K(a||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}Y.prototype[t]=r(),Y.prototype[t+"Form"]=r(!0)});let hn=class Lt{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const n=this;this.promise.then(s=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](s);n._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(a=>{n.subscribe(a),o=a}).then(s);return i.cancel=function(){n.unsubscribe(o)},i},t(function(o,i,a){n.reason||(n.reason=new le(o,i,a),r(n.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 r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Lt(function(s){t=s}),cancel:t}}};function mn(e){return function(r){return e.apply(null,r)}}function yn(e){return c.isObject(e)&&e.isAxiosError===!0}const Ue={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(Ue).forEach(([e,t])=>{Ue[t]=e});function At(e){const t=new Y(e),r=$e(Y.prototype.request,t);return c.extend(r,Y.prototype,t,{allOwnKeys:!0}),c.extend(r,t,null,{allOwnKeys:!0}),r.create=function(s){return At(K(e,s))},r}const N=At(ae);N.Axios=Y,N.CanceledError=le,N.CancelToken=hn,N.isCancel=ct,N.VERSION=Tt,N.toFormData=we,N.AxiosError=b,N.Cancel=N.CanceledError,N.all=function(t){return Promise.all(t)},N.spread=mn,N.isAxiosError=yn,N.mergeConfig=K,N.AxiosHeaders=L,N.formToJSON=e=>it(c.isHTMLForm(e)?new FormData(e):e),N.getAdapter=St.getAdapter,N.HttpStatusCode=Ue,N.default=N;const{Axios:Pn,AxiosError:kn,CanceledError:jn,isCancel:Fn,CancelToken:Dn,VERSION:Ln,all:Un,Cancel:vn,isAxiosError:In,spread:Bn,toFormData:Mn,AxiosHeaders:Hn,HttpStatusCode:qn,formToJSON:zn,getAdapter:$n,mergeConfig:Jn}=N,wn="http://localhost:8000/api";class xt{constructor(t,r=wn){Ft(this,"client");this.client=N.create({baseURL:r,headers:{"Content-Type":"application/json","X-API-Key":t},timeout:3e4}),this.client.interceptors.response.use(n=>n,n=>{var s,o;if((s=n.response)!=null&&s.data){const a=((o=n.response.data.response)==null?void 0:o.message)||"An unknown error occurred";throw new Error(a)}else throw n.request?new Error("No response from server. Please check your connection."):new Error(n.message||"Request failed")})}async sendMessage(t,r){try{const n=await this.client.post("/chat/",{question:t,session_id:r});if(n.data.response.status!=="success")throw new Error(n.data.response.message);return n.data.data}catch(n){throw n instanceof Error?n:new Error("Failed to send message")}}async getConversationHistory(t){try{const r=await this.client.get(`/chat/history/${t}/`);if(r.data.response.status!=="success")throw new Error(r.data.response.message);return r.data.data}catch(r){throw r instanceof Error?r:new Error("Failed to load conversation history")}}updateApiKey(t){this.client.defaults.headers.common["X-API-Key"]=t}updateBaseUrl(t){this.client.defaults.baseURL=t}}function ve(e,t){const[r,n]=S.useState(()=>{try{const o=window.localStorage.getItem(e);return o?JSON.parse(o):t}catch(o){return console.warn(`Error reading localStorage key "${e}":`,o),t}});return[r,o=>{try{const i=o instanceof Function?o(r):o;n(i),window.localStorage.setItem(e,JSON.stringify(i))}catch(i){console.warn(`Error setting localStorage key "${e}":`,i)}}]}function Ct(){return`session_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}const bn="customer_support_session_id",En="customer_support_messages";function Nt(e){const{apiKey:t,baseUrl:r,onError:n}=e,[s,o]=ve(En,[]),[i,a]=ve(bn,Ct()),[p,f]=S.useState(!1),[u,m]=S.useState(null),g=S.useRef(null);S.useEffect(()=>{g.current=new xt(t,r)},[t,r]);const A=S.useCallback(()=>{m(null)},[]),d=S.useCallback(async _=>{if(!g.current){const w=new Error("API client not initialized");m(w),n==null||n(w);return}if(!_.trim())return;const C={id:`user_${Date.now()}`,role:"USER",content:_,timestamp:new Date};o(w=>[...w,C]),f(!0),m(null);try{const w=await g.current.sendMessage(_,i),T={id:`assistant_${Date.now()}`,role:"ASSISTANT",content:w.answer,timestamp:new Date,sources:w.sources};o(j=>[...j,T]),w.session_id!==i&&a(w.session_id)}catch(w){const T=w instanceof Error?w:new Error("Failed to send message");m(T),n==null||n(T);const j={id:`error_${Date.now()}`,role:"ASSISTANT",content:`Sorry, I encountered an error: ${T.message}`,timestamp:new Date};o(B=>[...B,j])}finally{f(!1)}},[i,n,o,a]),y=S.useCallback(async()=>{if(!(!g.current||!i)){f(!0),m(null);try{const C=(await g.current.getConversationHistory(i)).messages.map((w,T)=>({id:`${w.role.toLowerCase()}_${T}_${Date.now()}`,role:w.role,content:w.content,timestamp:new Date(w.created_at)}));o(C)}catch(_){const C=_ instanceof Error?_:new Error("Failed to load history");m(C),n==null||n(C)}finally{f(!1)}}},[i,n,o]),h=S.useCallback(()=>{o([]),a(Ct())},[o,a]);return{messages:s,sendMessage:d,isLoading:p,error:u,clearError:A,sessionId:i,loadHistory:y,clearHistory:h}}const Pt=({message:e})=>{const t=e.role==="USER",r=e.timestamp instanceof Date?e.timestamp:new Date(e.timestamp);return R.jsxs("div",{className:`cs-message ${t?"cs-message--user":"cs-message--assistant"}`,children:[R.jsxs("div",{className:"cs-message__content",children:[R.jsx("p",{className:"cs-message__text",children:e.content}),e.sources&&e.sources.length>0&&R.jsxs("div",{className:"cs-message__sources",children:[R.jsx("p",{className:"cs-message__sources-title",children:"Sources:"}),R.jsx("ul",{className:"cs-message__sources-list",children:e.sources.map((n,s)=>R.jsxs("li",{className:"cs-message__source-item",children:[R.jsxs("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",className:"cs-message__source-link",children:[R.jsx(qt,{size:12}),R.jsx("span",{children:n.title})]}),R.jsxs("span",{className:"cs-message__source-similarity",children:[Math.round(n.similarity*100),"% match"]})]},s))})]})]}),R.jsx("time",{className:"cs-message__time",dateTime:r.toISOString(),children:r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})},kt=({onSendMessage:e,isLoading:t,placeholder:r="Type your message..."})=>{const[n,s]=S.useState(""),o=a=>{a.preventDefault(),n.trim()&&!t&&(e(n),s(""))},i=a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),o(a))};return R.jsxs("form",{className:"cs-input",onSubmit:o,children:[R.jsx("textarea",{className:"cs-input__textarea",value:n,onChange:a=>s(a.target.value),onKeyDown:i,placeholder:r,disabled:t,rows:1,"aria-label":"Message input"}),R.jsx("button",{type:"submit",className:"cs-input__button",disabled:!n.trim()||t,"aria-label":"Send message",children:R.jsx(Jt,{size:20})})]})},jt=({messages:e,onSendMessage:t,onClose:r,isLoading:n,error:s,placeholder:o,welcomeMessage:i="Hi! How can I help you today?"})=>{const a=S.useRef(null);return S.useEffect(()=>{var p;(p=a.current)==null||p.scrollIntoView({behavior:"smooth"})},[e]),R.jsxs("div",{className:"cs-window",children:[R.jsxs("div",{className:"cs-window__header",children:[R.jsx("h3",{className:"cs-window__title",children:"Customer Support"}),R.jsx("button",{className:"cs-window__close",onClick:r,"aria-label":"Close chat",children:R.jsx(Vt,{size:20})})]}),R.jsxs("div",{className:"cs-window__messages",children:[e.length===0&&!n&&R.jsx("div",{className:"cs-window__welcome",children:R.jsx("p",{children:i})}),e.map(p=>R.jsx(Pt,{message:p},p.id)),n&&R.jsxs("div",{className:"cs-window__typing",children:[R.jsx(zt,{size:20,className:"cs-window__typing-icon"}),R.jsx("span",{children:"Thinking..."})]}),s&&R.jsx("div",{className:"cs-window__error",children:R.jsx("p",{children:s.message})}),R.jsx("div",{ref:a})]}),R.jsx("div",{className:"cs-window__input-wrapper",children:R.jsx(kt,{onSendMessage:t,isLoading:n,placeholder:o})})]})},gn=({apiKey:e,baseUrl:t,theme:r,position:n="bottom-right",welcomeMessage:s,placeholder:o,className:i="",onError:a,onMessageSent:p,onMessageReceived:f})=>{const[u,m]=S.useState(!1),{messages:g,sendMessage:A,isLoading:d,error:y,clearError:h}=Nt({apiKey:e,baseUrl:t,onError:a});S.useEffect(()=>{if(r){const w=document.documentElement;r.primaryColor&&w.style.setProperty("--cs-primary-color",r.primaryColor),r.secondaryColor&&w.style.setProperty("--cs-secondary-color",r.secondaryColor),r.backgroundColor&&w.style.setProperty("--cs-bg-color",r.backgroundColor),r.textColor&&w.style.setProperty("--cs-text-color",r.textColor),r.fontFamily&&w.style.setProperty("--cs-font-family",r.fontFamily),r.borderRadius&&w.style.setProperty("--cs-border-radius",r.borderRadius),r.buttonColor&&w.style.setProperty("--cs-button-color",r.buttonColor),r.userMessageColor&&w.style.setProperty("--cs-user-message-color",r.userMessageColor),r.assistantMessageColor&&w.style.setProperty("--cs-assistant-message-color",r.assistantMessageColor)}},[r]);const _=async w=>{if(p==null||p(w),await A(w),!y){const T=g[g.length-1];(T==null?void 0:T.role)==="ASSISTANT"&&(f==null||f(T.content))}},C=()=>{m(!u),y&&h()};return R.jsxs("div",{className:`cs-widget cs-widget--${n} ${i}`,children:[u&&R.jsx(jt,{messages:g,onSendMessage:_,onClose:()=>m(!1),isLoading:d,error:y,placeholder:o,welcomeMessage:s}),R.jsxs("button",{className:`cs-widget__toggle ${u?"cs-widget__toggle--open":""}`,onClick:C,"aria-label":u?"Close chat":"Open chat","aria-expanded":u,children:[R.jsx($t,{size:24}),!u&&g.length>0&&R.jsx("span",{className:"cs-widget__badge",children:g.filter(w=>w.role==="ASSISTANT").length})]})]})};P.ChatInput=kt,P.ChatMessage=Pt,P.ChatWindow=jt,P.CustomerSupportAPIClient=xt,P.CustomerSupportWidget=gn,P.useCustomerSupport=Nt,P.useLocalStorage=ve,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})}));
|
|
46
|
+
*/const Ft=J("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Te(e,t){return function(){return e.apply(t,arguments)}}const{toString:Lt}=Object.prototype,{getPrototypeOf:de}=Object,{iterator:Y,toStringTag:Ne}=Symbol,ee=(e=>t=>{const n=Lt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),F=e=>(e=e.toLowerCase(),t=>ee(t)===e),te=e=>t=>typeof t===e,{isArray:H}=Array,v=te("undefined");function V(e){return e!==null&&!v(e)&&e.constructor!==null&&!v(e.constructor)&&x(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const xe=F("ArrayBuffer");function Ut(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&xe(e.buffer),t}const kt=te("string"),x=te("function"),Pe=te("number"),K=e=>e!==null&&typeof e=="object",Bt=e=>e===!0||e===!1,ne=e=>{if(ee(e)!=="object")return!1;const t=de(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Ne in e)&&!(Y in e)},It=e=>{if(!K(e)||V(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},jt=F("Date"),Mt=F("File"),$t=F("Blob"),qt=F("FileList"),Ht=e=>K(e)&&x(e.pipe),vt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||x(e.append)&&((t=ee(e))==="formdata"||t==="object"&&x(e.toString)&&e.toString()==="[object FormData]"))},zt=F("URLSearchParams"),[Jt,Vt,Kt,Wt]=["ReadableStream","Request","Response","Headers"].map(F),Xt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function W(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),H(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(V(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let a;for(r=0;r<i;r++)a=o[r],t.call(null,e[a],a,e)}}function De(e,t){if(V(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 j=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Fe=e=>!v(e)&&e!==j;function pe(){const{caseless:e,skipUndefined:t}=Fe(this)&&this||{},n={},r=(s,o)=>{const i=e&&De(n,o)||o;ne(n[i])&&ne(s)?n[i]=pe(n[i],s):ne(s)?n[i]=pe({},s):H(s)?n[i]=s.slice():(!t||!v(s))&&(n[i]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&W(arguments[s],r);return n}const Gt=(e,t,n,{allOwnKeys:r}={})=>(W(t,(s,o)=>{n&&x(s)?Object.defineProperty(e,o,{value:Te(s,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),Zt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Qt=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Yt=(e,t,n,r)=>{let s,o,i;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=n!==!1&&de(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},en=(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},tn=e=>{if(!e)return null;if(H(e))return e;let t=e.length;if(!Pe(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},nn=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&de(Uint8Array)),rn=(e,t)=>{const r=(e&&e[Y]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},sn=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},on=F("HTMLFormElement"),an=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Le=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),cn=F("RegExp"),Ue=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};W(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},ln=e=>{Ue(e,(t,n)=>{if(x(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(x(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+"'")})}})},un=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return H(e)?r(e):r(String(e).split(t)),n},fn=()=>{},dn=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function pn(e){return!!(e&&x(e.append)&&e[Ne]==="FormData"&&e[Y])}const hn=e=>{const t=new Array(10),n=(r,s)=>{if(K(r)){if(t.indexOf(r)>=0)return;if(V(r))return r;if(!("toJSON"in r)){t[s]=r;const o=H(r)?[]:{};return W(r,(i,a)=>{const d=n(i,s+1);!v(d)&&(o[a]=d)}),t[s]=void 0,o}}return r};return n(e,0)},mn=F("AsyncFunction"),yn=e=>e&&(K(e)||x(e))&&x(e.then)&&x(e.catch),ke=((e,t)=>e?setImmediate:t?((n,r)=>(j.addEventListener("message",({source:s,data:o})=>{s===j&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),j.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",x(j.postMessage)),wn=typeof queueMicrotask<"u"?queueMicrotask.bind(j):typeof process<"u"&&process.nextTick||ke,c={isArray:H,isArrayBuffer:xe,isBuffer:V,isFormData:vt,isArrayBufferView:Ut,isString:kt,isNumber:Pe,isBoolean:Bt,isObject:K,isPlainObject:ne,isEmptyObject:It,isReadableStream:Jt,isRequest:Vt,isResponse:Kt,isHeaders:Wt,isUndefined:v,isDate:jt,isFile:Mt,isBlob:$t,isRegExp:cn,isFunction:x,isStream:Ht,isURLSearchParams:zt,isTypedArray:nn,isFileList:qt,forEach:W,merge:pe,extend:Gt,trim:Xt,stripBOM:Zt,inherits:Qt,toFlatObject:Yt,kindOf:ee,kindOfTest:F,endsWith:en,toArray:tn,forEachEntry:rn,matchAll:sn,isHTMLForm:on,hasOwnProperty:Le,hasOwnProp:Le,reduceDescriptors:Ue,freezeMethods:ln,toObjectSet:un,toCamelCase:an,noop:fn,toFiniteNumber:dn,findKey:De,global:j,isContextDefined:Fe,isSpecCompliantForm:pn,toJSONObject:hn,isAsyncFn:mn,isThenable:yn,setImmediate:ke,asap:wn,isIterable:e=>e!=null&&x(e[Y])};let b=class Ot extends Error{static from(t,n,r,s,o,i){const a=new Ot(t.message,n||t.code,r,s,o);return a.cause=t,a.name=t.name,i&&Object.assign(a,i),a}constructor(t,n,r,s,o){super(t),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),s&&(this.request=s),o&&(this.response=o,this.status=o.status)}toJSON(){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:c.toJSONObject(this.config),code:this.code,status:this.status}}};b.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",b.ERR_BAD_OPTION="ERR_BAD_OPTION",b.ECONNABORTED="ECONNABORTED",b.ETIMEDOUT="ETIMEDOUT",b.ERR_NETWORK="ERR_NETWORK",b.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",b.ERR_DEPRECATED="ERR_DEPRECATED",b.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",b.ERR_BAD_REQUEST="ERR_BAD_REQUEST",b.ERR_CANCELED="ERR_CANCELED",b.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",b.ERR_INVALID_URL="ERR_INVALID_URL";const bn=null;function he(e){return c.isPlainObject(e)||c.isArray(e)}function Be(e){return c.endsWith(e,"[]")?e.slice(0,-2):e}function Ie(e,t,n){return e?e.concat(t).map(function(s,o){return s=Be(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function gn(e){return c.isArray(e)&&!e.some(he)}const En=c.toFlatObject(c,{},null,function(t){return/^is[A-Z]/.test(t)});function re(e,t,n){if(!c.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=c.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,h){return!c.isUndefined(h[m])});const r=n.metaTokens,s=n.visitor||l,o=n.dots,i=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(t);if(!c.isFunction(s))throw new TypeError("visitor must be a function");function u(f){if(f===null)return"";if(c.isDate(f))return f.toISOString();if(c.isBoolean(f))return f.toString();if(!d&&c.isBlob(f))throw new b("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(f)||c.isTypedArray(f)?d&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function l(f,m,h){let E=f;if(f&&!h&&typeof f=="object"){if(c.endsWith(m,"{}"))m=r?m:m.slice(0,-2),f=JSON.stringify(f);else if(c.isArray(f)&&gn(f)||(c.isFileList(f)||c.endsWith(m,"[]"))&&(E=c.toArray(f)))return m=Be(m),E.forEach(function(y,S){!(c.isUndefined(y)||y===null)&&t.append(i===!0?Ie([m],S,o):i===null?m:m+"[]",u(y))}),!1}return he(f)?!0:(t.append(Ie(h,m,o),u(f)),!1)}const p=[],g=Object.assign(En,{defaultVisitor:l,convertValue:u,isVisitable:he});function C(f,m){if(!c.isUndefined(f)){if(p.indexOf(f)!==-1)throw Error("Circular reference detected in "+m.join("."));p.push(f),c.forEach(f,function(E,A){(!(c.isUndefined(E)||E===null)&&s.call(t,E,c.isString(A)?A.trim():A,m,g))===!0&&C(E,m?m.concat(A):[A])}),p.pop()}}if(!c.isObject(e))throw new TypeError("data must be an object");return C(e),t}function je(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function me(e,t){this._pairs=[],e&&re(e,this,t)}const Me=me.prototype;Me.append=function(t,n){this._pairs.push([t,n])},Me.toString=function(t){const n=t?function(r){return t.call(this,r,je)}:je;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Sn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function $e(e,t,n){if(!t)return e;const r=n&&n.encode||Sn,s=c.isFunction(n)?{serialize:n}:n,o=s&&s.serialize;let i;if(o?i=o(t,s):i=c.isURLSearchParams(t)?t.toString():new me(t,s).toString(r),i){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class qe{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){c.forEach(this.handlers,function(r){r!==null&&t(r)})}}const He={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Rn={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:me,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ye=typeof window<"u"&&typeof document<"u",we=typeof navigator=="object"&&navigator||void 0,On=ye&&(!we||["ReactNative","NativeScript","NS"].indexOf(we.product)<0),An=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",_n=ye&&window.location.href||"http://localhost",T={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ye,hasStandardBrowserEnv:On,hasStandardBrowserWebWorkerEnv:An,navigator:we,origin:_n},Symbol.toStringTag,{value:"Module"})),...Rn};function Cn(e,t){return re(e,new T.classes.URLSearchParams,{visitor:function(n,r,s,o){return T.isNode&&c.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function Tn(e){return c.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Nn(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function ve(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),d=o>=n.length;return i=!i&&c.isArray(s)?s.length:i,d?(c.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!a):((!s[i]||!c.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&c.isArray(s[i])&&(s[i]=Nn(s[i])),!a)}if(c.isFormData(e)&&c.isFunction(e.entries)){const n={};return c.forEachEntry(e,(r,s)=>{t(Tn(r),s,n,0)}),n}return null}function xn(e,t,n){if(c.isString(e))try{return(t||JSON.parse)(e),c.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const X={transitional:He,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=c.isObject(t);if(o&&c.isHTMLForm(t)&&(t=new FormData(t)),c.isFormData(t))return s?JSON.stringify(ve(t)):t;if(c.isArrayBuffer(t)||c.isBuffer(t)||c.isStream(t)||c.isFile(t)||c.isBlob(t)||c.isReadableStream(t))return t;if(c.isArrayBufferView(t))return t.buffer;if(c.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Cn(t,this.formSerializer).toString();if((a=c.isFileList(t))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return re(a?{"files[]":t}:t,d&&new d,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),xn(t)):t}],transformResponse:[function(t){const n=this.transitional||X.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(c.isResponse(t)||c.isReadableStream(t))return t;if(t&&c.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(a){if(i)throw a.name==="SyntaxError"?b.from(a,b.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:T.classes.FormData,Blob:T.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],e=>{X.headers[e]={}});const Pn=c.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"]),Dn=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
47
|
+
`).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&Pn[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},ze=Symbol("internals");function G(e){return e&&String(e).trim().toLowerCase()}function se(e){return e===!1||e==null?e:c.isArray(e)?e.map(se):String(e)}function Fn(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 Ln=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function be(e,t,n,r,s){if(c.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!c.isString(t)){if(c.isString(r))return t.indexOf(r)!==-1;if(c.isRegExp(r))return r.test(t)}}function Un(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function kn(e,t){const n=c.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}let P=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(a,d,u){const l=G(d);if(!l)throw new Error("header name must be a non-empty string");const p=c.findKey(s,l);(!p||s[p]===void 0||u===!0||u===void 0&&s[p]!==!1)&&(s[p||d]=se(a))}const i=(a,d)=>c.forEach(a,(u,l)=>o(u,l,d));if(c.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(c.isString(t)&&(t=t.trim())&&!Ln(t))i(Dn(t),n);else if(c.isObject(t)&&c.isIterable(t)){let a={},d,u;for(const l of t){if(!c.isArray(l))throw TypeError("Object iterator must return a key-value pair");a[u=l[0]]=(d=a[u])?c.isArray(d)?[...d,l[1]]:[d,l[1]]:l[1]}i(a,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=G(t),t){const r=c.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Fn(s);if(c.isFunction(n))return n.call(this,s,r);if(c.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=G(t),t){const r=c.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||be(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=G(i),i){const a=c.findKey(r,i);a&&(!n||be(r,r[a],a,n))&&(delete r[a],s=!0)}}return c.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||be(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return c.forEach(this,(s,o)=>{const i=c.findKey(r,o);if(i){n[i]=se(s),delete n[o];return}const a=t?Un(o):String(o).trim();a!==o&&delete n[o],n[a]=se(s),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return c.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&c.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(`
|
|
48
|
+
`)}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[ze]=this[ze]={accessors:{}}).accessors,s=this.prototype;function o(i){const a=G(i);r[a]||(kn(s,i),r[a]=!0)}return c.isArray(t)?t.forEach(o):o(t),this}};P.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),c.reduceDescriptors(P.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),c.freezeMethods(P);function ge(e,t){const n=this||X,r=t||n,s=P.from(r.headers);let o=r.data;return c.forEach(e,function(a){o=a.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function Je(e){return!!(e&&e.__CANCEL__)}let Z=class extends b{constructor(t,n,r){super(t??"canceled",b.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function Ve(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 Bn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function In(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(d){const u=Date.now(),l=r[o];i||(i=u),n[s]=d,r[s]=u;let p=o,g=0;for(;p!==s;)g+=n[p++],p=p%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-i<t)return;const C=l&&u-l;return C?Math.round(g*1e3/C):void 0}}function jn(e,t){let n=0,r=1e3/t,s,o;const i=(u,l=Date.now())=>{n=l,s=null,o&&(clearTimeout(o),o=null),e(...u)};return[(...u)=>{const l=Date.now(),p=l-n;p>=r?i(u,l):(s=u,o||(o=setTimeout(()=>{o=null,i(s)},r-p)))},()=>s&&i(s)]}const oe=(e,t,n=3)=>{let r=0;const s=In(50,250);return jn(o=>{const i=o.loaded,a=o.lengthComputable?o.total:void 0,d=i-r,u=s(d),l=i<=a;r=i;const p={loaded:i,total:a,progress:a?i/a:void 0,bytes:d,rate:u||void 0,estimated:u&&a&&l?(a-i)/u:void 0,event:o,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(p)},n)},Ke=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},We=e=>(...t)=>c.asap(()=>e(...t)),Mn=T.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,T.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(T.origin),T.navigator&&/(msie|trident)/i.test(T.navigator.userAgent)):()=>!0,$n=T.hasStandardBrowserEnv?{write(e,t,n,r,s,o,i){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];c.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),c.isString(r)&&a.push(`path=${r}`),c.isString(s)&&a.push(`domain=${s}`),o===!0&&a.push("secure"),c.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.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 qn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Hn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Xe(e,t,n){let r=!qn(t);return e&&(r||n==!1)?Hn(e,t):t}const Ge=e=>e instanceof P?{...e}:e;function M(e,t){t=t||{};const n={};function r(u,l,p,g){return c.isPlainObject(u)&&c.isPlainObject(l)?c.merge.call({caseless:g},u,l):c.isPlainObject(l)?c.merge({},l):c.isArray(l)?l.slice():l}function s(u,l,p,g){if(c.isUndefined(l)){if(!c.isUndefined(u))return r(void 0,u,p,g)}else return r(u,l,p,g)}function o(u,l){if(!c.isUndefined(l))return r(void 0,l)}function i(u,l){if(c.isUndefined(l)){if(!c.isUndefined(u))return r(void 0,u)}else return r(void 0,l)}function a(u,l,p){if(p in t)return r(u,l);if(p in e)return r(void 0,u)}const d={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(u,l,p)=>s(Ge(u),Ge(l),p,!0)};return c.forEach(Object.keys({...e,...t}),function(l){const p=d[l]||s,g=p(e[l],t[l],l);c.isUndefined(g)&&p!==a||(n[l]=g)}),n}const Ze=e=>{const t=M({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:a}=t;if(t.headers=i=P.from(i),t.url=$e(Xe(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),c.isFormData(n)){if(T.hasStandardBrowserEnv||T.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(c.isFunction(n.getHeaders)){const d=n.getHeaders(),u=["content-type","content-length"];Object.entries(d).forEach(([l,p])=>{u.includes(l.toLowerCase())&&i.set(l,p)})}}if(T.hasStandardBrowserEnv&&(r&&c.isFunction(r)&&(r=r(t)),r||r!==!1&&Mn(t.url))){const d=s&&o&&$n.read(o);d&&i.set(s,d)}return t},vn=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const s=Ze(e);let o=s.data;const i=P.from(s.headers).normalize();let{responseType:a,onUploadProgress:d,onDownloadProgress:u}=s,l,p,g,C,f;function m(){C&&C(),f&&f(),s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(s.method.toUpperCase(),s.url,!0),h.timeout=s.timeout;function E(){if(!h)return;const y=P.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),N={data:!a||a==="text"||a==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:y,config:e,request:h};Ve(function(D){n(D),m()},function(D){r(D),m()},N),h=null}"onloadend"in h?h.onloadend=E:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(E)},h.onabort=function(){h&&(r(new b("Request aborted",b.ECONNABORTED,e,h)),h=null)},h.onerror=function(S){const N=S&&S.message?S.message:"Network Error",k=new b(N,b.ERR_NETWORK,e,h);k.event=S||null,r(k),h=null},h.ontimeout=function(){let S=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const N=s.transitional||He;s.timeoutErrorMessage&&(S=s.timeoutErrorMessage),r(new b(S,N.clarifyTimeoutError?b.ETIMEDOUT:b.ECONNABORTED,e,h)),h=null},o===void 0&&i.setContentType(null),"setRequestHeader"in h&&c.forEach(i.toJSON(),function(S,N){h.setRequestHeader(N,S)}),c.isUndefined(s.withCredentials)||(h.withCredentials=!!s.withCredentials),a&&a!=="json"&&(h.responseType=s.responseType),u&&([g,f]=oe(u,!0),h.addEventListener("progress",g)),d&&h.upload&&([p,C]=oe(d),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",C)),(s.cancelToken||s.signal)&&(l=y=>{h&&(r(!y||y.type?new Z(null,e,h):y),h.abort(),h=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const A=Bn(s.url);if(A&&T.protocols.indexOf(A)===-1){r(new b("Unsupported protocol "+A+":",b.ERR_BAD_REQUEST,e));return}h.send(o||null)})},zn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(u){if(!s){s=!0,a();const l=u instanceof Error?u:this.reason;r.abort(l instanceof b?l:new Z(l instanceof Error?l.message:l))}};let i=t&&setTimeout(()=>{i=null,o(new b(`timeout of ${t}ms exceeded`,b.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:d}=r;return d.unsubscribe=()=>c.asap(a),d}},Jn=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 Kn(e))yield*Jn(n,t)},Kn=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()}},Qe=(e,t,n,r)=>{const s=Vn(e,t);let o=0,i,a=d=>{i||(i=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:u,value:l}=await s.next();if(u){a(),d.close();return}let p=l.byteLength;if(n){let g=o+=p;n(g)}d.enqueue(new Uint8Array(l))}catch(u){throw a(u),u}},cancel(d){return a(d),s.return()}},{highWaterMark:2})},Ye=64*1024,{isFunction:ie}=c,Wn=(({Request:e,Response:t})=>({Request:e,Response:t}))(c.global),{ReadableStream:et,TextEncoder:tt}=c.global,nt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Xn=e=>{e=c.merge.call({skipUndefined:!0},Wn,e);const{fetch:t,Request:n,Response:r}=e,s=t?ie(t):typeof fetch=="function",o=ie(n),i=ie(r);if(!s)return!1;const a=s&&ie(et),d=s&&(typeof tt=="function"?(f=>m=>f.encode(m))(new tt):async f=>new Uint8Array(await new n(f).arrayBuffer())),u=o&&a&&nt(()=>{let f=!1;const m=new n(T.origin,{body:new et,method:"POST",get duplex(){return f=!0,"half"}}).headers.has("Content-Type");return f&&!m}),l=i&&a&&nt(()=>c.isReadableStream(new r("").body)),p={stream:l&&(f=>f.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!p[f]&&(p[f]=(m,h)=>{let E=m&&m[f];if(E)return E.call(m);throw new b(`Response type '${f}' is not supported`,b.ERR_NOT_SUPPORT,h)})});const g=async f=>{if(f==null)return 0;if(c.isBlob(f))return f.size;if(c.isSpecCompliantForm(f))return(await new n(T.origin,{method:"POST",body:f}).arrayBuffer()).byteLength;if(c.isArrayBufferView(f)||c.isArrayBuffer(f))return f.byteLength;if(c.isURLSearchParams(f)&&(f=f+""),c.isString(f))return(await d(f)).byteLength},C=async(f,m)=>{const h=c.toFiniteNumber(f.getContentLength());return h??g(m)};return async f=>{let{url:m,method:h,data:E,signal:A,cancelToken:y,timeout:S,onDownloadProgress:N,onUploadProgress:k,responseType:D,headers:Ae,withCredentials:le="same-origin",fetchOptions:yt}=Ze(f),wt=t||fetch;D=D?(D+"").toLowerCase():"text";let ue=zn([A,y&&y.toAbortSignal()],S),Q=null;const q=ue&&ue.unsubscribe&&(()=>{ue.unsubscribe()});let bt;try{if(k&&u&&h!=="get"&&h!=="head"&&(bt=await C(Ae,E))!==0){let I=new n(m,{method:"POST",body:E,duplex:"half"}),z;if(c.isFormData(E)&&(z=I.headers.get("content-type"))&&Ae.setContentType(z),I.body){const[_e,fe]=Ke(bt,oe(We(k)));E=Qe(I.body,Ye,_e,fe)}}c.isString(le)||(le=le?"include":"omit");const U=o&&"credentials"in n.prototype,gt={...yt,signal:ue,method:h.toUpperCase(),headers:Ae.normalize().toJSON(),body:E,duplex:"half",credentials:U?le:void 0};Q=o&&new n(m,gt);let B=await(o?wt(Q,yt):wt(m,gt));const Et=l&&(D==="stream"||D==="response");if(l&&(N||Et&&q)){const I={};["status","statusText","headers"].forEach(St=>{I[St]=B[St]});const z=c.toFiniteNumber(B.headers.get("content-length")),[_e,fe]=N&&Ke(z,oe(We(N),!0))||[];B=new r(Qe(B.body,Ye,_e,()=>{fe&&fe(),q&&q()}),I)}D=D||"text";let ar=await p[c.findKey(p,D)||"text"](B,f);return!Et&&q&&q(),await new Promise((I,z)=>{Ve(I,z,{data:ar,headers:P.from(B.headers),status:B.status,statusText:B.statusText,config:f,request:Q})})}catch(U){throw q&&q(),U&&U.name==="TypeError"&&/Load failed|fetch/i.test(U.message)?Object.assign(new b("Network Error",b.ERR_NETWORK,f,Q),{cause:U.cause||U}):b.from(U,U&&U.code,f,Q)}}},Gn=new Map,rt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,o=[r,s,n];let i=o.length,a=i,d,u,l=Gn;for(;a--;)d=o[a],u=l.get(d),u===void 0&&l.set(d,u=a?new Map:Xn(t)),l=u;return u};rt();const Ee={http:bn,xhr:vn,fetch:{get:rt}};c.forEach(Ee,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const st=e=>`- ${e}`,Zn=e=>c.isFunction(e)||e===null||e===!1;function Qn(e,t){e=c.isArray(e)?e:[e];const{length:n}=e;let r,s;const o={};for(let i=0;i<n;i++){r=e[i];let a;if(s=r,!Zn(r)&&(s=Ee[(a=String(r)).toLowerCase()],s===void 0))throw new b(`Unknown adapter '${a}'`);if(s&&(c.isFunction(s)||(s=s.get(t))))break;o[a||"#"+i]=s}if(!s){const i=Object.entries(o).map(([d,u])=>`adapter ${d} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=n?i.length>1?`since :
|
|
49
|
+
`+i.map(st).join(`
|
|
50
|
+
`):" "+st(i[0]):"as no adapter specified";throw new b("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s}const ot={getAdapter:Qn,adapters:Ee};function Se(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Z(null,e)}function it(e){return Se(e),e.headers=P.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),ot.getAdapter(e.adapter||X.adapter,e)(e).then(function(r){return Se(e),r.data=ge.call(e,e.transformResponse,r),r.headers=P.from(r.headers),r},function(r){return Je(r)||(Se(e),r&&r.response&&(r.response.data=ge.call(e,e.transformResponse,r.response),r.response.headers=P.from(r.response.headers))),Promise.reject(r)})}const at="1.13.4",ae={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ae[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const ct={};ae.transitional=function(t,n,r){function s(o,i){return"[Axios v"+at+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,a)=>{if(t===!1)throw new b(s(i," has been removed"+(n?" in "+n:"")),b.ERR_DEPRECATED);return n&&!ct[i]&&(ct[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,a):!0}},ae.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Yn(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 o=r[s],i=t[o];if(i){const a=e[o],d=a===void 0||i(a,o,e);if(d!==!0)throw new b("option "+o+" must be "+d,b.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new b("Unknown option "+o,b.ERR_BAD_OPTION)}}const ce={assertOptions:Yn,validators:ae},L=ce.validators;let $=class{constructor(t){this.defaults=t||{},this.interceptors={request:new qe,response:new qe}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
51
|
+
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=M(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&ce.assertOptions(r,{silentJSONParsing:L.transitional(L.boolean),forcedJSONParsing:L.transitional(L.boolean),clarifyTimeoutError:L.transitional(L.boolean)},!1),s!=null&&(c.isFunction(s)?n.paramsSerializer={serialize:s}:ce.assertOptions(s,{encode:L.function,serialize:L.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ce.assertOptions(n,{baseUrl:L.spelling("baseURL"),withXsrfToken:L.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&c.merge(o.common,o[n.method]);o&&c.forEach(["delete","get","head","post","put","patch","common"],f=>{delete o[f]}),n.headers=P.concat(i,o);const a=[];let d=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(d=d&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let l,p=0,g;if(!d){const f=[it.bind(this),void 0];for(f.unshift(...a),f.push(...u),g=f.length,l=Promise.resolve(n);p<g;)l=l.then(f[p++],f[p++]);return l}g=a.length;let C=n;for(;p<g;){const f=a[p++],m=a[p++];try{C=f(C)}catch(h){m.call(this,h);break}}try{l=it.call(this,C)}catch(f){return Promise.reject(f)}for(p=0,g=u.length;p<g;)l=l.then(u[p++],u[p++]);return l}getUri(t){t=M(this.defaults,t);const n=Xe(t.baseURL,t.url,t.allowAbsoluteUrls);return $e(n,t.params,t.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(t){$.prototype[t]=function(n,r){return this.request(M(r||{},{method:t,url:n,data:(r||{}).data}))}}),c.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,a){return this.request(M(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}$.prototype[t]=n(),$.prototype[t+"Form"]=n(!0)});let er=class At{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(a=>{r.subscribe(a),o=a}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,a){r.reason||(r.reason=new Z(o,i,a),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 At(function(s){t=s}),cancel:t}}};function tr(e){return function(n){return e.apply(null,n)}}function nr(e){return c.isObject(e)&&e.isAxiosError===!0}const Re={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(Re).forEach(([e,t])=>{Re[t]=e});function lt(e){const t=new $(e),n=Te($.prototype.request,t);return c.extend(n,$.prototype,t,{allOwnKeys:!0}),c.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return lt(M(e,s))},n}const O=lt(X);O.Axios=$,O.CanceledError=Z,O.CancelToken=er,O.isCancel=Je,O.VERSION=at,O.toFormData=re,O.AxiosError=b,O.Cancel=O.CanceledError,O.all=function(t){return Promise.all(t)},O.spread=tr,O.isAxiosError=nr,O.mergeConfig=M,O.AxiosHeaders=P,O.formToJSON=e=>ve(c.isHTMLForm(e)?new FormData(e):e),O.getAdapter=ot.getAdapter,O.HttpStatusCode=Re,O.default=O;const{Axios:yr,AxiosError:wr,CanceledError:br,isCancel:gr,CancelToken:Er,VERSION:Sr,all:Rr,Cancel:Or,isAxiosError:Ar,spread:_r,toFormData:Cr,AxiosHeaders:Tr,HttpStatusCode:Nr,formToJSON:xr,getAdapter:Pr,mergeConfig:Dr}=O,rr="http://localhost:8000/api";class ut{constructor(t,n=rr){Rt(this,"client");this.client=O.create({baseURL:n,headers:{"Content-Type":"application/json","X-API-Key":t},timeout:3e4}),this.client.interceptors.response.use(r=>r,r=>{var s,o;if((s=r.response)!=null&&s.data){const a=((o=r.response.data.response)==null?void 0:o.message)||"An unknown error occurred";throw new Error(a)}else throw r.request?new Error("No response from server. Please check your connection."):new Error(r.message||"Request failed")})}async sendMessage(t,n){try{const r=await this.client.post("/chat/",{question:t,session_id:n});if(r.data.response.status!=="success")throw new Error(r.data.response.message);return r.data.data}catch(r){throw r instanceof Error?r:new Error("Failed to send message")}}async getConversationHistory(t){try{const n=await this.client.get(`/chat/history/${t}/`);if(n.data.response.status!=="success")throw new Error(n.data.response.message);return n.data.data}catch(n){throw n instanceof Error?n:new Error("Failed to load conversation history")}}updateApiKey(t){this.client.defaults.headers.common["X-API-Key"]=t}updateBaseUrl(t){this.client.defaults.baseURL=t}}function Oe(e,t){const[n,r]=R.useState(()=>{try{const o=window.localStorage.getItem(e);return o?JSON.parse(o):t}catch(o){return console.warn(`Error reading localStorage key "${e}":`,o),t}});return[n,o=>{try{const i=o instanceof Function?o(n):o;r(i),window.localStorage.setItem(e,JSON.stringify(i))}catch(i){console.warn(`Error setting localStorage key "${e}":`,i)}}]}function ft(){return`session_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}const sr="customer_support_session_id",or="customer_support_messages";function dt(e){const{apiKey:t,baseUrl:n,onError:r}=e,[s,o]=Oe(or,[]),[i,a]=Oe(sr,ft()),[d,u]=R.useState(!1),[l,p]=R.useState(null),g=R.useRef(null);R.useEffect(()=>{g.current=new ut(t,n)},[t,n]);const C=R.useCallback(()=>{p(null)},[]),f=R.useCallback(async E=>{if(!g.current){const y=new Error("API client not initialized");p(y),r==null||r(y);return}if(!E.trim())return;const A={id:`user_${Date.now()}`,role:"USER",content:E,timestamp:new Date};o(y=>[...y,A]),u(!0),p(null);try{const y=await g.current.sendMessage(E,i),S={id:`assistant_${Date.now()}`,role:"ASSISTANT",content:y.answer,timestamp:new Date,sources:y.sources};o(N=>[...N,S]),y.session_id!==i&&a(y.session_id)}catch(y){const S=y instanceof Error?y:new Error("Failed to send message");p(S),r==null||r(S);const N={id:`error_${Date.now()}`,role:"ASSISTANT",content:`Sorry, I encountered an error: ${S.message}`,timestamp:new Date};o(k=>[...k,N])}finally{u(!1)}},[i,r,o,a]),m=R.useCallback(async()=>{if(!(!g.current||!i)){u(!0),p(null);try{const A=(await g.current.getConversationHistory(i)).messages.map((y,S)=>({id:`${y.role.toLowerCase()}_${S}_${Date.now()}`,role:y.role,content:y.content,timestamp:new Date(y.created_at)}));o(A)}catch(E){const A=E instanceof Error?E:new Error("Failed to load history");p(A),r==null||r(A)}finally{u(!1)}}},[i,r,o]),h=R.useCallback(()=>{o([]),a(ft())},[o,a]);return{messages:s,sendMessage:f,isLoading:d,error:l,clearError:C,sessionId:i,loadHistory:m,clearHistory:h}}const pt=({message:e})=>{const t=e.role==="USER",n=e.timestamp instanceof Date?e.timestamp:new Date(e.timestamp);return w.jsxs("div",{className:`cs-message ${t?"cs-message--user":"cs-message--assistant"}`,children:[w.jsxs("div",{className:"cs-message__content",children:[w.jsx("p",{className:"cs-message__text",children:e.content}),e.sources&&e.sources.length>0&&w.jsxs("div",{className:"cs-message__sources",children:[w.jsx("p",{className:"cs-message__sources-title",children:"Sources:"}),w.jsx("ul",{className:"cs-message__sources-list",children:e.sources.map((r,s)=>w.jsxs("li",{className:"cs-message__source-item",children:[w.jsxs("a",{href:r.url,target:"_blank",rel:"noopener noreferrer",className:"cs-message__source-link",children:[w.jsx(Nt,{size:12}),w.jsx("span",{children:r.title})]}),w.jsxs("span",{className:"cs-message__source-similarity",children:[Math.round(r.similarity*100),"% match"]})]},s))})]})]}),w.jsx("time",{className:"cs-message__time",dateTime:n.toISOString(),children:n.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})},ht=({onSendMessage:e,isLoading:t,placeholder:n="Type your message..."})=>{const[r,s]=R.useState(""),o=a=>{a.preventDefault(),r.trim()&&!t&&(e(r),s(""))},i=a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),o(a))};return w.jsxs("form",{className:"cs-input",onSubmit:o,children:[w.jsx("textarea",{className:"cs-input__textarea",value:r,onChange:a=>s(a.target.value),onKeyDown:i,placeholder:n,disabled:t,rows:1,"aria-label":"Message input"}),w.jsx("button",{type:"submit",className:"cs-input__button",disabled:!r.trim()||t,"aria-label":"Send message",children:w.jsx(Dt,{size:20})})]})},mt=({messages:e,onSendMessage:t,onClose:n,isLoading:r,error:s,placeholder:o,welcomeMessage:i="Hi! How can I help you today?"})=>{const a=R.useRef(null);return R.useEffect(()=>{var d;(d=a.current)==null||d.scrollIntoView({behavior:"smooth"})},[e]),w.jsxs("div",{className:"cs-window",children:[w.jsxs("div",{className:"cs-window__header",children:[w.jsx("h3",{className:"cs-window__title",children:"Customer Support"}),w.jsx("button",{className:"cs-window__close",onClick:n,"aria-label":"Close chat",children:w.jsx(Ft,{size:20})})]}),w.jsxs("div",{className:"cs-window__messages",children:[e.length===0&&!r&&w.jsx("div",{className:"cs-window__welcome",children:w.jsx("p",{children:i})}),e.map(d=>w.jsx(pt,{message:d},d.id)),r&&w.jsxs("div",{className:"cs-window__typing",children:[w.jsx(xt,{size:20,className:"cs-window__typing-icon"}),w.jsx("span",{children:"Thinking..."})]}),s&&w.jsx("div",{className:"cs-window__error",children:w.jsx("p",{children:s.message})}),w.jsx("div",{ref:a})]}),w.jsx("div",{className:"cs-window__input-wrapper",children:w.jsx(ht,{onSendMessage:t,isLoading:r,placeholder:o})})]})},ir=({apiKey:e,baseUrl:t,theme:n,position:r="bottom-right",welcomeMessage:s,placeholder:o,className:i="",onError:a,onMessageSent:d,onMessageReceived:u})=>{const[l,p]=R.useState(!1),{messages:g,sendMessage:C,isLoading:f,error:m,clearError:h}=dt({apiKey:e,baseUrl:t,onError:a});R.useEffect(()=>{if(n){const y=document.documentElement;n.primaryColor&&y.style.setProperty("--cs-primary-color",n.primaryColor),n.secondaryColor&&y.style.setProperty("--cs-secondary-color",n.secondaryColor),n.backgroundColor&&y.style.setProperty("--cs-bg-color",n.backgroundColor),n.textColor&&y.style.setProperty("--cs-text-color",n.textColor),n.fontFamily&&y.style.setProperty("--cs-font-family",n.fontFamily),n.borderRadius&&y.style.setProperty("--cs-border-radius",n.borderRadius),n.buttonColor&&y.style.setProperty("--cs-button-color",n.buttonColor),n.userMessageColor&&y.style.setProperty("--cs-user-message-color",n.userMessageColor),n.assistantMessageColor&&y.style.setProperty("--cs-assistant-message-color",n.assistantMessageColor)}},[n]);const E=async y=>{if(d==null||d(y),await C(y),!m){const S=g[g.length-1];(S==null?void 0:S.role)==="ASSISTANT"&&(u==null||u(S.content))}},A=()=>{p(!l),m&&h()};return w.jsxs("div",{className:`cs-widget cs-widget--${r} ${i}`,children:[l&&w.jsx(mt,{messages:g,onSendMessage:E,onClose:()=>p(!1),isLoading:f,error:m,placeholder:o,welcomeMessage:s}),w.jsxs("button",{className:`cs-widget__toggle ${l?"cs-widget__toggle--open":""}`,onClick:A,"aria-label":l?"Close chat":"Open chat","aria-expanded":l,children:[w.jsx(Pt,{size:24}),!l&&g.length>0&&w.jsx("span",{className:"cs-widget__badge",children:g.filter(y=>y.role==="ASSISTANT").length})]})]})};_.ChatInput=ht,_.ChatMessage=pt,_.ChatWindow=mt,_.CustomerSupportAPIClient=ut,_.CustomerSupportWidget=ir,_.useCustomerSupport=dt,_.useLocalStorage=Oe,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})}));
|
|
73
52
|
//# sourceMappingURL=index.umd.js.map
|