more-desk-one 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,49 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react/jsx-runtime"),N=require("react"),Lo=require("react-dom");function Bo(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const f=Bo(N),$o=Bo(Lo);function Tt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var aa={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Wn(e,t){function n(o,s,i){if(!(typeof document>"u")){i=Tt({},t,i),typeof i.expires=="number"&&(i.expires=new Date(Date.now()+i.expires*864e5)),i.expires&&(i.expires=i.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var c in i)i[c]&&(a+="; "+c,i[c]!==!0&&(a+="="+i[c].split(";")[0]));return document.cookie=o+"="+e.write(s,o)+a}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var s=document.cookie?document.cookie.split("; "):[],i={},a=0;a<s.length;a++){var c=s[a].split("="),l=c.slice(1).join("=");try{var u=decodeURIComponent(c[0]);if(i[u]=e.read(l,u),o===u)break}catch{}}return o?i[o]:i}}return Object.create({set:n,get:r,remove:function(o,s){n(o,"",Tt({},s,{expires:-1}))},withAttributes:function(o){return Wn(this.converter,Tt({},this.attributes,o))},withConverter:function(o){return Wn(Tt({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var X=Wn(aa,{path:"/"});class pt extends Error{}pt.prototype.name="InvalidTokenError";function ca(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,n)=>{let r=n.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function la(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return ca(t)}catch{return atob(t)}}function ua(e,t){if(typeof e!="string")throw new pt("Invalid token specified: must be a string");t||(t={});const n=t.header===!0?0:1,r=e.split(".")[n];if(typeof r!="string")throw new pt(`Invalid token specified: missing part #${n+1}`);let o;try{o=la(r)}catch(s){throw new pt(`Invalid token specified: invalid base64 for part #${n+1} (${s.message})`)}try{return JSON.parse(o)}catch(s){throw new pt(`Invalid token specified: invalid json for part #${n+1} (${s.message})`)}}function Uo(e,t){return function(){return e.apply(t,arguments)}}const{toString:da}=Object.prototype,{getPrototypeOf:ur}=Object,{iterator:un,toStringTag:Ho}=Symbol,dn=(e=>t=>{const n=da.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),me=e=>(e=e.toLowerCase(),t=>dn(t)===e),fn=e=>t=>typeof t===e,{isArray:nt}=Array,Qe=fn("undefined");function xt(e){return e!==null&&!Qe(e)&&e.constructor!==null&&!Qe(e.constructor)&&oe(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const zo=me("ArrayBuffer");function fa(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&zo(e.buffer),t}const pa=fn("string"),oe=fn("function"),Vo=fn("number"),Ct=e=>e!==null&&typeof e=="object",ma=e=>e===!0||e===!1,Ut=e=>{if(dn(e)!=="object")return!1;const t=ur(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Ho in e)&&!(un in e)},ha=e=>{if(!Ct(e)||xt(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},ga=me("Date"),ba=me("File"),va=me("Blob"),wa=me("FileList"),ya=e=>Ct(e)&&oe(e.pipe),xa=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||oe(e.append)&&((t=dn(e))==="formdata"||t==="object"&&oe(e.toString)&&e.toString()==="[object FormData]"))},Ca=me("URLSearchParams"),[Ea,Sa,Ra,Aa]=["ReadableStream","Request","Response","Headers"].map(me),ka=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Et(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),nt(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(xt(e))return;const s=n?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length;let a;for(r=0;r<i;r++)a=s[r],t.call(null,e[a],a,e)}}function Wo(e,t){if(xt(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,o;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const Ie=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Go=e=>!Qe(e)&&e!==Ie;function Gn(){const{caseless:e,skipUndefined:t}=Go(this)&&this||{},n={},r=(o,s)=>{const i=e&&Wo(n,s)||s;Ut(n[i])&&Ut(o)?n[i]=Gn(n[i],o):Ut(o)?n[i]=Gn({},o):nt(o)?n[i]=o.slice():(!t||!Qe(o))&&(n[i]=o)};for(let o=0,s=arguments.length;o<s;o++)arguments[o]&&Et(arguments[o],r);return n}const _a=(e,t,n,{allOwnKeys:r}={})=>(Et(t,(o,s)=>{n&&oe(o)?e[s]=Uo(o,n):e[s]=o},{allOwnKeys:r}),e),Pa=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Oa=(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)},Ta=(e,t,n,r)=>{let o,s,i;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],(!r||r(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=n!==!1&&ur(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Ma=(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},Fa=e=>{if(!e)return null;if(nt(e))return e;let t=e.length;if(!Vo(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Na=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ur(Uint8Array)),Da=(e,t)=>{const r=(e&&e[un]).call(e);let o;for(;(o=r.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},Ia=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},ja=me("HTMLFormElement"),La=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),jr=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Ba=me("RegExp"),Ko=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Et(n,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(r[s]=i||o)}),Object.defineProperties(e,r)},$a=e=>{Ko(e,(t,n)=>{if(oe(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(oe(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+"'")})}})},Ua=(e,t)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return nt(e)?r(e):r(String(e).split(t)),n},Ha=()=>{},za=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Va(e){return!!(e&&oe(e.append)&&e[Ho]==="FormData"&&e[un])}const Wa=e=>{const t=new Array(10),n=(r,o)=>{if(Ct(r)){if(t.indexOf(r)>=0)return;if(xt(r))return r;if(!("toJSON"in r)){t[o]=r;const s=nt(r)?[]:{};return Et(r,(i,a)=>{const c=n(i,o+1);!Qe(c)&&(s[a]=c)}),t[o]=void 0,s}}return r};return n(e,0)},Ga=me("AsyncFunction"),Ka=e=>e&&(Ct(e)||oe(e))&&oe(e.then)&&oe(e.catch),qo=((e,t)=>e?setImmediate:t?((n,r)=>(Ie.addEventListener("message",({source:o,data:s})=>{o===Ie&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),Ie.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",oe(Ie.postMessage)),qa=typeof queueMicrotask<"u"?queueMicrotask.bind(Ie):typeof process<"u"&&process.nextTick||qo,Xa=e=>e!=null&&oe(e[un]),w={isArray:nt,isArrayBuffer:zo,isBuffer:xt,isFormData:xa,isArrayBufferView:fa,isString:pa,isNumber:Vo,isBoolean:ma,isObject:Ct,isPlainObject:Ut,isEmptyObject:ha,isReadableStream:Ea,isRequest:Sa,isResponse:Ra,isHeaders:Aa,isUndefined:Qe,isDate:ga,isFile:ba,isBlob:va,isRegExp:Ba,isFunction:oe,isStream:ya,isURLSearchParams:Ca,isTypedArray:Na,isFileList:wa,forEach:Et,merge:Gn,extend:_a,trim:ka,stripBOM:Pa,inherits:Oa,toFlatObject:Ta,kindOf:dn,kindOfTest:me,endsWith:Ma,toArray:Fa,forEachEntry:Da,matchAll:Ia,isHTMLForm:ja,hasOwnProperty:jr,hasOwnProp:jr,reduceDescriptors:Ko,freezeMethods:$a,toObjectSet:Ua,toCamelCase:La,noop:Ha,toFiniteNumber:za,findKey:Wo,global:Ie,isContextDefined:Go,isSpecCompliantForm:Va,toJSONObject:Wa,isAsyncFn:Ga,isThenable:Ka,setImmediate:qo,asap:qa,isIterable:Xa};function $(e,t,n,r,o){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),o&&(this.response=o,this.status=o.status?o.status:null)}w.inherits($,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:w.toJSONObject(this.config),code:this.code,status:this.status}}});const Xo=$.prototype,Yo={};["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=>{Yo[e]={value:e}});Object.defineProperties($,Yo);Object.defineProperty(Xo,"isAxiosError",{value:!0});$.from=(e,t,n,r,o,s)=>{const i=Object.create(Xo);w.toFlatObject(e,i,function(u){return u!==Error.prototype},l=>l!=="isAxiosError");const a=e&&e.message?e.message:"Error",c=t==null&&e?e.code:t;return $.call(i,a,c,n,r,o),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",s&&Object.assign(i,s),i};const Ya=null;function Kn(e){return w.isPlainObject(e)||w.isArray(e)}function Jo(e){return w.endsWith(e,"[]")?e.slice(0,-2):e}function Lr(e,t,n){return e?e.concat(t).map(function(o,s){return o=Jo(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function Ja(e){return w.isArray(e)&&!e.some(Kn)}const Za=w.toFlatObject(w,{},null,function(t){return/^is[A-Z]/.test(t)});function pn(e,t,n){if(!w.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=w.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,b){return!w.isUndefined(b[h])});const r=n.metaTokens,o=n.visitor||u,s=n.dots,i=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&w.isSpecCompliantForm(t);if(!w.isFunction(o))throw new TypeError("visitor must be a function");function l(p){if(p===null)return"";if(w.isDate(p))return p.toISOString();if(w.isBoolean(p))return p.toString();if(!c&&w.isBlob(p))throw new $("Blob is not supported. Use a Buffer instead.");return w.isArrayBuffer(p)||w.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,h,b){let y=p;if(p&&!b&&typeof p=="object"){if(w.endsWith(h,"{}"))h=r?h:h.slice(0,-2),p=JSON.stringify(p);else if(w.isArray(p)&&Ja(p)||(w.isFileList(p)||w.endsWith(h,"[]"))&&(y=w.toArray(p)))return h=Jo(h),y.forEach(function(C,A){!(w.isUndefined(C)||C===null)&&t.append(i===!0?Lr([h],A,s):i===null?h:h+"[]",l(C))}),!1}return Kn(p)?!0:(t.append(Lr(b,h,s),l(p)),!1)}const d=[],m=Object.assign(Za,{defaultVisitor:u,convertValue:l,isVisitable:Kn});function v(p,h){if(!w.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+h.join("."));d.push(p),w.forEach(p,function(y,k){(!(w.isUndefined(y)||y===null)&&o.call(t,y,w.isString(k)?k.trim():k,h,m))===!0&&v(y,h?h.concat(k):[k])}),d.pop()}}if(!w.isObject(e))throw new TypeError("data must be an object");return v(e),t}function Br(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function dr(e,t){this._pairs=[],e&&pn(e,this,t)}const Zo=dr.prototype;Zo.append=function(t,n){this._pairs.push([t,n])};Zo.toString=function(t){const n=t?function(r){return t.call(this,r,Br)}:Br;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function Qa(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Qo(e,t,n){if(!t)return e;const r=n&&n.encode||Qa;w.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(o?s=o(t,n):s=w.isURLSearchParams(t)?t.toString():new dr(t,n).toString(r),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class $r{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){w.forEach(this.handlers,function(r){r!==null&&t(r)})}}const es={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ec=typeof URLSearchParams<"u"?URLSearchParams:dr,tc=typeof FormData<"u"?FormData:null,nc=typeof Blob<"u"?Blob:null,rc={isBrowser:!0,classes:{URLSearchParams:ec,FormData:tc,Blob:nc},protocols:["http","https","file","blob","url","data"]},fr=typeof window<"u"&&typeof document<"u",qn=typeof navigator=="object"&&navigator||void 0,oc=fr&&(!qn||["ReactNative","NativeScript","NS"].indexOf(qn.product)<0),sc=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ic=fr&&window.location.href||"http://localhost",ac=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:fr,hasStandardBrowserEnv:oc,hasStandardBrowserWebWorkerEnv:sc,navigator:qn,origin:ic},Symbol.toStringTag,{value:"Module"})),ne={...ac,...rc};function cc(e,t){return pn(e,new ne.classes.URLSearchParams,{visitor:function(n,r,o,s){return ne.isNode&&w.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function lc(e){return w.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function uc(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}function ts(e){function t(n,r,o,s){let i=n[s++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),c=s>=n.length;return i=!i&&w.isArray(o)?o.length:i,c?(w.hasOwnProp(o,i)?o[i]=[o[i],r]:o[i]=r,!a):((!o[i]||!w.isObject(o[i]))&&(o[i]=[]),t(n,r,o[i],s)&&w.isArray(o[i])&&(o[i]=uc(o[i])),!a)}if(w.isFormData(e)&&w.isFunction(e.entries)){const n={};return w.forEachEntry(e,(r,o)=>{t(lc(r),o,n,0)}),n}return null}function dc(e,t,n){if(w.isString(e))try{return(t||JSON.parse)(e),w.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const St={transitional:es,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=w.isObject(t);if(s&&w.isHTMLForm(t)&&(t=new FormData(t)),w.isFormData(t))return o?JSON.stringify(ts(t)):t;if(w.isArrayBuffer(t)||w.isBuffer(t)||w.isStream(t)||w.isFile(t)||w.isBlob(t)||w.isReadableStream(t))return t;if(w.isArrayBufferView(t))return t.buffer;if(w.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return cc(t,this.formSerializer).toString();if((a=w.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return pn(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),dc(t)):t}],transformResponse:[function(t){const n=this.transitional||St.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(w.isResponse(t)||w.isReadableStream(t))return t;if(t&&w.isString(t)&&(r&&!this.responseType||o)){const i=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(a){if(i)throw a.name==="SyntaxError"?$.from(a,$.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:ne.classes.FormData,Blob:ne.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};w.forEach(["delete","get","head","post","put","patch"],e=>{St.headers[e]={}});const fc=w.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"]),pc=e=>{const t={};let n,r,o;return e&&e.split(`
2
- `).forEach(function(i){o=i.indexOf(":"),n=i.substring(0,o).trim().toLowerCase(),r=i.substring(o+1).trim(),!(!n||t[n]&&fc[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Ur=Symbol("internals");function ut(e){return e&&String(e).trim().toLowerCase()}function Ht(e){return e===!1||e==null?e:w.isArray(e)?e.map(Ht):String(e)}function mc(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 hc=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Rn(e,t,n,r,o){if(w.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!w.isString(t)){if(w.isString(r))return t.indexOf(r)!==-1;if(w.isRegExp(r))return r.test(t)}}function gc(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function bc(e,t){const n=w.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,s,i){return this[r].call(this,t,o,s,i)},configurable:!0})})}let se=class{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function s(a,c,l){const u=ut(c);if(!u)throw new Error("header name must be a non-empty string");const d=w.findKey(o,u);(!d||o[d]===void 0||l===!0||l===void 0&&o[d]!==!1)&&(o[d||c]=Ht(a))}const i=(a,c)=>w.forEach(a,(l,u)=>s(l,u,c));if(w.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(w.isString(t)&&(t=t.trim())&&!hc(t))i(pc(t),n);else if(w.isObject(t)&&w.isIterable(t)){let a={},c,l;for(const u of t){if(!w.isArray(u))throw TypeError("Object iterator must return a key-value pair");a[l=u[0]]=(c=a[l])?w.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}i(a,n)}else t!=null&&s(n,t,r);return this}get(t,n){if(t=ut(t),t){const r=w.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return mc(o);if(w.isFunction(n))return n.call(this,o,r);if(w.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=ut(t),t){const r=w.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Rn(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function s(i){if(i=ut(i),i){const a=w.findKey(r,i);a&&(!n||Rn(r,r[a],a,n))&&(delete r[a],o=!0)}}return w.isArray(t)?t.forEach(s):s(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const s=n[r];(!t||Rn(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const n=this,r={};return w.forEach(this,(o,s)=>{const i=w.findKey(r,s);if(i){n[i]=Ht(o),delete n[s];return}const a=t?gc(s):String(s).trim();a!==s&&delete n[s],n[a]=Ht(o),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return w.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&w.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(o=>r.set(o)),r}static accessor(t){const r=(this[Ur]=this[Ur]={accessors:{}}).accessors,o=this.prototype;function s(i){const a=ut(i);r[a]||(bc(o,i),r[a]=!0)}return w.isArray(t)?t.forEach(s):s(t),this}};se.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);w.reduceDescriptors(se.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});w.freezeMethods(se);function An(e,t){const n=this||St,r=t||n,o=se.from(r.headers);let s=r.data;return w.forEach(e,function(a){s=a.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function ns(e){return!!(e&&e.__CANCEL__)}function rt(e,t,n){$.call(this,e??"canceled",$.ERR_CANCELED,t,n),this.name="CanceledError"}w.inherits(rt,$,{__CANCEL__:!0});function rs(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new $("Request failed with status code "+n.status,[$.ERR_BAD_REQUEST,$.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function vc(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function wc(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,s=0,i;return t=t!==void 0?t:1e3,function(c){const l=Date.now(),u=r[s];i||(i=l),n[o]=c,r[o]=l;let d=s,m=0;for(;d!==o;)m+=n[d++],d=d%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),l-i<t)return;const v=u&&l-u;return v?Math.round(m*1e3/v):void 0}}function yc(e,t){let n=0,r=1e3/t,o,s;const i=(l,u=Date.now())=>{n=u,o=null,s&&(clearTimeout(s),s=null),e(...l)};return[(...l)=>{const u=Date.now(),d=u-n;d>=r?i(l,u):(o=l,s||(s=setTimeout(()=>{s=null,i(o)},r-d)))},()=>o&&i(o)]}const Jt=(e,t,n=3)=>{let r=0;const o=wc(50,250);return yc(s=>{const i=s.loaded,a=s.lengthComputable?s.total:void 0,c=i-r,l=o(c),u=i<=a;r=i;const d={loaded:i,total:a,progress:a?i/a:void 0,bytes:c,rate:l||void 0,estimated:l&&a&&u?(a-i)/l:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},Hr=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},zr=e=>(...t)=>w.asap(()=>e(...t)),xc=ne.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ne.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ne.origin),ne.navigator&&/(msie|trident)/i.test(ne.navigator.userAgent)):()=>!0,Cc=ne.hasStandardBrowserEnv?{write(e,t,n,r,o,s,i){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];w.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),w.isString(r)&&a.push(`path=${r}`),w.isString(o)&&a.push(`domain=${o}`),s===!0&&a.push("secure"),w.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 Ec(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Sc(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function os(e,t,n){let r=!Ec(t);return e&&(r||n==!1)?Sc(e,t):t}const Vr=e=>e instanceof se?{...e}:e;function Le(e,t){t=t||{};const n={};function r(l,u,d,m){return w.isPlainObject(l)&&w.isPlainObject(u)?w.merge.call({caseless:m},l,u):w.isPlainObject(u)?w.merge({},u):w.isArray(u)?u.slice():u}function o(l,u,d,m){if(w.isUndefined(u)){if(!w.isUndefined(l))return r(void 0,l,d,m)}else return r(l,u,d,m)}function s(l,u){if(!w.isUndefined(u))return r(void 0,u)}function i(l,u){if(w.isUndefined(u)){if(!w.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function a(l,u,d){if(d in t)return r(l,u);if(d in e)return r(void 0,l)}const c={url:s,method:s,data:s,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:(l,u,d)=>o(Vr(l),Vr(u),d,!0)};return w.forEach(Object.keys({...e,...t}),function(u){const d=c[u]||o,m=d(e[u],t[u],u);w.isUndefined(m)&&d!==a||(n[u]=m)}),n}const ss=e=>{const t=Le({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;if(t.headers=i=se.from(i),t.url=Qo(os(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),w.isFormData(n)){if(ne.hasStandardBrowserEnv||ne.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(w.isFunction(n.getHeaders)){const c=n.getHeaders(),l=["content-type","content-length"];Object.entries(c).forEach(([u,d])=>{l.includes(u.toLowerCase())&&i.set(u,d)})}}if(ne.hasStandardBrowserEnv&&(r&&w.isFunction(r)&&(r=r(t)),r||r!==!1&&xc(t.url))){const c=o&&s&&Cc.read(s);c&&i.set(o,c)}return t},Rc=typeof XMLHttpRequest<"u",Ac=Rc&&function(e){return new Promise(function(n,r){const o=ss(e);let s=o.data;const i=se.from(o.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:l}=o,u,d,m,v,p;function h(){v&&v(),p&&p(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let b=new XMLHttpRequest;b.open(o.method.toUpperCase(),o.url,!0),b.timeout=o.timeout;function y(){if(!b)return;const C=se.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),R={data:!a||a==="text"||a==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:C,config:e,request:b};rs(function(E){n(E),h()},function(E){r(E),h()},R),b=null}"onloadend"in b?b.onloadend=y:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(y)},b.onabort=function(){b&&(r(new $("Request aborted",$.ECONNABORTED,e,b)),b=null)},b.onerror=function(A){const R=A&&A.message?A.message:"Network Error",x=new $(R,$.ERR_NETWORK,e,b);x.event=A||null,r(x),b=null},b.ontimeout=function(){let A=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const R=o.transitional||es;o.timeoutErrorMessage&&(A=o.timeoutErrorMessage),r(new $(A,R.clarifyTimeoutError?$.ETIMEDOUT:$.ECONNABORTED,e,b)),b=null},s===void 0&&i.setContentType(null),"setRequestHeader"in b&&w.forEach(i.toJSON(),function(A,R){b.setRequestHeader(R,A)}),w.isUndefined(o.withCredentials)||(b.withCredentials=!!o.withCredentials),a&&a!=="json"&&(b.responseType=o.responseType),l&&([m,p]=Jt(l,!0),b.addEventListener("progress",m)),c&&b.upload&&([d,v]=Jt(c),b.upload.addEventListener("progress",d),b.upload.addEventListener("loadend",v)),(o.cancelToken||o.signal)&&(u=C=>{b&&(r(!C||C.type?new rt(null,e,b):C),b.abort(),b=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const k=vc(o.url);if(k&&ne.protocols.indexOf(k)===-1){r(new $("Unsupported protocol "+k+":",$.ERR_BAD_REQUEST,e));return}b.send(s||null)})},kc=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const s=function(l){if(!o){o=!0,a();const u=l instanceof Error?l:this.reason;r.abort(u instanceof $?u:new rt(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,s(new $(`timeout ${t} of ms exceeded`,$.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(s):l.removeEventListener("abort",s)}),e=null)};e.forEach(l=>l.addEventListener("abort",s));const{signal:c}=r;return c.unsubscribe=()=>w.asap(a),c}},_c=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,o;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},Pc=async function*(e,t){for await(const n of Oc(e))yield*_c(n,t)},Oc=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()}},Wr=(e,t,n,r)=>{const o=Pc(e,t);let s=0,i,a=c=>{i||(i=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:l,value:u}=await o.next();if(l){a(),c.close();return}let d=u.byteLength;if(n){let m=s+=d;n(m)}c.enqueue(new Uint8Array(u))}catch(l){throw a(l),l}},cancel(c){return a(c),o.return()}},{highWaterMark:2})},Gr=64*1024,{isFunction:Mt}=w,Tc=(({Request:e,Response:t})=>({Request:e,Response:t}))(w.global),{ReadableStream:Kr,TextEncoder:qr}=w.global,Xr=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Mc=e=>{e=w.merge.call({skipUndefined:!0},Tc,e);const{fetch:t,Request:n,Response:r}=e,o=t?Mt(t):typeof fetch=="function",s=Mt(n),i=Mt(r);if(!o)return!1;const a=o&&Mt(Kr),c=o&&(typeof qr=="function"?(p=>h=>p.encode(h))(new qr):async p=>new Uint8Array(await new n(p).arrayBuffer())),l=s&&a&&Xr(()=>{let p=!1;const h=new n(ne.origin,{body:new Kr,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!h}),u=i&&a&&Xr(()=>w.isReadableStream(new r("").body)),d={stream:u&&(p=>p.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!d[p]&&(d[p]=(h,b)=>{let y=h&&h[p];if(y)return y.call(h);throw new $(`Response type '${p}' is not supported`,$.ERR_NOT_SUPPORT,b)})});const m=async p=>{if(p==null)return 0;if(w.isBlob(p))return p.size;if(w.isSpecCompliantForm(p))return(await new n(ne.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(w.isArrayBufferView(p)||w.isArrayBuffer(p))return p.byteLength;if(w.isURLSearchParams(p)&&(p=p+""),w.isString(p))return(await c(p)).byteLength},v=async(p,h)=>{const b=w.toFiniteNumber(p.getContentLength());return b??m(h)};return async p=>{let{url:h,method:b,data:y,signal:k,cancelToken:C,timeout:A,onDownloadProgress:R,onUploadProgress:x,responseType:E,headers:S,withCredentials:P="same-origin",fetchOptions:F}=ss(p),L=t||fetch;E=E?(E+"").toLowerCase():"text";let V=kc([k,C&&C.toAbortSignal()],A),B=null;const j=V&&V.unsubscribe&&(()=>{V.unsubscribe()});let W;try{if(x&&l&&b!=="get"&&b!=="head"&&(W=await v(S,y))!==0){let J=new n(h,{method:"POST",body:y,duplex:"half"}),ee;if(w.isFormData(y)&&(ee=J.headers.get("content-type"))&&S.setContentType(ee),J.body){const[K,q]=Hr(W,Jt(zr(x)));y=Wr(J.body,Gr,K,q)}}w.isString(P)||(P=P?"include":"omit");const D=s&&"credentials"in n.prototype,G={...F,signal:V,method:b.toUpperCase(),headers:S.normalize().toJSON(),body:y,duplex:"half",credentials:D?P:void 0};B=s&&new n(h,G);let _=await(s?L(B,F):L(h,G));const M=u&&(E==="stream"||E==="response");if(u&&(R||M&&j)){const J={};["status","statusText","headers"].forEach(ue=>{J[ue]=_[ue]});const ee=w.toFiniteNumber(_.headers.get("content-length")),[K,q]=R&&Hr(ee,Jt(zr(R),!0))||[];_=new r(Wr(_.body,Gr,K,()=>{q&&q(),j&&j()}),J)}E=E||"text";let Y=await d[w.findKey(d,E)||"text"](_,p);return!M&&j&&j(),await new Promise((J,ee)=>{rs(J,ee,{data:Y,headers:se.from(_.headers),status:_.status,statusText:_.statusText,config:p,request:B})})}catch(D){throw j&&j(),D&&D.name==="TypeError"&&/Load failed|fetch/i.test(D.message)?Object.assign(new $("Network Error",$.ERR_NETWORK,p,B),{cause:D.cause||D}):$.from(D,D&&D.code,p,B)}}},Fc=new Map,is=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,s=[r,o,n];let i=s.length,a=i,c,l,u=Fc;for(;a--;)c=s[a],l=u.get(c),l===void 0&&u.set(c,l=a?new Map:Mc(t)),u=l;return l};is();const pr={http:Ya,xhr:Ac,fetch:{get:is}};w.forEach(pr,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Yr=e=>`- ${e}`,Nc=e=>w.isFunction(e)||e===null||e===!1;function Dc(e,t){e=w.isArray(e)?e:[e];const{length:n}=e;let r,o;const s={};for(let i=0;i<n;i++){r=e[i];let a;if(o=r,!Nc(r)&&(o=pr[(a=String(r)).toLowerCase()],o===void 0))throw new $(`Unknown adapter '${a}'`);if(o&&(w.isFunction(o)||(o=o.get(t))))break;s[a||"#"+i]=o}if(!o){const i=Object.entries(s).map(([c,l])=>`adapter ${c} `+(l===!1?"is not supported by the environment":"is not available in the build"));let a=n?i.length>1?`since :
4
- `+i.map(Yr).join(`
5
- `):" "+Yr(i[0]):"as no adapter specified";throw new $("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}const as={getAdapter:Dc,adapters:pr};function kn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new rt(null,e)}function Jr(e){return kn(e),e.headers=se.from(e.headers),e.data=An.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),as.getAdapter(e.adapter||St.adapter,e)(e).then(function(r){return kn(e),r.data=An.call(e,e.transformResponse,r),r.headers=se.from(r.headers),r},function(r){return ns(r)||(kn(e),r&&r.response&&(r.response.data=An.call(e,e.transformResponse,r.response),r.response.headers=se.from(r.response.headers))),Promise.reject(r)})}const cs="1.13.2",mn={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{mn[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Zr={};mn.transitional=function(t,n,r){function o(s,i){return"[Axios v"+cs+"] Transitional option '"+s+"'"+i+(r?". "+r:"")}return(s,i,a)=>{if(t===!1)throw new $(o(i," has been removed"+(n?" in "+n:"")),$.ERR_DEPRECATED);return n&&!Zr[i]&&(Zr[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,i,a):!0}};mn.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Ic(e,t,n){if(typeof e!="object")throw new $("options must be an object",$.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const a=e[s],c=a===void 0||i(a,s,e);if(c!==!0)throw new $("option "+s+" must be "+c,$.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new $("Unknown option "+s,$.ERR_BAD_OPTION)}}const zt={assertOptions:Ic,validators:mn},ge=zt.validators;let je=class{constructor(t){this.defaults=t||{},this.interceptors={request:new $r,response:new $r}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
- `+s):r.stack=s}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Le(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&zt.assertOptions(r,{silentJSONParsing:ge.transitional(ge.boolean),forcedJSONParsing:ge.transitional(ge.boolean),clarifyTimeoutError:ge.transitional(ge.boolean)},!1),o!=null&&(w.isFunction(o)?n.paramsSerializer={serialize:o}:zt.assertOptions(o,{encode:ge.function,serialize:ge.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),zt.assertOptions(n,{baseUrl:ge.spelling("baseURL"),withXsrfToken:ge.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=s&&w.merge(s.common,s[n.method]);s&&w.forEach(["delete","get","head","post","put","patch","common"],p=>{delete s[p]}),n.headers=se.concat(i,s);const a=[];let c=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(c=c&&h.synchronous,a.unshift(h.fulfilled,h.rejected))});const l=[];this.interceptors.response.forEach(function(h){l.push(h.fulfilled,h.rejected)});let u,d=0,m;if(!c){const p=[Jr.bind(this),void 0];for(p.unshift(...a),p.push(...l),m=p.length,u=Promise.resolve(n);d<m;)u=u.then(p[d++],p[d++]);return u}m=a.length;let v=n;for(;d<m;){const p=a[d++],h=a[d++];try{v=p(v)}catch(b){h.call(this,b);break}}try{u=Jr.call(this,v)}catch(p){return Promise.reject(p)}for(d=0,m=l.length;d<m;)u=u.then(l[d++],l[d++]);return u}getUri(t){t=Le(this.defaults,t);const n=os(t.baseURL,t.url,t.allowAbsoluteUrls);return Qo(n,t.params,t.paramsSerializer)}};w.forEach(["delete","get","head","options"],function(t){je.prototype[t]=function(n,r){return this.request(Le(r||{},{method:t,url:n,data:(r||{}).data}))}});w.forEach(["post","put","patch"],function(t){function n(r){return function(s,i,a){return this.request(Le(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}je.prototype[t]=n(),je.prototype[t+"Form"]=n(!0)});let jc=class ls{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(a=>{r.subscribe(a),s=a}).then(o);return i.cancel=function(){r.unsubscribe(s)},i},t(function(s,i,a){r.reason||(r.reason=new rt(s,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 ls(function(o){t=o}),cancel:t}}};function Lc(e){return function(n){return e.apply(null,n)}}function Bc(e){return w.isObject(e)&&e.isAxiosError===!0}const Xn={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(Xn).forEach(([e,t])=>{Xn[t]=e});function us(e){const t=new je(e),n=Uo(je.prototype.request,t);return w.extend(n,je.prototype,t,{allOwnKeys:!0}),w.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return us(Le(e,o))},n}const Z=us(St);Z.Axios=je;Z.CanceledError=rt;Z.CancelToken=jc;Z.isCancel=ns;Z.VERSION=cs;Z.toFormData=pn;Z.AxiosError=$;Z.Cancel=Z.CanceledError;Z.all=function(t){return Promise.all(t)};Z.spread=Lc;Z.isAxiosError=Bc;Z.mergeConfig=Le;Z.AxiosHeaders=se;Z.formToJSON=e=>ts(w.isHTMLForm(e)?new FormData(e):e);Z.getAdapter=as.getAdapter;Z.HttpStatusCode=Xn;Z.default=Z;const{Axios:Um,AxiosError:Hm,CanceledError:zm,isCancel:Vm,CancelToken:Wm,VERSION:Gm,all:Km,Cancel:qm,isAxiosError:Xm,spread:Ym,toFormData:Jm,AxiosHeaders:Zm,HttpStatusCode:Qm,formToJSON:eh,getAdapter:th,mergeConfig:nh}=Z;function H(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function Qr(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function hn(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Qr(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Qr(e[o],null)}}}}function re(...e){return f.useCallback(hn(...e),e)}function ot(e,t=[]){let n=[];function r(s,i){const a=f.createContext(i),c=n.length;n=[...n,i];const l=d=>{const{scope:m,children:v,...p}=d,h=m?.[e]?.[c]||a,b=f.useMemo(()=>p,Object.values(p));return g.jsx(h.Provider,{value:b,children:v})};l.displayName=s+"Provider";function u(d,m){const v=m?.[e]?.[c]||a,p=f.useContext(v);if(p)return p;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[l,u]}const o=()=>{const s=n.map(i=>f.createContext(i));return function(a){const c=a?.[e]||s;return f.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,$c(o,...t)]}function $c(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:c,scopeName:l})=>{const d=c(s)[`__scope${l}`];return{...a,...d}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var Pe=globalThis?.document?f.useLayoutEffect:()=>{},Uc=f[" useInsertionEffect ".trim().toString()]||Pe;function ds({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=Hc({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o;{const u=f.useRef(e!==void 0);f.useEffect(()=>{const d=u.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,r])}const l=f.useCallback(u=>{if(a){const d=zc(u)?u(e):u;d!==e&&i.current?.(d)}else s(u)},[a,e,s,i]);return[c,l]}function Hc({defaultProp:e,onChange:t}){const[n,r]=f.useState(e),o=f.useRef(n),s=f.useRef(t);return Uc(()=>{s.current=t},[t]),f.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function zc(e){return typeof e=="function"}function gt(e){const t=Vc(e),n=f.forwardRef((r,o)=>{const{children:s,...i}=r,a=f.Children.toArray(s),c=a.find(Gc);if(c){const l=c.props.children,u=a.map(d=>d===c?f.Children.count(l)>1?f.Children.only(null):f.isValidElement(l)?l.props.children:null:d);return g.jsx(t,{...i,ref:o,children:f.isValidElement(l)?f.cloneElement(l,void 0,u):null})}return g.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Vc(e){const t=f.forwardRef((n,r)=>{const{children:o,...s}=n;if(f.isValidElement(o)){const i=qc(o),a=Kc(s,o.props);return o.type!==f.Fragment&&(a.ref=r?hn(r,i):i),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Wc=Symbol("radix.slottable");function Gc(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Wc}function Kc(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function qc(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Xc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],te=Xc.reduce((e,t)=>{const n=gt(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function fs(e,t){e&&$o.flushSync(()=>e.dispatchEvent(t))}function ps(e){const t=e+"CollectionProvider",[n,r]=ot(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=h=>{const{scope:b,children:y}=h,k=N.useRef(null),C=N.useRef(new Map).current;return g.jsx(o,{scope:b,itemMap:C,collectionRef:k,children:y})};i.displayName=t;const a=e+"CollectionSlot",c=gt(a),l=N.forwardRef((h,b)=>{const{scope:y,children:k}=h,C=s(a,y),A=re(b,C.collectionRef);return g.jsx(c,{ref:A,children:k})});l.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",m=gt(u),v=N.forwardRef((h,b)=>{const{scope:y,children:k,...C}=h,A=N.useRef(null),R=re(b,A),x=s(u,y);return N.useEffect(()=>(x.itemMap.set(A,{ref:A,...C}),()=>void x.itemMap.delete(A))),g.jsx(m,{[d]:"",ref:R,children:k})});v.displayName=u;function p(h){const b=s(e+"CollectionConsumer",h);return N.useCallback(()=>{const k=b.collectionRef.current;if(!k)return[];const C=Array.from(k.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((x,E)=>C.indexOf(x.ref.current)-C.indexOf(E.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:i,Slot:l,ItemSlot:v},p,r]}var Yc=f.createContext(void 0);function Jc(e){const t=f.useContext(Yc);return e||t||"ltr"}function Oe(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>t.current?.(...n),[])}function Zc(e,t=globalThis?.document){const n=Oe(e);f.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Qc="DismissableLayer",Yn="dismissableLayer.update",el="dismissableLayer.pointerDownOutside",tl="dismissableLayer.focusOutside",eo,ms=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),mr=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,l=f.useContext(ms),[u,d]=f.useState(null),m=u?.ownerDocument??globalThis?.document,[,v]=f.useState({}),p=re(t,E=>d(E)),h=Array.from(l.layers),[b]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),y=h.indexOf(b),k=u?h.indexOf(u):-1,C=l.layersWithOutsidePointerEventsDisabled.size>0,A=k>=y,R=ol(E=>{const S=E.target,P=[...l.branches].some(F=>F.contains(S));!A||P||(o?.(E),i?.(E),E.defaultPrevented||a?.())},m),x=sl(E=>{const S=E.target;[...l.branches].some(F=>F.contains(S))||(s?.(E),i?.(E),E.defaultPrevented||a?.())},m);return Zc(E=>{k===l.layers.size-1&&(r?.(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},m),f.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(eo=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),to(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=eo)}},[u,m,n,l]),f.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),to())},[u,l]),f.useEffect(()=>{const E=()=>v({});return document.addEventListener(Yn,E),()=>document.removeEventListener(Yn,E)},[]),g.jsx(te.div,{...c,ref:p,style:{pointerEvents:C?A?"auto":"none":void 0,...e.style},onFocusCapture:H(e.onFocusCapture,x.onFocusCapture),onBlurCapture:H(e.onBlurCapture,x.onBlurCapture),onPointerDownCapture:H(e.onPointerDownCapture,R.onPointerDownCapture)})});mr.displayName=Qc;var nl="DismissableLayerBranch",rl=f.forwardRef((e,t)=>{const n=f.useContext(ms),r=f.useRef(null),o=re(t,r);return f.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),g.jsx(te.div,{...e,ref:o})});rl.displayName=nl;function ol(e,t=globalThis?.document){const n=Oe(e),r=f.useRef(!1),o=f.useRef(()=>{});return f.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){hs(el,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function sl(e,t=globalThis?.document){const n=Oe(e),r=f.useRef(!1);return f.useEffect(()=>{const o=s=>{s.target&&!r.current&&hs(tl,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function to(){const e=new CustomEvent(Yn);document.dispatchEvent(e)}function hs(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?fs(o,s):o.dispatchEvent(s)}var _n=0;function gs(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??no()),document.body.insertAdjacentElement("beforeend",e[1]??no()),_n++,()=>{_n===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),_n--}},[])}function no(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Pn="focusScope.autoFocusOnMount",On="focusScope.autoFocusOnUnmount",ro={bubbles:!1,cancelable:!0},il="FocusScope",hr=f.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,c]=f.useState(null),l=Oe(o),u=Oe(s),d=f.useRef(null),m=re(t,h=>c(h)),v=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(r){let h=function(C){if(v.paused||!a)return;const A=C.target;a.contains(A)?d.current=A:ke(d.current,{select:!0})},b=function(C){if(v.paused||!a)return;const A=C.relatedTarget;A!==null&&(a.contains(A)||ke(d.current,{select:!0}))},y=function(C){if(document.activeElement===document.body)for(const R of C)R.removedNodes.length>0&&ke(a)};document.addEventListener("focusin",h),document.addEventListener("focusout",b);const k=new MutationObserver(y);return a&&k.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",b),k.disconnect()}}},[r,a,v.paused]),f.useEffect(()=>{if(a){so.add(v);const h=document.activeElement;if(!a.contains(h)){const y=new CustomEvent(Pn,ro);a.addEventListener(Pn,l),a.dispatchEvent(y),y.defaultPrevented||(al(fl(bs(a)),{select:!0}),document.activeElement===h&&ke(a))}return()=>{a.removeEventListener(Pn,l),setTimeout(()=>{const y=new CustomEvent(On,ro);a.addEventListener(On,u),a.dispatchEvent(y),y.defaultPrevented||ke(h??document.body,{select:!0}),a.removeEventListener(On,u),so.remove(v)},0)}}},[a,l,u,v]);const p=f.useCallback(h=>{if(!n&&!r||v.paused)return;const b=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,y=document.activeElement;if(b&&y){const k=h.currentTarget,[C,A]=cl(k);C&&A?!h.shiftKey&&y===A?(h.preventDefault(),n&&ke(C,{select:!0})):h.shiftKey&&y===C&&(h.preventDefault(),n&&ke(A,{select:!0})):y===k&&h.preventDefault()}},[n,r,v.paused]);return g.jsx(te.div,{tabIndex:-1,...i,ref:m,onKeyDown:p})});hr.displayName=il;function al(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ke(r,{select:t}),document.activeElement!==n)return}function cl(e){const t=bs(e),n=oo(t,e),r=oo(t.reverse(),e);return[n,r]}function bs(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function oo(e,t){for(const n of e)if(!ll(n,{upTo:t}))return n}function ll(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function ul(e){return e instanceof HTMLInputElement&&"select"in e}function ke(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ul(e)&&t&&e.select()}}var so=dl();function dl(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=io(e,t),e.unshift(t)},remove(t){e=io(e,t),e[0]?.resume()}}}function io(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function fl(e){return e.filter(t=>t.tagName!=="A")}var pl=f[" useId ".trim().toString()]||(()=>{}),ml=0;function vs(e){const[t,n]=f.useState(pl());return Pe(()=>{n(r=>r??String(ml++))},[e]),e||(t?`radix-${t}`:"")}const hl=["top","right","bottom","left"],Te=Math.min,ce=Math.max,Zt=Math.round,Ft=Math.floor,we=e=>({x:e,y:e}),gl={left:"right",right:"left",bottom:"top",top:"bottom"},bl={start:"end",end:"start"};function Jn(e,t,n){return ce(e,Te(t,n))}function Ee(e,t){return typeof e=="function"?e(t):e}function Se(e){return e.split("-")[0]}function st(e){return e.split("-")[1]}function gr(e){return e==="x"?"y":"x"}function br(e){return e==="y"?"height":"width"}const vl=new Set(["top","bottom"]);function ve(e){return vl.has(Se(e))?"y":"x"}function vr(e){return gr(ve(e))}function wl(e,t,n){n===void 0&&(n=!1);const r=st(e),o=vr(e),s=br(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Qt(i)),[i,Qt(i)]}function yl(e){const t=Qt(e);return[Zn(e),t,Zn(t)]}function Zn(e){return e.replace(/start|end/g,t=>bl[t])}const ao=["left","right"],co=["right","left"],xl=["top","bottom"],Cl=["bottom","top"];function El(e,t,n){switch(e){case"top":case"bottom":return n?t?co:ao:t?ao:co;case"left":case"right":return t?xl:Cl;default:return[]}}function Sl(e,t,n,r){const o=st(e);let s=El(Se(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Zn)))),s}function Qt(e){return e.replace(/left|right|bottom|top/g,t=>gl[t])}function Rl(e){return{top:0,right:0,bottom:0,left:0,...e}}function ws(e){return typeof e!="number"?Rl(e):{top:e,right:e,bottom:e,left:e}}function en(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function lo(e,t,n){let{reference:r,floating:o}=e;const s=ve(t),i=vr(t),a=br(i),c=Se(t),l=s==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let v;switch(c){case"top":v={x:u,y:r.y-o.height};break;case"bottom":v={x:u,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:d};break;case"left":v={x:r.x-o.width,y:d};break;default:v={x:r.x,y:r.y}}switch(st(t)){case"start":v[i]-=m*(n&&l?-1:1);break;case"end":v[i]+=m*(n&&l?-1:1);break}return v}const Al=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=lo(l,r,c),m=r,v={},p=0;for(let h=0;h<a.length;h++){const{name:b,fn:y}=a[h],{x:k,y:C,data:A,reset:R}=await y({x:u,y:d,initialPlacement:r,placement:m,strategy:o,middlewareData:v,rects:l,platform:i,elements:{reference:e,floating:t}});u=k??u,d=C??d,v={...v,[b]:{...v[b],...A}},R&&p<=50&&(p++,typeof R=="object"&&(R.placement&&(m=R.placement),R.rects&&(l=R.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):R.rects),{x:u,y:d}=lo(l,m,c)),h=-1)}return{x:u,y:d,placement:m,strategy:o,middlewareData:v}};async function bt(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:m=!1,padding:v=0}=Ee(t,e),p=ws(v),b=a[m?d==="floating"?"reference":"floating":d],y=en(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),k=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),A=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},R=en(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:k,offsetParent:C,strategy:c}):k);return{top:(y.top-R.top+p.top)/A.y,bottom:(R.bottom-y.bottom+p.bottom)/A.y,left:(y.left-R.left+p.left)/A.x,right:(R.right-y.right+p.right)/A.x}}const kl=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=Ee(e,t)||{};if(l==null)return{};const d=ws(u),m={x:n,y:r},v=vr(o),p=br(v),h=await i.getDimensions(l),b=v==="y",y=b?"top":"left",k=b?"bottom":"right",C=b?"clientHeight":"clientWidth",A=s.reference[p]+s.reference[v]-m[v]-s.floating[p],R=m[v]-s.reference[v],x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let E=x?x[C]:0;(!E||!await(i.isElement==null?void 0:i.isElement(x)))&&(E=a.floating[C]||s.floating[p]);const S=A/2-R/2,P=E/2-h[p]/2-1,F=Te(d[y],P),L=Te(d[k],P),V=F,B=E-h[p]-L,j=E/2-h[p]/2+S,W=Jn(V,j,B),D=!c.arrow&&st(o)!=null&&j!==W&&s.reference[p]/2-(j<V?F:L)-h[p]/2<0,G=D?j<V?j-V:j-B:0;return{[v]:m[v]+G,data:{[v]:W,centerOffset:j-W-G,...D&&{alignmentOffset:G}},reset:D}}}),_l=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:h=!0,...b}=Ee(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=Se(o),k=ve(a),C=Se(a)===a,A=await(c.isRTL==null?void 0:c.isRTL(l.floating)),R=m||(C||!h?[Qt(a)]:yl(a)),x=p!=="none";!m&&x&&R.push(...Sl(a,h,p,A));const E=[a,...R],S=await bt(t,b),P=[];let F=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&P.push(S[y]),d){const j=wl(o,i,A);P.push(S[j[0]],S[j[1]])}if(F=[...F,{placement:o,overflows:P}],!P.every(j=>j<=0)){var L,V;const j=(((L=s.flip)==null?void 0:L.index)||0)+1,W=E[j];if(W&&(!(d==="alignment"?k!==ve(W):!1)||F.every(_=>ve(_.placement)===k?_.overflows[0]>0:!0)))return{data:{index:j,overflows:F},reset:{placement:W}};let D=(V=F.filter(G=>G.overflows[0]<=0).sort((G,_)=>G.overflows[1]-_.overflows[1])[0])==null?void 0:V.placement;if(!D)switch(v){case"bestFit":{var B;const G=(B=F.filter(_=>{if(x){const M=ve(_.placement);return M===k||M==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(M=>M>0).reduce((M,Y)=>M+Y,0)]).sort((_,M)=>_[1]-M[1])[0])==null?void 0:B[0];G&&(D=G);break}case"initialPlacement":D=a;break}if(o!==D)return{reset:{placement:D}}}return{}}}};function uo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function fo(e){return hl.some(t=>e[t]>=0)}const Pl=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Ee(e,t);switch(r){case"referenceHidden":{const s=await bt(t,{...o,elementContext:"reference"}),i=uo(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:fo(i)}}}case"escaped":{const s=await bt(t,{...o,altBoundary:!0}),i=uo(s,n.floating);return{data:{escapedOffsets:i,escaped:fo(i)}}}default:return{}}}}},ys=new Set(["left","top"]);async function Ol(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Se(n),a=st(n),c=ve(n)==="y",l=ys.has(i)?-1:1,u=s&&c?-1:1,d=Ee(t,e);let{mainAxis:m,crossAxis:v,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof p=="number"&&(v=a==="end"?p*-1:p),c?{x:v*u,y:m*l}:{x:m*l,y:v*u}}const Tl=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await Ol(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},Ml=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:b=>{let{x:y,y:k}=b;return{x:y,y:k}}},...c}=Ee(e,t),l={x:n,y:r},u=await bt(t,c),d=ve(Se(o)),m=gr(d);let v=l[m],p=l[d];if(s){const b=m==="y"?"top":"left",y=m==="y"?"bottom":"right",k=v+u[b],C=v-u[y];v=Jn(k,v,C)}if(i){const b=d==="y"?"top":"left",y=d==="y"?"bottom":"right",k=p+u[b],C=p-u[y];p=Jn(k,p,C)}const h=a.fn({...t,[m]:v,[d]:p});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[m]:s,[d]:i}}}}}},Fl=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=Ee(e,t),u={x:n,y:r},d=ve(o),m=gr(d);let v=u[m],p=u[d];const h=Ee(a,t),b=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const C=m==="y"?"height":"width",A=s.reference[m]-s.floating[C]+b.mainAxis,R=s.reference[m]+s.reference[C]-b.mainAxis;v<A?v=A:v>R&&(v=R)}if(l){var y,k;const C=m==="y"?"width":"height",A=ys.has(Se(o)),R=s.reference[d]-s.floating[C]+(A&&((y=i.offset)==null?void 0:y[d])||0)+(A?0:b.crossAxis),x=s.reference[d]+s.reference[C]+(A?0:((k=i.offset)==null?void 0:k[d])||0)-(A?b.crossAxis:0);p<R?p=R:p>x&&(p=x)}return{[m]:v,[d]:p}}}},Nl=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...l}=Ee(e,t),u=await bt(t,l),d=Se(o),m=st(o),v=ve(o)==="y",{width:p,height:h}=s.floating;let b,y;d==="top"||d==="bottom"?(b=d,y=m===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,b=m==="end"?"top":"bottom");const k=h-u.top-u.bottom,C=p-u.left-u.right,A=Te(h-u[b],k),R=Te(p-u[y],C),x=!t.middlewareData.shift;let E=A,S=R;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(S=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=k),x&&!m){const F=ce(u.left,0),L=ce(u.right,0),V=ce(u.top,0),B=ce(u.bottom,0);v?S=p-2*(F!==0||L!==0?F+L:ce(u.left,u.right)):E=h-2*(V!==0||B!==0?V+B:ce(u.top,u.bottom))}await c({...t,availableWidth:S,availableHeight:E});const P=await i.getDimensions(a.floating);return p!==P.width||h!==P.height?{reset:{rects:!0}}:{}}}};function gn(){return typeof window<"u"}function it(e){return xs(e)?(e.nodeName||"").toLowerCase():"#document"}function le(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function xe(e){var t;return(t=(xs(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function xs(e){return gn()?e instanceof Node||e instanceof le(e).Node:!1}function fe(e){return gn()?e instanceof Element||e instanceof le(e).Element:!1}function ye(e){return gn()?e instanceof HTMLElement||e instanceof le(e).HTMLElement:!1}function po(e){return!gn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof le(e).ShadowRoot}const Dl=new Set(["inline","contents"]);function Rt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=pe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Dl.has(o)}const Il=new Set(["table","td","th"]);function jl(e){return Il.has(it(e))}const Ll=[":popover-open",":modal"];function bn(e){return Ll.some(t=>{try{return e.matches(t)}catch{return!1}})}const Bl=["transform","translate","scale","rotate","perspective"],$l=["transform","translate","scale","rotate","perspective","filter"],Ul=["paint","layout","strict","content"];function wr(e){const t=yr(),n=fe(e)?pe(e):e;return Bl.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||$l.some(r=>(n.willChange||"").includes(r))||Ul.some(r=>(n.contain||"").includes(r))}function Hl(e){let t=Me(e);for(;ye(t)&&!et(t);){if(wr(t))return t;if(bn(t))return null;t=Me(t)}return null}function yr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const zl=new Set(["html","body","#document"]);function et(e){return zl.has(it(e))}function pe(e){return le(e).getComputedStyle(e)}function vn(e){return fe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Me(e){if(it(e)==="html")return e;const t=e.assignedSlot||e.parentNode||po(e)&&e.host||xe(e);return po(t)?t.host:t}function Cs(e){const t=Me(e);return et(t)?e.ownerDocument?e.ownerDocument.body:e.body:ye(t)&&Rt(t)?t:Cs(t)}function vt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Cs(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=le(o);if(s){const a=Qn(i);return t.concat(i,i.visualViewport||[],Rt(o)?o:[],a&&n?vt(a):[])}return t.concat(o,vt(o,[],n))}function Qn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Es(e){const t=pe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ye(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Zt(n)!==s||Zt(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function xr(e){return fe(e)?e:e.contextElement}function Je(e){const t=xr(e);if(!ye(t))return we(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Es(t);let i=(s?Zt(n.width):n.width)/r,a=(s?Zt(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Vl=we(0);function Ss(e){const t=le(e);return!yr()||!t.visualViewport?Vl:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Wl(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==le(e)?!1:t}function Be(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=xr(e);let i=we(1);t&&(r?fe(r)&&(i=Je(r)):i=Je(e));const a=Wl(s,n,r)?Ss(s):we(0);let c=(o.left+a.x)/i.x,l=(o.top+a.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(s){const m=le(s),v=r&&fe(r)?le(r):r;let p=m,h=Qn(p);for(;h&&r&&v!==p;){const b=Je(h),y=h.getBoundingClientRect(),k=pe(h),C=y.left+(h.clientLeft+parseFloat(k.paddingLeft))*b.x,A=y.top+(h.clientTop+parseFloat(k.paddingTop))*b.y;c*=b.x,l*=b.y,u*=b.x,d*=b.y,c+=C,l+=A,p=le(h),h=Qn(p)}}return en({width:u,height:d,x:c,y:l})}function wn(e,t){const n=vn(e).scrollLeft;return t?t.left+n:Be(xe(e)).left+n}function Rs(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-wn(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Gl(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=xe(r),a=t?bn(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=we(1);const u=we(0),d=ye(r);if((d||!d&&!s)&&((it(r)!=="body"||Rt(i))&&(c=vn(r)),ye(r))){const v=Be(r);l=Je(r),u.x=v.x+r.clientLeft,u.y=v.y+r.clientTop}const m=i&&!d&&!s?Rs(i,c):we(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+m.x,y:n.y*l.y-c.scrollTop*l.y+u.y+m.y}}function Kl(e){return Array.from(e.getClientRects())}function ql(e){const t=xe(e),n=vn(e),r=e.ownerDocument.body,o=ce(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=ce(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+wn(e);const a=-n.scrollTop;return pe(r).direction==="rtl"&&(i+=ce(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const mo=25;function Xl(e,t){const n=le(e),r=xe(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const u=yr();(!u||u&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const l=wn(r);if(l<=0){const u=r.ownerDocument,d=u.body,m=getComputedStyle(d),v=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,p=Math.abs(r.clientWidth-d.clientWidth-v);p<=mo&&(s-=p)}else l<=mo&&(s+=l);return{width:s,height:i,x:a,y:c}}const Yl=new Set(["absolute","fixed"]);function Jl(e,t){const n=Be(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=ye(e)?Je(e):we(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,l=r*s.y;return{width:i,height:a,x:c,y:l}}function ho(e,t,n){let r;if(t==="viewport")r=Xl(e,n);else if(t==="document")r=ql(xe(e));else if(fe(t))r=Jl(t,n);else{const o=Ss(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return en(r)}function As(e,t){const n=Me(e);return n===t||!fe(n)||et(n)?!1:pe(n).position==="fixed"||As(n,t)}function Zl(e,t){const n=t.get(e);if(n)return n;let r=vt(e,[],!1).filter(a=>fe(a)&&it(a)!=="body"),o=null;const s=pe(e).position==="fixed";let i=s?Me(e):e;for(;fe(i)&&!et(i);){const a=pe(i),c=wr(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&Yl.has(o.position)||Rt(i)&&!c&&As(e,i))?r=r.filter(u=>u!==i):o=a,i=Me(i)}return t.set(e,r),r}function Ql(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?bn(t)?[]:Zl(t,this._c):[].concat(n),r],a=i[0],c=i.reduce((l,u)=>{const d=ho(t,u,o);return l.top=ce(d.top,l.top),l.right=Te(d.right,l.right),l.bottom=Te(d.bottom,l.bottom),l.left=ce(d.left,l.left),l},ho(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function eu(e){const{width:t,height:n}=Es(e);return{width:t,height:n}}function tu(e,t,n){const r=ye(t),o=xe(t),s=n==="fixed",i=Be(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=we(0);function l(){c.x=wn(o)}if(r||!r&&!s)if((it(t)!=="body"||Rt(o))&&(a=vn(t)),r){const v=Be(t,!0,s,t);c.x=v.x+t.clientLeft,c.y=v.y+t.clientTop}else o&&l();s&&!r&&o&&l();const u=o&&!r&&!s?Rs(o,a):we(0),d=i.left+a.scrollLeft-c.x-u.x,m=i.top+a.scrollTop-c.y-u.y;return{x:d,y:m,width:i.width,height:i.height}}function Tn(e){return pe(e).position==="static"}function go(e,t){if(!ye(e)||pe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return xe(e)===n&&(n=n.ownerDocument.body),n}function ks(e,t){const n=le(e);if(bn(e))return n;if(!ye(e)){let o=Me(e);for(;o&&!et(o);){if(fe(o)&&!Tn(o))return o;o=Me(o)}return n}let r=go(e,t);for(;r&&jl(r)&&Tn(r);)r=go(r,t);return r&&et(r)&&Tn(r)&&!wr(r)?n:r||Hl(e)||n}const nu=async function(e){const t=this.getOffsetParent||ks,n=this.getDimensions,r=await n(e.floating);return{reference:tu(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ru(e){return pe(e).direction==="rtl"}const ou={convertOffsetParentRelativeRectToViewportRelativeRect:Gl,getDocumentElement:xe,getClippingRect:Ql,getOffsetParent:ks,getElementRects:nu,getClientRects:Kl,getDimensions:eu,getScale:Je,isElement:fe,isRTL:ru};function _s(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function su(e,t){let n=null,r;const o=xe(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const l=e.getBoundingClientRect(),{left:u,top:d,width:m,height:v}=l;if(a||t(),!m||!v)return;const p=Ft(d),h=Ft(o.clientWidth-(u+m)),b=Ft(o.clientHeight-(d+v)),y=Ft(u),C={rootMargin:-p+"px "+-h+"px "+-b+"px "+-y+"px",threshold:ce(0,Te(1,c))||1};let A=!0;function R(x){const E=x[0].intersectionRatio;if(E!==c){if(!A)return i();E?i(!1,E):r=setTimeout(()=>{i(!1,1e-7)},1e3)}E===1&&!_s(l,e.getBoundingClientRect())&&i(),A=!1}try{n=new IntersectionObserver(R,{...C,root:o.ownerDocument})}catch{n=new IntersectionObserver(R,C)}n.observe(e)}return i(!0),s}function iu(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=xr(e),u=o||s?[...l?vt(l):[],...vt(t)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const d=l&&a?su(l,n):null;let m=-1,v=null;i&&(v=new ResizeObserver(y=>{let[k]=y;k&&k.target===l&&v&&(v.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=v)==null||C.observe(t)})),n()}),l&&!c&&v.observe(l),v.observe(t));let p,h=c?Be(e):null;c&&b();function b(){const y=Be(e);h&&!_s(h,y)&&n(),h=y,p=requestAnimationFrame(b)}return n(),()=>{var y;u.forEach(k=>{o&&k.removeEventListener("scroll",n),s&&k.removeEventListener("resize",n)}),d?.(),(y=v)==null||y.disconnect(),v=null,c&&cancelAnimationFrame(p)}}const au=Tl,cu=Ml,lu=_l,uu=Nl,du=Pl,bo=kl,fu=Fl,pu=(e,t,n)=>{const r=new Map,o={platform:ou,...n},s={...o.platform,_c:r};return Al(e,t,{...o,platform:s})};var mu=typeof document<"u",hu=function(){},Vt=mu?N.useLayoutEffect:hu;function tn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!tn(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!tn(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ps(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vo(e,t){const n=Ps(e);return Math.round(t*n)/n}function Mn(e){const t=f.useRef(e);return Vt(()=>{t.current=e}),t}function gu(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,d]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,v]=f.useState(r);tn(m,r)||v(r);const[p,h]=f.useState(null),[b,y]=f.useState(null),k=f.useCallback(_=>{_!==x.current&&(x.current=_,h(_))},[]),C=f.useCallback(_=>{_!==E.current&&(E.current=_,y(_))},[]),A=s||p,R=i||b,x=f.useRef(null),E=f.useRef(null),S=f.useRef(u),P=c!=null,F=Mn(c),L=Mn(o),V=Mn(l),B=f.useCallback(()=>{if(!x.current||!E.current)return;const _={placement:t,strategy:n,middleware:m};L.current&&(_.platform=L.current),pu(x.current,E.current,_).then(M=>{const Y={...M,isPositioned:V.current!==!1};j.current&&!tn(S.current,Y)&&(S.current=Y,$o.flushSync(()=>{d(Y)}))})},[m,t,n,L,V]);Vt(()=>{l===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,d(_=>({..._,isPositioned:!1})))},[l]);const j=f.useRef(!1);Vt(()=>(j.current=!0,()=>{j.current=!1}),[]),Vt(()=>{if(A&&(x.current=A),R&&(E.current=R),A&&R){if(F.current)return F.current(A,R,B);B()}},[A,R,B,F,P]);const W=f.useMemo(()=>({reference:x,floating:E,setReference:k,setFloating:C}),[k,C]),D=f.useMemo(()=>({reference:A,floating:R}),[A,R]),G=f.useMemo(()=>{const _={position:n,left:0,top:0};if(!D.floating)return _;const M=vo(D.floating,u.x),Y=vo(D.floating,u.y);return a?{..._,transform:"translate("+M+"px, "+Y+"px)",...Ps(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:Y}},[n,a,D.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:B,refs:W,elements:D,floatingStyles:G}),[u,B,W,D,G])}const bu=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?bo({element:r.current,padding:o}).fn(n):{}:r?bo({element:r,padding:o}).fn(n):{}}}},vu=(e,t)=>({...au(e),options:[e,t]}),wu=(e,t)=>({...cu(e),options:[e,t]}),yu=(e,t)=>({...fu(e),options:[e,t]}),xu=(e,t)=>({...lu(e),options:[e,t]}),Cu=(e,t)=>({...uu(e),options:[e,t]}),Eu=(e,t)=>({...du(e),options:[e,t]}),Su=(e,t)=>({...bu(e),options:[e,t]});var Ru="Arrow",Os=f.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return g.jsx(te.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});Os.displayName=Ru;var Au=Os;function ku(e){const[t,n]=f.useState(void 0);return Pe(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;i=l.inlineSize,a=l.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Cr="Popper",[Ts,yn]=ot(Cr),[_u,Ms]=Ts(Cr),Fs=e=>{const{__scopePopper:t,children:n}=e,[r,o]=f.useState(null);return g.jsx(_u,{scope:t,anchor:r,onAnchorChange:o,children:n})};Fs.displayName=Cr;var Ns="PopperAnchor",Ds=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Ms(Ns,n),i=f.useRef(null),a=re(t,i),c=f.useRef(null);return f.useEffect(()=>{const l=c.current;c.current=r?.current||i.current,l!==c.current&&s.onAnchorChange(c.current)}),r?null:g.jsx(te.div,{...o,ref:a})});Ds.displayName=Ns;var Er="PopperContent",[Pu,Ou]=Ts(Er),Is=f.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:m=!1,updatePositionStrategy:v="optimized",onPlaced:p,...h}=e,b=Ms(Er,n),[y,k]=f.useState(null),C=re(t,z=>k(z)),[A,R]=f.useState(null),x=ku(A),E=x?.width??0,S=x?.height??0,P=r+(s!=="center"?"-"+s:""),F=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},L=Array.isArray(l)?l:[l],V=L.length>0,B={padding:F,boundary:L.filter(Mu),altBoundary:V},{refs:j,floatingStyles:W,placement:D,isPositioned:G,middlewareData:_}=gu({strategy:"fixed",placement:P,whileElementsMounted:(...z)=>iu(...z,{animationFrame:v==="always"}),elements:{reference:b.anchor},middleware:[vu({mainAxis:o+S,alignmentAxis:i}),c&&wu({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?yu():void 0,...B}),c&&xu({...B}),Cu({...B,apply:({elements:z,rects:Re,availableWidth:ze,availableHeight:Ve})=>{const{width:lt,height:We}=Re.reference,Ot=z.floating.style;Ot.setProperty("--radix-popper-available-width",`${ze}px`),Ot.setProperty("--radix-popper-available-height",`${Ve}px`),Ot.setProperty("--radix-popper-anchor-width",`${lt}px`),Ot.setProperty("--radix-popper-anchor-height",`${We}px`)}}),A&&Su({element:A,padding:a}),Fu({arrowWidth:E,arrowHeight:S}),m&&Eu({strategy:"referenceHidden",...B})]}),[M,Y]=Bs(D),J=Oe(p);Pe(()=>{G&&J?.()},[G,J]);const ee=_.arrow?.x,K=_.arrow?.y,q=_.arrow?.centerOffset!==0,[ue,he]=f.useState();return Pe(()=>{y&&he(window.getComputedStyle(y).zIndex)},[y]),g.jsx("div",{ref:j.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:G?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[_.transformOrigin?.x,_.transformOrigin?.y].join(" "),..._.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(Pu,{scope:n,placedSide:M,onArrowChange:R,arrowX:ee,arrowY:K,shouldHideArrow:q,children:g.jsx(te.div,{"data-side":M,"data-align":Y,...h,ref:C,style:{...h.style,animation:G?void 0:"none"}})})})});Is.displayName=Er;var js="PopperArrow",Tu={top:"bottom",right:"left",bottom:"top",left:"right"},Ls=f.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=Ou(js,r),i=Tu[s.placedSide];return g.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:g.jsx(Au,{...o,ref:n,style:{...o.style,display:"block"}})})});Ls.displayName=js;function Mu(e){return e!==null}var Fu=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[l,u]=Bs(n),d={start:"0%",center:"50%",end:"100%"}[u],m=(o.arrow?.x??0)+a/2,v=(o.arrow?.y??0)+c/2;let p="",h="";return l==="bottom"?(p=i?d:`${m}px`,h=`${-c}px`):l==="top"?(p=i?d:`${m}px`,h=`${r.floating.height+c}px`):l==="right"?(p=`${-c}px`,h=i?d:`${v}px`):l==="left"&&(p=`${r.floating.width+c}px`,h=i?d:`${v}px`),{data:{x:p,y:h}}}});function Bs(e){const[t,n="center"]=e.split("-");return[t,n]}var Nu=Fs,Sr=Ds,$s=Is,Us=Ls,Du="Portal",Rr=f.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=f.useState(!1);Pe(()=>s(!0),[]);const i=n||o&&globalThis?.document?.body;return i?Lo.createPortal(g.jsx(te.div,{...r,ref:t}),i):null});Rr.displayName=Du;function Iu(e,t){return f.useReducer((n,r)=>t[n][r]??n,e)}var $e=e=>{const{present:t,children:n}=e,r=ju(t),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),s=re(r.ref,Lu(o));return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:s}):null};$e.displayName="Presence";function ju(e){const[t,n]=f.useState(),r=f.useRef(null),o=f.useRef(e),s=f.useRef("none"),i=e?"mounted":"unmounted",[a,c]=Iu(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const l=Nt(r.current);s.current=a==="mounted"?l:"none"},[a]),Pe(()=>{const l=r.current,u=o.current;if(u!==e){const m=s.current,v=Nt(l);e?c("MOUNT"):v==="none"||l?.display==="none"?c("UNMOUNT"):c(u&&m!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Pe(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,d=v=>{const h=Nt(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&h&&(c("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},m=v=>{v.target===t&&(s.current=Nt(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:f.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function Nt(e){return e?.animationName||"none"}function Lu(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Fn="rovingFocusGroup.onEntryFocus",Bu={bubbles:!1,cancelable:!0},At="RovingFocusGroup",[er,Hs,$u]=ps(At),[Uu,zs]=ot(At,[$u]),[Hu,zu]=Uu(At),Vs=f.forwardRef((e,t)=>g.jsx(er.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(er.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(Vu,{...e,ref:t})})}));Vs.displayName=At;var Vu=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,m=f.useRef(null),v=re(t,m),p=Jc(s),[h,b]=ds({prop:i,defaultProp:a??null,onChange:c,caller:At}),[y,k]=f.useState(!1),C=Oe(l),A=Hs(n),R=f.useRef(!1),[x,E]=f.useState(0);return f.useEffect(()=>{const S=m.current;if(S)return S.addEventListener(Fn,C),()=>S.removeEventListener(Fn,C)},[C]),g.jsx(Hu,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:h,onItemFocus:f.useCallback(S=>b(S),[b]),onItemShiftTab:f.useCallback(()=>k(!0),[]),onFocusableItemAdd:f.useCallback(()=>E(S=>S+1),[]),onFocusableItemRemove:f.useCallback(()=>E(S=>S-1),[]),children:g.jsx(te.div,{tabIndex:y||x===0?-1:0,"data-orientation":r,...d,ref:v,style:{outline:"none",...e.style},onMouseDown:H(e.onMouseDown,()=>{R.current=!0}),onFocus:H(e.onFocus,S=>{const P=!R.current;if(S.target===S.currentTarget&&P&&!y){const F=new CustomEvent(Fn,Bu);if(S.currentTarget.dispatchEvent(F),!F.defaultPrevented){const L=A().filter(D=>D.focusable),V=L.find(D=>D.active),B=L.find(D=>D.id===h),W=[V,B,...L].filter(Boolean).map(D=>D.ref.current);Ks(W,u)}}R.current=!1}),onBlur:H(e.onBlur,()=>k(!1))})})}),Ws="RovingFocusGroupItem",Gs=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...a}=e,c=vs(),l=s||c,u=zu(Ws,n),d=u.currentTabStopId===l,m=Hs(n),{onFocusableItemAdd:v,onFocusableItemRemove:p,currentTabStopId:h}=u;return f.useEffect(()=>{if(r)return v(),()=>p()},[r,v,p]),g.jsx(er.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:g.jsx(te.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:H(e.onMouseDown,b=>{r?u.onItemFocus(l):b.preventDefault()}),onFocus:H(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:H(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){u.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const y=Ku(b,u.orientation,u.dir);if(y!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let C=m().filter(A=>A.focusable).map(A=>A.ref.current);if(y==="last")C.reverse();else if(y==="prev"||y==="next"){y==="prev"&&C.reverse();const A=C.indexOf(b.currentTarget);C=u.loop?qu(C,A+1):C.slice(A+1)}setTimeout(()=>Ks(C))}}),children:typeof i=="function"?i({isCurrentTabStop:d,hasTabStop:h!=null}):i})})});Gs.displayName=Ws;var Wu={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Gu(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Ku(e,t,n){const r=Gu(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Wu[r]}function Ks(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function qu(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Xu=Vs,Yu=Gs,Ju=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ge=new WeakMap,Dt=new WeakMap,It={},Nn=0,qs=function(e){return e&&(e.host||qs(e.parentNode))},Zu=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=qs(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Qu=function(e,t,n,r){var o=Zu(t,Array.isArray(e)?e:[e]);It[n]||(It[n]=new WeakMap);var s=It[n],i=[],a=new Set,c=new Set(o),l=function(d){!d||a.has(d)||(a.add(d),l(d.parentNode))};o.forEach(l);var u=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(m){if(a.has(m))u(m);else try{var v=m.getAttribute(r),p=v!==null&&v!=="false",h=(Ge.get(m)||0)+1,b=(s.get(m)||0)+1;Ge.set(m,h),s.set(m,b),i.push(m),h===1&&p&&Dt.set(m,!0),b===1&&m.setAttribute(n,"true"),p||m.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",m,y)}})};return u(t),a.clear(),Nn++,function(){i.forEach(function(d){var m=Ge.get(d)-1,v=s.get(d)-1;Ge.set(d,m),s.set(d,v),m||(Dt.has(d)||d.removeAttribute(r),Dt.delete(d)),v||d.removeAttribute(n)}),Nn--,Nn||(Ge=new WeakMap,Ge=new WeakMap,Dt=new WeakMap,It={})}},Xs=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Ju(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Qu(r,o,n,"aria-hidden")):function(){return null}},be=function(){return be=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},be.apply(this,arguments)};function Ys(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function ed(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Wt="right-scroll-bar-position",Gt="width-before-scroll-bar",td="with-scroll-bars-hidden",nd="--removed-body-scroll-bar-size";function Dn(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function rd(e,t){var n=N.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var od=typeof window<"u"?f.useLayoutEffect:f.useEffect,wo=new WeakMap;function sd(e,t){var n=rd(null,function(r){return e.forEach(function(o){return Dn(o,r)})});return od(function(){var r=wo.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Dn(a,null)}),s.forEach(function(a){o.has(a)||Dn(a,i)})}wo.set(n,e)},[e]),n}function id(e){return e}function ad(e,t){t===void 0&&(t=id);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var u=i;i=[],u.forEach(s)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(u){i.push(u),l()},filter:function(u){return i=i.filter(u),n}}}};return o}function cd(e){e===void 0&&(e={});var t=ad(null);return t.options=be({async:!0,ssr:!1},e),t}var Js=function(e){var t=e.sideCar,n=Ys(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return f.createElement(r,be({},n))};Js.isSideCarExport=!0;function ld(e,t){return e.useMedium(t),Js}var Zs=cd(),In=function(){},xn=f.forwardRef(function(e,t){var n=f.useRef(null),r=f.useState({onScrollCapture:In,onWheelCapture:In,onTouchMoveCapture:In}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,m=e.sideCar,v=e.noRelative,p=e.noIsolation,h=e.inert,b=e.allowPinchZoom,y=e.as,k=y===void 0?"div":y,C=e.gapMode,A=Ys(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=m,x=sd([n,t]),E=be(be({},A),o);return f.createElement(f.Fragment,null,u&&f.createElement(R,{sideCar:Zs,removeScrollBar:l,shards:d,noRelative:v,noIsolation:p,inert:h,setCallbacks:s,allowPinchZoom:!!b,lockRef:n,gapMode:C}),i?f.cloneElement(f.Children.only(a),be(be({},E),{ref:x})):f.createElement(k,be({},E,{className:c,ref:x}),a))});xn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};xn.classNames={fullWidth:Gt,zeroRight:Wt};var ud=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function dd(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ud();return t&&e.setAttribute("nonce",t),e}function fd(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function pd(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var md=function(){var e=0,t=null;return{add:function(n){e==0&&(t=dd())&&(fd(t,n),pd(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},hd=function(){var e=md();return function(t,n){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Qs=function(){var e=hd(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},gd={left:0,top:0,right:0,gap:0},jn=function(e){return parseInt(e||"",10)||0},bd=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[jn(n),jn(r),jn(o)]},vd=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return gd;var t=bd(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},wd=Qs(),Ze="data-scroll-locked",yd=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
7
- .`.concat(td,` {
8
- overflow: hidden `).concat(r,`;
9
- padding-right: `).concat(a,"px ").concat(r,`;
10
- }
11
- body[`).concat(Ze,`] {
12
- overflow: hidden `).concat(r,`;
13
- overscroll-behavior: contain;
14
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
15
- padding-left: `.concat(o,`px;
16
- padding-top: `).concat(s,`px;
17
- padding-right: `).concat(i,`px;
18
- margin-left:0;
19
- margin-top:0;
20
- margin-right: `).concat(a,"px ").concat(r,`;
21
- `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
22
- }
23
-
24
- .`).concat(Wt,` {
25
- right: `).concat(a,"px ").concat(r,`;
26
- }
27
-
28
- .`).concat(Gt,` {
29
- margin-right: `).concat(a,"px ").concat(r,`;
30
- }
31
-
32
- .`).concat(Wt," .").concat(Wt,` {
33
- right: 0 `).concat(r,`;
34
- }
35
-
36
- .`).concat(Gt," .").concat(Gt,` {
37
- margin-right: 0 `).concat(r,`;
38
- }
39
-
40
- body[`).concat(Ze,`] {
41
- `).concat(nd,": ").concat(a,`px;
42
- }
43
- `)},yo=function(){var e=parseInt(document.body.getAttribute(Ze)||"0",10);return isFinite(e)?e:0},xd=function(){f.useEffect(function(){return document.body.setAttribute(Ze,(yo()+1).toString()),function(){var e=yo()-1;e<=0?document.body.removeAttribute(Ze):document.body.setAttribute(Ze,e.toString())}},[])},Cd=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;xd();var s=f.useMemo(function(){return vd(o)},[o]);return f.createElement(wd,{styles:yd(s,!t,o,n?"":"!important")})},tr=!1;if(typeof window<"u")try{var jt=Object.defineProperty({},"passive",{get:function(){return tr=!0,!0}});window.addEventListener("test",jt,jt),window.removeEventListener("test",jt,jt)}catch{tr=!1}var Ke=tr?{passive:!1}:!1,Ed=function(e){return e.tagName==="TEXTAREA"},ei=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Ed(e)&&n[t]==="visible")},Sd=function(e){return ei(e,"overflowY")},Rd=function(e){return ei(e,"overflowX")},xo=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=ti(e,r);if(o){var s=ni(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ad=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},kd=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ti=function(e,t){return e==="v"?Sd(t):Rd(t)},ni=function(e,t){return e==="v"?Ad(t):kd(t)},_d=function(e,t){return e==="h"&&t==="rtl"?-1:1},Pd=function(e,t,n,r,o){var s=_d(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,c=t.contains(a),l=!1,u=i>0,d=0,m=0;do{if(!a)break;var v=ni(e,a),p=v[0],h=v[1],b=v[2],y=h-b-s*p;(p||y)&&ti(e,a)&&(d+=y,m+=p);var k=a.parentNode;a=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(u&&Math.abs(d)<1||!u&&Math.abs(m)<1)&&(l=!0),l},Lt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Co=function(e){return[e.deltaX,e.deltaY]},Eo=function(e){return e&&"current"in e?e.current:e},Od=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Td=function(e){return`
44
- .block-interactivity-`.concat(e,` {pointer-events: none;}
45
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
46
- `)},Md=0,qe=[];function Fd(e){var t=f.useRef([]),n=f.useRef([0,0]),r=f.useRef(),o=f.useState(Md++)[0],s=f.useState(Qs)[0],i=f.useRef(e);f.useEffect(function(){i.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=ed([e.lockRef.current],(e.shards||[]).map(Eo),!0).filter(Boolean);return h.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=f.useCallback(function(h,b){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!i.current.allowPinchZoom;var y=Lt(h),k=n.current,C="deltaX"in h?h.deltaX:k[0]-y[0],A="deltaY"in h?h.deltaY:k[1]-y[1],R,x=h.target,E=Math.abs(C)>Math.abs(A)?"h":"v";if("touches"in h&&E==="h"&&x.type==="range")return!1;var S=window.getSelection(),P=S&&S.anchorNode,F=P?P===x||P.contains(x):!1;if(F)return!1;var L=xo(E,x);if(!L)return!0;if(L?R=E:(R=E==="v"?"h":"v",L=xo(E,x)),!L)return!1;if(!r.current&&"changedTouches"in h&&(C||A)&&(r.current=R),!R)return!0;var V=r.current||R;return Pd(V,b,h,V==="h"?C:A)},[]),c=f.useCallback(function(h){var b=h;if(!(!qe.length||qe[qe.length-1]!==s)){var y="deltaY"in b?Co(b):Lt(b),k=t.current.filter(function(R){return R.name===b.type&&(R.target===b.target||b.target===R.shadowParent)&&Od(R.delta,y)})[0];if(k&&k.should){b.cancelable&&b.preventDefault();return}if(!k){var C=(i.current.shards||[]).map(Eo).filter(Boolean).filter(function(R){return R.contains(b.target)}),A=C.length>0?a(b,C[0]):!i.current.noIsolation;A&&b.cancelable&&b.preventDefault()}}},[]),l=f.useCallback(function(h,b,y,k){var C={name:h,delta:b,target:y,should:k,shadowParent:Nd(y)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(A){return A!==C})},1)},[]),u=f.useCallback(function(h){n.current=Lt(h),r.current=void 0},[]),d=f.useCallback(function(h){l(h.type,Co(h),h.target,a(h,e.lockRef.current))},[]),m=f.useCallback(function(h){l(h.type,Lt(h),h.target,a(h,e.lockRef.current))},[]);f.useEffect(function(){return qe.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:m}),document.addEventListener("wheel",c,Ke),document.addEventListener("touchmove",c,Ke),document.addEventListener("touchstart",u,Ke),function(){qe=qe.filter(function(h){return h!==s}),document.removeEventListener("wheel",c,Ke),document.removeEventListener("touchmove",c,Ke),document.removeEventListener("touchstart",u,Ke)}},[]);var v=e.removeScrollBar,p=e.inert;return f.createElement(f.Fragment,null,p?f.createElement(s,{styles:Td(o)}):null,v?f.createElement(Cd,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Nd(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Dd=ld(Zs,Fd);var Ar=f.forwardRef(function(e,t){return f.createElement(xn,be({},e,{ref:t,sideCar:Dd}))});Ar.classNames=xn.classNames;var nr=["Enter"," "],Id=["ArrowDown","PageUp","Home"],ri=["ArrowUp","PageDown","End"],jd=[...Id,...ri],Ld={ltr:[...nr,"ArrowRight"],rtl:[...nr,"ArrowLeft"]},Bd={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Cn="Menu",[wt,$d,Ud]=ps(Cn),[Ue,oi]=ot(Cn,[Ud,yn,zs]),kr=yn(),si=zs(),[rh,He]=Ue(Cn),[oh,kt]=Ue(Cn),Hd="MenuAnchor",_r=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=kr(n);return g.jsx(Sr,{...o,...r,ref:t})});_r.displayName=Hd;var Pr="MenuPortal",[zd,ii]=Ue(Pr,{forceMount:void 0}),ai=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=He(Pr,t);return g.jsx(zd,{scope:t,forceMount:n,children:g.jsx($e,{present:n||s.open,children:g.jsx(Rr,{asChild:!0,container:o,children:r})})})};ai.displayName=Pr;var de="MenuContent",[Vd,Or]=Ue(de),ci=f.forwardRef((e,t)=>{const n=ii(de,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=He(de,e.__scopeMenu),i=kt(de,e.__scopeMenu);return g.jsx(wt.Provider,{scope:e.__scopeMenu,children:g.jsx($e,{present:r||s.open,children:g.jsx(wt.Slot,{scope:e.__scopeMenu,children:i.modal?g.jsx(Wd,{...o,ref:t}):g.jsx(Gd,{...o,ref:t})})})})}),Wd=f.forwardRef((e,t)=>{const n=He(de,e.__scopeMenu),r=f.useRef(null),o=re(t,r);return f.useEffect(()=>{const s=r.current;if(s)return Xs(s)},[]),g.jsx(Tr,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:H(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Gd=f.forwardRef((e,t)=>{const n=He(de,e.__scopeMenu);return g.jsx(Tr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Kd=gt("MenuContent.ScrollLock"),Tr=f.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:m,onDismiss:v,disableOutsideScroll:p,...h}=e,b=He(de,n),y=kt(de,n),k=kr(n),C=si(n),A=$d(n),[R,x]=f.useState(null),E=f.useRef(null),S=re(t,E,b.onContentChange),P=f.useRef(0),F=f.useRef(""),L=f.useRef(0),V=f.useRef(null),B=f.useRef("right"),j=f.useRef(0),W=p?Ar:f.Fragment,D=p?{as:Kd,allowPinchZoom:!0}:void 0,G=M=>{const Y=F.current+M,J=A().filter(z=>!z.disabled),ee=document.activeElement,K=J.find(z=>z.ref.current===ee)?.textValue,q=J.map(z=>z.textValue),ue=sf(q,Y,K),he=J.find(z=>z.textValue===ue)?.ref.current;(function z(Re){F.current=Re,window.clearTimeout(P.current),Re!==""&&(P.current=window.setTimeout(()=>z(""),1e3))})(Y),he&&setTimeout(()=>he.focus())};f.useEffect(()=>()=>window.clearTimeout(P.current),[]),gs();const _=f.useCallback(M=>B.current===V.current?.side&&cf(M,V.current?.area),[]);return g.jsx(Vd,{scope:n,searchRef:F,onItemEnter:f.useCallback(M=>{_(M)&&M.preventDefault()},[_]),onItemLeave:f.useCallback(M=>{_(M)||(E.current?.focus(),x(null))},[_]),onTriggerLeave:f.useCallback(M=>{_(M)&&M.preventDefault()},[_]),pointerGraceTimerRef:L,onPointerGraceIntentChange:f.useCallback(M=>{V.current=M},[]),children:g.jsx(W,{...D,children:g.jsx(hr,{asChild:!0,trapped:o,onMountAutoFocus:H(s,M=>{M.preventDefault(),E.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:g.jsx(mr,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:m,onDismiss:v,children:g.jsx(Xu,{asChild:!0,...C,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:R,onCurrentTabStopIdChange:x,onEntryFocus:H(c,M=>{y.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx($s,{role:"menu","aria-orientation":"vertical","data-state":Si(b.open),"data-radix-menu-content":"",dir:y.dir,...k,...h,ref:S,style:{outline:"none",...h.style},onKeyDown:H(h.onKeyDown,M=>{const J=M.target.closest("[data-radix-menu-content]")===M.currentTarget,ee=M.ctrlKey||M.altKey||M.metaKey,K=M.key.length===1;J&&(M.key==="Tab"&&M.preventDefault(),!ee&&K&&G(M.key));const q=E.current;if(M.target!==q||!jd.includes(M.key))return;M.preventDefault();const he=A().filter(z=>!z.disabled).map(z=>z.ref.current);ri.includes(M.key)&&he.reverse(),rf(he)}),onBlur:H(e.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(P.current),F.current="")}),onPointerMove:H(e.onPointerMove,yt(M=>{const Y=M.target,J=j.current!==M.clientX;if(M.currentTarget.contains(Y)&&J){const ee=M.clientX>j.current?"right":"left";B.current=ee,j.current=M.clientX}}))})})})})})})});ci.displayName=de;var qd="MenuGroup",Mr=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(te.div,{role:"group",...r,ref:t})});Mr.displayName=qd;var Xd="MenuLabel",li=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(te.div,{...r,ref:t})});li.displayName=Xd;var nn="MenuItem",So="menu.itemSelect",En=f.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=f.useRef(null),i=kt(nn,e.__scopeMenu),a=Or(nn,e.__scopeMenu),c=re(t,s),l=f.useRef(!1),u=()=>{const d=s.current;if(!n&&d){const m=new CustomEvent(So,{bubbles:!0,cancelable:!0});d.addEventListener(So,v=>r?.(v),{once:!0}),fs(d,m),m.defaultPrevented?l.current=!1:i.onClose()}};return g.jsx(ui,{...o,ref:c,disabled:n,onClick:H(e.onClick,u),onPointerDown:d=>{e.onPointerDown?.(d),l.current=!0},onPointerUp:H(e.onPointerUp,d=>{l.current||d.currentTarget?.click()}),onKeyDown:H(e.onKeyDown,d=>{const m=a.searchRef.current!=="";n||m&&d.key===" "||nr.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});En.displayName=nn;var ui=f.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=Or(nn,n),a=si(n),c=f.useRef(null),l=re(t,c),[u,d]=f.useState(!1),[m,v]=f.useState("");return f.useEffect(()=>{const p=c.current;p&&v((p.textContent??"").trim())},[s.children]),g.jsx(wt.ItemSlot,{scope:n,disabled:r,textValue:o??m,children:g.jsx(Yu,{asChild:!0,...a,focusable:!r,children:g.jsx(te.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:l,onPointerMove:H(e.onPointerMove,yt(p=>{r?i.onItemLeave(p):(i.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:H(e.onPointerLeave,yt(p=>i.onItemLeave(p))),onFocus:H(e.onFocus,()=>d(!0)),onBlur:H(e.onBlur,()=>d(!1))})})})}),Yd="MenuCheckboxItem",di=f.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return g.jsx(gi,{scope:e.__scopeMenu,checked:n,children:g.jsx(En,{role:"menuitemcheckbox","aria-checked":rn(n)?"mixed":n,...o,ref:t,"data-state":Nr(n),onSelect:H(o.onSelect,()=>r?.(rn(n)?!0:!n),{checkForDefaultPrevented:!1})})})});di.displayName=Yd;var fi="MenuRadioGroup",[Jd,Zd]=Ue(fi,{value:void 0,onValueChange:()=>{}}),pi=f.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=Oe(r);return g.jsx(Jd,{scope:e.__scopeMenu,value:n,onValueChange:s,children:g.jsx(Mr,{...o,ref:t})})});pi.displayName=fi;var mi="MenuRadioItem",hi=f.forwardRef((e,t)=>{const{value:n,...r}=e,o=Zd(mi,e.__scopeMenu),s=n===o.value;return g.jsx(gi,{scope:e.__scopeMenu,checked:s,children:g.jsx(En,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":Nr(s),onSelect:H(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});hi.displayName=mi;var Fr="MenuItemIndicator",[gi,Qd]=Ue(Fr,{checked:!1}),bi=f.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=Qd(Fr,n);return g.jsx($e,{present:r||rn(s.checked)||s.checked===!0,children:g.jsx(te.span,{...o,ref:t,"data-state":Nr(s.checked)})})});bi.displayName=Fr;var ef="MenuSeparator",vi=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(te.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});vi.displayName=ef;var tf="MenuArrow",wi=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=kr(n);return g.jsx(Us,{...o,...r,ref:t})});wi.displayName=tf;var nf="MenuSub",[sh,yi]=Ue(nf),mt="MenuSubTrigger",xi=f.forwardRef((e,t)=>{const n=He(mt,e.__scopeMenu),r=kt(mt,e.__scopeMenu),o=yi(mt,e.__scopeMenu),s=Or(mt,e.__scopeMenu),i=f.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=s,l={__scopeMenu:e.__scopeMenu},u=f.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return f.useEffect(()=>u,[u]),f.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),c(null)}},[a,c]),g.jsx(_r,{asChild:!0,...l,children:g.jsx(ui,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Si(n.open),...e,ref:hn(t,o.onTriggerChange),onClick:d=>{e.onClick?.(d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:H(e.onPointerMove,yt(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:H(e.onPointerLeave,yt(d=>{u();const m=n.content?.getBoundingClientRect();if(m){const v=n.content?.dataset.side,p=v==="right",h=p?-5:5,b=m[p?"left":"right"],y=m[p?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+h,y:d.clientY},{x:b,y:m.top},{x:y,y:m.top},{x:y,y:m.bottom},{x:b,y:m.bottom}],side:v}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:H(e.onKeyDown,d=>{const m=s.searchRef.current!=="";e.disabled||m&&d.key===" "||Ld[r.dir].includes(d.key)&&(n.onOpenChange(!0),n.content?.focus(),d.preventDefault())})})})});xi.displayName=mt;var Ci="MenuSubContent",Ei=f.forwardRef((e,t)=>{const n=ii(de,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=He(de,e.__scopeMenu),i=kt(de,e.__scopeMenu),a=yi(Ci,e.__scopeMenu),c=f.useRef(null),l=re(t,c);return g.jsx(wt.Provider,{scope:e.__scopeMenu,children:g.jsx($e,{present:r||s.open,children:g.jsx(wt.Slot,{scope:e.__scopeMenu,children:g.jsx(Tr,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:l,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{i.isUsingKeyboardRef.current&&c.current?.focus(),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:H(e.onFocusOutside,u=>{u.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:H(e.onEscapeKeyDown,u=>{i.onClose(),u.preventDefault()}),onKeyDown:H(e.onKeyDown,u=>{const d=u.currentTarget.contains(u.target),m=Bd[i.dir].includes(u.key);d&&m&&(s.onOpenChange(!1),a.trigger?.focus(),u.preventDefault())})})})})})});Ei.displayName=Ci;function Si(e){return e?"open":"closed"}function rn(e){return e==="indeterminate"}function Nr(e){return rn(e)?"indeterminate":e?"checked":"unchecked"}function rf(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function of(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function sf(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=of(e,Math.max(s,0));o.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function af(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[i],l=a.x,u=a.y,d=c.x,m=c.y;u>r!=m>r&&n<(d-l)*(r-u)/(m-u)+l&&(o=!o)}return o}function cf(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return af(n,t)}function yt(e){return t=>t.pointerType==="mouse"?e(t):void 0}var lf=_r,uf=ai,df=ci,ff=Mr,pf=li,mf=En,hf=di,gf=pi,bf=hi,vf=bi,wf=vi,yf=wi,xf=xi,Cf=Ei,Ri="DropdownMenu",[Ef]=ot(Ri,[oi]),ie=oi(),[ih,Ai]=Ef(Ri),ki="DropdownMenuTrigger",Sf=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=Ai(ki,n),i=ie(n);return g.jsx(lf,{asChild:!0,...i,children:g.jsx(te.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:hn(t,s.triggerRef),onPointerDown:H(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:H(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});Sf.displayName=ki;var Rf="DropdownMenuPortal",_i=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ie(t);return g.jsx(uf,{...r,...n})};_i.displayName=Rf;var Pi="DropdownMenuContent",Oi=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ai(Pi,n),s=ie(n),i=f.useRef(!1);return g.jsx(df,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:H(e.onCloseAutoFocus,a=>{i.current||o.triggerRef.current?.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:H(e.onInteractOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,u=c.button===2||l;(!o.modal||u)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Oi.displayName=Pi;var Af="DropdownMenuGroup",kf=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ie(n);return g.jsx(ff,{...o,...r,ref:t})});kf.displayName=Af;var _f="DropdownMenuLabel",Pf=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ie(n);return g.jsx(pf,{...o,...r,ref:t})});Pf.displayName=_f;var Of="DropdownMenuItem",Tf=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ie(n);return g.jsx(mf,{...o,...r,ref:t})});Tf.displayName=Of;var Mf="DropdownMenuCheckboxItem",Ff=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ie(n);return g.jsx(hf,{...o,...r,ref:t})});Ff.displayName=Mf;var Nf="DropdownMenuRadioGroup",Df=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ie(n);return g.jsx(gf,{...o,...r,ref:t})});Df.displayName=Nf;var If="DropdownMenuRadioItem",jf=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ie(n);return g.jsx(bf,{...o,...r,ref:t})});jf.displayName=If;var Lf="DropdownMenuItemIndicator",Bf=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ie(n);return g.jsx(vf,{...o,...r,ref:t})});Bf.displayName=Lf;var $f="DropdownMenuSeparator",Uf=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ie(n);return g.jsx(wf,{...o,...r,ref:t})});Uf.displayName=$f;var Hf="DropdownMenuArrow",zf=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ie(n);return g.jsx(yf,{...o,...r,ref:t})});zf.displayName=Hf;var Vf="DropdownMenuSubTrigger",Wf=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ie(n);return g.jsx(xf,{...o,...r,ref:t})});Wf.displayName=Vf;var Gf="DropdownMenuSubContent",Kf=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ie(n);return g.jsx(Cf,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Kf.displayName=Gf;var qf=_i,Ti=Oi;function Mi(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Mi(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Xf(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Mi(e))&&(r&&(r+=" "),r+=t);return r}const Yf=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Jf=(e,t)=>({classGroupId:e,validator:t}),Fi=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),on="-",Ro=[],Zf="arbitrary..",Qf=e=>{const t=tp(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return ep(i);const a=i.split(on),c=a[0]===""&&a.length>1?1:0;return Ni(a,c,t)},getConflictingClassGroupIds:(i,a)=>{if(a){const c=r[i],l=n[i];return c?l?Yf(l,c):c:l||Ro}return n[i]||Ro}}},Ni=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const l=Ni(e,t+1,s);if(l)return l}const i=n.validators;if(i===null)return;const a=t===0?e.join(on):e.slice(t).join(on),c=i.length;for(let l=0;l<c;l++){const u=i[l];if(u.validator(a))return u.classGroupId}},ep=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Zf+r:void 0})(),tp=e=>{const{theme:t,classGroups:n}=e;return np(n,t)},np=(e,t)=>{const n=Fi();for(const r in e){const o=e[r];Dr(o,n,r,t)}return n},Dr=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const i=e[s];rp(i,t,n,r)}},rp=(e,t,n,r)=>{if(typeof e=="string"){op(e,t,n);return}if(typeof e=="function"){sp(e,t,n,r);return}ip(e,t,n,r)},op=(e,t,n)=>{const r=e===""?t:Di(t,e);r.classGroupId=n},sp=(e,t,n,r)=>{if(ap(e)){Dr(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Jf(n,e))},ip=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let i=0;i<s;i++){const[a,c]=o[i];Dr(c,Di(t,a),n,r)}},Di=(e,t)=>{let n=e;const r=t.split(on),o=r.length;for(let s=0;s<o;s++){const i=r[s];let a=n.nextPart.get(i);a||(a=Fi(),n.nextPart.set(i,a)),n=a}return n},ap=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,cp=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,i)=>{n[s]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return o(s,i),i},set(s,i){s in n?n[s]=i:o(s,i)}}},rr="!",Ao=":",lp=[],ko=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),up=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,a=0,c=0,l;const u=o.length;for(let h=0;h<u;h++){const b=o[h];if(i===0&&a===0){if(b===Ao){s.push(o.slice(c,h)),c=h+1;continue}if(b==="/"){l=h;continue}}b==="["?i++:b==="]"?i--:b==="("?a++:b===")"&&a--}const d=s.length===0?o:o.slice(c);let m=d,v=!1;d.endsWith(rr)?(m=d.slice(0,-1),v=!0):d.startsWith(rr)&&(m=d.slice(1),v=!0);const p=l&&l>c?l-c:void 0;return ko(s,v,m,p)};if(t){const o=t+Ao,s=r;r=i=>i.startsWith(o)?s(i.slice(o.length)):ko(lp,!1,i,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},dp=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const i=n[s],a=i[0]==="[",c=t.has(i);a||c?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(i)):o.push(i)}return o.length>0&&(o.sort(),r.push(...o)),r}},fp=e=>({cache:cp(e.cacheSize),parseClassName:up(e),sortModifiers:dp(e),...Qf(e)}),pp=/\s+/,mp=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,i=[],a=e.trim().split(pp);let c="";for(let l=a.length-1;l>=0;l-=1){const u=a[l],{isExternal:d,modifiers:m,hasImportantModifier:v,baseClassName:p,maybePostfixModifierPosition:h}=n(u);if(d){c=u+(c.length>0?" "+c:c);continue}let b=!!h,y=r(b?p.substring(0,h):p);if(!y){if(!b){c=u+(c.length>0?" "+c:c);continue}if(y=r(p),!y){c=u+(c.length>0?" "+c:c);continue}b=!1}const k=m.length===0?"":m.length===1?m[0]:s(m).join(":"),C=v?k+rr:k,A=C+y;if(i.indexOf(A)>-1)continue;i.push(A);const R=o(y,b);for(let x=0;x<R.length;++x){const E=R[x];i.push(C+E)}c=u+(c.length>0?" "+c:c)}return c},hp=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=Ii(n))&&(o&&(o+=" "),o+=r);return o},Ii=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ii(e[r]))&&(n&&(n+=" "),n+=t);return n},gp=(e,...t)=>{let n,r,o,s;const i=c=>{const l=t.reduce((u,d)=>d(u),e());return n=fp(l),r=n.cache.get,o=n.cache.set,s=a,a(c)},a=c=>{const l=r(c);if(l)return l;const u=mp(c,n);return o(c,u),u};return s=i,(...c)=>s(hp(...c))},bp=[],Q=e=>{const t=n=>n[e]||bp;return t.isThemeGetter=!0,t},ji=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Li=/^\((?:(\w[\w-]*):)?(.+)\)$/i,vp=/^\d+\/\d+$/,wp=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,yp=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,xp=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Cp=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ep=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xe=e=>vp.test(e),U=e=>!!e&&!Number.isNaN(Number(e)),Ae=e=>!!e&&Number.isInteger(Number(e)),Ln=e=>e.endsWith("%")&&U(e.slice(0,-1)),Ce=e=>wp.test(e),Sp=()=>!0,Rp=e=>yp.test(e)&&!xp.test(e),Bi=()=>!1,Ap=e=>Cp.test(e),kp=e=>Ep.test(e),_p=e=>!O(e)&&!T(e),Pp=e=>at(e,Hi,Bi),O=e=>ji.test(e),De=e=>at(e,zi,Rp),Bn=e=>at(e,Np,U),_o=e=>at(e,$i,Bi),Op=e=>at(e,Ui,kp),Bt=e=>at(e,Vi,Ap),T=e=>Li.test(e),dt=e=>ct(e,zi),Tp=e=>ct(e,Dp),Po=e=>ct(e,$i),Mp=e=>ct(e,Hi),Fp=e=>ct(e,Ui),$t=e=>ct(e,Vi,!0),at=(e,t,n)=>{const r=ji.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ct=(e,t,n=!1)=>{const r=Li.exec(e);return r?r[1]?t(r[1]):n:!1},$i=e=>e==="position"||e==="percentage",Ui=e=>e==="image"||e==="url",Hi=e=>e==="length"||e==="size"||e==="bg-size",zi=e=>e==="length",Np=e=>e==="number",Dp=e=>e==="family-name",Vi=e=>e==="shadow",Ip=()=>{const e=Q("color"),t=Q("font"),n=Q("text"),r=Q("font-weight"),o=Q("tracking"),s=Q("leading"),i=Q("breakpoint"),a=Q("container"),c=Q("spacing"),l=Q("radius"),u=Q("shadow"),d=Q("inset-shadow"),m=Q("text-shadow"),v=Q("drop-shadow"),p=Q("blur"),h=Q("perspective"),b=Q("aspect"),y=Q("ease"),k=Q("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],R=()=>[...A(),T,O],x=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto","contain","none"],S=()=>[T,O,c],P=()=>[Xe,"full","auto",...S()],F=()=>[Ae,"none","subgrid",T,O],L=()=>["auto",{span:["full",Ae,T,O]},Ae,T,O],V=()=>[Ae,"auto",T,O],B=()=>["auto","min","max","fr",T,O],j=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...S()],G=()=>[Xe,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],_=()=>[e,T,O],M=()=>[...A(),Po,_o,{position:[T,O]}],Y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],J=()=>["auto","cover","contain",Mp,Pp,{size:[T,O]}],ee=()=>[Ln,dt,De],K=()=>["","none","full",l,T,O],q=()=>["",U,dt,De],ue=()=>["solid","dashed","dotted","double"],he=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],z=()=>[U,Ln,Po,_o],Re=()=>["","none",p,T,O],ze=()=>["none",U,T,O],Ve=()=>["none",U,T,O],lt=()=>[U,T,O],We=()=>[Xe,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ce],breakpoint:[Ce],color:[Sp],container:[Ce],"drop-shadow":[Ce],ease:["in","out","in-out"],font:[_p],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ce],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ce],shadow:[Ce],spacing:["px",U],text:[Ce],"text-shadow":[Ce],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Xe,O,T,b]}],container:["container"],columns:[{columns:[U,O,T,a]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:R()}],overflow:[{overflow:x()}],"overflow-x":[{"overflow-x":x()}],"overflow-y":[{"overflow-y":x()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{start:P()}],end:[{end:P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[Ae,"auto",T,O]}],basis:[{basis:[Xe,"full","auto",a,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[U,Xe,"auto","initial","none",O]}],grow:[{grow:["",U,T,O]}],shrink:[{shrink:["",U,T,O]}],order:[{order:[Ae,"first","last","none",T,O]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":B()}],"auto-rows":[{"auto-rows":B()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...j(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...j()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":j()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],w:[{w:[a,"screen",...G()]}],"min-w":[{"min-w":[a,"screen","none",...G()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",n,dt,De]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,T,Bn]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ln,O]}],"font-family":[{font:[Tp,O,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,T,O]}],"line-clamp":[{"line-clamp":[U,"none",T,Bn]}],leading:[{leading:[s,...S()]}],"list-image":[{"list-image":["none",T,O]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",T,O]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:_()}],"text-color":[{text:_()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ue(),"wavy"]}],"text-decoration-thickness":[{decoration:[U,"from-font","auto",T,De]}],"text-decoration-color":[{decoration:_()}],"underline-offset":[{"underline-offset":[U,"auto",T,O]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",T,O]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",T,O]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:M()}],"bg-repeat":[{bg:Y()}],"bg-size":[{bg:J()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ae,T,O],radial:["",T,O],conic:[Ae,T,O]},Fp,Op]}],"bg-color":[{bg:_()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:_()}],"gradient-via":[{via:_()}],"gradient-to":[{to:_()}],rounded:[{rounded:K()}],"rounded-s":[{"rounded-s":K()}],"rounded-e":[{"rounded-e":K()}],"rounded-t":[{"rounded-t":K()}],"rounded-r":[{"rounded-r":K()}],"rounded-b":[{"rounded-b":K()}],"rounded-l":[{"rounded-l":K()}],"rounded-ss":[{"rounded-ss":K()}],"rounded-se":[{"rounded-se":K()}],"rounded-ee":[{"rounded-ee":K()}],"rounded-es":[{"rounded-es":K()}],"rounded-tl":[{"rounded-tl":K()}],"rounded-tr":[{"rounded-tr":K()}],"rounded-br":[{"rounded-br":K()}],"rounded-bl":[{"rounded-bl":K()}],"border-w":[{border:q()}],"border-w-x":[{"border-x":q()}],"border-w-y":[{"border-y":q()}],"border-w-s":[{"border-s":q()}],"border-w-e":[{"border-e":q()}],"border-w-t":[{"border-t":q()}],"border-w-r":[{"border-r":q()}],"border-w-b":[{"border-b":q()}],"border-w-l":[{"border-l":q()}],"divide-x":[{"divide-x":q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ue(),"hidden","none"]}],"divide-style":[{divide:[...ue(),"hidden","none"]}],"border-color":[{border:_()}],"border-color-x":[{"border-x":_()}],"border-color-y":[{"border-y":_()}],"border-color-s":[{"border-s":_()}],"border-color-e":[{"border-e":_()}],"border-color-t":[{"border-t":_()}],"border-color-r":[{"border-r":_()}],"border-color-b":[{"border-b":_()}],"border-color-l":[{"border-l":_()}],"divide-color":[{divide:_()}],"outline-style":[{outline:[...ue(),"none","hidden"]}],"outline-offset":[{"outline-offset":[U,T,O]}],"outline-w":[{outline:["",U,dt,De]}],"outline-color":[{outline:_()}],shadow:[{shadow:["","none",u,$t,Bt]}],"shadow-color":[{shadow:_()}],"inset-shadow":[{"inset-shadow":["none",d,$t,Bt]}],"inset-shadow-color":[{"inset-shadow":_()}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:_()}],"ring-offset-w":[{"ring-offset":[U,De]}],"ring-offset-color":[{"ring-offset":_()}],"inset-ring-w":[{"inset-ring":q()}],"inset-ring-color":[{"inset-ring":_()}],"text-shadow":[{"text-shadow":["none",m,$t,Bt]}],"text-shadow-color":[{"text-shadow":_()}],opacity:[{opacity:[U,T,O]}],"mix-blend":[{"mix-blend":[...he(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":he()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[U]}],"mask-image-linear-from-pos":[{"mask-linear-from":z()}],"mask-image-linear-to-pos":[{"mask-linear-to":z()}],"mask-image-linear-from-color":[{"mask-linear-from":_()}],"mask-image-linear-to-color":[{"mask-linear-to":_()}],"mask-image-t-from-pos":[{"mask-t-from":z()}],"mask-image-t-to-pos":[{"mask-t-to":z()}],"mask-image-t-from-color":[{"mask-t-from":_()}],"mask-image-t-to-color":[{"mask-t-to":_()}],"mask-image-r-from-pos":[{"mask-r-from":z()}],"mask-image-r-to-pos":[{"mask-r-to":z()}],"mask-image-r-from-color":[{"mask-r-from":_()}],"mask-image-r-to-color":[{"mask-r-to":_()}],"mask-image-b-from-pos":[{"mask-b-from":z()}],"mask-image-b-to-pos":[{"mask-b-to":z()}],"mask-image-b-from-color":[{"mask-b-from":_()}],"mask-image-b-to-color":[{"mask-b-to":_()}],"mask-image-l-from-pos":[{"mask-l-from":z()}],"mask-image-l-to-pos":[{"mask-l-to":z()}],"mask-image-l-from-color":[{"mask-l-from":_()}],"mask-image-l-to-color":[{"mask-l-to":_()}],"mask-image-x-from-pos":[{"mask-x-from":z()}],"mask-image-x-to-pos":[{"mask-x-to":z()}],"mask-image-x-from-color":[{"mask-x-from":_()}],"mask-image-x-to-color":[{"mask-x-to":_()}],"mask-image-y-from-pos":[{"mask-y-from":z()}],"mask-image-y-to-pos":[{"mask-y-to":z()}],"mask-image-y-from-color":[{"mask-y-from":_()}],"mask-image-y-to-color":[{"mask-y-to":_()}],"mask-image-radial":[{"mask-radial":[T,O]}],"mask-image-radial-from-pos":[{"mask-radial-from":z()}],"mask-image-radial-to-pos":[{"mask-radial-to":z()}],"mask-image-radial-from-color":[{"mask-radial-from":_()}],"mask-image-radial-to-color":[{"mask-radial-to":_()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[U]}],"mask-image-conic-from-pos":[{"mask-conic-from":z()}],"mask-image-conic-to-pos":[{"mask-conic-to":z()}],"mask-image-conic-from-color":[{"mask-conic-from":_()}],"mask-image-conic-to-color":[{"mask-conic-to":_()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:M()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:J()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",T,O]}],filter:[{filter:["","none",T,O]}],blur:[{blur:Re()}],brightness:[{brightness:[U,T,O]}],contrast:[{contrast:[U,T,O]}],"drop-shadow":[{"drop-shadow":["","none",v,$t,Bt]}],"drop-shadow-color":[{"drop-shadow":_()}],grayscale:[{grayscale:["",U,T,O]}],"hue-rotate":[{"hue-rotate":[U,T,O]}],invert:[{invert:["",U,T,O]}],saturate:[{saturate:[U,T,O]}],sepia:[{sepia:["",U,T,O]}],"backdrop-filter":[{"backdrop-filter":["","none",T,O]}],"backdrop-blur":[{"backdrop-blur":Re()}],"backdrop-brightness":[{"backdrop-brightness":[U,T,O]}],"backdrop-contrast":[{"backdrop-contrast":[U,T,O]}],"backdrop-grayscale":[{"backdrop-grayscale":["",U,T,O]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[U,T,O]}],"backdrop-invert":[{"backdrop-invert":["",U,T,O]}],"backdrop-opacity":[{"backdrop-opacity":[U,T,O]}],"backdrop-saturate":[{"backdrop-saturate":[U,T,O]}],"backdrop-sepia":[{"backdrop-sepia":["",U,T,O]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",T,O]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[U,"initial",T,O]}],ease:[{ease:["linear","initial",y,T,O]}],delay:[{delay:[U,T,O]}],animate:[{animate:["none",k,T,O]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,T,O]}],"perspective-origin":[{"perspective-origin":R()}],rotate:[{rotate:ze()}],"rotate-x":[{"rotate-x":ze()}],"rotate-y":[{"rotate-y":ze()}],"rotate-z":[{"rotate-z":ze()}],scale:[{scale:Ve()}],"scale-x":[{"scale-x":Ve()}],"scale-y":[{"scale-y":Ve()}],"scale-z":[{"scale-z":Ve()}],"scale-3d":["scale-3d"],skew:[{skew:lt()}],"skew-x":[{"skew-x":lt()}],"skew-y":[{"skew-y":lt()}],transform:[{transform:[T,O,"","none","gpu","cpu"]}],"transform-origin":[{origin:R()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:We()}],"translate-x":[{"translate-x":We()}],"translate-y":[{"translate-y":We()}],"translate-z":[{"translate-z":We()}],"translate-none":["translate-none"],accent:[{accent:_()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:_()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",T,O]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",T,O]}],fill:[{fill:["none",..._()]}],"stroke-w":[{stroke:[U,dt,De,Bn]}],stroke:[{stroke:["none",..._()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},jp=gp(Ip);var Lp=Object.defineProperty,sn=Object.getOwnPropertySymbols,Wi=Object.prototype.hasOwnProperty,Gi=Object.prototype.propertyIsEnumerable,Oo=(e,t,n)=>t in e?Lp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bp=(e,t)=>{for(var n in t||(t={}))Wi.call(t,n)&&Oo(e,n,t[n]);if(sn)for(var n of sn(t))Gi.call(t,n)&&Oo(e,n,t[n]);return e},$p=(e,t)=>{var n={};for(var r in e)Wi.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&sn)for(var r of sn(e))t.indexOf(r)<0&&Gi.call(e,r)&&(n[r]=e[r]);return n},Up=(e,t,n)=>new Promise((r,o)=>{var s=c=>{try{a(n.next(c))}catch(l){o(l)}},i=c=>{try{a(n.throw(c))}catch(l){o(l)}},a=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,i);a((n=n.apply(e,t)).next())}),Ye=class ht{static getInstance(t){return ht.instance||(ht.instance=Z.create({baseURL:t,headers:{"Content-Type":"application/json",accept:"application/json"}})),ht.instance}static request(t,n){return new Promise(r=>{ht.getInstance(n).request(t).then(o=>{r({status:o.status,data:o.data})}).catch(o=>{var s,i;r({status:((s=o?.response)==null?void 0:s.status)||403,data:((i=o?.response)==null?void 0:i.data)||{message:"Something went wrong"}})})})}},or=class I{static init(t){I.env=t.env,I.redirectUrl=t.redirectUrl,I.app=t.app,I.idp=t.idp}static login(t){if(I.env&&I.redirectUrl)window.open(`${I.redirectUrl}?redirect=${t}`,"_self");else throw Error("SDK is not initialized")}static getToken(t){return new Promise((n,r)=>{if(I.env&&I.redirectUrl){const o=X.get(I.env==="prod"?"prod_more_auth":"dev_more_auth");if(o){const s=`${I.app}_${I.env==="prod"?"prod_more_auth":"dev_more_auth"}`,i=X.get(s);let a=!1;if(i){const c=ua(i);if(c&&c.exp){const l=new Date(0);if(l.setUTCSeconds(c.exp),new Date().getTime()-l.getTime()>0)a=!0;else return n({token:i})}}if(a||!i){const c={method:"POST",data:{app_name:I.app,refresh_token:o},url:"/refresh-token"};return Ye.request(c,I.idp).then(l=>{var u,d,m,v;const{data:p,status:h}=l;if((u=p.data)!=null&&u.token){const b=`${I.app}_${I.env==="prod"?"prod_more_auth":"dev_more_auth"}`;return X.set(b,(d=p.data)==null?void 0:d.token,{domain:"localhost",secure:process.env.NODE_ENV==="production",path:"/",expires:14/1440}),X.set(b,(m=p.data)==null?void 0:m.token,{domain:"more.in",secure:process.env.NODE_ENV==="production",path:"/",expires:14/1440}),n(p?.data)}else h===403?window.open(`${(v=I.redirectUrl)==null?void 0:v.replace("login","").trim()}no-access?app-name=${I.app}`,"_self"):I.redirectUrl&&I.login(t);return r("Invalid token")}).catch(l=>{if(I.redirectUrl){I.login(t);return}return r(l)})}else return n({token:i})}else I.login(t);r("Token not found")}else throw Error("SDK is not initialized")})}static logout(t){return Up(this,null,function*(){if(I.env==="prod"){const n=X.get("prod_more_auth");Object.keys(X.get()).forEach(r=>{r&&r.includes("prod_more_auth")&&X.remove(r,{path:"/",domain:"more.in"})}),X.remove("prod_more_auth",{path:"/",domain:"more.in"}),n&&(yield I.callLogoutAPI(n))}else{const n=X.get("dev_more_auth");Object.keys(X.get()).forEach(r=>{r&&r.includes("dev_more_auth")&&(X.remove(r,{path:"/",domain:"more.in"}),X.remove(r,{path:"/",domain:"localhost"}))}),X.remove("dev_more_auth",{path:"/",domain:"localhost"}),X.remove("dev_more_auth",{path:"/",domain:"more.in"}),n&&(yield I.callLogoutAPI(n))}t?window.open(`${I.redirectUrl}?redirect=${t}`,"_self"):window.open(`${I.redirectUrl}`,"_self")})}static getDevToken(t){return new Promise((n,r)=>{if(I.env&&I.redirectUrl){const o=X.get(I.env==="prod"?"prod_more_auth":"dev_more_auth");if(o){const s=`${I.app}_${I.env==="prod"?"prod_more_auth":"dev_more_auth"}`,i=X.get(s);if(i)return n({token:i});{const a={method:"POST",data:{app_name:I.app,refresh_token:o},url:"/refresh-token"};return Ye.request(a,I.idp).then(c=>{var l,u;const{data:d}=c;if((l=d.data)!=null&&l.token){const m=`${I.app}_${I.env==="prod"?"prod_more_auth":"dev_more_auth"}`;return X.set(m,(u=d.data)==null?void 0:u.token,{domain:"localhost",secure:process.env.NODE_ENV==="production",path:"/",expires:14/1440}),n(d?.data)}else return r("Invalid token")}).catch(c=>r(c))}}else{const s={method:"POST",data:{app_name:I.app,username:t},url:"/generate-developer-token"};return Ye.request(s,I.idp).then(i=>{var a,c,l,u;const{data:d}=i;if((a=d.data)!=null&&a.token&&((c=d?.data)!=null&&c.refresh_token)){const m=`${I.app}_${I.env==="prod"?"prod_more_auth":"dev_more_auth"}`,v=I.env==="prod"?"prod_more_auth":"dev_more_auth";return X.set(m,(l=d.data)==null?void 0:l.token,{domain:"localhost",secure:process.env.NODE_ENV==="production",path:"/",expires:14/1440}),X.set(v,(u=d.data)==null?void 0:u.refresh_token,{domain:"localhost",secure:process.env.NODE_ENV==="production",path:"/",expires:14/1440}),n(d?.data)}else return r("Invalid token")}).catch(i=>r(i))}}else throw Error("SDK is not initialized")})}static getProfileDetails(){return new Promise((t,n)=>{if(I.env&&I.redirectUrl){if(X.get(I.env==="prod"?"prod_more_auth":"dev_more_auth")){const o=`${I.app}_${I.env==="prod"?"prod_more_auth":"dev_more_auth"}`,s=X.get(o);if(s){const i={headers:{Authorization:`Bearer ${s}`},url:"/profile"};return Ye.request(i,I.idp).then(a=>{const{data:c}=a;return c.data?t(c?.data):n("Invalid token")}).catch(a=>n(a))}}}else throw Error("SDK is not initialized")})}static getPermittedApps(){return new Promise((t,n)=>{if(I.env&&I.redirectUrl){if(X.get(I.env==="prod"?"prod_more_auth":"dev_more_auth")){const o=`${I.app}_${I.env==="prod"?"prod_more_auth":"dev_more_auth"}`,s=X.get(o);if(s){const i={headers:{Authorization:`Bearer ${s}`},params:{source:"web",access:"assigned"},url:"/apps"};return Ye.request(i,I.idp).then(a=>{var c,l;const{data:u}=a;return Array.isArray((c=u.data)==null?void 0:c.apps)?t((l=u?.data)==null?void 0:l.apps):n("Invalid token")}).catch(a=>n(a))}}}else throw Error("SDK is not initialized")})}};or.callLogoutAPI=e=>{const t={method:"POST",data:{refresh_token:e},url:"/logout"};return new Promise(n=>{Ye.request(t,or.idp).then(r=>{n(!0)}).catch(r=>{n(!1)})})};var an=or,To=({name:e,employeeId:t,className:n,size:r=100,onClick:o})=>{const s=Math.round(r/2.083),i=N.useMemo(()=>[["#203A43","#2C5364"],["#8E2DE2","#4A00E0"],["#FF416C","#FF4B2B"],["#ED213A","#93291E"],["#AD5389","#3C1053"],["#4E54C8","#8F94FB"],["#0F0C29","#302B63"],["#3C3B3F","#605C3C"],["#800080","#FFC0CB"],["#7F00FF","#E100FF"],["#396AFC","#2948FF"],["#CB356B","#BD3F32"],["#000046","#1CB5E0"],["#E44D26","#F16529"],["#C33764","#1D2671"],["#44A08D","#093637"],["#093028","#237A57"],["#EE0979","#FF6A00"],["#41295A","#2F0743"],["#FF00CC","#333399"],["#000428","#004E92"],["#141E30","#243B55"],["#FF4B1F","#FF9068"],["#834D9B","#D04ED6"],["#B24592","#F15F79"],["#E53935","#E35D5B"],["#00BF8F","#001510"],["#FF0084","#33001B"],["#6441A5","#2A0845"],["#4776E6","#8E54E9"],["#00C6FF","#0072FF"],["#F5515F","#9F041B"],["#F83600","#F9D423"],["#FF512F","#DD2476"],["#00DBDE","#FC00FF"],["#833AB4","#FD1D1D"],["#43C6AC","#191654"],["#FBD72B","#F9484A"],["#00B09B","#96C93D"],["#B24592","#F15F79"],["#24C6DC","#514A9D"],["#F53844","#42378F"],["#F45C43","#EB3349"],["#0575E6","#021B79"],["#7F00FF","#E100FF"],["#00D2FF","#3A7BD5"],["#F9D423","#FF4E50"],["#EE0979","#FF6A00"],["#FF512F","#F09819"],["#36D1DC","#5B86E5"],["#FF3CAC","#784BA0"],["#FF6CAB","#7366FF"],["#FFE53B","#FF2525"],["#21D4FD","#B721FF"],["#4E54C8","#8F94FB"],["#667EEA","#764BA2"],["#6EE2F5","#6454F0"],["#FF61D2","#FE9090"],["#00C6A7","#1EAE98"],["#92FFC0","#002661"],["#FF5858","#F09819"],["#00B4DB","#0083B0"],["#00FF87","#60EFFA"],["#F857A6","#FF5858"],["#4158D0","#C850C0"],["#00DBB6","#0033FF"],["#00FFA3","#0072FF"],["#FAD961","#F76B1C"],["#F43B47","#453A94"],["#00FFA1","#00B3F4"],["#0061FF","#60EFFF"],["#FF0F7B","#F89B29"],["#696EFF","#F8ACFF"],["#432371","#FAAE7B"],["#9BAFD9","#103783"],["#4DC9E6","#210CAE"],["#EF745C","#34073D"],["#919BFF","#133A94"],["#FFA8BD","#242ACF"],["#392D69","#B57BEE"],["#FCB0F3","#3D05DD"],["#30C5D2","#471069"],["#8711C1","#2472FC"],["#07C8F9","#0D41E1"],["#F44369","#3E3B92"],["#0965C0","#C53A94"],["#F74C06","#F9BC2C"],["#08203E","#557C93"],["#295270","#524175"],["#83489E","#C5302E"],["#C81D77","#6710C2"],["#243748","#4B749F"],["#2A454B","#294861"],["#F4119E","#4A313E"],["#C11E38","#220B34"],["#CF414B","#852170"],["#B15B86","#440F50"],["#B94C98","#F0073B"],["#FC4778","#3952F5"],["#2B0948","#CE653B"],["#3F3F42","#5D5D3C"],["#A106F4","#E707FA"],["#663177","#C63F7B"],["#020344","#28B8D5"],["#4A9B7F","#0A3431"],["#0968E5","#091970"],["#0B2C24","#247A4D"],["#E20B8C","#F84B00"],["#000328","#00458E"],["#1E6C8E","#2E7775"],["#F90C71","#30001A"],["#1F140D","#9B8074"],["#76030F","#121B67"],["#5E3719","#B2A496"]],[]),a=N.useMemo(()=>{const d=String(t||"");let m=5381;for(let v=0;v<d.length;v++)m=(m<<5)+m+d.charCodeAt(v);return Math.abs(m>>>0)},[t]),c=N.useMemo(()=>{if(i.length===0)return["#000000","#000000"];const d=a%i.length,m=i[d];return(a&1)===0?m:[m[1],m[0]]},[a,i]),l=N.useMemo(()=>`grad-${a}-${r}`,[a,r]),u=N.useMemo(()=>{const d=(e||"").trim();if(!d)return"??";const m=d.split(/[.\s\-_]+/).filter(Boolean);return m.length>=2?(m[0][0]+m[m.length-1][0]).toUpperCase():m[0].length>=2?(m[0][0]+m[0][1]).toUpperCase():(m[0][0]+m[0][0]).toUpperCase()},[e]);return g.jsxs("svg",{width:r,height:r,viewBox:`0 0 ${r} ${r}`,role:"img",className:n,onClick:o,children:[g.jsx("defs",{children:g.jsxs("linearGradient",{id:l,x1:"0%",y1:"0%",x2:"100%",y2:"0%",gradientTransform:"rotate(45)",children:[g.jsx("stop",{offset:"0%",stopColor:c[0]}),g.jsx("stop",{offset:"100%",stopColor:c[1]})]})}),g.jsx("rect",{x:"0",y:"0",width:r,height:r,fill:`url(#${l})`,rx:Math.round(r*.12)}),g.jsx("text",{x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"central",fill:"#FFFFFF",fontFamily:"'DM Sans', system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji'",fontWeight:"600",fontSize:s,letterSpacing:"0.02em",children:u})]})};function Hp(...e){return jp(Xf(e))}var zp=N.forwardRef((e,t)=>{var n=e,{className:r,sideOffset:o=4}=n,s=$p(n,["className","sideOffset"]);return g.jsx(qf,{children:g.jsx(Ti,Bp({ref:t,sideOffset:o,className:Hp("z-50",r)},s))})});zp.displayName=Ti.displayName;let Ki=null;function Vp(e){Ki=e}function Wp(e){Ki?.(e)}const qi=N.createContext(void 0),Gp=({children:e,appName:t,apiKey:n,token:r})=>{const[o,s]=N.useState(!!r),[i,a]=N.useState(r),[c,l]=N.useState(!0),[u,d]=N.useState(null);return N.useEffect(()=>{Vp(a)},[]),g.jsx(qi.Provider,{value:{appName:t,apiKey:n,accessToken:i,authorized:o,setAuthorized:s,isChatScreen:c,setIsChatScreen:l,profileInfo:u,setProfileInfo:d},children:e})},_t=()=>{const e=N.useContext(qi);if(!e)throw new Error("useSdkContext must be used inside SDKProvider");return e};var Sn="Popover",[Xi]=ot(Sn,[yn]),Pt=yn(),[Kp,Ne]=Xi(Sn),Yi=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,a=Pt(t),c=f.useRef(null),[l,u]=f.useState(!1),[d,m]=ds({prop:r,defaultProp:o??!1,onChange:s,caller:Sn});return g.jsx(Nu,{...a,children:g.jsx(Kp,{scope:t,contentId:vs(),triggerRef:c,open:d,onOpenChange:m,onOpenToggle:f.useCallback(()=>m(v=>!v),[m]),hasCustomAnchor:l,onCustomAnchorAdd:f.useCallback(()=>u(!0),[]),onCustomAnchorRemove:f.useCallback(()=>u(!1),[]),modal:i,children:n})})};Yi.displayName=Sn;var Ji="PopoverAnchor",qp=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ne(Ji,n),s=Pt(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:a}=o;return f.useEffect(()=>(i(),()=>a()),[i,a]),g.jsx(Sr,{...s,...r,ref:t})});qp.displayName=Ji;var Zi="PopoverTrigger",Qi=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ne(Zi,n),s=Pt(n),i=re(t,o.triggerRef),a=g.jsx(te.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":oa(o.open),...r,ref:i,onClick:H(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:g.jsx(Sr,{asChild:!0,...s,children:a})});Qi.displayName=Zi;var Ir="PopoverPortal",[Xp,Yp]=Xi(Ir,{forceMount:void 0}),ea=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=Ne(Ir,t);return g.jsx(Xp,{scope:t,forceMount:n,children:g.jsx($e,{present:n||s.open,children:g.jsx(Rr,{asChild:!0,container:o,children:r})})})};ea.displayName=Ir;var tt="PopoverContent",ta=f.forwardRef((e,t)=>{const n=Yp(tt,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=Ne(tt,e.__scopePopover);return g.jsx($e,{present:r||s.open,children:s.modal?g.jsx(Zp,{...o,ref:t}):g.jsx(Qp,{...o,ref:t})})});ta.displayName=tt;var Jp=gt("PopoverContent.RemoveScroll"),Zp=f.forwardRef((e,t)=>{const n=Ne(tt,e.__scopePopover),r=f.useRef(null),o=re(t,r),s=f.useRef(!1);return f.useEffect(()=>{const i=r.current;if(i)return Xs(i)},[]),g.jsx(Ar,{as:Jp,allowPinchZoom:!0,children:g.jsx(na,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(e.onCloseAutoFocus,i=>{i.preventDefault(),s.current||n.triggerRef.current?.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,l=a.button===2||c;s.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:H(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),Qp=f.forwardRef((e,t)=>{const n=Ne(tt,e.__scopePopover),r=f.useRef(!1),o=f.useRef(!1);return g.jsx(na,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;n.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),na=f.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,m=Ne(tt,n),v=Pt(n);return gs(),g.jsx(hr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:g.jsx(mr,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>m.onOpenChange(!1),children:g.jsx($s,{"data-state":oa(m.open),role:"dialog",id:m.contentId,...v,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),ra="PopoverClose",em=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ne(ra,n);return g.jsx(te.button,{type:"button",...r,ref:t,onClick:H(e.onClick,()=>o.onOpenChange(!1))})});em.displayName=ra;var tm="PopoverArrow",nm=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Pt(n);return g.jsx(Us,{...o,...r,ref:t})});nm.displayName=tm;function oa(e){return e?"open":"closed"}var rm=Yi,om=Qi,sm=ea,im=ta;const am=e=>f.createElement("svg",{width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"M15.8261 8.67349C12.4046 8.67349 9.63062 11.447 9.63062 14.8685C9.63062 18.29 12.4046 21.064 15.8261 21.064C16.1656 21.064 16.4991 21.0365 16.8241 20.984C15.0221 20.4765 13.7006 18.8205 13.7006 16.856C13.7006 14.4875 15.6206 12.568 17.9886 12.568C19.8251 12.568 21.3921 13.722 22.0031 15.345C22.0151 15.188 22.0211 15.029 22.0211 14.8685C22.0211 11.447 19.2476 8.67349 15.8261 8.67349Z",fill:"#B72402"}),f.createElement("path",{d:"M17.9984 7.621C13.0309 7.621 9.00342 11.6485 9.00342 16.616C9.00342 20.526 11.4949 23.8495 14.9744 25.0915V27.785C14.9744 28.228 15.4404 28.515 15.8349 28.3125C17.5759 27.4215 21.5219 25.332 23.5549 23.696C23.6114 23.65 23.6674 23.6065 23.7214 23.5605C23.7624 23.527 23.8009 23.494 23.8394 23.4605C25.7724 21.8115 26.9964 19.356 26.9964 16.616C26.9964 11.6485 22.9689 7.621 17.9989 7.621H17.9984ZM15.8274 21.064C15.5379 21.064 15.2539 21.0435 14.9749 21.005C11.9559 20.59 9.63092 18.0015 9.63092 14.8675C9.63092 11.4465 12.4039 8.6735 15.8274 8.6735C19.2509 8.6735 22.0214 11.4465 22.0214 14.8675C22.0214 15.0265 22.0164 15.185 22.0034 15.341C21.8319 17.6225 20.4259 19.5555 18.4544 20.48C17.9424 20.7205 17.3919 20.892 16.8154 20.9845C16.4929 21.036 16.1624 21.064 15.8269 21.064H15.8274Z",fill:"#FA4B16"})),cm=e=>f.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"M14.4167 3.58334L14.4167 5.13334L5.58341 5.13333L5.58341 3.58333L14.4167 3.58334ZM2.66675 4.5L6.06675 8.01667L2.68341 11.5167L1.56675 10.4L3.86675 8.01667L1.55008 5.61667L2.66675 4.5ZM14.4167 7.25L14.4167 8.81667L7.48341 8.81667L7.48341 7.25L14.4167 7.25ZM14.4167 10.8667L14.4167 12.4333L5.58341 12.4333L5.58341 10.8667L14.4167 10.8667Z",fill:"#172128"})),lm=e=>f.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"M13.25 14.45L8.7667 9.98335C8.44448 10.238 8.06414 10.4378 7.6257 10.5827C7.18725 10.7276 6.71203 10.8 6.20003 10.8C4.92048 10.8 3.8367 10.3556 2.9487 9.46668C2.0607 8.57779 1.6167 7.50557 1.6167 6.25001C1.6167 4.99446 2.06114 3.92223 2.95003 3.03335C3.83892 2.14446 4.91392 1.70001 6.17503 1.70001C7.43614 1.70001 8.50837 2.14446 9.3917 3.03335C10.275 3.92223 10.7167 4.99529 10.7167 6.25251C10.7167 6.75085 10.6473 7.2139 10.5084 7.64168C10.3695 8.06946 10.1611 8.47223 9.88337 8.85001L14.3834 13.3167L13.25 14.45ZM6.1892 9.23335C7.02142 9.23335 7.72298 8.94307 8.29387 8.36251C8.86464 7.78196 9.15003 7.07779 9.15003 6.25001C9.15003 5.42223 8.86381 4.71807 8.29137 4.13751C7.71892 3.55696 7.0182 3.26668 6.1892 3.26668C5.35109 3.26668 4.64059 3.55696 4.0577 4.13751C3.47481 4.71807 3.18337 5.42223 3.18337 6.25001C3.18337 7.07779 3.47398 7.78196 4.0552 8.36251C4.63642 8.94307 5.34775 9.23335 6.1892 9.23335Z",fill:"#172128"})),um=e=>f.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"M10.0417 19.3958V17.7292H16.0625V16.6042H12.7292V9.70833H16.0625V8.77083C16.0625 7.10417 15.4757 5.67014 14.3021 4.46875C13.1285 3.26736 11.7049 2.66667 10.0312 2.66667C8.38542 2.66667 6.95833 3.26736 5.75 4.46875C4.54167 5.67014 3.9375 7.10417 3.9375 8.77083V9.70833H7.27083V16.6042H1.97917V8.775C1.97917 7.66722 2.19229 6.62306 2.61854 5.6425C3.04479 4.66195 3.62132 3.80319 4.34812 3.06625C5.07493 2.32931 5.92903 1.74861 6.91042 1.32417C7.89167 0.899722 8.93667 0.6875 10.0454 0.6875C11.154 0.6875 12.1944 0.899306 13.1667 1.32292C14.1389 1.74653 14.9868 2.32424 15.7104 3.05604C16.4342 3.78785 17.0036 4.64278 17.4187 5.62083C17.834 6.59889 18.0417 7.64889 18.0417 8.77083V19.3958H10.0417ZM3.9375 14.625H5.3125V11.6875H3.9375V14.625ZM14.7083 14.625H16.0625V11.6875H14.7083V14.625Z",fill:"#172128"})),dm=e=>f.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"M1.58334 12.6167V11.0333H14.4333V12.6167H1.58334ZM1.58334 8.78333V7.21666H14.4333V8.78333H1.58334ZM1.58334 4.96666V3.38333H14.4333V4.96666H1.58334Z",fill:"#172128"})),fm=e=>f.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"M12.7833 10.679C12.7833 11.9375 12.3239 12.9861 11.4053 13.825C10.4867 14.6639 9.39228 15.0834 8.12194 15.0834C6.85172 15.0834 5.76105 14.6639 4.84994 13.825C3.93883 12.9861 3.48328 11.9389 3.48328 10.6834V4.08336C3.48328 3.17869 3.81383 2.42197 4.47494 1.81319C5.13605 1.20441 5.92083 0.900024 6.82928 0.900024C7.73783 0.900024 8.52117 1.20441 9.17928 1.81319C9.8375 2.42197 10.1666 3.17869 10.1666 4.08336V10.35C10.1666 10.8935 9.96383 11.3543 9.55828 11.7325C9.15272 12.1109 8.673 12.3 8.11911 12.3C7.56533 12.3 7.09033 12.1127 6.69411 11.738C6.298 11.3634 6.09994 10.9007 6.09994 10.35V4.18336H7.54994V10.35C7.54994 10.4945 7.60711 10.6139 7.72144 10.7084C7.83578 10.8028 7.97267 10.85 8.13211 10.85C8.29155 10.85 8.42883 10.8036 8.54394 10.7109C8.65905 10.6181 8.71661 10.4978 8.71661 10.35V4.10002C8.72772 3.59714 8.54439 3.17975 8.16661 2.84786C7.78883 2.51597 7.34322 2.35002 6.82978 2.35002C6.31633 2.35002 5.87189 2.51352 5.49644 2.84052C5.121 3.16752 4.93328 3.5818 4.93328 4.08336V10.6834C4.94439 11.5417 5.26367 12.2507 5.89111 12.8105C6.51855 13.3702 7.2715 13.65 8.14994 13.65C9.01294 13.65 9.762 13.3695 10.3971 12.8084C11.0323 12.2472 11.3444 11.5389 11.3333 10.6834V3.70002H12.7833V10.679Z",fill:"white"})),pm=e=>f.createElement("svg",{width:41,height:12,viewBox:"0 0 41 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("g",{clipPath:"url(#clip0_100_2379)"},f.createElement("path",{d:"M21.1825 7.56627H22.1696V5.46029C21.9697 5.38454 21.6628 5.35825 21.4373 5.35825C20.6381 5.35825 19.9407 5.89477 19.9261 6.85195H19.8885L19.4834 5.40815H17.7463V11.7965H20.0681V8.80642C20.0681 8.10324 20.2821 7.56672 21.1825 7.56672V7.56627Z",fill:"#172128"}),f.createElement("path",{d:"M2.31875 8.00074C2.31875 7.40005 2.55889 7.11976 3.04271 7.11976C3.48584 7.11976 3.69989 7.3996 3.69989 8.00074V11.7956H6.0217V8.00074C6.0217 7.40005 6.26184 7.11976 6.74256 7.11976C7.18835 7.11976 7.4024 7.3996 7.4024 8.00074V11.7956H9.72111V7.32385C9.72111 6.14831 9.12761 5.21786 7.68013 5.21786C6.74212 5.21786 6.14862 5.53603 5.78111 6.25036H5.75502C5.4627 5.62605 4.8661 5.21786 3.98028 5.21786C3.04227 5.21786 2.45761 5.53603 2.10426 6.25036H2.07817L1.80043 5.40725H3.8147e-05V11.7956H2.31875V8.00074Z",fill:"#172128"}),f.createElement("path",{d:"M10.1851 8.7301C10.1851 10.8129 11.8701 12 13.7227 12C15.5753 12 17.2837 10.8129 17.2837 8.7301V8.47342C17.2837 6.37903 15.5726 5.20349 13.7227 5.20349C11.8728 5.20349 10.1851 6.38215 10.1851 8.47342V8.7301ZM13.7346 7.02071C14.5975 7.02071 14.9765 7.70919 14.9765 8.59017C14.9765 9.47116 14.597 10.1743 13.7346 10.1743C12.8722 10.1743 12.4928 9.47116 12.4928 8.59017C12.4928 7.70919 12.8749 7.02071 13.7346 7.02071Z",fill:"#172128"}),f.createElement("path",{d:"M25.7969 5.20346C23.9324 5.20346 22.3867 6.43158 22.3867 8.47339V8.73007C22.3867 10.8623 24.0602 12 25.8982 12C27.3545 12 28.7874 11.2589 29.0797 9.70151H26.975C26.8101 10.1333 26.3669 10.2764 25.9618 10.2764C25.2264 10.2764 24.7837 9.76301 24.7315 9.08611H29.0912C29.1173 8.87044 29.1173 8.60173 29.1173 8.38293C29.1173 6.08444 27.3686 5.20346 25.7969 5.20346ZM24.7576 7.75862C24.8067 7.19848 25.137 6.71143 25.846 6.71143H25.8491C26.4948 6.71143 26.8623 7.19581 26.8623 7.75862H24.7576Z",fill:"#172128"}),f.createElement("path",{d:"M34.376 3.1975C33.6653 3.44883 32.9979 3.86058 32.4292 4.43319C31.8605 5.00581 31.4523 5.67824 31.2028 6.39435C30.9538 5.67824 30.5448 5.00581 29.9765 4.43275C29.4082 3.86013 28.7408 3.44838 28.0301 3.19705C28.7408 2.94572 29.4082 2.53398 29.9769 1.96136C30.5452 1.38874 30.9538 0.716307 31.2033 -0.000244141C31.4527 0.716307 31.8613 1.3883 32.4301 1.96136C32.9984 2.53398 33.6657 2.94572 34.3764 3.19705L34.376 3.1975Z",fill:"url(#paint0_linear_100_2379)"}),f.createElement("path",{d:"M35.4872 12.0001C34.8667 12.0001 34.2696 11.7715 33.9119 11.3869C33.5895 11.0621 33.4108 10.6655 33.4108 10.1722V10.1C33.4108 8.82507 34.4611 8.12769 35.9051 8.12769C36.4061 8.12769 36.9077 8.17581 37.3729 8.34426V7.94721C37.3729 6.92497 37.0027 6.27571 35.8812 6.27571C35.1413 6.27571 34.4492 6.5404 34.4134 7.38217H33.6854V7.30998C33.8287 6.0471 34.7835 5.61441 35.8578 5.61441C37.1708 5.61441 38.0898 6.17945 38.0898 7.93563V11.808H37.5768C37.4932 11.5915 37.4335 11.3508 37.3499 11.1347H37.326C36.932 11.6516 36.1682 12.0005 35.488 12.0005L35.4872 12.0001ZM37.3729 9.54697V9.01803C36.8718 8.84958 36.3823 8.76536 35.8812 8.76536C35.01 8.76536 34.1507 9.13834 34.1507 10.0643C34.1507 10.9061 34.7831 11.3152 35.6066 11.3152C36.43 11.3152 37.3729 10.5937 37.3729 9.54742V9.54697Z",fill:"#172128"}),f.createElement("path",{d:"M40.9998 3.77446C40.9998 4.09931 40.7371 4.3395 40.4152 4.3395C40.0932 4.3395 39.8305 4.09887 39.8305 3.77446V3.7504C39.8305 3.40148 40.0932 3.19739 40.4152 3.19739C40.7371 3.19739 40.9998 3.40193 40.9998 3.7504V3.77446ZM40.0569 11.8076V5.79444H40.7729V11.8076H40.0569Z",fill:"#172128"})),f.createElement("defs",null,f.createElement("linearGradient",{id:"paint0_linear_100_2379",x1:31.3237,y1:301678e-10,x2:34.1742,y2:2.06507,gradientUnits:"userSpaceOnUse"},f.createElement("stop",{stopColor:"#FA4B16"}),f.createElement("stop",{offset:1,stopColor:"#8E64EF"})),f.createElement("clipPath",{id:"clip0_100_2379"},f.createElement("rect",{width:41,height:12,fill:"white"})))),mm=e=>f.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"M14.4241 8.00167C12.9851 8.50672 11.6338 9.33413 10.4822 10.4848C9.33067 11.6355 8.50415 12.9868 7.9991 14.4258C7.49495 12.9868 6.66664 11.6355 5.51596 10.4839C4.36528 9.33324 3.01402 8.50582 1.575 8.00078C3.01402 7.49573 4.36528 6.66832 5.51686 5.51764C6.66754 4.36696 7.49495 3.01569 8 1.57578C8.50504 3.01569 9.33246 4.36606 10.484 5.51764C11.6347 6.66832 12.986 7.49573 14.425 8.00078L14.4241 8.00167Z",fill:"url(#paint0_linear_100_2352)"}),f.createElement("defs",null,f.createElement("linearGradient",{id:"paint0_linear_100_2352",x1:8.24377,y1:1.57633,x2:13.9855,y2:5.76743,gradientUnits:"userSpaceOnUse"},f.createElement("stop",{stopColor:"#FA4B16"}),f.createElement("stop",{offset:1,stopColor:"#8E64EF"}))));function hm({children:e,side:t="top",align:n="end"}){const{setIsChatScreen:r,isChatScreen:o}=_t(),s=()=>{o||r(!0)};return g.jsxs(rm,{children:[g.jsx(om,{asChild:!0,className:"data-[state=open]:mhb-outline data-[state=open]:mhb-outline-neutral-110",children:g.jsx("button",{type:"button",className:"mhb-h-12 mhb-w-12 mhb-rounded-[16px] mhb-bg-neutral-10 mhb-flex mhb-items-center mhb-justify-center",onClick:s,children:g.jsx(um,{className:"mhb-h-5 mhb-w-5"})})}),g.jsx(sm,{children:g.jsx(im,{side:t,align:n,sideOffset:12,className:`mhb-popover
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("react"),V=require("more-sso-sdk"),fe=require("@radix-ui/react-popover");function me(e){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(s,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}return s.default=e,Object.freeze(s)}const l=me(i),R=me(fe);let de=null;function ge(e){de=e}function xe(e){de?.(e)}const ue=i.createContext(void 0),ye=({children:e,appName:s,apiKey:r,token:a})=>{const[c,h]=i.useState(!!a),[u,b]=i.useState(a),[p,o]=i.useState(!0),[w,_]=i.useState(null);return i.useEffect(()=>{ge(b)},[]),t.jsx(ue.Provider,{value:{appName:s,apiKey:r,accessToken:u,authorized:c,setAuthorized:h,isChatScreen:p,setIsChatScreen:o,profileInfo:w,setProfileInfo:_},children:e})},$=()=>{const e=i.useContext(ue);if(!e)throw new Error("useSdkContext must be used inside SDKProvider");return e},Ce=e=>l.createElement("svg",{width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M15.8261 8.67349C12.4046 8.67349 9.63062 11.447 9.63062 14.8685C9.63062 18.29 12.4046 21.064 15.8261 21.064C16.1656 21.064 16.4991 21.0365 16.8241 20.984C15.0221 20.4765 13.7006 18.8205 13.7006 16.856C13.7006 14.4875 15.6206 12.568 17.9886 12.568C19.8251 12.568 21.3921 13.722 22.0031 15.345C22.0151 15.188 22.0211 15.029 22.0211 14.8685C22.0211 11.447 19.2476 8.67349 15.8261 8.67349Z",fill:"#B72402"}),l.createElement("path",{d:"M17.9984 7.621C13.0309 7.621 9.00342 11.6485 9.00342 16.616C9.00342 20.526 11.4949 23.8495 14.9744 25.0915V27.785C14.9744 28.228 15.4404 28.515 15.8349 28.3125C17.5759 27.4215 21.5219 25.332 23.5549 23.696C23.6114 23.65 23.6674 23.6065 23.7214 23.5605C23.7624 23.527 23.8009 23.494 23.8394 23.4605C25.7724 21.8115 26.9964 19.356 26.9964 16.616C26.9964 11.6485 22.9689 7.621 17.9989 7.621H17.9984ZM15.8274 21.064C15.5379 21.064 15.2539 21.0435 14.9749 21.005C11.9559 20.59 9.63092 18.0015 9.63092 14.8675C9.63092 11.4465 12.4039 8.6735 15.8274 8.6735C19.2509 8.6735 22.0214 11.4465 22.0214 14.8675C22.0214 15.0265 22.0164 15.185 22.0034 15.341C21.8319 17.6225 20.4259 19.5555 18.4544 20.48C17.9424 20.7205 17.3919 20.892 16.8154 20.9845C16.4929 21.036 16.1624 21.064 15.8269 21.064H15.8274Z",fill:"#FA4B16"})),we=e=>l.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M14.4167 3.58334L14.4167 5.13334L5.58341 5.13333L5.58341 3.58333L14.4167 3.58334ZM2.66675 4.5L6.06675 8.01667L2.68341 11.5167L1.56675 10.4L3.86675 8.01667L1.55008 5.61667L2.66675 4.5ZM14.4167 7.25L14.4167 8.81667L7.48341 8.81667L7.48341 7.25L14.4167 7.25ZM14.4167 10.8667L14.4167 12.4333L5.58341 12.4333L5.58341 10.8667L14.4167 10.8667Z",fill:"#172128"})),_e=e=>l.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M13.25 14.45L8.7667 9.98335C8.44448 10.238 8.06414 10.4378 7.6257 10.5827C7.18725 10.7276 6.71203 10.8 6.20003 10.8C4.92048 10.8 3.8367 10.3556 2.9487 9.46668C2.0607 8.57779 1.6167 7.50557 1.6167 6.25001C1.6167 4.99446 2.06114 3.92223 2.95003 3.03335C3.83892 2.14446 4.91392 1.70001 6.17503 1.70001C7.43614 1.70001 8.50837 2.14446 9.3917 3.03335C10.275 3.92223 10.7167 4.99529 10.7167 6.25251C10.7167 6.75085 10.6473 7.2139 10.5084 7.64168C10.3695 8.06946 10.1611 8.47223 9.88337 8.85001L14.3834 13.3167L13.25 14.45ZM6.1892 9.23335C7.02142 9.23335 7.72298 8.94307 8.29387 8.36251C8.86464 7.78196 9.15003 7.07779 9.15003 6.25001C9.15003 5.42223 8.86381 4.71807 8.29137 4.13751C7.71892 3.55696 7.0182 3.26668 6.1892 3.26668C5.35109 3.26668 4.64059 3.55696 4.0577 4.13751C3.47481 4.71807 3.18337 5.42223 3.18337 6.25001C3.18337 7.07779 3.47398 7.78196 4.0552 8.36251C4.63642 8.94307 5.34775 9.23335 6.1892 9.23335Z",fill:"#172128"})),ke=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M10.0417 19.3958V17.7292H16.0625V16.6042H12.7292V9.70833H16.0625V8.77083C16.0625 7.10417 15.4757 5.67014 14.3021 4.46875C13.1285 3.26736 11.7049 2.66667 10.0312 2.66667C8.38542 2.66667 6.95833 3.26736 5.75 4.46875C4.54167 5.67014 3.9375 7.10417 3.9375 8.77083V9.70833H7.27083V16.6042H1.97917V8.775C1.97917 7.66722 2.19229 6.62306 2.61854 5.6425C3.04479 4.66195 3.62132 3.80319 4.34812 3.06625C5.07493 2.32931 5.92903 1.74861 6.91042 1.32417C7.89167 0.899722 8.93667 0.6875 10.0454 0.6875C11.154 0.6875 12.1944 0.899306 13.1667 1.32292C14.1389 1.74653 14.9868 2.32424 15.7104 3.05604C16.4342 3.78785 17.0036 4.64278 17.4187 5.62083C17.834 6.59889 18.0417 7.64889 18.0417 8.77083V19.3958H10.0417ZM3.9375 14.625H5.3125V11.6875H3.9375V14.625ZM14.7083 14.625H16.0625V11.6875H14.7083V14.625Z",fill:"#172128"})),ve=e=>l.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M1.58334 12.6167V11.0333H14.4333V12.6167H1.58334ZM1.58334 8.78333V7.21666H14.4333V8.78333H1.58334ZM1.58334 4.96666V3.38333H14.4333V4.96666H1.58334Z",fill:"#172128"})),je=e=>l.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M12.7833 10.679C12.7833 11.9375 12.3239 12.9861 11.4053 13.825C10.4867 14.6639 9.39228 15.0834 8.12194 15.0834C6.85172 15.0834 5.76105 14.6639 4.84994 13.825C3.93883 12.9861 3.48328 11.9389 3.48328 10.6834V4.08336C3.48328 3.17869 3.81383 2.42197 4.47494 1.81319C5.13605 1.20441 5.92083 0.900024 6.82928 0.900024C7.73783 0.900024 8.52117 1.20441 9.17928 1.81319C9.8375 2.42197 10.1666 3.17869 10.1666 4.08336V10.35C10.1666 10.8935 9.96383 11.3543 9.55828 11.7325C9.15272 12.1109 8.673 12.3 8.11911 12.3C7.56533 12.3 7.09033 12.1127 6.69411 11.738C6.298 11.3634 6.09994 10.9007 6.09994 10.35V4.18336H7.54994V10.35C7.54994 10.4945 7.60711 10.6139 7.72144 10.7084C7.83578 10.8028 7.97267 10.85 8.13211 10.85C8.29155 10.85 8.42883 10.8036 8.54394 10.7109C8.65905 10.6181 8.71661 10.4978 8.71661 10.35V4.10002C8.72772 3.59714 8.54439 3.17975 8.16661 2.84786C7.78883 2.51597 7.34322 2.35002 6.82978 2.35002C6.31633 2.35002 5.87189 2.51352 5.49644 2.84052C5.121 3.16752 4.93328 3.5818 4.93328 4.08336V10.6834C4.94439 11.5417 5.26367 12.2507 5.89111 12.8105C6.51855 13.3702 7.2715 13.65 8.14994 13.65C9.01294 13.65 9.762 13.3695 10.3971 12.8084C11.0323 12.2472 11.3444 11.5389 11.3333 10.6834V3.70002H12.7833V10.679Z",fill:"white"})),Se=e=>l.createElement("svg",{width:41,height:12,viewBox:"0 0 41 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_100_2379)"},l.createElement("path",{d:"M21.1825 7.56627H22.1696V5.46029C21.9697 5.38454 21.6628 5.35825 21.4373 5.35825C20.6381 5.35825 19.9407 5.89477 19.9261 6.85195H19.8885L19.4834 5.40815H17.7463V11.7965H20.0681V8.80642C20.0681 8.10324 20.2821 7.56672 21.1825 7.56672V7.56627Z",fill:"#172128"}),l.createElement("path",{d:"M2.31875 8.00074C2.31875 7.40005 2.55889 7.11976 3.04271 7.11976C3.48584 7.11976 3.69989 7.3996 3.69989 8.00074V11.7956H6.0217V8.00074C6.0217 7.40005 6.26184 7.11976 6.74256 7.11976C7.18835 7.11976 7.4024 7.3996 7.4024 8.00074V11.7956H9.72111V7.32385C9.72111 6.14831 9.12761 5.21786 7.68013 5.21786C6.74212 5.21786 6.14862 5.53603 5.78111 6.25036H5.75502C5.4627 5.62605 4.8661 5.21786 3.98028 5.21786C3.04227 5.21786 2.45761 5.53603 2.10426 6.25036H2.07817L1.80043 5.40725H3.8147e-05V11.7956H2.31875V8.00074Z",fill:"#172128"}),l.createElement("path",{d:"M10.1851 8.7301C10.1851 10.8129 11.8701 12 13.7227 12C15.5753 12 17.2837 10.8129 17.2837 8.7301V8.47342C17.2837 6.37903 15.5726 5.20349 13.7227 5.20349C11.8728 5.20349 10.1851 6.38215 10.1851 8.47342V8.7301ZM13.7346 7.02071C14.5975 7.02071 14.9765 7.70919 14.9765 8.59017C14.9765 9.47116 14.597 10.1743 13.7346 10.1743C12.8722 10.1743 12.4928 9.47116 12.4928 8.59017C12.4928 7.70919 12.8749 7.02071 13.7346 7.02071Z",fill:"#172128"}),l.createElement("path",{d:"M25.7969 5.20346C23.9324 5.20346 22.3867 6.43158 22.3867 8.47339V8.73007C22.3867 10.8623 24.0602 12 25.8982 12C27.3545 12 28.7874 11.2589 29.0797 9.70151H26.975C26.8101 10.1333 26.3669 10.2764 25.9618 10.2764C25.2264 10.2764 24.7837 9.76301 24.7315 9.08611H29.0912C29.1173 8.87044 29.1173 8.60173 29.1173 8.38293C29.1173 6.08444 27.3686 5.20346 25.7969 5.20346ZM24.7576 7.75862C24.8067 7.19848 25.137 6.71143 25.846 6.71143H25.8491C26.4948 6.71143 26.8623 7.19581 26.8623 7.75862H24.7576Z",fill:"#172128"}),l.createElement("path",{d:"M34.376 3.1975C33.6653 3.44883 32.9979 3.86058 32.4292 4.43319C31.8605 5.00581 31.4523 5.67824 31.2028 6.39435C30.9538 5.67824 30.5448 5.00581 29.9765 4.43275C29.4082 3.86013 28.7408 3.44838 28.0301 3.19705C28.7408 2.94572 29.4082 2.53398 29.9769 1.96136C30.5452 1.38874 30.9538 0.716307 31.2033 -0.000244141C31.4527 0.716307 31.8613 1.3883 32.4301 1.96136C32.9984 2.53398 33.6657 2.94572 34.3764 3.19705L34.376 3.1975Z",fill:"url(#paint0_linear_100_2379)"}),l.createElement("path",{d:"M35.4872 12.0001C34.8667 12.0001 34.2696 11.7715 33.9119 11.3869C33.5895 11.0621 33.4108 10.6655 33.4108 10.1722V10.1C33.4108 8.82507 34.4611 8.12769 35.9051 8.12769C36.4061 8.12769 36.9077 8.17581 37.3729 8.34426V7.94721C37.3729 6.92497 37.0027 6.27571 35.8812 6.27571C35.1413 6.27571 34.4492 6.5404 34.4134 7.38217H33.6854V7.30998C33.8287 6.0471 34.7835 5.61441 35.8578 5.61441C37.1708 5.61441 38.0898 6.17945 38.0898 7.93563V11.808H37.5768C37.4932 11.5915 37.4335 11.3508 37.3499 11.1347H37.326C36.932 11.6516 36.1682 12.0005 35.488 12.0005L35.4872 12.0001ZM37.3729 9.54697V9.01803C36.8718 8.84958 36.3823 8.76536 35.8812 8.76536C35.01 8.76536 34.1507 9.13834 34.1507 10.0643C34.1507 10.9061 34.7831 11.3152 35.6066 11.3152C36.43 11.3152 37.3729 10.5937 37.3729 9.54742V9.54697Z",fill:"#172128"}),l.createElement("path",{d:"M40.9998 3.77446C40.9998 4.09931 40.7371 4.3395 40.4152 4.3395C40.0932 4.3395 39.8305 4.09887 39.8305 3.77446V3.7504C39.8305 3.40148 40.0932 3.19739 40.4152 3.19739C40.7371 3.19739 40.9998 3.40193 40.9998 3.7504V3.77446ZM40.0569 11.8076V5.79444H40.7729V11.8076H40.0569Z",fill:"#172128"})),l.createElement("defs",null,l.createElement("linearGradient",{id:"paint0_linear_100_2379",x1:31.3237,y1:301678e-10,x2:34.1742,y2:2.06507,gradientUnits:"userSpaceOnUse"},l.createElement("stop",{stopColor:"#FA4B16"}),l.createElement("stop",{offset:1,stopColor:"#8E64EF"})),l.createElement("clipPath",{id:"clip0_100_2379"},l.createElement("rect",{width:41,height:12,fill:"white"})))),Ne=e=>l.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M14.4241 8.00167C12.9851 8.50672 11.6338 9.33413 10.4822 10.4848C9.33067 11.6355 8.50415 12.9868 7.9991 14.4258C7.49495 12.9868 6.66664 11.6355 5.51596 10.4839C4.36528 9.33324 3.01402 8.50582 1.575 8.00078C3.01402 7.49573 4.36528 6.66832 5.51686 5.51764C6.66754 4.36696 7.49495 3.01569 8 1.57578C8.50504 3.01569 9.33246 4.36606 10.484 5.51764C11.6347 6.66832 12.986 7.49573 14.425 8.00078L14.4241 8.00167Z",fill:"url(#paint0_linear_100_2352)"}),l.createElement("defs",null,l.createElement("linearGradient",{id:"paint0_linear_100_2352",x1:8.24377,y1:1.57633,x2:13.9855,y2:5.76743,gradientUnits:"userSpaceOnUse"},l.createElement("stop",{stopColor:"#FA4B16"}),l.createElement("stop",{offset:1,stopColor:"#8E64EF"}))));function Te({children:e,side:s="top",align:r="end"}){const{setIsChatScreen:a,isChatScreen:c}=$(),h=()=>{c||a(!0)};return t.jsxs(R.Root,{children:[t.jsx(R.Trigger,{asChild:!0,className:"data-[state=open]:mhb-outline data-[state=open]:mhb-outline-neutral-110",children:t.jsx("button",{type:"button",className:"mhb-h-12 mhb-w-12 mhb-rounded-[16px] mhb-bg-neutral-10 mhb-flex mhb-items-center mhb-justify-center",onClick:h,children:t.jsx(ke,{className:"mhb-h-5 mhb-w-5"})})}),t.jsx(R.Portal,{children:t.jsx(R.Content,{side:s,align:r,sideOffset:12,className:`mhb-popover
47
2
  mhb-flex mhb-flex-col
48
3
  mhb-h-[460px] mhb-max-h-[460px]
49
4
  mhb-w-[323px]
@@ -51,7 +6,7 @@
51
6
  mhb-rounded-[16px]
52
7
  mhb-border mhb-border-neutral-10
53
8
  mhb-shadow-[0_4px_20px_rgba(23,33,40,0.05)]
54
- mhb-overflow-hidden`,children:g.jsx("div",{className:"mhb-popover-children mhb-h-full mhb-flex mhb-flex-col",children:e})})})]})}const gm=({forwardedRef:e,onChangeHandler:t})=>g.jsxs("div",{className:"mhb-h-[48px] mhb-flex mhb-rounded-[9999px] mhb-bg-neutral-10 mhb-items-center mhb-gap-3 mhb-px-3",children:[g.jsx(lm,{className:"mhb-h-4 mhb-w-4"}),g.jsx("input",{ref:e,onChange:t,type:"text",placeholder:"Search your chats",className:`
9
+ mhb-overflow-hidden`,children:t.jsx("div",{className:"mhb-popover-children mhb-h-full mhb-flex mhb-flex-col",children:e})})})]})}const Ee=({forwardedRef:e,onChangeHandler:s})=>t.jsxs("div",{className:"mhb-h-[48px] mhb-flex mhb-rounded-[9999px] mhb-bg-neutral-10 mhb-items-center mhb-gap-3 mhb-px-3",children:[t.jsx(_e,{className:"mhb-h-4 mhb-w-4"}),t.jsx("input",{ref:e,onChange:s,type:"text",placeholder:"Search your chats",className:`
55
10
  mhb-input
56
11
  mhb-flex-1
57
12
  mhb-w-full
@@ -64,7 +19,7 @@
64
19
  mhb-overflow-visible
65
20
  placeholder:mhb-text-neutral-40
66
21
  focus:mhb-outline-none
67
- `})]}),bm=N.forwardRef((e,t)=>g.jsx(gm,{...e,forwardedRef:t})),sr=()=>g.jsx("div",{className:"mhb-flex mhb-items-center mhb-justify-center",children:g.jsx("svg",{className:"mhb-w-8 mhb-h-8 mhb-animate-spin mhb-text-neutral-110",viewBox:"0 0 50 50",children:g.jsx("circle",{cx:"25",cy:"25",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeDasharray:"100",strokeDashoffset:"60"})})});let ae=null,$n=0,ir=!1,vm=0;const _e={};let Kt=!1,qt="",sa="",Xt="",ar=[],Un=!1;function wm(){const t={host:new URL(qt).hostname,"x-api-key":Xt},n={},r=btoa(JSON.stringify(t)),o=btoa(JSON.stringify(n)),s=`${sa}?header=${r}&payload=${o}`;return new WebSocket(s,["graphql-ws"])}const ia=()=>{ir=!1,ae=wm(),Kt=!1,ae.onopen=()=>{$n=0,ae?.send(JSON.stringify({type:"connection_init"}))},ae.onmessage=e=>{const t=JSON.parse(e.data);if(Kt)t.type==="error"||(t.type==="data"&&_e[t.id]?_e[t.id].callback(t.payload.data):t.type==="complete"&&_e[t.id]&&delete _e[t.id]);else if(t.type==="connection_ack"){Kt=!0;for(const n in _e)ae?.send(JSON.stringify(_e[n].message))}},ae.onclose=()=>{if(ir)return;const e=Math.min(1e3*Math.pow(2,$n)+Math.random()*1e3,3e4);setTimeout(()=>{$n++,ia()},e)},ae.onerror=()=>{ae?.close()}},Mo=(e,t=null)=>{ar.forEach(({resolve:n,reject:r})=>{e?r(e):t&&n(t)}),ar=[]};function ym(){return new Promise((e,t)=>{ar.push({resolve:e,reject:t})})}const xm=e=>{qt=e.apiURL,Xt=e.apiKey,sa=e.apiURL.replace("https://","wss://").replace("appsync-api","appsync-realtime-api"),ia();const t=async(n,r={},o)=>{const i=await(await fetch(qt,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":Xt,...o?{Authorization:`Bearer ${o}`}:{}},body:JSON.stringify({query:n,variables:r})})).json();if(Array.isArray(i.errors)&&i.errors.some(c=>{const l=c.message?.toLowerCase()??"";return l.includes("unauthorized")||l.includes("jwt")||l.includes("expired")})){if(Un){const c=await ym();return t(n,r,c)}Un=!0;try{let c=null;if(process.env.NODE_ENV==="development")c=await an.getDevToken("432896");else{const l=window.location.href,u=encodeURIComponent(l);c=an.getToken(u)}if(!c?.token)throw new Error("Refresh did not return an access token");return Wp(c.token),Mo(null,c.token),t(n,r,c.token)}catch(c){throw Mo(c,null),c}finally{Un=!1}}if(i.errors)throw new Error(i.errors.map(c=>c.message).join(", "));return i.data};return{executeGraphql:t,subscribe:(n,r={},o)=>{if(!n.trim().startsWith("subscription"))return()=>{};const s=`${++vm}`,i={id:s,type:"start",payload:{data:JSON.stringify({query:n,variables:r}),extensions:{authorization:{host:new URL(qt).hostname,"x-api-key":Xt}}}};return _e[s]={message:i,callback:o},Kt&&ae?.readyState===WebSocket.OPEN&&ae.send(JSON.stringify(i)),()=>{ae?.readyState===WebSocket.OPEN&&ae.send(JSON.stringify({id:s,type:"stop"})),delete _e[s]}},close:()=>{ir=!0,ae?.close()}}};let Fe;const Cm=e=>{Fe||(Fe=xm(e))},cn=async(e,t={},n)=>{if(!Fe)throw new Error("client is not created");return Fe.executeGraphql(e,t,n)},Hn=async(e,t={},n)=>{if(!Fe)throw new Error("client is not created");return Fe.executeGraphql(e,t,n)},Em=(e,t={},n)=>{if(!Fe)throw new Error("client is not created");return Fe.subscribe(e,t,n)},Fo=`query AssistHistory($limit: Int, $offset: Int , $ticket_id: Int) {
22
+ `})]}),He=i.forwardRef((e,s)=>t.jsx(Ee,{...e,forwardedRef:s})),W=()=>t.jsx("div",{className:"mhb-flex mhb-items-center mhb-justify-center",children:t.jsx("svg",{className:"mhb-w-8 mhb-h-8 mhb-animate-spin mhb-text-neutral-110",viewBox:"0 0 50 50",children:t.jsx("circle",{cx:"25",cy:"25",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeDasharray:"100",strokeDashoffset:"60"})})});let S=null,z=0,Y=!1,Me=0;const M={};let O=!1,P="",be="",F="",Q=[],G=!1;function Le(){const s={host:new URL(P).hostname,"x-api-key":F},r={},a=btoa(JSON.stringify(s)),c=btoa(JSON.stringify(r)),h=`${be}?header=${a}&payload=${c}`;return new WebSocket(h,["graphql-ws"])}const pe=()=>{Y=!1,S=Le(),O=!1,S.onopen=()=>{z=0,S?.send(JSON.stringify({type:"connection_init"}))},S.onmessage=e=>{const s=JSON.parse(e.data);if(O)s.type==="error"||(s.type==="data"&&M[s.id]?M[s.id].callback(s.payload.data):s.type==="complete"&&M[s.id]&&delete M[s.id]);else if(s.type==="connection_ack"){O=!0;for(const r in M)S?.send(JSON.stringify(M[r].message))}},S.onclose=()=>{if(Y)return;const e=Math.min(1e3*Math.pow(2,z)+Math.random()*1e3,3e4);setTimeout(()=>{z++,pe()},e)},S.onerror=()=>{S?.close()}},ae=(e,s=null)=>{Q.forEach(({resolve:r,reject:a})=>{e?a(e):s&&r(s)}),Q=[]};function Ae(){return new Promise((e,s)=>{Q.push({resolve:e,reject:s})})}const Ie=e=>{P=e.apiURL,F=e.apiKey,be=e.apiURL.replace("https://","wss://").replace("appsync-api","appsync-realtime-api"),pe();const s=async(r,a={},c)=>{const u=await(await fetch(P,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":F,...c?{Authorization:`Bearer ${c}`}:{}},body:JSON.stringify({query:r,variables:a})})).json(),b=Array.isArray(u.errors)?u.errors:[];if(b.some(o=>{const w=o.message?.toLowerCase()??"";return w.includes("unauthorized")||w.includes("jwt")||w.includes("expired")})){if(G){const o=await Ae();return s(r,a,o)}G=!0;try{let o=null;if(process.env.NODE_ENV==="development")o=await V.SSOAuthorization.getDevToken("432896");else{const w=window.location.href,_=encodeURIComponent(w);o=V.SSOAuthorization.getToken(_)}if(!o?.token)throw new Error("Refresh did not return an access token");return xe(o.token),ae(null,o.token),s(r,a,o.token)}catch(o){throw ae(o,null),o}finally{G=!1}}if(b.length>0)throw new Error(b.map(o=>o.message).join(", "));return u.data};return{executeGraphql:s,subscribe:(r,a={},c)=>{if(!r.trim().startsWith("subscription"))return()=>{};const h=`${++Me}`,u={id:h,type:"start",payload:{data:JSON.stringify({query:r,variables:a}),extensions:{authorization:{host:new URL(P).hostname,"x-api-key":F}}}};return M[h]={message:u,callback:c},O&&S?.readyState===WebSocket.OPEN&&S.send(JSON.stringify(u)),()=>{S?.readyState===WebSocket.OPEN&&S.send(JSON.stringify({id:h,type:"stop"})),delete M[h]}},close:()=>{Y=!0,S?.close()}}};let L;const Ve=e=>{L||(L=Ie(e))},U=async(e,s={},r)=>{if(!L)throw new Error("client is not created");return L.executeGraphql(e,s,r)},K=async(e,s={},r)=>{if(!L)throw new Error("client is not created");return L.executeGraphql(e,s,r)},De=(e,s={},r)=>{if(!L)throw new Error("client is not created");return L.subscribe(e,s,r)},ie=`query AssistHistory($limit: Int, $offset: Int , $ticket_id: Int) {
68
23
  assistHistory(limit: $limit, offset: $offset, ticket_id: $ticket_id) {
69
24
  message_id
70
25
  text
@@ -80,7 +35,7 @@
80
35
  user_name
81
36
  user_type
82
37
  }
83
- }}`,No=`query EmployeeAssistTickets($search_key: String $limit: Int, $offset: Int) {
38
+ }}`,oe=`query EmployeeAssistTickets($search_key: String $limit: Int, $offset: Int) {
84
39
  EmployeeAssistTickets(search_key: $search_key limit: $limit, offset: $offset) {
85
40
  ticket_id
86
41
  parent_id
@@ -112,7 +67,7 @@
112
67
  chat_handover
113
68
  is_new
114
69
  }
115
- }`,Do=10,Sm=()=>{const[e,t]=N.useState([]),[n,r]=N.useState(!0),[o,s]=N.useState(null),[i,a]=N.useState(!1),[c,l]=N.useState(""),u=N.useRef(!0),{accessToken:d}=_t(),m=()=>{cn(No,{limit:Do,search_key:c},d).then(async p=>{t(p?.EmployeeAssistTickets??[])}).catch(p=>{s(p)}).finally(()=>{r(!1)})};return N.useEffect(()=>{if(u.current){u.current=!1,m();return}const p=setTimeout(()=>{m()},400);return()=>clearTimeout(p)},[c]),{ticketData:e,loading:n,error:o,getNextPageTicketData:p=>{d&&(i||(a(!0),cn(No,{limit:Do,offset:p},d).then(async h=>{const{EmployeeAssistTickets:b}=h;t(y=>[...y,...b])}).catch(h=>{s(h)}).finally(()=>{a(!1)})))},isLoadingMore:i,setSearchText:l}};function zn(e){return(e?new Date(e):new Date).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",timeZone:"Asia/Kolkata"})}function Rm(e,t="Asia/Kolkata",n="en-GB"){const r=new Date(e);if(Number.isNaN(r.getTime()))return"";const o=new Intl.DateTimeFormat(n,{day:"2-digit",month:"short",year:"2-digit",timeZone:t}).formatToParts(r),s=o.find(l=>l.type==="day")?.value??"",i=o.find(l=>l.type==="month")?.value??"",a=o.find(l=>l.type==="year")?.value??"",c=new Intl.DateTimeFormat(n,{hour:"2-digit",minute:"2-digit",hour12:!1,timeZone:t}).format(r);return`${s} ${i} ‘${a}, ${c}`}const cr=(e,t)=>{sessionStorage.setItem(e,JSON.stringify(t))},ft=e=>{const t=sessionStorage.getItem(e);return t?JSON.parse(t):null},Am=()=>{const e=N.useRef(null),t=N.useRef(null),n=N.useRef(null),{ticketData:r,loading:o,getNextPageTicketData:s,isLoadingMore:i,setSearchText:a}=Sm(),{setIsChatScreen:c,profileInfo:l}=_t();N.useLayoutEffect(()=>{e.current},[r.length]);const u=v=>{const p=v.currentTarget;if(n.current?.blur(),p.scrollHeight<=p.clientHeight)return;const h=p.scrollHeight-p.scrollTop-p.clientHeight,b=r.length;t.current!==b&&h<=20&&!o&&(t.current=b,s(b))},d=v=>{cr("userAndTicket",{ticket_id:v,employee_id:l?.employee_id}),c(p=>!p)},m=v=>{v.preventDefault();const p=n.current?.value?.trim();a(p??null)};return g.jsxs("div",{className:"mhb-flex mhb-flex-col mhb-h-full mhb-min-h-0",children:[g.jsx("div",{className:"mhb-searchbarContainer mhb-flex mhb-flex-col mhb-border-b mhb-border-neutral-20",children:g.jsx(bm,{ref:n,onChangeHandler:m})}),g.jsx("div",{ref:e,onScroll:u,className:"mhb-history-main-container mhb-no-scrollbar mhb-py-3 mhb-flex mhb-flex-col mhb-gap-1 mhb-overflow-y-auto mhb-flex-1 mhb-min-h-0",children:o?g.jsx(sr,{}):g.jsxs(g.Fragment,{children:[r.map(v=>g.jsxs("button",{type:"button",className:"mhb-btn-reset mhb-history-container mhb-p-3 mhb-flex mhb-flex-col mhb-rounded-[12px] mhb-bg-neutral-10 mhb-gap-2 mhb-items-start",onClick:()=>d(v.ticket_id),children:[g.jsx("div",{className:"mhb-flex mhb-items-start",children:g.jsx("p",{className:"mhb-typography-para-thick-30 mhb-text-neutral-110 mhb-m-0 mhb-min-w-0 mhb-break-words mhb-whitespace-normal mhb-text-left",children:v.title})}),g.jsx("p",{className:"mhb-typography-para-30 mhb-text-neutral-60 mhb-m-0",children:Rm(v.created_at)})]},v.ticket_id)),i&&g.jsx(sr,{})]})})]})},km=({isChatScreen:e,setIsChatScreen:t})=>{const n=()=>{t(o=>!o)},r=()=>{sessionStorage.removeItem("userAndTicket"),t(o=>!o)};return g.jsxs("div",{className:"mhb-header mhb-border-b mhb-border-neutral-20 mhb-flex mhb-items-center mhb-justify-between",children:[g.jsx(am,{className:"h-[36px] w-[36px] fill-current"}),g.jsxs("div",{className:"mhb-flex mhb-gap-2 mhb-items-center",children:[e?g.jsx("div",{className:"mhb-btn-reset mhb-p-3 mhb-invisible mhb-typography-para-thick-30",children:"new chat"}):g.jsx("button",{type:"button",onClick:r,className:"mhb-btn-reset mhb-p-3 mhb-bg-neutral-10 mhb-typography-para-thick-30 mhb-rounded-[9999px]",children:"new chat"}),g.jsx("button",{type:"button",className:"mhb-btn-reset mhb-h-[36px] mhb-w-[36px] mhb-flex mhb-items-center mhb-justify-center mhb-rounded-full mhb-bg-neutral-10",onClick:n,children:e?g.jsx(dm,{className:"mhb-h-[16px] mhb-w-[16px] fill-current"}):g.jsx(cm,{className:"mhb-h-[16px] mhb-w-[16px]"})})]})]})},Io=`
70
+ }`,le=10,$e=()=>{const[e,s]=i.useState([]),[r,a]=i.useState(!0),[c,h]=i.useState(null),[u,b]=i.useState(!1),[p,o]=i.useState(""),w=i.useRef(!0),{accessToken:_}=$(),k=()=>{U(oe,{limit:le,search_key:p},_).then(async g=>{s(g?.EmployeeAssistTickets??[])}).catch(g=>{h(g)}).finally(()=>{a(!1)})};return i.useEffect(()=>{if(w.current){w.current=!1,k();return}const g=setTimeout(()=>{k()},400);return()=>clearTimeout(g)},[p]),{ticketData:e,loading:r,error:c,getNextPageTicketData:g=>{_&&(u||(b(!0),U(oe,{limit:le,offset:g},_).then(async j=>{const{EmployeeAssistTickets:T}=j;s(E=>[...E,...T])}).catch(j=>{h(j)}).finally(()=>{b(!1)})))},isLoadingMore:u,setSearchText:o}};function q(e){return(e?new Date(e):new Date).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",timeZone:"Asia/Kolkata"})}function Re(e,s="Asia/Kolkata",r="en-GB"){const a=new Date(e);if(Number.isNaN(a.getTime()))return"";const c=new Intl.DateTimeFormat(r,{day:"2-digit",month:"short",year:"2-digit",timeZone:s}).formatToParts(a),h=c.find(o=>o.type==="day")?.value??"",u=c.find(o=>o.type==="month")?.value??"",b=c.find(o=>o.type==="year")?.value??"",p=new Intl.DateTimeFormat(r,{hour:"2-digit",minute:"2-digit",hour12:!1,timeZone:s}).format(a);return`${h} ${u} ‘${b}, ${p}`}const X=(e,s)=>{sessionStorage.setItem(e,JSON.stringify(s))},D=e=>{const s=sessionStorage.getItem(e);return s?JSON.parse(s):null},Oe=()=>{const e=i.useRef(null),s=i.useRef(null),r=i.useRef(null),{ticketData:a,loading:c,getNextPageTicketData:h,isLoadingMore:u,setSearchText:b}=$e(),{setIsChatScreen:p,profileInfo:o}=$();i.useLayoutEffect(()=>{e.current},[a.length]);const w=m=>{const g=m.currentTarget;if(r.current?.blur(),g.scrollHeight<=g.clientHeight)return;const j=g.scrollHeight-g.scrollTop-g.clientHeight,T=a.length;s.current!==T&&j<=20&&!c&&(s.current=T,h(T))},_=m=>{X("userAndTicket",{ticket_id:m,employee_id:o?.employee_id}),p(g=>!g)},k=m=>{m.preventDefault();const g=r.current?.value?.trim();b(g??null)};return t.jsxs("div",{className:"mhb-flex mhb-flex-col mhb-h-full mhb-min-h-0",children:[t.jsx("div",{className:"mhb-searchbarContainer mhb-flex mhb-flex-col mhb-border-b mhb-border-neutral-20",children:t.jsx(He,{ref:r,onChangeHandler:k})}),t.jsx("div",{ref:e,onScroll:w,className:"mhb-history-main-container mhb-no-scrollbar mhb-py-3 mhb-flex mhb-flex-col mhb-gap-1 mhb-overflow-y-auto mhb-flex-1 mhb-min-h-0",children:c?t.jsx(W,{}):t.jsxs(t.Fragment,{children:[a.map(m=>t.jsxs("button",{type:"button",className:"mhb-btn-reset mhb-history-container mhb-p-3 mhb-flex mhb-flex-col mhb-rounded-[12px] mhb-bg-neutral-10 mhb-gap-2 mhb-items-start",onClick:()=>_(m.ticket_id),children:[t.jsx("div",{className:"mhb-flex mhb-items-start",children:t.jsx("p",{className:"mhb-typography-para-thick-30 mhb-text-neutral-110 mhb-m-0 mhb-min-w-0 mhb-break-words mhb-whitespace-normal mhb-text-left",children:m.title})}),t.jsx("p",{className:"mhb-typography-para-30 mhb-text-neutral-60 mhb-m-0",children:Re(m.created_at)})]},m.ticket_id)),u&&t.jsx(W,{})]})})]})},Pe=({isChatScreen:e,setIsChatScreen:s})=>{const r=()=>{s(c=>!c)},a=()=>{sessionStorage.removeItem("userAndTicket"),s(c=>!c)};return t.jsxs("div",{className:"mhb-header mhb-border-b mhb-border-neutral-20 mhb-flex mhb-items-center mhb-justify-between",children:[t.jsx(Ce,{className:"h-[36px] w-[36px] fill-current"}),t.jsxs("div",{className:"mhb-flex mhb-gap-2 mhb-items-center",children:[e?t.jsx("div",{className:"mhb-btn-reset mhb-p-3 mhb-invisible mhb-typography-para-thick-30",children:"new chat"}):t.jsx("button",{type:"button",onClick:a,className:"mhb-btn-reset mhb-p-3 mhb-bg-neutral-10 mhb-typography-para-thick-30 mhb-rounded-[9999px]",children:"new chat"}),t.jsx("button",{type:"button",className:"mhb-btn-reset mhb-h-[36px] mhb-w-[36px] mhb-flex mhb-items-center mhb-justify-center mhb-rounded-full mhb-bg-neutral-10",onClick:r,children:e?t.jsx(ve,{className:"mhb-h-[16px] mhb-w-[16px] fill-current"}):t.jsx(we,{className:"mhb-h-[16px] mhb-w-[16px]"})})]})]})},ce=`
116
71
  mutation AssistChat(
117
72
  $message: String!
118
73
  $ticket_id: Int
@@ -143,7 +98,7 @@ mutation AssistChat(
143
98
  }
144
99
  }
145
100
  }
146
- `,_m=`
101
+ `,Fe=`
147
102
  mutation GetPresignedLink(
148
103
  $files: [String!]!
149
104
  $signature_type: String!
@@ -152,7 +107,7 @@ mutation AssistChat(
152
107
  filename
153
108
  url
154
109
  }
155
- }`,Pm=`subscription onAssistChat($ticket_id: Int!) {
110
+ }`,Ze=`subscription onAssistChat($ticket_id: Int!) {
156
111
  onAssistChat(ticket_id: $ticket_id) {
157
112
  message_id
158
113
  text
@@ -169,7 +124,7 @@ mutation AssistChat(
169
124
  user_type
170
125
  }
171
126
  }
172
- }`,Vn=10,Om=()=>{const[e,t]=N.useState([]),[n,r]=N.useState(!0),[o,s]=N.useState(null),[i,a]=N.useState(!1),[c,l]=N.useState(!1),[u,d]=N.useState(!0),{accessToken:m,profileInfo:v}=_t(),p=ft("userAndTicket")?.ticket_id,h=ft("userAndTicket")?.employee_id,b=N.useMemo(()=>e.find(R=>R.ticket_id!=null)?.ticket_id??null,[e]);let y=p??b??null;return N.useEffect(()=>{if(!y||!v)return;if(h&&v?.employee_id!=h){sessionStorage.removeItem("userAndTicket");return}const R=Em(Pm,{ticket_id:y},x=>{const E=x;E?.onAssistChat?.user?.user_type==="agent"&&t(S=>[...S,E.onAssistChat])});return()=>R()},[y,v]),N.useEffect(()=>{if(!m||!v)return;h&&v?.employee_id!==h&&(sessionStorage.removeItem("userAndTicket"),y=null);const R={...y&&{ticket_id:y},limit:Vn};cn(Fo,R,m).then(async x=>{t(x?.assistHistory??[])}).catch(x=>{s(x)}).finally(()=>{r(!1)})},[v]),{historyData:e,msgLoading:n,msgError:o,isSending:c,sendMessage:R=>{const x=e.find(P=>P.ticket_id!=null)?.ticket_id??null,E=e.find(P=>P.handover==!0)?.handover??!1,S={...x&&{ticket_id:x},message:R,handover:E,attachments:[],text:R,message_id:Math.random(),created_at:new Date().toISOString(),user:{user_name:v?.full_name,user_type:"employee"}};l(!0),t(P=>[...P,S]),Hn(Io,S,m).then(async P=>{const F=P;F.assistChat.user.user_type!=="employee"&&t(L=>[...L,F.assistChat]),!ft("userAndTicket")&&F.assistChat?.ticket_id&&v&&cr("userAndTicket",{ticket_id:F.assistChat?.ticket_id,employee_id:v.employee_id})}).catch(()=>t(P=>P.slice(0,-1))).finally(()=>l(!1))},getNextPageData:R=>{if(!m||i)return;const x=ft("userAndTicket")?.ticket_id,E={...x&&{ticket_id:x},limit:Vn,offset:R};a(!0),cn(Fo,E,m).then(async S=>{const F=S?.assistHistory??[];t(L=>[...F,...L]),F.length<Vn&&d(!1)}).catch(S=>{s(S)}).finally(()=>{a(!1)})},isLoadingMore:i,upload:async R=>{l(!0);const x={files:R.files.map(E=>`${R.ticketId}/${E.name}`),signature_type:R.signature_type};try{const E=await Hn(_m,x,m);for(const[j,W]of R.files.entries()){const D=E.GetPresignedLink[j]?.url;D&&await fetch(D,{method:"PUT",body:W,headers:{"Content-Type":W.type}})}const S=e.find(j=>j.handover)?.handover??!1,P=R.files.map(j=>({url:URL.createObjectURL(j),filename:j.name})),F={ticket_id:R.ticketId,handover:S,attachments:P,text:"",message_id:Math.random(),created_at:new Date().toISOString(),user:{user_name:v?.full_name,user_type:"employee"}};t(j=>[...j,F]);const L={ticket_id:R.ticketId,handover:S,attachments:R.files.map(j=>`${R.ticketId}/${j.name}`),message:"",text:"",message_id:Math.random(),created_at:new Date().toISOString(),user:{user_name:v?.full_name,user_type:"employee"}},B=await Hn(Io,L,m);B.assistChat.user.user_type!=="employee"&&t(j=>[...j,B.assistChat]),!ft("userAndTicket")&&B.assistChat?.ticket_id&&v&&cr("userAndTicket",{ticket_id:B.assistChat.ticket_id,employee_id:v.employee_id})}catch{t(S=>S.slice(0,-1))}finally{l(!1)}},hasMore:u}},Tm=({toastMsg:e})=>g.jsxs("div",{id:"toast-simple",className:"mhb-border-red-60 mhb-fixed mhb-bottom-6 mhb-right-6 mhb-z-50 mhb-flex mhb-max-w-xs mhb-items-center mhb-space-x-4 mhb-divide-x mhb-divide-gray-200 mhb-rounded-lg mhb-border mhb-bg-white mhb-p-4 mhb-text-gray-700 mhb-shadow-lg dark:mhb-divide-gray-700 dark:mhb-border-gray-600 dark:mhb-bg-gray-800 dark:mhb-text-gray-300",role:"alert",children:[g.jsx("svg",{className:"mhb-text-red-60 mhb-h-3 mhb-w-3","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 14 14",children:g.jsx("path",{stroke:"currentColor",d:"m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"})}),g.jsx("div",{className:"mhb-text-red-60 mhb-typography-label-thick-30 mhb-ps-4",children:e})]}),Mm=N.memo(({url:e,msg:t,isFirstInGroup:n,fileType:r})=>{const[o,s]=N.useState(!1),i=async()=>{const a=t.attachments[0],l=await(await fetch(a.url)).blob(),u=URL.createObjectURL(l),d=document.createElement("a");d.href=u,d.download=a.filename||"download.pdf",d.click(),URL.revokeObjectURL(u)};return g.jsxs(g.Fragment,{children:[(r==="jpg"||r==="jpeg"||r==="png")&&g.jsx("div",{className:"mhb-flex",children:g.jsx("div",{className:`mhb-rounded-[16px] mhb-bg-white ${t?.user?.user_type==="customer"?"mhb-ml-auto":"mhb-mr-auto"} ${n?t?.user?.user_type==="customer"?"mhb-rounded-tr-[4px]":"mhb-rounded-tl-[4px]":""}`,children:g.jsx("div",{className:"mhb-overflow-x-auto mhb-rounded-[16px] mhb-bg-neutral-10 mhb-px-1 mhb-py-1",children:g.jsx("div",{className:"mhb-flex mhb-w-fit mhb-space-x-1",children:g.jsx("div",{className:"mhb-h-[44px] mhb-w-[44px] mhb-flex-shrink-0 mhb-rounded-[12px] mhb-bg-white",children:g.jsx("img",{src:e,alt:"Attachment",className:"mhb-h-[44px] mhb-w-[44px] mhb-rounded-[12px] mhb-object-cover",onClick:()=>s(!0)})})})})})}),r==="pdf"&&g.jsxs("button",{className:"mhb-flex mhb-w-full mhb-items-center mhb-justify-between mhb-gap-3 mhb-rounded-[20px] mhb-mhb-border mhb-border-neutral-10 mhb-bg-white p-3 focus:mhb-outline-none",onClick:()=>i(),children:[g.jsx("div",{className:"mhb-relative mhb-flex mhb-h-[36px] mhb-w-[36px] mhb-items-center mhb-justify-center mhb-rounded-[8px] mhb-bg-neutral-20",children:g.jsx("p",{className:"mhb-absolute mhb-text-white mhb-typography-para-40",children:"pdf"})}),g.jsx("p",{className:"mhb-max-w-[50px] mhb-overflow-hidden mhb-text-ellipsis mhb-whitespace-nowrap mhb-text-neutral-110 mhb-typography-para-thick-30",children:t.attachments[0].filename.split(/[/_]/).pop()})]})]})},(e,t)=>e.url===t.url&&e.isFirstInGroup===t.isFirstInGroup&&e.msg.user?.user_type===t.msg.user?.user_type&&e.fileType===t.fileType),jo=["image/jpeg","image/jpg","image/png","application/pdf"],Fm=()=>{const[e,t]=N.useState(""),n=N.useRef(null),r=N.useRef(null),o=N.useRef(null),s=N.useRef(0),i=N.useRef(0),a=N.useRef(!1),{historyData:c,sendMessage:l,getNextPageData:u,isLoadingMore:d,isSending:m,upload:v,msgLoading:p,hasMore:h}=Om();N.useLayoutEffect(()=>{const x=n.current;if(x)if(a.current){const E=s.current,S=i.current,F=x.scrollHeight-E;x.scrollTop=S+F,a.current=!1}else x.scrollTop=x.scrollHeight},[c?.length]);const b=()=>{const x=r.current?.value?.trim();h||(a.current=!1),x&&(l(x),r.current&&(r.current.value=""))},y=x=>{m||x.key==="Enter"&&(x.preventDefault(),b())},k=x=>{const E=x.currentTarget;if(E.scrollHeight>E.clientHeight&&E.scrollTop<=20&&!d){const P=c.length;s.current=E.scrollHeight,i.current=E.scrollTop,a.current=!0,u(P)}},C=x=>{const E=Array.from(x.target.files||[]),S=E.filter(L=>jo.includes(L.type));if(E.filter(L=>!jo.includes(L.type)).length>0){t("Only JPG, PNG, and PDF files are allowed. Other files like videos are not supported."),setTimeout(()=>t(null),3e3),x.target.value="";return}const F=c[c?.length-1]?.ticket_id;S.length>0&&F&&v({files:S,signature_type:"upload",ticketId:F})},A=()=>{o.current?.click()},R=N.useMemo(()=>c?.some(x=>x.handover==!0),[c]);return g.jsxs("div",{className:"mhb-flex mhb-h-full mhb-flex-col mhb-overflow-hidden mhb-bg-white",children:[g.jsx(g.Fragment,{children:p?g.jsx("div",{className:"mhb-py-3",children:g.jsx(sr,{})}):g.jsxs(g.Fragment,{children:[g.jsx("div",{ref:n,className:"mhb-flex-grow mhb-overflow-y-auto mhb-py-3 [&>*]:[mhb-overflow-anchor:none]",onScroll:k,children:g.jsx("div",{className:"mhb-flex mhb-min-h-full mhb-flex-col mhb-justify-end mhb-gap-1",children:c?.map((x,E)=>{const S="user"in x&&E===0||c[E-1]?.user?.user_type!==x?.user?.user_type,P=new Date(x.created_at??""),F=E>0?new Date(c[E-1].created_at??""):null,L=!F||P.getDate()!==F.getDate()||P.getMonth()!==F.getMonth()||P.getFullYear()!==F.getFullYear(),V=F&&P.getTime()-F.getTime()>120*1e3,B=x.hasOwnProperty("user")&&(S||L||V),j=x?.attachments?.some(W=>{const D=W.filename.match(/\.([a-zA-Z0-9]+)(?:\?|$)/)?.[1]?.toLowerCase();return["jpg","jpeg","png"].includes(D||"")});return g.jsx("div",{className:`mhb-flex ${x.user.user_type==="bot"||x.user.user_type==="agent"?"mhb-justify-start":"mhb-justify-end"}`,children:g.jsxs("div",{className:"mhb-max-w-[75%]",children:[B&&g.jsx("div",{className:`mhb-mb-1 mhb-flex mhb-items-center ${x.user.user_type==="bot"||x.user.user_type==="agent"?"mhb-justify-start":"mhb-justify-end"}`,children:x.user.user_type==="bot"?g.jsxs("div",{className:"mhb-flex mhb-gap-2 mhb-items-center",children:[g.jsxs("div",{className:"mhb-flex mhb-items-center mhb-gap-1",children:[g.jsx(mm,{}),g.jsx("div",{className:"mhb-mb-1",children:g.jsx(pm,{})})]}),g.jsxs("div",{className:"mhb-flex mhb-gap-1 mhb-mt-[2px] mhb-items-center",children:[g.jsx("div",{className:"mhb-h-[2px] mhb-w-[2px] mhb-rounded-full mhb-bg-neutral-60"}),g.jsx("p",{className:"mhb-typography-para-40 mhb-text-neutral-60",children:zn(x.created_at)})]})]}):x.user.user_type==="employee"?g.jsxs("div",{className:"mhb-flex mhb-gap-2 mhb-items-center",children:[g.jsxs("div",{className:"mhb-flex mhb-gap-1",children:[g.jsx("p",{className:"mhb-typography-para-40 mhb-text-neutral-60",children:zn(x.created_at)}),g.jsx("div",{className:"mhb-h-[2px] mhb-w-[2px] mhb-rounded-full mhb-bg-neutral-60 mhb-flex mhb-self-center"})]}),g.jsx(To,{name:x?.user?.user_name||"",employeeId:"",className:"mhb-size-4 mhb-shrink-0 mhb-rounded-full mhb-select-none"})]}):x.user.user_type==="agent"?g.jsxs("div",{className:"mhb-flex mhb-gap-2 mhb-items-center",children:[g.jsx(To,{name:x?.user?.user_name||"",employeeId:"",className:"mhb-size-4 mhb-shrink-0 mhb-rounded-full mhb-select-none"}),g.jsxs("div",{className:"mhb-flex mhb-gap-1 mhb-mt-1 mhb-items-center",children:[g.jsx("div",{className:"mhb-h-[2px] mhb-w-[2px] mhb-rounded-full mhb-bg-neutral-60"}),g.jsx("p",{className:"mhb-typography-para-40 mhb-text-neutral-60",children:zn(x.created_at)})]})]}):null}),g.jsx("div",{className:"mhb-flex mhb-overflow-hidden mhb-min-w-0",children:Array.isArray(x?.attachments)&&x?.attachments?.length>0?g.jsx("div",{className:`mhb-p-1 mhb-rounded-[16px] ${x.user.user_type==="bot"||x.user.user_type==="agent"?`mhb-bg-orange-60 ${B?"mhb-rounded-tl-[4px]":"mhb-rounded-[20px]"}`:`mhb-bg-neutral-10 ${B?"mhb-rounded-tr-[4px]":"mhb-rounded-[20px]"}`} ${j?"mhb-overflow-x-auto mhb-flex":"mhb-flex mhb-flex-col mhb-gap-1"}`,children:x.attachments.map((W,D)=>g.jsx("div",{children:g.jsx(Mm,{url:W.url,msg:x,isFirstInGroup:!1,fileType:W?.filename.match(/\.([a-zA-Z0-9]+)(?:\?|$)/)?.[1]?.toLowerCase()||""})},D))}):g.jsx("p",{className:`mhb-whitespace-pre-line mhb-break-words mhb-rounded-[16px] mhb-p-3
173
- mhb-typography-para-30 mhb-ml-auto ${x.user.user_type==="bot"||x.user.user_type==="agent"?`mhb-bg-orange-60 mhb-text-white ${B?"mhb-rounded-tl-[4px]":"mhb-rounded-[20px]"} `:`mhb-bg-neutral-10 mhb-text-neutral-110 ${B?"mhb-rounded-tr-[4px]":"mhb-rounded-[20px]"} `}
174
- `,children:x?.text})})]})},x.message_id)})})}),g.jsx("div",{className:"mhb-chat-input-container mhb-sticky mhb-bottom-0 mhb-bg-white mhb-py-3 mhb-flex mhb-items-center mhb-gap-2",children:g.jsxs("div",{className:"mhb-bg-neutral-10 mhb-flex mhb-h-[80px] mhb-flex-1 mhb-rounded-xl mhb-p-3",children:[g.jsx("div",{className:"mhb-flex mhb-flex-1",children:g.jsx("textarea",{ref:r,placeholder:"Type your message here...",className:"mhb-btn-reset mhb-textarea mhb-flex-grow mhb-text-neutral-70 mhb-caret-orange-70 mhb-typography-para-30 mhb-bg-transparent mhb-resize-none placeholder:mhb-text-neutral-40",onKeyDown:y})}),g.jsxs("div",{className:"mhb-flex mhb-gap-1 mhb-justify-end mhb-items-end",children:[R&&g.jsxs("button",{type:"button",className:"mhb-btn-reset mhb-h-[36px] mhb-w-[36px] mhb-rounded-full mhb-bg-neutral-100 mhb-flex mhb-items-center mhb-justify-center mhb-outline-none",disabled:m,onClick:A,children:[g.jsx(fm,{className:"h-[16px] w-[16px] mhb-fill-current"}),g.jsx("input",{type:"file",multiple:!0,accept:".jpg,.jpeg,.png,.pdf",ref:o,onChange:C,className:"hidden"})]}),g.jsx("button",{type:"button",className:"mhb-btn-reset mhb-h-[36px] mhb-rounded-[9999px] mhb-bg-orange-60 mhb-flex mhb-p-3 mhb-items-center mhb-justify-center mhb-shadow-[0_4px_12px_0_rgba(250,75,22,0.50)] mhb-outline-none",disabled:m,onClick:b,children:g.jsx("p",{className:"mhb-typography-label-thick-30 mhb-text-white",children:"Send"})})]})]})})]})}),e&&g.jsx(Tm,{toastMsg:e})]})};function Nm({side:e="top",align:t="end"}){const{authorized:n,isChatScreen:r,setIsChatScreen:o,accessToken:s,setProfileInfo:i}=_t(),a=async()=>{const c=await an.getProfileDetails();i(c)};return N.useEffect(()=>{s&&a()},[]),g.jsx("div",{className:"mhb-root",children:g.jsx(hm,{side:e,align:t,children:g.jsxs("div",{className:"mhb-h-full mhb-w-full mhb-flex mhb-flex-col mhb-min-h-0",children:[g.jsx(km,{isChatScreen:r,setIsChatScreen:o}),r?g.jsx(Fm,{}):g.jsx(Am,{})]})})})}function Dm(e){const{apiKey:t,accessToken:n}=e;if(!t||!n)throw new Error("Missing parameters: apiKey, and accessToken are required")}let lr=null,ln=!1,Yt=[];function Im(){for(const e of Yt)e()}function jm(e){ln||(Dm(e),an.init({env:e.env,redirectUrl:e.redirectUrl,app:e.app,idp:e.idp}),lr=e,ln=!0,Im(),Cm({apiKey:e.apiKey,apiURL:e.apiURL}))}function Lm(e){const[t,n]=N.useState({initialized:ln,sdkOptions:lr});return N.useEffect(()=>{const r=()=>{n({initialized:ln,sdkOptions:lr})};return Yt.push(r),()=>{Yt=Yt.filter(o=>o!==r)}},[]),!t.initialized||!t.sdkOptions?null:g.jsx(Gp,{appName:t.sdkOptions.app,apiKey:t.sdkOptions.apiKey,token:t.sdkOptions.accessToken,children:g.jsx(Nm,{...e})})}exports.ChatButton=Lm;exports.init=jm;
127
+ }`,J=10,Ue=()=>{const[e,s]=i.useState([]),[r,a]=i.useState(!0),[c,h]=i.useState(null),[u,b]=i.useState(!1),[p,o]=i.useState(!1),[w,_]=i.useState(!0),{accessToken:k,profileInfo:m}=$(),g=D("userAndTicket")?.ticket_id,j=D("userAndTicket")?.employee_id,T=i.useMemo(()=>e.find(f=>f.ticket_id!=null)?.ticket_id??null,[e]);let E=g??T??null;return i.useEffect(()=>{if(!E||!m)return;if(j&&m?.employee_id!=j){sessionStorage.removeItem("userAndTicket");return}const f=De(Ze,{ticket_id:E},n=>{const d=n;d?.onAssistChat?.user?.user_type==="agent"&&s(x=>[...x,d.onAssistChat])});return()=>f()},[E,m]),i.useEffect(()=>{if(!k||!m)return;j&&m?.employee_id!==j&&(sessionStorage.removeItem("userAndTicket"),E=null);const f={...E&&{ticket_id:E},limit:J};U(ie,f,k).then(async n=>{s(n?.assistHistory??[])}).catch(n=>{h(n)}).finally(()=>{a(!1)})},[m]),{historyData:e,msgLoading:r,msgError:c,isSending:p,sendMessage:f=>{const n=e.find(y=>y.ticket_id!=null)?.ticket_id??null,d=e.find(y=>y.handover==!0)?.handover??!1,x={...n&&{ticket_id:n},message:f,handover:d,attachments:[],text:f,message_id:Math.random(),created_at:new Date().toISOString(),user:{user_name:m?.full_name,user_type:"employee"}};o(!0),s(y=>[...y,x]),K(ce,x,k).then(async y=>{const C=y;C.assistChat.user.user_type!=="employee"&&s(N=>[...N,C.assistChat]),!D("userAndTicket")&&C.assistChat?.ticket_id&&m&&X("userAndTicket",{ticket_id:C.assistChat?.ticket_id,employee_id:m.employee_id})}).catch(()=>s(y=>y.slice(0,-1))).finally(()=>o(!1))},getNextPageData:f=>{if(!k||u)return;const n=D("userAndTicket")?.ticket_id,d={...n&&{ticket_id:n},limit:J,offset:f};b(!0),U(ie,d,k).then(async x=>{const C=x?.assistHistory??[];s(N=>[...C,...N]),C.length<J&&_(!1)}).catch(x=>{h(x)}).finally(()=>{b(!1)})},isLoadingMore:u,upload:async f=>{o(!0);const n={files:f.files.map(d=>`${f.ticketId}/${d.name}`),signature_type:f.signature_type};try{const d=await K(Fe,n,k);for(const[v,A]of f.files.entries()){const I=d.GetPresignedLink[v]?.url;I&&await fetch(I,{method:"PUT",body:A,headers:{"Content-Type":A.type}})}const x=e.find(v=>v.handover)?.handover??!1,y=f.files.map(v=>({url:URL.createObjectURL(v),filename:v.name})),C={ticket_id:f.ticketId,handover:x,attachments:y,text:"",message_id:Math.random(),created_at:new Date().toISOString(),user:{user_name:m?.full_name,user_type:"employee"}};s(v=>[...v,C]);const N={ticket_id:f.ticketId,handover:x,attachments:f.files.map(v=>`${f.ticketId}/${v.name}`),message:"",text:"",message_id:Math.random(),created_at:new Date().toISOString(),user:{user_name:m?.full_name,user_type:"employee"}},H=await K(ce,N,k);H.assistChat.user.user_type!=="employee"&&s(v=>[...v,H.assistChat]),!D("userAndTicket")&&H.assistChat?.ticket_id&&m&&X("userAndTicket",{ticket_id:H.assistChat.ticket_id,employee_id:m.employee_id})}catch{s(x=>x.slice(0,-1))}finally{o(!1)}},hasMore:w}},Be=({toastMsg:e})=>t.jsxs("div",{id:"toast-simple",className:"mhb-border-red-60 mhb-fixed mhb-bottom-6 mhb-right-6 mhb-z-50 mhb-flex mhb-max-w-xs mhb-items-center mhb-space-x-4 mhb-divide-x mhb-divide-gray-200 mhb-rounded-lg mhb-border mhb-bg-white mhb-p-4 mhb-text-gray-700 mhb-shadow-lg dark:mhb-divide-gray-700 dark:mhb-border-gray-600 dark:mhb-bg-gray-800 dark:mhb-text-gray-300",role:"alert",children:[t.jsx("svg",{className:"mhb-text-red-60 mhb-h-3 mhb-w-3","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 14 14",children:t.jsx("path",{stroke:"currentColor",d:"m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"})}),t.jsx("div",{className:"mhb-text-red-60 mhb-typography-label-thick-30 mhb-ps-4",children:e})]}),ze=i.memo(({url:e,msg:s,isFirstInGroup:r,fileType:a})=>{const[c,h]=i.useState(!1),u=async()=>{const b=s.attachments[0],o=await(await fetch(b.url)).blob(),w=URL.createObjectURL(o),_=document.createElement("a");_.href=w,_.download=b.filename||"download.pdf",_.click(),URL.revokeObjectURL(w)};return t.jsxs(t.Fragment,{children:[(a==="jpg"||a==="jpeg"||a==="png")&&t.jsx("div",{className:"mhb-flex",children:t.jsx("div",{className:`mhb-rounded-[16px] mhb-bg-white ${s?.user?.user_type==="customer"?"mhb-ml-auto":"mhb-mr-auto"} ${r?s?.user?.user_type==="customer"?"mhb-rounded-tr-[4px]":"mhb-rounded-tl-[4px]":""}`,children:t.jsx("div",{className:"mhb-overflow-x-auto mhb-rounded-[16px] mhb-bg-neutral-10 mhb-px-1 mhb-py-1",children:t.jsx("div",{className:"mhb-flex mhb-w-fit mhb-space-x-1",children:t.jsx("div",{className:"mhb-h-[44px] mhb-w-[44px] mhb-flex-shrink-0 mhb-rounded-[12px] mhb-bg-white",children:t.jsx("img",{src:e,alt:"Attachment",className:"mhb-h-[44px] mhb-w-[44px] mhb-rounded-[12px] mhb-object-cover",onClick:()=>h(!0)})})})})})}),a==="pdf"&&t.jsxs("button",{className:"mhb-flex mhb-w-full mhb-items-center mhb-justify-between mhb-gap-3 mhb-rounded-[20px] mhb-mhb-border mhb-border-neutral-10 mhb-bg-white p-3 focus:mhb-outline-none",onClick:()=>u(),children:[t.jsx("div",{className:"mhb-relative mhb-flex mhb-h-[36px] mhb-w-[36px] mhb-items-center mhb-justify-center mhb-rounded-[8px] mhb-bg-neutral-20",children:t.jsx("p",{className:"mhb-absolute mhb-text-white mhb-typography-para-40",children:"pdf"})}),t.jsx("p",{className:"mhb-max-w-[50px] mhb-overflow-hidden mhb-text-ellipsis mhb-whitespace-nowrap mhb-text-neutral-110 mhb-typography-para-thick-30",children:s.attachments[0].filename.split(/[/_]/).pop()})]})]})},(e,s)=>e.url===s.url&&e.isFirstInGroup===s.isFirstInGroup&&e.msg.user?.user_type===s.msg.user?.user_type&&e.fileType===s.fileType),he=["image/jpeg","image/jpg","image/png","application/pdf"],Ge=()=>{const[e,s]=i.useState(""),r=i.useRef(null),a=i.useRef(null),c=i.useRef(null),h=i.useRef(0),u=i.useRef(0),b=i.useRef(!1),{historyData:p,sendMessage:o,getNextPageData:w,isLoadingMore:_,isSending:k,upload:m,msgLoading:g,hasMore:j}=Ue();i.useLayoutEffect(()=>{const n=r.current;if(n)if(b.current){const d=h.current,x=u.current,C=n.scrollHeight-d;n.scrollTop=x+C,b.current=!1}else n.scrollTop=n.scrollHeight},[p?.length]);const T=()=>{const n=a.current?.value?.trim();j||(b.current=!1),n&&(o(n),a.current&&(a.current.value=""))},E=n=>{k||n.key==="Enter"&&(n.preventDefault(),T())},te=n=>{const d=n.currentTarget;if(d.scrollHeight>d.clientHeight&&d.scrollTop<=20&&!_){const y=p.length;h.current=d.scrollHeight,u.current=d.scrollTop,b.current=!0,w(y)}},se=n=>{const d=Array.from(n.target.files||[]),x=d.filter(N=>he.includes(N.type));if(d.filter(N=>!he.includes(N.type)).length>0){s("Only JPG, PNG, and PDF files are allowed. Other files like videos are not supported."),setTimeout(()=>s(null),3e3),n.target.value="";return}const C=p[p?.length-1]?.ticket_id;x.length>0&&C&&m({files:x,signature_type:"upload",ticketId:C})},ne=()=>{c.current?.click()},f=i.useMemo(()=>p?.some(n=>n.handover==!0),[p]);return console.log(p,"historyData"),t.jsxs("div",{className:"mhb-flex mhb-h-full mhb-flex-col mhb-overflow-hidden mhb-bg-white",children:[t.jsx(t.Fragment,{children:g?t.jsx("div",{className:"mhb-py-3",children:t.jsx(W,{})}):t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:r,className:"mhb-flex-grow mhb-overflow-y-auto mhb-py-3 [&>*]:[mhb-overflow-anchor:none]",onScroll:te,children:t.jsx("div",{className:"mhb-flex mhb-min-h-full mhb-flex-col mhb-justify-end mhb-gap-1",children:p?.map((n,d)=>{const x="user"in n&&d===0||p[d-1]?.user?.user_type!==n?.user?.user_type,y=new Date(n.created_at??""),C=d>0?new Date(p[d-1].created_at??""):null,N=!C||y.getDate()!==C.getDate()||y.getMonth()!==C.getMonth()||y.getFullYear()!==C.getFullYear(),re=C&&y.getTime()-C.getTime()>120*1e3,H=n.hasOwnProperty("user")&&(x||N||re),v=n?.attachments?.some(A=>{const I=A.filename.match(/\.([a-zA-Z0-9]+)(?:\?|$)/)?.[1]?.toLowerCase();return["jpg","jpeg","png"].includes(I||"")});return t.jsx("div",{className:`mhb-flex ${n.user.user_type==="bot"||n.user.user_type==="agent"?"mhb-justify-start":"mhb-justify-end"}`,children:t.jsxs("div",{className:"mhb-max-w-[75%",children:[H&&t.jsx("div",{className:`mhb-mb-1 mhb-flex mhb-items-center ${n.user.user_type==="bot"||n.user.user_type==="agent"?"mhb-justify-start":"mhb-justify-end"}`,children:n.user.user_type==="bot"?t.jsxs("div",{className:"mhb-flex mhb-gap-2 mhb-items-center",children:[t.jsxs("div",{className:"mhb-flex mhb-items-center mhb-gap-1",children:[t.jsx(Ne,{}),t.jsx("div",{className:"mhb-mb-1",children:t.jsx(Se,{})})]}),t.jsxs("div",{className:"mhb-flex mhb-gap-1 mhb-mt-[2px] mhb-items-center",children:[t.jsx("div",{className:"mhb-h-[2px] mhb-w-[2px] mhb-rounded-full mhb-bg-neutral-60"}),t.jsx("p",{className:"mhb-typography-para-40 mhb-text-neutral-60",children:q(n.created_at)})]})]}):n.user.user_type==="employee"?t.jsxs("div",{className:"mhb-flex mhb-gap-2 mhb-items-center",children:[t.jsxs("div",{className:"mhb-flex mhb-gap-1",children:[t.jsx("p",{className:"mhb-typography-para-40 mhb-text-neutral-60",children:q(n.created_at)}),t.jsx("div",{className:"mhb-h-[2px] mhb-w-[2px] mhb-rounded-full mhb-bg-neutral-60 mhb-flex mhb-self-center"})]}),t.jsx(V.Avatar,{name:n?.user?.user_name||"",employeeId:"",className:"mhb-size-4 mhb-shrink-0 mhb-rounded-full mhb-select-none"})]}):n.user.user_type==="agent"?t.jsxs("div",{className:"mhb-flex mhb-gap-2 mhb-items-center",children:[t.jsx(V.Avatar,{name:n?.user?.user_name||"",employeeId:"",className:"mhb-size-4 mhb-shrink-0 mhb-rounded-full mhb-select-none"}),t.jsxs("div",{className:"mhb-flex mhb-gap-1 mhb-mt-1 mhb-items-center",children:[t.jsx("div",{className:"mhb-h-[2px] mhb-w-[2px] mhb-rounded-full mhb-bg-neutral-60"}),t.jsx("p",{className:"mhb-typography-para-40 mhb-text-neutral-60",children:q(n.created_at)})]})]}):null}),t.jsx("div",{className:"mhb-flex mhb-overflow-hidden mhb-min-w-0",children:Array.isArray(n?.attachments)&&n?.attachments?.length>0?t.jsx("div",{className:`mhb-p-1 mhb-rounded-[16px] ${n.user.user_type==="bot"||n.user.user_type==="agent"?`mhb-bg-orange-60 ${H?"mhb-rounded-tl-[4px]":"mhb-rounded-[20px]"}`:`mhb-bg-neutral-10 ${H?"mhb-rounded-tr-[4px]":"mhb-rounded-[20px]"}`} ${v?"mhb-overflow-x-auto mhb-flex":"mhb-flex mhb-flex-col mhb-gap-1"}`,children:n.attachments.map((A,I)=>t.jsx("div",{children:t.jsx(ze,{url:A.url,msg:n,isFirstInGroup:!1,fileType:A?.filename.match(/\.([a-zA-Z0-9]+)(?:\?|$)/)?.[1]?.toLowerCase()||""})},I))}):t.jsx("p",{className:`mhb-whitespace-pre-line mhb-break-words mhb-rounded-[16px] mhb-p-3
128
+ mhb-typography-para-30 ${n.user.user_type==="bot"||n.user.user_type==="agent"?`mhb-bg-orange-60 mhb-text-white ${H?"mhb-rounded-tl-[4px]":"mhb-rounded-[20px]"} `:`mhb-bg-neutral-10 mhb-text-neutral-110 mhb-ml-auto ${H?"mhb-rounded-tr-[4px]":"mhb-rounded-[20px]"} `}
129
+ `,children:n?.text})})]})},n.message_id)})})}),t.jsx("div",{className:"mhb-chat-input-container mhb-sticky mhb-bottom-0 mhb-bg-white mhb-py-3 mhb-flex mhb-items-center mhb-gap-2",children:t.jsxs("div",{className:"mhb-bg-neutral-10 mhb-flex mhb-h-[80px] mhb-flex-1 mhb-rounded-xl mhb-p-3",children:[t.jsx("div",{className:"mhb-flex mhb-flex-1",children:t.jsx("textarea",{ref:a,placeholder:"Type your message here...",className:"mhb-btn-reset mhb-textarea mhb-flex-grow mhb-text-neutral-70 mhb-caret-orange-70 mhb-typography-para-30 mhb-bg-transparent mhb-resize-none placeholder:mhb-text-neutral-40",onKeyDown:E})}),t.jsxs("div",{className:"mhb-flex mhb-gap-1 mhb-justify-end mhb-items-end",children:[f&&t.jsxs("button",{type:"button",className:"mhb-btn-reset mhb-h-[36px] mhb-w-[36px] mhb-rounded-full mhb-bg-neutral-100 mhb-flex mhb-items-center mhb-justify-center mhb-outline-none",disabled:k,onClick:ne,children:[t.jsx(je,{className:"h-[16px] w-[16px] mhb-fill-current"}),t.jsx("input",{type:"file",accept:".jpg,.jpeg,.png,.pdf",ref:c,onChange:se,className:"hidden"})]}),t.jsx("button",{type:"button",className:"mhb-btn-reset mhb-h-[36px] mhb-rounded-[9999px] mhb-bg-orange-60 mhb-flex mhb-p-3 mhb-items-center mhb-justify-center mhb-shadow-[0_4px_12px_0_rgba(250,75,22,0.50)] mhb-outline-none",disabled:k,onClick:T,children:t.jsx("p",{className:"mhb-typography-label-thick-30 mhb-text-white",children:"Send"})})]})]})})]})}),e&&t.jsx(Be,{toastMsg:e})]})};function Ke({side:e="top",align:s="end"}){const{authorized:r,isChatScreen:a,setIsChatScreen:c,accessToken:h,setProfileInfo:u}=$(),b=async()=>{const p=await V.SSOAuthorization.getProfileDetails();u(p)};return i.useEffect(()=>{h&&b()},[]),t.jsx("div",{className:"mhb-root",children:t.jsx(Te,{side:e,align:s,children:t.jsxs("div",{className:"mhb-h-full mhb-w-full mhb-flex mhb-flex-col mhb-min-h-0",children:[t.jsx(Pe,{isChatScreen:a,setIsChatScreen:c}),a?t.jsx(Ge,{}):t.jsx(Oe,{})]})})})}function qe(e){const{apiKey:s,accessToken:r}=e;if(!s||!r)throw new Error("Missing parameters: apiKey, and accessToken are required")}let ee=null,B=!1,Z=[];function Je(){for(const e of Z)e()}function We(e){B||(qe(e),V.SSOAuthorization.init({env:e.env,redirectUrl:e.redirectUrl,app:e.app,idp:e.idp}),ee=e,B=!0,Je(),Ve({apiKey:e.apiKey,apiURL:e.apiURL}))}function Ye(e){const[s,r]=i.useState({initialized:B,sdkOptions:ee});return i.useEffect(()=>{const a=()=>{r({initialized:B,sdkOptions:ee})};return Z.push(a),()=>{Z=Z.filter(c=>c!==a)}},[]),!s.initialized||!s.sdkOptions?null:t.jsx(ye,{appName:s.sdkOptions.app,apiKey:s.sdkOptions.apiKey,token:s.sdkOptions.accessToken,children:t.jsx(Ke,{...e})})}exports.ChatButton=Ye;exports.init=We;
175
130
  //# sourceMappingURL=index.cjs.map