@hiver/connector-agent 4.9.0-oneClickGen-beta.9 → 4.9.0-oneClickGen-beta.10

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/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(de,I){typeof exports=="object"&&typeof module<"u"?I(exports,require("react"),require("react-dom"),require("@hiver/hiver-ui-kit")):typeof define=="function"&&define.amd?define(["exports","react","react-dom","@hiver/hiver-ui-kit"],I):(de=typeof globalThis<"u"?globalThis:de||self,I(de["@hiver/connector-agent"]={},de.React,de.ReactDOM,de.hiverUiKit))})(this,function(de,I,je,u){"use strict";var KA=Object.defineProperty;var I2=de=>{throw TypeError(de)};var eL=(de,I,je)=>I in de?KA(de,I,{enumerable:!0,configurable:!0,writable:!0,value:je}):de[I]=je;var Re=(de,I,je)=>eL(de,typeof I!="symbol"?I+"":I,je),Il=(de,I,je)=>I.has(de)||I2("Cannot "+je);var F=(de,I,je)=>(Il(de,I,"read from private field"),je?je.call(de):I.get(de)),ue=(de,I,je)=>I.has(de)?I2("Cannot add the same private member more than once"):I instanceof WeakSet?I.add(de):I.set(de,je),K=(de,I,je,u)=>(Il(de,I,"write to private field"),u?u.call(de,je):I.set(de,je),je),be=(de,I,je)=>(Il(de,I,"access private method"),je);var Xa=(de,I,je,u)=>({set _(Ya){K(de,I,Ya,je)},get _(){return F(de,I,u)}});var wr,Hn,co,h2,lo,Wn,uo,g2,Ir,m2,fo,po,Bt,_r,lt,as,Sr,tn,kn,b2,dn,y2,fn,dt,Tr,pn,nr,C2,_n,nn,is,x2,ze,Zn,Xn,ho,go,zn,mo,bo,E2,wt,we,cs,ft,Ar,yo,Yn,hn,ls,Co,xo,Lr,Or,Jn,Eo,Ne,ds,_l,Sl,Tl,Al,Ll,Ol,Fl,_2,v2,qn,Qn,It,Sn,Tn,za,kl,w2;function Ya(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 A=Ya(I);var ge=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ja={exports:{}},Ao={};/**
1
+ (function(de,I){typeof exports=="object"&&typeof module<"u"?I(exports,require("react"),require("react-dom"),require("@hiver/hiver-ui-kit")):typeof define=="function"&&define.amd?define(["exports","react","react-dom","@hiver/hiver-ui-kit"],I):(de=typeof globalThis<"u"?globalThis:de||self,I(de["@hiver/connector-agent"]={},de.React,de.ReactDOM,de.hiverUiKit))})(this,function(de,I,je,u){"use strict";var eL=Object.defineProperty;var I2=de=>{throw TypeError(de)};var tL=(de,I,je)=>I in de?eL(de,I,{enumerable:!0,configurable:!0,writable:!0,value:je}):de[I]=je;var Re=(de,I,je)=>tL(de,typeof I!="symbol"?I+"":I,je),Il=(de,I,je)=>I.has(de)||I2("Cannot "+je);var F=(de,I,je)=>(Il(de,I,"read from private field"),je?je.call(de):I.get(de)),ue=(de,I,je)=>I.has(de)?I2("Cannot add the same private member more than once"):I instanceof WeakSet?I.add(de):I.set(de,je),K=(de,I,je,u)=>(Il(de,I,"write to private field"),u?u.call(de,je):I.set(de,je),je),be=(de,I,je)=>(Il(de,I,"access private method"),je);var Xa=(de,I,je,u)=>({set _(Ya){K(de,I,Ya,je)},get _(){return F(de,I,u)}});var wr,Hn,co,h2,lo,Wn,uo,g2,Ir,m2,fo,po,Bt,_r,lt,as,Sr,tn,kn,b2,dn,y2,fn,dt,Tr,pn,nr,C2,_n,nn,is,x2,ze,Zn,Xn,ho,go,zn,mo,bo,E2,wt,we,cs,ft,Ar,yo,Yn,hn,ls,Co,xo,Lr,Or,Jn,Eo,Ne,ds,_l,Sl,Tl,Al,Ll,Ol,Fl,_2,v2,qn,Qn,It,Sn,Tn,za,kl,w2;function Ya(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 A=Ya(I);var ge=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ja={exports:{}},Ao={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -22,12 +22,12 @@
22
22
 
23
23
  Check the render method of \``+O+"`."}return""}}function us(O){return""}var So={};function To(O){{var Z=Pr();if(!Z){var $=typeof O=="string"?O:O.displayName||O.name;$&&(Z=`
24
24
 
25
- Check the top-level render call using <`+$+">.")}return Z}}function er(O,Z){{if(!O._store||O._store.validated||O.key!=null)return;O._store.validated=!0;var $=To(Z);if(So[$])return;So[$]=!0;var le="";O&&O._owner&&O._owner!==On.current&&(le=" It was passed a child from "+M(O._owner.type)+"."),bn(O),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',$,le),bn(null)}}function tr(O,Z){{if(typeof O!="object")return;if(_t(O))for(var $=0;$<O.length;$++){var le=O[$];Mr(le)&&er(le,Z)}else if(Mr(O))O._store&&(O._store.validated=!0);else if(O){var Ce=h(O);if(typeof Ce=="function"&&Ce!==O.entries)for(var Me=Ce.call(O),Ee;!(Ee=Me.next()).done;)Mr(Ee.value)&&er(Ee.value,Z)}}}function ae(O){{var Z=O.type;if(Z==null||typeof Z=="string")return;var $;if(typeof Z=="function")$=Z.propTypes;else if(typeof Z=="object"&&(Z.$$typeof===c||Z.$$typeof===g))$=Z.propTypes;else return;if($){var le=M(Z);Qe($,O.props,"prop",le,O)}else if(Z.PropTypes!==void 0&&!Rr){Rr=!0;var Ce=M(Z);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Ce||"Unknown")}typeof Z.getDefaultProps=="function"&&!Z.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function _e(O){{for(var Z=Object.keys(O.props),$=0;$<Z.length;$++){var le=Z[$];if(le!=="children"&&le!=="key"){bn(O),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",le),bn(null);break}}O.ref!==null&&(bn(O),E("Invalid attribute `ref` supplied to `React.Fragment`."),bn(null))}}var $e={};function it(O,Z,$,le,Ce,Me){{var Ee=N(O);if(!Ee){var ye="";(O===void 0||typeof O=="object"&&O!==null&&Object.keys(O).length===0)&&(ye+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var rt=us();rt?ye+=rt:ye+=Pr();var oe;O===null?oe="null":_t(O)?oe="array":O!==void 0&&O.$$typeof===t?(oe="<"+(M(O.type)||"Unknown")+" />",ye=" Did you accidentally export a JSX literal instead of a component?"):oe=typeof O,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",oe,ye)}var he=_o(O,Z,$,Ce,Me);if(he==null)return he;if(Ee){var He=Z.children;if(He!==void 0)if(le)if(_t(He)){for(var Tt=0;Tt<He.length;Tt++)tr(He[Tt],O);Object.freeze&&Object.freeze(He)}else E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else tr(He,O)}if(nt.call(Z,"key")){var jr=M(O),At=Object.keys(Z).filter(function(UA){return UA!=="key"}),wl=At.length>0?"{key: someKey, "+At.join(": ..., ")+": ...}":"{key: someKey}";if(!$e[jr+wl]){var $A=At.length>0?"{"+At.join(": ..., ")+": ...}":"{}";E(`A props object containing a "key" prop is being spread into JSX:
25
+ Check the top-level render call using <`+$+">.")}return Z}}function er(O,Z){{if(!O._store||O._store.validated||O.key!=null)return;O._store.validated=!0;var $=To(Z);if(So[$])return;So[$]=!0;var le="";O&&O._owner&&O._owner!==On.current&&(le=" It was passed a child from "+M(O._owner.type)+"."),bn(O),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',$,le),bn(null)}}function tr(O,Z){{if(typeof O!="object")return;if(_t(O))for(var $=0;$<O.length;$++){var le=O[$];Mr(le)&&er(le,Z)}else if(Mr(O))O._store&&(O._store.validated=!0);else if(O){var Ce=h(O);if(typeof Ce=="function"&&Ce!==O.entries)for(var Me=Ce.call(O),Ee;!(Ee=Me.next()).done;)Mr(Ee.value)&&er(Ee.value,Z)}}}function ae(O){{var Z=O.type;if(Z==null||typeof Z=="string")return;var $;if(typeof Z=="function")$=Z.propTypes;else if(typeof Z=="object"&&(Z.$$typeof===c||Z.$$typeof===g))$=Z.propTypes;else return;if($){var le=M(Z);Qe($,O.props,"prop",le,O)}else if(Z.PropTypes!==void 0&&!Rr){Rr=!0;var Ce=M(Z);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Ce||"Unknown")}typeof Z.getDefaultProps=="function"&&!Z.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function _e(O){{for(var Z=Object.keys(O.props),$=0;$<Z.length;$++){var le=Z[$];if(le!=="children"&&le!=="key"){bn(O),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",le),bn(null);break}}O.ref!==null&&(bn(O),E("Invalid attribute `ref` supplied to `React.Fragment`."),bn(null))}}var $e={};function it(O,Z,$,le,Ce,Me){{var Ee=N(O);if(!Ee){var ye="";(O===void 0||typeof O=="object"&&O!==null&&Object.keys(O).length===0)&&(ye+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var rt=us();rt?ye+=rt:ye+=Pr();var oe;O===null?oe="null":_t(O)?oe="array":O!==void 0&&O.$$typeof===t?(oe="<"+(M(O.type)||"Unknown")+" />",ye=" Did you accidentally export a JSX literal instead of a component?"):oe=typeof O,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",oe,ye)}var he=_o(O,Z,$,Ce,Me);if(he==null)return he;if(Ee){var He=Z.children;if(He!==void 0)if(le)if(_t(He)){for(var Tt=0;Tt<He.length;Tt++)tr(He[Tt],O);Object.freeze&&Object.freeze(He)}else E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else tr(He,O)}if(nt.call(Z,"key")){var jr=M(O),At=Object.keys(Z).filter(function(KA){return KA!=="key"}),wl=At.length>0?"{key: someKey, "+At.join(": ..., ")+": ...}":"{key: someKey}";if(!$e[jr+wl]){var UA=At.length>0?"{"+At.join(": ..., ")+": ...}":"{}";E(`A props object containing a "key" prop is being spread into JSX:
26
26
  let props = %s;
27
27
  <%s {...props} />
28
28
  React keys must be passed directly to JSX without using spread:
29
29
  let props = %s;
30
- <%s key={someKey} {...props} />`,wl,jr,$A,jr),$e[jr+wl]=!0}}return O===r?_e(he):ae(he),he}}function St(O,Z,$){return it(O,Z,$,!0)}function yn(O,Z,$){return it(O,Z,$,!1)}var mt=yn,Fn=St;Lo.Fragment=r,Lo.jsx=mt,Lo.jsxs=Fn}()),Lo}process.env.NODE_ENV==="production"?Ja.exports=S2():Ja.exports=T2();var d=Ja.exports;function Rl(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=Rl(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Dn(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Rl(e))&&(r&&(r+=" "),r+=t);return r}const Oo=e=>typeof e=="number"&&!isNaN(e),rr=e=>typeof e=="string",Lt=e=>typeof e=="function",ps=e=>rr(e)||Lt(e)?e:null,qa=e=>I.isValidElement(e)||rr(e)||Lt(e)||Oo(e);function A2(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:o}=e;requestAnimationFrame(()=>{o.minHeight="initial",o.height=r+"px",o.transition=`all ${n}ms`,requestAnimationFrame(()=>{o.height="0",o.padding="0",o.margin="0",setTimeout(t,n)})})}function hs(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:o=!0,collapseDuration:s=300}=e;return function(a){let{children:i,position:c,preventExitTransition:l,done:f,nodeRef:g,isIn:y,playToast:x}=a;const b=r?`${t}--${c}`:t,p=r?`${n}--${c}`:n,h=I.useRef(0);return I.useLayoutEffect(()=>{const m=g.current,E=b.split(" "),C=w=>{w.target===g.current&&(x(),m.removeEventListener("animationend",C),m.removeEventListener("animationcancel",C),h.current===0&&w.type!=="animationcancel"&&m.classList.remove(...E))};m.classList.add(...E),m.addEventListener("animationend",C),m.addEventListener("animationcancel",C)},[]),I.useEffect(()=>{const m=g.current,E=()=>{m.removeEventListener("animationend",E),o?A2(m,f,s):f()};y||(l?E():(h.current=1,m.className+=` ${p}`,m.addEventListener("animationend",E)))},[y]),I.createElement(I.Fragment,null,i)}}function Ml(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const ut=new Map;let Fo=[];const Qa=new Set,L2=e=>Qa.forEach(t=>t(e)),Pl=()=>ut.size>0;function jl(e,t){var n;if(t)return!((n=ut.get(t))==null||!n.isToastActive(e));let r=!1;return ut.forEach(o=>{o.isToastActive(e)&&(r=!0)}),r}function Bl(e,t){qa(e)&&(Pl()||Fo.push({content:e,options:t}),ut.forEach(n=>{n.buildToast(e,t)}))}function Vl(e,t){ut.forEach(n=>{t!=null&&t!=null&&t.containerId?(t==null?void 0:t.containerId)===n.id&&n.toggle(e,t==null?void 0:t.id):n.toggle(e,t==null?void 0:t.id)})}function O2(e){const{subscribe:t,getSnapshot:n,setProps:r}=I.useRef(function(s){const a=s.containerId||1;return{subscribe(i){const c=function(f,g,y){let x=1,b=0,p=[],h=[],m=[],E=g;const C=new Map,w=new Set,v=()=>{m=Array.from(C.values()),w.forEach(S=>S())},_=S=>{h=S==null?[]:h.filter(L=>L!==S),v()},T=S=>{const{toastId:L,onOpen:N,updateId:k,children:D}=S.props,M=k==null;S.staleId&&C.delete(S.staleId),C.set(L,S),h=[...h,S.props.toastId].filter(j=>j!==S.staleId),v(),y(Ml(S,M?"added":"updated")),M&&Lt(N)&&N(I.isValidElement(D)&&D.props)};return{id:f,props:E,observe:S=>(w.add(S),()=>w.delete(S)),toggle:(S,L)=>{C.forEach(N=>{L!=null&&L!==N.props.toastId||Lt(N.toggle)&&N.toggle(S)})},removeToast:_,toasts:C,clearQueue:()=>{b-=p.length,p=[]},buildToast:(S,L)=>{if((V=>{let{containerId:R,toastId:G,updateId:W}=V;const U=R?R!==f:f!==1,Q=C.has(G)&&W==null;return U||Q})(L))return;const{toastId:N,updateId:k,data:D,staleId:M,delay:j}=L,J=()=>{_(N)},Y=k==null;Y&&b++;const z={...E,style:E.toastStyle,key:x++,...Object.fromEntries(Object.entries(L).filter(V=>{let[R,G]=V;return G!=null})),toastId:N,updateId:k,data:D,closeToast:J,isIn:!1,className:ps(L.className||E.toastClassName),bodyClassName:ps(L.bodyClassName||E.bodyClassName),progressClassName:ps(L.progressClassName||E.progressClassName),autoClose:!L.isLoading&&(H=L.autoClose,q=E.autoClose,H===!1||Oo(H)&&H>0?H:q),deleteToast(){const V=C.get(N),{onClose:R,children:G}=V.props;Lt(R)&&R(I.isValidElement(G)&&G.props),y(Ml(V,"removed")),C.delete(N),b--,b<0&&(b=0),p.length>0?T(p.shift()):v()}};var H,q;z.closeButton=E.closeButton,L.closeButton===!1||qa(L.closeButton)?z.closeButton=L.closeButton:L.closeButton===!0&&(z.closeButton=!qa(E.closeButton)||E.closeButton);let ne=S;I.isValidElement(S)&&!rr(S.type)?ne=I.cloneElement(S,{closeToast:J,toastProps:z,data:D}):Lt(S)&&(ne=S({closeToast:J,toastProps:z,data:D}));const ce={content:ne,props:z,staleId:M};E.limit&&E.limit>0&&b>E.limit&&Y?p.push(ce):Oo(j)?setTimeout(()=>{T(ce)},j):T(ce)},setProps(S){E=S},setToggle:(S,L)=>{C.get(S).toggle=L},isToastActive:S=>h.some(L=>L===S),getSnapshot:()=>E.newestOnTop?m.reverse():m}}(a,s,L2);ut.set(a,c);const l=c.observe(i);return Fo.forEach(f=>Bl(f.content,f.options)),Fo=[],()=>{l(),ut.delete(a)}},setProps(i){var c;(c=ut.get(a))==null||c.setProps(i)},getSnapshot(){var i;return(i=ut.get(a))==null?void 0:i.getSnapshot()}}}(e)).current;r(e);const o=I.useSyncExternalStore(t,n,n);return{getToastToRender:function(s){if(!o)return[];const a=new Map;return o.forEach(i=>{const{position:c}=i.props;a.has(c)||a.set(c,[]),a.get(c).push(i)}),Array.from(a,i=>s(i[0],i[1]))},isToastActive:jl,count:o==null?void 0:o.length}}function F2(e){const[t,n]=I.useState(!1),[r,o]=I.useState(!1),s=I.useRef(null),a=I.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:i,pauseOnHover:c,closeToast:l,onClick:f,closeOnClick:g}=e;var y,x;function b(){n(!0)}function p(){n(!1)}function h(C){const w=s.current;a.canDrag&&w&&(a.didMove=!0,t&&p(),a.delta=e.draggableDirection==="x"?C.clientX-a.start:C.clientY-a.start,a.start!==C.clientX&&(a.canCloseOnClick=!1),w.style.transform=`translate3d(${e.draggableDirection==="x"?`${a.delta}px, var(--y)`:`0, calc(${a.delta}px + var(--y))`},0)`,w.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function m(){document.removeEventListener("pointermove",h),document.removeEventListener("pointerup",m);const C=s.current;if(a.canDrag&&a.didMove&&C){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return o(!0),e.closeToast(),void e.collapseAll();C.style.transition="transform 0.2s, opacity 0.2s",C.style.removeProperty("transform"),C.style.removeProperty("opacity")}}(x=ut.get((y={id:e.toastId,containerId:e.containerId,fn:n}).containerId||1))==null||x.setToggle(y.id,y.fn),I.useEffect(()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||p(),window.addEventListener("focus",b),window.addEventListener("blur",p),()=>{window.removeEventListener("focus",b),window.removeEventListener("blur",p)}},[e.pauseOnFocusLoss]);const E={onPointerDown:function(C){if(e.draggable===!0||e.draggable===C.pointerType){a.didMove=!1,document.addEventListener("pointermove",h),document.addEventListener("pointerup",m);const w=s.current;a.canCloseOnClick=!0,a.canDrag=!0,w.style.transition="none",e.draggableDirection==="x"?(a.start=C.clientX,a.removalDistance=w.offsetWidth*(e.draggablePercent/100)):(a.start=C.clientY,a.removalDistance=w.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(C){const{top:w,bottom:v,left:_,right:T}=s.current.getBoundingClientRect();C.nativeEvent.type!=="touchend"&&e.pauseOnHover&&C.clientX>=_&&C.clientX<=T&&C.clientY>=w&&C.clientY<=v?p():b()}};return i&&c&&(E.onMouseEnter=p,e.stacked||(E.onMouseLeave=b)),g&&(E.onClick=C=>{f&&f(C),a.canCloseOnClick&&l()}),{playToast:b,pauseToast:p,isRunning:t,preventExitTransition:r,toastRef:s,eventHandlers:E}}function k2(e){let{delay:t,isRunning:n,closeToast:r,type:o="default",hide:s,className:a,style:i,controlledProgress:c,progress:l,rtl:f,isIn:g,theme:y}=e;const x=s||c&&l===0,b={...i,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused"};c&&(b.transform=`scaleX(${l})`);const p=Dn("Toastify__progress-bar",c?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${y}`,`Toastify__progress-bar--${o}`,{"Toastify__progress-bar--rtl":f}),h=Lt(a)?a({rtl:f,type:o,defaultClassName:p}):Dn(p,a),m={[c&&l>=1?"onTransitionEnd":"onAnimationEnd"]:c&&l<1?null:()=>{g&&r()}};return I.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":x},I.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${y} Toastify__progress-bar--${o}`}),I.createElement("div",{role:"progressbar","aria-hidden":x?"true":"false","aria-label":"notification timer",className:h,style:b,...m}))}let D2=1;const Gl=()=>""+D2++;function N2(e){return e&&(rr(e.toastId)||Oo(e.toastId))?e.toastId:Gl()}function ko(e,t){return Bl(e,t),t.toastId}function gs(e,t){return{...t,type:t&&t.type||e,toastId:N2(t)}}function ms(e){return(t,n)=>ko(t,gs(e,n))}function Oe(e,t){return ko(e,gs("default",t))}Oe.loading=(e,t)=>ko(e,gs("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),Oe.promise=function(e,t,n){let r,{pending:o,error:s,success:a}=t;o&&(r=rr(o)?Oe.loading(o,n):Oe.loading(o.render,{...n,...o}));const i={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},c=(f,g,y)=>{if(g==null)return void Oe.dismiss(r);const x={type:f,...i,...n,data:y},b=rr(g)?{render:g}:g;return r?Oe.update(r,{...x,...b}):Oe(b.render,{...x,...b}),y},l=Lt(e)?e():e;return l.then(f=>c("success",a,f)).catch(f=>c("error",s,f)),l},Oe.success=ms("success"),Oe.info=ms("info"),Oe.error=ms("error"),Oe.warning=ms("warning"),Oe.warn=Oe.warning,Oe.dark=(e,t)=>ko(e,gs("default",{theme:"dark",...t})),Oe.dismiss=function(e){(function(t){var n;if(Pl()){if(t==null||rr(n=t)||Oo(n))ut.forEach(r=>{r.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){const r=ut.get(t.containerId);r?r.removeToast(t.id):ut.forEach(o=>{o.removeToast(t.id)})}}else Fo=Fo.filter(r=>t!=null&&r.options.toastId!==t)})(e)},Oe.clearWaitingQueue=function(e){e===void 0&&(e={}),ut.forEach(t=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()})},Oe.isActive=jl,Oe.update=function(e,t){t===void 0&&(t={});const n=((r,o)=>{var s;let{containerId:a}=o;return(s=ut.get(a||1))==null?void 0:s.toasts.get(r)})(e,t);if(n){const{props:r,content:o}=n,s={delay:100,...r,...t,toastId:t.toastId||e,updateId:Gl()};s.toastId!==e&&(s.staleId=e);const a=s.render||o;delete s.render,ko(a,s)}},Oe.done=e=>{Oe.update(e,{progress:1})},Oe.onChange=function(e){return Qa.add(e),()=>{Qa.delete(e)}},Oe.play=e=>Vl(!0,e),Oe.pause=e=>Vl(!1,e);const R2=typeof window<"u"?I.useLayoutEffect:I.useEffect,bs=e=>{let{theme:t,type:n,isLoading:r,...o}=e;return I.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...o})},$a={info:function(e){return I.createElement(bs,{...e},I.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return I.createElement(bs,{...e},I.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return I.createElement(bs,{...e},I.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return I.createElement(bs,{...e},I.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return I.createElement("div",{className:"Toastify__spinner"})}},M2=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:o,playToast:s}=F2(e),{closeButton:a,children:i,autoClose:c,onClick:l,type:f,hideProgressBar:g,closeToast:y,transition:x,position:b,className:p,style:h,bodyClassName:m,bodyStyle:E,progressClassName:C,progressStyle:w,updateId:v,role:_,progress:T,rtl:S,toastId:L,deleteToast:N,isIn:k,isLoading:D,closeOnClick:M,theme:j}=e,J=Dn("Toastify__toast",`Toastify__toast-theme--${j}`,`Toastify__toast--${f}`,{"Toastify__toast--rtl":S},{"Toastify__toast--close-on-click":M}),Y=Lt(p)?p({rtl:S,position:b,type:f,defaultClassName:J}):Dn(J,p),z=function(ce){let{theme:V,type:R,isLoading:G,icon:W}=ce,U=null;const Q={theme:V,type:R};return W===!1||(Lt(W)?U=W({...Q,isLoading:G}):I.isValidElement(W)?U=I.cloneElement(W,Q):G?U=$a.spinner():(re=>re in $a)(R)&&(U=$a[R](Q))),U}(e),H=!!T||!c,q={closeToast:y,type:f,theme:j};let ne=null;return a===!1||(ne=Lt(a)?a(q):I.isValidElement(a)?I.cloneElement(a,q):function(ce){let{closeToast:V,theme:R,ariaLabel:G="close"}=ce;return I.createElement("button",{className:`Toastify__close-button Toastify__close-button--${R}`,type:"button",onClick:W=>{W.stopPropagation(),V(W)},"aria-label":G},I.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},I.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(q)),I.createElement(x,{isIn:k,done:N,position:b,preventExitTransition:n,nodeRef:r,playToast:s},I.createElement("div",{id:L,onClick:l,"data-in":k,className:Y,...o,style:h,ref:r},I.createElement("div",{...k&&{role:_},className:Lt(m)?m({type:f}):Dn("Toastify__toast-body",m),style:E},z!=null&&I.createElement("div",{className:Dn("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!D})},z),I.createElement("div",null,i)),ne,I.createElement(k2,{...v&&!H?{key:`pb-${v}`}:{},rtl:S,theme:j,delay:c,isRunning:t,isIn:k,closeToast:y,hide:g,type:f,style:w,className:C,controlledProgress:H,progress:T||0})))},ys=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},P2=hs(ys("bounce",!0));hs(ys("slide",!0)),hs(ys("zoom")),hs(ys("flip"));const j2={position:"top-right",transition:P2,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function Ua(e){let t={...j2,...e};const n=e.stacked,[r,o]=I.useState(!0),s=I.useRef(null),{getToastToRender:a,isToastActive:i,count:c}=O2(t),{className:l,style:f,rtl:g,containerId:y}=t;function x(p){const h=Dn("Toastify__toast-container",`Toastify__toast-container--${p}`,{"Toastify__toast-container--rtl":g});return Lt(l)?l({position:p,rtl:g,defaultClassName:h}):Dn(h,ps(l))}function b(){n&&(o(!0),Oe.play())}return R2(()=>{if(n){var p;const h=s.current.querySelectorAll('[data-in="true"]'),m=12,E=(p=t.position)==null?void 0:p.includes("top");let C=0,w=0;Array.from(h).reverse().forEach((v,_)=>{const T=v;T.classList.add("Toastify__toast--stacked"),_>0&&(T.dataset.collapsed=`${r}`),T.dataset.pos||(T.dataset.pos=E?"top":"bot");const S=C*(r?.2:1)+(r?0:m*_);T.style.setProperty("--y",`${E?S:-1*S}px`),T.style.setProperty("--g",`${m}`),T.style.setProperty("--s",""+(1-(r?w:0))),C+=T.offsetHeight,w+=.025})}},[r,c,n]),I.createElement("div",{ref:s,className:"Toastify",id:y,onMouseEnter:()=>{n&&(o(!1),Oe.pause())},onMouseLeave:b},a((p,h)=>{const m=h.length?{...f}:{...f,pointerEvents:"none"};return I.createElement("div",{className:x(p),style:m,key:`container-${p}`},h.map(E=>{let{content:C,props:w}=E;return I.createElement(M2,{...w,stacked:n,collapseAll:b,isIn:i(w.toastId,w.containerId),style:w.style,key:`toast-${w.key}`},C)}))}))}var Br=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},or=typeof window>"u"||"Deno"in globalThis;function jt(){}function B2(e,t){return typeof e=="function"?e(t):e}function Ka(e){return typeof e=="number"&&e>=0&&e!==1/0}function Hl(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Vr(e,t){return typeof e=="function"?e(t):e}function Ht(e,t){return typeof e=="function"?e(t):e}function Wl(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:a,stale:i}=e;if(a){if(r){if(t.queryHash!==ei(a,t.options))return!1}else if(!Do(t.queryKey,a))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||o&&o!==t.state.fetchStatus||s&&!s(t))}function Zl(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(sr(t.options.mutationKey)!==sr(s))return!1}else if(!Do(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function ei(e,t){return((t==null?void 0:t.queryKeyHashFn)||sr)(e)}function sr(e){return JSON.stringify(e,(t,n)=>ni(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Do(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Do(e[n],t[n])):!1}function ti(e,t){if(e===t)return e;const n=Xl(e)&&Xl(t);if(n||ni(e)&&ni(t)){const r=n?e:Object.keys(e),o=r.length,s=n?t:Object.keys(t),a=s.length,i=n?[]:{};let c=0;for(let l=0;l<a;l++){const f=n?l:s[l];(!n&&r.includes(f)||n)&&e[f]===void 0&&t[f]===void 0?(i[f]=void 0,c++):(i[f]=ti(e[f],t[f]),i[f]===e[f]&&e[f]!==void 0&&c++)}return o===a&&c===o?e:i}return t}function Cs(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Xl(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ni(e){if(!zl(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!zl(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function zl(e){return Object.prototype.toString.call(e)==="[object Object]"}function V2(e){return new Promise(t=>{setTimeout(t,e)})}function ri(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return ti(e,t)}catch(r){console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`)}return ti(e,t)}return t}function G2(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function H2(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var xs=Symbol();function Yl(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===xs&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===xs?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var W2=(h2=class extends Br{constructor(){super();ue(this,wr);ue(this,Hn);ue(this,co);K(this,co,t=>{if(!or&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){F(this,Hn)||this.setEventListener(F(this,co))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,Hn))==null||t.call(this),K(this,Hn,void 0))}setEventListener(t){var n;K(this,co,t),(n=F(this,Hn))==null||n.call(this),K(this,Hn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){F(this,wr)!==t&&(K(this,wr,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof F(this,wr)=="boolean"?F(this,wr):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},wr=new WeakMap,Hn=new WeakMap,co=new WeakMap,h2),oi=new W2,Z2=(g2=class extends Br{constructor(){super();ue(this,lo,!0);ue(this,Wn);ue(this,uo);K(this,uo,t=>{if(!or&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){F(this,Wn)||this.setEventListener(F(this,uo))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,Wn))==null||t.call(this),K(this,Wn,void 0))}setEventListener(t){var n;K(this,uo,t),(n=F(this,Wn))==null||n.call(this),K(this,Wn,t(this.setOnline.bind(this)))}setOnline(t){F(this,lo)!==t&&(K(this,lo,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return F(this,lo)}},lo=new WeakMap,Wn=new WeakMap,uo=new WeakMap,g2),Es=new Z2;function si(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function X2(e){return Math.min(1e3*2**e,3e4)}function Jl(e){return(e??"online")==="online"?Es.isOnline():!0}var ql=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function ai(e){return e instanceof ql}function Ql(e){let t=!1,n=0,r=!1,o;const s=si(),a=p=>{var h;r||(y(new ql(p)),(h=e.abort)==null||h.call(e))},i=()=>{t=!0},c=()=>{t=!1},l=()=>oi.isFocused()&&(e.networkMode==="always"||Es.isOnline())&&e.canRun(),f=()=>Jl(e.networkMode)&&e.canRun(),g=p=>{var h;r||(r=!0,(h=e.onSuccess)==null||h.call(e,p),o==null||o(),s.resolve(p))},y=p=>{var h;r||(r=!0,(h=e.onError)==null||h.call(e,p),o==null||o(),s.reject(p))},x=()=>new Promise(p=>{var h;o=m=>{(r||l())&&p(m)},(h=e.onPause)==null||h.call(e)}).then(()=>{var p;o=void 0,r||(p=e.onContinue)==null||p.call(e)}),b=()=>{if(r)return;let p;const h=n===0?e.initialPromise:void 0;try{p=h??e.fn()}catch(m){p=Promise.reject(m)}Promise.resolve(p).then(g).catch(m=>{var _;if(r)return;const E=e.retry??(or?0:3),C=e.retryDelay??X2,w=typeof C=="function"?C(n,m):C,v=E===!0||typeof E=="number"&&n<E||typeof E=="function"&&E(n,m);if(t||!v){y(m);return}n++,(_=e.onFail)==null||_.call(e,n,m),V2(w).then(()=>l()?void 0:x()).then(()=>{t?y(m):b()})})};return{promise:s,cancel:a,continue:()=>(o==null||o(),s),cancelRetry:i,continueRetry:c,canStart:f,start:()=>(f()?b():x().then(b),s)}}function z2(){let e=[],t=0,n=i=>{i()},r=i=>{i()},o=i=>setTimeout(i,0);const s=i=>{t?e.push(i):o(()=>{n(i)})},a=()=>{const i=e;e=[],i.length&&o(()=>{r(()=>{i.forEach(c=>{n(c)})})})};return{batch:i=>{let c;t++;try{c=i()}finally{t--,t||a()}return c},batchCalls:i=>(...c)=>{s(()=>{i(...c)})},schedule:s,setNotifyFunction:i=>{n=i},setBatchNotifyFunction:i=>{r=i},setScheduler:i=>{o=i}}}var Ue=z2(),$l=(m2=class{constructor(){ue(this,Ir)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ka(this.gcTime)&&K(this,Ir,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(or?1/0:5*60*1e3))}clearGcTimeout(){F(this,Ir)&&(clearTimeout(F(this,Ir)),K(this,Ir,void 0))}},Ir=new WeakMap,m2),Y2=(b2=class extends $l{constructor(t){super();ue(this,tn);ue(this,fo);ue(this,po);ue(this,Bt);ue(this,_r);ue(this,lt);ue(this,as);ue(this,Sr);K(this,Sr,!1),K(this,as,t.defaultOptions),this.setOptions(t.options),this.observers=[],K(this,_r,t.client),K(this,Bt,F(this,_r).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,K(this,fo,J2(this.options)),this.state=t.state??F(this,fo),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=F(this,lt))==null?void 0:t.promise}setOptions(t){this.options={...F(this,as),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&F(this,Bt).remove(this)}setData(t,n){const r=ri(this.state.data,t,this.options);return be(this,tn,kn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){be(this,tn,kn).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=F(this,lt))==null?void 0:r.promise;return(o=F(this,lt))==null||o.cancel(t),n?n.then(jt).catch(jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(F(this,fo))}isActive(){return this.observers.some(t=>Ht(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===xs||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!Hl(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=F(this,lt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=F(this,lt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),F(this,Bt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(F(this,lt)&&(F(this,Sr)?F(this,lt).cancel({revert:!0}):F(this,lt).cancelRetry()),this.scheduleGc()),F(this,Bt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||be(this,tn,kn).call(this,{type:"invalidate"})}fetch(t,n){var c,l,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(F(this,lt))return F(this,lt).continueRetry(),F(this,lt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const g=this.observers.find(y=>y.options.queryFn);g&&this.setOptions(g.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(K(this,Sr,!0),r.signal)})},s=()=>{const g=Yl(this.options,n),y={client:F(this,_r),queryKey:this.queryKey,meta:this.meta};return o(y),K(this,Sr,!1),this.options.persister?this.options.persister(g,y,this):g(y)},a={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:F(this,_r),state:this.state,fetchFn:s};o(a),(c=this.options.behavior)==null||c.onFetch(a,this),K(this,po,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((l=a.fetchOptions)==null?void 0:l.meta))&&be(this,tn,kn).call(this,{type:"fetch",meta:(f=a.fetchOptions)==null?void 0:f.meta});const i=g=>{var y,x,b,p;ai(g)&&g.silent||be(this,tn,kn).call(this,{type:"error",error:g}),ai(g)||((x=(y=F(this,Bt).config).onError)==null||x.call(y,g,this),(p=(b=F(this,Bt).config).onSettled)==null||p.call(b,this.state.data,g,this)),this.scheduleGc()};return K(this,lt,Ql({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:g=>{var y,x,b,p;if(g===void 0){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),i(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(g)}catch(h){i(h);return}(x=(y=F(this,Bt).config).onSuccess)==null||x.call(y,g,this),(p=(b=F(this,Bt).config).onSettled)==null||p.call(b,g,this.state.error,this),this.scheduleGc()},onError:i,onFail:(g,y)=>{be(this,tn,kn).call(this,{type:"failed",failureCount:g,error:y})},onPause:()=>{be(this,tn,kn).call(this,{type:"pause"})},onContinue:()=>{be(this,tn,kn).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),F(this,lt).start()}},fo=new WeakMap,po=new WeakMap,Bt=new WeakMap,_r=new WeakMap,lt=new WeakMap,as=new WeakMap,Sr=new WeakMap,tn=new WeakSet,kn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Ul(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return ai(o)&&o.revert&&F(this,po)?{...F(this,po),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Ue.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),F(this,Bt).notify({query:this,type:"updated",action:t})})},b2);function Ul(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Jl(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function J2(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var q2=(y2=class extends Br{constructor(t={}){super();ue(this,dn);this.config=t,K(this,dn,new Map)}build(t,n,r){const o=n.queryKey,s=n.queryHash??ei(o,n);let a=this.get(s);return a||(a=new Y2({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(a)),a}add(t){F(this,dn).has(t.queryHash)||(F(this,dn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=F(this,dn).get(t.queryHash);n&&(t.destroy(),n===t&&F(this,dn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ue.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return F(this,dn).get(t)}getAll(){return[...F(this,dn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Wl(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Wl(t,r)):n}notify(t){Ue.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Ue.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ue.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},dn=new WeakMap,y2),Q2=(C2=class extends $l{constructor(t){super();ue(this,pn);ue(this,fn);ue(this,dt);ue(this,Tr);this.mutationId=t.mutationId,K(this,dt,t.mutationCache),K(this,fn,[]),this.state=t.state||Kl(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){F(this,fn).includes(t)||(F(this,fn).push(t),this.clearGcTimeout(),F(this,dt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){K(this,fn,F(this,fn).filter(n=>n!==t)),this.scheduleGc(),F(this,dt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){F(this,fn).length||(this.state.status==="pending"?this.scheduleGc():F(this,dt).remove(this))}continue(){var t;return((t=F(this,Tr))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,s,a,i,c,l,f,g,y,x,b,p,h,m,E,C,w,v,_,T;K(this,Tr,Ql({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(S,L)=>{be(this,pn,nr).call(this,{type:"failed",failureCount:S,error:L})},onPause:()=>{be(this,pn,nr).call(this,{type:"pause"})},onContinue:()=>{be(this,pn,nr).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>F(this,dt).canRun(this)}));const n=this.state.status==="pending",r=!F(this,Tr).canStart();try{if(!n){be(this,pn,nr).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(o=F(this,dt).config).onMutate)==null?void 0:s.call(o,t,this));const L=await((i=(a=this.options).onMutate)==null?void 0:i.call(a,t));L!==this.state.context&&be(this,pn,nr).call(this,{type:"pending",context:L,variables:t,isPaused:r})}const S=await F(this,Tr).start();return await((l=(c=F(this,dt).config).onSuccess)==null?void 0:l.call(c,S,t,this.state.context,this)),await((g=(f=this.options).onSuccess)==null?void 0:g.call(f,S,t,this.state.context)),await((x=(y=F(this,dt).config).onSettled)==null?void 0:x.call(y,S,null,this.state.variables,this.state.context,this)),await((p=(b=this.options).onSettled)==null?void 0:p.call(b,S,null,t,this.state.context)),be(this,pn,nr).call(this,{type:"success",data:S}),S}catch(S){try{throw await((m=(h=F(this,dt).config).onError)==null?void 0:m.call(h,S,t,this.state.context,this)),await((C=(E=this.options).onError)==null?void 0:C.call(E,S,t,this.state.context)),await((v=(w=F(this,dt).config).onSettled)==null?void 0:v.call(w,void 0,S,this.state.variables,this.state.context,this)),await((T=(_=this.options).onSettled)==null?void 0:T.call(_,void 0,S,t,this.state.context)),S}finally{be(this,pn,nr).call(this,{type:"error",error:S})}}finally{F(this,dt).runNext(this)}}},fn=new WeakMap,dt=new WeakMap,Tr=new WeakMap,pn=new WeakSet,nr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Ue.batch(()=>{F(this,fn).forEach(r=>{r.onMutationUpdate(t)}),F(this,dt).notify({mutation:this,type:"updated",action:t})})},C2);function Kl(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $2=(x2=class extends Br{constructor(t={}){super();ue(this,_n);ue(this,nn);ue(this,is);this.config=t,K(this,_n,new Set),K(this,nn,new Map),K(this,is,0)}build(t,n,r){const o=new Q2({mutationCache:this,mutationId:++Xa(this,is)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){F(this,_n).add(t);const n=vs(t);if(typeof n=="string"){const r=F(this,nn).get(n);r?r.push(t):F(this,nn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(F(this,_n).delete(t)){const n=vs(t);if(typeof n=="string"){const r=F(this,nn).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&F(this,nn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=vs(t);if(typeof n=="string"){const r=F(this,nn).get(n),o=r==null?void 0:r.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=vs(t);if(typeof n=="string"){const o=(r=F(this,nn).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ue.batch(()=>{F(this,_n).forEach(t=>{this.notify({type:"removed",mutation:t})}),F(this,_n).clear(),F(this,nn).clear()})}getAll(){return Array.from(F(this,_n))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Zl(n,r))}findAll(t={}){return this.getAll().filter(n=>Zl(t,n))}notify(t){Ue.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Ue.batch(()=>Promise.all(t.map(n=>n.continue().catch(jt))))}},_n=new WeakMap,nn=new WeakMap,is=new WeakMap,x2);function vs(e){var t;return(t=e.options.scope)==null?void 0:t.id}function ws(e){return{onFetch:(t,n)=>{var f,g,y,x,b;const r=t.options,o=(y=(g=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:g.fetchMore)==null?void 0:y.direction,s=((x=t.state.data)==null?void 0:x.pages)||[],a=((b=t.state.data)==null?void 0:b.pageParams)||[];let i={pages:[],pageParams:[]},c=0;const l=async()=>{let p=!1;const h=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},m=Yl(t.options,t.fetchOptions),E=async(C,w,v)=>{if(p)return Promise.reject();if(w==null&&C.pages.length)return Promise.resolve(C);const _={client:t.client,queryKey:t.queryKey,pageParam:w,direction:v?"backward":"forward",meta:t.options.meta};h(_);const T=await m(_),{maxPages:S}=t.options,L=v?H2:G2;return{pages:L(C.pages,T,S),pageParams:L(C.pageParams,w,S)}};if(o&&s.length){const C=o==="backward",w=C?eu:ii,v={pages:s,pageParams:a},_=w(r,v);i=await E(v,_,C)}else{const C=e??s.length;do{const w=c===0?a[0]??r.initialPageParam:ii(r,i);if(c>0&&w==null)break;i=await E(i,w),c++}while(c<C)}return i};t.options.persister?t.fetchFn=()=>{var p,h;return(h=(p=t.options).persister)==null?void 0:h.call(p,l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=l}}}function ii(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function eu(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}function U2(e,t){return t?ii(e,t)!=null:!1}function K2(e,t){return!t||!e.getPreviousPageParam?!1:eu(e,t)!=null}var eh=(E2=class{constructor(e={}){ue(this,ze);ue(this,Zn);ue(this,Xn);ue(this,ho);ue(this,go);ue(this,zn);ue(this,mo);ue(this,bo);K(this,ze,e.queryCache||new q2),K(this,Zn,e.mutationCache||new $2),K(this,Xn,e.defaultOptions||{}),K(this,ho,new Map),K(this,go,new Map),K(this,zn,0)}mount(){Xa(this,zn)._++,F(this,zn)===1&&(K(this,mo,oi.subscribe(async e=>{e&&(await this.resumePausedMutations(),F(this,ze).onFocus())})),K(this,bo,Es.subscribe(async e=>{e&&(await this.resumePausedMutations(),F(this,ze).onOnline())})))}unmount(){var e,t;Xa(this,zn)._--,F(this,zn)===0&&((e=F(this,mo))==null||e.call(this),K(this,mo,void 0),(t=F(this,bo))==null||t.call(this),K(this,bo,void 0))}isFetching(e){return F(this,ze).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return F(this,Zn).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=F(this,ze).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=F(this,ze).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Vr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return F(this,ze).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=F(this,ze).get(r.queryHash),s=o==null?void 0:o.state.data,a=B2(t,s);if(a!==void 0)return F(this,ze).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Ue.batch(()=>F(this,ze).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=F(this,ze).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=F(this,ze);Ue.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=F(this,ze);return Ue.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Ue.batch(()=>F(this,ze).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(jt).catch(jt)}invalidateQueries(e,t={}){return Ue.batch(()=>(F(this,ze).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Ue.batch(()=>F(this,ze).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(jt)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(jt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=F(this,ze).build(this,t);return n.isStaleByTime(Vr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(jt).catch(jt)}fetchInfiniteQuery(e){return e.behavior=ws(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jt).catch(jt)}ensureInfiniteQueryData(e){return e.behavior=ws(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Es.isOnline()?F(this,Zn).resumePausedMutations():Promise.resolve()}getQueryCache(){return F(this,ze)}getMutationCache(){return F(this,Zn)}getDefaultOptions(){return F(this,Xn)}setDefaultOptions(e){K(this,Xn,e)}setQueryDefaults(e,t){F(this,ho).set(sr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...F(this,ho).values()],n={};return t.forEach(r=>{Do(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){F(this,go).set(sr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...F(this,go).values()],n={};return t.forEach(r=>{Do(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...F(this,Xn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ei(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===xs&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...F(this,Xn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){F(this,ze).clear(),F(this,Zn).clear()}},ze=new WeakMap,Zn=new WeakMap,Xn=new WeakMap,ho=new WeakMap,go=new WeakMap,zn=new WeakMap,mo=new WeakMap,bo=new WeakMap,E2),tu=(v2=class extends Br{constructor(t,n){super();ue(this,Ne);ue(this,wt);ue(this,we);ue(this,cs);ue(this,ft);ue(this,Ar);ue(this,yo);ue(this,Yn);ue(this,hn);ue(this,ls);ue(this,Co);ue(this,xo);ue(this,Lr);ue(this,Or);ue(this,Jn);ue(this,Eo,new Set);this.options=n,K(this,wt,t),K(this,hn,null),K(this,Yn,si()),this.options.experimental_prefetchInRender||F(this,Yn).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(F(this,we).addObserver(this),nu(F(this,we),this.options)?be(this,Ne,ds).call(this):this.updateResult(),be(this,Ne,Al).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ci(F(this,we),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ci(F(this,we),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,be(this,Ne,Ll).call(this),be(this,Ne,Ol).call(this),F(this,we).removeObserver(this)}setOptions(t,n){const r=this.options,o=F(this,we);if(this.options=F(this,wt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ht(this.options.enabled,F(this,we))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");be(this,Ne,Fl).call(this),F(this,we).setOptions(this.options),r._defaulted&&!Cs(this.options,r)&&F(this,wt).getQueryCache().notify({type:"observerOptionsUpdated",query:F(this,we),observer:this});const s=this.hasListeners();s&&ru(F(this,we),o,this.options,r)&&be(this,Ne,ds).call(this),this.updateResult(n),s&&(F(this,we)!==o||Ht(this.options.enabled,F(this,we))!==Ht(r.enabled,F(this,we))||Vr(this.options.staleTime,F(this,we))!==Vr(r.staleTime,F(this,we)))&&be(this,Ne,_l).call(this);const a=be(this,Ne,Sl).call(this);s&&(F(this,we)!==o||Ht(this.options.enabled,F(this,we))!==Ht(r.enabled,F(this,we))||a!==F(this,Jn))&&be(this,Ne,Tl).call(this,a)}getOptimisticResult(t){const n=F(this,wt).getQueryCache().build(F(this,wt),t),r=this.createResult(n,t);return nh(this,r)&&(K(this,ft,r),K(this,yo,this.options),K(this,Ar,F(this,we).state)),r}getCurrentResult(){return F(this,ft)}trackResult(t,n){const r={};return Object.keys(t).forEach(o=>{Object.defineProperty(r,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),n==null||n(o),t[o])})}),r}trackProp(t){F(this,Eo).add(t)}getCurrentQuery(){return F(this,we)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=F(this,wt).defaultQueryOptions(t),r=F(this,wt).getQueryCache().build(F(this,wt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return be(this,Ne,ds).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),F(this,ft)))}createResult(t,n){var S;const r=F(this,we),o=this.options,s=F(this,ft),a=F(this,Ar),i=F(this,yo),l=t!==r?t.state:F(this,cs),{state:f}=t;let g={...f},y=!1,x;if(n._optimisticResults){const L=this.hasListeners(),N=!L&&nu(t,n),k=L&&ru(t,r,n,o);(N||k)&&(g={...g,...Ul(f.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:b,errorUpdatedAt:p,status:h}=g;if(n.select&&g.data!==void 0)if(s&&g.data===(a==null?void 0:a.data)&&n.select===F(this,ls))x=F(this,Co);else try{K(this,ls,n.select),x=n.select(g.data),x=ri(s==null?void 0:s.data,x,n),K(this,Co,x),K(this,hn,null)}catch(L){K(this,hn,L)}else x=g.data;if(n.placeholderData!==void 0&&x===void 0&&h==="pending"){let L;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(i==null?void 0:i.placeholderData))L=s.data;else if(L=typeof n.placeholderData=="function"?n.placeholderData((S=F(this,xo))==null?void 0:S.state.data,F(this,xo)):n.placeholderData,n.select&&L!==void 0)try{L=n.select(L),K(this,hn,null)}catch(N){K(this,hn,N)}L!==void 0&&(h="success",x=ri(s==null?void 0:s.data,L,n),y=!0)}F(this,hn)&&(b=F(this,hn),x=F(this,Co),p=Date.now(),h="error");const m=g.fetchStatus==="fetching",E=h==="pending",C=h==="error",w=E&&m,v=x!==void 0,T={status:h,fetchStatus:g.fetchStatus,isPending:E,isSuccess:h==="success",isError:C,isInitialLoading:w,isLoading:w,data:x,dataUpdatedAt:g.dataUpdatedAt,error:b,errorUpdatedAt:p,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>l.dataUpdateCount||g.errorUpdateCount>l.errorUpdateCount,isFetching:m,isRefetching:m&&!E,isLoadingError:C&&!v,isPaused:g.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:C&&v,isStale:li(t,n),refetch:this.refetch,promise:F(this,Yn)};if(this.options.experimental_prefetchInRender){const L=D=>{T.status==="error"?D.reject(T.error):T.data!==void 0&&D.resolve(T.data)},N=()=>{const D=K(this,Yn,T.promise=si());L(D)},k=F(this,Yn);switch(k.status){case"pending":t.queryHash===r.queryHash&&L(k);break;case"fulfilled":(T.status==="error"||T.data!==k.value)&&N();break;case"rejected":(T.status!=="error"||T.error!==k.reason)&&N();break}}return T}updateResult(t){const n=F(this,ft),r=this.createResult(F(this,we),this.options);if(K(this,Ar,F(this,we).state),K(this,yo,this.options),F(this,Ar).data!==void 0&&K(this,xo,F(this,we)),Cs(r,n))return;K(this,ft,r);const o={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:a}=this.options,i=typeof a=="function"?a():a;if(i==="all"||!i&&!F(this,Eo).size)return!0;const c=new Set(i??F(this,Eo));return this.options.throwOnError&&c.add("error"),Object.keys(F(this,ft)).some(l=>{const f=l;return F(this,ft)[f]!==n[f]&&c.has(f)})};(t==null?void 0:t.listeners)!==!1&&s()&&(o.listeners=!0),be(this,Ne,_2).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&be(this,Ne,Al).call(this)}},wt=new WeakMap,we=new WeakMap,cs=new WeakMap,ft=new WeakMap,Ar=new WeakMap,yo=new WeakMap,Yn=new WeakMap,hn=new WeakMap,ls=new WeakMap,Co=new WeakMap,xo=new WeakMap,Lr=new WeakMap,Or=new WeakMap,Jn=new WeakMap,Eo=new WeakMap,Ne=new WeakSet,ds=function(t){be(this,Ne,Fl).call(this);let n=F(this,we).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(jt)),n},_l=function(){be(this,Ne,Ll).call(this);const t=Vr(this.options.staleTime,F(this,we));if(or||F(this,ft).isStale||!Ka(t))return;const r=Hl(F(this,ft).dataUpdatedAt,t)+1;K(this,Lr,setTimeout(()=>{F(this,ft).isStale||this.updateResult()},r))},Sl=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(F(this,we)):this.options.refetchInterval)??!1},Tl=function(t){be(this,Ne,Ol).call(this),K(this,Jn,t),!(or||Ht(this.options.enabled,F(this,we))===!1||!Ka(F(this,Jn))||F(this,Jn)===0)&&K(this,Or,setInterval(()=>{(this.options.refetchIntervalInBackground||oi.isFocused())&&be(this,Ne,ds).call(this)},F(this,Jn)))},Al=function(){be(this,Ne,_l).call(this),be(this,Ne,Tl).call(this,be(this,Ne,Sl).call(this))},Ll=function(){F(this,Lr)&&(clearTimeout(F(this,Lr)),K(this,Lr,void 0))},Ol=function(){F(this,Or)&&(clearInterval(F(this,Or)),K(this,Or,void 0))},Fl=function(){const t=F(this,wt).getQueryCache().build(F(this,wt),this.options);if(t===F(this,we))return;const n=F(this,we);K(this,we,t),K(this,cs,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},_2=function(t){Ue.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(F(this,ft))}),F(this,wt).getQueryCache().notify({query:F(this,we),type:"observerResultsUpdated"})})},v2);function th(e,t){return Ht(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function nu(e,t){return th(e,t)||e.state.data!==void 0&&ci(e,t,t.refetchOnMount)}function ci(e,t,n){if(Ht(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&li(e,t)}return!1}function ru(e,t,n,r){return(e!==t||Ht(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&li(e,n)}function li(e,t){return Ht(t.enabled,e)!==!1&&e.isStaleByTime(Vr(t.staleTime,e))}function nh(e,t){return!Cs(e.getCurrentResult(),t)}var rh=class extends tu{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e,t){super.setOptions({...e,behavior:ws()},t)}getOptimisticResult(e){return e.behavior=ws(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var b,p;const{state:n}=e,r=super.createResult(e,t),{isFetching:o,isRefetching:s,isError:a,isRefetchError:i}=r,c=(p=(b=n.fetchMeta)==null?void 0:b.fetchMore)==null?void 0:p.direction,l=a&&c==="forward",f=o&&c==="forward",g=a&&c==="backward",y=o&&c==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:U2(t,n.data),hasPreviousPage:K2(t,n.data),isFetchNextPageError:l,isFetchingNextPage:f,isFetchPreviousPageError:g,isFetchingPreviousPage:y,isRefetchError:i&&!l&&!g,isRefetching:s&&!f&&!y}}},oh=(w2=class extends Br{constructor(n,r){super();ue(this,Tn);ue(this,qn);ue(this,Qn);ue(this,It);ue(this,Sn);K(this,qn,n),this.setOptions(r),this.bindMethods(),be(this,Tn,za).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var o;const r=this.options;this.options=F(this,qn).defaultMutationOptions(n),Cs(this.options,r)||F(this,qn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:F(this,It),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&sr(r.mutationKey)!==sr(this.options.mutationKey)?this.reset():((o=F(this,It))==null?void 0:o.state.status)==="pending"&&F(this,It).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=F(this,It))==null||n.removeObserver(this)}onMutationUpdate(n){be(this,Tn,za).call(this),be(this,Tn,kl).call(this,n)}getCurrentResult(){return F(this,Qn)}reset(){var n;(n=F(this,It))==null||n.removeObserver(this),K(this,It,void 0),be(this,Tn,za).call(this),be(this,Tn,kl).call(this)}mutate(n,r){var o;return K(this,Sn,r),(o=F(this,It))==null||o.removeObserver(this),K(this,It,F(this,qn).getMutationCache().build(F(this,qn),this.options)),F(this,It).addObserver(this),F(this,It).execute(n)}},qn=new WeakMap,Qn=new WeakMap,It=new WeakMap,Sn=new WeakMap,Tn=new WeakSet,za=function(){var r;const n=((r=F(this,It))==null?void 0:r.state)??Kl();K(this,Qn,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},kl=function(n){Ue.batch(()=>{var r,o,s,a,i,c,l,f;if(F(this,Sn)&&this.hasListeners()){const g=F(this,Qn).variables,y=F(this,Qn).context;(n==null?void 0:n.type)==="success"?((o=(r=F(this,Sn)).onSuccess)==null||o.call(r,n.data,g,y),(a=(s=F(this,Sn)).onSettled)==null||a.call(s,n.data,null,g,y)):(n==null?void 0:n.type)==="error"&&((c=(i=F(this,Sn)).onError)==null||c.call(i,n.error,g,y),(f=(l=F(this,Sn)).onSettled)==null||f.call(l,void 0,n.error,g,y))}this.listeners.forEach(g=>{g(F(this,Qn))})})},w2),ou=A.createContext(void 0),Gr=e=>{const t=A.useContext(ou);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},sh=({client:e,children:t})=>(A.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(ou.Provider,{value:e,children:t})),su=A.createContext(!1),ah=()=>A.useContext(su);su.Provider;function ih(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ch=A.createContext(ih()),lh=()=>A.useContext(ch);function au(e,t){return typeof e=="function"?e(...t):!!e}function ui(){}var uh=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},dh=e=>{A.useEffect(()=>{e.clearReset()},[e])},fh=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||au(n,[e.error,r])),ph=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},hh=(e,t)=>e.isLoading&&e.isFetching&&!t,gh=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,iu=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function cu(e,t,n){var g,y,x,b,p;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=Gr(),o=ah(),s=lh(),a=r.defaultQueryOptions(e);(y=(g=r.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||y.call(g,a),process.env.NODE_ENV!=="production"&&(a.queryFn||console.error(`[${a.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),a._optimisticResults=o?"isRestoring":"optimistic",ph(a),uh(a,s),dh(s);const i=!r.getQueryCache().get(a.queryHash),[c]=A.useState(()=>new t(r,a)),l=c.getOptimisticResult(a),f=!o&&e.subscribed!==!1;if(A.useSyncExternalStore(A.useCallback(h=>{const m=f?c.subscribe(Ue.batchCalls(h)):ui;return c.updateResult(),m},[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),A.useEffect(()=>{c.setOptions(a,{listeners:!1})},[a,c]),gh(a,l))throw iu(a,c,s);if(fh({result:l,errorResetBoundary:s,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw l.error;if((b=(x=r.getDefaultOptions().queries)==null?void 0:x._experimental_afterQuery)==null||b.call(x,a,l),a.experimental_prefetchInRender&&!or&&hh(l,o)){const h=i?iu(a,c,s):(p=r.getQueryCache().get(a.queryHash))==null?void 0:p.promise;h==null||h.catch(ui).finally(()=>{c.updateResult()})}return a.notifyOnChangeProps?l:c.trackResult(l)}function Wt(e,t){return cu(e,tu)}function Zt(e,t){const n=Gr(),[r]=A.useState(()=>new oh(n,e));A.useEffect(()=>{r.setOptions(e)},[r,e]);const o=A.useSyncExternalStore(A.useCallback(a=>r.subscribe(Ue.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=A.useCallback((a,i)=>{r.mutate(a,i).catch(ui)},[r]);if(o.error&&au(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}function mh(e,t){return cu(e,rh)}const di=(e,t)=>t.some(n=>e instanceof n);let lu,uu;function bh(){return lu||(lu=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function yh(){return uu||(uu=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const fi=new WeakMap,pi=new WeakMap,Is=new WeakMap;function Ch(e){const t=new Promise((n,r)=>{const o=()=>{e.removeEventListener("success",s),e.removeEventListener("error",a)},s=()=>{n(ar(e.result)),o()},a=()=>{r(e.error),o()};e.addEventListener("success",s),e.addEventListener("error",a)});return Is.set(t,e),t}function xh(e){if(fi.has(e))return;const t=new Promise((n,r)=>{const o=()=>{e.removeEventListener("complete",s),e.removeEventListener("error",a),e.removeEventListener("abort",a)},s=()=>{n(),o()},a=()=>{r(e.error||new DOMException("AbortError","AbortError")),o()};e.addEventListener("complete",s),e.addEventListener("error",a),e.addEventListener("abort",a)});fi.set(e,t)}let hi={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return fi.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return ar(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function du(e){hi=e(hi)}function Eh(e){return yh().includes(e)?function(...t){return e.apply(gi(this),t),ar(this.request)}:function(...t){return ar(e.apply(gi(this),t))}}function vh(e){return typeof e=="function"?Eh(e):(e instanceof IDBTransaction&&xh(e),di(e,bh())?new Proxy(e,hi):e)}function ar(e){if(e instanceof IDBRequest)return Ch(e);if(pi.has(e))return pi.get(e);const t=vh(e);return t!==e&&(pi.set(e,t),Is.set(t,e)),t}const gi=e=>Is.get(e);function wh(e,t,{blocked:n,upgrade:r,blocking:o,terminated:s}={}){const a=indexedDB.open(e,t),i=ar(a);return r&&a.addEventListener("upgradeneeded",c=>{r(ar(a.result),c.oldVersion,c.newVersion,ar(a.transaction),c)}),n&&a.addEventListener("blocked",c=>n(c.oldVersion,c.newVersion,c)),i.then(c=>{s&&c.addEventListener("close",()=>s()),o&&c.addEventListener("versionchange",l=>o(l.oldVersion,l.newVersion,l))}).catch(()=>{}),i}const Ih=["get","getKey","getAll","getAllKeys","count"],_h=["put","add","delete","clear"],mi=new Map;function fu(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(mi.get(t))return mi.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=_h.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(o||Ih.includes(n)))return;const s=async function(a,...i){const c=this.transaction(a,o?"readwrite":"readonly");let l=c.store;return r&&(l=l.index(i.shift())),(await Promise.all([l[n](...i),o&&c.done]))[0]};return mi.set(t,s),s}du(e=>({...e,get:(t,n,r)=>fu(t,n)||e.get(t,n,r),has:(t,n)=>!!fu(t,n)||e.has(t,n)}));const Sh=["continue","continuePrimaryKey","advance"],pu={},bi=new WeakMap,hu=new WeakMap,Th={get(e,t){if(!Sh.includes(t))return e[t];let n=pu[t];return n||(n=pu[t]=function(...r){bi.set(this,hu.get(this)[t](...r))}),n}};async function*Ah(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;t=t;const n=new Proxy(t,Th);for(hu.set(n,t),Is.set(n,gi(t));t;)yield n,t=await(bi.get(n)||t.continue()),bi.delete(n)}function gu(e,t){return t===Symbol.asyncIterator&&di(e,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&di(e,[IDBIndex,IDBObjectStore])}du(e=>({...e,get(t,n,r){return gu(t,n)?Ah:e.get(t,n,r)},has(t,n){return gu(t,n)||e.has(t,n)}}));const Lh="connector-db",Oh=1,_s={FEEDBACK:"feedback"},No=`${_s.FEEDBACK}:data`,Ss=`${_s.FEEDBACK}:last_submitted`,Ro=`${_s.FEEDBACK}:capture_on_demand`,Mo=`${_s.FEEDBACK}:show_notification`,Fh=12*60*60*1e3,yi=(e,t=new Date)=>e?Math.abs(t.getTime()-e.getTime())>=Fh:!0,mu=(e,t=!1)=>e.captureFeedback&&(yi(e.firstViewed)&&(!e.lastSubmittedFeedback||yi(e.lastSubmittedFeedback))||!!t);let ir=null;const Nn=async()=>{try{ir||(ir=await wh(Lh,Oh,{upgrade(e){e.objectStoreNames.contains(No)||e.createObjectStore(No),e.objectStoreNames.contains(Ss)||e.createObjectStore(Ss),e.objectStoreNames.contains(Ro)||e.createObjectStore(Ro),e.objectStoreNames.contains(Mo)||e.createObjectStore(Mo)},blocked(){console.warn("Upgrade blocked! Close other tabs using this DB.")},blocking(){console.warn("Another tab is trying to upgrade. Closing connection to allow upgrade."),ir&&(ir.close(),ir=null)},terminated(){console.error("DB connection unexpectedly closed. Resetting connection."),ir=null}}))}catch(e){console.error("Error opening IndexedDB connection:",e)}return ir},Ci=async e=>{if(!e)return[];const t=await Nn();if(!t)return[];try{return await t.get(No,e)||[]}catch(n){return console.error("Error fetching user feedback data:",n),[]}},kh=async e=>{if(!e)return null;const t=await Nn();if(!t)return null;try{return await t.get(Ss,e)||null}catch(n){return console.error("Error fetching last submitted feedback:",n),null}},Ts=async e=>{if(!e)return;const t=await Nn();if(t)try{return await t.get(Ro,e)}catch(n){console.error("Error fetching capture on demand status:",n);return}},Dh=async e=>{if(!e)return!1;const t=await Nn();if(!t)return!1;try{return await t.get(Mo,e)??!1}catch(n){return console.error("Error fetching show notification status:",n),!1}},Nh=async(e,t)=>{if(!e||!t||!t.length)return;const n=await Nn();if(n)try{const r=await Ci(e),o=new Set(r.map(a=>a.connectorId)),s=t.filter(a=>!o.has(a.connector_id)).map(a=>({connectorId:a.connector_id,captureFeedback:!0,firstViewed:new Date}));if(s.length>0){const a=[...r,...s];await n.put(No,a,e),await n.put(Mo,!0,e)}}catch(r){console.error("Error updating connectors feedback data:",r)}},Rh=async e=>{if(!e)return;const t=await Nn();if(t)try{const n=await Ci(e),r=await Ts(e),o=new Date,s=n.map(a=>{const i=mu(a,r);return{...a,lastSubmittedFeedback:i?o:a.lastSubmittedFeedback,captureFeedback:a.captureFeedback!==i}});await t.put(No,s,e),await t.put(Ss,o,e),r&&await t.put(Ro,!1,e)}catch(n){console.error("Error updating feedback submission date:",n)}},bu=async(e,t)=>{if(!e)return;const n=await Nn();if(n)try{await n.put(Ro,t,e)}catch(r){console.error("Error updating capture on demand:",r)}},Mh=async e=>{if(!e)return;const t=await Nn();if(t)try{await t.put(Mo,!1,e)}catch(n){console.error("Error resetting show notification status:",n)}},Ph=async e=>{const t=await Ci(e),n=await Ts(e);return t.filter(o=>mu(o,n))},xi=async e=>{const t=await kh(e);return t&&!yi(t)?!1:await Ts(e)&&!t?!0:!!(await Ph(e)).length},jh=async(e,t)=>{await Nh(e,t)},As=async e=>{e&&await Rh(e)},Bh=async(e,t)=>{const n=await Ts(e);t?n!==!1&&await bu(e,t):await bu(e,void 0)},yu=async e=>await Dh(e)&&await xi(e),Cu=async e=>{await Mh(e)};var Ei={},cr={};function xu(e,t){return function(){return e.apply(t,arguments)}}const{toString:Vh}=Object.prototype,{getPrototypeOf:vi}=Object,Ls=(e=>t=>{const n=Vh.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Xt=e=>(e=e.toLowerCase(),t=>Ls(t)===e),Os=e=>t=>typeof t===e,{isArray:Hr}=Array,Po=Os("undefined");function Gh(e){return e!==null&&!Po(e)&&e.constructor!==null&&!Po(e.constructor)&&Ot(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Eu=Xt("ArrayBuffer");function Hh(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Eu(e.buffer),t}const Wh=Os("string"),Ot=Os("function"),vu=Os("number"),Fs=e=>e!==null&&typeof e=="object",Zh=e=>e===!0||e===!1,ks=e=>{if(Ls(e)!=="object")return!1;const t=vi(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Xh=Xt("Date"),zh=Xt("File"),Yh=Xt("Blob"),Jh=Xt("FileList"),qh=e=>Fs(e)&&Ot(e.pipe),Qh=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ot(e.append)&&((t=Ls(e))==="formdata"||t==="object"&&Ot(e.toString)&&e.toString()==="[object FormData]"))},$h=Xt("URLSearchParams"),[Uh,Kh,eg,tg]=["ReadableStream","Request","Response","Headers"].map(Xt),ng=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function jo(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),Hr(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),a=s.length;let i;for(r=0;r<a;r++)i=s[r],t.call(null,e[i],i,e)}}function wu(e,t){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 lr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:ge,Iu=e=>!Po(e)&&e!==lr;function wi(){const{caseless:e}=Iu(this)&&this||{},t={},n=(r,o)=>{const s=e&&wu(t,o)||o;ks(t[s])&&ks(r)?t[s]=wi(t[s],r):ks(r)?t[s]=wi({},r):Hr(r)?t[s]=r.slice():t[s]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&jo(arguments[r],n);return t}const rg=(e,t,n,{allOwnKeys:r}={})=>(jo(t,(o,s)=>{n&&Ot(o)?e[s]=xu(o,n):e[s]=o},{allOwnKeys:r}),e),og=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),sg=(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)},ag=(e,t,n,r)=>{let o,s,a;const i={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)a=o[s],(!r||r(a,e,t))&&!i[a]&&(t[a]=e[a],i[a]=!0);e=n!==!1&&vi(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},ig=(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},cg=e=>{if(!e)return null;if(Hr(e))return e;let t=e.length;if(!vu(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},lg=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&vi(Uint8Array)),ug=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=r.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},dg=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},fg=Xt("HTMLFormElement"),pg=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),_u=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),hg=Xt("RegExp"),Su=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};jo(n,(o,s)=>{let a;(a=t(o,s,e))!==!1&&(r[s]=a||o)}),Object.defineProperties(e,r)},gg=e=>{Su(e,(t,n)=>{if(Ot(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Ot(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+"'")})}})},mg=(e,t)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return Hr(e)?r(e):r(String(e).split(t)),n},bg=()=>{},yg=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Ii="abcdefghijklmnopqrstuvwxyz",Tu="0123456789",Au={DIGIT:Tu,ALPHA:Ii,ALPHA_DIGIT:Ii+Ii.toUpperCase()+Tu},Cg=(e=16,t=Au.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function xg(e){return!!(e&&Ot(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Eg=e=>{const t=new Array(10),n=(r,o)=>{if(Fs(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const s=Hr(r)?[]:{};return jo(r,(a,i)=>{const c=n(a,o+1);!Po(c)&&(s[i]=c)}),t[o]=void 0,s}}return r};return n(e,0)},vg=Xt("AsyncFunction"),wg=e=>e&&(Fs(e)||Ot(e))&&Ot(e.then)&&Ot(e.catch),Lu=((e,t)=>e?setImmediate:t?((n,r)=>(lr.addEventListener("message",({source:o,data:s})=>{o===lr&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),lr.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ot(lr.postMessage)),Ig=typeof queueMicrotask<"u"?queueMicrotask.bind(lr):typeof process<"u"&&process.nextTick||Lu;var P={isArray:Hr,isArrayBuffer:Eu,isBuffer:Gh,isFormData:Qh,isArrayBufferView:Hh,isString:Wh,isNumber:vu,isBoolean:Zh,isObject:Fs,isPlainObject:ks,isReadableStream:Uh,isRequest:Kh,isResponse:eg,isHeaders:tg,isUndefined:Po,isDate:Xh,isFile:zh,isBlob:Yh,isRegExp:hg,isFunction:Ot,isStream:qh,isURLSearchParams:$h,isTypedArray:lg,isFileList:Jh,forEach:jo,merge:wi,extend:rg,trim:ng,stripBOM:og,inherits:sg,toFlatObject:ag,kindOf:Ls,kindOfTest:Xt,endsWith:ig,toArray:cg,forEachEntry:ug,matchAll:dg,isHTMLForm:fg,hasOwnProperty:_u,hasOwnProp:_u,reduceDescriptors:Su,freezeMethods:gg,toObjectSet:mg,toCamelCase:pg,noop:bg,toFiniteNumber:yg,findKey:wu,global:lr,isContextDefined:Iu,ALPHABET:Au,generateString:Cg,isSpecCompliantForm:xg,toJSONObject:Eg,isAsyncFn:vg,isThenable:wg,setImmediate:Lu,asap:Ig};function me(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)}P.inherits(me,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:P.toJSONObject(this.config),code:this.code,status:this.status}}});const Ou=me.prototype,Fu={};["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=>{Fu[e]={value:e}}),Object.defineProperties(me,Fu),Object.defineProperty(Ou,"isAxiosError",{value:!0}),me.from=(e,t,n,r,o,s)=>{const a=Object.create(Ou);return P.toFlatObject(e,a,function(c){return c!==Error.prototype},i=>i!=="isAxiosError"),me.call(a,e.message,t,n,r,o),a.cause=e,a.name=e.name,s&&Object.assign(a,s),a};var _g=null;function _i(e){return P.isPlainObject(e)||P.isArray(e)}function ku(e){return P.endsWith(e,"[]")?e.slice(0,-2):e}function Du(e,t,n){return e?e.concat(t).map(function(o,s){return o=ku(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function Sg(e){return P.isArray(e)&&!e.some(_i)}const Tg=P.toFlatObject(P,{},null,function(t){return/^is[A-Z]/.test(t)});function Ds(e,t,n){if(!P.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=P.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(p,h){return!P.isUndefined(h[p])});const r=n.metaTokens,o=n.visitor||f,s=n.dots,a=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&P.isSpecCompliantForm(t);if(!P.isFunction(o))throw new TypeError("visitor must be a function");function l(b){if(b===null)return"";if(P.isDate(b))return b.toISOString();if(!c&&P.isBlob(b))throw new me("Blob is not supported. Use a Buffer instead.");return P.isArrayBuffer(b)||P.isTypedArray(b)?c&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function f(b,p,h){let m=b;if(b&&!h&&typeof b=="object"){if(P.endsWith(p,"{}"))p=r?p:p.slice(0,-2),b=JSON.stringify(b);else if(P.isArray(b)&&Sg(b)||(P.isFileList(b)||P.endsWith(p,"[]"))&&(m=P.toArray(b)))return p=ku(p),m.forEach(function(C,w){!(P.isUndefined(C)||C===null)&&t.append(a===!0?Du([p],w,s):a===null?p:p+"[]",l(C))}),!1}return _i(b)?!0:(t.append(Du(h,p,s),l(b)),!1)}const g=[],y=Object.assign(Tg,{defaultVisitor:f,convertValue:l,isVisitable:_i});function x(b,p){if(!P.isUndefined(b)){if(g.indexOf(b)!==-1)throw Error("Circular reference detected in "+p.join("."));g.push(b),P.forEach(b,function(m,E){(!(P.isUndefined(m)||m===null)&&o.call(t,m,P.isString(E)?E.trim():E,p,y))===!0&&x(m,p?p.concat(E):[E])}),g.pop()}}if(!P.isObject(e))throw new TypeError("data must be an object");return x(e),t}function Nu(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Si(e,t){this._pairs=[],e&&Ds(e,this,t)}const Ru=Si.prototype;Ru.append=function(t,n){this._pairs.push([t,n])},Ru.toString=function(t){const n=t?function(r){return t.call(this,r,Nu)}:Nu;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function Ag(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Mu(e,t,n){if(!t)return e;const r=n&&n.encode||Ag,o=n&&n.serialize;let s;if(o?s=o(t,n):s=P.isURLSearchParams(t)?t.toString():new Si(t,n).toString(r),s){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class Lg{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){P.forEach(this.handlers,function(r){r!==null&&t(r)})}}var Pu=Lg,ju={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Og=typeof URLSearchParams<"u"?URLSearchParams:Si,Fg=typeof FormData<"u"?FormData:null,kg=typeof Blob<"u"?Blob:null,Dg={isBrowser:!0,classes:{URLSearchParams:Og,FormData:Fg,Blob:kg},protocols:["http","https","file","blob","url","data"]};const Ti=typeof window<"u"&&typeof document<"u",Ai=typeof navigator=="object"&&navigator||void 0,Ng=Ti&&(!Ai||["ReactNative","NativeScript","NS"].indexOf(Ai.product)<0),Rg=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Mg=Ti&&window.location.href||"http://localhost";var Pg=Object.freeze({__proto__:null,hasBrowserEnv:Ti,hasStandardBrowserWebWorkerEnv:Rg,hasStandardBrowserEnv:Ng,navigator:Ai,origin:Mg}),bt={...Pg,...Dg};function jg(e,t){return Ds(e,new bt.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,s){return bt.isNode&&P.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function Bg(e){return P.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Vg(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 Bu(e){function t(n,r,o,s){let a=n[s++];if(a==="__proto__")return!0;const i=Number.isFinite(+a),c=s>=n.length;return a=!a&&P.isArray(o)?o.length:a,c?(P.hasOwnProp(o,a)?o[a]=[o[a],r]:o[a]=r,!i):((!o[a]||!P.isObject(o[a]))&&(o[a]=[]),t(n,r,o[a],s)&&P.isArray(o[a])&&(o[a]=Vg(o[a])),!i)}if(P.isFormData(e)&&P.isFunction(e.entries)){const n={};return P.forEachEntry(e,(r,o)=>{t(Bg(r),o,n,0)}),n}return null}function Gg(e,t,n){if(P.isString(e))try{return(t||JSON.parse)(e),P.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const Li={transitional:ju,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=P.isObject(t);if(s&&P.isHTMLForm(t)&&(t=new FormData(t)),P.isFormData(t))return o?JSON.stringify(Bu(t)):t;if(P.isArrayBuffer(t)||P.isBuffer(t)||P.isStream(t)||P.isFile(t)||P.isBlob(t)||P.isReadableStream(t))return t;if(P.isArrayBufferView(t))return t.buffer;if(P.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return jg(t,this.formSerializer).toString();if((i=P.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Ds(i?{"files[]":t}:t,c&&new c,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),Gg(t)):t}],transformResponse:[function(t){const n=this.transitional||Li.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(P.isResponse(t)||P.isReadableStream(t))return t;if(t&&P.isString(t)&&(r&&!this.responseType||o)){const a=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(i){if(a)throw i.name==="SyntaxError"?me.from(i,me.ERR_BAD_RESPONSE,this,null,this.response):i}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:bt.classes.FormData,Blob:bt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};P.forEach(["delete","get","head","post","put","patch"],e=>{Li.headers[e]={}});var Oi=Li;const Hg=P.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"]);var Wg=e=>{const t={};let n,r,o;return e&&e.split(`
30
+ <%s key={someKey} {...props} />`,wl,jr,UA,jr),$e[jr+wl]=!0}}return O===r?_e(he):ae(he),he}}function St(O,Z,$){return it(O,Z,$,!0)}function yn(O,Z,$){return it(O,Z,$,!1)}var mt=yn,Fn=St;Lo.Fragment=r,Lo.jsx=mt,Lo.jsxs=Fn}()),Lo}process.env.NODE_ENV==="production"?Ja.exports=S2():Ja.exports=T2();var d=Ja.exports;function Rl(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=Rl(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Dn(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Rl(e))&&(r&&(r+=" "),r+=t);return r}const Oo=e=>typeof e=="number"&&!isNaN(e),rr=e=>typeof e=="string",Lt=e=>typeof e=="function",ps=e=>rr(e)||Lt(e)?e:null,qa=e=>I.isValidElement(e)||rr(e)||Lt(e)||Oo(e);function A2(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:o}=e;requestAnimationFrame(()=>{o.minHeight="initial",o.height=r+"px",o.transition=`all ${n}ms`,requestAnimationFrame(()=>{o.height="0",o.padding="0",o.margin="0",setTimeout(t,n)})})}function hs(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:o=!0,collapseDuration:s=300}=e;return function(a){let{children:i,position:c,preventExitTransition:l,done:f,nodeRef:g,isIn:y,playToast:x}=a;const b=r?`${t}--${c}`:t,p=r?`${n}--${c}`:n,h=I.useRef(0);return I.useLayoutEffect(()=>{const m=g.current,E=b.split(" "),C=w=>{w.target===g.current&&(x(),m.removeEventListener("animationend",C),m.removeEventListener("animationcancel",C),h.current===0&&w.type!=="animationcancel"&&m.classList.remove(...E))};m.classList.add(...E),m.addEventListener("animationend",C),m.addEventListener("animationcancel",C)},[]),I.useEffect(()=>{const m=g.current,E=()=>{m.removeEventListener("animationend",E),o?A2(m,f,s):f()};y||(l?E():(h.current=1,m.className+=` ${p}`,m.addEventListener("animationend",E)))},[y]),I.createElement(I.Fragment,null,i)}}function Ml(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const ut=new Map;let Fo=[];const Qa=new Set,L2=e=>Qa.forEach(t=>t(e)),Pl=()=>ut.size>0;function jl(e,t){var n;if(t)return!((n=ut.get(t))==null||!n.isToastActive(e));let r=!1;return ut.forEach(o=>{o.isToastActive(e)&&(r=!0)}),r}function Bl(e,t){qa(e)&&(Pl()||Fo.push({content:e,options:t}),ut.forEach(n=>{n.buildToast(e,t)}))}function Vl(e,t){ut.forEach(n=>{t!=null&&t!=null&&t.containerId?(t==null?void 0:t.containerId)===n.id&&n.toggle(e,t==null?void 0:t.id):n.toggle(e,t==null?void 0:t.id)})}function O2(e){const{subscribe:t,getSnapshot:n,setProps:r}=I.useRef(function(s){const a=s.containerId||1;return{subscribe(i){const c=function(f,g,y){let x=1,b=0,p=[],h=[],m=[],E=g;const C=new Map,w=new Set,v=()=>{m=Array.from(C.values()),w.forEach(S=>S())},_=S=>{h=S==null?[]:h.filter(L=>L!==S),v()},T=S=>{const{toastId:L,onOpen:N,updateId:k,children:D}=S.props,M=k==null;S.staleId&&C.delete(S.staleId),C.set(L,S),h=[...h,S.props.toastId].filter(j=>j!==S.staleId),v(),y(Ml(S,M?"added":"updated")),M&&Lt(N)&&N(I.isValidElement(D)&&D.props)};return{id:f,props:E,observe:S=>(w.add(S),()=>w.delete(S)),toggle:(S,L)=>{C.forEach(N=>{L!=null&&L!==N.props.toastId||Lt(N.toggle)&&N.toggle(S)})},removeToast:_,toasts:C,clearQueue:()=>{b-=p.length,p=[]},buildToast:(S,L)=>{if((V=>{let{containerId:R,toastId:G,updateId:W}=V;const U=R?R!==f:f!==1,Q=C.has(G)&&W==null;return U||Q})(L))return;const{toastId:N,updateId:k,data:D,staleId:M,delay:j}=L,J=()=>{_(N)},Y=k==null;Y&&b++;const z={...E,style:E.toastStyle,key:x++,...Object.fromEntries(Object.entries(L).filter(V=>{let[R,G]=V;return G!=null})),toastId:N,updateId:k,data:D,closeToast:J,isIn:!1,className:ps(L.className||E.toastClassName),bodyClassName:ps(L.bodyClassName||E.bodyClassName),progressClassName:ps(L.progressClassName||E.progressClassName),autoClose:!L.isLoading&&(H=L.autoClose,q=E.autoClose,H===!1||Oo(H)&&H>0?H:q),deleteToast(){const V=C.get(N),{onClose:R,children:G}=V.props;Lt(R)&&R(I.isValidElement(G)&&G.props),y(Ml(V,"removed")),C.delete(N),b--,b<0&&(b=0),p.length>0?T(p.shift()):v()}};var H,q;z.closeButton=E.closeButton,L.closeButton===!1||qa(L.closeButton)?z.closeButton=L.closeButton:L.closeButton===!0&&(z.closeButton=!qa(E.closeButton)||E.closeButton);let ne=S;I.isValidElement(S)&&!rr(S.type)?ne=I.cloneElement(S,{closeToast:J,toastProps:z,data:D}):Lt(S)&&(ne=S({closeToast:J,toastProps:z,data:D}));const ce={content:ne,props:z,staleId:M};E.limit&&E.limit>0&&b>E.limit&&Y?p.push(ce):Oo(j)?setTimeout(()=>{T(ce)},j):T(ce)},setProps(S){E=S},setToggle:(S,L)=>{C.get(S).toggle=L},isToastActive:S=>h.some(L=>L===S),getSnapshot:()=>E.newestOnTop?m.reverse():m}}(a,s,L2);ut.set(a,c);const l=c.observe(i);return Fo.forEach(f=>Bl(f.content,f.options)),Fo=[],()=>{l(),ut.delete(a)}},setProps(i){var c;(c=ut.get(a))==null||c.setProps(i)},getSnapshot(){var i;return(i=ut.get(a))==null?void 0:i.getSnapshot()}}}(e)).current;r(e);const o=I.useSyncExternalStore(t,n,n);return{getToastToRender:function(s){if(!o)return[];const a=new Map;return o.forEach(i=>{const{position:c}=i.props;a.has(c)||a.set(c,[]),a.get(c).push(i)}),Array.from(a,i=>s(i[0],i[1]))},isToastActive:jl,count:o==null?void 0:o.length}}function F2(e){const[t,n]=I.useState(!1),[r,o]=I.useState(!1),s=I.useRef(null),a=I.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:i,pauseOnHover:c,closeToast:l,onClick:f,closeOnClick:g}=e;var y,x;function b(){n(!0)}function p(){n(!1)}function h(C){const w=s.current;a.canDrag&&w&&(a.didMove=!0,t&&p(),a.delta=e.draggableDirection==="x"?C.clientX-a.start:C.clientY-a.start,a.start!==C.clientX&&(a.canCloseOnClick=!1),w.style.transform=`translate3d(${e.draggableDirection==="x"?`${a.delta}px, var(--y)`:`0, calc(${a.delta}px + var(--y))`},0)`,w.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function m(){document.removeEventListener("pointermove",h),document.removeEventListener("pointerup",m);const C=s.current;if(a.canDrag&&a.didMove&&C){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return o(!0),e.closeToast(),void e.collapseAll();C.style.transition="transform 0.2s, opacity 0.2s",C.style.removeProperty("transform"),C.style.removeProperty("opacity")}}(x=ut.get((y={id:e.toastId,containerId:e.containerId,fn:n}).containerId||1))==null||x.setToggle(y.id,y.fn),I.useEffect(()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||p(),window.addEventListener("focus",b),window.addEventListener("blur",p),()=>{window.removeEventListener("focus",b),window.removeEventListener("blur",p)}},[e.pauseOnFocusLoss]);const E={onPointerDown:function(C){if(e.draggable===!0||e.draggable===C.pointerType){a.didMove=!1,document.addEventListener("pointermove",h),document.addEventListener("pointerup",m);const w=s.current;a.canCloseOnClick=!0,a.canDrag=!0,w.style.transition="none",e.draggableDirection==="x"?(a.start=C.clientX,a.removalDistance=w.offsetWidth*(e.draggablePercent/100)):(a.start=C.clientY,a.removalDistance=w.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(C){const{top:w,bottom:v,left:_,right:T}=s.current.getBoundingClientRect();C.nativeEvent.type!=="touchend"&&e.pauseOnHover&&C.clientX>=_&&C.clientX<=T&&C.clientY>=w&&C.clientY<=v?p():b()}};return i&&c&&(E.onMouseEnter=p,e.stacked||(E.onMouseLeave=b)),g&&(E.onClick=C=>{f&&f(C),a.canCloseOnClick&&l()}),{playToast:b,pauseToast:p,isRunning:t,preventExitTransition:r,toastRef:s,eventHandlers:E}}function k2(e){let{delay:t,isRunning:n,closeToast:r,type:o="default",hide:s,className:a,style:i,controlledProgress:c,progress:l,rtl:f,isIn:g,theme:y}=e;const x=s||c&&l===0,b={...i,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused"};c&&(b.transform=`scaleX(${l})`);const p=Dn("Toastify__progress-bar",c?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${y}`,`Toastify__progress-bar--${o}`,{"Toastify__progress-bar--rtl":f}),h=Lt(a)?a({rtl:f,type:o,defaultClassName:p}):Dn(p,a),m={[c&&l>=1?"onTransitionEnd":"onAnimationEnd"]:c&&l<1?null:()=>{g&&r()}};return I.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":x},I.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${y} Toastify__progress-bar--${o}`}),I.createElement("div",{role:"progressbar","aria-hidden":x?"true":"false","aria-label":"notification timer",className:h,style:b,...m}))}let D2=1;const Gl=()=>""+D2++;function N2(e){return e&&(rr(e.toastId)||Oo(e.toastId))?e.toastId:Gl()}function ko(e,t){return Bl(e,t),t.toastId}function gs(e,t){return{...t,type:t&&t.type||e,toastId:N2(t)}}function ms(e){return(t,n)=>ko(t,gs(e,n))}function Oe(e,t){return ko(e,gs("default",t))}Oe.loading=(e,t)=>ko(e,gs("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),Oe.promise=function(e,t,n){let r,{pending:o,error:s,success:a}=t;o&&(r=rr(o)?Oe.loading(o,n):Oe.loading(o.render,{...n,...o}));const i={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},c=(f,g,y)=>{if(g==null)return void Oe.dismiss(r);const x={type:f,...i,...n,data:y},b=rr(g)?{render:g}:g;return r?Oe.update(r,{...x,...b}):Oe(b.render,{...x,...b}),y},l=Lt(e)?e():e;return l.then(f=>c("success",a,f)).catch(f=>c("error",s,f)),l},Oe.success=ms("success"),Oe.info=ms("info"),Oe.error=ms("error"),Oe.warning=ms("warning"),Oe.warn=Oe.warning,Oe.dark=(e,t)=>ko(e,gs("default",{theme:"dark",...t})),Oe.dismiss=function(e){(function(t){var n;if(Pl()){if(t==null||rr(n=t)||Oo(n))ut.forEach(r=>{r.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){const r=ut.get(t.containerId);r?r.removeToast(t.id):ut.forEach(o=>{o.removeToast(t.id)})}}else Fo=Fo.filter(r=>t!=null&&r.options.toastId!==t)})(e)},Oe.clearWaitingQueue=function(e){e===void 0&&(e={}),ut.forEach(t=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()})},Oe.isActive=jl,Oe.update=function(e,t){t===void 0&&(t={});const n=((r,o)=>{var s;let{containerId:a}=o;return(s=ut.get(a||1))==null?void 0:s.toasts.get(r)})(e,t);if(n){const{props:r,content:o}=n,s={delay:100,...r,...t,toastId:t.toastId||e,updateId:Gl()};s.toastId!==e&&(s.staleId=e);const a=s.render||o;delete s.render,ko(a,s)}},Oe.done=e=>{Oe.update(e,{progress:1})},Oe.onChange=function(e){return Qa.add(e),()=>{Qa.delete(e)}},Oe.play=e=>Vl(!0,e),Oe.pause=e=>Vl(!1,e);const R2=typeof window<"u"?I.useLayoutEffect:I.useEffect,bs=e=>{let{theme:t,type:n,isLoading:r,...o}=e;return I.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...o})},$a={info:function(e){return I.createElement(bs,{...e},I.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return I.createElement(bs,{...e},I.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return I.createElement(bs,{...e},I.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return I.createElement(bs,{...e},I.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return I.createElement("div",{className:"Toastify__spinner"})}},M2=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:o,playToast:s}=F2(e),{closeButton:a,children:i,autoClose:c,onClick:l,type:f,hideProgressBar:g,closeToast:y,transition:x,position:b,className:p,style:h,bodyClassName:m,bodyStyle:E,progressClassName:C,progressStyle:w,updateId:v,role:_,progress:T,rtl:S,toastId:L,deleteToast:N,isIn:k,isLoading:D,closeOnClick:M,theme:j}=e,J=Dn("Toastify__toast",`Toastify__toast-theme--${j}`,`Toastify__toast--${f}`,{"Toastify__toast--rtl":S},{"Toastify__toast--close-on-click":M}),Y=Lt(p)?p({rtl:S,position:b,type:f,defaultClassName:J}):Dn(J,p),z=function(ce){let{theme:V,type:R,isLoading:G,icon:W}=ce,U=null;const Q={theme:V,type:R};return W===!1||(Lt(W)?U=W({...Q,isLoading:G}):I.isValidElement(W)?U=I.cloneElement(W,Q):G?U=$a.spinner():(re=>re in $a)(R)&&(U=$a[R](Q))),U}(e),H=!!T||!c,q={closeToast:y,type:f,theme:j};let ne=null;return a===!1||(ne=Lt(a)?a(q):I.isValidElement(a)?I.cloneElement(a,q):function(ce){let{closeToast:V,theme:R,ariaLabel:G="close"}=ce;return I.createElement("button",{className:`Toastify__close-button Toastify__close-button--${R}`,type:"button",onClick:W=>{W.stopPropagation(),V(W)},"aria-label":G},I.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},I.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(q)),I.createElement(x,{isIn:k,done:N,position:b,preventExitTransition:n,nodeRef:r,playToast:s},I.createElement("div",{id:L,onClick:l,"data-in":k,className:Y,...o,style:h,ref:r},I.createElement("div",{...k&&{role:_},className:Lt(m)?m({type:f}):Dn("Toastify__toast-body",m),style:E},z!=null&&I.createElement("div",{className:Dn("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!D})},z),I.createElement("div",null,i)),ne,I.createElement(k2,{...v&&!H?{key:`pb-${v}`}:{},rtl:S,theme:j,delay:c,isRunning:t,isIn:k,closeToast:y,hide:g,type:f,style:w,className:C,controlledProgress:H,progress:T||0})))},ys=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},P2=hs(ys("bounce",!0));hs(ys("slide",!0)),hs(ys("zoom")),hs(ys("flip"));const j2={position:"top-right",transition:P2,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function Ua(e){let t={...j2,...e};const n=e.stacked,[r,o]=I.useState(!0),s=I.useRef(null),{getToastToRender:a,isToastActive:i,count:c}=O2(t),{className:l,style:f,rtl:g,containerId:y}=t;function x(p){const h=Dn("Toastify__toast-container",`Toastify__toast-container--${p}`,{"Toastify__toast-container--rtl":g});return Lt(l)?l({position:p,rtl:g,defaultClassName:h}):Dn(h,ps(l))}function b(){n&&(o(!0),Oe.play())}return R2(()=>{if(n){var p;const h=s.current.querySelectorAll('[data-in="true"]'),m=12,E=(p=t.position)==null?void 0:p.includes("top");let C=0,w=0;Array.from(h).reverse().forEach((v,_)=>{const T=v;T.classList.add("Toastify__toast--stacked"),_>0&&(T.dataset.collapsed=`${r}`),T.dataset.pos||(T.dataset.pos=E?"top":"bot");const S=C*(r?.2:1)+(r?0:m*_);T.style.setProperty("--y",`${E?S:-1*S}px`),T.style.setProperty("--g",`${m}`),T.style.setProperty("--s",""+(1-(r?w:0))),C+=T.offsetHeight,w+=.025})}},[r,c,n]),I.createElement("div",{ref:s,className:"Toastify",id:y,onMouseEnter:()=>{n&&(o(!1),Oe.pause())},onMouseLeave:b},a((p,h)=>{const m=h.length?{...f}:{...f,pointerEvents:"none"};return I.createElement("div",{className:x(p),style:m,key:`container-${p}`},h.map(E=>{let{content:C,props:w}=E;return I.createElement(M2,{...w,stacked:n,collapseAll:b,isIn:i(w.toastId,w.containerId),style:w.style,key:`toast-${w.key}`},C)}))}))}var Br=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},or=typeof window>"u"||"Deno"in globalThis;function jt(){}function B2(e,t){return typeof e=="function"?e(t):e}function Ka(e){return typeof e=="number"&&e>=0&&e!==1/0}function Hl(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Vr(e,t){return typeof e=="function"?e(t):e}function Ht(e,t){return typeof e=="function"?e(t):e}function Wl(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:a,stale:i}=e;if(a){if(r){if(t.queryHash!==ei(a,t.options))return!1}else if(!Do(t.queryKey,a))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||o&&o!==t.state.fetchStatus||s&&!s(t))}function Zl(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(sr(t.options.mutationKey)!==sr(s))return!1}else if(!Do(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function ei(e,t){return((t==null?void 0:t.queryKeyHashFn)||sr)(e)}function sr(e){return JSON.stringify(e,(t,n)=>ni(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Do(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Do(e[n],t[n])):!1}function ti(e,t){if(e===t)return e;const n=Xl(e)&&Xl(t);if(n||ni(e)&&ni(t)){const r=n?e:Object.keys(e),o=r.length,s=n?t:Object.keys(t),a=s.length,i=n?[]:{};let c=0;for(let l=0;l<a;l++){const f=n?l:s[l];(!n&&r.includes(f)||n)&&e[f]===void 0&&t[f]===void 0?(i[f]=void 0,c++):(i[f]=ti(e[f],t[f]),i[f]===e[f]&&e[f]!==void 0&&c++)}return o===a&&c===o?e:i}return t}function Cs(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Xl(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ni(e){if(!zl(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!zl(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function zl(e){return Object.prototype.toString.call(e)==="[object Object]"}function V2(e){return new Promise(t=>{setTimeout(t,e)})}function ri(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return ti(e,t)}catch(r){console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`)}return ti(e,t)}return t}function G2(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function H2(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var xs=Symbol();function Yl(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===xs&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===xs?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var W2=(h2=class extends Br{constructor(){super();ue(this,wr);ue(this,Hn);ue(this,co);K(this,co,t=>{if(!or&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){F(this,Hn)||this.setEventListener(F(this,co))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,Hn))==null||t.call(this),K(this,Hn,void 0))}setEventListener(t){var n;K(this,co,t),(n=F(this,Hn))==null||n.call(this),K(this,Hn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){F(this,wr)!==t&&(K(this,wr,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof F(this,wr)=="boolean"?F(this,wr):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},wr=new WeakMap,Hn=new WeakMap,co=new WeakMap,h2),oi=new W2,Z2=(g2=class extends Br{constructor(){super();ue(this,lo,!0);ue(this,Wn);ue(this,uo);K(this,uo,t=>{if(!or&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){F(this,Wn)||this.setEventListener(F(this,uo))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,Wn))==null||t.call(this),K(this,Wn,void 0))}setEventListener(t){var n;K(this,uo,t),(n=F(this,Wn))==null||n.call(this),K(this,Wn,t(this.setOnline.bind(this)))}setOnline(t){F(this,lo)!==t&&(K(this,lo,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return F(this,lo)}},lo=new WeakMap,Wn=new WeakMap,uo=new WeakMap,g2),Es=new Z2;function si(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function X2(e){return Math.min(1e3*2**e,3e4)}function Jl(e){return(e??"online")==="online"?Es.isOnline():!0}var ql=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function ai(e){return e instanceof ql}function Ql(e){let t=!1,n=0,r=!1,o;const s=si(),a=p=>{var h;r||(y(new ql(p)),(h=e.abort)==null||h.call(e))},i=()=>{t=!0},c=()=>{t=!1},l=()=>oi.isFocused()&&(e.networkMode==="always"||Es.isOnline())&&e.canRun(),f=()=>Jl(e.networkMode)&&e.canRun(),g=p=>{var h;r||(r=!0,(h=e.onSuccess)==null||h.call(e,p),o==null||o(),s.resolve(p))},y=p=>{var h;r||(r=!0,(h=e.onError)==null||h.call(e,p),o==null||o(),s.reject(p))},x=()=>new Promise(p=>{var h;o=m=>{(r||l())&&p(m)},(h=e.onPause)==null||h.call(e)}).then(()=>{var p;o=void 0,r||(p=e.onContinue)==null||p.call(e)}),b=()=>{if(r)return;let p;const h=n===0?e.initialPromise:void 0;try{p=h??e.fn()}catch(m){p=Promise.reject(m)}Promise.resolve(p).then(g).catch(m=>{var _;if(r)return;const E=e.retry??(or?0:3),C=e.retryDelay??X2,w=typeof C=="function"?C(n,m):C,v=E===!0||typeof E=="number"&&n<E||typeof E=="function"&&E(n,m);if(t||!v){y(m);return}n++,(_=e.onFail)==null||_.call(e,n,m),V2(w).then(()=>l()?void 0:x()).then(()=>{t?y(m):b()})})};return{promise:s,cancel:a,continue:()=>(o==null||o(),s),cancelRetry:i,continueRetry:c,canStart:f,start:()=>(f()?b():x().then(b),s)}}function z2(){let e=[],t=0,n=i=>{i()},r=i=>{i()},o=i=>setTimeout(i,0);const s=i=>{t?e.push(i):o(()=>{n(i)})},a=()=>{const i=e;e=[],i.length&&o(()=>{r(()=>{i.forEach(c=>{n(c)})})})};return{batch:i=>{let c;t++;try{c=i()}finally{t--,t||a()}return c},batchCalls:i=>(...c)=>{s(()=>{i(...c)})},schedule:s,setNotifyFunction:i=>{n=i},setBatchNotifyFunction:i=>{r=i},setScheduler:i=>{o=i}}}var Ue=z2(),$l=(m2=class{constructor(){ue(this,Ir)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ka(this.gcTime)&&K(this,Ir,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(or?1/0:5*60*1e3))}clearGcTimeout(){F(this,Ir)&&(clearTimeout(F(this,Ir)),K(this,Ir,void 0))}},Ir=new WeakMap,m2),Y2=(b2=class extends $l{constructor(t){super();ue(this,tn);ue(this,fo);ue(this,po);ue(this,Bt);ue(this,_r);ue(this,lt);ue(this,as);ue(this,Sr);K(this,Sr,!1),K(this,as,t.defaultOptions),this.setOptions(t.options),this.observers=[],K(this,_r,t.client),K(this,Bt,F(this,_r).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,K(this,fo,J2(this.options)),this.state=t.state??F(this,fo),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=F(this,lt))==null?void 0:t.promise}setOptions(t){this.options={...F(this,as),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&F(this,Bt).remove(this)}setData(t,n){const r=ri(this.state.data,t,this.options);return be(this,tn,kn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){be(this,tn,kn).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=F(this,lt))==null?void 0:r.promise;return(o=F(this,lt))==null||o.cancel(t),n?n.then(jt).catch(jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(F(this,fo))}isActive(){return this.observers.some(t=>Ht(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===xs||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!Hl(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=F(this,lt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=F(this,lt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),F(this,Bt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(F(this,lt)&&(F(this,Sr)?F(this,lt).cancel({revert:!0}):F(this,lt).cancelRetry()),this.scheduleGc()),F(this,Bt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||be(this,tn,kn).call(this,{type:"invalidate"})}fetch(t,n){var c,l,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(F(this,lt))return F(this,lt).continueRetry(),F(this,lt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const g=this.observers.find(y=>y.options.queryFn);g&&this.setOptions(g.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(K(this,Sr,!0),r.signal)})},s=()=>{const g=Yl(this.options,n),y={client:F(this,_r),queryKey:this.queryKey,meta:this.meta};return o(y),K(this,Sr,!1),this.options.persister?this.options.persister(g,y,this):g(y)},a={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:F(this,_r),state:this.state,fetchFn:s};o(a),(c=this.options.behavior)==null||c.onFetch(a,this),K(this,po,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((l=a.fetchOptions)==null?void 0:l.meta))&&be(this,tn,kn).call(this,{type:"fetch",meta:(f=a.fetchOptions)==null?void 0:f.meta});const i=g=>{var y,x,b,p;ai(g)&&g.silent||be(this,tn,kn).call(this,{type:"error",error:g}),ai(g)||((x=(y=F(this,Bt).config).onError)==null||x.call(y,g,this),(p=(b=F(this,Bt).config).onSettled)==null||p.call(b,this.state.data,g,this)),this.scheduleGc()};return K(this,lt,Ql({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:g=>{var y,x,b,p;if(g===void 0){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),i(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(g)}catch(h){i(h);return}(x=(y=F(this,Bt).config).onSuccess)==null||x.call(y,g,this),(p=(b=F(this,Bt).config).onSettled)==null||p.call(b,g,this.state.error,this),this.scheduleGc()},onError:i,onFail:(g,y)=>{be(this,tn,kn).call(this,{type:"failed",failureCount:g,error:y})},onPause:()=>{be(this,tn,kn).call(this,{type:"pause"})},onContinue:()=>{be(this,tn,kn).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),F(this,lt).start()}},fo=new WeakMap,po=new WeakMap,Bt=new WeakMap,_r=new WeakMap,lt=new WeakMap,as=new WeakMap,Sr=new WeakMap,tn=new WeakSet,kn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Ul(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return ai(o)&&o.revert&&F(this,po)?{...F(this,po),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Ue.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),F(this,Bt).notify({query:this,type:"updated",action:t})})},b2);function Ul(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Jl(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function J2(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var q2=(y2=class extends Br{constructor(t={}){super();ue(this,dn);this.config=t,K(this,dn,new Map)}build(t,n,r){const o=n.queryKey,s=n.queryHash??ei(o,n);let a=this.get(s);return a||(a=new Y2({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(a)),a}add(t){F(this,dn).has(t.queryHash)||(F(this,dn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=F(this,dn).get(t.queryHash);n&&(t.destroy(),n===t&&F(this,dn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ue.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return F(this,dn).get(t)}getAll(){return[...F(this,dn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Wl(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Wl(t,r)):n}notify(t){Ue.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Ue.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ue.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},dn=new WeakMap,y2),Q2=(C2=class extends $l{constructor(t){super();ue(this,pn);ue(this,fn);ue(this,dt);ue(this,Tr);this.mutationId=t.mutationId,K(this,dt,t.mutationCache),K(this,fn,[]),this.state=t.state||Kl(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){F(this,fn).includes(t)||(F(this,fn).push(t),this.clearGcTimeout(),F(this,dt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){K(this,fn,F(this,fn).filter(n=>n!==t)),this.scheduleGc(),F(this,dt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){F(this,fn).length||(this.state.status==="pending"?this.scheduleGc():F(this,dt).remove(this))}continue(){var t;return((t=F(this,Tr))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,s,a,i,c,l,f,g,y,x,b,p,h,m,E,C,w,v,_,T;K(this,Tr,Ql({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(S,L)=>{be(this,pn,nr).call(this,{type:"failed",failureCount:S,error:L})},onPause:()=>{be(this,pn,nr).call(this,{type:"pause"})},onContinue:()=>{be(this,pn,nr).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>F(this,dt).canRun(this)}));const n=this.state.status==="pending",r=!F(this,Tr).canStart();try{if(!n){be(this,pn,nr).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(o=F(this,dt).config).onMutate)==null?void 0:s.call(o,t,this));const L=await((i=(a=this.options).onMutate)==null?void 0:i.call(a,t));L!==this.state.context&&be(this,pn,nr).call(this,{type:"pending",context:L,variables:t,isPaused:r})}const S=await F(this,Tr).start();return await((l=(c=F(this,dt).config).onSuccess)==null?void 0:l.call(c,S,t,this.state.context,this)),await((g=(f=this.options).onSuccess)==null?void 0:g.call(f,S,t,this.state.context)),await((x=(y=F(this,dt).config).onSettled)==null?void 0:x.call(y,S,null,this.state.variables,this.state.context,this)),await((p=(b=this.options).onSettled)==null?void 0:p.call(b,S,null,t,this.state.context)),be(this,pn,nr).call(this,{type:"success",data:S}),S}catch(S){try{throw await((m=(h=F(this,dt).config).onError)==null?void 0:m.call(h,S,t,this.state.context,this)),await((C=(E=this.options).onError)==null?void 0:C.call(E,S,t,this.state.context)),await((v=(w=F(this,dt).config).onSettled)==null?void 0:v.call(w,void 0,S,this.state.variables,this.state.context,this)),await((T=(_=this.options).onSettled)==null?void 0:T.call(_,void 0,S,t,this.state.context)),S}finally{be(this,pn,nr).call(this,{type:"error",error:S})}}finally{F(this,dt).runNext(this)}}},fn=new WeakMap,dt=new WeakMap,Tr=new WeakMap,pn=new WeakSet,nr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Ue.batch(()=>{F(this,fn).forEach(r=>{r.onMutationUpdate(t)}),F(this,dt).notify({mutation:this,type:"updated",action:t})})},C2);function Kl(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $2=(x2=class extends Br{constructor(t={}){super();ue(this,_n);ue(this,nn);ue(this,is);this.config=t,K(this,_n,new Set),K(this,nn,new Map),K(this,is,0)}build(t,n,r){const o=new Q2({mutationCache:this,mutationId:++Xa(this,is)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){F(this,_n).add(t);const n=vs(t);if(typeof n=="string"){const r=F(this,nn).get(n);r?r.push(t):F(this,nn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(F(this,_n).delete(t)){const n=vs(t);if(typeof n=="string"){const r=F(this,nn).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&F(this,nn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=vs(t);if(typeof n=="string"){const r=F(this,nn).get(n),o=r==null?void 0:r.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=vs(t);if(typeof n=="string"){const o=(r=F(this,nn).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ue.batch(()=>{F(this,_n).forEach(t=>{this.notify({type:"removed",mutation:t})}),F(this,_n).clear(),F(this,nn).clear()})}getAll(){return Array.from(F(this,_n))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Zl(n,r))}findAll(t={}){return this.getAll().filter(n=>Zl(t,n))}notify(t){Ue.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Ue.batch(()=>Promise.all(t.map(n=>n.continue().catch(jt))))}},_n=new WeakMap,nn=new WeakMap,is=new WeakMap,x2);function vs(e){var t;return(t=e.options.scope)==null?void 0:t.id}function ws(e){return{onFetch:(t,n)=>{var f,g,y,x,b;const r=t.options,o=(y=(g=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:g.fetchMore)==null?void 0:y.direction,s=((x=t.state.data)==null?void 0:x.pages)||[],a=((b=t.state.data)==null?void 0:b.pageParams)||[];let i={pages:[],pageParams:[]},c=0;const l=async()=>{let p=!1;const h=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},m=Yl(t.options,t.fetchOptions),E=async(C,w,v)=>{if(p)return Promise.reject();if(w==null&&C.pages.length)return Promise.resolve(C);const _={client:t.client,queryKey:t.queryKey,pageParam:w,direction:v?"backward":"forward",meta:t.options.meta};h(_);const T=await m(_),{maxPages:S}=t.options,L=v?H2:G2;return{pages:L(C.pages,T,S),pageParams:L(C.pageParams,w,S)}};if(o&&s.length){const C=o==="backward",w=C?eu:ii,v={pages:s,pageParams:a},_=w(r,v);i=await E(v,_,C)}else{const C=e??s.length;do{const w=c===0?a[0]??r.initialPageParam:ii(r,i);if(c>0&&w==null)break;i=await E(i,w),c++}while(c<C)}return i};t.options.persister?t.fetchFn=()=>{var p,h;return(h=(p=t.options).persister)==null?void 0:h.call(p,l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=l}}}function ii(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function eu(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}function U2(e,t){return t?ii(e,t)!=null:!1}function K2(e,t){return!t||!e.getPreviousPageParam?!1:eu(e,t)!=null}var eh=(E2=class{constructor(e={}){ue(this,ze);ue(this,Zn);ue(this,Xn);ue(this,ho);ue(this,go);ue(this,zn);ue(this,mo);ue(this,bo);K(this,ze,e.queryCache||new q2),K(this,Zn,e.mutationCache||new $2),K(this,Xn,e.defaultOptions||{}),K(this,ho,new Map),K(this,go,new Map),K(this,zn,0)}mount(){Xa(this,zn)._++,F(this,zn)===1&&(K(this,mo,oi.subscribe(async e=>{e&&(await this.resumePausedMutations(),F(this,ze).onFocus())})),K(this,bo,Es.subscribe(async e=>{e&&(await this.resumePausedMutations(),F(this,ze).onOnline())})))}unmount(){var e,t;Xa(this,zn)._--,F(this,zn)===0&&((e=F(this,mo))==null||e.call(this),K(this,mo,void 0),(t=F(this,bo))==null||t.call(this),K(this,bo,void 0))}isFetching(e){return F(this,ze).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return F(this,Zn).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=F(this,ze).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=F(this,ze).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Vr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return F(this,ze).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=F(this,ze).get(r.queryHash),s=o==null?void 0:o.state.data,a=B2(t,s);if(a!==void 0)return F(this,ze).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Ue.batch(()=>F(this,ze).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=F(this,ze).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=F(this,ze);Ue.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=F(this,ze);return Ue.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Ue.batch(()=>F(this,ze).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(jt).catch(jt)}invalidateQueries(e,t={}){return Ue.batch(()=>(F(this,ze).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Ue.batch(()=>F(this,ze).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(jt)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(jt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=F(this,ze).build(this,t);return n.isStaleByTime(Vr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(jt).catch(jt)}fetchInfiniteQuery(e){return e.behavior=ws(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jt).catch(jt)}ensureInfiniteQueryData(e){return e.behavior=ws(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Es.isOnline()?F(this,Zn).resumePausedMutations():Promise.resolve()}getQueryCache(){return F(this,ze)}getMutationCache(){return F(this,Zn)}getDefaultOptions(){return F(this,Xn)}setDefaultOptions(e){K(this,Xn,e)}setQueryDefaults(e,t){F(this,ho).set(sr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...F(this,ho).values()],n={};return t.forEach(r=>{Do(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){F(this,go).set(sr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...F(this,go).values()],n={};return t.forEach(r=>{Do(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...F(this,Xn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ei(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===xs&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...F(this,Xn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){F(this,ze).clear(),F(this,Zn).clear()}},ze=new WeakMap,Zn=new WeakMap,Xn=new WeakMap,ho=new WeakMap,go=new WeakMap,zn=new WeakMap,mo=new WeakMap,bo=new WeakMap,E2),tu=(v2=class extends Br{constructor(t,n){super();ue(this,Ne);ue(this,wt);ue(this,we);ue(this,cs);ue(this,ft);ue(this,Ar);ue(this,yo);ue(this,Yn);ue(this,hn);ue(this,ls);ue(this,Co);ue(this,xo);ue(this,Lr);ue(this,Or);ue(this,Jn);ue(this,Eo,new Set);this.options=n,K(this,wt,t),K(this,hn,null),K(this,Yn,si()),this.options.experimental_prefetchInRender||F(this,Yn).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(F(this,we).addObserver(this),nu(F(this,we),this.options)?be(this,Ne,ds).call(this):this.updateResult(),be(this,Ne,Al).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ci(F(this,we),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ci(F(this,we),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,be(this,Ne,Ll).call(this),be(this,Ne,Ol).call(this),F(this,we).removeObserver(this)}setOptions(t,n){const r=this.options,o=F(this,we);if(this.options=F(this,wt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ht(this.options.enabled,F(this,we))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");be(this,Ne,Fl).call(this),F(this,we).setOptions(this.options),r._defaulted&&!Cs(this.options,r)&&F(this,wt).getQueryCache().notify({type:"observerOptionsUpdated",query:F(this,we),observer:this});const s=this.hasListeners();s&&ru(F(this,we),o,this.options,r)&&be(this,Ne,ds).call(this),this.updateResult(n),s&&(F(this,we)!==o||Ht(this.options.enabled,F(this,we))!==Ht(r.enabled,F(this,we))||Vr(this.options.staleTime,F(this,we))!==Vr(r.staleTime,F(this,we)))&&be(this,Ne,_l).call(this);const a=be(this,Ne,Sl).call(this);s&&(F(this,we)!==o||Ht(this.options.enabled,F(this,we))!==Ht(r.enabled,F(this,we))||a!==F(this,Jn))&&be(this,Ne,Tl).call(this,a)}getOptimisticResult(t){const n=F(this,wt).getQueryCache().build(F(this,wt),t),r=this.createResult(n,t);return nh(this,r)&&(K(this,ft,r),K(this,yo,this.options),K(this,Ar,F(this,we).state)),r}getCurrentResult(){return F(this,ft)}trackResult(t,n){const r={};return Object.keys(t).forEach(o=>{Object.defineProperty(r,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),n==null||n(o),t[o])})}),r}trackProp(t){F(this,Eo).add(t)}getCurrentQuery(){return F(this,we)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=F(this,wt).defaultQueryOptions(t),r=F(this,wt).getQueryCache().build(F(this,wt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return be(this,Ne,ds).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),F(this,ft)))}createResult(t,n){var S;const r=F(this,we),o=this.options,s=F(this,ft),a=F(this,Ar),i=F(this,yo),l=t!==r?t.state:F(this,cs),{state:f}=t;let g={...f},y=!1,x;if(n._optimisticResults){const L=this.hasListeners(),N=!L&&nu(t,n),k=L&&ru(t,r,n,o);(N||k)&&(g={...g,...Ul(f.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:b,errorUpdatedAt:p,status:h}=g;if(n.select&&g.data!==void 0)if(s&&g.data===(a==null?void 0:a.data)&&n.select===F(this,ls))x=F(this,Co);else try{K(this,ls,n.select),x=n.select(g.data),x=ri(s==null?void 0:s.data,x,n),K(this,Co,x),K(this,hn,null)}catch(L){K(this,hn,L)}else x=g.data;if(n.placeholderData!==void 0&&x===void 0&&h==="pending"){let L;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(i==null?void 0:i.placeholderData))L=s.data;else if(L=typeof n.placeholderData=="function"?n.placeholderData((S=F(this,xo))==null?void 0:S.state.data,F(this,xo)):n.placeholderData,n.select&&L!==void 0)try{L=n.select(L),K(this,hn,null)}catch(N){K(this,hn,N)}L!==void 0&&(h="success",x=ri(s==null?void 0:s.data,L,n),y=!0)}F(this,hn)&&(b=F(this,hn),x=F(this,Co),p=Date.now(),h="error");const m=g.fetchStatus==="fetching",E=h==="pending",C=h==="error",w=E&&m,v=x!==void 0,T={status:h,fetchStatus:g.fetchStatus,isPending:E,isSuccess:h==="success",isError:C,isInitialLoading:w,isLoading:w,data:x,dataUpdatedAt:g.dataUpdatedAt,error:b,errorUpdatedAt:p,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>l.dataUpdateCount||g.errorUpdateCount>l.errorUpdateCount,isFetching:m,isRefetching:m&&!E,isLoadingError:C&&!v,isPaused:g.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:C&&v,isStale:li(t,n),refetch:this.refetch,promise:F(this,Yn)};if(this.options.experimental_prefetchInRender){const L=D=>{T.status==="error"?D.reject(T.error):T.data!==void 0&&D.resolve(T.data)},N=()=>{const D=K(this,Yn,T.promise=si());L(D)},k=F(this,Yn);switch(k.status){case"pending":t.queryHash===r.queryHash&&L(k);break;case"fulfilled":(T.status==="error"||T.data!==k.value)&&N();break;case"rejected":(T.status!=="error"||T.error!==k.reason)&&N();break}}return T}updateResult(t){const n=F(this,ft),r=this.createResult(F(this,we),this.options);if(K(this,Ar,F(this,we).state),K(this,yo,this.options),F(this,Ar).data!==void 0&&K(this,xo,F(this,we)),Cs(r,n))return;K(this,ft,r);const o={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:a}=this.options,i=typeof a=="function"?a():a;if(i==="all"||!i&&!F(this,Eo).size)return!0;const c=new Set(i??F(this,Eo));return this.options.throwOnError&&c.add("error"),Object.keys(F(this,ft)).some(l=>{const f=l;return F(this,ft)[f]!==n[f]&&c.has(f)})};(t==null?void 0:t.listeners)!==!1&&s()&&(o.listeners=!0),be(this,Ne,_2).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&be(this,Ne,Al).call(this)}},wt=new WeakMap,we=new WeakMap,cs=new WeakMap,ft=new WeakMap,Ar=new WeakMap,yo=new WeakMap,Yn=new WeakMap,hn=new WeakMap,ls=new WeakMap,Co=new WeakMap,xo=new WeakMap,Lr=new WeakMap,Or=new WeakMap,Jn=new WeakMap,Eo=new WeakMap,Ne=new WeakSet,ds=function(t){be(this,Ne,Fl).call(this);let n=F(this,we).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(jt)),n},_l=function(){be(this,Ne,Ll).call(this);const t=Vr(this.options.staleTime,F(this,we));if(or||F(this,ft).isStale||!Ka(t))return;const r=Hl(F(this,ft).dataUpdatedAt,t)+1;K(this,Lr,setTimeout(()=>{F(this,ft).isStale||this.updateResult()},r))},Sl=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(F(this,we)):this.options.refetchInterval)??!1},Tl=function(t){be(this,Ne,Ol).call(this),K(this,Jn,t),!(or||Ht(this.options.enabled,F(this,we))===!1||!Ka(F(this,Jn))||F(this,Jn)===0)&&K(this,Or,setInterval(()=>{(this.options.refetchIntervalInBackground||oi.isFocused())&&be(this,Ne,ds).call(this)},F(this,Jn)))},Al=function(){be(this,Ne,_l).call(this),be(this,Ne,Tl).call(this,be(this,Ne,Sl).call(this))},Ll=function(){F(this,Lr)&&(clearTimeout(F(this,Lr)),K(this,Lr,void 0))},Ol=function(){F(this,Or)&&(clearInterval(F(this,Or)),K(this,Or,void 0))},Fl=function(){const t=F(this,wt).getQueryCache().build(F(this,wt),this.options);if(t===F(this,we))return;const n=F(this,we);K(this,we,t),K(this,cs,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},_2=function(t){Ue.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(F(this,ft))}),F(this,wt).getQueryCache().notify({query:F(this,we),type:"observerResultsUpdated"})})},v2);function th(e,t){return Ht(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function nu(e,t){return th(e,t)||e.state.data!==void 0&&ci(e,t,t.refetchOnMount)}function ci(e,t,n){if(Ht(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&li(e,t)}return!1}function ru(e,t,n,r){return(e!==t||Ht(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&li(e,n)}function li(e,t){return Ht(t.enabled,e)!==!1&&e.isStaleByTime(Vr(t.staleTime,e))}function nh(e,t){return!Cs(e.getCurrentResult(),t)}var rh=class extends tu{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e,t){super.setOptions({...e,behavior:ws()},t)}getOptimisticResult(e){return e.behavior=ws(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var b,p;const{state:n}=e,r=super.createResult(e,t),{isFetching:o,isRefetching:s,isError:a,isRefetchError:i}=r,c=(p=(b=n.fetchMeta)==null?void 0:b.fetchMore)==null?void 0:p.direction,l=a&&c==="forward",f=o&&c==="forward",g=a&&c==="backward",y=o&&c==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:U2(t,n.data),hasPreviousPage:K2(t,n.data),isFetchNextPageError:l,isFetchingNextPage:f,isFetchPreviousPageError:g,isFetchingPreviousPage:y,isRefetchError:i&&!l&&!g,isRefetching:s&&!f&&!y}}},oh=(w2=class extends Br{constructor(n,r){super();ue(this,Tn);ue(this,qn);ue(this,Qn);ue(this,It);ue(this,Sn);K(this,qn,n),this.setOptions(r),this.bindMethods(),be(this,Tn,za).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var o;const r=this.options;this.options=F(this,qn).defaultMutationOptions(n),Cs(this.options,r)||F(this,qn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:F(this,It),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&sr(r.mutationKey)!==sr(this.options.mutationKey)?this.reset():((o=F(this,It))==null?void 0:o.state.status)==="pending"&&F(this,It).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=F(this,It))==null||n.removeObserver(this)}onMutationUpdate(n){be(this,Tn,za).call(this),be(this,Tn,kl).call(this,n)}getCurrentResult(){return F(this,Qn)}reset(){var n;(n=F(this,It))==null||n.removeObserver(this),K(this,It,void 0),be(this,Tn,za).call(this),be(this,Tn,kl).call(this)}mutate(n,r){var o;return K(this,Sn,r),(o=F(this,It))==null||o.removeObserver(this),K(this,It,F(this,qn).getMutationCache().build(F(this,qn),this.options)),F(this,It).addObserver(this),F(this,It).execute(n)}},qn=new WeakMap,Qn=new WeakMap,It=new WeakMap,Sn=new WeakMap,Tn=new WeakSet,za=function(){var r;const n=((r=F(this,It))==null?void 0:r.state)??Kl();K(this,Qn,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},kl=function(n){Ue.batch(()=>{var r,o,s,a,i,c,l,f;if(F(this,Sn)&&this.hasListeners()){const g=F(this,Qn).variables,y=F(this,Qn).context;(n==null?void 0:n.type)==="success"?((o=(r=F(this,Sn)).onSuccess)==null||o.call(r,n.data,g,y),(a=(s=F(this,Sn)).onSettled)==null||a.call(s,n.data,null,g,y)):(n==null?void 0:n.type)==="error"&&((c=(i=F(this,Sn)).onError)==null||c.call(i,n.error,g,y),(f=(l=F(this,Sn)).onSettled)==null||f.call(l,void 0,n.error,g,y))}this.listeners.forEach(g=>{g(F(this,Qn))})})},w2),ou=A.createContext(void 0),Gr=e=>{const t=A.useContext(ou);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},sh=({client:e,children:t})=>(A.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(ou.Provider,{value:e,children:t})),su=A.createContext(!1),ah=()=>A.useContext(su);su.Provider;function ih(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ch=A.createContext(ih()),lh=()=>A.useContext(ch);function au(e,t){return typeof e=="function"?e(...t):!!e}function ui(){}var uh=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},dh=e=>{A.useEffect(()=>{e.clearReset()},[e])},fh=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||au(n,[e.error,r])),ph=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},hh=(e,t)=>e.isLoading&&e.isFetching&&!t,gh=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,iu=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function cu(e,t,n){var g,y,x,b,p;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=Gr(),o=ah(),s=lh(),a=r.defaultQueryOptions(e);(y=(g=r.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||y.call(g,a),process.env.NODE_ENV!=="production"&&(a.queryFn||console.error(`[${a.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),a._optimisticResults=o?"isRestoring":"optimistic",ph(a),uh(a,s),dh(s);const i=!r.getQueryCache().get(a.queryHash),[c]=A.useState(()=>new t(r,a)),l=c.getOptimisticResult(a),f=!o&&e.subscribed!==!1;if(A.useSyncExternalStore(A.useCallback(h=>{const m=f?c.subscribe(Ue.batchCalls(h)):ui;return c.updateResult(),m},[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),A.useEffect(()=>{c.setOptions(a,{listeners:!1})},[a,c]),gh(a,l))throw iu(a,c,s);if(fh({result:l,errorResetBoundary:s,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw l.error;if((b=(x=r.getDefaultOptions().queries)==null?void 0:x._experimental_afterQuery)==null||b.call(x,a,l),a.experimental_prefetchInRender&&!or&&hh(l,o)){const h=i?iu(a,c,s):(p=r.getQueryCache().get(a.queryHash))==null?void 0:p.promise;h==null||h.catch(ui).finally(()=>{c.updateResult()})}return a.notifyOnChangeProps?l:c.trackResult(l)}function Wt(e,t){return cu(e,tu)}function Zt(e,t){const n=Gr(),[r]=A.useState(()=>new oh(n,e));A.useEffect(()=>{r.setOptions(e)},[r,e]);const o=A.useSyncExternalStore(A.useCallback(a=>r.subscribe(Ue.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=A.useCallback((a,i)=>{r.mutate(a,i).catch(ui)},[r]);if(o.error&&au(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}function mh(e,t){return cu(e,rh)}const di=(e,t)=>t.some(n=>e instanceof n);let lu,uu;function bh(){return lu||(lu=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function yh(){return uu||(uu=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const fi=new WeakMap,pi=new WeakMap,Is=new WeakMap;function Ch(e){const t=new Promise((n,r)=>{const o=()=>{e.removeEventListener("success",s),e.removeEventListener("error",a)},s=()=>{n(ar(e.result)),o()},a=()=>{r(e.error),o()};e.addEventListener("success",s),e.addEventListener("error",a)});return Is.set(t,e),t}function xh(e){if(fi.has(e))return;const t=new Promise((n,r)=>{const o=()=>{e.removeEventListener("complete",s),e.removeEventListener("error",a),e.removeEventListener("abort",a)},s=()=>{n(),o()},a=()=>{r(e.error||new DOMException("AbortError","AbortError")),o()};e.addEventListener("complete",s),e.addEventListener("error",a),e.addEventListener("abort",a)});fi.set(e,t)}let hi={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return fi.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return ar(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function du(e){hi=e(hi)}function Eh(e){return yh().includes(e)?function(...t){return e.apply(gi(this),t),ar(this.request)}:function(...t){return ar(e.apply(gi(this),t))}}function vh(e){return typeof e=="function"?Eh(e):(e instanceof IDBTransaction&&xh(e),di(e,bh())?new Proxy(e,hi):e)}function ar(e){if(e instanceof IDBRequest)return Ch(e);if(pi.has(e))return pi.get(e);const t=vh(e);return t!==e&&(pi.set(e,t),Is.set(t,e)),t}const gi=e=>Is.get(e);function wh(e,t,{blocked:n,upgrade:r,blocking:o,terminated:s}={}){const a=indexedDB.open(e,t),i=ar(a);return r&&a.addEventListener("upgradeneeded",c=>{r(ar(a.result),c.oldVersion,c.newVersion,ar(a.transaction),c)}),n&&a.addEventListener("blocked",c=>n(c.oldVersion,c.newVersion,c)),i.then(c=>{s&&c.addEventListener("close",()=>s()),o&&c.addEventListener("versionchange",l=>o(l.oldVersion,l.newVersion,l))}).catch(()=>{}),i}const Ih=["get","getKey","getAll","getAllKeys","count"],_h=["put","add","delete","clear"],mi=new Map;function fu(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(mi.get(t))return mi.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=_h.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(o||Ih.includes(n)))return;const s=async function(a,...i){const c=this.transaction(a,o?"readwrite":"readonly");let l=c.store;return r&&(l=l.index(i.shift())),(await Promise.all([l[n](...i),o&&c.done]))[0]};return mi.set(t,s),s}du(e=>({...e,get:(t,n,r)=>fu(t,n)||e.get(t,n,r),has:(t,n)=>!!fu(t,n)||e.has(t,n)}));const Sh=["continue","continuePrimaryKey","advance"],pu={},bi=new WeakMap,hu=new WeakMap,Th={get(e,t){if(!Sh.includes(t))return e[t];let n=pu[t];return n||(n=pu[t]=function(...r){bi.set(this,hu.get(this)[t](...r))}),n}};async function*Ah(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;t=t;const n=new Proxy(t,Th);for(hu.set(n,t),Is.set(n,gi(t));t;)yield n,t=await(bi.get(n)||t.continue()),bi.delete(n)}function gu(e,t){return t===Symbol.asyncIterator&&di(e,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&di(e,[IDBIndex,IDBObjectStore])}du(e=>({...e,get(t,n,r){return gu(t,n)?Ah:e.get(t,n,r)},has(t,n){return gu(t,n)||e.has(t,n)}}));const Lh="connector-db",Oh=1,_s={FEEDBACK:"feedback"},No=`${_s.FEEDBACK}:data`,Ss=`${_s.FEEDBACK}:last_submitted`,Ro=`${_s.FEEDBACK}:capture_on_demand`,Mo=`${_s.FEEDBACK}:show_notification`,Fh=12*60*60*1e3,yi=(e,t=new Date)=>e?Math.abs(t.getTime()-e.getTime())>=Fh:!0,mu=(e,t=!1)=>e.captureFeedback&&(yi(e.firstViewed)&&(!e.lastSubmittedFeedback||yi(e.lastSubmittedFeedback))||!!t);let ir=null;const Nn=async()=>{try{ir||(ir=await wh(Lh,Oh,{upgrade(e){e.objectStoreNames.contains(No)||e.createObjectStore(No),e.objectStoreNames.contains(Ss)||e.createObjectStore(Ss),e.objectStoreNames.contains(Ro)||e.createObjectStore(Ro),e.objectStoreNames.contains(Mo)||e.createObjectStore(Mo)},blocked(){console.warn("Upgrade blocked! Close other tabs using this DB.")},blocking(){console.warn("Another tab is trying to upgrade. Closing connection to allow upgrade."),ir&&(ir.close(),ir=null)},terminated(){console.error("DB connection unexpectedly closed. Resetting connection."),ir=null}}))}catch(e){console.error("Error opening IndexedDB connection:",e)}return ir},Ci=async e=>{if(!e)return[];const t=await Nn();if(!t)return[];try{return await t.get(No,e)||[]}catch(n){return console.error("Error fetching user feedback data:",n),[]}},kh=async e=>{if(!e)return null;const t=await Nn();if(!t)return null;try{return await t.get(Ss,e)||null}catch(n){return console.error("Error fetching last submitted feedback:",n),null}},Ts=async e=>{if(!e)return;const t=await Nn();if(t)try{return await t.get(Ro,e)}catch(n){console.error("Error fetching capture on demand status:",n);return}},Dh=async e=>{if(!e)return!1;const t=await Nn();if(!t)return!1;try{return await t.get(Mo,e)??!1}catch(n){return console.error("Error fetching show notification status:",n),!1}},Nh=async(e,t)=>{if(!e||!t||!t.length)return;const n=await Nn();if(n)try{const r=await Ci(e),o=new Set(r.map(a=>a.connectorId)),s=t.filter(a=>!o.has(a.connector_id)).map(a=>({connectorId:a.connector_id,captureFeedback:!0,firstViewed:new Date}));if(s.length>0){const a=[...r,...s];await n.put(No,a,e),await n.put(Mo,!0,e)}}catch(r){console.error("Error updating connectors feedback data:",r)}},Rh=async e=>{if(!e)return;const t=await Nn();if(t)try{const n=await Ci(e),r=await Ts(e),o=new Date,s=n.map(a=>{const i=mu(a,r);return{...a,lastSubmittedFeedback:i?o:a.lastSubmittedFeedback,captureFeedback:a.captureFeedback!==i}});await t.put(No,s,e),await t.put(Ss,o,e),r&&await t.put(Ro,!1,e)}catch(n){console.error("Error updating feedback submission date:",n)}},bu=async(e,t)=>{if(!e)return;const n=await Nn();if(n)try{await n.put(Ro,t,e)}catch(r){console.error("Error updating capture on demand:",r)}},Mh=async e=>{if(!e)return;const t=await Nn();if(t)try{await t.put(Mo,!1,e)}catch(n){console.error("Error resetting show notification status:",n)}},Ph=async e=>{const t=await Ci(e),n=await Ts(e);return t.filter(o=>mu(o,n))},xi=async e=>{const t=await kh(e);return t&&!yi(t)?!1:await Ts(e)&&!t?!0:!!(await Ph(e)).length},jh=async(e,t)=>{await Nh(e,t)},As=async e=>{e&&await Rh(e)},Bh=async(e,t)=>{const n=await Ts(e);t?n!==!1&&await bu(e,t):await bu(e,void 0)},yu=async e=>await Dh(e)&&await xi(e),Cu=async e=>{await Mh(e)};var Ei={},cr={};function xu(e,t){return function(){return e.apply(t,arguments)}}const{toString:Vh}=Object.prototype,{getPrototypeOf:vi}=Object,Ls=(e=>t=>{const n=Vh.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Xt=e=>(e=e.toLowerCase(),t=>Ls(t)===e),Os=e=>t=>typeof t===e,{isArray:Hr}=Array,Po=Os("undefined");function Gh(e){return e!==null&&!Po(e)&&e.constructor!==null&&!Po(e.constructor)&&Ot(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Eu=Xt("ArrayBuffer");function Hh(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Eu(e.buffer),t}const Wh=Os("string"),Ot=Os("function"),vu=Os("number"),Fs=e=>e!==null&&typeof e=="object",Zh=e=>e===!0||e===!1,ks=e=>{if(Ls(e)!=="object")return!1;const t=vi(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Xh=Xt("Date"),zh=Xt("File"),Yh=Xt("Blob"),Jh=Xt("FileList"),qh=e=>Fs(e)&&Ot(e.pipe),Qh=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ot(e.append)&&((t=Ls(e))==="formdata"||t==="object"&&Ot(e.toString)&&e.toString()==="[object FormData]"))},$h=Xt("URLSearchParams"),[Uh,Kh,eg,tg]=["ReadableStream","Request","Response","Headers"].map(Xt),ng=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function jo(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),Hr(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),a=s.length;let i;for(r=0;r<a;r++)i=s[r],t.call(null,e[i],i,e)}}function wu(e,t){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 lr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:ge,Iu=e=>!Po(e)&&e!==lr;function wi(){const{caseless:e}=Iu(this)&&this||{},t={},n=(r,o)=>{const s=e&&wu(t,o)||o;ks(t[s])&&ks(r)?t[s]=wi(t[s],r):ks(r)?t[s]=wi({},r):Hr(r)?t[s]=r.slice():t[s]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&jo(arguments[r],n);return t}const rg=(e,t,n,{allOwnKeys:r}={})=>(jo(t,(o,s)=>{n&&Ot(o)?e[s]=xu(o,n):e[s]=o},{allOwnKeys:r}),e),og=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),sg=(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)},ag=(e,t,n,r)=>{let o,s,a;const i={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)a=o[s],(!r||r(a,e,t))&&!i[a]&&(t[a]=e[a],i[a]=!0);e=n!==!1&&vi(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},ig=(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},cg=e=>{if(!e)return null;if(Hr(e))return e;let t=e.length;if(!vu(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},lg=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&vi(Uint8Array)),ug=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=r.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},dg=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},fg=Xt("HTMLFormElement"),pg=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),_u=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),hg=Xt("RegExp"),Su=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};jo(n,(o,s)=>{let a;(a=t(o,s,e))!==!1&&(r[s]=a||o)}),Object.defineProperties(e,r)},gg=e=>{Su(e,(t,n)=>{if(Ot(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Ot(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+"'")})}})},mg=(e,t)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return Hr(e)?r(e):r(String(e).split(t)),n},bg=()=>{},yg=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Ii="abcdefghijklmnopqrstuvwxyz",Tu="0123456789",Au={DIGIT:Tu,ALPHA:Ii,ALPHA_DIGIT:Ii+Ii.toUpperCase()+Tu},Cg=(e=16,t=Au.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function xg(e){return!!(e&&Ot(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Eg=e=>{const t=new Array(10),n=(r,o)=>{if(Fs(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const s=Hr(r)?[]:{};return jo(r,(a,i)=>{const c=n(a,o+1);!Po(c)&&(s[i]=c)}),t[o]=void 0,s}}return r};return n(e,0)},vg=Xt("AsyncFunction"),wg=e=>e&&(Fs(e)||Ot(e))&&Ot(e.then)&&Ot(e.catch),Lu=((e,t)=>e?setImmediate:t?((n,r)=>(lr.addEventListener("message",({source:o,data:s})=>{o===lr&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),lr.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ot(lr.postMessage)),Ig=typeof queueMicrotask<"u"?queueMicrotask.bind(lr):typeof process<"u"&&process.nextTick||Lu;var P={isArray:Hr,isArrayBuffer:Eu,isBuffer:Gh,isFormData:Qh,isArrayBufferView:Hh,isString:Wh,isNumber:vu,isBoolean:Zh,isObject:Fs,isPlainObject:ks,isReadableStream:Uh,isRequest:Kh,isResponse:eg,isHeaders:tg,isUndefined:Po,isDate:Xh,isFile:zh,isBlob:Yh,isRegExp:hg,isFunction:Ot,isStream:qh,isURLSearchParams:$h,isTypedArray:lg,isFileList:Jh,forEach:jo,merge:wi,extend:rg,trim:ng,stripBOM:og,inherits:sg,toFlatObject:ag,kindOf:Ls,kindOfTest:Xt,endsWith:ig,toArray:cg,forEachEntry:ug,matchAll:dg,isHTMLForm:fg,hasOwnProperty:_u,hasOwnProp:_u,reduceDescriptors:Su,freezeMethods:gg,toObjectSet:mg,toCamelCase:pg,noop:bg,toFiniteNumber:yg,findKey:wu,global:lr,isContextDefined:Iu,ALPHABET:Au,generateString:Cg,isSpecCompliantForm:xg,toJSONObject:Eg,isAsyncFn:vg,isThenable:wg,setImmediate:Lu,asap:Ig};function me(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)}P.inherits(me,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:P.toJSONObject(this.config),code:this.code,status:this.status}}});const Ou=me.prototype,Fu={};["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=>{Fu[e]={value:e}}),Object.defineProperties(me,Fu),Object.defineProperty(Ou,"isAxiosError",{value:!0}),me.from=(e,t,n,r,o,s)=>{const a=Object.create(Ou);return P.toFlatObject(e,a,function(c){return c!==Error.prototype},i=>i!=="isAxiosError"),me.call(a,e.message,t,n,r,o),a.cause=e,a.name=e.name,s&&Object.assign(a,s),a};var _g=null;function _i(e){return P.isPlainObject(e)||P.isArray(e)}function ku(e){return P.endsWith(e,"[]")?e.slice(0,-2):e}function Du(e,t,n){return e?e.concat(t).map(function(o,s){return o=ku(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function Sg(e){return P.isArray(e)&&!e.some(_i)}const Tg=P.toFlatObject(P,{},null,function(t){return/^is[A-Z]/.test(t)});function Ds(e,t,n){if(!P.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=P.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(p,h){return!P.isUndefined(h[p])});const r=n.metaTokens,o=n.visitor||f,s=n.dots,a=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&P.isSpecCompliantForm(t);if(!P.isFunction(o))throw new TypeError("visitor must be a function");function l(b){if(b===null)return"";if(P.isDate(b))return b.toISOString();if(!c&&P.isBlob(b))throw new me("Blob is not supported. Use a Buffer instead.");return P.isArrayBuffer(b)||P.isTypedArray(b)?c&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function f(b,p,h){let m=b;if(b&&!h&&typeof b=="object"){if(P.endsWith(p,"{}"))p=r?p:p.slice(0,-2),b=JSON.stringify(b);else if(P.isArray(b)&&Sg(b)||(P.isFileList(b)||P.endsWith(p,"[]"))&&(m=P.toArray(b)))return p=ku(p),m.forEach(function(C,w){!(P.isUndefined(C)||C===null)&&t.append(a===!0?Du([p],w,s):a===null?p:p+"[]",l(C))}),!1}return _i(b)?!0:(t.append(Du(h,p,s),l(b)),!1)}const g=[],y=Object.assign(Tg,{defaultVisitor:f,convertValue:l,isVisitable:_i});function x(b,p){if(!P.isUndefined(b)){if(g.indexOf(b)!==-1)throw Error("Circular reference detected in "+p.join("."));g.push(b),P.forEach(b,function(m,E){(!(P.isUndefined(m)||m===null)&&o.call(t,m,P.isString(E)?E.trim():E,p,y))===!0&&x(m,p?p.concat(E):[E])}),g.pop()}}if(!P.isObject(e))throw new TypeError("data must be an object");return x(e),t}function Nu(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Si(e,t){this._pairs=[],e&&Ds(e,this,t)}const Ru=Si.prototype;Ru.append=function(t,n){this._pairs.push([t,n])},Ru.toString=function(t){const n=t?function(r){return t.call(this,r,Nu)}:Nu;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function Ag(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Mu(e,t,n){if(!t)return e;const r=n&&n.encode||Ag,o=n&&n.serialize;let s;if(o?s=o(t,n):s=P.isURLSearchParams(t)?t.toString():new Si(t,n).toString(r),s){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class Lg{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){P.forEach(this.handlers,function(r){r!==null&&t(r)})}}var Pu=Lg,ju={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Og=typeof URLSearchParams<"u"?URLSearchParams:Si,Fg=typeof FormData<"u"?FormData:null,kg=typeof Blob<"u"?Blob:null,Dg={isBrowser:!0,classes:{URLSearchParams:Og,FormData:Fg,Blob:kg},protocols:["http","https","file","blob","url","data"]};const Ti=typeof window<"u"&&typeof document<"u",Ai=typeof navigator=="object"&&navigator||void 0,Ng=Ti&&(!Ai||["ReactNative","NativeScript","NS"].indexOf(Ai.product)<0),Rg=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Mg=Ti&&window.location.href||"http://localhost";var Pg=Object.freeze({__proto__:null,hasBrowserEnv:Ti,hasStandardBrowserWebWorkerEnv:Rg,hasStandardBrowserEnv:Ng,navigator:Ai,origin:Mg}),bt={...Pg,...Dg};function jg(e,t){return Ds(e,new bt.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,s){return bt.isNode&&P.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function Bg(e){return P.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Vg(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 Bu(e){function t(n,r,o,s){let a=n[s++];if(a==="__proto__")return!0;const i=Number.isFinite(+a),c=s>=n.length;return a=!a&&P.isArray(o)?o.length:a,c?(P.hasOwnProp(o,a)?o[a]=[o[a],r]:o[a]=r,!i):((!o[a]||!P.isObject(o[a]))&&(o[a]=[]),t(n,r,o[a],s)&&P.isArray(o[a])&&(o[a]=Vg(o[a])),!i)}if(P.isFormData(e)&&P.isFunction(e.entries)){const n={};return P.forEachEntry(e,(r,o)=>{t(Bg(r),o,n,0)}),n}return null}function Gg(e,t,n){if(P.isString(e))try{return(t||JSON.parse)(e),P.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const Li={transitional:ju,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=P.isObject(t);if(s&&P.isHTMLForm(t)&&(t=new FormData(t)),P.isFormData(t))return o?JSON.stringify(Bu(t)):t;if(P.isArrayBuffer(t)||P.isBuffer(t)||P.isStream(t)||P.isFile(t)||P.isBlob(t)||P.isReadableStream(t))return t;if(P.isArrayBufferView(t))return t.buffer;if(P.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return jg(t,this.formSerializer).toString();if((i=P.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Ds(i?{"files[]":t}:t,c&&new c,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),Gg(t)):t}],transformResponse:[function(t){const n=this.transitional||Li.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(P.isResponse(t)||P.isReadableStream(t))return t;if(t&&P.isString(t)&&(r&&!this.responseType||o)){const a=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(i){if(a)throw i.name==="SyntaxError"?me.from(i,me.ERR_BAD_RESPONSE,this,null,this.response):i}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:bt.classes.FormData,Blob:bt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};P.forEach(["delete","get","head","post","put","patch"],e=>{Li.headers[e]={}});var Oi=Li;const Hg=P.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"]);var Wg=e=>{const t={};let n,r,o;return e&&e.split(`
31
31
  `).forEach(function(a){o=a.indexOf(":"),n=a.substring(0,o).trim().toLowerCase(),r=a.substring(o+1).trim(),!(!n||t[n]&&Hg[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t};const Vu=Symbol("internals");function Bo(e){return e&&String(e).trim().toLowerCase()}function Ns(e){return e===!1||e==null?e:P.isArray(e)?e.map(Ns):String(e)}function Zg(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 Xg=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Fi(e,t,n,r,o){if(P.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!P.isString(t)){if(P.isString(r))return t.indexOf(r)!==-1;if(P.isRegExp(r))return r.test(t)}}function zg(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Yg(e,t){const n=P.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,s,a){return this[r].call(this,t,o,s,a)},configurable:!0})})}class Rs{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function s(i,c,l){const f=Bo(c);if(!f)throw new Error("header name must be a non-empty string");const g=P.findKey(o,f);(!g||o[g]===void 0||l===!0||l===void 0&&o[g]!==!1)&&(o[g||c]=Ns(i))}const a=(i,c)=>P.forEach(i,(l,f)=>s(l,f,c));if(P.isPlainObject(t)||t instanceof this.constructor)a(t,n);else if(P.isString(t)&&(t=t.trim())&&!Xg(t))a(Wg(t),n);else if(P.isHeaders(t))for(const[i,c]of t.entries())s(c,i,r);else t!=null&&s(n,t,r);return this}get(t,n){if(t=Bo(t),t){const r=P.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return Zg(o);if(P.isFunction(n))return n.call(this,o,r);if(P.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Bo(t),t){const r=P.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Fi(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function s(a){if(a=Bo(a),a){const i=P.findKey(r,a);i&&(!n||Fi(r,r[i],i,n))&&(delete r[i],o=!0)}}return P.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||Fi(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const n=this,r={};return P.forEach(this,(o,s)=>{const a=P.findKey(r,s);if(a){n[a]=Ns(o),delete n[s];return}const i=t?zg(s):String(s).trim();i!==s&&delete n[s],n[i]=Ns(o),r[i]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return P.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&P.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(`
32
32
  `)}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[Vu]=this[Vu]={accessors:{}}).accessors,o=this.prototype;function s(a){const i=Bo(a);r[i]||(Yg(o,a),r[i]=!0)}return P.isArray(t)?t.forEach(s):s(t),this}}Rs.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),P.reduceDescriptors(Rs.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),P.freezeMethods(Rs);var zt=Rs;function ki(e,t){const n=this||Oi,r=t||n,o=zt.from(r.headers);let s=r.data;return P.forEach(e,function(i){s=i.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function Gu(e){return!!(e&&e.__CANCEL__)}function Wr(e,t,n){me.call(this,e??"canceled",me.ERR_CANCELED,t,n),this.name="CanceledError"}P.inherits(Wr,me,{__CANCEL__:!0});function Hu(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new me("Request failed with status code "+n.status,[me.ERR_BAD_REQUEST,me.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Jg(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function qg(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,s=0,a;return t=t!==void 0?t:1e3,function(c){const l=Date.now(),f=r[s];a||(a=l),n[o]=c,r[o]=l;let g=s,y=0;for(;g!==o;)y+=n[g++],g=g%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),l-a<t)return;const x=f&&l-f;return x?Math.round(y*1e3/x):void 0}}function Qg(e,t){let n=0,r=1e3/t,o,s;const a=(l,f=Date.now())=>{n=f,o=null,s&&(clearTimeout(s),s=null),e.apply(null,l)};return[(...l)=>{const f=Date.now(),g=f-n;g>=r?a(l,f):(o=l,s||(s=setTimeout(()=>{s=null,a(o)},r-g)))},()=>o&&a(o)]}const Ms=(e,t,n=3)=>{let r=0;const o=qg(50,250);return Qg(s=>{const a=s.loaded,i=s.lengthComputable?s.total:void 0,c=a-r,l=o(c),f=a<=i;r=a;const g={loaded:a,total:i,progress:i?a/i:void 0,bytes:c,rate:l||void 0,estimated:l&&i&&f?(i-a)/l:void 0,event:s,lengthComputable:i!=null,[t?"download":"upload"]:!0};e(g)},n)},Wu=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Zu=e=>(...t)=>P.asap(()=>e(...t));var $g=bt.hasStandardBrowserEnv?function(){const t=bt.navigator&&/(msie|trident)/i.test(bt.navigator.userAgent),n=document.createElement("a");let r;function o(s){let a=s;return t&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=o(window.location.href),function(a){const i=P.isString(a)?o(a):a;return i.protocol===r.protocol&&i.host===r.host}}():function(){return function(){return!0}}(),Ug=bt.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const a=[e+"="+encodeURIComponent(t)];P.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),P.isString(r)&&a.push("path="+r),P.isString(o)&&a.push("domain="+o),s===!0&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Kg(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function em(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Xu(e,t){return e&&!Kg(t)?em(e,t):t}const zu=e=>e instanceof zt?{...e}:e;function ur(e,t){t=t||{};const n={};function r(l,f,g){return P.isPlainObject(l)&&P.isPlainObject(f)?P.merge.call({caseless:g},l,f):P.isPlainObject(f)?P.merge({},f):P.isArray(f)?f.slice():f}function o(l,f,g){if(P.isUndefined(f)){if(!P.isUndefined(l))return r(void 0,l,g)}else return r(l,f,g)}function s(l,f){if(!P.isUndefined(f))return r(void 0,f)}function a(l,f){if(P.isUndefined(f)){if(!P.isUndefined(l))return r(void 0,l)}else return r(void 0,f)}function i(l,f,g){if(g in t)return r(l,f);if(g in e)return r(void 0,l)}const c={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:i,headers:(l,f)=>o(zu(l),zu(f),!0)};return P.forEach(Object.keys(Object.assign({},e,t)),function(f){const g=c[f]||o,y=g(e[f],t[f],f);P.isUndefined(y)&&g!==i||(n[f]=y)}),n}var Yu=e=>{const t=ur({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:a,auth:i}=t;t.headers=a=zt.from(a),t.url=Mu(Xu(t.baseURL,t.url),e.params,e.paramsSerializer),i&&a.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):"")));let c;if(P.isFormData(n)){if(bt.hasStandardBrowserEnv||bt.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((c=a.getContentType())!==!1){const[l,...f]=c?c.split(";").map(g=>g.trim()).filter(Boolean):[];a.setContentType([l||"multipart/form-data",...f].join("; "))}}if(bt.hasStandardBrowserEnv&&(r&&P.isFunction(r)&&(r=r(t)),r||r!==!1&&$g(t.url))){const l=o&&s&&Ug.read(s);l&&a.set(o,l)}return t},tm=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const o=Yu(e);let s=o.data;const a=zt.from(o.headers).normalize();let{responseType:i,onUploadProgress:c,onDownloadProgress:l}=o,f,g,y,x,b;function p(){x&&x(),b&&b(),o.cancelToken&&o.cancelToken.unsubscribe(f),o.signal&&o.signal.removeEventListener("abort",f)}let h=new XMLHttpRequest;h.open(o.method.toUpperCase(),o.url,!0),h.timeout=o.timeout;function m(){if(!h)return;const C=zt.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),v={data:!i||i==="text"||i==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:C,config:e,request:h};Hu(function(T){n(T),p()},function(T){r(T),p()},v),h=null}"onloadend"in h?h.onloadend=m:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(m)},h.onabort=function(){h&&(r(new me("Request aborted",me.ECONNABORTED,e,h)),h=null)},h.onerror=function(){r(new me("Network Error",me.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let w=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const v=o.transitional||ju;o.timeoutErrorMessage&&(w=o.timeoutErrorMessage),r(new me(w,v.clarifyTimeoutError?me.ETIMEDOUT:me.ECONNABORTED,e,h)),h=null},s===void 0&&a.setContentType(null),"setRequestHeader"in h&&P.forEach(a.toJSON(),function(w,v){h.setRequestHeader(v,w)}),P.isUndefined(o.withCredentials)||(h.withCredentials=!!o.withCredentials),i&&i!=="json"&&(h.responseType=o.responseType),l&&([y,b]=Ms(l,!0),h.addEventListener("progress",y)),c&&h.upload&&([g,x]=Ms(c),h.upload.addEventListener("progress",g),h.upload.addEventListener("loadend",x)),(o.cancelToken||o.signal)&&(f=C=>{h&&(r(!C||C.type?new Wr(null,e,h):C),h.abort(),h=null)},o.cancelToken&&o.cancelToken.subscribe(f),o.signal&&(o.signal.aborted?f():o.signal.addEventListener("abort",f)));const E=Jg(o.url);if(E&&bt.protocols.indexOf(E)===-1){r(new me("Unsupported protocol "+E+":",me.ERR_BAD_REQUEST,e));return}h.send(s||null)})},nm=(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,i();const f=l instanceof Error?l:this.reason;r.abort(f instanceof me?f:new Wr(f instanceof Error?f.message:f))}};let a=t&&setTimeout(()=>{a=null,s(new me(`timeout ${t} of ms exceeded`,me.ETIMEDOUT))},t);const i=()=>{e&&(a&&clearTimeout(a),a=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=()=>P.asap(i),c}};const rm=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},om=async function*(e,t){for await(const n of sm(e))yield*rm(n,t)},sm=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()}},Ju=(e,t,n,r)=>{const o=om(e,t);let s=0,a,i=c=>{a||(a=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:l,value:f}=await o.next();if(l){i(),c.close();return}let g=f.byteLength;if(n){let y=s+=g;n(y)}c.enqueue(new Uint8Array(f))}catch(l){throw i(l),l}},cancel(c){return i(c),o.return()}},{highWaterMark:2})},Ps=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",qu=Ps&&typeof ReadableStream=="function",am=Ps&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Qu=(e,...t)=>{try{return!!e(...t)}catch{return!1}},im=qu&&Qu(()=>{let e=!1;const t=new Request(bt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),$u=64*1024,Di=qu&&Qu(()=>P.isReadableStream(new Response("").body)),js={stream:Di&&(e=>e.body)};Ps&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!js[t]&&(js[t]=P.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new me(`Response type '${t}' is not supported`,me.ERR_NOT_SUPPORT,r)})})})(new Response);const cm=async e=>{if(e==null)return 0;if(P.isBlob(e))return e.size;if(P.isSpecCompliantForm(e))return(await new Request(bt.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(P.isArrayBufferView(e)||P.isArrayBuffer(e))return e.byteLength;if(P.isURLSearchParams(e)&&(e=e+""),P.isString(e))return(await am(e)).byteLength},lm=async(e,t)=>{const n=P.toFiniteNumber(e.getContentLength());return n??cm(t)};var um=Ps&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:s,timeout:a,onDownloadProgress:i,onUploadProgress:c,responseType:l,headers:f,withCredentials:g="same-origin",fetchOptions:y}=Yu(e);l=l?(l+"").toLowerCase():"text";let x=nm([o,s&&s.toAbortSignal()],a),b;const p=x&&x.unsubscribe&&(()=>{x.unsubscribe()});let h;try{if(c&&im&&n!=="get"&&n!=="head"&&(h=await lm(f,r))!==0){let v=new Request(t,{method:"POST",body:r,duplex:"half"}),_;if(P.isFormData(r)&&(_=v.headers.get("content-type"))&&f.setContentType(_),v.body){const[T,S]=Wu(h,Ms(Zu(c)));r=Ju(v.body,$u,T,S)}}P.isString(g)||(g=g?"include":"omit");const m="credentials"in Request.prototype;b=new Request(t,{...y,signal:x,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:m?g:void 0});let E=await fetch(b);const C=Di&&(l==="stream"||l==="response");if(Di&&(i||C&&p)){const v={};["status","statusText","headers"].forEach(L=>{v[L]=E[L]});const _=P.toFiniteNumber(E.headers.get("content-length")),[T,S]=i&&Wu(_,Ms(Zu(i),!0))||[];E=new Response(Ju(E.body,$u,T,()=>{S&&S(),p&&p()}),v)}l=l||"text";let w=await js[P.findKey(js,l)||"text"](E,e);return!C&&p&&p(),await new Promise((v,_)=>{Hu(v,_,{data:w,headers:zt.from(E.headers),status:E.status,statusText:E.statusText,config:e,request:b})})}catch(m){throw p&&p(),m&&m.name==="TypeError"&&/fetch/i.test(m.message)?Object.assign(new me("Network Error",me.ERR_NETWORK,e,b),{cause:m.cause||m}):me.from(m,m&&m.code,e,b)}});const Ni={http:_g,xhr:tm,fetch:um};P.forEach(Ni,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Uu=e=>`- ${e}`,dm=e=>P.isFunction(e)||e===null||e===!1;var Ku={getAdapter:e=>{e=P.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let s=0;s<t;s++){n=e[s];let a;if(r=n,!dm(n)&&(r=Ni[(a=String(n)).toLowerCase()],r===void 0))throw new me(`Unknown adapter '${a}'`);if(r)break;o[a||"#"+s]=r}if(!r){const s=Object.entries(o).map(([i,c])=>`adapter ${i} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=t?s.length>1?`since :
33
33
  `+s.map(Uu).join(`
@@ -603,7 +603,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
603
603
  *
604
604
  * This source code is licensed under the MIT license found in the
605
605
  * LICENSE file in the root directory of this source tree.
606
- */var hf;function x9(){return hf||(hf=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,i=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,g=e?Symbol.for("react.suspense"):60113,y=e?Symbol.for("react.suspense_list"):60120,x=e?Symbol.for("react.memo"):60115,b=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,h=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,E=e?Symbol.for("react.scope"):60119;function C(X){return typeof X=="string"||typeof X=="function"||X===r||X===l||X===s||X===o||X===g||X===y||typeof X=="object"&&X!==null&&(X.$$typeof===b||X.$$typeof===x||X.$$typeof===a||X.$$typeof===i||X.$$typeof===f||X.$$typeof===h||X.$$typeof===m||X.$$typeof===E||X.$$typeof===p)}function w(X){if(typeof X=="object"&&X!==null){var Ve=X.$$typeof;switch(Ve){case t:var Ge=X.type;switch(Ge){case c:case l:case r:case s:case o:case g:return Ge;default:var at=Ge&&Ge.$$typeof;switch(at){case i:case f:case b:case x:case a:return at;default:return Ve}}case n:return Ve}}}var v=c,_=l,T=i,S=a,L=t,N=f,k=r,D=b,M=x,j=n,J=s,Y=o,z=g,H=!1;function q(X){return H||(H=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),ne(X)||w(X)===c}function ne(X){return w(X)===l}function ce(X){return w(X)===i}function V(X){return w(X)===a}function R(X){return typeof X=="object"&&X!==null&&X.$$typeof===t}function G(X){return w(X)===f}function W(X){return w(X)===r}function U(X){return w(X)===b}function Q(X){return w(X)===x}function re(X){return w(X)===n}function B(X){return w(X)===s}function te(X){return w(X)===o}function pe(X){return w(X)===g}De.AsyncMode=v,De.ConcurrentMode=_,De.ContextConsumer=T,De.ContextProvider=S,De.Element=L,De.ForwardRef=N,De.Fragment=k,De.Lazy=D,De.Memo=M,De.Portal=j,De.Profiler=J,De.StrictMode=Y,De.Suspense=z,De.isAsyncMode=q,De.isConcurrentMode=ne,De.isContextConsumer=ce,De.isContextProvider=V,De.isElement=R,De.isForwardRef=G,De.isFragment=W,De.isLazy=U,De.isMemo=Q,De.isPortal=re,De.isProfiler=B,De.isStrictMode=te,De.isSuspense=pe,De.isValidElementType=C,De.typeOf=w}()),De}process.env.NODE_ENV==="production"?Fc.exports=C9():Fc.exports=x9();var E9=Fc.exports,gf=E9,v9={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},w9={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},mf={};mf[gf.ForwardRef]=v9,mf[gf.Memo]=w9;var I9=!0;function _9(e,t,n){var r="";return n.split(" ").forEach(function(o){e[o]!==void 0?t.push(e[o]+";"):o&&(r+=o+" ")}),r}var bf=function(t,n,r){var o=t.key+"-"+n.name;(r===!1||I9===!1)&&t.registered[o]===void 0&&(t.registered[o]=n.styles)},S9=function(t,n,r){bf(t,n,r);var o=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var s=n;do t.insert(n===s?"."+o:"",s,t.sheet,!0),s=s.next;while(s!==void 0)}};function T9(e){for(var t=0,n,r=0,o=e.length;o>=4;++r,o-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var A9={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},L9=!1,O9=/[A-Z]|^ms/g,F9=/_EMO_([^_]+?)_([^]*?)_EMO_/g,yf=function(t){return t.charCodeAt(1)===45},Cf=function(t){return t!=null&&typeof t!="boolean"},kc=u9(function(e){return yf(e)?e:e.replace(O9,"-$&").toLowerCase()}),xf=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(F9,function(r,o,s){return cn={name:o,styles:s,next:cn},o})}return A9[t]!==1&&!yf(t)&&typeof n=="number"&&n!==0?n+"px":n},k9="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function $o(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var o=n;if(o.anim===1)return cn={name:o.name,styles:o.styles,next:cn},o.name;var s=n;if(s.styles!==void 0){var a=s.next;if(a!==void 0)for(;a!==void 0;)cn={name:a.name,styles:a.styles,next:cn},a=a.next;var i=s.styles+";";return i}return D9(e,t,n)}case"function":{if(e!==void 0){var c=cn,l=n(e);return cn=c,$o(e,t,l)}break}}var f=n;return f}function D9(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=$o(e,t,n[o])+";";else for(var s in n){var a=n[s];if(typeof a!="object"){var i=a;Cf(i)&&(r+=kc(s)+":"+xf(s,i)+";")}else{if(s==="NO_COMPONENT_SELECTOR"&&L9)throw new Error(k9);if(Array.isArray(a)&&typeof a[0]=="string"&&t==null)for(var c=0;c<a.length;c++)Cf(a[c])&&(r+=kc(s)+":"+xf(s,a[c])+";");else{var l=$o(e,t,a);switch(s){case"animation":case"animationName":{r+=kc(s)+":"+l+";";break}default:r+=s+"{"+l+"}"}}}}return r}var Ef=/label:\s*([^\s;{]+)\s*(;|$)/g,cn;function vf(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,o="";cn=void 0;var s=e[0];if(s==null||s.raw===void 0)r=!1,o+=$o(n,t,s);else{var a=s;o+=a[0]}for(var i=1;i<e.length;i++)if(o+=$o(n,t,e[i]),r){var c=s;o+=c[i]}Ef.lastIndex=0;for(var l="",f;(f=Ef.exec(o))!==null;)l+="-"+f[1];var g=T9(o)+l;return{name:g,styles:o,next:cn}}var N9=function(t){return t()},R9=A.useInsertionEffect?A.useInsertionEffect:!1,M9=R9||N9,P9=!1,wf=A.createContext(typeof HTMLElement<"u"?y9({key:"css"}):null);wf.Provider;var j9=function(t){return I.forwardRef(function(n,r){var o=I.useContext(wf);return t(n,o,r)})},B9=A.createContext({}),Dc={}.hasOwnProperty,Nc="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",V9=function(t,n){var r={};for(var o in n)Dc.call(n,o)&&(r[o]=n[o]);return r[Nc]=t,r},G9=function(t){var n=t.cache,r=t.serialized,o=t.isStringTag;return bf(n,r,o),M9(function(){return S9(n,r,o)}),null},H9=j9(function(e,t,n){var r=e.css;typeof r=="string"&&t.registered[r]!==void 0&&(r=t.registered[r]);var o=e[Nc],s=[r],a="";typeof e.className=="string"?a=_9(t.registered,s,e.className):e.className!=null&&(a=e.className+" ");var i=vf(s,void 0,A.useContext(B9));a+=t.key+"-"+i.name;var c={};for(var l in e)Dc.call(e,l)&&l!=="css"&&l!==Nc&&!P9&&(c[l]=e[l]);return c.className=a,n&&(c.ref=n),A.createElement(A.Fragment,null,A.createElement(G9,{cache:t,serialized:i,isStringTag:typeof o=="string"}),A.createElement(o,c))}),W9=H9,ie=function(t,n){var r=arguments;if(n==null||!Dc.call(n,"css"))return A.createElement.apply(void 0,r);var o=r.length,s=new Array(o);s[0]=W9,s[1]=V9(t,n);for(var a=2;a<o;a++)s[a]=r[a];return A.createElement.apply(null,s)};function Rc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return vf(t)}var Z9=function(){var t=Rc.apply(void 0,arguments),n="animation-"+t.name;return{name:n,styles:"@keyframes "+n+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}};function X9(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const z9=Math.min,Y9=Math.max,pa=Math.round,ha=Math.floor,ga=e=>({x:e,y:e});function J9(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 ma(){return typeof window<"u"}function If(e){return Sf(e)?(e.nodeName||"").toLowerCase():"#document"}function wn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _f(e){var t;return(t=(Sf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Sf(e){return ma()?e instanceof Node||e instanceof wn(e).Node:!1}function q9(e){return ma()?e instanceof Element||e instanceof wn(e).Element:!1}function Mc(e){return ma()?e instanceof HTMLElement||e instanceof wn(e).HTMLElement:!1}function Tf(e){return!ma()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof wn(e).ShadowRoot}function Af(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Pc(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Q9(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function $9(e){return["html","body","#document"].includes(If(e))}function Pc(e){return wn(e).getComputedStyle(e)}function U9(e){if(If(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Tf(e)&&e.host||_f(e);return Tf(t)?t.host:t}function Lf(e){const t=U9(e);return $9(t)?e.ownerDocument?e.ownerDocument.body:e.body:Mc(t)&&Af(t)?t:Lf(t)}function ba(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Lf(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),a=wn(o);if(s){const i=jc(a);return t.concat(a,a.visualViewport||[],Af(o)?o:[],i&&n?ba(i):[])}return t.concat(o,ba(o,[],n))}function jc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function K9(e){const t=Pc(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Mc(e),s=o?e.offsetWidth:n,a=o?e.offsetHeight:r,i=pa(n)!==s||pa(r)!==a;return i&&(n=s,r=a),{width:n,height:r,$:i}}function Bc(e){return q9(e)?e:e.contextElement}function Of(e){const t=Bc(e);if(!Mc(t))return ga(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=K9(t);let a=(s?pa(n.width):n.width)/r,i=(s?pa(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}const eC=ga(0);function tC(e){const t=wn(e);return!Q9()||!t.visualViewport?eC:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function nC(e,t,n){return!1}function Ff(e,t,n,r){t===void 0&&(t=!1);const o=e.getBoundingClientRect(),s=Bc(e);let a=ga(1);t&&(a=Of(e));const i=nC()?tC(s):ga(0);let c=(o.left+i.x)/a.x,l=(o.top+i.y)/a.y,f=o.width/a.x,g=o.height/a.y;if(s){const y=wn(s),x=r;let b=y,p=jc(b);for(;p&&r&&x!==b;){const h=Of(p),m=p.getBoundingClientRect(),E=Pc(p),C=m.left+(p.clientLeft+parseFloat(E.paddingLeft))*h.x,w=m.top+(p.clientTop+parseFloat(E.paddingTop))*h.y;c*=h.x,l*=h.y,f*=h.x,g*=h.y,c+=C,l+=w,b=wn(p),p=jc(b)}}return J9({width:f,height:g,x:c,y:l})}function rC(e,t){let n=null,r;const o=_f(e);function s(){var i;clearTimeout(r),(i=n)==null||i.disconnect(),n=null}function a(i,c){i===void 0&&(i=!1),c===void 0&&(c=1),s();const{left:l,top:f,width:g,height:y}=e.getBoundingClientRect();if(i||t(),!g||!y)return;const x=ha(f),b=ha(o.clientWidth-(l+g)),p=ha(o.clientHeight-(f+y)),h=ha(l),E={rootMargin:-x+"px "+-b+"px "+-p+"px "+-h+"px",threshold:Y9(0,z9(1,c))||1};let C=!0;function w(v){const _=v[0].intersectionRatio;if(_!==c){if(!C)return a();_?a(!1,_):r=setTimeout(()=>{a(!1,1e-7)},1e3)}C=!1}try{n=new IntersectionObserver(w,{...E,root:o.ownerDocument})}catch{n=new IntersectionObserver(w,E)}n.observe(e)}return a(!0),s}function oC(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=Bc(e),f=o||s?[...l?ba(l):[],...ba(t)]:[];f.forEach(m=>{o&&m.addEventListener("scroll",n,{passive:!0}),s&&m.addEventListener("resize",n)});const g=l&&i?rC(l,n):null;let y=-1,x=null;a&&(x=new ResizeObserver(m=>{let[E]=m;E&&E.target===l&&x&&(x.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var C;(C=x)==null||C.observe(t)})),n()}),l&&!c&&x.observe(l),x.observe(t));let b,p=c?Ff(e):null;c&&h();function h(){const m=Ff(e);p&&(m.x!==p.x||m.y!==p.y||m.width!==p.width||m.height!==p.height)&&n(),p=m,b=requestAnimationFrame(h)}return n(),()=>{var m;f.forEach(E=>{o&&E.removeEventListener("scroll",n),s&&E.removeEventListener("resize",n)}),g==null||g(),(m=x)==null||m.disconnect(),x=null,c&&cancelAnimationFrame(b)}}var Vc=I.useLayoutEffect,sC=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],ya=function(){};function aC(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function iC(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];var s=[].concat(r);if(t&&e)for(var a in t)t.hasOwnProperty(a)&&t[a]&&s.push("".concat(aC(e,a)));return s.filter(function(i){return i}).map(function(i){return String(i).trim()}).join(" ")}var Ca=function(t){return bC(t)?t.filter(Boolean):mr(t)==="object"&&t!==null?[t]:[]},kf=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=Kt(t,sC);return se({},n)},Xe=function(t,n,r){var o=t.cx,s=t.getStyles,a=t.getClassNames,i=t.className;return{css:s(n,t),className:o(r??{},a(n,t),i)}};function cC(e,t,n){if(n){var r=n(e,t);if(typeof r=="string")return r}return e}function xa(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function lC(e){return xa(e)?window.innerHeight:e.clientHeight}function Df(e){return xa(e)?window.pageYOffset:e.scrollTop}function Ea(e,t){if(xa(e)){window.scrollTo(0,t);return}e.scrollTop=t}function uC(e){var t=getComputedStyle(e),n=t.position==="absolute",r=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var o=e;o=o.parentElement;)if(t=getComputedStyle(o),!(n&&t.position==="static")&&r.test(t.overflow+t.overflowY+t.overflowX))return o;return document.documentElement}function dC(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function va(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:ya,o=Df(e),s=t-o,a=10,i=0;function c(){i+=a;var l=dC(i,o,s,n);Ea(e,l),i<n?window.requestAnimationFrame(c):r(e)}c()}function Nf(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=t.offsetHeight/3;r.bottom+o>n.bottom?Ea(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+o,e.scrollHeight)):r.top-o<n.top&&Ea(e,Math.max(t.offsetTop-o,0))}function fC(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function Rf(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function pC(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var Mf=!1,hC={get passive(){return Mf=!0}},wa=typeof window<"u"?window:{};wa.addEventListener&&wa.removeEventListener&&(wa.addEventListener("p",ya,hC),wa.removeEventListener("p",ya,!1));var gC=Mf;function mC(e){return e!=null}function bC(e){return Array.isArray(e)}function Uo(e,t,n){return e?t:n}function aL(e){return e}function iL(e){return e}var yC=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var s=Object.entries(t).filter(function(a){var i=tt(a,1),c=i[0];return!r.includes(c)});return s.reduce(function(a,i){var c=tt(i,2),l=c[0],f=c[1];return a[l]=f,a},{})},CC=["children","innerProps"],xC=["children","innerProps"];function EC(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,o=e.placement,s=e.shouldScroll,a=e.isFixedPosition,i=e.controlHeight,c=uC(n),l={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return l;var f=c.getBoundingClientRect(),g=f.height,y=n.getBoundingClientRect(),x=y.bottom,b=y.height,p=y.top,h=n.offsetParent.getBoundingClientRect(),m=h.top,E=a?window.innerHeight:lC(c),C=Df(c),w=parseInt(getComputedStyle(n).marginBottom,10),v=parseInt(getComputedStyle(n).marginTop,10),_=m-v,T=E-p,S=_+C,L=g-C-p,N=x-E+C+w,k=C+p-v,D=160;switch(o){case"auto":case"bottom":if(T>=b)return{placement:"bottom",maxHeight:t};if(L>=b&&!a)return s&&va(c,N,D),{placement:"bottom",maxHeight:t};if(!a&&L>=r||a&&T>=r){s&&va(c,N,D);var M=a?T-w:L-w;return{placement:"bottom",maxHeight:M}}if(o==="auto"||a){var j=t,J=a?_:S;return J>=r&&(j=Math.min(J-w-i,t)),{placement:"top",maxHeight:j}}if(o==="bottom")return s&&Ea(c,N),{placement:"bottom",maxHeight:t};break;case"top":if(_>=b)return{placement:"top",maxHeight:t};if(S>=b&&!a)return s&&va(c,k,D),{placement:"top",maxHeight:t};if(!a&&S>=r||a&&_>=r){var Y=t;return(!a&&S>=r||a&&_>=r)&&(Y=a?_-v:S-v),s&&va(c,k,D),{placement:"top",maxHeight:Y}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(o,'".'))}return l}function vC(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var Pf=function(t){return t==="auto"?"bottom":t},wC=function(t,n){var r,o=t.placement,s=t.theme,a=s.borderRadius,i=s.spacing,c=s.colors;return se((r={label:"menu"},Ur(r,vC(o),"100%"),Ur(r,"position","absolute"),Ur(r,"width","100%"),Ur(r,"zIndex",1),r),n?{}:{backgroundColor:c.neutral0,borderRadius:a,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:i.menuGutter,marginTop:i.menuGutter})},jf=I.createContext(null),IC=function(t){var n=t.children,r=t.minMenuHeight,o=t.maxMenuHeight,s=t.menuPlacement,a=t.menuPosition,i=t.menuShouldScrollIntoView,c=t.theme,l=I.useContext(jf)||{},f=l.setPortalPlacement,g=I.useRef(null),y=I.useState(o),x=tt(y,2),b=x[0],p=x[1],h=I.useState(null),m=tt(h,2),E=m[0],C=m[1],w=c.spacing.controlHeight;return Vc(function(){var v=g.current;if(v){var _=a==="fixed",T=i&&!_,S=EC({maxHeight:o,menuEl:v,minHeight:r,placement:s,shouldScroll:T,isFixedPosition:_,controlHeight:w});p(S.maxHeight),C(S.placement),f==null||f(S.placement)}},[o,s,a,i,r,f,w]),n({ref:g,placerProps:se(se({},t),{},{placement:E||Pf(s),maxHeight:b})})},_C=function(t){var n=t.children,r=t.innerRef,o=t.innerProps;return ie("div",fe({},Xe(t,"menu",{menu:!0}),{ref:r},o),n)},SC=_C,TC=function(t,n){var r=t.maxHeight,o=t.theme.spacing.baseUnit;return se({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:o,paddingTop:o})},AC=function(t){var n=t.children,r=t.innerProps,o=t.innerRef,s=t.isMulti;return ie("div",fe({},Xe(t,"menuList",{"menu-list":!0,"menu-list--is-multi":s}),{ref:o},r),n)},Bf=function(t,n){var r=t.theme,o=r.spacing.baseUnit,s=r.colors;return se({textAlign:"center"},n?{}:{color:s.neutral40,padding:"".concat(o*2,"px ").concat(o*3,"px")})},LC=Bf,OC=Bf,FC=function(t){var n=t.children,r=n===void 0?"No options":n,o=t.innerProps,s=Kt(t,CC);return ie("div",fe({},Xe(se(se({},s),{},{children:r,innerProps:o}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),o),r)},kC=function(t){var n=t.children,r=n===void 0?"Loading...":n,o=t.innerProps,s=Kt(t,xC);return ie("div",fe({},Xe(se(se({},s),{},{children:r,innerProps:o}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),o),r)},DC=function(t){var n=t.rect,r=t.offset,o=t.position;return{left:n.left,position:o,top:r,width:n.width,zIndex:1}},NC=function(t){var n=t.appendTo,r=t.children,o=t.controlElement,s=t.innerProps,a=t.menuPlacement,i=t.menuPosition,c=I.useRef(null),l=I.useRef(null),f=I.useState(Pf(a)),g=tt(f,2),y=g[0],x=g[1],b=I.useMemo(function(){return{setPortalPlacement:x}},[]),p=I.useState(null),h=tt(p,2),m=h[0],E=h[1],C=I.useCallback(function(){if(o){var T=fC(o),S=i==="fixed"?0:window.pageYOffset,L=T[y]+S;(L!==(m==null?void 0:m.offset)||T.left!==(m==null?void 0:m.rect.left)||T.width!==(m==null?void 0:m.rect.width))&&E({offset:L,rect:T})}},[o,i,y,m==null?void 0:m.offset,m==null?void 0:m.rect.left,m==null?void 0:m.rect.width]);Vc(function(){C()},[C]);var w=I.useCallback(function(){typeof l.current=="function"&&(l.current(),l.current=null),o&&c.current&&(l.current=oC(o,c.current,C,{elementResize:"ResizeObserver"in window}))},[o,C]);Vc(function(){w()},[w]);var v=I.useCallback(function(T){c.current=T,w()},[w]);if(!n&&i!=="fixed"||!m)return null;var _=ie("div",fe({ref:v},Xe(se(se({},t),{},{offset:m.offset,position:i,rect:m.rect}),"menuPortal",{"menu-portal":!0}),s),r);return ie(jf.Provider,{value:b},n?je.createPortal(_,n):_)},RC=function(t){var n=t.isDisabled,r=t.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},MC=function(t){var n=t.children,r=t.innerProps,o=t.isDisabled,s=t.isRtl;return ie("div",fe({},Xe(t,"container",{"--is-disabled":o,"--is-rtl":s}),r),n)},PC=function(t,n){var r=t.theme.spacing,o=t.isMulti,s=t.hasValue,a=t.selectProps.controlShouldRenderValue;return se({alignItems:"center",display:o&&s&&a?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},jC=function(t){var n=t.children,r=t.innerProps,o=t.isMulti,s=t.hasValue;return ie("div",fe({},Xe(t,"valueContainer",{"value-container":!0,"value-container--is-multi":o,"value-container--has-value":s}),r),n)},BC=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},VC=function(t){var n=t.children,r=t.innerProps;return ie("div",fe({},Xe(t,"indicatorsContainer",{indicators:!0}),r),n)},Vf,GC=["size"],HC=["innerProps","isRtl","size"];function WC(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var ZC=process.env.NODE_ENV==="production"?{name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"}:{name:"tj5bde-Svg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0;label:Svg;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgUmVhY3ROb2RlIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsganN4LCBrZXlmcmFtZXMgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmltcG9ydCB7XG4gIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lLFxuICBDU1NPYmplY3RXaXRoTGFiZWwsXG4gIEdyb3VwQmFzZSxcbn0gZnJvbSAnLi4vdHlwZXMnO1xuaW1wb3J0IHsgZ2V0U3R5bGVQcm9wcyB9IGZyb20gJy4uL3V0aWxzJztcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEljb25zXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgU3ZnID0gKHtcbiAgc2l6ZSxcbiAgLi4ucHJvcHNcbn06IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3ZnJ10gJiB7IHNpemU6IG51bWJlciB9KSA9PiAoXG4gIDxzdmdcbiAgICBoZWlnaHQ9e3NpemV9XG4gICAgd2lkdGg9e3NpemV9XG4gICAgdmlld0JveD1cIjAgMCAyMCAyMFwiXG4gICAgYXJpYS1oaWRkZW49XCJ0cnVlXCJcbiAgICBmb2N1c2FibGU9XCJmYWxzZVwiXG4gICAgY3NzPXt7XG4gICAgICBkaXNwbGF5OiAnaW5saW5lLWJsb2NrJyxcbiAgICAgIGZpbGw6ICdjdXJyZW50Q29sb3InLFxuICAgICAgbGluZUhlaWdodDogMSxcbiAgICAgIHN0cm9rZTogJ2N1cnJlbnRDb2xvcicsXG4gICAgICBzdHJva2VXaWR0aDogMCxcbiAgICB9fVxuICAgIHsuLi5wcm9wc31cbiAgLz5cbik7XG5cbmV4cG9ydCB0eXBlIENyb3NzSWNvblByb3BzID0gSlNYLkludHJpbnNpY0VsZW1lbnRzWydzdmcnXSAmIHsgc2l6ZT86IG51bWJlciB9O1xuZXhwb3J0IGNvbnN0IENyb3NzSWNvbiA9IChwcm9wczogQ3Jvc3NJY29uUHJvcHMpID0+IChcbiAgPFN2ZyBzaXplPXsyMH0gey4uLnByb3BzfT5cbiAgICA8cGF0aCBkPVwiTTE0LjM0OCAxNC44NDljLTAuNDY5IDAuNDY5LTEuMjI5IDAuNDY5LTEuNjk3IDBsLTIuNjUxLTMuMDMwLTIuNjUxIDMuMDI5Yy0wLjQ2OSAwLjQ2OS0xLjIyOSAwLjQ2OS0xLjY5NyAwLTAuNDY5LTAuNDY5LTAuNDY5LTEuMjI5IDAtMS42OTdsMi43NTgtMy4xNS0yLjc1OS0zLjE1MmMtMC40NjktMC40NjktMC40NjktMS4yMjggMC0xLjY5N3MxLjIyOC0wLjQ2OSAxLjY5NyAwbDIuNjUyIDMuMDMxIDIuNjUxLTMuMDMxYzAuNDY5LTAuNDY5IDEuMjI4LTAuNDY5IDEuNjk3IDBzMC40NjkgMS4yMjkgMCAxLjY5N2wtMi43NTggMy4xNTIgMi43NTggMy4xNWMwLjQ2OSAwLjQ2OSAwLjQ2OSAxLjIyOSAwIDEuNjk4elwiIC8+XG4gIDwvU3ZnPlxuKTtcbmV4cG9ydCB0eXBlIERvd25DaGV2cm9uUHJvcHMgPSBKU1guSW50cmluc2ljRWxlbWVudHNbJ3N2ZyddICYgeyBzaXplPzogbnVtYmVyIH07XG5leHBvcnQgY29uc3QgRG93bkNoZXZyb24gPSAocHJvcHM6IERvd25DaGV2cm9uUHJvcHMpID0+IChcbiAgPFN2ZyBzaXplPXsyMH0gey4uLnByb3BzfT5cbiAgICA8cGF0aCBkPVwiTTQuNTE2IDcuNTQ4YzAuNDM2LTAuNDQ2IDEuMDQzLTAuNDgxIDEuNTc2IDBsMy45MDggMy43NDcgMy45MDgtMy43NDdjMC41MzMtMC40ODEgMS4xNDEtMC40NDYgMS41NzQgMCAwLjQzNiAwLjQ0NSAwLjQwOCAxLjE5NyAwIDEuNjE1LTAuNDA2IDAuNDE4LTQuNjk1IDQuNTAyLTQuNjk1IDQuNTAyLTAuMjE3IDAuMjIzLTAuNTAyIDAuMzM1LTAuNzg3IDAuMzM1cy0wLjU3LTAuMTEyLTAuNzg5LTAuMzM1YzAgMC00LjI4Ny00LjA4NC00LjY5NS00LjUwMnMtMC40MzYtMS4xNyAwLTEuNjE1elwiIC8+XG4gIDwvU3ZnPlxuKTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEJ1dHRvbnNcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5leHBvcnQgaW50ZXJmYWNlIERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8XG4gIE9wdGlvbiA9IHVua25vd24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuID0gYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPiA9IEdyb3VwQmFzZTxPcHRpb24+XG4+IGV4dGVuZHMgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWU8T3B0aW9uLCBJc011bHRpLCBHcm91cD4ge1xuICAvKiogVGhlIGNoaWxkcmVuIHRvIGJlIHJlbmRlcmVkIGluc2lkZSB0aGUgaW5kaWNhdG9yLiAqL1xuICBjaGlsZHJlbj86IFJlYWN0Tm9kZTtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpc0Rpc2FibGVkOiBib29sZWFuO1xufVxuXG5jb25zdCBiYXNlQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNGb2N1c2VkLFxuICAgIHRoZW1lOiB7XG4gICAgICBzcGFjaW5nOiB7IGJhc2VVbml0IH0sXG4gICAgICBjb2xvcnMsXG4gICAgfSxcbiAgfTpcbiAgICB8IERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbiAgICB8IENsZWFySW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdpbmRpY2F0b3JDb250YWluZXInLFxuICBkaXNwbGF5OiAnZmxleCcsXG4gIHRyYW5zaXRpb246ICdjb2xvciAxNTBtcycsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsNjAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBwYWRkaW5nOiBiYXNlVW5pdCAqIDIsXG4gICAgICAgICc6aG92ZXInOiB7XG4gICAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsODAgOiBjb2xvcnMubmV1dHJhbDQwLFxuICAgICAgICB9LFxuICAgICAgfSksXG59KTtcblxuZXhwb3J0IGNvbnN0IGRyb3Bkb3duSW5kaWNhdG9yQ1NTID0gYmFzZUNTUztcbmV4cG9ydCBjb25zdCBEcm9wZG93bkluZGljYXRvciA9IDxcbiAgT3B0aW9uLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPlxuPihcbiAgcHJvcHM6IERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGNoaWxkcmVuLCBpbm5lclByb3BzIH0gPSBwcm9wcztcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2Ryb3Bkb3duSW5kaWNhdG9yJywge1xuICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICdkcm9wZG93bi1pbmRpY2F0b3InOiB0cnVlLFxuICAgICAgfSl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICB7Y2hpbGRyZW4gfHwgPERvd25DaGV2cm9uIC8+fVxuICAgIDwvZGl2PlxuICApO1xufTtcblxuZXhwb3J0IGludGVyZmFjZSBDbGVhckluZGljYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgLyoqIFRoZSBjaGlsZHJlbiB0byBiZSByZW5kZXJlZCBpbnNpZGUgdGhlIGluZGljYXRvci4gKi9cbiAgY2hpbGRyZW4/OiBSZWFjdE5vZGU7XG4gIC8qKiBQcm9wcyB0aGF0IHdpbGwgYmUgcGFzc2VkIG9uIHRvIHRoZSBjaGlsZHJlbi4gKi9cbiAgaW5uZXJQcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydkaXYnXTtcbiAgLyoqIFRoZSBmb2N1c2VkIHN0YXRlIG9mIHRoZSBzZWxlY3QuICovXG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbn1cblxuZXhwb3J0IGNvbnN0IGNsZWFySW5kaWNhdG9yQ1NTID0gYmFzZUNTUztcbmV4cG9ydCBjb25zdCBDbGVhckluZGljYXRvciA9IDxcbiAgT3B0aW9uLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPlxuPihcbiAgcHJvcHM6IENsZWFySW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGNoaWxkcmVuLCBpbm5lclByb3BzIH0gPSBwcm9wcztcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2NsZWFySW5kaWNhdG9yJywge1xuICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICdjbGVhci1pbmRpY2F0b3InOiB0cnVlLFxuICAgICAgfSl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICB7Y2hpbGRyZW4gfHwgPENyb3NzSWNvbiAvPn1cbiAgICA8L2Rpdj5cbiAgKTtcbn07XG5cbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuLy8gU2VwYXJhdG9yXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuZXhwb3J0IGludGVyZmFjZSBJbmRpY2F0b3JTZXBhcmF0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIGlzRGlzYWJsZWQ6IGJvb2xlYW47XG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbiAgaW5uZXJQcm9wcz86IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3BhbiddO1xufVxuXG5leHBvcnQgY29uc3QgaW5kaWNhdG9yU2VwYXJhdG9yQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNEaXNhYmxlZCxcbiAgICB0aGVtZToge1xuICAgICAgc3BhY2luZzogeyBiYXNlVW5pdCB9LFxuICAgICAgY29sb3JzLFxuICAgIH0sXG4gIH06IEluZGljYXRvclNlcGFyYXRvclByb3BzPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+LFxuICB1bnN0eWxlZDogYm9vbGVhblxuKTogQ1NTT2JqZWN0V2l0aExhYmVsID0+ICh7XG4gIGxhYmVsOiAnaW5kaWNhdG9yU2VwYXJhdG9yJyxcbiAgYWxpZ25TZWxmOiAnc3RyZXRjaCcsXG4gIHdpZHRoOiAxLFxuICAuLi4odW5zdHlsZWRcbiAgICA/IHt9XG4gICAgOiB7XG4gICAgICAgIGJhY2tncm91bmRDb2xvcjogaXNEaXNhYmxlZCA/IGNvbG9ycy5uZXV0cmFsMTAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBtYXJnaW5Cb3R0b206IGJhc2VVbml0ICogMixcbiAgICAgICAgbWFyZ2luVG9wOiBiYXNlVW5pdCAqIDIsXG4gICAgICB9KSxcbn0pO1xuXG5leHBvcnQgY29uc3QgSW5kaWNhdG9yU2VwYXJhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogSW5kaWNhdG9yU2VwYXJhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxzcGFuXG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnaW5kaWNhdG9yU2VwYXJhdG9yJywge1xuICAgICAgICAnaW5kaWNhdG9yLXNlcGFyYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAvPlxuICApO1xufTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBMb2FkaW5nXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgbG9hZGluZ0RvdEFuaW1hdGlvbnMgPSBrZXlmcmFtZXNgXG4gIDAlLCA4MCUsIDEwMCUgeyBvcGFjaXR5OiAwOyB9XG4gIDQwJSB7IG9wYWNpdHk6IDE7IH1cbmA7XG5cbmV4cG9ydCBjb25zdCBsb2FkaW5nSW5kaWNhdG9yQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNGb2N1c2VkLFxuICAgIHNpemUsXG4gICAgdGhlbWU6IHtcbiAgICAgIGNvbG9ycyxcbiAgICAgIHNwYWNpbmc6IHsgYmFzZVVuaXQgfSxcbiAgICB9LFxuICB9OiBMb2FkaW5nSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdsb2FkaW5nSW5kaWNhdG9yJyxcbiAgZGlzcGxheTogJ2ZsZXgnLFxuICB0cmFuc2l0aW9uOiAnY29sb3IgMTUwbXMnLFxuICBhbGlnblNlbGY6ICdjZW50ZXInLFxuICBmb250U2l6ZTogc2l6ZSxcbiAgbGluZUhlaWdodDogMSxcbiAgbWFyZ2luUmlnaHQ6IHNpemUsXG4gIHRleHRBbGlnbjogJ2NlbnRlcicsXG4gIHZlcnRpY2FsQWxpZ246ICdtaWRkbGUnLFxuICAuLi4odW5zdHlsZWRcbiAgICA/IHt9XG4gICAgOiB7XG4gICAgICAgIGNvbG9yOiBpc0ZvY3VzZWQgPyBjb2xvcnMubmV1dHJhbDYwIDogY29sb3JzLm5ldXRyYWwyMCxcbiAgICAgICAgcGFkZGluZzogYmFzZVVuaXQgKiAyLFxuICAgICAgfSksXG59KTtcblxuaW50ZXJmYWNlIExvYWRpbmdEb3RQcm9wcyB7XG4gIGRlbGF5OiBudW1iZXI7XG4gIG9mZnNldDogYm9vbGVhbjtcbn1cbmNvbnN0IExvYWRpbmdEb3QgPSAoeyBkZWxheSwgb2Zmc2V0IH06IExvYWRpbmdEb3RQcm9wcykgPT4gKFxuICA8c3BhblxuICAgIGNzcz17e1xuICAgICAgYW5pbWF0aW9uOiBgJHtsb2FkaW5nRG90QW5pbWF0aW9uc30gMXMgZWFzZS1pbi1vdXQgJHtkZWxheX1tcyBpbmZpbml0ZTtgLFxuICAgICAgYmFja2dyb3VuZENvbG9yOiAnY3VycmVudENvbG9yJyxcbiAgICAgIGJvcmRlclJhZGl1czogJzFlbScsXG4gICAgICBkaXNwbGF5OiAnaW5saW5lLWJsb2NrJyxcbiAgICAgIG1hcmdpbkxlZnQ6IG9mZnNldCA/ICcxZW0nIDogdW5kZWZpbmVkLFxuICAgICAgaGVpZ2h0OiAnMWVtJyxcbiAgICAgIHZlcnRpY2FsQWxpZ246ICd0b3AnLFxuICAgICAgd2lkdGg6ICcxZW0nLFxuICAgIH19XG4gIC8+XG4pO1xuXG5leHBvcnQgaW50ZXJmYWNlIExvYWRpbmdJbmRpY2F0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIC8qKiBQcm9wcyB0aGF0IHdpbGwgYmUgcGFzc2VkIG9uIHRvIHRoZSBjaGlsZHJlbi4gKi9cbiAgaW5uZXJQcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydkaXYnXTtcbiAgLyoqIFRoZSBmb2N1c2VkIHN0YXRlIG9mIHRoZSBzZWxlY3QuICovXG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbiAgaXNEaXNhYmxlZDogYm9vbGVhbjtcbiAgLyoqIFNldCBzaXplIG9mIHRoZSBjb250YWluZXIuICovXG4gIHNpemU6IG51bWJlcjtcbn1cbmV4cG9ydCBjb25zdCBMb2FkaW5nSW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KHtcbiAgaW5uZXJQcm9wcyxcbiAgaXNSdGwsXG4gIHNpemUgPSA0LFxuICAuLi5yZXN0UHJvcHNcbn06IExvYWRpbmdJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPikgPT4ge1xuICByZXR1cm4gKFxuICAgIDxkaXZcbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKFxuICAgICAgICB7IC4uLnJlc3RQcm9wcywgaW5uZXJQcm9wcywgaXNSdGwsIHNpemUgfSxcbiAgICAgICAgJ2xvYWRpbmdJbmRpY2F0b3InLFxuICAgICAgICB7XG4gICAgICAgICAgaW5kaWNhdG9yOiB0cnVlLFxuICAgICAgICAgICdsb2FkaW5nLWluZGljYXRvcic6IHRydWUsXG4gICAgICAgIH1cbiAgICAgICl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MH0gb2Zmc2V0PXtpc1J0bH0gLz5cbiAgICAgIDxMb2FkaW5nRG90IGRlbGF5PXsxNjB9IG9mZnNldCAvPlxuICAgICAgPExvYWRpbmdEb3QgZGVsYXk9ezMyMH0gb2Zmc2V0PXshaXNSdGx9IC8+XG4gICAgPC9kaXY+XG4gICk7XG59O1xuIl19 */",toString:WC},Gf=function(t){var n=t.size,r=Kt(t,GC);return ie("svg",fe({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:ZC},r))},Gc=function(t){return ie(Gf,fe({size:20},t),ie("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},Hf=function(t){return ie(Gf,fe({size:20},t),ie("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},Wf=function(t,n){var r=t.isFocused,o=t.theme,s=o.spacing.baseUnit,a=o.colors;return se({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?a.neutral60:a.neutral20,padding:s*2,":hover":{color:r?a.neutral80:a.neutral40}})},XC=Wf,zC=function(t){var n=t.children,r=t.innerProps;return ie("div",fe({},Xe(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||ie(Hf,null))},YC=Wf,JC=function(t){var n=t.children,r=t.innerProps;return ie("div",fe({},Xe(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||ie(Gc,null))},qC=function(t,n){var r=t.isDisabled,o=t.theme,s=o.spacing.baseUnit,a=o.colors;return se({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?a.neutral10:a.neutral20,marginBottom:s*2,marginTop:s*2})},QC=function(t){var n=t.innerProps;return ie("span",fe({},n,Xe(t,"indicatorSeparator",{"indicator-separator":!0})))},$C=Z9(Vf||(Vf=X9([`
606
+ */var hf;function x9(){return hf||(hf=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,i=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,g=e?Symbol.for("react.suspense"):60113,y=e?Symbol.for("react.suspense_list"):60120,x=e?Symbol.for("react.memo"):60115,b=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,h=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,E=e?Symbol.for("react.scope"):60119;function C(X){return typeof X=="string"||typeof X=="function"||X===r||X===l||X===s||X===o||X===g||X===y||typeof X=="object"&&X!==null&&(X.$$typeof===b||X.$$typeof===x||X.$$typeof===a||X.$$typeof===i||X.$$typeof===f||X.$$typeof===h||X.$$typeof===m||X.$$typeof===E||X.$$typeof===p)}function w(X){if(typeof X=="object"&&X!==null){var Ve=X.$$typeof;switch(Ve){case t:var Ge=X.type;switch(Ge){case c:case l:case r:case s:case o:case g:return Ge;default:var at=Ge&&Ge.$$typeof;switch(at){case i:case f:case b:case x:case a:return at;default:return Ve}}case n:return Ve}}}var v=c,_=l,T=i,S=a,L=t,N=f,k=r,D=b,M=x,j=n,J=s,Y=o,z=g,H=!1;function q(X){return H||(H=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),ne(X)||w(X)===c}function ne(X){return w(X)===l}function ce(X){return w(X)===i}function V(X){return w(X)===a}function R(X){return typeof X=="object"&&X!==null&&X.$$typeof===t}function G(X){return w(X)===f}function W(X){return w(X)===r}function U(X){return w(X)===b}function Q(X){return w(X)===x}function re(X){return w(X)===n}function B(X){return w(X)===s}function te(X){return w(X)===o}function pe(X){return w(X)===g}De.AsyncMode=v,De.ConcurrentMode=_,De.ContextConsumer=T,De.ContextProvider=S,De.Element=L,De.ForwardRef=N,De.Fragment=k,De.Lazy=D,De.Memo=M,De.Portal=j,De.Profiler=J,De.StrictMode=Y,De.Suspense=z,De.isAsyncMode=q,De.isConcurrentMode=ne,De.isContextConsumer=ce,De.isContextProvider=V,De.isElement=R,De.isForwardRef=G,De.isFragment=W,De.isLazy=U,De.isMemo=Q,De.isPortal=re,De.isProfiler=B,De.isStrictMode=te,De.isSuspense=pe,De.isValidElementType=C,De.typeOf=w}()),De}process.env.NODE_ENV==="production"?Fc.exports=C9():Fc.exports=x9();var E9=Fc.exports,gf=E9,v9={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},w9={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},mf={};mf[gf.ForwardRef]=v9,mf[gf.Memo]=w9;var I9=!0;function _9(e,t,n){var r="";return n.split(" ").forEach(function(o){e[o]!==void 0?t.push(e[o]+";"):o&&(r+=o+" ")}),r}var bf=function(t,n,r){var o=t.key+"-"+n.name;(r===!1||I9===!1)&&t.registered[o]===void 0&&(t.registered[o]=n.styles)},S9=function(t,n,r){bf(t,n,r);var o=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var s=n;do t.insert(n===s?"."+o:"",s,t.sheet,!0),s=s.next;while(s!==void 0)}};function T9(e){for(var t=0,n,r=0,o=e.length;o>=4;++r,o-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var A9={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},L9=!1,O9=/[A-Z]|^ms/g,F9=/_EMO_([^_]+?)_([^]*?)_EMO_/g,yf=function(t){return t.charCodeAt(1)===45},Cf=function(t){return t!=null&&typeof t!="boolean"},kc=u9(function(e){return yf(e)?e:e.replace(O9,"-$&").toLowerCase()}),xf=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(F9,function(r,o,s){return cn={name:o,styles:s,next:cn},o})}return A9[t]!==1&&!yf(t)&&typeof n=="number"&&n!==0?n+"px":n},k9="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function $o(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var o=n;if(o.anim===1)return cn={name:o.name,styles:o.styles,next:cn},o.name;var s=n;if(s.styles!==void 0){var a=s.next;if(a!==void 0)for(;a!==void 0;)cn={name:a.name,styles:a.styles,next:cn},a=a.next;var i=s.styles+";";return i}return D9(e,t,n)}case"function":{if(e!==void 0){var c=cn,l=n(e);return cn=c,$o(e,t,l)}break}}var f=n;return f}function D9(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=$o(e,t,n[o])+";";else for(var s in n){var a=n[s];if(typeof a!="object"){var i=a;Cf(i)&&(r+=kc(s)+":"+xf(s,i)+";")}else{if(s==="NO_COMPONENT_SELECTOR"&&L9)throw new Error(k9);if(Array.isArray(a)&&typeof a[0]=="string"&&t==null)for(var c=0;c<a.length;c++)Cf(a[c])&&(r+=kc(s)+":"+xf(s,a[c])+";");else{var l=$o(e,t,a);switch(s){case"animation":case"animationName":{r+=kc(s)+":"+l+";";break}default:r+=s+"{"+l+"}"}}}}return r}var Ef=/label:\s*([^\s;{]+)\s*(;|$)/g,cn;function vf(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,o="";cn=void 0;var s=e[0];if(s==null||s.raw===void 0)r=!1,o+=$o(n,t,s);else{var a=s;o+=a[0]}for(var i=1;i<e.length;i++)if(o+=$o(n,t,e[i]),r){var c=s;o+=c[i]}Ef.lastIndex=0;for(var l="",f;(f=Ef.exec(o))!==null;)l+="-"+f[1];var g=T9(o)+l;return{name:g,styles:o,next:cn}}var N9=function(t){return t()},R9=A.useInsertionEffect?A.useInsertionEffect:!1,M9=R9||N9,P9=!1,wf=A.createContext(typeof HTMLElement<"u"?y9({key:"css"}):null);wf.Provider;var j9=function(t){return I.forwardRef(function(n,r){var o=I.useContext(wf);return t(n,o,r)})},B9=A.createContext({}),Dc={}.hasOwnProperty,Nc="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",V9=function(t,n){var r={};for(var o in n)Dc.call(n,o)&&(r[o]=n[o]);return r[Nc]=t,r},G9=function(t){var n=t.cache,r=t.serialized,o=t.isStringTag;return bf(n,r,o),M9(function(){return S9(n,r,o)}),null},H9=j9(function(e,t,n){var r=e.css;typeof r=="string"&&t.registered[r]!==void 0&&(r=t.registered[r]);var o=e[Nc],s=[r],a="";typeof e.className=="string"?a=_9(t.registered,s,e.className):e.className!=null&&(a=e.className+" ");var i=vf(s,void 0,A.useContext(B9));a+=t.key+"-"+i.name;var c={};for(var l in e)Dc.call(e,l)&&l!=="css"&&l!==Nc&&!P9&&(c[l]=e[l]);return c.className=a,n&&(c.ref=n),A.createElement(A.Fragment,null,A.createElement(G9,{cache:t,serialized:i,isStringTag:typeof o=="string"}),A.createElement(o,c))}),W9=H9,ie=function(t,n){var r=arguments;if(n==null||!Dc.call(n,"css"))return A.createElement.apply(void 0,r);var o=r.length,s=new Array(o);s[0]=W9,s[1]=V9(t,n);for(var a=2;a<o;a++)s[a]=r[a];return A.createElement.apply(null,s)};function Rc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return vf(t)}var Z9=function(){var t=Rc.apply(void 0,arguments),n="animation-"+t.name;return{name:n,styles:"@keyframes "+n+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}};function X9(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const z9=Math.min,Y9=Math.max,pa=Math.round,ha=Math.floor,ga=e=>({x:e,y:e});function J9(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 ma(){return typeof window<"u"}function If(e){return Sf(e)?(e.nodeName||"").toLowerCase():"#document"}function wn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _f(e){var t;return(t=(Sf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Sf(e){return ma()?e instanceof Node||e instanceof wn(e).Node:!1}function q9(e){return ma()?e instanceof Element||e instanceof wn(e).Element:!1}function Mc(e){return ma()?e instanceof HTMLElement||e instanceof wn(e).HTMLElement:!1}function Tf(e){return!ma()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof wn(e).ShadowRoot}function Af(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Pc(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Q9(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function $9(e){return["html","body","#document"].includes(If(e))}function Pc(e){return wn(e).getComputedStyle(e)}function U9(e){if(If(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Tf(e)&&e.host||_f(e);return Tf(t)?t.host:t}function Lf(e){const t=U9(e);return $9(t)?e.ownerDocument?e.ownerDocument.body:e.body:Mc(t)&&Af(t)?t:Lf(t)}function ba(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Lf(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),a=wn(o);if(s){const i=jc(a);return t.concat(a,a.visualViewport||[],Af(o)?o:[],i&&n?ba(i):[])}return t.concat(o,ba(o,[],n))}function jc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function K9(e){const t=Pc(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Mc(e),s=o?e.offsetWidth:n,a=o?e.offsetHeight:r,i=pa(n)!==s||pa(r)!==a;return i&&(n=s,r=a),{width:n,height:r,$:i}}function Bc(e){return q9(e)?e:e.contextElement}function Of(e){const t=Bc(e);if(!Mc(t))return ga(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=K9(t);let a=(s?pa(n.width):n.width)/r,i=(s?pa(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}const eC=ga(0);function tC(e){const t=wn(e);return!Q9()||!t.visualViewport?eC:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function nC(e,t,n){return!1}function Ff(e,t,n,r){t===void 0&&(t=!1);const o=e.getBoundingClientRect(),s=Bc(e);let a=ga(1);t&&(a=Of(e));const i=nC()?tC(s):ga(0);let c=(o.left+i.x)/a.x,l=(o.top+i.y)/a.y,f=o.width/a.x,g=o.height/a.y;if(s){const y=wn(s),x=r;let b=y,p=jc(b);for(;p&&r&&x!==b;){const h=Of(p),m=p.getBoundingClientRect(),E=Pc(p),C=m.left+(p.clientLeft+parseFloat(E.paddingLeft))*h.x,w=m.top+(p.clientTop+parseFloat(E.paddingTop))*h.y;c*=h.x,l*=h.y,f*=h.x,g*=h.y,c+=C,l+=w,b=wn(p),p=jc(b)}}return J9({width:f,height:g,x:c,y:l})}function rC(e,t){let n=null,r;const o=_f(e);function s(){var i;clearTimeout(r),(i=n)==null||i.disconnect(),n=null}function a(i,c){i===void 0&&(i=!1),c===void 0&&(c=1),s();const{left:l,top:f,width:g,height:y}=e.getBoundingClientRect();if(i||t(),!g||!y)return;const x=ha(f),b=ha(o.clientWidth-(l+g)),p=ha(o.clientHeight-(f+y)),h=ha(l),E={rootMargin:-x+"px "+-b+"px "+-p+"px "+-h+"px",threshold:Y9(0,z9(1,c))||1};let C=!0;function w(v){const _=v[0].intersectionRatio;if(_!==c){if(!C)return a();_?a(!1,_):r=setTimeout(()=>{a(!1,1e-7)},1e3)}C=!1}try{n=new IntersectionObserver(w,{...E,root:o.ownerDocument})}catch{n=new IntersectionObserver(w,E)}n.observe(e)}return a(!0),s}function oC(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=Bc(e),f=o||s?[...l?ba(l):[],...ba(t)]:[];f.forEach(m=>{o&&m.addEventListener("scroll",n,{passive:!0}),s&&m.addEventListener("resize",n)});const g=l&&i?rC(l,n):null;let y=-1,x=null;a&&(x=new ResizeObserver(m=>{let[E]=m;E&&E.target===l&&x&&(x.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var C;(C=x)==null||C.observe(t)})),n()}),l&&!c&&x.observe(l),x.observe(t));let b,p=c?Ff(e):null;c&&h();function h(){const m=Ff(e);p&&(m.x!==p.x||m.y!==p.y||m.width!==p.width||m.height!==p.height)&&n(),p=m,b=requestAnimationFrame(h)}return n(),()=>{var m;f.forEach(E=>{o&&E.removeEventListener("scroll",n),s&&E.removeEventListener("resize",n)}),g==null||g(),(m=x)==null||m.disconnect(),x=null,c&&cancelAnimationFrame(b)}}var Vc=I.useLayoutEffect,sC=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],ya=function(){};function aC(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function iC(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];var s=[].concat(r);if(t&&e)for(var a in t)t.hasOwnProperty(a)&&t[a]&&s.push("".concat(aC(e,a)));return s.filter(function(i){return i}).map(function(i){return String(i).trim()}).join(" ")}var Ca=function(t){return bC(t)?t.filter(Boolean):mr(t)==="object"&&t!==null?[t]:[]},kf=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=Kt(t,sC);return se({},n)},Xe=function(t,n,r){var o=t.cx,s=t.getStyles,a=t.getClassNames,i=t.className;return{css:s(n,t),className:o(r??{},a(n,t),i)}};function cC(e,t,n){if(n){var r=n(e,t);if(typeof r=="string")return r}return e}function xa(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function lC(e){return xa(e)?window.innerHeight:e.clientHeight}function Df(e){return xa(e)?window.pageYOffset:e.scrollTop}function Ea(e,t){if(xa(e)){window.scrollTo(0,t);return}e.scrollTop=t}function uC(e){var t=getComputedStyle(e),n=t.position==="absolute",r=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var o=e;o=o.parentElement;)if(t=getComputedStyle(o),!(n&&t.position==="static")&&r.test(t.overflow+t.overflowY+t.overflowX))return o;return document.documentElement}function dC(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function va(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:ya,o=Df(e),s=t-o,a=10,i=0;function c(){i+=a;var l=dC(i,o,s,n);Ea(e,l),i<n?window.requestAnimationFrame(c):r(e)}c()}function Nf(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=t.offsetHeight/3;r.bottom+o>n.bottom?Ea(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+o,e.scrollHeight)):r.top-o<n.top&&Ea(e,Math.max(t.offsetTop-o,0))}function fC(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function Rf(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function pC(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var Mf=!1,hC={get passive(){return Mf=!0}},wa=typeof window<"u"?window:{};wa.addEventListener&&wa.removeEventListener&&(wa.addEventListener("p",ya,hC),wa.removeEventListener("p",ya,!1));var gC=Mf;function mC(e){return e!=null}function bC(e){return Array.isArray(e)}function Uo(e,t,n){return e?t:n}function iL(e){return e}function cL(e){return e}var yC=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var s=Object.entries(t).filter(function(a){var i=tt(a,1),c=i[0];return!r.includes(c)});return s.reduce(function(a,i){var c=tt(i,2),l=c[0],f=c[1];return a[l]=f,a},{})},CC=["children","innerProps"],xC=["children","innerProps"];function EC(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,o=e.placement,s=e.shouldScroll,a=e.isFixedPosition,i=e.controlHeight,c=uC(n),l={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return l;var f=c.getBoundingClientRect(),g=f.height,y=n.getBoundingClientRect(),x=y.bottom,b=y.height,p=y.top,h=n.offsetParent.getBoundingClientRect(),m=h.top,E=a?window.innerHeight:lC(c),C=Df(c),w=parseInt(getComputedStyle(n).marginBottom,10),v=parseInt(getComputedStyle(n).marginTop,10),_=m-v,T=E-p,S=_+C,L=g-C-p,N=x-E+C+w,k=C+p-v,D=160;switch(o){case"auto":case"bottom":if(T>=b)return{placement:"bottom",maxHeight:t};if(L>=b&&!a)return s&&va(c,N,D),{placement:"bottom",maxHeight:t};if(!a&&L>=r||a&&T>=r){s&&va(c,N,D);var M=a?T-w:L-w;return{placement:"bottom",maxHeight:M}}if(o==="auto"||a){var j=t,J=a?_:S;return J>=r&&(j=Math.min(J-w-i,t)),{placement:"top",maxHeight:j}}if(o==="bottom")return s&&Ea(c,N),{placement:"bottom",maxHeight:t};break;case"top":if(_>=b)return{placement:"top",maxHeight:t};if(S>=b&&!a)return s&&va(c,k,D),{placement:"top",maxHeight:t};if(!a&&S>=r||a&&_>=r){var Y=t;return(!a&&S>=r||a&&_>=r)&&(Y=a?_-v:S-v),s&&va(c,k,D),{placement:"top",maxHeight:Y}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(o,'".'))}return l}function vC(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var Pf=function(t){return t==="auto"?"bottom":t},wC=function(t,n){var r,o=t.placement,s=t.theme,a=s.borderRadius,i=s.spacing,c=s.colors;return se((r={label:"menu"},Ur(r,vC(o),"100%"),Ur(r,"position","absolute"),Ur(r,"width","100%"),Ur(r,"zIndex",1),r),n?{}:{backgroundColor:c.neutral0,borderRadius:a,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:i.menuGutter,marginTop:i.menuGutter})},jf=I.createContext(null),IC=function(t){var n=t.children,r=t.minMenuHeight,o=t.maxMenuHeight,s=t.menuPlacement,a=t.menuPosition,i=t.menuShouldScrollIntoView,c=t.theme,l=I.useContext(jf)||{},f=l.setPortalPlacement,g=I.useRef(null),y=I.useState(o),x=tt(y,2),b=x[0],p=x[1],h=I.useState(null),m=tt(h,2),E=m[0],C=m[1],w=c.spacing.controlHeight;return Vc(function(){var v=g.current;if(v){var _=a==="fixed",T=i&&!_,S=EC({maxHeight:o,menuEl:v,minHeight:r,placement:s,shouldScroll:T,isFixedPosition:_,controlHeight:w});p(S.maxHeight),C(S.placement),f==null||f(S.placement)}},[o,s,a,i,r,f,w]),n({ref:g,placerProps:se(se({},t),{},{placement:E||Pf(s),maxHeight:b})})},_C=function(t){var n=t.children,r=t.innerRef,o=t.innerProps;return ie("div",fe({},Xe(t,"menu",{menu:!0}),{ref:r},o),n)},SC=_C,TC=function(t,n){var r=t.maxHeight,o=t.theme.spacing.baseUnit;return se({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:o,paddingTop:o})},AC=function(t){var n=t.children,r=t.innerProps,o=t.innerRef,s=t.isMulti;return ie("div",fe({},Xe(t,"menuList",{"menu-list":!0,"menu-list--is-multi":s}),{ref:o},r),n)},Bf=function(t,n){var r=t.theme,o=r.spacing.baseUnit,s=r.colors;return se({textAlign:"center"},n?{}:{color:s.neutral40,padding:"".concat(o*2,"px ").concat(o*3,"px")})},LC=Bf,OC=Bf,FC=function(t){var n=t.children,r=n===void 0?"No options":n,o=t.innerProps,s=Kt(t,CC);return ie("div",fe({},Xe(se(se({},s),{},{children:r,innerProps:o}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),o),r)},kC=function(t){var n=t.children,r=n===void 0?"Loading...":n,o=t.innerProps,s=Kt(t,xC);return ie("div",fe({},Xe(se(se({},s),{},{children:r,innerProps:o}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),o),r)},DC=function(t){var n=t.rect,r=t.offset,o=t.position;return{left:n.left,position:o,top:r,width:n.width,zIndex:1}},NC=function(t){var n=t.appendTo,r=t.children,o=t.controlElement,s=t.innerProps,a=t.menuPlacement,i=t.menuPosition,c=I.useRef(null),l=I.useRef(null),f=I.useState(Pf(a)),g=tt(f,2),y=g[0],x=g[1],b=I.useMemo(function(){return{setPortalPlacement:x}},[]),p=I.useState(null),h=tt(p,2),m=h[0],E=h[1],C=I.useCallback(function(){if(o){var T=fC(o),S=i==="fixed"?0:window.pageYOffset,L=T[y]+S;(L!==(m==null?void 0:m.offset)||T.left!==(m==null?void 0:m.rect.left)||T.width!==(m==null?void 0:m.rect.width))&&E({offset:L,rect:T})}},[o,i,y,m==null?void 0:m.offset,m==null?void 0:m.rect.left,m==null?void 0:m.rect.width]);Vc(function(){C()},[C]);var w=I.useCallback(function(){typeof l.current=="function"&&(l.current(),l.current=null),o&&c.current&&(l.current=oC(o,c.current,C,{elementResize:"ResizeObserver"in window}))},[o,C]);Vc(function(){w()},[w]);var v=I.useCallback(function(T){c.current=T,w()},[w]);if(!n&&i!=="fixed"||!m)return null;var _=ie("div",fe({ref:v},Xe(se(se({},t),{},{offset:m.offset,position:i,rect:m.rect}),"menuPortal",{"menu-portal":!0}),s),r);return ie(jf.Provider,{value:b},n?je.createPortal(_,n):_)},RC=function(t){var n=t.isDisabled,r=t.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},MC=function(t){var n=t.children,r=t.innerProps,o=t.isDisabled,s=t.isRtl;return ie("div",fe({},Xe(t,"container",{"--is-disabled":o,"--is-rtl":s}),r),n)},PC=function(t,n){var r=t.theme.spacing,o=t.isMulti,s=t.hasValue,a=t.selectProps.controlShouldRenderValue;return se({alignItems:"center",display:o&&s&&a?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},jC=function(t){var n=t.children,r=t.innerProps,o=t.isMulti,s=t.hasValue;return ie("div",fe({},Xe(t,"valueContainer",{"value-container":!0,"value-container--is-multi":o,"value-container--has-value":s}),r),n)},BC=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},VC=function(t){var n=t.children,r=t.innerProps;return ie("div",fe({},Xe(t,"indicatorsContainer",{indicators:!0}),r),n)},Vf,GC=["size"],HC=["innerProps","isRtl","size"];function WC(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var ZC=process.env.NODE_ENV==="production"?{name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"}:{name:"tj5bde-Svg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0;label:Svg;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgUmVhY3ROb2RlIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsganN4LCBrZXlmcmFtZXMgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmltcG9ydCB7XG4gIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lLFxuICBDU1NPYmplY3RXaXRoTGFiZWwsXG4gIEdyb3VwQmFzZSxcbn0gZnJvbSAnLi4vdHlwZXMnO1xuaW1wb3J0IHsgZ2V0U3R5bGVQcm9wcyB9IGZyb20gJy4uL3V0aWxzJztcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEljb25zXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgU3ZnID0gKHtcbiAgc2l6ZSxcbiAgLi4ucHJvcHNcbn06IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3ZnJ10gJiB7IHNpemU6IG51bWJlciB9KSA9PiAoXG4gIDxzdmdcbiAgICBoZWlnaHQ9e3NpemV9XG4gICAgd2lkdGg9e3NpemV9XG4gICAgdmlld0JveD1cIjAgMCAyMCAyMFwiXG4gICAgYXJpYS1oaWRkZW49XCJ0cnVlXCJcbiAgICBmb2N1c2FibGU9XCJmYWxzZVwiXG4gICAgY3NzPXt7XG4gICAgICBkaXNwbGF5OiAnaW5saW5lLWJsb2NrJyxcbiAgICAgIGZpbGw6ICdjdXJyZW50Q29sb3InLFxuICAgICAgbGluZUhlaWdodDogMSxcbiAgICAgIHN0cm9rZTogJ2N1cnJlbnRDb2xvcicsXG4gICAgICBzdHJva2VXaWR0aDogMCxcbiAgICB9fVxuICAgIHsuLi5wcm9wc31cbiAgLz5cbik7XG5cbmV4cG9ydCB0eXBlIENyb3NzSWNvblByb3BzID0gSlNYLkludHJpbnNpY0VsZW1lbnRzWydzdmcnXSAmIHsgc2l6ZT86IG51bWJlciB9O1xuZXhwb3J0IGNvbnN0IENyb3NzSWNvbiA9IChwcm9wczogQ3Jvc3NJY29uUHJvcHMpID0+IChcbiAgPFN2ZyBzaXplPXsyMH0gey4uLnByb3BzfT5cbiAgICA8cGF0aCBkPVwiTTE0LjM0OCAxNC44NDljLTAuNDY5IDAuNDY5LTEuMjI5IDAuNDY5LTEuNjk3IDBsLTIuNjUxLTMuMDMwLTIuNjUxIDMuMDI5Yy0wLjQ2OSAwLjQ2OS0xLjIyOSAwLjQ2OS0xLjY5NyAwLTAuNDY5LTAuNDY5LTAuNDY5LTEuMjI5IDAtMS42OTdsMi43NTgtMy4xNS0yLjc1OS0zLjE1MmMtMC40NjktMC40NjktMC40NjktMS4yMjggMC0xLjY5N3MxLjIyOC0wLjQ2OSAxLjY5NyAwbDIuNjUyIDMuMDMxIDIuNjUxLTMuMDMxYzAuNDY5LTAuNDY5IDEuMjI4LTAuNDY5IDEuNjk3IDBzMC40NjkgMS4yMjkgMCAxLjY5N2wtMi43NTggMy4xNTIgMi43NTggMy4xNWMwLjQ2OSAwLjQ2OSAwLjQ2OSAxLjIyOSAwIDEuNjk4elwiIC8+XG4gIDwvU3ZnPlxuKTtcbmV4cG9ydCB0eXBlIERvd25DaGV2cm9uUHJvcHMgPSBKU1guSW50cmluc2ljRWxlbWVudHNbJ3N2ZyddICYgeyBzaXplPzogbnVtYmVyIH07XG5leHBvcnQgY29uc3QgRG93bkNoZXZyb24gPSAocHJvcHM6IERvd25DaGV2cm9uUHJvcHMpID0+IChcbiAgPFN2ZyBzaXplPXsyMH0gey4uLnByb3BzfT5cbiAgICA8cGF0aCBkPVwiTTQuNTE2IDcuNTQ4YzAuNDM2LTAuNDQ2IDEuMDQzLTAuNDgxIDEuNTc2IDBsMy45MDggMy43NDcgMy45MDgtMy43NDdjMC41MzMtMC40ODEgMS4xNDEtMC40NDYgMS41NzQgMCAwLjQzNiAwLjQ0NSAwLjQwOCAxLjE5NyAwIDEuNjE1LTAuNDA2IDAuNDE4LTQuNjk1IDQuNTAyLTQuNjk1IDQuNTAyLTAuMjE3IDAuMjIzLTAuNTAyIDAuMzM1LTAuNzg3IDAuMzM1cy0wLjU3LTAuMTEyLTAuNzg5LTAuMzM1YzAgMC00LjI4Ny00LjA4NC00LjY5NS00LjUwMnMtMC40MzYtMS4xNyAwLTEuNjE1elwiIC8+XG4gIDwvU3ZnPlxuKTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEJ1dHRvbnNcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5leHBvcnQgaW50ZXJmYWNlIERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8XG4gIE9wdGlvbiA9IHVua25vd24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuID0gYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPiA9IEdyb3VwQmFzZTxPcHRpb24+XG4+IGV4dGVuZHMgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWU8T3B0aW9uLCBJc011bHRpLCBHcm91cD4ge1xuICAvKiogVGhlIGNoaWxkcmVuIHRvIGJlIHJlbmRlcmVkIGluc2lkZSB0aGUgaW5kaWNhdG9yLiAqL1xuICBjaGlsZHJlbj86IFJlYWN0Tm9kZTtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpc0Rpc2FibGVkOiBib29sZWFuO1xufVxuXG5jb25zdCBiYXNlQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNGb2N1c2VkLFxuICAgIHRoZW1lOiB7XG4gICAgICBzcGFjaW5nOiB7IGJhc2VVbml0IH0sXG4gICAgICBjb2xvcnMsXG4gICAgfSxcbiAgfTpcbiAgICB8IERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbiAgICB8IENsZWFySW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdpbmRpY2F0b3JDb250YWluZXInLFxuICBkaXNwbGF5OiAnZmxleCcsXG4gIHRyYW5zaXRpb246ICdjb2xvciAxNTBtcycsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsNjAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBwYWRkaW5nOiBiYXNlVW5pdCAqIDIsXG4gICAgICAgICc6aG92ZXInOiB7XG4gICAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsODAgOiBjb2xvcnMubmV1dHJhbDQwLFxuICAgICAgICB9LFxuICAgICAgfSksXG59KTtcblxuZXhwb3J0IGNvbnN0IGRyb3Bkb3duSW5kaWNhdG9yQ1NTID0gYmFzZUNTUztcbmV4cG9ydCBjb25zdCBEcm9wZG93bkluZGljYXRvciA9IDxcbiAgT3B0aW9uLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPlxuPihcbiAgcHJvcHM6IERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGNoaWxkcmVuLCBpbm5lclByb3BzIH0gPSBwcm9wcztcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2Ryb3Bkb3duSW5kaWNhdG9yJywge1xuICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICdkcm9wZG93bi1pbmRpY2F0b3InOiB0cnVlLFxuICAgICAgfSl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICB7Y2hpbGRyZW4gfHwgPERvd25DaGV2cm9uIC8+fVxuICAgIDwvZGl2PlxuICApO1xufTtcblxuZXhwb3J0IGludGVyZmFjZSBDbGVhckluZGljYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgLyoqIFRoZSBjaGlsZHJlbiB0byBiZSByZW5kZXJlZCBpbnNpZGUgdGhlIGluZGljYXRvci4gKi9cbiAgY2hpbGRyZW4/OiBSZWFjdE5vZGU7XG4gIC8qKiBQcm9wcyB0aGF0IHdpbGwgYmUgcGFzc2VkIG9uIHRvIHRoZSBjaGlsZHJlbi4gKi9cbiAgaW5uZXJQcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydkaXYnXTtcbiAgLyoqIFRoZSBmb2N1c2VkIHN0YXRlIG9mIHRoZSBzZWxlY3QuICovXG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbn1cblxuZXhwb3J0IGNvbnN0IGNsZWFySW5kaWNhdG9yQ1NTID0gYmFzZUNTUztcbmV4cG9ydCBjb25zdCBDbGVhckluZGljYXRvciA9IDxcbiAgT3B0aW9uLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPlxuPihcbiAgcHJvcHM6IENsZWFySW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGNoaWxkcmVuLCBpbm5lclByb3BzIH0gPSBwcm9wcztcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2NsZWFySW5kaWNhdG9yJywge1xuICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICdjbGVhci1pbmRpY2F0b3InOiB0cnVlLFxuICAgICAgfSl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICB7Y2hpbGRyZW4gfHwgPENyb3NzSWNvbiAvPn1cbiAgICA8L2Rpdj5cbiAgKTtcbn07XG5cbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuLy8gU2VwYXJhdG9yXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuZXhwb3J0IGludGVyZmFjZSBJbmRpY2F0b3JTZXBhcmF0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIGlzRGlzYWJsZWQ6IGJvb2xlYW47XG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbiAgaW5uZXJQcm9wcz86IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3BhbiddO1xufVxuXG5leHBvcnQgY29uc3QgaW5kaWNhdG9yU2VwYXJhdG9yQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNEaXNhYmxlZCxcbiAgICB0aGVtZToge1xuICAgICAgc3BhY2luZzogeyBiYXNlVW5pdCB9LFxuICAgICAgY29sb3JzLFxuICAgIH0sXG4gIH06IEluZGljYXRvclNlcGFyYXRvclByb3BzPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+LFxuICB1bnN0eWxlZDogYm9vbGVhblxuKTogQ1NTT2JqZWN0V2l0aExhYmVsID0+ICh7XG4gIGxhYmVsOiAnaW5kaWNhdG9yU2VwYXJhdG9yJyxcbiAgYWxpZ25TZWxmOiAnc3RyZXRjaCcsXG4gIHdpZHRoOiAxLFxuICAuLi4odW5zdHlsZWRcbiAgICA/IHt9XG4gICAgOiB7XG4gICAgICAgIGJhY2tncm91bmRDb2xvcjogaXNEaXNhYmxlZCA/IGNvbG9ycy5uZXV0cmFsMTAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBtYXJnaW5Cb3R0b206IGJhc2VVbml0ICogMixcbiAgICAgICAgbWFyZ2luVG9wOiBiYXNlVW5pdCAqIDIsXG4gICAgICB9KSxcbn0pO1xuXG5leHBvcnQgY29uc3QgSW5kaWNhdG9yU2VwYXJhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogSW5kaWNhdG9yU2VwYXJhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxzcGFuXG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnaW5kaWNhdG9yU2VwYXJhdG9yJywge1xuICAgICAgICAnaW5kaWNhdG9yLXNlcGFyYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAvPlxuICApO1xufTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBMb2FkaW5nXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgbG9hZGluZ0RvdEFuaW1hdGlvbnMgPSBrZXlmcmFtZXNgXG4gIDAlLCA4MCUsIDEwMCUgeyBvcGFjaXR5OiAwOyB9XG4gIDQwJSB7IG9wYWNpdHk6IDE7IH1cbmA7XG5cbmV4cG9ydCBjb25zdCBsb2FkaW5nSW5kaWNhdG9yQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNGb2N1c2VkLFxuICAgIHNpemUsXG4gICAgdGhlbWU6IHtcbiAgICAgIGNvbG9ycyxcbiAgICAgIHNwYWNpbmc6IHsgYmFzZVVuaXQgfSxcbiAgICB9LFxuICB9OiBMb2FkaW5nSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdsb2FkaW5nSW5kaWNhdG9yJyxcbiAgZGlzcGxheTogJ2ZsZXgnLFxuICB0cmFuc2l0aW9uOiAnY29sb3IgMTUwbXMnLFxuICBhbGlnblNlbGY6ICdjZW50ZXInLFxuICBmb250U2l6ZTogc2l6ZSxcbiAgbGluZUhlaWdodDogMSxcbiAgbWFyZ2luUmlnaHQ6IHNpemUsXG4gIHRleHRBbGlnbjogJ2NlbnRlcicsXG4gIHZlcnRpY2FsQWxpZ246ICdtaWRkbGUnLFxuICAuLi4odW5zdHlsZWRcbiAgICA/IHt9XG4gICAgOiB7XG4gICAgICAgIGNvbG9yOiBpc0ZvY3VzZWQgPyBjb2xvcnMubmV1dHJhbDYwIDogY29sb3JzLm5ldXRyYWwyMCxcbiAgICAgICAgcGFkZGluZzogYmFzZVVuaXQgKiAyLFxuICAgICAgfSksXG59KTtcblxuaW50ZXJmYWNlIExvYWRpbmdEb3RQcm9wcyB7XG4gIGRlbGF5OiBudW1iZXI7XG4gIG9mZnNldDogYm9vbGVhbjtcbn1cbmNvbnN0IExvYWRpbmdEb3QgPSAoeyBkZWxheSwgb2Zmc2V0IH06IExvYWRpbmdEb3RQcm9wcykgPT4gKFxuICA8c3BhblxuICAgIGNzcz17e1xuICAgICAgYW5pbWF0aW9uOiBgJHtsb2FkaW5nRG90QW5pbWF0aW9uc30gMXMgZWFzZS1pbi1vdXQgJHtkZWxheX1tcyBpbmZpbml0ZTtgLFxuICAgICAgYmFja2dyb3VuZENvbG9yOiAnY3VycmVudENvbG9yJyxcbiAgICAgIGJvcmRlclJhZGl1czogJzFlbScsXG4gICAgICBkaXNwbGF5OiAnaW5saW5lLWJsb2NrJyxcbiAgICAgIG1hcmdpbkxlZnQ6IG9mZnNldCA/ICcxZW0nIDogdW5kZWZpbmVkLFxuICAgICAgaGVpZ2h0OiAnMWVtJyxcbiAgICAgIHZlcnRpY2FsQWxpZ246ICd0b3AnLFxuICAgICAgd2lkdGg6ICcxZW0nLFxuICAgIH19XG4gIC8+XG4pO1xuXG5leHBvcnQgaW50ZXJmYWNlIExvYWRpbmdJbmRpY2F0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIC8qKiBQcm9wcyB0aGF0IHdpbGwgYmUgcGFzc2VkIG9uIHRvIHRoZSBjaGlsZHJlbi4gKi9cbiAgaW5uZXJQcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydkaXYnXTtcbiAgLyoqIFRoZSBmb2N1c2VkIHN0YXRlIG9mIHRoZSBzZWxlY3QuICovXG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbiAgaXNEaXNhYmxlZDogYm9vbGVhbjtcbiAgLyoqIFNldCBzaXplIG9mIHRoZSBjb250YWluZXIuICovXG4gIHNpemU6IG51bWJlcjtcbn1cbmV4cG9ydCBjb25zdCBMb2FkaW5nSW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KHtcbiAgaW5uZXJQcm9wcyxcbiAgaXNSdGwsXG4gIHNpemUgPSA0LFxuICAuLi5yZXN0UHJvcHNcbn06IExvYWRpbmdJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPikgPT4ge1xuICByZXR1cm4gKFxuICAgIDxkaXZcbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKFxuICAgICAgICB7IC4uLnJlc3RQcm9wcywgaW5uZXJQcm9wcywgaXNSdGwsIHNpemUgfSxcbiAgICAgICAgJ2xvYWRpbmdJbmRpY2F0b3InLFxuICAgICAgICB7XG4gICAgICAgICAgaW5kaWNhdG9yOiB0cnVlLFxuICAgICAgICAgICdsb2FkaW5nLWluZGljYXRvcic6IHRydWUsXG4gICAgICAgIH1cbiAgICAgICl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MH0gb2Zmc2V0PXtpc1J0bH0gLz5cbiAgICAgIDxMb2FkaW5nRG90IGRlbGF5PXsxNjB9IG9mZnNldCAvPlxuICAgICAgPExvYWRpbmdEb3QgZGVsYXk9ezMyMH0gb2Zmc2V0PXshaXNSdGx9IC8+XG4gICAgPC9kaXY+XG4gICk7XG59O1xuIl19 */",toString:WC},Gf=function(t){var n=t.size,r=Kt(t,GC);return ie("svg",fe({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:ZC},r))},Gc=function(t){return ie(Gf,fe({size:20},t),ie("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},Hf=function(t){return ie(Gf,fe({size:20},t),ie("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},Wf=function(t,n){var r=t.isFocused,o=t.theme,s=o.spacing.baseUnit,a=o.colors;return se({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?a.neutral60:a.neutral20,padding:s*2,":hover":{color:r?a.neutral80:a.neutral40}})},XC=Wf,zC=function(t){var n=t.children,r=t.innerProps;return ie("div",fe({},Xe(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||ie(Hf,null))},YC=Wf,JC=function(t){var n=t.children,r=t.innerProps;return ie("div",fe({},Xe(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||ie(Gc,null))},qC=function(t,n){var r=t.isDisabled,o=t.theme,s=o.spacing.baseUnit,a=o.colors;return se({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?a.neutral10:a.neutral20,marginBottom:s*2,marginTop:s*2})},QC=function(t){var n=t.innerProps;return ie("span",fe({},n,Xe(t,"indicatorSeparator",{"indicator-separator":!0})))},$C=Z9(Vf||(Vf=X9([`
607
607
  0%, 80%, 100% { opacity: 0; }
608
608
  40% { opacity: 1; }
609
609
  `]))),UC=function(t,n){var r=t.isFocused,o=t.size,s=t.theme,a=s.colors,i=s.spacing.baseUnit;return se({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:o,lineHeight:1,marginRight:o,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?a.neutral60:a.neutral20,padding:i*2})},Hc=function(t){var n=t.delay,r=t.offset;return ie("span",{css:Rc({animation:"".concat($C," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},process.env.NODE_ENV==="production"?"":";label:LoadingDot;",process.env.NODE_ENV==="production"?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW1RSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgUmVhY3ROb2RlIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsganN4LCBrZXlmcmFtZXMgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmltcG9ydCB7XG4gIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lLFxuICBDU1NPYmplY3RXaXRoTGFiZWwsXG4gIEdyb3VwQmFzZSxcbn0gZnJvbSAnLi4vdHlwZXMnO1xuaW1wb3J0IHsgZ2V0U3R5bGVQcm9wcyB9IGZyb20gJy4uL3V0aWxzJztcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEljb25zXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgU3ZnID0gKHtcbiAgc2l6ZSxcbiAgLi4ucHJvcHNcbn06IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3ZnJ10gJiB7IHNpemU6IG51bWJlciB9KSA9PiAoXG4gIDxzdmdcbiAgICBoZWlnaHQ9e3NpemV9XG4gICAgd2lkdGg9e3NpemV9XG4gICAgdmlld0JveD1cIjAgMCAyMCAyMFwiXG4gICAgYXJpYS1oaWRkZW49XCJ0cnVlXCJcbiAgICBmb2N1c2FibGU9XCJmYWxzZVwiXG4gICAgY3NzPXt7XG4gICAgICBkaXNwbGF5OiAnaW5saW5lLWJsb2NrJyxcbiAgICAgIGZpbGw6ICdjdXJyZW50Q29sb3InLFxuICAgICAgbGluZUhlaWdodDogMSxcbiAgICAgIHN0cm9rZTogJ2N1cnJlbnRDb2xvcicsXG4gICAgICBzdHJva2VXaWR0aDogMCxcbiAgICB9fVxuICAgIHsuLi5wcm9wc31cbiAgLz5cbik7XG5cbmV4cG9ydCB0eXBlIENyb3NzSWNvblByb3BzID0gSlNYLkludHJpbnNpY0VsZW1lbnRzWydzdmcnXSAmIHsgc2l6ZT86IG51bWJlciB9O1xuZXhwb3J0IGNvbnN0IENyb3NzSWNvbiA9IChwcm9wczogQ3Jvc3NJY29uUHJvcHMpID0+IChcbiAgPFN2ZyBzaXplPXsyMH0gey4uLnByb3BzfT5cbiAgICA8cGF0aCBkPVwiTTE0LjM0OCAxNC44NDljLTAuNDY5IDAuNDY5LTEuMjI5IDAuNDY5LTEuNjk3IDBsLTIuNjUxLTMuMDMwLTIuNjUxIDMuMDI5Yy0wLjQ2OSAwLjQ2OS0xLjIyOSAwLjQ2OS0xLjY5NyAwLTAuNDY5LTAuNDY5LTAuNDY5LTEuMjI5IDAtMS42OTdsMi43NTgtMy4xNS0yLjc1OS0zLjE1MmMtMC40NjktMC40NjktMC40NjktMS4yMjggMC0xLjY5N3MxLjIyOC0wLjQ2OSAxLjY5NyAwbDIuNjUyIDMuMDMxIDIuNjUxLTMuMDMxYzAuNDY5LTAuNDY5IDEuMjI4LTAuNDY5IDEuNjk3IDBzMC40NjkgMS4yMjkgMCAxLjY5N2wtMi43NTggMy4xNTIgMi43NTggMy4xNWMwLjQ2OSAwLjQ2OSAwLjQ2OSAxLjIyOSAwIDEuNjk4elwiIC8+XG4gIDwvU3ZnPlxuKTtcbmV4cG9ydCB0eXBlIERvd25DaGV2cm9uUHJvcHMgPSBKU1guSW50cmluc2ljRWxlbWVudHNbJ3N2ZyddICYgeyBzaXplPzogbnVtYmVyIH07XG5leHBvcnQgY29uc3QgRG93bkNoZXZyb24gPSAocHJvcHM6IERvd25DaGV2cm9uUHJvcHMpID0+IChcbiAgPFN2ZyBzaXplPXsyMH0gey4uLnByb3BzfT5cbiAgICA8cGF0aCBkPVwiTTQuNTE2IDcuNTQ4YzAuNDM2LTAuNDQ2IDEuMDQzLTAuNDgxIDEuNTc2IDBsMy45MDggMy43NDcgMy45MDgtMy43NDdjMC41MzMtMC40ODEgMS4xNDEtMC40NDYgMS41NzQgMCAwLjQzNiAwLjQ0NSAwLjQwOCAxLjE5NyAwIDEuNjE1LTAuNDA2IDAuNDE4LTQuNjk1IDQuNTAyLTQuNjk1IDQuNTAyLTAuMjE3IDAuMjIzLTAuNTAyIDAuMzM1LTAuNzg3IDAuMzM1cy0wLjU3LTAuMTEyLTAuNzg5LTAuMzM1YzAgMC00LjI4Ny00LjA4NC00LjY5NS00LjUwMnMtMC40MzYtMS4xNyAwLTEuNjE1elwiIC8+XG4gIDwvU3ZnPlxuKTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEJ1dHRvbnNcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5leHBvcnQgaW50ZXJmYWNlIERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8XG4gIE9wdGlvbiA9IHVua25vd24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuID0gYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPiA9IEdyb3VwQmFzZTxPcHRpb24+XG4+IGV4dGVuZHMgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWU8T3B0aW9uLCBJc011bHRpLCBHcm91cD4ge1xuICAvKiogVGhlIGNoaWxkcmVuIHRvIGJlIHJlbmRlcmVkIGluc2lkZSB0aGUgaW5kaWNhdG9yLiAqL1xuICBjaGlsZHJlbj86IFJlYWN0Tm9kZTtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpc0Rpc2FibGVkOiBib29sZWFuO1xufVxuXG5jb25zdCBiYXNlQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNGb2N1c2VkLFxuICAgIHRoZW1lOiB7XG4gICAgICBzcGFjaW5nOiB7IGJhc2VVbml0IH0sXG4gICAgICBjb2xvcnMsXG4gICAgfSxcbiAgfTpcbiAgICB8IERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbiAgICB8IENsZWFySW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdpbmRpY2F0b3JDb250YWluZXInLFxuICBkaXNwbGF5OiAnZmxleCcsXG4gIHRyYW5zaXRpb246ICdjb2xvciAxNTBtcycsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsNjAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBwYWRkaW5nOiBiYXNlVW5pdCAqIDIsXG4gICAgICAgICc6aG92ZXInOiB7XG4gICAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsODAgOiBjb2xvcnMubmV1dHJhbDQwLFxuICAgICAgICB9LFxuICAgICAgfSksXG59KTtcblxuZXhwb3J0IGNvbnN0IGRyb3Bkb3duSW5kaWNhdG9yQ1NTID0gYmFzZUNTUztcbmV4cG9ydCBjb25zdCBEcm9wZG93bkluZGljYXRvciA9IDxcbiAgT3B0aW9uLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPlxuPihcbiAgcHJvcHM6IERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGNoaWxkcmVuLCBpbm5lclByb3BzIH0gPSBwcm9wcztcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2Ryb3Bkb3duSW5kaWNhdG9yJywge1xuICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICdkcm9wZG93bi1pbmRpY2F0b3InOiB0cnVlLFxuICAgICAgfSl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICB7Y2hpbGRyZW4gfHwgPERvd25DaGV2cm9uIC8+fVxuICAgIDwvZGl2PlxuICApO1xufTtcblxuZXhwb3J0IGludGVyZmFjZSBDbGVhckluZGljYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgLyoqIFRoZSBjaGlsZHJlbiB0byBiZSByZW5kZXJlZCBpbnNpZGUgdGhlIGluZGljYXRvci4gKi9cbiAgY2hpbGRyZW4/OiBSZWFjdE5vZGU7XG4gIC8qKiBQcm9wcyB0aGF0IHdpbGwgYmUgcGFzc2VkIG9uIHRvIHRoZSBjaGlsZHJlbi4gKi9cbiAgaW5uZXJQcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydkaXYnXTtcbiAgLyoqIFRoZSBmb2N1c2VkIHN0YXRlIG9mIHRoZSBzZWxlY3QuICovXG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbn1cblxuZXhwb3J0IGNvbnN0IGNsZWFySW5kaWNhdG9yQ1NTID0gYmFzZUNTUztcbmV4cG9ydCBjb25zdCBDbGVhckluZGljYXRvciA9IDxcbiAgT3B0aW9uLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPlxuPihcbiAgcHJvcHM6IENsZWFySW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGNoaWxkcmVuLCBpbm5lclByb3BzIH0gPSBwcm9wcztcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2NsZWFySW5kaWNhdG9yJywge1xuICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICdjbGVhci1pbmRpY2F0b3InOiB0cnVlLFxuICAgICAgfSl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICB7Y2hpbGRyZW4gfHwgPENyb3NzSWNvbiAvPn1cbiAgICA8L2Rpdj5cbiAgKTtcbn07XG5cbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuLy8gU2VwYXJhdG9yXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuZXhwb3J0IGludGVyZmFjZSBJbmRpY2F0b3JTZXBhcmF0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIGlzRGlzYWJsZWQ6IGJvb2xlYW47XG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbiAgaW5uZXJQcm9wcz86IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3BhbiddO1xufVxuXG5leHBvcnQgY29uc3QgaW5kaWNhdG9yU2VwYXJhdG9yQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNEaXNhYmxlZCxcbiAgICB0aGVtZToge1xuICAgICAgc3BhY2luZzogeyBiYXNlVW5pdCB9LFxuICAgICAgY29sb3JzLFxuICAgIH0sXG4gIH06IEluZGljYXRvclNlcGFyYXRvclByb3BzPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+LFxuICB1bnN0eWxlZDogYm9vbGVhblxuKTogQ1NTT2JqZWN0V2l0aExhYmVsID0+ICh7XG4gIGxhYmVsOiAnaW5kaWNhdG9yU2VwYXJhdG9yJyxcbiAgYWxpZ25TZWxmOiAnc3RyZXRjaCcsXG4gIHdpZHRoOiAxLFxuICAuLi4odW5zdHlsZWRcbiAgICA/IHt9XG4gICAgOiB7XG4gICAgICAgIGJhY2tncm91bmRDb2xvcjogaXNEaXNhYmxlZCA/IGNvbG9ycy5uZXV0cmFsMTAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBtYXJnaW5Cb3R0b206IGJhc2VVbml0ICogMixcbiAgICAgICAgbWFyZ2luVG9wOiBiYXNlVW5pdCAqIDIsXG4gICAgICB9KSxcbn0pO1xuXG5leHBvcnQgY29uc3QgSW5kaWNhdG9yU2VwYXJhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogSW5kaWNhdG9yU2VwYXJhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxzcGFuXG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnaW5kaWNhdG9yU2VwYXJhdG9yJywge1xuICAgICAgICAnaW5kaWNhdG9yLXNlcGFyYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAvPlxuICApO1xufTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBMb2FkaW5nXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgbG9hZGluZ0RvdEFuaW1hdGlvbnMgPSBrZXlmcmFtZXNgXG4gIDAlLCA4MCUsIDEwMCUgeyBvcGFjaXR5OiAwOyB9XG4gIDQwJSB7IG9wYWNpdHk6IDE7IH1cbmA7XG5cbmV4cG9ydCBjb25zdCBsb2FkaW5nSW5kaWNhdG9yQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNGb2N1c2VkLFxuICAgIHNpemUsXG4gICAgdGhlbWU6IHtcbiAgICAgIGNvbG9ycyxcbiAgICAgIHNwYWNpbmc6IHsgYmFzZVVuaXQgfSxcbiAgICB9LFxuICB9OiBMb2FkaW5nSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdsb2FkaW5nSW5kaWNhdG9yJyxcbiAgZGlzcGxheTogJ2ZsZXgnLFxuICB0cmFuc2l0aW9uOiAnY29sb3IgMTUwbXMnLFxuICBhbGlnblNlbGY6ICdjZW50ZXInLFxuICBmb250U2l6ZTogc2l6ZSxcbiAgbGluZUhlaWdodDogMSxcbiAgbWFyZ2luUmlnaHQ6IHNpemUsXG4gIHRleHRBbGlnbjogJ2NlbnRlcicsXG4gIHZlcnRpY2FsQWxpZ246ICdtaWRkbGUnLFxuICAuLi4odW5zdHlsZWRcbiAgICA/IHt9XG4gICAgOiB7XG4gICAgICAgIGNvbG9yOiBpc0ZvY3VzZWQgPyBjb2xvcnMubmV1dHJhbDYwIDogY29sb3JzLm5ldXRyYWwyMCxcbiAgICAgICAgcGFkZGluZzogYmFzZVVuaXQgKiAyLFxuICAgICAgfSksXG59KTtcblxuaW50ZXJmYWNlIExvYWRpbmdEb3RQcm9wcyB7XG4gIGRlbGF5OiBudW1iZXI7XG4gIG9mZnNldDogYm9vbGVhbjtcbn1cbmNvbnN0IExvYWRpbmdEb3QgPSAoeyBkZWxheSwgb2Zmc2V0IH06IExvYWRpbmdEb3RQcm9wcykgPT4gKFxuICA8c3BhblxuICAgIGNzcz17e1xuICAgICAgYW5pbWF0aW9uOiBgJHtsb2FkaW5nRG90QW5pbWF0aW9uc30gMXMgZWFzZS1pbi1vdXQgJHtkZWxheX1tcyBpbmZpbml0ZTtgLFxuICAgICAgYmFja2dyb3VuZENvbG9yOiAnY3VycmVudENvbG9yJyxcbiAgICAgIGJvcmRlclJhZGl1czogJzFlbScsXG4gICAgICBkaXNwbGF5OiAnaW5saW5lLWJsb2NrJyxcbiAgICAgIG1hcmdpbkxlZnQ6IG9mZnNldCA/ICcxZW0nIDogdW5kZWZpbmVkLFxuICAgICAgaGVpZ2h0OiAnMWVtJyxcbiAgICAgIHZlcnRpY2FsQWxpZ246ICd0b3AnLFxuICAgICAgd2lkdGg6ICcxZW0nLFxuICAgIH19XG4gIC8+XG4pO1xuXG5leHBvcnQgaW50ZXJmYWNlIExvYWRpbmdJbmRpY2F0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIC8qKiBQcm9wcyB0aGF0IHdpbGwgYmUgcGFzc2VkIG9uIHRvIHRoZSBjaGlsZHJlbi4gKi9cbiAgaW5uZXJQcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydkaXYnXTtcbiAgLyoqIFRoZSBmb2N1c2VkIHN0YXRlIG9mIHRoZSBzZWxlY3QuICovXG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbiAgaXNEaXNhYmxlZDogYm9vbGVhbjtcbiAgLyoqIFNldCBzaXplIG9mIHRoZSBjb250YWluZXIuICovXG4gIHNpemU6IG51bWJlcjtcbn1cbmV4cG9ydCBjb25zdCBMb2FkaW5nSW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KHtcbiAgaW5uZXJQcm9wcyxcbiAgaXNSdGwsXG4gIHNpemUgPSA0LFxuICAuLi5yZXN0UHJvcHNcbn06IExvYWRpbmdJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPikgPT4ge1xuICByZXR1cm4gKFxuICAgIDxkaXZcbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKFxuICAgICAgICB7IC4uLnJlc3RQcm9wcywgaW5uZXJQcm9wcywgaXNSdGwsIHNpemUgfSxcbiAgICAgICAgJ2xvYWRpbmdJbmRpY2F0b3InLFxuICAgICAgICB7XG4gICAgICAgICAgaW5kaWNhdG9yOiB0cnVlLFxuICAgICAgICAgICdsb2FkaW5nLWluZGljYXRvcic6IHRydWUsXG4gICAgICAgIH1cbiAgICAgICl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MH0gb2Zmc2V0PXtpc1J0bH0gLz5cbiAgICAgIDxMb2FkaW5nRG90IGRlbGF5PXsxNjB9IG9mZnNldCAvPlxuICAgICAgPExvYWRpbmdEb3QgZGVsYXk9ezMyMH0gb2Zmc2V0PXshaXNSdGx9IC8+XG4gICAgPC9kaXY+XG4gICk7XG59O1xuIl19 */")})},KC=function(t){var n=t.innerProps,r=t.isRtl,o=t.size,s=o===void 0?4:o,a=Kt(t,HC);return ie("div",fe({},Xe(se(se({},a),{},{innerProps:n,isRtl:r,size:s}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),ie(Hc,{delay:0,offset:r}),ie(Hc,{delay:160,offset:!0}),ie(Hc,{delay:320,offset:!r}))},ex=function(t,n){var r=t.isDisabled,o=t.isFocused,s=t.theme,a=s.colors,i=s.borderRadius,c=s.spacing;return se({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:c.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?a.neutral5:a.neutral0,borderColor:r?a.neutral10:o?a.primary:a.neutral20,borderRadius:i,borderStyle:"solid",borderWidth:1,boxShadow:o?"0 0 0 1px ".concat(a.primary):void 0,"&:hover":{borderColor:o?a.primary:a.neutral30}})},tx=function(t){var n=t.children,r=t.isDisabled,o=t.isFocused,s=t.innerRef,a=t.innerProps,i=t.menuIsOpen;return ie("div",fe({ref:s},Xe(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":o,"control--menu-is-open":i}),a,{"aria-disabled":r||void 0}),n)},nx=tx,rx=["data"],ox=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},sx=function(t){var n=t.children,r=t.cx,o=t.getStyles,s=t.getClassNames,a=t.Heading,i=t.headingProps,c=t.innerProps,l=t.label,f=t.theme,g=t.selectProps;return ie("div",fe({},Xe(t,"group",{group:!0}),c),ie(a,fe({},i,{selectProps:g,theme:f,getStyles:o,getClassNames:s,cx:r}),l),ie("div",null,n))},ax=function(t,n){var r=t.theme,o=r.colors,s=r.spacing;return se({label:"group",cursor:"default",display:"block"},n?{}:{color:o.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:s.baseUnit*3,paddingRight:s.baseUnit*3,textTransform:"uppercase"})},ix=function(t){var n=kf(t);n.data;var r=Kt(n,rx);return ie("div",fe({},Xe(t,"groupHeading",{"group-heading":!0}),r))},cx=sx,lx=["innerRef","isDisabled","isHidden","inputClassName"],ux=function(t,n){var r=t.isDisabled,o=t.value,s=t.theme,a=s.spacing,i=s.colors;return se(se({visibility:r?"hidden":"visible",transform:o?"translateZ(0)":""},dx),n?{}:{margin:a.baseUnit/2,paddingBottom:a.baseUnit/2,paddingTop:a.baseUnit/2,color:i.neutral80})},Zf={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},dx={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":se({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Zf)},fx=function(t){return se({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},Zf)},px=function(t){var n=t.cx,r=t.value,o=kf(t),s=o.innerRef,a=o.isDisabled,i=o.isHidden,c=o.inputClassName,l=Kt(o,lx);return ie("div",fe({},Xe(t,"input",{"input-container":!0}),{"data-value":r||""}),ie("input",fe({className:n({input:!0},c),ref:s,style:fx(i),disabled:a},l)))},hx=px,gx=function(t,n){var r=t.theme,o=r.spacing,s=r.borderRadius,a=r.colors;return se({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:a.neutral10,borderRadius:s/2,margin:o.baseUnit/2})},mx=function(t,n){var r=t.theme,o=r.borderRadius,s=r.colors,a=t.cropWithEllipsis;return se({overflow:"hidden",textOverflow:a||a===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:o/2,color:s.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},bx=function(t,n){var r=t.theme,o=r.spacing,s=r.borderRadius,a=r.colors,i=t.isFocused;return se({alignItems:"center",display:"flex"},n?{}:{borderRadius:s/2,backgroundColor:i?a.dangerLight:void 0,paddingLeft:o.baseUnit,paddingRight:o.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}})},Xf=function(t){var n=t.children,r=t.innerProps;return ie("div",r,n)},yx=Xf,Cx=Xf;function xx(e){var t=e.children,n=e.innerProps;return ie("div",fe({role:"button"},n),t||ie(Gc,{size:14}))}var Ex=function(t){var n=t.children,r=t.components,o=t.data,s=t.innerProps,a=t.isDisabled,i=t.removeProps,c=t.selectProps,l=r.Container,f=r.Label,g=r.Remove;return ie(l,{data:o,innerProps:se(se({},Xe(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":a})),s),selectProps:c},ie(f,{data:o,innerProps:se({},Xe(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:c},n),ie(g,{data:o,innerProps:se(se({},Xe(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},i),selectProps:c}))},vx=Ex,wx=function(t,n){var r=t.isDisabled,o=t.isFocused,s=t.isSelected,a=t.theme,i=a.spacing,c=a.colors;return se({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:s?c.primary:o?c.primary25:"transparent",color:r?c.neutral20:s?c.neutral0:"inherit",padding:"".concat(i.baseUnit*2,"px ").concat(i.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:s?c.primary:c.primary50}})},Ix=function(t){var n=t.children,r=t.isDisabled,o=t.isFocused,s=t.isSelected,a=t.innerRef,i=t.innerProps;return ie("div",fe({},Xe(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":o,"option--is-selected":s}),{ref:a,"aria-disabled":r},i),n)},_x=Ix,Sx=function(t,n){var r=t.theme,o=r.spacing,s=r.colors;return se({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:s.neutral50,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},Tx=function(t){var n=t.children,r=t.innerProps;return ie("div",fe({},Xe(t,"placeholder",{placeholder:!0}),r),n)},Ax=Tx,Lx=function(t,n){var r=t.isDisabled,o=t.theme,s=o.spacing,a=o.colors;return se({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?a.neutral40:a.neutral80,marginLeft:s.baseUnit/2,marginRight:s.baseUnit/2})},Ox=function(t){var n=t.children,r=t.isDisabled,o=t.innerProps;return ie("div",fe({},Xe(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),o),n)},Fx=Ox,ln={ClearIndicator:JC,Control:nx,DropdownIndicator:zC,DownChevron:Hf,CrossIcon:Gc,Group:cx,GroupHeading:ix,IndicatorsContainer:VC,IndicatorSeparator:QC,Input:hx,LoadingIndicator:KC,Menu:SC,MenuList:AC,MenuPortal:NC,LoadingMessage:kC,NoOptionsMessage:FC,MultiValue:vx,MultiValueContainer:yx,MultiValueLabel:Cx,MultiValueRemove:xx,Option:_x,Placeholder:Ax,SelectContainer:MC,SingleValue:Fx,ValueContainer:jC},kx=function(t){return se(se({},ln),t.components)},zf=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Dx(e,t){return!!(e===t||zf(e)&&zf(t))}function Nx(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Dx(e[n],t[n]))return!1;return!0}function Rx(e,t){t===void 0&&(t=Nx);var n=null;function r(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];if(n&&n.lastThis===this&&t(o,n.lastArgs))return n.lastResult;var a=e.apply(this,o);return n={lastResult:a,lastArgs:o,lastThis:this},a}return r.clear=function(){n=null},r}function Mx(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}for(var Px=process.env.NODE_ENV==="production"?{name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"}:{name:"1f43avz-a11yText-A11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap;label:A11yText;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkExMXlUZXh0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNSSIsImZpbGUiOiJBMTF5VGV4dC50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKiogQGpzeCBqc3ggKi9cbmltcG9ydCB7IGpzeCB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuLy8gQXNzaXN0aXZlIHRleHQgdG8gZGVzY3JpYmUgdmlzdWFsIGVsZW1lbnRzLiBIaWRkZW4gZm9yIHNpZ2h0ZWQgdXNlcnMuXG5jb25zdCBBMTF5VGV4dCA9IChwcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzcGFuJ10pID0+IChcbiAgPHNwYW5cbiAgICBjc3M9e3tcbiAgICAgIGxhYmVsOiAnYTExeVRleHQnLFxuICAgICAgekluZGV4OiA5OTk5LFxuICAgICAgYm9yZGVyOiAwLFxuICAgICAgY2xpcDogJ3JlY3QoMXB4LCAxcHgsIDFweCwgMXB4KScsXG4gICAgICBoZWlnaHQ6IDEsXG4gICAgICB3aWR0aDogMSxcbiAgICAgIHBvc2l0aW9uOiAnYWJzb2x1dGUnLFxuICAgICAgb3ZlcmZsb3c6ICdoaWRkZW4nLFxuICAgICAgcGFkZGluZzogMCxcbiAgICAgIHdoaXRlU3BhY2U6ICdub3dyYXAnLFxuICAgIH19XG4gICAgey4uLnByb3BzfVxuICAvPlxuKTtcblxuZXhwb3J0IGRlZmF1bHQgQTExeVRleHQ7XG4iXX0= */",toString:Mx},jx=function(t){return ie("span",fe({css:Px},t))},Yf=jx,Bx={guidance:function(t){var n=t.isSearchable,r=t.isMulti,o=t.tabSelectsValue,s=t.context,a=t.isInitialFocus;switch(s){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(o?", press Tab to select the option and exit the menu":"",".");case"input":return a?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,r=t.label,o=r===void 0?"":r,s=t.labels,a=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(o,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(s.length>1?"s":""," ").concat(s.join(","),", selected.");case"select-option":return a?"option ".concat(o," is disabled. Select another option."):"option ".concat(o,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,o=t.options,s=t.label,a=s===void 0?"":s,i=t.selectValue,c=t.isDisabled,l=t.isSelected,f=t.isAppleDevice,g=function(p,h){return p&&p.length?"".concat(p.indexOf(h)+1," of ").concat(p.length):""};if(n==="value"&&i)return"value ".concat(a," focused, ").concat(g(i,r),".");if(n==="menu"&&f){var y=c?" disabled":"",x="".concat(l?" selected":"").concat(y);return"".concat(a).concat(x,", ").concat(g(o,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},Vx=function(t){var n=t.ariaSelection,r=t.focusedOption,o=t.focusedValue,s=t.focusableOptions,a=t.isFocused,i=t.selectValue,c=t.selectProps,l=t.id,f=t.isAppleDevice,g=c.ariaLiveMessages,y=c.getOptionLabel,x=c.inputValue,b=c.isMulti,p=c.isOptionDisabled,h=c.isSearchable,m=c.menuIsOpen,E=c.options,C=c.screenReaderStatus,w=c.tabSelectsValue,v=c.isLoading,_=c["aria-label"],T=c["aria-live"],S=I.useMemo(function(){return se(se({},Bx),g||{})},[g]),L=I.useMemo(function(){var J="";if(n&&S.onChange){var Y=n.option,z=n.options,H=n.removedValue,q=n.removedValues,ne=n.value,ce=function(re){return Array.isArray(re)?null:re},V=H||Y||ce(ne),R=V?y(V):"",G=z||q||void 0,W=G?G.map(y):[],U=se({isDisabled:V&&p(V,i),label:R,labels:W},n);J=S.onChange(U)}return J},[n,S,p,i,y]),N=I.useMemo(function(){var J="",Y=r||o,z=!!(r&&i&&i.includes(r));if(Y&&S.onFocus){var H={focused:Y,label:y(Y),isDisabled:p(Y,i),isSelected:z,options:s,context:Y===r?"menu":"value",selectValue:i,isAppleDevice:f};J=S.onFocus(H)}return J},[r,o,y,p,S,s,i,f]),k=I.useMemo(function(){var J="";if(m&&E.length&&!v&&S.onFilter){var Y=C({count:s.length});J=S.onFilter({inputValue:x,resultsMessage:Y})}return J},[s,x,m,S,E,C,v]),D=(n==null?void 0:n.action)==="initial-input-focus",M=I.useMemo(function(){var J="";if(S.guidance){var Y=o?"value":m?"menu":"input";J=S.guidance({"aria-label":_,context:Y,isDisabled:r&&p(r,i),isMulti:b,isSearchable:h,tabSelectsValue:w,isInitialFocus:D})}return J},[_,r,o,b,p,h,m,S,i,w,D]),j=ie(I.Fragment,null,ie("span",{id:"aria-selection"},L),ie("span",{id:"aria-focused"},N),ie("span",{id:"aria-results"},k),ie("span",{id:"aria-guidance"},M));return ie(I.Fragment,null,ie(Yf,{id:l},D&&j),ie(Yf,{"aria-live":T,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},a&&!D&&j))},Gx=Vx,Wc=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Hx=new RegExp("["+Wc.map(function(e){return e.letters}).join("")+"]","g"),Jf={},Zc=0;Zc<Wc.length;Zc++)for(var Xc=Wc[Zc],zc=0;zc<Xc.letters.length;zc++)Jf[Xc.letters[zc]]=Xc.base;var qf=function(t){return t.replace(Hx,function(n){return Jf[n]})},Wx=Rx(qf),Qf=function(t){return t.replace(/^\s+|\s+$/g,"")},Zx=function(t){return"".concat(t.label," ").concat(t.value)},Xx=function(t){return function(n,r){if(n.data.__isNew__)return!0;var o=se({ignoreCase:!0,ignoreAccents:!0,stringify:Zx,trim:!0,matchFrom:"any"},t),s=o.ignoreCase,a=o.ignoreAccents,i=o.stringify,c=o.trim,l=o.matchFrom,f=c?Qf(r):r,g=c?Qf(i(n)):i(n);return s&&(f=f.toLowerCase(),g=g.toLowerCase()),a&&(f=Wx(f),g=qf(g)),l==="start"?g.substr(0,f.length)===f:g.indexOf(f)>-1}},zx=["innerRef"];function Yx(e){var t=e.innerRef,n=Kt(e,zx),r=yC(n,"onExited","in","enter","exit","appear");return ie("input",fe({ref:t},r,{css:Rc({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},process.env.NODE_ENV==="production"?"":";label:DummyInput;",process.env.NODE_ENV==="production"?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkR1bW15SW5wdXQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCTSIsImZpbGUiOiJEdW1teUlucHV0LnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgUmVmIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsganN4IH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHsgcmVtb3ZlUHJvcHMgfSBmcm9tICcuLi91dGlscyc7XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIER1bW15SW5wdXQoe1xuICBpbm5lclJlZixcbiAgLi4ucHJvcHNcbn06IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snaW5wdXQnXSAmIHtcbiAgcmVhZG9ubHkgaW5uZXJSZWY6IFJlZjxIVE1MSW5wdXRFbGVtZW50Pjtcbn0pIHtcbiAgLy8gUmVtb3ZlIGFuaW1hdGlvbiBwcm9wcyBub3QgbWVhbnQgZm9yIEhUTUwgZWxlbWVudHNcbiAgY29uc3QgZmlsdGVyZWRQcm9wcyA9IHJlbW92ZVByb3BzKFxuICAgIHByb3BzLFxuICAgICdvbkV4aXRlZCcsXG4gICAgJ2luJyxcbiAgICAnZW50ZXInLFxuICAgICdleGl0JyxcbiAgICAnYXBwZWFyJ1xuICApO1xuXG4gIHJldHVybiAoXG4gICAgPGlucHV0XG4gICAgICByZWY9e2lubmVyUmVmfVxuICAgICAgey4uLmZpbHRlcmVkUHJvcHN9XG4gICAgICBjc3M9e3tcbiAgICAgICAgbGFiZWw6ICdkdW1teUlucHV0JyxcbiAgICAgICAgLy8gZ2V0IHJpZCBvZiBhbnkgZGVmYXVsdCBzdHlsZXNcbiAgICAgICAgYmFja2dyb3VuZDogMCxcbiAgICAgICAgYm9yZGVyOiAwLFxuICAgICAgICAvLyBpbXBvcnRhbnQhIHRoaXMgaGlkZXMgdGhlIGZsYXNoaW5nIGN1cnNvclxuICAgICAgICBjYXJldENvbG9yOiAndHJhbnNwYXJlbnQnLFxuICAgICAgICBmb250U2l6ZTogJ2luaGVyaXQnLFxuICAgICAgICBncmlkQXJlYTogJzEgLyAxIC8gMiAvIDMnLFxuICAgICAgICBvdXRsaW5lOiAwLFxuICAgICAgICBwYWRkaW5nOiAwLFxuICAgICAgICAvLyBpbXBvcnRhbnQhIHdpdGhvdXQgYHdpZHRoYCBicm93c2VycyB3b24ndCBhbGxvdyBmb2N1c1xuICAgICAgICB3aWR0aDogMSxcblxuICAgICAgICAvLyByZW1vdmUgY3Vyc29yIG9uIGRlc2t0b3BcbiAgICAgICAgY29sb3I6ICd0cmFuc3BhcmVudCcsXG5cbiAgICAgICAgLy8gcmVtb3ZlIGN1cnNvciBvbiBtb2JpbGUgd2hpbHN0IG1haW50YWluaW5nIFwic2Nyb2xsIGludG8gdmlld1wiIGJlaGF2aW91clxuICAgICAgICBsZWZ0OiAtMTAwLFxuICAgICAgICBvcGFjaXR5OiAwLFxuICAgICAgICBwb3NpdGlvbjogJ3JlbGF0aXZlJyxcbiAgICAgICAgdHJhbnNmb3JtOiAnc2NhbGUoLjAxKScsXG4gICAgICB9fVxuICAgIC8+XG4gICk7XG59XG4iXX0= */")}))}var Jx=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function qx(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,o=e.onTopArrive,s=e.onTopLeave,a=I.useRef(!1),i=I.useRef(!1),c=I.useRef(0),l=I.useRef(null),f=I.useCallback(function(h,m){if(l.current!==null){var E=l.current,C=E.scrollTop,w=E.scrollHeight,v=E.clientHeight,_=l.current,T=m>0,S=w-v-C,L=!1;S>m&&a.current&&(r&&r(h),a.current=!1),T&&i.current&&(s&&s(h),i.current=!1),T&&m>S?(n&&!a.current&&n(h),_.scrollTop=w,L=!0,a.current=!0):!T&&-m>C&&(o&&!i.current&&o(h),_.scrollTop=0,L=!0,i.current=!0),L&&Jx(h)}},[n,r,o,s]),g=I.useCallback(function(h){f(h,h.deltaY)},[f]),y=I.useCallback(function(h){c.current=h.changedTouches[0].clientY},[]),x=I.useCallback(function(h){var m=c.current-h.changedTouches[0].clientY;f(h,m)},[f]),b=I.useCallback(function(h){if(h){var m=gC?{passive:!1}:!1;h.addEventListener("wheel",g,m),h.addEventListener("touchstart",y,m),h.addEventListener("touchmove",x,m)}},[x,y,g]),p=I.useCallback(function(h){h&&(h.removeEventListener("wheel",g,!1),h.removeEventListener("touchstart",y,!1),h.removeEventListener("touchmove",x,!1))},[x,y,g]);return I.useEffect(function(){if(t){var h=l.current;return b(h),function(){p(h)}}},[t,b,p]),function(h){l.current=h}}var $f=["boxSizing","height","overflow","paddingRight","position"],Uf={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Kf(e){e.preventDefault()}function e1(e){e.stopPropagation()}function t1(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function n1(){return"ontouchstart"in window||navigator.maxTouchPoints}var r1=!!(typeof window<"u"&&window.document&&window.document.createElement),Ko=0,ro={capture:!1,passive:!1};function Qx(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,o=I.useRef({}),s=I.useRef(null),a=I.useCallback(function(c){if(r1){var l=document.body,f=l&&l.style;if(r&&$f.forEach(function(b){var p=f&&f[b];o.current[b]=p}),r&&Ko<1){var g=parseInt(o.current.paddingRight,10)||0,y=document.body?document.body.clientWidth:0,x=window.innerWidth-y+g||0;Object.keys(Uf).forEach(function(b){var p=Uf[b];f&&(f[b]=p)}),f&&(f.paddingRight="".concat(x,"px"))}l&&n1()&&(l.addEventListener("touchmove",Kf,ro),c&&(c.addEventListener("touchstart",t1,ro),c.addEventListener("touchmove",e1,ro))),Ko+=1}},[r]),i=I.useCallback(function(c){if(r1){var l=document.body,f=l&&l.style;Ko=Math.max(Ko-1,0),r&&Ko<1&&$f.forEach(function(g){var y=o.current[g];f&&(f[g]=y)}),l&&n1()&&(l.removeEventListener("touchmove",Kf,ro),c&&(c.removeEventListener("touchstart",t1,ro),c.removeEventListener("touchmove",e1,ro)))}},[r]);return I.useEffect(function(){if(t){var c=s.current;return a(c),function(){i(c)}}},[t,a,i]),function(c){s.current=c}}function $x(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var Ux=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},Kx=process.env.NODE_ENV==="production"?{name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"}:{name:"bp8cua-ScrollManager",styles:"position:fixed;left:0;bottom:0;right:0;top:0;label:ScrollManager;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlNjcm9sbE1hbmFnZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW9EVSIsImZpbGUiOiJTY3JvbGxNYW5hZ2VyLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsganN4IH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHsgRnJhZ21lbnQsIFJlYWN0RWxlbWVudCwgUmVmQ2FsbGJhY2ssIE1vdXNlRXZlbnQgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgdXNlU2Nyb2xsQ2FwdHVyZSBmcm9tICcuL3VzZVNjcm9sbENhcHR1cmUnO1xuaW1wb3J0IHVzZVNjcm9sbExvY2sgZnJvbSAnLi91c2VTY3JvbGxMb2NrJztcblxuaW50ZXJmYWNlIFByb3BzIHtcbiAgcmVhZG9ubHkgY2hpbGRyZW46IChyZWY6IFJlZkNhbGxiYWNrPEhUTUxFbGVtZW50PikgPT4gUmVhY3RFbGVtZW50O1xuICByZWFkb25seSBsb2NrRW5hYmxlZDogYm9vbGVhbjtcbiAgcmVhZG9ubHkgY2FwdHVyZUVuYWJsZWQ6IGJvb2xlYW47XG4gIHJlYWRvbmx5IG9uQm90dG9tQXJyaXZlPzogKGV2ZW50OiBXaGVlbEV2ZW50IHwgVG91Y2hFdmVudCkgPT4gdm9pZDtcbiAgcmVhZG9ubHkgb25Cb3R0b21MZWF2ZT86IChldmVudDogV2hlZWxFdmVudCB8IFRvdWNoRXZlbnQpID0+IHZvaWQ7XG4gIHJlYWRvbmx5IG9uVG9wQXJyaXZlPzogKGV2ZW50OiBXaGVlbEV2ZW50IHwgVG91Y2hFdmVudCkgPT4gdm9pZDtcbiAgcmVhZG9ubHkgb25Ub3BMZWF2ZT86IChldmVudDogV2hlZWxFdmVudCB8IFRvdWNoRXZlbnQpID0+IHZvaWQ7XG59XG5cbmNvbnN0IGJsdXJTZWxlY3RJbnB1dCA9IChldmVudDogTW91c2VFdmVudDxIVE1MRGl2RWxlbWVudD4pID0+IHtcbiAgY29uc3QgZWxlbWVudCA9IGV2ZW50LnRhcmdldCBhcyBIVE1MRGl2RWxlbWVudDtcbiAgcmV0dXJuIChcbiAgICBlbGVtZW50Lm93bmVyRG9jdW1lbnQuYWN0aXZlRWxlbWVudCAmJlxuICAgIChlbGVtZW50Lm93bmVyRG9jdW1lbnQuYWN0aXZlRWxlbWVudCBhcyBIVE1MRWxlbWVudCkuYmx1cigpXG4gICk7XG59O1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBTY3JvbGxNYW5hZ2VyKHtcbiAgY2hpbGRyZW4sXG4gIGxvY2tFbmFibGVkLFxuICBjYXB0dXJlRW5hYmxlZCA9IHRydWUsXG4gIG9uQm90dG9tQXJyaXZlLFxuICBvbkJvdHRvbUxlYXZlLFxuICBvblRvcEFycml2ZSxcbiAgb25Ub3BMZWF2ZSxcbn06IFByb3BzKSB7XG4gIGNvbnN0IHNldFNjcm9sbENhcHR1cmVUYXJnZXQgPSB1c2VTY3JvbGxDYXB0dXJlKHtcbiAgICBpc0VuYWJsZWQ6IGNhcHR1cmVFbmFibGVkLFxuICAgIG9uQm90dG9tQXJyaXZlLFxuICAgIG9uQm90dG9tTGVhdmUsXG4gICAgb25Ub3BBcnJpdmUsXG4gICAgb25Ub3BMZWF2ZSxcbiAgfSk7XG4gIGNvbnN0IHNldFNjcm9sbExvY2tUYXJnZXQgPSB1c2VTY3JvbGxMb2NrKHsgaXNFbmFibGVkOiBsb2NrRW5hYmxlZCB9KTtcblxuICBjb25zdCB0YXJnZXRSZWY6IFJlZkNhbGxiYWNrPEhUTUxFbGVtZW50PiA9IChlbGVtZW50KSA9PiB7XG4gICAgc2V0U2Nyb2xsQ2FwdHVyZVRhcmdldChlbGVtZW50KTtcbiAgICBzZXRTY3JvbGxMb2NrVGFyZ2V0KGVsZW1lbnQpO1xuICB9O1xuXG4gIHJldHVybiAoXG4gICAgPEZyYWdtZW50PlxuICAgICAge2xvY2tFbmFibGVkICYmIChcbiAgICAgICAgPGRpdlxuICAgICAgICAgIG9uQ2xpY2s9e2JsdXJTZWxlY3RJbnB1dH1cbiAgICAgICAgICBjc3M9e3sgcG9zaXRpb246ICdmaXhlZCcsIGxlZnQ6IDAsIGJvdHRvbTogMCwgcmlnaHQ6IDAsIHRvcDogMCB9fVxuICAgICAgICAvPlxuICAgICAgKX1cbiAgICAgIHtjaGlsZHJlbih0YXJnZXRSZWYpfVxuICAgIDwvRnJhZ21lbnQ+XG4gICk7XG59XG4iXX0= */",toString:$x};function e7(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,o=r===void 0?!0:r,s=e.onBottomArrive,a=e.onBottomLeave,i=e.onTopArrive,c=e.onTopLeave,l=qx({isEnabled:o,onBottomArrive:s,onBottomLeave:a,onTopArrive:i,onTopLeave:c}),f=Qx({isEnabled:n}),g=function(x){l(x),f(x)};return ie(I.Fragment,null,n&&ie("div",{onClick:Ux,css:Kx}),t(g))}function t7(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var n7=process.env.NODE_ENV==="production"?{name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"}:{name:"5kkxb2-requiredInput-RequiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%;label:RequiredInput;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlJlcXVpcmVkSW5wdXQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWNJIiwiZmlsZSI6IlJlcXVpcmVkSW5wdXQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqIEBqc3gganN4ICovXG5pbXBvcnQgeyBGb2N1c0V2ZW50SGFuZGxlciwgRnVuY3Rpb25Db21wb25lbnQgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3ggfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmNvbnN0IFJlcXVpcmVkSW5wdXQ6IEZ1bmN0aW9uQ29tcG9uZW50PHtcbiAgcmVhZG9ubHkgbmFtZT86IHN0cmluZztcbiAgcmVhZG9ubHkgb25Gb2N1czogRm9jdXNFdmVudEhhbmRsZXI8SFRNTElucHV0RWxlbWVudD47XG59PiA9ICh7IG5hbWUsIG9uRm9jdXMgfSkgPT4gKFxuICA8aW5wdXRcbiAgICByZXF1aXJlZFxuICAgIG5hbWU9e25hbWV9XG4gICAgdGFiSW5kZXg9ey0xfVxuICAgIGFyaWEtaGlkZGVuPVwidHJ1ZVwiXG4gICAgb25Gb2N1cz17b25Gb2N1c31cbiAgICBjc3M9e3tcbiAgICAgIGxhYmVsOiAncmVxdWlyZWRJbnB1dCcsXG4gICAgICBvcGFjaXR5OiAwLFxuICAgICAgcG9pbnRlckV2ZW50czogJ25vbmUnLFxuICAgICAgcG9zaXRpb246ICdhYnNvbHV0ZScsXG4gICAgICBib3R0b206IDAsXG4gICAgICBsZWZ0OiAwLFxuICAgICAgcmlnaHQ6IDAsXG4gICAgICB3aWR0aDogJzEwMCUnLFxuICAgIH19XG4gICAgLy8gUHJldmVudCBgU3dpdGNoaW5nIGZyb20gdW5jb250cm9sbGVkIHRvIGNvbnRyb2xsZWRgIGVycm9yXG4gICAgdmFsdWU9XCJcIlxuICAgIG9uQ2hhbmdlPXsoKSA9PiB7fX1cbiAgLz5cbik7XG5cbmV4cG9ydCBkZWZhdWx0IFJlcXVpcmVkSW5wdXQ7XG4iXX0= */",toString:t7},r7=function(t){var n=t.name,r=t.onFocus;return ie("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:n7,value:"",onChange:function(){}})},o7=r7;function Yc(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function s7(){return Yc(/^iPhone/i)}function o1(){return Yc(/^Mac/i)}function a7(){return Yc(/^iPad/i)||o1()&&navigator.maxTouchPoints>1}function i7(){return s7()||a7()}function c7(){return o1()||i7()}var l7=function(t){return t.label},s1=function(t){return t.label},a1=function(t){return t.value},u7=function(t){return!!t.isDisabled},d7={clearIndicator:YC,container:RC,control:ex,dropdownIndicator:XC,group:ox,groupHeading:ax,indicatorsContainer:BC,indicatorSeparator:qC,input:ux,loadingIndicator:UC,loadingMessage:OC,menu:wC,menuList:TC,menuPortal:DC,multiValue:gx,multiValueLabel:mx,multiValueRemove:bx,noOptionsMessage:LC,option:wx,placeholder:Sx,singleValue:Lx,valueContainer:PC},f7={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},p7=4,i1=4,h7=38,g7=i1*2,m7={baseUnit:i1,controlHeight:h7,menuGutter:g7},Jc={borderRadius:p7,colors:f7,spacing:m7},b7={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Rf(),captureMenuScroll:!Rf(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Xx(),formatGroupLabel:l7,getOptionLabel:s1,getOptionValue:a1,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:u7,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!pC(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function c1(e,t,n,r){var o=p1(e,t,n),s=h1(e,t,n),a=f1(e,t),i=_a(e,t);return{type:"option",data:t,isDisabled:o,isSelected:s,label:a,value:i,index:r}}function Ia(e,t){return e.options.map(function(n,r){if("options"in n){var o=n.options.map(function(a,i){return c1(e,a,t,i)}).filter(function(a){return d1(e,a)});return o.length>0?{type:"group",data:n,options:o,index:r}:void 0}var s=c1(e,n,t,r);return d1(e,s)?s:void 0}).filter(mC)}function l1(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Kr(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function u1(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,Kr(r.options.map(function(o){return{data:o.data,id:"".concat(t,"-").concat(r.index,"-").concat(o.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function y7(e,t){return l1(Ia(e,t))}function d1(e,t){var n=e.inputValue,r=n===void 0?"":n,o=t.data,s=t.isSelected,a=t.label,i=t.value;return(!m1(e)||!s)&&g1(e,{label:a,value:i,data:o},r)}function C7(e,t){var n=e.focusedValue,r=e.selectValue,o=r.indexOf(n);if(o>-1){var s=t.indexOf(n);if(s>-1)return n;if(o<t.length)return t[o]}return null}function x7(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var qc=function(t,n){var r,o=(r=t.find(function(s){return s.data===n}))===null||r===void 0?void 0:r.id;return o||null},f1=function(t,n){return t.getOptionLabel(n)},_a=function(t,n){return t.getOptionValue(n)};function p1(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function h1(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=_a(e,t);return n.some(function(o){return _a(e,o)===r})}function g1(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var m1=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},E7=1,Sa=function(e){R6(n,e);var t=j6(n);function n(r){var o;if(D6(this,n),o=t.call(this,r),o.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},o.blockOptionHover=!1,o.isComposing=!1,o.commonProps=void 0,o.initialTouchX=0,o.initialTouchY=0,o.openAfterFocus=!1,o.scrollToFocusedOptionOnUpdate=!1,o.userIsDragging=void 0,o.isAppleDevice=c7(),o.controlRef=null,o.getControlRef=function(c){o.controlRef=c},o.focusedOptionRef=null,o.getFocusedOptionRef=function(c){o.focusedOptionRef=c},o.menuListRef=null,o.getMenuListRef=function(c){o.menuListRef=c},o.inputRef=null,o.getInputRef=function(c){o.inputRef=c},o.focus=o.focusInput,o.blur=o.blurInput,o.onChange=function(c,l){var f=o.props,g=f.onChange,y=f.name;l.name=y,o.ariaOnChange(c,l),g(c,l)},o.setValue=function(c,l,f){var g=o.props,y=g.closeMenuOnSelect,x=g.isMulti,b=g.inputValue;o.onInputChange("",{action:"set-value",prevInputValue:b}),y&&(o.setState({inputIsHiddenAfterUpdate:!x}),o.onMenuClose()),o.setState({clearFocusValueOnUpdate:!0}),o.onChange(c,{action:l,option:f})},o.selectOption=function(c){var l=o.props,f=l.blurInputOnSelect,g=l.isMulti,y=l.name,x=o.state.selectValue,b=g&&o.isOptionSelected(c,x),p=o.isOptionDisabled(c,x);if(b){var h=o.getOptionValue(c);o.setValue(x.filter(function(m){return o.getOptionValue(m)!==h}),"deselect-option",c)}else if(!p)g?o.setValue([].concat(Kr(x),[c]),"select-option",c):o.setValue(c,"select-option");else{o.ariaOnChange(c,{action:"select-option",option:c,name:y});return}f&&o.blurInput()},o.removeValue=function(c){var l=o.props.isMulti,f=o.state.selectValue,g=o.getOptionValue(c),y=f.filter(function(b){return o.getOptionValue(b)!==g}),x=Uo(l,y,y[0]||null);o.onChange(x,{action:"remove-value",removedValue:c}),o.focusInput()},o.clearValue=function(){var c=o.state.selectValue;o.onChange(Uo(o.props.isMulti,[],null),{action:"clear",removedValues:c})},o.popValue=function(){var c=o.props.isMulti,l=o.state.selectValue,f=l[l.length-1],g=l.slice(0,l.length-1),y=Uo(c,g,g[0]||null);f&&o.onChange(y,{action:"pop-value",removedValue:f})},o.getFocusedOptionId=function(c){return qc(o.state.focusableOptionsWithIds,c)},o.getFocusableOptionsWithIds=function(){return u1(Ia(o.props,o.state.selectValue),o.getElementId("option"))},o.getValue=function(){return o.state.selectValue},o.cx=function(){for(var c=arguments.length,l=new Array(c),f=0;f<c;f++)l[f]=arguments[f];return iC.apply(void 0,[o.props.classNamePrefix].concat(l))},o.getOptionLabel=function(c){return f1(o.props,c)},o.getOptionValue=function(c){return _a(o.props,c)},o.getStyles=function(c,l){var f=o.props.unstyled,g=d7[c](l,f);g.boxSizing="border-box";var y=o.props.styles[c];return y?y(g,l):g},o.getClassNames=function(c,l){var f,g;return(f=(g=o.props.classNames)[c])===null||f===void 0?void 0:f.call(g,l)},o.getElementId=function(c){return"".concat(o.state.instancePrefix,"-").concat(c)},o.getComponents=function(){return kx(o.props)},o.buildCategorizedOptions=function(){return Ia(o.props,o.state.selectValue)},o.getCategorizedOptions=function(){return o.props.menuIsOpen?o.buildCategorizedOptions():[]},o.buildFocusableOptions=function(){return l1(o.buildCategorizedOptions())},o.getFocusableOptions=function(){return o.props.menuIsOpen?o.buildFocusableOptions():[]},o.ariaOnChange=function(c,l){o.setState({ariaSelection:se({value:c},l)})},o.onMenuMouseDown=function(c){c.button===0&&(c.stopPropagation(),c.preventDefault(),o.focusInput())},o.onMenuMouseMove=function(c){o.blockOptionHover=!1},o.onControlMouseDown=function(c){if(!c.defaultPrevented){var l=o.props.openMenuOnClick;o.state.isFocused?o.props.menuIsOpen?c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&o.onMenuClose():l&&o.openMenu("first"):(l&&(o.openAfterFocus=!0),o.focusInput()),c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&c.preventDefault()}},o.onDropdownIndicatorMouseDown=function(c){if(!(c&&c.type==="mousedown"&&c.button!==0)&&!o.props.isDisabled){var l=o.props,f=l.isMulti,g=l.menuIsOpen;o.focusInput(),g?(o.setState({inputIsHiddenAfterUpdate:!f}),o.onMenuClose()):o.openMenu("first"),c.preventDefault()}},o.onClearIndicatorMouseDown=function(c){c&&c.type==="mousedown"&&c.button!==0||(o.clearValue(),c.preventDefault(),o.openAfterFocus=!1,c.type==="touchend"?o.focusInput():setTimeout(function(){return o.focusInput()}))},o.onScroll=function(c){typeof o.props.closeMenuOnScroll=="boolean"?c.target instanceof HTMLElement&&xa(c.target)&&o.props.onMenuClose():typeof o.props.closeMenuOnScroll=="function"&&o.props.closeMenuOnScroll(c)&&o.props.onMenuClose()},o.onCompositionStart=function(){o.isComposing=!0},o.onCompositionEnd=function(){o.isComposing=!1},o.onTouchStart=function(c){var l=c.touches,f=l&&l.item(0);f&&(o.initialTouchX=f.clientX,o.initialTouchY=f.clientY,o.userIsDragging=!1)},o.onTouchMove=function(c){var l=c.touches,f=l&&l.item(0);if(f){var g=Math.abs(f.clientX-o.initialTouchX),y=Math.abs(f.clientY-o.initialTouchY),x=5;o.userIsDragging=g>x||y>x}},o.onTouchEnd=function(c){o.userIsDragging||(o.controlRef&&!o.controlRef.contains(c.target)&&o.menuListRef&&!o.menuListRef.contains(c.target)&&o.blurInput(),o.initialTouchX=0,o.initialTouchY=0)},o.onControlTouchEnd=function(c){o.userIsDragging||o.onControlMouseDown(c)},o.onClearIndicatorTouchEnd=function(c){o.userIsDragging||o.onClearIndicatorMouseDown(c)},o.onDropdownIndicatorTouchEnd=function(c){o.userIsDragging||o.onDropdownIndicatorMouseDown(c)},o.handleInputChange=function(c){var l=o.props.inputValue,f=c.currentTarget.value;o.setState({inputIsHiddenAfterUpdate:!1}),o.onInputChange(f,{action:"input-change",prevInputValue:l}),o.props.menuIsOpen||o.onMenuOpen()},o.onInputFocus=function(c){o.props.onFocus&&o.props.onFocus(c),o.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(o.openAfterFocus||o.props.openMenuOnFocus)&&o.openMenu("first"),o.openAfterFocus=!1},o.onInputBlur=function(c){var l=o.props.inputValue;if(o.menuListRef&&o.menuListRef.contains(document.activeElement)){o.inputRef.focus();return}o.props.onBlur&&o.props.onBlur(c),o.onInputChange("",{action:"input-blur",prevInputValue:l}),o.onMenuClose(),o.setState({focusedValue:null,isFocused:!1})},o.onOptionHover=function(c){if(!(o.blockOptionHover||o.state.focusedOption===c)){var l=o.getFocusableOptions(),f=l.indexOf(c);o.setState({focusedOption:c,focusedOptionId:f>-1?o.getFocusedOptionId(c):null})}},o.shouldHideSelectedOptions=function(){return m1(o.props)},o.onValueInputFocus=function(c){c.preventDefault(),c.stopPropagation(),o.focus()},o.onKeyDown=function(c){var l=o.props,f=l.isMulti,g=l.backspaceRemovesValue,y=l.escapeClearsValue,x=l.inputValue,b=l.isClearable,p=l.isDisabled,h=l.menuIsOpen,m=l.onKeyDown,E=l.tabSelectsValue,C=l.openMenuOnFocus,w=o.state,v=w.focusedOption,_=w.focusedValue,T=w.selectValue;if(!p&&!(typeof m=="function"&&(m(c),c.defaultPrevented))){switch(o.blockOptionHover=!0,c.key){case"ArrowLeft":if(!f||x)return;o.focusValue("previous");break;case"ArrowRight":if(!f||x)return;o.focusValue("next");break;case"Delete":case"Backspace":if(x)return;if(_)o.removeValue(_);else{if(!g)return;f?o.popValue():b&&o.clearValue()}break;case"Tab":if(o.isComposing||c.shiftKey||!h||!E||!v||C&&o.isOptionSelected(v,T))return;o.selectOption(v);break;case"Enter":if(c.keyCode===229)break;if(h){if(!v||o.isComposing)return;o.selectOption(v);break}return;case"Escape":h?(o.setState({inputIsHiddenAfterUpdate:!1}),o.onInputChange("",{action:"menu-close",prevInputValue:x}),o.onMenuClose()):b&&y&&o.clearValue();break;case" ":if(x)return;if(!h){o.openMenu("first");break}if(!v)return;o.selectOption(v);break;case"ArrowUp":h?o.focusOption("up"):o.openMenu("last");break;case"ArrowDown":h?o.focusOption("down"):o.openMenu("first");break;case"PageUp":if(!h)return;o.focusOption("pageup");break;case"PageDown":if(!h)return;o.focusOption("pagedown");break;case"Home":if(!h)return;o.focusOption("first");break;case"End":if(!h)return;o.focusOption("last");break;default:return}c.preventDefault()}},o.state.instancePrefix="react-select-"+(o.props.instanceId||++E7),o.state.selectValue=Ca(r.value),r.menuIsOpen&&o.state.selectValue.length){var s=o.getFocusableOptionsWithIds(),a=o.buildFocusableOptions(),i=a.indexOf(o.state.selectValue[0]);o.state.focusableOptionsWithIds=s,o.state.focusedOption=a[i],o.state.focusedOptionId=qc(s,a[i])}return o}return N6(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Nf(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(o){var s=this.props,a=s.isDisabled,i=s.menuIsOpen,c=this.state.isFocused;(c&&!a&&o.isDisabled||c&&i&&!o.menuIsOpen)&&this.focusInput(),c&&a&&!o.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!c&&!a&&o.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Nf(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(o,s){this.props.onInputChange(o,s)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(o){var s=this,a=this.state,i=a.selectValue,c=a.isFocused,l=this.buildFocusableOptions(),f=o==="first"?0:l.length-1;if(!this.props.isMulti){var g=l.indexOf(i[0]);g>-1&&(f=g)}this.scrollToFocusedOptionOnUpdate=!(c&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:l[f],focusedOptionId:this.getFocusedOptionId(l[f])},function(){return s.onMenuOpen()})}},{key:"focusValue",value:function(o){var s=this.state,a=s.selectValue,i=s.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var c=a.indexOf(i);i||(c=-1);var l=a.length-1,f=-1;if(a.length){switch(o){case"previous":c===0?f=0:c===-1?f=l:f=c-1;break;case"next":c>-1&&c<l&&(f=c+1);break}this.setState({inputIsHidden:f!==-1,focusedValue:a[f]})}}}},{key:"focusOption",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",s=this.props.pageSize,a=this.state.focusedOption,i=this.getFocusableOptions();if(i.length){var c=0,l=i.indexOf(a);a||(l=-1),o==="up"?c=l>0?l-1:i.length-1:o==="down"?c=(l+1)%i.length:o==="pageup"?(c=l-s,c<0&&(c=0)):o==="pagedown"?(c=l+s,c>i.length-1&&(c=i.length-1)):o==="last"&&(c=i.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:i[c],focusedValue:null,focusedOptionId:this.getFocusedOptionId(i[c])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Jc):se(se({},Jc),this.props.theme):Jc}},{key:"getCommonProps",value:function(){var o=this.clearValue,s=this.cx,a=this.getStyles,i=this.getClassNames,c=this.getValue,l=this.selectOption,f=this.setValue,g=this.props,y=g.isMulti,x=g.isRtl,b=g.options,p=this.hasValue();return{clearValue:o,cx:s,getStyles:a,getClassNames:i,getValue:c,hasValue:p,isMulti:y,isRtl:x,options:b,selectOption:l,selectProps:g,setValue:f,theme:this.getTheme()}}},{key:"hasValue",value:function(){var o=this.state.selectValue;return o.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var o=this.props,s=o.isClearable,a=o.isMulti;return s===void 0?a:s}},{key:"isOptionDisabled",value:function(o,s){return p1(this.props,o,s)}},{key:"isOptionSelected",value:function(o,s){return h1(this.props,o,s)}},{key:"filterOption",value:function(o,s){return g1(this.props,o,s)}},{key:"formatOptionLabel",value:function(o,s){if(typeof this.props.formatOptionLabel=="function"){var a=this.props.inputValue,i=this.state.selectValue;return this.props.formatOptionLabel(o,{context:s,inputValue:a,selectValue:i})}else return this.getOptionLabel(o)}},{key:"formatGroupLabel",value:function(o){return this.props.formatGroupLabel(o)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var o=this.props,s=o.isDisabled,a=o.isSearchable,i=o.inputId,c=o.inputValue,l=o.tabIndex,f=o.form,g=o.menuIsOpen,y=o.required,x=this.getComponents(),b=x.Input,p=this.state,h=p.inputIsHidden,m=p.ariaSelection,E=this.commonProps,C=i||this.getElementId("input"),w=se(se(se({"aria-autocomplete":"list","aria-expanded":g,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":y,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},g&&{"aria-controls":this.getElementId("listbox")}),!a&&{"aria-readonly":!0}),this.hasValue()?(m==null?void 0:m.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return a?A.createElement(b,fe({},E,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:C,innerRef:this.getInputRef,isDisabled:s,isHidden:h,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:l,form:f,type:"text",value:c},w)):A.createElement(Yx,fe({id:C,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:ya,onFocus:this.onInputFocus,disabled:s,tabIndex:l,inputMode:"none",form:f,value:""},w))}},{key:"renderPlaceholderOrValue",value:function(){var o=this,s=this.getComponents(),a=s.MultiValue,i=s.MultiValueContainer,c=s.MultiValueLabel,l=s.MultiValueRemove,f=s.SingleValue,g=s.Placeholder,y=this.commonProps,x=this.props,b=x.controlShouldRenderValue,p=x.isDisabled,h=x.isMulti,m=x.inputValue,E=x.placeholder,C=this.state,w=C.selectValue,v=C.focusedValue,_=C.isFocused;if(!this.hasValue()||!b)return m?null:A.createElement(g,fe({},y,{key:"placeholder",isDisabled:p,isFocused:_,innerProps:{id:this.getElementId("placeholder")}}),E);if(h)return w.map(function(S,L){var N=S===v,k="".concat(o.getOptionLabel(S),"-").concat(o.getOptionValue(S));return A.createElement(a,fe({},y,{components:{Container:i,Label:c,Remove:l},isFocused:N,isDisabled:p,key:k,index:L,removeProps:{onClick:function(){return o.removeValue(S)},onTouchEnd:function(){return o.removeValue(S)},onMouseDown:function(M){M.preventDefault()}},data:S}),o.formatOptionLabel(S,"value"))});if(m)return null;var T=w[0];return A.createElement(f,fe({},y,{data:T,isDisabled:p}),this.formatOptionLabel(T,"value"))}},{key:"renderClearIndicator",value:function(){var o=this.getComponents(),s=o.ClearIndicator,a=this.commonProps,i=this.props,c=i.isDisabled,l=i.isLoading,f=this.state.isFocused;if(!this.isClearable()||!s||c||!this.hasValue()||l)return null;var g={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return A.createElement(s,fe({},a,{innerProps:g,isFocused:f}))}},{key:"renderLoadingIndicator",value:function(){var o=this.getComponents(),s=o.LoadingIndicator,a=this.commonProps,i=this.props,c=i.isDisabled,l=i.isLoading,f=this.state.isFocused;if(!s||!l)return null;var g={"aria-hidden":"true"};return A.createElement(s,fe({},a,{innerProps:g,isDisabled:c,isFocused:f}))}},{key:"renderIndicatorSeparator",value:function(){var o=this.getComponents(),s=o.DropdownIndicator,a=o.IndicatorSeparator;if(!s||!a)return null;var i=this.commonProps,c=this.props.isDisabled,l=this.state.isFocused;return A.createElement(a,fe({},i,{isDisabled:c,isFocused:l}))}},{key:"renderDropdownIndicator",value:function(){var o=this.getComponents(),s=o.DropdownIndicator;if(!s)return null;var a=this.commonProps,i=this.props.isDisabled,c=this.state.isFocused,l={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return A.createElement(s,fe({},a,{innerProps:l,isDisabled:i,isFocused:c}))}},{key:"renderMenu",value:function(){var o=this,s=this.getComponents(),a=s.Group,i=s.GroupHeading,c=s.Menu,l=s.MenuList,f=s.MenuPortal,g=s.LoadingMessage,y=s.NoOptionsMessage,x=s.Option,b=this.commonProps,p=this.state.focusedOption,h=this.props,m=h.captureMenuScroll,E=h.inputValue,C=h.isLoading,w=h.loadingMessage,v=h.minMenuHeight,_=h.maxMenuHeight,T=h.menuIsOpen,S=h.menuPlacement,L=h.menuPosition,N=h.menuPortalTarget,k=h.menuShouldBlockScroll,D=h.menuShouldScrollIntoView,M=h.noOptionsMessage,j=h.onMenuScrollToTop,J=h.onMenuScrollToBottom;if(!T)return null;var Y=function(R,G){var W=R.type,U=R.data,Q=R.isDisabled,re=R.isSelected,B=R.label,te=R.value,pe=p===U,X=Q?void 0:function(){return o.onOptionHover(U)},Ve=Q?void 0:function(){return o.selectOption(U)},Ge="".concat(o.getElementId("option"),"-").concat(G),at={id:Ge,onClick:Ve,onMouseMove:X,onMouseOver:X,tabIndex:-1,role:"option","aria-selected":o.isAppleDevice?void 0:re};return A.createElement(x,fe({},b,{innerProps:at,data:U,isDisabled:Q,isSelected:re,key:Ge,label:B,type:W,value:te,isFocused:pe,innerRef:pe?o.getFocusedOptionRef:void 0}),o.formatOptionLabel(R.data,"menu"))},z;if(this.hasOptions())z=this.getCategorizedOptions().map(function(V){if(V.type==="group"){var R=V.data,G=V.options,W=V.index,U="".concat(o.getElementId("group"),"-").concat(W),Q="".concat(U,"-heading");return A.createElement(a,fe({},b,{key:U,data:R,options:G,Heading:i,headingProps:{id:Q,data:V.data},label:o.formatGroupLabel(V.data)}),V.options.map(function(re){return Y(re,"".concat(W,"-").concat(re.index))}))}else if(V.type==="option")return Y(V,"".concat(V.index))});else if(C){var H=w({inputValue:E});if(H===null)return null;z=A.createElement(g,b,H)}else{var q=M({inputValue:E});if(q===null)return null;z=A.createElement(y,b,q)}var ne={minMenuHeight:v,maxMenuHeight:_,menuPlacement:S,menuPosition:L,menuShouldScrollIntoView:D},ce=A.createElement(IC,fe({},b,ne),function(V){var R=V.ref,G=V.placerProps,W=G.placement,U=G.maxHeight;return A.createElement(c,fe({},b,ne,{innerRef:R,innerProps:{onMouseDown:o.onMenuMouseDown,onMouseMove:o.onMenuMouseMove},isLoading:C,placement:W}),A.createElement(e7,{captureEnabled:m,onTopArrive:j,onBottomArrive:J,lockEnabled:k},function(Q){return A.createElement(l,fe({},b,{innerRef:function(B){o.getMenuListRef(B),Q(B)},innerProps:{role:"listbox","aria-multiselectable":b.isMulti,id:o.getElementId("listbox")},isLoading:C,maxHeight:U,focusedOption:p}),z)}))});return N||L==="fixed"?A.createElement(f,fe({},b,{appendTo:N,controlElement:this.controlRef,menuPlacement:S,menuPosition:L}),ce):ce}},{key:"renderFormField",value:function(){var o=this,s=this.props,a=s.delimiter,i=s.isDisabled,c=s.isMulti,l=s.name,f=s.required,g=this.state.selectValue;if(f&&!this.hasValue()&&!i)return A.createElement(o7,{name:l,onFocus:this.onValueInputFocus});if(!(!l||i))if(c)if(a){var y=g.map(function(p){return o.getOptionValue(p)}).join(a);return A.createElement("input",{name:l,type:"hidden",value:y})}else{var x=g.length>0?g.map(function(p,h){return A.createElement("input",{key:"i-".concat(h),name:l,type:"hidden",value:o.getOptionValue(p)})}):A.createElement("input",{name:l,type:"hidden",value:""});return A.createElement("div",null,x)}else{var b=g[0]?this.getOptionValue(g[0]):"";return A.createElement("input",{name:l,type:"hidden",value:b})}}},{key:"renderLiveRegion",value:function(){var o=this.commonProps,s=this.state,a=s.ariaSelection,i=s.focusedOption,c=s.focusedValue,l=s.isFocused,f=s.selectValue,g=this.getFocusableOptions();return A.createElement(Gx,fe({},o,{id:this.getElementId("live-region"),ariaSelection:a,focusedOption:i,focusedValue:c,isFocused:l,selectValue:f,focusableOptions:g,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var o=this.getComponents(),s=o.Control,a=o.IndicatorsContainer,i=o.SelectContainer,c=o.ValueContainer,l=this.props,f=l.className,g=l.id,y=l.isDisabled,x=l.menuIsOpen,b=this.state.isFocused,p=this.commonProps=this.getCommonProps();return A.createElement(i,fe({},p,{className:f,innerProps:{id:g,onKeyDown:this.onKeyDown},isDisabled:y,isFocused:b}),this.renderLiveRegion(),A.createElement(s,fe({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:y,isFocused:b,menuIsOpen:x}),A.createElement(c,fe({},p,{isDisabled:y}),this.renderPlaceholderOrValue(),this.renderInput()),A.createElement(a,fe({},p,{isDisabled:y}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(o,s){var a=s.prevProps,i=s.clearFocusValueOnUpdate,c=s.inputIsHiddenAfterUpdate,l=s.ariaSelection,f=s.isFocused,g=s.prevWasFocused,y=s.instancePrefix,x=o.options,b=o.value,p=o.menuIsOpen,h=o.inputValue,m=o.isMulti,E=Ca(b),C={};if(a&&(b!==a.value||x!==a.options||p!==a.menuIsOpen||h!==a.inputValue)){var w=p?y7(o,E):[],v=p?u1(Ia(o,E),"".concat(y,"-option")):[],_=i?C7(s,E):null,T=x7(s,w),S=qc(v,T);C={selectValue:E,focusedOption:T,focusedOptionId:S,focusableOptionsWithIds:v,focusedValue:_,clearFocusValueOnUpdate:!1}}var L=c!=null&&o!==a?{inputIsHidden:c,inputIsHiddenAfterUpdate:void 0}:{},N=l,k=f&&g;return f&&!k&&(N={value:Uo(m,E,E[0]||null),options:E,action:"initial-input-focus"},k=!g),(l==null?void 0:l.action)==="initial-input-focus"&&(N=null),se(se(se({},C),L),{},{prevProps:o,ariaSelection:N,prevWasFocused:k})}}]),n}(I.Component);Sa.defaultProps=b7;var v7=I.forwardRef(function(e,t){var n=Ic(e);return A.createElement(Sa,fe({ref:t},n))}),w7=v7;const I7=u.styled(u.Box)`
@@ -1244,10 +1244,20 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1244
1244
  flex-shrink: 0;
1245
1245
  padding-left: 20px;
1246
1246
  box-sizing: content-box !important;
1247
- `,vE={borderRadius:"0 !important",padding:"0 !important",width:"max-content !important",maxWidth:"max-content !important",height:"100% !important",maxHeight:"100% !important",position:"fixed",boxSizing:"border-box !important",top:0,bottom:0,right:0,margin:0};function wE(e){return e.rowId??e.name}const IE=({open:e,onClose:t,formId:n,fields:r,variables:o,connectorLogo:s,isSaving:a,title:i="Map fields",isLoading:c=!1,defaultValues:l,customFields:f,fetchOptions:g,onSave:y,onCancel:x,onFieldChange:b})=>{const[p,h]=I.useState({}),[m,E]=I.useState({}),C=I.useMemo(()=>{if(!Array.isArray(r)||!r.length)return[];const L=new Set;return r.filter(k=>L.has(k.name)?!1:(L.add(k.name),!0)).sort((k,D)=>k.priority-D.priority)},[r]),w=({name:L,value:N})=>{E(k=>{const D={...k};return N?D[L]=N:delete D[L],D})};I.useEffect(()=>{l&&e&&h({...l})},[l,e]),I.useEffect(()=>()=>{e||(h({}),E({}))},[e]);const v=()=>{t(),h({})},_=()=>{x==null||x(),h({}),t()},T=()=>{const L={...p};for(const N in L)L[N]||delete L[N];y(L)},S=Object.keys(m).length>0;return d.jsx(u.Dialog,{open:e,onClose:v,PaperProps:{sx:vE},maxWidth:!1,children:c?d.jsx(u.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",width:"615px"},children:d.jsx(u.CircularProgress,{})}):d.jsxs(mE,{children:[d.jsxs(bE,{children:[d.jsxs(u.Stack,{direction:"row",alignItems:"center",gap:2,children:[d.jsx(fE,{}),d.jsx(u.Stack,{gap:.5,flex:1,minWidth:0,children:d.jsxs(u.Stack,{direction:"row",alignItems:"center",gap:.5,children:[d.jsx(u.Typography,{variant:"h6",fontSize:18,fontWeight:600,color:u.theme.palette.gray.gray1,children:i}),d.jsx(u.Tooltip,{title:"Assign default values to create fields",placement:"top",children:d.jsx(u.IconButton,{size:"small","aria-label":"About mapping fields",sx:{padding:"4px"},children:d.jsx(u.icons.InfoOutlined,{sx:{fontSize:18,color:u.theme.palette.gray.gray3}})})})]})})]}),d.jsx(u.Tooltip,{title:"Close",placement:"bottom",children:d.jsx(u.IconButton,{onClick:v,size:"small","aria-label":"Close",children:d.jsx(u.icons.Close,{sx:{fontSize:20}})})})]}),d.jsx(yE,{children:d.jsxs(CE,{children:[d.jsxs(u.Stack,{direction:"row",padding:"16px 24px",sx:{backgroundColor:u.theme.palette.gray.gray6a,borderBottom:"1px solid #ECEFF6",borderRadius:"8px 8px 0 0"},children:[d.jsx(hE,{src:s,alt:"Connector"}),d.jsx(u.Typography,{variant:"caption",fontSize:14,fontWeight:600,color:u.theme.palette.gray.gray3,flex:1,children:"Field"}),d.jsx(u.Typography,{variant:"caption",fontSize:14,fontWeight:600,color:u.theme.palette.gray.gray3,width:320,children:"Map to"})]}),C.map((L,N)=>{const k=wE(L),D=p[k]??"";return!M1(L)&&!lE.includes(L.type)?null:d.jsxs(u.Stack,{direction:"row",alignItems:"center",padding:"24px",gap:2,sx:{borderBottom:N<C.length-1?"1px solid #F6F8FC":void 0,"&:last-child":{borderBottom:"none"}},children:[d.jsx(u.Stack,{direction:"row",alignItems:"center",gap:1,flex:1,minWidth:125,children:d.jsx(u.Typography,{variant:"body2",fontSize:14,color:u.theme.palette.gray.gray2,noWrap:!0,children:L.label})}),d.jsx(gE,{width:20,height:20}),d.jsx(EE,{children:d.jsx(uE,{field:L,formId:String(n),value:D,formValues:p,variables:o,customFields:f,errors:m,setError:w,fetchOptions:g,setFormValues:h,onFieldChange:b})})]},k)})]})}),d.jsxs(xE,{children:[d.jsx(u.Button,{variant:"contained",onClick:T,sx:{textTransform:"none",padding:"3px 32px !important"},disabled:a||S,children:"Save"}),d.jsx(u.Button,{variant:"outlined",color:"inherit",onClick:_,disabled:a,sx:{textTransform:"none",padding:"3px 12px !important",borderColor:u.theme.palette.gray.gray5},children:"Cancel"})]})]})})},tl=(e,t,n)=>{let r=`${t}_${n}`;return Object.keys(e).forEach(o=>{r=`${r}_${o}:${e[o]}`}),r},_E=(e,t)=>t?Object.values(t).filter(r=>e.values[r]&&!e.errors[r]):[],ns=(e,t)=>t?Object.keys(t).reduce((r,o)=>{let s="";const a=t[o];return e.values&&e.values[a]&&typeof e.values[a]=="object"&&"value"in e.values[a]?s=e.values[a].value:e.values&&e.values[a]&&typeof e.values[a]!="object"?s=e.values[a]:s=null,{...r,[o]:s}},{}):{},nl=({formFields:e})=>{const t={};return e.forEach(n=>{var r,o,s,a,i,c;if(t[n.name]={},(r=n.validations)!=null&&r.isRequired&&(typeof n.validations.isRequired=="object"?t[n.name].isRequired=E6(n.validations.isRequired.msg):t[n.name].isRequired=!0),n.type==="date"){let l=typeof((o=n.validations)==null?void 0:o.disableFuture)=="object"?n.validations.disableFuture.msg:"";l=typeof((s=n.validations)==null?void 0:s.disablePast)=="object"?n.validations.disablePast.msg:l,t[n.name].validate=v6(l);return}if(n.type==="number"&&((a=n.validations)!=null&&a.range)){t[n.name].validate=w6();return}if(n.type==="text"&&n.limit){t[n.name].validate=vc();return}if(n.type==="table"){const l=nl({formFields:n.columns??[]});t[n.name].validations=l}if((i=n.validations)!=null&&i.isUrl){const l=typeof n.validations.isUrl=="object"?n.validations.isUrl.msg:"";t[n.name].validate=C6(l)}else if((c=n.validations)!=null&&c.isEmail){const l=typeof n.validations.isEmail=="object"?n.validations.isEmail.msg:"";t[n.name].validate=x6(l)}}),t},Fa={isMultiSelect:e=>Array.isArray(e)?e.every(t=>typeof t=="object"&&"label"in t&&"value"in t):!1,isTable:e=>Array.isArray(e)?e.some(n=>!!n[La.ROW_ID]):!1,isSelect:e=>!!e&&typeof e=="object"&&"label"in e,isDate:e=>!!e&&typeof e=="object"&&"toISOString"in e},rs=(e,t)=>Object.keys(t).reduce((n,r)=>{const o=e.values[t[r]];let s;return Fa.isMultiSelect(o)?s=o.map(a=>a.value):Fa.isTable(o)?s=o.map(({...i})=>(delete i[La.ROW_ID],i)).filter(i=>Object.keys(i).length>0):Fa.isSelect(o)?s=o.value:Fa.isDate(o)?s=o.toISOString():s=o||"",n[r]=s,n},{}),SE=(e,t)=>{const n={},r=new Set;let o="";for(const s of e)s.rowId?(n[s.rowId]||(n[s.rowId]=[]),n[s.rowId].push(s),r.add(s.rowId),o=""):!n[o]||n[o].length>=t?(r.add(s.name),n[s.name]=[s],o=s.name):n[o].push(s);return[...r].map(s=>({id:s,formFields:n[s]}))},G1=(e,t)=>{if(!t||!Array.isArray(e))return 0;let n=0;for(const r of e){const o=t[r.name];if(r.type==="table"&&Array.isArray(o)){let s=0;for(const a of o){const i=G1(r.columns,a);s+=i}s>0&&n++;continue}o===""||o===void 0||o===null||n++}return n},Cr="/v1/api",TE=`${Cr}/connectors/conversation/:conversationId/metadata`,AE=`${Cr}/connectors/forms/:formId/field/:fieldName/data`,LE=`${Cr}/connectors/form/:formId`,OE=`${Cr}/connectors/forms/:id/link`,FE=`${Cr}/connectors/forms/:id/preview`,kE=`${Cr}/connectors/conversation/:conversationId/selected-email`,DE=`${Cr}/connectors/app-cf-values`,H1=(e,t,n="email")=>{const r=new URLSearchParams;return r.append("channel_type",n),xe({url:et(`${AE}?${r.toString()}`,e),method:Fe.POST,data:t})},NE=(e,t,n="email")=>{const r=new URLSearchParams;return r.append("channel_type",n),xe({url:et(`${LE}?${r.toString()}`,e),method:Fe.POST,data:t})},RE=(e,t,n="email")=>{const r=new URLSearchParams;return r.append("channel_type",n),xe({url:`${FE.replace(":id",e)}?${r.toString()}`,method:Fe.POST,data:{args:t}})},ME="https://avatars.githubusercontent.com/u/62397590",W1={optionsMap:null,createOptionApi:ee.IDLE,dropdownOptionsApis:ee.IDLE,previewCardData:null,previewCardApiStatus:ee.IDLE,selectedSuggestionType:"basic"},Z1=xc({name:"commonSlice",initialState:W1,reducers:{resetState:()=>W1,resetPreviewCardData:e=>{e.previewCardData=null,e.previewCardApiStatus=ee.IDLE},setSelectedSuggestionType:(e,t)=>{e.selectedSuggestionType=t.payload}},extraReducers:e=>{e.addCase(ka.pending,t=>{t.createOptionApi=ee.LOADING}).addCase(ka.fulfilled,(t,n)=>{const r=t.optionsMap||{},{optionsList:o,key:s}=n.payload;t.createOptionApi=ee.IDLE,t.optionsMap={...r,[s]:{...r[s],options:o}}}).addCase(ka.rejected,t=>{t.createOptionApi=ee.FAILED}).addCase(xr.pending,t=>{t.dropdownOptionsApis=ee.LOADING}).addCase(xr.fulfilled,(t,n)=>{const r=t.optionsMap||{},{optionsList:o,hasMore:s,currentPage:a,searchTerm:i,key:c}=n.payload;t.dropdownOptionsApis=ee.IDLE,t.optionsMap={...r,[c]:{options:o,hasMore:s,currentPage:a,searchTerm:i}}}).addCase(xr.rejected,t=>{t.dropdownOptionsApis=ee.FAILED}).addCase(so.pending,t=>{t.previewCardApiStatus=ee.LOADING}).addCase(so.fulfilled,(t,n)=>{const{data:r}=n.payload;r&&(t.previewCardData=r),t.previewCardApiStatus=ee.IDLE}).addCase(so.rejected,t=>{t.previewCardApiStatus=ee.FAILED})}}),ka=$t("commonSlice/createDropDownOption",async(e,{getState:t,rejectWithValue:n})=>{var p,h,m;const{fieldName:r,label:o,formId:s,interfaceId:a,conversationId:i=null,args:c={},createArgs:l={},callback:f}=e,g=tl(c||{},s,r),{common:y}=t(),{options:x=[],...b}=((p=y.optionsMap)==null?void 0:p[g])||{};try{const E=await NE({fieldName:r,formId:a},{args:l,conversation_id:i});if(!E||!("data"in E)||!("output_variables"in E.data)||!("external_resource_id"in E.data.output_variables))throw E;const C=E.data.output_variables,{external_resource_id:w,...v}=C,T=[{label:o,value:w,prefillValues:v},...x],S=Y0(T,L=>L.value);return f==null||f(S),{optionsList:S,key:g,...b}}catch(E){f==null||f(x);const C=E,w=(h=C==null?void 0:C.response)==null?void 0:h.data,v=typeof w=="string"?w:(w==null?void 0:w.message)||vn;return Ie({message:v,type:Ye}),n((m=C==null?void 0:C.response)==null?void 0:m.status)}}),xr=$t("commonSlice/fetchDropDownOptions",async(e,{getState:t,rejectWithValue:n})=>{var T,S,L;const{fieldName:r,formId:o,searchTerm:s,fieldConfig:a,callback:i,args:c={},interfaceId:l="",pagination:f={enabled:!1},controller:g}=e,y=tl(c||{},o,r),{common:x}=t();let b=!1;a.meta&&"showAvatar"in a.meta&&typeof a.meta.showAvatar=="boolean"&&(b=a.meta.showAvatar);const p=((T=x.optionsMap)==null?void 0:T[y])||{},h=!e.isScrollToBottomEvent&&(!p||s!==p.searchTerm),m=h?[]:p.options||[],E=h?!0:p.hasMore??!0,C=h?0:p.currentPage??0,{enabled:w,limit:v}=f,_=v||10;try{let N;const k=g==null?void 0:g.signal,D=w?{pageNumber:C+1,searchTerm:s,limit:_,enabled:w}:null;if(E&&(N=await H1({fieldName:r,formId:o},{pagination:D||{},args:c,interfaceId:l})),k!=null&&k.aborted)throw k.reason;if(!N||!N.data||!("data"in N.data)||!Array.isArray(N.data.data)||!N.data.data.length){const{common:H}=t(),q=(S=H.optionsMap)==null?void 0:S[y];return i==null||i(q.options??[]),{...q,optionsList:q.options??[],key:y,hasMore:!1}}const j=N.data.data.map(H=>b?{...H,avatarUrl:H.avatarUrl||ME}:(delete H.avatarUrl,H)),J=[...m,...j],Y=w?j.length>=_:!1,z=Y0(J,H=>H.value);return i==null||i(z),{optionsList:z,fieldName:r,formId:o,searchTerm:s,currentPage:C+1,hasMore:Y,key:y}}catch(N){const{common:k}=t(),D=((L=k.optionsMap)==null?void 0:L[y])||{};return i==null||i(D.options??[]),n(N)}},{condition:(e,{getState:t})=>{var g;if(e.isScrollToBottomEvent)return!0;const{fieldName:n,formId:r,searchTerm:o,callback:s,args:a}=e,i=tl(a||{},r,n),{common:c}=t(),l=(g=c.optionsMap)==null?void 0:g[i];if((l==null?void 0:l.searchTerm)!==o)return!0;const f=(l==null?void 0:l.options)||[];return f&&f.length?(s==null||s(f),!1):!0}}),so=$t("commonSlice/previewCard",async({id:e,args:t,channelType:n,isRefresh:r},{rejectWithValue:o})=>{var s;try{const a=await RE(e,t,n),i=a==null?void 0:a.data;return i?(r&&Ie({message:B0,type:Ut}),{data:jd(i)}):(r&&Ie({message:j0,type:Ye}),{data:null})}catch(a){return o({status:(s=a.response)==null?void 0:s.status})}}),{resetState:cL,resetPreviewCardData:PE,setSelectedSuggestionType:jE}=Z1.actions,BE=Z1.reducer,Vn="/v1/api",VE=`${Vn}/connectors/forms/list`,GE=`${Vn}/connectors/cards/:id/unlink`,HE=`${Vn}/connectors/forms/:id/link`,WE=`${Vn}/connectors/form/:formId`,ZE=`${Vn}/connectors/forms/:formId/data`,XE=`${Vn}/connectors/forms/:formId/get_forms_custom_fields`,X1=`${Vn}/connectors/forms/:formId/defaults`,zE=`${Vn}/connectors/forms/:formId/default-values`,YE=({inboxIds:e,channelType:t,conversationId:n})=>{const r=new URLSearchParams;return e.forEach(o=>r.append("inbox_ids",o)),r.append("channel_type",t),r.append("conversation_id",String(n)),xe({url:`${VE}?${r.toString()}`,method:Fe.GET})},z1=(e,t,n="email")=>{const r=new URLSearchParams;return r.append("channel_type",n),xe({url:et(`${WE}?${r.toString()}`,e),method:Fe.POST,data:t})},JE=(e,t="email",n,r)=>{const o=new URLSearchParams;return o.append("channel_type",t),xe({url:`${GE.replace(":id",e)}?${o.toString()}`,method:Fe.POST,data:{externalResourceId:n,conversationId:r}})},qE=(e,t,n="email",r,o)=>{const s=new URLSearchParams;return s.append("channel_type",n),o&&s.append("senderEmail",o),xe({url:`${HE.replace(":id",e)}?${s.toString()}`,method:Fe.POST,data:{externalResourceId:t,conversationId:r}})},QE=(e,t="email",n,r,o)=>{const s=new URLSearchParams;return s.append("channel_type",t),s.append("conversation_id",String(n||"")),s.append("senderEmail",o),s.append("externalResourceId",r),xe({url:`${ZE.replace(":formId",e)}?${s.toString()}`,method:Fe.GET})},$E="Error in previewing the card",Y1="Link format isn't recognized. Please check that you've entered a valid URL",UE="Item already linked",KE="Card linked successfully",ev="Error in linking the card",tv="New card created",nv="Card creation failed",rv="Create and link objects from different apps to this conversation",ov="Are you sure you want to change the primary object?",sv="Changing the primary object will reset all the information you’ve entered and all data will be lost and can’t be recovered.",av="Are you sure you want to leave?",iv=`If you go back now, all the information you’ve entered will be lost and can’t be recovered.
1248
- Do you want to continue?`,cv="Select an object to create",lv="Select an object to link",J1="Select object",uv="Paste URL or ID",dv="Object ID/Link",fv="Card updated",pv="Card updation failed",q1=3,hv="Map fields",gv="Variables linked to inbox may not be available as conversation is linked to multiple inboxes.",rl=(e,t)=>{var r,o,s,a,i,c,l,f,g,y,x,b,p;let n={};switch(e.type){case"select":case"multi-select":{n={...e,defaultOptions:!!e.interfaceDetails,isInfiniteScrollable:((o=(r=e.interfaceDetails)==null?void 0:r.pagination)==null?void 0:o.enabled)||!1,loadOptionsOnFocus:Object.keys(((s=e.interfaceDetails)==null?void 0:s.args)||{}).length>0,isMultiSelect:e.type==="multi-select",type:e.interfaceDetails?"async-select":"select",isClearable:((a=e.meta)==null?void 0:a.isClearable)??!0};break}case"date":{n={...e,type:"date",disablePast:!!((i=e.validations)!=null&&i.disablePast)||!1,disableFuture:!!((c=e.validations)!=null&&c.disableFuture)||!1};break}case"number":{n={...e,type:"number",min:((f=(l=e.validations)==null?void 0:l.range)==null?void 0:f.min)||Number.MIN_SAFE_INTEGER,max:((y=(g=e.validations)==null?void 0:g.range)==null?void 0:y.max)||Number.MAX_SAFE_INTEGER};break}case"multiline":{n={...e,type:"text",maxRows:((x=e.validations)==null?void 0:x.maxRows)||5,limit:(b=e.validations)==null?void 0:b.maxCharacters,rows:5,multiline:!0};break}case"text":{n={...e,type:"text",limit:(p=e.validations)==null?void 0:p.maxCharacters};break}default:n={...e}}return"value"in n&&(n.defaultValue=n.value,delete n.value),{...n,...t}},Q1=xc({name:"writeCapability",initialState:V0,reducers:{resetState:()=>V0,resetCurrentResourceDetails:e=>{e.currentResourceDetails=null,e.currentResourceDetailsApiStatus=ee.IDLE},setCurrentCardInEdit:(e,t)=>{e.currentCardInEdit=t.payload},setHasUnsavedChanges:(e,t)=>{e.hasUnsavedChanges=t.payload}},extraReducers:e=>{e.addCase(Da.pending,t=>{t.objectListApiStatus=ee.LOADING}).addCase(Da.fulfilled,(t,n)=>{const{createObjectList:r,createObjectConnectorNamesList:o,linkObjectList:s,editObjectList:a,searchObjectList:i,formFields:c,objectDict:l,dependentFieldsMap:f}=n.payload;t.objectListApiStatus=ee.IDLE,t.createObjectList=r,t.createObjectConnectorNamesList=o,t.linkObjectList=s,t.editObjectList=a,t.searchObjectList=i,t.formFields=c,t.objectDict=l,t.dependentFieldsMap=f}).addCase(Da.rejected,t=>{t.objectListApiStatus=ee.FAILED}).addCase(xr.pending,t=>{t.dropdownOptionsApis=ee.LOADING}).addCase(xr.fulfilled,(t,n)=>{const r=t.optionsMap||{},{optionsList:o,hasMore:s,currentPage:a,key:i}=n.payload;t.dropdownOptionsApis=ee.IDLE,t.optionsMap={...r,[i]:{options:o,hasMore:s,currentPage:a}}}).addCase(xr.rejected,t=>{t.dropdownOptionsApis=ee.FAILED}).addCase(Na.pending,t=>{t.createFormApiStatus=ee.LOADING}).addCase(Na.fulfilled,t=>{t.createFormApiStatus=ee.IDLE}).addCase(Na.rejected,t=>{t.createFormApiStatus=ee.FAILED}).addCase(Pa.pending,t=>{t.linkCardApiStatus=ee.LOADING}).addCase(Pa.fulfilled,t=>{t.linkCardApiStatus=ee.IDLE}).addCase(Pa.rejected,t=>{t.linkCardApiStatus=ee.FAILED}).addCase(Ma.pending,t=>{t.unlinkCardApiStatus=ee.LOADING}).addCase(Ma.fulfilled,t=>{t.unlinkCardApiStatus=ee.IDLE}).addCase(Ma.rejected,t=>{t.unlinkCardApiStatus=ee.FAILED}).addCase(Ra.pending,t=>{t.updateFormApiStatus=ee.LOADING}).addCase(Ra.fulfilled,t=>{t.updateFormApiStatus=ee.IDLE}).addCase(Ra.rejected,t=>{t.updateFormApiStatus=ee.FAILED}).addCase(ja.pending,t=>{t.currentResourceDetailsApiStatus=ee.LOADING}).addCase(ja.fulfilled,(t,n)=>{const{data:r}=n.payload;r&&(t.currentResourceDetails=r),t.currentResourceDetailsApiStatus=ee.IDLE}).addCase(ja.rejected,t=>{t.currentResourceDetailsApiStatus=ee.FAILED})}}),Da=$t("writeCapability/fetchObjectList",async e=>{const{inboxIds:t,channelType:n,conversationId:r,isExpandedFormEnabled:o}=e,s=await YE({inboxIds:t,channelType:n,conversationId:r});if(!s||!s.data||!("formsList"in s.data)||!Array.isArray(s.data.formsList))return{createObjectList:[],createObjectConnectorNamesList:[],linkObjectList:[],editObjectList:[],searchObjectList:[],formFields:null,objectDict:null,dependentFieldsMap:{}};const a=s.data.formsList,i={},c=[],l=[],f=[],g=[],y=[],x={},b={};return a==null||a.forEach(p=>{var m,E;if(p.expandedView&&!o)return;const h={...p};"fieldList"in h&&delete h.fieldList,b[p.id]=h,i[p.id]||(i[p.id]={}),x[p.id]||(x[p.id]=[]),p.type==="create"&&p.authenticated?(c.push({value:p.id,label:p.name,avatarUrl:p.logoUrl,connectorKey:p.connectorName}),p.connectorName&&!l.includes(p.connectorName)&&l.push(p.connectorName)):p.type==="link"&&p.authenticated?f.push({value:p.id,label:p.name,avatarUrl:p.logoUrl}):p.type==="edit"&&p.authenticated?g.push({value:p.id,label:p.name,avatarUrl:p.logoUrl}):p.type==="search_and_link"&&p.authenticated&&y.push({value:p.id,label:p.name,avatarUrl:p.logoUrl}),(m=p.fieldList)==null||m.sort((C,w)=>C.priority-w.priority),(E=p.fieldList)==null||E.forEach(C=>{const w=rl(C);if(w.columns&&(w.columns=w.columns.map(v=>rl(v,{loadOptionsOnFocus:!0,defaultOptions:!1}))),x[p.id]=[...x[p.id],w],C.interfaceDetails&&(C.interfaceDetails.args||C.interfaceDetails.optionalArgs)){const v={...C.interfaceDetails.args,...C.interfaceDetails.optionalArgs};Object.values(v).forEach(_=>{i[p.id][_]?i[p.id][_]=[...i[p.id][_],C.name]:i[p.id][_]=[C.name]})}})}),{createObjectList:c,createObjectConnectorNamesList:l,linkObjectList:f,editObjectList:g,searchObjectList:y,formFields:x,objectDict:b,dependentFieldsMap:i}}),Na=$t("writeCapability/createForm",async(e,{rejectWithValue:t})=>{var c;const{formId:n,successCallback:r,failureCallback:o,args:s={},interfaceId:a,conversationId:i}=e;try{await z1({formId:n},{args:s,interfaceId:a,conversationId:i}),r==null||r(),Ie({message:tv,type:Ut})}catch(l){const f=l,g=(c=f==null?void 0:f.response)==null?void 0:c.data,y=(g==null?void 0:g.message)??nv;return o==null||o(l),Ie({message:y,type:Ye}),t(l)}}),Ra=$t("writeCapability/updateForm",async(e,{rejectWithValue:t})=>{const{formId:n,successCallback:r,failureCallback:o,args:s={},interfaceId:a,conversationId:i,externalResourceId:c,previousArgs:l={}}=e;try{await z1({formId:n},{args:s,interfaceId:a,conversationId:i,externalResourceId:c,previousArgs:l}),r==null||r(),Ie({message:fv,type:Ut})}catch(f){return o==null||o(f),Ie({message:pv,type:Ye}),t(f)}}),Ma=$t("writeCapability/unlinkCard",async({id:e,channelType:t,externalResourceId:n,conversationId:r})=>{await JE(e,t,n,r)}),Pa=$t("writeCapability/linkCard",async({id:e,externalResourceId:t,channelType:n,conversationId:r,email:o},{rejectWithValue:s})=>{var a;try{await qE(e,t,n,r,o)}catch(i){return s({status:(a=i.response)==null?void 0:a.status})}}),ja=$t("connectorCardLibrary/fetchCurrentResourceDetails",async(e,{rejectWithValue:t})=>{const{id:n,channelType:r,conversationId:o,externalResourceId:s,contactEmail:a}=e;try{const i=await QE(n,r,o,s,a),c=i==null?void 0:i.data,l=i==null?void 0:i.status,f={values:{},errors:{}};return Object.entries(c.formData).forEach(([g,y])=>{"label"in y&&(y.type&&y.type==="date"?f.values[g]=y.label?new Date(parseInt(y.label)).toISOString():"":y.type&&y.type==="multi-select"&&"value"in y&&"label"in y&&y.value&&y.label?f.values[g]=[{value:y.value,label:y.label}]:y.value?f.values[g]={value:y.value,label:y.label}:f.values[g]=y.label)}),{data:f,status:l}}catch(i){return Ie({message:vn,type:Ye}),t(i)}}),{resetState:lL,setCurrentCardInEdit:ao,resetCurrentResourceDetails:mv,setHasUnsavedChanges:$1}=Q1.actions,bv=Q1.reducer,yv=()=>{const[e,t]=I.useState(null),[n,r]=I.useState({isVertical:!1,isHorizontal:!1,isScrolling:!1}),o=I.useCallback(s=>{t(s)},[]);return I.useEffect(()=>{if(!e)return;e.dataset.prevScrollLeft="0",e.dataset.prevScrollTop="0";let s=null;const a=100;let i=null;const c=150,l=f=>{s||(s=window.setTimeout(()=>{const g=f.target,y=Number(e.dataset.prevScrollLeft)||0,x=Number(e.dataset.prevScrollTop)||0,b=g.scrollLeft,p=g.scrollTop,h=b-y,m=p-x,E=Math.abs(m)>Math.abs(h),C=Math.abs(h)>Math.abs(m);r({isVertical:E,isHorizontal:C,isScrolling:!0}),e.dataset.prevScrollLeft=String(b),e.dataset.prevScrollTop=String(p),s=null},a),i&&window.clearTimeout(i),i=window.setTimeout(()=>{r(g=>({...g,isScrolling:!1})),i=null},c))};return e.addEventListener("scroll",l),()=>{e.removeEventListener("scroll",l),s&&window.clearTimeout(s),i&&window.clearTimeout(i)}},[e]),[n,o]},Cv="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.8016%2011.709L12.3416%205.16893L11.4298%204.25712L4.88979%2010.7972V11.709H5.8016ZM6.33618%2012.9987H3.6001V10.2626L10.9739%202.88875C11.0948%202.76786%2011.2588%202.69995%2011.4298%202.69995C11.6008%202.69995%2011.7648%202.76786%2011.8857%202.88875L13.71%204.71302C13.8309%204.83395%2013.8988%204.99794%2013.8988%205.16893C13.8988%205.33992%2013.8309%205.50391%2013.71%205.62484L6.33618%2012.9987ZM3.6001%2014.2884H15.2073V15.578H3.6001V14.2884Z'%20fill='%236C7B94'/%3e%3c/svg%3e",xv=({data:e,title:t,currentCard:n,setShowModal:r})=>{const o=Qt(),{sendTrackingEvent:s,currentSmIds:a}=I.useContext(We),{userGroupId:i}=qt()||{},[c,l]=yv(),{isScrolling:f,isVertical:g}=c,y=f&&g,x=I.useMemo(()=>(e==null?void 0:e[0].data.map(m=>m.label))||[],[e]),b=I.useMemo(()=>e.map(m=>{const E={cells:{},externalResourceId:m.externalResourceId};return m.data.forEach((C,w)=>{if(x[w]){let v=C.value?C.value:Zs;v&&C.type==="date"&&(v=new Date(parseInt(v)).toLocaleDateString(navigator.language)),E.cells[x[w]]={label:v,deepLink:C==null?void 0:C.deepLink}}}),E}),[e,x]),p=(m,E)=>d.jsx(O4,{align:"left",children:m.deepLink?d.jsx(u.Link,{target:"_blank",underline:"none",href:m.deepLink,children:m.label}):d.jsx(u.Typography,{variant:"body2",color:"gray.black",children:m.label})},`${E}_${m.label}`),h=m=>{!m||!n||(r(!1),s(Ed,{card_title:n.title,connector_name:n.connectorName,ug_id:i,sm_ids:a}),o(ao({...n,externalResourceId:m})))};return d.jsxs(u.Stack,{maxHeight:"340px",maxWidth:"700px",padding:"32px 0px 32px 32px",overflow:"auto",children:[d.jsx(u.Typography,{variant:"h2",color:"gray.black",marginBottom:"16px",children:t}),d.jsx(u.TableContainer,{ref:l,children:d.jsxs(u.Table,{stickyHeader:!0,children:[d.jsx(T4,{children:d.jsxs(u.TableRow,{children:[x.map(m=>d.jsx(A4,{sx:{whiteSpace:"nowrap"},children:d.jsx(u.Typography,{variant:"overline",color:"gray.gray3",children:m})},m)),d.jsx(k4,{})]})}),d.jsx(u.TableBody,{children:b.map((m,E)=>d.jsxs(L4,{children:[Object.values(m.cells).map((C,w)=>p(C,w)),d.jsx(F4,{children:!y&&m.externalResourceId&&d.jsx(u.Tooltip,{title:Fd,placement:"bottom",children:d.jsx(u.IconButton,{className:"row-edit",onClick:()=>h(m.externalResourceId),children:d.jsx("img",{src:Cv})})})})]},`id_${E}`))})]})})]})},Ev=e=>e.cardList.connectorCards,vv=e=>e.cardList.connectorsEnabled,wv=e=>e.cardList.connectorApiStatus,Iv=e=>e.cardList.cardSpecificData,_v=e=>e.cardList.specificConnectorApiStatus,Sv=e=>e.cardList.specificConnectorErrorCode,Tv=e=>{const{connectorApiStatus:t,specificConnectorApiStatus:n}=e.cardList;return t!==ee.IDLE||!n?!1:Object.values(n).every(r=>r===ee.IDLE||r===ee.FAILED)},Av="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9%204.8675L14.6475%2014.625H3.3525L9%204.8675ZM9%201.875L0.75%2016.125H17.25L9%201.875Z'%20fill='%23F07530'/%3e%3cpath%20d='M9.75%2012.375H8.25V13.875H9.75V12.375Z'%20fill='%23F07530'/%3e%3cpath%20d='M9.75%207.875H8.25V11.625H9.75V7.875Z'%20fill='%23F07530'/%3e%3c/svg%3e",U1=/^No\s.+\sfound\sfor\s(email|Email)\s.+@.+\..+$/,K1=e=>{const t=/\(Error code: (.*?)\)$/,n=e.match(t),r=n?n[1]:null,o=n?e.replace(t,"").trim():e;return{error_code:r,error_message:o}},Lv=(e,t)=>`${Dd} (Error code: ${e})`.replace(/{{connector_name}}/g,(t==null?void 0:t[0])||""),Ov=(e,t,n)=>{var l,f,g,y,x;const r=e.externalResourceId?`${e.id}_${e.externalResourceId}`:e.id,o=t==null?void 0:t[r];if(!o)return!0;const s=o.cardType==="flat",a=(l=t==null?void 0:t[r])==null?void 0:l.data,i=s&&((f=a==null?void 0:a.flatDisplay)!=null&&f.data)?a.flatDisplay.data:!s&&((x=(y=(g=a==null?void 0:a.listItems)==null?void 0:g.fields)==null?void 0:y[0])!=null&&x.data)?a.listItems.fields[0].data:[],c=o.cardErrorMessage;return c&&U1.test(c)?!0:!ep(e,t,n)&&!i.length},ep=(e,t,n)=>{var f,g;const r=e.externalResourceId?`${e.id}_${e.externalResourceId}`:e.id,o=t==null?void 0:t[r];if(!o)return!1;const a=o.cardType==="flat"||(g=(f=o.data)==null?void 0:f.listItems)==null?void 0:g.errorMessage,i=(n==null?void 0:n[r])===ee.FAILED,c=o.cardErrorMessage,l=c&&U1.test(c);return i||a||c&&!l};function Fv(e,t,n){const r={},o={};let s=0,a=0;for(const c of e){const l=c.externalResourceId?`${c.id}_${c.externalResourceId}`:c.id,f=t==null?void 0:t[l],g=(f==null?void 0:f.connectorNames)??[];for(const y of g)r[y]||(r[y]=[],o[y]={cards_visible:0,empty_cards:0,cards_with_error:0,card_key:[],card_title:[]}),r[y].push(c),o[y].cards_visible+=1,o[y].card_key.push(c.id),o[y].card_title.push(c.title),Ov(c,t,n)&&(o[y].empty_cards+=1,s+=1),ep(c,t,n)&&(o[y].cards_with_error+=1,a+=1)}return{cards_per_app:Object.entries(o).map(([c,l])=>({app_name:c,...l})),total_empty_cards:s,total_cards_with_errors:a}}const tp=e=>{const{value:t,error:n,deepLink:r,statusCode:o,isLoading:s,type:a,redirectToAdminTab:i,isFailed:c,connectorNames:l,cardTitle:f,currentCard:g,cardId:y,isCardLevelError:x,fieldName:b,showErrorIcon:p}=e,h=I.useRef(null),m=I.useRef(null),{email:E,currentSmIds:C,conversationId:w,sendTrackingEvent:v,connectorFunctions:_}=I.useContext(We),T=ve(Sv),S=T==null?void 0:T[y],[L,N]=I.useState(!1),k=I.useMemo(()=>{if(n&&x){const{error_message:q}=K1(n);return q}return c?Dd.replace(/{{connector_name}}/g,(l==null?void 0:l[0])||""):_d},[n,c,l,x]),D=I.useCallback(()=>{const q=n||Lv(S,l),{error_code:ne,error_message:ce}=K1(q);v==null||v(z3,{sm_ids:C,frontend_req_params:{email:E,conversationId:w,externalResourceId:g==null?void 0:g.externalResourceId},card_title:f,connector_name:l!=null&&l.length?l:"",error_code:ne,error_message:ce})},[n,S,v,C,E,w,f,l,g==null?void 0:g.externalResourceId]);I.useEffect(()=>{(n&&x||c&&S)&&D()},[D,S,c,n,x]),I.useEffect(()=>{const q=r?m.current:h.current;if(q){const ne=q.scrollHeight>q.clientHeight||q.scrollWidth>q.clientWidth;N(ne)}},[t,r]);const M=o==zi.NOT_FOUND;let j=M?Zs:t;a==="date"&&j&&!M&&(j=new Date(parseInt(j)).toLocaleDateString(navigator.language));const J=!!n||c,Y=()=>{i?_==null||_.redirectToAdmin():window.open(D5,"_blank")},z=()=>{v==null||v(Y3,{sm_ids:C,card_title:f,field_name:b})},H=q=>{const ne=/<>(.*?)<>/g,ce=q.split(ne);return d.jsx(I.Fragment,{children:ce.map((V,R)=>R%2===1?d.jsx(w4,{variant:"body2",onClick:Y,children:V},R):V)})};return s?d.jsx(Pn,{variant:"rounded",width:"100%",height:16,animation:"wave",margin:"4px 0 0 0"}):J?d.jsxs(zd,{gap:"7px",children:[p?d.jsx(u.Stack,{marginTop:"3px",flexShrink:"0",children:d.jsx("img",{src:Av,width:"18px",height:"18px"})}):null,d.jsx(Yd,{variant:"body_sm_regular",children:k?H(k):_d})]}):d.jsx(u.Tooltip,{title:L?j:null,placement:"bottom",children:r?d.jsx(Jd,{ref:m,target:"_blank",underline:"none",href:r,fontSize:"13px",onClick:z,children:j||Zs}):d.jsx(_4,{ref:h,variant:"caption_regular",children:j||Zs})})},np="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_825_73646)'%3e%3cpath%20d='M19%206.41L17.59%205L12%2010.59L6.41%205L5%206.41L10.59%2012L5%2017.59L6.41%2019L12%2013.41L17.59%2019L19%2017.59L13.41%2012L19%206.41Z'%20fill='%236F7C90'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_825_73646'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Er=({shown:e,setShown:t,children:n,showCloseButton:r=!1,borderRadius:o=4,sx:s})=>d.jsx(u.Dialog,{open:e,onClose:()=>t(!1),PaperProps:{style:{borderRadius:o,padding:0,height:"fit-content",width:"fit-content",maxWidth:"none"}},sx:{...s},children:d.jsxs(u.Stack,{direction:"row",children:[r&&d.jsx(u.Box,{position:"absolute",right:10,top:10,children:d.jsx(u.Tooltip,{title:"Close",placement:"bottom",children:d.jsx(u.IconButton,{onClick:()=>t(!1),children:d.jsx("img",{src:np})})})}),n]})}),rp=e=>{var V,R,G;const{id:t,cardTitle:n,specificCardData:r,specificConnectorApiStatus:o,isOpen:s,currentCard:a}=e,i=24,c=(o==null?void 0:o[t])===ee.IDLE,l=(o==null?void 0:o[t])===ee.LOADING,f=(o==null?void 0:o[t])===ee.FAILED,{cardType:g,data:y,cardErrorMessage:x,redirectToAdminTab:b,connectorNames:p}=(r==null?void 0:r[t])||{},h=g==="flat",[m,E]=I.useState(!1),[C,w]=I.useState(!1),[v,_]=I.useState(!1),[T,S]=I.useState(!1),L=((V=y==null?void 0:y.listItems)==null?void 0:V.statusCode)!==401,N=I.useMemo(()=>{var W,U,Q,re;return h&&((W=y==null?void 0:y.flatDisplay)!=null&&W.data)?y.flatDisplay.data:!h&&((re=(Q=(U=y==null?void 0:y.listItems)==null?void 0:U.fields)==null?void 0:Q[0])!=null&&re.data)?y.listItems.fields[0].data:[]},[h,y]),k=I.useMemo(()=>N==null?void 0:N.slice(0,5),[N]),[D,M]=I.useState([]),j=I.useRef(null),[J,Y]=I.useState(0),z=m?-180:0,H=h?!1:!!((R=y==null?void 0:y.listItems)!=null&&R.errorMessage),q=H||f||x,ne=c&&!H&&s&&(v||C);I.useLayoutEffect(()=>{var W;(W=j.current)!=null&&W.scrollHeight&&Y(j.current.scrollHeight+i)},[o==null?void 0:o[t],D,j]),I.useEffect(()=>{var re,B;const W=((N==null?void 0:N.length)||0)>5,U=!h&&(((B=(re=y==null?void 0:y.listItems)==null?void 0:re.fields)==null?void 0:B.length)||0)>1;_(W&&!U),w(U)},[y,h,N==null?void 0:N.length]),I.useEffect(()=>{M(m?N:k)},[y,m,k,N]);const ce=()=>{v?E(W=>!W):S(W=>!W)};return d.jsxs(d.Fragment,{children:[d.jsx(Er,{shown:T,setShown:S,showCloseButton:!0,borderRadius:12,children:d.jsx(xv,{data:((G=y==null?void 0:y.listItems)==null?void 0:G.fields)||[],title:n,currentCard:a,setShowModal:S})}),d.jsx(E4,{className:s?"":"slideUp",height:J,children:d.jsx(u.Stack,{ref:j,gap:1,margin:"12px",children:l&&!(D!=null&&D.length)?d.jsxs(d.Fragment,{children:[d.jsx(Pn,{variant:"rounded",width:"100%",height:20,animation:"wave"}),d.jsx(Pn,{variant:"rounded",width:"100%",height:20,animation:"wave"})]}):d.jsx(d.Fragment,{children:q?d.jsx(u.Box,{margin:"8px 0",children:d.jsx(tp,{error:x,isLoading:l,redirectToAdminTab:b,isFailed:f,showErrorIcon:!L,connectorNames:p,cardId:t,cardTitle:n,currentCard:a,isCardLevelError:!0})}):D!=null&&D.length?D==null?void 0:D.map(W=>{const{value:U,label:Q,deepLink:re,type:B}=W,te="errorMessage"in W?W.errorMessage:null,pe="statusCode"in W?W.statusCode:null;return d.jsxs("div",{children:[d.jsx(v4,{variant:"overline_medium",children:Q}),d.jsx(tp,{value:U,error:te,deepLink:re,statusCode:pe,isLoading:l,type:B,cardTitle:n,currentCard:a,cardId:t,fieldName:Q})]},Q)}):d.jsx(u.Box,{margin:"8px 0",children:d.jsx(Yd,{variant:"body_sm_regular",children:v5})})})})}),!x&&ne&&d.jsx(N4,{variant:"body_xs_medium",onClick:ce,children:v?d.jsxs(d.Fragment,{children:[m?gb:r0,d.jsx(D4,{src:hb,transformAngle:z})]}):r0})]})},kv={connectorCards:null,cardSpecificData:null,connectorApiStatus:ee.IDLE,conversationMetaDataApiStatus:ee.IDLE,specificConnectorApiStatus:null,threadId:null,connectorsEnabled:!1,specificConnectorErrorCode:null,conversationEmailHeaders:null},op="/v1/api",Dv=`${op}/connectors/cards`,Nv=`${op}/connectors/cards/:id/data`,Rv=({inboxIds:e,conversationId:t,channelType:n="email"})=>{const r=new URLSearchParams;return e.forEach(o=>r.append("inbox_ids",o)),r.append("channel_type",n),r.append("conversation_id",String(t||"")),xe({url:`${Dv}?${r.toString()}`,method:Fe.GET})},Mv=(e,t,n,r)=>{const o=new URLSearchParams;return o.append("senderEmail",t),o.append("conversation_id",String(n||"")),r&&o.append("externalResourceId",r),xe({url:`${Nv.replace(":id",e)}?${o.toString()}`,method:Fe.GET})},sp=xc({name:"connectorCardLibrary",initialState:kv,reducers:{updateThreadId(e,t){const{payload:n}=t;e.threadId=n.threadId,e.connectorCards=null},clearConnectorList(e){e.connectorCards=null,e.cardSpecificData=null}},extraReducers:e=>{e.addCase(Ba.pending,t=>{t.connectorApiStatus=ee.LOADING}).addCase(Ba.fulfilled,(t,n)=>{t.connectorApiStatus=ee.IDLE,t.connectorCards=n.payload.cards,t.connectorsEnabled=n.payload.connectorsEnabled}).addCase(Ba.rejected,t=>{t.connectorApiStatus=ee.FAILED}).addCase(os.pending,(t,n)=>{const{id:r,externalResourceId:o=""}=n.meta.arg;let s=r;o&&(s=`${s}_${o}`),t.specificConnectorApiStatus={...t.specificConnectorApiStatus??{},[s]:ee.LOADING}}).addCase(os.fulfilled,(t,n)=>{const{id:r,externalResourceId:o=""}=n.meta.arg;let s=r;o&&(s=`${s}_${o}`);const{data:a}=n.payload||{};a&&(t.cardSpecificData={...t.cardSpecificData?t.cardSpecificData:{},[s]:a}),t.specificConnectorApiStatus={...t.specificConnectorApiStatus??{},[s]:ee.IDLE}}).addCase(os.rejected,(t,n)=>{const{id:r,externalResourceId:o=""}=n.meta.arg;let s=r;o&&(s=`${s}_${o}`),t.specificConnectorApiStatus={...t.specificConnectorApiStatus??{},[s]:ee.FAILED};const a=n.payload&&typeof n.payload=="object"&&"code"in n.payload?String(n.payload.code):Nd;t.specificConnectorErrorCode={...t.specificConnectorErrorCode??{},[s]:a}})}}),Ba=$t("connectorCardLibrary/fetchAllCard",async({inboxIds:e,channelType:t,conversationId:n})=>{var i;const r=await Rv({inboxIds:e,channelType:t,conversationId:n});if(!Array.isArray((i=r==null?void 0:r.data)==null?void 0:i.cards))return{cards:[],connectorsEnabled:!1};const{cards:o,connectorsEnabled:s=!1}=r.data;return{cards:o.sort((c,l)=>(c==null?void 0:c.priority)-(l==null?void 0:l.priority)),connectorsEnabled:s}}),os=$t("connectorCardLibrary/fetchSpecificCard",async({id:e,email:t,conversationId:n,isRefresh:r,externalResourceId:o},s)=>{try{const a=await Mv(e,t,n,o),i=a==null?void 0:a.data,c=a==null?void 0:a.status;return i?(r&&Ie({message:B0,type:Ut}),{data:jd(i),status:c}):(r&&Ie({message:j0,type:Ye}),{data:{},status:c})}catch(a){const i=a;return s.rejectWithValue({...i,code:i.code||Nd})}}),Pv=sp.reducer,ap=sp.actions,ip="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.76618%202.23341C8.79952%201.26675%207.47285%200.666748%205.99952%200.666748C3.05285%200.666748%200.672852%203.05341%200.672852%206.00008C0.672852%208.94675%203.05285%2011.3334%205.99952%2011.3334C8.48619%2011.3334%2010.5595%209.63341%2011.1529%207.33341H9.76618C9.21952%208.88675%207.73952%2010.0001%205.99952%2010.0001C3.79285%2010.0001%201.99952%208.20675%201.99952%206.00008C1.99952%203.79341%203.79285%202.00008%205.99952%202.00008C7.10618%202.00008%208.09285%202.46008%208.81285%203.18675L6.66618%205.33341H11.3329V0.666748L9.76618%202.23341Z'%20fill='%236C7B94'/%3e%3c/svg%3e",jv="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.4587%206.7528C11.2244%206.51848%2010.8445%206.51848%2010.6102%206.7528C10.3759%206.98711%2010.3759%207.36701%2010.6102%207.60132L11.4587%206.7528ZM12.1916%208.33414L12.6158%207.90988L12.1916%208.33414ZM8.33462%2012.1911L8.75888%2011.7668L8.33462%2012.1911ZM7.6018%2010.6097C7.36748%2010.3754%206.98758%2010.3754%206.75327%2010.6097C6.51895%2010.8441%206.51895%2011.224%206.75327%2011.4583L7.6018%2010.6097ZM4.43911%209.14411C4.67343%209.37842%205.05333%209.37842%205.28764%209.14411C5.52196%208.9098%205.52196%208.5299%205.28764%208.29558L4.43911%209.14411ZM3.70629%207.56276L4.13056%207.1385L3.70629%207.56276ZM7.56324%203.70582L7.9875%203.28155L7.56324%203.70582ZM8.29606%205.28716C8.53037%205.52148%208.91027%205.52148%209.14459%205.28716C9.3789%205.05285%209.3789%204.67295%209.14459%204.43864L8.29606%205.28716ZM10.6102%207.60132L11.7673%208.75841L12.6158%207.90988L11.4587%206.7528L10.6102%207.60132ZM11.7673%208.75841C12.1662%209.15735%2012.3904%209.69843%2012.3904%2010.2626L13.5904%2010.2626C13.5904%209.38017%2013.2398%208.53387%2012.6158%207.90988L11.7673%208.75841ZM12.3904%2010.2626C12.3904%2010.8268%2012.1662%2011.3679%2011.7673%2011.7668L12.6158%2012.6154C13.2398%2011.9914%2013.5904%2011.1451%2013.5904%2010.2626L12.3904%2010.2626ZM11.7673%2011.7668C10.9365%2012.5976%209.58963%2012.5976%208.75888%2011.7668L7.91035%2012.6154C9.20973%2013.9147%2011.3164%2013.9147%2012.6158%2012.6154L11.7673%2011.7668ZM8.75888%2011.7668L7.6018%2010.6097L6.75327%2011.4583L7.91035%2012.6154L8.75888%2011.7668ZM5.28764%208.29558L4.13056%207.1385L3.28203%207.98703L4.43911%209.14411L5.28764%208.29558ZM4.13056%207.1385C3.73162%206.73956%203.50749%206.19848%203.50749%205.63429L2.30749%205.63429C2.30749%206.51674%202.65804%207.36304%203.28203%207.98703L4.13056%207.1385ZM3.50749%205.63429C3.50749%205.0701%203.73162%204.52902%204.13056%204.13008L3.28203%203.28155C2.65804%203.90554%202.30749%204.75184%202.30749%205.63429L3.50749%205.63429ZM4.13056%204.13008C4.96131%203.29933%206.30822%203.29933%207.13897%204.13008L7.9875%203.28155C6.68812%201.98217%204.58141%201.98217%203.28203%203.28155L4.13056%204.13008ZM7.13897%204.13008L8.29606%205.28716L9.14459%204.43864L7.9875%203.28155L7.13897%204.13008Z'%20fill='%236C7B94'/%3e%3crect%20x='5.08887'%20y='6.0791'%20width='1.33333'%20height='6.66667'%20rx='0.666667'%20transform='rotate(-45%205.08887%206.0791)'%20fill='%236C7B94'/%3e%3cpath%20d='M5.59961%2014.3998V12.7998'%20stroke='%236C7B94'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M12.7998%205.59961H14.3998'%20stroke='%236C7B94'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M2.40039%2011.2002H4.00039'%20stroke='%236C7B94'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M11.2002%202.40039V4.00039'%20stroke='%236C7B94'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Bv="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_5908_39767)'%3e%3cpath%20d='M9.37333%206.01333L9.98667%206.62667L3.94667%2012.6667H3.33333V12.0533L9.37333%206.01333ZM11.7733%202C11.6067%202%2011.4333%202.06667%2011.3067%202.19333L10.0867%203.41333L12.5867%205.91333L13.8067%204.69333C14.0667%204.43333%2014.0667%204.01333%2013.8067%203.75333L12.2467%202.19333C12.1133%202.06%2011.9467%202%2011.7733%202ZM9.37333%204.12667L2%2011.5V14H4.5L11.8733%206.62667L9.37333%204.12667Z'%20fill='%236C7B94'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_5908_39767'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",cp=e=>e.write.createObjectList,Vv=e=>e.write.createObjectConnectorNamesList,lp=e=>e.write.linkObjectList,Gv=e=>e.write.editObjectList,Hv=e=>e.write.objectDict,Wv=e=>e.write.formFields,Zv=e=>e.write.linkCardApiStatus,Xv=e=>e.write.unlinkCardApiStatus,zv=e=>e.write.dependentFieldsMap,Yv=e=>e.write.createFormApiStatus,Jv=e=>e.write.updateFormApiStatus,qv=e=>e.write.currentResourceDetails,Qv=e=>e.write.currentResourceDetailsApiStatus,up=e=>e.write.currentCardInEdit,dp=e=>e.write.hasUnsavedChanges,$v=e=>typeof e=="string"?/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/.test(e):typeof e=="object"&&"_isValid"in e,fp=e=>Object.keys(e).sort((n,r)=>r.localeCompare(n)).reduce((n,r)=>{var o;return(typeof e[r]=="string"||typeof e[r]=="object"&&e[r]!==null)&&$v(e[r])?n[r]=(o=new Date(`${e[r]}`))==null?void 0:o.toString():n[r]=e[r],n},{}),pp=(e,t)=>JSON.stringify(fp(e))===JSON.stringify(fp(t)),Uv=e=>A5.replace("{{connectorName}}",e),Kv=({showUnlinkModal:e,setShowUnlinkModal:t,cardId:n,onCardUnlinking:r,externalResourceId:o,conversationId:s,connectorName:a})=>{const i=Qt(),{sendTrackingEvent:c}=I.useContext(We),f=ve(Xv)===ee.LOADING,g=()=>{s&&o&&i(Ma({id:n,conversationId:s,externalResourceId:o})).unwrap().then(()=>{c(D3,{connector_name:a,conversation_id:s}),t(!1),r(),Ie({message:My,type:Ut})}).catch(()=>{Ie({message:Py,type:Ut})})};return d.jsx(Er,{shown:e,setShown:t,showCloseButton:!0,children:d.jsxs(u.Stack,{width:"400px",padding:"20px",gap:"8px",children:[d.jsx(u.Typography,{variant:"h2",children:T5}),d.jsx(u.Typography,{variant:"body2",children:Uv(a)}),d.jsxs(u.Stack,{direction:"row",gap:"8px",marginTop:"20px",justifyContent:"flex-end",children:[d.jsx(u.Button,{variant:"text",onClick:()=>t(!1),children:qi}),d.jsx(u.Button,{disabled:f,color:"error",onClick:g,children:Od})]})]})})},ew=({actions:e,isHovered:t=!1})=>{const r=e.filter(i=>i.shown);if(r.length===0)return null;const o=r[r.length-1],s=r.slice(0,-1),a=t?(s.length+1)*32:32;return d.jsxs(S4,{width:a,isHovered:t,children:[d.jsx("div",{className:"hidden-actions",children:s.map(({id:i,disabled:c,label:l,iconSrc:f,action:g})=>d.jsx(u.Tooltip,{title:l,placement:"bottom",children:d.jsx(qr,{onClick:g,disabled:c,children:d.jsx("img",{src:f})})},i))}),o&&d.jsx(u.Tooltip,{title:o.label,placement:"bottom",children:d.jsx(qr,{onClick:o.action,disabled:o.disabled,children:d.jsx("img",{src:o.iconSrc})})},o.id)]})},tw=e=>{const{card:t,specificCardData:n,email:r,specificConnectorApiStatus:o,defaultOpenState:s=!1,onCardUnlinking:a}=e,i=Qt(),{availableFeatures:c,sendTrackingEvent:l,conversationId:f,currentSmIds:g}=I.useContext(We),{userGroupId:y}=qt()||{},[x,b]=I.useState(!!s),[p,h]=I.useState(!1),[m,E]=I.useState(!1),[C,w]=I.useState(!1),{id:v,title:_,externalResourceId:T="",forms:S=[],logoUrl:L}=t;let N=v;T&&(N=`${N}_${T}`);const{data:k,cardType:D,cardErrorMessage:M,connectorNames:j}=(n==null?void 0:n[N])??{},J=(j==null?void 0:j[0])||"",Y=(o==null?void 0:o[N])===ee.LOADING,z=(o==null?void 0:o[N])===ee.FAILED,H=!!(Ke(c,wd)&&T),q=I.useMemo(()=>{var B,te;if(M||z||!(Ke(c,p5)&&S.some(pe=>pe.type==="edit")))return!1;switch(D){case"flat":return!!((k==null?void 0:k.flatDisplay.externalResourceId)??t.externalResourceId);case"flat_with_list":return((B=k==null?void 0:k.listItems)==null?void 0:B.fields.length)===1?(te=k==null?void 0:k.listItems)==null?void 0:te.fields.some(pe=>pe.externalResourceId):!1;default:return!1}},[k,D,c,S,t,M,z]),ne=I.useCallback((B=!1)=>{const te=B?j3:P3;r&&v&&f&&i(os({id:v,email:r,conversationId:f,externalResourceId:T})).unwrap().then(pe=>{const X={...Pd(pe,_,B,!0),sm_ids:g};l(te,X)}).catch(pe=>{const X={...Pd(pe,_,B,!1),sm_ids:g};l(te,X)})},[i,r,v,_,l,f,T,g]);I.useEffect(()=>{x&&ne(!0)},[x,ne]);const ce=(B,te)=>{var X;B==null||B.stopPropagation(),i(os({id:te,email:r,conversationId:f,isRefresh:!0,externalResourceId:T})).unwrap().then(()=>{l(w3,{id:te})});const pe=B.target.tagName==="BUTTON"?(X=B.target)==null?void 0:X.firstChild:B.target;pe.className&&(pe.className=""),setTimeout(()=>pe.className="selected",1)},V=(B,te)=>{B.stopPropagation(),!(n!=null&&n[te])&&!Y&&ne(),l(x?v3:E3,{id:te}),b(pe=>!pe)},R=B=>{B.stopPropagation();const te=B.currentTarget.offsetWidth<B.currentTarget.scrollWidth;h(!!te)},G=B=>{var pe,X;B.stopPropagation(),l(Ed,{card_title:_,connector_name:J,ug_id:y,sm_ids:g});let te;D==="flat"?te=(k==null?void 0:k.flatDisplay.externalResourceId)??t.externalResourceId:D==="flat_with_list"&&(te=(X=(pe=k==null?void 0:k.listItems)==null?void 0:pe.fields[0])==null?void 0:X.externalResourceId),te?i(ao({...t,externalResourceId:te})):Ie({message:vn,type:Ye})},W=B=>{B.stopPropagation(),E(!0)},U=()=>{w(!0)},Q=()=>{w(!1)},re=[{id:"unlink",label:Od,disabled:Y,shown:H,iconSrc:jv,action:B=>W(B)},{id:"refresh",label:Sd,disabled:Y,shown:!0,iconSrc:ip,action:B=>ce(B,v)},{id:"edit",label:Fd,disabled:Y,shown:q,iconSrc:Bv,action:B=>G(B)}];return d.jsxs(b4,{"data-testid":`test_${v}`,onMouseEnter:U,onMouseLeave:Q,children:[d.jsxs(y4,{className:x?"hiver-card-expanded":"",onClick:B=>V(B,N),children:[d.jsxs(C4,{children:[L&&d.jsx("img",{src:L,alt:_}),d.jsx(u.Tooltip,{title:p?_:"",placement:"bottom",children:d.jsx(x4,{variant:"body_sm_regular",onMouseOver:B=>R(B),onMouseLeave:B=>R(B),children:_})})]}),d.jsxs(zd,{children:[d.jsx(ew,{actions:re,isHovered:C}),d.jsx(u.Tooltip,{title:x?Td:Yi,placement:"bottom",children:d.jsx(qr,{onClick:B=>V(B,N),children:d.jsx(tc,{className:x?"":"hiver-up"})})})]})]}),d.jsx(rp,{id:N,cardTitle:t.title,currentCard:t,specificCardData:n,specificConnectorApiStatus:o,isOpen:x}),d.jsx(Kv,{showUnlinkModal:m,setShowUnlinkModal:E,cardId:v,onCardUnlinking:a,conversationId:f,externalResourceId:T,connectorName:J})]})},nw=Number.MAX_SAFE_INTEGER,rw=({cards:e,email:t,specificCardData:n,specificConnectorApiStatus:r,onCardUnlinking:o})=>{const{availableFeatures:s}=I.useContext(We),i=Ke(s,g5)?nw:1;return d.jsx(u.Box,{flexGrow:1,children:e.map((c,l)=>{const{id:f,externalResourceId:g}=c;let y=f;return g&&(y=`${y}_${g}`),d.jsx("div",{children:d.jsx(tw,{card:c,specificCardData:n,email:t??"",defaultOpenState:l<i,specificConnectorApiStatus:r,onCardUnlinking:o})},y)})})},io=({children:e})=>{if(!Array.isArray(e))return e;let t=null;return e.find(r=>typeof(r==null?void 0:r.type)!="function"?!1:(r.props.fallback&&(t=r),r.props.condition))??t};function In({children:e,condition:t,fallback:n=!1}){return!t&&!n?null:e}io.CaseView=In;const ow="Bring your favourite tools into Hiver",sw="Plugin image",aw="Integrate tools like Salesforce, HubSpot, and Shopify to boost productivity",iw="Enable Connectors",cw="Enable Apps",lw="Learn more",uw="https://help.hiverhq.com/custom-connectors/hiver-s-custom-connectors",dw="Contact your admin to enable this",fw="https://youtu.be/ODcJnzZLb50",pw="connectors-module/assets/connectors-images/connector-mainpage.png",hw="connectors-module/assets/connectors-images/connector-mainpage-apps.png",gw="Explore connectors",mw="Connectors",bw=u.styled(u.Box)`
1247
+ `,vE=u.styled(u.Stack)`
1248
+ flex-direction: row;
1249
+ align-items: center;
1250
+ gap: 8px;
1251
+ flex-shrink: 0;
1252
+ flex-grow: 1;
1253
+ flex-basis: 170px;
1254
+ width: 170px;
1255
+ word-break: break-all;
1256
+ text-wrap: wrap;
1257
+ `,wE={borderRadius:"0 !important",padding:"0 !important",width:"max-content !important",maxWidth:"max-content !important",height:"100% !important",maxHeight:"100% !important",position:"fixed",boxSizing:"border-box !important",top:0,bottom:0,right:0,margin:0};function IE(e){return e.rowId??e.name}const _E=({open:e,onClose:t,formId:n,fields:r,variables:o,connectorLogo:s,isSaving:a,title:i="Map fields",isLoading:c=!1,defaultValues:l,customFields:f,fetchOptions:g,onSave:y,onCancel:x,onFieldChange:b})=>{const[p,h]=I.useState({}),[m,E]=I.useState({}),C=I.useMemo(()=>{if(!Array.isArray(r)||!r.length)return[];const L=new Set;return r.filter(k=>L.has(k.name)?!1:(L.add(k.name),!0)).sort((k,D)=>k.priority-D.priority)},[r]),w=({name:L,value:N})=>{E(k=>{const D={...k};return N?D[L]=N:delete D[L],D})};I.useEffect(()=>{l&&e&&h({...l})},[l,e]),I.useEffect(()=>()=>{e||(h({}),E({}))},[e]);const v=()=>{t(),h({})},_=()=>{x==null||x(),h({}),t()},T=()=>{const L={...p};for(const N in L)L[N]||delete L[N];y(L)},S=Object.keys(m).length>0;return d.jsx(u.Dialog,{open:e,onClose:v,PaperProps:{sx:wE},maxWidth:!1,children:c?d.jsx(u.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",width:"615px"},children:d.jsx(u.CircularProgress,{})}):d.jsxs(mE,{children:[d.jsxs(bE,{children:[d.jsxs(u.Stack,{direction:"row",alignItems:"center",gap:2,children:[d.jsx(fE,{}),d.jsx(u.Stack,{gap:.5,flex:1,minWidth:0,children:d.jsxs(u.Stack,{direction:"row",alignItems:"center",gap:.5,children:[d.jsx(u.Typography,{variant:"h6",fontSize:18,fontWeight:600,color:u.theme.palette.gray.gray1,children:i}),d.jsx(u.Tooltip,{title:"Assign default values to create fields",placement:"top",children:d.jsx(u.IconButton,{size:"small","aria-label":"About mapping fields",sx:{padding:"4px"},children:d.jsx(u.icons.InfoOutlined,{sx:{fontSize:18,color:u.theme.palette.gray.gray3}})})})]})})]}),d.jsx(u.Tooltip,{title:"Close",placement:"bottom",children:d.jsx(u.IconButton,{onClick:v,size:"small","aria-label":"Close",children:d.jsx(u.icons.Close,{sx:{fontSize:20}})})})]}),d.jsx(yE,{children:d.jsxs(CE,{children:[d.jsxs(u.Stack,{direction:"row",padding:"16px 24px",sx:{backgroundColor:u.theme.palette.gray.gray6a,borderBottom:"1px solid #ECEFF6",borderRadius:"8px 8px 0 0"},children:[d.jsx(hE,{src:s,alt:"Connector"}),d.jsx(u.Typography,{variant:"caption",fontSize:14,fontWeight:600,color:u.theme.palette.gray.gray3,flex:1,children:"Field"}),d.jsx(u.Typography,{variant:"caption",fontSize:14,fontWeight:600,color:u.theme.palette.gray.gray3,width:320,children:"Map to"})]}),C.map((L,N)=>{const k=IE(L),D=p[k]??"";return!M1(L)&&!lE.includes(L.type)?null:d.jsxs(u.Stack,{direction:"row",alignItems:"center",padding:"24px",gap:2,sx:{borderBottom:N<C.length-1?"1px solid #F6F8FC":void 0,"&:last-child":{borderBottom:"none"}},children:[d.jsx(vE,{children:d.jsx(u.Typography,{variant:"body2",fontSize:14,color:u.theme.palette.gray.gray2,children:L.label})}),d.jsx(gE,{width:20,height:20}),d.jsx(EE,{children:d.jsx(uE,{field:L,formId:String(n),value:D,formValues:p,variables:o,customFields:f,errors:m,setError:w,fetchOptions:g,setFormValues:h,onFieldChange:b})})]},k)})]})}),d.jsxs(xE,{children:[d.jsx(u.Button,{variant:"contained",onClick:T,sx:{textTransform:"none",padding:"3px 32px !important"},disabled:a||S,children:"Save"}),d.jsx(u.Button,{variant:"outlined",color:"inherit",onClick:_,disabled:a,sx:{textTransform:"none",padding:"3px 12px !important",borderColor:u.theme.palette.gray.gray5},children:"Cancel"})]})]})})},tl=(e,t,n)=>{let r=`${t}_${n}`;return Object.keys(e).forEach(o=>{r=`${r}_${o}:${e[o]}`}),r},SE=(e,t)=>t?Object.values(t).filter(r=>e.values[r]&&!e.errors[r]):[],ns=(e,t)=>t?Object.keys(t).reduce((r,o)=>{let s="";const a=t[o];return e.values&&e.values[a]&&typeof e.values[a]=="object"&&"value"in e.values[a]?s=e.values[a].value:e.values&&e.values[a]&&typeof e.values[a]!="object"?s=e.values[a]:s=null,{...r,[o]:s}},{}):{},nl=({formFields:e})=>{const t={};return e.forEach(n=>{var r,o,s,a,i,c;if(t[n.name]={},(r=n.validations)!=null&&r.isRequired&&(typeof n.validations.isRequired=="object"?t[n.name].isRequired=E6(n.validations.isRequired.msg):t[n.name].isRequired=!0),n.type==="date"){let l=typeof((o=n.validations)==null?void 0:o.disableFuture)=="object"?n.validations.disableFuture.msg:"";l=typeof((s=n.validations)==null?void 0:s.disablePast)=="object"?n.validations.disablePast.msg:l,t[n.name].validate=v6(l);return}if(n.type==="number"&&((a=n.validations)!=null&&a.range)){t[n.name].validate=w6();return}if(n.type==="text"&&n.limit){t[n.name].validate=vc();return}if(n.type==="table"){const l=nl({formFields:n.columns??[]});t[n.name].validations=l}if((i=n.validations)!=null&&i.isUrl){const l=typeof n.validations.isUrl=="object"?n.validations.isUrl.msg:"";t[n.name].validate=C6(l)}else if((c=n.validations)!=null&&c.isEmail){const l=typeof n.validations.isEmail=="object"?n.validations.isEmail.msg:"";t[n.name].validate=x6(l)}}),t},Fa={isMultiSelect:e=>Array.isArray(e)?e.every(t=>typeof t=="object"&&"label"in t&&"value"in t):!1,isTable:e=>Array.isArray(e)?e.some(n=>!!n[La.ROW_ID]):!1,isSelect:e=>!!e&&typeof e=="object"&&"label"in e,isDate:e=>!!e&&typeof e=="object"&&"toISOString"in e},rs=(e,t)=>Object.keys(t).reduce((n,r)=>{const o=e.values[t[r]];let s;return Fa.isMultiSelect(o)?s=o.map(a=>a.value):Fa.isTable(o)?s=o.map(({...i})=>(delete i[La.ROW_ID],i)).filter(i=>Object.keys(i).length>0):Fa.isSelect(o)?s=o.value:Fa.isDate(o)?s=o.toISOString():s=o||"",n[r]=s,n},{}),TE=(e,t)=>{const n={},r=new Set;let o="";for(const s of e)s.rowId?(n[s.rowId]||(n[s.rowId]=[]),n[s.rowId].push(s),r.add(s.rowId),o=""):!n[o]||n[o].length>=t?(r.add(s.name),n[s.name]=[s],o=s.name):n[o].push(s);return[...r].map(s=>({id:s,formFields:n[s]}))},G1=(e,t)=>{if(!t||!Array.isArray(e))return 0;let n=0;for(const r of e){const o=t[r.name];if(r.type==="table"&&Array.isArray(o)){let s=0;for(const a of o){const i=G1(r.columns,a);s+=i}s>0&&n++;continue}o===""||o===void 0||o===null||n++}return n},Cr="/v1/api",AE=`${Cr}/connectors/conversation/:conversationId/metadata`,LE=`${Cr}/connectors/forms/:formId/field/:fieldName/data`,OE=`${Cr}/connectors/form/:formId`,FE=`${Cr}/connectors/forms/:id/link`,kE=`${Cr}/connectors/forms/:id/preview`,DE=`${Cr}/connectors/conversation/:conversationId/selected-email`,NE=`${Cr}/connectors/app-cf-values`,H1=(e,t,n="email")=>{const r=new URLSearchParams;return r.append("channel_type",n),xe({url:et(`${LE}?${r.toString()}`,e),method:Fe.POST,data:t})},RE=(e,t,n="email")=>{const r=new URLSearchParams;return r.append("channel_type",n),xe({url:et(`${OE}?${r.toString()}`,e),method:Fe.POST,data:t})},ME=(e,t,n="email")=>{const r=new URLSearchParams;return r.append("channel_type",n),xe({url:`${kE.replace(":id",e)}?${r.toString()}`,method:Fe.POST,data:{args:t}})},PE="https://avatars.githubusercontent.com/u/62397590",W1={optionsMap:null,createOptionApi:ee.IDLE,dropdownOptionsApis:ee.IDLE,previewCardData:null,previewCardApiStatus:ee.IDLE,selectedSuggestionType:"basic"},Z1=xc({name:"commonSlice",initialState:W1,reducers:{resetState:()=>W1,resetPreviewCardData:e=>{e.previewCardData=null,e.previewCardApiStatus=ee.IDLE},setSelectedSuggestionType:(e,t)=>{e.selectedSuggestionType=t.payload}},extraReducers:e=>{e.addCase(ka.pending,t=>{t.createOptionApi=ee.LOADING}).addCase(ka.fulfilled,(t,n)=>{const r=t.optionsMap||{},{optionsList:o,key:s}=n.payload;t.createOptionApi=ee.IDLE,t.optionsMap={...r,[s]:{...r[s],options:o}}}).addCase(ka.rejected,t=>{t.createOptionApi=ee.FAILED}).addCase(xr.pending,t=>{t.dropdownOptionsApis=ee.LOADING}).addCase(xr.fulfilled,(t,n)=>{const r=t.optionsMap||{},{optionsList:o,hasMore:s,currentPage:a,searchTerm:i,key:c}=n.payload;t.dropdownOptionsApis=ee.IDLE,t.optionsMap={...r,[c]:{options:o,hasMore:s,currentPage:a,searchTerm:i}}}).addCase(xr.rejected,t=>{t.dropdownOptionsApis=ee.FAILED}).addCase(so.pending,t=>{t.previewCardApiStatus=ee.LOADING}).addCase(so.fulfilled,(t,n)=>{const{data:r}=n.payload;r&&(t.previewCardData=r),t.previewCardApiStatus=ee.IDLE}).addCase(so.rejected,t=>{t.previewCardApiStatus=ee.FAILED})}}),ka=$t("commonSlice/createDropDownOption",async(e,{getState:t,rejectWithValue:n})=>{var p,h,m;const{fieldName:r,label:o,formId:s,interfaceId:a,conversationId:i=null,args:c={},createArgs:l={},callback:f}=e,g=tl(c||{},s,r),{common:y}=t(),{options:x=[],...b}=((p=y.optionsMap)==null?void 0:p[g])||{};try{const E=await RE({fieldName:r,formId:a},{args:l,conversation_id:i});if(!E||!("data"in E)||!("output_variables"in E.data)||!("external_resource_id"in E.data.output_variables))throw E;const C=E.data.output_variables,{external_resource_id:w,...v}=C,T=[{label:o,value:w,prefillValues:v},...x],S=Y0(T,L=>L.value);return f==null||f(S),{optionsList:S,key:g,...b}}catch(E){f==null||f(x);const C=E,w=(h=C==null?void 0:C.response)==null?void 0:h.data,v=typeof w=="string"?w:(w==null?void 0:w.message)||vn;return Ie({message:v,type:Ye}),n((m=C==null?void 0:C.response)==null?void 0:m.status)}}),xr=$t("commonSlice/fetchDropDownOptions",async(e,{getState:t,rejectWithValue:n})=>{var T,S,L;const{fieldName:r,formId:o,searchTerm:s,fieldConfig:a,callback:i,args:c={},interfaceId:l="",pagination:f={enabled:!1},controller:g}=e,y=tl(c||{},o,r),{common:x}=t();let b=!1;a.meta&&"showAvatar"in a.meta&&typeof a.meta.showAvatar=="boolean"&&(b=a.meta.showAvatar);const p=((T=x.optionsMap)==null?void 0:T[y])||{},h=!e.isScrollToBottomEvent&&(!p||s!==p.searchTerm),m=h?[]:p.options||[],E=h?!0:p.hasMore??!0,C=h?0:p.currentPage??0,{enabled:w,limit:v}=f,_=v||10;try{let N;const k=g==null?void 0:g.signal,D=w?{pageNumber:C+1,searchTerm:s,limit:_,enabled:w}:null;if(E&&(N=await H1({fieldName:r,formId:o},{pagination:D||{},args:c,interfaceId:l})),k!=null&&k.aborted)throw k.reason;if(!N||!N.data||!("data"in N.data)||!Array.isArray(N.data.data)||!N.data.data.length){const{common:H}=t(),q=(S=H.optionsMap)==null?void 0:S[y];return i==null||i(q.options??[]),{...q,optionsList:q.options??[],key:y,hasMore:!1}}const j=N.data.data.map(H=>b?{...H,avatarUrl:H.avatarUrl||PE}:(delete H.avatarUrl,H)),J=[...m,...j],Y=w?j.length>=_:!1,z=Y0(J,H=>H.value);return i==null||i(z),{optionsList:z,fieldName:r,formId:o,searchTerm:s,currentPage:C+1,hasMore:Y,key:y}}catch(N){const{common:k}=t(),D=((L=k.optionsMap)==null?void 0:L[y])||{};return i==null||i(D.options??[]),n(N)}},{condition:(e,{getState:t})=>{var g;if(e.isScrollToBottomEvent)return!0;const{fieldName:n,formId:r,searchTerm:o,callback:s,args:a}=e,i=tl(a||{},r,n),{common:c}=t(),l=(g=c.optionsMap)==null?void 0:g[i];if((l==null?void 0:l.searchTerm)!==o)return!0;const f=(l==null?void 0:l.options)||[];return f&&f.length?(s==null||s(f),!1):!0}}),so=$t("commonSlice/previewCard",async({id:e,args:t,channelType:n,isRefresh:r},{rejectWithValue:o})=>{var s;try{const a=await ME(e,t,n),i=a==null?void 0:a.data;return i?(r&&Ie({message:B0,type:Ut}),{data:jd(i)}):(r&&Ie({message:j0,type:Ye}),{data:null})}catch(a){return o({status:(s=a.response)==null?void 0:s.status})}}),{resetState:lL,resetPreviewCardData:jE,setSelectedSuggestionType:BE}=Z1.actions,VE=Z1.reducer,Vn="/v1/api",GE=`${Vn}/connectors/forms/list`,HE=`${Vn}/connectors/cards/:id/unlink`,WE=`${Vn}/connectors/forms/:id/link`,ZE=`${Vn}/connectors/form/:formId`,XE=`${Vn}/connectors/forms/:formId/data`,zE=`${Vn}/connectors/forms/:formId/get_forms_custom_fields`,X1=`${Vn}/connectors/forms/:formId/defaults`,YE=`${Vn}/connectors/forms/:formId/default-values`,JE=({inboxIds:e,channelType:t,conversationId:n})=>{const r=new URLSearchParams;return e.forEach(o=>r.append("inbox_ids",o)),r.append("channel_type",t),r.append("conversation_id",String(n)),xe({url:`${GE}?${r.toString()}`,method:Fe.GET})},z1=(e,t,n="email")=>{const r=new URLSearchParams;return r.append("channel_type",n),xe({url:et(`${ZE}?${r.toString()}`,e),method:Fe.POST,data:t})},qE=(e,t="email",n,r)=>{const o=new URLSearchParams;return o.append("channel_type",t),xe({url:`${HE.replace(":id",e)}?${o.toString()}`,method:Fe.POST,data:{externalResourceId:n,conversationId:r}})},QE=(e,t,n="email",r,o)=>{const s=new URLSearchParams;return s.append("channel_type",n),o&&s.append("senderEmail",o),xe({url:`${WE.replace(":id",e)}?${s.toString()}`,method:Fe.POST,data:{externalResourceId:t,conversationId:r}})},$E=(e,t="email",n,r,o)=>{const s=new URLSearchParams;return s.append("channel_type",t),s.append("conversation_id",String(n||"")),s.append("senderEmail",o),s.append("externalResourceId",r),xe({url:`${XE.replace(":formId",e)}?${s.toString()}`,method:Fe.GET})},UE="Error in previewing the card",Y1="Link format isn't recognized. Please check that you've entered a valid URL",KE="Item already linked",ev="Card linked successfully",tv="Error in linking the card",nv="New card created",rv="Card creation failed",ov="Create and link objects from different apps to this conversation",sv="Are you sure you want to change the primary object?",av="Changing the primary object will reset all the information you’ve entered and all data will be lost and can’t be recovered.",iv="Are you sure you want to leave?",cv=`If you go back now, all the information you’ve entered will be lost and can’t be recovered.
1258
+ Do you want to continue?`,lv="Select an object to create",uv="Select an object to link",J1="Select object",dv="Paste URL or ID",fv="Object ID/Link",pv="Card updated",hv="Card updation failed",q1=3,gv="Map fields",mv="Variables linked to inbox may not be available as conversation is linked to multiple inboxes.",rl=(e,t)=>{var r,o,s,a,i,c,l,f,g,y,x,b,p;let n={};switch(e.type){case"select":case"multi-select":{n={...e,defaultOptions:!!e.interfaceDetails,isInfiniteScrollable:((o=(r=e.interfaceDetails)==null?void 0:r.pagination)==null?void 0:o.enabled)||!1,loadOptionsOnFocus:Object.keys(((s=e.interfaceDetails)==null?void 0:s.args)||{}).length>0,isMultiSelect:e.type==="multi-select",type:e.interfaceDetails?"async-select":"select",isClearable:((a=e.meta)==null?void 0:a.isClearable)??!0};break}case"date":{n={...e,type:"date",disablePast:!!((i=e.validations)!=null&&i.disablePast)||!1,disableFuture:!!((c=e.validations)!=null&&c.disableFuture)||!1};break}case"number":{n={...e,type:"number",min:((f=(l=e.validations)==null?void 0:l.range)==null?void 0:f.min)||Number.MIN_SAFE_INTEGER,max:((y=(g=e.validations)==null?void 0:g.range)==null?void 0:y.max)||Number.MAX_SAFE_INTEGER};break}case"multiline":{n={...e,type:"text",maxRows:((x=e.validations)==null?void 0:x.maxRows)||5,limit:(b=e.validations)==null?void 0:b.maxCharacters,rows:5,multiline:!0};break}case"text":{n={...e,type:"text",limit:(p=e.validations)==null?void 0:p.maxCharacters};break}default:n={...e}}return"value"in n&&(n.defaultValue=n.value,delete n.value),{...n,...t}},Q1=xc({name:"writeCapability",initialState:V0,reducers:{resetState:()=>V0,resetCurrentResourceDetails:e=>{e.currentResourceDetails=null,e.currentResourceDetailsApiStatus=ee.IDLE},setCurrentCardInEdit:(e,t)=>{e.currentCardInEdit=t.payload},setHasUnsavedChanges:(e,t)=>{e.hasUnsavedChanges=t.payload}},extraReducers:e=>{e.addCase(Da.pending,t=>{t.objectListApiStatus=ee.LOADING}).addCase(Da.fulfilled,(t,n)=>{const{createObjectList:r,createObjectConnectorNamesList:o,linkObjectList:s,editObjectList:a,searchObjectList:i,formFields:c,objectDict:l,dependentFieldsMap:f}=n.payload;t.objectListApiStatus=ee.IDLE,t.createObjectList=r,t.createObjectConnectorNamesList=o,t.linkObjectList=s,t.editObjectList=a,t.searchObjectList=i,t.formFields=c,t.objectDict=l,t.dependentFieldsMap=f}).addCase(Da.rejected,t=>{t.objectListApiStatus=ee.FAILED}).addCase(xr.pending,t=>{t.dropdownOptionsApis=ee.LOADING}).addCase(xr.fulfilled,(t,n)=>{const r=t.optionsMap||{},{optionsList:o,hasMore:s,currentPage:a,key:i}=n.payload;t.dropdownOptionsApis=ee.IDLE,t.optionsMap={...r,[i]:{options:o,hasMore:s,currentPage:a}}}).addCase(xr.rejected,t=>{t.dropdownOptionsApis=ee.FAILED}).addCase(Na.pending,t=>{t.createFormApiStatus=ee.LOADING}).addCase(Na.fulfilled,t=>{t.createFormApiStatus=ee.IDLE}).addCase(Na.rejected,t=>{t.createFormApiStatus=ee.FAILED}).addCase(Pa.pending,t=>{t.linkCardApiStatus=ee.LOADING}).addCase(Pa.fulfilled,t=>{t.linkCardApiStatus=ee.IDLE}).addCase(Pa.rejected,t=>{t.linkCardApiStatus=ee.FAILED}).addCase(Ma.pending,t=>{t.unlinkCardApiStatus=ee.LOADING}).addCase(Ma.fulfilled,t=>{t.unlinkCardApiStatus=ee.IDLE}).addCase(Ma.rejected,t=>{t.unlinkCardApiStatus=ee.FAILED}).addCase(Ra.pending,t=>{t.updateFormApiStatus=ee.LOADING}).addCase(Ra.fulfilled,t=>{t.updateFormApiStatus=ee.IDLE}).addCase(Ra.rejected,t=>{t.updateFormApiStatus=ee.FAILED}).addCase(ja.pending,t=>{t.currentResourceDetailsApiStatus=ee.LOADING}).addCase(ja.fulfilled,(t,n)=>{const{data:r}=n.payload;r&&(t.currentResourceDetails=r),t.currentResourceDetailsApiStatus=ee.IDLE}).addCase(ja.rejected,t=>{t.currentResourceDetailsApiStatus=ee.FAILED})}}),Da=$t("writeCapability/fetchObjectList",async e=>{const{inboxIds:t,channelType:n,conversationId:r,isExpandedFormEnabled:o}=e,s=await JE({inboxIds:t,channelType:n,conversationId:r});if(!s||!s.data||!("formsList"in s.data)||!Array.isArray(s.data.formsList))return{createObjectList:[],createObjectConnectorNamesList:[],linkObjectList:[],editObjectList:[],searchObjectList:[],formFields:null,objectDict:null,dependentFieldsMap:{}};const a=s.data.formsList,i={},c=[],l=[],f=[],g=[],y=[],x={},b={};return a==null||a.forEach(p=>{var m,E;if(p.expandedView&&!o)return;const h={...p};"fieldList"in h&&delete h.fieldList,b[p.id]=h,i[p.id]||(i[p.id]={}),x[p.id]||(x[p.id]=[]),p.type==="create"&&p.authenticated?(c.push({value:p.id,label:p.name,avatarUrl:p.logoUrl,connectorKey:p.connectorName}),p.connectorName&&!l.includes(p.connectorName)&&l.push(p.connectorName)):p.type==="link"&&p.authenticated?f.push({value:p.id,label:p.name,avatarUrl:p.logoUrl}):p.type==="edit"&&p.authenticated?g.push({value:p.id,label:p.name,avatarUrl:p.logoUrl}):p.type==="search_and_link"&&p.authenticated&&y.push({value:p.id,label:p.name,avatarUrl:p.logoUrl}),(m=p.fieldList)==null||m.sort((C,w)=>C.priority-w.priority),(E=p.fieldList)==null||E.forEach(C=>{const w=rl(C);if(w.columns&&(w.columns=w.columns.map(v=>rl(v,{loadOptionsOnFocus:!0,defaultOptions:!1}))),x[p.id]=[...x[p.id],w],C.interfaceDetails&&(C.interfaceDetails.args||C.interfaceDetails.optionalArgs)){const v={...C.interfaceDetails.args,...C.interfaceDetails.optionalArgs};Object.values(v).forEach(_=>{i[p.id][_]?i[p.id][_]=[...i[p.id][_],C.name]:i[p.id][_]=[C.name]})}})}),{createObjectList:c,createObjectConnectorNamesList:l,linkObjectList:f,editObjectList:g,searchObjectList:y,formFields:x,objectDict:b,dependentFieldsMap:i}}),Na=$t("writeCapability/createForm",async(e,{rejectWithValue:t})=>{var c;const{formId:n,successCallback:r,failureCallback:o,args:s={},interfaceId:a,conversationId:i}=e;try{await z1({formId:n},{args:s,interfaceId:a,conversationId:i}),r==null||r(),Ie({message:nv,type:Ut})}catch(l){const f=l,g=(c=f==null?void 0:f.response)==null?void 0:c.data,y=(g==null?void 0:g.message)??rv;return o==null||o(l),Ie({message:y,type:Ye}),t(l)}}),Ra=$t("writeCapability/updateForm",async(e,{rejectWithValue:t})=>{const{formId:n,successCallback:r,failureCallback:o,args:s={},interfaceId:a,conversationId:i,externalResourceId:c,previousArgs:l={}}=e;try{await z1({formId:n},{args:s,interfaceId:a,conversationId:i,externalResourceId:c,previousArgs:l}),r==null||r(),Ie({message:pv,type:Ut})}catch(f){return o==null||o(f),Ie({message:hv,type:Ye}),t(f)}}),Ma=$t("writeCapability/unlinkCard",async({id:e,channelType:t,externalResourceId:n,conversationId:r})=>{await qE(e,t,n,r)}),Pa=$t("writeCapability/linkCard",async({id:e,externalResourceId:t,channelType:n,conversationId:r,email:o},{rejectWithValue:s})=>{var a;try{await QE(e,t,n,r,o)}catch(i){return s({status:(a=i.response)==null?void 0:a.status})}}),ja=$t("connectorCardLibrary/fetchCurrentResourceDetails",async(e,{rejectWithValue:t})=>{const{id:n,channelType:r,conversationId:o,externalResourceId:s,contactEmail:a}=e;try{const i=await $E(n,r,o,s,a),c=i==null?void 0:i.data,l=i==null?void 0:i.status,f={values:{},errors:{}};return Object.entries(c.formData).forEach(([g,y])=>{"label"in y&&(y.type&&y.type==="date"?f.values[g]=y.label?new Date(parseInt(y.label)).toISOString():"":y.type&&y.type==="multi-select"&&"value"in y&&"label"in y&&y.value&&y.label?f.values[g]=[{value:y.value,label:y.label}]:y.value?f.values[g]={value:y.value,label:y.label}:f.values[g]=y.label)}),{data:f,status:l}}catch(i){return Ie({message:vn,type:Ye}),t(i)}}),{resetState:uL,setCurrentCardInEdit:ao,resetCurrentResourceDetails:bv,setHasUnsavedChanges:$1}=Q1.actions,yv=Q1.reducer,Cv=()=>{const[e,t]=I.useState(null),[n,r]=I.useState({isVertical:!1,isHorizontal:!1,isScrolling:!1}),o=I.useCallback(s=>{t(s)},[]);return I.useEffect(()=>{if(!e)return;e.dataset.prevScrollLeft="0",e.dataset.prevScrollTop="0";let s=null;const a=100;let i=null;const c=150,l=f=>{s||(s=window.setTimeout(()=>{const g=f.target,y=Number(e.dataset.prevScrollLeft)||0,x=Number(e.dataset.prevScrollTop)||0,b=g.scrollLeft,p=g.scrollTop,h=b-y,m=p-x,E=Math.abs(m)>Math.abs(h),C=Math.abs(h)>Math.abs(m);r({isVertical:E,isHorizontal:C,isScrolling:!0}),e.dataset.prevScrollLeft=String(b),e.dataset.prevScrollTop=String(p),s=null},a),i&&window.clearTimeout(i),i=window.setTimeout(()=>{r(g=>({...g,isScrolling:!1})),i=null},c))};return e.addEventListener("scroll",l),()=>{e.removeEventListener("scroll",l),s&&window.clearTimeout(s),i&&window.clearTimeout(i)}},[e]),[n,o]},xv="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.8016%2011.709L12.3416%205.16893L11.4298%204.25712L4.88979%2010.7972V11.709H5.8016ZM6.33618%2012.9987H3.6001V10.2626L10.9739%202.88875C11.0948%202.76786%2011.2588%202.69995%2011.4298%202.69995C11.6008%202.69995%2011.7648%202.76786%2011.8857%202.88875L13.71%204.71302C13.8309%204.83395%2013.8988%204.99794%2013.8988%205.16893C13.8988%205.33992%2013.8309%205.50391%2013.71%205.62484L6.33618%2012.9987ZM3.6001%2014.2884H15.2073V15.578H3.6001V14.2884Z'%20fill='%236C7B94'/%3e%3c/svg%3e",Ev=({data:e,title:t,currentCard:n,setShowModal:r})=>{const o=Qt(),{sendTrackingEvent:s,currentSmIds:a}=I.useContext(We),{userGroupId:i}=qt()||{},[c,l]=Cv(),{isScrolling:f,isVertical:g}=c,y=f&&g,x=I.useMemo(()=>(e==null?void 0:e[0].data.map(m=>m.label))||[],[e]),b=I.useMemo(()=>e.map(m=>{const E={cells:{},externalResourceId:m.externalResourceId};return m.data.forEach((C,w)=>{if(x[w]){let v=C.value?C.value:Zs;v&&C.type==="date"&&(v=new Date(parseInt(v)).toLocaleDateString(navigator.language)),E.cells[x[w]]={label:v,deepLink:C==null?void 0:C.deepLink}}}),E}),[e,x]),p=(m,E)=>d.jsx(O4,{align:"left",children:m.deepLink?d.jsx(u.Link,{target:"_blank",underline:"none",href:m.deepLink,children:m.label}):d.jsx(u.Typography,{variant:"body2",color:"gray.black",children:m.label})},`${E}_${m.label}`),h=m=>{!m||!n||(r(!1),s(Ed,{card_title:n.title,connector_name:n.connectorName,ug_id:i,sm_ids:a}),o(ao({...n,externalResourceId:m})))};return d.jsxs(u.Stack,{maxHeight:"340px",maxWidth:"700px",padding:"32px 0px 32px 32px",overflow:"auto",children:[d.jsx(u.Typography,{variant:"h2",color:"gray.black",marginBottom:"16px",children:t}),d.jsx(u.TableContainer,{ref:l,children:d.jsxs(u.Table,{stickyHeader:!0,children:[d.jsx(T4,{children:d.jsxs(u.TableRow,{children:[x.map(m=>d.jsx(A4,{sx:{whiteSpace:"nowrap"},children:d.jsx(u.Typography,{variant:"overline",color:"gray.gray3",children:m})},m)),d.jsx(k4,{})]})}),d.jsx(u.TableBody,{children:b.map((m,E)=>d.jsxs(L4,{children:[Object.values(m.cells).map((C,w)=>p(C,w)),d.jsx(F4,{children:!y&&m.externalResourceId&&d.jsx(u.Tooltip,{title:Fd,placement:"bottom",children:d.jsx(u.IconButton,{className:"row-edit",onClick:()=>h(m.externalResourceId),children:d.jsx("img",{src:xv})})})})]},`id_${E}`))})]})})]})},vv=e=>e.cardList.connectorCards,wv=e=>e.cardList.connectorsEnabled,Iv=e=>e.cardList.connectorApiStatus,_v=e=>e.cardList.cardSpecificData,Sv=e=>e.cardList.specificConnectorApiStatus,Tv=e=>e.cardList.specificConnectorErrorCode,Av=e=>{const{connectorApiStatus:t,specificConnectorApiStatus:n}=e.cardList;return t!==ee.IDLE||!n?!1:Object.values(n).every(r=>r===ee.IDLE||r===ee.FAILED)},Lv="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9%204.8675L14.6475%2014.625H3.3525L9%204.8675ZM9%201.875L0.75%2016.125H17.25L9%201.875Z'%20fill='%23F07530'/%3e%3cpath%20d='M9.75%2012.375H8.25V13.875H9.75V12.375Z'%20fill='%23F07530'/%3e%3cpath%20d='M9.75%207.875H8.25V11.625H9.75V7.875Z'%20fill='%23F07530'/%3e%3c/svg%3e",U1=/^No\s.+\sfound\sfor\s(email|Email)\s.+@.+\..+$/,K1=e=>{const t=/\(Error code: (.*?)\)$/,n=e.match(t),r=n?n[1]:null,o=n?e.replace(t,"").trim():e;return{error_code:r,error_message:o}},Ov=(e,t)=>`${Dd} (Error code: ${e})`.replace(/{{connector_name}}/g,(t==null?void 0:t[0])||""),Fv=(e,t,n)=>{var l,f,g,y,x;const r=e.externalResourceId?`${e.id}_${e.externalResourceId}`:e.id,o=t==null?void 0:t[r];if(!o)return!0;const s=o.cardType==="flat",a=(l=t==null?void 0:t[r])==null?void 0:l.data,i=s&&((f=a==null?void 0:a.flatDisplay)!=null&&f.data)?a.flatDisplay.data:!s&&((x=(y=(g=a==null?void 0:a.listItems)==null?void 0:g.fields)==null?void 0:y[0])!=null&&x.data)?a.listItems.fields[0].data:[],c=o.cardErrorMessage;return c&&U1.test(c)?!0:!ep(e,t,n)&&!i.length},ep=(e,t,n)=>{var f,g;const r=e.externalResourceId?`${e.id}_${e.externalResourceId}`:e.id,o=t==null?void 0:t[r];if(!o)return!1;const a=o.cardType==="flat"||(g=(f=o.data)==null?void 0:f.listItems)==null?void 0:g.errorMessage,i=(n==null?void 0:n[r])===ee.FAILED,c=o.cardErrorMessage,l=c&&U1.test(c);return i||a||c&&!l};function kv(e,t,n){const r={},o={};let s=0,a=0;for(const c of e){const l=c.externalResourceId?`${c.id}_${c.externalResourceId}`:c.id,f=t==null?void 0:t[l],g=(f==null?void 0:f.connectorNames)??[];for(const y of g)r[y]||(r[y]=[],o[y]={cards_visible:0,empty_cards:0,cards_with_error:0,card_key:[],card_title:[]}),r[y].push(c),o[y].cards_visible+=1,o[y].card_key.push(c.id),o[y].card_title.push(c.title),Fv(c,t,n)&&(o[y].empty_cards+=1,s+=1),ep(c,t,n)&&(o[y].cards_with_error+=1,a+=1)}return{cards_per_app:Object.entries(o).map(([c,l])=>({app_name:c,...l})),total_empty_cards:s,total_cards_with_errors:a}}const tp=e=>{const{value:t,error:n,deepLink:r,statusCode:o,isLoading:s,type:a,redirectToAdminTab:i,isFailed:c,connectorNames:l,cardTitle:f,currentCard:g,cardId:y,isCardLevelError:x,fieldName:b,showErrorIcon:p}=e,h=I.useRef(null),m=I.useRef(null),{email:E,currentSmIds:C,conversationId:w,sendTrackingEvent:v,connectorFunctions:_}=I.useContext(We),T=ve(Tv),S=T==null?void 0:T[y],[L,N]=I.useState(!1),k=I.useMemo(()=>{if(n&&x){const{error_message:q}=K1(n);return q}return c?Dd.replace(/{{connector_name}}/g,(l==null?void 0:l[0])||""):_d},[n,c,l,x]),D=I.useCallback(()=>{const q=n||Ov(S,l),{error_code:ne,error_message:ce}=K1(q);v==null||v(z3,{sm_ids:C,frontend_req_params:{email:E,conversationId:w,externalResourceId:g==null?void 0:g.externalResourceId},card_title:f,connector_name:l!=null&&l.length?l:"",error_code:ne,error_message:ce})},[n,S,v,C,E,w,f,l,g==null?void 0:g.externalResourceId]);I.useEffect(()=>{(n&&x||c&&S)&&D()},[D,S,c,n,x]),I.useEffect(()=>{const q=r?m.current:h.current;if(q){const ne=q.scrollHeight>q.clientHeight||q.scrollWidth>q.clientWidth;N(ne)}},[t,r]);const M=o==zi.NOT_FOUND;let j=M?Zs:t;a==="date"&&j&&!M&&(j=new Date(parseInt(j)).toLocaleDateString(navigator.language));const J=!!n||c,Y=()=>{i?_==null||_.redirectToAdmin():window.open(D5,"_blank")},z=()=>{v==null||v(Y3,{sm_ids:C,card_title:f,field_name:b})},H=q=>{const ne=/<>(.*?)<>/g,ce=q.split(ne);return d.jsx(I.Fragment,{children:ce.map((V,R)=>R%2===1?d.jsx(w4,{variant:"body2",onClick:Y,children:V},R):V)})};return s?d.jsx(Pn,{variant:"rounded",width:"100%",height:16,animation:"wave",margin:"4px 0 0 0"}):J?d.jsxs(zd,{gap:"7px",children:[p?d.jsx(u.Stack,{marginTop:"3px",flexShrink:"0",children:d.jsx("img",{src:Lv,width:"18px",height:"18px"})}):null,d.jsx(Yd,{variant:"body_sm_regular",children:k?H(k):_d})]}):d.jsx(u.Tooltip,{title:L?j:null,placement:"bottom",children:r?d.jsx(Jd,{ref:m,target:"_blank",underline:"none",href:r,fontSize:"13px",onClick:z,children:j||Zs}):d.jsx(_4,{ref:h,variant:"caption_regular",children:j||Zs})})},np="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_825_73646)'%3e%3cpath%20d='M19%206.41L17.59%205L12%2010.59L6.41%205L5%206.41L10.59%2012L5%2017.59L6.41%2019L12%2013.41L17.59%2019L19%2017.59L13.41%2012L19%206.41Z'%20fill='%236F7C90'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_825_73646'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Er=({shown:e,setShown:t,children:n,showCloseButton:r=!1,borderRadius:o=4,sx:s})=>d.jsx(u.Dialog,{open:e,onClose:()=>t(!1),PaperProps:{style:{borderRadius:o,padding:0,height:"fit-content",width:"fit-content",maxWidth:"none"}},sx:{...s},children:d.jsxs(u.Stack,{direction:"row",children:[r&&d.jsx(u.Box,{position:"absolute",right:10,top:10,children:d.jsx(u.Tooltip,{title:"Close",placement:"bottom",children:d.jsx(u.IconButton,{onClick:()=>t(!1),children:d.jsx("img",{src:np})})})}),n]})}),rp=e=>{var V,R,G;const{id:t,cardTitle:n,specificCardData:r,specificConnectorApiStatus:o,isOpen:s,currentCard:a}=e,i=24,c=(o==null?void 0:o[t])===ee.IDLE,l=(o==null?void 0:o[t])===ee.LOADING,f=(o==null?void 0:o[t])===ee.FAILED,{cardType:g,data:y,cardErrorMessage:x,redirectToAdminTab:b,connectorNames:p}=(r==null?void 0:r[t])||{},h=g==="flat",[m,E]=I.useState(!1),[C,w]=I.useState(!1),[v,_]=I.useState(!1),[T,S]=I.useState(!1),L=((V=y==null?void 0:y.listItems)==null?void 0:V.statusCode)!==401,N=I.useMemo(()=>{var W,U,Q,re;return h&&((W=y==null?void 0:y.flatDisplay)!=null&&W.data)?y.flatDisplay.data:!h&&((re=(Q=(U=y==null?void 0:y.listItems)==null?void 0:U.fields)==null?void 0:Q[0])!=null&&re.data)?y.listItems.fields[0].data:[]},[h,y]),k=I.useMemo(()=>N==null?void 0:N.slice(0,5),[N]),[D,M]=I.useState([]),j=I.useRef(null),[J,Y]=I.useState(0),z=m?-180:0,H=h?!1:!!((R=y==null?void 0:y.listItems)!=null&&R.errorMessage),q=H||f||x,ne=c&&!H&&s&&(v||C);I.useLayoutEffect(()=>{var W;(W=j.current)!=null&&W.scrollHeight&&Y(j.current.scrollHeight+i)},[o==null?void 0:o[t],D,j]),I.useEffect(()=>{var re,B;const W=((N==null?void 0:N.length)||0)>5,U=!h&&(((B=(re=y==null?void 0:y.listItems)==null?void 0:re.fields)==null?void 0:B.length)||0)>1;_(W&&!U),w(U)},[y,h,N==null?void 0:N.length]),I.useEffect(()=>{M(m?N:k)},[y,m,k,N]);const ce=()=>{v?E(W=>!W):S(W=>!W)};return d.jsxs(d.Fragment,{children:[d.jsx(Er,{shown:T,setShown:S,showCloseButton:!0,borderRadius:12,children:d.jsx(Ev,{data:((G=y==null?void 0:y.listItems)==null?void 0:G.fields)||[],title:n,currentCard:a,setShowModal:S})}),d.jsx(E4,{className:s?"":"slideUp",height:J,children:d.jsx(u.Stack,{ref:j,gap:1,margin:"12px",children:l&&!(D!=null&&D.length)?d.jsxs(d.Fragment,{children:[d.jsx(Pn,{variant:"rounded",width:"100%",height:20,animation:"wave"}),d.jsx(Pn,{variant:"rounded",width:"100%",height:20,animation:"wave"})]}):d.jsx(d.Fragment,{children:q?d.jsx(u.Box,{margin:"8px 0",children:d.jsx(tp,{error:x,isLoading:l,redirectToAdminTab:b,isFailed:f,showErrorIcon:!L,connectorNames:p,cardId:t,cardTitle:n,currentCard:a,isCardLevelError:!0})}):D!=null&&D.length?D==null?void 0:D.map(W=>{const{value:U,label:Q,deepLink:re,type:B}=W,te="errorMessage"in W?W.errorMessage:null,pe="statusCode"in W?W.statusCode:null;return d.jsxs("div",{children:[d.jsx(v4,{variant:"overline_medium",children:Q}),d.jsx(tp,{value:U,error:te,deepLink:re,statusCode:pe,isLoading:l,type:B,cardTitle:n,currentCard:a,cardId:t,fieldName:Q})]},Q)}):d.jsx(u.Box,{margin:"8px 0",children:d.jsx(Yd,{variant:"body_sm_regular",children:v5})})})})}),!x&&ne&&d.jsx(N4,{variant:"body_xs_medium",onClick:ce,children:v?d.jsxs(d.Fragment,{children:[m?gb:r0,d.jsx(D4,{src:hb,transformAngle:z})]}):r0})]})},Dv={connectorCards:null,cardSpecificData:null,connectorApiStatus:ee.IDLE,conversationMetaDataApiStatus:ee.IDLE,specificConnectorApiStatus:null,threadId:null,connectorsEnabled:!1,specificConnectorErrorCode:null,conversationEmailHeaders:null},op="/v1/api",Nv=`${op}/connectors/cards`,Rv=`${op}/connectors/cards/:id/data`,Mv=({inboxIds:e,conversationId:t,channelType:n="email"})=>{const r=new URLSearchParams;return e.forEach(o=>r.append("inbox_ids",o)),r.append("channel_type",n),r.append("conversation_id",String(t||"")),xe({url:`${Nv}?${r.toString()}`,method:Fe.GET})},Pv=(e,t,n,r)=>{const o=new URLSearchParams;return o.append("senderEmail",t),o.append("conversation_id",String(n||"")),r&&o.append("externalResourceId",r),xe({url:`${Rv.replace(":id",e)}?${o.toString()}`,method:Fe.GET})},sp=xc({name:"connectorCardLibrary",initialState:Dv,reducers:{updateThreadId(e,t){const{payload:n}=t;e.threadId=n.threadId,e.connectorCards=null},clearConnectorList(e){e.connectorCards=null,e.cardSpecificData=null}},extraReducers:e=>{e.addCase(Ba.pending,t=>{t.connectorApiStatus=ee.LOADING}).addCase(Ba.fulfilled,(t,n)=>{t.connectorApiStatus=ee.IDLE,t.connectorCards=n.payload.cards,t.connectorsEnabled=n.payload.connectorsEnabled}).addCase(Ba.rejected,t=>{t.connectorApiStatus=ee.FAILED}).addCase(os.pending,(t,n)=>{const{id:r,externalResourceId:o=""}=n.meta.arg;let s=r;o&&(s=`${s}_${o}`),t.specificConnectorApiStatus={...t.specificConnectorApiStatus??{},[s]:ee.LOADING}}).addCase(os.fulfilled,(t,n)=>{const{id:r,externalResourceId:o=""}=n.meta.arg;let s=r;o&&(s=`${s}_${o}`);const{data:a}=n.payload||{};a&&(t.cardSpecificData={...t.cardSpecificData?t.cardSpecificData:{},[s]:a}),t.specificConnectorApiStatus={...t.specificConnectorApiStatus??{},[s]:ee.IDLE}}).addCase(os.rejected,(t,n)=>{const{id:r,externalResourceId:o=""}=n.meta.arg;let s=r;o&&(s=`${s}_${o}`),t.specificConnectorApiStatus={...t.specificConnectorApiStatus??{},[s]:ee.FAILED};const a=n.payload&&typeof n.payload=="object"&&"code"in n.payload?String(n.payload.code):Nd;t.specificConnectorErrorCode={...t.specificConnectorErrorCode??{},[s]:a}})}}),Ba=$t("connectorCardLibrary/fetchAllCard",async({inboxIds:e,channelType:t,conversationId:n})=>{var i;const r=await Mv({inboxIds:e,channelType:t,conversationId:n});if(!Array.isArray((i=r==null?void 0:r.data)==null?void 0:i.cards))return{cards:[],connectorsEnabled:!1};const{cards:o,connectorsEnabled:s=!1}=r.data;return{cards:o.sort((c,l)=>(c==null?void 0:c.priority)-(l==null?void 0:l.priority)),connectorsEnabled:s}}),os=$t("connectorCardLibrary/fetchSpecificCard",async({id:e,email:t,conversationId:n,isRefresh:r,externalResourceId:o},s)=>{try{const a=await Pv(e,t,n,o),i=a==null?void 0:a.data,c=a==null?void 0:a.status;return i?(r&&Ie({message:B0,type:Ut}),{data:jd(i),status:c}):(r&&Ie({message:j0,type:Ye}),{data:{},status:c})}catch(a){const i=a;return s.rejectWithValue({...i,code:i.code||Nd})}}),jv=sp.reducer,ap=sp.actions,ip="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.76618%202.23341C8.79952%201.26675%207.47285%200.666748%205.99952%200.666748C3.05285%200.666748%200.672852%203.05341%200.672852%206.00008C0.672852%208.94675%203.05285%2011.3334%205.99952%2011.3334C8.48619%2011.3334%2010.5595%209.63341%2011.1529%207.33341H9.76618C9.21952%208.88675%207.73952%2010.0001%205.99952%2010.0001C3.79285%2010.0001%201.99952%208.20675%201.99952%206.00008C1.99952%203.79341%203.79285%202.00008%205.99952%202.00008C7.10618%202.00008%208.09285%202.46008%208.81285%203.18675L6.66618%205.33341H11.3329V0.666748L9.76618%202.23341Z'%20fill='%236C7B94'/%3e%3c/svg%3e",Bv="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.4587%206.7528C11.2244%206.51848%2010.8445%206.51848%2010.6102%206.7528C10.3759%206.98711%2010.3759%207.36701%2010.6102%207.60132L11.4587%206.7528ZM12.1916%208.33414L12.6158%207.90988L12.1916%208.33414ZM8.33462%2012.1911L8.75888%2011.7668L8.33462%2012.1911ZM7.6018%2010.6097C7.36748%2010.3754%206.98758%2010.3754%206.75327%2010.6097C6.51895%2010.8441%206.51895%2011.224%206.75327%2011.4583L7.6018%2010.6097ZM4.43911%209.14411C4.67343%209.37842%205.05333%209.37842%205.28764%209.14411C5.52196%208.9098%205.52196%208.5299%205.28764%208.29558L4.43911%209.14411ZM3.70629%207.56276L4.13056%207.1385L3.70629%207.56276ZM7.56324%203.70582L7.9875%203.28155L7.56324%203.70582ZM8.29606%205.28716C8.53037%205.52148%208.91027%205.52148%209.14459%205.28716C9.3789%205.05285%209.3789%204.67295%209.14459%204.43864L8.29606%205.28716ZM10.6102%207.60132L11.7673%208.75841L12.6158%207.90988L11.4587%206.7528L10.6102%207.60132ZM11.7673%208.75841C12.1662%209.15735%2012.3904%209.69843%2012.3904%2010.2626L13.5904%2010.2626C13.5904%209.38017%2013.2398%208.53387%2012.6158%207.90988L11.7673%208.75841ZM12.3904%2010.2626C12.3904%2010.8268%2012.1662%2011.3679%2011.7673%2011.7668L12.6158%2012.6154C13.2398%2011.9914%2013.5904%2011.1451%2013.5904%2010.2626L12.3904%2010.2626ZM11.7673%2011.7668C10.9365%2012.5976%209.58963%2012.5976%208.75888%2011.7668L7.91035%2012.6154C9.20973%2013.9147%2011.3164%2013.9147%2012.6158%2012.6154L11.7673%2011.7668ZM8.75888%2011.7668L7.6018%2010.6097L6.75327%2011.4583L7.91035%2012.6154L8.75888%2011.7668ZM5.28764%208.29558L4.13056%207.1385L3.28203%207.98703L4.43911%209.14411L5.28764%208.29558ZM4.13056%207.1385C3.73162%206.73956%203.50749%206.19848%203.50749%205.63429L2.30749%205.63429C2.30749%206.51674%202.65804%207.36304%203.28203%207.98703L4.13056%207.1385ZM3.50749%205.63429C3.50749%205.0701%203.73162%204.52902%204.13056%204.13008L3.28203%203.28155C2.65804%203.90554%202.30749%204.75184%202.30749%205.63429L3.50749%205.63429ZM4.13056%204.13008C4.96131%203.29933%206.30822%203.29933%207.13897%204.13008L7.9875%203.28155C6.68812%201.98217%204.58141%201.98217%203.28203%203.28155L4.13056%204.13008ZM7.13897%204.13008L8.29606%205.28716L9.14459%204.43864L7.9875%203.28155L7.13897%204.13008Z'%20fill='%236C7B94'/%3e%3crect%20x='5.08887'%20y='6.0791'%20width='1.33333'%20height='6.66667'%20rx='0.666667'%20transform='rotate(-45%205.08887%206.0791)'%20fill='%236C7B94'/%3e%3cpath%20d='M5.59961%2014.3998V12.7998'%20stroke='%236C7B94'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M12.7998%205.59961H14.3998'%20stroke='%236C7B94'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M2.40039%2011.2002H4.00039'%20stroke='%236C7B94'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M11.2002%202.40039V4.00039'%20stroke='%236C7B94'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Vv="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_5908_39767)'%3e%3cpath%20d='M9.37333%206.01333L9.98667%206.62667L3.94667%2012.6667H3.33333V12.0533L9.37333%206.01333ZM11.7733%202C11.6067%202%2011.4333%202.06667%2011.3067%202.19333L10.0867%203.41333L12.5867%205.91333L13.8067%204.69333C14.0667%204.43333%2014.0667%204.01333%2013.8067%203.75333L12.2467%202.19333C12.1133%202.06%2011.9467%202%2011.7733%202ZM9.37333%204.12667L2%2011.5V14H4.5L11.8733%206.62667L9.37333%204.12667Z'%20fill='%236C7B94'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_5908_39767'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",cp=e=>e.write.createObjectList,Gv=e=>e.write.createObjectConnectorNamesList,lp=e=>e.write.linkObjectList,Hv=e=>e.write.editObjectList,Wv=e=>e.write.objectDict,Zv=e=>e.write.formFields,Xv=e=>e.write.linkCardApiStatus,zv=e=>e.write.unlinkCardApiStatus,Yv=e=>e.write.dependentFieldsMap,Jv=e=>e.write.createFormApiStatus,qv=e=>e.write.updateFormApiStatus,Qv=e=>e.write.currentResourceDetails,$v=e=>e.write.currentResourceDetailsApiStatus,up=e=>e.write.currentCardInEdit,dp=e=>e.write.hasUnsavedChanges,Uv=e=>typeof e=="string"?/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/.test(e):typeof e=="object"&&"_isValid"in e,fp=e=>Object.keys(e).sort((n,r)=>r.localeCompare(n)).reduce((n,r)=>{var o;return(typeof e[r]=="string"||typeof e[r]=="object"&&e[r]!==null)&&Uv(e[r])?n[r]=(o=new Date(`${e[r]}`))==null?void 0:o.toString():n[r]=e[r],n},{}),pp=(e,t)=>JSON.stringify(fp(e))===JSON.stringify(fp(t)),Kv=e=>A5.replace("{{connectorName}}",e),ew=({showUnlinkModal:e,setShowUnlinkModal:t,cardId:n,onCardUnlinking:r,externalResourceId:o,conversationId:s,connectorName:a})=>{const i=Qt(),{sendTrackingEvent:c}=I.useContext(We),f=ve(zv)===ee.LOADING,g=()=>{s&&o&&i(Ma({id:n,conversationId:s,externalResourceId:o})).unwrap().then(()=>{c(D3,{connector_name:a,conversation_id:s}),t(!1),r(),Ie({message:My,type:Ut})}).catch(()=>{Ie({message:Py,type:Ut})})};return d.jsx(Er,{shown:e,setShown:t,showCloseButton:!0,children:d.jsxs(u.Stack,{width:"400px",padding:"20px",gap:"8px",children:[d.jsx(u.Typography,{variant:"h2",children:T5}),d.jsx(u.Typography,{variant:"body2",children:Kv(a)}),d.jsxs(u.Stack,{direction:"row",gap:"8px",marginTop:"20px",justifyContent:"flex-end",children:[d.jsx(u.Button,{variant:"text",onClick:()=>t(!1),children:qi}),d.jsx(u.Button,{disabled:f,color:"error",onClick:g,children:Od})]})]})})},tw=({actions:e,isHovered:t=!1})=>{const r=e.filter(i=>i.shown);if(r.length===0)return null;const o=r[r.length-1],s=r.slice(0,-1),a=t?(s.length+1)*32:32;return d.jsxs(S4,{width:a,isHovered:t,children:[d.jsx("div",{className:"hidden-actions",children:s.map(({id:i,disabled:c,label:l,iconSrc:f,action:g})=>d.jsx(u.Tooltip,{title:l,placement:"bottom",children:d.jsx(qr,{onClick:g,disabled:c,children:d.jsx("img",{src:f})})},i))}),o&&d.jsx(u.Tooltip,{title:o.label,placement:"bottom",children:d.jsx(qr,{onClick:o.action,disabled:o.disabled,children:d.jsx("img",{src:o.iconSrc})})},o.id)]})},nw=e=>{const{card:t,specificCardData:n,email:r,specificConnectorApiStatus:o,defaultOpenState:s=!1,onCardUnlinking:a}=e,i=Qt(),{availableFeatures:c,sendTrackingEvent:l,conversationId:f,currentSmIds:g}=I.useContext(We),{userGroupId:y}=qt()||{},[x,b]=I.useState(!!s),[p,h]=I.useState(!1),[m,E]=I.useState(!1),[C,w]=I.useState(!1),{id:v,title:_,externalResourceId:T="",forms:S=[],logoUrl:L}=t;let N=v;T&&(N=`${N}_${T}`);const{data:k,cardType:D,cardErrorMessage:M,connectorNames:j}=(n==null?void 0:n[N])??{},J=(j==null?void 0:j[0])||"",Y=(o==null?void 0:o[N])===ee.LOADING,z=(o==null?void 0:o[N])===ee.FAILED,H=!!(Ke(c,wd)&&T),q=I.useMemo(()=>{var B,te;if(M||z||!(Ke(c,p5)&&S.some(pe=>pe.type==="edit")))return!1;switch(D){case"flat":return!!((k==null?void 0:k.flatDisplay.externalResourceId)??t.externalResourceId);case"flat_with_list":return((B=k==null?void 0:k.listItems)==null?void 0:B.fields.length)===1?(te=k==null?void 0:k.listItems)==null?void 0:te.fields.some(pe=>pe.externalResourceId):!1;default:return!1}},[k,D,c,S,t,M,z]),ne=I.useCallback((B=!1)=>{const te=B?j3:P3;r&&v&&f&&i(os({id:v,email:r,conversationId:f,externalResourceId:T})).unwrap().then(pe=>{const X={...Pd(pe,_,B,!0),sm_ids:g};l(te,X)}).catch(pe=>{const X={...Pd(pe,_,B,!1),sm_ids:g};l(te,X)})},[i,r,v,_,l,f,T,g]);I.useEffect(()=>{x&&ne(!0)},[x,ne]);const ce=(B,te)=>{var X;B==null||B.stopPropagation(),i(os({id:te,email:r,conversationId:f,isRefresh:!0,externalResourceId:T})).unwrap().then(()=>{l(w3,{id:te})});const pe=B.target.tagName==="BUTTON"?(X=B.target)==null?void 0:X.firstChild:B.target;pe.className&&(pe.className=""),setTimeout(()=>pe.className="selected",1)},V=(B,te)=>{B.stopPropagation(),!(n!=null&&n[te])&&!Y&&ne(),l(x?v3:E3,{id:te}),b(pe=>!pe)},R=B=>{B.stopPropagation();const te=B.currentTarget.offsetWidth<B.currentTarget.scrollWidth;h(!!te)},G=B=>{var pe,X;B.stopPropagation(),l(Ed,{card_title:_,connector_name:J,ug_id:y,sm_ids:g});let te;D==="flat"?te=(k==null?void 0:k.flatDisplay.externalResourceId)??t.externalResourceId:D==="flat_with_list"&&(te=(X=(pe=k==null?void 0:k.listItems)==null?void 0:pe.fields[0])==null?void 0:X.externalResourceId),te?i(ao({...t,externalResourceId:te})):Ie({message:vn,type:Ye})},W=B=>{B.stopPropagation(),E(!0)},U=()=>{w(!0)},Q=()=>{w(!1)},re=[{id:"unlink",label:Od,disabled:Y,shown:H,iconSrc:Bv,action:B=>W(B)},{id:"refresh",label:Sd,disabled:Y,shown:!0,iconSrc:ip,action:B=>ce(B,v)},{id:"edit",label:Fd,disabled:Y,shown:q,iconSrc:Vv,action:B=>G(B)}];return d.jsxs(b4,{"data-testid":`test_${v}`,onMouseEnter:U,onMouseLeave:Q,children:[d.jsxs(y4,{className:x?"hiver-card-expanded":"",onClick:B=>V(B,N),children:[d.jsxs(C4,{children:[L&&d.jsx("img",{src:L,alt:_}),d.jsx(u.Tooltip,{title:p?_:"",placement:"bottom",children:d.jsx(x4,{variant:"body_sm_regular",onMouseOver:B=>R(B),onMouseLeave:B=>R(B),children:_})})]}),d.jsxs(zd,{children:[d.jsx(tw,{actions:re,isHovered:C}),d.jsx(u.Tooltip,{title:x?Td:Yi,placement:"bottom",children:d.jsx(qr,{onClick:B=>V(B,N),children:d.jsx(tc,{className:x?"":"hiver-up"})})})]})]}),d.jsx(rp,{id:N,cardTitle:t.title,currentCard:t,specificCardData:n,specificConnectorApiStatus:o,isOpen:x}),d.jsx(ew,{showUnlinkModal:m,setShowUnlinkModal:E,cardId:v,onCardUnlinking:a,conversationId:f,externalResourceId:T,connectorName:J})]})},rw=Number.MAX_SAFE_INTEGER,ow=({cards:e,email:t,specificCardData:n,specificConnectorApiStatus:r,onCardUnlinking:o})=>{const{availableFeatures:s}=I.useContext(We),i=Ke(s,g5)?rw:1;return d.jsx(u.Box,{flexGrow:1,children:e.map((c,l)=>{const{id:f,externalResourceId:g}=c;let y=f;return g&&(y=`${y}_${g}`),d.jsx("div",{children:d.jsx(nw,{card:c,specificCardData:n,email:t??"",defaultOpenState:l<i,specificConnectorApiStatus:r,onCardUnlinking:o})},y)})})},io=({children:e})=>{if(!Array.isArray(e))return e;let t=null;return e.find(r=>typeof(r==null?void 0:r.type)!="function"?!1:(r.props.fallback&&(t=r),r.props.condition))??t};function In({children:e,condition:t,fallback:n=!1}){return!t&&!n?null:e}io.CaseView=In;const sw="Bring your favourite tools into Hiver",aw="Plugin image",iw="Integrate tools like Salesforce, HubSpot, and Shopify to boost productivity",cw="Enable Connectors",lw="Enable Apps",uw="Learn more",dw="https://help.hiverhq.com/custom-connectors/hiver-s-custom-connectors",fw="Contact your admin to enable this",pw="https://youtu.be/ODcJnzZLb50",hw="connectors-module/assets/connectors-images/connector-mainpage.png",gw="connectors-module/assets/connectors-images/connector-mainpage-apps.png",mw="Explore connectors",bw="Connectors",yw=u.styled(u.Box)`
1249
1259
  padding-top: 20px;
1250
- `,yw=u.styled(u.Stack)`
1260
+ `,Cw=u.styled(u.Stack)`
1251
1261
  width: 100%;
1252
1262
  height: 97px;
1253
1263
  background-color: ${u.theme.palette.purple.light};
@@ -1263,17 +1273,17 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
1263
1273
  height: 56px;
1264
1274
  width: 102px;
1265
1275
  }
1266
- `,Cw=u.styled(u.Typography)`
1276
+ `,xw=u.styled(u.Typography)`
1267
1277
  color: ${u.theme.palette.gray.gray1};
1268
1278
  height: 54px;
1269
1279
  width: 120px;
1270
1280
  line-height: 18px;
1271
- `,xw=u.styled(u.Link)`
1281
+ `,Ew=u.styled(u.Link)`
1272
1282
  display: block;
1273
1283
  width: 100%;
1274
1284
  margin-bottom: 20px;
1275
1285
  margin-top: 12px;
1276
- `,Ew=u.styled(u.Typography)`
1286
+ `,vw=u.styled(u.Typography)`
1277
1287
  color: ${u.theme.palette.gray.gray1};
1278
1288
  font-size: 13px;
1279
1289
  margin-bottom: 24px;
@@ -1287,17 +1297,17 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
1287
1297
  background-color: #e3dfff;
1288
1298
  border: 1px solid ${u.theme.palette.purple.primary};
1289
1299
  }
1290
- `,vw=u.styled(u.Stack)`
1300
+ `,ww=u.styled(u.Stack)`
1291
1301
  margin-top: 16px;
1292
1302
  justify-content: center;
1293
1303
  align-items: center;
1294
1304
  gap: 8px;
1295
- `,ww=u.styled(u.icons.InfoOutlined)`
1305
+ `,Iw=u.styled(u.icons.InfoOutlined)`
1296
1306
  width: 18px;
1297
1307
  color: ${u.theme.palette.gray.gray3};
1298
- `,Iw=u.styled(u.Typography)`
1308
+ `,_w=u.styled(u.Typography)`
1299
1309
  color: ${u.theme.palette.gray.gray3};
1300
- `,_w="https://cdn.hiverhq.com/connectors-module/assets/PlugIn.svg",Sw={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_HIVER_CDN_URL:"https://cdn.hiverhq.com/",VITE_MY_ENV_VAR:"myVariable From Agent"},{VITE_HIVER_CDN_URL:Tw}=Sw,gp=({isAdmin:e=!0,hideHeading:t=!1})=>{const{sendTrackingEvent:n,availableFeatures:r,connectorFunctions:o}=I.useContext(We),s=Ke(r,d5),a=Ke(r,Ws),i=g=>{g.stopPropagation(),n(C3),o==null||o.redirectToAdmin()},c=g=>{g.stopPropagation(),n(x3),window.open(uw,"_blank")},l=()=>{n(X3,{source:"main_tab"})},f=a?hw:pw;return d.jsxs(bw,{"data-testid":"noConnectors",children:[s?d.jsxs(d.Fragment,{children:[t?null:d.jsx(u.Typography,{variant:"h2",children:a?Ji:mw}),d.jsx(xw,{onClick:l,href:fw,target:"_blank",children:d.jsx(g8,{src:Tw+f,alt:gw,aspectRatio:"1000/783"})})]}):d.jsxs(yw,{children:[d.jsx(Cw,{variant:"body1_medium",children:ow}),d.jsx("img",{src:_w,alt:sw})]}),d.jsx(Ew,{variant:"body2",children:aw}),e?d.jsx(hp,{endIcon:d.jsx(u.icons.ArrowForward,{}),onClick:i,...s&&{size:"medium"},children:a?cw:iw}):d.jsxs(d.Fragment,{children:[d.jsx(hp,{onClick:c,children:lw}),d.jsxs(vw,{direction:"row",children:[d.jsx(ww,{}),d.jsx(Iw,{variant:"caption",children:dw})]})]})]})},Aw=()=>{const{availableFeatures:e}=I.useContext(We),t=Ke(e,Ws);return d.jsxs(Xd,{children:[d.jsxs(u.Stack,{direction:"row",boxSizing:"content-box",paddingTop:"20px",paddingBottom:"12px",height:"36px",gap:"8px",alignItems:"center",children:[t?d.jsx(Gd,{width:"20px",height:"20px"}):d.jsx(Wd,{}),d.jsx(Zd,{variant:"body_sm_medium",children:t?Ji:Ad})]}),d.jsxs(u.Stack,{gap:"12px",children:[d.jsx(Pn,{variant:"rounded",width:"100%",height:"46px",animation:"wave"}),d.jsx(Pn,{variant:"rounded",width:"100%",height:"46px",animation:"wave"}),d.jsx(Pn,{variant:"rounded",width:"100%",height:"46px",animation:"wave"})]})]})},Lw=()=>{const{metaData:e,sendTrackingEvent:t,isAdmin:n,connectorFunctions:r}=I.useContext(We),[o,s]=I.useState(!1),a=I.useRef(null),[i,c]=I.useState(0),{templateUpdates:l}=e||{},{sections:f=[],actionButtons:g=[],title:y}=l||{},{version:x=""}=l||{},b=M5(x),p=I.useMemo(()=>R5(x),[x]),h=I.useMemo(()=>(g==null?void 0:g.filter(({isAdminPanelLink:w})=>!(!n&&w)))??[],[g,n]);if(I.useEffect(()=>{!p&&l&&Ui(x,!0)},[p,x,l]),I.useLayoutEffect(()=>{var w;(w=a.current)!=null&&w.scrollHeight&&c(a.current.scrollHeight)},[a]),I.useEffect(()=>{l&&!b&&t(_3,{update_version_id:x})},[]),!l||b)return null;const m=w=>{var v;w.stopPropagation(),s(_=>!_),(v=a.current)!=null&&v.scrollHeight&&c(a.current.scrollHeight),Ui(x,!1,!0)},E=(w,v="",_=!1,T=!1)=>{var S;if(w.stopPropagation(),_&&T?t(S3,{update_version_id:x}):T&&t(T3,{update_version_id:x}),!_&&v){(S=window.open(v,"_blank"))==null||S.focus();return}C(w,!1),r==null||r.redirectToAdmin()},C=(w,v=!0)=>{w.stopPropagation(),Ui(x,!1),s(!1),v&&t(A3,{update_version_id:x})};return d.jsxs(M4,{children:[d.jsxs(P4,{children:[d.jsx(R4,{variant:"h3",children:y}),d.jsxs(u.Box,{children:[o?d.jsx(u.Tooltip,{title:I5,placement:"bottom",children:d.jsx(u.IconButton,{onClick:C,children:d.jsx(u.icons.Close,{sx:{height:"16px",width:"16px",opacity:"0.8"}})})}):null,d.jsx(u.Tooltip,{title:o?w5:Yi,placement:"bottom",children:d.jsx(qr,{onClick:m,children:d.jsx(tc,{className:o?"":"hiver-up"})})})]})]}),d.jsx(j4,{className:o?"slideDown":"slideUp",ref:a,height:i,children:d.jsxs(B4,{children:[f.map(({title:w,items:v,type:_})=>d.jsxs(Z4,{children:[d.jsx(u.Typography,{variant:"body2_medium",children:w}),v.map(T=>{const S=_===O5,{deeplink:L,textHtml:N,imageUrl:k}=T,D=()=>d.jsx(I4,{className:S?"":"ellipsisClass",component:"div",variant:"body2",dangerouslySetInnerHTML:{__html:N}});return d.jsx(V4,{component:"ul",children:d.jsxs(G4,{component:S?"li":"div",marginLeft:k?"0":"14px",children:[k?d.jsx("img",{src:k}):null,L?d.jsx(Jd,{target:"_blank",underline:"none",onClick:M=>E(M,L),fontSize:"13px",children:D()}):D()]})},N)})]},w)),d.jsx(u.Stack,{flexDirection:"row",gap:"8px",marginBottom:"11.5px",children:h.map(({text:w,link:v,isAdminPanelLink:_})=>d.jsx(H4,{variant:_?"contained":"text",children:d.jsx(W4,{variant:"caption",onClick:T=>E(T,v,_,!0),children:w})},w))})]})})]})},Ow=({selectedEmail:e,conversationId:t})=>xe({url:kE.replace(":conversationId",""+t),method:Fe.PATCH,data:{selectedEmail:e}}),Fw="data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='7'%20cy='7'%20r='7'%20fill='%23196FE0'/%3e%3cpath%20d='M10.8288%204.89995C10.5922%204.64324%2010.1976%204.63193%209.94761%204.87601L5.96804%208.75823L4.06989%206.75353C3.82948%206.49981%203.43531%206.49425%203.18845%206.74158C2.9418%206.98865%202.9366%207.39455%203.1768%207.64827L5.50404%2010.1061C5.626%2010.235%205.78808%2010.3%205.95059%2010.3C6.10477%2010.3%206.25896%2010.2414%206.37969%2010.124L10.8056%205.80646C11.0553%205.56278%2011.0659%205.15689%2010.8288%204.89995Z'%20fill='white'/%3e%3c/svg%3e",mp=e=>{const t=I.useRef(null),[n,r]=I.useState(!1);return I.useEffect(()=>{t.current&&r(t.current.scrollWidth>t.current.clientWidth)},[e]),{textRef:t,isOverflow:n}},kw=e=>{const{textRef:t,isOverflow:n}=mp(e.data.label);return d.jsx(u.Tooltip,{title:n?e.data.value:null,placement:"bottom",children:d.jsx(X4,{ref:t,variant:"body_sm_regular",paddingTop:n?"5px":"0px",children:e.data.label})})},Dw=e=>d.jsxs(ln.MenuList,{...e,children:[d.jsx(z4,{children:d.jsx(u.Typography,{variant:"body_sm_medium",children:yb})}),e.children]}),Nw=e=>{const{isSelected:t}=e,{textRef:n,isOverflow:r}=mp(e.data.label);return d.jsx(ln.Option,{...e,children:d.jsxs(u.Stack,{direction:"row",gap:"5px",justifyContent:"space-between",alignItems:"center",children:[d.jsx(u.Tooltip,{title:r?e.data.value:null,placement:"bottom",children:d.jsx(Y4,{ref:n,className:"dropdown-item-text",variant:"body_sm_regular",children:e.data.label})}),t?d.jsx("img",{src:Fw,width:"14px",height:"14px"}):null]})})},Rw=e=>d.jsx(ln.ValueContainer,{...e,children:d.jsxs(u.Stack,{direction:"row",alignItems:"center",gap:"4px",children:[d.jsx(u.icons.AccountCircle,{sx:{height:"20px",width:"20px",color:u.theme.palette.gray.gray3,flexShrink:0}}),d.jsx(u.Stack,{direction:"row",alignItems:"center",sx:{flex:1,minWidth:0,overflow:"hidden"},children:e.children})]})}),Mw=e=>d.jsx(ln.DropdownIndicator,{...e,children:e.selectProps.menuIsOpen?d.jsx(u.icons.ArrowDropUp,{sx:{height:"18px",width:"18px",color:u.theme.palette.gray.gray3}}):d.jsx(u.icons.ArrowDropDown,{sx:{height:"18px",width:"18px",color:u.theme.palette.gray.gray3}})}),Pw={control:(e,t)=>({...e,border:`1px solid ${t.isFocused?u.theme.palette.gray.gray3:u.theme.palette.gray.gray5}`,borderRadius:"8px",boxShadow:t.isFocused?`0 0 0 1px ${u.theme.palette.gray.gray3}`:"none",backgroundColor:u.theme.palette.gray.gray7,cursor:"pointer","& > :first-child":{"& > :first-child":{paddingTop:"0px"},"& > :nth-child(2)":{height:"0px"}}}),option:(e,t)=>({...e,backgroundColor:u.theme.palette.gray.white,color:u.theme.palette.gray.black,height:"36px",padding:"6px 16px","&:hover":{backgroundColor:t.isFocused?u.theme.palette.gray.gray7:u.theme.palette.gray.white}}),singleValue:e=>({...e}),menuList:e=>({...e,maxHeight:"160px",borderRadius:"4px",overflowX:"hidden"}),menu:e=>({...e,boxShadow:"0px 3px 15px 0px #00000040",marginTop:"3px"}),menuPortal:e=>({...e,zIndex:2,maxHeight:"160px"})},jw=({selectedEmail:e,emailHeaders:t,root:n,isLoading:r,setSelectedEmail:o})=>{const{conversationId:s}=I.useContext(We),a=t?Object.entries(t).map(([c])=>({value:c,label:c})):e?[{value:e,label:e}]:[];I.useEffect(()=>{if(!e&&!r&&t&&Object.keys(t).length>0){const c=Object.keys(t)[0];c&&o(c)}},[t,o,e,r]);const i=c=>{const l=String((c==null?void 0:c.value)||"");l&&s&&Ow({selectedEmail:l,conversationId:s}),o(l)};return d.jsx(u.Tooltip,{title:"Selected email",placement:"top",children:d.jsx("div",{style:{marginTop:"12px"},children:d.jsx(es,{options:a,value:e&&!r?{value:e,label:e}:null,placeholder:"Select an email",name:"email-selection",type:"select",onChange:i,components:{...es.getDefaultComponents(),MenuList:Dw,Option:Nw,SingleValue:kw,DropdownIndicator:Mw,ValueContainer:Rw},root:n,styles:Pw,isSearchable:!1,menuPortalTarget:document.body,isLoading:r})})})};u.styled(u.Paper)`
1310
+ `,Sw="https://cdn.hiverhq.com/connectors-module/assets/PlugIn.svg",Tw={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_HIVER_CDN_URL:"https://cdn.hiverhq.com/",VITE_MY_ENV_VAR:"myVariable From Agent"},{VITE_HIVER_CDN_URL:Aw}=Tw,gp=({isAdmin:e=!0,hideHeading:t=!1})=>{const{sendTrackingEvent:n,availableFeatures:r,connectorFunctions:o}=I.useContext(We),s=Ke(r,d5),a=Ke(r,Ws),i=g=>{g.stopPropagation(),n(C3),o==null||o.redirectToAdmin()},c=g=>{g.stopPropagation(),n(x3),window.open(dw,"_blank")},l=()=>{n(X3,{source:"main_tab"})},f=a?gw:hw;return d.jsxs(yw,{"data-testid":"noConnectors",children:[s?d.jsxs(d.Fragment,{children:[t?null:d.jsx(u.Typography,{variant:"h2",children:a?Ji:bw}),d.jsx(Ew,{onClick:l,href:pw,target:"_blank",children:d.jsx(g8,{src:Aw+f,alt:mw,aspectRatio:"1000/783"})})]}):d.jsxs(Cw,{children:[d.jsx(xw,{variant:"body1_medium",children:sw}),d.jsx("img",{src:Sw,alt:aw})]}),d.jsx(vw,{variant:"body2",children:iw}),e?d.jsx(hp,{endIcon:d.jsx(u.icons.ArrowForward,{}),onClick:i,...s&&{size:"medium"},children:a?lw:cw}):d.jsxs(d.Fragment,{children:[d.jsx(hp,{onClick:c,children:uw}),d.jsxs(ww,{direction:"row",children:[d.jsx(Iw,{}),d.jsx(_w,{variant:"caption",children:fw})]})]})]})},Lw=()=>{const{availableFeatures:e}=I.useContext(We),t=Ke(e,Ws);return d.jsxs(Xd,{children:[d.jsxs(u.Stack,{direction:"row",boxSizing:"content-box",paddingTop:"20px",paddingBottom:"12px",height:"36px",gap:"8px",alignItems:"center",children:[t?d.jsx(Gd,{width:"20px",height:"20px"}):d.jsx(Wd,{}),d.jsx(Zd,{variant:"body_sm_medium",children:t?Ji:Ad})]}),d.jsxs(u.Stack,{gap:"12px",children:[d.jsx(Pn,{variant:"rounded",width:"100%",height:"46px",animation:"wave"}),d.jsx(Pn,{variant:"rounded",width:"100%",height:"46px",animation:"wave"}),d.jsx(Pn,{variant:"rounded",width:"100%",height:"46px",animation:"wave"})]})]})},Ow=()=>{const{metaData:e,sendTrackingEvent:t,isAdmin:n,connectorFunctions:r}=I.useContext(We),[o,s]=I.useState(!1),a=I.useRef(null),[i,c]=I.useState(0),{templateUpdates:l}=e||{},{sections:f=[],actionButtons:g=[],title:y}=l||{},{version:x=""}=l||{},b=M5(x),p=I.useMemo(()=>R5(x),[x]),h=I.useMemo(()=>(g==null?void 0:g.filter(({isAdminPanelLink:w})=>!(!n&&w)))??[],[g,n]);if(I.useEffect(()=>{!p&&l&&Ui(x,!0)},[p,x,l]),I.useLayoutEffect(()=>{var w;(w=a.current)!=null&&w.scrollHeight&&c(a.current.scrollHeight)},[a]),I.useEffect(()=>{l&&!b&&t(_3,{update_version_id:x})},[]),!l||b)return null;const m=w=>{var v;w.stopPropagation(),s(_=>!_),(v=a.current)!=null&&v.scrollHeight&&c(a.current.scrollHeight),Ui(x,!1,!0)},E=(w,v="",_=!1,T=!1)=>{var S;if(w.stopPropagation(),_&&T?t(S3,{update_version_id:x}):T&&t(T3,{update_version_id:x}),!_&&v){(S=window.open(v,"_blank"))==null||S.focus();return}C(w,!1),r==null||r.redirectToAdmin()},C=(w,v=!0)=>{w.stopPropagation(),Ui(x,!1),s(!1),v&&t(A3,{update_version_id:x})};return d.jsxs(M4,{children:[d.jsxs(P4,{children:[d.jsx(R4,{variant:"h3",children:y}),d.jsxs(u.Box,{children:[o?d.jsx(u.Tooltip,{title:I5,placement:"bottom",children:d.jsx(u.IconButton,{onClick:C,children:d.jsx(u.icons.Close,{sx:{height:"16px",width:"16px",opacity:"0.8"}})})}):null,d.jsx(u.Tooltip,{title:o?w5:Yi,placement:"bottom",children:d.jsx(qr,{onClick:m,children:d.jsx(tc,{className:o?"":"hiver-up"})})})]})]}),d.jsx(j4,{className:o?"slideDown":"slideUp",ref:a,height:i,children:d.jsxs(B4,{children:[f.map(({title:w,items:v,type:_})=>d.jsxs(Z4,{children:[d.jsx(u.Typography,{variant:"body2_medium",children:w}),v.map(T=>{const S=_===O5,{deeplink:L,textHtml:N,imageUrl:k}=T,D=()=>d.jsx(I4,{className:S?"":"ellipsisClass",component:"div",variant:"body2",dangerouslySetInnerHTML:{__html:N}});return d.jsx(V4,{component:"ul",children:d.jsxs(G4,{component:S?"li":"div",marginLeft:k?"0":"14px",children:[k?d.jsx("img",{src:k}):null,L?d.jsx(Jd,{target:"_blank",underline:"none",onClick:M=>E(M,L),fontSize:"13px",children:D()}):D()]})},N)})]},w)),d.jsx(u.Stack,{flexDirection:"row",gap:"8px",marginBottom:"11.5px",children:h.map(({text:w,link:v,isAdminPanelLink:_})=>d.jsx(H4,{variant:_?"contained":"text",children:d.jsx(W4,{variant:"caption",onClick:T=>E(T,v,_,!0),children:w})},w))})]})})]})},Fw=({selectedEmail:e,conversationId:t})=>xe({url:DE.replace(":conversationId",""+t),method:Fe.PATCH,data:{selectedEmail:e}}),kw="data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='7'%20cy='7'%20r='7'%20fill='%23196FE0'/%3e%3cpath%20d='M10.8288%204.89995C10.5922%204.64324%2010.1976%204.63193%209.94761%204.87601L5.96804%208.75823L4.06989%206.75353C3.82948%206.49981%203.43531%206.49425%203.18845%206.74158C2.9418%206.98865%202.9366%207.39455%203.1768%207.64827L5.50404%2010.1061C5.626%2010.235%205.78808%2010.3%205.95059%2010.3C6.10477%2010.3%206.25896%2010.2414%206.37969%2010.124L10.8056%205.80646C11.0553%205.56278%2011.0659%205.15689%2010.8288%204.89995Z'%20fill='white'/%3e%3c/svg%3e",mp=e=>{const t=I.useRef(null),[n,r]=I.useState(!1);return I.useEffect(()=>{t.current&&r(t.current.scrollWidth>t.current.clientWidth)},[e]),{textRef:t,isOverflow:n}},Dw=e=>{const{textRef:t,isOverflow:n}=mp(e.data.label);return d.jsx(u.Tooltip,{title:n?e.data.value:null,placement:"bottom",children:d.jsx(X4,{ref:t,variant:"body_sm_regular",paddingTop:n?"5px":"0px",children:e.data.label})})},Nw=e=>d.jsxs(ln.MenuList,{...e,children:[d.jsx(z4,{children:d.jsx(u.Typography,{variant:"body_sm_medium",children:yb})}),e.children]}),Rw=e=>{const{isSelected:t}=e,{textRef:n,isOverflow:r}=mp(e.data.label);return d.jsx(ln.Option,{...e,children:d.jsxs(u.Stack,{direction:"row",gap:"5px",justifyContent:"space-between",alignItems:"center",children:[d.jsx(u.Tooltip,{title:r?e.data.value:null,placement:"bottom",children:d.jsx(Y4,{ref:n,className:"dropdown-item-text",variant:"body_sm_regular",children:e.data.label})}),t?d.jsx("img",{src:kw,width:"14px",height:"14px"}):null]})})},Mw=e=>d.jsx(ln.ValueContainer,{...e,children:d.jsxs(u.Stack,{direction:"row",alignItems:"center",gap:"4px",children:[d.jsx(u.icons.AccountCircle,{sx:{height:"20px",width:"20px",color:u.theme.palette.gray.gray3,flexShrink:0}}),d.jsx(u.Stack,{direction:"row",alignItems:"center",sx:{flex:1,minWidth:0,overflow:"hidden"},children:e.children})]})}),Pw=e=>d.jsx(ln.DropdownIndicator,{...e,children:e.selectProps.menuIsOpen?d.jsx(u.icons.ArrowDropUp,{sx:{height:"18px",width:"18px",color:u.theme.palette.gray.gray3}}):d.jsx(u.icons.ArrowDropDown,{sx:{height:"18px",width:"18px",color:u.theme.palette.gray.gray3}})}),jw={control:(e,t)=>({...e,border:`1px solid ${t.isFocused?u.theme.palette.gray.gray3:u.theme.palette.gray.gray5}`,borderRadius:"8px",boxShadow:t.isFocused?`0 0 0 1px ${u.theme.palette.gray.gray3}`:"none",backgroundColor:u.theme.palette.gray.gray7,cursor:"pointer","& > :first-child":{"& > :first-child":{paddingTop:"0px"},"& > :nth-child(2)":{height:"0px"}}}),option:(e,t)=>({...e,backgroundColor:u.theme.palette.gray.white,color:u.theme.palette.gray.black,height:"36px",padding:"6px 16px","&:hover":{backgroundColor:t.isFocused?u.theme.palette.gray.gray7:u.theme.palette.gray.white}}),singleValue:e=>({...e}),menuList:e=>({...e,maxHeight:"160px",borderRadius:"4px",overflowX:"hidden"}),menu:e=>({...e,boxShadow:"0px 3px 15px 0px #00000040",marginTop:"3px"}),menuPortal:e=>({...e,zIndex:2,maxHeight:"160px"})},Bw=({selectedEmail:e,emailHeaders:t,root:n,isLoading:r,setSelectedEmail:o})=>{const{conversationId:s}=I.useContext(We),a=t?Object.entries(t).map(([c])=>({value:c,label:c})):e?[{value:e,label:e}]:[];I.useEffect(()=>{if(!e&&!r&&t&&Object.keys(t).length>0){const c=Object.keys(t)[0];c&&o(c)}},[t,o,e,r]);const i=c=>{const l=String((c==null?void 0:c.value)||"");l&&s&&Fw({selectedEmail:l,conversationId:s}),o(l)};return d.jsx(u.Tooltip,{title:"Selected email",placement:"top",children:d.jsx("div",{style:{marginTop:"12px"},children:d.jsx(es,{options:a,value:e&&!r?{value:e,label:e}:null,placeholder:"Select an email",name:"email-selection",type:"select",onChange:i,components:{...es.getDefaultComponents(),MenuList:Nw,Option:Rw,SingleValue:Dw,DropdownIndicator:Pw,ValueContainer:Mw},root:n,styles:jw,isSearchable:!1,menuPortalTarget:document.body,isLoading:r})})})};u.styled(u.Paper)`
1301
1311
  width: stretch;
1302
1312
  height: 100%;
1303
1313
  position: absolute;
@@ -1307,7 +1317,7 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
1307
1317
  padding: 20px 14px;
1308
1318
  box-sizing: border-box;
1309
1319
  overflow: hidden;
1310
- `;const Bw=u.styled(u.Paper)`
1320
+ `;const Vw=u.styled(u.Paper)`
1311
1321
  width: stretch;
1312
1322
  height: 100%;
1313
1323
  top: 0px;
@@ -1315,17 +1325,17 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
1315
1325
  padding: 0;
1316
1326
  box-sizing: border-box;
1317
1327
  overflow: hidden;
1318
- `,Vw=u.styled("img")`
1328
+ `,Gw=u.styled("img")`
1319
1329
  height: 16px;
1320
1330
  width: 16px;
1321
- `,Gw=u.styled(u.Box)`
1331
+ `,Hw=u.styled(u.Box)`
1322
1332
  margin-top: 12px;
1323
1333
  height: 100%;
1324
- `,Hw="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_4735_44625)'%3e%3cpath%20d='M7.9987%2013.334L8.9387%2012.394L5.2187%208.66732H13.332V7.33398L5.2187%207.33398L8.9387%203.60732L7.9987%202.66732L2.66537%208.00065L7.9987%2013.334Z'%20fill='%234D596C'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_4735_44625'%3e%3crect%20width='16'%20height='16'%20fill='white'%20transform='matrix(-1%200%200%20-1%2016%2016)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",ol=({children:e,rightNode:t,title:n="Back",backButtonTooltip:r,onClose:o})=>d.jsxs(Bw,{children:[d.jsxs(u.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[d.jsxs(u.Stack,{direction:"row",alignItems:"center",marginLeft:"-8px",children:[d.jsx(u.Tooltip,{title:r,placement:"bottom",children:d.jsx(u.IconButton,{onClick:o,children:d.jsx(Vw,{src:Hw})})}),d.jsx(u.Typography,{children:n})]}),d.jsx(u.Stack,{direction:"row",alignItems:"center",children:t})]}),d.jsx(Gw,{children:e})]}),bp=e=>e.common.previewCardData,yp=e=>e.common.previewCardApiStatus,Ww=e=>e.common.selectedSuggestionType,Zw=u.styled(u.Stack)`
1334
+ `,Ww="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_4735_44625)'%3e%3cpath%20d='M7.9987%2013.334L8.9387%2012.394L5.2187%208.66732H13.332V7.33398L5.2187%207.33398L8.9387%203.60732L7.9987%202.66732L2.66537%208.00065L7.9987%2013.334Z'%20fill='%234D596C'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_4735_44625'%3e%3crect%20width='16'%20height='16'%20fill='white'%20transform='matrix(-1%200%200%20-1%2016%2016)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",ol=({children:e,rightNode:t,title:n="Back",backButtonTooltip:r,onClose:o})=>d.jsxs(Vw,{children:[d.jsxs(u.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[d.jsxs(u.Stack,{direction:"row",alignItems:"center",marginLeft:"-8px",children:[d.jsx(u.Tooltip,{title:r,placement:"bottom",children:d.jsx(u.IconButton,{onClick:o,children:d.jsx(Gw,{src:Ww})})}),d.jsx(u.Typography,{children:n})]}),d.jsx(u.Stack,{direction:"row",alignItems:"center",children:t})]}),d.jsx(Hw,{children:e})]}),bp=e=>e.common.previewCardData,yp=e=>e.common.previewCardApiStatus,Zw=e=>e.common.selectedSuggestionType,Xw=u.styled(u.Stack)`
1325
1335
  width: 100%;
1326
1336
  border-radius: 8px;
1327
1337
  border: 1px solid ${u.theme.palette.gray.gray5};
1328
- `,Xw=u.styled(u.Stack)`
1338
+ `,zw=u.styled(u.Stack)`
1329
1339
  padding: 11px;
1330
1340
  height: 46px;
1331
1341
  background: ${u.theme.palette.gray.gray6};
@@ -1335,7 +1345,7 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
1335
1345
  white-space: nowrap;
1336
1346
  overflow: hidden;
1337
1347
  }
1338
- `,zw=u.styled(u.Button)`
1348
+ `,Yw=u.styled(u.Button)`
1339
1349
  &:hover {
1340
1350
  background-color: #e3e9ff !important;
1341
1351
  color: ${u.theme.palette.purple.primary} !important;
@@ -1343,7 +1353,7 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
1343
1353
  }
1344
1354
  margin-top: 10px;
1345
1355
  display: block;
1346
- `,Yw=u.styled(u.Stack)`
1356
+ `,Jw=u.styled(u.Stack)`
1347
1357
  flex-direction: row;
1348
1358
  flex-grow: 1;
1349
1359
  align-items: center;
@@ -1354,7 +1364,7 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
1354
1364
  height: 20px;
1355
1365
  flex-shrink: 0;
1356
1366
  }
1357
- `,Cp=({cardData:e,cardDataApiStatus:t,objectToLink:n,args:r})=>{const o=Qt(),[s,a]=I.useState(!1),[i,c]=I.useState(!0),{id:l="",cardTitle:f="",logoUrl:g}=e||{},y=t===ee.LOADING,x=p=>{p.stopPropagation();const h=p.currentTarget.offsetWidth<p.currentTarget.scrollWidth;a(!!h)},b=p=>{var m;o(so({id:n,args:r,isRefresh:!0}));const h=p.target.tagName==="BUTTON"?(m=p.target)==null?void 0:m.firstChild:p.target;h.className&&(h.className=""),setTimeout(()=>h.className="selected",1)};return d.jsxs(Zw,{children:[d.jsxs(Xw,{direction:"row",justifyContent:"space-between",children:[y?d.jsxs(u.Stack,{gap:"6px",direction:"row",children:[d.jsx(Pn,{width:"16px",height:"24px"}),d.jsx(Pn,{width:"100px",height:"24px"})]}):d.jsxs(Yw,{children:[g&&d.jsx("img",{src:g,alt:f}),d.jsx(u.Tooltip,{title:s?f:"",children:d.jsx(u.Typography,{variant:"h4",onMouseOver:p=>x(p),onMouseLeave:p=>x(p),children:f})})]}),d.jsxs(u.Stack,{direction:"row",alignItems:"center",children:[i?d.jsx(u.Tooltip,{title:Sd,placement:"bottom",children:d.jsx(qr,{onClick:p=>b(p),children:d.jsx("img",{src:ip})})}):null,d.jsx(u.Tooltip,{title:i?Td:Yi,placement:"bottom",children:d.jsx(qr,{onClick:()=>c(p=>!p),children:d.jsx(tc,{className:i?"":"hiver-up"})})})]})]}),d.jsx(rp,{id:l,cardTitle:f,specificCardData:{[l]:e},specificConnectorApiStatus:{[l]:t},isOpen:i})]})},xp={values:{},errors:{}},vt={SET_FIELD_VALUE:"SET_FIELD_VALUE",CLEAR_ERROR:"CLEAR_ERROR",SET_FIELD_ERROR:"SET_FIELD_ERROR",SET_FIELDS:"SET_FIELDS",SET_FORM_DEFAULTS:"SET_FORM_DEFAULTS",CLEAR_FIELDS:"CLEAR_FIELDS",RESET_STATE:"RESET_STATE"},Jw=(e,t)=>{const{type:n,payload:r}=t;switch(n){case vt.SET_FIELD_VALUE:{if(!(r!=null&&r.value))return e;const{name:o,value:s}=r.value;return{...e,values:{...e.values,[o]:s}}}case vt.SET_FIELD_ERROR:{if(!(r!=null&&r.value))return e;const{name:o,value:s}=r.value;return typeof s=="boolean"||typeof s=="string"?{...e,errors:{...e.errors,[o]:s}}:e}case vt.CLEAR_ERROR:{if(!(r!=null&&r.value))return e;const{name:o}=r.value;return{...e,errors:{...e.errors,[o]:""}}}case vt.SET_FIELDS:{if(!(r!=null&&r.values))return e;const{values:o}=r;return{...e,values:o}}case vt.SET_FORM_DEFAULTS:{if(!(r!=null&&r.values))return e;const{values:o}=r,s={...e.errors};for(const a in o??{})o[a]&&delete s[a];return{...e,errors:s,values:{...e.values,...o}}}case vt.CLEAR_FIELDS:{const{fieldNames:o}=r??{};if(!Array.isArray(o))return e;const s={...e.values},a={...e.errors};for(const i of o)delete s[i],delete a[i];return{...e,values:s,errors:a}}case vt.RESET_STATE:return xp}return e},Ep=()=>I.useReducer(Jw,xp),vp=({state:e,dispatch:t,validations:n,dynamicFields:r})=>{const o=e.errors,s=(x,b)=>{t({type:vt.SET_FIELD_VALUE,payload:{value:{value:b,name:x}}})},a=I.useCallback(x=>{t({type:vt.SET_FORM_DEFAULTS,payload:{values:x}})},[t]),i=I.useCallback(()=>Object.keys(o).filter(b=>!!o[b]).length>0,[o]),c=x=>{x.stopPropagation();const{name:b,value:p}=(x==null?void 0:x.target)||{};s(b,p)},l=(x,b)=>{x.stopPropagation();const{name:p}=(x==null?void 0:x.target)||{};s(p,b)},f=(x,b)=>{s(x,b||"")},g=(x,b)=>{e.errors[x]!==b&&t({type:vt.SET_FIELD_ERROR,payload:{value:{name:x,value:b}}})},y=(x,b)=>{if(b){const p=b[x];p==null||p.forEach(h=>{var m;s(h,""),b[h]&&y(h,b),(m=n[h])!=null&&m.isRequired&&g(h,!0)})}};return I.useEffect(()=>{if(Array.isArray(r))return()=>{const x=r.map(b=>b.name);t({type:vt.CLEAR_FIELDS,payload:{fieldNames:x}})}},[r,t]),{setValue:s,setFormDefaults:a,isErrorInValidations:i,inputChangeHandler:c,checkboxChangeHandler:l,dateChangeHandler:f,handleValidationError:g,clearDependentFields:y}},wp=({formFields:e,formId:t,formState:n,appDispatch:r})=>e.reduce((o,s)=>{if(s.type!=="async-select"||!s.interfaceDetails)return o;const a=s.interfaceDetails,i={loadOptions:(c,l,f,g)=>{let y=a;s.searchInterfaceDetails&&typeof c=="string"&&c.trim().length>0&&!f&&(y=s.searchInterfaceDetails);const x=_E(n,y==null?void 0:y.args),b=Object.values((y==null?void 0:y.args)||{});if(x.length===b.length){r(xr({fieldName:s.name,formId:String(t),searchTerm:c,fieldConfig:s,interfaceId:y==null?void 0:y.id,pagination:y==null?void 0:y.pagination,callback:l,args:{...ns(n,y==null?void 0:y.args),...ns(n,y==null?void 0:y.optionalArgs)},isScrollToBottomEvent:f,controller:g}));return}return l([])}};return{...o,[s.name]:i}},{}),Ip=({formFields:e,formId:t,formState:n,conversationId:r,appDispatch:o})=>e.reduce((s,a)=>{if(!a.createOptionInterfaceDetails)return s;const i=a.createOptionInterfaceDetails;return{...s,[a.name]:{createOption:(c,l)=>{var g,y;if(!c)return;const f={values:{name:a.name,value:c},errors:{}};o(ka({fieldName:a.name,formId:String(t),interfaceId:i.id,conversationId:r,label:c,callback:l,args:{...ns(n,(g=a==null?void 0:a.interfaceDetails)==null?void 0:g.args),...ns(n,(y=a==null?void 0:a.interfaceDetails)==null?void 0:y.optionalArgs)},createArgs:{...ns(f,i.args)}}))}}}},{}),_p=({formFields:e,formState:t,formId:n,conversationId:r})=>{const o=Qt(),s=I.useMemo(()=>{if(e&&e.length){const i=wp({formFields:e,formId:n,formState:t,appDispatch:o});return e.reduce((l,f)=>{const g=f.columns;if(!g)return l;const y=wp({formFields:g,formId:n,formState:t,appDispatch:o});return{...l,[f.name]:{loadOptionsList:y}}},i)}return null},[e,t,n,o]),a=I.useMemo(()=>{const i=Ip({formFields:e,formId:n,formState:t,conversationId:r,appDispatch:o});return e.reduce((l,f)=>{const g=f.columns;if(!g)return l;const y=Ip({formFields:g,formId:n,formState:t,conversationId:r,appDispatch:o});return{...l,[f.name]:{createOptionList:y}}},i)},[e,n,t,r,o]);return{fetchConfig:s,createConfig:a}},qw=async({formId:e})=>{try{const t=await xe({url:et(X1,{formId:e}),method:Fe.GET}),n=t==null?void 0:t.data;return n.enabled?Q0(n.defaults):{}}catch(t){throw console.error(t),t}},Sp=({formId:e})=>["Global","WriteForm","FormDefaults",e],Qw=({formId:e,enabled:t})=>{const n=I.useRef(!1),r=I.useRef(e);e&&e!==r.current&&(n.current=!0,r.current=e);const o=Wt({queryKey:Sp({formId:e}),queryFn:async()=>{const s=await qw({formId:e});return n.current=!1,s},refetchOnMount:!0,enabled:n.current&&t,staleTime:0});return{enabledRef:n,...o}},Tp=e=>Array.isArray(e)&&e.length>0,$w=async({formId:e,conversationId:t,inboxIds:n})=>{try{const r=new URLSearchParams;if(t&&r.set("conversation_id",String(t)),Tp(n))for(const a of n)r.append("inbox_id",String(a));const o=await xe({url:et(zE,{formId:e})+"?"+r.toString(),method:Fe.GET}),s=o==null?void 0:o.data;if(!s.enabled)throw new Error("Form default values are not enabled");return Q0(s.defaults,!0)}catch(r){throw console.error(r),r}},Ap=({formId:e,conversationId:t,inboxIds:n})=>["Global","WriteForm","FormDefaults",e,t,n],Lp=({formId:e,conversationId:t,inboxIds:n,enabled:r,fetchOnMount:o=!0})=>{const s=I.useRef(!0),a=Wt({queryKey:Ap({formId:e,conversationId:t,inboxIds:n}),queryFn:async()=>{const c=await $w({formId:e,conversationId:t,inboxIds:n});return s.current=!1,c},refetchOnMount:o,enabled:s.current&&!!e&&!!t&&Tp(n)&&r,staleTime:0}),i=I.useMemo(()=>{if(Object.keys(a.data??{}).length===0&&a.isSuccess)return!0},[a.data,a.isSuccess]);return{enabledRef:s,isNudgeRequired:i,...a}},Uw=async({formId:e,data:t})=>{try{const n=await xe({url:et(X1,{formId:e}),data:{defaults:t},method:Fe.PUT}),r=n==null?void 0:n.data;return r.enabled?r.defaults:{}}catch(n){throw console.error(n),n}},Kw=({formId:e,conversationId:t,inboxIds:n,onSuccess:r,onError:o})=>{const s=Gr();return Zt({mutationFn:a=>Uw({formId:e,data:a}),onSuccess:()=>{s.invalidateQueries({queryKey:Sp({formId:e})}),s.invalidateQueries({queryKey:Ap({formId:e,conversationId:t,inboxIds:n})}),r==null||r(),Ie({message:"Form defaults updated successfully",type:Ut})},onError:()=>{o==null||o(),Ie({message:"Failed to update form defaults",type:Ye})}})},eI=({open:e,isEdit:t,formId:n,fields:r,connectorLogo:o,variables:s,customFormArgsEnabled:a,customFormArgsMap:i,title:c="Map fields",isLoading:l=!1,onSuccess:f,onClose:g})=>{const[y,x]=I.useState({}),{conversationId:b,currentSmIds:p}=I.useContext(We),{data:h}=h6({formId:n,formData:y,argsMap:i??{},enabled:!!n&&!!a,delay:500}),{data:m,isLoading:E,enabledRef:C}=Qw({formId:n,enabled:!t&&!!e}),{mutate:w,isPending:v}=Kw({formId:n,conversationId:b,inboxIds:p,onSuccess:()=>{C.current=!0,f==null||f()}}),_=I.useMemo(()=>h!=null&&h.length?[...r,...h]:r,[r,h]);I.useEffect(()=>{x(m)},[m]);const T=N=>{const k=_.map(M=>({name:M.name,type:M.isMultiSelect?"multi-select":M.type})),D=S6(N,k);w(D)},S=async({args:N,pagination:k},{formId:D,fieldName:M})=>{const j=await H1({formId:D,fieldName:M},{pagination:k,args:N}),J=Array.isArray(j==null?void 0:j.data.data)?j.data.data:[];return{options:J,hasMore:!!J.length}},L=N=>{const k=J0(N.value)?N.value.value:N.value,D=k&&N.type==="multi-select"?[k]:k;x(M=>({...M,[N.name]:D}))};return d.jsx(IE,{open:e,defaultValues:m,formId:n,fields:_,connectorLogo:o,variables:s,title:c,isLoading:l||E,isSaving:v,fetchOptions:S,onSave:T,onClose:()=>g==null?void 0:g(),onCancel:()=>g==null?void 0:g(),onFieldChange:L})},tI=async({formId:e,args:t})=>{try{const n=await xe({url:et(XE,{formId:e}),data:{args:t},method:Fe.POST});return(n==null?void 0:n.data).fieldList.map(o=>rl(o))}catch(n){throw console.error(n),n}},nI=({formId:e,args:t,enabled:n,delay:r=500})=>{const[o,s]=I.useState(t);return I.useEffect(()=>{const a=setTimeout(()=>s(t),r);return()=>clearTimeout(a)},[t,r]),Wt({queryKey:["Global","WriteForm","CustomFields",e,o],queryFn:()=>tI({formId:e,args:t}),refetchOnMount:!1,enabled:n})},Op="connector-agent_auto_fill_nudge",rI=e=>A.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 275 81",fill:"none","aria-hidden":"true",...e},A.createElement("defs",null,A.createElement("filter",{id:"autofillCardShadow",x:"-30%",y:"-30%",width:"160%",height:"160%"},A.createElement("feDropShadow",{dx:0,dy:1,stdDeviation:2,floodColor:"#000",floodOpacity:.08})),A.createElement("linearGradient",{id:"autofillHoneycomb",x1:0,y1:0,x2:1,y2:1,gradientUnits:"objectBoundingBox"},A.createElement("stop",{offset:0,stopColor:"#FFD54F"}),A.createElement("stop",{offset:1,stopColor:"#FFB300"}))),A.createElement("g",{transform:"translate(14 10) rotate(-2.75 44 29)",filter:"url(#autofillCardShadow)"},A.createElement("rect",{width:88,height:56,rx:6,fill:"#fff",stroke:"#EEE",strokeWidth:.75}),A.createElement("circle",{cx:14,cy:6,r:8,fill:"#fff",stroke:"#EEE",strokeWidth:.6}),A.createElement("path",{d:"M10.5 6l2.2 2.5L15.5 4",stroke:"#506DFF",strokeWidth:1.1,strokeLinecap:"round",strokeLinejoin:"round"}),A.createElement("rect",{x:10,y:18,width:68,height:14,rx:7,fill:"#fff",stroke:"#D1D8FA",strokeWidth:.5}),A.createElement("text",{x:14,y:27.5,fill:"#334155",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:5.5,fontWeight:600},"Source field 1"),A.createElement("rect",{x:10,y:36,width:68,height:14,rx:7,fill:"#fff",stroke:"#F5F5F5",strokeWidth:.5}),A.createElement("text",{x:14,y:45.5,fill:"#6F7C90",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:5.5,fontWeight:500},"Source field 2")),A.createElement("path",{d:"M108 40H175",stroke:"#9CA3AF",strokeWidth:.9,strokeDasharray:"3 3",strokeLinecap:"round"}),A.createElement("circle",{cx:142,cy:40,r:9,fill:"#fff",stroke:"#E5E7EB",strokeWidth:.75}),A.createElement("path",{d:"M137.5 40h9M135 40l2.5-2M135 40l2.5 2M149.5 40l-2.5-2M149.5 40l-2.5 2",stroke:"#506DFF",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),A.createElement("g",{transform:"translate(186 18)",filter:"url(#autofillCardShadow)"},A.createElement("rect",{width:72,height:46,rx:5,fill:"#fff",stroke:"#EEE",strokeWidth:.75}),A.createElement("circle",{cx:12,cy:5,r:7,fill:"#fff",stroke:"#EEE",strokeWidth:.6}),A.createElement("circle",{cx:12,cy:5,r:4,fill:"url(#autofillHoneycomb)"}),A.createElement("rect",{x:8,y:16,width:56,height:13,rx:6.5,fill:"#fff",stroke:"#D1D8FA",strokeWidth:.5}),A.createElement("text",{x:12,y:24.5,fill:"#334155",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:5.5,fontWeight:600},"Target field"))),oI=u.styled(u.Stack)`
1367
+ `,Cp=({cardData:e,cardDataApiStatus:t,objectToLink:n,args:r})=>{const o=Qt(),[s,a]=I.useState(!1),[i,c]=I.useState(!0),{id:l="",cardTitle:f="",logoUrl:g}=e||{},y=t===ee.LOADING,x=p=>{p.stopPropagation();const h=p.currentTarget.offsetWidth<p.currentTarget.scrollWidth;a(!!h)},b=p=>{var m;o(so({id:n,args:r,isRefresh:!0}));const h=p.target.tagName==="BUTTON"?(m=p.target)==null?void 0:m.firstChild:p.target;h.className&&(h.className=""),setTimeout(()=>h.className="selected",1)};return d.jsxs(Xw,{children:[d.jsxs(zw,{direction:"row",justifyContent:"space-between",children:[y?d.jsxs(u.Stack,{gap:"6px",direction:"row",children:[d.jsx(Pn,{width:"16px",height:"24px"}),d.jsx(Pn,{width:"100px",height:"24px"})]}):d.jsxs(Jw,{children:[g&&d.jsx("img",{src:g,alt:f}),d.jsx(u.Tooltip,{title:s?f:"",children:d.jsx(u.Typography,{variant:"h4",onMouseOver:p=>x(p),onMouseLeave:p=>x(p),children:f})})]}),d.jsxs(u.Stack,{direction:"row",alignItems:"center",children:[i?d.jsx(u.Tooltip,{title:Sd,placement:"bottom",children:d.jsx(qr,{onClick:p=>b(p),children:d.jsx("img",{src:ip})})}):null,d.jsx(u.Tooltip,{title:i?Td:Yi,placement:"bottom",children:d.jsx(qr,{onClick:()=>c(p=>!p),children:d.jsx(tc,{className:i?"":"hiver-up"})})})]})]}),d.jsx(rp,{id:l,cardTitle:f,specificCardData:{[l]:e},specificConnectorApiStatus:{[l]:t},isOpen:i})]})},xp={values:{},errors:{}},vt={SET_FIELD_VALUE:"SET_FIELD_VALUE",CLEAR_ERROR:"CLEAR_ERROR",SET_FIELD_ERROR:"SET_FIELD_ERROR",SET_FIELDS:"SET_FIELDS",SET_FORM_DEFAULTS:"SET_FORM_DEFAULTS",CLEAR_FIELDS:"CLEAR_FIELDS",RESET_STATE:"RESET_STATE"},qw=(e,t)=>{const{type:n,payload:r}=t;switch(n){case vt.SET_FIELD_VALUE:{if(!(r!=null&&r.value))return e;const{name:o,value:s}=r.value;return{...e,values:{...e.values,[o]:s}}}case vt.SET_FIELD_ERROR:{if(!(r!=null&&r.value))return e;const{name:o,value:s}=r.value;return typeof s=="boolean"||typeof s=="string"?{...e,errors:{...e.errors,[o]:s}}:e}case vt.CLEAR_ERROR:{if(!(r!=null&&r.value))return e;const{name:o}=r.value;return{...e,errors:{...e.errors,[o]:""}}}case vt.SET_FIELDS:{if(!(r!=null&&r.values))return e;const{values:o}=r;return{...e,values:o}}case vt.SET_FORM_DEFAULTS:{if(!(r!=null&&r.values))return e;const{values:o}=r,s={...e.errors};for(const a in o??{})o[a]&&delete s[a];return{...e,errors:s,values:{...e.values,...o}}}case vt.CLEAR_FIELDS:{const{fieldNames:o}=r??{};if(!Array.isArray(o))return e;const s={...e.values},a={...e.errors};for(const i of o)delete s[i],delete a[i];return{...e,values:s,errors:a}}case vt.RESET_STATE:return xp}return e},Ep=()=>I.useReducer(qw,xp),vp=({state:e,dispatch:t,validations:n,dynamicFields:r})=>{const o=e.errors,s=(x,b)=>{t({type:vt.SET_FIELD_VALUE,payload:{value:{value:b,name:x}}})},a=I.useCallback(x=>{t({type:vt.SET_FORM_DEFAULTS,payload:{values:x}})},[t]),i=I.useCallback(()=>Object.keys(o).filter(b=>!!o[b]).length>0,[o]),c=x=>{x.stopPropagation();const{name:b,value:p}=(x==null?void 0:x.target)||{};s(b,p)},l=(x,b)=>{x.stopPropagation();const{name:p}=(x==null?void 0:x.target)||{};s(p,b)},f=(x,b)=>{s(x,b||"")},g=(x,b)=>{e.errors[x]!==b&&t({type:vt.SET_FIELD_ERROR,payload:{value:{name:x,value:b}}})},y=(x,b)=>{if(b){const p=b[x];p==null||p.forEach(h=>{var m;s(h,""),b[h]&&y(h,b),(m=n[h])!=null&&m.isRequired&&g(h,!0)})}};return I.useEffect(()=>{if(Array.isArray(r))return()=>{const x=r.map(b=>b.name);t({type:vt.CLEAR_FIELDS,payload:{fieldNames:x}})}},[r,t]),{setValue:s,setFormDefaults:a,isErrorInValidations:i,inputChangeHandler:c,checkboxChangeHandler:l,dateChangeHandler:f,handleValidationError:g,clearDependentFields:y}},wp=({formFields:e,formId:t,formState:n,appDispatch:r})=>e.reduce((o,s)=>{if(s.type!=="async-select"||!s.interfaceDetails)return o;const a=s.interfaceDetails,i={loadOptions:(c,l,f,g)=>{let y=a;s.searchInterfaceDetails&&typeof c=="string"&&c.trim().length>0&&!f&&(y=s.searchInterfaceDetails);const x=SE(n,y==null?void 0:y.args),b=Object.values((y==null?void 0:y.args)||{});if(x.length===b.length){r(xr({fieldName:s.name,formId:String(t),searchTerm:c,fieldConfig:s,interfaceId:y==null?void 0:y.id,pagination:y==null?void 0:y.pagination,callback:l,args:{...ns(n,y==null?void 0:y.args),...ns(n,y==null?void 0:y.optionalArgs)},isScrollToBottomEvent:f,controller:g}));return}return l([])}};return{...o,[s.name]:i}},{}),Ip=({formFields:e,formId:t,formState:n,conversationId:r,appDispatch:o})=>e.reduce((s,a)=>{if(!a.createOptionInterfaceDetails)return s;const i=a.createOptionInterfaceDetails;return{...s,[a.name]:{createOption:(c,l)=>{var g,y;if(!c)return;const f={values:{name:a.name,value:c},errors:{}};o(ka({fieldName:a.name,formId:String(t),interfaceId:i.id,conversationId:r,label:c,callback:l,args:{...ns(n,(g=a==null?void 0:a.interfaceDetails)==null?void 0:g.args),...ns(n,(y=a==null?void 0:a.interfaceDetails)==null?void 0:y.optionalArgs)},createArgs:{...ns(f,i.args)}}))}}}},{}),_p=({formFields:e,formState:t,formId:n,conversationId:r})=>{const o=Qt(),s=I.useMemo(()=>{if(e&&e.length){const i=wp({formFields:e,formId:n,formState:t,appDispatch:o});return e.reduce((l,f)=>{const g=f.columns;if(!g)return l;const y=wp({formFields:g,formId:n,formState:t,appDispatch:o});return{...l,[f.name]:{loadOptionsList:y}}},i)}return null},[e,t,n,o]),a=I.useMemo(()=>{const i=Ip({formFields:e,formId:n,formState:t,conversationId:r,appDispatch:o});return e.reduce((l,f)=>{const g=f.columns;if(!g)return l;const y=Ip({formFields:g,formId:n,formState:t,conversationId:r,appDispatch:o});return{...l,[f.name]:{createOptionList:y}}},i)},[e,n,t,r,o]);return{fetchConfig:s,createConfig:a}},Qw=async({formId:e})=>{try{const t=await xe({url:et(X1,{formId:e}),method:Fe.GET}),n=t==null?void 0:t.data;return n.enabled?Q0(n.defaults):{}}catch(t){throw console.error(t),t}},Sp=({formId:e})=>["Global","WriteForm","FormDefaults",e],$w=({formId:e,enabled:t})=>{const n=I.useRef(!1),r=I.useRef(e);e&&e!==r.current&&(n.current=!0,r.current=e);const o=Wt({queryKey:Sp({formId:e}),queryFn:async()=>{const s=await Qw({formId:e});return n.current=!1,s},refetchOnMount:!0,enabled:n.current&&t,staleTime:0});return{enabledRef:n,...o}},Tp=e=>Array.isArray(e)&&e.length>0,Uw=async({formId:e,conversationId:t,inboxIds:n})=>{try{const r=new URLSearchParams;if(t&&r.set("conversation_id",String(t)),Tp(n))for(const a of n)r.append("inbox_id",String(a));const o=await xe({url:et(YE,{formId:e})+"?"+r.toString(),method:Fe.GET}),s=o==null?void 0:o.data;if(!s.enabled)throw new Error("Form default values are not enabled");return Q0(s.defaults,!0)}catch(r){throw console.error(r),r}},Ap=({formId:e,conversationId:t,inboxIds:n})=>["Global","WriteForm","FormDefaults",e,t,n],Lp=({formId:e,conversationId:t,inboxIds:n,enabled:r,fetchOnMount:o=!0})=>{const s=I.useRef(!0),a=Wt({queryKey:Ap({formId:e,conversationId:t,inboxIds:n}),queryFn:async()=>{const c=await Uw({formId:e,conversationId:t,inboxIds:n});return s.current=!1,c},refetchOnMount:o,enabled:s.current&&!!e&&!!t&&Tp(n)&&r,staleTime:0}),i=I.useMemo(()=>{if(Object.keys(a.data??{}).length===0&&a.isSuccess)return!0},[a.data,a.isSuccess]);return{enabledRef:s,isNudgeRequired:i,...a}},Kw=async({formId:e,data:t})=>{try{const n=await xe({url:et(X1,{formId:e}),data:{defaults:t},method:Fe.PUT}),r=n==null?void 0:n.data;return r.enabled?r.defaults:{}}catch(n){throw console.error(n),n}},eI=({formId:e,conversationId:t,inboxIds:n,onSuccess:r,onError:o})=>{const s=Gr();return Zt({mutationFn:a=>Kw({formId:e,data:a}),onSuccess:()=>{s.invalidateQueries({queryKey:Sp({formId:e})}),s.invalidateQueries({queryKey:Ap({formId:e,conversationId:t,inboxIds:n})}),r==null||r(),Ie({message:"Form defaults updated successfully",type:Ut})},onError:()=>{o==null||o(),Ie({message:"Failed to update form defaults",type:Ye})}})},tI=({open:e,isEdit:t,formId:n,fields:r,connectorLogo:o,variables:s,customFormArgsEnabled:a,customFormArgsMap:i,title:c="Map fields",isLoading:l=!1,onSuccess:f,onClose:g})=>{const[y,x]=I.useState({}),{conversationId:b,currentSmIds:p}=I.useContext(We),{data:h}=h6({formId:n,formData:y,argsMap:i??{},enabled:!!n&&!!a,delay:500}),{data:m,isLoading:E,enabledRef:C}=$w({formId:n,enabled:!t&&!!e}),{mutate:w,isPending:v}=eI({formId:n,conversationId:b,inboxIds:p,onSuccess:()=>{C.current=!0,f==null||f()}}),_=I.useMemo(()=>h!=null&&h.length?[...r,...h]:r,[r,h]);I.useEffect(()=>{x(m)},[m]);const T=N=>{const k=_.map(M=>({name:M.name,type:M.isMultiSelect?"multi-select":M.type})),D=S6(N,k);w(D)},S=async({args:N,pagination:k},{formId:D,fieldName:M})=>{const j=await H1({formId:D,fieldName:M},{pagination:k,args:N}),J=Array.isArray(j==null?void 0:j.data.data)?j.data.data:[];return{options:J,hasMore:!!J.length}},L=N=>{const k=J0(N.value)?N.value.value:N.value,D=k&&N.type==="multi-select"?[k]:k;x(M=>({...M,[N.name]:D}))};return d.jsx(_E,{open:e,defaultValues:m,formId:n,fields:_,connectorLogo:o,variables:s,title:c,isLoading:l||E,isSaving:v,fetchOptions:S,onSave:T,onClose:()=>g==null?void 0:g(),onCancel:()=>g==null?void 0:g(),onFieldChange:L})},nI=async({formId:e,args:t})=>{try{const n=await xe({url:et(zE,{formId:e}),data:{args:t},method:Fe.POST});return(n==null?void 0:n.data).fieldList.map(o=>rl(o))}catch(n){throw console.error(n),n}},rI=({formId:e,args:t,enabled:n,delay:r=500})=>{const[o,s]=I.useState(t);return I.useEffect(()=>{const a=setTimeout(()=>s(t),r);return()=>clearTimeout(a)},[t,r]),Wt({queryKey:["Global","WriteForm","CustomFields",e,o],queryFn:()=>nI({formId:e,args:t}),refetchOnMount:!1,enabled:n})},Op="connector-agent_auto_fill_nudge",oI=e=>A.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 275 81",fill:"none","aria-hidden":"true",...e},A.createElement("defs",null,A.createElement("filter",{id:"autofillCardShadow",x:"-30%",y:"-30%",width:"160%",height:"160%"},A.createElement("feDropShadow",{dx:0,dy:1,stdDeviation:2,floodColor:"#000",floodOpacity:.08})),A.createElement("linearGradient",{id:"autofillHoneycomb",x1:0,y1:0,x2:1,y2:1,gradientUnits:"objectBoundingBox"},A.createElement("stop",{offset:0,stopColor:"#FFD54F"}),A.createElement("stop",{offset:1,stopColor:"#FFB300"}))),A.createElement("g",{transform:"translate(14 10) rotate(-2.75 44 29)",filter:"url(#autofillCardShadow)"},A.createElement("rect",{width:88,height:56,rx:6,fill:"#fff",stroke:"#EEE",strokeWidth:.75}),A.createElement("circle",{cx:14,cy:6,r:8,fill:"#fff",stroke:"#EEE",strokeWidth:.6}),A.createElement("path",{d:"M10.5 6l2.2 2.5L15.5 4",stroke:"#506DFF",strokeWidth:1.1,strokeLinecap:"round",strokeLinejoin:"round"}),A.createElement("rect",{x:10,y:18,width:68,height:14,rx:7,fill:"#fff",stroke:"#D1D8FA",strokeWidth:.5}),A.createElement("text",{x:14,y:27.5,fill:"#334155",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:5.5,fontWeight:600},"Source field 1"),A.createElement("rect",{x:10,y:36,width:68,height:14,rx:7,fill:"#fff",stroke:"#F5F5F5",strokeWidth:.5}),A.createElement("text",{x:14,y:45.5,fill:"#6F7C90",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:5.5,fontWeight:500},"Source field 2")),A.createElement("path",{d:"M108 40H175",stroke:"#9CA3AF",strokeWidth:.9,strokeDasharray:"3 3",strokeLinecap:"round"}),A.createElement("circle",{cx:142,cy:40,r:9,fill:"#fff",stroke:"#E5E7EB",strokeWidth:.75}),A.createElement("path",{d:"M137.5 40h9M135 40l2.5-2M135 40l2.5 2M149.5 40l-2.5-2M149.5 40l-2.5 2",stroke:"#506DFF",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),A.createElement("g",{transform:"translate(186 18)",filter:"url(#autofillCardShadow)"},A.createElement("rect",{width:72,height:46,rx:5,fill:"#fff",stroke:"#EEE",strokeWidth:.75}),A.createElement("circle",{cx:12,cy:5,r:7,fill:"#fff",stroke:"#EEE",strokeWidth:.6}),A.createElement("circle",{cx:12,cy:5,r:4,fill:"url(#autofillHoneycomb)"}),A.createElement("rect",{x:8,y:16,width:56,height:13,rx:6.5,fill:"#fff",stroke:"#D1D8FA",strokeWidth:.5}),A.createElement("text",{x:12,y:24.5,fill:"#334155",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:5.5,fontWeight:600},"Target field"))),sI=u.styled(u.Stack)`
1358
1368
  gap: 12px;
1359
1369
  align-items: stretch;
1360
1370
  background-color: #f3f8ff;
@@ -1363,7 +1373,7 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
1363
1373
  padding: 8px;
1364
1374
  padding-bottom: 12px;
1365
1375
  margin-bottom: 20px;
1366
- `,sI=u.styled(u.Box)`
1376
+ `,aI=u.styled(u.Box)`
1367
1377
  display: flex;
1368
1378
  align-items: center;
1369
1379
  justify-content: center;
@@ -1379,20 +1389,20 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
1379
1389
  height: 100%;
1380
1390
  object-fit: cover;
1381
1391
  }
1382
- `,aI=u.styled(u.Stack)`
1392
+ `,iI=u.styled(u.Stack)`
1383
1393
  gap: 16px;
1384
1394
  align-items: flex-start;
1385
1395
  width: 100%;
1386
- `,iI=u.styled(u.Stack)`
1396
+ `,cI=u.styled(u.Stack)`
1387
1397
  gap: 2px;
1388
1398
  align-items: flex-start;
1389
1399
  width: 100%;
1390
- `,cI=u.styled(u.Stack)`
1400
+ `,lI=u.styled(u.Stack)`
1391
1401
  flex-direction: row;
1392
1402
  gap: 12px;
1393
1403
  align-items: center;
1394
- `,lI=({onPrimaryClick:e})=>{const[t,n]=I.useState(()=>ra().getItem(Op)==="true");if(t)return null;const r=()=>{ra().setItem(Op,"true"),n(!0)};return d.jsxs(oI,{children:[d.jsx(sI,{children:d.jsx(rI,{style:{backgroundColor:"#FFDD57"}})}),d.jsxs(aI,{children:[d.jsxs(iI,{children:[d.jsx(u.Typography,{variant:"body2",sx:{fontWeight:600,color:u.theme.palette.gray.black,lineHeight:"18px"},children:"Autofill data with Map fields"}),d.jsx(u.Typography,{variant:"caption",color:u.theme.palette.gray.gray3,sx:{letterSpacing:"0.2px",lineHeight:"16px"},children:"Now you can configure what data to auto fill these fields"})]}),d.jsxs(cI,{children:[d.jsx(u.Button,{size:"small",onClick:e,children:"Checkout"}),d.jsx(u.Button,{variant:"text",size:"small",sx:{color:u.theme.palette.gray.gray2},onClick:r,children:"Dismiss"})]})]})]})},Fp=({setShown:e,shown:t,title:n,description:r,buttons:o})=>d.jsx(Er,{shown:t,setShown:e,showCloseButton:!0,children:d.jsxs(u.Stack,{width:"400px",padding:"20px",children:[d.jsx(u.Typography,{variant:"h2",marginBottom:"8px",children:n}),d.jsx(u.Stack,{gap:"4px",marginBottom:"20px",children:r.split(`
1395
- `).map((s,a)=>d.jsx(u.Typography,{variant:"body2",children:s},a))}),d.jsx(u.Stack,{direction:"row",justifyContent:"flex-end",gap:"8px",children:o.map(s=>d.jsx(u.Button,{variant:s.variant,size:"medium",onClick:s.action,children:s.label},s.label.split(" ").join("_").toLowerCase()))})]})}),kp="connector-agent-expanded-write-form",Dp=({metaData:e,isEdit:t=!1,defaultOption:n,mapFormOpen:r,onClose:o,onCreateSuccess:s,setMetaData:a,setMapFormOpen:i,setCreateFormId:c})=>{var er,tr;const{userGroupId:l}=qt()||{},[f,g]=I.useState(null),[y,x]=I.useState(!1),[b,p]=I.useState(!1),h=I.useRef(null),{conversationId:m,availableFeatures:E,sendTrackingEvent:C,currentSmIds:w,connectorFunctions:{redirectToAdmin:v,getFormElement:_,toggleFormElement:T},stackingContext:S,isAdmin:L,variables:N}=I.useContext(We),[k,D]=Ep(),M=ve(up),j=ve(t?Gv:cp),J=ve(Wv),Y=ve(Hv),z=ve(zv),H=ve(Yv),q=ve(Jv),ne=ve(qv),ce=ve(Qv),V=ve(dp),R=Y==null?void 0:Y[(f==null?void 0:f.value)??""],G=Ke(E,E5),W=(R==null?void 0:R.hasCustomFields)??!1,{customFieldsArgsPresent:U,customFieldsArgs:Q}=I.useMemo(()=>{if(!W)return{customFieldsArgsPresent:!1,customFieldsArgs:{}};const ae=Object.values((R==null?void 0:R.customFieldsArgs)??{}).every(it=>!!k.values[it]);if(!ae)return{customFieldsArgsPresent:!1,customFieldsArgs:{}};const _e=(R==null?void 0:R.customFieldsArgs)??{},$e=rs(k,_e);return{customFieldsArgsPresent:ae,customFieldsArgs:$e}},[W,k,R==null?void 0:R.customFieldsArgs]),re=W&&U&&G,{data:B}=nI({formId:String(f==null?void 0:f.value),args:Q,enabled:re}),te=I.useMemo(()=>re?B??[]:[],[re,B]),pe=R==null?void 0:R.expandedView,{formConfigs:X,formViewConfigs:Ve}=I.useMemo(()=>{if(f&&"value"in f&&J&&J[f.value]&&Array.isArray(J[f.value])){const _e=[...J[f.value],...te],$e=[{id:f.value,formFields:_e}];return{formConfigs:$e,formViewConfigs:pe?SE(_e,q1):$e}}const ae=[{id:"emptyFormId",formFields:[]}];return{formConfigs:ae,formViewConfigs:ae}},[J,te,f,pe]),Ge=(er=X[0])==null?void 0:er.formFields,at=I.useMemo(()=>(Ge??[]).filter(_e=>!_e.isCustomField),[Ge]),nt=I.useMemo(()=>{var _e;const ae=((_e=X==null?void 0:X[0])==null?void 0:_e.formFields)||[];return nl({formFields:ae})},[X]),{setValue:Vt,setFormDefaults:pt,inputChangeHandler:ht,checkboxChangeHandler:Qe,dateChangeHandler:An,clearDependentFields:_t,handleValidationError:vo,isErrorInValidations:$n}=vp({state:k,dispatch:D,validations:nt,dynamicFields:te}),Fr=X[0].id!=="emptyFormId"?X[0].id:f==null?void 0:f.value,{data:gt,isNudgeRequired:gn,enabledRef:kr}=Lp({formId:Fr,conversationId:m,inboxIds:w,enabled:!t});I.useEffect(()=>{gt&&pt(gt)},[gt,pt]),I.useEffect(()=>{f&&(c==null||c(f.value))},[f,c]);const{userGroupId:Gt}=qt()||{},{fetchConfig:wo,createConfig:Un}=_p({formFields:X[0].formFields,formId:X[0].id,formState:k,conversationId:m}),Pt=(tr=M==null?void 0:M.forms.find(ae=>ae.type==="edit"))==null?void 0:tr.id,{externalResourceId:Ln}=M??{},Io=[H,q,ce].includes(ee.LOADING),Kn=I.useMemo(()=>!pe||!_?null:_(),[pe,_]),mn=Qt();I.useEffect(()=>(pe&&T&&T(!0),()=>{pe&&T&&T(!1)}),[pe,T]),I.useEffect(()=>{mn($1(t?!(ne&&"values"in ne&&"values"in k&&pp(k.values,ne.values)):(e==null?void 0:e.fields_filled)!==void 0&&e.fields_filled>0))},[t,e,ne,k,mn]),I.useEffect(()=>(t&&ne&&D({type:vt.SET_FIELDS,payload:ne}),()=>{D({type:vt.SET_FIELDS,payload:{values:{}}})}),[t,D,ne]),I.useEffect(()=>{f!==null&&a(ae=>({...ae,object_type:f.label}))},[f,a]),I.useEffect(()=>{if(k.values){const ae=G1(X[0].formFields,k.values);a(_e=>({..._e,fields_filled:ae}))}},[k,X,a]),I.useEffect(()=>{if(n&&!t)return g(n);j&&j.length&&g(t&&Pt?j.find(ae=>ae.value===Pt)??null:ae=>ae||!Y?ae:j.length===1?j[0]:j.find($e=>!Y[$e.value].expandedView)??null)},[j,Y,t,Pt,n]);const Dr=()=>{g(h.current),x(!1),D({type:vt.RESET_STATE})},_o=(ae,_e)=>{Vt(ae,_e)},On=(ae,_e,$e)=>{if(_e.action==="clear"&&_e.name&&(Vt(_e.name,""),f!=null&&f.value&&_t(_e.name,z==null?void 0:z[f.value]),nt[_e.name].isRequired&&vo(_e.name,!0)),ae&&typeof ae=="object"&&"label"in ae&&typeof ae.label=="string"&&"value"in ae&&(typeof ae.value=="string"||typeof ae.value=="number")&&typeof _e.name<"u")if(_e.name==="form-object"){if(h.current={value:ae.value,label:ae.label},k.values&&ae.value!==(f==null?void 0:f.value)){const it=Object.values(k.values).filter(mt=>mt!=="").length;(Object.values(gt??{}).filter(mt=>!!mt).length>0?!pp(k.values,gt):it>0)?x(!0):Dr()}}else{let it=!1;$e&&(it=$e.isMultiSelect||!1);const St=!it&&"prefillValues"in ae&&ae.prefillValues,yn=it?[{value:ae.value,label:ae.label}]:{value:ae.value,label:ae.label};if(Vt(_e.name,yn),St)for(const mt in St)Vt(mt,St[mt]);f!=null&&f.value&&_t(_e.name,z==null?void 0:z[f.value])}},Nr=()=>{if(!$n()&&Pt&&(Y!=null&&Y[Pt])&&m&&Ln){const{connectorName:ae,title:_e}=M;C(G3,{connector_name:ae,card_title:_e,sm_ids:w,ug_id:Gt});const $e=Y[Pt].interfaceDetails;if(!$e||!ne)return;const{id:it,args:St={},previousArgs:yn={}}=$e,mt=rs(ne,yn),Fn=rs(k,St);mn(Ra({formId:String(Pt),conversationId:m,args:Fn,previousArgs:mt,externalResourceId:Ln,interfaceId:it,successCallback:()=>{s()}})).unwrap().then(()=>{var le;C(Z3,{connector_name:ae,card_title:_e,sm_ids:w,ug_id:Gt});const O=((le=X[0].formFields)==null?void 0:le.filter(Ce=>Ce.isCustomField))??[],Z=O.length>0,$=O.some(Ce=>k.values[Ce.name]);C(a5,{sm_ids:w,ug_id:l,connector_name:R==null?void 0:R.connectorName,form_object:R==null?void 0:R.name,object_type:f==null?void 0:f.label,has_custom_fields:Z,custom_fields_used:$})}).finally(()=>{mn(ao(null))})}},bn=()=>{if(!$n()&&f&&(Y!=null&&Y[f.value])&&m){const ae=Y==null?void 0:Y[f.value].interfaceDetails;if(!ae)return;const{id:_e,args:$e={}}=ae,it=rs(k,$e);mn(Na({formId:String(f.value),conversationId:m,args:it,interfaceId:_e,successCallback:()=>{s()}})).unwrap().then(()=>{var Fn;C(F3,{object_type:f});const St=((Fn=X[0].formFields)==null?void 0:Fn.filter(O=>O.isCustomField))??[],yn=St.length>0,mt=St.some(O=>k.values[O.name]);C(s5,{sm_ids:w,ug_id:l,connector_name:R==null?void 0:R.connectorName,form_object:R==null?void 0:R.name,object_type:f==null?void 0:f.label,has_custom_fields:yn,custom_fields_used:mt})})}},Rr=[{label:"Cancel",action:()=>x(!1),variant:"text"},{label:"Continue",action:Dr}],Mr=()=>{v(R==null?void 0:R.connectorId,{isEdit:!0,tabIndex:2,editCard:(R==null?void 0:R.cardId)??""}),C(o5,{sm_ids:w,ug_id:l,connector_name:R==null?void 0:R.connectorName,form_object:R==null?void 0:R.name})},Pr=()=>{kr.current=!0,i==null||i(!1)},us=L&&G&&(R==null?void 0:R.cardAccessMode)==="read_write",So=!b&&(w==null?void 0:w.length)>1&&Object.keys(gt??{}).length>0,To=d.jsxs(Pp,{className:pe?kp:"",children:[i&&d.jsx(eI,{open:r??!1,isEdit:t,fields:at,variables:N??[],title:(R==null?void 0:R.name)||"Map Fields",connectorLogo:(R==null?void 0:R.logoUrl)??"",formId:Fr,customFormArgsEnabled:(R==null?void 0:R.hasCustomFields)??!1,customFormArgsMap:(R==null?void 0:R.customFieldsArgs)??void 0,onSuccess:Pr,onClose:()=>i==null?void 0:i(!1)}),gn?d.jsx(lI,{onPrimaryClick:()=>{i==null||i(!0)}}):null,d.jsx(Fp,{shown:y,setShown:x,title:ov,description:sv,buttons:Rr}),pe?d.jsxs(dI,{children:[d.jsxs(u.Typography,{variant:"body_sm_medium",children:[t?"Edit":"Add"," to ",R.connectorName]}),d.jsx(u.Tooltip,{title:"Close Popup",placement:"bottom",children:d.jsx(u.IconButton,{onClick:o,children:d.jsx(fI,{src:np})})})]}):null,d.jsxs(Mp,{spacing:3,children:[!t&&!pe?d.jsx(yr,{type:"select",placeholder:J1,options:j,value:f,name:"form-object",selectChangeHandler:On,label:cv,labelSpacing:.5,validation:{isRequired:!0}}):null,d.jsx(N1,{showGlobalLoader:ce===ee.LOADING,formConfig:Ve,selectChangeHandler:On,inputChangeHandler:ht,checkboxChangeHandler:Qe,dateChangeHandler:An,tableChangeHandler:_o,onValidationError:vo,fieldsSpacing:3,labelSpacing:.5,fetchConfig:wo,createConfig:Un,values:k.values,validations:nt,...pe?{cols:q1,stackIndex:S.expandedForm}:null}),us?d.jsx(u.Stack,{marginTop:"28px",width:"100%",justifyContent:"center",children:d.jsx(u.Button,{variant:"text",startIcon:d.jsx(pI,{}),onClick:Mr,size:"small",children:N5})}):null]}),So?d.jsxs(uI,{children:[d.jsx(u.Typography,{variant:"body2",color:u.theme.palette.gray.gray1,children:gv}),d.jsx(u.IconButton,{onClick:()=>p(!0),children:d.jsx(u.icons.Close,{sx:{height:"16px",width:"16px",opacity:"0.8"}})})]}):null,d.jsxs(Rp,{children:[d.jsx(u.Button,{disabled:$n()||Io||!V,onClick:t?Nr:bn,size:"small",...pe?{style:{order:2}}:null,children:t?S5:_5}),d.jsx(jp,{variant:"outlined",color:"tertiary",size:"small",onClick:o,disabled:Io,children:qi})]})]});return pe&&Kn?je.createPortal(To,Kn):To},Np=e=>A.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:10,height:10,viewBox:"0 0 10 10",fill:"none",...e},A.createElement("path",{d:"M9.70785 5.66671H5.70785V9.66671H4.37451V5.66671H0.374512V4.33337H4.37451V0.333374H5.70785V4.33337H9.70785V5.66671Z",fill:"#4D596C"})),uI=u.styled(u.Stack)`
1404
+ `,uI=({onPrimaryClick:e})=>{const[t,n]=I.useState(()=>ra().getItem(Op)==="true");if(t)return null;const r=()=>{ra().setItem(Op,"true"),n(!0)};return d.jsxs(sI,{children:[d.jsx(aI,{children:d.jsx(oI,{style:{backgroundColor:"#FFDD57"}})}),d.jsxs(iI,{children:[d.jsxs(cI,{children:[d.jsx(u.Typography,{variant:"body2",sx:{fontWeight:600,color:u.theme.palette.gray.black,lineHeight:"18px"},children:"Autofill data with Map fields"}),d.jsx(u.Typography,{variant:"caption",color:u.theme.palette.gray.gray3,sx:{letterSpacing:"0.2px",lineHeight:"16px"},children:"Now you can configure what data to auto fill these fields"})]}),d.jsxs(lI,{children:[d.jsx(u.Button,{size:"small",onClick:e,children:"Checkout"}),d.jsx(u.Button,{variant:"text",size:"small",sx:{color:u.theme.palette.gray.gray2},onClick:r,children:"Dismiss"})]})]})]})},Fp=({setShown:e,shown:t,title:n,description:r,buttons:o})=>d.jsx(Er,{shown:t,setShown:e,showCloseButton:!0,children:d.jsxs(u.Stack,{width:"400px",padding:"20px",children:[d.jsx(u.Typography,{variant:"h2",marginBottom:"8px",children:n}),d.jsx(u.Stack,{gap:"4px",marginBottom:"20px",children:r.split(`
1405
+ `).map((s,a)=>d.jsx(u.Typography,{variant:"body2",children:s},a))}),d.jsx(u.Stack,{direction:"row",justifyContent:"flex-end",gap:"8px",children:o.map(s=>d.jsx(u.Button,{variant:s.variant,size:"medium",onClick:s.action,children:s.label},s.label.split(" ").join("_").toLowerCase()))})]})}),kp="connector-agent-expanded-write-form",Dp=({metaData:e,isEdit:t=!1,defaultOption:n,mapFormOpen:r,onClose:o,onCreateSuccess:s,setMetaData:a,setMapFormOpen:i,setCreateFormId:c})=>{var er,tr;const{userGroupId:l}=qt()||{},[f,g]=I.useState(null),[y,x]=I.useState(!1),[b,p]=I.useState(!1),h=I.useRef(null),{conversationId:m,availableFeatures:E,sendTrackingEvent:C,currentSmIds:w,connectorFunctions:{redirectToAdmin:v,getFormElement:_,toggleFormElement:T},stackingContext:S,isAdmin:L,variables:N}=I.useContext(We),[k,D]=Ep(),M=ve(up),j=ve(t?Hv:cp),J=ve(Zv),Y=ve(Wv),z=ve(Yv),H=ve(Jv),q=ve(qv),ne=ve(Qv),ce=ve($v),V=ve(dp),R=Y==null?void 0:Y[(f==null?void 0:f.value)??""],G=Ke(E,E5),W=(R==null?void 0:R.hasCustomFields)??!1,{customFieldsArgsPresent:U,customFieldsArgs:Q}=I.useMemo(()=>{if(!W)return{customFieldsArgsPresent:!1,customFieldsArgs:{}};const ae=Object.values((R==null?void 0:R.customFieldsArgs)??{}).every(it=>!!k.values[it]);if(!ae)return{customFieldsArgsPresent:!1,customFieldsArgs:{}};const _e=(R==null?void 0:R.customFieldsArgs)??{},$e=rs(k,_e);return{customFieldsArgsPresent:ae,customFieldsArgs:$e}},[W,k,R==null?void 0:R.customFieldsArgs]),re=W&&U&&G,{data:B}=rI({formId:String(f==null?void 0:f.value),args:Q,enabled:re}),te=I.useMemo(()=>re?B??[]:[],[re,B]),pe=R==null?void 0:R.expandedView,{formConfigs:X,formViewConfigs:Ve}=I.useMemo(()=>{if(f&&"value"in f&&J&&J[f.value]&&Array.isArray(J[f.value])){const _e=[...J[f.value],...te],$e=[{id:f.value,formFields:_e}];return{formConfigs:$e,formViewConfigs:pe?TE(_e,q1):$e}}const ae=[{id:"emptyFormId",formFields:[]}];return{formConfigs:ae,formViewConfigs:ae}},[J,te,f,pe]),Ge=(er=X[0])==null?void 0:er.formFields,at=I.useMemo(()=>(Ge??[]).filter(_e=>!_e.isFieldCustom),[Ge]),nt=I.useMemo(()=>{var _e;const ae=((_e=X==null?void 0:X[0])==null?void 0:_e.formFields)||[];return nl({formFields:ae})},[X]),{setValue:Vt,setFormDefaults:pt,inputChangeHandler:ht,checkboxChangeHandler:Qe,dateChangeHandler:An,clearDependentFields:_t,handleValidationError:vo,isErrorInValidations:$n}=vp({state:k,dispatch:D,validations:nt,dynamicFields:te}),Fr=X[0].id!=="emptyFormId"?X[0].id:f==null?void 0:f.value,{data:gt,isNudgeRequired:gn,enabledRef:kr}=Lp({formId:Fr,conversationId:m,inboxIds:w,enabled:!t});I.useEffect(()=>{gt&&pt(gt)},[gt,pt]),I.useEffect(()=>{f&&(c==null||c(f.value))},[f,c]);const{userGroupId:Gt}=qt()||{},{fetchConfig:wo,createConfig:Un}=_p({formFields:X[0].formFields,formId:X[0].id,formState:k,conversationId:m}),Pt=(tr=M==null?void 0:M.forms.find(ae=>ae.type==="edit"))==null?void 0:tr.id,{externalResourceId:Ln}=M??{},Io=[H,q,ce].includes(ee.LOADING),Kn=I.useMemo(()=>!pe||!_?null:_(),[pe,_]),mn=Qt();I.useEffect(()=>(pe&&T&&T(!0),()=>{pe&&T&&T(!1)}),[pe,T]),I.useEffect(()=>{mn($1(t?!(ne&&"values"in ne&&"values"in k&&pp(k.values,ne.values)):(e==null?void 0:e.fields_filled)!==void 0&&e.fields_filled>0))},[t,e,ne,k,mn]),I.useEffect(()=>(t&&ne&&D({type:vt.SET_FIELDS,payload:ne}),()=>{D({type:vt.SET_FIELDS,payload:{values:{}}})}),[t,D,ne]),I.useEffect(()=>{f!==null&&a(ae=>({...ae,object_type:f.label}))},[f,a]),I.useEffect(()=>{if(k.values){const ae=G1(X[0].formFields,k.values);a(_e=>({..._e,fields_filled:ae}))}},[k,X,a]),I.useEffect(()=>{if(n&&!t)return g(n);j&&j.length&&g(t&&Pt?j.find(ae=>ae.value===Pt)??null:ae=>ae||!Y?ae:j.length===1?j[0]:j.find($e=>!Y[$e.value].expandedView)??null)},[j,Y,t,Pt,n]);const Dr=()=>{g(h.current),x(!1),D({type:vt.RESET_STATE})},_o=(ae,_e)=>{Vt(ae,_e)},On=(ae,_e,$e)=>{if(_e.action==="clear"&&_e.name&&(Vt(_e.name,""),f!=null&&f.value&&_t(_e.name,z==null?void 0:z[f.value]),nt[_e.name].isRequired&&vo(_e.name,!0)),ae&&typeof ae=="object"&&"label"in ae&&typeof ae.label=="string"&&"value"in ae&&(typeof ae.value=="string"||typeof ae.value=="number")&&typeof _e.name<"u")if(_e.name==="form-object"){if(h.current={value:ae.value,label:ae.label},k.values&&ae.value!==(f==null?void 0:f.value)){const it=Object.values(k.values).filter(mt=>mt!=="").length;(Object.values(gt??{}).filter(mt=>!!mt).length>0?!pp(k.values,gt):it>0)?x(!0):Dr()}}else{let it=!1;$e&&(it=$e.isMultiSelect||!1);const St=!it&&"prefillValues"in ae&&ae.prefillValues,yn=it?[{value:ae.value,label:ae.label}]:{value:ae.value,label:ae.label};if(Vt(_e.name,yn),St)for(const mt in St)Vt(mt,St[mt]);f!=null&&f.value&&_t(_e.name,z==null?void 0:z[f.value])}},Nr=()=>{if(!$n()&&Pt&&(Y!=null&&Y[Pt])&&m&&Ln){const{connectorName:ae,title:_e}=M;C(G3,{connector_name:ae,card_title:_e,sm_ids:w,ug_id:Gt});const $e=Y[Pt].interfaceDetails;if(!$e||!ne)return;const{id:it,args:St={},previousArgs:yn={}}=$e,mt=rs(ne,yn),Fn=rs(k,St);mn(Ra({formId:String(Pt),conversationId:m,args:Fn,previousArgs:mt,externalResourceId:Ln,interfaceId:it,successCallback:()=>{s()}})).unwrap().then(()=>{var le;C(Z3,{connector_name:ae,card_title:_e,sm_ids:w,ug_id:Gt});const O=((le=X[0].formFields)==null?void 0:le.filter(Ce=>Ce.isFieldCustom))??[],Z=O.length>0,$=O.some(Ce=>k.values[Ce.name]);C(a5,{sm_ids:w,ug_id:l,connector_name:R==null?void 0:R.connectorName,form_object:R==null?void 0:R.name,object_type:f==null?void 0:f.label,has_custom_fields:Z,custom_fields_used:$})}).finally(()=>{mn(ao(null))})}},bn=()=>{if(!$n()&&f&&(Y!=null&&Y[f.value])&&m){const ae=Y==null?void 0:Y[f.value].interfaceDetails;if(!ae)return;const{id:_e,args:$e={}}=ae,it=rs(k,$e);mn(Na({formId:String(f.value),conversationId:m,args:it,interfaceId:_e,successCallback:()=>{s()}})).unwrap().then(()=>{var Fn;C(F3,{object_type:f});const St=((Fn=X[0].formFields)==null?void 0:Fn.filter(O=>O.isFieldCustom))??[],yn=St.length>0,mt=St.some(O=>k.values[O.name]);C(s5,{sm_ids:w,ug_id:l,connector_name:R==null?void 0:R.connectorName,form_object:R==null?void 0:R.name,object_type:f==null?void 0:f.label,has_custom_fields:yn,custom_fields_used:mt})})}},Rr=[{label:"Cancel",action:()=>x(!1),variant:"text"},{label:"Continue",action:Dr}],Mr=()=>{v(R==null?void 0:R.connectorId,{isEdit:!0,tabIndex:2,editCard:(R==null?void 0:R.cardId)??""}),C(o5,{sm_ids:w,ug_id:l,connector_name:R==null?void 0:R.connectorName,form_object:R==null?void 0:R.name})},Pr=()=>{kr.current=!0,i==null||i(!1)},us=L&&G&&(R==null?void 0:R.cardAccessMode)==="read_write",So=!b&&(w==null?void 0:w.length)>1&&Object.keys(gt??{}).length>0,To=d.jsxs(Pp,{className:pe?kp:"",children:[i&&d.jsx(tI,{open:r??!1,isEdit:t,fields:at,variables:N??[],title:(R==null?void 0:R.name)||"Map Fields",connectorLogo:(R==null?void 0:R.logoUrl)??"",formId:Fr,customFormArgsEnabled:(R==null?void 0:R.hasCustomFields)??!1,customFormArgsMap:(R==null?void 0:R.customFieldsArgs)??void 0,onSuccess:Pr,onClose:()=>i==null?void 0:i(!1)}),gn?d.jsx(uI,{onPrimaryClick:()=>{i==null||i(!0)}}):null,d.jsx(Fp,{shown:y,setShown:x,title:sv,description:av,buttons:Rr}),pe?d.jsxs(fI,{children:[d.jsxs(u.Typography,{variant:"body_sm_medium",children:[t?"Edit":"Add"," to ",R.connectorName]}),d.jsx(u.Tooltip,{title:"Close Popup",placement:"bottom",children:d.jsx(u.IconButton,{onClick:o,children:d.jsx(pI,{src:np})})})]}):null,d.jsxs(Mp,{spacing:3,children:[!t&&!pe?d.jsx(yr,{type:"select",placeholder:J1,options:j,value:f,name:"form-object",selectChangeHandler:On,label:lv,labelSpacing:.5,validation:{isRequired:!0}}):null,d.jsx(N1,{showGlobalLoader:ce===ee.LOADING,formConfig:Ve,selectChangeHandler:On,inputChangeHandler:ht,checkboxChangeHandler:Qe,dateChangeHandler:An,tableChangeHandler:_o,onValidationError:vo,fieldsSpacing:3,labelSpacing:.5,fetchConfig:wo,createConfig:Un,values:k.values,validations:nt,...pe?{cols:q1,stackIndex:S.expandedForm}:null}),us?d.jsx(u.Stack,{marginTop:"28px",width:"100%",justifyContent:"center",children:d.jsx(u.Button,{variant:"text",startIcon:d.jsx(hI,{}),onClick:Mr,size:"small",children:N5})}):null]}),So?d.jsxs(dI,{children:[d.jsx(u.Typography,{variant:"body2",color:u.theme.palette.gray.gray1,children:mv}),d.jsx(u.IconButton,{onClick:()=>p(!0),children:d.jsx(u.icons.Close,{sx:{height:"16px",width:"16px",opacity:"0.8"}})})]}):null,d.jsxs(Rp,{children:[d.jsx(u.Button,{disabled:$n()||Io||!V,onClick:t?Nr:bn,size:"small",...pe?{style:{order:2}}:null,children:t?S5:_5}),d.jsx(jp,{variant:"outlined",color:"tertiary",size:"small",onClick:o,disabled:Io,children:qi})]})]});return pe&&Kn?je.createPortal(To,Kn):To},Np=e=>A.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:10,height:10,viewBox:"0 0 10 10",fill:"none",...e},A.createElement("path",{d:"M9.70785 5.66671H5.70785V9.66671H4.37451V5.66671H0.374512V4.33337H4.37451V0.333374H5.70785V4.33337H9.70785V5.66671Z",fill:"#4D596C"})),dI=u.styled(u.Stack)`
1396
1406
  box-sizing: border-box;
1397
1407
  width: 100%;
1398
1408
  flex-flow: row nowrap;
@@ -1452,7 +1462,7 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
1452
1462
  color: ${u.theme.palette.purple.primary} !important;
1453
1463
  border: 1px solid ${u.theme.palette.purple.primary} !important;
1454
1464
  }
1455
- `,dI=u.styled(u.Stack)`
1465
+ `,fI=u.styled(u.Stack)`
1456
1466
  box-sizing: border-box;
1457
1467
  flex-flow: row nowrap;
1458
1468
  justify-content: space-between;
@@ -1464,7 +1474,7 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
1464
1474
  background-color: var(--form-background-color, inherit);
1465
1475
  padding-top: 20px;
1466
1476
  padding-bottom: 10px;
1467
- `,fI=u.styled("img")`
1477
+ `,pI=u.styled("img")`
1468
1478
  height: 16px;
1469
1479
  width: 16px;
1470
1480
  `;u.styled(u.Button)`
@@ -1472,12 +1482,12 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
1472
1482
  &:hover {
1473
1483
  color: ${u.theme.palette.purple.primary};
1474
1484
  }
1475
- `;const pI=u.styled(Np)`
1485
+ `;const hI=u.styled(Np)`
1476
1486
  fill: ${u.theme.palette.purple.primary};
1477
1487
  path {
1478
1488
  fill: ${u.theme.palette.purple.primary} !important;
1479
1489
  }
1480
- `,hI=({setOpenTaskLinking:e,onLinkingSuccess:t})=>{const n=Qt(),r=ve(bp),o=ve(yp),s=ve(Zv),a=ve(lp),[i,c]=I.useState(!1),[l,f]=I.useState(null),[g,y]=I.useState(""),[x,b]=I.useState({}),{conversationId:p,sendTrackingEvent:h,email:m}=I.useContext(We);I.useEffect(()=>{a&&a.length&&f(a[0])},[a]);const E={externalResourceId:g},C=o===ee.LOADING,w=s===ee.LOADING,v=()=>{!i&&l&&"value"in l&&(h(N3,{object_type:l.label}),n(so({id:String(l==null?void 0:l.value),args:E})).unwrap().catch(D=>{(D==null?void 0:D.status)===400?Ie({message:Y1,type:Ye}):Ie({message:$E,type:Ye})})),c(D=>!D)},_=()=>{l&&"value"in l&&p&&n(Pa({id:String(l.value),externalResourceId:g,conversationId:p,email:m})).unwrap().then(()=>{h(k3,{object_type:l.label,input_type:g}),Ie({message:KE,type:Ut}),e(!1),t()}).catch(D=>{(D==null?void 0:D.status)===400?Ie({message:Y1,type:Ye}):(D==null?void 0:D.status)===409?Ie({message:UE,type:Ye}):Ie({message:ev,type:Ye})})},T=()=>{e(!1),c(!1)},S=(D,M)=>{D&&typeof D=="object"&&"label"in D&&typeof D.label=="string"&&"value"in D&&(typeof D.value=="string"||typeof D.value=="number")&&typeof M.name<"u"&&(f({value:D.value,label:D.label}),y(""))},L=D=>{D.stopPropagation();const{value:M}=(D==null?void 0:D.target)||{};y(M),c(!1)},N=(D,M)=>{b(j=>({...j,[D]:!!M}))},k=()=>Object.keys(x).filter(M=>x[M]).length>0;return d.jsxs(Pp,{children:[d.jsxs(Mp,{spacing:3,children:[d.jsx(yr,{type:"select",placeholder:J1,options:a,value:l,name:"form-object",selectChangeHandler:S,label:lv,labelSpacing:.5,validation:{isRequired:!0},onValidationError:N}),d.jsx(yr,{type:"text",placeholder:uv,value:g,name:"resourceId",inputChangeHandler:L,label:dv,labelSpacing:.5,validation:{isRequired:!0,validate:I6()},onValidationError:N}),i?d.jsx(Cp,{cardData:r,cardDataApiStatus:o,objectToLink:String((l==null?void 0:l.value)||""),args:E}):null,d.jsx(zw,{fullWidth:!0,disabled:k()||C,color:"tertiary",variant:"outlined",size:"small",onClick:v,children:i?bb:mb})]}),d.jsxs(Rp,{children:[d.jsx(u.Button,{onClick:_,disabled:k()||w,size:"small",children:Ld}),d.jsx(jp,{color:"tertiary",variant:"outlined",onClick:T,disabled:w,size:"small",children:qi})]})]})},gI=({formId:e,enabled:t,conversationId:n,inboxIds:r,setMapFormOpen:o})=>{const{isSuccess:s}=Lp({formId:e,conversationId:n,inboxIds:r,enabled:t,fetchOnMount:!1});return s?d.jsx(u.Typography,{variant:"body2",color:"primary.main",fontSize:14,fontWeight:500,lineHeight:"20px",paddingRight:"8px",onClick:()=>o(!0),style:{cursor:"pointer"},children:hv}):null},mI=u.styled(u.Button)`
1490
+ `,gI=({setOpenTaskLinking:e,onLinkingSuccess:t})=>{const n=Qt(),r=ve(bp),o=ve(yp),s=ve(Xv),a=ve(lp),[i,c]=I.useState(!1),[l,f]=I.useState(null),[g,y]=I.useState(""),[x,b]=I.useState({}),{conversationId:p,sendTrackingEvent:h,email:m}=I.useContext(We);I.useEffect(()=>{a&&a.length&&f(a[0])},[a]);const E={externalResourceId:g},C=o===ee.LOADING,w=s===ee.LOADING,v=()=>{!i&&l&&"value"in l&&(h(N3,{object_type:l.label}),n(so({id:String(l==null?void 0:l.value),args:E})).unwrap().catch(D=>{(D==null?void 0:D.status)===400?Ie({message:Y1,type:Ye}):Ie({message:UE,type:Ye})})),c(D=>!D)},_=()=>{l&&"value"in l&&p&&n(Pa({id:String(l.value),externalResourceId:g,conversationId:p,email:m})).unwrap().then(()=>{h(k3,{object_type:l.label,input_type:g}),Ie({message:ev,type:Ut}),e(!1),t()}).catch(D=>{(D==null?void 0:D.status)===400?Ie({message:Y1,type:Ye}):(D==null?void 0:D.status)===409?Ie({message:KE,type:Ye}):Ie({message:tv,type:Ye})})},T=()=>{e(!1),c(!1)},S=(D,M)=>{D&&typeof D=="object"&&"label"in D&&typeof D.label=="string"&&"value"in D&&(typeof D.value=="string"||typeof D.value=="number")&&typeof M.name<"u"&&(f({value:D.value,label:D.label}),y(""))},L=D=>{D.stopPropagation();const{value:M}=(D==null?void 0:D.target)||{};y(M),c(!1)},N=(D,M)=>{b(j=>({...j,[D]:!!M}))},k=()=>Object.keys(x).filter(M=>x[M]).length>0;return d.jsxs(Pp,{children:[d.jsxs(Mp,{spacing:3,children:[d.jsx(yr,{type:"select",placeholder:J1,options:a,value:l,name:"form-object",selectChangeHandler:S,label:uv,labelSpacing:.5,validation:{isRequired:!0},onValidationError:N}),d.jsx(yr,{type:"text",placeholder:dv,value:g,name:"resourceId",inputChangeHandler:L,label:fv,labelSpacing:.5,validation:{isRequired:!0,validate:I6()},onValidationError:N}),i?d.jsx(Cp,{cardData:r,cardDataApiStatus:o,objectToLink:String((l==null?void 0:l.value)||""),args:E}):null,d.jsx(Yw,{fullWidth:!0,disabled:k()||C,color:"tertiary",variant:"outlined",size:"small",onClick:v,children:i?bb:mb})]}),d.jsxs(Rp,{children:[d.jsx(u.Button,{onClick:_,disabled:k()||w,size:"small",children:Ld}),d.jsx(jp,{color:"tertiary",variant:"outlined",onClick:T,disabled:w,size:"small",children:qi})]})]})},mI=({formId:e,enabled:t,conversationId:n,inboxIds:r,setMapFormOpen:o})=>{const{isSuccess:s}=Lp({formId:e,conversationId:n,inboxIds:r,enabled:t,fetchOnMount:!1});return s?d.jsx(u.Typography,{variant:"body2",color:"primary.main",fontSize:14,fontWeight:500,lineHeight:"20px",paddingRight:"8px",onClick:()=>o(!0),style:{cursor:"pointer"},children:gv}):null},bI=u.styled(u.Button)`
1481
1491
  &:hover {
1482
1492
  background-color: #e3e9ff !important;
1483
1493
  color: ${u.theme.palette.purple.primary} !important;
@@ -1491,14 +1501,14 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
1491
1501
  & .content__btn {
1492
1502
  margin-left: 8px;
1493
1503
  }
1494
- `,bI=u.styled(u.Button)`
1504
+ `,yI=u.styled(u.Button)`
1495
1505
  & path {
1496
1506
  fill: #fff;
1497
1507
  }
1498
1508
  & .content__btn {
1499
1509
  margin-left: 8px;
1500
1510
  }
1501
- `,yI=e=>A.createElement("svg",{width:20,height:21,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},A.createElement("mask",{id:"mask0_4649_80352",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:20,height:21},A.createElement("rect",{y:.320312,width:20,height:20,fill:"#D9D9D9"})),A.createElement("g",{mask:"url(#mask0_4649_80352)"},A.createElement("path",{d:"M9.16797 14.4873H10.8346V11.154H14.168V9.4873H10.8346V6.15397H9.16797V9.4873H5.83464V11.154H9.16797V14.4873ZM10.0013 18.654C8.84852 18.654 7.76519 18.4352 6.7513 17.9977C5.73741 17.5602 4.85547 16.9665 4.10547 16.2165C3.35547 15.4665 2.76172 14.5845 2.32422 13.5706C1.88672 12.5567 1.66797 11.4734 1.66797 10.3206C1.66797 9.16786 1.88672 8.08453 2.32422 7.07064C2.76172 6.05675 3.35547 5.1748 4.10547 4.4248C4.85547 3.6748 5.73741 3.08105 6.7513 2.64355C7.76519 2.20605 8.84852 1.9873 10.0013 1.9873C11.1541 1.9873 12.2374 2.20605 13.2513 2.64355C14.2652 3.08105 15.1471 3.6748 15.8971 4.4248C16.6471 5.1748 17.2409 6.05675 17.6784 7.07064C18.1159 8.08453 18.3346 9.16786 18.3346 10.3206C18.3346 11.4734 18.1159 12.5567 17.6784 13.5706C17.2409 14.5845 16.6471 15.4665 15.8971 16.2165C15.1471 16.9665 14.2652 17.5602 13.2513 17.9977C12.2374 18.4352 11.1541 18.654 10.0013 18.654ZM10.0013 16.9873C11.8624 16.9873 13.4388 16.3415 14.7305 15.0498C16.0221 13.7581 16.668 12.1817 16.668 10.3206C16.668 8.45953 16.0221 6.88314 14.7305 5.59147C13.4388 4.2998 11.8624 3.65397 10.0013 3.65397C8.14019 3.65397 6.5638 4.2998 5.27214 5.59147C3.98047 6.88314 3.33464 8.45953 3.33464 10.3206C3.33464 12.1817 3.98047 13.7581 5.27214 15.0498C6.5638 16.3415 8.14019 16.9873 10.0013 16.9873Z",fill:"#4D596C"}))),CI=e=>A.createElement("svg",{width:20,height:21,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},A.createElement("path",{d:"M14.3462 8.73757C14.0406 8.43198 13.5451 8.43198 13.2395 8.73757C12.9339 9.04316 12.9339 9.53863 13.2395 9.84422L14.3462 8.73757ZM15.2392 10.7372L15.7925 10.1839L15.2392 10.7372ZM16.2377 13.1478L15.4552 13.1478L16.2377 13.1478ZM15.2392 15.5584L14.6859 15.0051L15.2392 15.5584ZM10.418 15.5584L9.86469 16.1118L10.418 15.5584ZM9.52499 13.5588C9.2194 13.2532 8.72393 13.2532 8.41834 13.5588C8.11275 13.8643 8.11275 14.3598 8.41834 14.6654L9.52499 13.5588ZM5.52477 11.7731C5.83036 12.0787 6.32583 12.0787 6.63142 11.7731C6.93701 11.4675 6.93701 10.972 6.63142 10.6665L5.52477 11.7731ZM9.45292 4.95224L10.0062 4.39892L9.45292 4.95224ZM10.346 6.95192C10.6515 7.25752 11.147 7.25752 11.4526 6.95192C11.7582 6.64633 11.7582 6.15087 11.4526 5.84527L10.346 6.95192ZM13.2395 9.84422L14.6859 11.2906L15.7925 10.1839L14.3462 8.73757L13.2395 9.84422ZM14.6859 11.2906C15.1785 11.7832 15.4552 12.4512 15.4552 13.1478L17.0202 13.1478C17.0202 12.0362 16.5786 10.97 15.7925 10.1839L14.6859 11.2906ZM15.4552 13.1478C15.4552 13.8445 15.1785 14.5125 14.6859 15.0051L15.7925 16.1118C16.5786 15.3257 17.0202 14.2595 17.0202 13.1478L15.4552 13.1478ZM14.6859 15.0051C13.6601 16.0308 11.9971 16.0308 10.9713 15.0051L9.86469 16.1118C11.5016 17.7487 14.1556 17.7487 15.7925 16.1118L14.6859 15.0051ZM10.9713 15.0051L9.52499 13.5588L8.41834 14.6654L9.86469 16.1118L10.9713 15.0051ZM6.63142 10.6665L5.18507 9.2201L4.07842 10.3268L5.52477 11.7731L6.63142 10.6665ZM5.18507 9.2201C4.69249 8.72752 4.41576 8.05944 4.41576 7.36283H2.85072C2.85072 8.47452 3.29234 9.54067 4.07842 10.3268L5.18507 9.2201ZM4.41576 7.36283C4.41576 6.66622 4.69249 5.99815 5.18507 5.50557L4.07842 4.39892C3.29234 5.185 2.85072 6.25115 2.85072 7.36283H4.41576ZM5.18507 5.50557C6.21081 4.47983 7.87386 4.47983 8.8996 5.50557L10.0062 4.39892C8.36932 2.76199 5.71534 2.76199 4.07842 4.39892L5.18507 5.50557ZM8.8996 5.50557L10.346 6.95192L11.4526 5.84527L10.0062 4.39892L8.8996 5.50557Z",fill:"#4D596C"}),A.createElement("rect",{x:6.36328,y:7.91895,width:1.66667,height:8.33333,rx:.833333,transform:"rotate(-45 6.36328 7.91895)",fill:"#4D596C"})),xI=({onCreateClick:e,onLinkClick:t,haveCreateObjects:n,haveLinkObjects:r})=>d.jsxs(u.Stack,{gap:2,marginTop:"12px",children:[d.jsx(u.Typography,{variant:"body2",color:u.theme.palette.gray.gray1,children:rv}),d.jsxs(u.Stack,{gap:"12px",children:[n?d.jsxs(bI,{fullWidth:!0,onClick:e,size:"medium",children:[d.jsx(yI,{}),d.jsx("span",{className:"content__btn",children:Qi})]}):null,r?d.jsxs(mI,{fullWidth:!0,color:"tertiary",variant:"outlined",onClick:t,size:"medium",children:[d.jsx(CI,{}),d.jsx("span",{className:"content__btn",children:kd})]}):null]})]}),EI=e=>e.write.searchObjectList,Bp=e=>e.write.objectDict,vI=e=>e.write.formFields,wI=e=>e.write.dependentFieldsMap,II="Search in Connectors",_I="Search in Apps",SI="Start typing to search..",TI="Smart search suggestions",AI=":count result:countSuffix found for :searchObject in :connectorName",LI="Back to search results",OI="No search results found",Vp=e=>A.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"#97A3B7",xmlns:"http://www.w3.org/2000/svg",...e},A.createElement("g",{id:"icons/Actions/Search"},A.createElement("path",{id:"Shape",fillRule:"evenodd",clipRule:"evenodd",d:"M8.57633 7.54717H8.03431L7.8422 7.36192C8.51458 6.57976 8.91938 5.56432 8.91938 4.45969C8.91938 1.99657 6.92281 0 4.45969 0C1.99657 0 0 1.99657 0 4.45969C0 6.92281 1.99657 8.91938 4.45969 8.91938C5.56432 8.91938 6.57976 8.51458 7.36192 7.8422L7.54717 8.03431V8.57633L10.9777 12L12 10.9777L8.57633 7.54717ZM4.45969 7.54717C2.75129 7.54717 1.37221 6.1681 1.37221 4.45969C1.37221 2.75129 2.75129 1.37221 4.45969 1.37221C6.1681 1.37221 7.54717 2.75129 7.54717 4.45969C7.54717 6.1681 6.1681 7.54717 4.45969 7.54717Z"}))),FI=u.styled(u.Stack)`
1511
+ `,CI=e=>A.createElement("svg",{width:20,height:21,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},A.createElement("mask",{id:"mask0_4649_80352",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:20,height:21},A.createElement("rect",{y:.320312,width:20,height:20,fill:"#D9D9D9"})),A.createElement("g",{mask:"url(#mask0_4649_80352)"},A.createElement("path",{d:"M9.16797 14.4873H10.8346V11.154H14.168V9.4873H10.8346V6.15397H9.16797V9.4873H5.83464V11.154H9.16797V14.4873ZM10.0013 18.654C8.84852 18.654 7.76519 18.4352 6.7513 17.9977C5.73741 17.5602 4.85547 16.9665 4.10547 16.2165C3.35547 15.4665 2.76172 14.5845 2.32422 13.5706C1.88672 12.5567 1.66797 11.4734 1.66797 10.3206C1.66797 9.16786 1.88672 8.08453 2.32422 7.07064C2.76172 6.05675 3.35547 5.1748 4.10547 4.4248C4.85547 3.6748 5.73741 3.08105 6.7513 2.64355C7.76519 2.20605 8.84852 1.9873 10.0013 1.9873C11.1541 1.9873 12.2374 2.20605 13.2513 2.64355C14.2652 3.08105 15.1471 3.6748 15.8971 4.4248C16.6471 5.1748 17.2409 6.05675 17.6784 7.07064C18.1159 8.08453 18.3346 9.16786 18.3346 10.3206C18.3346 11.4734 18.1159 12.5567 17.6784 13.5706C17.2409 14.5845 16.6471 15.4665 15.8971 16.2165C15.1471 16.9665 14.2652 17.5602 13.2513 17.9977C12.2374 18.4352 11.1541 18.654 10.0013 18.654ZM10.0013 16.9873C11.8624 16.9873 13.4388 16.3415 14.7305 15.0498C16.0221 13.7581 16.668 12.1817 16.668 10.3206C16.668 8.45953 16.0221 6.88314 14.7305 5.59147C13.4388 4.2998 11.8624 3.65397 10.0013 3.65397C8.14019 3.65397 6.5638 4.2998 5.27214 5.59147C3.98047 6.88314 3.33464 8.45953 3.33464 10.3206C3.33464 12.1817 3.98047 13.7581 5.27214 15.0498C6.5638 16.3415 8.14019 16.9873 10.0013 16.9873Z",fill:"#4D596C"}))),xI=e=>A.createElement("svg",{width:20,height:21,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},A.createElement("path",{d:"M14.3462 8.73757C14.0406 8.43198 13.5451 8.43198 13.2395 8.73757C12.9339 9.04316 12.9339 9.53863 13.2395 9.84422L14.3462 8.73757ZM15.2392 10.7372L15.7925 10.1839L15.2392 10.7372ZM16.2377 13.1478L15.4552 13.1478L16.2377 13.1478ZM15.2392 15.5584L14.6859 15.0051L15.2392 15.5584ZM10.418 15.5584L9.86469 16.1118L10.418 15.5584ZM9.52499 13.5588C9.2194 13.2532 8.72393 13.2532 8.41834 13.5588C8.11275 13.8643 8.11275 14.3598 8.41834 14.6654L9.52499 13.5588ZM5.52477 11.7731C5.83036 12.0787 6.32583 12.0787 6.63142 11.7731C6.93701 11.4675 6.93701 10.972 6.63142 10.6665L5.52477 11.7731ZM9.45292 4.95224L10.0062 4.39892L9.45292 4.95224ZM10.346 6.95192C10.6515 7.25752 11.147 7.25752 11.4526 6.95192C11.7582 6.64633 11.7582 6.15087 11.4526 5.84527L10.346 6.95192ZM13.2395 9.84422L14.6859 11.2906L15.7925 10.1839L14.3462 8.73757L13.2395 9.84422ZM14.6859 11.2906C15.1785 11.7832 15.4552 12.4512 15.4552 13.1478L17.0202 13.1478C17.0202 12.0362 16.5786 10.97 15.7925 10.1839L14.6859 11.2906ZM15.4552 13.1478C15.4552 13.8445 15.1785 14.5125 14.6859 15.0051L15.7925 16.1118C16.5786 15.3257 17.0202 14.2595 17.0202 13.1478L15.4552 13.1478ZM14.6859 15.0051C13.6601 16.0308 11.9971 16.0308 10.9713 15.0051L9.86469 16.1118C11.5016 17.7487 14.1556 17.7487 15.7925 16.1118L14.6859 15.0051ZM10.9713 15.0051L9.52499 13.5588L8.41834 14.6654L9.86469 16.1118L10.9713 15.0051ZM6.63142 10.6665L5.18507 9.2201L4.07842 10.3268L5.52477 11.7731L6.63142 10.6665ZM5.18507 9.2201C4.69249 8.72752 4.41576 8.05944 4.41576 7.36283H2.85072C2.85072 8.47452 3.29234 9.54067 4.07842 10.3268L5.18507 9.2201ZM4.41576 7.36283C4.41576 6.66622 4.69249 5.99815 5.18507 5.50557L4.07842 4.39892C3.29234 5.185 2.85072 6.25115 2.85072 7.36283H4.41576ZM5.18507 5.50557C6.21081 4.47983 7.87386 4.47983 8.8996 5.50557L10.0062 4.39892C8.36932 2.76199 5.71534 2.76199 4.07842 4.39892L5.18507 5.50557ZM8.8996 5.50557L10.346 6.95192L11.4526 5.84527L10.0062 4.39892L8.8996 5.50557Z",fill:"#4D596C"}),A.createElement("rect",{x:6.36328,y:7.91895,width:1.66667,height:8.33333,rx:.833333,transform:"rotate(-45 6.36328 7.91895)",fill:"#4D596C"})),EI=({onCreateClick:e,onLinkClick:t,haveCreateObjects:n,haveLinkObjects:r})=>d.jsxs(u.Stack,{gap:2,marginTop:"12px",children:[d.jsx(u.Typography,{variant:"body2",color:u.theme.palette.gray.gray1,children:ov}),d.jsxs(u.Stack,{gap:"12px",children:[n?d.jsxs(yI,{fullWidth:!0,onClick:e,size:"medium",children:[d.jsx(CI,{}),d.jsx("span",{className:"content__btn",children:Qi})]}):null,r?d.jsxs(bI,{fullWidth:!0,color:"tertiary",variant:"outlined",onClick:t,size:"medium",children:[d.jsx(xI,{}),d.jsx("span",{className:"content__btn",children:kd})]}):null]})]}),vI=e=>e.write.searchObjectList,Bp=e=>e.write.objectDict,wI=e=>e.write.formFields,II=e=>e.write.dependentFieldsMap,_I="Search in Connectors",SI="Search in Apps",TI="Start typing to search..",AI="Smart search suggestions",LI=":count result:countSuffix found for :searchObject in :connectorName",OI="Back to search results",FI="No search results found",Vp=e=>A.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"#97A3B7",xmlns:"http://www.w3.org/2000/svg",...e},A.createElement("g",{id:"icons/Actions/Search"},A.createElement("path",{id:"Shape",fillRule:"evenodd",clipRule:"evenodd",d:"M8.57633 7.54717H8.03431L7.8422 7.36192C8.51458 6.57976 8.91938 5.56432 8.91938 4.45969C8.91938 1.99657 6.92281 0 4.45969 0C1.99657 0 0 1.99657 0 4.45969C0 6.92281 1.99657 8.91938 4.45969 8.91938C5.56432 8.91938 6.57976 8.51458 7.36192 7.8422L7.54717 8.03431V8.57633L10.9777 12L12 10.9777L8.57633 7.54717ZM4.45969 7.54717C2.75129 7.54717 1.37221 6.1681 1.37221 4.45969C1.37221 2.75129 2.75129 1.37221 4.45969 1.37221C6.1681 1.37221 7.54717 2.75129 7.54717 4.45969C7.54717 6.1681 6.1681 7.54717 4.45969 7.54717Z"}))),kI=u.styled(u.Stack)`
1502
1512
  flex-flow: row nowrap;
1503
1513
  align-items: center;
1504
1514
  column-gap: 12px;
@@ -1508,28 +1518,28 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
1508
1518
  &:hover {
1509
1519
  background-color: ${({isSelected:e})=>e?"rgb(80, 109, 255, 0.12)":"rgba(0, 0, 0, 0.04)"};
1510
1520
  }
1511
- `,kI=u.styled("img")`
1521
+ `,DI=u.styled("img")`
1512
1522
  flex-shrink: 0;
1513
1523
  display: block;
1514
1524
  width: 24px;
1515
1525
  height: 24px;
1516
1526
  border-radius: 50%;
1517
- `,Gp=({data:e,suggestionType:t="basic",isSelected:n=!1,onSelect:r})=>{const o=Qt(),{sendTrackingEvent:s,currentSmIds:a}=I.useContext(We),{label:i,description:c,avatarUrl:l,connectorName:f}=e,g=()=>{s(q3,{suggestion_type:t,search_keyword:i,sm_ids:a,connector_name:f}),r(e,t),o(jE(t))};return d.jsxs(FI,{isSelected:n,onClick:g,children:[d.jsx(kI,{src:l,alt:"option"}),d.jsxs(u.Stack,{children:[d.jsx(u.Typography,{color:u.theme.palette.gray.gray1,children:i}),d.jsx(u.Typography,{color:u.theme.palette.gray.gray3,fontSize:"12px",children:c})]})]})},DI=u.styled(u.Stack)`
1527
+ `,Gp=({data:e,suggestionType:t="basic",isSelected:n=!1,onSelect:r})=>{const o=Qt(),{sendTrackingEvent:s,currentSmIds:a}=I.useContext(We),{label:i,description:c,avatarUrl:l,connectorName:f}=e,g=()=>{s(q3,{suggestion_type:t,search_keyword:i,sm_ids:a,connector_name:f}),r(e,t),o(BE(t))};return d.jsxs(kI,{isSelected:n,onClick:g,children:[d.jsx(DI,{src:l,alt:"option"}),d.jsxs(u.Stack,{children:[d.jsx(u.Typography,{color:u.theme.palette.gray.gray1,children:i}),d.jsx(u.Typography,{color:u.theme.palette.gray.gray3,fontSize:"12px",children:c})]})]})},NI=u.styled(u.Stack)`
1518
1528
  padding: 10px 0 10px 10px;
1519
- `,{Control:NI}=ln,RI=({children:e,...t})=>d.jsxs(NI,{...t,children:[d.jsx(DI,{children:d.jsx(Vp,{})}),e]}),MI=e=>{const{data:t,isSelected:n,selectOption:r}=e;return d.jsx(Gp,{data:t,isSelected:n,onSelect:r})},PI={control:(e,{isFocused:t})=>({...e,cursor:"pointer",boxShadow:"none",borderColor:t?"#196FE0 !important":"#D6DDE8",borderWidth:"1px"}),menu:e=>({...e,marginTop:0,padding:0,borderRadius:"4px",background:"#fff",boxShadow:"0px 3px 15px 0px rgba(0, 0, 0, 0.25)",zIndex:3}),input:e=>({...e,"& input":{opacity:"1 !important"}}),menuPortal:e=>({...e,zIndex:3})},jI=({options:e,value:t,inputValue:n,root:r,onChange:o,onInputChange:s,onReset:a,NoOptionsMessage:i,menuOpen:c})=>{const{availableFeatures:l,sendTrackingEvent:f,currentSmIds:g}=I.useContext(We),y=Ke(l,Ws),x=(h,{action:m})=>{m==="input-change"&&(s(h),h||a())},b=h=>{o(h),h||(s(""),a())},p=()=>{const h=[...new Set(e.map(m=>m.connectorName))];f(J3,{connector_names:h,sm_ids:g})};return d.jsx(es,{name:"global-search",type:"select",value:t,inputValue:n,options:n?e:[],placeholder:y?_I:II,isSearchable:!0,filterOption:null,styles:PI,onInputChange:x,onChange:b,isClearable:!0,menuPortalTarget:document.body,blurInputOnSelect:!0,onFocus:p,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Option:MI,Control:RI,...i&&{NoOptionsMessage:i}},root:r,...typeof c=="boolean"&&{menuIsOpen:c}})},BI=u.styled(u.Stack)`
1529
+ `,{Control:RI}=ln,MI=({children:e,...t})=>d.jsxs(RI,{...t,children:[d.jsx(NI,{children:d.jsx(Vp,{})}),e]}),PI=e=>{const{data:t,isSelected:n,selectOption:r}=e;return d.jsx(Gp,{data:t,isSelected:n,onSelect:r})},jI={control:(e,{isFocused:t})=>({...e,cursor:"pointer",boxShadow:"none",borderColor:t?"#196FE0 !important":"#D6DDE8",borderWidth:"1px"}),menu:e=>({...e,marginTop:0,padding:0,borderRadius:"4px",background:"#fff",boxShadow:"0px 3px 15px 0px rgba(0, 0, 0, 0.25)",zIndex:3}),input:e=>({...e,"& input":{opacity:"1 !important"}}),menuPortal:e=>({...e,zIndex:3})},BI=({options:e,value:t,inputValue:n,root:r,onChange:o,onInputChange:s,onReset:a,NoOptionsMessage:i,menuOpen:c})=>{const{availableFeatures:l,sendTrackingEvent:f,currentSmIds:g}=I.useContext(We),y=Ke(l,Ws),x=(h,{action:m})=>{m==="input-change"&&(s(h),h||a())},b=h=>{o(h),h||(s(""),a())},p=()=>{const h=[...new Set(e.map(m=>m.connectorName))];f(J3,{connector_names:h,sm_ids:g})};return d.jsx(es,{name:"global-search",type:"select",value:t,inputValue:n,options:n?e:[],placeholder:y?SI:_I,isSearchable:!0,filterOption:null,styles:jI,onInputChange:x,onChange:b,isClearable:!0,menuPortalTarget:document.body,blurInputOnSelect:!0,onFocus:p,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Option:PI,Control:MI,...i&&{NoOptionsMessage:i}},root:r,...typeof c=="boolean"&&{menuIsOpen:c}})},VI=u.styled(u.Stack)`
1520
1530
  margin: ${({isEmpty:e})=>e?"0":"12px 0"};
1521
- `,VI=({objectId:e,searchString:t,fetchSearchResults:n})=>{var w;const[r,o]=Ep(),s=I.useRef(null),a=ve(Bp),i=ve(vI),c=ve(wI),l=I.useMemo(()=>e&&i&&i[e]&&Array.isArray(i[e])?{id:e,formFields:i[e]}:{id:"emptyFormId",formFields:[]},[i,e]),f=I.useMemo(()=>{const v=(l==null?void 0:l.formFields)||[];return nl({formFields:v})},[l]),{setValue:g,inputChangeHandler:y,dateChangeHandler:x,clearDependentFields:b,handleValidationError:p,isErrorInValidations:h}=vp({state:r,dispatch:o,validations:f}),{fetchConfig:m}=_p({formState:r,formFields:l.formFields,formId:l.id}),E=I.useCallback(v=>{s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{n(v)},500)},[n]);I.useEffect(()=>{const v=r.values,_=l.id,T=l.formFields;if(Object.values(v).filter(j=>!!j).length<T.length||!a||h()){s.current&&clearTimeout(s.current);return}const S=a[e].searchInterfaceDetails;if(!S)return;const L=a[e].connectorName,{id:N,args:k={}}=S,D=rs(r,k);E({id:_,interfaceId:N,searchString:t,connectorName:L,args:D})},[r,l,a,e,t,h,E]),I.useEffect(()=>()=>{s.current&&clearTimeout(s.current)},[]);const C=(v,_,T)=>{if(_.action==="clear"&&_.name&&(g(_.name,""),b(_.name,c[e]),f[_.name].isRequired&&p(_.name,!0)),v&&typeof v=="object"&&"label"in v&&typeof v.label=="string"&&"value"in v&&(typeof v.value=="string"||typeof v.value=="number")&&typeof _.name<"u"){let S=!1;T&&(S=T.isMultiSelect||!1);const L=S?[{value:v.value,label:v.label}]:{value:v.value,label:v.label};g(_.name,L),b(_.name,c[e])}};return d.jsx(BI,{isEmpty:((w=l.formFields)==null?void 0:w.length)===0,children:d.jsx(N1,{showGlobalLoader:!1,formConfig:[l],selectChangeHandler:C,inputChangeHandler:y,dateChangeHandler:x,onValidationError:p,labelSpacing:.5,fetchConfig:m,values:r.values,validations:f})})},sl="@connector-agent-global-search-priority",al=y6(),GI=({objectList:e})=>({sortedObjectList:I.useMemo(()=>{const r=al.getItem(sl);return r?[...e].sort((o,s)=>(r[o.value]??0)>(r[s.value]??0)?-1:1):e},[e]),updatePriority:r=>{const o=al.getItem(sl)??{};o[r]||(o[r]=0),o[r]++,al.setItem(sl,o)}}),HI=u.styled(u.Stack)`
1531
+ `,GI=({objectId:e,searchString:t,fetchSearchResults:n})=>{var w;const[r,o]=Ep(),s=I.useRef(null),a=ve(Bp),i=ve(wI),c=ve(II),l=I.useMemo(()=>e&&i&&i[e]&&Array.isArray(i[e])?{id:e,formFields:i[e]}:{id:"emptyFormId",formFields:[]},[i,e]),f=I.useMemo(()=>{const v=(l==null?void 0:l.formFields)||[];return nl({formFields:v})},[l]),{setValue:g,inputChangeHandler:y,dateChangeHandler:x,clearDependentFields:b,handleValidationError:p,isErrorInValidations:h}=vp({state:r,dispatch:o,validations:f}),{fetchConfig:m}=_p({formState:r,formFields:l.formFields,formId:l.id}),E=I.useCallback(v=>{s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{n(v)},500)},[n]);I.useEffect(()=>{const v=r.values,_=l.id,T=l.formFields;if(Object.values(v).filter(j=>!!j).length<T.length||!a||h()){s.current&&clearTimeout(s.current);return}const S=a[e].searchInterfaceDetails;if(!S)return;const L=a[e].connectorName,{id:N,args:k={}}=S,D=rs(r,k);E({id:_,interfaceId:N,searchString:t,connectorName:L,args:D})},[r,l,a,e,t,h,E]),I.useEffect(()=>()=>{s.current&&clearTimeout(s.current)},[]);const C=(v,_,T)=>{if(_.action==="clear"&&_.name&&(g(_.name,""),b(_.name,c[e]),f[_.name].isRequired&&p(_.name,!0)),v&&typeof v=="object"&&"label"in v&&typeof v.label=="string"&&"value"in v&&(typeof v.value=="string"||typeof v.value=="number")&&typeof _.name<"u"){let S=!1;T&&(S=T.isMultiSelect||!1);const L=S?[{value:v.value,label:v.label}]:{value:v.value,label:v.label};g(_.name,L),b(_.name,c[e])}};return d.jsx(VI,{isEmpty:((w=l.formFields)==null?void 0:w.length)===0,children:d.jsx(N1,{showGlobalLoader:!1,formConfig:[l],selectChangeHandler:C,inputChangeHandler:y,dateChangeHandler:x,onValidationError:p,labelSpacing:.5,fetchConfig:m,values:r.values,validations:f})})},sl="@connector-agent-global-search-priority",al=y6(),HI=({objectList:e})=>({sortedObjectList:I.useMemo(()=>{const r=al.getItem(sl);return r?[...e].sort((o,s)=>(r[o.value]??0)>(r[s.value]??0)?-1:1):e},[e]),updatePriority:r=>{const o=al.getItem(sl)??{};o[r]||(o[r]=0),o[r]++,al.setItem(sl,o)}}),WI=u.styled(u.Stack)`
1522
1532
  padding: 8px 0;
1523
- `,WI=u.styled(u.Typography)`
1533
+ `,ZI=u.styled(u.Typography)`
1524
1534
  padding: 6px 16px;
1525
1535
  color: ${u.theme.palette.gray.gray4};
1526
1536
  font-size: 13px;
1527
- `,ZI=u.styled(u.Typography)`
1537
+ `,XI=u.styled(u.Typography)`
1528
1538
  padding: 6px 16px;
1529
1539
  color: ${u.theme.palette.gray.gray3};
1530
1540
  font-size: 11px;
1531
1541
  text-transform: uppercase;
1532
- `,XI=({onSelect:e,selectedOption:t,options:n})=>n.length?d.jsxs(HI,{children:[d.jsx(WI,{children:SI}),d.jsx(ZI,{children:TI}),n.map(r=>d.jsx(Gp,{suggestionType:"smart",data:r,isSelected:t===r,onSelect:e},r.label+r.description))]}):null,zI=e=>new Promise(t=>setTimeout(t,e)),Hp=({apiFn:e,intervalMillis:t,maxRetries:n,increaseIntervalMillis:r=0,isSatisfied:o,pushIntermediateResults:s=()=>{}})=>(...i)=>{const c=async(l=0)=>{const f=await e(...i);if(s(f),o(f))return s(null),f;if(l>=n)throw f;return l++,t+=r,zI(t).then(()=>c(l))};return c()},YI=async({conversationId:e,senderEmail:t})=>{try{const n=await xe({url:et(TE,{conversationId:e}),params:{senderEmail:t},method:Fe.GET});return n==null?void 0:n.data}catch(n){throw console.error(n),n}},Wp=({conversationId:e,senderEmail:t,enabled:n})=>Wt({queryKey:["Global","ConversationMetaData",e,t],queryFn:()=>YI({conversationId:e,senderEmail:t}),refetchOnMount:!1,enabled:n}),Zp="/v1/api",JI=`${Zp}/connectors/forms/:formId/search`,qI=`${Zp}/connectors/conversation/:conversationId/smart-suggestions`,QI=e=>{if(e.status!=="completed")return e;const t=e.smart_suggestions??[],n=[];for(const r of t)n.push({label:r.search_string,description:`${r.connector_name??""} - ${r.object_name??""}`,avatarUrl:r.connector_logo,value:r.form_id,connectorName:r.connector_name,objectName:r.object_name});return{...e,suggestedOptions:n}},$I=Hp({apiFn:async({conversationId:e})=>{try{const t=await xe({url:et(qI,{conversationId:e}),method:Fe.GET}),n=t==null?void 0:t.data;return QI(n)}catch(t){throw console.error(t),t}},intervalMillis:1500,maxRetries:5,isSatisfied:e=>e.status!=="pending"}),UI=({conversationId:e,senderEmail:t,enabled:n})=>{const{isSuccess:r}=Wp({conversationId:e,senderEmail:t,enabled:n});return Wt({queryKey:["GlobalSearch","SmartSuggestions",e],queryFn:()=>$I({conversationId:e}),enabled:n&&r})},KI=({selectedObject:e,root:t,setSelectedObject:n,fetchSearchResults:r,onReset:o})=>{const[s,a]=I.useState(""),{conversationId:i,email:c,availableFeatures:l}=I.useContext(We),f=ve(EI),g=ve(Bp),y=Ke(l,b5),{sortedObjectList:x,updatePriority:b}=GI({objectList:f}),{data:p}=UI({enabled:y&&!!i,conversationId:String(i),senderEmail:c}),h=(p==null?void 0:p.suggestedOptions)??[],m=I.useMemo(()=>!g||!x.length?[]:x.map(({value:C})=>{const w=g[C];return w?{description:`${w.connectorName??""} - ${w.searchObject}`,avatarUrl:w.logoUrl,label:"",value:C,connectorName:w.connectorName,objectName:w.searchObject}:null}).filter(C=>!!C),[x,g]),E=C=>{n(C),C&&b(""+C.value)};return m.length?d.jsxs(u.Stack,{children:[d.jsx(jI,{value:e,options:m.map(C=>({...C,label:s})),inputValue:s,root:t,onInputChange:a,onChange:E,onReset:o,NoOptionsMessage:({selectOption:C})=>d.jsx(XI,{selectedOption:e,onSelect:C,options:h}),menuOpen:!s&&!h.length?!1:void 0}),e?d.jsx(VI,{objectId:e.value,searchString:e.label,fetchSearchResults:r},e.value):null]}):null},e_="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='%236C7B94'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.00483%2012.5052C7.73146%2012.7786%207.73146%2013.2218%208.00483%2013.4952C8.2782%2013.7685%208.72141%2013.7685%208.99478%2013.4952L11.9948%2010.4952C12.2681%2010.2218%2012.2681%209.77859%2011.9948%209.50522L8.99478%206.50522C8.72141%206.23185%208.2782%206.23185%208.00483%206.50522C7.73146%206.77859%207.73146%207.2218%208.00483%207.49517L10.5099%2010.0002L8.00483%2012.5052Z'/%3e%3c/svg%3e",t_=async({id:e,externalResourceId:t,conversationId:n,channelType:r="email",email:o})=>{const s=new URLSearchParams;s.append("channel_type",r),o&&s.append("senderEmail",o),await xe({url:`${OE.replace(":id",e)}?${s.toString()}`,method:Fe.POST,data:{externalResourceId:t,conversationId:n}})},n_=({onSuccess:e})=>Zt({mutationFn:t_,onSuccess:()=>{Ie({message:Ny,type:Ut}),e==null||e()},onError:()=>{Ie({message:Ry,type:Ye})}}),r_="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_8444_63907)'%3e%3cpath%20d='M7.99967%2013.333L8.93967%2012.393L5.21968%208.66634H13.333V7.33301L5.21968%207.33301L8.93967%203.60634L7.99967%202.66634L2.66634%207.99967L7.99967%2013.333Z'%20fill='%23343C45'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_8444_63907'%3e%3crect%20width='16'%20height='16'%20fill='white'%20transform='matrix(-1%200%200%20-1%2016%2016)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",o_=u.styled(u.Stack)`
1542
+ `,zI=({onSelect:e,selectedOption:t,options:n})=>n.length?d.jsxs(WI,{children:[d.jsx(ZI,{children:TI}),d.jsx(XI,{children:AI}),n.map(r=>d.jsx(Gp,{suggestionType:"smart",data:r,isSelected:t===r,onSelect:e},r.label+r.description))]}):null,YI=e=>new Promise(t=>setTimeout(t,e)),Hp=({apiFn:e,intervalMillis:t,maxRetries:n,increaseIntervalMillis:r=0,isSatisfied:o,pushIntermediateResults:s=()=>{}})=>(...i)=>{const c=async(l=0)=>{const f=await e(...i);if(s(f),o(f))return s(null),f;if(l>=n)throw f;return l++,t+=r,YI(t).then(()=>c(l))};return c()},JI=async({conversationId:e,senderEmail:t})=>{try{const n=await xe({url:et(AE,{conversationId:e}),params:{senderEmail:t},method:Fe.GET});return n==null?void 0:n.data}catch(n){throw console.error(n),n}},Wp=({conversationId:e,senderEmail:t,enabled:n})=>Wt({queryKey:["Global","ConversationMetaData",e,t],queryFn:()=>JI({conversationId:e,senderEmail:t}),refetchOnMount:!1,enabled:n}),Zp="/v1/api",qI=`${Zp}/connectors/forms/:formId/search`,QI=`${Zp}/connectors/conversation/:conversationId/smart-suggestions`,$I=e=>{if(e.status!=="completed")return e;const t=e.smart_suggestions??[],n=[];for(const r of t)n.push({label:r.search_string,description:`${r.connector_name??""} - ${r.object_name??""}`,avatarUrl:r.connector_logo,value:r.form_id,connectorName:r.connector_name,objectName:r.object_name});return{...e,suggestedOptions:n}},UI=Hp({apiFn:async({conversationId:e})=>{try{const t=await xe({url:et(QI,{conversationId:e}),method:Fe.GET}),n=t==null?void 0:t.data;return $I(n)}catch(t){throw console.error(t),t}},intervalMillis:1500,maxRetries:5,isSatisfied:e=>e.status!=="pending"}),KI=({conversationId:e,senderEmail:t,enabled:n})=>{const{isSuccess:r}=Wp({conversationId:e,senderEmail:t,enabled:n});return Wt({queryKey:["GlobalSearch","SmartSuggestions",e],queryFn:()=>UI({conversationId:e}),enabled:n&&r})},e_=({selectedObject:e,root:t,setSelectedObject:n,fetchSearchResults:r,onReset:o})=>{const[s,a]=I.useState(""),{conversationId:i,email:c,availableFeatures:l}=I.useContext(We),f=ve(vI),g=ve(Bp),y=Ke(l,b5),{sortedObjectList:x,updatePriority:b}=HI({objectList:f}),{data:p}=KI({enabled:y&&!!i,conversationId:String(i),senderEmail:c}),h=(p==null?void 0:p.suggestedOptions)??[],m=I.useMemo(()=>!g||!x.length?[]:x.map(({value:C})=>{const w=g[C];return w?{description:`${w.connectorName??""} - ${w.searchObject}`,avatarUrl:w.logoUrl,label:"",value:C,connectorName:w.connectorName,objectName:w.searchObject}:null}).filter(C=>!!C),[x,g]),E=C=>{n(C),C&&b(""+C.value)};return m.length?d.jsxs(u.Stack,{children:[d.jsx(BI,{value:e,options:m.map(C=>({...C,label:s})),inputValue:s,root:t,onInputChange:a,onChange:E,onReset:o,NoOptionsMessage:({selectOption:C})=>d.jsx(zI,{selectedOption:e,onSelect:C,options:h}),menuOpen:!s&&!h.length?!1:void 0}),e?d.jsx(GI,{objectId:e.value,searchString:e.label,fetchSearchResults:r},e.value):null]}):null},t_="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='%236C7B94'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.00483%2012.5052C7.73146%2012.7786%207.73146%2013.2218%208.00483%2013.4952C8.2782%2013.7685%208.72141%2013.7685%208.99478%2013.4952L11.9948%2010.4952C12.2681%2010.2218%2012.2681%209.77859%2011.9948%209.50522L8.99478%206.50522C8.72141%206.23185%208.2782%206.23185%208.00483%206.50522C7.73146%206.77859%207.73146%207.2218%208.00483%207.49517L10.5099%2010.0002L8.00483%2012.5052Z'/%3e%3c/svg%3e",n_=async({id:e,externalResourceId:t,conversationId:n,channelType:r="email",email:o})=>{const s=new URLSearchParams;s.append("channel_type",r),o&&s.append("senderEmail",o),await xe({url:`${FE.replace(":id",e)}?${s.toString()}`,method:Fe.POST,data:{externalResourceId:t,conversationId:n}})},r_=({onSuccess:e})=>Zt({mutationFn:n_,onSuccess:()=>{Ie({message:Ny,type:Ut}),e==null||e()},onError:()=>{Ie({message:Ry,type:Ye})}}),o_="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_8444_63907)'%3e%3cpath%20d='M7.99967%2013.333L8.93967%2012.393L5.21968%208.66634H13.333V7.33301L5.21968%207.33301L8.93967%203.60634L7.99967%202.66634L2.66634%207.99967L7.99967%2013.333Z'%20fill='%23343C45'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_8444_63907'%3e%3crect%20width='16'%20height='16'%20fill='white'%20transform='matrix(-1%200%200%20-1%2016%2016)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",s_=u.styled(u.Stack)`
1533
1543
  width: fit-content;
1534
1544
  cursor: pointer;
1535
1545
  gap: 8px;
@@ -1541,7 +1551,7 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
1541
1551
  letter-spacing: 0.4px;
1542
1552
  text-align: center;
1543
1553
  vertical-align: middle;
1544
- `,s_=({meta:{externalResourceId:e,formId:t,searchKeyword:n,searchResultLabel:r},onBack:o,onLink:s})=>{const a=Qt(),{conversationId:i,currentSmIds:c,sendTrackingEvent:l,email:f}=I.useContext(We),g=ve(bp),y=ve(yp),{mutate:x,isPending:b}=n_({onSuccess:s}),p=y===ee.LOADING,h={externalResourceId:e};I.useEffect(()=>{a(so({id:t,args:{externalResourceId:e}}))},[e,t,a]);const m=()=>{l(e5,{search_keyword:n,search_result_label:r,sm_ids:c,card_title:g==null?void 0:g.cardTitle,connector_names:g==null?void 0:g.connectorNames}),x({id:t,externalResourceId:e,conversationId:i,email:f})};return d.jsxs(u.Stack,{gap:"12px",marginTop:"12px",children:[d.jsxs(o_,{onClick:o,children:[d.jsx("img",{src:r_,width:"16px",height:"16px"}),d.jsx(u.Typography,{children:LI})]}),d.jsxs(u.Stack,{gap:"24px",children:[d.jsx(Cp,{cardData:g,cardDataApiStatus:y,objectToLink:t,args:h}),d.jsx(u.Stack,{alignItems:"flex-end",children:d.jsx(u.Button,{size:"small",disabled:p||b,onClick:m,children:Ld})})]})]})},Xp=u.styled(u.Stack)`
1554
+ `,a_=({meta:{externalResourceId:e,formId:t,searchKeyword:n,searchResultLabel:r},onBack:o,onLink:s})=>{const a=Qt(),{conversationId:i,currentSmIds:c,sendTrackingEvent:l,email:f}=I.useContext(We),g=ve(bp),y=ve(yp),{mutate:x,isPending:b}=r_({onSuccess:s}),p=y===ee.LOADING,h={externalResourceId:e};I.useEffect(()=>{a(so({id:t,args:{externalResourceId:e}}))},[e,t,a]);const m=()=>{l(e5,{search_keyword:n,search_result_label:r,sm_ids:c,card_title:g==null?void 0:g.cardTitle,connector_names:g==null?void 0:g.connectorNames}),x({id:t,externalResourceId:e,conversationId:i,email:f})};return d.jsxs(u.Stack,{gap:"12px",marginTop:"12px",children:[d.jsxs(s_,{onClick:o,children:[d.jsx("img",{src:o_,width:"16px",height:"16px"}),d.jsx(u.Typography,{children:OI})]}),d.jsxs(u.Stack,{gap:"24px",children:[d.jsx(Cp,{cardData:g,cardDataApiStatus:y,objectToLink:t,args:h}),d.jsx(u.Stack,{alignItems:"flex-end",children:d.jsx(u.Button,{size:"small",disabled:p||b,onClick:m,children:Ld})})]})]})},Xp=u.styled(u.Stack)`
1545
1555
  padding: 12px 12px 12px 11px;
1546
1556
  border: 1px solid ${u.theme.palette.gray.gray5};
1547
1557
  border-radius: 8px;
@@ -1557,10 +1567,10 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
1557
1567
  }
1558
1568
  }
1559
1569
  `};
1560
- `,a_="data:image/svg+xml,%3csvg%20width='124'%20height='107'%20viewBox='0%200%20124%20107'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M28.6168%2054.7446C28.6931%2052.5589%2031.0146%2051.1102%2033.0842%2051.8174C35.9985%2052.8133%2040.0375%2053.9024%2044.0621%2054.043C48.0034%2054.1806%2051.968%2053.4097%2054.8762%2052.6339C57.0264%2052.0602%2059.2927%2053.6932%2059.215%2055.9172C59.1742%2057.0856%2058.4742%2058.1269%2057.3723%2058.5178C54.8051%2059.4284%2049.7633%2060.8927%2044.3075%2060.7022C38.7694%2060.5088%2033.1999%2058.6241%2030.4004%2057.5311C29.2637%2057.0873%2028.5742%2055.9641%2028.6168%2054.7446Z'%20fill='url(%23paint0_linear_8481_102191)'/%3e%3cpath%20d='M47.223%2043.6373C44.4928%2030.7926%2052.6922%2018.1666%2065.5368%2015.4364C78.3815%2012.7062%2091.0075%2020.9055%2093.7377%2033.7502L105.079%2087.1053L84.1844%2091.5466C70.0346%2094.5542%2056.1258%2085.5217%2053.1182%2071.3719L47.223%2043.6373Z'%20fill='url(%23paint1_linear_8481_102191)'/%3e%3cmask%20id='mask0_8481_102191'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='46'%20y='14'%20width='60'%20height='79'%3e%3cpath%20d='M47.223%2043.6373C44.4928%2030.7926%2052.6922%2018.1666%2065.5368%2015.4364C78.3815%2012.7062%2091.0075%2020.9055%2093.7377%2033.7502L105.079%2087.1053L84.1844%2091.5466C70.0346%2094.5542%2056.1258%2085.5217%2053.1182%2071.3719L47.223%2043.6373Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_8481_102191)'%3e%3cellipse%20cx='63.7775'%20cy='46.8684'%20rx='1.48152'%20ry='1.39438'%20transform='rotate(-12%2063.7775%2046.8684)'%20fill='%23435C71'/%3e%3crect%20x='47.4368'%20y='59.3203'%20width='53.657'%20height='13.2235'%20transform='rotate(-12%2047.4368%2059.3203)'%20fill='url(%23paint2_linear_8481_102191)'/%3e%3crect%20x='51.1907'%20y='76.9824'%20width='53.657'%20height='10.4263'%20transform='rotate(-12%2051.1907%2076.9824)'%20fill='url(%23paint3_linear_8481_102191)'/%3e%3c/g%3e%3cpath%20opacity='0.883952'%20d='M113.939%2051.0679C114.775%2055%20112.265%2058.865%20108.333%2059.7008L107.842%2059.8052C103.639%2060.6986%2099.5073%2058.0155%2098.6139%2053.8123L97.205%2047.1837L105.307%2045.4616C109.239%2044.6259%20113.104%2047.1359%20113.939%2051.0679Z'%20fill='url(%23paint4_linear_8481_102191)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M68.7215%2066.4138C67.1801%2064.8725%2067.6745%2062.2062%2069.587%2061.1603C72.4457%2059.5969%2076.2861%2057.1773%2079.3785%2054.0849C82.4099%2051.0535%2084.752%2047.3461%2086.2775%2044.5465C87.3388%2042.5989%2090.0598%2042.0819%2091.6282%2043.6503C92.4782%2044.5003%2092.758%2045.7623%2092.2604%2046.8566C91.0829%2049.4466%2088.5191%2054.344%2084.4346%2058.4285C80.2853%2062.5778%2074.8639%2065.591%2072.0553%2066.9952C70.9363%2067.5548%2069.6062%2067.2985%2068.7215%2066.4138Z'%20fill='url(%23paint5_linear_8481_102191)'/%3e%3crect%20x='48.7264'%20y='33.7744'%20width='11.2108'%20height='11.2108'%20rx='5.59457'%20transform='rotate(-12%2048.7264%2033.7744)'%20fill='url(%23paint6_linear_8481_102191)'/%3e%3crect%20x='50.0175'%20y='35.8193'%20width='4.0158'%20height='3.84848'%20rx='1.92424'%20transform='rotate(-12%2050.0175%2035.8193)'%20fill='%23435C71'/%3e%3crect%20x='59.2875'%20y='31.5723'%20width='11.2108'%20height='11.2108'%20rx='5.59457'%20transform='rotate(-12%2059.2875%2031.5723)'%20fill='%23FFFEFE'/%3e%3cpath%20opacity='0.883952'%20d='M111.25%2038.5376C110.415%2034.6055%20106.55%2032.0955%20102.618%2032.9313L102.127%2033.0356C97.9234%2033.9291%2095.2403%2038.0607%2096.1337%2042.2639L97.5426%2048.8925L105.644%2047.1705C109.576%2046.3347%20112.086%2042.4696%20111.25%2038.5376Z'%20fill='url(%23paint7_linear_8481_102191)'/%3e%3crect%20x='60.0181'%20y='33.8037'%20width='3.84848'%20height='3.84848'%20rx='1.90724'%20transform='rotate(-12%2060.0181%2033.8037)'%20fill='%23435C71'/%3e%3cpath%20d='M36.9246%2059.1604C36.4487%2060.717%2034.7371%2061.6271%2033.1805%2061.1512C32.3613%2060.9007%2031.7241%2060.3475%2031.3259%2059.5987L25.2059%2046.7983C24.9784%2046.3703%2025.1286%2045.8788%2025.5566%2045.6513L28.338%2044.1724C28.7659%2043.9449%2029.2574%2044.0951%2029.4849%2044.5231L36.6496%2056.8367C37.0728%2057.5036%2037.15%2058.423%2036.9246%2059.1604Z'%20fill='%23FFDF9F'/%3e%3crect%20x='27.9973'%20y='44.333'%20width='2.39869'%20height='3.59807'%20transform='rotate(152%2027.9973%2044.333)'%20fill='%23FF9090'/%3e%3cpath%20d='M26.6628%2044.3769L26.9472%2044.9118L28.0169%2044.343L26.3106%2041.1338L24.171%2042.2714L25.0243%2043.876C25.6661%2043.5347%2026.3215%2043.7351%2026.6628%2044.3769Z'%20fill='%23FFB19F'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.26386%2027.248C9.3428%2020.4481%2016.5101%2016.6372%2023.31%2018.7161C30.11%2020.7951%2033.9209%2027.9624%2031.8419%2034.7623C29.763%2041.5622%2022.5956%2045.3731%2015.7958%2043.2942C8.99587%2041.2152%205.18493%2034.0479%207.26386%2027.248ZM9.72157%2027.9983C8.06843%2033.4055%2011.1399%2039.1821%2016.5471%2040.8352C21.9543%2042.4884%2027.7309%2039.4168%2029.384%2034.0096C31.0372%2028.6024%2027.9657%2022.8258%2022.5585%2021.1727C17.1513%2019.5196%2011.3747%2022.5911%209.72157%2027.9983Z'%20fill='%23FFE69F'/%3e%3ccircle%20opacity='0.414016'%20cx='19.5529'%20cy='31.0039'%20r='10.2804'%20transform='rotate(17%2019.5529%2031.0039)'%20fill='%23BBDEFC'/%3e%3cpath%20d='M14.3685%2030.6746C15.7299%2027.6867%2018.9391%2025.9803%2022.1776%2026.5225L22.2595%2026.5475C23.7024%2026.8095%2024.3854%2024.8682%2023.1497%2024.2218C22.3806%2023.8074%2021.5613%2023.557%2020.717%2023.3884C17.3715%2022.9031%2014.0553%2024.6664%2012.6939%2027.6543C12.2796%2028.4235%2012.0859%2029.3497%2012.0244%2030.1372C11.8444%2031.6051%2013.8607%2032.0424%2014.4503%2030.6997C14.3434%2030.7566%2014.3685%2030.6746%2014.3685%2030.6746Z'%20fill='%23F6FBFF'/%3e%3cpath%20d='M10.2904%2029.0679C11.9436%2023.6607%2017.7202%2020.5893%2023.1274%2022.2424C25.6671%2023.0189%2027.5785%2024.6783%2028.9301%2026.704C27.7539%2024.1048%2025.508%2022.0744%2022.5586%2021.1727C17.1514%2019.5196%2011.3748%2022.591%209.72165%2027.9982C8.81993%2030.9476%209.32924%2033.97%2010.7444%2036.3735C9.82081%2034.1203%209.51395%2031.6077%2010.2904%2029.0679Z'%20fill='%23ADCBE7'/%3e%3cpath%20opacity='0.406087'%20d='M36.4864%2056.8021L36.1373%2056.2691C36.3845%2056.8563%2036.428%2057.5516%2036.2372%2058.1754C35.9273%2059.189%2034.5593%2059.1971%2034.0713%2058.2806L28.3787%2047.5877C28.0534%2046.9767%2027.3508%2046.7619%2026.7395%2047.0866L25.7206%2047.6277L31.4395%2059.3516C31.7648%2059.9627%2032.27%2060.5434%2032.8706%2060.8123C33.7054%2061.1528%2034.6593%2061.1034%2035.3726%2060.7247C36.0858%2060.3459%2036.6602%2059.5837%2036.8444%2058.7021C37.0351%2058.0783%2036.8117%2057.4132%2036.4864%2056.8021Z'%20fill='white'/%3e%3cpath%20d='M29.8826%2048.4977C29.8006%2048.4726%2029.6368%2048.4225%2029.5799%2048.3155L28.1579%2045.6411C28.0442%2045.4272%2028.1193%2045.1814%2028.3332%2045.0677C28.5472%2044.9539%2028.7929%2045.0291%2028.9067%2045.243L30.3287%2047.9174C30.4424%2048.1313%2030.3673%2048.3771%2030.1534%2048.4908C30.1284%2048.5728%2029.9645%2048.5227%2029.8826%2048.4977Z'%20fill='%23FFF5EB'/%3e%3cellipse%20cx='29.2637'%20cy='54.631'%20rx='1.50593'%20ry='3.17918'%20transform='rotate(-23%2029.2637%2054.631)'%20fill='%23FFC478'/%3e%3cellipse%20cx='34.0592'%20cy='52.4078'%20rx='0.920288'%20ry='1.67325'%20transform='rotate(106%2034.0592%2052.4078)'%20fill='%23FFC478'/%3e%3cpath%20d='M89.1282%2019.2055L68.2257%2026.8725L45.9197%2028.3898L44.4929%2016.4082C44.3371%2013.798%2047.5283%2011.4502%2050.9859%2011.6309L65.1429%2012.369L67.3969%2012.4869C68.5309%2012.5463%2069.7066%2012.3289%2070.7522%2011.8627L78.6899%208.34726C81.725%206.99992%2085.3012%207.87475%2086.2125%2010.1876L89.1282%2019.2055Z'%20fill='url(%23paint8_linear_8481_102191)'/%3e%3cpath%20opacity='0.479771'%20d='M88.6262%2019.0953L68.3101%2026.5288L65.3314%2012.5149L67.5211%2012.6263C68.6228%2012.6824%2069.7652%2012.471%2070.7816%2012.0192L78.4972%208.61266C81.4474%207.30707%2084.9208%208.14856%2085.8036%2010.3829L88.6262%2019.0953Z'%20fill='%23ADCBE7'/%3e%3cpath%20d='M91.6332%2026.6212L46.9517%2036.1186L46.0387%2028.4438L89.2535%2019.2582L91.6332%2026.6212Z'%20fill='%23717DAD'/%3e%3cpath%20d='M102.961%2024.2033C103.125%2024.9722%20102.371%2025.7829%20101.278%2026.015L37.9675%2039.4722C36.8754%2039.7043%2035.8568%2039.2704%2035.6933%2038.5015C35.5301%2037.7336%2036.284%2036.922%2037.3761%2036.6898L100.687%2023.2327C101.779%2023.0005%20102.798%2023.4354%20102.961%2024.2033Z'%20fill='%239ED1FF'/%3e%3cpath%20d='M102.703%2024.1718C102.838%2024.805%20102.067%2025.5045%20100.983%2025.7349L69.5583%2032.4144L69.0712%2030.123L100.496%2023.4436C101.58%2023.2131%20102.569%2023.5394%20102.703%2024.1718Z'%20fill='%2378AFE1'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_8481_102191'%20x1='32.2665'%20y1='59.6553'%20x2='59.0518'%20y2='60.5906'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFFDE0'/%3e%3cstop%20offset='1'%20stop-color='%23FFB362'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_8481_102191'%20x1='67.3434'%20y1='85.966'%20x2='103.216'%20y2='78.3411'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFFABC'/%3e%3cstop%20offset='1'%20stop-color='%23FFA650'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_8481_102191'%20x1='51.4347'%20y1='74.8197'%20x2='91.1539'%20y2='74.8197'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A3C1FF'/%3e%3cstop%20offset='1'%20stop-color='%234243FF'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_8481_102191'%20x1='55.1887'%20y1='89.2031'%20x2='94.9078'%20y2='89.2031'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A3C1FF'/%3e%3cstop%20offset='1'%20stop-color='%234243FF'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_8481_102191'%20x1='94.5023'%20y1='53.1799'%20x2='106.762'%20y2='58.7056'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF9498'/%3e%3cstop%20offset='1'%20stop-color='%23FFD671'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint5_linear_8481_102191'%20x1='74.9906'%20y1='66.9871'%20x2='94.9778'%20y2='46.9999'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFFDE0'/%3e%3cstop%20offset='1'%20stop-color='%23FFB362'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint6_linear_8481_102191'%20x1='50.5805'%20y1='44.0581'%20x2='59.9372'%20y2='44.0581'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='white'/%3e%3cstop%20offset='1'%20stop-color='%23E3EEF3'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint7_linear_8481_102191'%20x1='88.4187'%20y1='43.3906'%20x2='99.3981'%20y2='25.1833'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF9498'/%3e%3cstop%20offset='1'%20stop-color='%23FFD671'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint8_linear_8481_102191'%20x1='56.4985'%20y1='29.5482'%20x2='100.532'%20y2='20.1885'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23ECF7FF'/%3e%3cstop%20offset='1'%20stop-color='%23C2E0FF'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",i_=()=>d.jsxs(u.Box,{justifyItems:"center",marginTop:"40px",children:[d.jsx("img",{src:a_,width:124,height:107}),d.jsx(u.Typography,{variant:"body2",color:u.theme.palette.gray.gray3,children:OI})]}),c_=({searchResults:e,selectedObject:t,onReset:n,fetchCards:r})=>{const o=Qt(),{sendTrackingEvent:s,currentSmIds:a}=I.useContext(We),[i,c]=I.useState(null),l=et(AI,{count:e.length.toString(),countSuffix:e.length>1?"s":"",searchObject:t.objectName,connectorName:t.connectorName}),f=(x,b)=>{s(K3,{search_keyword:t.label,search_result_label:b,sm_ids:a,connector_name:t.connectorName}),c({externalResourceId:x,formId:t.value.toString(),searchKeyword:t.label,searchResultLabel:b})},g=()=>{c(null),o(PE())},y=()=>{n(),r(),g()};return e.length?i?d.jsx(s_,{meta:i,onBack:g,onLink:y}):d.jsxs(u.Stack,{gap:"14px",marginTop:"12px",children:[d.jsx(u.Typography,{variant:"body2",children:l}),d.jsx(u.Stack,{gap:"17px",children:e==null?void 0:e.map(({externalResourceId:x,name:b,description:p})=>d.jsxs(Xp,{onClick:()=>f(x,b),direction:"row",children:[d.jsxs(u.Stack,{flexGrow:1,children:[d.jsx(u.Typography,{variant:"body2",color:u.theme.palette.gray.gray1,children:b}),d.jsx(u.Typography,{variant:"caption",color:u.theme.palette.gray.gray3,children:p})]}),d.jsx(u.Box,{alignSelf:"center",className:"search-item__chevron",width:"20px",height:"20px",children:d.jsx("img",{src:e_})})]},x))})]}):d.jsx(i_,{})},il=u.styled(u.Skeleton)`
1570
+ `,i_="data:image/svg+xml,%3csvg%20width='124'%20height='107'%20viewBox='0%200%20124%20107'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M28.6168%2054.7446C28.6931%2052.5589%2031.0146%2051.1102%2033.0842%2051.8174C35.9985%2052.8133%2040.0375%2053.9024%2044.0621%2054.043C48.0034%2054.1806%2051.968%2053.4097%2054.8762%2052.6339C57.0264%2052.0602%2059.2927%2053.6932%2059.215%2055.9172C59.1742%2057.0856%2058.4742%2058.1269%2057.3723%2058.5178C54.8051%2059.4284%2049.7633%2060.8927%2044.3075%2060.7022C38.7694%2060.5088%2033.1999%2058.6241%2030.4004%2057.5311C29.2637%2057.0873%2028.5742%2055.9641%2028.6168%2054.7446Z'%20fill='url(%23paint0_linear_8481_102191)'/%3e%3cpath%20d='M47.223%2043.6373C44.4928%2030.7926%2052.6922%2018.1666%2065.5368%2015.4364C78.3815%2012.7062%2091.0075%2020.9055%2093.7377%2033.7502L105.079%2087.1053L84.1844%2091.5466C70.0346%2094.5542%2056.1258%2085.5217%2053.1182%2071.3719L47.223%2043.6373Z'%20fill='url(%23paint1_linear_8481_102191)'/%3e%3cmask%20id='mask0_8481_102191'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='46'%20y='14'%20width='60'%20height='79'%3e%3cpath%20d='M47.223%2043.6373C44.4928%2030.7926%2052.6922%2018.1666%2065.5368%2015.4364C78.3815%2012.7062%2091.0075%2020.9055%2093.7377%2033.7502L105.079%2087.1053L84.1844%2091.5466C70.0346%2094.5542%2056.1258%2085.5217%2053.1182%2071.3719L47.223%2043.6373Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_8481_102191)'%3e%3cellipse%20cx='63.7775'%20cy='46.8684'%20rx='1.48152'%20ry='1.39438'%20transform='rotate(-12%2063.7775%2046.8684)'%20fill='%23435C71'/%3e%3crect%20x='47.4368'%20y='59.3203'%20width='53.657'%20height='13.2235'%20transform='rotate(-12%2047.4368%2059.3203)'%20fill='url(%23paint2_linear_8481_102191)'/%3e%3crect%20x='51.1907'%20y='76.9824'%20width='53.657'%20height='10.4263'%20transform='rotate(-12%2051.1907%2076.9824)'%20fill='url(%23paint3_linear_8481_102191)'/%3e%3c/g%3e%3cpath%20opacity='0.883952'%20d='M113.939%2051.0679C114.775%2055%20112.265%2058.865%20108.333%2059.7008L107.842%2059.8052C103.639%2060.6986%2099.5073%2058.0155%2098.6139%2053.8123L97.205%2047.1837L105.307%2045.4616C109.239%2044.6259%20113.104%2047.1359%20113.939%2051.0679Z'%20fill='url(%23paint4_linear_8481_102191)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M68.7215%2066.4138C67.1801%2064.8725%2067.6745%2062.2062%2069.587%2061.1603C72.4457%2059.5969%2076.2861%2057.1773%2079.3785%2054.0849C82.4099%2051.0535%2084.752%2047.3461%2086.2775%2044.5465C87.3388%2042.5989%2090.0598%2042.0819%2091.6282%2043.6503C92.4782%2044.5003%2092.758%2045.7623%2092.2604%2046.8566C91.0829%2049.4466%2088.5191%2054.344%2084.4346%2058.4285C80.2853%2062.5778%2074.8639%2065.591%2072.0553%2066.9952C70.9363%2067.5548%2069.6062%2067.2985%2068.7215%2066.4138Z'%20fill='url(%23paint5_linear_8481_102191)'/%3e%3crect%20x='48.7264'%20y='33.7744'%20width='11.2108'%20height='11.2108'%20rx='5.59457'%20transform='rotate(-12%2048.7264%2033.7744)'%20fill='url(%23paint6_linear_8481_102191)'/%3e%3crect%20x='50.0175'%20y='35.8193'%20width='4.0158'%20height='3.84848'%20rx='1.92424'%20transform='rotate(-12%2050.0175%2035.8193)'%20fill='%23435C71'/%3e%3crect%20x='59.2875'%20y='31.5723'%20width='11.2108'%20height='11.2108'%20rx='5.59457'%20transform='rotate(-12%2059.2875%2031.5723)'%20fill='%23FFFEFE'/%3e%3cpath%20opacity='0.883952'%20d='M111.25%2038.5376C110.415%2034.6055%20106.55%2032.0955%20102.618%2032.9313L102.127%2033.0356C97.9234%2033.9291%2095.2403%2038.0607%2096.1337%2042.2639L97.5426%2048.8925L105.644%2047.1705C109.576%2046.3347%20112.086%2042.4696%20111.25%2038.5376Z'%20fill='url(%23paint7_linear_8481_102191)'/%3e%3crect%20x='60.0181'%20y='33.8037'%20width='3.84848'%20height='3.84848'%20rx='1.90724'%20transform='rotate(-12%2060.0181%2033.8037)'%20fill='%23435C71'/%3e%3cpath%20d='M36.9246%2059.1604C36.4487%2060.717%2034.7371%2061.6271%2033.1805%2061.1512C32.3613%2060.9007%2031.7241%2060.3475%2031.3259%2059.5987L25.2059%2046.7983C24.9784%2046.3703%2025.1286%2045.8788%2025.5566%2045.6513L28.338%2044.1724C28.7659%2043.9449%2029.2574%2044.0951%2029.4849%2044.5231L36.6496%2056.8367C37.0728%2057.5036%2037.15%2058.423%2036.9246%2059.1604Z'%20fill='%23FFDF9F'/%3e%3crect%20x='27.9973'%20y='44.333'%20width='2.39869'%20height='3.59807'%20transform='rotate(152%2027.9973%2044.333)'%20fill='%23FF9090'/%3e%3cpath%20d='M26.6628%2044.3769L26.9472%2044.9118L28.0169%2044.343L26.3106%2041.1338L24.171%2042.2714L25.0243%2043.876C25.6661%2043.5347%2026.3215%2043.7351%2026.6628%2044.3769Z'%20fill='%23FFB19F'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.26386%2027.248C9.3428%2020.4481%2016.5101%2016.6372%2023.31%2018.7161C30.11%2020.7951%2033.9209%2027.9624%2031.8419%2034.7623C29.763%2041.5622%2022.5956%2045.3731%2015.7958%2043.2942C8.99587%2041.2152%205.18493%2034.0479%207.26386%2027.248ZM9.72157%2027.9983C8.06843%2033.4055%2011.1399%2039.1821%2016.5471%2040.8352C21.9543%2042.4884%2027.7309%2039.4168%2029.384%2034.0096C31.0372%2028.6024%2027.9657%2022.8258%2022.5585%2021.1727C17.1513%2019.5196%2011.3747%2022.5911%209.72157%2027.9983Z'%20fill='%23FFE69F'/%3e%3ccircle%20opacity='0.414016'%20cx='19.5529'%20cy='31.0039'%20r='10.2804'%20transform='rotate(17%2019.5529%2031.0039)'%20fill='%23BBDEFC'/%3e%3cpath%20d='M14.3685%2030.6746C15.7299%2027.6867%2018.9391%2025.9803%2022.1776%2026.5225L22.2595%2026.5475C23.7024%2026.8095%2024.3854%2024.8682%2023.1497%2024.2218C22.3806%2023.8074%2021.5613%2023.557%2020.717%2023.3884C17.3715%2022.9031%2014.0553%2024.6664%2012.6939%2027.6543C12.2796%2028.4235%2012.0859%2029.3497%2012.0244%2030.1372C11.8444%2031.6051%2013.8607%2032.0424%2014.4503%2030.6997C14.3434%2030.7566%2014.3685%2030.6746%2014.3685%2030.6746Z'%20fill='%23F6FBFF'/%3e%3cpath%20d='M10.2904%2029.0679C11.9436%2023.6607%2017.7202%2020.5893%2023.1274%2022.2424C25.6671%2023.0189%2027.5785%2024.6783%2028.9301%2026.704C27.7539%2024.1048%2025.508%2022.0744%2022.5586%2021.1727C17.1514%2019.5196%2011.3748%2022.591%209.72165%2027.9982C8.81993%2030.9476%209.32924%2033.97%2010.7444%2036.3735C9.82081%2034.1203%209.51395%2031.6077%2010.2904%2029.0679Z'%20fill='%23ADCBE7'/%3e%3cpath%20opacity='0.406087'%20d='M36.4864%2056.8021L36.1373%2056.2691C36.3845%2056.8563%2036.428%2057.5516%2036.2372%2058.1754C35.9273%2059.189%2034.5593%2059.1971%2034.0713%2058.2806L28.3787%2047.5877C28.0534%2046.9767%2027.3508%2046.7619%2026.7395%2047.0866L25.7206%2047.6277L31.4395%2059.3516C31.7648%2059.9627%2032.27%2060.5434%2032.8706%2060.8123C33.7054%2061.1528%2034.6593%2061.1034%2035.3726%2060.7247C36.0858%2060.3459%2036.6602%2059.5837%2036.8444%2058.7021C37.0351%2058.0783%2036.8117%2057.4132%2036.4864%2056.8021Z'%20fill='white'/%3e%3cpath%20d='M29.8826%2048.4977C29.8006%2048.4726%2029.6368%2048.4225%2029.5799%2048.3155L28.1579%2045.6411C28.0442%2045.4272%2028.1193%2045.1814%2028.3332%2045.0677C28.5472%2044.9539%2028.7929%2045.0291%2028.9067%2045.243L30.3287%2047.9174C30.4424%2048.1313%2030.3673%2048.3771%2030.1534%2048.4908C30.1284%2048.5728%2029.9645%2048.5227%2029.8826%2048.4977Z'%20fill='%23FFF5EB'/%3e%3cellipse%20cx='29.2637'%20cy='54.631'%20rx='1.50593'%20ry='3.17918'%20transform='rotate(-23%2029.2637%2054.631)'%20fill='%23FFC478'/%3e%3cellipse%20cx='34.0592'%20cy='52.4078'%20rx='0.920288'%20ry='1.67325'%20transform='rotate(106%2034.0592%2052.4078)'%20fill='%23FFC478'/%3e%3cpath%20d='M89.1282%2019.2055L68.2257%2026.8725L45.9197%2028.3898L44.4929%2016.4082C44.3371%2013.798%2047.5283%2011.4502%2050.9859%2011.6309L65.1429%2012.369L67.3969%2012.4869C68.5309%2012.5463%2069.7066%2012.3289%2070.7522%2011.8627L78.6899%208.34726C81.725%206.99992%2085.3012%207.87475%2086.2125%2010.1876L89.1282%2019.2055Z'%20fill='url(%23paint8_linear_8481_102191)'/%3e%3cpath%20opacity='0.479771'%20d='M88.6262%2019.0953L68.3101%2026.5288L65.3314%2012.5149L67.5211%2012.6263C68.6228%2012.6824%2069.7652%2012.471%2070.7816%2012.0192L78.4972%208.61266C81.4474%207.30707%2084.9208%208.14856%2085.8036%2010.3829L88.6262%2019.0953Z'%20fill='%23ADCBE7'/%3e%3cpath%20d='M91.6332%2026.6212L46.9517%2036.1186L46.0387%2028.4438L89.2535%2019.2582L91.6332%2026.6212Z'%20fill='%23717DAD'/%3e%3cpath%20d='M102.961%2024.2033C103.125%2024.9722%20102.371%2025.7829%20101.278%2026.015L37.9675%2039.4722C36.8754%2039.7043%2035.8568%2039.2704%2035.6933%2038.5015C35.5301%2037.7336%2036.284%2036.922%2037.3761%2036.6898L100.687%2023.2327C101.779%2023.0005%20102.798%2023.4354%20102.961%2024.2033Z'%20fill='%239ED1FF'/%3e%3cpath%20d='M102.703%2024.1718C102.838%2024.805%20102.067%2025.5045%20100.983%2025.7349L69.5583%2032.4144L69.0712%2030.123L100.496%2023.4436C101.58%2023.2131%20102.569%2023.5394%20102.703%2024.1718Z'%20fill='%2378AFE1'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_8481_102191'%20x1='32.2665'%20y1='59.6553'%20x2='59.0518'%20y2='60.5906'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFFDE0'/%3e%3cstop%20offset='1'%20stop-color='%23FFB362'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_8481_102191'%20x1='67.3434'%20y1='85.966'%20x2='103.216'%20y2='78.3411'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFFABC'/%3e%3cstop%20offset='1'%20stop-color='%23FFA650'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_8481_102191'%20x1='51.4347'%20y1='74.8197'%20x2='91.1539'%20y2='74.8197'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A3C1FF'/%3e%3cstop%20offset='1'%20stop-color='%234243FF'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_8481_102191'%20x1='55.1887'%20y1='89.2031'%20x2='94.9078'%20y2='89.2031'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A3C1FF'/%3e%3cstop%20offset='1'%20stop-color='%234243FF'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_8481_102191'%20x1='94.5023'%20y1='53.1799'%20x2='106.762'%20y2='58.7056'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF9498'/%3e%3cstop%20offset='1'%20stop-color='%23FFD671'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint5_linear_8481_102191'%20x1='74.9906'%20y1='66.9871'%20x2='94.9778'%20y2='46.9999'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFFDE0'/%3e%3cstop%20offset='1'%20stop-color='%23FFB362'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint6_linear_8481_102191'%20x1='50.5805'%20y1='44.0581'%20x2='59.9372'%20y2='44.0581'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='white'/%3e%3cstop%20offset='1'%20stop-color='%23E3EEF3'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint7_linear_8481_102191'%20x1='88.4187'%20y1='43.3906'%20x2='99.3981'%20y2='25.1833'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF9498'/%3e%3cstop%20offset='1'%20stop-color='%23FFD671'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint8_linear_8481_102191'%20x1='56.4985'%20y1='29.5482'%20x2='100.532'%20y2='20.1885'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23ECF7FF'/%3e%3cstop%20offset='1'%20stop-color='%23C2E0FF'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",c_=()=>d.jsxs(u.Box,{justifyItems:"center",marginTop:"40px",children:[d.jsx("img",{src:i_,width:124,height:107}),d.jsx(u.Typography,{variant:"body2",color:u.theme.palette.gray.gray3,children:FI})]}),l_=({searchResults:e,selectedObject:t,onReset:n,fetchCards:r})=>{const o=Qt(),{sendTrackingEvent:s,currentSmIds:a}=I.useContext(We),[i,c]=I.useState(null),l=et(LI,{count:e.length.toString(),countSuffix:e.length>1?"s":"",searchObject:t.objectName,connectorName:t.connectorName}),f=(x,b)=>{s(K3,{search_keyword:t.label,search_result_label:b,sm_ids:a,connector_name:t.connectorName}),c({externalResourceId:x,formId:t.value.toString(),searchKeyword:t.label,searchResultLabel:b})},g=()=>{c(null),o(jE())},y=()=>{n(),r(),g()};return e.length?i?d.jsx(a_,{meta:i,onBack:g,onLink:y}):d.jsxs(u.Stack,{gap:"14px",marginTop:"12px",children:[d.jsx(u.Typography,{variant:"body2",children:l}),d.jsx(u.Stack,{gap:"17px",children:e==null?void 0:e.map(({externalResourceId:x,name:b,description:p})=>d.jsxs(Xp,{onClick:()=>f(x,b),direction:"row",children:[d.jsxs(u.Stack,{flexGrow:1,children:[d.jsx(u.Typography,{variant:"body2",color:u.theme.palette.gray.gray1,children:b}),d.jsx(u.Typography,{variant:"caption",color:u.theme.palette.gray.gray3,children:p})]}),d.jsx(u.Box,{alignSelf:"center",className:"search-item__chevron",width:"20px",height:"20px",children:d.jsx("img",{src:t_})})]},x))})]}):d.jsx(c_,{})},il=u.styled(u.Skeleton)`
1561
1571
  display: block;
1562
1572
  margin: ${e=>e.margin?e.margin:0};
1563
- `,l_=()=>d.jsxs(u.Stack,{marginTop:"12px",children:[d.jsx(il,{variant:"rounded",width:"50%",height:"16px",animation:"wave",margin:"0 0 18px 0"}),d.jsx(u.Stack,{gap:"17px",children:d.jsxs(Xp,{gap:"8px",disableHover:!0,children:[d.jsx(il,{variant:"rounded",width:"30%",height:"16px",animation:"wave"}),d.jsx(il,{variant:"rounded",width:"70%",height:"16px",animation:"wave"})]})})]});let cl={};const ll=new Set,u_=(e,t)=>{cl={...cl,[e]:t},ll.forEach(n=>n())},d_=e=>(ll.add(e),()=>ll.delete(e)),f_=e=>I.useSyncExternalStore(d_,()=>cl)[e],p_=async({id:e,searchString:t,args:n})=>{try{if(e===void 0||t===void 0)return[];const r=await xe({url:JI.replace(":formId",e.toString()),method:Fe.POST,data:{search_string:t,args:n}});let o=null;return r!=null&&r.data&&"data"in r.data&&(o=r.data.data),o}catch(r){Ie({message:vn,type:Ye}),console.error(r)}},h_=(e,t)=>Zt({mutationFn:p_,onMutate:({searchString:n,connectorName:r})=>{e(n,r)},onSuccess:(n,{searchString:r,connectorName:o})=>{t(r,n,o)}}),ul={OPEN_FORM_VIEW:"connector-agent-open-form-view"},g_=(e,t={})=>{const{delayAfterLoad:n=1e3}=t,r=I.useRef(!1),o=I.useRef(void 0),s=I.useCallback((c="auto")=>{const l=e.current;l&&l.scrollIntoView({behavior:c})},[e]),a=I.useCallback((c,l="smooth")=>{r.current||(o.current!==void 0&&clearTimeout(o.current),c&&(o.current=setTimeout(()=>{s(l),r.current=!0},n)))},[s,n]),i=I.useCallback(()=>{r.current=!1,o.current!==void 0&&clearTimeout(o.current)},[]);return I.useEffect(()=>()=>{o.current!==void 0&&clearTimeout(o.current)},[]),{scrollOnceAfterLoad:a,resetScrollState:i,hasScrolledOnce:r.current}},m_=e=>A.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},A.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.86993 0.652446C7.56922 0.248711 8.43078 0.248711 9.13007 0.652446L13.7981 3.34755C14.4974 3.75129 14.9282 4.49742 14.9282 5.30489V10.6951C14.9282 11.5026 14.4974 12.2487 13.7981 12.6524L9.13007 15.3476C8.43078 15.7513 7.56922 15.7513 6.86993 15.3476L2.20187 12.6524C1.50258 12.2487 1.0718 11.5026 1.0718 10.6951V5.30489C1.0718 4.49742 1.50258 3.75129 2.20187 3.34755L6.86993 0.652446Z",fill:"#FFD122"}),A.createElement("g",{filter:"url(#filter0_d_360_39563)"},A.createElement("path",{d:"M5.83154 4.43359V4.43359C6.84296 4.43359 7.66287 5.25351 7.66287 6.26492V11.5179V11.5179C6.65146 11.5179 5.83154 10.698 5.83154 9.68661V4.43359Z",fill:"white"})),A.createElement("g",{filter:"url(#filter1_d_360_39563)"},A.createElement("path",{d:"M8.57812 7.66211V7.66211C9.58954 7.66211 10.4095 8.48202 10.4095 9.49343V11.7103V11.7103C9.39804 11.7103 8.57812 10.8904 8.57812 9.87898V7.66211Z",fill:"white"})),A.createElement("defs",null,A.createElement("filter",{id:"filter0_d_360_39563",x:4.76488,y:3.36693,width:3.96488,height:9.21732,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},A.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),A.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),A.createElement("feOffset",null),A.createElement("feGaussianBlur",{stdDeviation:.533333}),A.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.114019 0"}),A.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_360_39563"}),A.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_360_39563",result:"shape"})),A.createElement("filter",{id:"filter1_d_360_39563",x:7.51146,y:6.59544,width:3.96488,height:6.18216,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},A.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),A.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),A.createElement("feOffset",null),A.createElement("feGaussianBlur",{stdDeviation:.533333}),A.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.114019 0"}),A.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_360_39563"}),A.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_360_39563",result:"shape"})))),b_="/v1/api/connectors/lookup/bulk",y_="/v1/api/connectors/lookup/bulk",C_=async e=>{const t=new URLSearchParams;e.forEach(o=>t.append("connector_ids",o));const n=`${b_}?${t.toString()}`,r=await xe({url:n,method:Fe.GET});return r==null?void 0:r.data},x_=async e=>{const t=await xe({url:y_,method:Fe.PUT,data:{entries:e}});return t==null?void 0:t.data},E_={fontSize:"14px",width:"209px",height:"40px",background:"#F6F8FC",borderRadius:"8px",fontWeight:400,"& .MuiOutlinedInput-notchedOutline":{borderColor:"#ECEFF6"}},v_={border:`1px solid ${u.theme.palette.gray.gray5}`,borderRadius:"8px",padding:"12px"},zp={flex:1,height:"1px",backgroundColor:u.theme.palette.gray.gray6},w_={flexShrink:0,border:`1px solid ${u.theme.palette.gray.gray6}`,borderRadius:"15px"},I_={border:`1px solid ${u.theme.palette.gray.gray6}`,backgroundColor:u.theme.palette.gray.gray6a,borderRadius:"8px",padding:"8px 10px"},__=I.memo(function({connector:t,selectedHiverParam:n,onChange:r,sendTrackingEvent:o}){var i;const s=((i=(t.presets??[]).find(c=>c.hiverParam===n))==null?void 0:i.objectParamLabel)??"",a=I.useCallback(c=>{o(i5,{hiver_param:c.target.value,connector_name:t.connectorName,page:"agent_connector_panel"}),r(t.connectorId,c.target.value)},[t.connectorId,t.connectorName,r,o]);return d.jsxs(u.Stack,{direction:"row",alignItems:"center",gap:"0px",justifyContent:"space-between",children:[d.jsx(u.Select,{value:n,onChange:a,size:"small",variant:"outlined",sx:E_,MenuProps:{sx:{zIndex:1500}},renderValue:c=>{var f;const l=((f=(t.presets??[]).find(g=>g.hiverParam===c))==null?void 0:f.label)??"";return d.jsxs(u.Stack,{direction:"row",alignItems:"center",gap:"8px",children:[d.jsx(m_,{width:18,height:18}),d.jsx("span",{children:l})]})},children:(t.presets??[]).map(c=>d.jsx(u.MenuItem,{value:c.hiverParam,sx:{fontSize:"14px"},children:c.label},c.hiverParam))}),d.jsx(u.Box,{sx:zp}),d.jsxs(u.Stack,{direction:"row",alignItems:"center",gap:"4px",padding:"4px 12px",sx:w_,children:[t.logo&&d.jsx("img",{src:t.logo,width:16,height:16,alt:t.connectorName}),d.jsxs(u.Typography,{variant:"body2",color:u.theme.palette.gray.gray3,children:["Matches with ",t.connectorName,"'s"]})]}),d.jsx(u.Box,{sx:zp}),d.jsx(u.Box,{sx:I_,children:d.jsx(u.Typography,{variant:"body2",fontSize:14,children:s})})]})}),S_=I.memo(function({open:t,onClose:n,connectors:r,onSaveSuccess:o}){const{sendTrackingEvent:s}=I.useContext(We),[a,i]=I.useState({});I.useEffect(()=>{if(t&&r.length>0){const b={};r.filter(p=>{var h;return((h=p.presets)==null?void 0:h.length)>1}).forEach(p=>{b[p.connectorId]=p.hiverParam}),i(b)}},[t,r]);const c=Gr(),{mutate:l,isPending:f}=Zt({mutationFn:x_,onSuccess:b=>{const p={};b.results.forEach(({connectorId:h,hiverParam:m})=>{p[h]=m}),c.setQueriesData({queryKey:["lookup","bulk"]},h=>h&&{...h,connectors:h.connectors.map(m=>p[m.connectorId]!==void 0?{...m,hiverParam:p[m.connectorId]}:m)}),s(c5,{page:"agent_connector_panel"}),Ie({message:"Identity mapping saved successfully",type:"success"}),o==null||o(),n()},onError:()=>{Ie({message:"Failed to save identity mapping",type:"error"})}}),g=I.useCallback(()=>{const b=Object.entries(a).map(([p,h])=>({connector_id:p,hiver_param:h}));l(b)},[a,l]),y=I.useCallback((b,p)=>{i(h=>({...h,[b]:p}))},[]),x=I.useCallback(b=>{b||n()},[n]);return d.jsx(Er,{shown:t,setShown:x,showCloseButton:!1,children:d.jsxs(u.Stack,{padding:"24px 20px",gap:"16px",sx:{minWidth:"800px"},children:[d.jsx(u.Typography,{variant:"h2",children:"Customer identity mapping"}),d.jsx(u.Typography,{variant:"body2",children:"Choose how Hiver should identify customers when fetching data from connected apps."}),r.some(b=>{var p;return((p=b.presets)==null?void 0:p.length)>1})&&d.jsx(u.Stack,{gap:"8px",sx:v_,children:r.filter(b=>{var p;return((p=b.presets)==null?void 0:p.length)>1}).map(b=>d.jsx(__,{connector:b,selectedHiverParam:a[b.connectorId]??b.hiverParam,onChange:y,sendTrackingEvent:s},b.connectorId))}),d.jsxs(u.Stack,{direction:"row",justifyContent:"flex-end",gap:"8px",children:[d.jsx(u.Button,{variant:"text",onClick:n,children:"Cancel"}),d.jsx(u.Button,{variant:"contained",onClick:g,disabled:f,children:"Save"})]})]})})}),T_=({enabled:e,...t})=>{const{actionQueue:n}=I.useContext(We);n&&e&&n.register(t),I.useEffect(()=>{if(n)return()=>{n.destroy()}},[n,e])},A_=({isAdmin:e=!1})=>{var ye,rt;const{email:t,currentSmIds:n,sendTrackingEvent:r,availableFeatures:o,conversationId:s}=I.useContext(We),a=Qt(),{userGroupId:i,userId:c}=qt()||{},l=I.useRef(!1),f=I.useRef(null),g=I.useRef(null),y=I.useRef(null),[x,b]=I.useState({}),[p,h]=I.useState(!1),[m,E]=I.useState(!1),[C,w]=I.useState(!1),[v,_]=I.useState(!1),[T,S]=I.useState(),[L,N]=I.useState(!1),[k,D]=I.useState(null),[M,j]=I.useState(),[J,Y]=I.useState(null),[z,H]=I.useState(!1),[q,ne]=I.useState(!1),[ce,V]=I.useState(!1),[R,G]=I.useState(!1),[W,U]=I.useState(void 0),Q=ve(Ev),re=ve(vv),B=ve(Iv),te=ve(_v),pe=ve(Tv),X=ve(wv),Ve=ve(cp),Ge=ve(Vv),at=ve(lp),nt=ve(up),Vt=ve(dp),pt=ve(Ww),ht=Ke(o,u5),Qe=Ke(o,wd),An=Ke(o,m5),_t=Ke(o,y5),vo=Ke(o,C5),$n=Ke(o,x5),Fr=(ye=qt())==null?void 0:ye.tenantPlatform,gt=Ke(o,Fr==="HIVERWEB"?`hot-${Id}`:Id),{data:gn}=Wt({queryKey:["connectors","enabledAuthenticated"],queryFn:i6,enabled:gt&&e}),kr=I.useMemo(()=>(gn??[]).map(oe=>oe.id),[gn]),{data:Gt,isSuccess:wo}=Wt({queryKey:["lookup","bulk",kr.join(",")],queryFn:()=>C_(kr),enabled:kr.length>0&&gt&&e,refetchOnMount:!1}),Un=wo&&((Gt==null?void 0:Gt.connectors)??[]).some(oe=>{var he;return(((he=oe.presets)==null?void 0:he.length)??0)>1});T_({conversationId:s,openCreateForm:()=>w(!0),enabled:re});const Pt=I.useMemo(()=>!Q||!Q.length?null:Fv(Q,B,te),[Q,B,te]),Ln=P5(B),{data:Io,isLoading:Kn}=Wp({senderEmail:t,conversationId:String(s),enabled:_t&&!!t}),{emailHeaders:mn,selectedEmail:Dr}=Io??{},{scrollOnceAfterLoad:_o,resetScrollState:On}=g_(g),Nr=X!==ee.LOADING&&(!te||!Object.values(te).some(oe=>oe===ee.LOADING))&&Q&&Q.length>0;I.useLayoutEffect(()=>{var oe;z&&!p&&q&&((oe=y==null?void 0:y.current)!=null&&oe.scrollHeight)&&_o(!!Nr,"smooth")},[z,p,q,Nr,_o,(rt=y==null?void 0:y.current)==null?void 0:rt.scrollHeight,c]);const bn=(oe,he)=>{r(Q3,{search_keyword:oe,sm_ids:n,connector_name:he,suggestion_type:pt})},Rr=(oe,he,He)=>{!Array.isArray(he)||!he.length?r($3,{search_keyword:oe,sm_ids:n,connector_name:He,suggestion_type:pt}):he.length&&r(U3,{num_of_results:he.length,search_keyword:oe,sm_ids:n,connector_name:He,suggestion_type:pt})},{mutate:Mr,reset:Pr,data:us,isPending:So,isIdle:To}=h_(bn,Rr),er=I.useCallback(()=>{Pr(),D(null)},[Pr,D]),tr=Gr(),ae=I.useCallback(()=>{t&&n.length&&s&&a(Ba({inboxIds:n,conversationId:s}))},[a,t,n,s]),_e=I.useCallback(()=>{tr.invalidateQueries({queryKey:["lookup","bulk"]}),ae()},[tr,ae]),$e=I.useCallback((oe,he)=>{oe&&s&&he&&a(ja({id:oe,channelType:"email",conversationId:s,externalResourceId:he,contactEmail:t})).unwrap().catch(()=>{a(ao(null))})},[a,s,t]);if(I.useEffect(()=>{(async()=>{c&&(H(await xi(c)),ne(await yu(c)))})()},[c]),I.useEffect(()=>{Kn||j(Dr||t)},[t,Dr,Kn]),I.useEffect(()=>{M&&s&&u_(String(s),M)},[M,s]),I.useEffect(()=>{q&&c&&Cu(c)},[q,c]),I.useEffect(()=>{var oe;if(nt){E(!0);const{externalResourceId:he}=nt,He=(oe=nt.forms.find(Tt=>Tt.type==="edit"))==null?void 0:oe.id;$e(He,he)}else E(!1),a(mv())},[nt,$e,a]),I.useEffect(()=>(ae(),On(),()=>{a(ap.clearConnectorList())}),[a,ae,On]),I.useEffect(()=>{if(pe&&Q&&Q.length&&Pt&&!l.current){const{cards_per_app:oe,total_empty_cards:he,total_cards_with_errors:He}=Pt;r(I3,{numOfCards:Q.length,total_cards_loaded:Q.length,total_empty_cards:he,total_cards_with_errors:He,cards_per_app:oe,sm_ids:n}),l.current=!0}return()=>{l.current=!1}},[pe,Q,Pt,r,n]),I.useEffect(()=>{s&&n&&n.length&&a(Da({inboxIds:n,conversationId:s,channelType:"email",isExpandedFormEnabled:$n}))},[a,n,s,$n]),I.useEffect(()=>{const oe=he=>{var Tt;if(!(he instanceof CustomEvent))return;const He=(Tt=he.detail)==null?void 0:Tt.connectorKey;b({connectorKey:He})};return window.addEventListener(ul.OPEN_FORM_VIEW,oe),()=>{window.removeEventListener(ul.OPEN_FORM_VIEW,oe)}},[]),I.useEffect(()=>{if(!(Ve!=null&&Ve.length)||!x.connectorKey)return;const oe=x.connectorKey;b({});const he=Ve.find(He=>{var Tt;return((Tt=He.connectorKey)==null?void 0:Tt.toLowerCase())===(oe==null?void 0:oe.toLowerCase())});he&&(Y(he),w(!0))},[Ve,x]),!t.length||X===ee.LOADING)return d.jsx(Aw,{});const it=oe=>{r(L3,{connector_name:Ge,source:oe,sm_ids:n})},St=oe=>{w(!0),it(oe)},yn=()=>{_(!0),r(O3)},mt=oe=>{r(oe,T),Vt?N(!0):(w(!1),Y(null))},Fn=oe=>{if(nt){const{connectorName:he,title:He}=nt;r(oe,{connector_name:he,card_title:He,sm_ids:n,ug_id:i})}Vt?N(!0):a(ao(null))},O=()=>{w(!1),a(ao(null)),S(void 0),N(!1)},Z=()=>{ae(),w(!1),E(!1),a(ap.clearConnectorList())},$=[{label:"Go back",variant:"text",action:O},{label:"Stay",variant:"contained",action:()=>N(!1)}],le=Ve.length>0,Ce=at.length>0,Me=C||m||v,Ee=()=>le||Ce?d.jsx(xI,{haveCreateObjects:le,haveLinkObjects:Ce,onCreateClick:()=>St(Rd.MAIN_BUTTON),onLinkClick:()=>_(!0)}):d.jsx(gp,{isAdmin:e,hideHeading:!0});return d.jsxs(Xd,{ref:f,"data-testid":Array.isArray(Q)?"connector-agent":"loading",id:"connector-agent-container",stopOverflow:C||v,children:[d.jsx(Fp,{shown:L,setShown:N,title:av,description:iv,buttons:$}),d.jsx(m4,{onWheel:()=>h(!0),ref:y,children:re?d.jsxs(d.Fragment,{children:[d.jsx(J4,{connectors:Ln,isWriteFlowEnabled:Qe,haveCreateObjects:le,haveLinkObjects:Ce,cards:Q,handleCreateNewObject:()=>St(Rd.ICON),handleLinkNewObject:yn}),An&&!Me?d.jsx(KI,{selectedObject:k,setSelectedObject:D,fetchSearchResults:Mr,onReset:er,root:f.current}):null,d.jsxs(io,{children:[d.jsx(In,{condition:An&&So,children:d.jsx(l_,{})},"search"),d.jsx(In,{condition:An&&!!k&&!To,children:d.jsx(c_,{searchResults:us??[],selectedObject:k,onReset:er,fetchCards:ae})},"results"),d.jsx(In,{condition:C,children:d.jsx(ol,{onClose:()=>mt(M3),title:Qi,rightNode:d.jsx(gI,{formId:W,conversationId:s,inboxIds:n,enabled:C&&!!W,setMapFormOpen:V}),children:d.jsx(Dp,{onClose:()=>mt(R3),onCreateSuccess:Z,metaData:T,setMetaData:S,defaultOption:J,connectors:Ln,mapFormOpen:ce,setMapFormOpen:V,setCreateFormId:U})})},"create-form"),d.jsx(In,{condition:m,children:d.jsx(ol,{onClose:()=>Fn(W3),title:L5,backButtonTooltip:"Back",children:d.jsx(Dp,{isEdit:!0,onClose:()=>Fn(H3),onCreateSuccess:Z,metaData:T,setMetaData:S,connectors:Ln})})},"edit-form"),d.jsx(In,{condition:v,children:d.jsx(ol,{onClose:()=>_(!1),children:d.jsx(hI,{setOpenTaskLinking:_,onLinkingSuccess:ae})})},"link-form"),d.jsxs(In,{fallback:!0,children:[_t&&(Q!=null&&Q.length)?d.jsxs(u.Stack,{direction:"row",alignItems:"center",gap:"8px",children:[d.jsx(u.Stack,{sx:{flex:1,minWidth:0},children:d.jsx(jw,{emailHeaders:mn,selectedEmail:M,root:f.current,isLoading:Kn,setSelectedEmail:j})}),gt&&Un&&e&&d.jsx(u.Tooltip,{title:"Update customer identity mapping",placement:"top",children:d.jsx(u.IconButton,{"aria-label":"Open customer identity mapping settings",sx:{height:"32px",width:"32px",marginTop:"12px",flexShrink:0},onClick:()=>{r(vd,{page:"agent_connector_panel"}),G(!0)},children:d.jsx(u.icons.SettingsOutlined,{sx:{height:"20px",width:"20px"}})})})]}):null,!_t&&gt&&Un&&e&&(Q!=null&&Q.length)?d.jsx(u.Button,{fullWidth:!0,variant:"contained",startIcon:d.jsx(u.icons.SettingsOutlined,{sx:{height:"14px",width:"14px"}}),sx:{backgroundColor:"#edf1f6",color:"#4d596c",borderRadius:"6px",padding:"9px 12px",marginTop:"12px",textTransform:"none",fontWeight:500,fontSize:"14px",lineHeight:"20px",boxShadow:"none","&:hover":{backgroundColor:"#e2e8f0",boxShadow:"none"}},onClick:()=>{r(vd,{page:"agent_connector_panel"}),G(!0)},children:"Customer identity mapping"}):null,ht?d.jsx(Lw,{}):null,d.jsxs(io,{children:[d.jsxs(In,{condition:!!Q&&Q.length>0,children:[d.jsx(rw,{cards:Q,specificCardData:B,email:M??"",specificConnectorApiStatus:te,onCardUnlinking:ae}),d.jsx("div",{ref:g,children:vo?d.jsx(q5,{connectors:Ln,expanded:z}):null})]},"cards-list"),d.jsx(In,{condition:!(Q!=null&&Q.length)&&Qe,children:Ee()},"create-banner")]})]},"cards")]})]}):d.jsx(gp,{isAdmin:e})}),!re&&d.jsx(i4,{}),gt&&d.jsx(S_,{open:R,onClose:()=>G(!1),connectors:(Gt==null?void 0:Gt.connectors)??[],onSaveSuccess:_e})]})},L_=({children:e,sendTrackingEvent:t,contactEmail:n,baseUrls:r={},currentSmIds:o=[],userEmail:s,metaData:a,availableFeatures:i,conversationId:c,connectorFunctions:l,stackingContext:f,isAdmin:g=!1,actionQueue:y,variables:x})=>{const b=I.useMemo(()=>({userEmail:s,email:n,baseUrls:r,currentSmIds:o,metaData:a,conversationId:c,sendTrackingEvent:t||(()=>{}),availableFeatures:i,isAdmin:g,connectorFunctions:l,stackingContext:f,actionQueue:y,variables:x}),[s,n,r,t,o,a,i,c,g,l,f,y,x]);return d.jsx(We.Provider,{value:b,children:e})},dl=({children:e})=>{const[t]=I.useState(()=>new eh);return d.jsx(sh,{client:t,children:e})},O_=i0({cardList:Pv,write:bv,common:BE}),fl=hy({reducer:O_,devTools:!0}),F_=({children:e,userEmail:t,extraParams:n,contactEmail:r,baseUrls:o,availableFeatures:s,connectorFunctions:a,stackingContext:i,actionQueue:c})=>d.jsx(ac,{store:fl,children:d.jsx(u.HiverProvider,{inter:!0,children:d.jsx(dl,{children:d.jsx(L_,{...n,userEmail:t,availableFeatures:s,sendTrackingEvent:n==null?void 0:n.sendTrackingEvent,contactEmail:r,currentSmIds:n==null?void 0:n.currentSmIds,metaData:n==null?void 0:n.metaData,conversationId:n==null?void 0:n.conversationId,baseUrls:o,connectorFunctions:a,stackingContext:i,actionQueue:c,isAdmin:n==null?void 0:n.isAdmin,children:d.jsx(I.Suspense,{fallback:d.jsx(d.Fragment,{}),children:e})})})})}),pl=u.styled(u.Box)`
1573
+ `,u_=()=>d.jsxs(u.Stack,{marginTop:"12px",children:[d.jsx(il,{variant:"rounded",width:"50%",height:"16px",animation:"wave",margin:"0 0 18px 0"}),d.jsx(u.Stack,{gap:"17px",children:d.jsxs(Xp,{gap:"8px",disableHover:!0,children:[d.jsx(il,{variant:"rounded",width:"30%",height:"16px",animation:"wave"}),d.jsx(il,{variant:"rounded",width:"70%",height:"16px",animation:"wave"})]})})]});let cl={};const ll=new Set,d_=(e,t)=>{cl={...cl,[e]:t},ll.forEach(n=>n())},f_=e=>(ll.add(e),()=>ll.delete(e)),p_=e=>I.useSyncExternalStore(f_,()=>cl)[e],h_=async({id:e,searchString:t,args:n})=>{try{if(e===void 0||t===void 0)return[];const r=await xe({url:qI.replace(":formId",e.toString()),method:Fe.POST,data:{search_string:t,args:n}});let o=null;return r!=null&&r.data&&"data"in r.data&&(o=r.data.data),o}catch(r){Ie({message:vn,type:Ye}),console.error(r)}},g_=(e,t)=>Zt({mutationFn:h_,onMutate:({searchString:n,connectorName:r})=>{e(n,r)},onSuccess:(n,{searchString:r,connectorName:o})=>{t(r,n,o)}}),ul={OPEN_FORM_VIEW:"connector-agent-open-form-view"},m_=(e,t={})=>{const{delayAfterLoad:n=1e3}=t,r=I.useRef(!1),o=I.useRef(void 0),s=I.useCallback((c="auto")=>{const l=e.current;l&&l.scrollIntoView({behavior:c})},[e]),a=I.useCallback((c,l="smooth")=>{r.current||(o.current!==void 0&&clearTimeout(o.current),c&&(o.current=setTimeout(()=>{s(l),r.current=!0},n)))},[s,n]),i=I.useCallback(()=>{r.current=!1,o.current!==void 0&&clearTimeout(o.current)},[]);return I.useEffect(()=>()=>{o.current!==void 0&&clearTimeout(o.current)},[]),{scrollOnceAfterLoad:a,resetScrollState:i,hasScrolledOnce:r.current}},b_=e=>A.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},A.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.86993 0.652446C7.56922 0.248711 8.43078 0.248711 9.13007 0.652446L13.7981 3.34755C14.4974 3.75129 14.9282 4.49742 14.9282 5.30489V10.6951C14.9282 11.5026 14.4974 12.2487 13.7981 12.6524L9.13007 15.3476C8.43078 15.7513 7.56922 15.7513 6.86993 15.3476L2.20187 12.6524C1.50258 12.2487 1.0718 11.5026 1.0718 10.6951V5.30489C1.0718 4.49742 1.50258 3.75129 2.20187 3.34755L6.86993 0.652446Z",fill:"#FFD122"}),A.createElement("g",{filter:"url(#filter0_d_360_39563)"},A.createElement("path",{d:"M5.83154 4.43359V4.43359C6.84296 4.43359 7.66287 5.25351 7.66287 6.26492V11.5179V11.5179C6.65146 11.5179 5.83154 10.698 5.83154 9.68661V4.43359Z",fill:"white"})),A.createElement("g",{filter:"url(#filter1_d_360_39563)"},A.createElement("path",{d:"M8.57812 7.66211V7.66211C9.58954 7.66211 10.4095 8.48202 10.4095 9.49343V11.7103V11.7103C9.39804 11.7103 8.57812 10.8904 8.57812 9.87898V7.66211Z",fill:"white"})),A.createElement("defs",null,A.createElement("filter",{id:"filter0_d_360_39563",x:4.76488,y:3.36693,width:3.96488,height:9.21732,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},A.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),A.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),A.createElement("feOffset",null),A.createElement("feGaussianBlur",{stdDeviation:.533333}),A.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.114019 0"}),A.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_360_39563"}),A.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_360_39563",result:"shape"})),A.createElement("filter",{id:"filter1_d_360_39563",x:7.51146,y:6.59544,width:3.96488,height:6.18216,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},A.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),A.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),A.createElement("feOffset",null),A.createElement("feGaussianBlur",{stdDeviation:.533333}),A.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.114019 0"}),A.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_360_39563"}),A.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_360_39563",result:"shape"})))),y_="/v1/api/connectors/lookup/bulk",C_="/v1/api/connectors/lookup/bulk",x_=async e=>{const t=new URLSearchParams;e.forEach(o=>t.append("connector_ids",o));const n=`${y_}?${t.toString()}`,r=await xe({url:n,method:Fe.GET});return r==null?void 0:r.data},E_=async e=>{const t=await xe({url:C_,method:Fe.PUT,data:{entries:e}});return t==null?void 0:t.data},v_={fontSize:"14px",width:"209px",height:"40px",background:"#F6F8FC",borderRadius:"8px",fontWeight:400,"& .MuiOutlinedInput-notchedOutline":{borderColor:"#ECEFF6"}},w_={border:`1px solid ${u.theme.palette.gray.gray5}`,borderRadius:"8px",padding:"12px"},zp={flex:1,height:"1px",backgroundColor:u.theme.palette.gray.gray6},I_={flexShrink:0,border:`1px solid ${u.theme.palette.gray.gray6}`,borderRadius:"15px"},__={border:`1px solid ${u.theme.palette.gray.gray6}`,backgroundColor:u.theme.palette.gray.gray6a,borderRadius:"8px",padding:"8px 10px"},S_=I.memo(function({connector:t,selectedHiverParam:n,onChange:r,sendTrackingEvent:o}){var i;const s=((i=(t.presets??[]).find(c=>c.hiverParam===n))==null?void 0:i.objectParamLabel)??"",a=I.useCallback(c=>{o(i5,{hiver_param:c.target.value,connector_name:t.connectorName,page:"agent_connector_panel"}),r(t.connectorId,c.target.value)},[t.connectorId,t.connectorName,r,o]);return d.jsxs(u.Stack,{direction:"row",alignItems:"center",gap:"0px",justifyContent:"space-between",children:[d.jsx(u.Select,{value:n,onChange:a,size:"small",variant:"outlined",sx:v_,MenuProps:{sx:{zIndex:1500}},renderValue:c=>{var f;const l=((f=(t.presets??[]).find(g=>g.hiverParam===c))==null?void 0:f.label)??"";return d.jsxs(u.Stack,{direction:"row",alignItems:"center",gap:"8px",children:[d.jsx(b_,{width:18,height:18}),d.jsx("span",{children:l})]})},children:(t.presets??[]).map(c=>d.jsx(u.MenuItem,{value:c.hiverParam,sx:{fontSize:"14px"},children:c.label},c.hiverParam))}),d.jsx(u.Box,{sx:zp}),d.jsxs(u.Stack,{direction:"row",alignItems:"center",gap:"4px",padding:"4px 12px",sx:I_,children:[t.logo&&d.jsx("img",{src:t.logo,width:16,height:16,alt:t.connectorName}),d.jsxs(u.Typography,{variant:"body2",color:u.theme.palette.gray.gray3,children:["Matches with ",t.connectorName,"'s"]})]}),d.jsx(u.Box,{sx:zp}),d.jsx(u.Box,{sx:__,children:d.jsx(u.Typography,{variant:"body2",fontSize:14,children:s})})]})}),T_=I.memo(function({open:t,onClose:n,connectors:r,onSaveSuccess:o}){const{sendTrackingEvent:s}=I.useContext(We),[a,i]=I.useState({});I.useEffect(()=>{if(t&&r.length>0){const b={};r.filter(p=>{var h;return((h=p.presets)==null?void 0:h.length)>1}).forEach(p=>{b[p.connectorId]=p.hiverParam}),i(b)}},[t,r]);const c=Gr(),{mutate:l,isPending:f}=Zt({mutationFn:E_,onSuccess:b=>{const p={};b.results.forEach(({connectorId:h,hiverParam:m})=>{p[h]=m}),c.setQueriesData({queryKey:["lookup","bulk"]},h=>h&&{...h,connectors:h.connectors.map(m=>p[m.connectorId]!==void 0?{...m,hiverParam:p[m.connectorId]}:m)}),s(c5,{page:"agent_connector_panel"}),Ie({message:"Identity mapping saved successfully",type:"success"}),o==null||o(),n()},onError:()=>{Ie({message:"Failed to save identity mapping",type:"error"})}}),g=I.useCallback(()=>{const b=Object.entries(a).map(([p,h])=>({connector_id:p,hiver_param:h}));l(b)},[a,l]),y=I.useCallback((b,p)=>{i(h=>({...h,[b]:p}))},[]),x=I.useCallback(b=>{b||n()},[n]);return d.jsx(Er,{shown:t,setShown:x,showCloseButton:!1,children:d.jsxs(u.Stack,{padding:"24px 20px",gap:"16px",sx:{minWidth:"800px"},children:[d.jsx(u.Typography,{variant:"h2",children:"Customer identity mapping"}),d.jsx(u.Typography,{variant:"body2",children:"Choose how Hiver should identify customers when fetching data from connected apps."}),r.some(b=>{var p;return((p=b.presets)==null?void 0:p.length)>1})&&d.jsx(u.Stack,{gap:"8px",sx:w_,children:r.filter(b=>{var p;return((p=b.presets)==null?void 0:p.length)>1}).map(b=>d.jsx(S_,{connector:b,selectedHiverParam:a[b.connectorId]??b.hiverParam,onChange:y,sendTrackingEvent:s},b.connectorId))}),d.jsxs(u.Stack,{direction:"row",justifyContent:"flex-end",gap:"8px",children:[d.jsx(u.Button,{variant:"text",onClick:n,children:"Cancel"}),d.jsx(u.Button,{variant:"contained",onClick:g,disabled:f,children:"Save"})]})]})})}),A_=({enabled:e,...t})=>{const{actionQueue:n}=I.useContext(We);n&&e&&n.register(t),I.useEffect(()=>{if(n)return()=>{n.destroy()}},[n,e])},L_=({isAdmin:e=!1})=>{var ye,rt;const{email:t,currentSmIds:n,sendTrackingEvent:r,availableFeatures:o,conversationId:s}=I.useContext(We),a=Qt(),{userGroupId:i,userId:c}=qt()||{},l=I.useRef(!1),f=I.useRef(null),g=I.useRef(null),y=I.useRef(null),[x,b]=I.useState({}),[p,h]=I.useState(!1),[m,E]=I.useState(!1),[C,w]=I.useState(!1),[v,_]=I.useState(!1),[T,S]=I.useState(),[L,N]=I.useState(!1),[k,D]=I.useState(null),[M,j]=I.useState(),[J,Y]=I.useState(null),[z,H]=I.useState(!1),[q,ne]=I.useState(!1),[ce,V]=I.useState(!1),[R,G]=I.useState(!1),[W,U]=I.useState(void 0),Q=ve(vv),re=ve(wv),B=ve(_v),te=ve(Sv),pe=ve(Av),X=ve(Iv),Ve=ve(cp),Ge=ve(Gv),at=ve(lp),nt=ve(up),Vt=ve(dp),pt=ve(Zw),ht=Ke(o,u5),Qe=Ke(o,wd),An=Ke(o,m5),_t=Ke(o,y5),vo=Ke(o,C5),$n=Ke(o,x5),Fr=(ye=qt())==null?void 0:ye.tenantPlatform,gt=Ke(o,Fr==="HIVERWEB"?`hot-${Id}`:Id),{data:gn}=Wt({queryKey:["connectors","enabledAuthenticated"],queryFn:i6,enabled:gt&&e}),kr=I.useMemo(()=>(gn??[]).map(oe=>oe.id),[gn]),{data:Gt,isSuccess:wo}=Wt({queryKey:["lookup","bulk",kr.join(",")],queryFn:()=>x_(kr),enabled:kr.length>0&&gt&&e,refetchOnMount:!1}),Un=wo&&((Gt==null?void 0:Gt.connectors)??[]).some(oe=>{var he;return(((he=oe.presets)==null?void 0:he.length)??0)>1});A_({conversationId:s,openCreateForm:()=>w(!0),enabled:re});const Pt=I.useMemo(()=>!Q||!Q.length?null:kv(Q,B,te),[Q,B,te]),Ln=P5(B),{data:Io,isLoading:Kn}=Wp({senderEmail:t,conversationId:String(s),enabled:_t&&!!t}),{emailHeaders:mn,selectedEmail:Dr}=Io??{},{scrollOnceAfterLoad:_o,resetScrollState:On}=m_(g),Nr=X!==ee.LOADING&&(!te||!Object.values(te).some(oe=>oe===ee.LOADING))&&Q&&Q.length>0;I.useLayoutEffect(()=>{var oe;z&&!p&&q&&((oe=y==null?void 0:y.current)!=null&&oe.scrollHeight)&&_o(!!Nr,"smooth")},[z,p,q,Nr,_o,(rt=y==null?void 0:y.current)==null?void 0:rt.scrollHeight,c]);const bn=(oe,he)=>{r(Q3,{search_keyword:oe,sm_ids:n,connector_name:he,suggestion_type:pt})},Rr=(oe,he,He)=>{!Array.isArray(he)||!he.length?r($3,{search_keyword:oe,sm_ids:n,connector_name:He,suggestion_type:pt}):he.length&&r(U3,{num_of_results:he.length,search_keyword:oe,sm_ids:n,connector_name:He,suggestion_type:pt})},{mutate:Mr,reset:Pr,data:us,isPending:So,isIdle:To}=g_(bn,Rr),er=I.useCallback(()=>{Pr(),D(null)},[Pr,D]),tr=Gr(),ae=I.useCallback(()=>{t&&n.length&&s&&a(Ba({inboxIds:n,conversationId:s}))},[a,t,n,s]),_e=I.useCallback(()=>{tr.invalidateQueries({queryKey:["lookup","bulk"]}),ae()},[tr,ae]),$e=I.useCallback((oe,he)=>{oe&&s&&he&&a(ja({id:oe,channelType:"email",conversationId:s,externalResourceId:he,contactEmail:t})).unwrap().catch(()=>{a(ao(null))})},[a,s,t]);if(I.useEffect(()=>{(async()=>{c&&(H(await xi(c)),ne(await yu(c)))})()},[c]),I.useEffect(()=>{Kn||j(Dr||t)},[t,Dr,Kn]),I.useEffect(()=>{M&&s&&d_(String(s),M)},[M,s]),I.useEffect(()=>{q&&c&&Cu(c)},[q,c]),I.useEffect(()=>{var oe;if(nt){E(!0);const{externalResourceId:he}=nt,He=(oe=nt.forms.find(Tt=>Tt.type==="edit"))==null?void 0:oe.id;$e(He,he)}else E(!1),a(bv())},[nt,$e,a]),I.useEffect(()=>(ae(),On(),()=>{a(ap.clearConnectorList())}),[a,ae,On]),I.useEffect(()=>{if(pe&&Q&&Q.length&&Pt&&!l.current){const{cards_per_app:oe,total_empty_cards:he,total_cards_with_errors:He}=Pt;r(I3,{numOfCards:Q.length,total_cards_loaded:Q.length,total_empty_cards:he,total_cards_with_errors:He,cards_per_app:oe,sm_ids:n}),l.current=!0}return()=>{l.current=!1}},[pe,Q,Pt,r,n]),I.useEffect(()=>{s&&n&&n.length&&a(Da({inboxIds:n,conversationId:s,channelType:"email",isExpandedFormEnabled:$n}))},[a,n,s,$n]),I.useEffect(()=>{const oe=he=>{var Tt;if(!(he instanceof CustomEvent))return;const He=(Tt=he.detail)==null?void 0:Tt.connectorKey;b({connectorKey:He})};return window.addEventListener(ul.OPEN_FORM_VIEW,oe),()=>{window.removeEventListener(ul.OPEN_FORM_VIEW,oe)}},[]),I.useEffect(()=>{if(!(Ve!=null&&Ve.length)||!x.connectorKey)return;const oe=x.connectorKey;b({});const he=Ve.find(He=>{var Tt;return((Tt=He.connectorKey)==null?void 0:Tt.toLowerCase())===(oe==null?void 0:oe.toLowerCase())});he&&(Y(he),w(!0))},[Ve,x]),!t.length||X===ee.LOADING)return d.jsx(Lw,{});const it=oe=>{r(L3,{connector_name:Ge,source:oe,sm_ids:n})},St=oe=>{w(!0),it(oe)},yn=()=>{_(!0),r(O3)},mt=oe=>{r(oe,T),Vt?N(!0):(w(!1),Y(null))},Fn=oe=>{if(nt){const{connectorName:he,title:He}=nt;r(oe,{connector_name:he,card_title:He,sm_ids:n,ug_id:i})}Vt?N(!0):a(ao(null))},O=()=>{w(!1),a(ao(null)),S(void 0),N(!1)},Z=()=>{ae(),w(!1),E(!1),a(ap.clearConnectorList())},$=[{label:"Go back",variant:"text",action:O},{label:"Stay",variant:"contained",action:()=>N(!1)}],le=Ve.length>0,Ce=at.length>0,Me=C||m||v,Ee=()=>le||Ce?d.jsx(EI,{haveCreateObjects:le,haveLinkObjects:Ce,onCreateClick:()=>St(Rd.MAIN_BUTTON),onLinkClick:()=>_(!0)}):d.jsx(gp,{isAdmin:e,hideHeading:!0});return d.jsxs(Xd,{ref:f,"data-testid":Array.isArray(Q)?"connector-agent":"loading",id:"connector-agent-container",stopOverflow:C||v,children:[d.jsx(Fp,{shown:L,setShown:N,title:iv,description:cv,buttons:$}),d.jsx(m4,{onWheel:()=>h(!0),ref:y,children:re?d.jsxs(d.Fragment,{children:[d.jsx(J4,{connectors:Ln,isWriteFlowEnabled:Qe,haveCreateObjects:le,haveLinkObjects:Ce,cards:Q,handleCreateNewObject:()=>St(Rd.ICON),handleLinkNewObject:yn}),An&&!Me?d.jsx(e_,{selectedObject:k,setSelectedObject:D,fetchSearchResults:Mr,onReset:er,root:f.current}):null,d.jsxs(io,{children:[d.jsx(In,{condition:An&&So,children:d.jsx(u_,{})},"search"),d.jsx(In,{condition:An&&!!k&&!To,children:d.jsx(l_,{searchResults:us??[],selectedObject:k,onReset:er,fetchCards:ae})},"results"),d.jsx(In,{condition:C,children:d.jsx(ol,{onClose:()=>mt(M3),title:Qi,rightNode:d.jsx(mI,{formId:W,conversationId:s,inboxIds:n,enabled:C&&!!W,setMapFormOpen:V}),children:d.jsx(Dp,{onClose:()=>mt(R3),onCreateSuccess:Z,metaData:T,setMetaData:S,defaultOption:J,connectors:Ln,mapFormOpen:ce,setMapFormOpen:V,setCreateFormId:U})})},"create-form"),d.jsx(In,{condition:m,children:d.jsx(ol,{onClose:()=>Fn(W3),title:L5,backButtonTooltip:"Back",children:d.jsx(Dp,{isEdit:!0,onClose:()=>Fn(H3),onCreateSuccess:Z,metaData:T,setMetaData:S,connectors:Ln})})},"edit-form"),d.jsx(In,{condition:v,children:d.jsx(ol,{onClose:()=>_(!1),children:d.jsx(gI,{setOpenTaskLinking:_,onLinkingSuccess:ae})})},"link-form"),d.jsxs(In,{fallback:!0,children:[_t&&(Q!=null&&Q.length)?d.jsxs(u.Stack,{direction:"row",alignItems:"center",gap:"8px",children:[d.jsx(u.Stack,{sx:{flex:1,minWidth:0},children:d.jsx(Bw,{emailHeaders:mn,selectedEmail:M,root:f.current,isLoading:Kn,setSelectedEmail:j})}),gt&&Un&&e&&d.jsx(u.Tooltip,{title:"Update customer identity mapping",placement:"top",children:d.jsx(u.IconButton,{"aria-label":"Open customer identity mapping settings",sx:{height:"32px",width:"32px",marginTop:"12px",flexShrink:0},onClick:()=>{r(vd,{page:"agent_connector_panel"}),G(!0)},children:d.jsx(u.icons.SettingsOutlined,{sx:{height:"20px",width:"20px"}})})})]}):null,!_t&&gt&&Un&&e&&(Q!=null&&Q.length)?d.jsx(u.Button,{fullWidth:!0,variant:"contained",startIcon:d.jsx(u.icons.SettingsOutlined,{sx:{height:"14px",width:"14px"}}),sx:{backgroundColor:"#edf1f6",color:"#4d596c",borderRadius:"6px",padding:"9px 12px",marginTop:"12px",textTransform:"none",fontWeight:500,fontSize:"14px",lineHeight:"20px",boxShadow:"none","&:hover":{backgroundColor:"#e2e8f0",boxShadow:"none"}},onClick:()=>{r(vd,{page:"agent_connector_panel"}),G(!0)},children:"Customer identity mapping"}):null,ht?d.jsx(Ow,{}):null,d.jsxs(io,{children:[d.jsxs(In,{condition:!!Q&&Q.length>0,children:[d.jsx(ow,{cards:Q,specificCardData:B,email:M??"",specificConnectorApiStatus:te,onCardUnlinking:ae}),d.jsx("div",{ref:g,children:vo?d.jsx(q5,{connectors:Ln,expanded:z}):null})]},"cards-list"),d.jsx(In,{condition:!(Q!=null&&Q.length)&&Qe,children:Ee()},"create-banner")]})]},"cards")]})]}):d.jsx(gp,{isAdmin:e})}),!re&&d.jsx(i4,{}),gt&&d.jsx(T_,{open:R,onClose:()=>G(!1),connectors:(Gt==null?void 0:Gt.connectors)??[],onSaveSuccess:_e})]})},O_=({children:e,sendTrackingEvent:t,contactEmail:n,baseUrls:r={},currentSmIds:o=[],userEmail:s,metaData:a,availableFeatures:i,conversationId:c,connectorFunctions:l,stackingContext:f,isAdmin:g=!1,actionQueue:y,variables:x})=>{const b=I.useMemo(()=>({userEmail:s,email:n,baseUrls:r,currentSmIds:o,metaData:a,conversationId:c,sendTrackingEvent:t||(()=>{}),availableFeatures:i,isAdmin:g,connectorFunctions:l,stackingContext:f,actionQueue:y,variables:x}),[s,n,r,t,o,a,i,c,g,l,f,y,x]);return d.jsx(We.Provider,{value:b,children:e})},dl=({children:e})=>{const[t]=I.useState(()=>new eh);return d.jsx(sh,{client:t,children:e})},F_=i0({cardList:jv,write:yv,common:VE}),fl=hy({reducer:F_,devTools:!0}),k_=({children:e,userEmail:t,extraParams:n,contactEmail:r,baseUrls:o,availableFeatures:s,connectorFunctions:a,stackingContext:i,actionQueue:c})=>d.jsx(ac,{store:fl,children:d.jsx(u.HiverProvider,{inter:!0,children:d.jsx(dl,{children:d.jsx(O_,{...n,userEmail:t,availableFeatures:s,sendTrackingEvent:n==null?void 0:n.sendTrackingEvent,contactEmail:r,currentSmIds:n==null?void 0:n.currentSmIds,metaData:n==null?void 0:n.metaData,conversationId:n==null?void 0:n.conversationId,baseUrls:o,connectorFunctions:a,stackingContext:i,actionQueue:c,isAdmin:n==null?void 0:n.isAdmin,children:d.jsx(I.Suspense,{fallback:d.jsx(d.Fragment,{}),children:e})})})})}),pl=u.styled(u.Box)`
1564
1574
  height: inherit;
1565
1575
  .MuiScopedCssBaseline-root {
1566
1576
  height: inherit;
@@ -1668,7 +1678,7 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
1668
1678
  [hidden] {
1669
1679
  display: none;
1670
1680
  }
1671
- `,k_=u.styled(u.Box)`
1681
+ `,D_=u.styled(u.Box)`
1672
1682
  :root {
1673
1683
  --toastify-color-light: #fff;
1674
1684
  --toastify-color-dark: #121212;
@@ -2399,7 +2409,7 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
2399
2409
  transform: rotate(360deg);
2400
2410
  }
2401
2411
  }
2402
- `,hl=u.styled(k_)`
2412
+ `,hl=u.styled(D_)`
2403
2413
  .Toastify__toast-container {
2404
2414
  min-width: 320px !important;
2405
2415
  font-size: 16px;
@@ -2448,7 +2458,7 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
2448
2458
  align-self: auto !important;
2449
2459
  margin-left: 12px;
2450
2460
  }
2451
- `,D_=({userEmail:e="",contactEmail:t="",baseUrls:n={},extraParams:r={},availableFeatures:o={},connectorFunctions:s,stackingContext:a={},actionQueue:i})=>d.jsx(pl,{children:d.jsxs(F_,{userEmail:e,availableFeatures:o,extraParams:r,contactEmail:t,connectorFunctions:s,stackingContext:a,actionQueue:i,baseUrls:n,children:[d.jsx(A_,{isAdmin:r==null?void 0:r.isAdmin}),je.createPortal(d.jsx(hl,{id:"toast-message",children:d.jsx(Ua,{position:"bottom-left",autoClose:5e3,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,draggable:!0,pauseOnHover:!0,...!!a.toastMessage&&{style:{zIndex:a.toastMessage}}})}),document.body),d.jsx("div",{"data-connectorid":"connector-layover-portal"})]})}),Yp="/v1/api",N_=`${Yp}/connector/conversation/:conversationId/data`,R_=`${Yp}/connector/feedback/conversation/:conversationId`,M_=async(e,t)=>{try{let n=N_.replace(":conversationId",e)+"?channel_type=email";if(t!=null&&t.length){const o=t.map(s=>`inbox_ids=${encodeURIComponent(s)}`).join("&");n+=`&${o}`}const r=await xe({url:n,method:Fe.GET});return r!=null&&r.data&&Array.isArray(r.data)?r.data.reduce((s,a)=>{var i,c;return s[(i=a==null?void 0:a.cardData)==null?void 0:i.textToHighlight]||(s[(c=a==null?void 0:a.cardData)==null?void 0:c.textToHighlight]={...a}),s},{}):null}catch(n){return Promise.reject(n)}};function P_(e,t,n){return Wt({queryKey:["connector-analytics",e,t,n],queryFn:async()=>!t||!e?null:await M_(e,n),enabled:!!t&&!!e})}class j_{constructor(t=[],n=null){Re(this,"highlightTerms");Re(this,"observer");Re(this,"isHighlighting");Re(this,"debounceTimer");Re(this,"debounceDelay");Re(this,"onHighlightsUpdated");this.highlightTerms=t,this.observer=null,this.isHighlighting=!1,this.debounceTimer=null,this.debounceDelay=500,this.onHighlightsUpdated=n,this.init()}init(){this.highlightAllEmails(),this.startObserver()}startObserver(){const t=this.findGmailContainer();if(!t){console.warn("Gmail container not found");return}this.observer=new MutationObserver(n=>{if(this.isHighlighting)return;let r=!1;n.forEach(o=>{o.type==="childList"&&Array.from(o.addedNodes).some(i=>{var c,l,f,g;return i.nodeType===1&&i instanceof Element&&(((c=i.classList)==null?void 0:c.contains("a3s"))||((l=i.classList)==null?void 0:l.contains("ii"))||((f=i.querySelector)==null?void 0:f.call(i,".a3s"))||((g=i.querySelector)==null?void 0:g.call(i,"h2.hP")))})&&(r=!0)}),r&&this.debounceHighlight()}),this.observer.observe(t,{childList:!0,subtree:!0})}findGmailContainer(){return document.querySelector('[role="main"]')||document.querySelector(".nH.if")||document.querySelector(".AO")||document.body}debounceHighlight(){this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.highlightAllEmails()},this.debounceDelay)}highlightAllEmails(){var t;if(this.highlightTerms.length!==0){this.isHighlighting=!0;try{if(this.clearHighlights(),["h2.hP",".ii.gt .a3s.aiL",".ii.gt .a3s",'[data-expanded="true"]'].forEach(r=>{document.querySelectorAll(r).forEach(s=>{this.isElementVisible(s)&&this.highlightInElement(s)})}),this.onHighlightsUpdated){const r=Array.from(document.querySelectorAll(".gmail-highlight"));(t=this.onHighlightsUpdated)==null||t.call(this,r)}}finally{setTimeout(()=>{this.isHighlighting=!1},250)}}}isElementVisible(t){const n=t;return n.offsetParent!==null&&n.offsetWidth>0&&n.offsetHeight>0}highlightInElement(t){if(!t||this.highlightTerms.length===0||t.dataset.highlightProcessed==="true")return;const r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,{acceptNode:a=>a.parentElement&&a.parentElement.classList.contains("gmail-highlight")||a.parentElement&&["SCRIPT","STYLE"].includes(a.parentElement.tagName)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}),o=[];let s;for(;s=r.nextNode();)o.push(s);o.forEach(a=>{this.highlightInTextNode(a)}),t.dataset.highlightProcessed="true"}highlightInTextNode(t){let n=t.textContent,r=!1;if(!n)return;if([...this.highlightTerms].sort((s,a)=>a.length-s.length).forEach(s=>{if(!s||s.trim().length===0)return;const a=this.escapeRegex(s.trim()),i=new RegExp(`\\b${a}\\b`,"gi");i.test(n)&&(n=n.replace(i,`<span class="gmail-highlight" data-highlight-term="${s.trim()}"><span class="gmail-highlight-inner">${s}</span></span>`),r=!0)}),r&&t.parentNode){const s=document.createElement("span");s.innerHTML=n,t.parentNode.replaceChild(s,t)}}clearHighlights(){document.querySelectorAll(".gmail-highlight").forEach(r=>{const o=r.parentNode;o&&r.textContent&&(o.replaceChild(document.createTextNode(r.textContent),r),o.normalize())}),document.querySelectorAll('[data-highlight-processed="true"]').forEach(r=>{delete r.dataset.highlightProcessed})}escapeRegex(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}refreshHighlights(){this.highlightAllEmails()}updateHighlightTerms(t){this.highlightTerms=t||[],this.highlightAllEmails()}destroy(){this.observer&&(this.observer.disconnect(),this.observer=null),this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.clearHighlights(),this.highlightTerms=[]}}if(!document.getElementById("gmail-highlighter-styles")){const e=document.createElement("style");e.id="gmail-highlighter-styles",e.textContent=`
2461
+ `,N_=({userEmail:e="",contactEmail:t="",baseUrls:n={},extraParams:r={},availableFeatures:o={},connectorFunctions:s,stackingContext:a={},actionQueue:i})=>d.jsx(pl,{children:d.jsxs(k_,{userEmail:e,availableFeatures:o,extraParams:r,contactEmail:t,connectorFunctions:s,stackingContext:a,actionQueue:i,baseUrls:n,children:[d.jsx(L_,{isAdmin:r==null?void 0:r.isAdmin}),je.createPortal(d.jsx(hl,{id:"toast-message",children:d.jsx(Ua,{position:"bottom-left",autoClose:5e3,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,draggable:!0,pauseOnHover:!0,...!!a.toastMessage&&{style:{zIndex:a.toastMessage}}})}),document.body),d.jsx("div",{"data-connectorid":"connector-layover-portal"})]})}),Yp="/v1/api",R_=`${Yp}/connector/conversation/:conversationId/data`,M_=`${Yp}/connector/feedback/conversation/:conversationId`,P_=async(e,t)=>{try{let n=R_.replace(":conversationId",e)+"?channel_type=email";if(t!=null&&t.length){const o=t.map(s=>`inbox_ids=${encodeURIComponent(s)}`).join("&");n+=`&${o}`}const r=await xe({url:n,method:Fe.GET});return r!=null&&r.data&&Array.isArray(r.data)?r.data.reduce((s,a)=>{var i,c;return s[(i=a==null?void 0:a.cardData)==null?void 0:i.textToHighlight]||(s[(c=a==null?void 0:a.cardData)==null?void 0:c.textToHighlight]={...a}),s},{}):null}catch(n){return Promise.reject(n)}};function j_(e,t,n){return Wt({queryKey:["connector-analytics",e,t,n],queryFn:async()=>!t||!e?null:await P_(e,n),enabled:!!t&&!!e})}class B_{constructor(t=[],n=null){Re(this,"highlightTerms");Re(this,"observer");Re(this,"isHighlighting");Re(this,"debounceTimer");Re(this,"debounceDelay");Re(this,"onHighlightsUpdated");this.highlightTerms=t,this.observer=null,this.isHighlighting=!1,this.debounceTimer=null,this.debounceDelay=500,this.onHighlightsUpdated=n,this.init()}init(){this.highlightAllEmails(),this.startObserver()}startObserver(){const t=this.findGmailContainer();if(!t){console.warn("Gmail container not found");return}this.observer=new MutationObserver(n=>{if(this.isHighlighting)return;let r=!1;n.forEach(o=>{o.type==="childList"&&Array.from(o.addedNodes).some(i=>{var c,l,f,g;return i.nodeType===1&&i instanceof Element&&(((c=i.classList)==null?void 0:c.contains("a3s"))||((l=i.classList)==null?void 0:l.contains("ii"))||((f=i.querySelector)==null?void 0:f.call(i,".a3s"))||((g=i.querySelector)==null?void 0:g.call(i,"h2.hP")))})&&(r=!0)}),r&&this.debounceHighlight()}),this.observer.observe(t,{childList:!0,subtree:!0})}findGmailContainer(){return document.querySelector('[role="main"]')||document.querySelector(".nH.if")||document.querySelector(".AO")||document.body}debounceHighlight(){this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.highlightAllEmails()},this.debounceDelay)}highlightAllEmails(){var t;if(this.highlightTerms.length!==0){this.isHighlighting=!0;try{if(this.clearHighlights(),["h2.hP",".ii.gt .a3s.aiL",".ii.gt .a3s",'[data-expanded="true"]'].forEach(r=>{document.querySelectorAll(r).forEach(s=>{this.isElementVisible(s)&&this.highlightInElement(s)})}),this.onHighlightsUpdated){const r=Array.from(document.querySelectorAll(".gmail-highlight"));(t=this.onHighlightsUpdated)==null||t.call(this,r)}}finally{setTimeout(()=>{this.isHighlighting=!1},250)}}}isElementVisible(t){const n=t;return n.offsetParent!==null&&n.offsetWidth>0&&n.offsetHeight>0}highlightInElement(t){if(!t||this.highlightTerms.length===0||t.dataset.highlightProcessed==="true")return;const r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,{acceptNode:a=>a.parentElement&&a.parentElement.classList.contains("gmail-highlight")||a.parentElement&&["SCRIPT","STYLE"].includes(a.parentElement.tagName)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}),o=[];let s;for(;s=r.nextNode();)o.push(s);o.forEach(a=>{this.highlightInTextNode(a)}),t.dataset.highlightProcessed="true"}highlightInTextNode(t){let n=t.textContent,r=!1;if(!n)return;if([...this.highlightTerms].sort((s,a)=>a.length-s.length).forEach(s=>{if(!s||s.trim().length===0)return;const a=this.escapeRegex(s.trim()),i=new RegExp(`\\b${a}\\b`,"gi");i.test(n)&&(n=n.replace(i,`<span class="gmail-highlight" data-highlight-term="${s.trim()}"><span class="gmail-highlight-inner">${s}</span></span>`),r=!0)}),r&&t.parentNode){const s=document.createElement("span");s.innerHTML=n,t.parentNode.replaceChild(s,t)}}clearHighlights(){document.querySelectorAll(".gmail-highlight").forEach(r=>{const o=r.parentNode;o&&r.textContent&&(o.replaceChild(document.createTextNode(r.textContent),r),o.normalize())}),document.querySelectorAll('[data-highlight-processed="true"]').forEach(r=>{delete r.dataset.highlightProcessed})}escapeRegex(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}refreshHighlights(){this.highlightAllEmails()}updateHighlightTerms(t){this.highlightTerms=t||[],this.highlightAllEmails()}destroy(){this.observer&&(this.observer.disconnect(),this.observer=null),this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.clearHighlights(),this.highlightTerms=[]}}if(!document.getElementById("gmail-highlighter-styles")){const e=document.createElement("style");e.id="gmail-highlighter-styles",e.textContent=`
2452
2462
  .gmail-highlight {
2453
2463
  background-color: #ECEFF6 !important;
2454
2464
  color: #2c3e50 !important;
@@ -2478,7 +2488,7 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
2478
2488
  transform: translateY(0) !important;
2479
2489
  box-shadow: none !important;
2480
2490
  }
2481
- `,document.head.appendChild(e)}function B_(){return Zt({mutationKey:["submit-connector-feedback"],mutationFn:async({conversationId:e,feedbackData:t})=>{if(!e)throw new Error("Conversation ID is required");const n=await xe({url:R_.replace(":conversationId",e)+"?channel_type=email",method:"POST",data:t});return n==null?void 0:n.data}})}const V_="Everything looks good",G_="Something is not working",H_="Share feedback",W_="Manage Smart Previews",Z_="Reach out to your admin to disable this feature",X_="Go to Apps",z_="Disable Feature",Y_="Tell us what went wrong",J_="Please provide feedback",q_=[{label:"Data is not accurate",value:"Data is not accurate"},{label:"Data is from the wrong App",value:"Data is from the wrong App"},{label:"Other",value:"other"}],Q_="Tell us more (optional)",$_="Enter your feedback",gl=40,U_="Feedback submitted",K_="Failed to submit feedback",un={OBJECT_HIGHLIGHTED:"app_object_detection_highlighted",OBJECT_HOVERED:"app_object_detection_hovered",PERMALINK_CLICKED:"app_object_detection_permalink_clicked",POSITIVE_FEEDBACK_CLICKED:"app_object_detection_positive_feedback_detected",NEGATIVE_FEEDBACK_CLICKED:"app_object_detection_negative_feedback_clicked",NEGATIVE_FEEDBACK_SUBMITTED:"app_object_detection_negative_feedback_submitted",FEEDBACK_OPTION_CLICKED:"app_object_detection_general_feedback_clicked",FEEDBACK_OPTION_SUBMITTED:"app_object_detection_general_feedback_submitted",DATA_CARD_DURATION:"app_object_detection_data_card_duration",DATA_CARD_SCROLLED:"app_object_detection_data_card_scrolled"},Jp=e=>d.jsx(u.Button,{...e,disabled:e.isLoading||e.disabled,children:e.isLoading?d.jsx(u.CircularProgress,{sx:{color:"#97A3B7"},size:20}):e.label}),eS=u.styled(u.Box)`
2491
+ `,document.head.appendChild(e)}function V_(){return Zt({mutationKey:["submit-connector-feedback"],mutationFn:async({conversationId:e,feedbackData:t})=>{if(!e)throw new Error("Conversation ID is required");const n=await xe({url:M_.replace(":conversationId",e)+"?channel_type=email",method:"POST",data:t});return n==null?void 0:n.data}})}const G_="Everything looks good",H_="Something is not working",W_="Share feedback",Z_="Manage Smart Previews",X_="Reach out to your admin to disable this feature",z_="Go to Apps",Y_="Disable Feature",J_="Tell us what went wrong",q_="Please provide feedback",Q_=[{label:"Data is not accurate",value:"Data is not accurate"},{label:"Data is from the wrong App",value:"Data is from the wrong App"},{label:"Other",value:"other"}],$_="Tell us more (optional)",U_="Enter your feedback",gl=40,K_="Feedback submitted",eS="Failed to submit feedback",un={OBJECT_HIGHLIGHTED:"app_object_detection_highlighted",OBJECT_HOVERED:"app_object_detection_hovered",PERMALINK_CLICKED:"app_object_detection_permalink_clicked",POSITIVE_FEEDBACK_CLICKED:"app_object_detection_positive_feedback_detected",NEGATIVE_FEEDBACK_CLICKED:"app_object_detection_negative_feedback_clicked",NEGATIVE_FEEDBACK_SUBMITTED:"app_object_detection_negative_feedback_submitted",FEEDBACK_OPTION_CLICKED:"app_object_detection_general_feedback_clicked",FEEDBACK_OPTION_SUBMITTED:"app_object_detection_general_feedback_submitted",DATA_CARD_DURATION:"app_object_detection_data_card_duration",DATA_CARD_SCROLLED:"app_object_detection_data_card_scrolled"},Jp=e=>d.jsx(u.Button,{...e,disabled:e.isLoading||e.disabled,children:e.isLoading?d.jsx(u.CircularProgress,{sx:{color:"#97A3B7"},size:20}):e.label}),tS=u.styled(u.Box)`
2482
2492
  max-height: 340px;
2483
2493
  width: 440px;
2484
2494
  border-radius: 12px;
@@ -2492,15 +2502,15 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
2492
2502
  flex-direction: row;
2493
2503
  margin-bottom: 12px;
2494
2504
  }
2495
- `,tS=u.styled(u.Box)`
2505
+ `,nS=u.styled(u.Box)`
2496
2506
  border-bottom: 1px solid ${u.theme.palette.gray.gray6};
2497
2507
  margin: 12px -16px;
2498
- `,nS=u.styled(u.Box)`
2508
+ `,rS=u.styled(u.Box)`
2499
2509
  display: flex;
2500
2510
  justify-content: flex-end;
2501
2511
  margin-top: 30px;
2502
2512
  gap: 8px;
2503
- `,qp=({onCancel:e,onSubmit:t,isLoading:n,showOptions:r=!0,title:o})=>{const[s,a]=I.useState(""),[i,c]=I.useState(""),l=b=>{a(b.target.value)},f=b=>{b.stopPropagation();const{value:p}=(b==null?void 0:b.target)||{};c(p)},g=()=>{t({feedbackOption:s,feedbackComment:i})},y=()=>{e==null||e()},x=r?!s:!i;return d.jsxs(eS,{children:[d.jsx(u.Typography,{variant:"h3",children:o}),d.jsx(tS,{}),r?d.jsx(u.FormControl,{children:d.jsx(u.RadioGroup,{"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:s,onChange:l,children:q_.map(b=>d.jsx(u.FormControlLabel,{value:b.value,control:d.jsx(u.Radio,{}),label:b.label},b.value))})}):null,d.jsx(yr,{type:"text",placeholder:r?Q_:$_,value:i,name:"feedbackComment",inputChangeHandler:f,multiline:!0,rows:5,limit:250,validation:{validate:vc()}}),d.jsxs(nS,{children:[d.jsx(u.Button,{variant:"text",color:"primary",style:{color:u.theme.palette.gray.gray3},disabled:n,onClick:y,children:"Cancel"}),d.jsx(Jp,{variant:"contained",color:"primary",isLoading:n,disabled:x,label:"Submit",onClick:g})]})]})},rS=u.styled(u.Box)`
2513
+ `,qp=({onCancel:e,onSubmit:t,isLoading:n,showOptions:r=!0,title:o})=>{const[s,a]=I.useState(""),[i,c]=I.useState(""),l=b=>{a(b.target.value)},f=b=>{b.stopPropagation();const{value:p}=(b==null?void 0:b.target)||{};c(p)},g=()=>{t({feedbackOption:s,feedbackComment:i})},y=()=>{e==null||e()},x=r?!s:!i;return d.jsxs(tS,{children:[d.jsx(u.Typography,{variant:"h3",children:o}),d.jsx(nS,{}),r?d.jsx(u.FormControl,{children:d.jsx(u.RadioGroup,{"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:s,onChange:l,children:Q_.map(b=>d.jsx(u.FormControlLabel,{value:b.value,control:d.jsx(u.Radio,{}),label:b.label},b.value))})}):null,d.jsx(yr,{type:"text",placeholder:r?$_:U_,value:i,name:"feedbackComment",inputChangeHandler:f,multiline:!0,rows:5,limit:250,validation:{validate:vc()}}),d.jsxs(rS,{children:[d.jsx(u.Button,{variant:"text",color:"primary",style:{color:u.theme.palette.gray.gray3},disabled:n,onClick:y,children:"Cancel"}),d.jsx(Jp,{variant:"contained",color:"primary",isLoading:n,disabled:x,label:"Submit",onClick:g})]})]})},oS=u.styled(u.Box)`
2504
2514
  border-radius: 12px;
2505
2515
  max-height: 298px;
2506
2516
  width: 288px;
@@ -2510,29 +2520,29 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
2510
2520
  & > * {
2511
2521
  box-sizing: border-box;
2512
2522
  }
2513
- `,oS=u.styled(u.Box)`
2523
+ `,sS=u.styled(u.Box)`
2514
2524
  height: 24px;
2515
2525
  display: flex;
2516
2526
  align-items: center;
2517
2527
  justify-content: space-between;
2518
2528
  padding: 12px 0px;
2519
- `,sS=u.styled(u.Typography)`
2529
+ `,aS=u.styled(u.Typography)`
2520
2530
  white-space: nowrap;
2521
2531
  overflow: hidden;
2522
2532
  text-overflow: ellipsis;
2523
2533
  width: ${e=>e.width||"200px"};
2524
2534
  line-height: 18px;
2525
- `,aS=u.styled(u.Box)`
2535
+ `,iS=u.styled(u.Box)`
2526
2536
  height: 1px;
2527
2537
  background-color: ${u.theme.palette.gray.gray6};
2528
2538
  margin: 0 -16px;
2529
- `,iS=u.styled(u.Box)`
2539
+ `,cS=u.styled(u.Box)`
2530
2540
  padding: 0px 16px;
2531
2541
  border-radius: 12px;
2532
2542
  height: calc(100% - 82px);
2533
2543
  overflow-y: auto;
2534
2544
  scrollbar-width: thin;
2535
- `,cS=u.styled(u.Typography)`
2545
+ `,lS=u.styled(u.Typography)`
2536
2546
  font-size: 12px;
2537
2547
  font-weight: 400;
2538
2548
  color: ${u.theme.palette.gray.gray1};
@@ -2540,7 +2550,7 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
2540
2550
  min-width: 80px;
2541
2551
  margin-right: 12px;
2542
2552
  text-align: left;
2543
- `,lS=u.styled(u.Typography)`
2553
+ `,uS=u.styled(u.Typography)`
2544
2554
  font-size: 12px;
2545
2555
  font-weight: 400;
2546
2556
  color: ${u.theme.palette.gray.black};
@@ -2549,11 +2559,11 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
2549
2559
  margin-right: 0px;
2550
2560
  word-break: 'break-word';
2551
2561
  text-align: right;
2552
- `,uS=u.styled(u.Box)`
2562
+ `,dS=u.styled(u.Box)`
2553
2563
  display: flex;
2554
2564
  justify-content: space-between;
2555
2565
  margin-bottom: 20px;
2556
- `,dS=u.styled(u.Box)`
2566
+ `,fS=u.styled(u.Box)`
2557
2567
  display: flex;
2558
2568
  justify-content: space-between;
2559
2569
  align-items: center;
@@ -2564,13 +2574,13 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
2564
2574
  `,ss=u.styled(u.Tooltip)`
2565
2575
  padding: 6px;
2566
2576
  border-radius: 6px;
2567
- `,fS=u.styled(u.Button)`
2577
+ `,pS=u.styled(u.Button)`
2568
2578
  background-color: #f3f8ff;
2569
2579
  border-radius: 360px;
2570
2580
  color: #196fe0;
2571
2581
  padding: 5px 12px;
2572
2582
  min-width: 100px;
2573
- `,Qp=e=>A.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},A.createElement("path",{d:"M7.87354 2.73877C7.87354 2.30139 7.53821 1.94227 7.11084 1.90381L5.09229 6.44775C5.06387 6.51167 5.02799 6.57074 4.98975 6.62744V12.3667H10.4722C11.0395 12.3665 11.5225 11.9529 11.6089 11.3921L12.2368 7.30811C12.3437 6.61168 11.8047 5.98395 11.1001 5.98389H9.05615C8.40276 5.98371 7.87354 5.45372 7.87354 4.80029V2.73877ZM2.07275 11.8003C2.07275 12.1133 2.32718 12.3667 2.64014 12.3667H3.78955V7.1499H2.64014C2.32718 7.1499 2.07275 7.40432 2.07275 7.71729V11.8003ZM9.07275 4.78369H11.1001C12.5403 4.78375 13.6412 6.0673 13.4224 7.49072L12.7944 11.5747C12.6179 12.7208 11.6318 13.5667 10.4722 13.5669H2.64014C1.66443 13.5669 0.873535 12.776 0.873535 11.8003V7.71729C0.873535 6.74158 1.66443 5.95068 2.64014 5.95068H3.99951L6.04834 1.34131L6.12256 1.20166C6.31844 0.892431 6.66142 0.700708 7.03467 0.700684C8.16045 0.700684 9.07275 1.61299 9.07275 2.73877V4.78369Z",fill:"#97A3B7"})),$p=e=>A.createElement("svg",{width:13,height:14,viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},A.createElement("path",{d:"M11.8008 3.16651C11.8008 2.83026 11.7996 2.61407 11.7861 2.44972C11.7733 2.29228 11.7516 2.23558 11.7383 2.20948C11.684 2.10311 11.5976 2.0167 11.4912 1.96241C11.4651 1.94911 11.4084 1.92742 11.251 1.91456C11.0866 1.90113 10.8698 1.89991 10.5332 1.89991H10.084V7.11671H10.5332C10.8697 7.11671 11.0866 7.11647 11.251 7.10304C11.4084 7.09017 11.4651 7.06848 11.4912 7.05519C11.5977 7.00085 11.684 6.91369 11.7383 6.80714C11.7516 6.78095 11.7733 6.72473 11.7861 6.56788C11.7996 6.40344 11.8008 6.18671 11.8008 5.85011V3.16651ZM6.00001 11.5288C6.00014 11.9658 6.33491 12.3239 6.76173 12.3628L8.68946 8.02784C8.73905 7.91626 8.79776 7.77463 8.8838 7.6421V1.89991H4.30275C3.86739 1.89991 3.57385 1.9011 3.34571 1.91847C3.12524 1.93527 3.00982 1.96482 2.92677 2.00245C2.72742 2.09281 2.55809 2.23906 2.43849 2.42237C2.38875 2.49873 2.34108 2.60774 2.29103 2.82276C2.23917 3.04561 2.19414 3.33583 2.12794 3.76612L1.82325 5.74952C1.73618 6.31551 1.67724 6.70248 1.65724 7.00245C1.63765 7.29653 1.66125 7.4439 1.69923 7.54347C1.79436 7.79282 1.97309 8.00139 2.20509 8.13331C2.29773 8.18598 2.43978 8.23198 2.73341 8.25733C3.03294 8.28318 3.42441 8.2837 3.99708 8.2837H4.46681C4.62026 8.2837 4.77205 8.28306 4.89943 8.29347C5.00019 8.30172 5.11526 8.31839 5.23439 8.36085L5.3545 8.41261L5.51271 8.51026C5.61292 8.58313 5.70157 8.67078 5.77443 8.77101L5.8711 8.93019L5.92286 9.0503C5.96524 9.1694 5.98202 9.28456 5.99025 9.38526C6.00063 9.51256 6.00001 9.66359 6.00001 9.8169V11.5288ZM13 5.85011C13 6.1669 13.0008 6.44089 12.9824 6.66554C12.9635 6.89709 12.9214 7.12868 12.8076 7.35206C12.6383 7.68439 12.3684 7.95514 12.0361 8.12452C11.8127 8.23838 11.5803 8.2804 11.3486 8.29933C11.124 8.31767 10.8499 8.3169 10.5332 8.3169H10.0899C9.97739 8.31691 9.91771 8.31637 9.87501 8.31886C9.85536 8.35692 9.83103 8.41194 9.78517 8.51515L7.82521 12.9263C7.6519 13.3159 7.26532 13.5669 6.83888 13.5669C5.71318 13.5669 4.80093 12.6545 4.80079 11.5288V9.8169C4.80079 9.64881 4.799 9.55553 4.79396 9.48878C4.72728 9.48383 4.63383 9.4839 4.46681 9.4839H3.99708C3.44579 9.4839 2.99395 9.48395 2.63087 9.45265C2.26202 9.42082 1.92186 9.35223 1.61232 9.17628C1.13824 8.90671 0.772529 8.48073 0.578136 7.9712C0.451217 7.63844 0.43534 7.29185 0.459972 6.92237C0.484222 6.55869 0.552876 6.11195 0.63673 5.5669L0.942394 3.58351C1.00581 3.17132 1.05751 2.82883 1.12208 2.55128C1.18838 2.26634 1.27691 2.00629 1.4336 1.76612C1.67803 1.39152 2.02424 1.0943 2.43165 0.909678C2.69285 0.791323 2.96319 0.743407 3.25489 0.721201C3.53908 0.699573 3.8856 0.700693 4.30275 0.700693H10.5332C10.8499 0.700693 11.124 0.69993 11.3486 0.718272C11.5803 0.737198 11.8127 0.779216 12.0361 0.893076C12.3683 1.06241 12.6383 1.33244 12.8076 1.66456C12.9215 1.88802 12.9635 2.12041 12.9824 2.35206C13.0008 2.57656 13 2.85001 13 3.16651V5.85011Z",fill:"#97A3B7"})),pS=e=>A.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},A.createElement("path",{d:"M6.02637 0.261719C6.91006 0.100716 7.81654 0.108586 8.69727 0.285156C8.77943 0.301685 8.85737 0.335356 8.92578 0.383789C8.99413 0.432207 9.05187 0.494446 9.09473 0.566406L10.1699 2.37109L12.2686 2.40137C12.3521 2.40267 12.4348 2.42105 12.5107 2.45605C12.5866 2.49114 12.6547 2.5417 12.71 2.60449L12.9268 2.8623C13.4177 3.47393 13.8044 4.1638 14.0703 4.90332H14.0713C14.1006 4.98499 14.1111 5.07276 14.1035 5.15918C14.0958 5.24545 14.0694 5.32914 14.0264 5.4043L13.0107 7.17676L14.0654 8.97949C14.1089 9.05374 14.1349 9.13706 14.1436 9.22266C14.1522 9.30829 14.143 9.39509 14.1152 9.47656C13.8308 10.316 13.3846 11.0919 12.8008 11.7588C12.7442 11.8235 12.6731 11.8748 12.5947 11.9102C12.5163 11.9454 12.4307 11.9644 12.3447 11.9639L10.2559 11.9512L9.22656 13.7188C9.18293 13.7935 9.12263 13.8576 9.05176 13.9072C8.98094 13.9567 8.90045 13.9914 8.81543 14.0068C7.9318 14.1675 7.02506 14.1583 6.14453 13.9814L6.14355 13.9824C6.0797 13.9694 6.01838 13.9446 5.96191 13.9121C5.87332 13.8615 5.7985 13.7897 5.74609 13.7021L4.67188 11.8955L2.56934 11.8682C2.48571 11.8669 2.4031 11.8485 2.32715 11.8135C2.25108 11.7784 2.18323 11.727 2.12793 11.6641C1.60736 11.0751 1.18875 10.4045 0.888672 9.67969L0.767578 9.36621C0.738264 9.28452 0.726773 9.19681 0.734375 9.11035C0.742031 9.02393 0.768379 8.93953 0.811523 8.86426L1.82617 7.0918L0.772461 5.28906C0.729026 5.2148 0.702006 5.1315 0.693359 5.0459C0.684801 4.96052 0.695058 4.87421 0.722656 4.79297C1.00784 3.95289 1.45608 3.17678 2.04102 2.50977C2.09771 2.44503 2.16762 2.39274 2.24609 2.35742C2.32438 2.32222 2.40928 2.30426 2.49512 2.30469L4.58398 2.31543L5.61426 0.549805C5.65789 0.474997 5.71718 0.410066 5.78809 0.360352C5.8591 0.31064 5.94107 0.277156 6.02637 0.261719ZM7.53809 14.0195C7.59898 14.0196 7.65982 14.0181 7.7207 14.0166C7.65982 14.0181 7.59898 14.0196 7.53809 14.0195ZM7.2334 14.0117C7.28581 14.014 7.33818 14.0164 7.39062 14.0176C7.33818 14.0164 7.28581 14.014 7.2334 14.0117ZM7.85742 14.0127C7.89653 14.0109 7.93552 14.0073 7.97461 14.0049C7.93552 14.0073 7.89654 14.0109 7.85742 14.0127ZM6.91113 13.9902C6.97295 13.9958 7.03476 14.0009 7.09668 14.0049C7.03476 14.0009 6.97295 13.9958 6.91113 13.9902ZM6.6543 13.9619C6.6898 13.9665 6.72519 13.9716 6.76074 13.9756C6.72519 13.9716 6.6898 13.9665 6.6543 13.9619ZM5.91016 13.75C5.94027 13.7795 5.97474 13.8051 6.01172 13.8262L5.95898 13.791C5.94197 13.7782 5.92535 13.7649 5.91016 13.75ZM6.58008 12.9414H6.58105H6.58008ZM8.2002 1.41895C7.63858 1.33129 7.06722 1.32543 6.50391 1.40137L5.5127 3.10059C5.45667 3.19686 5.37383 3.27503 5.27539 3.32715C5.21254 3.36088 5.14878 3.39942 5.08594 3.43555L5.08496 3.43457C4.99197 3.48895 4.88605 3.51825 4.77832 3.51758L2.77637 3.50586C2.43354 3.9367 2.15694 4.41647 1.95508 4.92871L2.96875 6.66211H2.96973C3.01013 6.73278 3.03531 6.81132 3.04492 6.8916L3.04883 6.97461C3.04667 7.04613 3.0485 7.11658 3.05078 7.18945C3.0548 7.30124 3.02821 7.41268 2.97266 7.50977L1.99609 9.21289C2.21404 9.7388 2.50744 10.2299 2.86621 10.6719L4.88281 10.7012H4.88379C4.99002 10.7034 5.09368 10.7341 5.18457 10.7891L5.39258 10.9082C5.45916 10.9464 5.51715 10.9978 5.56445 11.0576L5.6084 11.1201L6.6416 12.8486C7.20362 12.9365 7.77513 12.9432 8.33887 12.8672L9.3291 11.1689C9.38528 11.0722 9.46843 10.9926 9.56738 10.9404C9.63017 10.9067 9.69505 10.8701 9.75781 10.834L9.8291 10.7988C9.90336 10.7678 9.98341 10.7514 10.0645 10.752L12.0664 10.7646C12.4092 10.3324 12.6847 9.85062 12.8857 9.33691L11.8711 7.60645L11.8721 7.60547C11.8181 7.51108 11.7903 7.40365 11.792 7.29492L11.791 7.29395C11.7932 7.22206 11.7923 7.15042 11.79 7.07715C11.7862 6.96565 11.8128 6.85466 11.8682 6.75781L12.8438 5.05371C12.6258 4.52811 12.3333 4.03648 11.9746 3.59473L9.95801 3.56641H9.95703C9.85067 3.56414 9.74722 3.53265 9.65625 3.47754V3.47852L9.45898 3.36426L9.39258 3.32129C9.32844 3.27486 9.27351 3.21669 9.23242 3.14844V3.14746L8.2002 1.41895ZM2.4668 11.7559L2.57031 11.7686H2.57129C2.50157 11.7675 2.43246 11.7518 2.36914 11.7227L2.4668 11.7559ZM1.78809 11.082V11.0811V11.082ZM13.0244 11.3203C13.0502 11.2862 13.0774 11.2533 13.1025 11.2188C13.0774 11.2533 13.0502 11.2862 13.0244 11.3203ZM13.2051 11.0713C13.2348 11.0279 13.2643 10.9845 13.293 10.9404C13.2643 10.9845 13.2348 11.0279 13.2051 11.0713ZM9.90918 10.876C9.90231 10.8782 9.89544 10.8803 9.88867 10.8828C9.89545 10.8803 9.90231 10.8782 9.90918 10.876ZM13.3535 10.8447C13.3903 10.7861 13.426 10.7268 13.4609 10.667C13.426 10.7268 13.3903 10.7861 13.3535 10.8447ZM13.5049 10.5928C13.5426 10.5264 13.5789 10.4593 13.6143 10.3916C13.5789 10.4593 13.5426 10.5264 13.5049 10.5928ZM13.6582 10.3066C13.695 10.2337 13.7305 10.1602 13.7646 10.0859C13.7305 10.1602 13.695 10.2337 13.6582 10.3066ZM7.2168 4.04004C7.82858 3.99994 8.43974 4.14269 8.9707 4.44922C9.68176 4.86085 10.2003 5.53844 10.4131 6.33203C10.6256 7.12573 10.5145 7.97155 10.1045 8.68359C9.79803 9.21429 9.34157 9.64291 8.79199 9.91406C8.24214 10.1852 7.62346 10.287 7.01562 10.207C6.40793 10.127 5.83684 9.86895 5.37598 9.46484C4.91529 9.06072 4.58448 8.52844 4.42578 7.93652C4.26721 7.34451 4.28843 6.71808 4.48535 6.1377C4.68236 5.55755 5.04627 5.04792 5.53223 4.6748C6.01845 4.30171 6.60526 4.08027 7.2168 4.04004ZM13.7852 10.041C13.8281 9.94559 13.8697 9.84945 13.9082 9.75195V9.75098C13.8696 9.84876 13.8283 9.94531 13.7852 10.041ZM6.40918 9.95703C6.46044 9.97542 6.51219 9.99222 6.56445 10.0078C6.51219 9.99225 6.46044 9.97539 6.40918 9.95703ZM6.20996 9.87695C6.25096 9.89508 6.2922 9.91244 6.33398 9.92871C6.2922 9.91247 6.25097 9.89505 6.20996 9.87695ZM6.02832 9.79004C6.0678 9.81077 6.10809 9.82969 6.14844 9.84863C6.10808 9.82972 6.06781 9.81074 6.02832 9.79004ZM5.84082 9.68262C5.87596 9.70443 5.9113 9.72578 5.94727 9.74609C5.91128 9.7258 5.87597 9.7044 5.84082 9.68262ZM12.9131 9.53613C12.9421 9.46825 12.9707 9.40012 12.9971 9.33105L12.9961 9.33008C12.9697 9.3993 12.9422 9.46808 12.9131 9.53613ZM5.66602 9.56543C5.7015 9.59105 5.73694 9.61662 5.77344 9.64062C5.73693 9.61664 5.70151 9.59104 5.66602 9.56543ZM1.97461 9.41699C1.99284 9.4575 2.01311 9.49704 2.03223 9.53711C1.98023 9.42813 1.93016 9.31814 1.88477 9.20605L1.97461 9.41699ZM5.59277 9.5127C5.59556 9.51484 5.59877 9.51642 5.60156 9.51855C5.54737 9.47722 5.49386 9.43478 5.44238 9.38965L5.59277 9.5127ZM8.03125 5.33496C7.67547 5.21424 7.29063 5.20159 6.92773 5.29883C6.56509 5.39617 6.23977 5.59952 5.99219 5.88184C5.74452 6.16433 5.58615 6.51424 5.53711 6.88672C5.48824 7.25901 5.54977 7.63783 5.71582 7.97461C5.88202 8.31152 6.14537 8.59145 6.4707 8.7793C6.90703 9.0311 7.42549 9.09913 7.91211 8.96875C8.39876 8.83831 8.81448 8.52031 9.06641 8.08398C9.25414 7.7587 9.3409 7.38453 9.31641 7.00977C9.2918 6.635 9.15631 6.27555 8.92773 5.97754C8.69908 5.67961 8.38685 5.45577 8.03125 5.33496ZM6.17676 8.69922C6.25355 8.76023 6.3343 8.81676 6.41992 8.86621L6.4209 8.86523C6.33525 8.81578 6.2536 8.76024 6.17676 8.69922ZM8.47754 8.83203V8.83105V8.83203ZM5.77637 8.27246C5.83227 8.35318 5.89399 8.4295 5.96094 8.50098L5.86426 8.38965C5.83359 8.35168 5.80422 8.31265 5.77637 8.27246ZM4.52246 7.91113C4.5608 8.0541 4.60948 8.19346 4.66797 8.32812C4.60945 8.19325 4.56083 8.05334 4.52246 7.91016V7.91113ZM9.40039 6.85645C9.40722 6.90519 9.41278 6.95457 9.41602 7.00391C9.41922 7.05311 9.42035 7.1023 9.41992 7.15137C9.42035 7.10204 9.41926 7.05239 9.41602 7.00293C9.41279 6.95379 9.40719 6.90498 9.40039 6.85645ZM11.9004 6.95215C11.8982 6.96247 11.897 6.97295 11.8955 6.9834C11.8971 6.97295 11.8982 6.96247 11.9004 6.95215ZM4.65137 5.97754C4.62849 6.03229 4.60852 6.08831 4.58887 6.14453C4.60851 6.0883 4.6285 6.03229 4.65137 5.97754ZM4.73633 5.79492C4.7241 5.81941 4.71274 5.8443 4.70117 5.86914C4.71273 5.8443 4.72411 5.81941 4.73633 5.79492ZM4.84473 5.59863C4.82627 5.62957 4.80836 5.66078 4.79102 5.69238C4.80835 5.66077 4.82628 5.62957 4.84473 5.59863ZM4.95605 5.42383C4.93113 5.45972 4.90714 5.49624 4.88379 5.5332C4.90712 5.49623 4.93114 5.45973 4.95605 5.42383ZM8.31445 4.27051C8.52443 4.33607 8.72746 4.42504 8.91992 4.53613L8.9209 4.53516C8.72801 4.42379 8.52395 4.33516 8.31348 4.26953L8.31445 4.27051ZM5.09082 5.24609C5.06172 5.28198 5.03326 5.3183 5.00586 5.35547C5.03325 5.31828 5.06173 5.28199 5.09082 5.24609ZM6.63965 5.29199C6.64276 5.29067 6.6463 5.29037 6.64941 5.28906C6.6463 5.29037 6.64276 5.29067 6.63965 5.29199ZM7.9209 5.19824H7.92188H7.9209ZM6.90234 5.20215H6.90332H6.90234ZM5.23145 5.08496C5.19896 5.11965 5.16651 5.15429 5.13574 5.19043C5.1665 5.15428 5.19897 5.11966 5.23145 5.08496ZM13.9766 4.93652V4.9375V4.93652ZM0.922852 4.53613C0.885573 4.63126 0.850299 4.72727 0.817383 4.82422V4.8252C0.850362 4.72803 0.885496 4.63148 0.922852 4.53613ZM2.01855 4.5293H2.01953H2.01855ZM1.04688 4.24316C1.02195 4.29878 0.998013 4.35481 0.974609 4.41113C0.998008 4.35481 1.02196 4.29878 1.04688 4.24316ZM7.22363 4.13965L7.22461 4.14062L7.22363 4.13965ZM7.66699 4.14453L7.66602 4.14355L7.66699 4.14453ZM1.17188 3.97852C1.1445 4.03303 1.11865 4.08828 1.09277 4.14355C1.11864 4.08828 1.14451 4.03304 1.17188 3.97852ZM12.4287 4.0498V4.04883V4.0498ZM12.6348 2.66992V2.6709C12.8546 2.91962 13.0566 3.1828 13.2383 3.45898C13.1171 3.27471 12.987 3.09618 12.8486 2.92383C12.7796 2.83782 12.708 2.75273 12.6348 2.66992ZM1.30859 3.72168C1.28765 3.75921 1.26729 3.79703 1.24707 3.83496C1.26728 3.79703 1.28765 3.75921 1.30859 3.72168ZM2.72656 3.40723V3.4082L4.7793 3.41797V3.41699L2.72656 3.40723ZM12.0234 3.49707C12.0719 3.55591 12.1198 3.61522 12.166 3.67578L12.0234 3.49609L9.95898 3.4668L12.0234 3.49707ZM1.47852 3.43457C1.45114 3.47831 1.42381 3.52205 1.39746 3.56641C1.4238 3.52204 1.45115 3.47831 1.47852 3.43457ZM9.78809 3.43164C9.79329 3.43365 9.79845 3.43566 9.80371 3.4375C9.79845 3.43567 9.79329 3.43365 9.78809 3.43164ZM5.22852 3.23926V3.24023V3.23926ZM1.64746 3.17676C1.61837 3.21879 1.58963 3.26104 1.56152 3.30371C1.58963 3.26104 1.61837 3.21879 1.64746 3.17676ZM2.11523 2.5752H2.11621H2.11523ZM8.94629 0.53418C8.96978 0.559626 8.99096 0.587273 9.00879 0.617188C8.97313 0.557368 8.92497 0.505135 8.86816 0.464844L8.94629 0.53418ZM6.37305 0.307617C6.26302 0.322319 6.15337 0.34041 6.04395 0.360352C6.15337 0.340409 6.26301 0.322304 6.37305 0.307617ZM8.35059 0.325195C8.25055 0.310024 8.15027 0.296933 8.0498 0.286133C8.15027 0.296945 8.25055 0.310026 8.35059 0.325195ZM7.92578 0.275391C7.85971 0.269476 7.79372 0.26282 7.72754 0.258789C7.79372 0.262834 7.85971 0.269466 7.92578 0.275391ZM6.9502 0.255859C6.89287 0.258741 6.83558 0.262311 6.77832 0.266602C6.83559 0.262325 6.89287 0.258726 6.9502 0.255859ZM7.58008 0.25293C7.53418 0.251105 7.4883 0.248968 7.44238 0.248047C7.4883 0.24898 7.53418 0.251094 7.58008 0.25293ZM7.12988 0.249023C7.17448 0.24794 7.21907 0.247302 7.26367 0.24707C7.21907 0.247314 7.17448 0.247928 7.12988 0.249023ZM6.67871 0.274414C6.57668 0.283521 6.47471 0.294033 6.37305 0.307617C6.47471 0.294047 6.57668 0.283499 6.67871 0.274414Z",fill:"#97A3B7"})),hS=e=>A.createElement("svg",{width:14,height:15,viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},A.createElement("g",{clipPath:"url(#clip0_189_1728)"},A.createElement("path",{d:"M2.33317 2.4672H11.6665V9.4672H3.01567L2.33317 10.1497V2.4672ZM2.33317 1.30054C1.6915 1.30054 1.17234 1.82554 1.17234 2.4672L1.1665 12.9672L3.49984 10.6339H11.6665C12.3082 10.6339 12.8332 10.1089 12.8332 9.4672V2.4672C12.8332 1.82554 12.3082 1.30054 11.6665 1.30054H2.33317ZM3.49984 7.13387H8.1665V8.30054H3.49984V7.13387ZM3.49984 5.38387H10.4998V6.55054H3.49984V5.38387ZM3.49984 3.63387H10.4998V4.80054H3.49984V3.63387Z",fill:"#97A3B7"})),A.createElement("defs",null,A.createElement("clipPath",{id:"clip0_189_1728"},A.createElement("rect",{width:14,height:14,fill:"white",transform:"translate(0 0.133789)"})))),gS=e=>A.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},A.createElement("g",{clipPath:"url(#clip0_3803_129233)"},A.createElement("path",{d:"M7.3335 4.66683H8.66683V6.00016H7.3335V4.66683ZM7.3335 7.3335H8.66683V11.3335H7.3335V7.3335ZM8.00016 1.3335C4.32016 1.3335 1.3335 4.32016 1.3335 8.00016C1.3335 11.6802 4.32016 14.6668 8.00016 14.6668C11.6802 14.6668 14.6668 11.6802 14.6668 8.00016C14.6668 4.32016 11.6802 1.3335 8.00016 1.3335ZM8.00016 13.3335C5.06016 13.3335 2.66683 10.9402 2.66683 8.00016C2.66683 5.06016 5.06016 2.66683 8.00016 2.66683C10.9402 2.66683 13.3335 5.06016 13.3335 8.00016C13.3335 10.9402 10.9402 13.3335 8.00016 13.3335Z",fill:"#6F7C90"})),A.createElement("defs",null,A.createElement("clipPath",{id:"clip0_3803_129233"},A.createElement("rect",{width:16,height:16,fill:"white"})))),mS=({analysisData:e,isAdmin:t=!1,smIds:n,conversationId:r,showGoToApp:o=!1,redirectToAdmin:s,goToApps:a,hideTooltip:i,sendTrackingEvent:c})=>{const[l,f]=I.useState(!1),g=I.useRef(!1),[y,x]=I.useState(!1),[b,p]=I.useState([]),{mutate:h,isPending:m}=B_(),{logoUrl:E,cardTitle:C,id:w,externalResourceId:v,connectorId:_,textToHighlight:T}=e.cardData||{},S=I.useMemo(()=>({key:T,card_id:w,card_title:C,connector_id:_,external_resource_id:v,conversation_id:r,sm_id:n[0],all_sm_ids:n}),[T,w,C,_,v,r,n]);if(I.useEffect(()=>{const H=Date.now();return()=>{c(un.DATA_CARD_DURATION,{...S,duration:Date.now()-H})}},[c]),I.useEffect(()=>{var q,ne,ce;const H=(ce=(ne=(q=e==null?void 0:e.cardData)==null?void 0:q.data)==null?void 0:ne.flatDetails)==null?void 0:ce.data;if(H){const V=H.sort((R,G)=>R.priority-G.priority);p(V),c(un.OBJECT_HOVERED,S)}},[e,c,S]),!b||b.length===0)return null;const L=()=>{f(!0),c(un.FEEDBACK_OPTION_CLICKED,S)},N=()=>{x(!0),c(un.NEGATIVE_FEEDBACK_CLICKED,S)},k=H=>{const q={card_id:w,entity_id:v,comment:H.feedbackComment,option:H.feedbackOption,feedback_type:"entity_extraction"};typeof H.isThumbsUp<"u"&&(q.positive_feedback=H.isThumbsUp),h({conversationId:r,feedbackData:q},{onSuccess:()=>{l?c(un.FEEDBACK_OPTION_SUBMITTED,S):y&&c(un.NEGATIVE_FEEDBACK_SUBMITTED,S),f(!1),x(!1),Ie({message:U_,type:Ut})},onError:()=>{Ie({message:K_,type:Ye})}})},D=()=>{k({isThumbsUp:!0}),c(un.POSITIVE_FEEDBACK_CLICKED,S)},M=H=>{k({...H,isThumbsUp:!1})},j=()=>{s==null||s(_),i()},J=()=>{a==null||a()},Y=H=>{c(un.PERMALINK_CLICKED,{...S,clicked_value:H})},z=()=>{g.current||(c(un.DATA_CARD_SCROLLED,S),g.current=!0)};return d.jsxs(d.Fragment,{children:[d.jsxs(rS,{children:[d.jsxs(iS,{onScroll:z,children:[d.jsxs(oS,{children:[d.jsxs(u.Stack,{flexDirection:"row",alignItems:"center",style:{height:"100%"},children:[E&&d.jsx("img",{src:E,alt:"Logo",style:{marginRight:8},height:18,width:18}),d.jsx(u.Tooltip,{title:C,arrow:!0,placement:"top",children:d.jsx(sS,{variant:"h3",color:u.theme.palette.gray.black,width:o?"100px":"200px",children:C})})]}),o?d.jsx(fS,{variant:"text",size:"small",endIcon:d.jsx(u.icons.ArrowForward,{}),onClick:J,children:X_}):null]}),d.jsx(aS,{}),d.jsx(u.Box,{paddingY:"16px",children:b.map(({key:H,value:q,label:ne,deepLink:ce})=>d.jsxs(uS,{children:[d.jsxs(cS,{children:[ne,":"]}),d.jsx(u.Tooltip,{title:(q==null?void 0:q.length)>gl?q:"",arrow:!0,placement:"top",children:ce?d.jsx(u.Link,{href:ce,target:"_blank",rel:"noopener noreferrer",style:{textDecoration:"none",color:u.theme.palette.primary.main},onClick:()=>Y(q),children:Bd(q||"N/A",gl)}):d.jsx(lS,{children:Bd(q||"N/A",gl)})})]},H))})]}),d.jsxs(dS,{children:[d.jsx(u.Stack,{flexDirection:"row",alignItems:"center",children:t?d.jsx(ss,{arrow:!0,title:W_,placement:"top",children:d.jsx(u.IconButton,{onClick:j,children:d.jsx(pS,{})})}):d.jsxs(d.Fragment,{children:[d.jsx(u.Typography,{color:u.theme.palette.gray.gray3,fontSize:12,children:z_}),d.jsx(ss,{arrow:!0,title:Z_,placement:"top",children:d.jsx(u.IconButton,{size:"small",children:d.jsx(gS,{})})})]})}),d.jsxs(u.Stack,{flexDirection:"row",alignItems:"center",children:[d.jsx(ss,{arrow:!0,title:V_,placement:"top",children:d.jsx(u.IconButton,{size:"small",disabled:m,onClick:D,children:d.jsx(Qp,{})})}),d.jsx(ss,{arrow:!0,title:G_,placement:"top",children:d.jsx(u.IconButton,{size:"small",disabled:m,onClick:N,children:d.jsx($p,{})})}),d.jsx(ss,{arrow:!0,title:H_,placement:"top",children:d.jsx(u.IconButton,{onClick:L,size:"small",disabled:m,children:d.jsx(hS,{})})})]})]})]}),d.jsx(Er,{shown:l,setShown:f,borderRadius:12,sx:{zIndex:15002},children:d.jsx(qp,{onCancel:()=>f(!1),onSubmit:k,isLoading:m,showOptions:!1,title:J_})}),d.jsx(Er,{shown:y,setShown:x,borderRadius:12,sx:{zIndex:15002},children:d.jsx(qp,{onCancel:()=>x(!1),onSubmit:M,isLoading:m,title:Y_})})]})},Up=(e,t,n,r=10)=>e>=n.left-r&&e<=n.right+r&&t>=n.top-r&&t<=n.bottom+r,Kp=(e,t=350,n=400)=>{const r=e.getBoundingClientRect(),o=window.innerHeight,s=window.innerWidth,a=r.top,i=o-r.bottom;return i>=t||i>a?r.left<n/2?"bottom-start":s-r.right<n/2?"bottom-end":"bottom":r.left<n/2?"top-start":s-r.right<n/2?"top-end":"top"},bS=u.styled(({className:e,...t})=>d.jsx(u.Tooltip,{...t,classes:{popper:e}}))(()=>({[`& .${u.tooltipClasses.tooltip}`]:{backgroundColor:"#fff",padding:0,maxWidth:"288px",width:"288px",maxHeight:"300px",overflowY:"auto",borderRadius:"12px",boxShadow:"0px 0px 8px 0px #04060F14",border:`1px solid ${u.theme.palette.gray.gray6}`,position:"relative"}}));function yS({elements:e,title:t,onKeyChange:n}){const[r,o]=I.useState(!1),[s,a]=I.useState(null),[i,c]=I.useState(""),[l,f]=I.useState("bottom"),[g,y]=I.useState(!1),x=I.useRef(null),b=I.useRef({x:0,y:0}),p=I.useCallback(()=>{x.current&&(clearTimeout(x.current),x.current=null)},[]);I.useEffect(()=>{if(e&&e.length>0){const v=S=>{const L=S.currentTarget,N=L.textContent||"",k=Kp(L);f(k),c(N),n&&n(N),a(L),o(!0)},_=()=>{if(r&&s){const S=Kp(s);f(S)}},T=S=>{if(b.current={x:S.clientX,y:S.clientY},!r||g)return;const L=S.clientX,N=S.clientY;let k=!1;for(const D of e)if(Up(L,N,D.getBoundingClientRect())){k=!0;break}if(!k){const D=document.querySelector(`.${u.tooltipClasses.tooltip}`);D&&Up(L,N,D.getBoundingClientRect())&&(k=!0)}k||(o(!1),a(null))};return e.forEach(S=>{S.addEventListener("mouseenter",v)}),window.addEventListener("resize",_),window.addEventListener("scroll",_),document.addEventListener("mousemove",T),()=>{e.forEach(S=>{S.removeEventListener("mouseenter",v)}),window.removeEventListener("resize",_),window.removeEventListener("scroll",_),document.removeEventListener("mousemove",T),p()}}},[e,n,r,s,g,p]);const h=()=>{y(!0),p()},m=()=>{y(!1),x.current=setTimeout(()=>{o(!1),a(null)},150)},C=typeof t=="function"?t(i,()=>{o(!1),a(null)}):t,w=d.jsx("div",{onMouseEnter:h,onMouseLeave:m,children:C});return d.jsx(bS,{title:w,open:r,placement:l,disableInteractive:!1,PopperProps:{anchorEl:s,modifiers:[{name:"preventOverflow",options:{boundary:window}}]},children:d.jsx("span",{})})}const CS=({conversationId:e,hasSmList:t,smIds:n,isAdmin:r,goToApps:o,redirectToAdmin:s,sendTrackingEvent:a})=>{const[i,c]=I.useState(null),[l,f]=I.useState([]),{data:g,isError:y}=P_(e,t,n);return I.useEffect(()=>{g?c(g):y&&c(null)},[g,y]),I.useEffect(()=>{let x=null;if(i&&Object.keys(i).length&&e){x=new j_(Object.keys(i)||[],f);const b=Object.keys(i).map(p=>{var m;const h=((m=i[p])==null?void 0:m.cardData)||{};return{key:p,card_title:h.cardTitle,connector_id:h.connectorId}});a(un.OBJECT_HIGHLIGHTED,{conversation_id:e,sm_id:n[0],all_sm_ids:n,cards:b})}return()=>{x&&x.destroy(),window.tooltipCleanup&&delete window.tooltipCleanup}},[i,e,a,n]),d.jsx("div",{children:d.jsx(yS,{elements:l,title:(x,b)=>{var p;return!i||!x||!((p=i[x])!=null&&p.cardData)?d.jsx(u.Typography,{variant:"body2",color:u.theme.palette.gray.gray6,children:"Loading data..."}):d.jsx(mS,{smIds:n,conversationId:e||"",analysisData:i[x],isAdmin:r,redirectToAdmin:s,goToApps:o,hideTooltip:b,sendTrackingEvent:a})}})})},xS=({children:e})=>d.jsx(ac,{store:fl,children:d.jsx(u.HiverProvider,{inter:!0,children:d.jsx(dl,{children:d.jsx(I.Suspense,{fallback:d.jsx(d.Fragment,{}),children:e})})})}),ES=({conversationId:e,hasSmList:t,smIds:n,isAdmin:r,connectorFunctions:o})=>d.jsx(pl,{children:d.jsxs(xS,{children:[d.jsx(CS,{hasSmList:t,smIds:n,conversationId:e,isAdmin:r,goToApps:o.goToApps,redirectToAdmin:o.redirectToAdmin,sendTrackingEvent:o.sendTrackingEvent}),je.createPortal(d.jsx(hl,{id:"toast-message",children:d.jsx(Ua,{position:"bottom-left",autoClose:5e3,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,draggable:!0,pauseOnHover:!0})}),document.body)]})}),e2={OPEN_CREATE_FORM:"OPEN_CREATE_FORM"},vS=({conversationId:e,openCreateForm:t})=>n=>{n.conversationId===e&&t()};class wS{constructor({processDelay:t=1e3}){Re(this,"_processDelay");Re(this,"initialized",!1);Re(this,"_queue",[]);Re(this,"_queueProps",{conversationId:NaN,openCreateForm:()=>{}});Re(this,"ACTIONS",e2);this._processDelay=t}register(t){this._queueProps=t,!this.initialized&&(this.initialized=!0,this._delay(this._processDelay).then(()=>this._process()))}add(t){this._queue.push(t),this._process()}_delay(t){return new Promise(n=>setTimeout(n,t))}_process(){if(this.initialized)for(;this._queue.length>0;){const t=this._queue.shift();if(t)switch(t.type){case e2.OPEN_CREATE_FORM:vS(this._queueProps)(t.payload);break}}}destroy(){this._queueProps={conversationId:NaN,openCreateForm:()=>{}},this.initialized=!1}}var Se=(e=>(e.NOT_LOGGED="NOT_LOGGED",e.PENDING="PENDING",e.LOGGED="LOGGED",e.ERROR="ERROR",e.UNAUTHENTICATED="UNAUTHENTICATED",e.PAUSED="PAUSED",e))(Se||{}),Va=(e=>(e.ENABLED="enabled",e.UNAUTHENTICATED="unauthenticated",e.DISABLED="disabled",e))(Va||{});const IS=e=>{const t=[],n={};for(const r of e){const o=n[r.entityType];if(o===void 0){const s={type:r.entityType,entities:[r]};n[r.entityType]=t.length,t.push(s)}else t[o].entities.push(r)}return t},_S=e=>{const{emailLogSettings:t,messageLogStatus:n,selectedEntities:r,autoLogEnabled:o}=e;return t.connectorStatus===Va.UNAUTHENTICATED?Se.UNAUTHENTICATED:n.pending>0?Se.PENDING:n.failed?Se.ERROR:r.length===0?Se.NOT_LOGGED:o?Se.LOGGED:Se.PAUSED},ml=e=>A.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:14,height:14,viewBox:"0 0 14 14",fill:"#D24B58",...e},A.createElement("path",{d:"M6.3335 8.99967H7.66683V10.333H6.3335V8.99967ZM6.3335 3.66634H7.66683V7.66634H6.3335V3.66634ZM6.9935 0.333008C3.3135 0.333008 0.333496 3.31967 0.333496 6.99967C0.333496 10.6797 3.3135 13.6663 6.9935 13.6663C10.6802 13.6663 13.6668 10.6797 13.6668 6.99967C13.6668 3.31967 10.6802 0.333008 6.9935 0.333008ZM7.00016 12.333C4.0535 12.333 1.66683 9.94634 1.66683 6.99967C1.66683 4.05301 4.0535 1.66634 7.00016 1.66634C9.94683 1.66634 12.3335 4.05301 12.3335 6.99967C12.3335 9.94634 9.94683 12.333 7.00016 12.333Z"})),SS=e=>A.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:10,viewBox:"0 0 12 10",fill:"none",...e},A.createElement("path",{d:"M4.0001 8.0299L1.2201 5.2499L0.273438 6.1899L4.0001 9.91656L12.0001 1.91656L11.0601 0.976562L4.0001 8.0299Z",fill:"white"})),TS=e=>A.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:19,height:18,viewBox:"0 0 19 18",fill:"#6F7C90",...e},A.createElement("g",{clipPath:"url(#clip0_532_206243)"},A.createElement("path",{d:"M9.94092 3V0.75L6.94092 3.75L9.94092 6.75V4.5C12.4234 4.5 14.4409 6.5175 14.4409 9C14.4409 9.7575 14.2534 10.4775 13.9159 11.1L15.0109 12.195C15.5959 11.2725 15.9409 10.1775 15.9409 9C15.9409 5.685 13.2559 3 9.94092 3ZM9.94092 13.5C7.45842 13.5 5.44092 11.4825 5.44092 9C5.44092 8.2425 5.62842 7.5225 5.96592 6.9L4.87092 5.805C4.28592 6.7275 3.94092 7.8225 3.94092 9C3.94092 12.315 6.62592 15 9.94092 15V17.25L12.9409 14.25L9.94092 11.25V13.5Z"})),A.createElement("defs",null,A.createElement("clipPath",{id:"clip0_532_206243"},A.createElement("rect",{width:18,height:18,fill:"white",transform:"translate(0.940918)"})))),AS=e=>A.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:18,height:18,viewBox:"0 0 18 18",fill:"none",...e},A.createElement("g",{clipPath:"url(#clip0_1_11813)"},A.createElement("path",{d:"M9.05859 0C4.09059 0 0.0585938 4.032 0.0585938 9C0.0585938 13.968 4.09059 18 9.05859 18C14.0266 18 18.0586 13.968 18.0586 9C18.0586 4.032 14.0266 0 9.05859 0ZM8.15859 12.6H6.35859V5.4H8.15859V12.6ZM11.7586 12.6H9.95859V5.4H11.7586V12.6Z",fill:"#F2A579"})),A.createElement("defs",null,A.createElement("clipPath",{id:"clip0_1_11813"},A.createElement("rect",{width:18,height:18,fill:"white"})))),Ga=u.keyframes`
2583
+ `,Qp=e=>A.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},A.createElement("path",{d:"M7.87354 2.73877C7.87354 2.30139 7.53821 1.94227 7.11084 1.90381L5.09229 6.44775C5.06387 6.51167 5.02799 6.57074 4.98975 6.62744V12.3667H10.4722C11.0395 12.3665 11.5225 11.9529 11.6089 11.3921L12.2368 7.30811C12.3437 6.61168 11.8047 5.98395 11.1001 5.98389H9.05615C8.40276 5.98371 7.87354 5.45372 7.87354 4.80029V2.73877ZM2.07275 11.8003C2.07275 12.1133 2.32718 12.3667 2.64014 12.3667H3.78955V7.1499H2.64014C2.32718 7.1499 2.07275 7.40432 2.07275 7.71729V11.8003ZM9.07275 4.78369H11.1001C12.5403 4.78375 13.6412 6.0673 13.4224 7.49072L12.7944 11.5747C12.6179 12.7208 11.6318 13.5667 10.4722 13.5669H2.64014C1.66443 13.5669 0.873535 12.776 0.873535 11.8003V7.71729C0.873535 6.74158 1.66443 5.95068 2.64014 5.95068H3.99951L6.04834 1.34131L6.12256 1.20166C6.31844 0.892431 6.66142 0.700708 7.03467 0.700684C8.16045 0.700684 9.07275 1.61299 9.07275 2.73877V4.78369Z",fill:"#97A3B7"})),$p=e=>A.createElement("svg",{width:13,height:14,viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},A.createElement("path",{d:"M11.8008 3.16651C11.8008 2.83026 11.7996 2.61407 11.7861 2.44972C11.7733 2.29228 11.7516 2.23558 11.7383 2.20948C11.684 2.10311 11.5976 2.0167 11.4912 1.96241C11.4651 1.94911 11.4084 1.92742 11.251 1.91456C11.0866 1.90113 10.8698 1.89991 10.5332 1.89991H10.084V7.11671H10.5332C10.8697 7.11671 11.0866 7.11647 11.251 7.10304C11.4084 7.09017 11.4651 7.06848 11.4912 7.05519C11.5977 7.00085 11.684 6.91369 11.7383 6.80714C11.7516 6.78095 11.7733 6.72473 11.7861 6.56788C11.7996 6.40344 11.8008 6.18671 11.8008 5.85011V3.16651ZM6.00001 11.5288C6.00014 11.9658 6.33491 12.3239 6.76173 12.3628L8.68946 8.02784C8.73905 7.91626 8.79776 7.77463 8.8838 7.6421V1.89991H4.30275C3.86739 1.89991 3.57385 1.9011 3.34571 1.91847C3.12524 1.93527 3.00982 1.96482 2.92677 2.00245C2.72742 2.09281 2.55809 2.23906 2.43849 2.42237C2.38875 2.49873 2.34108 2.60774 2.29103 2.82276C2.23917 3.04561 2.19414 3.33583 2.12794 3.76612L1.82325 5.74952C1.73618 6.31551 1.67724 6.70248 1.65724 7.00245C1.63765 7.29653 1.66125 7.4439 1.69923 7.54347C1.79436 7.79282 1.97309 8.00139 2.20509 8.13331C2.29773 8.18598 2.43978 8.23198 2.73341 8.25733C3.03294 8.28318 3.42441 8.2837 3.99708 8.2837H4.46681C4.62026 8.2837 4.77205 8.28306 4.89943 8.29347C5.00019 8.30172 5.11526 8.31839 5.23439 8.36085L5.3545 8.41261L5.51271 8.51026C5.61292 8.58313 5.70157 8.67078 5.77443 8.77101L5.8711 8.93019L5.92286 9.0503C5.96524 9.1694 5.98202 9.28456 5.99025 9.38526C6.00063 9.51256 6.00001 9.66359 6.00001 9.8169V11.5288ZM13 5.85011C13 6.1669 13.0008 6.44089 12.9824 6.66554C12.9635 6.89709 12.9214 7.12868 12.8076 7.35206C12.6383 7.68439 12.3684 7.95514 12.0361 8.12452C11.8127 8.23838 11.5803 8.2804 11.3486 8.29933C11.124 8.31767 10.8499 8.3169 10.5332 8.3169H10.0899C9.97739 8.31691 9.91771 8.31637 9.87501 8.31886C9.85536 8.35692 9.83103 8.41194 9.78517 8.51515L7.82521 12.9263C7.6519 13.3159 7.26532 13.5669 6.83888 13.5669C5.71318 13.5669 4.80093 12.6545 4.80079 11.5288V9.8169C4.80079 9.64881 4.799 9.55553 4.79396 9.48878C4.72728 9.48383 4.63383 9.4839 4.46681 9.4839H3.99708C3.44579 9.4839 2.99395 9.48395 2.63087 9.45265C2.26202 9.42082 1.92186 9.35223 1.61232 9.17628C1.13824 8.90671 0.772529 8.48073 0.578136 7.9712C0.451217 7.63844 0.43534 7.29185 0.459972 6.92237C0.484222 6.55869 0.552876 6.11195 0.63673 5.5669L0.942394 3.58351C1.00581 3.17132 1.05751 2.82883 1.12208 2.55128C1.18838 2.26634 1.27691 2.00629 1.4336 1.76612C1.67803 1.39152 2.02424 1.0943 2.43165 0.909678C2.69285 0.791323 2.96319 0.743407 3.25489 0.721201C3.53908 0.699573 3.8856 0.700693 4.30275 0.700693H10.5332C10.8499 0.700693 11.124 0.69993 11.3486 0.718272C11.5803 0.737198 11.8127 0.779216 12.0361 0.893076C12.3683 1.06241 12.6383 1.33244 12.8076 1.66456C12.9215 1.88802 12.9635 2.12041 12.9824 2.35206C13.0008 2.57656 13 2.85001 13 3.16651V5.85011Z",fill:"#97A3B7"})),hS=e=>A.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},A.createElement("path",{d:"M6.02637 0.261719C6.91006 0.100716 7.81654 0.108586 8.69727 0.285156C8.77943 0.301685 8.85737 0.335356 8.92578 0.383789C8.99413 0.432207 9.05187 0.494446 9.09473 0.566406L10.1699 2.37109L12.2686 2.40137C12.3521 2.40267 12.4348 2.42105 12.5107 2.45605C12.5866 2.49114 12.6547 2.5417 12.71 2.60449L12.9268 2.8623C13.4177 3.47393 13.8044 4.1638 14.0703 4.90332H14.0713C14.1006 4.98499 14.1111 5.07276 14.1035 5.15918C14.0958 5.24545 14.0694 5.32914 14.0264 5.4043L13.0107 7.17676L14.0654 8.97949C14.1089 9.05374 14.1349 9.13706 14.1436 9.22266C14.1522 9.30829 14.143 9.39509 14.1152 9.47656C13.8308 10.316 13.3846 11.0919 12.8008 11.7588C12.7442 11.8235 12.6731 11.8748 12.5947 11.9102C12.5163 11.9454 12.4307 11.9644 12.3447 11.9639L10.2559 11.9512L9.22656 13.7188C9.18293 13.7935 9.12263 13.8576 9.05176 13.9072C8.98094 13.9567 8.90045 13.9914 8.81543 14.0068C7.9318 14.1675 7.02506 14.1583 6.14453 13.9814L6.14355 13.9824C6.0797 13.9694 6.01838 13.9446 5.96191 13.9121C5.87332 13.8615 5.7985 13.7897 5.74609 13.7021L4.67188 11.8955L2.56934 11.8682C2.48571 11.8669 2.4031 11.8485 2.32715 11.8135C2.25108 11.7784 2.18323 11.727 2.12793 11.6641C1.60736 11.0751 1.18875 10.4045 0.888672 9.67969L0.767578 9.36621C0.738264 9.28452 0.726773 9.19681 0.734375 9.11035C0.742031 9.02393 0.768379 8.93953 0.811523 8.86426L1.82617 7.0918L0.772461 5.28906C0.729026 5.2148 0.702006 5.1315 0.693359 5.0459C0.684801 4.96052 0.695058 4.87421 0.722656 4.79297C1.00784 3.95289 1.45608 3.17678 2.04102 2.50977C2.09771 2.44503 2.16762 2.39274 2.24609 2.35742C2.32438 2.32222 2.40928 2.30426 2.49512 2.30469L4.58398 2.31543L5.61426 0.549805C5.65789 0.474997 5.71718 0.410066 5.78809 0.360352C5.8591 0.31064 5.94107 0.277156 6.02637 0.261719ZM7.53809 14.0195C7.59898 14.0196 7.65982 14.0181 7.7207 14.0166C7.65982 14.0181 7.59898 14.0196 7.53809 14.0195ZM7.2334 14.0117C7.28581 14.014 7.33818 14.0164 7.39062 14.0176C7.33818 14.0164 7.28581 14.014 7.2334 14.0117ZM7.85742 14.0127C7.89653 14.0109 7.93552 14.0073 7.97461 14.0049C7.93552 14.0073 7.89654 14.0109 7.85742 14.0127ZM6.91113 13.9902C6.97295 13.9958 7.03476 14.0009 7.09668 14.0049C7.03476 14.0009 6.97295 13.9958 6.91113 13.9902ZM6.6543 13.9619C6.6898 13.9665 6.72519 13.9716 6.76074 13.9756C6.72519 13.9716 6.6898 13.9665 6.6543 13.9619ZM5.91016 13.75C5.94027 13.7795 5.97474 13.8051 6.01172 13.8262L5.95898 13.791C5.94197 13.7782 5.92535 13.7649 5.91016 13.75ZM6.58008 12.9414H6.58105H6.58008ZM8.2002 1.41895C7.63858 1.33129 7.06722 1.32543 6.50391 1.40137L5.5127 3.10059C5.45667 3.19686 5.37383 3.27503 5.27539 3.32715C5.21254 3.36088 5.14878 3.39942 5.08594 3.43555L5.08496 3.43457C4.99197 3.48895 4.88605 3.51825 4.77832 3.51758L2.77637 3.50586C2.43354 3.9367 2.15694 4.41647 1.95508 4.92871L2.96875 6.66211H2.96973C3.01013 6.73278 3.03531 6.81132 3.04492 6.8916L3.04883 6.97461C3.04667 7.04613 3.0485 7.11658 3.05078 7.18945C3.0548 7.30124 3.02821 7.41268 2.97266 7.50977L1.99609 9.21289C2.21404 9.7388 2.50744 10.2299 2.86621 10.6719L4.88281 10.7012H4.88379C4.99002 10.7034 5.09368 10.7341 5.18457 10.7891L5.39258 10.9082C5.45916 10.9464 5.51715 10.9978 5.56445 11.0576L5.6084 11.1201L6.6416 12.8486C7.20362 12.9365 7.77513 12.9432 8.33887 12.8672L9.3291 11.1689C9.38528 11.0722 9.46843 10.9926 9.56738 10.9404C9.63017 10.9067 9.69505 10.8701 9.75781 10.834L9.8291 10.7988C9.90336 10.7678 9.98341 10.7514 10.0645 10.752L12.0664 10.7646C12.4092 10.3324 12.6847 9.85062 12.8857 9.33691L11.8711 7.60645L11.8721 7.60547C11.8181 7.51108 11.7903 7.40365 11.792 7.29492L11.791 7.29395C11.7932 7.22206 11.7923 7.15042 11.79 7.07715C11.7862 6.96565 11.8128 6.85466 11.8682 6.75781L12.8438 5.05371C12.6258 4.52811 12.3333 4.03648 11.9746 3.59473L9.95801 3.56641H9.95703C9.85067 3.56414 9.74722 3.53265 9.65625 3.47754V3.47852L9.45898 3.36426L9.39258 3.32129C9.32844 3.27486 9.27351 3.21669 9.23242 3.14844V3.14746L8.2002 1.41895ZM2.4668 11.7559L2.57031 11.7686H2.57129C2.50157 11.7675 2.43246 11.7518 2.36914 11.7227L2.4668 11.7559ZM1.78809 11.082V11.0811V11.082ZM13.0244 11.3203C13.0502 11.2862 13.0774 11.2533 13.1025 11.2188C13.0774 11.2533 13.0502 11.2862 13.0244 11.3203ZM13.2051 11.0713C13.2348 11.0279 13.2643 10.9845 13.293 10.9404C13.2643 10.9845 13.2348 11.0279 13.2051 11.0713ZM9.90918 10.876C9.90231 10.8782 9.89544 10.8803 9.88867 10.8828C9.89545 10.8803 9.90231 10.8782 9.90918 10.876ZM13.3535 10.8447C13.3903 10.7861 13.426 10.7268 13.4609 10.667C13.426 10.7268 13.3903 10.7861 13.3535 10.8447ZM13.5049 10.5928C13.5426 10.5264 13.5789 10.4593 13.6143 10.3916C13.5789 10.4593 13.5426 10.5264 13.5049 10.5928ZM13.6582 10.3066C13.695 10.2337 13.7305 10.1602 13.7646 10.0859C13.7305 10.1602 13.695 10.2337 13.6582 10.3066ZM7.2168 4.04004C7.82858 3.99994 8.43974 4.14269 8.9707 4.44922C9.68176 4.86085 10.2003 5.53844 10.4131 6.33203C10.6256 7.12573 10.5145 7.97155 10.1045 8.68359C9.79803 9.21429 9.34157 9.64291 8.79199 9.91406C8.24214 10.1852 7.62346 10.287 7.01562 10.207C6.40793 10.127 5.83684 9.86895 5.37598 9.46484C4.91529 9.06072 4.58448 8.52844 4.42578 7.93652C4.26721 7.34451 4.28843 6.71808 4.48535 6.1377C4.68236 5.55755 5.04627 5.04792 5.53223 4.6748C6.01845 4.30171 6.60526 4.08027 7.2168 4.04004ZM13.7852 10.041C13.8281 9.94559 13.8697 9.84945 13.9082 9.75195V9.75098C13.8696 9.84876 13.8283 9.94531 13.7852 10.041ZM6.40918 9.95703C6.46044 9.97542 6.51219 9.99222 6.56445 10.0078C6.51219 9.99225 6.46044 9.97539 6.40918 9.95703ZM6.20996 9.87695C6.25096 9.89508 6.2922 9.91244 6.33398 9.92871C6.2922 9.91247 6.25097 9.89505 6.20996 9.87695ZM6.02832 9.79004C6.0678 9.81077 6.10809 9.82969 6.14844 9.84863C6.10808 9.82972 6.06781 9.81074 6.02832 9.79004ZM5.84082 9.68262C5.87596 9.70443 5.9113 9.72578 5.94727 9.74609C5.91128 9.7258 5.87597 9.7044 5.84082 9.68262ZM12.9131 9.53613C12.9421 9.46825 12.9707 9.40012 12.9971 9.33105L12.9961 9.33008C12.9697 9.3993 12.9422 9.46808 12.9131 9.53613ZM5.66602 9.56543C5.7015 9.59105 5.73694 9.61662 5.77344 9.64062C5.73693 9.61664 5.70151 9.59104 5.66602 9.56543ZM1.97461 9.41699C1.99284 9.4575 2.01311 9.49704 2.03223 9.53711C1.98023 9.42813 1.93016 9.31814 1.88477 9.20605L1.97461 9.41699ZM5.59277 9.5127C5.59556 9.51484 5.59877 9.51642 5.60156 9.51855C5.54737 9.47722 5.49386 9.43478 5.44238 9.38965L5.59277 9.5127ZM8.03125 5.33496C7.67547 5.21424 7.29063 5.20159 6.92773 5.29883C6.56509 5.39617 6.23977 5.59952 5.99219 5.88184C5.74452 6.16433 5.58615 6.51424 5.53711 6.88672C5.48824 7.25901 5.54977 7.63783 5.71582 7.97461C5.88202 8.31152 6.14537 8.59145 6.4707 8.7793C6.90703 9.0311 7.42549 9.09913 7.91211 8.96875C8.39876 8.83831 8.81448 8.52031 9.06641 8.08398C9.25414 7.7587 9.3409 7.38453 9.31641 7.00977C9.2918 6.635 9.15631 6.27555 8.92773 5.97754C8.69908 5.67961 8.38685 5.45577 8.03125 5.33496ZM6.17676 8.69922C6.25355 8.76023 6.3343 8.81676 6.41992 8.86621L6.4209 8.86523C6.33525 8.81578 6.2536 8.76024 6.17676 8.69922ZM8.47754 8.83203V8.83105V8.83203ZM5.77637 8.27246C5.83227 8.35318 5.89399 8.4295 5.96094 8.50098L5.86426 8.38965C5.83359 8.35168 5.80422 8.31265 5.77637 8.27246ZM4.52246 7.91113C4.5608 8.0541 4.60948 8.19346 4.66797 8.32812C4.60945 8.19325 4.56083 8.05334 4.52246 7.91016V7.91113ZM9.40039 6.85645C9.40722 6.90519 9.41278 6.95457 9.41602 7.00391C9.41922 7.05311 9.42035 7.1023 9.41992 7.15137C9.42035 7.10204 9.41926 7.05239 9.41602 7.00293C9.41279 6.95379 9.40719 6.90498 9.40039 6.85645ZM11.9004 6.95215C11.8982 6.96247 11.897 6.97295 11.8955 6.9834C11.8971 6.97295 11.8982 6.96247 11.9004 6.95215ZM4.65137 5.97754C4.62849 6.03229 4.60852 6.08831 4.58887 6.14453C4.60851 6.0883 4.6285 6.03229 4.65137 5.97754ZM4.73633 5.79492C4.7241 5.81941 4.71274 5.8443 4.70117 5.86914C4.71273 5.8443 4.72411 5.81941 4.73633 5.79492ZM4.84473 5.59863C4.82627 5.62957 4.80836 5.66078 4.79102 5.69238C4.80835 5.66077 4.82628 5.62957 4.84473 5.59863ZM4.95605 5.42383C4.93113 5.45972 4.90714 5.49624 4.88379 5.5332C4.90712 5.49623 4.93114 5.45973 4.95605 5.42383ZM8.31445 4.27051C8.52443 4.33607 8.72746 4.42504 8.91992 4.53613L8.9209 4.53516C8.72801 4.42379 8.52395 4.33516 8.31348 4.26953L8.31445 4.27051ZM5.09082 5.24609C5.06172 5.28198 5.03326 5.3183 5.00586 5.35547C5.03325 5.31828 5.06173 5.28199 5.09082 5.24609ZM6.63965 5.29199C6.64276 5.29067 6.6463 5.29037 6.64941 5.28906C6.6463 5.29037 6.64276 5.29067 6.63965 5.29199ZM7.9209 5.19824H7.92188H7.9209ZM6.90234 5.20215H6.90332H6.90234ZM5.23145 5.08496C5.19896 5.11965 5.16651 5.15429 5.13574 5.19043C5.1665 5.15428 5.19897 5.11966 5.23145 5.08496ZM13.9766 4.93652V4.9375V4.93652ZM0.922852 4.53613C0.885573 4.63126 0.850299 4.72727 0.817383 4.82422V4.8252C0.850362 4.72803 0.885496 4.63148 0.922852 4.53613ZM2.01855 4.5293H2.01953H2.01855ZM1.04688 4.24316C1.02195 4.29878 0.998013 4.35481 0.974609 4.41113C0.998008 4.35481 1.02196 4.29878 1.04688 4.24316ZM7.22363 4.13965L7.22461 4.14062L7.22363 4.13965ZM7.66699 4.14453L7.66602 4.14355L7.66699 4.14453ZM1.17188 3.97852C1.1445 4.03303 1.11865 4.08828 1.09277 4.14355C1.11864 4.08828 1.14451 4.03304 1.17188 3.97852ZM12.4287 4.0498V4.04883V4.0498ZM12.6348 2.66992V2.6709C12.8546 2.91962 13.0566 3.1828 13.2383 3.45898C13.1171 3.27471 12.987 3.09618 12.8486 2.92383C12.7796 2.83782 12.708 2.75273 12.6348 2.66992ZM1.30859 3.72168C1.28765 3.75921 1.26729 3.79703 1.24707 3.83496C1.26728 3.79703 1.28765 3.75921 1.30859 3.72168ZM2.72656 3.40723V3.4082L4.7793 3.41797V3.41699L2.72656 3.40723ZM12.0234 3.49707C12.0719 3.55591 12.1198 3.61522 12.166 3.67578L12.0234 3.49609L9.95898 3.4668L12.0234 3.49707ZM1.47852 3.43457C1.45114 3.47831 1.42381 3.52205 1.39746 3.56641C1.4238 3.52204 1.45115 3.47831 1.47852 3.43457ZM9.78809 3.43164C9.79329 3.43365 9.79845 3.43566 9.80371 3.4375C9.79845 3.43567 9.79329 3.43365 9.78809 3.43164ZM5.22852 3.23926V3.24023V3.23926ZM1.64746 3.17676C1.61837 3.21879 1.58963 3.26104 1.56152 3.30371C1.58963 3.26104 1.61837 3.21879 1.64746 3.17676ZM2.11523 2.5752H2.11621H2.11523ZM8.94629 0.53418C8.96978 0.559626 8.99096 0.587273 9.00879 0.617188C8.97313 0.557368 8.92497 0.505135 8.86816 0.464844L8.94629 0.53418ZM6.37305 0.307617C6.26302 0.322319 6.15337 0.34041 6.04395 0.360352C6.15337 0.340409 6.26301 0.322304 6.37305 0.307617ZM8.35059 0.325195C8.25055 0.310024 8.15027 0.296933 8.0498 0.286133C8.15027 0.296945 8.25055 0.310026 8.35059 0.325195ZM7.92578 0.275391C7.85971 0.269476 7.79372 0.26282 7.72754 0.258789C7.79372 0.262834 7.85971 0.269466 7.92578 0.275391ZM6.9502 0.255859C6.89287 0.258741 6.83558 0.262311 6.77832 0.266602C6.83559 0.262325 6.89287 0.258726 6.9502 0.255859ZM7.58008 0.25293C7.53418 0.251105 7.4883 0.248968 7.44238 0.248047C7.4883 0.24898 7.53418 0.251094 7.58008 0.25293ZM7.12988 0.249023C7.17448 0.24794 7.21907 0.247302 7.26367 0.24707C7.21907 0.247314 7.17448 0.247928 7.12988 0.249023ZM6.67871 0.274414C6.57668 0.283521 6.47471 0.294033 6.37305 0.307617C6.47471 0.294047 6.57668 0.283499 6.67871 0.274414Z",fill:"#97A3B7"})),gS=e=>A.createElement("svg",{width:14,height:15,viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},A.createElement("g",{clipPath:"url(#clip0_189_1728)"},A.createElement("path",{d:"M2.33317 2.4672H11.6665V9.4672H3.01567L2.33317 10.1497V2.4672ZM2.33317 1.30054C1.6915 1.30054 1.17234 1.82554 1.17234 2.4672L1.1665 12.9672L3.49984 10.6339H11.6665C12.3082 10.6339 12.8332 10.1089 12.8332 9.4672V2.4672C12.8332 1.82554 12.3082 1.30054 11.6665 1.30054H2.33317ZM3.49984 7.13387H8.1665V8.30054H3.49984V7.13387ZM3.49984 5.38387H10.4998V6.55054H3.49984V5.38387ZM3.49984 3.63387H10.4998V4.80054H3.49984V3.63387Z",fill:"#97A3B7"})),A.createElement("defs",null,A.createElement("clipPath",{id:"clip0_189_1728"},A.createElement("rect",{width:14,height:14,fill:"white",transform:"translate(0 0.133789)"})))),mS=e=>A.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},A.createElement("g",{clipPath:"url(#clip0_3803_129233)"},A.createElement("path",{d:"M7.3335 4.66683H8.66683V6.00016H7.3335V4.66683ZM7.3335 7.3335H8.66683V11.3335H7.3335V7.3335ZM8.00016 1.3335C4.32016 1.3335 1.3335 4.32016 1.3335 8.00016C1.3335 11.6802 4.32016 14.6668 8.00016 14.6668C11.6802 14.6668 14.6668 11.6802 14.6668 8.00016C14.6668 4.32016 11.6802 1.3335 8.00016 1.3335ZM8.00016 13.3335C5.06016 13.3335 2.66683 10.9402 2.66683 8.00016C2.66683 5.06016 5.06016 2.66683 8.00016 2.66683C10.9402 2.66683 13.3335 5.06016 13.3335 8.00016C13.3335 10.9402 10.9402 13.3335 8.00016 13.3335Z",fill:"#6F7C90"})),A.createElement("defs",null,A.createElement("clipPath",{id:"clip0_3803_129233"},A.createElement("rect",{width:16,height:16,fill:"white"})))),bS=({analysisData:e,isAdmin:t=!1,smIds:n,conversationId:r,showGoToApp:o=!1,redirectToAdmin:s,goToApps:a,hideTooltip:i,sendTrackingEvent:c})=>{const[l,f]=I.useState(!1),g=I.useRef(!1),[y,x]=I.useState(!1),[b,p]=I.useState([]),{mutate:h,isPending:m}=V_(),{logoUrl:E,cardTitle:C,id:w,externalResourceId:v,connectorId:_,textToHighlight:T}=e.cardData||{},S=I.useMemo(()=>({key:T,card_id:w,card_title:C,connector_id:_,external_resource_id:v,conversation_id:r,sm_id:n[0],all_sm_ids:n}),[T,w,C,_,v,r,n]);if(I.useEffect(()=>{const H=Date.now();return()=>{c(un.DATA_CARD_DURATION,{...S,duration:Date.now()-H})}},[c]),I.useEffect(()=>{var q,ne,ce;const H=(ce=(ne=(q=e==null?void 0:e.cardData)==null?void 0:q.data)==null?void 0:ne.flatDetails)==null?void 0:ce.data;if(H){const V=H.sort((R,G)=>R.priority-G.priority);p(V),c(un.OBJECT_HOVERED,S)}},[e,c,S]),!b||b.length===0)return null;const L=()=>{f(!0),c(un.FEEDBACK_OPTION_CLICKED,S)},N=()=>{x(!0),c(un.NEGATIVE_FEEDBACK_CLICKED,S)},k=H=>{const q={card_id:w,entity_id:v,comment:H.feedbackComment,option:H.feedbackOption,feedback_type:"entity_extraction"};typeof H.isThumbsUp<"u"&&(q.positive_feedback=H.isThumbsUp),h({conversationId:r,feedbackData:q},{onSuccess:()=>{l?c(un.FEEDBACK_OPTION_SUBMITTED,S):y&&c(un.NEGATIVE_FEEDBACK_SUBMITTED,S),f(!1),x(!1),Ie({message:K_,type:Ut})},onError:()=>{Ie({message:eS,type:Ye})}})},D=()=>{k({isThumbsUp:!0}),c(un.POSITIVE_FEEDBACK_CLICKED,S)},M=H=>{k({...H,isThumbsUp:!1})},j=()=>{s==null||s(_),i()},J=()=>{a==null||a()},Y=H=>{c(un.PERMALINK_CLICKED,{...S,clicked_value:H})},z=()=>{g.current||(c(un.DATA_CARD_SCROLLED,S),g.current=!0)};return d.jsxs(d.Fragment,{children:[d.jsxs(oS,{children:[d.jsxs(cS,{onScroll:z,children:[d.jsxs(sS,{children:[d.jsxs(u.Stack,{flexDirection:"row",alignItems:"center",style:{height:"100%"},children:[E&&d.jsx("img",{src:E,alt:"Logo",style:{marginRight:8},height:18,width:18}),d.jsx(u.Tooltip,{title:C,arrow:!0,placement:"top",children:d.jsx(aS,{variant:"h3",color:u.theme.palette.gray.black,width:o?"100px":"200px",children:C})})]}),o?d.jsx(pS,{variant:"text",size:"small",endIcon:d.jsx(u.icons.ArrowForward,{}),onClick:J,children:z_}):null]}),d.jsx(iS,{}),d.jsx(u.Box,{paddingY:"16px",children:b.map(({key:H,value:q,label:ne,deepLink:ce})=>d.jsxs(dS,{children:[d.jsxs(lS,{children:[ne,":"]}),d.jsx(u.Tooltip,{title:(q==null?void 0:q.length)>gl?q:"",arrow:!0,placement:"top",children:ce?d.jsx(u.Link,{href:ce,target:"_blank",rel:"noopener noreferrer",style:{textDecoration:"none",color:u.theme.palette.primary.main},onClick:()=>Y(q),children:Bd(q||"N/A",gl)}):d.jsx(uS,{children:Bd(q||"N/A",gl)})})]},H))})]}),d.jsxs(fS,{children:[d.jsx(u.Stack,{flexDirection:"row",alignItems:"center",children:t?d.jsx(ss,{arrow:!0,title:Z_,placement:"top",children:d.jsx(u.IconButton,{onClick:j,children:d.jsx(hS,{})})}):d.jsxs(d.Fragment,{children:[d.jsx(u.Typography,{color:u.theme.palette.gray.gray3,fontSize:12,children:Y_}),d.jsx(ss,{arrow:!0,title:X_,placement:"top",children:d.jsx(u.IconButton,{size:"small",children:d.jsx(mS,{})})})]})}),d.jsxs(u.Stack,{flexDirection:"row",alignItems:"center",children:[d.jsx(ss,{arrow:!0,title:G_,placement:"top",children:d.jsx(u.IconButton,{size:"small",disabled:m,onClick:D,children:d.jsx(Qp,{})})}),d.jsx(ss,{arrow:!0,title:H_,placement:"top",children:d.jsx(u.IconButton,{size:"small",disabled:m,onClick:N,children:d.jsx($p,{})})}),d.jsx(ss,{arrow:!0,title:W_,placement:"top",children:d.jsx(u.IconButton,{onClick:L,size:"small",disabled:m,children:d.jsx(gS,{})})})]})]})]}),d.jsx(Er,{shown:l,setShown:f,borderRadius:12,sx:{zIndex:15002},children:d.jsx(qp,{onCancel:()=>f(!1),onSubmit:k,isLoading:m,showOptions:!1,title:q_})}),d.jsx(Er,{shown:y,setShown:x,borderRadius:12,sx:{zIndex:15002},children:d.jsx(qp,{onCancel:()=>x(!1),onSubmit:M,isLoading:m,title:J_})})]})},Up=(e,t,n,r=10)=>e>=n.left-r&&e<=n.right+r&&t>=n.top-r&&t<=n.bottom+r,Kp=(e,t=350,n=400)=>{const r=e.getBoundingClientRect(),o=window.innerHeight,s=window.innerWidth,a=r.top,i=o-r.bottom;return i>=t||i>a?r.left<n/2?"bottom-start":s-r.right<n/2?"bottom-end":"bottom":r.left<n/2?"top-start":s-r.right<n/2?"top-end":"top"},yS=u.styled(({className:e,...t})=>d.jsx(u.Tooltip,{...t,classes:{popper:e}}))(()=>({[`& .${u.tooltipClasses.tooltip}`]:{backgroundColor:"#fff",padding:0,maxWidth:"288px",width:"288px",maxHeight:"300px",overflowY:"auto",borderRadius:"12px",boxShadow:"0px 0px 8px 0px #04060F14",border:`1px solid ${u.theme.palette.gray.gray6}`,position:"relative"}}));function CS({elements:e,title:t,onKeyChange:n}){const[r,o]=I.useState(!1),[s,a]=I.useState(null),[i,c]=I.useState(""),[l,f]=I.useState("bottom"),[g,y]=I.useState(!1),x=I.useRef(null),b=I.useRef({x:0,y:0}),p=I.useCallback(()=>{x.current&&(clearTimeout(x.current),x.current=null)},[]);I.useEffect(()=>{if(e&&e.length>0){const v=S=>{const L=S.currentTarget,N=L.textContent||"",k=Kp(L);f(k),c(N),n&&n(N),a(L),o(!0)},_=()=>{if(r&&s){const S=Kp(s);f(S)}},T=S=>{if(b.current={x:S.clientX,y:S.clientY},!r||g)return;const L=S.clientX,N=S.clientY;let k=!1;for(const D of e)if(Up(L,N,D.getBoundingClientRect())){k=!0;break}if(!k){const D=document.querySelector(`.${u.tooltipClasses.tooltip}`);D&&Up(L,N,D.getBoundingClientRect())&&(k=!0)}k||(o(!1),a(null))};return e.forEach(S=>{S.addEventListener("mouseenter",v)}),window.addEventListener("resize",_),window.addEventListener("scroll",_),document.addEventListener("mousemove",T),()=>{e.forEach(S=>{S.removeEventListener("mouseenter",v)}),window.removeEventListener("resize",_),window.removeEventListener("scroll",_),document.removeEventListener("mousemove",T),p()}}},[e,n,r,s,g,p]);const h=()=>{y(!0),p()},m=()=>{y(!1),x.current=setTimeout(()=>{o(!1),a(null)},150)},C=typeof t=="function"?t(i,()=>{o(!1),a(null)}):t,w=d.jsx("div",{onMouseEnter:h,onMouseLeave:m,children:C});return d.jsx(yS,{title:w,open:r,placement:l,disableInteractive:!1,PopperProps:{anchorEl:s,modifiers:[{name:"preventOverflow",options:{boundary:window}}]},children:d.jsx("span",{})})}const xS=({conversationId:e,hasSmList:t,smIds:n,isAdmin:r,goToApps:o,redirectToAdmin:s,sendTrackingEvent:a})=>{const[i,c]=I.useState(null),[l,f]=I.useState([]),{data:g,isError:y}=j_(e,t,n);return I.useEffect(()=>{g?c(g):y&&c(null)},[g,y]),I.useEffect(()=>{let x=null;if(i&&Object.keys(i).length&&e){x=new B_(Object.keys(i)||[],f);const b=Object.keys(i).map(p=>{var m;const h=((m=i[p])==null?void 0:m.cardData)||{};return{key:p,card_title:h.cardTitle,connector_id:h.connectorId}});a(un.OBJECT_HIGHLIGHTED,{conversation_id:e,sm_id:n[0],all_sm_ids:n,cards:b})}return()=>{x&&x.destroy(),window.tooltipCleanup&&delete window.tooltipCleanup}},[i,e,a,n]),d.jsx("div",{children:d.jsx(CS,{elements:l,title:(x,b)=>{var p;return!i||!x||!((p=i[x])!=null&&p.cardData)?d.jsx(u.Typography,{variant:"body2",color:u.theme.palette.gray.gray6,children:"Loading data..."}):d.jsx(bS,{smIds:n,conversationId:e||"",analysisData:i[x],isAdmin:r,redirectToAdmin:s,goToApps:o,hideTooltip:b,sendTrackingEvent:a})}})})},ES=({children:e})=>d.jsx(ac,{store:fl,children:d.jsx(u.HiverProvider,{inter:!0,children:d.jsx(dl,{children:d.jsx(I.Suspense,{fallback:d.jsx(d.Fragment,{}),children:e})})})}),vS=({conversationId:e,hasSmList:t,smIds:n,isAdmin:r,connectorFunctions:o})=>d.jsx(pl,{children:d.jsxs(ES,{children:[d.jsx(xS,{hasSmList:t,smIds:n,conversationId:e,isAdmin:r,goToApps:o.goToApps,redirectToAdmin:o.redirectToAdmin,sendTrackingEvent:o.sendTrackingEvent}),je.createPortal(d.jsx(hl,{id:"toast-message",children:d.jsx(Ua,{position:"bottom-left",autoClose:5e3,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,draggable:!0,pauseOnHover:!0})}),document.body)]})}),e2={OPEN_CREATE_FORM:"OPEN_CREATE_FORM"},wS=({conversationId:e,openCreateForm:t})=>n=>{n.conversationId===e&&t()};class IS{constructor({processDelay:t=1e3}){Re(this,"_processDelay");Re(this,"initialized",!1);Re(this,"_queue",[]);Re(this,"_queueProps",{conversationId:NaN,openCreateForm:()=>{}});Re(this,"ACTIONS",e2);this._processDelay=t}register(t){this._queueProps=t,!this.initialized&&(this.initialized=!0,this._delay(this._processDelay).then(()=>this._process()))}add(t){this._queue.push(t),this._process()}_delay(t){return new Promise(n=>setTimeout(n,t))}_process(){if(this.initialized)for(;this._queue.length>0;){const t=this._queue.shift();if(t)switch(t.type){case e2.OPEN_CREATE_FORM:wS(this._queueProps)(t.payload);break}}}destroy(){this._queueProps={conversationId:NaN,openCreateForm:()=>{}},this.initialized=!1}}var Se=(e=>(e.NOT_LOGGED="NOT_LOGGED",e.PENDING="PENDING",e.LOGGED="LOGGED",e.ERROR="ERROR",e.UNAUTHENTICATED="UNAUTHENTICATED",e.PAUSED="PAUSED",e))(Se||{}),Va=(e=>(e.ENABLED="enabled",e.UNAUTHENTICATED="unauthenticated",e.DISABLED="disabled",e))(Va||{});const _S=e=>{const t=[],n={};for(const r of e){const o=n[r.entityType];if(o===void 0){const s={type:r.entityType,entities:[r]};n[r.entityType]=t.length,t.push(s)}else t[o].entities.push(r)}return t},SS=e=>{const{emailLogSettings:t,messageLogStatus:n,selectedEntities:r,autoLogEnabled:o}=e;return t.connectorStatus===Va.UNAUTHENTICATED?Se.UNAUTHENTICATED:n.pending>0?Se.PENDING:n.failed?Se.ERROR:r.length===0?Se.NOT_LOGGED:o?Se.LOGGED:Se.PAUSED},ml=e=>A.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:14,height:14,viewBox:"0 0 14 14",fill:"#D24B58",...e},A.createElement("path",{d:"M6.3335 8.99967H7.66683V10.333H6.3335V8.99967ZM6.3335 3.66634H7.66683V7.66634H6.3335V3.66634ZM6.9935 0.333008C3.3135 0.333008 0.333496 3.31967 0.333496 6.99967C0.333496 10.6797 3.3135 13.6663 6.9935 13.6663C10.6802 13.6663 13.6668 10.6797 13.6668 6.99967C13.6668 3.31967 10.6802 0.333008 6.9935 0.333008ZM7.00016 12.333C4.0535 12.333 1.66683 9.94634 1.66683 6.99967C1.66683 4.05301 4.0535 1.66634 7.00016 1.66634C9.94683 1.66634 12.3335 4.05301 12.3335 6.99967C12.3335 9.94634 9.94683 12.333 7.00016 12.333Z"})),TS=e=>A.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:10,viewBox:"0 0 12 10",fill:"none",...e},A.createElement("path",{d:"M4.0001 8.0299L1.2201 5.2499L0.273438 6.1899L4.0001 9.91656L12.0001 1.91656L11.0601 0.976562L4.0001 8.0299Z",fill:"white"})),AS=e=>A.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:19,height:18,viewBox:"0 0 19 18",fill:"#6F7C90",...e},A.createElement("g",{clipPath:"url(#clip0_532_206243)"},A.createElement("path",{d:"M9.94092 3V0.75L6.94092 3.75L9.94092 6.75V4.5C12.4234 4.5 14.4409 6.5175 14.4409 9C14.4409 9.7575 14.2534 10.4775 13.9159 11.1L15.0109 12.195C15.5959 11.2725 15.9409 10.1775 15.9409 9C15.9409 5.685 13.2559 3 9.94092 3ZM9.94092 13.5C7.45842 13.5 5.44092 11.4825 5.44092 9C5.44092 8.2425 5.62842 7.5225 5.96592 6.9L4.87092 5.805C4.28592 6.7275 3.94092 7.8225 3.94092 9C3.94092 12.315 6.62592 15 9.94092 15V17.25L12.9409 14.25L9.94092 11.25V13.5Z"})),A.createElement("defs",null,A.createElement("clipPath",{id:"clip0_532_206243"},A.createElement("rect",{width:18,height:18,fill:"white",transform:"translate(0.940918)"})))),LS=e=>A.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:18,height:18,viewBox:"0 0 18 18",fill:"none",...e},A.createElement("g",{clipPath:"url(#clip0_1_11813)"},A.createElement("path",{d:"M9.05859 0C4.09059 0 0.0585938 4.032 0.0585938 9C0.0585938 13.968 4.09059 18 9.05859 18C14.0266 18 18.0586 13.968 18.0586 9C18.0586 4.032 14.0266 0 9.05859 0ZM8.15859 12.6H6.35859V5.4H8.15859V12.6ZM11.7586 12.6H9.95859V5.4H11.7586V12.6Z",fill:"#F2A579"})),A.createElement("defs",null,A.createElement("clipPath",{id:"clip0_1_11813"},A.createElement("rect",{width:18,height:18,fill:"white"})))),Ga=u.keyframes`
2574
2584
  from {
2575
2585
  transform: rotate(0deg);
2576
2586
  }
@@ -2583,73 +2593,73 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
2583
2593
  border-radius: 50%;
2584
2594
  justify-content: center;
2585
2595
  align-items: center;
2586
- `,LS=u.styled(bl)`
2587
- background-color: #ffe250;
2588
2596
  `,OS=u.styled(bl)`
2589
- background-color: #00bc7e;
2597
+ background-color: #ffe250;
2590
2598
  `,FS=u.styled(bl)`
2599
+ background-color: #00bc7e;
2600
+ `,kS=u.styled(bl)`
2591
2601
  animation: ${Ga} 1s linear infinite;
2592
2602
  animation-fill-mode: backwards;
2593
2603
  animation-direction: reverse;
2594
- `,kS={[Se.NOT_LOGGED]:d.jsx(LS,{children:d.jsx(Np,{})}),[Se.PENDING]:d.jsx(FS,{children:d.jsx(TS,{})}),[Se.LOGGED]:d.jsx(OS,{children:d.jsx(SS,{})}),[Se.ERROR]:d.jsx(ml,{}),[Se.UNAUTHENTICATED]:d.jsx(ml,{}),[Se.PAUSED]:d.jsx(AS,{})},t2=u.styled(u.Typography)`
2604
+ `,DS={[Se.NOT_LOGGED]:d.jsx(OS,{children:d.jsx(Np,{})}),[Se.PENDING]:d.jsx(kS,{children:d.jsx(AS,{})}),[Se.LOGGED]:d.jsx(FS,{children:d.jsx(TS,{})}),[Se.ERROR]:d.jsx(ml,{}),[Se.UNAUTHENTICATED]:d.jsx(ml,{}),[Se.PAUSED]:d.jsx(LS,{})},t2=u.styled(u.Typography)`
2595
2605
  font-size: 12px;
2596
2606
  line-height: 14px;
2597
2607
  font-weight: 500;
2598
2608
  color: #4d596c;
2599
- `,DS=u.styled(t2)`
2609
+ `,NS=u.styled(t2)`
2600
2610
  color: #6f7c90;
2601
- `,yl=e=>d.jsx(t2,{children:e}),Cl=e=>d.jsx(DS,{children:e}),NS={[Se.NOT_LOGGED]:yl,[Se.PENDING]:Cl,[Se.LOGGED]:yl,[Se.PAUSED]:yl,[Se.ERROR]:Cl,[Se.UNAUTHENTICATED]:Cl},RS={[Se.NOT_LOGGED]:"Sync conversation",[Se.PENDING]:"Syncing in progress",[Se.LOGGED]:"Synced",[Se.PAUSED]:"Synced",[Se.ERROR]:"Syncing failed",[Se.UNAUTHENTICATED]:"Sync conversation"},en=I.createContext({}),MS=u.styled(({className:e,...t})=>d.jsx(u.Tooltip,{...t,classes:{popper:e}}))(()=>({[`& .${u.tooltipClasses.tooltip}`]:{backgroundColor:"#fff",padding:0,maxWidth:"288px",width:"288px",height:"405px",overflowY:"auto",borderRadius:"12px",boxShadow:"0px 0px 8px 0px #04060F14",border:`1px solid ${u.theme.palette.gray.gray6}`,position:"relative"}})),PS=u.styled(u.Box)`
2611
+ `,yl=e=>d.jsx(t2,{children:e}),Cl=e=>d.jsx(NS,{children:e}),RS={[Se.NOT_LOGGED]:yl,[Se.PENDING]:Cl,[Se.LOGGED]:yl,[Se.PAUSED]:yl,[Se.ERROR]:Cl,[Se.UNAUTHENTICATED]:Cl},MS={[Se.NOT_LOGGED]:"Sync conversation",[Se.PENDING]:"Syncing in progress",[Se.LOGGED]:"Synced",[Se.PAUSED]:"Synced",[Se.ERROR]:"Syncing failed",[Se.UNAUTHENTICATED]:"Sync conversation"},en=I.createContext({}),PS=u.styled(({className:e,...t})=>d.jsx(u.Tooltip,{...t,classes:{popper:e}}))(()=>({[`& .${u.tooltipClasses.tooltip}`]:{backgroundColor:"#fff",padding:0,maxWidth:"288px",width:"288px",height:"405px",overflowY:"auto",borderRadius:"12px",boxShadow:"0px 0px 8px 0px #04060F14",border:`1px solid ${u.theme.palette.gray.gray6}`,position:"relative"}})),jS=u.styled(u.Box)`
2602
2612
  width: fit-content;
2603
2613
  height: fit-content;
2604
- `,jS=({children:e,renderTooltip:t,defaultOpen:n})=>{const[r,o]=I.useState(n),s=()=>o(!1),a=()=>o(!0),i=c=>{c.stopPropagation()};return d.jsx(u.ClickAwayListener,{onClickAway:s,children:d.jsx(PS,{onClick:a,children:d.jsx(MS,{open:r,disableHoverListener:!0,disableFocusListener:!0,disableTouchListener:!0,title:d.jsx(u.Box,{onClick:i,height:"100%",children:t({close:s})}),placement:"bottom-start",PopperProps:{modifiers:[{name:"preventOverflow",options:{boundary:window}}]},children:e})})})},BS="Turn off to stop syncing this conversation.",VS="Turn on to continue syncing this conversation.",GS="Authentication failed",HS="Retry authentication to use this functionality and save in ':connectorName'",WS="Reach out to your admin to reauthenticate :connectorName",ZS="Syncing this conversation to :connectorName. Refresh the page to see updates.",XS="Something went wrong while syncing this conversation. Please try again.",zS="No recommendations found",YS="Already synced email cannot be removed",JS="https://cdn.hiverhq.com/connectors-module/assets/sync_conversation_preview.png",qS="Log this email thread to your CRM",QS="Automatically sync Hiver conversations with your CRM to unify and audit customer records easily.",n2="connector-agent_email-logger_welcomed",r2="connector-agent_email-logger_welcome_shown",$S="Tell us how we can improve",US="Everything looks good",KS="Something is not working",eT="Please provide your feedback",tT="Feedback submitted",nT="Failed to submit feedback",o2="email-logging",rT=[{label:"Records are not accurate",value:"not_accurate"},{label:"Search is not working",value:"search_not_working"},{label:"Other",value:"other"}],Mt={email_logging_intro_popup_shown:"email_logging_intro_popup_shown",email_logging_intro_popup_continue_clicked:"email_logging_intro_popup_continue_clicked",email_logging_intro_popup_learn_more_clicked:"email_logging_intro_popup_learn_more_clicked",email_logging_log_config_saved:"email_logging_log_config_saved",email_logging_log_config_canceled:"email_logging_log_config_canceled",email_logging_auto_log_enabled:"email_logging_auto_log_enabled",email_logging_auto_log_disabled:"email_logging_auto_log_disabled",email_logging_search_initiated:"email_logging_search_initiated",email_logging_search_results_found:"email_logging_search_results_found",email_logging_search_result_selected:"email_logging_search_result_selected",email_logging_smart_suggestion_initiated:"email_logging_smart_suggestion_initiated",email_logging_smart_suggestion_selected:"email_logging_smart_suggestion_selected",email_logging_smart_suggestion_not_found:"email_logging_smart_suggestion_not_found",email_logging_failed_clicked:"email_logging_failed_clicked"},oT={backgroundColor:"#fff",minWidth:"340px",width:"340px",borderRadius:"8px",boxShadow:"0px 2px 10px 0px #00000026",color:u.theme.palette.gray.gray3,padding:"0px"},sT={color:"#fff !important"},aT=u.styled(u.Stack)`
2614
+ `,BS=({children:e,renderTooltip:t,defaultOpen:n})=>{const[r,o]=I.useState(n),s=()=>o(!1),a=()=>o(!0),i=c=>{c.stopPropagation()};return d.jsx(u.ClickAwayListener,{onClickAway:s,children:d.jsx(jS,{onClick:a,children:d.jsx(PS,{open:r,disableHoverListener:!0,disableFocusListener:!0,disableTouchListener:!0,title:d.jsx(u.Box,{onClick:i,height:"100%",children:t({close:s})}),placement:"bottom-start",PopperProps:{modifiers:[{name:"preventOverflow",options:{boundary:window}}]},children:e})})})},VS="Turn off to stop syncing this conversation.",GS="Turn on to continue syncing this conversation.",HS="Authentication failed",WS="Retry authentication to use this functionality and save in ':connectorName'",ZS="Reach out to your admin to reauthenticate :connectorName",XS="Syncing this conversation to :connectorName. Refresh the page to see updates.",zS="Something went wrong while syncing this conversation. Please try again.",YS="No recommendations found",JS="Already synced email cannot be removed",qS="https://cdn.hiverhq.com/connectors-module/assets/sync_conversation_preview.png",QS="Log this email thread to your CRM",$S="Automatically sync Hiver conversations with your CRM to unify and audit customer records easily.",n2="connector-agent_email-logger_welcomed",r2="connector-agent_email-logger_welcome_shown",US="Tell us how we can improve",KS="Everything looks good",eT="Something is not working",tT="Please provide your feedback",nT="Feedback submitted",rT="Failed to submit feedback",o2="email-logging",oT=[{label:"Records are not accurate",value:"not_accurate"},{label:"Search is not working",value:"search_not_working"},{label:"Other",value:"other"}],Mt={email_logging_intro_popup_shown:"email_logging_intro_popup_shown",email_logging_intro_popup_continue_clicked:"email_logging_intro_popup_continue_clicked",email_logging_intro_popup_learn_more_clicked:"email_logging_intro_popup_learn_more_clicked",email_logging_log_config_saved:"email_logging_log_config_saved",email_logging_log_config_canceled:"email_logging_log_config_canceled",email_logging_auto_log_enabled:"email_logging_auto_log_enabled",email_logging_auto_log_disabled:"email_logging_auto_log_disabled",email_logging_search_initiated:"email_logging_search_initiated",email_logging_search_results_found:"email_logging_search_results_found",email_logging_search_result_selected:"email_logging_search_result_selected",email_logging_smart_suggestion_initiated:"email_logging_smart_suggestion_initiated",email_logging_smart_suggestion_selected:"email_logging_smart_suggestion_selected",email_logging_smart_suggestion_not_found:"email_logging_smart_suggestion_not_found",email_logging_failed_clicked:"email_logging_failed_clicked"},sT={backgroundColor:"#fff",minWidth:"340px",width:"340px",borderRadius:"8px",boxShadow:"0px 2px 10px 0px #00000026",color:u.theme.palette.gray.gray3,padding:"0px"},aT={color:"#fff !important"},iT=u.styled(u.Stack)`
2605
2615
  box-sizing: border-box;
2606
2616
  padding: 16px;
2607
- `,iT=u.styled("img")`
2617
+ `,cT=u.styled("img")`
2608
2618
  display: block;
2609
2619
  width: 100%;
2610
2620
  aspect-ratio: 3 / 2;
2611
2621
  border-radius: 8px;
2612
2622
  background: #ecedff;
2613
2623
  object-fit: cover;
2614
- `,cT=u.styled(u.Typography)`
2624
+ `,lT=u.styled(u.Typography)`
2615
2625
  margin-top: 10px;
2616
2626
  color: #343c45;
2617
2627
  font-size: 14px;
2618
2628
  font-weight: 600;
2619
2629
  line-height: 18px;
2620
2630
  letter-spacing: -0.28px;
2621
- `,lT=u.styled(u.Typography)`
2631
+ `,uT=u.styled(u.Typography)`
2622
2632
  margin-top: 6px;
2623
2633
  color: #3e4c5a;
2624
2634
  font-size: 13px;
2625
2635
  font-weight: 400;
2626
2636
  line-height: 18px;
2627
2637
  letter-spacing: -0.13px;
2628
- `,uT=u.styled(u.Stack)`
2638
+ `,dT=u.styled(u.Stack)`
2629
2639
  margin-top: 20px;
2630
2640
  flex-flow: row nowrap;
2631
2641
  justify-content: flex-end;
2632
2642
  column-gap: 8px;
2633
- `,s2=ra(),dT=({onContinue:e,connectorName:t})=>{const{connectorFunctions:n}=I.useContext(en),r=n==null?void 0:n.sendTrackingEvent;return I.useEffect(()=>{const o=s2.getItem(r2);if(!r||!t||o==="true")return;const s=setTimeout(()=>{r(Mt.email_logging_intro_popup_shown,{app_name:t}),s2.setItem(r2,"true")},1500);return()=>{clearTimeout(s)}},[r,t]),d.jsxs(aT,{children:[d.jsx(iT,{src:JS,alt:"Welcome"}),d.jsx(cT,{children:qS}),d.jsx(lT,{children:QS}),d.jsx(uT,{children:e?d.jsx(u.Button,{variant:"contained",size:"small",className:"primary-action",onClick:e,children:"Continue"}):null})]})},fT=({children:e,onContinue:t,connectorName:n})=>d.jsx(R1,{title:d.jsx(dT,{onContinue:t,connectorName:n}),placement:"bottom-start",arrow:!0,tooltipStyle:oT,arrowStyle:sT,children:e}),pT={backgroundColor:"#fff",maxWidth:"326px",height:"144px",width:"326px",borderRadius:"8px",boxShadow:"0px 2px 10px 0px #00000026",color:u.theme.palette.gray.gray3,padding:"0px"},hT={color:"#fff !important"},gT=u.styled(u.Box)`
2643
+ `,s2=ra(),fT=({onContinue:e,connectorName:t})=>{const{connectorFunctions:n}=I.useContext(en),r=n==null?void 0:n.sendTrackingEvent;return I.useEffect(()=>{const o=s2.getItem(r2);if(!r||!t||o==="true")return;const s=setTimeout(()=>{r(Mt.email_logging_intro_popup_shown,{app_name:t}),s2.setItem(r2,"true")},1500);return()=>{clearTimeout(s)}},[r,t]),d.jsxs(iT,{children:[d.jsx(cT,{src:qS,alt:"Welcome"}),d.jsx(lT,{children:QS}),d.jsx(uT,{children:$S}),d.jsx(dT,{children:e?d.jsx(u.Button,{variant:"contained",size:"small",className:"primary-action",onClick:e,children:"Continue"}):null})]})},pT=({children:e,onContinue:t,connectorName:n})=>d.jsx(R1,{title:d.jsx(fT,{onContinue:t,connectorName:n}),placement:"bottom-start",arrow:!0,tooltipStyle:sT,arrowStyle:aT,children:e}),hT={backgroundColor:"#fff",maxWidth:"326px",height:"144px",width:"326px",borderRadius:"8px",boxShadow:"0px 2px 10px 0px #00000026",color:u.theme.palette.gray.gray3,padding:"0px"},gT={color:"#fff !important"},mT=u.styled(u.Box)`
2634
2644
  padding: 16px;
2635
- `,mT=u.styled(u.Typography)`
2645
+ `,bT=u.styled(u.Typography)`
2636
2646
  font-weight: 600;
2637
2647
  font-size: 14px;
2638
2648
  line-height: 130%;
2639
2649
  color: ${u.theme.palette.gray.gray1};
2640
- `,bT=u.styled(u.Typography)`
2650
+ `,yT=u.styled(u.Typography)`
2641
2651
  font-weight: 400;
2642
2652
  font-size: 13px;
2643
2653
  line-height: 135%;
2644
2654
  color: ${u.theme.palette.gray.gray3};
2645
2655
  margin-top: 6px;
2646
- `,yT=u.styled(u.Box)`
2656
+ `,CT=u.styled(u.Box)`
2647
2657
  display: flex;
2648
2658
  justify-content: space-between;
2649
2659
  align-items: center;
2650
2660
  margin-top: 20px;
2651
2661
  width: 100%;
2652
- `,CT=e=>A.createElement("svg",{width:58,height:26,viewBox:"0 0 58 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},A.createElement("path",{d:"M8.9082 1.37598C10.221 0.614497 11.8414 0.614651 13.1543 1.37598L19.9619 5.32422C21.2668 6.08111 22.0702 7.47589 22.0703 8.98438V16.916C22.0703 18.4247 21.2669 19.8192 19.9619 20.5762L13.1543 24.5244C11.8414 25.2858 10.2211 25.2859 8.9082 24.5244L2.10156 20.5762C0.796567 19.8192 -0.00683594 18.4247 -0.00683594 16.916V8.98438C-0.00668786 7.47589 0.796688 6.08111 2.10156 5.32422L8.9082 1.37598ZM11.9531 15.9727C11.9531 17.5841 13.2597 18.8906 14.8711 18.8906V15.3281C14.871 13.7167 13.5645 12.4102 11.9531 12.4102V15.9727ZM7.57617 15.6641C7.57619 17.2755 8.88271 18.582 10.4941 18.582V10.1592C10.4939 8.54793 9.18748 7.24219 7.57617 7.24219V15.6641Z",fill:"#D0D8E3"}),A.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M27.4643 7.74676V11.8643C27.8476 11.0201 28.9238 10.6646 29.6462 10.6646C31.4006 10.6646 32.4325 11.8199 32.4325 13.7898V17.0335C32.4325 17.4482 32.0935 17.8037 31.6512 17.8037C31.2384 17.8037 30.914 17.4482 30.914 17.0335V13.8787C30.914 12.7975 30.2359 12.1606 29.3808 12.1606C28.511 12.1606 27.4643 12.6493 27.4643 14.012V17.0335C27.4643 17.4482 27.1252 17.8037 26.6829 17.8037C26.2701 17.8037 25.9458 17.4482 25.9458 17.0335V7.74676C25.9458 7.33204 26.2849 6.97656 26.7272 6.97656C27.1399 6.97656 27.4643 7.33204 27.4643 7.74676ZM33.6052 8.01336C33.6052 7.46534 34.0769 7.05062 34.6224 7.05062C35.1826 7.05062 35.6249 7.46534 35.6249 8.01336C35.6249 8.56139 35.1826 8.97611 34.6224 8.97611C34.0769 8.97611 33.6052 8.56139 33.6052 8.01336ZM35.389 17.0335C35.389 17.4482 35.0499 17.8037 34.6077 17.8037C34.1949 17.8037 33.8705 17.4482 33.8705 17.0335V11.5089C33.8705 11.0941 34.1949 10.7387 34.6077 10.7387C35.0499 10.7387 35.389 11.0941 35.389 11.5089V17.0335ZM42.7241 11.7014L40.4685 17.1076C40.2915 17.5371 39.9967 17.8037 39.5544 17.8037H39.466C39.0237 17.8037 38.7141 17.5371 38.5372 17.1076L36.2963 11.7014C36.1341 11.3163 36.3848 10.8275 36.7976 10.7535C37.1956 10.6794 37.5642 10.872 37.7116 11.2571L39.5102 15.7894L41.3088 11.2571C41.4562 10.872 41.8248 10.6794 42.2228 10.7535C42.6356 10.8275 42.8862 11.3163 42.7241 11.7014ZM44.6044 13.701H48.5996C48.4522 12.6197 47.6708 11.9976 46.6388 11.9976C45.5774 11.9976 44.7518 12.6345 44.6044 13.701ZM50.0886 14.1157C50.0886 14.5156 49.7643 14.8118 49.3957 14.8118H44.6044C44.7518 15.8782 45.6069 16.5447 46.7125 16.5447C47.4349 16.5447 47.8477 16.293 48.349 15.8782C48.5996 15.6709 49.0124 15.5672 49.322 15.819C49.6021 16.0412 49.6168 16.5003 49.3515 16.7817C48.6586 17.5075 47.6561 17.8778 46.6388 17.8778C44.6781 17.8778 43.1006 16.4411 43.1006 14.249C43.1006 12.0569 44.6781 10.6646 46.6388 10.6646C48.5554 10.6646 50.0296 11.9976 50.0886 14.1157ZM54.4162 12.1013C53.1188 12.1013 52.5733 13.4047 52.5733 15.2413V17.0335C52.5733 17.4482 52.2343 17.8037 51.792 17.8037C51.3792 17.8037 51.0548 17.4482 51.0548 17.0335V11.5089C51.0548 11.0941 51.3792 10.7387 51.792 10.7387C52.2343 10.7387 52.5733 11.0941 52.5733 11.5089V12.3975C52.9272 11.1682 53.6053 10.6646 54.4604 10.6646C54.6815 10.6646 54.9027 10.6794 55.1091 10.7239C55.4924 10.8127 55.743 11.1978 55.6545 11.5977C55.5218 12.2642 54.8584 12.1013 54.4162 12.1013Z",fill:"#D0D8E3"})),xT=({isAdmin:e,connectorId:t,connectorName:n,close:r})=>{const o=e?HS:WS,{connectorFunctions:s}=I.useContext(en),a=s==null?void 0:s.redirectToAdmin,i=()=>{r(),a==null||a(t)};return d.jsxs(gT,{children:[d.jsx(mT,{children:GS}),d.jsx(bT,{children:et(o,{connectorName:n})}),d.jsxs(yT,{children:[d.jsx("div",{children:d.jsx(CT,{})}),e?d.jsx(u.Button,{variant:"contained",size:"small",color:"primary",onClick:i,children:"Authenticate"}):null]})]})},ET=({isAdmin:e,isAuthenticated:t,connectorId:n,connectorName:r,children:o})=>{const[s,a]=I.useState(!0),i=()=>a(!0),c=()=>a(!1);return d.jsx(R1,{onTouchMove:i,onMouseMove:i,onPointerMove:i,title:s&&!t?d.jsx(xT,{isAdmin:e,connectorId:n,connectorName:r,close:c}):"",enterDelay:500,placement:"top",arrow:!0,tooltipStyle:pT,arrowStyle:hT,children:o})},vT=({children:e,isAdmin:t,logSettings:n,status:r,retry:o,renderEntities:s})=>{const{connectorFunctions:a}=I.useContext(en),i=a==null?void 0:a.sendTrackingEvent,[c,l]=I.useState(()=>localStorage.getItem(n2)==="true"),[f,g]=I.useState(!1),{connectorId:y,connectorName:x,connectorStatus:b}=n??{},p=t||b!==Va.DISABLED,h=b===Va.UNAUTHENTICATED,m=r===Se.PENDING,E=()=>{localStorage.setItem(n2,"true"),l(!0),g(!0),i==null||i(Mt.email_logging_intro_popup_continue_clicked,{app_name:x})};return c?h?d.jsx(ET,{connectorId:y,connectorName:x,isAdmin:t,isAuthenticated:!1,children:e}):o?d.jsx(u.Tooltip,{title:XS,children:e}):m?d.jsx(u.Tooltip,{title:ZS.replace(":connectorName",x),children:e}):s?d.jsx(jS,{defaultOpen:f,renderTooltip:s,children:e}):d.jsx(d.Fragment,{children:e}):d.jsx(fT,{onContinue:p?E:void 0,connectorName:x,children:e})},wT=e=>A.createElement("svg",{width:124,height:107,viewBox:"0 0 124 107",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},A.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28.6168 54.7446C28.6931 52.5589 31.0146 51.1102 33.0842 51.8174C35.9985 52.8133 40.0375 53.9024 44.0621 54.043C48.0034 54.1806 51.968 53.4097 54.8762 52.6339C57.0264 52.0602 59.2927 53.6932 59.215 55.9172C59.1742 57.0856 58.4742 58.1269 57.3723 58.5178C54.8051 59.4284 49.7633 60.8927 44.3075 60.7022C38.7694 60.5088 33.1999 58.6241 30.4004 57.5311C29.2637 57.0873 28.5742 55.9641 28.6168 54.7446Z",fill:"url(#paint0_linear_8481_102191)"}),A.createElement("path",{d:"M47.223 43.6373C44.4928 30.7926 52.6922 18.1666 65.5368 15.4364C78.3815 12.7062 91.0075 20.9055 93.7377 33.7502L105.079 87.1053L84.1844 91.5466C70.0346 94.5542 56.1258 85.5217 53.1182 71.3719L47.223 43.6373Z",fill:"url(#paint1_linear_8481_102191)"}),A.createElement("mask",{id:"mask0_8481_102191",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:46,y:14,width:60,height:79},A.createElement("path",{d:"M47.223 43.6373C44.4928 30.7926 52.6922 18.1666 65.5368 15.4364C78.3815 12.7062 91.0075 20.9055 93.7377 33.7502L105.079 87.1053L84.1844 91.5466C70.0346 94.5542 56.1258 85.5217 53.1182 71.3719L47.223 43.6373Z",fill:"white"})),A.createElement("g",{mask:"url(#mask0_8481_102191)"},A.createElement("ellipse",{cx:63.7775,cy:46.8684,rx:1.48152,ry:1.39438,transform:"rotate(-12 63.7775 46.8684)",fill:"#435C71"}),A.createElement("rect",{x:47.4368,y:59.3203,width:53.657,height:13.2235,transform:"rotate(-12 47.4368 59.3203)",fill:"url(#paint2_linear_8481_102191)"}),A.createElement("rect",{x:51.1907,y:76.9824,width:53.657,height:10.4263,transform:"rotate(-12 51.1907 76.9824)",fill:"url(#paint3_linear_8481_102191)"})),A.createElement("path",{opacity:.883952,d:"M113.939 51.0679C114.775 55 112.265 58.865 108.333 59.7008L107.842 59.8052C103.639 60.6986 99.5073 58.0155 98.6139 53.8123L97.205 47.1837L105.307 45.4616C109.239 44.6259 113.104 47.1359 113.939 51.0679Z",fill:"url(#paint4_linear_8481_102191)"}),A.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M68.7215 66.4138C67.1801 64.8725 67.6745 62.2062 69.587 61.1603C72.4457 59.5969 76.2861 57.1773 79.3785 54.0849C82.4099 51.0535 84.752 47.3461 86.2775 44.5465C87.3388 42.5989 90.0598 42.0819 91.6282 43.6503C92.4782 44.5003 92.758 45.7623 92.2604 46.8566C91.0829 49.4466 88.5191 54.344 84.4346 58.4285C80.2853 62.5778 74.8639 65.591 72.0553 66.9952C70.9363 67.5548 69.6062 67.2985 68.7215 66.4138Z",fill:"url(#paint5_linear_8481_102191)"}),A.createElement("rect",{x:48.7264,y:33.7744,width:11.2108,height:11.2108,rx:5.59457,transform:"rotate(-12 48.7264 33.7744)",fill:"url(#paint6_linear_8481_102191)"}),A.createElement("rect",{x:50.0175,y:35.8193,width:4.0158,height:3.84848,rx:1.92424,transform:"rotate(-12 50.0175 35.8193)",fill:"#435C71"}),A.createElement("rect",{x:59.2875,y:31.5723,width:11.2108,height:11.2108,rx:5.59457,transform:"rotate(-12 59.2875 31.5723)",fill:"#FFFEFE"}),A.createElement("path",{opacity:.883952,d:"M111.25 38.5376C110.415 34.6055 106.55 32.0955 102.618 32.9313L102.127 33.0356C97.9234 33.9291 95.2403 38.0607 96.1337 42.2639L97.5426 48.8925L105.644 47.1705C109.576 46.3347 112.086 42.4696 111.25 38.5376Z",fill:"url(#paint7_linear_8481_102191)"}),A.createElement("rect",{x:60.0181,y:33.8037,width:3.84848,height:3.84848,rx:1.90724,transform:"rotate(-12 60.0181 33.8037)",fill:"#435C71"}),A.createElement("path",{d:"M36.9246 59.1604C36.4487 60.717 34.7371 61.6271 33.1805 61.1512C32.3613 60.9007 31.7241 60.3475 31.3259 59.5987L25.2059 46.7983C24.9784 46.3703 25.1286 45.8788 25.5566 45.6513L28.338 44.1724C28.7659 43.9449 29.2574 44.0951 29.4849 44.5231L36.6496 56.8367C37.0728 57.5036 37.15 58.423 36.9246 59.1604Z",fill:"#FFDF9F"}),A.createElement("rect",{x:27.9973,y:44.333,width:2.39869,height:3.59807,transform:"rotate(152 27.9973 44.333)",fill:"#FF9090"}),A.createElement("path",{d:"M26.6628 44.3769L26.9472 44.9118L28.0169 44.343L26.3106 41.1338L24.171 42.2714L25.0243 43.876C25.6661 43.5347 26.3215 43.7351 26.6628 44.3769Z",fill:"#FFB19F"}),A.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.26386 27.248C9.3428 20.4481 16.5101 16.6372 23.31 18.7161C30.11 20.7951 33.9209 27.9624 31.8419 34.7623C29.763 41.5622 22.5956 45.3731 15.7958 43.2942C8.99587 41.2152 5.18493 34.0479 7.26386 27.248ZM9.72157 27.9983C8.06843 33.4055 11.1399 39.1821 16.5471 40.8352C21.9543 42.4884 27.7309 39.4168 29.384 34.0096C31.0372 28.6024 27.9657 22.8258 22.5585 21.1727C17.1513 19.5196 11.3747 22.5911 9.72157 27.9983Z",fill:"#FFE69F"}),A.createElement("circle",{opacity:.414016,cx:19.5529,cy:31.0039,r:10.2804,transform:"rotate(17 19.5529 31.0039)",fill:"#BBDEFC"}),A.createElement("path",{d:"M14.3685 30.6746C15.7299 27.6867 18.9391 25.9803 22.1776 26.5225L22.2595 26.5475C23.7024 26.8095 24.3854 24.8682 23.1497 24.2218C22.3806 23.8074 21.5613 23.557 20.717 23.3884C17.3715 22.9031 14.0553 24.6664 12.6939 27.6543C12.2796 28.4235 12.0859 29.3497 12.0244 30.1372C11.8444 31.6051 13.8607 32.0424 14.4503 30.6997C14.3434 30.7566 14.3685 30.6746 14.3685 30.6746Z",fill:"#F6FBFF"}),A.createElement("path",{d:"M10.2904 29.0679C11.9436 23.6607 17.7202 20.5893 23.1274 22.2424C25.6671 23.0189 27.5785 24.6783 28.9301 26.704C27.7539 24.1048 25.508 22.0744 22.5586 21.1727C17.1514 19.5196 11.3748 22.591 9.72165 27.9982C8.81993 30.9476 9.32924 33.97 10.7444 36.3735C9.82081 34.1203 9.51395 31.6077 10.2904 29.0679Z",fill:"#ADCBE7"}),A.createElement("path",{opacity:.406087,d:"M36.4864 56.8021L36.1373 56.2691C36.3845 56.8563 36.428 57.5516 36.2372 58.1754C35.9273 59.189 34.5593 59.1971 34.0713 58.2806L28.3787 47.5877C28.0534 46.9767 27.3508 46.7619 26.7395 47.0866L25.7206 47.6277L31.4395 59.3516C31.7648 59.9627 32.27 60.5434 32.8706 60.8123C33.7054 61.1528 34.6593 61.1034 35.3726 60.7247C36.0858 60.3459 36.6602 59.5837 36.8444 58.7021C37.0351 58.0783 36.8117 57.4132 36.4864 56.8021Z",fill:"white"}),A.createElement("path",{d:"M29.8826 48.4977C29.8006 48.4726 29.6368 48.4225 29.5799 48.3155L28.1579 45.6411C28.0442 45.4272 28.1193 45.1814 28.3332 45.0677C28.5472 44.9539 28.7929 45.0291 28.9067 45.243L30.3287 47.9174C30.4424 48.1313 30.3673 48.3771 30.1534 48.4908C30.1284 48.5728 29.9645 48.5227 29.8826 48.4977Z",fill:"#FFF5EB"}),A.createElement("ellipse",{cx:29.2637,cy:54.631,rx:1.50593,ry:3.17918,transform:"rotate(-23 29.2637 54.631)",fill:"#FFC478"}),A.createElement("ellipse",{cx:34.0592,cy:52.4078,rx:.920288,ry:1.67325,transform:"rotate(106 34.0592 52.4078)",fill:"#FFC478"}),A.createElement("path",{d:"M89.1282 19.2055L68.2257 26.8725L45.9197 28.3898L44.4929 16.4082C44.3371 13.798 47.5283 11.4502 50.9859 11.6309L65.1429 12.369L67.3969 12.4869C68.5309 12.5463 69.7066 12.3289 70.7522 11.8627L78.6899 8.34726C81.725 6.99992 85.3012 7.87475 86.2125 10.1876L89.1282 19.2055Z",fill:"url(#paint8_linear_8481_102191)"}),A.createElement("path",{opacity:.479771,d:"M88.6262 19.0953L68.3101 26.5288L65.3314 12.5149L67.5211 12.6263C68.6228 12.6824 69.7652 12.471 70.7816 12.0192L78.4972 8.61266C81.4474 7.30707 84.9208 8.14856 85.8036 10.3829L88.6262 19.0953Z",fill:"#ADCBE7"}),A.createElement("path",{d:"M91.6332 26.6212L46.9517 36.1186L46.0387 28.4438L89.2535 19.2582L91.6332 26.6212Z",fill:"#717DAD"}),A.createElement("path",{d:"M102.961 24.2033C103.125 24.9722 102.371 25.7829 101.278 26.015L37.9675 39.4722C36.8754 39.7043 35.8568 39.2704 35.6933 38.5015C35.5301 37.7336 36.284 36.922 37.3761 36.6898L100.687 23.2327C101.779 23.0005 102.798 23.4354 102.961 24.2033Z",fill:"#9ED1FF"}),A.createElement("path",{d:"M102.703 24.1718C102.838 24.805 102.067 25.5045 100.983 25.7349L69.5583 32.4144L69.0712 30.123L100.496 23.4436C101.58 23.2131 102.569 23.5394 102.703 24.1718Z",fill:"#78AFE1"}),A.createElement("defs",null,A.createElement("linearGradient",{id:"paint0_linear_8481_102191",x1:32.2665,y1:59.6553,x2:59.0518,y2:60.5906,gradientUnits:"userSpaceOnUse"},A.createElement("stop",{stopColor:"#FFFDE0"}),A.createElement("stop",{offset:1,stopColor:"#FFB362"})),A.createElement("linearGradient",{id:"paint1_linear_8481_102191",x1:67.3434,y1:85.966,x2:103.216,y2:78.3411,gradientUnits:"userSpaceOnUse"},A.createElement("stop",{stopColor:"#FFFABC"}),A.createElement("stop",{offset:1,stopColor:"#FFA650"})),A.createElement("linearGradient",{id:"paint2_linear_8481_102191",x1:51.4347,y1:74.8197,x2:91.1539,y2:74.8197,gradientUnits:"userSpaceOnUse"},A.createElement("stop",{stopColor:"#A3C1FF"}),A.createElement("stop",{offset:1,stopColor:"#4243FF"})),A.createElement("linearGradient",{id:"paint3_linear_8481_102191",x1:55.1887,y1:89.2031,x2:94.9078,y2:89.2031,gradientUnits:"userSpaceOnUse"},A.createElement("stop",{stopColor:"#A3C1FF"}),A.createElement("stop",{offset:1,stopColor:"#4243FF"})),A.createElement("linearGradient",{id:"paint4_linear_8481_102191",x1:94.5023,y1:53.1799,x2:106.762,y2:58.7056,gradientUnits:"userSpaceOnUse"},A.createElement("stop",{stopColor:"#FF9498"}),A.createElement("stop",{offset:1,stopColor:"#FFD671"})),A.createElement("linearGradient",{id:"paint5_linear_8481_102191",x1:74.9906,y1:66.9871,x2:94.9778,y2:46.9999,gradientUnits:"userSpaceOnUse"},A.createElement("stop",{stopColor:"#FFFDE0"}),A.createElement("stop",{offset:1,stopColor:"#FFB362"})),A.createElement("linearGradient",{id:"paint6_linear_8481_102191",x1:50.5805,y1:44.0581,x2:59.9372,y2:44.0581,gradientUnits:"userSpaceOnUse"},A.createElement("stop",{stopColor:"white"}),A.createElement("stop",{offset:1,stopColor:"#E3EEF3"})),A.createElement("linearGradient",{id:"paint7_linear_8481_102191",x1:88.4187,y1:43.3906,x2:99.3981,y2:25.1833,gradientUnits:"userSpaceOnUse"},A.createElement("stop",{stopColor:"#FF9498"}),A.createElement("stop",{offset:1,stopColor:"#FFD671"})),A.createElement("linearGradient",{id:"paint8_linear_8481_102191",x1:56.4985,y1:29.5482,x2:100.532,y2:20.1885,gradientUnits:"userSpaceOnUse"},A.createElement("stop",{stopColor:"#ECF7FF"}),A.createElement("stop",{offset:1,stopColor:"#C2E0FF"})))),xl=({message:e})=>d.jsxs(u.Stack,{justifyContent:"center",alignItems:"center",height:"100%",children:[d.jsx(wT,{width:124,height:107}),d.jsx(u.Typography,{variant:"body2",color:u.theme.palette.gray.gray3,children:e})]}),Gn="/v1/api",IT=`${Gn}/connector/conversation/:conversationId/email_log_status`,_T=`${Gn}/connector/conversation/:conversationId/entity_recommendations`,ST=`${Gn}/connector/conversation/:conversationId/retry_emails_log`,TT=`${Gn}/connector/conversation/:conversationId/validate_entity`,AT=`${Gn}/connectors/forms/:formId/search`,LT=`${Gn}/connector/conversation/:conversationId/log_emails`,OT=`${Gn}/connector/feedback/conversation/:conversationId`,FT=`${Gn}/connector/conversation/:conversationId/log_emails`,kT=async({payload:e,entity:t,conversationId:n})=>{if("externalResourceId"in t)return t;try{if(!n)throw new Error("Conversation ID is required to validate entity");const r=await xe({url:et(TT,{conversationId:n}),data:e,method:Fe.POST}),o=r==null?void 0:r.data;if(!o.valid)throw new Error("Entity validation failed");return{...o,...t}}catch(r){throw console.error(r),r}},DT=({onSuccess:e,onError:t})=>Zt({mutationFn:kT,onSuccess:e,onError:t}),El=e=>A.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:14,height:14,viewBox:"0 0 14 14",fill:"#6F7C90",...e},A.createElement("path",{d:"M6.99967 13.6654C6.08856 13.6654 5.22745 13.4903 4.41634 13.14C3.60523 12.7898 2.89701 12.312 2.29167 11.7067C1.68634 11.1014 1.20856 10.3931 0.858341 9.58203C0.508119 8.77092 0.333008 7.90981 0.333008 6.9987C0.333008 6.07648 0.508119 5.2127 0.858341 4.40736C1.20856 3.60203 1.68634 2.89648 2.29167 2.2907C2.89701 1.68492 3.60523 1.20714 4.41634 0.857365C5.22745 0.507587 6.08856 0.332476 6.99967 0.332031C7.18856 0.332031 7.34701 0.396031 7.47501 0.524031C7.60301 0.652031 7.66679 0.810253 7.66634 0.998698C7.6659 1.18714 7.6019 1.34559 7.47434 1.47403C7.34679 1.60248 7.18856 1.66625 6.99967 1.66536C5.5219 1.66536 4.26345 2.18492 3.22434 3.22403C2.18523 4.26314 1.6659 5.52136 1.66634 6.9987C1.66679 8.47603 2.18634 9.73448 3.22501 10.774C4.26367 11.8136 5.5219 12.3329 6.99967 12.332C8.47745 12.3311 9.7359 11.8118 10.775 10.774C11.8141 9.73625 12.3335 8.47781 12.333 6.9987C12.333 6.80981 12.397 6.65159 12.525 6.52403C12.653 6.39648 12.8112 6.33248 12.9997 6.33203C13.1881 6.33159 13.3466 6.39559 13.475 6.52403C13.6035 6.65248 13.6672 6.8107 13.6663 6.9987C13.6663 7.90981 13.4912 8.77092 13.141 9.58203C12.7908 10.3931 12.313 11.1016 11.7077 11.7074C11.1023 12.3131 10.3968 12.7909 9.59101 13.1407C8.78523 13.4905 7.92145 13.6654 6.99967 13.6654Z"})),NT=u.styled(u.Stack)`
2662
+ `,xT=e=>A.createElement("svg",{width:58,height:26,viewBox:"0 0 58 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},A.createElement("path",{d:"M8.9082 1.37598C10.221 0.614497 11.8414 0.614651 13.1543 1.37598L19.9619 5.32422C21.2668 6.08111 22.0702 7.47589 22.0703 8.98438V16.916C22.0703 18.4247 21.2669 19.8192 19.9619 20.5762L13.1543 24.5244C11.8414 25.2858 10.2211 25.2859 8.9082 24.5244L2.10156 20.5762C0.796567 19.8192 -0.00683594 18.4247 -0.00683594 16.916V8.98438C-0.00668786 7.47589 0.796688 6.08111 2.10156 5.32422L8.9082 1.37598ZM11.9531 15.9727C11.9531 17.5841 13.2597 18.8906 14.8711 18.8906V15.3281C14.871 13.7167 13.5645 12.4102 11.9531 12.4102V15.9727ZM7.57617 15.6641C7.57619 17.2755 8.88271 18.582 10.4941 18.582V10.1592C10.4939 8.54793 9.18748 7.24219 7.57617 7.24219V15.6641Z",fill:"#D0D8E3"}),A.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M27.4643 7.74676V11.8643C27.8476 11.0201 28.9238 10.6646 29.6462 10.6646C31.4006 10.6646 32.4325 11.8199 32.4325 13.7898V17.0335C32.4325 17.4482 32.0935 17.8037 31.6512 17.8037C31.2384 17.8037 30.914 17.4482 30.914 17.0335V13.8787C30.914 12.7975 30.2359 12.1606 29.3808 12.1606C28.511 12.1606 27.4643 12.6493 27.4643 14.012V17.0335C27.4643 17.4482 27.1252 17.8037 26.6829 17.8037C26.2701 17.8037 25.9458 17.4482 25.9458 17.0335V7.74676C25.9458 7.33204 26.2849 6.97656 26.7272 6.97656C27.1399 6.97656 27.4643 7.33204 27.4643 7.74676ZM33.6052 8.01336C33.6052 7.46534 34.0769 7.05062 34.6224 7.05062C35.1826 7.05062 35.6249 7.46534 35.6249 8.01336C35.6249 8.56139 35.1826 8.97611 34.6224 8.97611C34.0769 8.97611 33.6052 8.56139 33.6052 8.01336ZM35.389 17.0335C35.389 17.4482 35.0499 17.8037 34.6077 17.8037C34.1949 17.8037 33.8705 17.4482 33.8705 17.0335V11.5089C33.8705 11.0941 34.1949 10.7387 34.6077 10.7387C35.0499 10.7387 35.389 11.0941 35.389 11.5089V17.0335ZM42.7241 11.7014L40.4685 17.1076C40.2915 17.5371 39.9967 17.8037 39.5544 17.8037H39.466C39.0237 17.8037 38.7141 17.5371 38.5372 17.1076L36.2963 11.7014C36.1341 11.3163 36.3848 10.8275 36.7976 10.7535C37.1956 10.6794 37.5642 10.872 37.7116 11.2571L39.5102 15.7894L41.3088 11.2571C41.4562 10.872 41.8248 10.6794 42.2228 10.7535C42.6356 10.8275 42.8862 11.3163 42.7241 11.7014ZM44.6044 13.701H48.5996C48.4522 12.6197 47.6708 11.9976 46.6388 11.9976C45.5774 11.9976 44.7518 12.6345 44.6044 13.701ZM50.0886 14.1157C50.0886 14.5156 49.7643 14.8118 49.3957 14.8118H44.6044C44.7518 15.8782 45.6069 16.5447 46.7125 16.5447C47.4349 16.5447 47.8477 16.293 48.349 15.8782C48.5996 15.6709 49.0124 15.5672 49.322 15.819C49.6021 16.0412 49.6168 16.5003 49.3515 16.7817C48.6586 17.5075 47.6561 17.8778 46.6388 17.8778C44.6781 17.8778 43.1006 16.4411 43.1006 14.249C43.1006 12.0569 44.6781 10.6646 46.6388 10.6646C48.5554 10.6646 50.0296 11.9976 50.0886 14.1157ZM54.4162 12.1013C53.1188 12.1013 52.5733 13.4047 52.5733 15.2413V17.0335C52.5733 17.4482 52.2343 17.8037 51.792 17.8037C51.3792 17.8037 51.0548 17.4482 51.0548 17.0335V11.5089C51.0548 11.0941 51.3792 10.7387 51.792 10.7387C52.2343 10.7387 52.5733 11.0941 52.5733 11.5089V12.3975C52.9272 11.1682 53.6053 10.6646 54.4604 10.6646C54.6815 10.6646 54.9027 10.6794 55.1091 10.7239C55.4924 10.8127 55.743 11.1978 55.6545 11.5977C55.5218 12.2642 54.8584 12.1013 54.4162 12.1013Z",fill:"#D0D8E3"})),ET=({isAdmin:e,connectorId:t,connectorName:n,close:r})=>{const o=e?WS:ZS,{connectorFunctions:s}=I.useContext(en),a=s==null?void 0:s.redirectToAdmin,i=()=>{r(),a==null||a(t)};return d.jsxs(mT,{children:[d.jsx(bT,{children:HS}),d.jsx(yT,{children:et(o,{connectorName:n})}),d.jsxs(CT,{children:[d.jsx("div",{children:d.jsx(xT,{})}),e?d.jsx(u.Button,{variant:"contained",size:"small",color:"primary",onClick:i,children:"Authenticate"}):null]})]})},vT=({isAdmin:e,isAuthenticated:t,connectorId:n,connectorName:r,children:o})=>{const[s,a]=I.useState(!0),i=()=>a(!0),c=()=>a(!1);return d.jsx(R1,{onTouchMove:i,onMouseMove:i,onPointerMove:i,title:s&&!t?d.jsx(ET,{isAdmin:e,connectorId:n,connectorName:r,close:c}):"",enterDelay:500,placement:"top",arrow:!0,tooltipStyle:hT,arrowStyle:gT,children:o})},wT=({children:e,isAdmin:t,logSettings:n,status:r,retry:o,renderEntities:s})=>{const{connectorFunctions:a}=I.useContext(en),i=a==null?void 0:a.sendTrackingEvent,[c,l]=I.useState(()=>localStorage.getItem(n2)==="true"),[f,g]=I.useState(!1),{connectorId:y,connectorName:x,connectorStatus:b}=n??{},p=t||b!==Va.DISABLED,h=b===Va.UNAUTHENTICATED,m=r===Se.PENDING,E=()=>{localStorage.setItem(n2,"true"),l(!0),g(!0),i==null||i(Mt.email_logging_intro_popup_continue_clicked,{app_name:x})};return c?h?d.jsx(vT,{connectorId:y,connectorName:x,isAdmin:t,isAuthenticated:!1,children:e}):o?d.jsx(u.Tooltip,{title:zS,children:e}):m?d.jsx(u.Tooltip,{title:XS.replace(":connectorName",x),children:e}):s?d.jsx(BS,{defaultOpen:f,renderTooltip:s,children:e}):d.jsx(d.Fragment,{children:e}):d.jsx(pT,{onContinue:p?E:void 0,connectorName:x,children:e})},IT=e=>A.createElement("svg",{width:124,height:107,viewBox:"0 0 124 107",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},A.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28.6168 54.7446C28.6931 52.5589 31.0146 51.1102 33.0842 51.8174C35.9985 52.8133 40.0375 53.9024 44.0621 54.043C48.0034 54.1806 51.968 53.4097 54.8762 52.6339C57.0264 52.0602 59.2927 53.6932 59.215 55.9172C59.1742 57.0856 58.4742 58.1269 57.3723 58.5178C54.8051 59.4284 49.7633 60.8927 44.3075 60.7022C38.7694 60.5088 33.1999 58.6241 30.4004 57.5311C29.2637 57.0873 28.5742 55.9641 28.6168 54.7446Z",fill:"url(#paint0_linear_8481_102191)"}),A.createElement("path",{d:"M47.223 43.6373C44.4928 30.7926 52.6922 18.1666 65.5368 15.4364C78.3815 12.7062 91.0075 20.9055 93.7377 33.7502L105.079 87.1053L84.1844 91.5466C70.0346 94.5542 56.1258 85.5217 53.1182 71.3719L47.223 43.6373Z",fill:"url(#paint1_linear_8481_102191)"}),A.createElement("mask",{id:"mask0_8481_102191",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:46,y:14,width:60,height:79},A.createElement("path",{d:"M47.223 43.6373C44.4928 30.7926 52.6922 18.1666 65.5368 15.4364C78.3815 12.7062 91.0075 20.9055 93.7377 33.7502L105.079 87.1053L84.1844 91.5466C70.0346 94.5542 56.1258 85.5217 53.1182 71.3719L47.223 43.6373Z",fill:"white"})),A.createElement("g",{mask:"url(#mask0_8481_102191)"},A.createElement("ellipse",{cx:63.7775,cy:46.8684,rx:1.48152,ry:1.39438,transform:"rotate(-12 63.7775 46.8684)",fill:"#435C71"}),A.createElement("rect",{x:47.4368,y:59.3203,width:53.657,height:13.2235,transform:"rotate(-12 47.4368 59.3203)",fill:"url(#paint2_linear_8481_102191)"}),A.createElement("rect",{x:51.1907,y:76.9824,width:53.657,height:10.4263,transform:"rotate(-12 51.1907 76.9824)",fill:"url(#paint3_linear_8481_102191)"})),A.createElement("path",{opacity:.883952,d:"M113.939 51.0679C114.775 55 112.265 58.865 108.333 59.7008L107.842 59.8052C103.639 60.6986 99.5073 58.0155 98.6139 53.8123L97.205 47.1837L105.307 45.4616C109.239 44.6259 113.104 47.1359 113.939 51.0679Z",fill:"url(#paint4_linear_8481_102191)"}),A.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M68.7215 66.4138C67.1801 64.8725 67.6745 62.2062 69.587 61.1603C72.4457 59.5969 76.2861 57.1773 79.3785 54.0849C82.4099 51.0535 84.752 47.3461 86.2775 44.5465C87.3388 42.5989 90.0598 42.0819 91.6282 43.6503C92.4782 44.5003 92.758 45.7623 92.2604 46.8566C91.0829 49.4466 88.5191 54.344 84.4346 58.4285C80.2853 62.5778 74.8639 65.591 72.0553 66.9952C70.9363 67.5548 69.6062 67.2985 68.7215 66.4138Z",fill:"url(#paint5_linear_8481_102191)"}),A.createElement("rect",{x:48.7264,y:33.7744,width:11.2108,height:11.2108,rx:5.59457,transform:"rotate(-12 48.7264 33.7744)",fill:"url(#paint6_linear_8481_102191)"}),A.createElement("rect",{x:50.0175,y:35.8193,width:4.0158,height:3.84848,rx:1.92424,transform:"rotate(-12 50.0175 35.8193)",fill:"#435C71"}),A.createElement("rect",{x:59.2875,y:31.5723,width:11.2108,height:11.2108,rx:5.59457,transform:"rotate(-12 59.2875 31.5723)",fill:"#FFFEFE"}),A.createElement("path",{opacity:.883952,d:"M111.25 38.5376C110.415 34.6055 106.55 32.0955 102.618 32.9313L102.127 33.0356C97.9234 33.9291 95.2403 38.0607 96.1337 42.2639L97.5426 48.8925L105.644 47.1705C109.576 46.3347 112.086 42.4696 111.25 38.5376Z",fill:"url(#paint7_linear_8481_102191)"}),A.createElement("rect",{x:60.0181,y:33.8037,width:3.84848,height:3.84848,rx:1.90724,transform:"rotate(-12 60.0181 33.8037)",fill:"#435C71"}),A.createElement("path",{d:"M36.9246 59.1604C36.4487 60.717 34.7371 61.6271 33.1805 61.1512C32.3613 60.9007 31.7241 60.3475 31.3259 59.5987L25.2059 46.7983C24.9784 46.3703 25.1286 45.8788 25.5566 45.6513L28.338 44.1724C28.7659 43.9449 29.2574 44.0951 29.4849 44.5231L36.6496 56.8367C37.0728 57.5036 37.15 58.423 36.9246 59.1604Z",fill:"#FFDF9F"}),A.createElement("rect",{x:27.9973,y:44.333,width:2.39869,height:3.59807,transform:"rotate(152 27.9973 44.333)",fill:"#FF9090"}),A.createElement("path",{d:"M26.6628 44.3769L26.9472 44.9118L28.0169 44.343L26.3106 41.1338L24.171 42.2714L25.0243 43.876C25.6661 43.5347 26.3215 43.7351 26.6628 44.3769Z",fill:"#FFB19F"}),A.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.26386 27.248C9.3428 20.4481 16.5101 16.6372 23.31 18.7161C30.11 20.7951 33.9209 27.9624 31.8419 34.7623C29.763 41.5622 22.5956 45.3731 15.7958 43.2942C8.99587 41.2152 5.18493 34.0479 7.26386 27.248ZM9.72157 27.9983C8.06843 33.4055 11.1399 39.1821 16.5471 40.8352C21.9543 42.4884 27.7309 39.4168 29.384 34.0096C31.0372 28.6024 27.9657 22.8258 22.5585 21.1727C17.1513 19.5196 11.3747 22.5911 9.72157 27.9983Z",fill:"#FFE69F"}),A.createElement("circle",{opacity:.414016,cx:19.5529,cy:31.0039,r:10.2804,transform:"rotate(17 19.5529 31.0039)",fill:"#BBDEFC"}),A.createElement("path",{d:"M14.3685 30.6746C15.7299 27.6867 18.9391 25.9803 22.1776 26.5225L22.2595 26.5475C23.7024 26.8095 24.3854 24.8682 23.1497 24.2218C22.3806 23.8074 21.5613 23.557 20.717 23.3884C17.3715 22.9031 14.0553 24.6664 12.6939 27.6543C12.2796 28.4235 12.0859 29.3497 12.0244 30.1372C11.8444 31.6051 13.8607 32.0424 14.4503 30.6997C14.3434 30.7566 14.3685 30.6746 14.3685 30.6746Z",fill:"#F6FBFF"}),A.createElement("path",{d:"M10.2904 29.0679C11.9436 23.6607 17.7202 20.5893 23.1274 22.2424C25.6671 23.0189 27.5785 24.6783 28.9301 26.704C27.7539 24.1048 25.508 22.0744 22.5586 21.1727C17.1514 19.5196 11.3748 22.591 9.72165 27.9982C8.81993 30.9476 9.32924 33.97 10.7444 36.3735C9.82081 34.1203 9.51395 31.6077 10.2904 29.0679Z",fill:"#ADCBE7"}),A.createElement("path",{opacity:.406087,d:"M36.4864 56.8021L36.1373 56.2691C36.3845 56.8563 36.428 57.5516 36.2372 58.1754C35.9273 59.189 34.5593 59.1971 34.0713 58.2806L28.3787 47.5877C28.0534 46.9767 27.3508 46.7619 26.7395 47.0866L25.7206 47.6277L31.4395 59.3516C31.7648 59.9627 32.27 60.5434 32.8706 60.8123C33.7054 61.1528 34.6593 61.1034 35.3726 60.7247C36.0858 60.3459 36.6602 59.5837 36.8444 58.7021C37.0351 58.0783 36.8117 57.4132 36.4864 56.8021Z",fill:"white"}),A.createElement("path",{d:"M29.8826 48.4977C29.8006 48.4726 29.6368 48.4225 29.5799 48.3155L28.1579 45.6411C28.0442 45.4272 28.1193 45.1814 28.3332 45.0677C28.5472 44.9539 28.7929 45.0291 28.9067 45.243L30.3287 47.9174C30.4424 48.1313 30.3673 48.3771 30.1534 48.4908C30.1284 48.5728 29.9645 48.5227 29.8826 48.4977Z",fill:"#FFF5EB"}),A.createElement("ellipse",{cx:29.2637,cy:54.631,rx:1.50593,ry:3.17918,transform:"rotate(-23 29.2637 54.631)",fill:"#FFC478"}),A.createElement("ellipse",{cx:34.0592,cy:52.4078,rx:.920288,ry:1.67325,transform:"rotate(106 34.0592 52.4078)",fill:"#FFC478"}),A.createElement("path",{d:"M89.1282 19.2055L68.2257 26.8725L45.9197 28.3898L44.4929 16.4082C44.3371 13.798 47.5283 11.4502 50.9859 11.6309L65.1429 12.369L67.3969 12.4869C68.5309 12.5463 69.7066 12.3289 70.7522 11.8627L78.6899 8.34726C81.725 6.99992 85.3012 7.87475 86.2125 10.1876L89.1282 19.2055Z",fill:"url(#paint8_linear_8481_102191)"}),A.createElement("path",{opacity:.479771,d:"M88.6262 19.0953L68.3101 26.5288L65.3314 12.5149L67.5211 12.6263C68.6228 12.6824 69.7652 12.471 70.7816 12.0192L78.4972 8.61266C81.4474 7.30707 84.9208 8.14856 85.8036 10.3829L88.6262 19.0953Z",fill:"#ADCBE7"}),A.createElement("path",{d:"M91.6332 26.6212L46.9517 36.1186L46.0387 28.4438L89.2535 19.2582L91.6332 26.6212Z",fill:"#717DAD"}),A.createElement("path",{d:"M102.961 24.2033C103.125 24.9722 102.371 25.7829 101.278 26.015L37.9675 39.4722C36.8754 39.7043 35.8568 39.2704 35.6933 38.5015C35.5301 37.7336 36.284 36.922 37.3761 36.6898L100.687 23.2327C101.779 23.0005 102.798 23.4354 102.961 24.2033Z",fill:"#9ED1FF"}),A.createElement("path",{d:"M102.703 24.1718C102.838 24.805 102.067 25.5045 100.983 25.7349L69.5583 32.4144L69.0712 30.123L100.496 23.4436C101.58 23.2131 102.569 23.5394 102.703 24.1718Z",fill:"#78AFE1"}),A.createElement("defs",null,A.createElement("linearGradient",{id:"paint0_linear_8481_102191",x1:32.2665,y1:59.6553,x2:59.0518,y2:60.5906,gradientUnits:"userSpaceOnUse"},A.createElement("stop",{stopColor:"#FFFDE0"}),A.createElement("stop",{offset:1,stopColor:"#FFB362"})),A.createElement("linearGradient",{id:"paint1_linear_8481_102191",x1:67.3434,y1:85.966,x2:103.216,y2:78.3411,gradientUnits:"userSpaceOnUse"},A.createElement("stop",{stopColor:"#FFFABC"}),A.createElement("stop",{offset:1,stopColor:"#FFA650"})),A.createElement("linearGradient",{id:"paint2_linear_8481_102191",x1:51.4347,y1:74.8197,x2:91.1539,y2:74.8197,gradientUnits:"userSpaceOnUse"},A.createElement("stop",{stopColor:"#A3C1FF"}),A.createElement("stop",{offset:1,stopColor:"#4243FF"})),A.createElement("linearGradient",{id:"paint3_linear_8481_102191",x1:55.1887,y1:89.2031,x2:94.9078,y2:89.2031,gradientUnits:"userSpaceOnUse"},A.createElement("stop",{stopColor:"#A3C1FF"}),A.createElement("stop",{offset:1,stopColor:"#4243FF"})),A.createElement("linearGradient",{id:"paint4_linear_8481_102191",x1:94.5023,y1:53.1799,x2:106.762,y2:58.7056,gradientUnits:"userSpaceOnUse"},A.createElement("stop",{stopColor:"#FF9498"}),A.createElement("stop",{offset:1,stopColor:"#FFD671"})),A.createElement("linearGradient",{id:"paint5_linear_8481_102191",x1:74.9906,y1:66.9871,x2:94.9778,y2:46.9999,gradientUnits:"userSpaceOnUse"},A.createElement("stop",{stopColor:"#FFFDE0"}),A.createElement("stop",{offset:1,stopColor:"#FFB362"})),A.createElement("linearGradient",{id:"paint6_linear_8481_102191",x1:50.5805,y1:44.0581,x2:59.9372,y2:44.0581,gradientUnits:"userSpaceOnUse"},A.createElement("stop",{stopColor:"white"}),A.createElement("stop",{offset:1,stopColor:"#E3EEF3"})),A.createElement("linearGradient",{id:"paint7_linear_8481_102191",x1:88.4187,y1:43.3906,x2:99.3981,y2:25.1833,gradientUnits:"userSpaceOnUse"},A.createElement("stop",{stopColor:"#FF9498"}),A.createElement("stop",{offset:1,stopColor:"#FFD671"})),A.createElement("linearGradient",{id:"paint8_linear_8481_102191",x1:56.4985,y1:29.5482,x2:100.532,y2:20.1885,gradientUnits:"userSpaceOnUse"},A.createElement("stop",{stopColor:"#ECF7FF"}),A.createElement("stop",{offset:1,stopColor:"#C2E0FF"})))),xl=({message:e})=>d.jsxs(u.Stack,{justifyContent:"center",alignItems:"center",height:"100%",children:[d.jsx(IT,{width:124,height:107}),d.jsx(u.Typography,{variant:"body2",color:u.theme.palette.gray.gray3,children:e})]}),Gn="/v1/api",_T=`${Gn}/connector/conversation/:conversationId/email_log_status`,ST=`${Gn}/connector/conversation/:conversationId/entity_recommendations`,TT=`${Gn}/connector/conversation/:conversationId/retry_emails_log`,AT=`${Gn}/connector/conversation/:conversationId/validate_entity`,LT=`${Gn}/connectors/forms/:formId/search`,OT=`${Gn}/connector/conversation/:conversationId/log_emails`,FT=`${Gn}/connector/feedback/conversation/:conversationId`,kT=`${Gn}/connector/conversation/:conversationId/log_emails`,DT=async({payload:e,entity:t,conversationId:n})=>{if("externalResourceId"in t)return t;try{if(!n)throw new Error("Conversation ID is required to validate entity");const r=await xe({url:et(AT,{conversationId:n}),data:e,method:Fe.POST}),o=r==null?void 0:r.data;if(!o.valid)throw new Error("Entity validation failed");return{...o,...t}}catch(r){throw console.error(r),r}},NT=({onSuccess:e,onError:t})=>Zt({mutationFn:DT,onSuccess:e,onError:t}),El=e=>A.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:14,height:14,viewBox:"0 0 14 14",fill:"#6F7C90",...e},A.createElement("path",{d:"M6.99967 13.6654C6.08856 13.6654 5.22745 13.4903 4.41634 13.14C3.60523 12.7898 2.89701 12.312 2.29167 11.7067C1.68634 11.1014 1.20856 10.3931 0.858341 9.58203C0.508119 8.77092 0.333008 7.90981 0.333008 6.9987C0.333008 6.07648 0.508119 5.2127 0.858341 4.40736C1.20856 3.60203 1.68634 2.89648 2.29167 2.2907C2.89701 1.68492 3.60523 1.20714 4.41634 0.857365C5.22745 0.507587 6.08856 0.332476 6.99967 0.332031C7.18856 0.332031 7.34701 0.396031 7.47501 0.524031C7.60301 0.652031 7.66679 0.810253 7.66634 0.998698C7.6659 1.18714 7.6019 1.34559 7.47434 1.47403C7.34679 1.60248 7.18856 1.66625 6.99967 1.66536C5.5219 1.66536 4.26345 2.18492 3.22434 3.22403C2.18523 4.26314 1.6659 5.52136 1.66634 6.9987C1.66679 8.47603 2.18634 9.73448 3.22501 10.774C4.26367 11.8136 5.5219 12.3329 6.99967 12.332C8.47745 12.3311 9.7359 11.8118 10.775 10.774C11.8141 9.73625 12.3335 8.47781 12.333 6.9987C12.333 6.80981 12.397 6.65159 12.525 6.52403C12.653 6.39648 12.8112 6.33248 12.9997 6.33203C13.1881 6.33159 13.3466 6.39559 13.475 6.52403C13.6035 6.65248 13.6672 6.8107 13.6663 6.9987C13.6663 7.90981 13.4912 8.77092 13.141 9.58203C12.7908 10.3931 12.313 11.1016 11.7077 11.7074C11.1023 12.3131 10.3968 12.7909 9.59101 13.1407C8.78523 13.4905 7.92145 13.6654 6.99967 13.6654Z"})),RT=u.styled(u.Stack)`
2653
2663
  display: flex;
2654
2664
  flex-flow: row nowrap;
2655
2665
  justify-content: flex-start;
@@ -2665,7 +2675,7 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
2665
2675
  cursor: not-allowed;
2666
2676
  }
2667
2677
  `:null}
2668
- `,RT=u.styled(u.Checkbox)`
2678
+ `,MT=u.styled(u.Checkbox)`
2669
2679
  padding: 0;
2670
2680
  margin: 0;
2671
2681
  svg {
@@ -2681,12 +2691,12 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
2681
2691
  input:checked:disabled ~ svg {
2682
2692
  fill: #d6dde8;
2683
2693
  }
2684
- `,MT=u.styled(El)`
2694
+ `,PT=u.styled(El)`
2685
2695
  width: 16px;
2686
2696
  height: 16px;
2687
2697
  fill: #506dff;
2688
2698
  animation: ${Ga} 1s linear infinite;
2689
- `,PT=u.styled(u.Typography)`
2699
+ `,jT=u.styled(u.Typography)`
2690
2700
  font-size: 13px;
2691
2701
  overflow: hidden;
2692
2702
  text-overflow: ellipsis;
@@ -2694,7 +2704,7 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
2694
2704
  `,a2=u.styled(u.Stack)`
2695
2705
  margin-left: auto;
2696
2706
  flex-shrink: 0;
2697
- `,jT=({connectorName:e,entity:t,checked:n,disabled:r,setCheckedEntities:o})=>{const{conversationId:s,connectorFunctions:a}=I.useContext(en),i=a==null?void 0:a.sendTrackingEvent,{displayValue:c,entityType:l,cardId:f}=t,g=m=>{o==null||o(E=>({...E,[l+c]:m})),i==null||i(Mt.email_logging_smart_suggestion_selected,{app_name:e,object_key_selected:c})},y=()=>{i==null||i(Mt.email_logging_smart_suggestion_not_found,{app_name:e,object_key_selected:c})},{mutate:x,isPending:b,isError:p}=DT({onSuccess:g,onError:y}),h=()=>{!o||b||r||p||(n?o(m=>{const E={...m};return delete E[l+c],E}):(i==null||i(Mt.email_logging_smart_suggestion_initiated,{app_name:e,object_key_selected:c}),x({entity:t,payload:{entityType:l,searchString:c,cardId:f},conversationId:s})))};return d.jsx(u.Tooltip,{title:r?YS:"",placement:"top",children:d.jsxs(NT,{disabled:b||p,onClick:h,children:[d.jsx(RT,{value:n,checked:n,disabled:r}),d.jsx(u.Tooltip,{title:(c==null?void 0:c.length)>30?c:null,placement:"right",children:d.jsx(PT,{variant:"body2",children:c})}),b?d.jsx(a2,{children:d.jsx(MT,{})}):null,p?d.jsx(u.Tooltip,{title:"Record not found in "+e,children:d.jsx(a2,{children:d.jsx(ml,{})})}):null]})})},BT=u.styled(u.Stack)`
2707
+ `,BT=({connectorName:e,entity:t,checked:n,disabled:r,setCheckedEntities:o})=>{const{conversationId:s,connectorFunctions:a}=I.useContext(en),i=a==null?void 0:a.sendTrackingEvent,{displayValue:c,entityType:l,cardId:f}=t,g=m=>{o==null||o(E=>({...E,[l+c]:m})),i==null||i(Mt.email_logging_smart_suggestion_selected,{app_name:e,object_key_selected:c})},y=()=>{i==null||i(Mt.email_logging_smart_suggestion_not_found,{app_name:e,object_key_selected:c})},{mutate:x,isPending:b,isError:p}=NT({onSuccess:g,onError:y}),h=()=>{!o||b||r||p||(n?o(m=>{const E={...m};return delete E[l+c],E}):(i==null||i(Mt.email_logging_smart_suggestion_initiated,{app_name:e,object_key_selected:c}),x({entity:t,payload:{entityType:l,searchString:c,cardId:f},conversationId:s})))};return d.jsx(u.Tooltip,{title:r?JS:"",placement:"top",children:d.jsxs(RT,{disabled:b||p,onClick:h,children:[d.jsx(MT,{value:n,checked:n,disabled:r}),d.jsx(u.Tooltip,{title:(c==null?void 0:c.length)>30?c:null,placement:"right",children:d.jsx(jT,{variant:"body2",children:c})}),b?d.jsx(a2,{children:d.jsx(PT,{})}):null,p?d.jsx(u.Tooltip,{title:"Record not found in "+e,children:d.jsx(a2,{children:d.jsx(ml,{})})}):null]})})},VT=u.styled(u.Stack)`
2698
2708
  color: #343c45;
2699
2709
  padding: 18px 0;
2700
2710
  box-sizing: border-box;
@@ -2705,7 +2715,7 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
2705
2715
  overflow-y: auto;
2706
2716
  scrollbar-width: thin;
2707
2717
  scrollbar-color: #97a3b7 transparent;
2708
- `;const VT=u.styled(u.Stack)`
2718
+ `;const GT=u.styled(u.Stack)`
2709
2719
  display: grid;
2710
2720
  grid-template-rows: max-content 0fr;
2711
2721
  transition: grid-template-rows 300ms ease-out;
@@ -2718,7 +2728,7 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
2718
2728
  transform: rotate(-90deg);
2719
2729
  }
2720
2730
  }
2721
- `,GT=u.styled(u.Stack)`
2731
+ `,HT=u.styled(u.Stack)`
2722
2732
  cursor: pointer;
2723
2733
  flex-flow: row nowrap;
2724
2734
  justify-content: space-between;
@@ -2731,19 +2741,19 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
2731
2741
  transform-origin: center;
2732
2742
  transition: transform 300ms ease-out;
2733
2743
  }
2734
- `,HT=u.styled(u.Typography)`
2744
+ `,WT=u.styled(u.Typography)`
2735
2745
  font-size: 13px;
2736
2746
  line-height: 18px;
2737
2747
  font-weight: 400;
2738
2748
  color: #6f7c90;
2739
2749
  text-transform: capitalize;
2740
- `,WT=u.styled(u.Stack)`
2750
+ `,ZT=u.styled(u.Stack)`
2741
2751
  overflow: hidden;
2742
- `,i2=e=>A.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"#6C7B94",xmlns:"http://www.w3.org/2000/svg",...e},A.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.00483 12.5052C7.73146 12.7786 7.73146 13.2218 8.00483 13.4952C8.2782 13.7685 8.72141 13.7685 8.99478 13.4952L11.9948 10.4952C12.2681 10.2218 12.2681 9.77859 11.9948 9.50522L8.99478 6.50522C8.72141 6.23185 8.2782 6.23185 8.00483 6.50522C7.73146 6.77859 7.73146 7.2218 8.00483 7.49517L10.5099 10.0002L8.00483 12.5052Z"})),c2=({connectorName:e,entities:t,checkedEntities:n={},disabled:r=!1,setCheckedEntities:o})=>{const s=I.useMemo(()=>IS(t),[t]),a=i=>{const c=i.currentTarget;if(!c)return;const l=c.parentElement;l&&l.classList.toggle("expanded")};return t!=null&&t.length?d.jsx(BT,{children:s.map(i=>d.jsxs(VT,{className:"expanded",children:[d.jsxs(GT,{onClick:a,children:[d.jsx(HT,{variant:"body2",children:i.type}),d.jsx(i2,{className:"toggle-arrow-icon"})]}),d.jsx(WT,{children:i.entities.map(c=>d.jsx(jT,{connectorName:e,entity:c,checked:r||!!n[c.entityType+c.displayValue],setCheckedEntities:o,disabled:r},c.formId))})]},i.type))}):d.jsx(xl,{message:zS})},ZT=u.styled(u.Stack)`
2752
+ `,i2=e=>A.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"#6C7B94",xmlns:"http://www.w3.org/2000/svg",...e},A.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.00483 12.5052C7.73146 12.7786 7.73146 13.2218 8.00483 13.4952C8.2782 13.7685 8.72141 13.7685 8.99478 13.4952L11.9948 10.4952C12.2681 10.2218 12.2681 9.77859 11.9948 9.50522L8.99478 6.50522C8.72141 6.23185 8.2782 6.23185 8.00483 6.50522C7.73146 6.77859 7.73146 7.2218 8.00483 7.49517L10.5099 10.0002L8.00483 12.5052Z"})),c2=({connectorName:e,entities:t,checkedEntities:n={},disabled:r=!1,setCheckedEntities:o})=>{const s=I.useMemo(()=>_S(t),[t]),a=i=>{const c=i.currentTarget;if(!c)return;const l=c.parentElement;l&&l.classList.toggle("expanded")};return t!=null&&t.length?d.jsx(VT,{children:s.map(i=>d.jsxs(GT,{className:"expanded",children:[d.jsxs(HT,{onClick:a,children:[d.jsx(WT,{variant:"body2",children:i.type}),d.jsx(i2,{className:"toggle-arrow-icon"})]}),d.jsx(ZT,{children:i.entities.map(c=>d.jsx(BT,{connectorName:e,entity:c,checked:r||!!n[c.entityType+c.displayValue],setCheckedEntities:o,disabled:r},c.formId))})]},i.type))}):d.jsx(xl,{message:YS})},XT=u.styled(u.Stack)`
2743
2753
  padding: 18px 0;
2744
2754
  row-gap: 12px;
2745
2755
  box-sizing: border-box;
2746
- `,XT=u.styled(u.Stack)`
2756
+ `,zT=u.styled(u.Stack)`
2747
2757
  cursor: pointer;
2748
2758
  position: relative;
2749
2759
  z-index: 1;
@@ -2754,7 +2764,7 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
2754
2764
  background-color: rgba(0, 0, 0, 0.04);
2755
2765
  z-index: -1;
2756
2766
  }
2757
- `,zT=({searchText:e,connectorName:t,formData:n,onClick:r})=>d.jsxs(XT,{onClick:r,children:[d.jsx(u.Typography,{color:u.theme.palette.gray.gray1,children:e}),d.jsxs(u.Typography,{color:u.theme.palette.gray.gray3,fontSize:"12px",textTransform:"capitalize",children:[t," - ",n==null?void 0:n.searchObject]})]}),YT=({searchText:e,connectorName:t,options:n,onSearch:r})=>{const o=s=>{r({formId:s.id,searchObject:s.searchObject,searchText:e})};return d.jsx(ZT,{children:n.map(s=>d.jsx(zT,{searchText:e,connectorName:t,formData:s,onClick:()=>o(s)},t+(s==null?void 0:s.searchObject)))})},JT=u.styled(u.Stack)`
2767
+ `,YT=({searchText:e,connectorName:t,formData:n,onClick:r})=>d.jsxs(zT,{onClick:r,children:[d.jsx(u.Typography,{color:u.theme.palette.gray.gray1,children:e}),d.jsxs(u.Typography,{color:u.theme.palette.gray.gray3,fontSize:"12px",textTransform:"capitalize",children:[t," - ",n==null?void 0:n.searchObject]})]}),JT=({searchText:e,connectorName:t,options:n,onSearch:r})=>{const o=s=>{r({formId:s.id,searchObject:s.searchObject,searchText:e})};return d.jsx(XT,{children:n.map(s=>d.jsx(YT,{searchText:e,connectorName:t,formData:s,onClick:()=>o(s)},t+(s==null?void 0:s.searchObject)))})},qT=u.styled(u.Stack)`
2758
2768
  padding: 12px 12px 12px 11px;
2759
2769
  border: 1px solid ${u.theme.palette.gray.gray5};
2760
2770
  border-radius: 8px;
@@ -2768,26 +2778,26 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
2768
2778
  transform: translateX(6px);
2769
2779
  }
2770
2780
  }
2771
- `,qT=u.styled(u.Stack)`
2781
+ `,QT=u.styled(u.Stack)`
2772
2782
  padding: 14px 0;
2773
2783
  row-gap: 12px;
2774
2784
  column-gap: 16px;
2775
2785
  box-sizing: border-box;
2776
- `,QT=u.styled(u.Stack)`
2786
+ `,$T=u.styled(u.Stack)`
2777
2787
  padding: 8px 0;
2778
2788
  row-gap: 12px;
2779
2789
  box-sizing: border-box;
2780
- `,$T=({entity:e,onLog:t})=>{const{externalResourceId:n,name:r}=e;return d.jsxs(JT,{onClick:t,direction:"row",children:[d.jsx(u.Stack,{flexGrow:1,children:d.jsx(u.Typography,{variant:"body2",fontSize:"13px",color:"#343C45",children:r})}),d.jsx(i2,{})]},n)},UT=({connectorName:e,results:t,formId:n,searchObject:r,addEntity:o})=>{const s=t.length,{connectorFunctions:a}=I.useContext(en),i=a==null?void 0:a.sendTrackingEvent;if(!(t!=null&&t.length))return d.jsx(xl,{message:"No results found"});const c=l=>{o(l),i==null||i(Mt.email_logging_search_result_selected,{app_name:e,object_name:l.displayValue,object_key:l.entityType})};return d.jsxs(qT,{children:[d.jsxs(u.Typography,{variant:"body2",color:"#3E4C5A",children:[s," Results found in ",e]}),d.jsx(QT,{children:t.map(l=>d.jsx($T,{entity:{...l,id:n,searchObject:r},onLog:()=>c({...l,entityType:r,app:e,displayValue:l.name})},l.externalResourceId))})]})},KT=u.styled(u.Stack)`
2790
+ `,UT=({entity:e,onLog:t})=>{const{externalResourceId:n,name:r}=e;return d.jsxs(qT,{onClick:t,direction:"row",children:[d.jsx(u.Stack,{flexGrow:1,children:d.jsx(u.Typography,{variant:"body2",fontSize:"13px",color:"#343C45",children:r})}),d.jsx(i2,{})]},n)},KT=({connectorName:e,results:t,formId:n,searchObject:r,addEntity:o})=>{const s=t.length,{connectorFunctions:a}=I.useContext(en),i=a==null?void 0:a.sendTrackingEvent;if(!(t!=null&&t.length))return d.jsx(xl,{message:"No results found"});const c=l=>{o(l),i==null||i(Mt.email_logging_search_result_selected,{app_name:e,object_name:l.displayValue,object_key:l.entityType})};return d.jsxs(QT,{children:[d.jsxs(u.Typography,{variant:"body2",color:"#3E4C5A",children:[s," Results found in ",e]}),d.jsx($T,{children:t.map(l=>d.jsx(UT,{entity:{...l,id:n,searchObject:r},onLog:()=>c({...l,entityType:r,app:e,displayValue:l.name})},l.externalResourceId))})]})},eA=u.styled(u.Stack)`
2781
2791
  height: 100%;
2782
2792
  row-gap: 8px;
2783
2793
  align-items: center;
2784
2794
  justify-content: center;
2785
- `,eA=u.styled(El)`
2795
+ `,tA=u.styled(El)`
2786
2796
  width: 32px;
2787
2797
  height: 32px;
2788
2798
  fill: #506dff;
2789
2799
  animation: ${Ga} 1s linear infinite;
2790
- `,tA=({message:e="Fetching details"})=>d.jsxs(KT,{children:[d.jsx(eA,{}),d.jsx(u.Typography,{variant:"body2",fontSize:"12px",color:"#6F7C90",children:e})]}),nA=async({conversationId:e})=>{try{if(!e)throw new Error("Conversation ID is required to fetch email log status");const t=await xe({url:et(IT,{conversationId:e}),method:Fe.GET});return t==null?void 0:t.data}catch(t){throw console.error(t),t}},rA=e=>{var t;return e?!((t=e==null?void 0:e.messageLogStatus)!=null&&t.pending):!1},Ha=({conversationId:e})=>{const t=Gr(),{queryKey:n,polledLogsStatus:r}=I.useMemo(()=>{const s=["EmailLogger","PolledLogsStatus",e],a=Hp({intervalMillis:1e3,maxRetries:10,increaseIntervalMillis:1500,apiFn:nA,isSatisfied:rA,pushIntermediateResults:i=>{t.setQueryData(s,i)}});return{queryKey:s,polledLogsStatus:a}},[t,e]);return Wt({queryKey:n,queryFn:()=>r({conversationId:e}),enabled:!!e,refetchOnWindowFocus:"always",retry:!1})},oA=async({payload:e,conversationId:t})=>{try{if(!t)throw new Error("Conversation ID is required to post logs");const n=await xe({url:et(LT,{conversationId:t}),data:e,method:Fe.POST});return n==null?void 0:n.data}catch(n){throw Ie({message:vn,type:Ye}),console.error(n),n}},sA=({onSuccess:e})=>Zt({mutationFn:oA,onSuccess:e}),aA=u.styled(u.Stack)`
2800
+ `,nA=({message:e="Fetching details"})=>d.jsxs(eA,{children:[d.jsx(tA,{}),d.jsx(u.Typography,{variant:"body2",fontSize:"12px",color:"#6F7C90",children:e})]}),rA=async({conversationId:e})=>{try{if(!e)throw new Error("Conversation ID is required to fetch email log status");const t=await xe({url:et(_T,{conversationId:e}),method:Fe.GET});return t==null?void 0:t.data}catch(t){throw console.error(t),t}},oA=e=>{var t;return e?!((t=e==null?void 0:e.messageLogStatus)!=null&&t.pending):!1},Ha=({conversationId:e})=>{const t=Gr(),{queryKey:n,polledLogsStatus:r}=I.useMemo(()=>{const s=["EmailLogger","PolledLogsStatus",e],a=Hp({intervalMillis:1e3,maxRetries:10,increaseIntervalMillis:1500,apiFn:rA,isSatisfied:oA,pushIntermediateResults:i=>{t.setQueryData(s,i)}});return{queryKey:s,polledLogsStatus:a}},[t,e]);return Wt({queryKey:n,queryFn:()=>r({conversationId:e}),enabled:!!e,refetchOnWindowFocus:"always",retry:!1})},sA=async({payload:e,conversationId:t})=>{try{if(!t)throw new Error("Conversation ID is required to post logs");const n=await xe({url:et(OT,{conversationId:t}),data:e,method:Fe.POST});return n==null?void 0:n.data}catch(n){throw Ie({message:vn,type:Ye}),console.error(n),n}},aA=({onSuccess:e})=>Zt({mutationFn:sA,onSuccess:e}),iA=u.styled(u.Stack)`
2791
2801
  padding: 12px;
2792
2802
  flex-flow: row nowrap;
2793
2803
  justify-content: flex-end;
@@ -2804,7 +2814,7 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
2804
2814
  padding: 7px 10px;
2805
2815
  }
2806
2816
  }
2807
- `,iA=({checkedEntities:e,close:t,connectorName:n,connectorId:r})=>{const{conversationId:o,connectorFunctions:s}=I.useContext(en),{refetch:a}=Ha({conversationId:o}),i=s==null?void 0:s.sendTrackingEvent,c=()=>{a(),t();const b=Object.values(e),p=b.map(m=>m.displayValue).join(", "),h=Array.from(new Set(b.map(m=>m==null?void 0:m.entityType)));i==null||i(Mt.email_logging_log_config_saved,{app_name:n,num_of_keys_selected:b.length,list_of_keys:p,list_of_objects:h.join(", "),num_of_objects_selected:h.length})},{mutate:l,isPending:f}=sA({onSuccess:c}),g=Object.keys(e).length>0,y=()=>{const b=Object.values(e);l({conversationId:o,payload:{selectedEntities:b,connectorId:r,autoLogEnabled:!0}})},x=()=>{t==null||t(),i==null||i(Mt.email_logging_log_config_canceled,{app_name:n})};return d.jsxs(aA,{children:[d.jsx(u.Button,{variant:"text",size:"small",onClick:x,children:"Cancel"}),d.jsxs(u.Button,{variant:"contained",size:"small",className:"primary-action",disabled:f||!g,onClick:y,children:[f?d.jsx(u.CircularProgress,{sx:{color:"#97A3B7"},size:12}):null,"Save & Enable"]})]})},cA="Tell us more (optional)",lA=u.styled(u.Box)`
2817
+ `,cA=({checkedEntities:e,close:t,connectorName:n,connectorId:r})=>{const{conversationId:o,connectorFunctions:s}=I.useContext(en),{refetch:a}=Ha({conversationId:o}),i=s==null?void 0:s.sendTrackingEvent,c=()=>{a(),t();const b=Object.values(e),p=b.map(m=>m.displayValue).join(", "),h=Array.from(new Set(b.map(m=>m==null?void 0:m.entityType)));i==null||i(Mt.email_logging_log_config_saved,{app_name:n,num_of_keys_selected:b.length,list_of_keys:p,list_of_objects:h.join(", "),num_of_objects_selected:h.length})},{mutate:l,isPending:f}=aA({onSuccess:c}),g=Object.keys(e).length>0,y=()=>{const b=Object.values(e);l({conversationId:o,payload:{selectedEntities:b,connectorId:r,autoLogEnabled:!0}})},x=()=>{t==null||t(),i==null||i(Mt.email_logging_log_config_canceled,{app_name:n})};return d.jsxs(iA,{children:[d.jsx(u.Button,{variant:"text",size:"small",onClick:x,children:"Cancel"}),d.jsxs(u.Button,{variant:"contained",size:"small",className:"primary-action",disabled:f||!g,onClick:y,children:[f?d.jsx(u.CircularProgress,{sx:{color:"#97A3B7"},size:12}):null,"Save & Enable"]})]})},lA="Tell us more (optional)",uA=u.styled(u.Box)`
2808
2818
  width: ${({width:e})=>e||"440px"};
2809
2819
  border-radius: 12px;
2810
2820
  padding: 16px;
@@ -2817,15 +2827,15 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
2817
2827
  flex-direction: row;
2818
2828
  margin-bottom: 12px;
2819
2829
  }
2820
- `,uA=u.styled(u.Box)`
2830
+ `,dA=u.styled(u.Box)`
2821
2831
  border-bottom: 1px solid ${u.theme.palette.gray.gray6};
2822
2832
  margin: 12px -16px;
2823
- `,dA=u.styled(u.Box)`
2833
+ `,fA=u.styled(u.Box)`
2824
2834
  display: flex;
2825
2835
  justify-content: flex-end;
2826
2836
  margin-top: 30px;
2827
2837
  gap: 8px;
2828
- `,fA=({onCancel:e,onSubmit:t,isLoading:n,showOptions:r=!0,title:o,width:s,feedbackOptions:a,feedbackPlaceholder:i=cA})=>{const[c,l]=I.useState(""),[f,g]=I.useState(""),y=m=>{l(m.target.value)},x=m=>{m.stopPropagation();const{value:E}=(m==null?void 0:m.target)||{};g(E)},b=()=>{t({feedbackOption:c,feedbackComment:f})},p=()=>{e==null||e()},h=r?!c:!f;return d.jsxs(lA,{width:s,children:[d.jsx(u.Typography,{variant:"h3",children:o}),d.jsx(uA,{}),r?d.jsx(u.FormControl,{children:d.jsx(u.RadioGroup,{"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:c,onChange:y,children:a.map(m=>d.jsx(u.FormControlLabel,{value:m.value,control:d.jsx(u.Radio,{}),label:m.label},m.value))})}):null,d.jsx(yr,{type:"text",placeholder:i,value:f,name:"feedbackComment",inputChangeHandler:x,multiline:!0,rows:5,limit:250,validation:{validate:vc()}}),d.jsxs(dA,{children:[d.jsx(u.Button,{variant:"text",color:"primary",style:{color:u.theme.palette.gray.gray3},disabled:n,onClick:p,children:"Cancel"}),d.jsx(Jp,{variant:"contained",color:"primary",isLoading:n,disabled:h,label:"Submit",onClick:b})]})]})},pA=async({conversationId:e,feedbackData:t})=>{try{if(!e)throw new Error("Conversation ID is required");const n=await xe({url:OT.replace(":conversationId",e)+"?channel_type=email",method:"POST",data:t});return Ie({message:tT,type:Ut}),n==null?void 0:n.data}catch(n){throw console.error("Error submitting feedback:",n),Ie({message:nT,type:Ye}),n}};function hA({onSuccess:e}){return Zt({mutationFn:pA,onSuccess:e})}const gA=u.styled(u.Stack)`
2838
+ `,pA=({onCancel:e,onSubmit:t,isLoading:n,showOptions:r=!0,title:o,width:s,feedbackOptions:a,feedbackPlaceholder:i=lA})=>{const[c,l]=I.useState(""),[f,g]=I.useState(""),y=m=>{l(m.target.value)},x=m=>{m.stopPropagation();const{value:E}=(m==null?void 0:m.target)||{};g(E)},b=()=>{t({feedbackOption:c,feedbackComment:f})},p=()=>{e==null||e()},h=r?!c:!f;return d.jsxs(uA,{width:s,children:[d.jsx(u.Typography,{variant:"h3",children:o}),d.jsx(dA,{}),r?d.jsx(u.FormControl,{children:d.jsx(u.RadioGroup,{"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:c,onChange:y,children:a.map(m=>d.jsx(u.FormControlLabel,{value:m.value,control:d.jsx(u.Radio,{}),label:m.label},m.value))})}):null,d.jsx(yr,{type:"text",placeholder:i,value:f,name:"feedbackComment",inputChangeHandler:x,multiline:!0,rows:5,limit:250,validation:{validate:vc()}}),d.jsxs(fA,{children:[d.jsx(u.Button,{variant:"text",color:"primary",style:{color:u.theme.palette.gray.gray3},disabled:n,onClick:p,children:"Cancel"}),d.jsx(Jp,{variant:"contained",color:"primary",isLoading:n,disabled:h,label:"Submit",onClick:b})]})]})},hA=async({conversationId:e,feedbackData:t})=>{try{if(!e)throw new Error("Conversation ID is required");const n=await xe({url:FT.replace(":conversationId",e)+"?channel_type=email",method:"POST",data:t});return Ie({message:nT,type:Ut}),n==null?void 0:n.data}catch(n){throw console.error("Error submitting feedback:",n),Ie({message:rT,type:Ye}),n}};function gA({onSuccess:e}){return Zt({mutationFn:hA,onSuccess:e})}const mA=u.styled(u.Stack)`
2829
2839
  flex-flow: row nowrap;
2830
2840
  justify-content: space-between;
2831
2841
  align-items: center;
@@ -2837,7 +2847,7 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
2837
2847
  &:disabled {
2838
2848
  opacity: 0.4;
2839
2849
  }
2840
- `,mA=u.styled(u.Typography)`
2850
+ `,bA=u.styled(u.Typography)`
2841
2851
  color: #6f7c90;
2842
2852
  font-size: 11px;
2843
2853
  font-weight: 400;
@@ -2846,35 +2856,35 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
2846
2856
  `,u2=u.styled(u.Tooltip)`
2847
2857
  padding: 6px;
2848
2858
  border-radius: 6px;
2849
- `,bA=()=>{const{conversationId:e}=I.useContext(en),[t,n]=I.useState(!1),r=()=>{n(!1)},{mutate:o,isPending:s}=hA({onSuccess:r}),a=()=>{o({conversationId:e,feedbackData:{feedback_type:o2,positive_feedback:!1}})},i=()=>{n(!0)},c=({feedbackComment:l,feedbackOption:f})=>{o({conversationId:e,feedbackData:{feedback_type:o2,comment:l,option:f,positive_feedback:!1}})};return d.jsxs(gA,{children:[d.jsx(mA,{children:eT}),d.jsxs(u.Stack,{flexDirection:"row",alignItems:"flex-end",children:[d.jsx(u2,{arrow:!0,title:US,placement:"top",children:d.jsx(l2,{className:"feedback-button",size:"small",onClick:a,disabled:s,children:d.jsx(Qp,{})})}),d.jsx(u2,{arrow:!0,title:KS,placement:"top",children:d.jsx(l2,{className:"feedback-button",size:"small",onClick:i,disabled:s,children:d.jsx($p,{})})})]}),d.jsx(Er,{shown:t,setShown:n,borderRadius:12,sx:{zIndex:15002},children:d.jsx(fA,{onCancel:()=>n(!1),onSubmit:c,isLoading:s,title:$S,feedbackOptions:rT,width:"440px"})})]})},yA=async({conversationId:e})=>{try{if(!e)throw new Error("Conversation ID is required to fetch recommendations");const t=await xe({url:et(_T,{conversationId:e}),method:Fe.GET}),n=t==null?void 0:t.data;return(n==null?void 0:n.results)??[]}catch(t){throw console.error(t),t}},CA=({conversationId:e,enabled:t=!0})=>Wt({queryKey:["EmailLogger","EntityRecommendations",e],queryFn:()=>yA({conversationId:e}),enabled:!!e&&t}),xA=async({formId:e,searchObject:t,searchText:n})=>{try{if(!e)throw new Error("Form ID is required to fetch search entities");const r=await xe({url:et(AT,{formId:e}),data:{search_string:n,args:{}},method:Fe.POST}),o=r==null?void 0:r.data;if(!o||o.errorMessage)throw new Error(o.errorMessage||"Failed to fetch search entities");return{results:o.data,searchObject:t,formId:e}}catch(r){throw Ie({message:vn,type:Ye}),console.error(r),r}},EA=({onSuccess:e})=>Zt({mutationFn:xA,onSuccess:e}),vA=async({payload:e,conversationId:t})=>{try{if(!t)throw new Error("Conversation ID is required to toggle auto logs");const n=await xe({url:et(FT,{conversationId:t}),data:e,method:Fe.PATCH});return n==null?void 0:n.data}catch(n){throw Ie({message:vn,type:Ye}),console.error(n),n}},wA=({onSuccess:e})=>Zt({mutationFn:vA,onSuccess:e}),IA=u.styled(u.Stack)`
2859
+ `,yA=()=>{const{conversationId:e}=I.useContext(en),[t,n]=I.useState(!1),r=()=>{n(!1)},{mutate:o,isPending:s}=gA({onSuccess:r}),a=()=>{o({conversationId:e,feedbackData:{feedback_type:o2,positive_feedback:!1}})},i=()=>{n(!0)},c=({feedbackComment:l,feedbackOption:f})=>{o({conversationId:e,feedbackData:{feedback_type:o2,comment:l,option:f,positive_feedback:!1}})};return d.jsxs(mA,{children:[d.jsx(bA,{children:tT}),d.jsxs(u.Stack,{flexDirection:"row",alignItems:"flex-end",children:[d.jsx(u2,{arrow:!0,title:KS,placement:"top",children:d.jsx(l2,{className:"feedback-button",size:"small",onClick:a,disabled:s,children:d.jsx(Qp,{})})}),d.jsx(u2,{arrow:!0,title:eT,placement:"top",children:d.jsx(l2,{className:"feedback-button",size:"small",onClick:i,disabled:s,children:d.jsx($p,{})})})]}),d.jsx(Er,{shown:t,setShown:n,borderRadius:12,sx:{zIndex:15002},children:d.jsx(pA,{onCancel:()=>n(!1),onSubmit:c,isLoading:s,title:US,feedbackOptions:oT,width:"440px"})})]})},CA=async({conversationId:e})=>{try{if(!e)throw new Error("Conversation ID is required to fetch recommendations");const t=await xe({url:et(ST,{conversationId:e}),method:Fe.GET}),n=t==null?void 0:t.data;return(n==null?void 0:n.results)??[]}catch(t){throw console.error(t),t}},xA=({conversationId:e,enabled:t=!0})=>Wt({queryKey:["EmailLogger","EntityRecommendations",e],queryFn:()=>CA({conversationId:e}),enabled:!!e&&t}),EA=async({formId:e,searchObject:t,searchText:n})=>{try{if(!e)throw new Error("Form ID is required to fetch search entities");const r=await xe({url:et(LT,{formId:e}),data:{search_string:n,args:{}},method:Fe.POST}),o=r==null?void 0:r.data;if(!o||o.errorMessage)throw new Error(o.errorMessage||"Failed to fetch search entities");return{results:o.data,searchObject:t,formId:e}}catch(r){throw Ie({message:vn,type:Ye}),console.error(r),r}},vA=({onSuccess:e})=>Zt({mutationFn:EA,onSuccess:e}),wA=async({payload:e,conversationId:t})=>{try{if(!t)throw new Error("Conversation ID is required to toggle auto logs");const n=await xe({url:et(kT,{conversationId:t}),data:e,method:Fe.PATCH});return n==null?void 0:n.data}catch(n){throw Ie({message:vn,type:Ye}),console.error(n),n}},IA=({onSuccess:e})=>Zt({mutationFn:wA,onSuccess:e}),_A=u.styled(u.Stack)`
2850
2860
  color: #343c45;
2851
2861
  height: 100%;
2852
2862
  box-sizing: border-box;
2853
- `,_A=u.styled(u.Stack)`
2863
+ `,SA=u.styled(u.Stack)`
2854
2864
  flex-flow: row nowrap;
2855
2865
  justify-content: space-between;
2856
2866
  align-items: center;
2857
2867
  column-gap: 8px;
2858
2868
  padding: 12px 16px;
2859
2869
  background-color: #f6f8fc;
2860
- `,SA=u.styled(u.Stack)`
2870
+ `,TA=u.styled(u.Stack)`
2861
2871
  flex-flow: row nowrap;
2862
2872
  justify-content: flex-start;
2863
2873
  align-items: center;
2864
2874
  column-gap: 8px;
2865
- `,TA=u.styled(u.Stack)`
2875
+ `,AA=u.styled(u.Stack)`
2866
2876
  flex-flow: row nowrap;
2867
2877
  justify-content: flex-end;
2868
2878
  align-items: center;
2869
2879
  column-gap: 6px;
2870
- `,AA=u.styled(u.Stack)`
2880
+ `,LA=u.styled(u.Stack)`
2871
2881
  padding: 4px;
2872
2882
  background-color: #ffffff;
2873
2883
  border-radius: 50%;
2874
- `,LA=u.styled("img")`
2884
+ `,OA=u.styled("img")`
2875
2885
  width: 16px;
2876
2886
  height: 16px;
2877
- `,OA=u.styled(u.Stack)`
2887
+ `,FA=u.styled(u.Stack)`
2878
2888
  flex-grow: 1;
2879
2889
  `,d2=u.styled(u.Stack)`
2880
2890
  flex-grow: 1;
@@ -2887,10 +2897,10 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
2887
2897
  overflow-y: auto;
2888
2898
  scrollbar-width: thin;
2889
2899
  scrollbar-color: #97a3b7 transparent;
2890
- `,FA=u.styled(u.Stack)`
2900
+ `,kA=u.styled(u.Stack)`
2891
2901
  padding: 12px 16px 0;
2892
2902
  position: relative;
2893
- `,kA=u.styled(u.OutlinedInput)`
2903
+ `,DA=u.styled(u.OutlinedInput)`
2894
2904
  padding: 0;
2895
2905
  fieldset {
2896
2906
  border-radius: 4px;
@@ -2909,7 +2919,7 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
2909
2919
  border-width: 1px !important;
2910
2920
  }
2911
2921
  }
2912
- `,DA=u.styled(u.Stack)`
2922
+ `,NA=u.styled(u.Stack)`
2913
2923
  padding: 8px 0 8px 12px;
2914
2924
  justify-content: center;
2915
2925
  align-items: center;
@@ -2918,12 +2928,12 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
2918
2928
  height: 15px;
2919
2929
  fill: #4d596c;
2920
2930
  }
2921
- `,NA=e=>d.jsx(u.Switch,{disableRipple:!0,...e}),RA=u.styled(NA)(({disabled:e})=>({padding:0,width:"32px",height:"16px","& .MuiSwitch-switchBase":{padding:2,margin:0,transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(16px)",color:e?"#d6dde8":"#fff","& + .MuiSwitch-track":{opacity:1,backgroundColor:e?"#4d596c":"#506DFF"}}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:12,height:12},"& .MuiSwitch-track":{borderRadius:8}})),MA=u.styled(El)`
2931
+ `,RA=e=>d.jsx(u.Switch,{disableRipple:!0,...e}),MA=u.styled(RA)(({disabled:e})=>({padding:0,width:"32px",height:"16px","& .MuiSwitch-switchBase":{padding:2,margin:0,transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(16px)",color:e?"#d6dde8":"#fff","& + .MuiSwitch-track":{opacity:1,backgroundColor:e?"#4d596c":"#506DFF"}}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:12,height:12},"& .MuiSwitch-track":{borderRadius:8}})),PA=u.styled(El)`
2922
2932
  width: 14px;
2923
2933
  height: 14px;
2924
2934
  fill: #4d596c;
2925
2935
  animation: ${Ga} 1s linear infinite;
2926
- `,vr=io.CaseView,PA=({emailLogStatus:e,close:t})=>{const{emailLogSettings:n,autoLogEnabled:r,selectedEntities:o,formList:s}=e,{connectorName:a,connectorId:i,logoUrl:c}=n??{},l=(o==null?void 0:o.length)>0,[f,g]=I.useState(""),[y,x]=I.useState([]),[b,p]=I.useState({}),{conversationId:h,connectorFunctions:m}=I.useContext(en),E=m==null?void 0:m.sendTrackingEvent,{data:C,isError:w,isLoading:v}=CA({conversationId:h,enabled:!l}),{refetch:_}=Ha({conversationId:h}),T=()=>{E==null||E(Mt.email_logging_search_results_found,{app_name:a,search_keyword:f})},{mutate:S,data:L,isPending:N,isIdle:k,reset:D}=EA({onSuccess:T}),{mutate:M,isPending:j}=wA({onSuccess:_}),{results:J=[],...Y}=L??{},z=I.useMemo(()=>{const R={},G=[];for(const W of y){const U=W.entityType+W.displayValue;R[U]||G.push(W),R[U]=W}for(const W of C??[]){const U=W.entityType+W.displayValue;R[U]||G.push(W),R[U]=W}return G},[C,y]),H=R=>{g(R.target.value),k||D()},q=R=>{const{entityType:G,displayValue:W}=R;p(U=>({...U,[G+W]:R})),x(U=>[R,...U]),g(""),D()},ne=()=>{E==null||E(Mt.email_logging_search_initiated,{app_name:a})},ce=()=>{M({payload:{autoLogEnabled:!r},conversationId:h});const R=r?Mt.email_logging_auto_log_disabled:Mt.email_logging_auto_log_enabled;E==null||E(R,{app_name:a})},V=v||N;return d.jsxs(IA,{children:[d.jsxs(_A,{children:[d.jsxs(SA,{children:[d.jsx(AA,{children:d.jsx(LA,{src:c,alt:"connector"})}),d.jsx(u.Typography,{children:"Sync conversation"})]}),d.jsxs(TA,{children:[j?d.jsx(MA,{}):null,l?d.jsx(u.Tooltip,{arrow:!0,title:r?BS:VS,children:d.jsx(u.Stack,{children:d.jsx(RA,{checked:r,value:r,onClick:ce,disabled:j})})}):null]})]}),d.jsx(OA,{children:d.jsxs(io,{children:[d.jsxs(vr,{condition:l,children:[d.jsx(d2,{children:d.jsx(f2,{children:d.jsx(c2,{connectorName:a,entities:o,disabled:!0})})}),d.jsx(bA,{})]},"disabled-view"),d.jsxs(vr,{fallback:!0,children:[d.jsx(FA,{children:d.jsx(kA,{type:"text",name:"search",value:f,onChange:H,onFocus:ne,startAdornment:d.jsx(DA,{children:d.jsx(Vp,{})}),size:"small"})}),d.jsx(d2,{children:d.jsx(f2,{children:d.jsxs(io,{children:[d.jsx(vr,{condition:V,children:d.jsx(tA,{message:N?"Searching...":"Loading..."})},"loading"),d.jsx(vr,{condition:f===""&&z.length>0,children:d.jsx(c2,{connectorName:a,checkedEntities:b,setCheckedEntities:p,entities:z??[]})},"entity-suggestions"),d.jsx(vr,{condition:!!f&&k,children:d.jsx(YT,{searchText:f,connectorName:a,options:s,onSearch:S})},"search-options"),d.jsx(vr,{condition:!!f&&!k,children:d.jsx(UT,{connectorName:a,results:J,...Y,addEntity:q})},"search-results"),d.jsx(vr,{condition:!z.length&&w,children:d.jsx(xl,{message:vn})},"error")]})})}),f?null:d.jsx(iA,{connectorName:a,connectorId:i,checkedEntities:b,close:t})]},"select-logs")]})})]})},jA=async({conversationId:e})=>{try{if(!e)throw new Error("Conversation ID is required to retry logs");const t=await xe({url:et(ST,{conversationId:e}),method:Fe.POST});return t==null?void 0:t.data}catch(t){throw Ie({message:vn,type:Ye}),console.error(t),t}},BA=({onSuccess:e})=>Zt({mutationFn:jA,onSuccess:e}),VA=u.styled(u.Stack)`
2936
+ `,vr=io.CaseView,jA=({emailLogStatus:e,close:t})=>{const{emailLogSettings:n,autoLogEnabled:r,selectedEntities:o,formList:s}=e,{connectorName:a,connectorId:i,logoUrl:c}=n??{},l=(o==null?void 0:o.length)>0,[f,g]=I.useState(""),[y,x]=I.useState([]),[b,p]=I.useState({}),{conversationId:h,connectorFunctions:m}=I.useContext(en),E=m==null?void 0:m.sendTrackingEvent,{data:C,isError:w,isLoading:v}=xA({conversationId:h,enabled:!l}),{refetch:_}=Ha({conversationId:h}),T=()=>{E==null||E(Mt.email_logging_search_results_found,{app_name:a,search_keyword:f})},{mutate:S,data:L,isPending:N,isIdle:k,reset:D}=vA({onSuccess:T}),{mutate:M,isPending:j}=IA({onSuccess:_}),{results:J=[],...Y}=L??{},z=I.useMemo(()=>{const R={},G=[];for(const W of y){const U=W.entityType+W.displayValue;R[U]||G.push(W),R[U]=W}for(const W of C??[]){const U=W.entityType+W.displayValue;R[U]||G.push(W),R[U]=W}return G},[C,y]),H=R=>{g(R.target.value),k||D()},q=R=>{const{entityType:G,displayValue:W}=R;p(U=>({...U,[G+W]:R})),x(U=>[R,...U]),g(""),D()},ne=()=>{E==null||E(Mt.email_logging_search_initiated,{app_name:a})},ce=()=>{M({payload:{autoLogEnabled:!r},conversationId:h});const R=r?Mt.email_logging_auto_log_disabled:Mt.email_logging_auto_log_enabled;E==null||E(R,{app_name:a})},V=v||N;return d.jsxs(_A,{children:[d.jsxs(SA,{children:[d.jsxs(TA,{children:[d.jsx(LA,{children:d.jsx(OA,{src:c,alt:"connector"})}),d.jsx(u.Typography,{children:"Sync conversation"})]}),d.jsxs(AA,{children:[j?d.jsx(PA,{}):null,l?d.jsx(u.Tooltip,{arrow:!0,title:r?VS:GS,children:d.jsx(u.Stack,{children:d.jsx(MA,{checked:r,value:r,onClick:ce,disabled:j})})}):null]})]}),d.jsx(FA,{children:d.jsxs(io,{children:[d.jsxs(vr,{condition:l,children:[d.jsx(d2,{children:d.jsx(f2,{children:d.jsx(c2,{connectorName:a,entities:o,disabled:!0})})}),d.jsx(yA,{})]},"disabled-view"),d.jsxs(vr,{fallback:!0,children:[d.jsx(kA,{children:d.jsx(DA,{type:"text",name:"search",value:f,onChange:H,onFocus:ne,startAdornment:d.jsx(NA,{children:d.jsx(Vp,{})}),size:"small"})}),d.jsx(d2,{children:d.jsx(f2,{children:d.jsxs(io,{children:[d.jsx(vr,{condition:V,children:d.jsx(nA,{message:N?"Searching...":"Loading..."})},"loading"),d.jsx(vr,{condition:f===""&&z.length>0,children:d.jsx(c2,{connectorName:a,checkedEntities:b,setCheckedEntities:p,entities:z??[]})},"entity-suggestions"),d.jsx(vr,{condition:!!f&&k,children:d.jsx(JT,{searchText:f,connectorName:a,options:s,onSearch:S})},"search-options"),d.jsx(vr,{condition:!!f&&!k,children:d.jsx(KT,{connectorName:a,results:J,...Y,addEntity:q})},"search-results"),d.jsx(vr,{condition:!z.length&&w,children:d.jsx(xl,{message:vn})},"error")]})})}),f?null:d.jsx(cA,{connectorName:a,connectorId:i,checkedEntities:b,close:t})]},"select-logs")]})})]})},BA=async({conversationId:e})=>{try{if(!e)throw new Error("Conversation ID is required to retry logs");const t=await xe({url:et(TT,{conversationId:e}),method:Fe.POST});return t==null?void 0:t.data}catch(t){throw Ie({message:vn,type:Ye}),console.error(t),t}},VA=({onSuccess:e})=>Zt({mutationFn:BA,onSuccess:e}),GA=u.styled(u.Stack)`
2927
2937
  border-radius: 100px;
2928
2938
  background: #f6f8fc;
2929
2939
  flex-flow: row nowrap;
@@ -2932,7 +2942,7 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
2932
2942
  padding: 8px;
2933
2943
  width: fit-content;
2934
2944
  cursor: pointer;
2935
- `,GA=u.styled(u.Button)`
2945
+ `,HA=u.styled(u.Button)`
2936
2946
  padding: 0;
2937
2947
  background: none;
2938
2948
  border: none;
@@ -2941,4 +2951,4 @@ Do you want to continue?`,cv="Select an object to create",lv="Select an object t
2941
2951
  line-height: 14px;
2942
2952
  color: #506dff;
2943
2953
  margin-left: 6px;
2944
- `,HA=[Se.PENDING,Se.LOGGED,Se.NOT_LOGGED,Se.PAUSED],WA=[Se.LOGGED,Se.PAUSED],ZA=({status:e,emailLogStatus:t})=>{const{isAdmin:n,conversationId:r,connectorFunctions:o}=I.useContext(en),s=o==null?void 0:o.sendTrackingEvent,{refetch:a}=Ha({conversationId:r}),{mutate:i,isPending:c}=BA({onSuccess:a}),l=kS[e],f=RS[e],g=NS[e],{emailLogSettings:y,messageLogStatus:x}=t,{connectorName:b}=y??{},{logged:p,total:h}=x??{},m=WA.includes(e)&&h?` (${p}/${h})`:"",E=e===Se.ERROR,C=HA.includes(e),w=({close:_})=>d.jsx(PA,{close:_,emailLogStatus:t}),v=()=>{i({conversationId:r}),s==null||s(Mt.email_logging_failed_clicked,{app_name:b})};return d.jsx(vT,{logSettings:y,status:e,isAdmin:n,retry:E,renderEntities:C?w:void 0,children:d.jsxs(VA,{style:{cursor:C?"pointer":"not-allowed"},children:[l,g?g(`${f} ${m}`):null,E?d.jsx(GA,{variant:"text",disabled:c,onClick:v,children:"Retry"}):null]})})},vl=({emailLogStatus:e,containerElement:t,messageId:n,legacyMessageId:r})=>{if(!t)return null;const o=_S(e);return je.createPortal(d.jsx(ZA,{status:o,emailLogStatus:e,messageId:n,legacyMessageId:r}),t)},XA=({observer:e})=>{var x;const[t,n]=I.useState({}),[r,o]=I.useState({}),[s,a]=I.useState({}),{conversationId:i}=I.useContext(en),{data:c}=Ha({conversationId:i}),l=(x=c==null?void 0:c.emailLogSettings)==null?void 0:x.enabled,f=b=>{n(p=>({...p,...b}))},g=b=>{o(p=>({...p,...b}))},y=b=>{a(b)};return I.useEffect(()=>{if(!(!e||!l))return e.observe({setEmailButtonContainers:f,setComposeButtonContainers:g,setSubjectButtonContainers:y}),()=>{e.destroy(),n({}),o({})}},[e,l]),c?d.jsxs(d.Fragment,{children:[Object.entries(t).map(([b,p])=>d.jsx(vl,{emailLogStatus:c,containerElement:p.element,messageId:p.messageId,legacyMessageId:p.legacyMessageId},b)),Object.entries(r).map(([b,p])=>d.jsx(vl,{emailLogStatus:c,containerElement:p.element},b)),Object.entries(s).map(([b,p])=>d.jsx(vl,{emailLogStatus:c,containerElement:p.element},b))]}):null},zA=({isAdmin:e,conversationId:t,connectorFunctions:n,children:r})=>{const o=I.useMemo(()=>({isAdmin:e,conversationId:t,connectorFunctions:n}),[e,t,n]);return d.jsx(en.Provider,{value:o,children:r})},YA=({children:e,...t})=>d.jsx(ac,{store:fl,children:d.jsx(u.HiverProvider,{inter:!0,children:d.jsx(dl,{children:d.jsx(I.Suspense,{fallback:d.jsx(d.Fragment,{}),children:d.jsx(zA,{...t,children:e})})})})}),Wa=".hiver-log-crm-button",Za=".hiver-log-crm-compose-button",p2=".hiver-log-crm-subject-button";class JA{constructor({emailNodeFilter:t,composeNodeFilter:n,emailHeaderTargetSelector:r=".gE.iv.gt .c2",composeHeaderTargetSelector:o=".aoD.hl .bgW",emailMessageContainerSelector:s=".adn.ads",subjectContainer:a=null,disableAutoLogInEmail:i=!1,disableAutoLogInCompose:c=!1,disableAutoLogInSubject:l=!1}={}){Re(this,"observer",null);Re(this,"setComposeButtonContainers",null);Re(this,"setEmailButtonContainers",null);Re(this,"setSubjectButtonContainers",null);Re(this,"emailNodeFilter");Re(this,"composeNodeFilter");Re(this,"emailHeaderTargetSelector");Re(this,"composeHeaderTargetSelector");Re(this,"emailMessageContainerSelector");Re(this,"disableAutoLogInEmail");Re(this,"disableAutoLogInCompose");Re(this,"disableAutoLogInSubject");Re(this,"subjectContainer",null);Re(this,"_addLogButtonsOnEmail",()=>{if(this.disableAutoLogInEmail)return;document.querySelectorAll(Wa).forEach(r=>r.remove());const n=document.querySelectorAll(this.emailMessageContainerSelector);n.length&&n.forEach(r=>{var c;const o=r.querySelector(this.emailHeaderTargetSelector),s=r.getAttribute("data-message-id")||null,a=r.getAttribute("data-legacy-message-id")||null;if(o!=null&&o.querySelector(Wa))return;const i=document.createElement("div");i.classList.add(Wa.slice(1)),i.style.display="inline-block",i.style.marginLeft="8px",o==null||o.appendChild(i),(c=this.setEmailButtonContainers)==null||c.call(this,{[s??""]:{element:i,messageId:s,legacyMessageId:a}})})});Re(this,"_addLogButtonsOnCompose",()=>{if(this.disableAutoLogInCompose)return;document.querySelectorAll(Za).forEach(r=>r.remove());const n=document.querySelectorAll(this.composeHeaderTargetSelector);n.length&&n.forEach((r,o)=>{var a;if(r.querySelector(Za))return;const s=document.createElement("div");s.classList.add(Za.slice(1)),s.style.display="inline-block",r.appendChild(s),(a=this.setComposeButtonContainers)==null||a.call(this,{["_compose_"+o]:{element:s}})})});Re(this,"_addLogButtonOnSubject",()=>{var r,o,s;if(this.disableAutoLogInSubject||!this.subjectContainer)return;const t=(r=this.subjectContainer)==null?void 0:r.querySelectorAll(p2);t==null||t.forEach(a=>a.remove());const n=document.createElement("div");n.classList.add(p2.slice(1)),n.style.display="inline-block",(o=this.subjectContainer)==null||o.appendChild(n),(s=this.setSubjectButtonContainers)==null||s.call(this,{crm_subject:{element:n}})});this.emailNodeFilter=t||this._defaultEmailNodeFilter,this.composeNodeFilter=n||this._defaultComposeNodeFilter,this.emailHeaderTargetSelector=r,this.composeHeaderTargetSelector=o,this.emailMessageContainerSelector=s,this.subjectContainer=a,this.disableAutoLogInEmail=i,this.disableAutoLogInCompose=c,this.disableAutoLogInSubject=l}_defaultEmailNodeFilter(t){var n,r;return!!(t.nodeType===1&&t instanceof Element&&((n=t.classList)!=null&&n.contains("a3s")||(r=t.classList)!=null&&r.contains("ii")||typeof t.querySelector=="function"&&t.querySelector(".a3s")))}_defaultComposeNodeFilter(t){var n,r;return!!(t.nodeType===1&&t instanceof Element&&((n=t.classList)!=null&&n.contains("hiver-new-email-top-div")||(r=t.classList)!=null&&r.contains("hiver-compose-bar")))}_initMutationObserver(){this.observer&&this.observer.disconnect(),this.observer=new MutationObserver(t=>{let n=!1,r=!1;t.forEach(o=>{if(o.type==="childList"){const s=Array.from(o.addedNodes);this.disableAutoLogInEmail||s.some(this.emailNodeFilter)&&(n=!0),this.disableAutoLogInCompose||s.some(this.composeNodeFilter)&&(r=!0)}}),n&&setTimeout(()=>this._addLogButtonsOnEmail(),100),r&&setTimeout(()=>this._addLogButtonsOnCompose(),100)}),this.observer.observe(document.body,{childList:!0,subtree:!0})}_init(){this._addLogButtonsOnEmail(),this._addLogButtonsOnCompose(),this._addLogButtonOnSubject()}observe({setComposeButtonContainers:t,setEmailButtonContainers:n,setSubjectButtonContainers:r}){this.setComposeButtonContainers=t,this.setEmailButtonContainers=n,this.setSubjectButtonContainers=r,this._init(),(!this.disableAutoLogInEmail||!this.disableAutoLogInCompose)&&this._initMutationObserver()}destroy(){document.querySelectorAll(Wa).forEach(r=>r.remove()),document.querySelectorAll(Za).forEach(r=>r.remove()),this.observer&&(this.observer.disconnect(),this.observer=null)}}const qA=({observer:e,...t})=>d.jsx(pl,{children:d.jsxs(YA,{...t,children:[d.jsx(XA,{observer:e}),je.createPortal(d.jsx(hl,{id:"toast-message",children:d.jsx(Ua,{position:"bottom-left",autoClose:5e3,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,draggable:!0,pauseOnHover:!0})}),document.body)]})}),QA=e=>xe({url:DE,method:Fe.POST,data:e});de.ActionQueue=wS,de.CONNECTORS_AGENT_EVENTS=ul,de.ConnectorCardList=D_,de.EmailLogger=qA,de.GmailLogObserver=JA,de.HiverConnectorBifrostAuth=xe,de.IntegrationSense=ES,de.addNewConnectors=jh,de.dismissNotification=Cu,de.fetchAppCfValues=QA,de.getConnectorsBifrostConfigs=qt,de.getMetaData=s6,de.initConnectorsBifrost=u3,de.setCaptureFeedbackOnDemand=Bh,de.shouldCaptureFeedback=xi,de.shouldShowNotification=yu,de.useConnectorSelectedEmail=f_,Object.defineProperty(de,Symbol.toStringTag,{value:"Module"})});
2954
+ `,WA=[Se.PENDING,Se.LOGGED,Se.NOT_LOGGED,Se.PAUSED],ZA=[Se.LOGGED,Se.PAUSED],XA=({status:e,emailLogStatus:t})=>{const{isAdmin:n,conversationId:r,connectorFunctions:o}=I.useContext(en),s=o==null?void 0:o.sendTrackingEvent,{refetch:a}=Ha({conversationId:r}),{mutate:i,isPending:c}=VA({onSuccess:a}),l=DS[e],f=MS[e],g=RS[e],{emailLogSettings:y,messageLogStatus:x}=t,{connectorName:b}=y??{},{logged:p,total:h}=x??{},m=ZA.includes(e)&&h?` (${p}/${h})`:"",E=e===Se.ERROR,C=WA.includes(e),w=({close:_})=>d.jsx(jA,{close:_,emailLogStatus:t}),v=()=>{i({conversationId:r}),s==null||s(Mt.email_logging_failed_clicked,{app_name:b})};return d.jsx(wT,{logSettings:y,status:e,isAdmin:n,retry:E,renderEntities:C?w:void 0,children:d.jsxs(GA,{style:{cursor:C?"pointer":"not-allowed"},children:[l,g?g(`${f} ${m}`):null,E?d.jsx(HA,{variant:"text",disabled:c,onClick:v,children:"Retry"}):null]})})},vl=({emailLogStatus:e,containerElement:t,messageId:n,legacyMessageId:r})=>{if(!t)return null;const o=SS(e);return je.createPortal(d.jsx(XA,{status:o,emailLogStatus:e,messageId:n,legacyMessageId:r}),t)},zA=({observer:e})=>{var x;const[t,n]=I.useState({}),[r,o]=I.useState({}),[s,a]=I.useState({}),{conversationId:i}=I.useContext(en),{data:c}=Ha({conversationId:i}),l=(x=c==null?void 0:c.emailLogSettings)==null?void 0:x.enabled,f=b=>{n(p=>({...p,...b}))},g=b=>{o(p=>({...p,...b}))},y=b=>{a(b)};return I.useEffect(()=>{if(!(!e||!l))return e.observe({setEmailButtonContainers:f,setComposeButtonContainers:g,setSubjectButtonContainers:y}),()=>{e.destroy(),n({}),o({})}},[e,l]),c?d.jsxs(d.Fragment,{children:[Object.entries(t).map(([b,p])=>d.jsx(vl,{emailLogStatus:c,containerElement:p.element,messageId:p.messageId,legacyMessageId:p.legacyMessageId},b)),Object.entries(r).map(([b,p])=>d.jsx(vl,{emailLogStatus:c,containerElement:p.element},b)),Object.entries(s).map(([b,p])=>d.jsx(vl,{emailLogStatus:c,containerElement:p.element},b))]}):null},YA=({isAdmin:e,conversationId:t,connectorFunctions:n,children:r})=>{const o=I.useMemo(()=>({isAdmin:e,conversationId:t,connectorFunctions:n}),[e,t,n]);return d.jsx(en.Provider,{value:o,children:r})},JA=({children:e,...t})=>d.jsx(ac,{store:fl,children:d.jsx(u.HiverProvider,{inter:!0,children:d.jsx(dl,{children:d.jsx(I.Suspense,{fallback:d.jsx(d.Fragment,{}),children:d.jsx(YA,{...t,children:e})})})})}),Wa=".hiver-log-crm-button",Za=".hiver-log-crm-compose-button",p2=".hiver-log-crm-subject-button";class qA{constructor({emailNodeFilter:t,composeNodeFilter:n,emailHeaderTargetSelector:r=".gE.iv.gt .c2",composeHeaderTargetSelector:o=".aoD.hl .bgW",emailMessageContainerSelector:s=".adn.ads",subjectContainer:a=null,disableAutoLogInEmail:i=!1,disableAutoLogInCompose:c=!1,disableAutoLogInSubject:l=!1}={}){Re(this,"observer",null);Re(this,"setComposeButtonContainers",null);Re(this,"setEmailButtonContainers",null);Re(this,"setSubjectButtonContainers",null);Re(this,"emailNodeFilter");Re(this,"composeNodeFilter");Re(this,"emailHeaderTargetSelector");Re(this,"composeHeaderTargetSelector");Re(this,"emailMessageContainerSelector");Re(this,"disableAutoLogInEmail");Re(this,"disableAutoLogInCompose");Re(this,"disableAutoLogInSubject");Re(this,"subjectContainer",null);Re(this,"_addLogButtonsOnEmail",()=>{if(this.disableAutoLogInEmail)return;document.querySelectorAll(Wa).forEach(r=>r.remove());const n=document.querySelectorAll(this.emailMessageContainerSelector);n.length&&n.forEach(r=>{var c;const o=r.querySelector(this.emailHeaderTargetSelector),s=r.getAttribute("data-message-id")||null,a=r.getAttribute("data-legacy-message-id")||null;if(o!=null&&o.querySelector(Wa))return;const i=document.createElement("div");i.classList.add(Wa.slice(1)),i.style.display="inline-block",i.style.marginLeft="8px",o==null||o.appendChild(i),(c=this.setEmailButtonContainers)==null||c.call(this,{[s??""]:{element:i,messageId:s,legacyMessageId:a}})})});Re(this,"_addLogButtonsOnCompose",()=>{if(this.disableAutoLogInCompose)return;document.querySelectorAll(Za).forEach(r=>r.remove());const n=document.querySelectorAll(this.composeHeaderTargetSelector);n.length&&n.forEach((r,o)=>{var a;if(r.querySelector(Za))return;const s=document.createElement("div");s.classList.add(Za.slice(1)),s.style.display="inline-block",r.appendChild(s),(a=this.setComposeButtonContainers)==null||a.call(this,{["_compose_"+o]:{element:s}})})});Re(this,"_addLogButtonOnSubject",()=>{var r,o,s;if(this.disableAutoLogInSubject||!this.subjectContainer)return;const t=(r=this.subjectContainer)==null?void 0:r.querySelectorAll(p2);t==null||t.forEach(a=>a.remove());const n=document.createElement("div");n.classList.add(p2.slice(1)),n.style.display="inline-block",(o=this.subjectContainer)==null||o.appendChild(n),(s=this.setSubjectButtonContainers)==null||s.call(this,{crm_subject:{element:n}})});this.emailNodeFilter=t||this._defaultEmailNodeFilter,this.composeNodeFilter=n||this._defaultComposeNodeFilter,this.emailHeaderTargetSelector=r,this.composeHeaderTargetSelector=o,this.emailMessageContainerSelector=s,this.subjectContainer=a,this.disableAutoLogInEmail=i,this.disableAutoLogInCompose=c,this.disableAutoLogInSubject=l}_defaultEmailNodeFilter(t){var n,r;return!!(t.nodeType===1&&t instanceof Element&&((n=t.classList)!=null&&n.contains("a3s")||(r=t.classList)!=null&&r.contains("ii")||typeof t.querySelector=="function"&&t.querySelector(".a3s")))}_defaultComposeNodeFilter(t){var n,r;return!!(t.nodeType===1&&t instanceof Element&&((n=t.classList)!=null&&n.contains("hiver-new-email-top-div")||(r=t.classList)!=null&&r.contains("hiver-compose-bar")))}_initMutationObserver(){this.observer&&this.observer.disconnect(),this.observer=new MutationObserver(t=>{let n=!1,r=!1;t.forEach(o=>{if(o.type==="childList"){const s=Array.from(o.addedNodes);this.disableAutoLogInEmail||s.some(this.emailNodeFilter)&&(n=!0),this.disableAutoLogInCompose||s.some(this.composeNodeFilter)&&(r=!0)}}),n&&setTimeout(()=>this._addLogButtonsOnEmail(),100),r&&setTimeout(()=>this._addLogButtonsOnCompose(),100)}),this.observer.observe(document.body,{childList:!0,subtree:!0})}_init(){this._addLogButtonsOnEmail(),this._addLogButtonsOnCompose(),this._addLogButtonOnSubject()}observe({setComposeButtonContainers:t,setEmailButtonContainers:n,setSubjectButtonContainers:r}){this.setComposeButtonContainers=t,this.setEmailButtonContainers=n,this.setSubjectButtonContainers=r,this._init(),(!this.disableAutoLogInEmail||!this.disableAutoLogInCompose)&&this._initMutationObserver()}destroy(){document.querySelectorAll(Wa).forEach(r=>r.remove()),document.querySelectorAll(Za).forEach(r=>r.remove()),this.observer&&(this.observer.disconnect(),this.observer=null)}}const QA=({observer:e,...t})=>d.jsx(pl,{children:d.jsxs(JA,{...t,children:[d.jsx(zA,{observer:e}),je.createPortal(d.jsx(hl,{id:"toast-message",children:d.jsx(Ua,{position:"bottom-left",autoClose:5e3,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,draggable:!0,pauseOnHover:!0})}),document.body)]})}),$A=e=>xe({url:NE,method:Fe.POST,data:e});de.ActionQueue=IS,de.CONNECTORS_AGENT_EVENTS=ul,de.ConnectorCardList=N_,de.EmailLogger=QA,de.GmailLogObserver=qA,de.HiverConnectorBifrostAuth=xe,de.IntegrationSense=vS,de.addNewConnectors=jh,de.dismissNotification=Cu,de.fetchAppCfValues=$A,de.getConnectorsBifrostConfigs=qt,de.getMetaData=s6,de.initConnectorsBifrost=u3,de.setCaptureFeedbackOnDemand=Bh,de.shouldCaptureFeedback=xi,de.shouldShowNotification=yu,de.useConnectorSelectedEmail=p_,Object.defineProperty(de,Symbol.toStringTag,{value:"Module"})});