@xcelsior/ui-chat 2.0.2 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/.storybook/preview.tsx +2 -1
  2. package/dist/index.d.mts +3 -0
  3. package/dist/index.d.ts +3 -0
  4. package/dist/index.js +49 -53
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +77 -81
  7. package/dist/index.mjs.map +1 -1
  8. package/package.json +3 -2
  9. package/src/components/Chat.tsx +35 -74
  10. package/src/components/ChatWidget.tsx +0 -1
  11. package/src/hooks/useMessages.ts +22 -1
  12. package/src/hooks/useWebSocket.ts +18 -1
  13. package/storybook-static/assets/Chat.stories-BkbpOOSG.js +830 -0
  14. package/storybook-static/assets/{Color-YHDXOIA2-BMnd3YrF.js → Color-YHDXOIA2-CSuNIR0a.js} +1 -1
  15. package/storybook-static/assets/{DocsRenderer-CFRXHY34-i_W8iCu9.js → DocsRenderer-CFRXHY34-dpuOKTQp.js} +3 -3
  16. package/storybook-static/assets/{MessageItem-DAaKZ9s9.js → MessageItem-Dlb6dSKL.js} +9 -9
  17. package/storybook-static/assets/MessageItem.stories-CsxqSqu-.js +422 -0
  18. package/storybook-static/assets/{entry-preview-oDnntGcx.js → entry-preview-C_-WO6GJ.js} +1 -1
  19. package/storybook-static/assets/{iframe-CGBtu2Se.js → iframe-BXTccXxS.js} +2 -2
  20. package/storybook-static/assets/preview-B8y-wc-n.css +1 -0
  21. package/storybook-static/assets/preview-CC4t7T7W.js +1 -0
  22. package/storybook-static/assets/{preview-BRpahs9B.js → preview-Cyx3pE7Q.js} +2 -2
  23. package/storybook-static/iframe.html +1 -1
  24. package/storybook-static/index.json +1 -1
  25. package/storybook-static/project.json +1 -1
  26. package/tsconfig.json +4 -0
  27. package/storybook-static/assets/Chat.stories-J_Yp51wU.js +0 -803
  28. package/storybook-static/assets/MessageItem.stories-Ckr1_scc.js +0 -255
  29. package/storybook-static/assets/ToastContext-Bty1K7ya.js +0 -1
  30. package/storybook-static/assets/preview-DUOvJmsz.js +0 -1
  31. package/storybook-static/assets/preview-DcGwT3kv.css +0 -1
@@ -0,0 +1,830 @@
1
+ import{j as p}from"./jsx-runtime-Cf8x2fCZ.js";import{r as y,R as Rs}from"./index--qcDGAq6.js";import{X as Ts,a as Lr,C as Ms}from"./BrandIcons-Cjy5INAp.js";import{M as Ls}from"./MessageItem-Dlb6dSKL.js";import{r as Ps}from"./index-B_4m48Mv.js";import"./index-yBjzXJbu.js";import"./en-US-BukEqXxE.js";import"./index-BLHw34Di.js";function zs(e,t){const[n,r]=y.useState(!1),[s,o]=y.useState(null),[i,a]=y.useState(null),c=y.useRef(null),u=y.useRef(null),l=y.useRef(0),f=y.useRef(null),h=y.useRef(!1),b=5,d=3e3,v=!!t,g=y.useCallback(E=>{f.current&&E.removeEventListener("message",f.current);const L=T=>{var A,O,j;try{const I=JSON.parse(T.data);if(o(I),I.type==="message"&&I.data)(A=e.onMessageReceived)==null||A.call(e,I.data);else if(I.type==="error"){const z=new Error(((O=I.data)==null?void 0:O.message)||"WebSocket error");a(z),(j=e.onError)==null||j.call(e,z)}}catch(I){console.error("Failed to parse WebSocket message:",I)}};return E.addEventListener("message",L),f.current=L,()=>{E.removeEventListener("message",L),f.current===L&&(f.current=null)}},[]),_=y.useCallback(()=>{var E;if(!h.current){console.log("connecting to WebSocket...",e.currentUser,e.conversationId);try{c.current&&(f.current&&(c.current.removeEventListener("message",f.current),f.current=null),c.current.close());const L=new URL(e.websocketUrl);L.searchParams.set("user",JSON.stringify(e.currentUser)),e.conversationId&&L.searchParams.set("conversationId",e.conversationId),e.apiKey&&L.searchParams.set("apiKey",e.apiKey);const T=new WebSocket(L.toString());T.onopen=()=>{var A;if(h.current){T.close(1e3,"Effect cleaned up");return}console.log("WebSocket connected"),r(!0),a(null),l.current=0,(A=e.onConnectionChange)==null||A.call(e,!0)},T.onerror=A=>{var j;if(h.current)return;console.error("WebSocket error:",A);const O=new Error("WebSocket connection error");a(O),(j=e.onError)==null||j.call(e,O)},T.onclose=A=>{var O;h.current||(console.log("WebSocket closed:",A.code,A.reason),r(!1),(O=e.onConnectionChange)==null||O.call(e,!1),c.current=null,A.code!==1e3&&l.current<b&&(l.current+=1,console.log(`Reconnecting... (${l.current}/${b})`),u.current=setTimeout(()=>{_()},d)))},g(T),c.current=T??null}catch(L){console.error("Failed to create WebSocket connection:",L);const T=L instanceof Error?L:new Error("Failed to connect");a(T),(E=e.onError)==null||E.call(e,T)}}},[JSON.stringify([e.currentUser,e.conversationId])]),S=y.useCallback((E,L)=>{var T,A;if(!c.current||c.current.readyState!==WebSocket.OPEN){console.error("WebSocket is not connected"),(T=e.toast)==null||T.error("Not connected to chat server");return}try{c.current.send(JSON.stringify({action:E,data:L}))}catch(O){console.error("Failed to send message:",O);const j=O instanceof Error?O:new Error("Failed to send message");a(j),(A=e.onError)==null||A.call(e,j)}},[e]),k=y.useCallback(()=>{l.current=0,h.current=!1,_()},[_]);return y.useEffect(()=>v?(r((t==null?void 0:t.readyState)===WebSocket.OPEN||!1),c.current=t,g(t)):(h.current=!1,_(),()=>{h.current=!0,u.current&&clearTimeout(u.current),c.current&&(f.current&&(c.current.removeEventListener("message",f.current),f.current=null),c.current.close(1e3,"Component unmounted"))}),[_,v,t,g]),{isConnected:v?(t==null?void 0:t.readyState)===WebSocket.OPEN||!1:n,sendMessage:S,lastMessage:s,error:i,reconnect:k}}function Pr(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ns}=Object.prototype,{getPrototypeOf:Dt}=Object,{iterator:it,toStringTag:zr}=Symbol,at=(e=>t=>{const n=Ns.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ie=e=>(e=e.toLowerCase(),t=>at(t)===e),lt=e=>t=>typeof t===e,{isArray:Ce}=Array,_e=lt("undefined");function Ie(e){return e!==null&&!_e(e)&&e.constructor!==null&&!_e(e.constructor)&&Q(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Nr=ie("ArrayBuffer");function Os(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Nr(e.buffer),t}const As=lt("string"),Q=lt("function"),Or=lt("number"),De=e=>e!==null&&typeof e=="object",Is=e=>e===!0||e===!1,Je=e=>{if(at(e)!=="object")return!1;const t=Dt(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(zr in e)&&!(it in e)},Ds=e=>{if(!De(e)||Ie(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Us=ie("Date"),Bs=ie("File"),Fs=ie("Blob"),Hs=ie("FileList"),qs=e=>De(e)&&Q(e.pipe),Vs=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Q(e.append)&&((t=at(e))==="formdata"||t==="object"&&Q(e.toString)&&e.toString()==="[object FormData]"))},Ws=ie("URLSearchParams"),[Js,Xs,Ks,Gs]=["ReadableStream","Request","Response","Headers"].map(ie),Ys=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ue(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),Ce(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Ie(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 Ar(e,t){if(Ie(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 be=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ir=e=>!_e(e)&&e!==be;function wt(){const{caseless:e,skipUndefined:t}=Ir(this)&&this||{},n={},r=(s,o)=>{const i=e&&Ar(n,o)||o;Je(n[i])&&Je(s)?n[i]=wt(n[i],s):Je(s)?n[i]=wt({},s):Ce(s)?n[i]=s.slice():(!t||!_e(s))&&(n[i]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&Ue(arguments[s],r);return n}const Zs=(e,t,n,{allOwnKeys:r}={})=>(Ue(t,(s,o)=>{n&&Q(s)?e[o]=Pr(s,n):e[o]=s},{allOwnKeys:r}),e),Qs=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),eo=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},to=(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&&Dt(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},no=(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},ro=e=>{if(!e)return null;if(Ce(e))return e;let t=e.length;if(!Or(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},so=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Dt(Uint8Array)),oo=(e,t)=>{const r=(e&&e[it]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},io=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},ao=ie("HTMLFormElement"),lo=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Vt=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),co=ie("RegExp"),Dr=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Ue(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},uo=e=>{Dr(e,(t,n)=>{if(Q(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Q(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+"'")})}})},fo=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return Ce(e)?r(e):r(String(e).split(t)),n},po=()=>{},ho=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function mo(e){return!!(e&&Q(e.append)&&e[zr]==="FormData"&&e[it])}const go=e=>{const t=new Array(10),n=(r,s)=>{if(De(r)){if(t.indexOf(r)>=0)return;if(Ie(r))return r;if(!("toJSON"in r)){t[s]=r;const o=Ce(r)?[]:{};return Ue(r,(i,a)=>{const c=n(i,s+1);!_e(c)&&(o[a]=c)}),t[s]=void 0,o}}return r};return n(e,0)},bo=ie("AsyncFunction"),vo=e=>e&&(De(e)||Q(e))&&Q(e.then)&&Q(e.catch),Ur=((e,t)=>e?setImmediate:t?((n,r)=>(be.addEventListener("message",({source:s,data:o})=>{s===be&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),be.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Q(be.postMessage)),yo=typeof queueMicrotask<"u"?queueMicrotask.bind(be):typeof process<"u"&&process.nextTick||Ur,xo=e=>e!=null&&Q(e[it]),m={isArray:Ce,isArrayBuffer:Nr,isBuffer:Ie,isFormData:Vs,isArrayBufferView:Os,isString:As,isNumber:Or,isBoolean:Is,isObject:De,isPlainObject:Je,isEmptyObject:Ds,isReadableStream:Js,isRequest:Xs,isResponse:Ks,isHeaders:Gs,isUndefined:_e,isDate:Us,isFile:Bs,isBlob:Fs,isRegExp:co,isFunction:Q,isStream:qs,isURLSearchParams:Ws,isTypedArray:so,isFileList:Hs,forEach:Ue,merge:wt,extend:Zs,trim:Ys,stripBOM:Qs,inherits:eo,toFlatObject:to,kindOf:at,kindOfTest:ie,endsWith:no,toArray:ro,forEachEntry:oo,matchAll:io,isHTMLForm:ao,hasOwnProperty:Vt,hasOwnProp:Vt,reduceDescriptors:Dr,freezeMethods:uo,toObjectSet:fo,toCamelCase:lo,noop:po,toFiniteNumber:ho,findKey:Ar,global:be,isContextDefined:Ir,isSpecCompliantForm:mo,toJSONObject:go,isAsyncFn:bo,isThenable:vo,setImmediate:Ur,asap:yo,isIterable:xo};function N(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}m.inherits(N,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:m.toJSONObject(this.config),code:this.code,status:this.status}}});const Br=N.prototype,Fr={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Fr[e]={value:e}});Object.defineProperties(N,Fr);Object.defineProperty(Br,"isAxiosError",{value:!0});N.from=(e,t,n,r,s,o)=>{const i=Object.create(Br);m.toFlatObject(e,i,function(l){return l!==Error.prototype},u=>u!=="isAxiosError");const a=e&&e.message?e.message:"Error",c=t==null&&e?e.code:t;return N.call(i,a,c,n,r,s),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",o&&Object.assign(i,o),i};const _o=null;function kt(e){return m.isPlainObject(e)||m.isArray(e)}function Hr(e){return m.endsWith(e,"[]")?e.slice(0,-2):e}function Wt(e,t,n){return e?e.concat(t).map(function(s,o){return s=Hr(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function wo(e){return m.isArray(e)&&!e.some(kt)}const ko=m.toFlatObject(m,{},null,function(t){return/^is[A-Z]/.test(t)});function ct(e,t,n){if(!m.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=m.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,g){return!m.isUndefined(g[v])});const r=n.metaTokens,s=n.visitor||l,o=n.dots,i=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&m.isSpecCompliantForm(t);if(!m.isFunction(s))throw new TypeError("visitor must be a function");function u(d){if(d===null)return"";if(m.isDate(d))return d.toISOString();if(m.isBoolean(d))return d.toString();if(!c&&m.isBlob(d))throw new N("Blob is not supported. Use a Buffer instead.");return m.isArrayBuffer(d)||m.isTypedArray(d)?c&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function l(d,v,g){let _=d;if(d&&!g&&typeof d=="object"){if(m.endsWith(v,"{}"))v=r?v:v.slice(0,-2),d=JSON.stringify(d);else if(m.isArray(d)&&wo(d)||(m.isFileList(d)||m.endsWith(v,"[]"))&&(_=m.toArray(d)))return v=Hr(v),_.forEach(function(k,w){!(m.isUndefined(k)||k===null)&&t.append(i===!0?Wt([v],w,o):i===null?v:v+"[]",u(k))}),!1}return kt(d)?!0:(t.append(Wt(g,v,o),u(d)),!1)}const f=[],h=Object.assign(ko,{defaultVisitor:l,convertValue:u,isVisitable:kt});function b(d,v){if(!m.isUndefined(d)){if(f.indexOf(d)!==-1)throw Error("Circular reference detected in "+v.join("."));f.push(d),m.forEach(d,function(_,S){(!(m.isUndefined(_)||_===null)&&s.call(t,_,m.isString(S)?S.trim():S,v,h))===!0&&b(_,v?v.concat(S):[S])}),f.pop()}}if(!m.isObject(e))throw new TypeError("data must be an object");return b(e),t}function Jt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Ut(e,t){this._pairs=[],e&&ct(e,this,t)}const qr=Ut.prototype;qr.append=function(t,n){this._pairs.push([t,n])};qr.toString=function(t){const n=t?function(r){return t.call(this,r,Jt)}:Jt;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Co(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Vr(e,t,n){if(!t)return e;const r=n&&n.encode||Co;m.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(s?o=s(t,n):o=m.isURLSearchParams(t)?t.toString():new Ut(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Xt{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){m.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Wr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},So=typeof URLSearchParams<"u"?URLSearchParams:Ut,$o=typeof FormData<"u"?FormData:null,Eo=typeof Blob<"u"?Blob:null,jo={isBrowser:!0,classes:{URLSearchParams:So,FormData:$o,Blob:Eo},protocols:["http","https","file","blob","url","data"]},Bt=typeof window<"u"&&typeof document<"u",Ct=typeof navigator=="object"&&navigator||void 0,Ro=Bt&&(!Ct||["ReactNative","NativeScript","NS"].indexOf(Ct.product)<0),To=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Mo=Bt&&window.location.href||"http://localhost",Lo=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Bt,hasStandardBrowserEnv:Ro,hasStandardBrowserWebWorkerEnv:To,navigator:Ct,origin:Mo},Symbol.toStringTag,{value:"Module"})),Y={...Lo,...jo};function Po(e,t){return ct(e,new Y.classes.URLSearchParams,{visitor:function(n,r,s,o){return Y.isNode&&m.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function zo(e){return m.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function No(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 Jr(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),c=o>=n.length;return i=!i&&m.isArray(s)?s.length:i,c?(m.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!a):((!s[i]||!m.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&m.isArray(s[i])&&(s[i]=No(s[i])),!a)}if(m.isFormData(e)&&m.isFunction(e.entries)){const n={};return m.forEachEntry(e,(r,s)=>{t(zo(r),s,n,0)}),n}return null}function Oo(e,t,n){if(m.isString(e))try{return(t||JSON.parse)(e),m.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Be={transitional:Wr,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=m.isObject(t);if(o&&m.isHTMLForm(t)&&(t=new FormData(t)),m.isFormData(t))return s?JSON.stringify(Jr(t)):t;if(m.isArrayBuffer(t)||m.isBuffer(t)||m.isStream(t)||m.isFile(t)||m.isBlob(t)||m.isReadableStream(t))return t;if(m.isArrayBufferView(t))return t.buffer;if(m.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 Po(t,this.formSerializer).toString();if((a=m.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return ct(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),Oo(t)):t}],transformResponse:[function(t){const n=this.transitional||Be.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(m.isResponse(t)||m.isReadableStream(t))return t;if(t&&m.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"?N.from(a,N.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:Y.classes.FormData,Blob:Y.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};m.forEach(["delete","get","head","post","put","patch"],e=>{Be.headers[e]={}});const Ao=m.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"]),Io=e=>{const t={};let n,r,s;return e&&e.split(`
2
+ `).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&Ao[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Kt=Symbol("internals");function $e(e){return e&&String(e).trim().toLowerCase()}function Xe(e){return e===!1||e==null?e:m.isArray(e)?e.map(Xe):String(e)}function Do(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 Uo=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function pt(e,t,n,r,s){if(m.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!m.isString(t)){if(m.isString(r))return t.indexOf(r)!==-1;if(m.isRegExp(r))return r.test(t)}}function Bo(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Fo(e,t){const n=m.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 ee=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(a,c,u){const l=$e(c);if(!l)throw new Error("header name must be a non-empty string");const f=m.findKey(s,l);(!f||s[f]===void 0||u===!0||u===void 0&&s[f]!==!1)&&(s[f||c]=Xe(a))}const i=(a,c)=>m.forEach(a,(u,l)=>o(u,l,c));if(m.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(m.isString(t)&&(t=t.trim())&&!Uo(t))i(Io(t),n);else if(m.isObject(t)&&m.isIterable(t)){let a={},c,u;for(const l of t){if(!m.isArray(l))throw TypeError("Object iterator must return a key-value pair");a[u=l[0]]=(c=a[u])?m.isArray(c)?[...c,l[1]]:[c,l[1]]:l[1]}i(a,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=$e(t),t){const r=m.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Do(s);if(m.isFunction(n))return n.call(this,s,r);if(m.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=$e(t),t){const r=m.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||pt(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=$e(i),i){const a=m.findKey(r,i);a&&(!n||pt(r,r[a],a,n))&&(delete r[a],s=!0)}}return m.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||pt(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return m.forEach(this,(s,o)=>{const i=m.findKey(r,o);if(i){n[i]=Xe(s),delete n[o];return}const a=t?Bo(o):String(o).trim();a!==o&&delete n[o],n[a]=Xe(s),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return m.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&m.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
3
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Kt]=this[Kt]={accessors:{}}).accessors,s=this.prototype;function o(i){const a=$e(i);r[a]||(Fo(s,i),r[a]=!0)}return m.isArray(t)?t.forEach(o):o(t),this}};ee.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);m.reduceDescriptors(ee.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});m.freezeMethods(ee);function ht(e,t){const n=this||Be,r=t||n,s=ee.from(r.headers);let o=r.data;return m.forEach(e,function(a){o=a.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function Xr(e){return!!(e&&e.__CANCEL__)}function Se(e,t,n){N.call(this,e??"canceled",N.ERR_CANCELED,t,n),this.name="CanceledError"}m.inherits(Se,N,{__CANCEL__:!0});function Kr(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new N("Request failed with status code "+n.status,[N.ERR_BAD_REQUEST,N.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Ho(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function qo(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(c){const u=Date.now(),l=r[o];i||(i=u),n[s]=c,r[s]=u;let f=o,h=0;for(;f!==s;)h+=n[f++],f=f%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-i<t)return;const b=l&&u-l;return b?Math.round(h*1e3/b):void 0}}function Vo(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(),f=l-n;f>=r?i(u,l):(s=u,o||(o=setTimeout(()=>{o=null,i(s)},r-f)))},()=>s&&i(s)]}const Ze=(e,t,n=3)=>{let r=0;const s=qo(50,250);return Vo(o=>{const i=o.loaded,a=o.lengthComputable?o.total:void 0,c=i-r,u=s(c),l=i<=a;r=i;const f={loaded:i,total:a,progress:a?i/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a&&l?(a-i)/u:void 0,event:o,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(f)},n)},Gt=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Yt=e=>(...t)=>m.asap(()=>e(...t)),Wo=Y.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Y.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Y.origin),Y.navigator&&/(msie|trident)/i.test(Y.navigator.userAgent)):()=>!0,Jo=Y.hasStandardBrowserEnv?{write(e,t,n,r,s,o,i){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];m.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),m.isString(r)&&a.push(`path=${r}`),m.isString(s)&&a.push(`domain=${s}`),o===!0&&a.push("secure"),m.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 Xo(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Ko(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Gr(e,t,n){let r=!Xo(t);return e&&(r||n==!1)?Ko(e,t):t}const Zt=e=>e instanceof ee?{...e}:e;function ye(e,t){t=t||{};const n={};function r(u,l,f,h){return m.isPlainObject(u)&&m.isPlainObject(l)?m.merge.call({caseless:h},u,l):m.isPlainObject(l)?m.merge({},l):m.isArray(l)?l.slice():l}function s(u,l,f,h){if(m.isUndefined(l)){if(!m.isUndefined(u))return r(void 0,u,f,h)}else return r(u,l,f,h)}function o(u,l){if(!m.isUndefined(l))return r(void 0,l)}function i(u,l){if(m.isUndefined(l)){if(!m.isUndefined(u))return r(void 0,u)}else return r(void 0,l)}function a(u,l,f){if(f in t)return r(u,l);if(f in e)return r(void 0,u)}const c={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,f)=>s(Zt(u),Zt(l),f,!0)};return m.forEach(Object.keys({...e,...t}),function(l){const f=c[l]||s,h=f(e[l],t[l],l);m.isUndefined(h)&&f!==a||(n[l]=h)}),n}const Yr=e=>{const t=ye({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:a}=t;if(t.headers=i=ee.from(i),t.url=Vr(Gr(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),m.isFormData(n)){if(Y.hasStandardBrowserEnv||Y.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(m.isFunction(n.getHeaders)){const c=n.getHeaders(),u=["content-type","content-length"];Object.entries(c).forEach(([l,f])=>{u.includes(l.toLowerCase())&&i.set(l,f)})}}if(Y.hasStandardBrowserEnv&&(r&&m.isFunction(r)&&(r=r(t)),r||r!==!1&&Wo(t.url))){const c=s&&o&&Jo.read(o);c&&i.set(s,c)}return t},Go=typeof XMLHttpRequest<"u",Yo=Go&&function(e){return new Promise(function(n,r){const s=Yr(e);let o=s.data;const i=ee.from(s.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:u}=s,l,f,h,b,d;function v(){b&&b(),d&&d(),s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let g=new XMLHttpRequest;g.open(s.method.toUpperCase(),s.url,!0),g.timeout=s.timeout;function _(){if(!g)return;const k=ee.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),E={data:!a||a==="text"||a==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:k,config:e,request:g};Kr(function(T){n(T),v()},function(T){r(T),v()},E),g=null}"onloadend"in g?g.onloadend=_:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(_)},g.onabort=function(){g&&(r(new N("Request aborted",N.ECONNABORTED,e,g)),g=null)},g.onerror=function(w){const E=w&&w.message?w.message:"Network Error",L=new N(E,N.ERR_NETWORK,e,g);L.event=w||null,r(L),g=null},g.ontimeout=function(){let w=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const E=s.transitional||Wr;s.timeoutErrorMessage&&(w=s.timeoutErrorMessage),r(new N(w,E.clarifyTimeoutError?N.ETIMEDOUT:N.ECONNABORTED,e,g)),g=null},o===void 0&&i.setContentType(null),"setRequestHeader"in g&&m.forEach(i.toJSON(),function(w,E){g.setRequestHeader(E,w)}),m.isUndefined(s.withCredentials)||(g.withCredentials=!!s.withCredentials),a&&a!=="json"&&(g.responseType=s.responseType),u&&([h,d]=Ze(u,!0),g.addEventListener("progress",h)),c&&g.upload&&([f,b]=Ze(c),g.upload.addEventListener("progress",f),g.upload.addEventListener("loadend",b)),(s.cancelToken||s.signal)&&(l=k=>{g&&(r(!k||k.type?new Se(null,e,g):k),g.abort(),g=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const S=Ho(s.url);if(S&&Y.protocols.indexOf(S)===-1){r(new N("Unsupported protocol "+S+":",N.ERR_BAD_REQUEST,e));return}g.send(o||null)})},Zo=(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 N?l:new Se(l instanceof Error?l.message:l))}};let i=t&&setTimeout(()=>{i=null,o(new N(`timeout ${t} of ms exceeded`,N.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:c}=r;return c.unsubscribe=()=>m.asap(a),c}},Qo=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},ei=async function*(e,t){for await(const n of ti(e))yield*Qo(n,t)},ti=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()}},Qt=(e,t,n,r)=>{const s=ei(e,t);let o=0,i,a=c=>{i||(i=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:u,value:l}=await s.next();if(u){a(),c.close();return}let f=l.byteLength;if(n){let h=o+=f;n(h)}c.enqueue(new Uint8Array(l))}catch(u){throw a(u),u}},cancel(c){return a(c),s.return()}},{highWaterMark:2})},en=64*1024,{isFunction:Fe}=m,ni=(({Request:e,Response:t})=>({Request:e,Response:t}))(m.global),{ReadableStream:tn,TextEncoder:nn}=m.global,rn=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ri=e=>{e=m.merge.call({skipUndefined:!0},ni,e);const{fetch:t,Request:n,Response:r}=e,s=t?Fe(t):typeof fetch=="function",o=Fe(n),i=Fe(r);if(!s)return!1;const a=s&&Fe(tn),c=s&&(typeof nn=="function"?(d=>v=>d.encode(v))(new nn):async d=>new Uint8Array(await new n(d).arrayBuffer())),u=o&&a&&rn(()=>{let d=!1;const v=new n(Y.origin,{body:new tn,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!v}),l=i&&a&&rn(()=>m.isReadableStream(new r("").body)),f={stream:l&&(d=>d.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!f[d]&&(f[d]=(v,g)=>{let _=v&&v[d];if(_)return _.call(v);throw new N(`Response type '${d}' is not supported`,N.ERR_NOT_SUPPORT,g)})});const h=async d=>{if(d==null)return 0;if(m.isBlob(d))return d.size;if(m.isSpecCompliantForm(d))return(await new n(Y.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(m.isArrayBufferView(d)||m.isArrayBuffer(d))return d.byteLength;if(m.isURLSearchParams(d)&&(d=d+""),m.isString(d))return(await c(d)).byteLength},b=async(d,v)=>{const g=m.toFiniteNumber(d.getContentLength());return g??h(v)};return async d=>{let{url:v,method:g,data:_,signal:S,cancelToken:k,timeout:w,onDownloadProgress:E,onUploadProgress:L,responseType:T,headers:A,withCredentials:O="same-origin",fetchOptions:j}=Yr(d),I=t||fetch;T=T?(T+"").toLowerCase():"text";let z=Zo([S,k&&k.toAbortSignal()],w),C=null;const P=z&&z.unsubscribe&&(()=>{z.unsubscribe()});let U;try{if(L&&u&&g!=="get"&&g!=="head"&&(U=await b(A,_))!==0){let J=new n(v,{method:"POST",body:_,duplex:"half"}),Z;if(m.isFormData(_)&&(Z=J.headers.get("content-type"))&&A.setContentType(Z),J.body){const[X,W]=Gt(U,Ze(Yt(L)));_=Qt(J.body,en,X,W)}}m.isString(O)||(O=O?"include":"omit");const M=o&&"credentials"in n.prototype,q={...j,signal:z,method:g.toUpperCase(),headers:A.normalize().toJSON(),body:_,duplex:"half",credentials:M?O:void 0};C=o&&new n(v,q);let B=await(o?I(C,j):I(v,q));const te=l&&(T==="stream"||T==="response");if(l&&(E||te&&P)){const J={};["status","statusText","headers"].forEach(ne=>{J[ne]=B[ne]});const Z=m.toFiniteNumber(B.headers.get("content-length")),[X,W]=E&&Gt(Z,Ze(Yt(E),!0))||[];B=new r(Qt(B.body,en,X,()=>{W&&W(),P&&P()}),J)}T=T||"text";let ue=await f[m.findKey(f,T)||"text"](B,d);return!te&&P&&P(),await new Promise((J,Z)=>{Kr(J,Z,{data:ue,headers:ee.from(B.headers),status:B.status,statusText:B.statusText,config:d,request:C})})}catch(M){throw P&&P(),M&&M.name==="TypeError"&&/Load failed|fetch/i.test(M.message)?Object.assign(new N("Network Error",N.ERR_NETWORK,d,C),{cause:M.cause||M}):N.from(M,M&&M.code,d,C)}}},si=new Map,Zr=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,o=[r,s,n];let i=o.length,a=i,c,u,l=si;for(;a--;)c=o[a],u=l.get(c),u===void 0&&l.set(c,u=a?new Map:ri(t)),l=u;return u};Zr();const Ft={http:_o,xhr:Yo,fetch:{get:Zr}};m.forEach(Ft,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const sn=e=>`- ${e}`,oi=e=>m.isFunction(e)||e===null||e===!1;function ii(e,t){e=m.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,!oi(r)&&(s=Ft[(a=String(r)).toLowerCase()],s===void 0))throw new N(`Unknown adapter '${a}'`);if(s&&(m.isFunction(s)||(s=s.get(t))))break;o[a||"#"+i]=s}if(!s){const i=Object.entries(o).map(([c,u])=>`adapter ${c} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=n?i.length>1?`since :
4
+ `+i.map(sn).join(`
5
+ `):" "+sn(i[0]):"as no adapter specified";throw new N("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s}const Qr={getAdapter:ii,adapters:Ft};function mt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Se(null,e)}function on(e){return mt(e),e.headers=ee.from(e.headers),e.data=ht.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Qr.getAdapter(e.adapter||Be.adapter,e)(e).then(function(r){return mt(e),r.data=ht.call(e,e.transformResponse,r),r.headers=ee.from(r.headers),r},function(r){return Xr(r)||(mt(e),r&&r.response&&(r.response.data=ht.call(e,e.transformResponse,r.response),r.response.headers=ee.from(r.response.headers))),Promise.reject(r)})}const es="1.13.2",ut={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ut[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const an={};ut.transitional=function(t,n,r){function s(o,i){return"[Axios v"+es+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,a)=>{if(t===!1)throw new N(s(i," has been removed"+(n?" in "+n:"")),N.ERR_DEPRECATED);return n&&!an[i]&&(an[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}};ut.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function ai(e,t,n){if(typeof e!="object")throw new N("options must be an object",N.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],c=a===void 0||i(a,o,e);if(c!==!0)throw new N("option "+o+" must be "+c,N.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new N("Unknown option "+o,N.ERR_BAD_OPTION)}}const Ke={assertOptions:ai,validators:ut},ae=Ke.validators;let ve=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Xt,response:new Xt}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
+ `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ye(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&Ke.assertOptions(r,{silentJSONParsing:ae.transitional(ae.boolean),forcedJSONParsing:ae.transitional(ae.boolean),clarifyTimeoutError:ae.transitional(ae.boolean)},!1),s!=null&&(m.isFunction(s)?n.paramsSerializer={serialize:s}:Ke.assertOptions(s,{encode:ae.function,serialize:ae.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Ke.assertOptions(n,{baseUrl:ae.spelling("baseURL"),withXsrfToken:ae.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&m.merge(o.common,o[n.method]);o&&m.forEach(["delete","get","head","post","put","patch","common"],d=>{delete o[d]}),n.headers=ee.concat(i,o);const a=[];let c=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(n)===!1||(c=c&&v.synchronous,a.unshift(v.fulfilled,v.rejected))});const u=[];this.interceptors.response.forEach(function(v){u.push(v.fulfilled,v.rejected)});let l,f=0,h;if(!c){const d=[on.bind(this),void 0];for(d.unshift(...a),d.push(...u),h=d.length,l=Promise.resolve(n);f<h;)l=l.then(d[f++],d[f++]);return l}h=a.length;let b=n;for(;f<h;){const d=a[f++],v=a[f++];try{b=d(b)}catch(g){v.call(this,g);break}}try{l=on.call(this,b)}catch(d){return Promise.reject(d)}for(f=0,h=u.length;f<h;)l=l.then(u[f++],u[f++]);return l}getUri(t){t=ye(this.defaults,t);const n=Gr(t.baseURL,t.url,t.allowAbsoluteUrls);return Vr(n,t.params,t.paramsSerializer)}};m.forEach(["delete","get","head","options"],function(t){ve.prototype[t]=function(n,r){return this.request(ye(r||{},{method:t,url:n,data:(r||{}).data}))}});m.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,a){return this.request(ye(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}ve.prototype[t]=n(),ve.prototype[t+"Form"]=n(!0)});let li=class ts{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 Se(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 ts(function(s){t=s}),cancel:t}}};function ci(e){return function(n){return e.apply(null,n)}}function ui(e){return m.isObject(e)&&e.isAxiosError===!0}const St={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(St).forEach(([e,t])=>{St[t]=e});function ns(e){const t=new ve(e),n=Pr(ve.prototype.request,t);return m.extend(n,ve.prototype,t,{allOwnKeys:!0}),m.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return ns(ye(e,s))},n}const H=ns(Be);H.Axios=ve;H.CanceledError=Se;H.CancelToken=li;H.isCancel=Xr;H.VERSION=es;H.toFormData=ct;H.AxiosError=N;H.Cancel=H.CanceledError;H.all=function(t){return Promise.all(t)};H.spread=ci;H.isAxiosError=ui;H.mergeConfig=ye;H.AxiosHeaders=ee;H.formToJSON=e=>Jr(m.isHTMLForm(e)?new FormData(e):e);H.getAdapter=Qr.getAdapter;H.HttpStatusCode=St;H.default=H;const{Axios:$a,AxiosError:Ea,CanceledError:ja,isCancel:Ra,CancelToken:Ta,VERSION:Ma,all:La,Cancel:Pa,isAxiosError:za,spread:Na,toFormData:Oa,AxiosHeaders:Aa,HttpStatusCode:Ia,formToJSON:Da,getAdapter:Ua,mergeConfig:Ba}=H;async function ln(e,t,n){var r,s,o,i;try{const a=await H.get(`${e}/messages`,{params:{conversationId:t.conversationId,limit:t.limit||50,pageToken:t.pageToken},headers:{"Content-Type":"application/json",...n}});return{data:a.data.data??[],nextPageToken:(r=a.data.pagination)==null?void 0:r.nextPageToken}}catch(a){throw H.isAxiosError(a)?new Error(((i=(o=(s=a.response)==null?void 0:s.data)==null?void 0:o.error)==null?void 0:i.message)||a.message||"Failed to fetch messages"):a}}const di=45e3;function fi(e,t){const[n,r]=y.useState([]),[s,o]=y.useState(!1),[i,a]=y.useState(null),[c,u]=y.useState(void 0),[l,f]=y.useState(!0),[h,b]=y.useState(!1),[d,v]=y.useState(!1),g=y.useRef(null),{httpApiUrl:_,conversationId:S,headers:k,onError:w,toast:E}=t,L=y.useMemo(()=>({...k,"x-api-key":t.apiKey}),[k,t.apiKey]);y.useEffect(()=>{(async()=>{if(!(!_||!S)){o(!0),a(null);try{const C=await ln(_,{conversationId:S,limit:20},L);r(C.data),u(C.nextPageToken),f(!!C.nextPageToken)}catch(C){const P=C instanceof Error?C:new Error("Failed to load messages");a(P),w==null||w(P),E==null||E.error("Failed to load existing messages")}finally{o(!1)}}})()},[S,_,L,w,E]);const{onMessageReceived:T}=t;y.useEffect(()=>{var z;if(((z=e.lastMessage)==null?void 0:z.type)==="message"&&e.lastMessage.data){const C=e.lastMessage.data;if(S&&C.conversationId!==S)return;r(P=>P.some(U=>U.id===C.id)?P:[...P,C]),(C.senderType==="bot"||C.senderType==="system")&&(v(!1),g.current&&(clearTimeout(g.current),g.current=null)),T==null||T(C)}},[e.lastMessage,T,S]);const A=y.useCallback(z=>{r(C=>C.some(P=>P.id===z.id)?C:[...C,z]),z.senderType==="customer"&&(v(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{v(!1)},di))},[]),O=y.useCallback((z,C)=>{r(P=>P.map(U=>U.id===z?{...U,status:C}:U))},[]),j=y.useCallback(()=>{r([])},[]),I=y.useCallback(async()=>{if(!(!l||h||!_||!S||!c)){b(!0),a(null);try{const z=await ln(_,{conversationId:S,limit:20,pageToken:c},L);r(C=>[...z.data,...C]),u(z.nextPageToken),f(!!z.nextPageToken)}catch(z){const C=z instanceof Error?z:new Error("Failed to load more messages");a(C),w==null||w(C)}finally{b(!1)}}},[l,h,_,S,c,L,w]);return y.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]),{messages:n,addMessage:A,updateMessageStatus:O,clearMessages:j,isLoading:s,error:i,loadMore:I,hasMore:l,isLoadingMore:h,isBotThinking:d}}function pi(e,t){const[n,r]=y.useState(!1),[s,o]=y.useState(0),[i,a]=y.useState(null),u={...{maxFileSize:10*1024*1024,allowedTypes:["image/jpeg","image/jpg","image/png","image/gif","image/webp","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","text/plain","text/csv"]},...t},l=!!(t!=null&&t.uploadUrl),f=b=>u.allowedTypes.includes(b.type)?b.size>u.maxFileSize?`File size ${(b.size/1024/1024).toFixed(2)}MB exceeds the maximum allowed size of ${(u.maxFileSize/1024/1024).toFixed(2)}MB`:null:`File type ${b.type} is not supported. Allowed types: ${u.allowedTypes.join(", ")}`;return{uploadFile:async b=>{if(!(t!=null&&t.uploadUrl)){const v=new Error("File upload URL is not configured");throw a(v),v}const d=f(b);if(d){const v=new Error(d);throw a(v),v}r(!0),o(0),a(null);try{const v=await H.post(t.uploadUrl,{fileName:b.name,contentType:b.type,fileSize:b.size},{headers:{"Content-Type":"application/json","x-api-key":e||"",...t.headers}}),{uploadUrl:g,attachmentUrl:_}=v.data.data||v.data;if(!g||!_)throw new Error("Failed to get upload URL from server");return await H.put(g,b,{headers:{"Content-Type":b.type},onUploadProgress:S=>{if(S.total){const k=Math.round(S.loaded*100/S.total);o(k)}}}),{url:_,name:b.name,size:b.size,type:b.type,markdown:b.type.startsWith("image/")?`![${b.name}](${_})`:`[${b.name}](${_})`}}catch(v){console.error("File upload failed:",v);const g=v instanceof Error?v:new Error("Upload failed");throw a(g),g}finally{r(!1),o(0)}},isUploading:n,uploadProgress:s,error:i,canUpload:l}}function hi(e){const[t,n]=y.useState([]);return y.useEffect(()=>{var r;if(((r=e.lastMessage)==null?void 0:r.type)==="typing"&&e.lastMessage.data){const{userId:s,isTyping:o}=e.lastMessage.data;n(o?i=>i.includes(s)?i:[...i,s]:i=>i.filter(a=>a!==s))}},[e.lastMessage]),{isTyping:t.length>0,typingUsers:t}}const mi="xcelsior-chat-size",He=8,cn={n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize",ne:"nesw-resize",nw:"nwse-resize",se:"nwse-resize",sw:"nesw-resize"};function gi(e,t,n){try{const r=localStorage.getItem(e);if(r){const s=JSON.parse(r);if(typeof s.width=="number"&&typeof s.height=="number")return{width:s.width,height:s.height}}}catch{}return{width:t,height:n}}function un(e,t,n){try{localStorage.setItem(e,JSON.stringify({width:t,height:n}))}catch{}}function gt(){return typeof window<"u"&&window.innerWidth<768}function dn(e,t){const{clientX:n,clientY:r}=e,s=r-t.top<He,o=t.bottom-r<He,i=n-t.left<He,a=t.right-n<He;return s&&i?"nw":s&&a?"ne":o&&i?"sw":o&&a?"se":s?"n":o?"s":i?"w":a?"e":null}function bi({initialWidth:e=380,initialHeight:t=580,minWidth:n=320,minHeight:r=400,maxWidth:s=800,maxHeight:o=900,storageKey:i=mi,enabled:a=!0}={}){const[c,u]=y.useState(()=>typeof window>"u"?{width:e,height:t}:gi(i,e,t)),[l,f]=y.useState(!1),[h,b]=y.useState(!1),[d,v]=y.useState(null),g=y.useRef(c);g.current=c;const _=y.useRef(null),S=y.useRef(null),k=y.useCallback((C,P)=>{const U=Math.min(s,window.innerWidth-24),M=Math.min(o,window.innerHeight-100);return{width:Math.round(Math.max(n,Math.min(U,C))),height:Math.round(Math.max(r,Math.min(M,P)))}},[n,r,s,o]),w=y.useCallback((C,P)=>{if(!_.current)return g.current;const{edge:U,startWidth:M,startHeight:q}=_.current;let B=M,te=q;return U.includes("e")&&(B=M+C),U.includes("w")&&(B=M-C),U.includes("s")&&(te=q+P),U.includes("n")&&(te=q-P),k(B,te)},[k]),E=y.useCallback(C=>{if(!_.current)return;const P=C.clientX-_.current.startX,U=C.clientY-_.current.startY;u(w(P,U))},[w]),L=y.useCallback(C=>{if(!_.current)return;const P=C.clientX-_.current.startX,U=C.clientY-_.current.startY,M=w(P,U);un(i,M.width,M.height),_.current=null,f(!1),v(null),document.body.style.cursor="",document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",L)},[w,i,E]),T=y.useCallback(C=>{if(!_.current||C.touches.length===0)return;C.preventDefault();const P=C.touches[0],U=P.clientX-_.current.startX,M=P.clientY-_.current.startY;u(w(U,M))},[w]),A=y.useCallback(C=>{if(!_.current)return;const P=C.changedTouches[0];if(P){const U=P.clientX-_.current.startX,M=P.clientY-_.current.startY,q=w(U,M);un(i,q.width,q.height)}_.current=null,f(!1),v(null),document.removeEventListener("touchmove",T),document.removeEventListener("touchend",A)},[w,i,T]);y.useEffect(()=>()=>{document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",L),document.removeEventListener("touchmove",T),document.removeEventListener("touchend",A),document.body.style.cursor=""},[E,L,T,A]);const O=y.useCallback(C=>{if(!a||gt()||l)return;const P=C.currentTarget;S.current=P;const U=P.getBoundingClientRect(),M=dn(C,U);b(!!M),v(M),P.style.cursor=M?cn[M]:""},[a,l]),j=y.useCallback(C=>{!a||gt()||!d||(C.preventDefault(),C.stopPropagation(),_.current={edge:d,startX:C.clientX,startY:C.clientY,startWidth:g.current.width,startHeight:g.current.height},f(!0),document.body.style.cursor=cn[d],document.addEventListener("mousemove",E),document.addEventListener("mouseup",L))},[a,d,E,L]),I=y.useCallback(C=>{l||(b(!1),v(null),S.current&&(S.current.style.cursor=""))},[l]),z=y.useCallback(C=>{if(!a||gt()||C.touches.length===0)return;const U=C.currentTarget.getBoundingClientRect(),M=C.touches[0],q=dn(M,U);q&&(_.current={edge:q,startX:M.clientX,startY:M.clientY,startWidth:g.current.width,startHeight:g.current.height},f(!0),v(q),document.addEventListener("touchmove",T,{passive:!1}),document.addEventListener("touchend",A))},[a,T,A]);return{width:c.width,height:c.height,isResizing:l,isNearEdge:h,activeEdge:d,containerResizeProps:{onMouseMove:O,onMouseDown:j,onMouseLeave:I,onTouchStart:z}}}function $t({agent:e,onClose:t,onMinimize:n,theme:r}){return p.jsxs("div",{className:"relative text-white overflow-hidden",style:{flexShrink:0,background:["radial-gradient(ellipse at 30% 50%, rgba(0,50,255,0.4) 0%, transparent 60%)","radial-gradient(ellipse at 70% 30%, rgba(0,80,255,0.3) 0%, transparent 50%)","radial-gradient(ellipse at 50% 80%, rgba(0,30,200,0.3) 0%, transparent 60%)","linear-gradient(135deg, #0030cc 0%, #001a66 50%, #000d33 100%)"].join(", ")},children:[p.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{background:"linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 50%)"}}),p.jsxs("div",{className:"flex items-center justify-between",style:{padding:"8px 16px"},children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsxs("div",{className:"relative",children:[e!=null&&e.avatar?p.jsx("img",{src:e.avatar,alt:e.name,className:"h-10 w-10 rounded-full object-cover",style:{boxShadow:"0 2px 8px rgba(0,0,0,0.25)"}}):p.jsx("div",{style:{filter:"drop-shadow(0 2px 8px rgba(0,0,0,0.3))"},children:p.jsx(Ts,{size:28,color:"white"})}),(e==null?void 0:e.status)==="online"&&p.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full",style:{backgroundColor:(r==null?void 0:r.statusPositive)||"#1ed473",border:"2.5px solid rgba(0,50,180,0.9)",boxShadow:`0 0 8px ${(r==null?void 0:r.statusPositive)||"#1ed473"}80`}})]}),p.jsxs("div",{children:[p.jsx("h3",{className:"font-semibold leading-tight",style:{fontSize:"15px",letterSpacing:"-0.01em"},children:(e==null?void 0:e.name)||"Xcelsior Software"}),p.jsx("p",{className:"mt-0.5 leading-tight",style:{fontSize:"12px",letterSpacing:"0.015em",color:"rgba(255,255,255,0.6)"},children:(e==null?void 0:e.status)==="online"?p.jsxs("span",{className:"flex items-center gap-1.5",children:[p.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full",style:{backgroundColor:(r==null?void 0:r.statusPositive)||"#1ed473",boxShadow:`0 0 4px ${(r==null?void 0:r.statusPositive)||"#1ed473"}60`}}),"Online now"]}):(e==null?void 0:e.status)==="away"?"Away":"We typically reply within minutes"})]})]}),p.jsx("div",{className:"flex items-center gap-0.5",children:(n||t)&&p.jsx("button",{type:"button",onClick:n||t,className:"p-2 rounded-lg transition-all duration-150",style:{backgroundColor:"transparent"},onMouseEnter:s=>{s.currentTarget.style.backgroundColor="rgba(255,255,255,0.1)"},onMouseLeave:s=>{s.currentTarget.style.backgroundColor="transparent"},"aria-label":"Minimize chat",children:p.jsxs("svg",{width:"18",height:"18",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:[p.jsx("title",{children:"Minimize"}),p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})]})})})]}),p.jsx("div",{className:"h-px",style:{background:"linear-gradient(90deg, transparent 5%, rgba(255,255,255,0.12) 30%, rgba(255,255,255,0.12) 70%, transparent 95%)"}})]})}try{$t.displayName="ChatHeader",$t.__docgenInfo={description:"",displayName:"ChatHeader",props:{agent:{defaultValue:null,description:"",name:"agent",required:!1,type:{name:"IUser | undefined"}},onClose:{defaultValue:null,description:"",name:"onClose",required:!1,type:{name:"(() => void) | undefined"}},onMinimize:{defaultValue:null,description:"",name:"onMinimize",required:!1,type:{name:"(() => void) | undefined"}},theme:{defaultValue:null,description:"",name:"theme",required:!1,type:{name:"IChatTheme | undefined"}}}}}catch{}const vi={sm:16,md:24,lg:36},yi={sm:2,md:2,lg:3};function Qe({size:e="md",color:t="currentColor"}){const n=vi[e],r=yi[e];return p.jsxs(p.Fragment,{children:[p.jsx("style",{children:`
7
+ @keyframes xchat-spin {
8
+ to { transform: rotate(360deg); }
9
+ }
10
+ .xchat-spinner {
11
+ animation: xchat-spin 0.75s linear infinite;
12
+ border-radius: 50%;
13
+ display: inline-block;
14
+ flex-shrink: 0;
15
+ }
16
+ `}),p.jsx("span",{className:"xchat-spinner",role:"status","aria-label":"Loading",style:{width:n,height:n,border:`${r}px solid rgba(128,128,128,0.25)`,borderTopColor:t}})]})}try{Qe.displayName="Spinner",Qe.__docgenInfo={description:"",displayName:"Spinner",props:{size:{defaultValue:{value:"md"},description:"",name:"size",required:!1,type:{name:"enum",value:[{value:"undefined"},{value:'"sm"'},{value:'"md"'},{value:'"lg"'}]}},color:{defaultValue:{value:"currentColor"},description:"",name:"color",required:!1,type:{name:"string | undefined"}}}}}catch{}const bt={greeting:["Hey there!","Hello!","Hi! One moment","Welcome!","Nice to meet you"],farewell:["Wrapping up","One last thing","Almost done"],pricing:["Crunching numbers","Checking our plans","Let me look into that","Pulling up pricing","Running the numbers","Checking options"],quote:["Putting this together","Working on your quote","Gathering the details","Tailoring this for you"],booking:["Checking the calendar","Finding good times","Pulling up availability","Let me check slots"],technical:["Diving into the docs","Interesting question","Let me look that up","Checking the specs","Hmm, good one","Researching this"],code:["Reading the code","Checking the repo","Let me trace that","Debugging in my head"],support:["On it!","Let me help","Looking into this","Checking for you","I got you","Investigating"],frustrated:["I hear you","Let me fix this","Sorry about that","Working on it now","Bear with me"],services:["Great question","Let me explain","Pulling up details","Good to know you ask"],portfolio:["Checking our work","Pulling up examples","Let me show you","Finding case studies"],about:["Glad you asked!","Let me tell you","Good question","Here we go"],comparison:["Weighing the options","Let me compare","Thinking through this","Good point"],followUp:["Let me dig deeper","More details coming","Building on that","Expanding on this"],general:["Hmm, let me think","One sec","On it","Working on it","Almost there","Bear with me","Let me check","Good question","Hang tight","Looking into it","Let me see","Thinking","Just a moment","Figuring this out"]},xi=[{key:"frustrated",pattern:/frustrat|angry|annoyed|terrible|worst|useless|waste|stupid|wtf|seriously|ridiculous|unacceptable|disappointing/},{key:"greeting",pattern:/^(hi\b|hey\b|hello\b|good morning|good afternoon|good evening|g'day|howdy|yo\b|sup\b|what's up|greetings)/},{key:"farewell",pattern:/\b(thanks|thank you|bye|goodbye|cheers|that's all|that's it|no more|all good|perfect thanks)\b/},{key:"booking",pattern:/\b(book|schedule|meeting|appointment|calendar|available time|free slot|set up a call|arrange|consultation time|when can)\b/},{key:"quote",pattern:/\b(quote|proposal|estimate|project cost|custom price|tailor|bespoke)\b/},{key:"pricing",pattern:/\b(price|cost|how much|pricing|rate|fee|budget|afford|charge|per hour|hourly|package|plan|tier|subscription)\b/},{key:"code",pattern:/\b(code|github|repo|commit|deploy|ci\/cd|docker|aws|lambda|api endpoint|sdk|npm|yarn|pnpm|typescript|react|next\.?js)\b/},{key:"technical",pattern:/\b(api|integrate|integration|stack|server|database|backend|frontend|infrastructure|architecture|performance|scalab|migration|devops|cloud)\b/},{key:"support",pattern:/\b(bug|error|issue|broken|not working|help|support|problem|fix|crash|down|fail|stuck|trouble|can't|cannot|doesn't work|won't)\b/},{key:"portfolio",pattern:/\b(portfolio|case stud|example|previous work|client|project you|showcase|demo|sample)\b/},{key:"services",pattern:/\b(service|what do you|what can you|offer|do you do|capabilit|specializ|expertise|solution|consult|develop|design|build|create)\b/},{key:"about",pattern:/\b(who are|about you|your team|your company|where are you|location|office|founded|history|values|mission)\b/},{key:"comparison",pattern:/\b(compare|vs|versus|difference|better|which one|alternative|competitor|pros and cons|trade.?off|should i|recommend)\b/},{key:"followUp",pattern:/\b(more detail|tell me more|elaborate|explain further|what about|and also|another question|one more|can you also|what else|go on)\b/}];function fn(e){if(!e)return"general";const t=e.toLowerCase().trim();for(const n of xi)if(n.pattern.test(t))return n.key;return t.split(/\s+/).length<=3||t.endsWith("?"),"general"}function pn(e){const n=[...bt[e]||bt.general],r=bt.general.filter(o=>!n.includes(o)).sort(()=>Math.random()-.5).slice(0,3),s=[...n,...r];for(let o=s.length-1;o>0;o--){const i=Math.floor(Math.random()*(o+1));[s[o],s[i]]=[s[i],s[o]]}return s}function _i(e){if(!(e!=null&&e.startsWith("#")))return!1;const t=e.replace("#",""),n=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),s=parseInt(t.substring(4,6),16);return(.299*n+.587*r+.114*s)/255>.5}function Et({lastUserMessage:e,theme:t,showAvatar:n=!0}){const r=_i(t==null?void 0:t.background),s=(t==null?void 0:t.primary)||"#337eff",o=(t==null?void 0:t.textMuted)||(r?"rgba(0,0,0,0.4)":"rgba(247,247,248,0.45)"),[i,a]=y.useState(0),[c,u]=y.useState(""),[l,f]=y.useState(!1),h=y.useRef(pn(fn(e)));return y.useEffect(()=>{h.current=pn(fn(e)),a(0),u(""),f(!1)},[e]),y.useEffect(()=>{const b=h.current,d=b[i%b.length];let v;return l?c.length>0?v=setTimeout(()=>u(c.slice(0,-1)),18):(f(!1),a(g=>(g+1)%h.current.length)):c.length<d.length?v=setTimeout(()=>u(d.slice(0,c.length+1)),30+Math.random()*30):v=setTimeout(()=>f(!0),1800),()=>clearTimeout(v)},[c,l,i]),p.jsxs("div",{className:"flex gap-2.5 mb-3",role:"status","aria-live":"polite","aria-label":"Xcelsior is thinking",children:[n&&p.jsx("div",{className:"flex-shrink-0 mt-auto mb-5",children:p.jsx(Lr,{size:28})}),p.jsx("div",{className:"flex flex-col items-start",children:p.jsx("div",{style:{backgroundColor:r?"rgba(0,0,0,0.04)":"rgba(255,255,255,0.04)",borderRadius:"18px 18px 18px 4px",boxShadow:r?"inset 0 0 0 1px rgba(0,0,0,0.06)":"inset 0 0 0 0.5px rgba(255,255,255,0.06), inset 0 1px 0 0 rgba(255,255,255,0.08)",padding:"12px 16px",minWidth:160},children:p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[p.jsx("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[0,1,2].map(b=>p.jsx("span",{style:{width:5,height:5,borderRadius:"50%",backgroundColor:s,display:"inline-block",animation:`thinkingPulse 1.4s ease-in-out ${b*.2}s infinite`}},b))}),p.jsxs("span",{style:{fontSize:12,color:o,letterSpacing:"0.015em",fontStyle:"italic"},children:[c,p.jsx("span",{style:{display:"inline-block",width:1,height:13,backgroundColor:o,marginLeft:1,animation:"cursorBlink 0.8s step-end infinite",verticalAlign:"text-bottom"}})]})]})})})]})}try{Et.displayName="ThinkingIndicator",Et.__docgenInfo={description:"",displayName:"ThinkingIndicator",props:{lastUserMessage:{defaultValue:null,description:"Last message the user sent — used to pick contextual phrases",name:"lastUserMessage",required:!1,type:{name:"string | undefined"}},theme:{defaultValue:null,description:"Chat theme for color matching",name:"theme",required:!1,type:{name:"IChatTheme | undefined"}},showAvatar:{defaultValue:{value:"true"},description:"Show avatar next to the indicator",name:"showAvatar",required:!1,type:{name:"boolean | undefined"}}}}}catch{}function jt({messages:e,currentUser:t,isLoading:n=!1,isTyping:r=!1,typingUser:s,autoScroll:o=!0,onLoadMore:i,hasMore:a=!1,isLoadingMore:c=!1,theme:u,onQuickAction:l,isBotThinking:f=!1}){var O;const h=y.useRef(null),b=y.useRef(null),d=y.useRef(e.length),v=y.useRef(null),g=y.useRef(0),_=y.useRef(!1),S=y.useRef(!1),k=(u==null?void 0:u.background)||"#00001a",w=(()=>{if(!k.startsWith("#"))return!1;const j=k.replace("#",""),I=parseInt(j.substring(0,2),16),z=parseInt(j.substring(2,4),16),C=parseInt(j.substring(4,6),16);return(.299*I+.587*z+.114*C)/255>.5})(),E=(u==null?void 0:u.primary)||"#337eff",L=(u==null?void 0:u.text)||(w?"#1a1a2e":"#f7f7f8"),T=(u==null?void 0:u.textMuted)||(w?"rgba(0,0,0,0.4)":"rgba(247,247,248,0.45)");y.useEffect(()=>{o&&h.current&&(e.length>d.current&&!c&&h.current.scrollIntoView({behavior:"smooth"}),d.current=e.length)},[e.length,o,c]),y.useEffect(()=>{e.length>0&&h.current&&!n&&!_.current?(setTimeout(()=>{var j;(j=h.current)==null||j.scrollIntoView({behavior:"auto"}),setTimeout(()=>{S.current=!0},200)},100),_.current=!0):!n&&e.length===0&&!_.current&&(S.current=!0,_.current=!0)},[n,e.length]),y.useEffect(()=>{var j;if(c)g.current=((j=b.current)==null?void 0:j.scrollHeight)||0;else if(g.current>0&&b.current){const z=b.current.scrollHeight-g.current;b.current.scrollTop=z,g.current=0}},[c]);const A=y.useCallback(()=>{if(!b.current||!i||!a||c||!S.current)return;const{scrollTop:j}=b.current;j<100&&i()},[i,a,c]);return y.useEffect(()=>{const j=b.current;if(j)return j.addEventListener("scroll",A),()=>j.removeEventListener("scroll",A)},[A]),n?p.jsx("div",{className:"flex items-center justify-center h-full",children:p.jsx(Qe,{size:"lg"})}):e.length===0?p.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",style:{padding:"40px 32px"},children:[p.jsx("h3",{className:"font-semibold mb-2",style:{color:L,fontSize:"17px",letterSpacing:"-0.01em"},children:"How can we help?"}),p.jsx("p",{className:"max-w-[240px]",style:{color:T,fontSize:"13px",lineHeight:"1.5",letterSpacing:"0.015em",marginBottom:20},children:"Ask us anything. We are here to help you get the most out of Xcelsior."}),p.jsx("div",{className:"flex flex-wrap justify-center gap-2",children:[{label:"Our services",message:"What services does Xcelsior offer?"},{label:"Get a quote",message:"I would like to get a quote for a project"},{label:"Support",message:"I need help with something"}].map(j=>p.jsx("button",{type:"button",onClick:()=>l==null?void 0:l(j.message),style:{padding:"6px 14px",borderRadius:"999px",cursor:"pointer",transition:"all 150ms ease",backgroundColor:w?"rgba(0,0,0,0.04)":"rgba(255,255,255,0.04)",border:w?"1px solid rgba(0,0,0,0.1)":"1px solid rgba(255,255,255,0.1)",color:w?"rgba(0,0,0,0.6)":"rgba(247,247,248,0.6)",fontSize:"12px",letterSpacing:"0.015em"},onMouseEnter:I=>{I.currentTarget.style.backgroundColor=w?"rgba(0,0,0,0.08)":"rgba(255,255,255,0.08)",I.currentTarget.style.color=w?"rgba(0,0,0,0.8)":"rgba(247,247,248,0.8)",I.currentTarget.style.borderColor=E},onMouseLeave:I=>{I.currentTarget.style.backgroundColor=w?"rgba(0,0,0,0.04)":"rgba(255,255,255,0.04)",I.currentTarget.style.color=w?"rgba(0,0,0,0.6)":"rgba(247,247,248,0.6)",I.currentTarget.style.borderColor=w?"rgba(0,0,0,0.1)":"rgba(255,255,255,0.1)"},children:j.label},j.label))})]}):p.jsxs("div",{ref:b,className:"flex-1 overflow-y-auto px-4 py-3",style:{scrollBehavior:"smooth"},children:[p.jsx("style",{children:`
17
+ @keyframes thinkingPulse {
18
+ 0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
19
+ 30% { opacity: 1; transform: scale(1); }
20
+ }
21
+ @keyframes cursorBlink {
22
+ 0%, 100% { opacity: 1; }
23
+ 50% { opacity: 0; }
24
+ }
25
+ `}),c&&p.jsx("div",{className:"flex justify-center py-3",children:p.jsx(Qe,{size:"sm"})}),p.jsx("div",{ref:v}),e.map(j=>p.jsx(Ls,{message:j,currentUser:t,showAvatar:!0,showTimestamp:!0,theme:u},j.id)),r&&p.jsxs("div",{className:"flex gap-2.5 mb-3",children:[p.jsx("div",{className:"flex-shrink-0 mt-auto mb-5",children:p.jsx(Lr,{size:28})}),p.jsxs("div",{className:"flex flex-col items-start",children:[p.jsx("div",{className:"px-4 py-3",style:{backgroundColor:w?"rgba(0,0,0,0.04)":"rgba(255,255,255,0.04)",borderRadius:"18px 18px 18px 4px",boxShadow:w?"inset 0 0 0 1px rgba(0,0,0,0.06)":"inset 0 0 0 0.5px rgba(255,255,255,0.06), inset 0 1px 0 0 rgba(255,255,255,0.08)"},children:p.jsx("div",{className:"flex gap-1.5 items-center",style:{height:16},children:[0,1,2].map(j=>p.jsx("span",{className:"rounded-full animate-bounce",style:{width:5,height:5,backgroundColor:`${E}80`,animationDelay:`${j*.15}s`,animationDuration:"0.8s"}},j))})}),s&&p.jsxs("span",{className:"mt-1 px-1",style:{color:T,fontSize:"11px",letterSpacing:"0.019em"},children:[s," is typing..."]})]})]}),f&&!r&&p.jsx(Et,{theme:u,lastUserMessage:(O=e.filter(j=>j.senderType==="customer").pop())==null?void 0:O.content}),p.jsx("div",{ref:h})]})}try{jt.displayName="MessageList",jt.__docgenInfo={description:"",displayName:"MessageList",props:{messages:{defaultValue:null,description:"",name:"messages",required:!0,type:{name:"IMessage[]"}},currentUser:{defaultValue:null,description:"",name:"currentUser",required:!0,type:{name:"IUser"}},isLoading:{defaultValue:{value:"false"},description:"",name:"isLoading",required:!1,type:{name:"boolean | undefined"}},isTyping:{defaultValue:{value:"false"},description:"",name:"isTyping",required:!1,type:{name:"boolean | undefined"}},typingUser:{defaultValue:null,description:"",name:"typingUser",required:!1,type:{name:"string | undefined"}},autoScroll:{defaultValue:{value:"true"},description:"",name:"autoScroll",required:!1,type:{name:"boolean | undefined"}},onLoadMore:{defaultValue:null,description:"",name:"onLoadMore",required:!1,type:{name:"(() => void) | undefined"}},hasMore:{defaultValue:{value:"false"},description:"",name:"hasMore",required:!1,type:{name:"boolean | undefined"}},isLoadingMore:{defaultValue:{value:"false"},description:"",name:"isLoadingMore",required:!1,type:{name:"boolean | undefined"}},theme:{defaultValue:null,description:"",name:"theme",required:!1,type:{name:"IChatTheme | undefined"}},onQuickAction:{defaultValue:null,description:"Called when a quick-start action button is clicked — sends the text as a message",name:"onQuickAction",required:!1,type:{name:"((text: string) => void) | undefined"}},isBotThinking:{defaultValue:{value:"false"},description:"True when user sent a message and bot response hasn't arrived yet",name:"isBotThinking",required:!1,type:{name:"boolean | undefined"}}}}}catch{}function rs(e){return e&&e.__esModule?e.default:e}function oe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var dt,R,ss,Ae,os,hn,et={},is=[],wi=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function me(e,t){for(var n in t)e[n]=t[n];return e}function as(e){var t=e.parentNode;t&&t.removeChild(e)}function Rt(e,t,n){var r,s,o,i={};for(o in t)o=="key"?r=t[o]:o=="ref"?s=t[o]:i[o]=t[o];if(arguments.length>2&&(i.children=arguments.length>3?dt.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)i[o]===void 0&&(i[o]=e.defaultProps[o]);return Ge(e,i,r,s,null)}function Ge(e,t,n,r,s){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:s??++ss};return s==null&&R.vnode!=null&&R.vnode(o),o}function pe(){return{current:null}}function we(e){return e.children}function le(e,t){this.props=e,this.context=t}function ke(e,t){if(t==null)return e.__?ke(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?ke(e):null}function ls(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return ls(e)}}function mn(e){(!e.__d&&(e.__d=!0)&&Ae.push(e)&&!tt.__r++||hn!==R.debounceRendering)&&((hn=R.debounceRendering)||os)(tt)}function tt(){for(var e;tt.__r=Ae.length;)e=Ae.sort(function(t,n){return t.__v.__b-n.__v.__b}),Ae=[],e.some(function(t){var n,r,s,o,i,a;t.__d&&(i=(o=(n=t).__v).__e,(a=n.__P)&&(r=[],(s=me({},o)).__v=o.__v+1,Ht(a,o,s,n.__n,a.ownerSVGElement!==void 0,o.__h!=null?[i]:null,r,i??ke(o),o.__h),fs(r,o),o.__e!=i&&ls(o)))})}function cs(e,t,n,r,s,o,i,a,c,u){var l,f,h,b,d,v,g,_=r&&r.__k||is,S=_.length;for(n.__k=[],l=0;l<t.length;l++)if((b=n.__k[l]=(b=t[l])==null||typeof b=="boolean"?null:typeof b=="string"||typeof b=="number"||typeof b=="bigint"?Ge(null,b,null,null,b):Array.isArray(b)?Ge(we,{children:b},null,null,null):b.__b>0?Ge(b.type,b.props,b.key,null,b.__v):b)!=null){if(b.__=n,b.__b=n.__b+1,(h=_[l])===null||h&&b.key==h.key&&b.type===h.type)_[l]=void 0;else for(f=0;f<S;f++){if((h=_[f])&&b.key==h.key&&b.type===h.type){_[f]=void 0;break}h=null}Ht(e,b,h=h||et,s,o,i,a,c,u),d=b.__e,(f=b.ref)&&h.ref!=f&&(g||(g=[]),h.ref&&g.push(h.ref,null,b),g.push(f,b.__c||d,b)),d!=null?(v==null&&(v=d),typeof b.type=="function"&&b.__k===h.__k?b.__d=c=us(b,c,e):c=ds(e,b,h,_,d,c),typeof n.type=="function"&&(n.__d=c)):c&&h.__e==c&&c.parentNode!=e&&(c=ke(h))}for(n.__e=v,l=S;l--;)_[l]!=null&&(typeof n.type=="function"&&_[l].__e!=null&&_[l].__e==n.__d&&(n.__d=ke(r,l+1)),hs(_[l],_[l]));if(g)for(l=0;l<g.length;l++)ps(g[l],g[++l],g[++l])}function us(e,t,n){for(var r,s=e.__k,o=0;s&&o<s.length;o++)(r=s[o])&&(r.__=e,t=typeof r.type=="function"?us(r,t,n):ds(n,r,r,s,r.__e,t));return t}function nt(e,t){return t=t||[],e==null||typeof e=="boolean"||(Array.isArray(e)?e.some(function(n){nt(n,t)}):t.push(e)),t}function ds(e,t,n,r,s,o){var i,a,c;if(t.__d!==void 0)i=t.__d,t.__d=void 0;else if(n==null||s!=o||s.parentNode==null)e:if(o==null||o.parentNode!==e)e.appendChild(s),i=null;else{for(a=o,c=0;(a=a.nextSibling)&&c<r.length;c+=2)if(a==s)break e;e.insertBefore(s,o),i=o}return i!==void 0?i:s.nextSibling}function ki(e,t,n,r,s){var o;for(o in n)o==="children"||o==="key"||o in t||rt(e,o,null,n[o],r);for(o in t)s&&typeof t[o]!="function"||o==="children"||o==="key"||o==="value"||o==="checked"||n[o]===t[o]||rt(e,o,t[o],n[o],r)}function gn(e,t,n){t[0]==="-"?e.setProperty(t,n):e[t]=n==null?"":typeof n!="number"||wi.test(t)?n:n+"px"}function rt(e,t,n,r,s){var o;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||gn(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||gn(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?vn:bn,o):e.removeEventListener(t,o?vn:bn,o);else if(t!=="dangerouslySetInnerHTML"){if(s)t=t.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if(t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n!=null&&(n!==!1||t[0]==="a"&&t[1]==="r")?e.setAttribute(t,n):e.removeAttribute(t))}}function bn(e){this.l[e.type+!1](R.event?R.event(e):e)}function vn(e){this.l[e.type+!0](R.event?R.event(e):e)}function Ht(e,t,n,r,s,o,i,a,c){var u,l,f,h,b,d,v,g,_,S,k,w=t.type;if(t.constructor!==void 0)return null;n.__h!=null&&(c=n.__h,a=t.__e=n.__e,t.__h=null,o=[a]),(u=R.__b)&&u(t);try{e:if(typeof w=="function"){if(g=t.props,_=(u=w.contextType)&&r[u.__c],S=u?_?_.props.value:u.__:r,n.__c?v=(l=t.__c=n.__c).__=l.__E:("prototype"in w&&w.prototype.render?t.__c=l=new w(g,S):(t.__c=l=new le(g,S),l.constructor=w,l.render=Si),_&&_.sub(l),l.props=g,l.state||(l.state={}),l.context=S,l.__n=r,f=l.__d=!0,l.__h=[]),l.__s==null&&(l.__s=l.state),w.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=me({},l.__s)),me(l.__s,w.getDerivedStateFromProps(g,l.__s))),h=l.props,b=l.state,f)w.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(w.getDerivedStateFromProps==null&&g!==h&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(g,S),!l.__e&&l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(g,l.__s,S)===!1||t.__v===n.__v){l.props=g,l.state=l.__s,t.__v!==n.__v&&(l.__d=!1),l.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(E){E&&(E.__=t)}),l.__h.length&&i.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(g,l.__s,S),l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(h,b,d)})}l.context=S,l.props=g,l.state=l.__s,(u=R.__r)&&u(t),l.__d=!1,l.__v=t,l.__P=e,u=l.render(l.props,l.state,l.context),l.state=l.__s,l.getChildContext!=null&&(r=me(me({},r),l.getChildContext())),f||l.getSnapshotBeforeUpdate==null||(d=l.getSnapshotBeforeUpdate(h,b)),k=u!=null&&u.type===we&&u.key==null?u.props.children:u,cs(e,Array.isArray(k)?k:[k],t,n,r,s,o,i,a,c),l.base=t.__e,t.__h=null,l.__h.length&&i.push(l),v&&(l.__E=l.__=null),l.__e=!1}else o==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Ci(n.__e,t,n,r,s,o,i,c);(u=R.diffed)&&u(t)}catch(E){t.__v=null,(c||o!=null)&&(t.__e=a,t.__h=!!c,o[o.indexOf(a)]=null),R.__e(E,t,n)}}function fs(e,t){R.__c&&R.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(r){r.call(n)})}catch(r){R.__e(r,n.__v)}})}function Ci(e,t,n,r,s,o,i,a){var c,u,l,f=n.props,h=t.props,b=t.type,d=0;if(b==="svg"&&(s=!0),o!=null){for(;d<o.length;d++)if((c=o[d])&&"setAttribute"in c==!!b&&(b?c.localName===b:c.nodeType===3)){e=c,o[d]=null;break}}if(e==null){if(b===null)return document.createTextNode(h);e=s?document.createElementNS("http://www.w3.org/2000/svg",b):document.createElement(b,h.is&&h),o=null,a=!1}if(b===null)f===h||a&&e.data===h||(e.data=h);else{if(o=o&&dt.call(e.childNodes),u=(f=n.props||et).dangerouslySetInnerHTML,l=h.dangerouslySetInnerHTML,!a){if(o!=null)for(f={},d=0;d<e.attributes.length;d++)f[e.attributes[d].name]=e.attributes[d].value;(l||u)&&(l&&(u&&l.__html==u.__html||l.__html===e.innerHTML)||(e.innerHTML=l&&l.__html||""))}if(ki(e,h,f,s,a),l)t.__k=[];else if(d=t.props.children,cs(e,Array.isArray(d)?d:[d],t,n,r,s&&b!=="foreignObject",o,i,o?o[0]:n.__k&&ke(n,0),a),o!=null)for(d=o.length;d--;)o[d]!=null&&as(o[d]);a||("value"in h&&(d=h.value)!==void 0&&(d!==f.value||d!==e.value||b==="progress"&&!d)&&rt(e,"value",d,f.value,!1),"checked"in h&&(d=h.checked)!==void 0&&d!==e.checked&&rt(e,"checked",d,f.checked,!1))}return e}function ps(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){R.__e(r,n)}}function hs(e,t,n){var r,s;if(R.unmount&&R.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||ps(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){R.__e(o,t)}r.base=r.__P=null}if(r=e.__k)for(s=0;s<r.length;s++)r[s]&&hs(r[s],t,typeof e.type!="function");n||e.__e==null||as(e.__e),e.__e=e.__d=void 0}function Si(e,t,n){return this.constructor(e,n)}function ms(e,t,n){var r,s,o;R.__&&R.__(e,t),s=(r=typeof n=="function")?null:n&&n.__k||t.__k,o=[],Ht(t,e=(!r&&n||t).__k=Rt(we,null,[e]),s||et,et,t.ownerSVGElement!==void 0,!r&&n?[n]:s?null:t.firstChild?dt.call(t.childNodes):null,o,!r&&n?n:s?s.__e:t.firstChild,r),fs(o,e)}dt=is.slice,R={__e:function(e,t){for(var n,r,s;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&r.getDerivedStateFromError!=null&&(n.setState(r.getDerivedStateFromError(e)),s=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e),s=n.__d),s)return n.__E=n}catch(o){e=o}throw e}},ss=0,le.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=me({},this.state),typeof e=="function"&&(e=e(me({},n),this.props)),e&&me(n,e),e!=null&&this.__v&&(t&&this.__h.push(t),mn(this))},le.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),mn(this))},le.prototype.render=we,Ae=[],os=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,tt.__r=0;var $i=0;function x(e,t,n,r,s){var o,i,a={};for(i in t)i=="ref"?o=t[i]:a[i]=t[i];var c={type:e,props:a,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--$i,__source:r,__self:s};if(typeof e=="function"&&(o=e.defaultProps))for(i in o)a[i]===void 0&&(a[i]=o[i]);return R.vnode&&R.vnode(c),c}function Ei(e,t){try{window.localStorage[`emoji-mart.${e}`]=JSON.stringify(t)}catch{}}function ji(e){try{const t=window.localStorage[`emoji-mart.${e}`];if(t)return JSON.parse(t)}catch{}}var ge={set:Ei,get:ji};const vt=new Map,Ri=[{v:15,emoji:"🫨"},{v:14,emoji:"🫠"},{v:13.1,emoji:"😶‍🌫️"},{v:13,emoji:"🥸"},{v:12.1,emoji:"🧑‍🦰"},{v:12,emoji:"🥱"},{v:11,emoji:"🥰"},{v:5,emoji:"🤩"},{v:4,emoji:"👱‍♀️"},{v:3,emoji:"🤣"},{v:2,emoji:"👋🏻"},{v:1,emoji:"🙃"}];function Ti(){for(const{v:e,emoji:t}of Ri)if(gs(t))return e}function Mi(){return!gs("🇨🇦")}function gs(e){if(vt.has(e))return vt.get(e);const t=Li(e);return vt.set(e,t),t}const Li=(()=>{let e=null;try{navigator.userAgent.includes("jsdom")||(e=document.createElement("canvas").getContext("2d",{willReadFrequently:!0}))}catch{}if(!e)return()=>!1;const t=25,n=20,r=Math.floor(t/2);return e.font=r+"px Arial, Sans-Serif",e.textBaseline="top",e.canvas.width=n*2,e.canvas.height=t,s=>{e.clearRect(0,0,n*2,t),e.fillStyle="#FF0000",e.fillText(s,0,22),e.fillStyle="#0000FF",e.fillText(s,n,22);const o=e.getImageData(0,0,n,t).data,i=o.length;let a=0;for(;a<i&&!o[a+3];a+=4);if(a>=i)return!1;const c=n+a/4%n,u=Math.floor(a/4/n),l=e.getImageData(c,u,1,1).data;return!(o[a]!==l[0]||o[a+2]!==l[2]||e.measureText(s).width>=n)}})();var yn={latestVersion:Ti,noCountryFlags:Mi};const Tt=["+1","grinning","kissing_heart","heart_eyes","laughing","stuck_out_tongue_winking_eye","sweat_smile","joy","scream","disappointed","unamused","weary","sob","sunglasses","heart"];let K=null;function Pi(e){K||(K=ge.get("frequently")||{});const t=e.id||e;t&&(K[t]||(K[t]=0),K[t]+=1,ge.set("last",t),ge.set("frequently",K))}function zi({maxFrequentRows:e,perLine:t}){if(!e)return[];K||(K=ge.get("frequently"));let n=[];if(!K){K={};for(let o in Tt.slice(0,t)){const i=Tt[o];K[i]=t-o,n.push(i)}return n}const r=e*t,s=ge.get("last");for(let o in K)n.push(o);if(n.sort((o,i)=>{const a=K[i],c=K[o];return a==c?o.localeCompare(i):a-c}),n.length>r){const o=n.slice(r);n=n.slice(0,r);for(let i of o)i!=s&&delete K[i];s&&n.indexOf(s)==-1&&(delete K[n[n.length-1]],n.splice(-1,1,s)),ge.set("frequently",K)}return n}var bs={add:Pi,get:zi,DEFAULTS:Tt},vs={};vs=JSON.parse('{"search":"Search","search_no_results_1":"Oh no!","search_no_results_2":"That emoji couldn’t be found","pick":"Pick an emoji…","add_custom":"Add custom emoji","categories":{"activity":"Activity","custom":"Custom","flags":"Flags","foods":"Food & Drink","frequent":"Frequently used","nature":"Animals & Nature","objects":"Objects","people":"Smileys & People","places":"Travel & Places","search":"Search Results","symbols":"Symbols"},"skins":{"1":"Default","2":"Light","3":"Medium-Light","4":"Medium","5":"Medium-Dark","6":"Dark","choose":"Choose default skin tone"}}');var he={autoFocus:{value:!1},dynamicWidth:{value:!1},emojiButtonColors:{value:null},emojiButtonRadius:{value:"100%"},emojiButtonSize:{value:36},emojiSize:{value:24},emojiVersion:{value:15,choices:[1,2,3,4,5,11,12,12.1,13,13.1,14,15]},exceptEmojis:{value:[]},icons:{value:"auto",choices:["auto","outline","solid"]},locale:{value:"en",choices:["en","ar","be","cs","de","es","fa","fi","fr","hi","it","ja","ko","nl","pl","pt","ru","sa","tr","uk","vi","zh"]},maxFrequentRows:{value:4},navPosition:{value:"top",choices:["top","bottom","none"]},noCountryFlags:{value:!1},noResultsEmoji:{value:null},perLine:{value:9},previewEmoji:{value:null},previewPosition:{value:"bottom",choices:["top","bottom","none"]},searchPosition:{value:"sticky",choices:["sticky","static","none"]},set:{value:"native",choices:["native","apple","facebook","google","twitter"]},skin:{value:1,choices:[1,2,3,4,5,6]},skinTonePosition:{value:"preview",choices:["preview","search","none"]},theme:{value:"auto",choices:["auto","light","dark"]},categories:null,categoryIcons:null,custom:null,data:null,i18n:null,getImageURL:null,getSpritesheetURL:null,onAddCustomEmoji:null,onClickOutside:null,onEmojiSelect:null,stickySearch:{deprecated:!0,value:!0}};let G=null,D=null;const yt={};async function xn(e){if(yt[e])return yt[e];const n=await(await fetch(e)).json();return yt[e]=n,n}let xt=null,ys=null,xs=!1;function ft(e,{caller:t}={}){return xt||(xt=new Promise(n=>{ys=n})),e?Ni(e):t&&!xs&&console.warn(`\`${t}\` requires data to be initialized first. Promise will be pending until \`init\` is called.`),xt}async function Ni(e){xs=!0;let{emojiVersion:t,set:n,locale:r}=e;if(t||(t=he.emojiVersion.value),n||(n=he.set.value),r||(r=he.locale.value),D)D.categories=D.categories.filter(c=>!c.name);else{D=(typeof e.data=="function"?await e.data():e.data)||await xn(`https://cdn.jsdelivr.net/npm/@emoji-mart/data@latest/sets/${t}/${n}.json`),D.emoticons={},D.natives={},D.categories.unshift({id:"frequent",emojis:[]});for(const c in D.aliases){const u=D.aliases[c],l=D.emojis[u];l&&(l.aliases||(l.aliases=[]),l.aliases.push(c))}D.originalCategories=D.categories}if(G=(typeof e.i18n=="function"?await e.i18n():e.i18n)||(r=="en"?rs(vs):await xn(`https://cdn.jsdelivr.net/npm/@emoji-mart/data@latest/i18n/${r}.json`)),e.custom)for(let c in e.custom){c=parseInt(c);const u=e.custom[c],l=e.custom[c-1];if(!(!u.emojis||!u.emojis.length)){u.id||(u.id=`custom_${c+1}`),u.name||(u.name=G.categories.custom),l&&!u.icon&&(u.target=l.target||l),D.categories.push(u);for(const f of u.emojis)D.emojis[f.id]=f}}e.categories&&(D.categories=D.originalCategories.filter(c=>e.categories.indexOf(c.id)!=-1).sort((c,u)=>{const l=e.categories.indexOf(c.id),f=e.categories.indexOf(u.id);return l-f}));let s=null,o=null;n=="native"&&(s=yn.latestVersion(),o=e.noCountryFlags||yn.noCountryFlags());let i=D.categories.length,a=!1;for(;i--;){const c=D.categories[i];if(c.id=="frequent"){let{maxFrequentRows:f,perLine:h}=e;f=f>=0?f:he.maxFrequentRows.value,h||(h=he.perLine.value),c.emojis=bs.get({maxFrequentRows:f,perLine:h})}if(!c.emojis||!c.emojis.length){D.categories.splice(i,1);continue}const{categoryIcons:u}=e;if(u){const f=u[c.id];f&&!c.icon&&(c.icon=f)}let l=c.emojis.length;for(;l--;){const f=c.emojis[l],h=f.id?f:D.emojis[f],b=()=>{c.emojis.splice(l,1)};if(!h||e.exceptEmojis&&e.exceptEmojis.includes(h.id)){b();continue}if(s&&h.version>s){b();continue}if(o&&c.id=="flags"&&!Ui.includes(h.id)){b();continue}if(!h.search){if(a=!0,h.search=","+[[h.id,!1],[h.name,!0],[h.keywords,!1],[h.emoticons,!1]].map(([v,g])=>{if(v)return(Array.isArray(v)?v:[v]).map(_=>(g?_.split(/[-|_|\s]+/):[_]).map(S=>S.toLowerCase())).flat()}).flat().filter(v=>v&&v.trim()).join(","),h.emoticons)for(const v of h.emoticons)D.emoticons[v]||(D.emoticons[v]=h.id);let d=0;for(const v of h.skins){if(!v)continue;d++;const{native:g}=v;g&&(D.natives[g]=h.id,h.search+=`,${g}`);const _=d==1?"":`:skin-tone-${d}:`;v.shortcodes=`:${h.id}:${_}`}}}}a&&xe.reset(),ys()}function _s(e,t,n){e||(e={});const r={};for(let s in t)r[s]=ws(s,e,t,n);return r}function ws(e,t,n,r){const s=n[e];let o=r&&r.getAttribute(e)||(t[e]!=null&&t[e]!=null?t[e]:null);return s&&(o!=null&&s.value&&typeof s.value!=typeof o&&(typeof s.value=="boolean"?o=o!="false":o=s.value.constructor(o)),s.transform&&o&&(o=s.transform(o)),(o==null||s.choices&&s.choices.indexOf(o)==-1)&&(o=s.value)),o}const Oi=/^(?:\:([^\:]+)\:)(?:\:skin-tone-(\d)\:)?$/;let Mt=null;function Ai(e){return e.id?e:D.emojis[e]||D.emojis[D.aliases[e]]||D.emojis[D.natives[e]]}function Ii(){Mt=null}async function Di(e,{maxResults:t,caller:n}={}){if(!e||!e.trim().length)return null;t||(t=90),await ft(null,{caller:n||"SearchIndex.search"});const r=e.toLowerCase().replace(/(\w)-/,"$1 ").split(/[\s|,]+/).filter((a,c,u)=>a.trim()&&u.indexOf(a)==c);if(!r.length)return;let s=Mt||(Mt=Object.values(D.emojis)),o,i;for(const a of r){if(!s.length)break;o=[],i={};for(const c of s){if(!c.search)continue;const u=c.search.indexOf(`,${a}`);u!=-1&&(o.push(c),i[c.id]||(i[c.id]=0),i[c.id]+=c.id==a?0:u+1)}s=o}return o.length<2||(o.sort((a,c)=>{const u=i[a.id],l=i[c.id];return u==l?a.id.localeCompare(c.id):u-l}),o.length>t&&(o=o.slice(0,t))),o}var xe={search:Di,get:Ai,reset:Ii,SHORTCODES_REGEX:Oi};const Ui=["checkered_flag","crossed_flags","pirate_flag","rainbow-flag","transgender_flag","triangular_flag_on_post","waving_black_flag","waving_white_flag"];function Bi(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((n,r)=>n==t[r])}async function Fi(e=1){for(let t in[...Array(e).keys()])await new Promise(requestAnimationFrame)}function Hi(e,{skinIndex:t=0}={}){const n=e.skins[t]||(t=0,e.skins[t]),r={id:e.id,name:e.name,native:n.native,unified:n.unified,keywords:e.keywords,shortcodes:n.shortcodes||e.shortcodes};return e.skins.length>1&&(r.skin=t+1),n.src&&(r.src=n.src),e.aliases&&e.aliases.length&&(r.aliases=e.aliases),e.emoticons&&e.emoticons.length&&(r.emoticons=e.emoticons),r}const qi={activity:{outline:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:x("path",{d:"M12 0C5.373 0 0 5.372 0 12c0 6.627 5.373 12 12 12 6.628 0 12-5.373 12-12 0-6.628-5.372-12-12-12m9.949 11H17.05c.224-2.527 1.232-4.773 1.968-6.113A9.966 9.966 0 0 1 21.949 11M13 11V2.051a9.945 9.945 0 0 1 4.432 1.564c-.858 1.491-2.156 4.22-2.392 7.385H13zm-2 0H8.961c-.238-3.165-1.536-5.894-2.393-7.385A9.95 9.95 0 0 1 11 2.051V11zm0 2v8.949a9.937 9.937 0 0 1-4.432-1.564c.857-1.492 2.155-4.221 2.393-7.385H11zm4.04 0c.236 3.164 1.534 5.893 2.392 7.385A9.92 9.92 0 0 1 13 21.949V13h2.04zM4.982 4.887C5.718 6.227 6.726 8.473 6.951 11h-4.9a9.977 9.977 0 0 1 2.931-6.113M2.051 13h4.9c-.226 2.527-1.233 4.771-1.969 6.113A9.972 9.972 0 0 1 2.051 13m16.967 6.113c-.735-1.342-1.744-3.586-1.968-6.113h4.899a9.961 9.961 0 0 1-2.931 6.113"})}),solid:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:x("path",{d:"M16.17 337.5c0 44.98 7.565 83.54 13.98 107.9C35.22 464.3 50.46 496 174.9 496c9.566 0 19.59-.4707 29.84-1.271L17.33 307.3C16.53 317.6 16.17 327.7 16.17 337.5zM495.8 174.5c0-44.98-7.565-83.53-13.98-107.9c-4.688-17.54-18.34-31.23-36.04-35.95C435.5 27.91 392.9 16 337 16c-9.564 0-19.59 .4707-29.84 1.271l187.5 187.5C495.5 194.4 495.8 184.3 495.8 174.5zM26.77 248.8l236.3 236.3c142-36.1 203.9-150.4 222.2-221.1L248.9 26.87C106.9 62.96 45.07 177.2 26.77 248.8zM256 335.1c0 9.141-7.474 16-16 16c-4.094 0-8.188-1.564-11.31-4.689L164.7 283.3C161.6 280.2 160 276.1 160 271.1c0-8.529 6.865-16 16-16c4.095 0 8.189 1.562 11.31 4.688l64.01 64C254.4 327.8 256 331.9 256 335.1zM304 287.1c0 9.141-7.474 16-16 16c-4.094 0-8.188-1.564-11.31-4.689L212.7 235.3C209.6 232.2 208 228.1 208 223.1c0-9.141 7.473-16 16-16c4.094 0 8.188 1.562 11.31 4.688l64.01 64.01C302.5 279.8 304 283.9 304 287.1zM256 175.1c0-9.141 7.473-16 16-16c4.094 0 8.188 1.562 11.31 4.688l64.01 64.01c3.125 3.125 4.688 7.219 4.688 11.31c0 9.133-7.468 16-16 16c-4.094 0-8.189-1.562-11.31-4.688l-64.01-64.01C257.6 184.2 256 180.1 256 175.1z"})})},custom:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:x("path",{d:"M417.1 368c-5.937 10.27-16.69 16-27.75 16c-5.422 0-10.92-1.375-15.97-4.281L256 311.4V448c0 17.67-14.33 32-31.1 32S192 465.7 192 448V311.4l-118.3 68.29C68.67 382.6 63.17 384 57.75 384c-11.06 0-21.81-5.734-27.75-16c-8.828-15.31-3.594-34.88 11.72-43.72L159.1 256L41.72 187.7C26.41 178.9 21.17 159.3 29.1 144C36.63 132.5 49.26 126.7 61.65 128.2C65.78 128.7 69.88 130.1 73.72 132.3L192 200.6V64c0-17.67 14.33-32 32-32S256 46.33 256 64v136.6l118.3-68.29c3.838-2.213 7.939-3.539 12.07-4.051C398.7 126.7 411.4 132.5 417.1 144c8.828 15.31 3.594 34.88-11.72 43.72L288 256l118.3 68.28C421.6 333.1 426.8 352.7 417.1 368z"})}),flags:{outline:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:x("path",{d:"M0 0l6.084 24H8L1.916 0zM21 5h-4l-1-4H4l3 12h3l1 4h13L21 5zM6.563 3h7.875l2 8H8.563l-2-8zm8.832 10l-2.856 1.904L12.063 13h3.332zM19 13l-1.5-6h1.938l2 8H16l3-2z"})}),solid:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:x("path",{d:"M64 496C64 504.8 56.75 512 48 512h-32C7.25 512 0 504.8 0 496V32c0-17.75 14.25-32 32-32s32 14.25 32 32V496zM476.3 0c-6.365 0-13.01 1.35-19.34 4.233c-45.69 20.86-79.56 27.94-107.8 27.94c-59.96 0-94.81-31.86-163.9-31.87C160.9 .3055 131.6 4.867 96 15.75v350.5c32-9.984 59.87-14.1 84.85-14.1c73.63 0 124.9 31.78 198.6 31.78c31.91 0 68.02-5.971 111.1-23.09C504.1 355.9 512 344.4 512 332.1V30.73C512 11.1 495.3 0 476.3 0z"})})},foods:{outline:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:x("path",{d:"M17 4.978c-1.838 0-2.876.396-3.68.934.513-1.172 1.768-2.934 4.68-2.934a1 1 0 0 0 0-2c-2.921 0-4.629 1.365-5.547 2.512-.064.078-.119.162-.18.244C11.73 1.838 10.798.023 9.207.023 8.579.022 7.85.306 7 .978 5.027 2.54 5.329 3.902 6.492 4.999 3.609 5.222 0 7.352 0 12.969c0 4.582 4.961 11.009 9 11.009 1.975 0 2.371-.486 3-1 .629.514 1.025 1 3 1 4.039 0 9-6.418 9-11 0-5.953-4.055-8-7-8M8.242 2.546c.641-.508.943-.523.965-.523.426.169.975 1.405 1.357 3.055-1.527-.629-2.741-1.352-2.98-1.846.059-.112.241-.356.658-.686M15 21.978c-1.08 0-1.21-.109-1.559-.402l-.176-.146c-.367-.302-.816-.452-1.266-.452s-.898.15-1.266.452l-.176.146c-.347.292-.477.402-1.557.402-2.813 0-7-5.389-7-9.009 0-5.823 4.488-5.991 5-5.991 1.939 0 2.484.471 3.387 1.251l.323.276a1.995 1.995 0 0 0 2.58 0l.323-.276c.902-.78 1.447-1.251 3.387-1.251.512 0 5 .168 5 6 0 3.617-4.187 9-7 9"})}),solid:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:x("path",{d:"M481.9 270.1C490.9 279.1 496 291.3 496 304C496 316.7 490.9 328.9 481.9 337.9C472.9 346.9 460.7 352 448 352H64C51.27 352 39.06 346.9 30.06 337.9C21.06 328.9 16 316.7 16 304C16 291.3 21.06 279.1 30.06 270.1C39.06 261.1 51.27 256 64 256H448C460.7 256 472.9 261.1 481.9 270.1zM475.3 388.7C478.3 391.7 480 395.8 480 400V416C480 432.1 473.3 449.3 461.3 461.3C449.3 473.3 432.1 480 416 480H96C79.03 480 62.75 473.3 50.75 461.3C38.74 449.3 32 432.1 32 416V400C32 395.8 33.69 391.7 36.69 388.7C39.69 385.7 43.76 384 48 384H464C468.2 384 472.3 385.7 475.3 388.7zM50.39 220.8C45.93 218.6 42.03 215.5 38.97 211.6C35.91 207.7 33.79 203.2 32.75 198.4C31.71 193.5 31.8 188.5 32.99 183.7C54.98 97.02 146.5 32 256 32C365.5 32 457 97.02 479 183.7C480.2 188.5 480.3 193.5 479.2 198.4C478.2 203.2 476.1 207.7 473 211.6C469.1 215.5 466.1 218.6 461.6 220.8C457.2 222.9 452.3 224 447.3 224H64.67C59.73 224 54.84 222.9 50.39 220.8zM372.7 116.7C369.7 119.7 368 123.8 368 128C368 131.2 368.9 134.3 370.7 136.9C372.5 139.5 374.1 141.6 377.9 142.8C380.8 143.1 384 144.3 387.1 143.7C390.2 143.1 393.1 141.6 395.3 139.3C397.6 137.1 399.1 134.2 399.7 131.1C400.3 128 399.1 124.8 398.8 121.9C397.6 118.1 395.5 116.5 392.9 114.7C390.3 112.9 387.2 111.1 384 111.1C379.8 111.1 375.7 113.7 372.7 116.7V116.7zM244.7 84.69C241.7 87.69 240 91.76 240 96C240 99.16 240.9 102.3 242.7 104.9C244.5 107.5 246.1 109.6 249.9 110.8C252.8 111.1 256 112.3 259.1 111.7C262.2 111.1 265.1 109.6 267.3 107.3C269.6 105.1 271.1 102.2 271.7 99.12C272.3 96.02 271.1 92.8 270.8 89.88C269.6 86.95 267.5 84.45 264.9 82.7C262.3 80.94 259.2 79.1 256 79.1C251.8 79.1 247.7 81.69 244.7 84.69V84.69zM116.7 116.7C113.7 119.7 112 123.8 112 128C112 131.2 112.9 134.3 114.7 136.9C116.5 139.5 118.1 141.6 121.9 142.8C124.8 143.1 128 144.3 131.1 143.7C134.2 143.1 137.1 141.6 139.3 139.3C141.6 137.1 143.1 134.2 143.7 131.1C144.3 128 143.1 124.8 142.8 121.9C141.6 118.1 139.5 116.5 136.9 114.7C134.3 112.9 131.2 111.1 128 111.1C123.8 111.1 119.7 113.7 116.7 116.7L116.7 116.7z"})})},frequent:{outline:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[x("path",{d:"M13 4h-2l-.001 7H9v2h2v2h2v-2h4v-2h-4z"}),x("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10"})]}),solid:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:x("path",{d:"M256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512zM232 256C232 264 236 271.5 242.7 275.1L338.7 339.1C349.7 347.3 364.6 344.3 371.1 333.3C379.3 322.3 376.3 307.4 365.3 300L280 243.2V120C280 106.7 269.3 96 255.1 96C242.7 96 231.1 106.7 231.1 120L232 256z"})})},nature:{outline:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[x("path",{d:"M15.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 15.5 8M8.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 8.5 8"}),x("path",{d:"M18.933 0h-.027c-.97 0-2.138.787-3.018 1.497-1.274-.374-2.612-.51-3.887-.51-1.285 0-2.616.133-3.874.517C7.245.79 6.069 0 5.093 0h-.027C3.352 0 .07 2.67.002 7.026c-.039 2.479.276 4.238 1.04 5.013.254.258.882.677 1.295.882.191 3.177.922 5.238 2.536 6.38.897.637 2.187.949 3.2 1.102C8.04 20.6 8 20.795 8 21c0 1.773 2.35 3 4 3 1.648 0 4-1.227 4-3 0-.201-.038-.393-.072-.586 2.573-.385 5.435-1.877 5.925-7.587.396-.22.887-.568 1.104-.788.763-.774 1.079-2.534 1.04-5.013C23.929 2.67 20.646 0 18.933 0M3.223 9.135c-.237.281-.837 1.155-.884 1.238-.15-.41-.368-1.349-.337-3.291.051-3.281 2.478-4.972 3.091-5.031.256.015.731.27 1.265.646-1.11 1.171-2.275 2.915-2.352 5.125-.133.546-.398.858-.783 1.313M12 22c-.901 0-1.954-.693-2-1 0-.654.475-1.236 1-1.602V20a1 1 0 1 0 2 0v-.602c.524.365 1 .947 1 1.602-.046.307-1.099 1-2 1m3-3.48v.02a4.752 4.752 0 0 0-1.262-1.02c1.092-.516 2.239-1.334 2.239-2.217 0-1.842-1.781-2.195-3.977-2.195-2.196 0-3.978.354-3.978 2.195 0 .883 1.148 1.701 2.238 2.217A4.8 4.8 0 0 0 9 18.539v-.025c-1-.076-2.182-.281-2.973-.842-1.301-.92-1.838-3.045-1.853-6.478l.023-.041c.496-.826 1.49-1.45 1.804-3.102 0-2.047 1.357-3.631 2.362-4.522C9.37 3.178 10.555 3 11.948 3c1.447 0 2.685.192 3.733.57 1 .9 2.316 2.465 2.316 4.48.313 1.651 1.307 2.275 1.803 3.102.035.058.068.117.102.178-.059 5.967-1.949 7.01-4.902 7.19m6.628-8.202c-.037-.065-.074-.13-.113-.195a7.587 7.587 0 0 0-.739-.987c-.385-.455-.648-.768-.782-1.313-.076-2.209-1.241-3.954-2.353-5.124.531-.376 1.004-.63 1.261-.647.636.071 3.044 1.764 3.096 5.031.027 1.81-.347 3.218-.37 3.235"})]}),solid:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",children:x("path",{d:"M332.7 19.85C334.6 8.395 344.5 0 356.1 0C363.6 0 370.6 3.52 375.1 9.502L392 32H444.1C456.8 32 469.1 37.06 478.1 46.06L496 64H552C565.3 64 576 74.75 576 88V112C576 156.2 540.2 192 496 192H426.7L421.6 222.5L309.6 158.5L332.7 19.85zM448 64C439.2 64 432 71.16 432 80C432 88.84 439.2 96 448 96C456.8 96 464 88.84 464 80C464 71.16 456.8 64 448 64zM416 256.1V480C416 497.7 401.7 512 384 512H352C334.3 512 320 497.7 320 480V364.8C295.1 377.1 268.8 384 240 384C211.2 384 184 377.1 160 364.8V480C160 497.7 145.7 512 128 512H96C78.33 512 64 497.7 64 480V249.8C35.23 238.9 12.64 214.5 4.836 183.3L.9558 167.8C-3.331 150.6 7.094 133.2 24.24 128.1C41.38 124.7 58.76 135.1 63.05 152.2L66.93 167.8C70.49 182 83.29 191.1 97.97 191.1H303.8L416 256.1z"})})},objects:{outline:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[x("path",{d:"M12 0a9 9 0 0 0-5 16.482V21s2.035 3 5 3 5-3 5-3v-4.518A9 9 0 0 0 12 0zm0 2c3.86 0 7 3.141 7 7s-3.14 7-7 7-7-3.141-7-7 3.14-7 7-7zM9 17.477c.94.332 1.946.523 3 .523s2.06-.19 3-.523v.834c-.91.436-1.925.689-3 .689a6.924 6.924 0 0 1-3-.69v-.833zm.236 3.07A8.854 8.854 0 0 0 12 21c.965 0 1.888-.167 2.758-.451C14.155 21.173 13.153 22 12 22c-1.102 0-2.117-.789-2.764-1.453z"}),x("path",{d:"M14.745 12.449h-.004c-.852-.024-1.188-.858-1.577-1.824-.421-1.061-.703-1.561-1.182-1.566h-.009c-.481 0-.783.497-1.235 1.537-.436.982-.801 1.811-1.636 1.791l-.276-.043c-.565-.171-.853-.691-1.284-1.794-.125-.313-.202-.632-.27-.913-.051-.213-.127-.53-.195-.634C7.067 9.004 7.039 9 6.99 9A1 1 0 0 1 7 7h.01c1.662.017 2.015 1.373 2.198 2.134.486-.981 1.304-2.058 2.797-2.075 1.531.018 2.28 1.153 2.731 2.141l.002-.008C14.944 8.424 15.327 7 16.979 7h.032A1 1 0 1 1 17 9h-.011c-.149.076-.256.474-.319.709a6.484 6.484 0 0 1-.311.951c-.429.973-.79 1.789-1.614 1.789"})]}),solid:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",children:x("path",{d:"M112.1 454.3c0 6.297 1.816 12.44 5.284 17.69l17.14 25.69c5.25 7.875 17.17 14.28 26.64 14.28h61.67c9.438 0 21.36-6.401 26.61-14.28l17.08-25.68c2.938-4.438 5.348-12.37 5.348-17.7L272 415.1h-160L112.1 454.3zM191.4 .0132C89.44 .3257 16 82.97 16 175.1c0 44.38 16.44 84.84 43.56 115.8c16.53 18.84 42.34 58.23 52.22 91.45c.0313 .25 .0938 .5166 .125 .7823h160.2c.0313-.2656 .0938-.5166 .125-.7823c9.875-33.22 35.69-72.61 52.22-91.45C351.6 260.8 368 220.4 368 175.1C368 78.61 288.9-.2837 191.4 .0132zM192 96.01c-44.13 0-80 35.89-80 79.1C112 184.8 104.8 192 96 192S80 184.8 80 176c0-61.76 50.25-111.1 112-111.1c8.844 0 16 7.159 16 16S200.8 96.01 192 96.01z"})})},people:{outline:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[x("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10"}),x("path",{d:"M8 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 8 7M16 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 16 7M15.232 15c-.693 1.195-1.87 2-3.349 2-1.477 0-2.655-.805-3.347-2H15m3-2H6a6 6 0 1 0 12 0"})]}),solid:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:x("path",{d:"M0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256zM256 432C332.1 432 396.2 382 415.2 314.1C419.1 300.4 407.8 288 393.6 288H118.4C104.2 288 92.92 300.4 96.76 314.1C115.8 382 179.9 432 256 432V432zM176.4 160C158.7 160 144.4 174.3 144.4 192C144.4 209.7 158.7 224 176.4 224C194 224 208.4 209.7 208.4 192C208.4 174.3 194 160 176.4 160zM336.4 224C354 224 368.4 209.7 368.4 192C368.4 174.3 354 160 336.4 160C318.7 160 304.4 174.3 304.4 192C304.4 209.7 318.7 224 336.4 224z"})})},places:{outline:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[x("path",{d:"M6.5 12C5.122 12 4 13.121 4 14.5S5.122 17 6.5 17 9 15.879 9 14.5 7.878 12 6.5 12m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5M17.5 12c-1.378 0-2.5 1.121-2.5 2.5s1.122 2.5 2.5 2.5 2.5-1.121 2.5-2.5-1.122-2.5-2.5-2.5m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5"}),x("path",{d:"M22.482 9.494l-1.039-.346L21.4 9h.6c.552 0 1-.439 1-.992 0-.006-.003-.008-.003-.008H23c0-1-.889-2-1.984-2h-.642l-.731-1.717C19.262 3.012 18.091 2 16.764 2H7.236C5.909 2 4.738 3.012 4.357 4.283L3.626 6h-.642C1.889 6 1 7 1 8h.003S1 8.002 1 8.008C1 8.561 1.448 9 2 9h.6l-.043.148-1.039.346a2.001 2.001 0 0 0-1.359 2.097l.751 7.508a1 1 0 0 0 .994.901H3v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h6v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h1.096a.999.999 0 0 0 .994-.901l.751-7.508a2.001 2.001 0 0 0-1.359-2.097M6.273 4.857C6.402 4.43 6.788 4 7.236 4h9.527c.448 0 .834.43.963.857L19.313 9H4.688l1.585-4.143zM7 21H5v-1h2v1zm12 0h-2v-1h2v1zm2.189-3H2.811l-.662-6.607L3 11h18l.852.393L21.189 18z"})]}),solid:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:x("path",{d:"M39.61 196.8L74.8 96.29C88.27 57.78 124.6 32 165.4 32H346.6C387.4 32 423.7 57.78 437.2 96.29L472.4 196.8C495.6 206.4 512 229.3 512 256V448C512 465.7 497.7 480 480 480H448C430.3 480 416 465.7 416 448V400H96V448C96 465.7 81.67 480 64 480H32C14.33 480 0 465.7 0 448V256C0 229.3 16.36 206.4 39.61 196.8V196.8zM109.1 192H402.9L376.8 117.4C372.3 104.6 360.2 96 346.6 96H165.4C151.8 96 139.7 104.6 135.2 117.4L109.1 192zM96 256C78.33 256 64 270.3 64 288C64 305.7 78.33 320 96 320C113.7 320 128 305.7 128 288C128 270.3 113.7 256 96 256zM416 320C433.7 320 448 305.7 448 288C448 270.3 433.7 256 416 256C398.3 256 384 270.3 384 288C384 305.7 398.3 320 416 320z"})})},symbols:{outline:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:x("path",{d:"M0 0h11v2H0zM4 11h3V6h4V4H0v2h4zM15.5 17c1.381 0 2.5-1.116 2.5-2.493s-1.119-2.493-2.5-2.493S13 13.13 13 14.507 14.119 17 15.5 17m0-2.986c.276 0 .5.222.5.493 0 .272-.224.493-.5.493s-.5-.221-.5-.493.224-.493.5-.493M21.5 19.014c-1.381 0-2.5 1.116-2.5 2.493S20.119 24 21.5 24s2.5-1.116 2.5-2.493-1.119-2.493-2.5-2.493m0 2.986a.497.497 0 0 1-.5-.493c0-.271.224-.493.5-.493s.5.222.5.493a.497.497 0 0 1-.5.493M22 13l-9 9 1.513 1.5 8.99-9.009zM17 11c2.209 0 4-1.119 4-2.5V2s.985-.161 1.498.949C23.01 4.055 23 6 23 6s1-1.119 1-3.135C24-.02 21 0 21 0h-2v6.347A5.853 5.853 0 0 0 17 6c-2.209 0-4 1.119-4 2.5s1.791 2.5 4 2.5M10.297 20.482l-1.475-1.585a47.54 47.54 0 0 1-1.442 1.129c-.307-.288-.989-1.016-2.045-2.183.902-.836 1.479-1.466 1.729-1.892s.376-.871.376-1.336c0-.592-.273-1.178-.818-1.759-.546-.581-1.329-.871-2.349-.871-1.008 0-1.79.293-2.344.879-.556.587-.832 1.181-.832 1.784 0 .813.419 1.748 1.256 2.805-.847.614-1.444 1.208-1.794 1.784a3.465 3.465 0 0 0-.523 1.833c0 .857.308 1.56.924 2.107.616.549 1.423.823 2.42.823 1.173 0 2.444-.379 3.813-1.137L8.235 24h2.819l-2.09-2.383 1.333-1.135zm-6.736-6.389a1.02 1.02 0 0 1 .73-.286c.31 0 .559.085.747.254a.849.849 0 0 1 .283.659c0 .518-.419 1.112-1.257 1.784-.536-.651-.805-1.231-.805-1.742a.901.901 0 0 1 .302-.669M3.74 22c-.427 0-.778-.116-1.057-.349-.279-.232-.418-.487-.418-.766 0-.594.509-1.288 1.527-2.083.968 1.134 1.717 1.946 2.248 2.438-.921.507-1.686.76-2.3.76"})}),solid:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:x("path",{d:"M500.3 7.251C507.7 13.33 512 22.41 512 31.1V175.1C512 202.5 483.3 223.1 447.1 223.1C412.7 223.1 383.1 202.5 383.1 175.1C383.1 149.5 412.7 127.1 447.1 127.1V71.03L351.1 90.23V207.1C351.1 234.5 323.3 255.1 287.1 255.1C252.7 255.1 223.1 234.5 223.1 207.1C223.1 181.5 252.7 159.1 287.1 159.1V63.1C287.1 48.74 298.8 35.61 313.7 32.62L473.7 .6198C483.1-1.261 492.9 1.173 500.3 7.251H500.3zM74.66 303.1L86.5 286.2C92.43 277.3 102.4 271.1 113.1 271.1H174.9C185.6 271.1 195.6 277.3 201.5 286.2L213.3 303.1H239.1C266.5 303.1 287.1 325.5 287.1 351.1V463.1C287.1 490.5 266.5 511.1 239.1 511.1H47.1C21.49 511.1-.0019 490.5-.0019 463.1V351.1C-.0019 325.5 21.49 303.1 47.1 303.1H74.66zM143.1 359.1C117.5 359.1 95.1 381.5 95.1 407.1C95.1 434.5 117.5 455.1 143.1 455.1C170.5 455.1 191.1 434.5 191.1 407.1C191.1 381.5 170.5 359.1 143.1 359.1zM440.3 367.1H496C502.7 367.1 508.6 372.1 510.1 378.4C513.3 384.6 511.6 391.7 506.5 396L378.5 508C372.9 512.1 364.6 513.3 358.6 508.9C352.6 504.6 350.3 496.6 353.3 489.7L391.7 399.1H336C329.3 399.1 323.4 395.9 321 389.6C318.7 383.4 320.4 376.3 325.5 371.1L453.5 259.1C459.1 255 467.4 254.7 473.4 259.1C479.4 263.4 481.6 271.4 478.7 278.3L440.3 367.1zM116.7 219.1L19.85 119.2C-8.112 90.26-6.614 42.31 24.85 15.34C51.82-8.137 93.26-3.642 118.2 21.83L128.2 32.32L137.7 21.83C162.7-3.642 203.6-8.137 231.6 15.34C262.6 42.31 264.1 90.26 236.1 119.2L139.7 219.1C133.2 225.6 122.7 225.6 116.7 219.1H116.7z"})})}},Vi={loupe:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:x("path",{d:"M12.9 14.32a8 8 0 1 1 1.41-1.41l5.35 5.33-1.42 1.42-5.33-5.34zM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z"})}),delete:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:x("path",{d:"M10 8.586L2.929 1.515 1.515 2.929 8.586 10l-7.071 7.071 1.414 1.414L10 11.414l7.071 7.071 1.414-1.414L11.414 10l7.071-7.071-1.414-1.414L10 8.586z"})})};var st={categories:qi,search:Vi};function Lt(e){let{id:t,skin:n,emoji:r}=e;if(e.shortcodes){const a=e.shortcodes.match(xe.SHORTCODES_REGEX);a&&(t=a[1],a[2]&&(n=a[2]))}if(r||(r=xe.get(t||e.native)),!r)return e.fallback;const s=r.skins[n-1]||r.skins[0],o=s.src||(e.set!="native"&&!e.spritesheet?typeof e.getImageURL=="function"?e.getImageURL(e.set,s.unified):`https://cdn.jsdelivr.net/npm/emoji-datasource-${e.set}@15.0.1/img/${e.set}/64/${s.unified}.png`:void 0),i=typeof e.getSpritesheetURL=="function"?e.getSpritesheetURL(e.set):`https://cdn.jsdelivr.net/npm/emoji-datasource-${e.set}@15.0.1/img/${e.set}/sheets-256/64.png`;return x("span",{class:"emoji-mart-emoji","data-emoji-set":e.set,children:o?x("img",{style:{maxWidth:e.size||"1em",maxHeight:e.size||"1em",display:"inline-block"},alt:s.native||s.shortcodes,src:o}):e.set=="native"?x("span",{style:{fontSize:e.size,fontFamily:'"EmojiMart", "Segoe UI Emoji", "Segoe UI Symbol", "Segoe UI", "Apple Color Emoji", "Twemoji Mozilla", "Noto Color Emoji", "Android Emoji"'},children:s.native}):x("span",{style:{display:"block",width:e.size,height:e.size,backgroundImage:`url(${i})`,backgroundSize:`${100*D.sheet.cols}% ${100*D.sheet.rows}%`,backgroundPosition:`${100/(D.sheet.cols-1)*s.x}% ${100/(D.sheet.rows-1)*s.y}%`}})})}const Wi=typeof window<"u"&&window.HTMLElement?window.HTMLElement:Object;class ks extends Wi{static get observedAttributes(){return Object.keys(this.Props)}update(t={}){for(let n in t)this.attributeChangedCallback(n,null,t[n])}attributeChangedCallback(t,n,r){if(!this.component)return;const s=ws(t,{[t]:r},this.constructor.Props,this);this.component.componentWillReceiveProps?this.component.componentWillReceiveProps({[t]:s}):(this.component.props[t]=s,this.component.forceUpdate())}disconnectedCallback(){this.disconnected=!0,this.component&&this.component.unregister&&this.component.unregister()}constructor(t={}){if(super(),this.props=t,t.parent||t.ref){let n=null;const r=t.parent||(n=t.ref&&t.ref.current);n&&(n.innerHTML=""),r&&r.appendChild(this)}}}class Ji extends ks{setShadow(){this.attachShadow({mode:"open"})}injectStyles(t){if(!t)return;const n=document.createElement("style");n.textContent=t,this.shadowRoot.insertBefore(n,this.shadowRoot.firstChild)}constructor(t,{styles:n}={}){super(t),this.setShadow(),this.injectStyles(n)}}var Cs={fallback:"",id:"",native:"",shortcodes:"",size:{value:"",transform:e=>/\D/.test(e)?e:`${e}px`},set:he.set,skin:he.skin};class Ss extends ks{async connectedCallback(){const t=_s(this.props,Cs,this);t.element=this,t.ref=n=>{this.component=n},await ft(),!this.disconnected&&ms(x(Lt,{...t}),this)}constructor(t){super(t)}}oe(Ss,"Props",Cs);typeof customElements<"u"&&!customElements.get("em-emoji")&&customElements.define("em-emoji",Ss);var _n,Pt=[],wn=R.__b,kn=R.__r,Cn=R.diffed,Sn=R.__c,$n=R.unmount;function Xi(){var e;for(Pt.sort(function(t,n){return t.__v.__b-n.__v.__b});e=Pt.pop();)if(e.__P)try{e.__H.__h.forEach(Ye),e.__H.__h.forEach(zt),e.__H.__h=[]}catch(t){e.__H.__h=[],R.__e(t,e.__v)}}R.__b=function(e){wn&&wn(e)},R.__r=function(e){kn&&kn(e);var t=e.__c.__H;t&&(t.__h.forEach(Ye),t.__h.forEach(zt),t.__h=[])},R.diffed=function(e){Cn&&Cn(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(Pt.push(t)!==1&&_n===R.requestAnimationFrame||((_n=R.requestAnimationFrame)||function(n){var r,s=function(){clearTimeout(o),En&&cancelAnimationFrame(r),setTimeout(n)},o=setTimeout(s,100);En&&(r=requestAnimationFrame(s))})(Xi))},R.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Ye),n.__h=n.__h.filter(function(r){return!r.__||zt(r)})}catch(r){t.some(function(s){s.__h&&(s.__h=[])}),t=[],R.__e(r,n.__v)}}),Sn&&Sn(e,t)},R.unmount=function(e){$n&&$n(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Ye(r)}catch(s){t=s}}),t&&R.__e(t,n.__v))};var En=typeof requestAnimationFrame=="function";function Ye(e){var t=e.__c;typeof t=="function"&&(e.__c=void 0,t())}function zt(e){e.__c=e.__()}function Ki(e,t){for(var n in t)e[n]=t[n];return e}function jn(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function ot(e){this.props=e}(ot.prototype=new le).isPureReactComponent=!0,ot.prototype.shouldComponentUpdate=function(e,t){return jn(this.props,e)||jn(this.state,t)};var Rn=R.__b;R.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Rn&&Rn(e)};var Gi=R.__e;R.__e=function(e,t,n){if(e.then){for(var r,s=t;s=s.__;)if((r=s.__c)&&r.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t)}Gi(e,t,n)};var Tn=R.unmount;function _t(){this.__u=0,this.t=null,this.__b=null}function $s(e){var t=e.__.__c;return t&&t.__e&&t.__e(e)}function qe(){this.u=null,this.o=null}R.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&e.__h===!0&&(e.type=null),Tn&&Tn(e)},(_t.prototype=new le).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var s=$s(r.__v),o=!1,i=function(){o||(o=!0,n.__R=null,s?s(a):a())};n.__R=i;var a=function(){if(!--r.__u){if(r.state.__e){var u=r.state.__e;r.__v.__k[0]=(function f(h,b,d){return h&&(h.__v=null,h.__k=h.__k&&h.__k.map(function(v){return f(v,b,d)}),h.__c&&h.__c.__P===b&&(h.__e&&d.insertBefore(h.__e,h.__d),h.__c.__e=!0,h.__c.__P=d)),h})(u,u.__c.__P,u.__c.__O)}var l;for(r.setState({__e:r.__b=null});l=r.t.pop();)l.forceUpdate()}},c=t.__h===!0;r.__u++||c||r.setState({__e:r.__b=r.__v.__k[0]}),e.then(i,i)},_t.prototype.componentWillUnmount=function(){this.t=[]},_t.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=(function o(i,a,c){return i&&(i.__c&&i.__c.__H&&(i.__c.__H.__.forEach(function(u){typeof u.__c=="function"&&u.__c()}),i.__c.__H=null),(i=Ki({},i)).__c!=null&&(i.__c.__P===c&&(i.__c.__P=a),i.__c=null),i.__k=i.__k&&i.__k.map(function(u){return o(u,a,c)})),i})(this.__b,n,r.__O=r.__P)}this.__b=null}var s=t.__e&&Rt(we,null,e.fallback);return s&&(s.__h=null),[Rt(we,null,t.__e?null:e.children),s]};var Mn=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};(qe.prototype=new le).__e=function(e){var t=this,n=$s(t.__v),r=t.o.get(e);return r[0]++,function(s){var o=function(){t.props.revealOrder?(r.push(s),Mn(t,e,r)):s()};n?n(o):o()}},qe.prototype.render=function(e){this.u=null,this.o=new Map;var t=nt(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},qe.prototype.componentDidUpdate=qe.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){Mn(e,n,t)})};var Yi=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Zi=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Qi=typeof document<"u",ea=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/i:/fil|che|ra/i).test(e)};le.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(le.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Ln=R.event;function ta(){}function na(){return this.cancelBubble}function ra(){return this.defaultPrevented}R.event=function(e){return Ln&&(e=Ln(e)),e.persist=ta,e.isPropagationStopped=na,e.isDefaultPrevented=ra,e.nativeEvent=e};var Pn={configurable:!0,get:function(){return this.class}},zn=R.vnode;R.vnode=function(e){var t=e.type,n=e.props,r=n;if(typeof t=="string"){var s=t.indexOf("-")===-1;for(var o in r={},n){var i=n[o];Qi&&o==="children"&&t==="noscript"||o==="value"&&"defaultValue"in n&&i==null||(o==="defaultValue"&&"value"in n&&n.value==null?o="value":o==="download"&&i===!0?i="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+t)&&!ea(n.type)?o="oninput":/^onfocus$/i.test(o)?o="onfocusin":/^onblur$/i.test(o)?o="onfocusout":/^on(Ani|Tra|Tou|BeforeInp)/.test(o)?o=o.toLowerCase():s&&Zi.test(o)?o=o.replace(/[A-Z0-9]/,"-$&").toLowerCase():i===null&&(i=void 0),r[o]=i)}t=="select"&&r.multiple&&Array.isArray(r.value)&&(r.value=nt(n.children).forEach(function(a){a.props.selected=r.value.indexOf(a.props.value)!=-1})),t=="select"&&r.defaultValue!=null&&(r.value=nt(n.children).forEach(function(a){a.props.selected=r.multiple?r.defaultValue.indexOf(a.props.value)!=-1:r.defaultValue==a.props.value})),e.props=r,n.class!=n.className&&(Pn.enumerable="className"in n,n.className!=null&&(r.class=n.className),Object.defineProperty(r,"className",Pn))}e.$$typeof=Yi,zn&&zn(e)};var Nn=R.__r;R.__r=function(e){Nn&&Nn(e),e.__c};const sa={light:"outline",dark:"solid"};class oa extends ot{renderIcon(t){const{icon:n}=t;if(n){if(n.svg)return x("span",{class:"flex",dangerouslySetInnerHTML:{__html:n.svg}});if(n.src)return x("img",{src:n.src})}const r=st.categories[t.id]||st.categories.custom,s=this.props.icons=="auto"?sa[this.props.theme]:this.props.icons;return r[s]||r}render(){let t=null;return x("nav",{id:"nav",class:"padding","data-position":this.props.position,dir:this.props.dir,children:x("div",{class:"flex relative",children:[this.categories.map((n,r)=>{const s=n.name||G.categories[n.id],o=!this.props.unfocused&&n.id==this.state.categoryId;return o&&(t=r),x("button",{"aria-label":s,"aria-selected":o||void 0,title:s,type:"button",class:"flex flex-grow flex-center",onMouseDown:i=>i.preventDefault(),onClick:()=>{this.props.onClick({category:n,i:r})},children:this.renderIcon(n)})}),x("div",{class:"bar",style:{width:`${100/this.categories.length}%`,opacity:t==null?0:1,transform:this.props.dir==="rtl"?`scaleX(-1) translateX(${t*100}%)`:`translateX(${t*100}%)`}})]})})}constructor(){super(),this.categories=D.categories.filter(t=>!t.target),this.state={categoryId:this.categories[0].id}}}class ia extends ot{shouldComponentUpdate(t){for(let n in t)if(n!="children"&&t[n]!=this.props[n])return!0;return!1}render(){return this.props.children}}const Ve={rowsPerRender:10};class aa extends le{getInitialState(t=this.props){return{skin:ge.get("skin")||t.skin,theme:this.initTheme(t.theme)}}componentWillMount(){this.dir=G.rtl?"rtl":"ltr",this.refs={menu:pe(),navigation:pe(),scroll:pe(),search:pe(),searchInput:pe(),skinToneButton:pe(),skinToneRadio:pe()},this.initGrid(),this.props.stickySearch==!1&&this.props.searchPosition=="sticky"&&(console.warn("[EmojiMart] Deprecation warning: `stickySearch` has been renamed `searchPosition`."),this.props.searchPosition="static")}componentDidMount(){if(this.register(),this.shadowRoot=this.base.parentNode,this.props.autoFocus){const{searchInput:t}=this.refs;t.current&&t.current.focus()}}componentWillReceiveProps(t){this.nextState||(this.nextState={});for(const n in t)this.nextState[n]=t[n];clearTimeout(this.nextStateTimer),this.nextStateTimer=setTimeout(()=>{let n=!1;for(const s in this.nextState)this.props[s]=this.nextState[s],(s==="custom"||s==="categories")&&(n=!0);delete this.nextState;const r=this.getInitialState();if(n)return this.reset(r);this.setState(r)})}componentWillUnmount(){this.unregister()}async reset(t={}){await ft(this.props),this.initGrid(),this.unobserve(),this.setState(t,()=>{this.observeCategories(),this.observeRows()})}register(){document.addEventListener("click",this.handleClickOutside),this.observe()}unregister(){var t;document.removeEventListener("click",this.handleClickOutside),(t=this.darkMedia)==null||t.removeEventListener("change",this.darkMediaCallback),this.unobserve()}observe(){this.observeCategories(),this.observeRows()}unobserve({except:t=[]}={}){Array.isArray(t)||(t=[t]);for(const n of this.observers)t.includes(n)||n.disconnect();this.observers=[].concat(t)}initGrid(){const{categories:t}=D;this.refs.categories=new Map;const n=D.categories.map(s=>s.id).join(",");this.navKey&&this.navKey!=n&&this.refs.scroll.current&&(this.refs.scroll.current.scrollTop=0),this.navKey=n,this.grid=[],this.grid.setsize=0;const r=(s,o)=>{const i=[];i.__categoryId=o.id,i.__index=s.length,this.grid.push(i);const a=this.grid.length-1,c=a%Ve.rowsPerRender?{}:pe();return c.index=a,c.posinset=this.grid.setsize+1,s.push(c),i};for(let s of t){const o=[];let i=r(o,s);for(let a of s.emojis)i.length==this.getPerLine()&&(i=r(o,s)),this.grid.setsize+=1,i.push(a);this.refs.categories.set(s.id,{root:pe(),rows:o})}}initTheme(t){if(t!="auto")return t;if(!this.darkMedia){if(this.darkMedia=matchMedia("(prefers-color-scheme: dark)"),this.darkMedia.media.match(/^not/))return"light";this.darkMedia.addEventListener("change",this.darkMediaCallback)}return this.darkMedia.matches?"dark":"light"}initDynamicPerLine(t=this.props){if(!t.dynamicWidth)return;const{element:n,emojiButtonSize:r}=t,s=()=>{const{width:i}=n.getBoundingClientRect();return Math.floor(i/r)},o=new ResizeObserver(()=>{this.unobserve({except:o}),this.setState({perLine:s()},()=>{this.initGrid(),this.forceUpdate(()=>{this.observeCategories(),this.observeRows()})})});return o.observe(n),this.observers.push(o),s()}getPerLine(){return this.state.perLine||this.props.perLine}getEmojiByPos([t,n]){const r=this.state.searchResults||this.grid,s=r[t]&&r[t][n];if(s)return xe.get(s)}observeCategories(){const t=this.refs.navigation.current;if(!t)return;const n=new Map,r=i=>{i!=t.state.categoryId&&t.setState({categoryId:i})},s={root:this.refs.scroll.current,threshold:[0,1]},o=new IntersectionObserver(i=>{for(const c of i){const u=c.target.dataset.id;n.set(u,c.intersectionRatio)}const a=[...n];for(const[c,u]of a)if(u){r(c);break}},s);for(const{root:i}of this.refs.categories.values())o.observe(i.current);this.observers.push(o)}observeRows(){const t={...this.state.visibleRows},n=new IntersectionObserver(r=>{for(const s of r){const o=parseInt(s.target.dataset.index);s.isIntersecting?t[o]=!0:delete t[o]}this.setState({visibleRows:t})},{root:this.refs.scroll.current,rootMargin:`${this.props.emojiButtonSize*(Ve.rowsPerRender+5)}px 0px ${this.props.emojiButtonSize*Ve.rowsPerRender}px`});for(const{rows:r}of this.refs.categories.values())for(const s of r)s.current&&n.observe(s.current);this.observers.push(n)}preventDefault(t){t.preventDefault()}unfocusSearch(){const t=this.refs.searchInput.current;t&&t.blur()}navigate({e:t,input:n,left:r,right:s,up:o,down:i}){const a=this.state.searchResults||this.grid;if(!a.length)return;let[c,u]=this.state.pos;const l=(()=>{if(c==0&&u==0&&!t.repeat&&(r||o))return null;if(c==-1)return!t.repeat&&(s||i)&&n.selectionStart==n.value.length?[0,0]:null;if(r||s){let f=a[c];const h=r?-1:1;if(u+=h,!f[u]){if(c+=h,f=a[c],!f)return c=r?0:a.length-1,u=r?0:a[c].length-1,[c,u];u=r?f.length-1:0}return[c,u]}if(o||i){c+=o?-1:1;const f=a[c];return f?(f[u]||(u=f.length-1),[c,u]):(c=o?0:a.length-1,u=o?0:a[c].length-1,[c,u])}})();if(l)t.preventDefault();else{this.state.pos[0]>-1&&this.setState({pos:[-1,-1]});return}this.setState({pos:l,keyboard:!0},()=>{this.scrollTo({row:l[0]})})}scrollTo({categoryId:t,row:n}){const r=this.state.searchResults||this.grid;if(!r.length)return;const s=this.refs.scroll.current,o=s.getBoundingClientRect();let i=0;if(n>=0&&(t=r[n].__categoryId),t&&(i=(this.refs[t]||this.refs.categories.get(t).root).current.getBoundingClientRect().top-(o.top-s.scrollTop)+1),n>=0)if(!n)i=0;else{const a=r[n].__index,c=i+a*this.props.emojiButtonSize,u=c+this.props.emojiButtonSize+this.props.emojiButtonSize*.88;if(c<s.scrollTop)i=c;else if(u>s.scrollTop+o.height)i=u-o.height;else return}this.ignoreMouse(),s.scrollTop=i}ignoreMouse(){this.mouseIsIgnored=!0,clearTimeout(this.ignoreMouseTimer),this.ignoreMouseTimer=setTimeout(()=>{delete this.mouseIsIgnored},100)}handleEmojiOver(t){this.mouseIsIgnored||this.state.showSkins||this.setState({pos:t||[-1,-1],keyboard:!1})}handleEmojiClick({e:t,emoji:n,pos:r}){if(this.props.onEmojiSelect&&(!n&&r&&(n=this.getEmojiByPos(r)),n)){const s=Hi(n,{skinIndex:this.state.skin-1});this.props.maxFrequentRows&&bs.add(s,this.props),this.props.onEmojiSelect(s,t)}}closeSkins(){this.state.showSkins&&(this.setState({showSkins:null,tempSkin:null}),this.base.removeEventListener("click",this.handleBaseClick),this.base.removeEventListener("keydown",this.handleBaseKeydown))}handleSkinMouseOver(t){this.setState({tempSkin:t})}handleSkinClick(t){this.ignoreMouse(),this.closeSkins(),this.setState({skin:t,tempSkin:null}),ge.set("skin",t)}renderNav(){return x(oa,{ref:this.refs.navigation,icons:this.props.icons,theme:this.state.theme,dir:this.dir,unfocused:!!this.state.searchResults,position:this.props.navPosition,onClick:this.handleCategoryClick},this.navKey)}renderPreview(){const t=this.getEmojiByPos(this.state.pos),n=this.state.searchResults&&!this.state.searchResults.length;return x("div",{id:"preview",class:"flex flex-middle",dir:this.dir,"data-position":this.props.previewPosition,children:[x("div",{class:"flex flex-middle flex-grow",children:[x("div",{class:"flex flex-auto flex-middle flex-center",style:{height:this.props.emojiButtonSize,fontSize:this.props.emojiButtonSize},children:x(Lt,{emoji:t,id:n?this.props.noResultsEmoji||"cry":this.props.previewEmoji||(this.props.previewPosition=="top"?"point_down":"point_up"),set:this.props.set,size:this.props.emojiButtonSize,skin:this.state.tempSkin||this.state.skin,spritesheet:!0,getSpritesheetURL:this.props.getSpritesheetURL})}),x("div",{class:`margin-${this.dir[0]}`,children:t||n?x("div",{class:`padding-${this.dir[2]} align-${this.dir[0]}`,children:[x("div",{class:"preview-title ellipsis",children:t?t.name:G.search_no_results_1}),x("div",{class:"preview-subtitle ellipsis color-c",children:t?t.skins[0].shortcodes:G.search_no_results_2})]}):x("div",{class:"preview-placeholder color-c",children:G.pick})})]}),!t&&this.props.skinTonePosition=="preview"&&this.renderSkinToneButton()]})}renderEmojiButton(t,{pos:n,posinset:r,grid:s}){const o=this.props.emojiButtonSize,i=this.state.tempSkin||this.state.skin,c=(t.skins[i-1]||t.skins[0]).native,u=Bi(this.state.pos,n),l=n.concat(t.id).join("");return x(ia,{selected:u,skin:i,size:o,children:x("button",{"aria-label":c,"aria-selected":u||void 0,"aria-posinset":r,"aria-setsize":s.setsize,"data-keyboard":this.state.keyboard,title:this.props.previewPosition=="none"?t.name:void 0,type:"button",class:"flex flex-center flex-middle",tabindex:"-1",onClick:f=>this.handleEmojiClick({e:f,emoji:t}),onMouseEnter:()=>this.handleEmojiOver(n),onMouseLeave:()=>this.handleEmojiOver(),style:{width:this.props.emojiButtonSize,height:this.props.emojiButtonSize,fontSize:this.props.emojiSize,lineHeight:0},children:[x("div",{"aria-hidden":"true",class:"background",style:{borderRadius:this.props.emojiButtonRadius,backgroundColor:this.props.emojiButtonColors?this.props.emojiButtonColors[(r-1)%this.props.emojiButtonColors.length]:void 0}}),x(Lt,{emoji:t,set:this.props.set,size:this.props.emojiSize,skin:i,spritesheet:!0,getSpritesheetURL:this.props.getSpritesheetURL})]})},l)}renderSearch(){const t=this.props.previewPosition=="none"||this.props.skinTonePosition=="search";return x("div",{children:[x("div",{class:"spacer"}),x("div",{class:"flex flex-middle",children:[x("div",{class:"search relative flex-grow",children:[x("input",{type:"search",ref:this.refs.searchInput,placeholder:G.search,onClick:this.handleSearchClick,onInput:this.handleSearchInput,onKeyDown:this.handleSearchKeyDown,autoComplete:"off"}),x("span",{class:"icon loupe flex",children:st.search.loupe}),this.state.searchResults&&x("button",{title:"Clear","aria-label":"Clear",type:"button",class:"icon delete flex",onClick:this.clearSearch,onMouseDown:this.preventDefault,children:st.search.delete})]}),t&&this.renderSkinToneButton()]})]})}renderSearchResults(){const{searchResults:t}=this.state;return t?x("div",{class:"category",ref:this.refs.search,children:[x("div",{class:`sticky padding-small align-${this.dir[0]}`,children:G.categories.search}),x("div",{children:t.length?t.map((n,r)=>x("div",{class:"flex",children:n.map((s,o)=>this.renderEmojiButton(s,{pos:[r,o],posinset:r*this.props.perLine+o+1,grid:t}))})):x("div",{class:`padding-small align-${this.dir[0]}`,children:this.props.onAddCustomEmoji&&x("a",{onClick:this.props.onAddCustomEmoji,children:G.add_custom})})})]}):null}renderCategories(){const{categories:t}=D,n=!!this.state.searchResults,r=this.getPerLine();return x("div",{style:{visibility:n?"hidden":void 0,display:n?"none":void 0,height:"100%"},children:t.map(s=>{const{root:o,rows:i}=this.refs.categories.get(s.id);return x("div",{"data-id":s.target?s.target.id:s.id,class:"category",ref:o,children:[x("div",{class:`sticky padding-small align-${this.dir[0]}`,children:s.name||G.categories[s.id]}),x("div",{class:"relative",style:{height:i.length*this.props.emojiButtonSize},children:i.map((a,c)=>{const u=a.index-a.index%Ve.rowsPerRender,l=this.state.visibleRows[u],f="current"in a?a:void 0;if(!l&&!f)return null;const h=c*r,b=h+r,d=s.emojis.slice(h,b);return d.length<r&&d.push(...new Array(r-d.length)),x("div",{"data-index":a.index,ref:f,class:"flex row",style:{top:c*this.props.emojiButtonSize},children:l&&d.map((v,g)=>{if(!v)return x("div",{style:{width:this.props.emojiButtonSize,height:this.props.emojiButtonSize}});const _=xe.get(v);return this.renderEmojiButton(_,{pos:[a.index,g],posinset:a.posinset+g,grid:this.grid})})},a.index)})})]})})})}renderSkinToneButton(){return this.props.skinTonePosition=="none"?null:x("div",{class:"flex flex-auto flex-center flex-middle",style:{position:"relative",width:this.props.emojiButtonSize,height:this.props.emojiButtonSize},children:x("button",{type:"button",ref:this.refs.skinToneButton,class:"skin-tone-button flex flex-auto flex-center flex-middle","aria-selected":this.state.showSkins?"":void 0,"aria-label":G.skins.choose,title:G.skins.choose,onClick:this.openSkins,style:{width:this.props.emojiSize,height:this.props.emojiSize},children:x("span",{class:`skin-tone skin-tone-${this.state.skin}`})})})}renderLiveRegion(){const t=this.getEmojiByPos(this.state.pos),n=t?t.name:"";return x("div",{"aria-live":"polite",class:"sr-only",children:n})}renderSkins(){const n=this.refs.skinToneButton.current.getBoundingClientRect(),r=this.base.getBoundingClientRect(),s={};return this.dir=="ltr"?s.right=r.right-n.right-3:s.left=n.left-r.left-3,this.props.previewPosition=="bottom"&&this.props.skinTonePosition=="preview"?s.bottom=r.bottom-n.top+6:(s.top=n.bottom-r.top+3,s.bottom="auto"),x("div",{ref:this.refs.menu,role:"radiogroup",dir:this.dir,"aria-label":G.skins.choose,class:"menu hidden","data-position":s.top?"top":"bottom",style:s,children:[...Array(6).keys()].map(o=>{const i=o+1,a=this.state.skin==i;return x("div",{children:[x("input",{type:"radio",name:"skin-tone",value:i,"aria-label":G.skins[i],ref:a?this.refs.skinToneRadio:null,defaultChecked:a,onChange:()=>this.handleSkinMouseOver(i),onKeyDown:c=>{(c.code=="Enter"||c.code=="Space"||c.code=="Tab")&&(c.preventDefault(),this.handleSkinClick(i))}}),x("button",{"aria-hidden":"true",tabindex:"-1",onClick:()=>this.handleSkinClick(i),onMouseEnter:()=>this.handleSkinMouseOver(i),onMouseLeave:()=>this.handleSkinMouseOver(),class:"option flex flex-grow flex-middle",children:[x("span",{class:`skin-tone skin-tone-${i}`}),x("span",{class:"margin-small-lr",children:G.skins[i]})]})]})})})}render(){const t=this.props.perLine*this.props.emojiButtonSize;return x("section",{id:"root",class:"flex flex-column",dir:this.dir,style:{width:this.props.dynamicWidth?"100%":`calc(${t}px + (var(--padding) + var(--sidebar-width)))`},"data-emoji-set":this.props.set,"data-theme":this.state.theme,"data-menu":this.state.showSkins?"":void 0,children:[this.props.previewPosition=="top"&&this.renderPreview(),this.props.navPosition=="top"&&this.renderNav(),this.props.searchPosition=="sticky"&&x("div",{class:"padding-lr",children:this.renderSearch()}),x("div",{ref:this.refs.scroll,class:"scroll flex-grow padding-lr",children:x("div",{style:{width:this.props.dynamicWidth?"100%":t,height:"100%"},children:[this.props.searchPosition=="static"&&this.renderSearch(),this.renderSearchResults(),this.renderCategories()]})}),this.props.navPosition=="bottom"&&this.renderNav(),this.props.previewPosition=="bottom"&&this.renderPreview(),this.state.showSkins&&this.renderSkins(),this.renderLiveRegion()]})}constructor(t){super(),oe(this,"darkMediaCallback",()=>{this.props.theme=="auto"&&this.setState({theme:this.darkMedia.matches?"dark":"light"})}),oe(this,"handleClickOutside",n=>{const{element:r}=this.props;n.target!=r&&(this.state.showSkins&&this.closeSkins(),this.props.onClickOutside&&this.props.onClickOutside(n))}),oe(this,"handleBaseClick",n=>{this.state.showSkins&&(n.target.closest(".menu")||(n.preventDefault(),n.stopImmediatePropagation(),this.closeSkins()))}),oe(this,"handleBaseKeydown",n=>{this.state.showSkins&&n.key=="Escape"&&(n.preventDefault(),n.stopImmediatePropagation(),this.closeSkins())}),oe(this,"handleSearchClick",()=>{this.getEmojiByPos(this.state.pos)&&this.setState({pos:[-1,-1]})}),oe(this,"handleSearchInput",async()=>{const n=this.refs.searchInput.current;if(!n)return;const{value:r}=n,s=await xe.search(r),o=()=>{this.refs.scroll.current&&(this.refs.scroll.current.scrollTop=0)};if(!s)return this.setState({searchResults:s,pos:[-1,-1]},o);const i=n.selectionStart==n.value.length?[0,0]:[-1,-1],a=[];a.setsize=s.length;let c=null;for(let u of s)(!a.length||c.length==this.getPerLine())&&(c=[],c.__categoryId="search",c.__index=a.length,a.push(c)),c.push(u);this.ignoreMouse(),this.setState({searchResults:a,pos:i},o)}),oe(this,"handleSearchKeyDown",n=>{const r=n.currentTarget;switch(n.stopImmediatePropagation(),n.key){case"ArrowLeft":this.navigate({e:n,input:r,left:!0});break;case"ArrowRight":this.navigate({e:n,input:r,right:!0});break;case"ArrowUp":this.navigate({e:n,input:r,up:!0});break;case"ArrowDown":this.navigate({e:n,input:r,down:!0});break;case"Enter":n.preventDefault(),this.handleEmojiClick({e:n,pos:this.state.pos});break;case"Escape":n.preventDefault(),this.state.searchResults?this.clearSearch():this.unfocusSearch();break}}),oe(this,"clearSearch",()=>{const n=this.refs.searchInput.current;n&&(n.value="",n.focus(),this.handleSearchInput())}),oe(this,"handleCategoryClick",({category:n,i:r})=>{this.scrollTo(r==0?{row:-1}:{categoryId:n.id})}),oe(this,"openSkins",n=>{const{currentTarget:r}=n,s=r.getBoundingClientRect();this.setState({showSkins:s},async()=>{await Fi(2);const o=this.refs.menu.current;o&&(o.classList.remove("hidden"),this.refs.skinToneRadio.current.focus(),this.base.addEventListener("click",this.handleBaseClick,!0),this.base.addEventListener("keydown",this.handleBaseKeydown,!0))})}),this.observers=[],this.state={pos:[-1,-1],perLine:this.initDynamicPerLine(t),visibleRows:{0:!0},...this.getInitialState(t)}}}class qt extends Ji{async connectedCallback(){const t=_s(this.props,he,this);t.element=this,t.ref=n=>{this.component=n},await ft(t),!this.disconnected&&ms(x(aa,{...t}),this.shadowRoot)}constructor(t){super(t,{styles:rs(Es)})}}oe(qt,"Props",he);typeof customElements<"u"&&!customElements.get("em-emoji-picker")&&customElements.define("em-emoji-picker",qt);var Es={};Es=`:host {
26
+ width: min-content;
27
+ height: 435px;
28
+ min-height: 230px;
29
+ border-radius: var(--border-radius);
30
+ box-shadow: var(--shadow);
31
+ --border-radius: 10px;
32
+ --category-icon-size: 18px;
33
+ --font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
34
+ --font-size: 15px;
35
+ --preview-placeholder-size: 21px;
36
+ --preview-title-size: 1.1em;
37
+ --preview-subtitle-size: .9em;
38
+ --shadow-color: 0deg 0% 0%;
39
+ --shadow: .3px .5px 2.7px hsl(var(--shadow-color) / .14), .4px .8px 1px -3.2px hsl(var(--shadow-color) / .14), 1px 2px 2.5px -4.5px hsl(var(--shadow-color) / .14);
40
+ display: flex;
41
+ }
42
+
43
+ [data-theme="light"] {
44
+ --em-rgb-color: var(--rgb-color, 34, 36, 39);
45
+ --em-rgb-accent: var(--rgb-accent, 34, 102, 237);
46
+ --em-rgb-background: var(--rgb-background, 255, 255, 255);
47
+ --em-rgb-input: var(--rgb-input, 255, 255, 255);
48
+ --em-color-border: var(--color-border, rgba(0, 0, 0, .05));
49
+ --em-color-border-over: var(--color-border-over, rgba(0, 0, 0, .1));
50
+ }
51
+
52
+ [data-theme="dark"] {
53
+ --em-rgb-color: var(--rgb-color, 222, 222, 221);
54
+ --em-rgb-accent: var(--rgb-accent, 58, 130, 247);
55
+ --em-rgb-background: var(--rgb-background, 21, 22, 23);
56
+ --em-rgb-input: var(--rgb-input, 0, 0, 0);
57
+ --em-color-border: var(--color-border, rgba(255, 255, 255, .1));
58
+ --em-color-border-over: var(--color-border-over, rgba(255, 255, 255, .2));
59
+ }
60
+
61
+ #root {
62
+ --color-a: rgb(var(--em-rgb-color));
63
+ --color-b: rgba(var(--em-rgb-color), .65);
64
+ --color-c: rgba(var(--em-rgb-color), .45);
65
+ --padding: 12px;
66
+ --padding-small: calc(var(--padding) / 2);
67
+ --sidebar-width: 16px;
68
+ --duration: 225ms;
69
+ --duration-fast: 125ms;
70
+ --duration-instant: 50ms;
71
+ --easing: cubic-bezier(.4, 0, .2, 1);
72
+ width: 100%;
73
+ text-align: left;
74
+ border-radius: var(--border-radius);
75
+ background-color: rgb(var(--em-rgb-background));
76
+ position: relative;
77
+ }
78
+
79
+ @media (prefers-reduced-motion) {
80
+ #root {
81
+ --duration: 0;
82
+ --duration-fast: 0;
83
+ --duration-instant: 0;
84
+ }
85
+ }
86
+
87
+ #root[data-menu] button {
88
+ cursor: auto;
89
+ }
90
+
91
+ #root[data-menu] .menu button {
92
+ cursor: pointer;
93
+ }
94
+
95
+ :host, #root, input, button {
96
+ color: rgb(var(--em-rgb-color));
97
+ font-family: var(--font-family);
98
+ font-size: var(--font-size);
99
+ -webkit-font-smoothing: antialiased;
100
+ -moz-osx-font-smoothing: grayscale;
101
+ line-height: normal;
102
+ }
103
+
104
+ *, :before, :after {
105
+ box-sizing: border-box;
106
+ min-width: 0;
107
+ margin: 0;
108
+ padding: 0;
109
+ }
110
+
111
+ .relative {
112
+ position: relative;
113
+ }
114
+
115
+ .flex {
116
+ display: flex;
117
+ }
118
+
119
+ .flex-auto {
120
+ flex: none;
121
+ }
122
+
123
+ .flex-center {
124
+ justify-content: center;
125
+ }
126
+
127
+ .flex-column {
128
+ flex-direction: column;
129
+ }
130
+
131
+ .flex-grow {
132
+ flex: auto;
133
+ }
134
+
135
+ .flex-middle {
136
+ align-items: center;
137
+ }
138
+
139
+ .flex-wrap {
140
+ flex-wrap: wrap;
141
+ }
142
+
143
+ .padding {
144
+ padding: var(--padding);
145
+ }
146
+
147
+ .padding-t {
148
+ padding-top: var(--padding);
149
+ }
150
+
151
+ .padding-lr {
152
+ padding-left: var(--padding);
153
+ padding-right: var(--padding);
154
+ }
155
+
156
+ .padding-r {
157
+ padding-right: var(--padding);
158
+ }
159
+
160
+ .padding-small {
161
+ padding: var(--padding-small);
162
+ }
163
+
164
+ .padding-small-b {
165
+ padding-bottom: var(--padding-small);
166
+ }
167
+
168
+ .padding-small-lr {
169
+ padding-left: var(--padding-small);
170
+ padding-right: var(--padding-small);
171
+ }
172
+
173
+ .margin {
174
+ margin: var(--padding);
175
+ }
176
+
177
+ .margin-r {
178
+ margin-right: var(--padding);
179
+ }
180
+
181
+ .margin-l {
182
+ margin-left: var(--padding);
183
+ }
184
+
185
+ .margin-small-l {
186
+ margin-left: var(--padding-small);
187
+ }
188
+
189
+ .margin-small-lr {
190
+ margin-left: var(--padding-small);
191
+ margin-right: var(--padding-small);
192
+ }
193
+
194
+ .align-l {
195
+ text-align: left;
196
+ }
197
+
198
+ .align-r {
199
+ text-align: right;
200
+ }
201
+
202
+ .color-a {
203
+ color: var(--color-a);
204
+ }
205
+
206
+ .color-b {
207
+ color: var(--color-b);
208
+ }
209
+
210
+ .color-c {
211
+ color: var(--color-c);
212
+ }
213
+
214
+ .ellipsis {
215
+ white-space: nowrap;
216
+ max-width: 100%;
217
+ width: auto;
218
+ text-overflow: ellipsis;
219
+ overflow: hidden;
220
+ }
221
+
222
+ .sr-only {
223
+ width: 1px;
224
+ height: 1px;
225
+ position: absolute;
226
+ top: auto;
227
+ left: -10000px;
228
+ overflow: hidden;
229
+ }
230
+
231
+ a {
232
+ cursor: pointer;
233
+ color: rgb(var(--em-rgb-accent));
234
+ }
235
+
236
+ a:hover {
237
+ text-decoration: underline;
238
+ }
239
+
240
+ .spacer {
241
+ height: 10px;
242
+ }
243
+
244
+ [dir="rtl"] .scroll {
245
+ padding-left: 0;
246
+ padding-right: var(--padding);
247
+ }
248
+
249
+ .scroll {
250
+ padding-right: 0;
251
+ overflow-x: hidden;
252
+ overflow-y: auto;
253
+ }
254
+
255
+ .scroll::-webkit-scrollbar {
256
+ width: var(--sidebar-width);
257
+ height: var(--sidebar-width);
258
+ }
259
+
260
+ .scroll::-webkit-scrollbar-track {
261
+ border: 0;
262
+ }
263
+
264
+ .scroll::-webkit-scrollbar-button {
265
+ width: 0;
266
+ height: 0;
267
+ display: none;
268
+ }
269
+
270
+ .scroll::-webkit-scrollbar-corner {
271
+ background-color: rgba(0, 0, 0, 0);
272
+ }
273
+
274
+ .scroll::-webkit-scrollbar-thumb {
275
+ min-height: 20%;
276
+ min-height: 65px;
277
+ border: 4px solid rgb(var(--em-rgb-background));
278
+ border-radius: 8px;
279
+ }
280
+
281
+ .scroll::-webkit-scrollbar-thumb:hover {
282
+ background-color: var(--em-color-border-over) !important;
283
+ }
284
+
285
+ .scroll:hover::-webkit-scrollbar-thumb {
286
+ background-color: var(--em-color-border);
287
+ }
288
+
289
+ .sticky {
290
+ z-index: 1;
291
+ background-color: rgba(var(--em-rgb-background), .9);
292
+ -webkit-backdrop-filter: blur(4px);
293
+ backdrop-filter: blur(4px);
294
+ font-weight: 500;
295
+ position: sticky;
296
+ top: -1px;
297
+ }
298
+
299
+ [dir="rtl"] .search input[type="search"] {
300
+ padding: 10px 2.2em 10px 2em;
301
+ }
302
+
303
+ [dir="rtl"] .search .loupe {
304
+ left: auto;
305
+ right: .7em;
306
+ }
307
+
308
+ [dir="rtl"] .search .delete {
309
+ left: .7em;
310
+ right: auto;
311
+ }
312
+
313
+ .search {
314
+ z-index: 2;
315
+ position: relative;
316
+ }
317
+
318
+ .search input, .search button {
319
+ font-size: calc(var(--font-size) - 1px);
320
+ }
321
+
322
+ .search input[type="search"] {
323
+ width: 100%;
324
+ background-color: var(--em-color-border);
325
+ transition-duration: var(--duration);
326
+ transition-property: background-color, box-shadow;
327
+ transition-timing-function: var(--easing);
328
+ border: 0;
329
+ border-radius: 10px;
330
+ outline: 0;
331
+ padding: 10px 2em 10px 2.2em;
332
+ display: block;
333
+ }
334
+
335
+ .search input[type="search"]::-ms-input-placeholder {
336
+ color: inherit;
337
+ opacity: .6;
338
+ }
339
+
340
+ .search input[type="search"]::placeholder {
341
+ color: inherit;
342
+ opacity: .6;
343
+ }
344
+
345
+ .search input[type="search"], .search input[type="search"]::-webkit-search-decoration, .search input[type="search"]::-webkit-search-cancel-button, .search input[type="search"]::-webkit-search-results-button, .search input[type="search"]::-webkit-search-results-decoration {
346
+ -webkit-appearance: none;
347
+ -ms-appearance: none;
348
+ appearance: none;
349
+ }
350
+
351
+ .search input[type="search"]:focus {
352
+ background-color: rgb(var(--em-rgb-input));
353
+ box-shadow: inset 0 0 0 1px rgb(var(--em-rgb-accent)), 0 1px 3px rgba(65, 69, 73, .2);
354
+ }
355
+
356
+ .search .icon {
357
+ z-index: 1;
358
+ color: rgba(var(--em-rgb-color), .7);
359
+ position: absolute;
360
+ top: 50%;
361
+ transform: translateY(-50%);
362
+ }
363
+
364
+ .search .loupe {
365
+ pointer-events: none;
366
+ left: .7em;
367
+ }
368
+
369
+ .search .delete {
370
+ right: .7em;
371
+ }
372
+
373
+ svg {
374
+ fill: currentColor;
375
+ width: 1em;
376
+ height: 1em;
377
+ }
378
+
379
+ button {
380
+ -webkit-appearance: none;
381
+ -ms-appearance: none;
382
+ appearance: none;
383
+ cursor: pointer;
384
+ color: currentColor;
385
+ background-color: rgba(0, 0, 0, 0);
386
+ border: 0;
387
+ }
388
+
389
+ #nav {
390
+ z-index: 2;
391
+ padding-top: 12px;
392
+ padding-bottom: 12px;
393
+ padding-right: var(--sidebar-width);
394
+ position: relative;
395
+ }
396
+
397
+ #nav button {
398
+ color: var(--color-b);
399
+ transition: color var(--duration) var(--easing);
400
+ }
401
+
402
+ #nav button:hover {
403
+ color: var(--color-a);
404
+ }
405
+
406
+ #nav svg, #nav img {
407
+ width: var(--category-icon-size);
408
+ height: var(--category-icon-size);
409
+ }
410
+
411
+ #nav[dir="rtl"] .bar {
412
+ left: auto;
413
+ right: 0;
414
+ }
415
+
416
+ #nav .bar {
417
+ width: 100%;
418
+ height: 3px;
419
+ background-color: rgb(var(--em-rgb-accent));
420
+ transition: transform var(--duration) var(--easing);
421
+ border-radius: 3px 3px 0 0;
422
+ position: absolute;
423
+ bottom: -12px;
424
+ left: 0;
425
+ }
426
+
427
+ #nav button[aria-selected] {
428
+ color: rgb(var(--em-rgb-accent));
429
+ }
430
+
431
+ #preview {
432
+ z-index: 2;
433
+ padding: calc(var(--padding) + 4px) var(--padding);
434
+ padding-right: var(--sidebar-width);
435
+ position: relative;
436
+ }
437
+
438
+ #preview .preview-placeholder {
439
+ font-size: var(--preview-placeholder-size);
440
+ }
441
+
442
+ #preview .preview-title {
443
+ font-size: var(--preview-title-size);
444
+ }
445
+
446
+ #preview .preview-subtitle {
447
+ font-size: var(--preview-subtitle-size);
448
+ }
449
+
450
+ #nav:before, #preview:before {
451
+ content: "";
452
+ height: 2px;
453
+ position: absolute;
454
+ left: 0;
455
+ right: 0;
456
+ }
457
+
458
+ #nav[data-position="top"]:before, #preview[data-position="top"]:before {
459
+ background: linear-gradient(to bottom, var(--em-color-border), transparent);
460
+ top: 100%;
461
+ }
462
+
463
+ #nav[data-position="bottom"]:before, #preview[data-position="bottom"]:before {
464
+ background: linear-gradient(to top, var(--em-color-border), transparent);
465
+ bottom: 100%;
466
+ }
467
+
468
+ .category:last-child {
469
+ min-height: calc(100% + 1px);
470
+ }
471
+
472
+ .category button {
473
+ font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, sans-serif;
474
+ position: relative;
475
+ }
476
+
477
+ .category button > * {
478
+ position: relative;
479
+ }
480
+
481
+ .category button .background {
482
+ opacity: 0;
483
+ background-color: var(--em-color-border);
484
+ transition: opacity var(--duration-fast) var(--easing) var(--duration-instant);
485
+ position: absolute;
486
+ top: 0;
487
+ bottom: 0;
488
+ left: 0;
489
+ right: 0;
490
+ }
491
+
492
+ .category button:hover .background {
493
+ transition-duration: var(--duration-instant);
494
+ transition-delay: 0s;
495
+ }
496
+
497
+ .category button[aria-selected] .background {
498
+ opacity: 1;
499
+ }
500
+
501
+ .category button[data-keyboard] .background {
502
+ transition: none;
503
+ }
504
+
505
+ .row {
506
+ width: 100%;
507
+ position: absolute;
508
+ top: 0;
509
+ left: 0;
510
+ }
511
+
512
+ .skin-tone-button {
513
+ border: 1px solid rgba(0, 0, 0, 0);
514
+ border-radius: 100%;
515
+ }
516
+
517
+ .skin-tone-button:hover {
518
+ border-color: var(--em-color-border);
519
+ }
520
+
521
+ .skin-tone-button:active .skin-tone {
522
+ transform: scale(.85) !important;
523
+ }
524
+
525
+ .skin-tone-button .skin-tone {
526
+ transition: transform var(--duration) var(--easing);
527
+ }
528
+
529
+ .skin-tone-button[aria-selected] {
530
+ background-color: var(--em-color-border);
531
+ border-top-color: rgba(0, 0, 0, .05);
532
+ border-bottom-color: rgba(0, 0, 0, 0);
533
+ border-left-width: 0;
534
+ border-right-width: 0;
535
+ }
536
+
537
+ .skin-tone-button[aria-selected] .skin-tone {
538
+ transform: scale(.9);
539
+ }
540
+
541
+ .menu {
542
+ z-index: 2;
543
+ white-space: nowrap;
544
+ border: 1px solid var(--em-color-border);
545
+ background-color: rgba(var(--em-rgb-background), .9);
546
+ -webkit-backdrop-filter: blur(4px);
547
+ backdrop-filter: blur(4px);
548
+ transition-property: opacity, transform;
549
+ transition-duration: var(--duration);
550
+ transition-timing-function: var(--easing);
551
+ border-radius: 10px;
552
+ padding: 4px;
553
+ position: absolute;
554
+ box-shadow: 1px 1px 5px rgba(0, 0, 0, .05);
555
+ }
556
+
557
+ .menu.hidden {
558
+ opacity: 0;
559
+ }
560
+
561
+ .menu[data-position="bottom"] {
562
+ transform-origin: 100% 100%;
563
+ }
564
+
565
+ .menu[data-position="bottom"].hidden {
566
+ transform: scale(.9)rotate(-3deg)translateY(5%);
567
+ }
568
+
569
+ .menu[data-position="top"] {
570
+ transform-origin: 100% 0;
571
+ }
572
+
573
+ .menu[data-position="top"].hidden {
574
+ transform: scale(.9)rotate(3deg)translateY(-5%);
575
+ }
576
+
577
+ .menu input[type="radio"] {
578
+ clip: rect(0 0 0 0);
579
+ width: 1px;
580
+ height: 1px;
581
+ border: 0;
582
+ margin: 0;
583
+ padding: 0;
584
+ position: absolute;
585
+ overflow: hidden;
586
+ }
587
+
588
+ .menu input[type="radio"]:checked + .option {
589
+ box-shadow: 0 0 0 2px rgb(var(--em-rgb-accent));
590
+ }
591
+
592
+ .option {
593
+ width: 100%;
594
+ border-radius: 6px;
595
+ padding: 4px 6px;
596
+ }
597
+
598
+ .option:hover {
599
+ color: #fff;
600
+ background-color: rgb(var(--em-rgb-accent));
601
+ }
602
+
603
+ .skin-tone {
604
+ width: 16px;
605
+ height: 16px;
606
+ border-radius: 100%;
607
+ display: inline-block;
608
+ position: relative;
609
+ overflow: hidden;
610
+ }
611
+
612
+ .skin-tone:after {
613
+ content: "";
614
+ mix-blend-mode: overlay;
615
+ background: linear-gradient(rgba(255, 255, 255, .2), rgba(0, 0, 0, 0));
616
+ border: 1px solid rgba(0, 0, 0, .8);
617
+ border-radius: 100%;
618
+ position: absolute;
619
+ top: 0;
620
+ bottom: 0;
621
+ left: 0;
622
+ right: 0;
623
+ box-shadow: inset 0 -2px 3px #000, inset 0 1px 2px #fff;
624
+ }
625
+
626
+ .skin-tone-1 {
627
+ background-color: #ffc93a;
628
+ }
629
+
630
+ .skin-tone-2 {
631
+ background-color: #ffdab7;
632
+ }
633
+
634
+ .skin-tone-3 {
635
+ background-color: #e7b98f;
636
+ }
637
+
638
+ .skin-tone-4 {
639
+ background-color: #c88c61;
640
+ }
641
+
642
+ .skin-tone-5 {
643
+ background-color: #a46134;
644
+ }
645
+
646
+ .skin-tone-6 {
647
+ background-color: #5d4437;
648
+ }
649
+
650
+ [data-index] {
651
+ justify-content: space-between;
652
+ }
653
+
654
+ [data-emoji-set="twitter"] .skin-tone:after {
655
+ box-shadow: none;
656
+ border-color: rgba(0, 0, 0, .5);
657
+ }
658
+
659
+ [data-emoji-set="twitter"] .skin-tone-1 {
660
+ background-color: #fade72;
661
+ }
662
+
663
+ [data-emoji-set="twitter"] .skin-tone-2 {
664
+ background-color: #f3dfd0;
665
+ }
666
+
667
+ [data-emoji-set="twitter"] .skin-tone-3 {
668
+ background-color: #eed3a8;
669
+ }
670
+
671
+ [data-emoji-set="twitter"] .skin-tone-4 {
672
+ background-color: #cfad8d;
673
+ }
674
+
675
+ [data-emoji-set="twitter"] .skin-tone-5 {
676
+ background-color: #a8805d;
677
+ }
678
+
679
+ [data-emoji-set="twitter"] .skin-tone-6 {
680
+ background-color: #765542;
681
+ }
682
+
683
+ [data-emoji-set="google"] .skin-tone:after {
684
+ box-shadow: inset 0 0 2px 2px rgba(0, 0, 0, .4);
685
+ }
686
+
687
+ [data-emoji-set="google"] .skin-tone-1 {
688
+ background-color: #f5c748;
689
+ }
690
+
691
+ [data-emoji-set="google"] .skin-tone-2 {
692
+ background-color: #f1d5aa;
693
+ }
694
+
695
+ [data-emoji-set="google"] .skin-tone-3 {
696
+ background-color: #d4b48d;
697
+ }
698
+
699
+ [data-emoji-set="google"] .skin-tone-4 {
700
+ background-color: #aa876b;
701
+ }
702
+
703
+ [data-emoji-set="google"] .skin-tone-5 {
704
+ background-color: #916544;
705
+ }
706
+
707
+ [data-emoji-set="google"] .skin-tone-6 {
708
+ background-color: #61493f;
709
+ }
710
+
711
+ [data-emoji-set="facebook"] .skin-tone:after {
712
+ border-color: rgba(0, 0, 0, .4);
713
+ box-shadow: inset 0 -2px 3px #000, inset 0 1px 4px #fff;
714
+ }
715
+
716
+ [data-emoji-set="facebook"] .skin-tone-1 {
717
+ background-color: #f5c748;
718
+ }
719
+
720
+ [data-emoji-set="facebook"] .skin-tone-2 {
721
+ background-color: #f1d5aa;
722
+ }
723
+
724
+ [data-emoji-set="facebook"] .skin-tone-3 {
725
+ background-color: #d4b48d;
726
+ }
727
+
728
+ [data-emoji-set="facebook"] .skin-tone-4 {
729
+ background-color: #aa876b;
730
+ }
731
+
732
+ [data-emoji-set="facebook"] .skin-tone-5 {
733
+ background-color: #916544;
734
+ }
735
+
736
+ [data-emoji-set="facebook"] .skin-tone-6 {
737
+ background-color: #61493f;
738
+ }
739
+
740
+ `;function la(e){const t=y.useRef(null),n=y.useRef(null);return n.current&&n.current.update(e),y.useEffect(()=>(n.current=new qt({...e,ref:t}),()=>{n.current=null}),[]),Rs.createElement("div",{ref:t})}function ca(e){let t=0,n=0,r=0;if(e.startsWith("#")){const s=e.replace("#","");t=parseInt(s.substring(0,2),16),n=parseInt(s.substring(2,4),16),r=parseInt(s.substring(4,6),16)}return(.299*t+.587*n+.114*r)/255>.5}function Nt({onSend:e,onTyping:t,config:n,fileUpload:r,disabled:s=!1}){var ue,J,Z,X,W,ne;const[o,i]=y.useState(""),[a,c]=y.useState(!1),[u,l]=y.useState(),[f,h]=y.useState(null),[b,d]=y.useState(!1),v=y.useRef(null),g=y.useRef(null),_=y.useRef(null),S=y.useRef(null),k=y.useRef(null),w=y.useRef(null),E=y.useRef(!1),L=n.enableEmoji??!0,T=n.enableFileUpload??!0,A=((ue=n.theme)==null?void 0:ue.background)||"#00001a",O=ca(A),j=((J=n.theme)==null?void 0:J.text)||(O?"#1a1a2e":"#f7f7f8"),I=((Z=n.theme)==null?void 0:Z.textMuted)||(O?"rgba(0,0,0,0.4)":"rgba(247,247,248,0.45)"),z=((X=n.theme)==null?void 0:X.primary)||"#337eff";y.useEffect(()=>{L&&(async()=>{try{const $=await fetch("https://cdn.jsdelivr.net/npm/@emoji-mart/data");l(await $.json())}catch($){console.error("Failed to load emoji data:",$)}})()},[L]),y.useEffect(()=>{const $=F=>{g.current&&!g.current.contains(F.target)&&c(!1)};return a&&document.addEventListener("mousedown",$),()=>{document.removeEventListener("mousedown",$)}},[a]),y.useEffect(()=>()=>{k.current&&clearTimeout(k.current),w.current&&clearTimeout(w.current)},[]),y.useEffect(()=>{if(!a)return;const $=()=>{if(_.current){const F=_.current.getBoundingClientRect();h({top:F.top-370,left:F.left-300})}};return window.addEventListener("resize",$),window.addEventListener("scroll",$,!0),()=>{window.removeEventListener("resize",$),window.removeEventListener("scroll",$,!0)}},[a]);const C=$=>{i($),t&&n.enableTypingIndicator!==!1&&(w.current&&clearTimeout(w.current),k.current&&clearTimeout(k.current),E.current||(w.current=setTimeout(()=>{t(!0),E.current=!0},300)),k.current=setTimeout(()=>{E.current&&(t(!1),E.current=!1)},1500))},P=()=>{var F;const $=o.trim();!$||s||(e($),i(""),c(!1),t&&(k.current&&clearTimeout(k.current),w.current&&clearTimeout(w.current),E.current&&(t(!1),E.current=!1)),(F=v.current)==null||F.focus())},U=$=>{$.key==="Enter"&&!$.shiftKey&&($.preventDefault(),P())},M=$=>{const F=v.current;if(!F){i(re=>re+$);return}const de=F.selectionStart,V=F.selectionEnd,fe=o.slice(0,de)+$+o.slice(V);i(fe),setTimeout(()=>{const re=de+$.length;F.setSelectionRange(re,re),F.focus()},0)},q=async $=>{var V,fe,re;const F=$.target.files;if(!F||F.length===0)return;const de=F[0];try{(V=n.toast)==null||V.info("Uploading file...");const se=await r.uploadFile(de);se!=null&&se.markdown&&(M(`
741
+ ${se.markdown}
742
+ `),(fe=n.toast)==null||fe.success("File uploaded successfully"))}catch(se){console.error("File upload failed:",se),(re=n.toast)==null||re.error(se.message)}finally{S.current&&(S.current.value="")}},B=o.trim().length>0&&!s,te=O?"rgba(0,0,0,0.35)":"rgba(247,247,248,0.3)";return p.jsxs("div",{className:"px-4 py-3",style:{borderTop:O?"1px solid rgba(0,0,0,0.06)":"1px solid rgba(255,255,255,0.06)"},children:[p.jsxs("div",{className:"relative flex items-center rounded-full transition-all duration-200",style:{backgroundColor:O?"rgba(112,115,124,0.08)":"rgba(112,115,124,0.12)",outline:b?`2px solid ${z}`:"none",outlineOffset:"-1px",border:O?"1px solid rgba(0,0,0,0.1)":"1px solid rgba(255,255,255,0.08)",backdropFilter:"blur(32px)"},children:[p.jsx("style",{children:`.xchat-input::placeholder { color: ${te}; }`}),p.jsx("textarea",{ref:v,value:o,onChange:$=>C($.target.value),onKeyDown:U,onFocus:()=>d(!0),onBlur:()=>d(!1),placeholder:"Type a message...",rows:1,className:"xchat-input flex-1 resize-none bg-transparent",style:{color:j,border:"none",outline:"none",boxShadow:"none",WebkitAppearance:"none",padding:"10px 0 10px 20px",minHeight:"42px",maxHeight:"120px",caretColor:z,fontSize:"14px",lineHeight:"20px",letterSpacing:"0.006em"},disabled:s}),p.jsxs("div",{className:"flex items-center gap-1 px-2 shrink-0",children:[L&&p.jsx("button",{ref:_,type:"button",onClick:()=>{if(!a&&_.current){const $=_.current.getBoundingClientRect();h({top:$.top-450,left:$.left-290})}c($=>!$)},className:"p-1.5 rounded-lg transition-all duration-150",style:{color:I,backgroundColor:"transparent"},onMouseEnter:$=>{$.currentTarget.style.backgroundColor=O?"rgba(0,0,0,0.06)":"rgba(255,255,255,0.06)",$.currentTarget.style.color=j},onMouseLeave:$=>{$.currentTarget.style.backgroundColor="transparent",$.currentTarget.style.color=I},disabled:s,"aria-label":"Add emoji",children:p.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[p.jsx("title",{children:"Emoji"}),p.jsx("circle",{cx:"12",cy:"12",r:"10"}),p.jsx("path",{d:"M8 14s1.5 2 4 2 4-2 4-2"}),p.jsx("line",{x1:"9",y1:"9",x2:"9.01",y2:"9"}),p.jsx("line",{x1:"15",y1:"9",x2:"15.01",y2:"9"})]})}),T&&r.canUpload&&p.jsxs(p.Fragment,{children:[p.jsx("button",{type:"button",onClick:()=>{var $;return($=S.current)==null?void 0:$.click()},className:"p-1.5 rounded-lg transition-all duration-150",style:{color:I,backgroundColor:"transparent"},onMouseEnter:$=>{$.currentTarget.style.backgroundColor="rgba(255,255,255,0.06)",$.currentTarget.style.color=j},onMouseLeave:$=>{$.currentTarget.style.backgroundColor="transparent",$.currentTarget.style.color=I},disabled:s||r.isUploading,"aria-label":"Attach file",children:r.isUploading?p.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",className:"animate-spin","aria-hidden":"true",children:[p.jsx("title",{children:"Uploading"}),p.jsx("path",{d:"M21 12a9 9 0 11-6.219-8.56"})]}):p.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[p.jsx("title",{children:"Attach file"}),p.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})]})}),p.jsx("input",{ref:S,type:"file",accept:"image/*,application/pdf,.doc,.docx",className:"hidden",onChange:q})]}),p.jsx("button",{type:"button",onClick:P,disabled:!B,className:"p-1.5 rounded-lg transition-all duration-200",style:{background:B?`linear-gradient(135deg, ${z}, ${((W=n.theme)==null?void 0:W.primaryStrong)||"#005eff"})`:"transparent",color:B?"#ffffff":I,opacity:B?1:.35,cursor:B?"pointer":"default",boxShadow:B?`0 2px 8px -2px ${z}60`:"none"},"aria-label":"Send message",children:p.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[p.jsx("title",{children:"Send"}),p.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),p.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]})]}),r.isUploading&&p.jsxs("div",{className:"mt-2 px-1",children:[p.jsx("div",{className:"w-full rounded-full overflow-hidden",style:{height:3,backgroundColor:O?"rgba(0,0,0,0.06)":"rgba(255,255,255,0.06)"},children:p.jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${r.uploadProgress}%`,background:`linear-gradient(90deg, ${z}, ${((ne=n.theme)==null?void 0:ne.primaryStrong)||"#005eff"})`}})}),p.jsxs("p",{className:"mt-1",style:{fontSize:"11px",letterSpacing:"0.019em",color:I},children:["Uploading... ",r.uploadProgress,"%"]})]}),a&&u&&f&&typeof document<"u"&&Ps.createPortal(p.jsx("div",{ref:g,className:"fixed rounded-xl overflow-hidden",style:{top:`${f.top}px`,left:`${f.left}px`,zIndex:9999,boxShadow:["inset 0 0 0 0.5px rgba(255,255,255,0.06)","inset 0 1px 0 0 rgba(255,255,255,0.1)","0 16px 48px -8px rgba(0,0,0,0.5)"].join(", ")},children:p.jsx(la,{data:u,onEmojiSelect:$=>{M($.native||$.shortcodes||""),c(!1)},previewPosition:"none",skinTonePosition:"none",navPosition:"bottom",perLine:8,searchPosition:"sticky",theme:"dark"})}),document.body)]})}try{Nt.displayName="ChatInput",Nt.__docgenInfo={description:"",displayName:"ChatInput",props:{onSend:{defaultValue:null,description:"",name:"onSend",required:!0,type:{name:"(message: string) => void"}},onTyping:{defaultValue:null,description:"",name:"onTyping",required:!1,type:{name:"((isTyping: boolean) => void) | undefined"}},config:{defaultValue:null,description:"",name:"config",required:!0,type:{name:"IChatConfig"}},fileUpload:{defaultValue:null,description:"",name:"fileUpload",required:!0,type:{name:"UseFileUploadReturn"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean | undefined"}}}}}catch{}function ua(){var t;let e;try{const n=localStorage.getItem("xcelsior-chat-anon-id");n?e=n:(e=`anon-${((t=crypto.randomUUID)==null?void 0:t.call(crypto))||Math.random().toString(36).slice(2)}`,localStorage.setItem("xcelsior-chat-anon-id",e))}catch{e=`anon-${Math.random().toString(36).slice(2)}`}return{name:"Visitor",email:`${e}@anonymous.xcelsior.co`,type:"customer",status:"online"}}function Ot({config:e,className:t="",variant:n="popover",externalWebSocket:r,onMinimize:s,onClose:o,resolvedPosition:i="right"}){var J,Z,X,W,ne,$,F,de;const a=n==="fullPage",c=e.currentUser||ua(),u={...e,currentUser:c},l=zs(u,r),{messages:f,addMessage:h,isLoading:b,loadMore:d,hasMore:v,isLoadingMore:g,isBotThinking:_}=fi(l,u),S=pi(e.apiKey,e.fileUpload),{isTyping:k,typingUsers:w}=hi(l),{width:E,height:L,isResizing:T,isNearEdge:A,containerResizeProps:O}=bi({initialWidth:380,initialHeight:580,minWidth:320,minHeight:400,maxWidth:800,maxHeight:900,enabled:!a}),j=y.useCallback(V=>{var re,se;if(!l.isConnected){(re=e.toast)==null||re.error("Not connected to chat server");return}const fe={id:`temp-${Date.now()}`,conversationId:e.conversationId||"",senderId:c.email,senderType:c.type,content:V,messageType:"text",createdAt:new Date().toISOString(),status:"sent"};h(fe),l.sendMessage("sendMessage",{conversationId:e.conversationId,content:V,messageType:"text"}),(se=e.onMessageSent)==null||se.call(e,fe)},[l,e,h,c]),I=y.useCallback(V=>{!l.isConnected||e.enableTypingIndicator===!1||l.sendMessage("typing",{conversationId:e.conversationId,isTyping:V})},[l,e]);y.useEffect(()=>{var V;l.error&&((V=e.toast)==null||V.error(l.error.message||"An error occurred"))},[l.error,e]);const z=((J=e.theme)==null?void 0:J.background)||"#00001a";(Z=e.theme)!=null&&Z.backgroundAlt;const C=((X=e.theme)==null?void 0:X.text)||"#f7f7f8",P=((W=e.theme)==null?void 0:W.primary)||"#337eff",U=((ne=e.theme)==null?void 0:ne.textMuted)||"rgba(247,247,248,0.45)",M=(()=>{if(!z.startsWith("#"))return!1;const V=z.replace("#",""),fe=parseInt(V.substring(0,2),16),re=parseInt(V.substring(2,4),16),se=parseInt(V.substring(4,6),16);return(.299*fe+.587*re+.114*se)/255>.5})(),q=i==="left"?"left-4":"right-4",B=a?{backgroundColor:z,color:C}:{width:E,height:L,maxHeight:"calc(100vh - 100px)",backgroundColor:z,color:C,borderRadius:16,boxShadow:M?["0 25px 60px -12px rgba(0,0,0,0.15)","0 0 0 1px rgba(0,0,0,0.08)"].join(", "):["inset 0 0 0 0.5px rgba(255,255,255,0.06)","inset 0 1px 0 0 rgba(255,255,255,0.12)","0 25px 60px -12px rgba(0,0,0,0.6)","0 0 40px -8px rgba(51,126,255,0.15)"].join(", "),userSelect:T?"none":void 0},te=a?{}:{backgroundImage:M?"radial-gradient(circle, rgba(0,0,0,0.04) 1px, transparent 1px)":"radial-gradient(circle, rgba(255,255,255,0.03) 1px, transparent 1px)",backgroundSize:"24px 24px"},ue=!a&&A?{outline:M?"2px solid rgba(0,94,255,0.25)":"2px solid rgba(51,126,255,0.35)",outlineOffset:-1,transition:"outline 150ms ease"}:{outline:"2px solid transparent",outlineOffset:-1,transition:"outline 150ms ease"};return p.jsxs("div",{className:a?`flex flex-col h-full ${t}`:`fixed bottom-20 ${q} z-50 flex flex-col overflow-hidden ${t}`,style:{...B,...te,...ue},...a?{}:O,children:[!a&&p.jsx($t,{agent:c.type==="customer"?{email:"contact@xcelsior.co",name:"Xcelsior Software",type:"agent",status:l.isConnected?"online":"offline"}:void 0,onMinimize:s,onClose:o,theme:e.theme}),!l.isConnected&&p.jsx("div",{className:"px-4 py-2",style:{backgroundColor:M?"rgba(255,169,56,0.08)":"rgba(255,169,56,0.06)",borderBottom:`1px solid rgba(255,169,56,${M?"0.15":"0.12"})`},children:p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"w-1.5 h-1.5 rounded-full animate-pulse",style:{backgroundColor:(($=e.theme)==null?void 0:$.statusCaution)||"#ffa938"}}),p.jsx("span",{style:{fontSize:"12px",letterSpacing:"0.015em",color:((F=e.theme)==null?void 0:F.statusCaution)||"#ffa938"},children:"Reconnecting..."}),p.jsx("button",{type:"button",onClick:l.reconnect,className:"ml-auto transition-opacity",style:{fontSize:"12px",letterSpacing:"0.015em",color:((de=e.theme)==null?void 0:de.statusCaution)||"#ffa938",opacity:.7},onMouseEnter:V=>{V.currentTarget.style.opacity="1"},onMouseLeave:V=>{V.currentTarget.style.opacity="0.7"},children:"Retry"})]})}),b?p.jsx("div",{className:"flex-1 flex items-center justify-center",children:p.jsxs("div",{className:"text-center",children:[p.jsx("div",{className:"w-7 h-7 border-2 border-t-transparent rounded-full animate-spin mx-auto mb-3",style:{borderColor:P,borderTopColor:"transparent"}}),p.jsx("p",{style:{fontSize:"12px",letterSpacing:"0.015em",color:U},children:"Loading messages..."})]})}):p.jsx(jt,{messages:f,currentUser:c,isTyping:k,typingUser:w[0],autoScroll:!0,onLoadMore:d,hasMore:v,isLoadingMore:g,theme:e.theme,onQuickAction:j,isBotThinking:_}),p.jsx(Nt,{onSend:j,onTyping:I,config:u,fileUpload:S,disabled:!l.isConnected}),!a&&p.jsx("div",{className:"px-4 py-1.5 text-center",style:{borderTop:M?"1px solid rgba(0,0,0,0.06)":"1px solid rgba(255,255,255,0.06)",backgroundColor:M?"rgba(0,0,0,0.03)":"rgba(0,0,0,0.2)"},children:p.jsxs("p",{style:{fontSize:"10px",letterSpacing:"0.025em",color:M?"rgba(0,0,0,0.35)":"rgba(247,247,248,0.28)"},children:["Powered by"," ",p.jsx("span",{style:{fontWeight:600,color:M?"rgba(0,0,0,0.5)":"rgba(247,247,248,0.45)"},children:"Xcelsior"})]})})]})}try{Ot.displayName="ChatWidget",Ot.__docgenInfo={description:"",displayName:"ChatWidget",props:{config:{defaultValue:null,description:"",name:"config",required:!0,type:{name:"IChatConfig"}},className:{defaultValue:{value:""},description:"",name:"className",required:!1,type:{name:"string | undefined"}},variant:{defaultValue:{value:"popover"},description:"",name:"variant",required:!1,type:{name:"enum",value:[{value:"undefined"},{value:'"popover"'},{value:'"fullPage"'}]}},externalWebSocket:{defaultValue:null,description:"",name:"externalWebSocket",required:!1,type:{name:"WebSocket | null | undefined"}},onMinimize:{defaultValue:null,description:"",name:"onMinimize",required:!1,type:{name:"(() => void) | undefined"}},onClose:{defaultValue:null,description:"",name:"onClose",required:!1,type:{name:"(() => void) | undefined"}},resolvedPosition:{defaultValue:{value:"right"},description:"Resolved position (left or right) from the parent Chat component",name:"resolvedPosition",required:!1,type:{name:"enum",value:[{value:"undefined"},{value:'"left"'},{value:'"right"'}]}}}}}catch{}function At({onSubmit:e,className:t="",initialName:n="",initialEmail:r="",onMinimize:s,onClose:o}){const[i,a]=y.useState(n),[c,u]=y.useState(r),[l,f]=y.useState({}),[h,b]=y.useState(!1),[d,v]=y.useState(null),g=()=>{const k={};return i.trim()?i.trim().length<2&&(k.name="Name must be at least 2 characters"):k.name="Name is required",c.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(c)||(k.email="Please enter a valid email address"):k.email="Email is required",f(k),Object.keys(k).length===0},_=async k=>{if(k.preventDefault(),!!g()){b(!0);try{e(i.trim(),c.trim())}catch(w){console.error("Error submitting form:",w)}finally{b(!1)}}},S=(k,w)=>({width:"100%",padding:"10px 16px",fontSize:"14px",lineHeight:"20px",letterSpacing:"0.006em",color:"#f7f7f8",backgroundColor:"rgba(255,255,255,0.04)",border:"none",borderRadius:"12px",outline:"none",boxShadow:w?"inset 0 0 0 1px rgba(255,99,99,0.5)":d===k?"inset 0 0 0 1px rgba(51,126,255,0.4), 0 0 0 3px rgba(51,126,255,0.15)":"inset 0 0 0 0.5px rgba(255,255,255,0.08)",transition:"box-shadow 0.2s ease",caretColor:"#337eff"});return p.jsxs("div",{className:`fixed bottom-4 right-4 z-50 flex flex-col overflow-hidden ${t}`,style:{width:380,maxHeight:"calc(100vh - 2rem)",backgroundColor:"#00001a",borderRadius:16,boxShadow:["inset 0 0 0 0.5px rgba(255,255,255,0.06)","inset 0 1px 0 0 rgba(255,255,255,0.12)","0 25px 60px -12px rgba(0,0,0,0.6)","0 0 40px -8px rgba(51,126,255,0.15)"].join(", "),backgroundImage:"radial-gradient(circle, rgba(255,255,255,0.03) 1px, transparent 1px)",backgroundSize:"24px 24px"},children:[p.jsxs("div",{className:"relative text-white overflow-hidden",style:{background:"linear-gradient(135deg, #337eff 0%, #005eff 50%, #001a66 100%)"},children:[p.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{background:"linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 40%)"}}),p.jsx("div",{className:"relative px-5 py-4",children:p.jsxs("div",{className:"flex items-start justify-between",children:[p.jsxs("div",{className:"flex-1",children:[p.jsx("h2",{className:"font-semibold",style:{fontSize:"17px",letterSpacing:"-0.01em"},children:"Start a Conversation"}),p.jsx("p",{className:"mt-1",style:{fontSize:"13px",letterSpacing:"0.015em",color:"rgba(255,255,255,0.6)"},children:"Please provide your details to continue"})]}),p.jsxs("div",{className:"flex gap-1 ml-2",children:[p.jsx("button",{type:"button",onClick:s,className:"p-2 rounded-lg transition-all duration-150",style:{backgroundColor:"transparent"},onMouseEnter:k=>{k.currentTarget.style.backgroundColor="rgba(255,255,255,0.1)"},onMouseLeave:k=>{k.currentTarget.style.backgroundColor="transparent"},"aria-label":"Minimize chat",children:p.jsxs("svg",{width:"18",height:"18",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[p.jsx("title",{children:"Minimize"}),p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 12H4"})]})}),p.jsx("button",{type:"button",onClick:o,className:"p-2 rounded-lg transition-all duration-150",style:{backgroundColor:"transparent"},onMouseEnter:k=>{k.currentTarget.style.backgroundColor="rgba(255,255,255,0.1)"},onMouseLeave:k=>{k.currentTarget.style.backgroundColor="transparent"},"aria-label":"Close chat",children:p.jsxs("svg",{width:"18",height:"18",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[p.jsx("title",{children:"Close"}),p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})]})})]})]})}),p.jsx("div",{className:"h-px",style:{background:"linear-gradient(90deg, transparent 5%, rgba(255,255,255,0.12) 30%, rgba(255,255,255,0.12) 70%, transparent 95%)"}})]}),p.jsxs("form",{onSubmit:_,className:"p-5 flex flex-col gap-4",children:[p.jsxs("div",{children:[p.jsxs("label",{htmlFor:"chat-name",className:"block mb-2 font-medium",style:{fontSize:"13px",letterSpacing:"0.015em",color:"rgba(247,247,248,0.72)"},children:["Name ",p.jsx("span",{style:{color:"#ff6363"},children:"*"})]}),p.jsx("input",{type:"text",id:"chat-name",value:i,onChange:k=>{a(k.target.value),l.name&&f(w=>({...w,name:void 0}))},onFocus:()=>v("name"),onBlur:()=>v(null),style:S("name",!!l.name),placeholder:"John Doe",disabled:h,autoComplete:"name"}),l.name&&p.jsx("p",{className:"mt-1.5",style:{fontSize:"12px",letterSpacing:"0.015em",color:"#ff6363"},role:"alert",children:l.name})]}),p.jsxs("div",{children:[p.jsxs("label",{htmlFor:"chat-email",className:"block mb-2 font-medium",style:{fontSize:"13px",letterSpacing:"0.015em",color:"rgba(247,247,248,0.72)"},children:["Email ",p.jsx("span",{style:{color:"#ff6363"},children:"*"})]}),p.jsx("input",{type:"email",id:"chat-email",value:c,onChange:k=>{u(k.target.value),l.email&&f(w=>({...w,email:void 0}))},onFocus:()=>v("email"),onBlur:()=>v(null),style:S("email",!!l.email),placeholder:"john@example.com",disabled:h,autoComplete:"email"}),l.email&&p.jsx("p",{className:"mt-1.5",style:{fontSize:"12px",letterSpacing:"0.015em",color:"#ff6363"},role:"alert",children:l.email})]}),p.jsx("button",{type:"submit",disabled:h,className:"w-full py-2.5 rounded-xl font-semibold text-white transition-all duration-200",style:{fontSize:"14px",letterSpacing:"0.006em",background:"linear-gradient(135deg, #337eff, #005eff)",boxShadow:"0 4px 16px -4px rgba(51,126,255,0.4)",opacity:h?.6:1,cursor:h?"not-allowed":"pointer"},onMouseEnter:k=>{h||(k.currentTarget.style.boxShadow="0 6px 20px -4px rgba(51,126,255,0.5)")},onMouseLeave:k=>{k.currentTarget.style.boxShadow="0 4px 16px -4px rgba(51,126,255,0.4)"},children:h?p.jsxs("span",{className:"flex items-center justify-center gap-2",children:[p.jsxs("svg",{className:"animate-spin",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-label":"Loading",children:[p.jsx("title",{children:"Loading"}),p.jsx("path",{d:"M21 12a9 9 0 11-6.219-8.56"})]}),"Starting Chat..."]}):"Start Chat"}),p.jsx("p",{className:"text-center",style:{fontSize:"11px",letterSpacing:"0.019em",color:"rgba(247,247,248,0.28)"},children:"We respect your privacy. Your information will only be used to assist you."})]}),p.jsx("div",{className:"px-4 py-1.5 text-center",style:{borderTop:"1px solid rgba(255,255,255,0.06)",backgroundColor:"rgba(0,0,0,0.2)"},children:p.jsxs("p",{style:{fontSize:"10px",letterSpacing:"0.025em",color:"rgba(247,247,248,0.28)"},children:["Powered by"," ",p.jsx("span",{style:{fontWeight:600,color:"rgba(247,247,248,0.45)"},children:"Xcelsior"})]})})]})}try{At.displayName="PreChatForm",At.__docgenInfo={description:`PreChatForm component for collecting user information before starting chat.
743
+ Styled to match the Xcelsior website design system.`,displayName:"PreChatForm",props:{onSubmit:{defaultValue:null,description:"",name:"onSubmit",required:!0,type:{name:"(name: string, email: string) => void"}},className:{defaultValue:{value:""},description:"",name:"className",required:!1,type:{name:"string | undefined"}},initialName:{defaultValue:{value:""},description:"",name:"initialName",required:!1,type:{name:"string | undefined"}},initialEmail:{defaultValue:{value:""},description:"",name:"initialEmail",required:!1,type:{name:"string | undefined"}},onMinimize:{defaultValue:null,description:"Callback when user wants to minimize the form",name:"onMinimize",required:!0,type:{name:"() => void"}},onClose:{defaultValue:null,description:"Callback when user wants to close the form",name:"onClose",required:!0,type:{name:"() => void"}}}}}catch{}const js="xcelsior-chat-position";function da(){try{const e=localStorage.getItem(js);if(e==="left"||e==="right")return e}catch{}return"right"}function fa(e){try{localStorage.setItem(js,e)}catch{}}function pa(e="auto"){const t=e==="auto"?da():e,[n,r]=y.useState(t),[s,o]=y.useState(!1),i=y.useRef(0),a=y.useRef(null),c=y.useRef(!1),[u,l]=y.useState(!1);y.useEffect(()=>{try{if(!localStorage.getItem("xcelsior-chat-hint-shown")&&!c.current){c.current=!0,l(!0);const v=setTimeout(()=>{l(!1),localStorage.setItem("xcelsior-chat-hint-shown","true")},2e3);return()=>clearTimeout(v)}}catch{}},[]);const f=y.useCallback(d=>{i.current=d.clientX,o(!0),d.target.setPointerCapture(d.pointerId)},[]),h=y.useCallback(d=>{},[]),b=y.useCallback(d=>{o(!1),d.target.releasePointerCapture(d.pointerId);const v=d.clientX-i.current;if(Math.abs(v)>50){const g=window.innerWidth/2,_=d.clientX<g?"left":"right";_!==n&&(r(_),fa(_))}},[n]);return{position:n,isDragging:s,showHint:u,fabRef:a,handlers:{onPointerDown:f,onPointerMove:h,onPointerUp:b}}}function ha({state:e,defaultState:t="minimized",onStateChange:n}){const[r,s]=y.useState(t),o=e!==void 0&&e!=="undefined",i=o?e:r,a=y.useCallback(c=>{o||s(c),n==null||n(c)},[o,n]);return{currentState:i,setState:a,isControlled:o}}function We(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).substring(2,15)}`}function It({config:e,className:t="",storageKeyPrefix:n="xcelsior_chat",onPreChatSubmit:r,state:s,defaultState:o="minimized",onStateChange:i}){var U,M,q,B,te,ue,J,Z;const[a,c]=y.useState(null),[u,l]=y.useState(""),[f,h]=y.useState(!0),b=e.identityCollection||"progressive",{position:d,isDragging:v,showHint:g,handlers:_}=pa(e.position),S=y.useRef(!1),{currentState:k,setState:w}=ha({state:s,defaultState:o,onStateChange:i}),E=e.conversationId,L=(U=e.currentUser)==null?void 0:U.email,T=(M=e.currentUser)==null?void 0:M.name,A=(q=e.currentUser)==null?void 0:q.avatar,O=(B=e.currentUser)==null?void 0:B.status;y.useEffect(()=>{if(S.current)return;(()=>{try{if(L&&T){const $=E||We();c({name:T,email:L,avatar:A,type:"customer",status:O}),l($),h(!1),S.current=!0;return}const W=localStorage.getItem(`${n}_user`);if(W){const $=JSON.parse(W);if(!(Date.now()-$.timestamp>1440*60*1e3)&&$.email&&$.name){const de={name:$.name,email:$.email,type:"customer",status:"online"};c(de),l($.conversationId),h(!1),S.current=!0;return}}const ne=E||We();l(ne),(b==="progressive"||b==="none")&&c(null),S.current=!0}catch(W){console.error("Error initializing chat session:",W),l(E||We()),S.current=!0}finally{h(!1)}})()},[E,L,T,A,O,n,b]);const j=y.useCallback((X,W)=>{const ne=u||We(),$={name:X,email:W,type:"customer",status:"online"},F={name:X,email:W,conversationId:ne,timestamp:Date.now()};try{localStorage.setItem(`${n}_user`,JSON.stringify(F))}catch{}c($),l(ne),r==null||r($)},[u,n,r]);if(f||k==="closed")return null;const I=d==="left"?"left-4":"right-4",z=((te=e.theme)==null?void 0:te.primary)||"#337eff",C=((ue=e.theme)==null?void 0:ue.primaryStrong)||"#005eff";if(k==="minimized")return p.jsx("div",{className:`fixed bottom-5 ${I} z-50 ${t}`,children:p.jsxs("button",{type:"button",onClick:()=>w("open"),className:`group relative rounded-full text-white transition-all duration-300 flex items-center justify-center touch-none select-none ${g?"animate-bounce":""} ${v?"cursor-grabbing":"cursor-grab"}`,onMouseEnter:X=>{X.currentTarget.style.transform="scale(1.08)"},onMouseLeave:X=>{X.currentTarget.style.transform=v?"scale(1.1)":"scale(1)"},style:{width:64,height:64,background:`linear-gradient(135deg, ${z}, ${C})`,boxShadow:[`0 4px 24px 0 ${z}80`,"0 8px 32px -4px rgba(0,0,0,0.3)","inset 0 1px 0 0 rgba(255,255,255,0.2)"].join(", ")},"aria-label":"Open chat",..._,children:[p.jsx(Ms,{size:28,color:"white",className:"pointer-events-none"}),p.jsx("span",{className:"absolute inset-0 rounded-full animate-ping pointer-events-none",style:{backgroundColor:z,opacity:.15,animationDuration:"2.5s"}})]})});if(b==="form"&&(!a||!a.email||!a.name))return p.jsx(At,{onSubmit:j,className:t,initialName:(J=e.currentUser)==null?void 0:J.name,initialEmail:(Z=e.currentUser)==null?void 0:Z.email,onClose:()=>w("closed"),onMinimize:()=>w("minimized")});const P={...e,conversationId:u,currentUser:a||void 0};return p.jsx(Ot,{config:P,className:t,onClose:()=>w("closed"),onMinimize:()=>w("minimized"),resolvedPosition:d})}try{It.displayName="Chat",It.__docgenInfo={description:"",displayName:"Chat",props:{config:{defaultValue:null,description:"",name:"config",required:!0,type:{name:'Omit<IChatConfig, "conversationId"> & { conversationId?: string | undefined; }'}},className:{defaultValue:{value:""},description:"",name:"className",required:!1,type:{name:"string | undefined"}},storageKeyPrefix:{defaultValue:{value:"xcelsior_chat"},description:"",name:"storageKeyPrefix",required:!1,type:{name:"string | undefined"}},onPreChatSubmit:{defaultValue:null,description:"",name:"onPreChatSubmit",required:!1,type:{name:"((user: IUser) => void) | undefined"}},state:{defaultValue:null,description:"",name:"state",required:!1,type:{name:"enum",value:[{value:"undefined"},{value:'"undefined"'},{value:'"open"'},{value:'"minimized"'},{value:'"closed"'}]}},defaultState:{defaultValue:{value:"minimized"},description:"",name:"defaultState",required:!1,type:{name:"enum",value:[{value:"undefined"},{value:'"undefined"'},{value:'"open"'},{value:'"minimized"'},{value:'"closed"'}]}},onStateChange:{defaultValue:null,description:"",name:"onStateChange",required:!1,type:{name:"((state: ChatWidgetState) => void) | undefined"}}}}}catch{}const Fa={title:"Components/Chat",component:It,parameters:{layout:"fullscreen"},tags:["autodocs"]},ma={primary:"#337eff",primaryStrong:"#005eff",background:"#02164a",backgroundAlt:"#00001a",text:"#f7f7f8",textMuted:"rgba(247, 247, 248, 0.6)",statusPositive:"#1ed473",statusCaution:"#ffa938",statusNegative:"#ff6363",borderColor:"rgba(255, 255, 255, 0.1)"},ce={websocketUrl:"wss://m9v95p1m5g.execute-api.ap-southeast-2.amazonaws.com/dev",httpApiUrl:"https://1f5bjg13ej.execute-api.ap-southeast-2.amazonaws.com/dev",enableEmoji:!0,enableFileUpload:!0,enableTypingIndicator:!0,fileUpload:{uploadUrl:"https://dev-chat.xcelsior.co/api/attachments/upload-url",maxFileSize:2*1024*1024,allowedTypes:["image/jpeg","image/png","image/gif","application/pdf","text/plain"]},enableReadReceipts:!0,apiKey:"test",theme:ma,toast:{success:e=>console.log("Success:",e),error:e=>console.error("Error:",e),info:e=>console.log("Info:",e)}},Ee={args:{config:{...ce,identityCollection:"progressive"}}},je={args:{config:{...ce,identityCollection:"form"}}},Re={args:{config:{...ce,identityCollection:"progressive",currentUser:{name:"John Doe",email:"john@example.com",type:"customer",status:"online"}}}},Te={args:{config:{...ce,identityCollection:"progressive",position:"left"}}},Me={args:{config:{...ce,identityCollection:"progressive",position:"right"}}},Le={args:{config:{...ce,identityCollection:"progressive",position:"auto"}}},Pe={args:{config:{...ce,identityCollection:"progressive",theme:{primary:"#005eff",primaryStrong:"#003ecc",background:"#ffffff",backgroundAlt:"#f7f7f8",text:"#171719",textMuted:"rgba(23, 23, 25, 0.5)",statusPositive:"#1ed473",statusCaution:"#ffa938",statusNegative:"#ff6363",borderColor:"rgba(0, 0, 0, 0.1)"}}}},ze={args:{config:ce}},Ne={args:{config:ce,defaultState:"open"}},Oe={args:{config:{...ce,identityCollection:"progressive"},defaultState:"open"}};var On,An,In,Dn,Un;Ee.parameters={...Ee.parameters,docs:{...(On=Ee.parameters)==null?void 0:On.docs,source:{originalSource:`{
744
+ args: {
745
+ config: {
746
+ ...baseConfig,
747
+ identityCollection: 'progressive'
748
+ }
749
+ }
750
+ }`,...(In=(An=Ee.parameters)==null?void 0:An.docs)==null?void 0:In.source},description:{story:"Progressive identity mode (default) — no pre-chat form, bot collects info during conversation",...(Un=(Dn=Ee.parameters)==null?void 0:Dn.docs)==null?void 0:Un.description}}};var Bn,Fn,Hn,qn,Vn;je.parameters={...je.parameters,docs:{...(Bn=je.parameters)==null?void 0:Bn.docs,source:{originalSource:`{
751
+ args: {
752
+ config: {
753
+ ...baseConfig,
754
+ identityCollection: 'form'
755
+ }
756
+ }
757
+ }`,...(Hn=(Fn=je.parameters)==null?void 0:Fn.docs)==null?void 0:Hn.source},description:{story:"Form identity mode — shows pre-chat form before chat",...(Vn=(qn=je.parameters)==null?void 0:qn.docs)==null?void 0:Vn.description}}};var Wn,Jn,Xn,Kn,Gn;Re.parameters={...Re.parameters,docs:{...(Wn=Re.parameters)==null?void 0:Wn.docs,source:{originalSource:`{
758
+ args: {
759
+ config: {
760
+ ...baseConfig,
761
+ identityCollection: 'progressive',
762
+ currentUser: {
763
+ name: 'John Doe',
764
+ email: 'john@example.com',
765
+ type: 'customer',
766
+ status: 'online'
767
+ }
768
+ }
769
+ }
770
+ }`,...(Xn=(Jn=Re.parameters)==null?void 0:Jn.docs)==null?void 0:Xn.source},description:{story:"With known user — skips form/anonymous, goes straight to chat",...(Gn=(Kn=Re.parameters)==null?void 0:Kn.docs)==null?void 0:Gn.description}}};var Yn,Zn,Qn,er,tr;Te.parameters={...Te.parameters,docs:{...(Yn=Te.parameters)==null?void 0:Yn.docs,source:{originalSource:`{
771
+ args: {
772
+ config: {
773
+ ...baseConfig,
774
+ identityCollection: 'progressive',
775
+ position: 'left'
776
+ }
777
+ }
778
+ }`,...(Qn=(Zn=Te.parameters)==null?void 0:Zn.docs)==null?void 0:Qn.source},description:{story:"Widget positioned on the left",...(tr=(er=Te.parameters)==null?void 0:er.docs)==null?void 0:tr.description}}};var nr,rr,sr,or,ir;Me.parameters={...Me.parameters,docs:{...(nr=Me.parameters)==null?void 0:nr.docs,source:{originalSource:`{
779
+ args: {
780
+ config: {
781
+ ...baseConfig,
782
+ identityCollection: 'progressive',
783
+ position: 'right'
784
+ }
785
+ }
786
+ }`,...(sr=(rr=Me.parameters)==null?void 0:rr.docs)==null?void 0:sr.source},description:{story:"Widget positioned on the right (explicit)",...(ir=(or=Me.parameters)==null?void 0:or.docs)==null?void 0:ir.description}}};var ar,lr,cr,ur,dr;Le.parameters={...Le.parameters,docs:{...(ar=Le.parameters)==null?void 0:ar.docs,source:{originalSource:`{
787
+ args: {
788
+ config: {
789
+ ...baseConfig,
790
+ identityCollection: 'progressive',
791
+ position: 'auto'
792
+ }
793
+ }
794
+ }`,...(cr=(lr=Le.parameters)==null?void 0:lr.docs)==null?void 0:cr.source},description:{story:"Auto position — reads from localStorage, falls back to right",...(dr=(ur=Le.parameters)==null?void 0:ur.docs)==null?void 0:dr.description}}};var fr,pr,hr,mr,gr;Pe.parameters={...Pe.parameters,docs:{...(fr=Pe.parameters)==null?void 0:fr.docs,source:{originalSource:`{
795
+ args: {
796
+ config: {
797
+ ...baseConfig,
798
+ identityCollection: 'progressive',
799
+ theme: {
800
+ primary: '#005eff',
801
+ primaryStrong: '#003ecc',
802
+ background: '#ffffff',
803
+ backgroundAlt: '#f7f7f8',
804
+ text: '#171719',
805
+ textMuted: 'rgba(23, 23, 25, 0.5)',
806
+ statusPositive: '#1ed473',
807
+ statusCaution: '#ffa938',
808
+ statusNegative: '#ff6363',
809
+ borderColor: 'rgba(0, 0, 0, 0.1)'
810
+ }
811
+ }
812
+ }
813
+ }`,...(hr=(pr=Pe.parameters)==null?void 0:pr.docs)==null?void 0:hr.source},description:{story:"Light theme variant",...(gr=(mr=Pe.parameters)==null?void 0:mr.docs)==null?void 0:gr.description}}};var br,vr,yr,xr,_r;ze.parameters={...ze.parameters,docs:{...(br=ze.parameters)==null?void 0:br.docs,source:{originalSource:`{
814
+ args: {
815
+ config: baseConfig
816
+ }
817
+ }`,...(yr=(vr=ze.parameters)==null?void 0:vr.docs)==null?void 0:yr.source},description:{story:"Default (dark theme Xcelsior branded)",...(_r=(xr=ze.parameters)==null?void 0:xr.docs)==null?void 0:_r.description}}};var wr,kr,Cr,Sr,$r;Ne.parameters={...Ne.parameters,docs:{...(wr=Ne.parameters)==null?void 0:wr.docs,source:{originalSource:`{
818
+ args: {
819
+ config: baseConfig,
820
+ defaultState: 'open'
821
+ }
822
+ }`,...(Cr=(kr=Ne.parameters)==null?void 0:kr.docs)==null?void 0:Cr.source},description:{story:"Starts in open state",...($r=(Sr=Ne.parameters)==null?void 0:Sr.docs)==null?void 0:$r.description}}};var Er,jr,Rr,Tr,Mr;Oe.parameters={...Oe.parameters,docs:{...(Er=Oe.parameters)==null?void 0:Er.docs,source:{originalSource:`{
823
+ args: {
824
+ config: {
825
+ ...baseConfig,
826
+ identityCollection: 'progressive'
827
+ },
828
+ defaultState: 'open'
829
+ }
830
+ }`,...(Rr=(jr=Oe.parameters)==null?void 0:jr.docs)==null?void 0:Rr.source},description:{story:"Resizable widget — drag the bottom-right corner to resize",...(Mr=(Tr=Oe.parameters)==null?void 0:Tr.docs)==null?void 0:Mr.description}}};const Ha=["ProgressiveIdentity","FormIdentity","WithKnownUser","PositionLeft","PositionRight","PositionAuto","LightTheme","Default","OpenByDefault","Resizable"];export{ze as Default,je as FormIdentity,Pe as LightTheme,Ne as OpenByDefault,Le as PositionAuto,Te as PositionLeft,Me as PositionRight,Ee as ProgressiveIdentity,Oe as Resizable,Re as WithKnownUser,Ha as __namedExportsOrder,Fa as default};