@hiver/connector-agent 3.1.3-fixTrackingEvents-beta.5 → 3.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../../../src/features/connector-cards/components/no-connectors/style.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC7G,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,eAAO,MAAM,iBAAiB,EAAE,eAAe,CAAC,UAAU,CAezD,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,eAAe,CAAC,eAAe,CAKvD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,eAAe,CAAC,SAAS,CAKxD,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,eAAe,CAAC,eAAe,CAIrD,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,eAAe,CAAC,WAAW,CAU/D,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,eAAe,CAAC,UAAU,CAKzD,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,eAAe,CAAC,YAAY,CAGlD,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,eAAe,CAAC,eAAe,CAErD,CAAC"}
1
+ {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../../../src/features/connector-cards/components/no-connectors/style.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC7G,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,eAAO,MAAM,iBAAiB,EAAE,eAAe,CAAC,UAAU,CAgBzD,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,eAAe,CAAC,eAAe,CAKvD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,eAAe,CAAC,SAAS,CAKxD,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,eAAe,CAAC,eAAe,CAIrD,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,eAAe,CAAC,WAAW,CAU/D,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,eAAe,CAAC,UAAU,CAKzD,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,eAAe,CAAC,YAAY,CAGlD,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,eAAe,CAAC,eAAe,CAErD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/global-search/components/index.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,UAAU,iBAAiB;IACzB,cAAc,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACxC,iBAAiB,EAAE,QAAQ,CAAC,cAAc,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC;IACrE,kBAAkB,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACvD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CA2E9C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/global-search/components/index.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,UAAU,iBAAiB;IACzB,cAAc,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACxC,iBAAiB,EAAE,QAAQ,CAAC,cAAc,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC;IACrE,kBAAkB,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACvD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CA+E9C,CAAC"}
package/index.es.js CHANGED
@@ -8399,6 +8399,7 @@ const by = "Bring your favourite tools into Hiver", vy = "Plugin image", yy = "I
8399
8399
  align-items: center;
8400
8400
  justify-content: center;
8401
8401
  margin-bottom: 20px;
8402
+ margin-top: 12px;
8402
8403
  & img {
8403
8404
  height: 56px;
8404
8405
  width: 102px;
@@ -8412,7 +8413,7 @@ const by = "Bring your favourite tools into Hiver", vy = "Plugin image", yy = "I
8412
8413
  display: block;
8413
8414
  width: 100%;
8414
8415
  margin-bottom: 20px;
8415
- margin-top: 8px;
8416
+ margin-top: 12px;
8416
8417
  `, Ly = k(fe)`
8417
8418
  color: ${z.palette.gray.gray1};
8418
8419
  font-size: 13px;
@@ -16086,7 +16087,7 @@ const k4 = (e) => new Promise((t) => setTimeout(t, e)), P4 = ({
16086
16087
  }).filter((p) => !!p), [v, u]), d = (p) => {
16087
16088
  t(p), p && y("" + p.value);
16088
16089
  };
16089
- return /* @__PURE__ */ E.jsxs(J, { children: [
16090
+ return f.length ? /* @__PURE__ */ E.jsxs(J, { children: [
16090
16091
  /* @__PURE__ */ E.jsx(
16091
16092
  Wx,
16092
16093
  {
@@ -16109,7 +16110,7 @@ const k4 = (e) => new Promise((t) => setTimeout(t, e)), P4 = ({
16109
16110
  },
16110
16111
  e.value
16111
16112
  ) : null
16112
- ] });
16113
+ ] }) : null;
16113
16114
  }, X4 = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%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'%20fill='%236C7B94'/%3e%3c/svg%3e", U4 = async ({ id: e, externalResourceId: t, conversationId: n, channelType: r = "email" }) => {
16114
16115
  const i = new URLSearchParams();
16115
16116
  i.append("channel_type", r), await yt({
package/index.umd.js CHANGED
@@ -460,6 +460,7 @@ Do you want to continue?`,jb="Select an object to create",Vb="Select an object t
460
460
  align-items: center;
461
461
  justify-content: center;
462
462
  margin-bottom: 20px;
463
+ margin-top: 12px;
463
464
  & img {
464
465
  height: 56px;
465
466
  width: 102px;
@@ -473,7 +474,7 @@ Do you want to continue?`,jb="Select an object to create",Vb="Select an object t
473
474
  display: block;
474
475
  width: 100%;
475
476
  margin-bottom: 20px;
476
- margin-top: 8px;
477
+ margin-top: 12px;
477
478
  `,Hy=x.styled(x.Typography)`
478
479
  color: ${x.theme.palette.gray.gray1};
479
480
  font-size: 13px;
@@ -847,7 +848,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
847
848
  color: ${x.theme.palette.gray.gray3};
848
849
  font-size: 11px;
849
850
  text-transform: uppercase;
850
- `,hx=({onSelect:e,selectedOption:t,options:n})=>n.length?E.jsxs(dx,{children:[E.jsx(fx,{children:VE}),E.jsx(px,{children:HE}),n.map(r=>E.jsx(vf,{data:r,isSelected:t===r,onSelect:e},r.label+r.description))]}):null;var lr=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(){}},Nn=typeof window>"u"||"Deno"in globalThis;function vt(){}function gx(e,t){return typeof e=="function"?e(t):e}function sa(e){return typeof e=="number"&&e>=0&&e!==1/0}function Cf(e,t){return Math.max(e+(t||0)-Date.now(),0)}function dr(e,t){return typeof e=="function"?e(t):e}function Ot(e,t){return typeof e=="function"?e(t):e}function If(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==ia(i,t.options))return!1}else if(!$r(t.queryKey,i))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function Ef(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Pn(t.options.mutationKey)!==Pn(s))return!1}else if(!$r(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function ia(e,t){return((t==null?void 0:t.queryKeyHashFn)||Pn)(e)}function Pn(e){return JSON.stringify(e,(t,n)=>ca(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function $r(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!$r(e[n],t[n])):!1}function aa(e,t){if(e===t)return e;const n=xf(e)&&xf(t);if(n||ca(e)&&ca(t)){const r=n?e:Object.keys(e),o=r.length,s=n?t:Object.keys(t),i=s.length,a=n?[]:{};let c=0;for(let u=0;u<i;u++){const l=n?u:s[u];(!n&&r.includes(l)||n)&&e[l]===void 0&&t[l]===void 0?(a[l]=void 0,c++):(a[l]=aa(e[l],t[l]),a[l]===e[l]&&e[l]!==void 0&&c++)}return o===i&&c===o?e:a}return t}function vs(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 xf(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ca(e){if(!wf(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!wf(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function wf(e){return Object.prototype.toString.call(e)==="[object Object]"}function mx(e){return new Promise(t=>{setTimeout(t,e)})}function ua(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 aa(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 aa(e,t)}return t}function bx(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function yx(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Cs=Symbol();function Af(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Cs&&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===Cs?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var vx=(zf=class extends lr{constructor(){super();$(this,Mn);$(this,dn);$(this,fr);X(this,fr,t=>{if(!Nn&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){L(this,dn)||this.setEventListener(L(this,fr))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,dn))==null||t.call(this),X(this,dn,void 0))}setEventListener(t){var n;X(this,fr,t),(n=L(this,dn))==null||n.call(this),X(this,dn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){L(this,Mn)!==t&&(X(this,Mn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof L(this,Mn)=="boolean"?L(this,Mn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Mn=new WeakMap,dn=new WeakMap,fr=new WeakMap,zf),la=new vx,Cx=(Yf=class extends lr{constructor(){super();$(this,pr,!0);$(this,fn);$(this,hr);X(this,hr,t=>{if(!Nn&&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(){L(this,fn)||this.setEventListener(L(this,hr))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,fn))==null||t.call(this),X(this,fn,void 0))}setEventListener(t){var n;X(this,hr,t),(n=L(this,fn))==null||n.call(this),X(this,fn,t(this.setOnline.bind(this)))}setOnline(t){L(this,pr)!==t&&(X(this,pr,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return L(this,pr)}},pr=new WeakMap,fn=new WeakMap,hr=new WeakMap,Yf),Is=new Cx;function da(){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 Ix(e){return Math.min(1e3*2**e,3e4)}function Tf(e){return(e??"online")==="online"?Is.isOnline():!0}var Sf=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function fa(e){return e instanceof Sf}function _f(e){let t=!1,n=0,r=!1,o;const s=da(),i=p=>{var d;r||(y(new Sf(p)),(d=e.abort)==null||d.call(e))},a=()=>{t=!0},c=()=>{t=!1},u=()=>la.isFocused()&&(e.networkMode==="always"||Is.isOnline())&&e.canRun(),l=()=>Tf(e.networkMode)&&e.canRun(),g=p=>{var d;r||(r=!0,(d=e.onSuccess)==null||d.call(e,p),o==null||o(),s.resolve(p))},y=p=>{var d;r||(r=!0,(d=e.onError)==null||d.call(e,p),o==null||o(),s.reject(p))},v=()=>new Promise(p=>{var d;o=f=>{(r||u())&&p(f)},(d=e.onPause)==null||d.call(e)}).then(()=>{var p;o=void 0,r||(p=e.onContinue)==null||p.call(e)}),b=()=>{if(r)return;let p;const d=n===0?e.initialPromise:void 0;try{p=d??e.fn()}catch(f){p=Promise.reject(f)}Promise.resolve(p).then(g).catch(f=>{var w;if(r)return;const h=e.retry??(Nn?0:3),m=e.retryDelay??Ix,I=typeof m=="function"?m(n,f):m,C=h===!0||typeof h=="number"&&n<h||typeof h=="function"&&h(n,f);if(t||!C){y(f);return}n++,(w=e.onFail)==null||w.call(e,n,f),mx(I).then(()=>u()?void 0:v()).then(()=>{t?y(f):b()})})};return{promise:s,cancel:i,continue:()=>(o==null||o(),s),cancelRetry:a,continueRetry:c,canStart:l,start:()=>(l()?b():v().then(b),s)}}function Ex(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=a=>setTimeout(a,0);const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||i()}return c},batchCalls:a=>(...c)=>{s(()=>{a(...c)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var Be=Ex(),Of=(Jf=class{constructor(){$(this,Bn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),sa(this.gcTime)&&X(this,Bn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Nn?1/0:5*60*1e3))}clearGcTimeout(){L(this,Bn)&&(clearTimeout(L(this,Bn)),X(this,Bn,void 0))}},Bn=new WeakMap,Jf),xx=(Uf=class extends Of{constructor(t){super();$(this,Lt);$(this,gr);$(this,mr);$(this,Ct);$(this,Gn);$(this,Ye);$(this,Kr);$(this,jn);X(this,jn,!1),X(this,Kr,t.defaultOptions),this.setOptions(t.options),this.observers=[],X(this,Gn,t.client),X(this,Ct,L(this,Gn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,X(this,gr,wx(this.options)),this.state=t.state??L(this,gr),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=L(this,Ye))==null?void 0:t.promise}setOptions(t){this.options={...L(this,Kr),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&L(this,Ct).remove(this)}setData(t,n){const r=ua(this.state.data,t,this.options);return ue(this,Lt,rn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ue(this,Lt,rn).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=L(this,Ye))==null?void 0:r.promise;return(o=L(this,Ye))==null||o.cancel(t),n?n.then(vt).catch(vt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(L(this,gr))}isActive(){return this.observers.some(t=>Ot(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Cs||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||!Cf(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=L(this,Ye))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=L(this,Ye))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),L(this,Ct).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(L(this,Ye)&&(L(this,jn)?L(this,Ye).cancel({revert:!0}):L(this,Ye).cancelRetry()),this.scheduleGc()),L(this,Ct).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ue(this,Lt,rn).call(this,{type:"invalidate"})}fetch(t,n){var c,u,l;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(L(this,Ye))return L(this,Ye).continueRetry(),L(this,Ye).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:()=>(X(this,jn,!0),r.signal)})},s=()=>{const g=Af(this.options,n),y={client:L(this,Gn),queryKey:this.queryKey,meta:this.meta};return o(y),X(this,jn,!1),this.options.persister?this.options.persister(g,y,this):g(y)},i={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:L(this,Gn),state:this.state,fetchFn:s};o(i),(c=this.options.behavior)==null||c.onFetch(i,this),X(this,mr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&ue(this,Lt,rn).call(this,{type:"fetch",meta:(l=i.fetchOptions)==null?void 0:l.meta});const a=g=>{var y,v,b,p;fa(g)&&g.silent||ue(this,Lt,rn).call(this,{type:"error",error:g}),fa(g)||((v=(y=L(this,Ct).config).onError)==null||v.call(y,g,this),(p=(b=L(this,Ct).config).onSettled)==null||p.call(b,this.state.data,g,this)),this.scheduleGc()};return X(this,Ye,_f({initialPromise:n==null?void 0:n.initialPromise,fn:i.fetchFn,abort:r.abort.bind(r),onSuccess:g=>{var y,v,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}`),a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(g)}catch(d){a(d);return}(v=(y=L(this,Ct).config).onSuccess)==null||v.call(y,g,this),(p=(b=L(this,Ct).config).onSettled)==null||p.call(b,g,this.state.error,this),this.scheduleGc()},onError:a,onFail:(g,y)=>{ue(this,Lt,rn).call(this,{type:"failed",failureCount:g,error:y})},onPause:()=>{ue(this,Lt,rn).call(this,{type:"pause"})},onContinue:()=>{ue(this,Lt,rn).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0})),L(this,Ye).start()}},gr=new WeakMap,mr=new WeakMap,Ct=new WeakMap,Gn=new WeakMap,Ye=new WeakMap,Kr=new WeakMap,jn=new WeakMap,Lt=new WeakSet,rn=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,...Lf(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 fa(o)&&o.revert&&L(this,mr)?{...L(this,mr),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),Be.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),L(this,Ct).notify({query:this,type:"updated",action:t})})},Uf);function Lf(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Tf(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function wx(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 Ax=(Qf=class extends lr{constructor(t={}){super();$(this,Ht);this.config=t,X(this,Ht,new Map)}build(t,n,r){const o=n.queryKey,s=n.queryHash??ia(o,n);let i=this.get(s);return i||(i=new xx({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){L(this,Ht).has(t.queryHash)||(L(this,Ht).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=L(this,Ht).get(t.queryHash);n&&(t.destroy(),n===t&&L(this,Ht).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Be.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return L(this,Ht).get(t)}getAll(){return[...L(this,Ht).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>If(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>If(t,r)):n}notify(t){Be.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Be.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Be.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ht=new WeakMap,Qf),Tx=(qf=class extends Of{constructor(t){super();$(this,Zt);$(this,Wt);$(this,Ue);$(this,Vn);this.mutationId=t.mutationId,X(this,Ue,t.mutationCache),X(this,Wt,[]),this.state=t.state||Rf(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){L(this,Wt).includes(t)||(L(this,Wt).push(t),this.clearGcTimeout(),L(this,Ue).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){X(this,Wt,L(this,Wt).filter(n=>n!==t)),this.scheduleGc(),L(this,Ue).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){L(this,Wt).length||(this.state.status==="pending"?this.scheduleGc():L(this,Ue).remove(this))}continue(){var t;return((t=L(this,Vn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,s,i,a,c,u,l,g,y,v,b,p,d,f,h,m,I,C,w,A;X(this,Vn,_f({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(T,_)=>{ue(this,Zt,Cn).call(this,{type:"failed",failureCount:T,error:_})},onPause:()=>{ue(this,Zt,Cn).call(this,{type:"pause"})},onContinue:()=>{ue(this,Zt,Cn).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>L(this,Ue).canRun(this)}));const n=this.state.status==="pending",r=!L(this,Vn).canStart();try{if(!n){ue(this,Zt,Cn).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(o=L(this,Ue).config).onMutate)==null?void 0:s.call(o,t,this));const _=await((a=(i=this.options).onMutate)==null?void 0:a.call(i,t));_!==this.state.context&&ue(this,Zt,Cn).call(this,{type:"pending",context:_,variables:t,isPaused:r})}const T=await L(this,Vn).start();return await((u=(c=L(this,Ue).config).onSuccess)==null?void 0:u.call(c,T,t,this.state.context,this)),await((g=(l=this.options).onSuccess)==null?void 0:g.call(l,T,t,this.state.context)),await((v=(y=L(this,Ue).config).onSettled)==null?void 0:v.call(y,T,null,this.state.variables,this.state.context,this)),await((p=(b=this.options).onSettled)==null?void 0:p.call(b,T,null,t,this.state.context)),ue(this,Zt,Cn).call(this,{type:"success",data:T}),T}catch(T){try{throw await((f=(d=L(this,Ue).config).onError)==null?void 0:f.call(d,T,t,this.state.context,this)),await((m=(h=this.options).onError)==null?void 0:m.call(h,T,t,this.state.context)),await((C=(I=L(this,Ue).config).onSettled)==null?void 0:C.call(I,void 0,T,this.state.variables,this.state.context,this)),await((A=(w=this.options).onSettled)==null?void 0:A.call(w,void 0,T,t,this.state.context)),T}finally{ue(this,Zt,Cn).call(this,{type:"error",error:T})}}finally{L(this,Ue).runNext(this)}}},Wt=new WeakMap,Ue=new WeakMap,Vn=new WeakMap,Zt=new WeakSet,Cn=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),Be.batch(()=>{L(this,Wt).forEach(r=>{r.onMutationUpdate(t)}),L(this,Ue).notify({mutation:this,type:"updated",action:t})})},qf);function Rf(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Sx=($f=class extends lr{constructor(t={}){super();$(this,$t);$(this,Rt);$(this,eo);this.config=t,X(this,$t,new Set),X(this,Rt,new Map),X(this,eo,0)}build(t,n,r){const o=new Tx({mutationCache:this,mutationId:++xs(this,eo)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){L(this,$t).add(t);const n=Es(t);if(typeof n=="string"){const r=L(this,Rt).get(n);r?r.push(t):L(this,Rt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(L(this,$t).delete(t)){const n=Es(t);if(typeof n=="string"){const r=L(this,Rt).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&L(this,Rt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Es(t);if(typeof n=="string"){const r=L(this,Rt).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=Es(t);if(typeof n=="string"){const o=(r=L(this,Rt).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(){Be.batch(()=>{L(this,$t).forEach(t=>{this.notify({type:"removed",mutation:t})}),L(this,$t).clear(),L(this,Rt).clear()})}getAll(){return Array.from(L(this,$t))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Ef(n,r))}findAll(t={}){return this.getAll().filter(n=>Ef(t,n))}notify(t){Be.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Be.batch(()=>Promise.all(t.map(n=>n.continue().catch(vt))))}},$t=new WeakMap,Rt=new WeakMap,eo=new WeakMap,$f);function Es(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Ff(e){return{onFetch:(t,n)=>{var l,g,y,v,b;const r=t.options,o=(y=(g=(l=t.fetchOptions)==null?void 0:l.meta)==null?void 0:g.fetchMore)==null?void 0:y.direction,s=((v=t.state.data)==null?void 0:v.pages)||[],i=((b=t.state.data)==null?void 0:b.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let p=!1;const d=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},f=Af(t.options,t.fetchOptions),h=async(m,I,C)=>{if(p)return Promise.reject();if(I==null&&m.pages.length)return Promise.resolve(m);const w={client:t.client,queryKey:t.queryKey,pageParam:I,direction:C?"backward":"forward",meta:t.options.meta};d(w);const A=await f(w),{maxPages:T}=t.options,_=C?yx:bx;return{pages:_(m.pages,A,T),pageParams:_(m.pageParams,I,T)}};if(o&&s.length){const m=o==="backward",I=m?_x:Df,C={pages:s,pageParams:i},w=I(r,C);a=await h(C,w,m)}else{const m=e??s.length;do{const I=c===0?i[0]??r.initialPageParam:Df(r,a);if(c>0&&I==null)break;a=await h(a,I),c++}while(c<m)}return a};t.options.persister?t.fetchFn=()=>{var p,d;return(d=(p=t.options).persister)==null?void 0:d.call(p,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function Df(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 _x(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}var Ox=(Kf=class{constructor(e={}){$(this,Fe);$(this,pn);$(this,hn);$(this,br);$(this,yr);$(this,gn);$(this,vr);$(this,Cr);X(this,Fe,e.queryCache||new Ax),X(this,pn,e.mutationCache||new Sx),X(this,hn,e.defaultOptions||{}),X(this,br,new Map),X(this,yr,new Map),X(this,gn,0)}mount(){xs(this,gn)._++,L(this,gn)===1&&(X(this,vr,la.subscribe(async e=>{e&&(await this.resumePausedMutations(),L(this,Fe).onFocus())})),X(this,Cr,Is.subscribe(async e=>{e&&(await this.resumePausedMutations(),L(this,Fe).onOnline())})))}unmount(){var e,t;xs(this,gn)._--,L(this,gn)===0&&((e=L(this,vr))==null||e.call(this),X(this,vr,void 0),(t=L(this,Cr))==null||t.call(this),X(this,Cr,void 0))}isFetching(e){return L(this,Fe).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return L(this,pn).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=L(this,Fe).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=L(this,Fe).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(dr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return L(this,Fe).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=L(this,Fe).get(r.queryHash),s=o==null?void 0:o.state.data,i=gx(t,s);if(i!==void 0)return L(this,Fe).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Be.batch(()=>L(this,Fe).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=L(this,Fe).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=L(this,Fe);Be.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=L(this,Fe);return Be.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Be.batch(()=>L(this,Fe).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(vt).catch(vt)}invalidateQueries(e,t={}){return Be.batch(()=>(L(this,Fe).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=Be.batch(()=>L(this,Fe).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(vt)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(vt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=L(this,Fe).build(this,t);return n.isStaleByTime(dr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(vt).catch(vt)}fetchInfiniteQuery(e){return e.behavior=Ff(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(vt).catch(vt)}ensureInfiniteQueryData(e){return e.behavior=Ff(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Is.isOnline()?L(this,pn).resumePausedMutations():Promise.resolve()}getQueryCache(){return L(this,Fe)}getMutationCache(){return L(this,pn)}getDefaultOptions(){return L(this,hn)}setDefaultOptions(e){X(this,hn,e)}setQueryDefaults(e,t){L(this,br).set(Pn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...L(this,br).values()],n={};return t.forEach(r=>{$r(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){L(this,yr).set(Pn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...L(this,yr).values()],n={};return t.forEach(r=>{$r(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...L(this,hn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ia(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===Cs&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...L(this,hn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){L(this,Fe).clear(),L(this,pn).clear()}},Fe=new WeakMap,pn=new WeakMap,hn=new WeakMap,br=new WeakMap,yr=new WeakMap,gn=new WeakMap,vr=new WeakMap,Cr=new WeakMap,Kf),Lx=(e0=class extends lr{constructor(t,n){super();$(this,xe);$(this,it);$(this,fe);$(this,to);$(this,Qe);$(this,Hn);$(this,Ir);$(this,mn);$(this,Xt);$(this,no);$(this,Er);$(this,xr);$(this,Wn);$(this,Zn);$(this,bn);$(this,wr,new Set);this.options=n,X(this,it,t),X(this,Xt,null),X(this,mn,da()),this.options.experimental_prefetchInRender||L(this,mn).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&&(L(this,fe).addObserver(this),kf(L(this,fe),this.options)?ue(this,xe,io).call(this):this.updateResult(),ue(this,xe,Oa).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return pa(L(this,fe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return pa(L(this,fe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ue(this,xe,La).call(this),ue(this,xe,Ra).call(this),L(this,fe).removeObserver(this)}setOptions(t,n){const r=this.options,o=L(this,fe);if(this.options=L(this,it).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ot(this.options.enabled,L(this,fe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ue(this,xe,Fa).call(this),L(this,fe).setOptions(this.options),r._defaulted&&!vs(this.options,r)&&L(this,it).getQueryCache().notify({type:"observerOptionsUpdated",query:L(this,fe),observer:this});const s=this.hasListeners();s&&Nf(L(this,fe),o,this.options,r)&&ue(this,xe,io).call(this),this.updateResult(n),s&&(L(this,fe)!==o||Ot(this.options.enabled,L(this,fe))!==Ot(r.enabled,L(this,fe))||dr(this.options.staleTime,L(this,fe))!==dr(r.staleTime,L(this,fe)))&&ue(this,xe,Ta).call(this);const i=ue(this,xe,Sa).call(this);s&&(L(this,fe)!==o||Ot(this.options.enabled,L(this,fe))!==Ot(r.enabled,L(this,fe))||i!==L(this,bn))&&ue(this,xe,_a).call(this,i)}getOptimisticResult(t){const n=L(this,it).getQueryCache().build(L(this,it),t),r=this.createResult(n,t);return Fx(this,r)&&(X(this,Qe,r),X(this,Ir,this.options),X(this,Hn,L(this,fe).state)),r}getCurrentResult(){return L(this,Qe)}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){L(this,wr).add(t)}getCurrentQuery(){return L(this,fe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=L(this,it).defaultQueryOptions(t),r=L(this,it).getQueryCache().build(L(this,it),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ue(this,xe,io).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),L(this,Qe)))}createResult(t,n){var T;const r=L(this,fe),o=this.options,s=L(this,Qe),i=L(this,Hn),a=L(this,Ir),u=t!==r?t.state:L(this,to),{state:l}=t;let g={...l},y=!1,v;if(n._optimisticResults){const _=this.hasListeners(),k=!_&&kf(t,n),R=_&&Nf(t,r,n,o);(k||R)&&(g={...g,...Lf(l.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:b,errorUpdatedAt:p,status:d}=g;if(n.select&&g.data!==void 0)if(s&&g.data===(i==null?void 0:i.data)&&n.select===L(this,no))v=L(this,Er);else try{X(this,no,n.select),v=n.select(g.data),v=ua(s==null?void 0:s.data,v,n),X(this,Er,v),X(this,Xt,null)}catch(_){X(this,Xt,_)}else v=g.data;if(n.placeholderData!==void 0&&v===void 0&&d==="pending"){let _;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))_=s.data;else if(_=typeof n.placeholderData=="function"?n.placeholderData((T=L(this,xr))==null?void 0:T.state.data,L(this,xr)):n.placeholderData,n.select&&_!==void 0)try{_=n.select(_),X(this,Xt,null)}catch(k){X(this,Xt,k)}_!==void 0&&(d="success",v=ua(s==null?void 0:s.data,_,n),y=!0)}L(this,Xt)&&(b=L(this,Xt),v=L(this,Er),p=Date.now(),d="error");const f=g.fetchStatus==="fetching",h=d==="pending",m=d==="error",I=h&&f,C=v!==void 0,A={status:d,fetchStatus:g.fetchStatus,isPending:h,isSuccess:d==="success",isError:m,isInitialLoading:I,isLoading:I,data:v,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>u.dataUpdateCount||g.errorUpdateCount>u.errorUpdateCount,isFetching:f,isRefetching:f&&!h,isLoadingError:m&&!C,isPaused:g.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:m&&C,isStale:ha(t,n),refetch:this.refetch,promise:L(this,mn)};if(this.options.experimental_prefetchInRender){const _=N=>{A.status==="error"?N.reject(A.error):A.data!==void 0&&N.resolve(A.data)},k=()=>{const N=X(this,mn,A.promise=da());_(N)},R=L(this,mn);switch(R.status){case"pending":t.queryHash===r.queryHash&&_(R);break;case"fulfilled":(A.status==="error"||A.data!==R.value)&&k();break;case"rejected":(A.status!=="error"||A.error!==R.reason)&&k();break}}return A}updateResult(t){const n=L(this,Qe),r=this.createResult(L(this,fe),this.options);if(X(this,Hn,L(this,fe).state),X(this,Ir,this.options),L(this,Hn).data!==void 0&&X(this,xr,L(this,fe)),vs(r,n))return;X(this,Qe,r);const o={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!L(this,wr).size)return!0;const c=new Set(a??L(this,wr));return this.options.throwOnError&&c.add("error"),Object.keys(L(this,Qe)).some(u=>{const l=u;return L(this,Qe)[l]!==n[l]&&c.has(l)})};(t==null?void 0:t.listeners)!==!1&&s()&&(o.listeners=!0),ue(this,xe,f0).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ue(this,xe,Oa).call(this)}},it=new WeakMap,fe=new WeakMap,to=new WeakMap,Qe=new WeakMap,Hn=new WeakMap,Ir=new WeakMap,mn=new WeakMap,Xt=new WeakMap,no=new WeakMap,Er=new WeakMap,xr=new WeakMap,Wn=new WeakMap,Zn=new WeakMap,bn=new WeakMap,wr=new WeakMap,xe=new WeakSet,io=function(t){ue(this,xe,Fa).call(this);let n=L(this,fe).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(vt)),n},Ta=function(){ue(this,xe,La).call(this);const t=dr(this.options.staleTime,L(this,fe));if(Nn||L(this,Qe).isStale||!sa(t))return;const r=Cf(L(this,Qe).dataUpdatedAt,t)+1;X(this,Wn,setTimeout(()=>{L(this,Qe).isStale||this.updateResult()},r))},Sa=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(L(this,fe)):this.options.refetchInterval)??!1},_a=function(t){ue(this,xe,Ra).call(this),X(this,bn,t),!(Nn||Ot(this.options.enabled,L(this,fe))===!1||!sa(L(this,bn))||L(this,bn)===0)&&X(this,Zn,setInterval(()=>{(this.options.refetchIntervalInBackground||la.isFocused())&&ue(this,xe,io).call(this)},L(this,bn)))},Oa=function(){ue(this,xe,Ta).call(this),ue(this,xe,_a).call(this,ue(this,xe,Sa).call(this))},La=function(){L(this,Wn)&&(clearTimeout(L(this,Wn)),X(this,Wn,void 0))},Ra=function(){L(this,Zn)&&(clearInterval(L(this,Zn)),X(this,Zn,void 0))},Fa=function(){const t=L(this,it).getQueryCache().build(L(this,it),this.options);if(t===L(this,fe))return;const n=L(this,fe);X(this,fe,t),X(this,to,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},f0=function(t){Be.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(L(this,Qe))}),L(this,it).getQueryCache().notify({query:L(this,fe),type:"observerResultsUpdated"})})},e0);function Rx(e,t){return Ot(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function kf(e,t){return Rx(e,t)||e.state.data!==void 0&&pa(e,t,t.refetchOnMount)}function pa(e,t,n){if(Ot(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&ha(e,t)}return!1}function Nf(e,t,n,r){return(e!==t||Ot(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&ha(e,n)}function ha(e,t){return Ot(t.enabled,e)!==!1&&e.isStaleByTime(dr(t.staleTime,e))}function Fx(e,t){return!vs(e.getCurrentResult(),t)}var Dx=(t0=class extends lr{constructor(t,n){super();$(this,en);$(this,yn);$(this,vn);$(this,at);$(this,Kt);X(this,yn,t),this.setOptions(n),this.bindMethods(),ue(this,en,ws).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const n=this.options;this.options=L(this,yn).defaultMutationOptions(t),vs(this.options,n)||L(this,yn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:L(this,at),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Pn(n.mutationKey)!==Pn(this.options.mutationKey)?this.reset():((r=L(this,at))==null?void 0:r.state.status)==="pending"&&L(this,at).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=L(this,at))==null||t.removeObserver(this)}onMutationUpdate(t){ue(this,en,ws).call(this),ue(this,en,Da).call(this,t)}getCurrentResult(){return L(this,vn)}reset(){var t;(t=L(this,at))==null||t.removeObserver(this),X(this,at,void 0),ue(this,en,ws).call(this),ue(this,en,Da).call(this)}mutate(t,n){var r;return X(this,Kt,n),(r=L(this,at))==null||r.removeObserver(this),X(this,at,L(this,yn).getMutationCache().build(L(this,yn),this.options)),L(this,at).addObserver(this),L(this,at).execute(t)}},yn=new WeakMap,vn=new WeakMap,at=new WeakMap,Kt=new WeakMap,en=new WeakSet,ws=function(){var n;const t=((n=L(this,at))==null?void 0:n.state)??Rf();X(this,vn,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},Da=function(t){Be.batch(()=>{var n,r,o,s,i,a,c,u;if(L(this,Kt)&&this.hasListeners()){const l=L(this,vn).variables,g=L(this,vn).context;(t==null?void 0:t.type)==="success"?((r=(n=L(this,Kt)).onSuccess)==null||r.call(n,t.data,l,g),(s=(o=L(this,Kt)).onSettled)==null||s.call(o,t.data,null,l,g)):(t==null?void 0:t.type)==="error"&&((a=(i=L(this,Kt)).onError)==null||a.call(i,t.error,l,g),(u=(c=L(this,Kt)).onSettled)==null||u.call(c,void 0,t.error,l,g))}this.listeners.forEach(l=>{l(L(this,vn))})})},t0),Pf=M.createContext(void 0),Mf=e=>{const t=M.useContext(Pf);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},kx=({client:e,children:t})=>(M.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),E.jsx(Pf.Provider,{value:e,children:t})),Bf=M.createContext(!1),Nx=()=>M.useContext(Bf);Bf.Provider;function Px(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Mx=M.createContext(Px()),Bx=()=>M.useContext(Mx);function Gf(e,t){return typeof e=="function"?e(...t):!!e}function ga(){}var Gx=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},jx=e=>{M.useEffect(()=>{e.clearReset()},[e])},Vx=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||Gf(n,[e.error,r])),Hx=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)))},Wx=(e,t)=>e.isLoading&&e.isFetching&&!t,Zx=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,jf=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Xx(e,t,n){var g,y,v,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=Mf(),o=Nx(),s=Bx(),i=r.defaultQueryOptions(e);(y=(g=r.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||y.call(g,i),process.env.NODE_ENV!=="production"&&(i.queryFn||console.error(`[${i.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`)),i._optimisticResults=o?"isRestoring":"optimistic",Hx(i),Gx(i,s),jx(s);const a=!r.getQueryCache().get(i.queryHash),[c]=M.useState(()=>new t(r,i)),u=c.getOptimisticResult(i),l=!o&&e.subscribed!==!1;if(M.useSyncExternalStore(M.useCallback(d=>{const f=l?c.subscribe(Be.batchCalls(d)):ga;return c.updateResult(),f},[c,l]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),M.useEffect(()=>{c.setOptions(i,{listeners:!1})},[i,c]),Zx(i,u))throw jf(i,c,s);if(Vx({result:u,errorResetBoundary:s,throwOnError:i.throwOnError,query:r.getQueryCache().get(i.queryHash),suspense:i.suspense}))throw u.error;if((b=(v=r.getDefaultOptions().queries)==null?void 0:v._experimental_afterQuery)==null||b.call(v,i,u),i.experimental_prefetchInRender&&!Nn&&Wx(u,o)){const d=a?jf(i,c,s):(p=r.getQueryCache().get(i.queryHash))==null?void 0:p.promise;d==null||d.catch(ga).finally(()=>{c.updateResult()})}return i.notifyOnChangeProps?u:c.trackResult(u)}function Vf(e,t){return Xx(e,Lx)}function Hf(e,t){const n=Mf(),[r]=M.useState(()=>new Dx(n,e));M.useEffect(()=>{r.setOptions(e)},[r,e]);const o=M.useSyncExternalStore(M.useCallback(i=>r.subscribe(Be.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=M.useCallback((i,a)=>{r.mutate(i,a).catch(ga)},[r]);if(o.error&&Gf(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}const zx=e=>new Promise(t=>setTimeout(t,e)),Yx=({apiFn:e,intervalMillis:t,maxRetries:n,isSatisfied:r})=>(...s)=>{const i=async(a=0)=>{const c=await e(...s);if(r(c))return c;if(a>=n)throw c;return a++,zx(t).then(()=>i(a))};return i()},Jx=async({conversationId:e,senderEmail:t})=>{try{const n=await rt({url:Br(fb,{conversationId:e}),params:{senderEmail:t},method:ht.GET});return n==null?void 0:n.data}catch(n){throw console.error(n),n}},Wf=({conversationId:e,senderEmail:t,enabled:n})=>Vf({queryKey:["Global","ConversationMetaData",e,t],queryFn:()=>Jx({conversationId:e,senderEmail:t}),refetchOnMount:!1,enabled:n}),Zf="/v1/api",Ux=`${Zf}/connectors/forms/:formId/search`,Qx=`${Zf}/connectors/conversation/:conversationId/smart-suggestions`,qx=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}},$x=Yx({apiFn:async({conversationId:e})=>{try{const t=await rt({url:Br(Qx,{conversationId:e}),method:ht.GET}),n=t==null?void 0:t.data;return qx(n)}catch(t){throw console.error(t),t}},intervalMillis:1500,maxRetries:5,isSatisfied:e=>e.status!=="pending"}),Kx=({conversationId:e,senderEmail:t,enabled:n})=>{const{isSuccess:r}=Wf({conversationId:e,senderEmail:t,enabled:n});return Vf({queryKey:["GlobalSearch","SmartSuggestions",e],queryFn:()=>$x({conversationId:e}),enabled:n&&r})},e4=({selectedObject:e,setSelectedObject:t,fetchSearchResults:n,onReset:r})=>{const[o,s]=S.useState(""),{conversationId:i,email:a,availableFeatures:c}=S.useContext(Ke),u=ge(ME),l=ge(yf),g=_t(c,cg),{sortedObjectList:y,updatePriority:v}=lx({objectList:u}),{data:b}=Kx({enabled:g&&!!i,conversationId:String(i),senderEmail:a}),p=(b==null?void 0:b.suggestedOptions)??[],d=S.useMemo(()=>!l||!y.length?[]:y.map(({value:h})=>{const m=l[h];return m?{description:`${m.connectorName??""} - ${m.searchObject}`,avatarUrl:m.logoUrl,label:"",value:h,connectorName:m.connectorName,objectName:m.searchObject}:null}).filter(h=>!!h),[y,l]),f=h=>{t(h),h&&v(""+h.value)};return E.jsxs(x.Stack,{children:[E.jsx(ex,{value:e,options:d.map(h=>({...h,label:o})),inputValue:o,onInputChange:s,onChange:f,onReset:r,NoOptionsMessage:({selectOption:h})=>E.jsx(hx,{selectedOption:e,onSelect:h,options:p}),menuOpen:!o&&!p.length?!1:void 0}),e?E.jsx(nx,{objectId:e.value,searchString:e.label,fetchSearchResults:n},e.value):null]})},t4="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%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'%20fill='%236C7B94'/%3e%3c/svg%3e",n4=async({id:e,externalResourceId:t,conversationId:n,channelType:r="email"})=>{const o=new URLSearchParams;o.append("channel_type",r),await rt({url:`${hb.replace(":id",e)}?${o.toString()}`,method:ht.POST,data:{externalResourceId:t,conversationId:n}})},r4=({onSuccess:e})=>Hf({mutationFn:n4,onSuccess:()=>{De({message:D1,type:ln}),e==null||e()},onError:()=>{De({message:k1,type:bt})}}),o4="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",s4=x.styled(x.Stack)`
851
+ `,hx=({onSelect:e,selectedOption:t,options:n})=>n.length?E.jsxs(dx,{children:[E.jsx(fx,{children:VE}),E.jsx(px,{children:HE}),n.map(r=>E.jsx(vf,{data:r,isSelected:t===r,onSelect:e},r.label+r.description))]}):null;var lr=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(){}},Nn=typeof window>"u"||"Deno"in globalThis;function vt(){}function gx(e,t){return typeof e=="function"?e(t):e}function sa(e){return typeof e=="number"&&e>=0&&e!==1/0}function Cf(e,t){return Math.max(e+(t||0)-Date.now(),0)}function dr(e,t){return typeof e=="function"?e(t):e}function Ot(e,t){return typeof e=="function"?e(t):e}function If(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==ia(i,t.options))return!1}else if(!$r(t.queryKey,i))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function Ef(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Pn(t.options.mutationKey)!==Pn(s))return!1}else if(!$r(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function ia(e,t){return((t==null?void 0:t.queryKeyHashFn)||Pn)(e)}function Pn(e){return JSON.stringify(e,(t,n)=>ca(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function $r(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!$r(e[n],t[n])):!1}function aa(e,t){if(e===t)return e;const n=xf(e)&&xf(t);if(n||ca(e)&&ca(t)){const r=n?e:Object.keys(e),o=r.length,s=n?t:Object.keys(t),i=s.length,a=n?[]:{};let c=0;for(let u=0;u<i;u++){const l=n?u:s[u];(!n&&r.includes(l)||n)&&e[l]===void 0&&t[l]===void 0?(a[l]=void 0,c++):(a[l]=aa(e[l],t[l]),a[l]===e[l]&&e[l]!==void 0&&c++)}return o===i&&c===o?e:a}return t}function vs(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 xf(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ca(e){if(!wf(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!wf(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function wf(e){return Object.prototype.toString.call(e)==="[object Object]"}function mx(e){return new Promise(t=>{setTimeout(t,e)})}function ua(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 aa(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 aa(e,t)}return t}function bx(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function yx(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Cs=Symbol();function Af(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Cs&&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===Cs?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var vx=(zf=class extends lr{constructor(){super();$(this,Mn);$(this,dn);$(this,fr);X(this,fr,t=>{if(!Nn&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){L(this,dn)||this.setEventListener(L(this,fr))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,dn))==null||t.call(this),X(this,dn,void 0))}setEventListener(t){var n;X(this,fr,t),(n=L(this,dn))==null||n.call(this),X(this,dn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){L(this,Mn)!==t&&(X(this,Mn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof L(this,Mn)=="boolean"?L(this,Mn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Mn=new WeakMap,dn=new WeakMap,fr=new WeakMap,zf),la=new vx,Cx=(Yf=class extends lr{constructor(){super();$(this,pr,!0);$(this,fn);$(this,hr);X(this,hr,t=>{if(!Nn&&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(){L(this,fn)||this.setEventListener(L(this,hr))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,fn))==null||t.call(this),X(this,fn,void 0))}setEventListener(t){var n;X(this,hr,t),(n=L(this,fn))==null||n.call(this),X(this,fn,t(this.setOnline.bind(this)))}setOnline(t){L(this,pr)!==t&&(X(this,pr,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return L(this,pr)}},pr=new WeakMap,fn=new WeakMap,hr=new WeakMap,Yf),Is=new Cx;function da(){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 Ix(e){return Math.min(1e3*2**e,3e4)}function Tf(e){return(e??"online")==="online"?Is.isOnline():!0}var Sf=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function fa(e){return e instanceof Sf}function _f(e){let t=!1,n=0,r=!1,o;const s=da(),i=p=>{var d;r||(y(new Sf(p)),(d=e.abort)==null||d.call(e))},a=()=>{t=!0},c=()=>{t=!1},u=()=>la.isFocused()&&(e.networkMode==="always"||Is.isOnline())&&e.canRun(),l=()=>Tf(e.networkMode)&&e.canRun(),g=p=>{var d;r||(r=!0,(d=e.onSuccess)==null||d.call(e,p),o==null||o(),s.resolve(p))},y=p=>{var d;r||(r=!0,(d=e.onError)==null||d.call(e,p),o==null||o(),s.reject(p))},v=()=>new Promise(p=>{var d;o=f=>{(r||u())&&p(f)},(d=e.onPause)==null||d.call(e)}).then(()=>{var p;o=void 0,r||(p=e.onContinue)==null||p.call(e)}),b=()=>{if(r)return;let p;const d=n===0?e.initialPromise:void 0;try{p=d??e.fn()}catch(f){p=Promise.reject(f)}Promise.resolve(p).then(g).catch(f=>{var w;if(r)return;const h=e.retry??(Nn?0:3),m=e.retryDelay??Ix,I=typeof m=="function"?m(n,f):m,C=h===!0||typeof h=="number"&&n<h||typeof h=="function"&&h(n,f);if(t||!C){y(f);return}n++,(w=e.onFail)==null||w.call(e,n,f),mx(I).then(()=>u()?void 0:v()).then(()=>{t?y(f):b()})})};return{promise:s,cancel:i,continue:()=>(o==null||o(),s),cancelRetry:a,continueRetry:c,canStart:l,start:()=>(l()?b():v().then(b),s)}}function Ex(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=a=>setTimeout(a,0);const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||i()}return c},batchCalls:a=>(...c)=>{s(()=>{a(...c)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var Be=Ex(),Of=(Jf=class{constructor(){$(this,Bn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),sa(this.gcTime)&&X(this,Bn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Nn?1/0:5*60*1e3))}clearGcTimeout(){L(this,Bn)&&(clearTimeout(L(this,Bn)),X(this,Bn,void 0))}},Bn=new WeakMap,Jf),xx=(Uf=class extends Of{constructor(t){super();$(this,Lt);$(this,gr);$(this,mr);$(this,Ct);$(this,Gn);$(this,Ye);$(this,Kr);$(this,jn);X(this,jn,!1),X(this,Kr,t.defaultOptions),this.setOptions(t.options),this.observers=[],X(this,Gn,t.client),X(this,Ct,L(this,Gn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,X(this,gr,wx(this.options)),this.state=t.state??L(this,gr),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=L(this,Ye))==null?void 0:t.promise}setOptions(t){this.options={...L(this,Kr),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&L(this,Ct).remove(this)}setData(t,n){const r=ua(this.state.data,t,this.options);return ue(this,Lt,rn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ue(this,Lt,rn).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=L(this,Ye))==null?void 0:r.promise;return(o=L(this,Ye))==null||o.cancel(t),n?n.then(vt).catch(vt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(L(this,gr))}isActive(){return this.observers.some(t=>Ot(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Cs||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||!Cf(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=L(this,Ye))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=L(this,Ye))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),L(this,Ct).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(L(this,Ye)&&(L(this,jn)?L(this,Ye).cancel({revert:!0}):L(this,Ye).cancelRetry()),this.scheduleGc()),L(this,Ct).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ue(this,Lt,rn).call(this,{type:"invalidate"})}fetch(t,n){var c,u,l;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(L(this,Ye))return L(this,Ye).continueRetry(),L(this,Ye).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:()=>(X(this,jn,!0),r.signal)})},s=()=>{const g=Af(this.options,n),y={client:L(this,Gn),queryKey:this.queryKey,meta:this.meta};return o(y),X(this,jn,!1),this.options.persister?this.options.persister(g,y,this):g(y)},i={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:L(this,Gn),state:this.state,fetchFn:s};o(i),(c=this.options.behavior)==null||c.onFetch(i,this),X(this,mr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&ue(this,Lt,rn).call(this,{type:"fetch",meta:(l=i.fetchOptions)==null?void 0:l.meta});const a=g=>{var y,v,b,p;fa(g)&&g.silent||ue(this,Lt,rn).call(this,{type:"error",error:g}),fa(g)||((v=(y=L(this,Ct).config).onError)==null||v.call(y,g,this),(p=(b=L(this,Ct).config).onSettled)==null||p.call(b,this.state.data,g,this)),this.scheduleGc()};return X(this,Ye,_f({initialPromise:n==null?void 0:n.initialPromise,fn:i.fetchFn,abort:r.abort.bind(r),onSuccess:g=>{var y,v,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}`),a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(g)}catch(d){a(d);return}(v=(y=L(this,Ct).config).onSuccess)==null||v.call(y,g,this),(p=(b=L(this,Ct).config).onSettled)==null||p.call(b,g,this.state.error,this),this.scheduleGc()},onError:a,onFail:(g,y)=>{ue(this,Lt,rn).call(this,{type:"failed",failureCount:g,error:y})},onPause:()=>{ue(this,Lt,rn).call(this,{type:"pause"})},onContinue:()=>{ue(this,Lt,rn).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0})),L(this,Ye).start()}},gr=new WeakMap,mr=new WeakMap,Ct=new WeakMap,Gn=new WeakMap,Ye=new WeakMap,Kr=new WeakMap,jn=new WeakMap,Lt=new WeakSet,rn=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,...Lf(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 fa(o)&&o.revert&&L(this,mr)?{...L(this,mr),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),Be.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),L(this,Ct).notify({query:this,type:"updated",action:t})})},Uf);function Lf(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Tf(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function wx(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 Ax=(Qf=class extends lr{constructor(t={}){super();$(this,Ht);this.config=t,X(this,Ht,new Map)}build(t,n,r){const o=n.queryKey,s=n.queryHash??ia(o,n);let i=this.get(s);return i||(i=new xx({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){L(this,Ht).has(t.queryHash)||(L(this,Ht).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=L(this,Ht).get(t.queryHash);n&&(t.destroy(),n===t&&L(this,Ht).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Be.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return L(this,Ht).get(t)}getAll(){return[...L(this,Ht).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>If(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>If(t,r)):n}notify(t){Be.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Be.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Be.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ht=new WeakMap,Qf),Tx=(qf=class extends Of{constructor(t){super();$(this,Zt);$(this,Wt);$(this,Ue);$(this,Vn);this.mutationId=t.mutationId,X(this,Ue,t.mutationCache),X(this,Wt,[]),this.state=t.state||Rf(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){L(this,Wt).includes(t)||(L(this,Wt).push(t),this.clearGcTimeout(),L(this,Ue).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){X(this,Wt,L(this,Wt).filter(n=>n!==t)),this.scheduleGc(),L(this,Ue).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){L(this,Wt).length||(this.state.status==="pending"?this.scheduleGc():L(this,Ue).remove(this))}continue(){var t;return((t=L(this,Vn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,s,i,a,c,u,l,g,y,v,b,p,d,f,h,m,I,C,w,A;X(this,Vn,_f({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(T,_)=>{ue(this,Zt,Cn).call(this,{type:"failed",failureCount:T,error:_})},onPause:()=>{ue(this,Zt,Cn).call(this,{type:"pause"})},onContinue:()=>{ue(this,Zt,Cn).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>L(this,Ue).canRun(this)}));const n=this.state.status==="pending",r=!L(this,Vn).canStart();try{if(!n){ue(this,Zt,Cn).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(o=L(this,Ue).config).onMutate)==null?void 0:s.call(o,t,this));const _=await((a=(i=this.options).onMutate)==null?void 0:a.call(i,t));_!==this.state.context&&ue(this,Zt,Cn).call(this,{type:"pending",context:_,variables:t,isPaused:r})}const T=await L(this,Vn).start();return await((u=(c=L(this,Ue).config).onSuccess)==null?void 0:u.call(c,T,t,this.state.context,this)),await((g=(l=this.options).onSuccess)==null?void 0:g.call(l,T,t,this.state.context)),await((v=(y=L(this,Ue).config).onSettled)==null?void 0:v.call(y,T,null,this.state.variables,this.state.context,this)),await((p=(b=this.options).onSettled)==null?void 0:p.call(b,T,null,t,this.state.context)),ue(this,Zt,Cn).call(this,{type:"success",data:T}),T}catch(T){try{throw await((f=(d=L(this,Ue).config).onError)==null?void 0:f.call(d,T,t,this.state.context,this)),await((m=(h=this.options).onError)==null?void 0:m.call(h,T,t,this.state.context)),await((C=(I=L(this,Ue).config).onSettled)==null?void 0:C.call(I,void 0,T,this.state.variables,this.state.context,this)),await((A=(w=this.options).onSettled)==null?void 0:A.call(w,void 0,T,t,this.state.context)),T}finally{ue(this,Zt,Cn).call(this,{type:"error",error:T})}}finally{L(this,Ue).runNext(this)}}},Wt=new WeakMap,Ue=new WeakMap,Vn=new WeakMap,Zt=new WeakSet,Cn=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),Be.batch(()=>{L(this,Wt).forEach(r=>{r.onMutationUpdate(t)}),L(this,Ue).notify({mutation:this,type:"updated",action:t})})},qf);function Rf(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Sx=($f=class extends lr{constructor(t={}){super();$(this,$t);$(this,Rt);$(this,eo);this.config=t,X(this,$t,new Set),X(this,Rt,new Map),X(this,eo,0)}build(t,n,r){const o=new Tx({mutationCache:this,mutationId:++xs(this,eo)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){L(this,$t).add(t);const n=Es(t);if(typeof n=="string"){const r=L(this,Rt).get(n);r?r.push(t):L(this,Rt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(L(this,$t).delete(t)){const n=Es(t);if(typeof n=="string"){const r=L(this,Rt).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&L(this,Rt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Es(t);if(typeof n=="string"){const r=L(this,Rt).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=Es(t);if(typeof n=="string"){const o=(r=L(this,Rt).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(){Be.batch(()=>{L(this,$t).forEach(t=>{this.notify({type:"removed",mutation:t})}),L(this,$t).clear(),L(this,Rt).clear()})}getAll(){return Array.from(L(this,$t))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Ef(n,r))}findAll(t={}){return this.getAll().filter(n=>Ef(t,n))}notify(t){Be.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Be.batch(()=>Promise.all(t.map(n=>n.continue().catch(vt))))}},$t=new WeakMap,Rt=new WeakMap,eo=new WeakMap,$f);function Es(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Ff(e){return{onFetch:(t,n)=>{var l,g,y,v,b;const r=t.options,o=(y=(g=(l=t.fetchOptions)==null?void 0:l.meta)==null?void 0:g.fetchMore)==null?void 0:y.direction,s=((v=t.state.data)==null?void 0:v.pages)||[],i=((b=t.state.data)==null?void 0:b.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let p=!1;const d=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},f=Af(t.options,t.fetchOptions),h=async(m,I,C)=>{if(p)return Promise.reject();if(I==null&&m.pages.length)return Promise.resolve(m);const w={client:t.client,queryKey:t.queryKey,pageParam:I,direction:C?"backward":"forward",meta:t.options.meta};d(w);const A=await f(w),{maxPages:T}=t.options,_=C?yx:bx;return{pages:_(m.pages,A,T),pageParams:_(m.pageParams,I,T)}};if(o&&s.length){const m=o==="backward",I=m?_x:Df,C={pages:s,pageParams:i},w=I(r,C);a=await h(C,w,m)}else{const m=e??s.length;do{const I=c===0?i[0]??r.initialPageParam:Df(r,a);if(c>0&&I==null)break;a=await h(a,I),c++}while(c<m)}return a};t.options.persister?t.fetchFn=()=>{var p,d;return(d=(p=t.options).persister)==null?void 0:d.call(p,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function Df(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 _x(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}var Ox=(Kf=class{constructor(e={}){$(this,Fe);$(this,pn);$(this,hn);$(this,br);$(this,yr);$(this,gn);$(this,vr);$(this,Cr);X(this,Fe,e.queryCache||new Ax),X(this,pn,e.mutationCache||new Sx),X(this,hn,e.defaultOptions||{}),X(this,br,new Map),X(this,yr,new Map),X(this,gn,0)}mount(){xs(this,gn)._++,L(this,gn)===1&&(X(this,vr,la.subscribe(async e=>{e&&(await this.resumePausedMutations(),L(this,Fe).onFocus())})),X(this,Cr,Is.subscribe(async e=>{e&&(await this.resumePausedMutations(),L(this,Fe).onOnline())})))}unmount(){var e,t;xs(this,gn)._--,L(this,gn)===0&&((e=L(this,vr))==null||e.call(this),X(this,vr,void 0),(t=L(this,Cr))==null||t.call(this),X(this,Cr,void 0))}isFetching(e){return L(this,Fe).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return L(this,pn).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=L(this,Fe).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=L(this,Fe).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(dr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return L(this,Fe).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=L(this,Fe).get(r.queryHash),s=o==null?void 0:o.state.data,i=gx(t,s);if(i!==void 0)return L(this,Fe).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Be.batch(()=>L(this,Fe).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=L(this,Fe).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=L(this,Fe);Be.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=L(this,Fe);return Be.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Be.batch(()=>L(this,Fe).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(vt).catch(vt)}invalidateQueries(e,t={}){return Be.batch(()=>(L(this,Fe).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=Be.batch(()=>L(this,Fe).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(vt)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(vt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=L(this,Fe).build(this,t);return n.isStaleByTime(dr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(vt).catch(vt)}fetchInfiniteQuery(e){return e.behavior=Ff(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(vt).catch(vt)}ensureInfiniteQueryData(e){return e.behavior=Ff(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Is.isOnline()?L(this,pn).resumePausedMutations():Promise.resolve()}getQueryCache(){return L(this,Fe)}getMutationCache(){return L(this,pn)}getDefaultOptions(){return L(this,hn)}setDefaultOptions(e){X(this,hn,e)}setQueryDefaults(e,t){L(this,br).set(Pn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...L(this,br).values()],n={};return t.forEach(r=>{$r(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){L(this,yr).set(Pn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...L(this,yr).values()],n={};return t.forEach(r=>{$r(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...L(this,hn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ia(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===Cs&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...L(this,hn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){L(this,Fe).clear(),L(this,pn).clear()}},Fe=new WeakMap,pn=new WeakMap,hn=new WeakMap,br=new WeakMap,yr=new WeakMap,gn=new WeakMap,vr=new WeakMap,Cr=new WeakMap,Kf),Lx=(e0=class extends lr{constructor(t,n){super();$(this,xe);$(this,it);$(this,fe);$(this,to);$(this,Qe);$(this,Hn);$(this,Ir);$(this,mn);$(this,Xt);$(this,no);$(this,Er);$(this,xr);$(this,Wn);$(this,Zn);$(this,bn);$(this,wr,new Set);this.options=n,X(this,it,t),X(this,Xt,null),X(this,mn,da()),this.options.experimental_prefetchInRender||L(this,mn).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&&(L(this,fe).addObserver(this),kf(L(this,fe),this.options)?ue(this,xe,io).call(this):this.updateResult(),ue(this,xe,Oa).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return pa(L(this,fe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return pa(L(this,fe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ue(this,xe,La).call(this),ue(this,xe,Ra).call(this),L(this,fe).removeObserver(this)}setOptions(t,n){const r=this.options,o=L(this,fe);if(this.options=L(this,it).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ot(this.options.enabled,L(this,fe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ue(this,xe,Fa).call(this),L(this,fe).setOptions(this.options),r._defaulted&&!vs(this.options,r)&&L(this,it).getQueryCache().notify({type:"observerOptionsUpdated",query:L(this,fe),observer:this});const s=this.hasListeners();s&&Nf(L(this,fe),o,this.options,r)&&ue(this,xe,io).call(this),this.updateResult(n),s&&(L(this,fe)!==o||Ot(this.options.enabled,L(this,fe))!==Ot(r.enabled,L(this,fe))||dr(this.options.staleTime,L(this,fe))!==dr(r.staleTime,L(this,fe)))&&ue(this,xe,Ta).call(this);const i=ue(this,xe,Sa).call(this);s&&(L(this,fe)!==o||Ot(this.options.enabled,L(this,fe))!==Ot(r.enabled,L(this,fe))||i!==L(this,bn))&&ue(this,xe,_a).call(this,i)}getOptimisticResult(t){const n=L(this,it).getQueryCache().build(L(this,it),t),r=this.createResult(n,t);return Fx(this,r)&&(X(this,Qe,r),X(this,Ir,this.options),X(this,Hn,L(this,fe).state)),r}getCurrentResult(){return L(this,Qe)}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){L(this,wr).add(t)}getCurrentQuery(){return L(this,fe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=L(this,it).defaultQueryOptions(t),r=L(this,it).getQueryCache().build(L(this,it),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ue(this,xe,io).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),L(this,Qe)))}createResult(t,n){var T;const r=L(this,fe),o=this.options,s=L(this,Qe),i=L(this,Hn),a=L(this,Ir),u=t!==r?t.state:L(this,to),{state:l}=t;let g={...l},y=!1,v;if(n._optimisticResults){const _=this.hasListeners(),k=!_&&kf(t,n),R=_&&Nf(t,r,n,o);(k||R)&&(g={...g,...Lf(l.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:b,errorUpdatedAt:p,status:d}=g;if(n.select&&g.data!==void 0)if(s&&g.data===(i==null?void 0:i.data)&&n.select===L(this,no))v=L(this,Er);else try{X(this,no,n.select),v=n.select(g.data),v=ua(s==null?void 0:s.data,v,n),X(this,Er,v),X(this,Xt,null)}catch(_){X(this,Xt,_)}else v=g.data;if(n.placeholderData!==void 0&&v===void 0&&d==="pending"){let _;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))_=s.data;else if(_=typeof n.placeholderData=="function"?n.placeholderData((T=L(this,xr))==null?void 0:T.state.data,L(this,xr)):n.placeholderData,n.select&&_!==void 0)try{_=n.select(_),X(this,Xt,null)}catch(k){X(this,Xt,k)}_!==void 0&&(d="success",v=ua(s==null?void 0:s.data,_,n),y=!0)}L(this,Xt)&&(b=L(this,Xt),v=L(this,Er),p=Date.now(),d="error");const f=g.fetchStatus==="fetching",h=d==="pending",m=d==="error",I=h&&f,C=v!==void 0,A={status:d,fetchStatus:g.fetchStatus,isPending:h,isSuccess:d==="success",isError:m,isInitialLoading:I,isLoading:I,data:v,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>u.dataUpdateCount||g.errorUpdateCount>u.errorUpdateCount,isFetching:f,isRefetching:f&&!h,isLoadingError:m&&!C,isPaused:g.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:m&&C,isStale:ha(t,n),refetch:this.refetch,promise:L(this,mn)};if(this.options.experimental_prefetchInRender){const _=N=>{A.status==="error"?N.reject(A.error):A.data!==void 0&&N.resolve(A.data)},k=()=>{const N=X(this,mn,A.promise=da());_(N)},R=L(this,mn);switch(R.status){case"pending":t.queryHash===r.queryHash&&_(R);break;case"fulfilled":(A.status==="error"||A.data!==R.value)&&k();break;case"rejected":(A.status!=="error"||A.error!==R.reason)&&k();break}}return A}updateResult(t){const n=L(this,Qe),r=this.createResult(L(this,fe),this.options);if(X(this,Hn,L(this,fe).state),X(this,Ir,this.options),L(this,Hn).data!==void 0&&X(this,xr,L(this,fe)),vs(r,n))return;X(this,Qe,r);const o={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!L(this,wr).size)return!0;const c=new Set(a??L(this,wr));return this.options.throwOnError&&c.add("error"),Object.keys(L(this,Qe)).some(u=>{const l=u;return L(this,Qe)[l]!==n[l]&&c.has(l)})};(t==null?void 0:t.listeners)!==!1&&s()&&(o.listeners=!0),ue(this,xe,f0).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ue(this,xe,Oa).call(this)}},it=new WeakMap,fe=new WeakMap,to=new WeakMap,Qe=new WeakMap,Hn=new WeakMap,Ir=new WeakMap,mn=new WeakMap,Xt=new WeakMap,no=new WeakMap,Er=new WeakMap,xr=new WeakMap,Wn=new WeakMap,Zn=new WeakMap,bn=new WeakMap,wr=new WeakMap,xe=new WeakSet,io=function(t){ue(this,xe,Fa).call(this);let n=L(this,fe).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(vt)),n},Ta=function(){ue(this,xe,La).call(this);const t=dr(this.options.staleTime,L(this,fe));if(Nn||L(this,Qe).isStale||!sa(t))return;const r=Cf(L(this,Qe).dataUpdatedAt,t)+1;X(this,Wn,setTimeout(()=>{L(this,Qe).isStale||this.updateResult()},r))},Sa=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(L(this,fe)):this.options.refetchInterval)??!1},_a=function(t){ue(this,xe,Ra).call(this),X(this,bn,t),!(Nn||Ot(this.options.enabled,L(this,fe))===!1||!sa(L(this,bn))||L(this,bn)===0)&&X(this,Zn,setInterval(()=>{(this.options.refetchIntervalInBackground||la.isFocused())&&ue(this,xe,io).call(this)},L(this,bn)))},Oa=function(){ue(this,xe,Ta).call(this),ue(this,xe,_a).call(this,ue(this,xe,Sa).call(this))},La=function(){L(this,Wn)&&(clearTimeout(L(this,Wn)),X(this,Wn,void 0))},Ra=function(){L(this,Zn)&&(clearInterval(L(this,Zn)),X(this,Zn,void 0))},Fa=function(){const t=L(this,it).getQueryCache().build(L(this,it),this.options);if(t===L(this,fe))return;const n=L(this,fe);X(this,fe,t),X(this,to,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},f0=function(t){Be.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(L(this,Qe))}),L(this,it).getQueryCache().notify({query:L(this,fe),type:"observerResultsUpdated"})})},e0);function Rx(e,t){return Ot(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function kf(e,t){return Rx(e,t)||e.state.data!==void 0&&pa(e,t,t.refetchOnMount)}function pa(e,t,n){if(Ot(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&ha(e,t)}return!1}function Nf(e,t,n,r){return(e!==t||Ot(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&ha(e,n)}function ha(e,t){return Ot(t.enabled,e)!==!1&&e.isStaleByTime(dr(t.staleTime,e))}function Fx(e,t){return!vs(e.getCurrentResult(),t)}var Dx=(t0=class extends lr{constructor(t,n){super();$(this,en);$(this,yn);$(this,vn);$(this,at);$(this,Kt);X(this,yn,t),this.setOptions(n),this.bindMethods(),ue(this,en,ws).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const n=this.options;this.options=L(this,yn).defaultMutationOptions(t),vs(this.options,n)||L(this,yn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:L(this,at),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Pn(n.mutationKey)!==Pn(this.options.mutationKey)?this.reset():((r=L(this,at))==null?void 0:r.state.status)==="pending"&&L(this,at).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=L(this,at))==null||t.removeObserver(this)}onMutationUpdate(t){ue(this,en,ws).call(this),ue(this,en,Da).call(this,t)}getCurrentResult(){return L(this,vn)}reset(){var t;(t=L(this,at))==null||t.removeObserver(this),X(this,at,void 0),ue(this,en,ws).call(this),ue(this,en,Da).call(this)}mutate(t,n){var r;return X(this,Kt,n),(r=L(this,at))==null||r.removeObserver(this),X(this,at,L(this,yn).getMutationCache().build(L(this,yn),this.options)),L(this,at).addObserver(this),L(this,at).execute(t)}},yn=new WeakMap,vn=new WeakMap,at=new WeakMap,Kt=new WeakMap,en=new WeakSet,ws=function(){var n;const t=((n=L(this,at))==null?void 0:n.state)??Rf();X(this,vn,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},Da=function(t){Be.batch(()=>{var n,r,o,s,i,a,c,u;if(L(this,Kt)&&this.hasListeners()){const l=L(this,vn).variables,g=L(this,vn).context;(t==null?void 0:t.type)==="success"?((r=(n=L(this,Kt)).onSuccess)==null||r.call(n,t.data,l,g),(s=(o=L(this,Kt)).onSettled)==null||s.call(o,t.data,null,l,g)):(t==null?void 0:t.type)==="error"&&((a=(i=L(this,Kt)).onError)==null||a.call(i,t.error,l,g),(u=(c=L(this,Kt)).onSettled)==null||u.call(c,void 0,t.error,l,g))}this.listeners.forEach(l=>{l(L(this,vn))})})},t0),Pf=M.createContext(void 0),Mf=e=>{const t=M.useContext(Pf);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},kx=({client:e,children:t})=>(M.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),E.jsx(Pf.Provider,{value:e,children:t})),Bf=M.createContext(!1),Nx=()=>M.useContext(Bf);Bf.Provider;function Px(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Mx=M.createContext(Px()),Bx=()=>M.useContext(Mx);function Gf(e,t){return typeof e=="function"?e(...t):!!e}function ga(){}var Gx=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},jx=e=>{M.useEffect(()=>{e.clearReset()},[e])},Vx=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||Gf(n,[e.error,r])),Hx=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)))},Wx=(e,t)=>e.isLoading&&e.isFetching&&!t,Zx=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,jf=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Xx(e,t,n){var g,y,v,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=Mf(),o=Nx(),s=Bx(),i=r.defaultQueryOptions(e);(y=(g=r.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||y.call(g,i),process.env.NODE_ENV!=="production"&&(i.queryFn||console.error(`[${i.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`)),i._optimisticResults=o?"isRestoring":"optimistic",Hx(i),Gx(i,s),jx(s);const a=!r.getQueryCache().get(i.queryHash),[c]=M.useState(()=>new t(r,i)),u=c.getOptimisticResult(i),l=!o&&e.subscribed!==!1;if(M.useSyncExternalStore(M.useCallback(d=>{const f=l?c.subscribe(Be.batchCalls(d)):ga;return c.updateResult(),f},[c,l]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),M.useEffect(()=>{c.setOptions(i,{listeners:!1})},[i,c]),Zx(i,u))throw jf(i,c,s);if(Vx({result:u,errorResetBoundary:s,throwOnError:i.throwOnError,query:r.getQueryCache().get(i.queryHash),suspense:i.suspense}))throw u.error;if((b=(v=r.getDefaultOptions().queries)==null?void 0:v._experimental_afterQuery)==null||b.call(v,i,u),i.experimental_prefetchInRender&&!Nn&&Wx(u,o)){const d=a?jf(i,c,s):(p=r.getQueryCache().get(i.queryHash))==null?void 0:p.promise;d==null||d.catch(ga).finally(()=>{c.updateResult()})}return i.notifyOnChangeProps?u:c.trackResult(u)}function Vf(e,t){return Xx(e,Lx)}function Hf(e,t){const n=Mf(),[r]=M.useState(()=>new Dx(n,e));M.useEffect(()=>{r.setOptions(e)},[r,e]);const o=M.useSyncExternalStore(M.useCallback(i=>r.subscribe(Be.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=M.useCallback((i,a)=>{r.mutate(i,a).catch(ga)},[r]);if(o.error&&Gf(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}const zx=e=>new Promise(t=>setTimeout(t,e)),Yx=({apiFn:e,intervalMillis:t,maxRetries:n,isSatisfied:r})=>(...s)=>{const i=async(a=0)=>{const c=await e(...s);if(r(c))return c;if(a>=n)throw c;return a++,zx(t).then(()=>i(a))};return i()},Jx=async({conversationId:e,senderEmail:t})=>{try{const n=await rt({url:Br(fb,{conversationId:e}),params:{senderEmail:t},method:ht.GET});return n==null?void 0:n.data}catch(n){throw console.error(n),n}},Wf=({conversationId:e,senderEmail:t,enabled:n})=>Vf({queryKey:["Global","ConversationMetaData",e,t],queryFn:()=>Jx({conversationId:e,senderEmail:t}),refetchOnMount:!1,enabled:n}),Zf="/v1/api",Ux=`${Zf}/connectors/forms/:formId/search`,Qx=`${Zf}/connectors/conversation/:conversationId/smart-suggestions`,qx=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}},$x=Yx({apiFn:async({conversationId:e})=>{try{const t=await rt({url:Br(Qx,{conversationId:e}),method:ht.GET}),n=t==null?void 0:t.data;return qx(n)}catch(t){throw console.error(t),t}},intervalMillis:1500,maxRetries:5,isSatisfied:e=>e.status!=="pending"}),Kx=({conversationId:e,senderEmail:t,enabled:n})=>{const{isSuccess:r}=Wf({conversationId:e,senderEmail:t,enabled:n});return Vf({queryKey:["GlobalSearch","SmartSuggestions",e],queryFn:()=>$x({conversationId:e}),enabled:n&&r})},e4=({selectedObject:e,setSelectedObject:t,fetchSearchResults:n,onReset:r})=>{const[o,s]=S.useState(""),{conversationId:i,email:a,availableFeatures:c}=S.useContext(Ke),u=ge(ME),l=ge(yf),g=_t(c,cg),{sortedObjectList:y,updatePriority:v}=lx({objectList:u}),{data:b}=Kx({enabled:g&&!!i,conversationId:String(i),senderEmail:a}),p=(b==null?void 0:b.suggestedOptions)??[],d=S.useMemo(()=>!l||!y.length?[]:y.map(({value:h})=>{const m=l[h];return m?{description:`${m.connectorName??""} - ${m.searchObject}`,avatarUrl:m.logoUrl,label:"",value:h,connectorName:m.connectorName,objectName:m.searchObject}:null}).filter(h=>!!h),[y,l]),f=h=>{t(h),h&&v(""+h.value)};return d.length?E.jsxs(x.Stack,{children:[E.jsx(ex,{value:e,options:d.map(h=>({...h,label:o})),inputValue:o,onInputChange:s,onChange:f,onReset:r,NoOptionsMessage:({selectOption:h})=>E.jsx(hx,{selectedOption:e,onSelect:h,options:p}),menuOpen:!o&&!p.length?!1:void 0}),e?E.jsx(nx,{objectId:e.value,searchString:e.label,fetchSearchResults:n},e.value):null]}):null},t4="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%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'%20fill='%236C7B94'/%3e%3c/svg%3e",n4=async({id:e,externalResourceId:t,conversationId:n,channelType:r="email"})=>{const o=new URLSearchParams;o.append("channel_type",r),await rt({url:`${hb.replace(":id",e)}?${o.toString()}`,method:ht.POST,data:{externalResourceId:t,conversationId:n}})},r4=({onSuccess:e})=>Hf({mutationFn:n4,onSuccess:()=>{De({message:D1,type:ln}),e==null||e()},onError:()=>{De({message:k1,type:bt})}}),o4="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",s4=x.styled(x.Stack)`
851
852
  width: fit-content;
852
853
  cursor: pointer;
853
854
  gap: 8px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hiver/connector-agent",
3
- "version": "3.1.3-fixTrackingEvents-beta.5",
3
+ "version": "3.1.4",
4
4
  "main": "index.es.js",
5
5
  "module": "index.es.js",
6
6
  "types": "index.d.ts",