@hiver/connector-agent 1.3.4-beta.24 → 1.3.4-beta.25

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.
@@ -1,6 +1,6 @@
1
1
  import { CreateObjectMetaData } from '../../../../types/cards';
2
2
  interface WriteFormProps {
3
- onClose: () => void;
3
+ onClose: (showModal: boolean) => void;
4
4
  onCreateSuccess: () => void;
5
5
  setMetaData: React.Dispatch<React.SetStateAction<CreateObjectMetaData>>;
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/write-form/components/write-form/index.tsx"],"names":[],"mappings":"AAiCA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAGrD,UAAU,cAAc;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC,CAAC;CACzE;AACD,QAAA,MAAM,SAAS,8CAA+C,cAAc,4CA6S3E,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/write-form/components/write-form/index.tsx"],"names":[],"mappings":"AAiCA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAGrD,UAAU,cAAc;IACtB,OAAO,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC,CAAC;CACzE;AACD,QAAA,MAAM,SAAS,8CAA+C,cAAc,4CA6S3E,CAAC;AAEF,eAAe,SAAS,CAAC"}
package/index.es.js CHANGED
@@ -40225,7 +40225,7 @@ const ul = (e) => {
40225
40225
  }, F = (R, U) => {
40226
40226
  c == null || c(R, U), R && !d && E(!0), R && typeof R == "object" && "value" in R && d && A && I(R.value);
40227
40227
  }, O = (R, U) => {
40228
- u == null || u(i, R, U), console.log("Date Changed+++++", { isVisited: d, validateOnChange: A, value: R }), R && !d && E(!0), d && A && I(R);
40228
+ u == null || u(i, R, U), R && !d && E(!0), d && A && I(R);
40229
40229
  }, S = (R) => {
40230
40230
  switch (R.type) {
40231
40231
  case "select":
@@ -40713,7 +40713,7 @@ const ul = (e) => {
40713
40713
  args: W,
40714
40714
  interfaceId: L,
40715
40715
  successCallback: () => {
40716
- e(), t();
40716
+ e(!1), t();
40717
40717
  }
40718
40718
  })
40719
40719
  ).unwrap().then(() => {
@@ -40782,7 +40782,7 @@ const ul = (e) => {
40782
40782
  {
40783
40783
  variant: "outlined",
40784
40784
  color: "tertiary",
40785
- onClick: e,
40785
+ onClick: () => e(!0),
40786
40786
  disabled: f === Le.LOADING,
40787
40787
  children: Dg
40788
40788
  }
@@ -40842,8 +40842,8 @@ const ul = (e) => {
40842
40842
  l(!0), o(UN);
40843
40843
  }, S = () => {
40844
40844
  u(!0), o(NN);
40845
- }, R = (P) => {
40846
- o(P, g), (g == null ? void 0 : g.fields_filled) !== void 0 && g.fields_filled > 0 ? f(!0) : l(!1);
40845
+ }, R = (P, L) => {
40846
+ o(P, g), (g == null ? void 0 : g.fields_filled) !== void 0 && g.fields_filled > 0 && L ? f(!0) : l(!1);
40847
40847
  }, M = [
40848
40848
  {
40849
40849
  label: "Go back",
@@ -40912,13 +40912,13 @@ const ul = (e) => {
40912
40912
  /* @__PURE__ */ v.jsx(
40913
40913
  pp,
40914
40914
  {
40915
- onClose: () => R(YN),
40915
+ onClose: () => R(YN, !0),
40916
40916
  containerRef: x,
40917
40917
  isOpen: A,
40918
40918
  children: /* @__PURE__ */ v.jsx(
40919
40919
  Hz,
40920
40920
  {
40921
- onClose: () => R(zN),
40921
+ onClose: (P) => R(zN, P),
40922
40922
  onCreateSuccess: F,
40923
40923
  setMetaData: C
40924
40924
  }
package/index.umd.js CHANGED
@@ -2555,7 +2555,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2555
2555
  position: absolute;
2556
2556
  margin-left: 5px;
2557
2557
  }
2558
- `;var Bz=["defaultOptions","cacheOptions","loadOptions","options","isLoading","onInputChange","filterOption"];function hz(e){var t=e.defaultOptions,n=t===void 0?!1:t,o=e.cacheOptions,r=o===void 0?!1:o,i=e.loadOptions;e.options;var a=e.isLoading,A=a===void 0?!1:a,l=e.onInputChange,c=e.filterOption,u=c===void 0?null:c,g=po(e,Bz),C=g.inputValue,B=w.useRef(void 0),f=w.useRef(!1),p=w.useState(Array.isArray(n)?n:void 0),d=Gt(p,2),E=d[0],m=d[1],h=w.useState(typeof C<"u"?C:""),b=Gt(h,2),I=b[0],Q=b[1],y=w.useState(n===!0),T=Gt(y,2),k=T[0],S=T[1],O=w.useState(void 0),D=Gt(O,2),U=D[0],M=D[1],R=w.useState([]),L=Gt(R,2),H=L[0],W=L[1],Z=w.useState(!1),P=Gt(Z,2),z=P[0],Y=P[1],G=w.useState({}),K=Gt(G,2),_=K[0],ee=K[1],X=w.useState(void 0),q=Gt(X,2),ne=q[0],Ae=q[1],se=w.useState(void 0),j=Gt(se,2),te=j[0],$=j[1];r!==te&&(ee({}),$(r)),n!==ne&&(m(Array.isArray(n)?n:void 0),Ae(n)),w.useEffect(function(){return f.current=!0,function(){f.current=!1}},[]);var le=w.useCallback(function(xe,Ie){if(!i)return Ie();var be=i(xe,Ie);be&&typeof be.then=="function"&&be.then(Ie,function(){return Ie()})},[i]);w.useEffect(function(){n===!0&&le(I,function(xe){f.current&&(m(xe||[]),S(!!B.current))})},[]);var me=w.useCallback(function(xe,Ie){var be=XV(xe,Ie,l);if(!be){B.current=void 0,Q(""),M(""),W([]),S(!1),Y(!1);return}if(r&&_[be])Q(be),M(be),W(_[be]),S(!1),Y(!1);else{var Be=B.current={};Q(be),S(!0),Y(!U),le(be,function(De){f&&Be===B.current&&(B.current=void 0,S(!1),M(be),W(De||[]),Y(!1),ee(De?Qe(Qe({},_),{},Yi({},be,De)):_))})}},[r,le,U,_,l]),Se=z?[]:I&&U?H:E||[];return Qe(Qe({},g),{},{options:Se,isLoading:k||A,onInputChange:me,filterOption:u})}var mz=w.forwardRef(function(e,t){var n=hz(e),o=KB(n);return x.createElement(Hg,ke({ref:t},o))}),Qz=mz;function bz(e){return v.jsx(Ia.DropdownIndicator,{...e,children:v.jsx(SA,{children:e.selectProps.menuIsOpen?v.jsx(qo.ArrowDropUp,{}):v.jsx(qo.ArrowDropDown,{})})})}function vz(e){const[t,n]=w.useState([]),[o,r]=w.useState(""),[i,a]=w.useState(!1),{loadOptions:A,isApiSearchEnabled:l=!1,isInfiniteScrollable:c=!1,loadOptionsOnFocus:u=!1}=e,g=(E,m)=>{if(r(E),t.length>0&&!l){const b=t.filter(I=>I&&typeof I=="object"&&"label"in I&&typeof I.label=="string"?I.label.toLowerCase().includes(E.toLowerCase()):!1);m(b);return}const h=b=>{m(b),n(b)};A==null||A(E,h,!1)},C=(E,m)=>{a(!1),!(m&&"isError"in m&&m.isError)&&n(E)},B=E=>{var m;(m=e.onMenuScrollToBottom)==null||m.call(e,E),c&&A&&!i&&(a(!0),A(o,C,!0))},f=(E,m)=>{var h;(h=e.onInputChange)==null||h.call(e,E,m),m.action==="input-change"&&l&&(r(E),n([]))},p=E=>{var m;r(""),(m=e.onBlur)==null||m.call(e,E)},d=E=>{var m;(m=e.onFocus)==null||m.call(e,E),!i&&u&&(n([]),a(!0),A==null||A(o,C,!1))};return v.jsx(Qz,{...e,value:e.value?e.value:null,isDisabled:e.disabled,loadOptions:g,onMenuScrollToBottom:B,onInputChange:f,onBlur:p,onFocus:d,isLoading:i,defaultOptions:t.length?t:e.defaultOptions||!1,components:{ClearIndicator:zh,DropdownIndicator:bz,IndicatorSeparator:()=>null,Option:Wh}})}function yz(e){const[t,n]=w.useState(!1),o=w.useRef(null);w.useEffect(()=>{t&&o.current&&o.current.focus()},[t]);const r=(i,a)=>{i===null&&e.onChange(i,a),i&&typeof i.getTime=="function"&&!isNaN(i.getTime())&&e.onChange(i,a),e.onChange(i,a)};return v.jsx(XE,{inputFormat:e.inputFormat?e.inputFormat:Gh.DATE,...e,value:e.value||null,open:t,onOpen:()=>n(!0),onClose:()=>n(!1),onChange:r,PopperProps:{anchorEl:o.current},renderInput:i=>v.jsx(ZE,{...i,fullWidth:!0,variant:"outlined",disabled:e.disabled,inputRef:o,inputProps:{...i.inputProps,placeholder:e.placeholder},onBlur:e.onBlur,onFocus:e.onFocus,InputProps:{endAdornment:v.jsx(Fu,{position:"end",sx:{backgroundColor:"#FFFFFF"},children:v.jsx(qo.CalendarTodayOutlinedIcon,{})})},sx:{"& .MuiOutlinedInput-root":{backgroundColor:"#FFFFFF"}},onClick:()=>{t||n(!0)}})})}const oc=e=>{const{validation:t,helperText:n,id:o,label:r,name:i,validateOnBlur:a=!0,validateOnChange:A=!0,inputChangeHandler:l,selectChangeHandler:c,dateChangeHandler:u,onValidationError:g,iconData:C,isRequired:B,labelSpacing:f=1,loadOptions:p}=e,[d,E]=w.useState(!1),[m,h]=w.useState("");w.useEffect(()=>{d||I(e.value,!1)},[d,e.value]);const b=D=>{D&&!d&&E(!0)};function I(D,U=!0,M){let R="";if((t!=null&&t.isRequired||B)&&(R=D?"":Yh,!D&&typeof(t==null?void 0:t.isRequired)=="function")){const H=t.isRequired(D);H&&typeof H=="boolean"?R=Yh:H&&(R=H)}let L={id:o,name:i,label:r};if(e.type==="date"?L={...L,disableFuture:e.disableFuture,disablePast:e.disablePast}:e.type==="number"?L={...L,min:e.min,max:e.max}:e.type==="text"&&e.multiline&&(L={...L,maxCharacters:e.maxCharacters}),D&&!R&&(t!=null&&t.validate)){const H=t.validate(D,{...L,...M});typeof H=="boolean"&&H===!1?R=Cz:typeof H=="string"&&(R=H)}U&&h(R),g==null||g(i,R)}const Q=D=>{var U;d||E(!0),(U=e.onBlur)==null||U.call(e,D),d&&a&&I(e.value)},y=()=>e.helperText?v.jsx(Kh,{children:n}):d&&m?v.jsx(Kh,{className:"helper--error",children:m}):null,T=D=>{D&&!d&&E(!0),l==null||l(D),d&&A&&I(D.target.value)},k=(D,U)=>{c==null||c(D,U),D&&!d&&E(!0),D&&typeof D=="object"&&"value"in D&&d&&A&&I(D.value)},S=(D,U)=>{u==null||u(i,D,U),console.log("Date Changed+++++",{isVisited:d,validateOnChange:A,value:D}),D&&!d&&E(!0),d&&A&&I(D)},O=D=>{switch(D.type){case"select":return v.jsx(Xh,{children:v.jsx(pz,{...D,className:`formField__select ${m&&d?"formField__select--error":""} ${D.className||""}`,classNamePrefix:"hiverFormField",onBlur:Q,onChange:k,onFocus:b})});case"async-select":return v.jsx(Xh,{children:v.jsx(vz,{...D,className:`formField__select ${m&&d?"formField__select--error":""} ${D.className||""}`,classNamePrefix:"hiverFormField",onBlur:Q,onChange:k,onFocus:b,loadOptions:p})});case"date":return v.jsx(yz,{...D,label:void 0,onBlur:Q,onFocus:b,onChange:S,error:!!(m&&d)});default:return v.jsx(Ez,{id:o,...D,label:void 0,onBlur:Q,onChange:T,onFocus:b,error:!!(m&&d),inputProps:{type:D.type,min:D.min,max:D.max,...D.inputProps}})}};return v.jsxs(ze,{spacing:f,useFlexGap:!0,children:[r?v.jsxs(Ke,{variant:"h4",component:"label",htmlFor:o,color:Ge.palette.gray.gray1,className:"hiver__field--label",children:[r,t!=null&&t.isRequired||B?v.jsx("span",{className:"required__star",children:"*"}):null]}):null,v.jsxs(Iz,{children:[v.jsx(Zt,{title:e.toolTipTitle,arrow:!0,placement:"right-end",disableHoverListener:!0,children:O(e)}),C!=null&&C.icon?v.jsx(Zt,{title:C.toolTipText,placement:"bottom",children:v.jsx(sn,{className:"form--sideIcon",children:C==null?void 0:C.icon})}):null,y()]})]})},wz=V(ze)`
2558
+ `;var Bz=["defaultOptions","cacheOptions","loadOptions","options","isLoading","onInputChange","filterOption"];function hz(e){var t=e.defaultOptions,n=t===void 0?!1:t,o=e.cacheOptions,r=o===void 0?!1:o,i=e.loadOptions;e.options;var a=e.isLoading,A=a===void 0?!1:a,l=e.onInputChange,c=e.filterOption,u=c===void 0?null:c,g=po(e,Bz),C=g.inputValue,B=w.useRef(void 0),f=w.useRef(!1),p=w.useState(Array.isArray(n)?n:void 0),d=Gt(p,2),E=d[0],m=d[1],h=w.useState(typeof C<"u"?C:""),b=Gt(h,2),I=b[0],Q=b[1],y=w.useState(n===!0),T=Gt(y,2),k=T[0],S=T[1],O=w.useState(void 0),D=Gt(O,2),U=D[0],M=D[1],R=w.useState([]),L=Gt(R,2),H=L[0],W=L[1],Z=w.useState(!1),P=Gt(Z,2),z=P[0],Y=P[1],G=w.useState({}),K=Gt(G,2),_=K[0],ee=K[1],X=w.useState(void 0),q=Gt(X,2),ne=q[0],Ae=q[1],se=w.useState(void 0),j=Gt(se,2),te=j[0],$=j[1];r!==te&&(ee({}),$(r)),n!==ne&&(m(Array.isArray(n)?n:void 0),Ae(n)),w.useEffect(function(){return f.current=!0,function(){f.current=!1}},[]);var le=w.useCallback(function(xe,Ie){if(!i)return Ie();var be=i(xe,Ie);be&&typeof be.then=="function"&&be.then(Ie,function(){return Ie()})},[i]);w.useEffect(function(){n===!0&&le(I,function(xe){f.current&&(m(xe||[]),S(!!B.current))})},[]);var me=w.useCallback(function(xe,Ie){var be=XV(xe,Ie,l);if(!be){B.current=void 0,Q(""),M(""),W([]),S(!1),Y(!1);return}if(r&&_[be])Q(be),M(be),W(_[be]),S(!1),Y(!1);else{var Be=B.current={};Q(be),S(!0),Y(!U),le(be,function(De){f&&Be===B.current&&(B.current=void 0,S(!1),M(be),W(De||[]),Y(!1),ee(De?Qe(Qe({},_),{},Yi({},be,De)):_))})}},[r,le,U,_,l]),Se=z?[]:I&&U?H:E||[];return Qe(Qe({},g),{},{options:Se,isLoading:k||A,onInputChange:me,filterOption:u})}var mz=w.forwardRef(function(e,t){var n=hz(e),o=KB(n);return x.createElement(Hg,ke({ref:t},o))}),Qz=mz;function bz(e){return v.jsx(Ia.DropdownIndicator,{...e,children:v.jsx(SA,{children:e.selectProps.menuIsOpen?v.jsx(qo.ArrowDropUp,{}):v.jsx(qo.ArrowDropDown,{})})})}function vz(e){const[t,n]=w.useState([]),[o,r]=w.useState(""),[i,a]=w.useState(!1),{loadOptions:A,isApiSearchEnabled:l=!1,isInfiniteScrollable:c=!1,loadOptionsOnFocus:u=!1}=e,g=(E,m)=>{if(r(E),t.length>0&&!l){const b=t.filter(I=>I&&typeof I=="object"&&"label"in I&&typeof I.label=="string"?I.label.toLowerCase().includes(E.toLowerCase()):!1);m(b);return}const h=b=>{m(b),n(b)};A==null||A(E,h,!1)},C=(E,m)=>{a(!1),!(m&&"isError"in m&&m.isError)&&n(E)},B=E=>{var m;(m=e.onMenuScrollToBottom)==null||m.call(e,E),c&&A&&!i&&(a(!0),A(o,C,!0))},f=(E,m)=>{var h;(h=e.onInputChange)==null||h.call(e,E,m),m.action==="input-change"&&l&&(r(E),n([]))},p=E=>{var m;r(""),(m=e.onBlur)==null||m.call(e,E)},d=E=>{var m;(m=e.onFocus)==null||m.call(e,E),!i&&u&&(n([]),a(!0),A==null||A(o,C,!1))};return v.jsx(Qz,{...e,value:e.value?e.value:null,isDisabled:e.disabled,loadOptions:g,onMenuScrollToBottom:B,onInputChange:f,onBlur:p,onFocus:d,isLoading:i,defaultOptions:t.length?t:e.defaultOptions||!1,components:{ClearIndicator:zh,DropdownIndicator:bz,IndicatorSeparator:()=>null,Option:Wh}})}function yz(e){const[t,n]=w.useState(!1),o=w.useRef(null);w.useEffect(()=>{t&&o.current&&o.current.focus()},[t]);const r=(i,a)=>{i===null&&e.onChange(i,a),i&&typeof i.getTime=="function"&&!isNaN(i.getTime())&&e.onChange(i,a),e.onChange(i,a)};return v.jsx(XE,{inputFormat:e.inputFormat?e.inputFormat:Gh.DATE,...e,value:e.value||null,open:t,onOpen:()=>n(!0),onClose:()=>n(!1),onChange:r,PopperProps:{anchorEl:o.current},renderInput:i=>v.jsx(ZE,{...i,fullWidth:!0,variant:"outlined",disabled:e.disabled,inputRef:o,inputProps:{...i.inputProps,placeholder:e.placeholder},onBlur:e.onBlur,onFocus:e.onFocus,InputProps:{endAdornment:v.jsx(Fu,{position:"end",sx:{backgroundColor:"#FFFFFF"},children:v.jsx(qo.CalendarTodayOutlinedIcon,{})})},sx:{"& .MuiOutlinedInput-root":{backgroundColor:"#FFFFFF"}},onClick:()=>{t||n(!0)}})})}const oc=e=>{const{validation:t,helperText:n,id:o,label:r,name:i,validateOnBlur:a=!0,validateOnChange:A=!0,inputChangeHandler:l,selectChangeHandler:c,dateChangeHandler:u,onValidationError:g,iconData:C,isRequired:B,labelSpacing:f=1,loadOptions:p}=e,[d,E]=w.useState(!1),[m,h]=w.useState("");w.useEffect(()=>{d||I(e.value,!1)},[d,e.value]);const b=D=>{D&&!d&&E(!0)};function I(D,U=!0,M){let R="";if((t!=null&&t.isRequired||B)&&(R=D?"":Yh,!D&&typeof(t==null?void 0:t.isRequired)=="function")){const H=t.isRequired(D);H&&typeof H=="boolean"?R=Yh:H&&(R=H)}let L={id:o,name:i,label:r};if(e.type==="date"?L={...L,disableFuture:e.disableFuture,disablePast:e.disablePast}:e.type==="number"?L={...L,min:e.min,max:e.max}:e.type==="text"&&e.multiline&&(L={...L,maxCharacters:e.maxCharacters}),D&&!R&&(t!=null&&t.validate)){const H=t.validate(D,{...L,...M});typeof H=="boolean"&&H===!1?R=Cz:typeof H=="string"&&(R=H)}U&&h(R),g==null||g(i,R)}const Q=D=>{var U;d||E(!0),(U=e.onBlur)==null||U.call(e,D),d&&a&&I(e.value)},y=()=>e.helperText?v.jsx(Kh,{children:n}):d&&m?v.jsx(Kh,{className:"helper--error",children:m}):null,T=D=>{D&&!d&&E(!0),l==null||l(D),d&&A&&I(D.target.value)},k=(D,U)=>{c==null||c(D,U),D&&!d&&E(!0),D&&typeof D=="object"&&"value"in D&&d&&A&&I(D.value)},S=(D,U)=>{u==null||u(i,D,U),D&&!d&&E(!0),d&&A&&I(D)},O=D=>{switch(D.type){case"select":return v.jsx(Xh,{children:v.jsx(pz,{...D,className:`formField__select ${m&&d?"formField__select--error":""} ${D.className||""}`,classNamePrefix:"hiverFormField",onBlur:Q,onChange:k,onFocus:b})});case"async-select":return v.jsx(Xh,{children:v.jsx(vz,{...D,className:`formField__select ${m&&d?"formField__select--error":""} ${D.className||""}`,classNamePrefix:"hiverFormField",onBlur:Q,onChange:k,onFocus:b,loadOptions:p})});case"date":return v.jsx(yz,{...D,label:void 0,onBlur:Q,onFocus:b,onChange:S,error:!!(m&&d)});default:return v.jsx(Ez,{id:o,...D,label:void 0,onBlur:Q,onChange:T,onFocus:b,error:!!(m&&d),inputProps:{type:D.type,min:D.min,max:D.max,...D.inputProps}})}};return v.jsxs(ze,{spacing:f,useFlexGap:!0,children:[r?v.jsxs(Ke,{variant:"h4",component:"label",htmlFor:o,color:Ge.palette.gray.gray1,className:"hiver__field--label",children:[r,t!=null&&t.isRequired||B?v.jsx("span",{className:"required__star",children:"*"}):null]}):null,v.jsxs(Iz,{children:[v.jsx(Zt,{title:e.toolTipTitle,arrow:!0,placement:"right-end",disableHoverListener:!0,children:O(e)}),C!=null&&C.icon?v.jsx(Zt,{title:C.toolTipText,placement:"bottom",children:v.jsx(sn,{className:"form--sideIcon",children:C==null?void 0:C.icon})}):null,y()]})]})},wz=V(ze)`
2559
2559
  & .authform__section-title {
2560
2560
  margin-top: 32px;
2561
2561
  margin-bottom: -12px;
@@ -2620,7 +2620,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2620
2620
  border: 1px solid ${Ge.palette.purple.primary} !important;
2621
2621
  }
2622
2622
  margin-left: 12px;
2623
- `,Oz=({setOpenTaskLinking:e,onLinkingSuccess:t})=>{const n=Di(),o=Jt(jj),r=Jt(Vj),i=Jt(Hj),a=Jt(VB),[A,l]=w.useState(!1),[c,u]=w.useState(null),[g,C]=w.useState(""),[B,f]=w.useState({}),{conversationId:p,sendTrackingEvent:d}=w.useContext(ir);w.useEffect(()=>{a&&a.length&&u(a[0])},[a]);const E={externalResourceId:g},m=r===Re.LOADING,h=i===Re.LOADING,b=()=>{!A&&c&&"value"in c&&(d(PN,{object_type:c.label}),n(Ea({id:String(c==null?void 0:c.value),args:E})).unwrap().catch(()=>{no({message:qN,type:Ca})})),l(O=>!O)},I=()=>{c&&"value"in c&&p&&n(Hl({id:String(c.value),externalResourceId:g,conversationId:p})).unwrap().then(()=>{d(MN,{object_type:c.label,input_type:g}),no({message:$N,type:Hi}),e(!1),t()}).catch(()=>{no({message:ej,type:Ca})})},Q=()=>{e(!1),l(!1)},y=(O,D)=>{O&&typeof O=="object"&&"label"in O&&typeof O.label=="string"&&"value"in O&&(typeof O.value=="string"||typeof O.value=="number")&&typeof D.name<"u"&&(u({value:O.value,label:O.label}),C(""))},T=O=>{O.stopPropagation();const{value:D}=(O==null?void 0:O.target)||{};C(D),l(!1)},k=(O,D)=>{f(U=>({...U,[O]:!!D}))},S=()=>Object.keys(B).filter(D=>B[D]).length>0;return v.jsxs(_h,{children:[v.jsxs(Jh,{spacing:3,children:[v.jsx(oc,{type:"select",placeholder:LB,options:a,value:c,name:"form-object",selectChangeHandler:y,label:hj,labelSpacing:.5,validation:{isRequired:!0},onValidationError:k}),v.jsx(oc,{type:"text",placeholder:mj,value:g,name:"resourceId",inputChangeHandler:T,label:Qj,labelSpacing:.5,validation:{isRequired:!0,validate:Dj()},onValidationError:k}),A?v.jsx(Sz,{cardData:o,cardDataApiStatus:r,objectToLink:String((c==null?void 0:c.value)||""),args:E}):null,v.jsx(kz,{fullWidth:!0,disabled:S()||m,color:"tertiary",variant:"outlined",size:"small",onClick:b,children:A?nP:tP})]}),v.jsxs(Zh,{children:[v.jsx(zt,{onClick:I,disabled:S()||h,children:yD}),v.jsx(qh,{color:"tertiary",variant:"outlined",onClick:Q,disabled:h,children:Ud})]})]})},$h={values:{},errors:{}},sr={SET_FIELD_VALUE:"SET_FIELD_VALUE",CLEAR_ERROR:"CLEAR_ERROR",SET_FIELD_ERROR:"SET_FIELD_ERROR",SET_FIELDS:"SET_FIELDS",CLEAR_FIELDS:"CLEAR_FIELDS",RESET_STATE:"RESET_STATE"},Mz=(e,t)=>{const{type:n,payload:o}=t;switch(n){case sr.SET_FIELD_VALUE:{if(!o||!("name"in o))return e;const{name:r,value:i}=o;return{...e,values:{...e.values,[r]:i}}}case sr.SET_FIELD_ERROR:{if(!o||!("name"in o))return e;const{name:r,value:i}=o;return typeof i=="boolean"||typeof i=="string"?{...e,errors:{...e.errors,[r]:i}}:e}case sr.CLEAR_ERROR:{if(!o||!("name"in o))return e;const{name:r}=o;return{...e,errors:{...e.errors,[r]:""}}}case sr.SET_FIELDS:{if(!o||"name"in o)return e;const{values:r}=o;return{...e,values:r}}case sr.RESET_STATE:return $h}return e},em=({setShown:e,shown:t,title:n,description:o,buttons:r})=>v.jsx(jd,{shown:t,setShown:e,showCloseButton:!0,children:v.jsxs(ze,{width:"400px",padding:"20px",children:[v.jsx(Ke,{variant:"h2",marginBottom:"8px",children:n}),v.jsx(Ke,{variant:"body2",marginBottom:"20px",children:o}),v.jsx(ze,{direction:"row",justifyContent:"flex-end",gap:"8px",children:r.map(i=>v.jsx(zt,{variant:i.variant,onClick:i.action,children:i.label},i.label.split(" ").join("_").toLowerCase()))})]})}),Dz=({onClose:e,onCreateSuccess:t,setMetaData:n})=>{const[o,r]=w.useState(null),[i,a]=w.useState(!1),[A,l]=w.useReducer(Mz,$h),c=w.useRef(null),u=Jt(jB),g=Jt(Nj),C=Jt(Uj),B=Jt(zj),f=Jt(Yj),{conversationId:p,sendTrackingEvent:d}=w.useContext(ir),E=Di();w.useEffect(()=>{o!==null&&n(R=>({...R,object_type:o.label}))},[o,n]),w.useEffect(()=>{if(A.values){const R=Object.values(A.values).filter(L=>L!=="").length;n(L=>({...L,fields_filled:R}))}},[A,n]),w.useEffect(()=>{u&&u.length&&r(u[0])},[u]);const m=w.useMemo(()=>o&&"value"in o&&g&&g[o.value]&&Array.isArray(g[o.value])?[{id:o.value,formFields:g[o.value]}]:[{id:"emptyFormId",formFields:[]}],[g,o]),h=w.useMemo(()=>{if(m&&m.length){const{formFields:R,id:L}=m[0];return R.filter(Z=>Z.interfaceDetails).reduce((Z,P)=>{var G,K;const z=wj(A,(G=P==null?void 0:P.interfaceDetails)==null?void 0:G.args),Y=Object.values(((K=P==null?void 0:P.interfaceDetails)==null?void 0:K.args)||{});return{...Z,[P.name]:{loadOptions:(_,ee,X)=>{var q,ne,Ae;if(z.length===Y.length){E(Nl({fieldName:P.name,formId:String(L),fieldConfig:P,interfaceId:(q=P.interfaceDetails)==null?void 0:q.id,pagination:(ne=P.interfaceDetails)==null?void 0:ne.pagination,callback:ee,args:xj(A,(Ae=P==null?void 0:P.interfaceDetails)==null?void 0:Ae.args),isScrollToBottomEvent:X}));return}return ee([])}}}},{})}return null},[m,A,E]),b=w.useMemo(()=>{var L;const R=((L=m==null?void 0:m[0])==null?void 0:L.formFields)||[];return Pj({formFields:R})},[m]),I=(R,L)=>{l({type:sr.SET_FIELD_VALUE,payload:{value:L,name:R}})},Q=(R,L)=>{l({type:sr.SET_FIELD_ERROR,payload:{name:R,value:L}})},y=R=>{R.stopPropagation();const{name:L,value:H}=(R==null?void 0:R.target)||{};I(L,H)},T=R=>{if(o!=null&&o.value){const L=B[o.value][R];L==null||L.forEach(H=>{var W;I(H,""),B[o.value][H]&&T(H),(W=b[H])!=null&&W.isRequired&&Q(H,!0)})}},k=()=>{r(c.current),a(!1),l({type:sr.RESET_STATE})},S=(R,L,H)=>{if(L.action==="clear"&&L.name&&(I(L.name,""),T(L.name),b[L.name].isRequired&&Q(L.name,!0)),R&&typeof R=="object"&&"label"in R&&typeof R.label=="string"&&"value"in R&&(typeof R.value=="string"||typeof R.value=="number")&&typeof L.name<"u")if(L.name==="form-object")c.current={value:R.value,label:R.label},A.values&&R.value!==(o==null?void 0:o.value)&&(Object.values(A.values).filter(Z=>Z!=="").length>0?a(!0):k());else{let W=!1;H&&(W=H.isMultiSelect||!1);const Z=W?[{value:R.value,label:R.label}]:{value:R.value,label:R.label};I(L.name,Z),T(L.name)}},O=(R,L)=>{I(R,L||"")},D=()=>Object.keys(A.errors).filter(L=>!!A.errors[L]).length>0,U=()=>{if(!D()&&o&&(C!=null&&C[o.value])&&p){const R=C==null?void 0:C[o.value].interfaceDetails;if(!R)return;const{id:L,args:H={}}=R,W=Object.keys(H).reduce((Z,P)=>{const z=A.values[H[P]];let Y;return Array.isArray(z)?Y=z.map(G=>G.value):z&&typeof z=="object"&&"label"in z?Y=z.value:z&&typeof z=="object"?Y=z.toISOString():Y=z||"",Z[P]=Y,Z},{});E(jl({formId:String(o.value),conversationId:p,args:W,interfaceId:L,successCallback:()=>{e(),t()}})).unwrap().then(()=>{d(ON,{object_type:o})})}},M=[{label:"Cancel",action:()=>a(!1),variant:"text"},{label:"Continue",action:k}];return v.jsxs(_h,{children:[v.jsx(em,{shown:i,setShown:a,title:pj,description:Cj,buttons:M}),v.jsxs(Jh,{spacing:3,children:[v.jsx(oc,{type:"select",placeholder:LB,options:u,value:o,name:"form-object",selectChangeHandler:S,label:Bj,labelSpacing:.5,validation:{isRequired:!0}}),v.jsx(xz,{formConfig:m,selectChangeHandler:S,inputChangeHandler:y,dateChangeHandler:O,onValidationError:Q,fieldsSpacing:3,labelSpacing:.5,fetchConfig:h,values:A.values,validations:b})]}),v.jsxs(Zh,{children:[v.jsx(zt,{disabled:D()||f===Re.LOADING,onClick:U,children:wD}),v.jsx(qh,{variant:"outlined",color:"tertiary",onClick:e,disabled:f===Re.LOADING,children:Ud})]})]})},Pz=V(zt)`
2623
+ `,Oz=({setOpenTaskLinking:e,onLinkingSuccess:t})=>{const n=Di(),o=Jt(jj),r=Jt(Vj),i=Jt(Hj),a=Jt(VB),[A,l]=w.useState(!1),[c,u]=w.useState(null),[g,C]=w.useState(""),[B,f]=w.useState({}),{conversationId:p,sendTrackingEvent:d}=w.useContext(ir);w.useEffect(()=>{a&&a.length&&u(a[0])},[a]);const E={externalResourceId:g},m=r===Re.LOADING,h=i===Re.LOADING,b=()=>{!A&&c&&"value"in c&&(d(PN,{object_type:c.label}),n(Ea({id:String(c==null?void 0:c.value),args:E})).unwrap().catch(()=>{no({message:qN,type:Ca})})),l(O=>!O)},I=()=>{c&&"value"in c&&p&&n(Hl({id:String(c.value),externalResourceId:g,conversationId:p})).unwrap().then(()=>{d(MN,{object_type:c.label,input_type:g}),no({message:$N,type:Hi}),e(!1),t()}).catch(()=>{no({message:ej,type:Ca})})},Q=()=>{e(!1),l(!1)},y=(O,D)=>{O&&typeof O=="object"&&"label"in O&&typeof O.label=="string"&&"value"in O&&(typeof O.value=="string"||typeof O.value=="number")&&typeof D.name<"u"&&(u({value:O.value,label:O.label}),C(""))},T=O=>{O.stopPropagation();const{value:D}=(O==null?void 0:O.target)||{};C(D),l(!1)},k=(O,D)=>{f(U=>({...U,[O]:!!D}))},S=()=>Object.keys(B).filter(D=>B[D]).length>0;return v.jsxs(_h,{children:[v.jsxs(Jh,{spacing:3,children:[v.jsx(oc,{type:"select",placeholder:LB,options:a,value:c,name:"form-object",selectChangeHandler:y,label:hj,labelSpacing:.5,validation:{isRequired:!0},onValidationError:k}),v.jsx(oc,{type:"text",placeholder:mj,value:g,name:"resourceId",inputChangeHandler:T,label:Qj,labelSpacing:.5,validation:{isRequired:!0,validate:Dj()},onValidationError:k}),A?v.jsx(Sz,{cardData:o,cardDataApiStatus:r,objectToLink:String((c==null?void 0:c.value)||""),args:E}):null,v.jsx(kz,{fullWidth:!0,disabled:S()||m,color:"tertiary",variant:"outlined",size:"small",onClick:b,children:A?nP:tP})]}),v.jsxs(Zh,{children:[v.jsx(zt,{onClick:I,disabled:S()||h,children:yD}),v.jsx(qh,{color:"tertiary",variant:"outlined",onClick:Q,disabled:h,children:Ud})]})]})},$h={values:{},errors:{}},sr={SET_FIELD_VALUE:"SET_FIELD_VALUE",CLEAR_ERROR:"CLEAR_ERROR",SET_FIELD_ERROR:"SET_FIELD_ERROR",SET_FIELDS:"SET_FIELDS",CLEAR_FIELDS:"CLEAR_FIELDS",RESET_STATE:"RESET_STATE"},Mz=(e,t)=>{const{type:n,payload:o}=t;switch(n){case sr.SET_FIELD_VALUE:{if(!o||!("name"in o))return e;const{name:r,value:i}=o;return{...e,values:{...e.values,[r]:i}}}case sr.SET_FIELD_ERROR:{if(!o||!("name"in o))return e;const{name:r,value:i}=o;return typeof i=="boolean"||typeof i=="string"?{...e,errors:{...e.errors,[r]:i}}:e}case sr.CLEAR_ERROR:{if(!o||!("name"in o))return e;const{name:r}=o;return{...e,errors:{...e.errors,[r]:""}}}case sr.SET_FIELDS:{if(!o||"name"in o)return e;const{values:r}=o;return{...e,values:r}}case sr.RESET_STATE:return $h}return e},em=({setShown:e,shown:t,title:n,description:o,buttons:r})=>v.jsx(jd,{shown:t,setShown:e,showCloseButton:!0,children:v.jsxs(ze,{width:"400px",padding:"20px",children:[v.jsx(Ke,{variant:"h2",marginBottom:"8px",children:n}),v.jsx(Ke,{variant:"body2",marginBottom:"20px",children:o}),v.jsx(ze,{direction:"row",justifyContent:"flex-end",gap:"8px",children:r.map(i=>v.jsx(zt,{variant:i.variant,onClick:i.action,children:i.label},i.label.split(" ").join("_").toLowerCase()))})]})}),Dz=({onClose:e,onCreateSuccess:t,setMetaData:n})=>{const[o,r]=w.useState(null),[i,a]=w.useState(!1),[A,l]=w.useReducer(Mz,$h),c=w.useRef(null),u=Jt(jB),g=Jt(Nj),C=Jt(Uj),B=Jt(zj),f=Jt(Yj),{conversationId:p,sendTrackingEvent:d}=w.useContext(ir),E=Di();w.useEffect(()=>{o!==null&&n(R=>({...R,object_type:o.label}))},[o,n]),w.useEffect(()=>{if(A.values){const R=Object.values(A.values).filter(L=>L!=="").length;n(L=>({...L,fields_filled:R}))}},[A,n]),w.useEffect(()=>{u&&u.length&&r(u[0])},[u]);const m=w.useMemo(()=>o&&"value"in o&&g&&g[o.value]&&Array.isArray(g[o.value])?[{id:o.value,formFields:g[o.value]}]:[{id:"emptyFormId",formFields:[]}],[g,o]),h=w.useMemo(()=>{if(m&&m.length){const{formFields:R,id:L}=m[0];return R.filter(Z=>Z.interfaceDetails).reduce((Z,P)=>{var G,K;const z=wj(A,(G=P==null?void 0:P.interfaceDetails)==null?void 0:G.args),Y=Object.values(((K=P==null?void 0:P.interfaceDetails)==null?void 0:K.args)||{});return{...Z,[P.name]:{loadOptions:(_,ee,X)=>{var q,ne,Ae;if(z.length===Y.length){E(Nl({fieldName:P.name,formId:String(L),fieldConfig:P,interfaceId:(q=P.interfaceDetails)==null?void 0:q.id,pagination:(ne=P.interfaceDetails)==null?void 0:ne.pagination,callback:ee,args:xj(A,(Ae=P==null?void 0:P.interfaceDetails)==null?void 0:Ae.args),isScrollToBottomEvent:X}));return}return ee([])}}}},{})}return null},[m,A,E]),b=w.useMemo(()=>{var L;const R=((L=m==null?void 0:m[0])==null?void 0:L.formFields)||[];return Pj({formFields:R})},[m]),I=(R,L)=>{l({type:sr.SET_FIELD_VALUE,payload:{value:L,name:R}})},Q=(R,L)=>{l({type:sr.SET_FIELD_ERROR,payload:{name:R,value:L}})},y=R=>{R.stopPropagation();const{name:L,value:H}=(R==null?void 0:R.target)||{};I(L,H)},T=R=>{if(o!=null&&o.value){const L=B[o.value][R];L==null||L.forEach(H=>{var W;I(H,""),B[o.value][H]&&T(H),(W=b[H])!=null&&W.isRequired&&Q(H,!0)})}},k=()=>{r(c.current),a(!1),l({type:sr.RESET_STATE})},S=(R,L,H)=>{if(L.action==="clear"&&L.name&&(I(L.name,""),T(L.name),b[L.name].isRequired&&Q(L.name,!0)),R&&typeof R=="object"&&"label"in R&&typeof R.label=="string"&&"value"in R&&(typeof R.value=="string"||typeof R.value=="number")&&typeof L.name<"u")if(L.name==="form-object")c.current={value:R.value,label:R.label},A.values&&R.value!==(o==null?void 0:o.value)&&(Object.values(A.values).filter(Z=>Z!=="").length>0?a(!0):k());else{let W=!1;H&&(W=H.isMultiSelect||!1);const Z=W?[{value:R.value,label:R.label}]:{value:R.value,label:R.label};I(L.name,Z),T(L.name)}},O=(R,L)=>{I(R,L||"")},D=()=>Object.keys(A.errors).filter(L=>!!A.errors[L]).length>0,U=()=>{if(!D()&&o&&(C!=null&&C[o.value])&&p){const R=C==null?void 0:C[o.value].interfaceDetails;if(!R)return;const{id:L,args:H={}}=R,W=Object.keys(H).reduce((Z,P)=>{const z=A.values[H[P]];let Y;return Array.isArray(z)?Y=z.map(G=>G.value):z&&typeof z=="object"&&"label"in z?Y=z.value:z&&typeof z=="object"?Y=z.toISOString():Y=z||"",Z[P]=Y,Z},{});E(jl({formId:String(o.value),conversationId:p,args:W,interfaceId:L,successCallback:()=>{e(!1),t()}})).unwrap().then(()=>{d(ON,{object_type:o})})}},M=[{label:"Cancel",action:()=>a(!1),variant:"text"},{label:"Continue",action:k}];return v.jsxs(_h,{children:[v.jsx(em,{shown:i,setShown:a,title:pj,description:Cj,buttons:M}),v.jsxs(Jh,{spacing:3,children:[v.jsx(oc,{type:"select",placeholder:LB,options:u,value:o,name:"form-object",selectChangeHandler:S,label:Bj,labelSpacing:.5,validation:{isRequired:!0}}),v.jsx(xz,{formConfig:m,selectChangeHandler:S,inputChangeHandler:y,dateChangeHandler:O,onValidationError:Q,fieldsSpacing:3,labelSpacing:.5,fetchConfig:h,values:A.values,validations:b})]}),v.jsxs(Zh,{children:[v.jsx(zt,{disabled:D()||f===Re.LOADING,onClick:U,children:wD}),v.jsx(qh,{variant:"outlined",color:"tertiary",onClick:()=>e(!0),disabled:f===Re.LOADING,children:Ud})]})]})},Pz=V(zt)`
2624
2624
  &:hover {
2625
2625
  background-color: #e3e9ff !important;
2626
2626
  color: ${Ge.palette.purple.primary} !important;
@@ -2641,7 +2641,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2641
2641
  & .content__btn {
2642
2642
  margin-left: 8px;
2643
2643
  }
2644
- `,Lz=e=>x.createElement("svg",{width:20,height:21,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("mask",{id:"mask0_4649_80352",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:20,height:21},x.createElement("rect",{y:.320312,width:20,height:20,fill:"#D9D9D9"})),x.createElement("g",{mask:"url(#mask0_4649_80352)"},x.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"}))),Uz=e=>x.createElement("svg",{width:20,height:21,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.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"}),x.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"})),Nz=({onCreateClick:e,onLinkClick:t})=>v.jsxs(ze,{gap:2,marginTop:"12px",children:[v.jsx(Ke,{variant:"body2",color:Ge.palette.gray.gray1,children:fj}),v.jsxs(ze,{gap:"12px",children:[v.jsxs(Rz,{fullWidth:!0,onClick:e,children:[v.jsx(Lz,{}),v.jsx("span",{className:"content__btn",children:kI})]}),v.jsxs(Pz,{fullWidth:!0,color:"tertiary",variant:"outlined",onClick:t,children:[v.jsx(Uz,{}),v.jsx("span",{className:"content__btn",children:SI})]})]})]}),jz="data:image/svg+xml,%3csvg%20width='20'%20height='21'%20viewBox='0%200%2020%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmask%20id='mask0_4649_80352'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='20'%20height='21'%3e%3crect%20y='0.320312'%20width='20'%20height='20'%20fill='%23D9D9D9'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_4649_80352)'%3e%3cpath%20d='M9.16797%2014.4873H10.8346V11.154H14.168V9.4873H10.8346V6.15397H9.16797V9.4873H5.83464V11.154H9.16797V14.4873ZM10.0013%2018.654C8.84852%2018.654%207.76519%2018.4352%206.7513%2017.9977C5.73741%2017.5602%204.85547%2016.9665%204.10547%2016.2165C3.35547%2015.4665%202.76172%2014.5845%202.32422%2013.5706C1.88672%2012.5567%201.66797%2011.4734%201.66797%2010.3206C1.66797%209.16786%201.88672%208.08453%202.32422%207.07064C2.76172%206.05675%203.35547%205.1748%204.10547%204.4248C4.85547%203.6748%205.73741%203.08105%206.7513%202.64355C7.76519%202.20605%208.84852%201.9873%2010.0013%201.9873C11.1541%201.9873%2012.2374%202.20605%2013.2513%202.64355C14.2652%203.08105%2015.1471%203.6748%2015.8971%204.4248C16.6471%205.1748%2017.2409%206.05675%2017.6784%207.07064C18.1159%208.08453%2018.3346%209.16786%2018.3346%2010.3206C18.3346%2011.4734%2018.1159%2012.5567%2017.6784%2013.5706C17.2409%2014.5845%2016.6471%2015.4665%2015.8971%2016.2165C15.1471%2016.9665%2014.2652%2017.5602%2013.2513%2017.9977C12.2374%2018.4352%2011.1541%2018.654%2010.0013%2018.654ZM10.0013%2016.9873C11.8624%2016.9873%2013.4388%2016.3415%2014.7305%2015.0498C16.0221%2013.7581%2016.668%2012.1817%2016.668%2010.3206C16.668%208.45953%2016.0221%206.88314%2014.7305%205.59147C13.4388%204.2998%2011.8624%203.65397%2010.0013%203.65397C8.14019%203.65397%206.5638%204.2998%205.27214%205.59147C3.98047%206.88314%203.33464%208.45953%203.33464%2010.3206C3.33464%2012.1817%203.98047%2013.7581%205.27214%2015.0498C6.5638%2016.3415%208.14019%2016.9873%2010.0013%2016.9873Z'%20fill='%234D596C'/%3e%3c/g%3e%3c/svg%3e",Vz="data:image/svg+xml,%3csvg%20width='20'%20height='21'%20viewBox='0%200%2020%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.3462%208.73757C14.0406%208.43198%2013.5451%208.43198%2013.2395%208.73757C12.9339%209.04316%2012.9339%209.53863%2013.2395%209.84422L14.3462%208.73757ZM15.2392%2010.7372L15.7925%2010.1839L15.2392%2010.7372ZM16.2377%2013.1478L15.4552%2013.1478L16.2377%2013.1478ZM15.2392%2015.5584L14.6859%2015.0051L15.2392%2015.5584ZM10.418%2015.5584L9.86469%2016.1118L10.418%2015.5584ZM9.52499%2013.5588C9.2194%2013.2532%208.72393%2013.2532%208.41834%2013.5588C8.11275%2013.8643%208.11275%2014.3598%208.41834%2014.6654L9.52499%2013.5588ZM5.52477%2011.7731C5.83036%2012.0787%206.32583%2012.0787%206.63142%2011.7731C6.93701%2011.4675%206.93701%2010.972%206.63142%2010.6665L5.52477%2011.7731ZM9.45292%204.95224L10.0062%204.39892L9.45292%204.95224ZM10.346%206.95192C10.6515%207.25752%2011.147%207.25752%2011.4526%206.95192C11.7582%206.64633%2011.7582%206.15087%2011.4526%205.84527L10.346%206.95192ZM13.2395%209.84422L14.6859%2011.2906L15.7925%2010.1839L14.3462%208.73757L13.2395%209.84422ZM14.6859%2011.2906C15.1785%2011.7832%2015.4552%2012.4512%2015.4552%2013.1478L17.0202%2013.1478C17.0202%2012.0362%2016.5786%2010.97%2015.7925%2010.1839L14.6859%2011.2906ZM15.4552%2013.1478C15.4552%2013.8445%2015.1785%2014.5125%2014.6859%2015.0051L15.7925%2016.1118C16.5786%2015.3257%2017.0202%2014.2595%2017.0202%2013.1478L15.4552%2013.1478ZM14.6859%2015.0051C13.6601%2016.0308%2011.9971%2016.0308%2010.9713%2015.0051L9.86469%2016.1118C11.5016%2017.7487%2014.1556%2017.7487%2015.7925%2016.1118L14.6859%2015.0051ZM10.9713%2015.0051L9.52499%2013.5588L8.41834%2014.6654L9.86469%2016.1118L10.9713%2015.0051ZM6.63142%2010.6665L5.18507%209.2201L4.07842%2010.3268L5.52477%2011.7731L6.63142%2010.6665ZM5.18507%209.2201C4.69249%208.72752%204.41576%208.05944%204.41576%207.36283H2.85072C2.85072%208.47452%203.29234%209.54067%204.07842%2010.3268L5.18507%209.2201ZM4.41576%207.36283C4.41576%206.66622%204.69249%205.99815%205.18507%205.50557L4.07842%204.39892C3.29234%205.185%202.85072%206.25115%202.85072%207.36283H4.41576ZM5.18507%205.50557C6.21081%204.47983%207.87386%204.47983%208.8996%205.50557L10.0062%204.39892C8.36932%202.76199%205.71534%202.76199%204.07842%204.39892L5.18507%205.50557ZM8.8996%205.50557L10.346%206.95192L11.4526%205.84527L10.0062%204.39892L8.8996%205.50557Z'%20fill='%234D596C'/%3e%3crect%20x='6.36328'%20y='7.91895'%20width='1.66667'%20height='8.33333'%20rx='0.833333'%20transform='rotate(-45%206.36328%207.91895)'%20fill='%234D596C'/%3e%3c/svg%3e",Hz=({isAdmin:e=!1})=>{const{email:t,currentSmIds:n,sendTrackingEvent:o,availableFeatures:r,conversationId:i}=w.useContext(ir),a=Di(),[A,l]=w.useState(!1),[c,u]=w.useState(!1),[g,C]=w.useState(),[B,f]=w.useState(!1),p=Jt(nN),d=Jt(oN),E=Jt(iN),m=Jt(sN),h=Jt(rN),b=Jt(jB),I=Jt(VB),Q=vg(r,sP),y=vg(r,NI),T=w.useRef(null),k=w.useCallback(()=>{t&&n.length&&i&&a(Ll({inboxIds:n,conversationId:i}))},[a,t,n,i]);if(w.useEffect(()=>(k(),()=>{a(EN.clearConnectorList())}),[a,k]),w.useEffect(()=>{p&&p.length&&o(yN,{numOfCards:p.length})},[p,o,n]),w.useEffect(()=>{i&&n&&n.length&&a(Ul({inboxIds:n,conversationId:i,channelType:"email"}))},[a,n,i]),h===Re.LOADING)return v.jsx(lV,{});const S=()=>{l(!0),o(kN)},O=()=>{u(!0),o(SN)},D=R=>{o(R,g),(g==null?void 0:g.fields_filled)!==void 0&&g.fields_filled>0?f(!0):l(!1)},M=[{label:"Go back",variant:"text",action:()=>{l(!1),C(void 0),f(!1)}},{label:"Stay",variant:"contained",action:()=>f(!1)}];return v.jsxs(DI,{ref:T,"data-testid":Array.isArray(p)?"connector-agent":"loading",stopOverflow:A||c,children:[v.jsx(em,{shown:B,setShown:f,title:Ej,description:Ij,buttons:M}),d?v.jsxs(v.Fragment,{children:[v.jsxs(ze,{direction:"row",justifyContent:"space-between",marginBottom:"12px",height:"36px",children:[v.jsxs(ze,{direction:"row",alignItems:"center",children:[v.jsx(OI,{}),v.jsx(MI,{variant:"h2",children:QD})]}),v.jsx(ze,{direction:"row",gap:"4px",children:y&&(p!=null&&p.length)?v.jsxs(v.Fragment,{children:[b.length?v.jsx(Zt,{title:kI,children:v.jsx(sn,{onClick:S,children:v.jsx("img",{src:jz,alt:"Add",height:"20px"})})}):null,I.length?v.jsx(Zt,{title:SI,children:v.jsx(sn,{onClick:O,children:v.jsx("img",{src:Vz,alt:"Link Task",height:"20px"})})}):null]}):null})]}),Q?v.jsx(cV,{}):null,p==null?void 0:p.map((R,L)=>{const{id:H}=R;return v.jsx("div",{children:v.jsx(Xj,{card:R,specificCardData:E,email:t??"",defaultOpenState:L===0,specificConnectorApiStatus:m,onCardUnlinking:k})},H)}),!(p!=null&&p.length)&&y?v.jsx(Nz,{onCreateClick:()=>l(!0),onLinkClick:()=>u(!0)}):null]}):v.jsx(AV,{isAdmin:e}),v.jsx(zB,{onClose:()=>D(LN),containerRef:T,isOpen:A,children:v.jsx(Dz,{onClose:()=>D(RN),onCreateSuccess:k,setMetaData:C})}),v.jsx(zB,{onClose:()=>u(!1),containerRef:T,isOpen:c,children:v.jsx(Oz,{setOpenTaskLinking:u,onLinkingSuccess:k})})]})},Wz=({children:e,sendTrackingEvent:t,senderEmail:n="",baseUrls:o={},currentSmIds:r=[],metaData:i,availableFeatures:a,conversationId:A})=>{const l=w.useMemo(()=>({email:n,baseUrls:o,currentSmIds:r,metaData:i,conversationId:A,sendTrackingEvent:t||(()=>{}),availableFeatures:a}),[n,o,t,r,i,a,A]);return v.jsx(ir.Provider,{value:l,children:e})},zz=YI({cardList:CN,write:Lj}),Yz=nR({reducer:zz,devTools:!0}),Gz=({children:e,extraParams:t,senderEmail:n,baseUrls:o,availableFeatures:r})=>v.jsx(CD,{store:Yz,children:v.jsx($M,{custom:!0,children:v.jsx(Wz,{availableFeatures:r,sendTrackingEvent:t==null?void 0:t.sendTrackingEvent,senderEmail:n,currentSmIds:t==null?void 0:t.currentSmIds,metaData:t==null?void 0:t.metaData,conversationId:t==null?void 0:t.conversationId,baseUrls:o,children:v.jsx(w.Suspense,{fallback:v.jsx(v.Fragment,{}),children:e})})})}),Xz=V(Et)`
2644
+ `,Lz=e=>x.createElement("svg",{width:20,height:21,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("mask",{id:"mask0_4649_80352",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:20,height:21},x.createElement("rect",{y:.320312,width:20,height:20,fill:"#D9D9D9"})),x.createElement("g",{mask:"url(#mask0_4649_80352)"},x.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"}))),Uz=e=>x.createElement("svg",{width:20,height:21,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.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"}),x.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"})),Nz=({onCreateClick:e,onLinkClick:t})=>v.jsxs(ze,{gap:2,marginTop:"12px",children:[v.jsx(Ke,{variant:"body2",color:Ge.palette.gray.gray1,children:fj}),v.jsxs(ze,{gap:"12px",children:[v.jsxs(Rz,{fullWidth:!0,onClick:e,children:[v.jsx(Lz,{}),v.jsx("span",{className:"content__btn",children:kI})]}),v.jsxs(Pz,{fullWidth:!0,color:"tertiary",variant:"outlined",onClick:t,children:[v.jsx(Uz,{}),v.jsx("span",{className:"content__btn",children:SI})]})]})]}),jz="data:image/svg+xml,%3csvg%20width='20'%20height='21'%20viewBox='0%200%2020%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmask%20id='mask0_4649_80352'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='20'%20height='21'%3e%3crect%20y='0.320312'%20width='20'%20height='20'%20fill='%23D9D9D9'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_4649_80352)'%3e%3cpath%20d='M9.16797%2014.4873H10.8346V11.154H14.168V9.4873H10.8346V6.15397H9.16797V9.4873H5.83464V11.154H9.16797V14.4873ZM10.0013%2018.654C8.84852%2018.654%207.76519%2018.4352%206.7513%2017.9977C5.73741%2017.5602%204.85547%2016.9665%204.10547%2016.2165C3.35547%2015.4665%202.76172%2014.5845%202.32422%2013.5706C1.88672%2012.5567%201.66797%2011.4734%201.66797%2010.3206C1.66797%209.16786%201.88672%208.08453%202.32422%207.07064C2.76172%206.05675%203.35547%205.1748%204.10547%204.4248C4.85547%203.6748%205.73741%203.08105%206.7513%202.64355C7.76519%202.20605%208.84852%201.9873%2010.0013%201.9873C11.1541%201.9873%2012.2374%202.20605%2013.2513%202.64355C14.2652%203.08105%2015.1471%203.6748%2015.8971%204.4248C16.6471%205.1748%2017.2409%206.05675%2017.6784%207.07064C18.1159%208.08453%2018.3346%209.16786%2018.3346%2010.3206C18.3346%2011.4734%2018.1159%2012.5567%2017.6784%2013.5706C17.2409%2014.5845%2016.6471%2015.4665%2015.8971%2016.2165C15.1471%2016.9665%2014.2652%2017.5602%2013.2513%2017.9977C12.2374%2018.4352%2011.1541%2018.654%2010.0013%2018.654ZM10.0013%2016.9873C11.8624%2016.9873%2013.4388%2016.3415%2014.7305%2015.0498C16.0221%2013.7581%2016.668%2012.1817%2016.668%2010.3206C16.668%208.45953%2016.0221%206.88314%2014.7305%205.59147C13.4388%204.2998%2011.8624%203.65397%2010.0013%203.65397C8.14019%203.65397%206.5638%204.2998%205.27214%205.59147C3.98047%206.88314%203.33464%208.45953%203.33464%2010.3206C3.33464%2012.1817%203.98047%2013.7581%205.27214%2015.0498C6.5638%2016.3415%208.14019%2016.9873%2010.0013%2016.9873Z'%20fill='%234D596C'/%3e%3c/g%3e%3c/svg%3e",Vz="data:image/svg+xml,%3csvg%20width='20'%20height='21'%20viewBox='0%200%2020%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.3462%208.73757C14.0406%208.43198%2013.5451%208.43198%2013.2395%208.73757C12.9339%209.04316%2012.9339%209.53863%2013.2395%209.84422L14.3462%208.73757ZM15.2392%2010.7372L15.7925%2010.1839L15.2392%2010.7372ZM16.2377%2013.1478L15.4552%2013.1478L16.2377%2013.1478ZM15.2392%2015.5584L14.6859%2015.0051L15.2392%2015.5584ZM10.418%2015.5584L9.86469%2016.1118L10.418%2015.5584ZM9.52499%2013.5588C9.2194%2013.2532%208.72393%2013.2532%208.41834%2013.5588C8.11275%2013.8643%208.11275%2014.3598%208.41834%2014.6654L9.52499%2013.5588ZM5.52477%2011.7731C5.83036%2012.0787%206.32583%2012.0787%206.63142%2011.7731C6.93701%2011.4675%206.93701%2010.972%206.63142%2010.6665L5.52477%2011.7731ZM9.45292%204.95224L10.0062%204.39892L9.45292%204.95224ZM10.346%206.95192C10.6515%207.25752%2011.147%207.25752%2011.4526%206.95192C11.7582%206.64633%2011.7582%206.15087%2011.4526%205.84527L10.346%206.95192ZM13.2395%209.84422L14.6859%2011.2906L15.7925%2010.1839L14.3462%208.73757L13.2395%209.84422ZM14.6859%2011.2906C15.1785%2011.7832%2015.4552%2012.4512%2015.4552%2013.1478L17.0202%2013.1478C17.0202%2012.0362%2016.5786%2010.97%2015.7925%2010.1839L14.6859%2011.2906ZM15.4552%2013.1478C15.4552%2013.8445%2015.1785%2014.5125%2014.6859%2015.0051L15.7925%2016.1118C16.5786%2015.3257%2017.0202%2014.2595%2017.0202%2013.1478L15.4552%2013.1478ZM14.6859%2015.0051C13.6601%2016.0308%2011.9971%2016.0308%2010.9713%2015.0051L9.86469%2016.1118C11.5016%2017.7487%2014.1556%2017.7487%2015.7925%2016.1118L14.6859%2015.0051ZM10.9713%2015.0051L9.52499%2013.5588L8.41834%2014.6654L9.86469%2016.1118L10.9713%2015.0051ZM6.63142%2010.6665L5.18507%209.2201L4.07842%2010.3268L5.52477%2011.7731L6.63142%2010.6665ZM5.18507%209.2201C4.69249%208.72752%204.41576%208.05944%204.41576%207.36283H2.85072C2.85072%208.47452%203.29234%209.54067%204.07842%2010.3268L5.18507%209.2201ZM4.41576%207.36283C4.41576%206.66622%204.69249%205.99815%205.18507%205.50557L4.07842%204.39892C3.29234%205.185%202.85072%206.25115%202.85072%207.36283H4.41576ZM5.18507%205.50557C6.21081%204.47983%207.87386%204.47983%208.8996%205.50557L10.0062%204.39892C8.36932%202.76199%205.71534%202.76199%204.07842%204.39892L5.18507%205.50557ZM8.8996%205.50557L10.346%206.95192L11.4526%205.84527L10.0062%204.39892L8.8996%205.50557Z'%20fill='%234D596C'/%3e%3crect%20x='6.36328'%20y='7.91895'%20width='1.66667'%20height='8.33333'%20rx='0.833333'%20transform='rotate(-45%206.36328%207.91895)'%20fill='%234D596C'/%3e%3c/svg%3e",Hz=({isAdmin:e=!1})=>{const{email:t,currentSmIds:n,sendTrackingEvent:o,availableFeatures:r,conversationId:i}=w.useContext(ir),a=Di(),[A,l]=w.useState(!1),[c,u]=w.useState(!1),[g,C]=w.useState(),[B,f]=w.useState(!1),p=Jt(nN),d=Jt(oN),E=Jt(iN),m=Jt(sN),h=Jt(rN),b=Jt(jB),I=Jt(VB),Q=vg(r,sP),y=vg(r,NI),T=w.useRef(null),k=w.useCallback(()=>{t&&n.length&&i&&a(Ll({inboxIds:n,conversationId:i}))},[a,t,n,i]);if(w.useEffect(()=>(k(),()=>{a(EN.clearConnectorList())}),[a,k]),w.useEffect(()=>{p&&p.length&&o(yN,{numOfCards:p.length})},[p,o,n]),w.useEffect(()=>{i&&n&&n.length&&a(Ul({inboxIds:n,conversationId:i,channelType:"email"}))},[a,n,i]),h===Re.LOADING)return v.jsx(lV,{});const S=()=>{l(!0),o(kN)},O=()=>{u(!0),o(SN)},D=(R,L)=>{o(R,g),(g==null?void 0:g.fields_filled)!==void 0&&g.fields_filled>0&&L?f(!0):l(!1)},M=[{label:"Go back",variant:"text",action:()=>{l(!1),C(void 0),f(!1)}},{label:"Stay",variant:"contained",action:()=>f(!1)}];return v.jsxs(DI,{ref:T,"data-testid":Array.isArray(p)?"connector-agent":"loading",stopOverflow:A||c,children:[v.jsx(em,{shown:B,setShown:f,title:Ej,description:Ij,buttons:M}),d?v.jsxs(v.Fragment,{children:[v.jsxs(ze,{direction:"row",justifyContent:"space-between",marginBottom:"12px",height:"36px",children:[v.jsxs(ze,{direction:"row",alignItems:"center",children:[v.jsx(OI,{}),v.jsx(MI,{variant:"h2",children:QD})]}),v.jsx(ze,{direction:"row",gap:"4px",children:y&&(p!=null&&p.length)?v.jsxs(v.Fragment,{children:[b.length?v.jsx(Zt,{title:kI,children:v.jsx(sn,{onClick:S,children:v.jsx("img",{src:jz,alt:"Add",height:"20px"})})}):null,I.length?v.jsx(Zt,{title:SI,children:v.jsx(sn,{onClick:O,children:v.jsx("img",{src:Vz,alt:"Link Task",height:"20px"})})}):null]}):null})]}),Q?v.jsx(cV,{}):null,p==null?void 0:p.map((R,L)=>{const{id:H}=R;return v.jsx("div",{children:v.jsx(Xj,{card:R,specificCardData:E,email:t??"",defaultOpenState:L===0,specificConnectorApiStatus:m,onCardUnlinking:k})},H)}),!(p!=null&&p.length)&&y?v.jsx(Nz,{onCreateClick:()=>l(!0),onLinkClick:()=>u(!0)}):null]}):v.jsx(AV,{isAdmin:e}),v.jsx(zB,{onClose:()=>D(LN,!0),containerRef:T,isOpen:A,children:v.jsx(Dz,{onClose:R=>D(RN,R),onCreateSuccess:k,setMetaData:C})}),v.jsx(zB,{onClose:()=>u(!1),containerRef:T,isOpen:c,children:v.jsx(Oz,{setOpenTaskLinking:u,onLinkingSuccess:k})})]})},Wz=({children:e,sendTrackingEvent:t,senderEmail:n="",baseUrls:o={},currentSmIds:r=[],metaData:i,availableFeatures:a,conversationId:A})=>{const l=w.useMemo(()=>({email:n,baseUrls:o,currentSmIds:r,metaData:i,conversationId:A,sendTrackingEvent:t||(()=>{}),availableFeatures:a}),[n,o,t,r,i,a,A]);return v.jsx(ir.Provider,{value:l,children:e})},zz=YI({cardList:CN,write:Lj}),Yz=nR({reducer:zz,devTools:!0}),Gz=({children:e,extraParams:t,senderEmail:n,baseUrls:o,availableFeatures:r})=>v.jsx(CD,{store:Yz,children:v.jsx($M,{custom:!0,children:v.jsx(Wz,{availableFeatures:r,sendTrackingEvent:t==null?void 0:t.sendTrackingEvent,senderEmail:n,currentSmIds:t==null?void 0:t.currentSmIds,metaData:t==null?void 0:t.metaData,conversationId:t==null?void 0:t.conversationId,baseUrls:o,children:v.jsx(w.Suspense,{fallback:v.jsx(v.Fragment,{}),children:e})})})}),Xz=V(Et)`
2645
2645
  /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
2646
2646
 
2647
2647
  /* Document
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hiver/connector-agent",
3
- "version": "1.3.4-beta.24",
3
+ "version": "1.3.4-beta.25",
4
4
  "main": "index.es.js",
5
5
  "module": "index.es.js",
6
6
  "types": "index.d.ts",