@deepdesk/deepdesk-sdk 11.2.0 → 11.2.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +7 -6
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +6 -5
- package/dist/index.iife.js +8 -7
- package/package.json +1 -1
package/dist/index.iife.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Deepdesk=(()=>{var yk=Object.create;var Tl=Object.defineProperty;var vk=Object.getOwnPropertyDescriptor;var Sk=Object.getOwnPropertyNames;var wk=Object.getPrototypeOf,xk=Object.prototype.hasOwnProperty;var Ce=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Qe=(e,t)=>{for(var n in t)Tl(e,n,{get:t[n],enumerable:!0})},jy=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Sk(t))!xk.call(e,o)&&o!==n&&Tl(e,o,{get:()=>t[o],enumerable:!(r=vk(t,o))||r.enumerable});return e};var w=(e,t,n)=>(n=e!=null?yk(wk(e)):{},jy(t||!e||!e.__esModule?Tl(n,"default",{value:e,enumerable:!0}):n,e)),Ek=e=>jy(Tl({},"__esModule",{value:!0}),e);var te=Ce((u2,kl)=>{"use strict";(function(){"use strict";var e={}.hasOwnProperty,t="[native code]";function n(){for(var r=[],o=0;o<arguments.length;o++){var i=arguments[o];if(i){var s=typeof i;if(s==="string"||s==="number")r.push(i);else if(Array.isArray(i)){if(i.length){var a=n.apply(null,i);a&&r.push(a)}}else if(s==="object"){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){r.push(i.toString());continue}for(var l in i)e.call(i,l)&&i[l]&&r.push(l)}}}return r.join(" ")}typeof kl<"u"&&kl.exports?(n.default=n,kl.exports=n):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return n}):window.classNames=n})()});var Pl=Ce((c2,Vy)=>{"use strict";var zy=Object.getOwnPropertySymbols,Ck=Object.prototype.hasOwnProperty,bk=Object.prototype.propertyIsEnumerable;function Tk(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function kk(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(i){return t[i]});if(r.join("")!=="0123456789")return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(i){o[i]=i}),Object.keys(Object.assign({},o)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}Vy.exports=kk()?Object.assign:function(e,t){for(var n,r=Tk(e),o,i=1;i<arguments.length;i++){n=Object(arguments[i]);for(var s in n)Ck.call(n,s)&&(r[s]=n[s]);if(zy){o=zy(n);for(var a=0;a<o.length;a++)bk.call(n,o[a])&&(r[o[a]]=n[o[a]])}}return r}});var iv=Ce(Z=>{"use strict";var Cf=Pl(),Xo=60103,Wy=60106;Z.Fragment=60107;Z.StrictMode=60108;Z.Profiler=60114;var qy=60109,Gy=60110,Yy=60112;Z.Suspense=60113;var Xy=60115,Qy=60116;typeof Symbol=="function"&&Symbol.for&&(It=Symbol.for,Xo=It("react.element"),Wy=It("react.portal"),Z.Fragment=It("react.fragment"),Z.StrictMode=It("react.strict_mode"),Z.Profiler=It("react.profiler"),qy=It("react.provider"),Gy=It("react.context"),Yy=It("react.forward_ref"),Z.Suspense=It("react.suspense"),Xy=It("react.memo"),Qy=It("react.lazy"));var It,Ky=typeof Symbol=="function"&&Symbol.iterator;function Pk(e){return e===null||typeof e!="object"?null:(e=Ky&&e[Ky]||e["@@iterator"],typeof e=="function"?e:null)}function gs(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Zy={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Jy={};function Qo(e,t,n){this.props=e,this.context=t,this.refs=Jy,this.updater=n||Zy}Qo.prototype.isReactComponent={};Qo.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error(gs(85));this.updater.enqueueSetState(this,e,t,"setState")};Qo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ev(){}ev.prototype=Qo.prototype;function bf(e,t,n){this.props=e,this.context=t,this.refs=Jy,this.updater=n||Zy}var Tf=bf.prototype=new ev;Tf.constructor=bf;Cf(Tf,Qo.prototype);Tf.isPureReactComponent=!0;var kf={current:null},tv=Object.prototype.hasOwnProperty,nv={key:!0,ref:!0,__self:!0,__source:!0};function rv(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)tv.call(t,r)&&!nv.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];o.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return{$$typeof:Xo,type:e,key:i,ref:s,props:o,_owner:kf.current}}function Rk(e,t){return{$$typeof:Xo,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Pf(e){return typeof e=="object"&&e!==null&&e.$$typeof===Xo}function Ak(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var $y=/\/+/g;function Ef(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Ak(""+e.key):t.toString(36)}function Al(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Xo:case Wy:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Ef(s,0):r,Array.isArray(o)?(n="",e!=null&&(n=e.replace($y,"$&/")+"/"),Al(o,t,n,"",function(u){return u})):o!=null&&(Pf(o)&&(o=Rk(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace($y,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",Array.isArray(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Ef(i,a);s+=Al(i,t,n,l,o)}else if(l=Pk(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Ef(i,a++),s+=Al(i,t,n,l,o);else if(i==="object")throw t=""+e,Error(gs(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t));return s}function Rl(e,t,n){if(e==null)return e;var r=[],o=0;return Al(e,r,"","",function(i){return t.call(n,i,o++)}),r}function Lk(e){if(e._status===-1){var t=e._result;t=t(),e._status=0,e._result=t,t.then(function(n){e._status===0&&(n=n.default,e._status=1,e._result=n)},function(n){e._status===0&&(e._status=2,e._result=n)})}if(e._status===1)return e._result;throw e._result}var ov={current:null};function Ln(){var e=ov.current;if(e===null)throw Error(gs(321));return e}var Ik={ReactCurrentDispatcher:ov,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:kf,IsSomeRendererActing:{current:!1},assign:Cf};Z.Children={map:Rl,forEach:function(e,t,n){Rl(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Rl(e,function(){t++}),t},toArray:function(e){return Rl(e,function(t){return t})||[]},only:function(e){if(!Pf(e))throw Error(gs(143));return e}};Z.Component=Qo;Z.PureComponent=bf;Z.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ik;Z.cloneElement=function(e,t,n){if(e==null)throw Error(gs(267,e));var r=Cf({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=kf.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)tv.call(t,l)&&!nv.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:Xo,type:e.type,key:o,ref:i,props:r,_owner:s}};Z.createContext=function(e,t){return t===void 0&&(t=null),e={$$typeof:Gy,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider={$$typeof:qy,_context:e},e.Consumer=e};Z.createElement=rv;Z.createFactory=function(e){var t=rv.bind(null,e);return t.type=e,t};Z.createRef=function(){return{current:null}};Z.forwardRef=function(e){return{$$typeof:Yy,render:e}};Z.isValidElement=Pf;Z.lazy=function(e){return{$$typeof:Qy,_payload:{_status:-1,_result:e},_init:Lk}};Z.memo=function(e,t){return{$$typeof:Xy,type:e,compare:t===void 0?null:t}};Z.useCallback=function(e,t){return Ln().useCallback(e,t)};Z.useContext=function(e,t){return Ln().useContext(e,t)};Z.useDebugValue=function(){};Z.useEffect=function(e,t){return Ln().useEffect(e,t)};Z.useImperativeHandle=function(e,t,n){return Ln().useImperativeHandle(e,t,n)};Z.useLayoutEffect=function(e,t){return Ln().useLayoutEffect(e,t)};Z.useMemo=function(e,t){return Ln().useMemo(e,t)};Z.useReducer=function(e,t,n){return Ln().useReducer(e,t,n)};Z.useRef=function(e){return Ln().useRef(e)};Z.useState=function(e){return Ln().useState(e)};Z.version="17.0.2"});var D=Ce((f2,sv)=>{"use strict";sv.exports=iv()});var dv=Ce(ys=>{"use strict";Pl();var Nk=D(),uv=60103;ys.Fragment=60107;typeof Symbol=="function"&&Symbol.for&&(Rf=Symbol.for,uv=Rf("react.element"),ys.Fragment=Rf("react.fragment"));var Rf,Mk=Nk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,_k=Object.prototype.hasOwnProperty,Dk={key:!0,ref:!0,__self:!0,__source:!0};function cv(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)_k.call(t,r)&&!Dk.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:uv,type:e,key:i,ref:s,props:o,_owner:Mk.current}}ys.jsx=cv;ys.jsxs=cv});var b=Ce((h2,fv)=>{"use strict";fv.exports=dv()});var Hv=Ce(ne=>{"use strict";var ti,ws,zl,Hf;typeof performance=="object"&&typeof performance.now=="function"?(Nv=performance,ne.unstable_now=function(){return Nv.now()}):(Of=Date,Mv=Of.now(),ne.unstable_now=function(){return Of.now()-Mv});var Nv,Of,Mv;typeof window>"u"||typeof MessageChannel!="function"?(ei=null,Nf=null,Mf=function(){if(ei!==null)try{var e=ne.unstable_now();ei(!0,e),ei=null}catch(t){throw setTimeout(Mf,0),t}},ti=function(e){ei!==null?setTimeout(ti,0,e):(ei=e,setTimeout(Mf,0))},ws=function(e,t){Nf=setTimeout(e,t)},zl=function(){clearTimeout(Nf)},ne.unstable_shouldYield=function(){return!1},Hf=ne.unstable_forceFrameRate=function(){}):(_v=window.setTimeout,Dv=window.clearTimeout,typeof console<"u"&&(Fv=window.cancelAnimationFrame,typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof Fv!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")),vs=!1,Ss=null,Ul=-1,_f=5,Df=0,ne.unstable_shouldYield=function(){return ne.unstable_now()>=Df},Hf=function(){},ne.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_f=0<e?Math.floor(1e3/e):5},Ff=new MessageChannel,Bl=Ff.port2,Ff.port1.onmessage=function(){if(Ss!==null){var e=ne.unstable_now();Df=e+_f;try{Ss(!0,e)?Bl.postMessage(null):(vs=!1,Ss=null)}catch(t){throw Bl.postMessage(null),t}}else vs=!1},ti=function(e){Ss=e,vs||(vs=!0,Bl.postMessage(null))},ws=function(e,t){Ul=_v(function(){e(ne.unstable_now())},t)},zl=function(){Dv(Ul),Ul=-1});var ei,Nf,Mf,_v,Dv,Fv,vs,Ss,Ul,_f,Df,Ff,Bl;function Uf(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,o=e[r];if(o!==void 0&&0<jl(o,t))e[r]=t,e[n]=o,n=r;else break e}}function Qt(e){return e=e[0],e===void 0?null:e}function Vl(e){var t=e[0];if(t!==void 0){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length;r<o;){var i=2*(r+1)-1,s=e[i],a=i+1,l=e[a];if(s!==void 0&&0>jl(s,n))l!==void 0&&0>jl(l,s)?(e[r]=l,e[a]=n,r=a):(e[r]=s,e[i]=n,r=i);else if(l!==void 0&&0>jl(l,n))e[r]=l,e[a]=n,r=a;else break e}}return t}return null}function jl(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}var mn=[],lr=[],sP=1,Nt=null,ze=3,Kl=!1,io=!1,xs=!1;function Bf(e){for(var t=Qt(lr);t!==null;){if(t.callback===null)Vl(lr);else if(t.startTime<=e)Vl(lr),t.sortIndex=t.expirationTime,Uf(mn,t);else break;t=Qt(lr)}}function jf(e){if(xs=!1,Bf(e),!io)if(Qt(mn)!==null)io=!0,ti(zf);else{var t=Qt(lr);t!==null&&ws(jf,t.startTime-e)}}function zf(e,t){io=!1,xs&&(xs=!1,zl()),Kl=!0;var n=ze;try{for(Bf(t),Nt=Qt(mn);Nt!==null&&(!(Nt.expirationTime>t)||e&&!ne.unstable_shouldYield());){var r=Nt.callback;if(typeof r=="function"){Nt.callback=null,ze=Nt.priorityLevel;var o=r(Nt.expirationTime<=t);t=ne.unstable_now(),typeof o=="function"?Nt.callback=o:Nt===Qt(mn)&&Vl(mn),Bf(t)}else Vl(mn);Nt=Qt(mn)}if(Nt!==null)var i=!0;else{var s=Qt(lr);s!==null&&ws(jf,s.startTime-t),i=!1}return i}finally{Nt=null,ze=n,Kl=!1}}var aP=Hf;ne.unstable_IdlePriority=5;ne.unstable_ImmediatePriority=1;ne.unstable_LowPriority=4;ne.unstable_NormalPriority=3;ne.unstable_Profiling=null;ne.unstable_UserBlockingPriority=2;ne.unstable_cancelCallback=function(e){e.callback=null};ne.unstable_continueExecution=function(){io||Kl||(io=!0,ti(zf))};ne.unstable_getCurrentPriorityLevel=function(){return ze};ne.unstable_getFirstCallbackNode=function(){return Qt(mn)};ne.unstable_next=function(e){switch(ze){case 1:case 2:case 3:var t=3;break;default:t=ze}var n=ze;ze=t;try{return e()}finally{ze=n}};ne.unstable_pauseExecution=function(){};ne.unstable_requestPaint=aP;ne.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=ze;ze=e;try{return t()}finally{ze=n}};ne.unstable_scheduleCallback=function(e,t,n){var r=ne.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?r+n:r):n=r,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return o=n+o,e={id:sP++,callback:t,priorityLevel:e,startTime:n,expirationTime:o,sortIndex:-1},n>r?(e.sortIndex=n,Uf(lr,e),Qt(mn)===null&&e===Qt(lr)&&(xs?zl():xs=!0,ws(jf,n-r))):(e.sortIndex=o,Uf(mn,e),io||Kl||(io=!0,ti(zf))),e};ne.unstable_wrapCallback=function(e){var t=ze;return function(){var n=ze;ze=t;try{return e.apply(this,arguments)}finally{ze=n}}}});var Bv=Ce((l_,Uv)=>{"use strict";Uv.exports=Hv()});var kw=Ce(Ut=>{"use strict";var Fu=D(),ye=Pl(),Ne=Bv();function P(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!Fu)throw Error(P(227));var J0=new Set,Qs={};function yo(e,t){Ei(e,t),Ei(e+"Capture",t)}function Ei(e,t){for(Qs[e]=t,e=0;e<t.length;e++)J0.add(t[e])}var Hn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),lP=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,jv=Object.prototype.hasOwnProperty,zv={},Vv={};function uP(e){return jv.call(Vv,e)?!0:jv.call(zv,e)?!1:lP.test(e)?Vv[e]=!0:(zv[e]=!0,!1)}function cP(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function dP(e,t,n,r){if(t===null||typeof t>"u"||cP(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function et(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Fe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Fe[e]=new et(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Fe[t]=new et(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Fe[e]=new et(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Fe[e]=new et(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Fe[e]=new et(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Fe[e]=new et(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Fe[e]=new et(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Fe[e]=new et(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Fe[e]=new et(e,5,!1,e.toLowerCase(),null,!1,!1)});var Qp=/[\-:]([a-z])/g;function Zp(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Qp,Zp);Fe[t]=new et(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Qp,Zp);Fe[t]=new et(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Qp,Zp);Fe[t]=new et(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Fe[e]=new et(e,1,!1,e.toLowerCase(),null,!1,!1)});Fe.xlinkHref=new et("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Fe[e]=new et(e,1,!1,e.toLowerCase(),null,!0,!0)});function Jp(e,t,n,r){var o=Fe.hasOwnProperty(t)?Fe[t]:null,i=o!==null?o.type===0:r?!1:!(!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N");i||(dP(t,n,o,r)&&(n=null),r||o===null?uP(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var vo=Fu.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ms=60103,ao=60106,cr=60107,em=60108,Us=60114,tm=60109,nm=60110,Hu=60112,Bs=60113,mu=60120,Uu=60115,rm=60116,om=60121,im=60128,eS=60129,sm=60130,dp=60131;typeof Symbol=="function"&&Symbol.for&&(ke=Symbol.for,Ms=ke("react.element"),ao=ke("react.portal"),cr=ke("react.fragment"),em=ke("react.strict_mode"),Us=ke("react.profiler"),tm=ke("react.provider"),nm=ke("react.context"),Hu=ke("react.forward_ref"),Bs=ke("react.suspense"),mu=ke("react.suspense_list"),Uu=ke("react.memo"),rm=ke("react.lazy"),om=ke("react.block"),ke("react.scope"),im=ke("react.opaque.id"),eS=ke("react.debug_trace_mode"),sm=ke("react.offscreen"),dp=ke("react.legacy_hidden"));var ke,Kv=typeof Symbol=="function"&&Symbol.iterator;function Es(e){return e===null||typeof e!="object"?null:(e=Kv&&e[Kv]||e["@@iterator"],typeof e=="function"?e:null)}var Vf;function _s(e){if(Vf===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Vf=t&&t[1]||""}return`
|
|
1
|
+
"use strict";var Deepdesk=(()=>{var yk=Object.create;var Tl=Object.defineProperty;var vk=Object.getOwnPropertyDescriptor;var Sk=Object.getOwnPropertyNames;var wk=Object.getPrototypeOf,xk=Object.prototype.hasOwnProperty;var Ce=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Qe=(e,t)=>{for(var n in t)Tl(e,n,{get:t[n],enumerable:!0})},jy=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Sk(t))!xk.call(e,o)&&o!==n&&Tl(e,o,{get:()=>t[o],enumerable:!(r=vk(t,o))||r.enumerable});return e};var w=(e,t,n)=>(n=e!=null?yk(wk(e)):{},jy(t||!e||!e.__esModule?Tl(n,"default",{value:e,enumerable:!0}):n,e)),Ek=e=>jy(Tl({},"__esModule",{value:!0}),e);var te=Ce((c2,kl)=>{"use strict";(function(){"use strict";var e={}.hasOwnProperty,t="[native code]";function n(){for(var r=[],o=0;o<arguments.length;o++){var i=arguments[o];if(i){var s=typeof i;if(s==="string"||s==="number")r.push(i);else if(Array.isArray(i)){if(i.length){var a=n.apply(null,i);a&&r.push(a)}}else if(s==="object"){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){r.push(i.toString());continue}for(var l in i)e.call(i,l)&&i[l]&&r.push(l)}}}return r.join(" ")}typeof kl<"u"&&kl.exports?(n.default=n,kl.exports=n):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return n}):window.classNames=n})()});var Pl=Ce((d2,Vy)=>{"use strict";var zy=Object.getOwnPropertySymbols,Ck=Object.prototype.hasOwnProperty,bk=Object.prototype.propertyIsEnumerable;function Tk(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function kk(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(i){return t[i]});if(r.join("")!=="0123456789")return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(i){o[i]=i}),Object.keys(Object.assign({},o)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}Vy.exports=kk()?Object.assign:function(e,t){for(var n,r=Tk(e),o,i=1;i<arguments.length;i++){n=Object(arguments[i]);for(var s in n)Ck.call(n,s)&&(r[s]=n[s]);if(zy){o=zy(n);for(var a=0;a<o.length;a++)bk.call(n,o[a])&&(r[o[a]]=n[o[a]])}}return r}});var iv=Ce(Z=>{"use strict";var Cf=Pl(),Xo=60103,Wy=60106;Z.Fragment=60107;Z.StrictMode=60108;Z.Profiler=60114;var qy=60109,Gy=60110,Yy=60112;Z.Suspense=60113;var Xy=60115,Qy=60116;typeof Symbol=="function"&&Symbol.for&&(It=Symbol.for,Xo=It("react.element"),Wy=It("react.portal"),Z.Fragment=It("react.fragment"),Z.StrictMode=It("react.strict_mode"),Z.Profiler=It("react.profiler"),qy=It("react.provider"),Gy=It("react.context"),Yy=It("react.forward_ref"),Z.Suspense=It("react.suspense"),Xy=It("react.memo"),Qy=It("react.lazy"));var It,Ky=typeof Symbol=="function"&&Symbol.iterator;function Pk(e){return e===null||typeof e!="object"?null:(e=Ky&&e[Ky]||e["@@iterator"],typeof e=="function"?e:null)}function gs(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Zy={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Jy={};function Qo(e,t,n){this.props=e,this.context=t,this.refs=Jy,this.updater=n||Zy}Qo.prototype.isReactComponent={};Qo.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error(gs(85));this.updater.enqueueSetState(this,e,t,"setState")};Qo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ev(){}ev.prototype=Qo.prototype;function bf(e,t,n){this.props=e,this.context=t,this.refs=Jy,this.updater=n||Zy}var Tf=bf.prototype=new ev;Tf.constructor=bf;Cf(Tf,Qo.prototype);Tf.isPureReactComponent=!0;var kf={current:null},tv=Object.prototype.hasOwnProperty,nv={key:!0,ref:!0,__self:!0,__source:!0};function rv(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)tv.call(t,r)&&!nv.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];o.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return{$$typeof:Xo,type:e,key:i,ref:s,props:o,_owner:kf.current}}function Rk(e,t){return{$$typeof:Xo,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Pf(e){return typeof e=="object"&&e!==null&&e.$$typeof===Xo}function Ak(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var $y=/\/+/g;function Ef(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Ak(""+e.key):t.toString(36)}function Al(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Xo:case Wy:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Ef(s,0):r,Array.isArray(o)?(n="",e!=null&&(n=e.replace($y,"$&/")+"/"),Al(o,t,n,"",function(u){return u})):o!=null&&(Pf(o)&&(o=Rk(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace($y,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",Array.isArray(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Ef(i,a);s+=Al(i,t,n,l,o)}else if(l=Pk(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Ef(i,a++),s+=Al(i,t,n,l,o);else if(i==="object")throw t=""+e,Error(gs(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t));return s}function Rl(e,t,n){if(e==null)return e;var r=[],o=0;return Al(e,r,"","",function(i){return t.call(n,i,o++)}),r}function Lk(e){if(e._status===-1){var t=e._result;t=t(),e._status=0,e._result=t,t.then(function(n){e._status===0&&(n=n.default,e._status=1,e._result=n)},function(n){e._status===0&&(e._status=2,e._result=n)})}if(e._status===1)return e._result;throw e._result}var ov={current:null};function Ln(){var e=ov.current;if(e===null)throw Error(gs(321));return e}var Ik={ReactCurrentDispatcher:ov,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:kf,IsSomeRendererActing:{current:!1},assign:Cf};Z.Children={map:Rl,forEach:function(e,t,n){Rl(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Rl(e,function(){t++}),t},toArray:function(e){return Rl(e,function(t){return t})||[]},only:function(e){if(!Pf(e))throw Error(gs(143));return e}};Z.Component=Qo;Z.PureComponent=bf;Z.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ik;Z.cloneElement=function(e,t,n){if(e==null)throw Error(gs(267,e));var r=Cf({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=kf.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)tv.call(t,l)&&!nv.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:Xo,type:e.type,key:o,ref:i,props:r,_owner:s}};Z.createContext=function(e,t){return t===void 0&&(t=null),e={$$typeof:Gy,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider={$$typeof:qy,_context:e},e.Consumer=e};Z.createElement=rv;Z.createFactory=function(e){var t=rv.bind(null,e);return t.type=e,t};Z.createRef=function(){return{current:null}};Z.forwardRef=function(e){return{$$typeof:Yy,render:e}};Z.isValidElement=Pf;Z.lazy=function(e){return{$$typeof:Qy,_payload:{_status:-1,_result:e},_init:Lk}};Z.memo=function(e,t){return{$$typeof:Xy,type:e,compare:t===void 0?null:t}};Z.useCallback=function(e,t){return Ln().useCallback(e,t)};Z.useContext=function(e,t){return Ln().useContext(e,t)};Z.useDebugValue=function(){};Z.useEffect=function(e,t){return Ln().useEffect(e,t)};Z.useImperativeHandle=function(e,t,n){return Ln().useImperativeHandle(e,t,n)};Z.useLayoutEffect=function(e,t){return Ln().useLayoutEffect(e,t)};Z.useMemo=function(e,t){return Ln().useMemo(e,t)};Z.useReducer=function(e,t,n){return Ln().useReducer(e,t,n)};Z.useRef=function(e){return Ln().useRef(e)};Z.useState=function(e){return Ln().useState(e)};Z.version="17.0.2"});var D=Ce((p2,sv)=>{"use strict";sv.exports=iv()});var dv=Ce(ys=>{"use strict";Pl();var Nk=D(),uv=60103;ys.Fragment=60107;typeof Symbol=="function"&&Symbol.for&&(Rf=Symbol.for,uv=Rf("react.element"),ys.Fragment=Rf("react.fragment"));var Rf,Mk=Nk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,_k=Object.prototype.hasOwnProperty,Dk={key:!0,ref:!0,__self:!0,__source:!0};function cv(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)_k.call(t,r)&&!Dk.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:uv,type:e,key:i,ref:s,props:o,_owner:Mk.current}}ys.jsx=cv;ys.jsxs=cv});var b=Ce((y2,fv)=>{"use strict";fv.exports=dv()});var Hv=Ce(ne=>{"use strict";var ti,ws,zl,Hf;typeof performance=="object"&&typeof performance.now=="function"?(Nv=performance,ne.unstable_now=function(){return Nv.now()}):(Of=Date,Mv=Of.now(),ne.unstable_now=function(){return Of.now()-Mv});var Nv,Of,Mv;typeof window>"u"||typeof MessageChannel!="function"?(ei=null,Nf=null,Mf=function(){if(ei!==null)try{var e=ne.unstable_now();ei(!0,e),ei=null}catch(t){throw setTimeout(Mf,0),t}},ti=function(e){ei!==null?setTimeout(ti,0,e):(ei=e,setTimeout(Mf,0))},ws=function(e,t){Nf=setTimeout(e,t)},zl=function(){clearTimeout(Nf)},ne.unstable_shouldYield=function(){return!1},Hf=ne.unstable_forceFrameRate=function(){}):(_v=window.setTimeout,Dv=window.clearTimeout,typeof console<"u"&&(Fv=window.cancelAnimationFrame,typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof Fv!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")),vs=!1,Ss=null,Ul=-1,_f=5,Df=0,ne.unstable_shouldYield=function(){return ne.unstable_now()>=Df},Hf=function(){},ne.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_f=0<e?Math.floor(1e3/e):5},Ff=new MessageChannel,Bl=Ff.port2,Ff.port1.onmessage=function(){if(Ss!==null){var e=ne.unstable_now();Df=e+_f;try{Ss(!0,e)?Bl.postMessage(null):(vs=!1,Ss=null)}catch(t){throw Bl.postMessage(null),t}}else vs=!1},ti=function(e){Ss=e,vs||(vs=!0,Bl.postMessage(null))},ws=function(e,t){Ul=_v(function(){e(ne.unstable_now())},t)},zl=function(){Dv(Ul),Ul=-1});var ei,Nf,Mf,_v,Dv,Fv,vs,Ss,Ul,_f,Df,Ff,Bl;function Uf(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,o=e[r];if(o!==void 0&&0<jl(o,t))e[r]=t,e[n]=o,n=r;else break e}}function Qt(e){return e=e[0],e===void 0?null:e}function Vl(e){var t=e[0];if(t!==void 0){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length;r<o;){var i=2*(r+1)-1,s=e[i],a=i+1,l=e[a];if(s!==void 0&&0>jl(s,n))l!==void 0&&0>jl(l,s)?(e[r]=l,e[a]=n,r=a):(e[r]=s,e[i]=n,r=i);else if(l!==void 0&&0>jl(l,n))e[r]=l,e[a]=n,r=a;else break e}}return t}return null}function jl(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}var mn=[],lr=[],sP=1,Nt=null,ze=3,Kl=!1,io=!1,xs=!1;function Bf(e){for(var t=Qt(lr);t!==null;){if(t.callback===null)Vl(lr);else if(t.startTime<=e)Vl(lr),t.sortIndex=t.expirationTime,Uf(mn,t);else break;t=Qt(lr)}}function jf(e){if(xs=!1,Bf(e),!io)if(Qt(mn)!==null)io=!0,ti(zf);else{var t=Qt(lr);t!==null&&ws(jf,t.startTime-e)}}function zf(e,t){io=!1,xs&&(xs=!1,zl()),Kl=!0;var n=ze;try{for(Bf(t),Nt=Qt(mn);Nt!==null&&(!(Nt.expirationTime>t)||e&&!ne.unstable_shouldYield());){var r=Nt.callback;if(typeof r=="function"){Nt.callback=null,ze=Nt.priorityLevel;var o=r(Nt.expirationTime<=t);t=ne.unstable_now(),typeof o=="function"?Nt.callback=o:Nt===Qt(mn)&&Vl(mn),Bf(t)}else Vl(mn);Nt=Qt(mn)}if(Nt!==null)var i=!0;else{var s=Qt(lr);s!==null&&ws(jf,s.startTime-t),i=!1}return i}finally{Nt=null,ze=n,Kl=!1}}var aP=Hf;ne.unstable_IdlePriority=5;ne.unstable_ImmediatePriority=1;ne.unstable_LowPriority=4;ne.unstable_NormalPriority=3;ne.unstable_Profiling=null;ne.unstable_UserBlockingPriority=2;ne.unstable_cancelCallback=function(e){e.callback=null};ne.unstable_continueExecution=function(){io||Kl||(io=!0,ti(zf))};ne.unstable_getCurrentPriorityLevel=function(){return ze};ne.unstable_getFirstCallbackNode=function(){return Qt(mn)};ne.unstable_next=function(e){switch(ze){case 1:case 2:case 3:var t=3;break;default:t=ze}var n=ze;ze=t;try{return e()}finally{ze=n}};ne.unstable_pauseExecution=function(){};ne.unstable_requestPaint=aP;ne.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=ze;ze=e;try{return t()}finally{ze=n}};ne.unstable_scheduleCallback=function(e,t,n){var r=ne.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?r+n:r):n=r,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return o=n+o,e={id:sP++,callback:t,priorityLevel:e,startTime:n,expirationTime:o,sortIndex:-1},n>r?(e.sortIndex=n,Uf(lr,e),Qt(mn)===null&&e===Qt(lr)&&(xs?zl():xs=!0,ws(jf,n-r))):(e.sortIndex=o,Uf(mn,e),io||Kl||(io=!0,ti(zf))),e};ne.unstable_wrapCallback=function(e){var t=ze;return function(){var n=ze;ze=t;try{return e.apply(this,arguments)}finally{ze=n}}}});var Bv=Ce((u_,Uv)=>{"use strict";Uv.exports=Hv()});var kw=Ce(Ut=>{"use strict";var Fu=D(),ye=Pl(),Ne=Bv();function P(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!Fu)throw Error(P(227));var J0=new Set,Qs={};function yo(e,t){Ei(e,t),Ei(e+"Capture",t)}function Ei(e,t){for(Qs[e]=t,e=0;e<t.length;e++)J0.add(t[e])}var Hn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),lP=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,jv=Object.prototype.hasOwnProperty,zv={},Vv={};function uP(e){return jv.call(Vv,e)?!0:jv.call(zv,e)?!1:lP.test(e)?Vv[e]=!0:(zv[e]=!0,!1)}function cP(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function dP(e,t,n,r){if(t===null||typeof t>"u"||cP(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function et(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Fe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Fe[e]=new et(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Fe[t]=new et(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Fe[e]=new et(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Fe[e]=new et(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Fe[e]=new et(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Fe[e]=new et(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Fe[e]=new et(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Fe[e]=new et(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Fe[e]=new et(e,5,!1,e.toLowerCase(),null,!1,!1)});var Qp=/[\-:]([a-z])/g;function Zp(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Qp,Zp);Fe[t]=new et(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Qp,Zp);Fe[t]=new et(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Qp,Zp);Fe[t]=new et(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Fe[e]=new et(e,1,!1,e.toLowerCase(),null,!1,!1)});Fe.xlinkHref=new et("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Fe[e]=new et(e,1,!1,e.toLowerCase(),null,!0,!0)});function Jp(e,t,n,r){var o=Fe.hasOwnProperty(t)?Fe[t]:null,i=o!==null?o.type===0:r?!1:!(!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N");i||(dP(t,n,o,r)&&(n=null),r||o===null?uP(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var vo=Fu.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ms=60103,ao=60106,cr=60107,em=60108,Us=60114,tm=60109,nm=60110,Hu=60112,Bs=60113,mu=60120,Uu=60115,rm=60116,om=60121,im=60128,eS=60129,sm=60130,dp=60131;typeof Symbol=="function"&&Symbol.for&&(ke=Symbol.for,Ms=ke("react.element"),ao=ke("react.portal"),cr=ke("react.fragment"),em=ke("react.strict_mode"),Us=ke("react.profiler"),tm=ke("react.provider"),nm=ke("react.context"),Hu=ke("react.forward_ref"),Bs=ke("react.suspense"),mu=ke("react.suspense_list"),Uu=ke("react.memo"),rm=ke("react.lazy"),om=ke("react.block"),ke("react.scope"),im=ke("react.opaque.id"),eS=ke("react.debug_trace_mode"),sm=ke("react.offscreen"),dp=ke("react.legacy_hidden"));var ke,Kv=typeof Symbol=="function"&&Symbol.iterator;function Es(e){return e===null||typeof e!="object"?null:(e=Kv&&e[Kv]||e["@@iterator"],typeof e=="function"?e:null)}var Vf;function _s(e){if(Vf===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Vf=t&&t[1]||""}return`
|
|
2
2
|
`+Vf+e}var Kf=!1;function $l(e,t){if(!e||Kf)return"";Kf=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(l){var r=l}Reflect.construct(e,[],t)}else{try{t.call()}catch(l){r=l}e.call(t.prototype)}else{try{throw Error()}catch(l){r=l}e()}}catch(l){if(l&&r&&typeof l.stack=="string"){for(var o=l.stack.split(`
|
|
3
3
|
`),i=r.stack.split(`
|
|
4
4
|
`),s=o.length-1,a=i.length-1;1<=s&&0<=a&&o[s]!==i[a];)a--;for(;1<=s&&0<=a;s--,a--)if(o[s]!==i[a]){if(s!==1||a!==1)do if(s--,a--,0>a||o[s]!==i[a])return`
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
Error generating stack: `+i.message+`
|
|
7
7
|
`+i.stack}return{value:e,source:t,stack:o}}function Bp(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var NR=typeof WeakMap=="function"?WeakMap:Map;function pw(e,t,n){n=yr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){_u||(_u=!0,Wp=r),Bp(e,t)},n}function mw(e,t,n){n=yr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return Bp(e,t),r(o)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){typeof r!="function"&&(yn===null?yn=new Set([this]):yn.add(this),Bp(e,t));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}var MR=typeof WeakSet=="function"?WeakSet:Set;function K0(e){var t=e.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(n){xr(e,n)}else t.current=null}function _R(e,t){switch(t.tag){case 0:case 11:case 15:case 22:return;case 1:if(t.flags&256&&e!==null){var n=e.memoizedProps,r=e.memoizedState;e=t.stateNode,t=e.getSnapshotBeforeUpdate(t.elementType===t.type?n:Zt(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:t.flags&256&&wm(t.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(P(163))}function DR(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:if(t=n.updateQueue,t=t!==null?t.lastEffect:null,t!==null){e=t=t.next;do{if((e.tag&3)===3){var r=e.create;e.destroy=r()}e=e.next}while(e!==t)}if(t=n.updateQueue,t=t!==null?t.lastEffect:null,t!==null){e=t=t.next;do{var o=e;r=o.next,o=o.tag,o&4&&o&1&&(Cw(n,e),KR(n,e)),e=r}while(e!==t)}return;case 1:e=n.stateNode,n.flags&4&&(t===null?e.componentDidMount():(r=n.elementType===n.type?t.memoizedProps:Zt(n.type,t.memoizedProps),e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),t=n.updateQueue,t!==null&&T0(n,t,e);return;case 3:if(t=n.updateQueue,t!==null){if(e=null,n.child!==null)switch(n.child.tag){case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}T0(n,t,e)}return;case 5:e=n.stateNode,t===null&&n.flags&4&&US(n.type,n.memoizedProps)&&e.focus();return;case 6:return;case 4:return;case 12:return;case 13:n.memoizedState===null&&(n=n.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&vS(n))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(P(163))}function $0(e,t){for(var n=e;;){if(n.tag===5){var r=n.stateNode;if(t)r=r.style,typeof r.setProperty=="function"?r.setProperty("display","none","important"):r.display="none";else{r=n.stateNode;var o=n.memoizedProps.style;o=o!=null&&o.hasOwnProperty("display")?o.display:null,r.style.display=aS("display",o)}}else if(n.tag===6)n.stateNode.nodeValue=t?"":n.memoizedProps;else if((n.tag!==23&&n.tag!==24||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}function W0(e,t){if(po&&typeof po.onCommitFiberUnmount=="function")try{po.onCommitFiberUnmount(xm,t)}catch{}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(e=t.updateQueue,e!==null&&(e=e.lastEffect,e!==null)){var n=e=e.next;do{var r=n,o=r.destroy;if(r=r.tag,o!==void 0)if(r&4)Cw(t,n);else{r=t;try{o()}catch(i){xr(r,i)}}n=n.next}while(n!==e)}break;case 1:if(K0(t),e=t.stateNode,typeof e.componentWillUnmount=="function")try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(i){xr(t,i)}break;case 5:K0(t);break;case 4:gw(e,t)}}function q0(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function G0(e){return e.tag===5||e.tag===3||e.tag===4}function Y0(e){e:{for(var t=e.return;t!==null;){if(G0(t))break e;t=t.return}throw Error(P(160))}var n=t;switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:t=t.containerInfo,r=!0;break;case 4:t=t.containerInfo,r=!0;break;default:throw Error(P(161))}n.flags&16&&(Zs(t,""),n.flags&=-17);e:t:for(n=e;;){for(;n.sibling===null;){if(n.return===null||G0(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue t;n.child.return=n,n=n.child}if(!(n.flags&2)){n=n.stateNode;break e}}r?jp(e,n,t):zp(e,n,t)}function jp(e,t,n){var r=e.tag,o=r===5||r===6;if(o)e=o?e.stateNode:e.stateNode.instance,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=wu));else if(r!==4&&(e=e.child,e!==null))for(jp(e,t,n),e=e.sibling;e!==null;)jp(e,t,n),e=e.sibling}function zp(e,t,n){var r=e.tag,o=r===5||r===6;if(o)e=o?e.stateNode:e.stateNode.instance,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(zp(e,t,n),e=e.sibling;e!==null;)zp(e,t,n),e=e.sibling}function gw(e,t){for(var n=t,r=!1,o,i;;){if(!r){r=n.return;e:for(;;){if(r===null)throw Error(P(160));switch(o=r.stateNode,r.tag){case 5:i=!1;break e;case 3:o=o.containerInfo,i=!0;break e;case 4:o=o.containerInfo,i=!0;break e}r=r.return}r=!0}if(n.tag===5||n.tag===6){e:for(var s=e,a=n,l=a;;)if(W0(s,l),l.child!==null&&l.tag!==4)l.child.return=l,l=l.child;else{if(l===a)break e;for(;l.sibling===null;){if(l.return===null||l.return===a)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}i?(s=o,a=n.stateNode,s.nodeType===8?s.parentNode.removeChild(a):s.removeChild(a)):o.removeChild(n.stateNode)}else if(n.tag===4){if(n.child!==null){o=n.stateNode.containerInfo,i=!0,n.child.return=n,n=n.child;continue}}else if(W0(e,n),n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return,n.tag===4&&(r=!1)}n.sibling.return=n.return,n=n.sibling}}function ap(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var r=n=n.next;do(r.tag&3)===3&&(e=r.destroy,r.destroy=void 0,e!==void 0&&e()),r=r.next;while(r!==n)}return;case 1:return;case 5:if(n=t.stateNode,n!=null){r=t.memoizedProps;var o=e!==null?e.memoizedProps:r;e=t.type;var i=t.updateQueue;if(t.updateQueue=null,i!==null){for(n[xu]=r,e==="input"&&r.type==="radio"&&r.name!=null&&rS(n,r),wp(e,o),t=wp(e,r),o=0;o<i.length;o+=2){var s=i[o],a=i[o+1];s==="style"?lS(n,a):s==="dangerouslySetInnerHTML"?sS(n,a):s==="children"?Zs(n,a):Jp(n,s,a,t)}switch(e){case"input":pp(n,r);break;case"textarea":oS(n,r);break;case"select":e=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,i=r.value,i!=null?pi(n,!!r.multiple,i,!1):e!==!!r.multiple&&(r.defaultValue!=null?pi(n,!!r.multiple,r.defaultValue,!0):pi(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(t.stateNode===null)throw Error(P(162));t.stateNode.nodeValue=t.memoizedProps;return;case 3:n=t.stateNode,n.hydrate&&(n.hydrate=!1,vS(n.containerInfo));return;case 12:return;case 13:t.memoizedState!==null&&(Dm=Ke(),$0(t.child,!0)),X0(t);return;case 19:X0(t);return;case 17:return;case 23:case 24:$0(t,t.memoizedState!==null);return}throw Error(P(163))}function X0(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new MR),t.forEach(function(r){var o=qR.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function FR(e,t){return e!==null&&(e=e.memoizedState,e===null||e.dehydrated!==null)?(t=t.memoizedState,t!==null&&t.dehydrated===null):!1}var HR=Math.ceil,Mu=vo.ReactCurrentDispatcher,Mm=vo.ReactCurrentOwner,K=0,Je=null,Pe=null,$e=0,ho=0,Vp=Pr(0),De=0,Gu=null,Ri=0,ma=0,Ai=0,_m=0,Kp=null,Dm=0,$p=1/0;function Li(){$p=Ke()+500}var M=null,_u=!1,Wp=null,yn=null,Tr=!1,Gs=null,Fs=90,qp=[],Gp=[],Fn=null,Ys=0,Yp=null,cu=-1,Mn=0,du=0,Xs=null,fu=!1;function yt(){return K&48?Ke():cu!==-1?cu:cu=Ke()}function Sr(e){if(e=e.mode,!(e&2))return 1;if(!(e&4))return bi()===99?1:2;if(Mn===0&&(Mn=Ri),TR.transition!==0){du!==0&&(du=Kp!==null?Kp.pendingLanes:0),e=Mn;var t=4186112&~du;return t&=-t,t===0&&(e=4186112&~e,t=e&-e,t===0&&(t=8192)),t}return e=bi(),K&4&&e===98?e=vu(12,Mn):(e=RP(e),e=vu(e,Mn)),e}function wr(e,t,n){if(50<Ys)throw Ys=0,Yp=null,Error(P(185));if(e=Yu(e,t),e===null)return null;ju(e,t,n),e===Je&&(Ai|=t,De===4&&Si(e,$e));var r=bi();t===1?K&8&&!(K&48)?Xp(e):(Ht(e,n),K===0&&(Li(),wn())):(!(K&4)||r!==98&&r!==99||(Fn===null?Fn=new Set([e]):Fn.add(e)),Ht(e,n)),Kp=e}function Yu(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}function Ht(e,t){for(var n=e.callbackNode,r=e.suspendedLanes,o=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var a=31-Cr(s),l=1<<a,u=i[a];if(u===-1){if(!(l&r)||l&o){u=t,oi(l);var c=de;i[a]=10<=c?u+250:6<=c?u+5e3:-1}}else u<=t&&(e.expiredLanes|=l);s&=~l}if(r=na(e,e===Je?$e:0),t=de,r===0)n!==null&&(n!==np&&Ip(n),e.callbackNode=null,e.callbackPriority=0);else{if(n!==null){if(e.callbackPriority===t)return;n!==np&&Ip(n)}t===15?(n=Xp.bind(null,e),Nn===null?(Nn=[n],uu=Em(Wu,qS)):Nn.push(n),n=np):t===14?n=sa(99,Xp.bind(null,e)):(n=AP(t),n=sa(n,hw.bind(null,e))),e.callbackPriority=t,e.callbackNode=n}}function hw(e){if(cu=-1,du=Mn=0,K&48)throw Error(P(327));var t=e.callbackNode;if(Rr()&&e.callbackNode!==t)return null;var n=na(e,e===Je?$e:0);if(n===0)return null;var r=n,o=K;K|=16;var i=ww();(Je!==e||$e!==r)&&(Li(),wi(e,r));do try{jR();break}catch(a){Sw(e,a)}while(1);if(Cm(),Mu.current=i,K=o,Pe!==null?r=0:(Je=null,$e=0,r=De),Ri&Ai)wi(e,0);else if(r!==0){if(r===2&&(K|=64,e.hydrate&&(e.hydrate=!1,wm(e.containerInfo)),n=TS(e),n!==0&&(r=Hs(e,n))),r===1)throw t=Gu,wi(e,0),Si(e,n),Ht(e,Ke()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=n,r){case 0:case 1:throw Error(P(345));case 2:so(e);break;case 3:if(Si(e,n),(n&62914560)===n&&(r=Dm+500-Ke(),10<r)){if(na(e,0)!==0)break;if(o=e.suspendedLanes,(o&n)!==n){yt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=y0(so.bind(null,e),r);break}so(e);break;case 4:if(Si(e,n),(n&4186112)===n)break;for(r=e.eventTimes,o=-1;0<n;){var s=31-Cr(n);i=1<<s,s=r[s],s>o&&(o=s),n&=~i}if(n=o,n=Ke()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*HR(n/1960))-n,10<n){e.timeoutHandle=y0(so.bind(null,e),n);break}so(e);break;case 5:so(e);break;default:throw Error(P(329))}}return Ht(e,Ke()),e.callbackNode===t?hw.bind(null,e):null}function Si(e,t){for(t&=~_m,t&=~Ai,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Cr(t),r=1<<n;e[n]=-1,t&=~r}}function Xp(e){if(K&48)throw Error(P(327));if(Rr(),e===Je&&e.expiredLanes&$e){var t=$e,n=Hs(e,t);Ri&Ai&&(t=na(e,t),n=Hs(e,t))}else t=na(e,0),n=Hs(e,t);if(e.tag!==0&&n===2&&(K|=64,e.hydrate&&(e.hydrate=!1,wm(e.containerInfo)),t=TS(e),t!==0&&(n=Hs(e,t))),n===1)throw n=Gu,wi(e,0),Si(e,t),Ht(e,Ke()),n;return e.finishedWork=e.current.alternate,e.finishedLanes=t,so(e),Ht(e,Ke()),null}function UR(){if(Fn!==null){var e=Fn;Fn=null,e.forEach(function(t){t.expiredLanes|=24&t.pendingLanes,Ht(t,Ke())})}wn()}function yw(e,t){var n=K;K|=1;try{return e(t)}finally{K=n,K===0&&(Li(),wn())}}function vw(e,t){var n=K;K&=-2,K|=8;try{return e(t)}finally{K=n,K===0&&(Li(),wn())}}function ru(e,t){Ee(Vp,ho),ho|=t,Ri|=t}function Fm(){ho=Vp.current,me(Vp)}function wi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,SR(n)),Pe!==null)for(n=Pe.return;n!==null;){var r=n;switch(r.tag){case 1:r=r.type.childContextTypes,r!=null&&Eu();break;case 3:Ti(),me(ft),me(We),Pm();break;case 5:km(r);break;case 4:Ti();break;case 13:me(xe);break;case 19:me(xe);break;case 10:bm(r);break;case 23:case 24:Fm()}n=n.return}Je=e,Pe=kr(e.current,null),$e=ho=Ri=t,De=0,Gu=null,_m=Ai=ma=0}function Sw(e,t){do{var n=Pe;try{if(Cm(),Ws.current=Nu,Au){for(var r=be.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Au=!1}if(ca=0,_e=Ve=be=null,qs=!1,Mm.current=null,n===null||n.return===null){De=1,Gu=t,Pe=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=$e,a.flags|=2048,a.firstEffect=a.lastEffect=null,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l;if(!(a.mode&2)){var c=a.alternate;c?(a.updateQueue=c.updateQueue,a.memoizedState=c.memoizedState,a.lanes=c.lanes):(a.updateQueue=null,a.memoizedState=null)}var f=(xe.current&1)!==0,d=s;do{var m;if(m=d.tag===13){var y=d.memoizedState;if(y!==null)m=y.dehydrated!==null;else{var v=d.memoizedProps;m=v.fallback===void 0?!1:v.unstable_avoidThisFallback!==!0?!0:!f}}if(m){var p=d.updateQueue;if(p===null){var g=new Set;g.add(u),d.updateQueue=g}else p.add(u);if(!(d.mode&2)){if(d.flags|=64,a.flags|=16384,a.flags&=-2981,a.tag===1)if(a.alternate===null)a.tag=17;else{var h=yr(-1,1);h.tag=2,vr(a,h)}a.lanes|=1;break e}l=void 0,a=t;var S=i.pingCache;if(S===null?(S=i.pingCache=new NR,l=new Set,S.set(u,l)):(l=S.get(u),l===void 0&&(l=new Set,S.set(u,l))),!l.has(a)){l.add(a);var x=WR.bind(null,i,u,a);u.then(x,x)}d.flags|=4096,d.lanes=t;break e}d=d.return}while(d!==null);l=Error((fi(a.type)||"A React component")+` suspended while rendering, but no fallback UI was specified.
|
|
8
8
|
|
|
9
|
-
Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}De!==5&&(De=2),l=Nm(l,a),d=s;do{switch(d.tag){case 3:i=l,d.flags|=4096,t&=-t,d.lanes|=t;var T=pw(d,i,t);b0(d,T);break e;case 1:i=l;var C=d.type,k=d.stateNode;if(!(d.flags&64)&&(typeof C.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(yn===null||!yn.has(k)))){d.flags|=4096,t&=-t,d.lanes|=t;var L=mw(d,i,t);b0(d,L);break e}}d=d.return}while(d!==null)}Ew(n)}catch(I){t=I,Pe===n&&n!==null&&(Pe=n=n.return);continue}break}while(1)}function ww(){var e=Mu.current;return Mu.current=Nu,e===null?Nu:e}function Hs(e,t){var n=K;K|=16;var r=ww();Je===e&&$e===t||wi(e,t);do try{BR();break}catch(o){Sw(e,o)}while(1);if(Cm(),K=n,Mu.current=r,Pe!==null)throw Error(P(261));return Je=null,$e=0,De}function BR(){for(;Pe!==null;)xw(Pe)}function jR(){for(;Pe!==null&&!ER();)xw(Pe)}function xw(e){var t=bw(e.alternate,e,ho);e.memoizedProps=e.pendingProps,t===null?Ew(e):Pe=t,Mm.current=null}function Ew(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&2048){if(n=OR(t),n!==null){n.flags&=2047,Pe=n;return}e!==null&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}else{if(n=IR(n,t,ho),n!==null){Pe=n;return}if(n=t,n.tag!==24&&n.tag!==23||n.memoizedState===null||ho&1073741824||!(n.mode&4)){for(var r=0,o=n.child;o!==null;)r|=o.lanes|o.childLanes,o=o.sibling;n.childLanes=r}e!==null&&!(e.flags&2048)&&(e.firstEffect===null&&(e.firstEffect=t.firstEffect),t.lastEffect!==null&&(e.lastEffect!==null&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(e.lastEffect!==null?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}if(t=t.sibling,t!==null){Pe=t;return}Pe=t=e}while(t!==null);De===0&&(De=5)}function so(e){var t=bi();return go(99,zR.bind(null,e,t)),null}function zR(e,t){do Rr();while(Gs!==null);if(K&48)throw Error(P(327));var n=e.finishedWork;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(P(177));e.callbackNode=null;var r=n.lanes|n.childLanes,o=r,i=e.pendingLanes&~o;e.pendingLanes=o,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=o,e.mutableReadLanes&=o,e.entangledLanes&=o,o=e.entanglements;for(var s=e.eventTimes,a=e.expirationTimes;0<i;){var l=31-Cr(i),u=1<<l;o[l]=0,s[l]=-1,a[l]=-1,i&=~u}if(Fn!==null&&!(r&24)&&Fn.has(e)&&Fn.delete(e),e===Je&&(Pe=Je=null,$e=0),1<n.flags?n.lastEffect!==null?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,r!==null){if(o=K,K|=32,Mm.current=null,Jf=iu,s=d0(),kp(s)){if("selectionStart"in s)a={start:s.selectionStart,end:s.selectionEnd};else e:if(a=(a=s.ownerDocument)&&a.defaultView||window,(u=a.getSelection&&a.getSelection())&&u.rangeCount!==0){a=u.anchorNode,i=u.anchorOffset,l=u.focusNode,u=u.focusOffset;try{a.nodeType,l.nodeType}catch{a=null;break e}var c=0,f=-1,d=-1,m=0,y=0,v=s,p=null;t:for(;;){for(var g;v!==a||i!==0&&v.nodeType!==3||(f=c+i),v!==l||u!==0&&v.nodeType!==3||(d=c+u),v.nodeType===3&&(c+=v.nodeValue.length),(g=v.firstChild)!==null;)p=v,v=g;for(;;){if(v===s)break t;if(p===a&&++m===i&&(f=c),p===l&&++y===u&&(d=c),(g=v.nextSibling)!==null)break;v=p,p=v.parentNode}v=g}a=f===-1||d===-1?null:{start:f,end:d}}else a=null;a=a||{start:0,end:0}}else a=null;ep={focusedElem:s,selectionRange:a},iu=!1,Xs=null,fu=!1,M=r;do try{VR()}catch(I){if(M===null)throw Error(P(330));xr(M,I),M=M.nextEffect}while(M!==null);Xs=null,M=r;do try{for(s=e;M!==null;){var h=M.flags;if(h&16&&Zs(M.stateNode,""),h&128){var S=M.alternate;if(S!==null){var x=S.ref;x!==null&&(typeof x=="function"?x(null):x.current=null)}}switch(h&1038){case 2:Y0(M),M.flags&=-3;break;case 6:Y0(M),M.flags&=-3,ap(M.alternate,M);break;case 1024:M.flags&=-1025;break;case 1028:M.flags&=-1025,ap(M.alternate,M);break;case 4:ap(M.alternate,M);break;case 8:a=M,gw(s,a);var T=a.alternate;q0(a),T!==null&&q0(T)}M=M.nextEffect}}catch(I){if(M===null)throw Error(P(330));xr(M,I),M=M.nextEffect}while(M!==null);if(x=ep,S=d0(),h=x.focusedElem,s=x.selectionRange,S!==h&&h&&h.ownerDocument&&NS(h.ownerDocument.documentElement,h)){for(s!==null&&kp(h)&&(S=s.start,x=s.end,x===void 0&&(x=S),"selectionStart"in h?(h.selectionStart=S,h.selectionEnd=Math.min(x,h.value.length)):(x=(S=h.ownerDocument||document)&&S.defaultView||window,x.getSelection&&(x=x.getSelection(),a=h.textContent.length,T=Math.min(s.start,a),s=s.end===void 0?T:Math.min(s.end,a),!x.extend&&T>s&&(a=s,s=T,T=a),a=c0(h,T),i=c0(h,s),a&&i&&(x.rangeCount!==1||x.anchorNode!==a.node||x.anchorOffset!==a.offset||x.focusNode!==i.node||x.focusOffset!==i.offset)&&(S=S.createRange(),S.setStart(a.node,a.offset),x.removeAllRanges(),T>s?(x.addRange(S),x.extend(i.node,i.offset)):(S.setEnd(i.node,i.offset),x.addRange(S)))))),S=[],x=h;x=x.parentNode;)x.nodeType===1&&S.push({element:x,left:x.scrollLeft,top:x.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<S.length;h++)x=S[h],x.element.scrollLeft=x.left,x.element.scrollTop=x.top}iu=!!Jf,ep=Jf=null,e.current=n,M=r;do try{for(h=e;M!==null;){var C=M.flags;if(C&36&&DR(h,M.alternate,M),C&128){S=void 0;var k=M.ref;if(k!==null){var L=M.stateNode;switch(M.tag){case 5:S=L;break;default:S=L}typeof k=="function"?k(S):k.current=S}}M=M.nextEffect}}catch(I){if(M===null)throw Error(P(330));xr(M,I),M=M.nextEffect}while(M!==null);M=null,bR(),K=o}else e.current=n;if(Tr)Tr=!1,Gs=e,Fs=t;else for(M=r;M!==null;)t=M.nextEffect,M.nextEffect=null,M.flags&8&&(C=M,C.sibling=null,C.stateNode=null),M=t;if(r=e.pendingLanes,r===0&&(yn=null),r===1?e===Yp?Ys++:(Ys=0,Yp=e):Ys=0,n=n.stateNode,po&&typeof po.onCommitFiberRoot=="function")try{po.onCommitFiberRoot(xm,n,void 0,(n.current.flags&64)===64)}catch{}if(Ht(e,Ke()),_u)throw _u=!1,e=Wp,Wp=null,e;return K&8||wn(),null}function VR(){for(;M!==null;){var e=M.alternate;fu||Xs===null||(M.flags&8?Qv(M,Xs)&&(fu=!0):M.tag===13&&FR(e,M)&&Qv(M,Xs)&&(fu=!0));var t=M.flags;t&256&&_R(e,M),!(t&512)||Tr||(Tr=!0,sa(97,function(){return Rr(),null})),M=M.nextEffect}}function Rr(){if(Fs!==90){var e=97<Fs?97:Fs;return Fs=90,go(e,$R)}return!1}function KR(e,t){qp.push(t,e),Tr||(Tr=!0,sa(97,function(){return Rr(),null}))}function Cw(e,t){Gp.push(t,e),Tr||(Tr=!0,sa(97,function(){return Rr(),null}))}function $R(){if(Gs===null)return!1;var e=Gs;if(Gs=null,K&48)throw Error(P(331));var t=K;K|=32;var n=Gp;Gp=[];for(var r=0;r<n.length;r+=2){var o=n[r],i=n[r+1],s=o.destroy;if(o.destroy=void 0,typeof s=="function")try{s()}catch(l){if(i===null)throw Error(P(330));xr(i,l)}}for(n=qp,qp=[],r=0;r<n.length;r+=2){o=n[r],i=n[r+1];try{var a=o.create;o.destroy=a()}catch(l){if(i===null)throw Error(P(330));xr(i,l)}}for(a=e.current.firstEffect;a!==null;)e=a.nextEffect,a.nextEffect=null,a.flags&8&&(a.sibling=null,a.stateNode=null),a=e;return K=t,wn(),!0}function Q0(e,t,n){t=Nm(n,t),t=pw(e,t,1),vr(e,t),t=yt(),e=Yu(e,1),e!==null&&(ju(e,1,t),Ht(e,t))}function xr(e,t){if(e.tag===3)Q0(e,e,t);else for(var n=e.return;n!==null;){if(n.tag===3){Q0(n,e,t);break}else if(n.tag===1){var r=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(yn===null||!yn.has(r))){e=Nm(t,e);var o=mw(n,e,1);if(vr(n,o),o=yt(),n=Yu(n,1),n!==null)ju(n,1,o),Ht(n,o);else if(typeof r.componentDidCatch=="function"&&(yn===null||!yn.has(r)))try{r.componentDidCatch(t,e)}catch{}break}}n=n.return}}function WR(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=yt(),e.pingedLanes|=e.suspendedLanes&n,Je===e&&($e&n)===n&&(De===4||De===3&&($e&62914560)===$e&&500>Ke()-Dm?wi(e,0):_m|=n),Ht(e,t)}function qR(e,t){var n=e.stateNode;n!==null&&n.delete(t),t=0,t===0&&(t=e.mode,t&2?t&4?(Mn===0&&(Mn=Ri),t=ii(62914560&~Mn),t===0&&(t=4194304)):t=bi()===99?1:2:t=1),n=yt(),e=Yu(e,t),e!==null&&(ju(e,t,n),Ht(e,n))}var bw;bw=function(e,t,n){var r=t.lanes;if(e!==null)if(e.memoizedProps!==t.pendingProps||ft.current)Jt=!0;else if(n&r)Jt=!!(e.flags&16384);else{switch(Jt=!1,t.tag){case 3:F0(t),op();break;case 5:R0(t);break;case 1:pt(t.type)&&lu(t);break;case 4:Mp(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var o=t.type._context;Ee(Cu,o._currentValue),o._currentValue=r;break;case 13:if(t.memoizedState!==null)return n&t.child.childLanes?H0(e,t,n):(Ee(xe,xe.current&1),t=Dn(e,t,n),t!==null?t.sibling:null);Ee(xe,xe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&64){if(r)return V0(e,t,n);t.flags|=64}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Ee(xe,xe.current),r)break;return null;case 23:case 24:return t.lanes=0,ip(e,t,n)}return Dn(e,t,n)}else Jt=!1;switch(t.lanes=0,t.tag){case 2:if(r=t.type,e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,o=Ci(t,We.current),yi(t,n),o=Am(null,t,r,e,o,n),t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,pt(r)){var i=!0;lu(t)}else i=!1;t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Tm(t);var s=r.getDerivedStateFromProps;typeof s=="function"&&ku(t,r,s,e),o.updater=qu,t.stateNode=o,o._reactInternals=t,Np(t,r,e,n),t=Hp(null,t,r,!0,i,n)}else t.tag=0,dt(null,t,o,n),t=t.child;return t;case 16:o=t.elementType;e:{switch(e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=o._init,o=i(o._payload),t.type=o,i=t.tag=YR(o),e=Zt(o,e),i){case 0:t=Fp(null,t,o,e,n);break e;case 1:t=D0(null,t,o,e,n);break e;case 11:t=M0(null,t,o,e,n);break e;case 14:t=_0(null,t,o,Zt(o.type,e),r,n);break e}throw Error(P(306,o,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Zt(r,o),Fp(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Zt(r,o),D0(e,t,r,o,n);case 3:if(F0(t),r=t.updateQueue,e===null||r===null)throw Error(P(282));if(r=t.pendingProps,o=t.memoizedState,o=o!==null?o.element:null,YS(e,t),aa(t,r,null,n),r=t.memoizedState.element,r===o)op(),t=Dn(e,t,n);else{if(o=t.stateNode,(i=o.hydrate)&&(pr=hi(t.stateNode.containerInfo.firstChild),_n=t,i=Sn=!0),i){if(e=o.mutableSourceEagerHydrationData,e!=null)for(o=0;o<e.length;o+=2)i=e[o],i._workInProgressVersionPrimary=e[o+1],vi.push(i);for(n=JS(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|1024,n=n.sibling}else dt(e,t,r,n),op();t=t.child}return t;case 5:return R0(t),e===null&&_p(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Ap(r,o)?s=null:i!==null&&Ap(r,i)&&(t.flags|=16),uw(e,t),dt(e,t,s,n),t.child;case 6:return e===null&&_p(t),null;case 13:return H0(e,t,n);case 4:return Mp(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Pu(t,null,r,n):dt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Zt(r,o),M0(e,t,r,o,n);case 7:return dt(e,t,t.pendingProps,n),t.child;case 8:return dt(e,t,t.pendingProps.children,n),t.child;case 12:return dt(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,o=t.pendingProps,s=t.memoizedProps,i=o.value;var a=t.type._context;if(Ee(Cu,a._currentValue),a._currentValue=i,s!==null)if(a=s.value,i=Mt(a,i)?0:(typeof r._calculateChangedBits=="function"?r._calculateChangedBits(a,i):1073741823)|0,i===0){if(s.children===o.children&&!ft.current){t=Dn(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){s=a.child;for(var u=l.firstContext;u!==null;){if(u.context===r&&u.observedBits&i){a.tag===1&&(u=yr(-1,n&-n),u.tag=2,vr(a,u)),a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),GS(a.return,n),l.lanes|=n;break}u=u.next}}else s=a.tag===10&&a.type===t.type?null:a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===t){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}dt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,i=t.pendingProps,r=i.children,yi(t,n),o=Ft(o,i.unstable_observedBits),r=r(o),t.flags|=1,dt(e,t,r,n),t.child;case 14:return o=t.type,i=Zt(o,t.pendingProps),i=Zt(o.type,i),_0(e,t,o,i,r,n);case 15:return lw(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Zt(r,o),e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,pt(r)?(e=!0,lu(t)):e=!1,yi(t,n),QS(t,r,o),Np(t,r,o,n),Hp(null,t,r,!0,e,n);case 19:return V0(e,t,n);case 23:return ip(e,t,n);case 24:return ip(e,t,n)}throw Error(P(156,t.tag))};function GR(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function _t(e,t,n,r){return new GR(e,t,n,r)}function Hm(e){return e=e.prototype,!(!e||!e.isReactComponent)}function YR(e){if(typeof e=="function")return Hm(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Hu)return 11;if(e===Uu)return 14}return 2}function kr(e,t){var n=e.alternate;return n===null?(n=_t(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function pu(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Hm(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case cr:return xi(n.children,o,i,t);case eS:s=8,o|=16;break;case em:s=8,o|=1;break;case Us:return e=_t(12,n,t,o|8),e.elementType=Us,e.type=Us,e.lanes=i,e;case Bs:return e=_t(13,n,t,o),e.type=Bs,e.elementType=Bs,e.lanes=i,e;case mu:return e=_t(19,n,t,o),e.elementType=mu,e.lanes=i,e;case sm:return Um(n,o,i,t);case dp:return e=_t(24,n,t,o),e.elementType=dp,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case tm:s=10;break e;case nm:s=9;break e;case Hu:s=11;break e;case Uu:s=14;break e;case rm:s=16,r=null;break e;case om:s=22;break e}throw Error(P(130,e==null?e:typeof e,""))}return t=_t(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function xi(e,t,n,r){return e=_t(7,e,r,t),e.lanes=n,e}function Um(e,t,n,r){return e=_t(23,e,r,t),e.elementType=sm,e.lanes=n,e}function lp(e,t,n){return e=_t(6,e,null,t),e.lanes=n,e}function up(e,t,n){return t=_t(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function XR(e,t,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=qf(0),this.expirationTimes=qf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qf(0),this.mutableSourceEagerHydrationData=null}function QR(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ao,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Du(e,t,n,r){var o=t.current,i=yt(),s=Sr(o);e:if(n){n=n._reactInternals;t:{if(So(n)!==n||n.tag!==1)throw Error(P(170));var a=n;do{switch(a.tag){case 3:a=a.stateNode.context;break t;case 1:if(pt(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break t}}a=a.return}while(a!==null);throw Error(P(171))}if(n.tag===1){var l=n.type;if(pt(l)){n=jS(n,l,a);break e}}n=a}else n=br;return t.context===null?t.context=n:t.pendingContext=n,t=yr(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),vr(o,t),wr(o,s,i),s}function cp(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Z0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Bm(e,t){Z0(e,t),(e=e.alternate)&&Z0(e,t)}function ZR(){return null}function jm(e,t,n){var r=n!=null&&n.hydrationOptions!=null&&n.hydrationOptions.mutableSources||null;if(n=new XR(e,t,n!=null&&n.hydrate===!0),t=_t(3,null,null,t===2?7:t===1?3:0),n.current=t,t.stateNode=n,Tm(t),e[Pi]=n.current,DS(e.nodeType===8?e.parentNode:e),r)for(e=0;e<r.length;e++){t=r[e];var o=t._getVersion;o=o(t._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[t,o]:n.mutableSourceEagerHydrationData.push(t,o)}this._internalRoot=n}jm.prototype.render=function(e){Du(e,this._internalRoot,null,null)};jm.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;Du(null,e,null,function(){t[Pi]=null})};function ga(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function JR(e,t){if(t||(t=e?e.nodeType===9?e.documentElement:e.firstChild:null,t=!(!t||t.nodeType!==1||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new jm(e,0,t?{hydrate:!0}:void 0)}function Xu(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i._internalRoot;if(typeof o=="function"){var a=o;o=function(){var u=cp(s);a.call(u)}}Du(t,s,e,o)}else{if(i=n._reactRootContainer=JR(n,r),s=i._internalRoot,typeof o=="function"){var l=o;o=function(){var u=cp(s);l.call(u)}}vw(function(){Du(t,s,e,o)})}return cp(s)}gS=function(e){if(e.tag===13){var t=yt();wr(e,4,t),Bm(e,4)}};dm=function(e){if(e.tag===13){var t=yt();wr(e,67108864,t),Bm(e,67108864)}};hS=function(e){if(e.tag===13){var t=yt(),n=Sr(e);wr(e,n,t),Bm(e,n)}};yS=function(e,t){return t()};xp=function(e,t,n){switch(t){case"input":if(pp(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=$u(r);if(!o)throw Error(P(90));nS(r),pp(r,o)}}}break;case"textarea":oS(e,n);break;case"select":t=n.value,t!=null&&pi(e,!!n.multiple,t,!1)}};lm=yw;dS=function(e,t,n,r,o){var i=K;K|=4;try{return go(98,e.bind(null,t,n,r,o))}finally{K=i,K===0&&(Li(),wn())}};um=function(){!(K&49)&&(UR(),Rr())};fS=function(e,t){var n=K;K|=2;try{return e(t)}finally{K=n,K===0&&(Li(),wn())}};function Tw(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ga(t))throw Error(P(200));return QR(e,t,null,n)}var eA={Events:[fa,ui,$u,uS,cS,Rr,{current:!1}]},Os={findFiberByHostInstance:uo,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},tA={bundleType:Os.bundleType,version:Os.version,rendererPackageName:Os.rendererPackageName,rendererConfig:Os.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:vo.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=mS(e),e===null?null:e.stateNode},findFiberByHostInstance:Os.findFiberByHostInstance||ZR,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Ns=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Ns.isDisabled&&Ns.supportsFiber))try{xm=Ns.inject(tA),po=Ns}catch{}var Ns;Ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=eA;Ut.createPortal=Tw;Ut.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(P(188)):Error(P(268,Object.keys(e)));return e=mS(t),e=e===null?null:e.stateNode,e};Ut.flushSync=function(e,t){var n=K;if(n&48)return e(t);K|=1;try{if(e)return go(99,e.bind(null,t))}finally{K=n,wn()}};Ut.hydrate=function(e,t,n){if(!ga(t))throw Error(P(200));return Xu(null,e,t,!0,n)};Ut.render=function(e,t,n){if(!ga(t))throw Error(P(200));return Xu(null,e,t,!1,n)};Ut.unmountComponentAtNode=function(e){if(!ga(e))throw Error(P(40));return e._reactRootContainer?(vw(function(){Xu(null,null,e,!1,function(){e._reactRootContainer=null,e[Pi]=null})}),!0):!1};Ut.unstable_batchedUpdates=yw;Ut.unstable_createPortal=function(e,t){return Tw(e,t,2<arguments.length&&arguments[2]!==void 0?arguments[2]:null)};Ut.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!ga(n))throw Error(P(200));if(e==null||e._reactInternals===void 0)throw Error(P(38));return Xu(e,t,n,!1,r)};Ut.version="17.0.2"});var Qu=Ce((c_,Rw)=>{"use strict";function Pw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Pw)}catch(e){console.error(e)}}Pw(),Rw.exports=kw()});var nx=Ce(tx=>{"use strict";var Di=D();function UA(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var BA=typeof Object.is=="function"?Object.is:UA,jA=Di.useState,zA=Di.useEffect,VA=Di.useLayoutEffect,KA=Di.useDebugValue;function $A(e,t){var n=t(),r=jA({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return VA(function(){o.value=n,o.getSnapshot=t,mg(o)&&i({inst:o})},[e,n,t]),zA(function(){return mg(o)&&i({inst:o}),e(function(){mg(o)&&i({inst:o})})},[e]),KA(n),n}function mg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!BA(e,n)}catch{return!0}}function WA(e,t){return t()}var qA=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?WA:$A;tx.useSyncExternalStore=Di.useSyncExternalStore!==void 0?Di.useSyncExternalStore:qA});var gg=Ce((Q_,rx)=>{"use strict";rx.exports=nx()});var ix=Ce(ox=>{"use strict";var ic=D(),GA=gg();function YA(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var XA=typeof Object.is=="function"?Object.is:YA,QA=GA.useSyncExternalStore,ZA=ic.useRef,JA=ic.useEffect,eL=ic.useMemo,tL=ic.useDebugValue;ox.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=ZA(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=eL(function(){function l(m){if(!u){if(u=!0,c=m,m=r(m),o!==void 0&&s.hasValue){var y=s.value;if(o(y,m))return f=y}return f=m}if(y=f,XA(c,m))return y;var v=r(m);return o!==void 0&&o(y,v)?y:(c=m,f=v)}var u=!1,c,f,d=n===void 0?null:n;return[function(){return l(t())},d===null?void 0:function(){return l(d())}]},[t,n,r,o]);var a=QA(e,i[0],i[1]);return JA(function(){s.hasValue=!0,s.value=a},[a]),tL(a),a}});var ax=Ce((J_,sx)=>{"use strict";sx.exports=ix()});var vx=Ce(ie=>{"use strict";var Me=typeof Symbol=="function"&&Symbol.for,yg=Me?Symbol.for("react.element"):60103,vg=Me?Symbol.for("react.portal"):60106,uc=Me?Symbol.for("react.fragment"):60107,cc=Me?Symbol.for("react.strict_mode"):60108,dc=Me?Symbol.for("react.profiler"):60114,fc=Me?Symbol.for("react.provider"):60109,pc=Me?Symbol.for("react.context"):60110,Sg=Me?Symbol.for("react.async_mode"):60111,mc=Me?Symbol.for("react.concurrent_mode"):60111,gc=Me?Symbol.for("react.forward_ref"):60112,hc=Me?Symbol.for("react.suspense"):60113,iL=Me?Symbol.for("react.suspense_list"):60120,yc=Me?Symbol.for("react.memo"):60115,vc=Me?Symbol.for("react.lazy"):60116,sL=Me?Symbol.for("react.block"):60121,aL=Me?Symbol.for("react.fundamental"):60117,lL=Me?Symbol.for("react.responder"):60118,uL=Me?Symbol.for("react.scope"):60119;function wt(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case yg:switch(e=e.type,e){case Sg:case mc:case uc:case dc:case cc:case hc:return e;default:switch(e=e&&e.$$typeof,e){case pc:case gc:case vc:case yc:case fc:return e;default:return t}}case vg:return t}}}function yx(e){return wt(e)===mc}ie.AsyncMode=Sg;ie.ConcurrentMode=mc;ie.ContextConsumer=pc;ie.ContextProvider=fc;ie.Element=yg;ie.ForwardRef=gc;ie.Fragment=uc;ie.Lazy=vc;ie.Memo=yc;ie.Portal=vg;ie.Profiler=dc;ie.StrictMode=cc;ie.Suspense=hc;ie.isAsyncMode=function(e){return yx(e)||wt(e)===Sg};ie.isConcurrentMode=yx;ie.isContextConsumer=function(e){return wt(e)===pc};ie.isContextProvider=function(e){return wt(e)===fc};ie.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===yg};ie.isForwardRef=function(e){return wt(e)===gc};ie.isFragment=function(e){return wt(e)===uc};ie.isLazy=function(e){return wt(e)===vc};ie.isMemo=function(e){return wt(e)===yc};ie.isPortal=function(e){return wt(e)===vg};ie.isProfiler=function(e){return wt(e)===dc};ie.isStrictMode=function(e){return wt(e)===cc};ie.isSuspense=function(e){return wt(e)===hc};ie.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===uc||e===mc||e===dc||e===cc||e===hc||e===iL||typeof e=="object"&&e!==null&&(e.$$typeof===vc||e.$$typeof===yc||e.$$typeof===fc||e.$$typeof===pc||e.$$typeof===gc||e.$$typeof===aL||e.$$typeof===lL||e.$$typeof===uL||e.$$typeof===sL)};ie.typeOf=wt});var wx=Ce((pD,Sx)=>{"use strict";Sx.exports=vx()});var Px=Ce((mD,kx)=>{"use strict";var wg=wx(),cL={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},dL={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},fL={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},bx={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},xg={};xg[wg.ForwardRef]=fL;xg[wg.Memo]=bx;function xx(e){return wg.isMemo(e)?bx:xg[e.$$typeof]||cL}var pL=Object.defineProperty,mL=Object.getOwnPropertyNames,Ex=Object.getOwnPropertySymbols,gL=Object.getOwnPropertyDescriptor,hL=Object.getPrototypeOf,Cx=Object.prototype;function Tx(e,t,n){if(typeof t!="string"){if(Cx){var r=hL(t);r&&r!==Cx&&Tx(e,r,n)}var o=mL(t);Ex&&(o=o.concat(Ex(t)));for(var i=xx(e),s=xx(t),a=0;a<o.length;++a){var l=o[a];if(!dL[l]&&!(n&&n[l])&&!(s&&s[l])&&!(i&&i[l])){var u=gL(t,l);try{pL(e,l,u)}catch{}}}}return e}kx.exports=Tx});var Ax=Ce(se=>{"use strict";var Eg=Symbol.for("react.element"),Cg=Symbol.for("react.portal"),Sc=Symbol.for("react.fragment"),wc=Symbol.for("react.strict_mode"),xc=Symbol.for("react.profiler"),Ec=Symbol.for("react.provider"),Cc=Symbol.for("react.context"),yL=Symbol.for("react.server_context"),bc=Symbol.for("react.forward_ref"),Tc=Symbol.for("react.suspense"),kc=Symbol.for("react.suspense_list"),Pc=Symbol.for("react.memo"),Rc=Symbol.for("react.lazy"),vL=Symbol.for("react.offscreen"),Rx;Rx=Symbol.for("react.module.reference");function jt(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Eg:switch(e=e.type,e){case Sc:case xc:case wc:case Tc:case kc:return e;default:switch(e=e&&e.$$typeof,e){case yL:case Cc:case bc:case Rc:case Pc:case Ec:return e;default:return t}}case Cg:return t}}}se.ContextConsumer=Cc;se.ContextProvider=Ec;se.Element=Eg;se.ForwardRef=bc;se.Fragment=Sc;se.Lazy=Rc;se.Memo=Pc;se.Portal=Cg;se.Profiler=xc;se.StrictMode=wc;se.Suspense=Tc;se.SuspenseList=kc;se.isAsyncMode=function(){return!1};se.isConcurrentMode=function(){return!1};se.isContextConsumer=function(e){return jt(e)===Cc};se.isContextProvider=function(e){return jt(e)===Ec};se.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Eg};se.isForwardRef=function(e){return jt(e)===bc};se.isFragment=function(e){return jt(e)===Sc};se.isLazy=function(e){return jt(e)===Rc};se.isMemo=function(e){return jt(e)===Pc};se.isPortal=function(e){return jt(e)===Cg};se.isProfiler=function(e){return jt(e)===xc};se.isStrictMode=function(e){return jt(e)===wc};se.isSuspense=function(e){return jt(e)===Tc};se.isSuspenseList=function(e){return jt(e)===kc};se.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Sc||e===xc||e===wc||e===Tc||e===kc||e===vL||typeof e=="object"&&e!==null&&(e.$$typeof===Rc||e.$$typeof===Pc||e.$$typeof===Ec||e.$$typeof===Cc||e.$$typeof===bc||e.$$typeof===Rx||e.getModuleId!==void 0)};se.typeOf=jt});var Ix=Ce((hD,Lx)=>{"use strict";Lx.exports=Ax()});var Jg=Ce((N5,nE)=>{"use strict";var CI="Expected a function",eE=NaN,bI="[object Symbol]",TI=/^\s+|\s+$/g,kI=/^[-+]0x[0-9a-f]+$/i,PI=/^0b[01]+$/i,RI=/^0o[0-7]+$/i,AI=parseInt,LI=typeof global=="object"&&global&&global.Object===Object&&global,II=typeof self=="object"&&self&&self.Object===Object&&self,OI=LI||II||Function("return this")(),NI=Object.prototype,MI=NI.toString,_I=Math.max,DI=Math.min,Qg=function(){return OI.Date.now()};function FI(e,t,n){var r,o,i,s,a,l,u=0,c=!1,f=!1,d=!0;if(typeof e!="function")throw new TypeError(CI);t=tE(t)||0,Zg(n)&&(c=!!n.leading,f="maxWait"in n,i=f?_I(tE(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d);function m(C){var k=r,L=o;return r=o=void 0,u=C,s=e.apply(L,k),s}function y(C){return u=C,a=setTimeout(g,t),c?m(C):s}function v(C){var k=C-l,L=C-u,I=t-k;return f?DI(I,i-L):I}function p(C){var k=C-l,L=C-u;return l===void 0||k>=t||k<0||f&&L>=i}function g(){var C=Qg();if(p(C))return h(C);a=setTimeout(g,v(C))}function h(C){return a=void 0,d&&r?m(C):(r=o=void 0,s)}function S(){a!==void 0&&clearTimeout(a),u=0,r=l=o=a=void 0}function x(){return a===void 0?s:h(Qg())}function T(){var C=Qg(),k=p(C);if(r=arguments,o=this,l=C,k){if(a===void 0)return y(l);if(f)return a=setTimeout(g,t),m(l)}return a===void 0&&(a=setTimeout(g,t)),s}return T.cancel=S,T.flush=x,T}function Zg(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function HI(e){return!!e&&typeof e=="object"}function UI(e){return typeof e=="symbol"||HI(e)&&MI.call(e)==bI}function tE(e){if(typeof e=="number")return e;if(UI(e))return eE;if(Zg(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Zg(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(TI,"");var n=PI.test(e);return n||RI.test(e)?AI(e.slice(2),n?2:8):kI.test(e)?eE:+e}nE.exports=FI});var dE=Ce((Z5,cE)=>{"use strict";var WI=/["'&<>]/;cE.exports=qI;function qI(e){var t=""+e,n=WI.exec(t);if(!n)return t;var r,o="",i=0,s=0;for(i=n.index;i<t.length;i++){switch(t.charCodeAt(i)){case 34:r=""";break;case 38:r="&";break;case 39:r="'";break;case 60:r="<";break;case 62:r=">";break;default:continue}s!==i&&(o+=t.substring(s,i)),s=i+1,o+=r}return s!==i?o+t.substring(s,i):o}});var a2={};Qe(a2,{Card:()=>fe,ContentEditableInput:()=>zo,DeepdeskAPI:()=>or,DeepdeskSDK:()=>yl,HTTPClient:()=>pn,InputMediator:()=>rr,InputType:()=>oo,KeyboardHint:()=>Ml,Label:()=>_l,Locale:()=>Ca,Section:()=>In,SectionList:()=>Dl,Sources:()=>On,Suggestion:()=>oe,SuggestionList:()=>ht,TextAreaInput:()=>Vo,ToggleButton:()=>ro,attachFile:()=>ak,authenticateWithKey:()=>ik,createFullRange:()=>as,createOverlayContainer:()=>hl,createRangeFromOffsets:()=>Gr,escapeHTML:()=>Wi,fetchPlatformConfig:()=>sk,formatTextMarkup:()=>ok,getRangeOffsets:()=>fl,getRangeText:()=>pl,insertCKEditor:()=>rk,isHTML:()=>Sd,isSupportedInputElement:()=>ff,updateContentEditable:()=>tk,updateTextArea:()=>ek,useStyles:()=>A,waitForElementVisibilityChange:()=>gf});var Lf=w(te()),Ot=w(D());var Ll=w(D()),av=w(te()),hs=Ll.default.createContext({});function A(e,t){let{debug:n,...r}=(0,Ll.useContext)(hs),o=r[e];return o?Object.entries(t).reduce((i,[s,a])=>{let l=o[s];return{...i,[s]:(0,av.default)(a,l,n?`${e}__${s}`:!1)}},{}):t}var lv={root:"jo"};var Jr=w(b()),Il=()=>(0,Jr.jsxs)("svg",{className:lv.root,width:"185",height:"170",viewBox:"0 0 185 170",xmlns:"http://www.w3.org/2000/svg",children:[(0,Jr.jsx)("defs",{children:(0,Jr.jsx)("style",{children:".cls-1 { fill: #b3b3b3; }"})}),(0,Jr.jsx)("title",{children:"Failed loading image"}),(0,Jr.jsx)("path",{className:"cls-1",d:"M15 130.896V16.994c0-1.097.898-1.994 2.007-1.994h150.986A2 2 0 0 1 170 16.994v69.147L133.015 51 87.26 120.377l-35.863-17.758L15 130.896zM2 0C.895 0 0 .887 0 2v166c0 1.105.887 2 2 2h181c1.105 0 2-.887 2-2V2c0-1.105-.887-2-2-2H2zm49 72c11.046 0 20-9.178 20-20.5S62.046 31 51 31s-20 9.178-20 20.5S39.954 72 51 72z",fillRule:"evenodd"})]});var Af={root:"Yo",imageWrapper:"F",image:"qo",content:"m",title:"Co",contentIsCropped:"So",lineClamp:"Eo"};var eo=w(b()),Ol=(0,Ot.createContext)(Af),Hk=({title:e,src:t})=>{let n=(0,Ot.useContext)(Ol),[r,o]=(0,Ot.useState)(!1);return(0,Ot.useEffect)(()=>{o(!1)},[t]),(0,eo.jsx)("div",{className:n.imageWrapper,children:t&&!r?(0,eo.jsx)("img",{className:n.image,alt:e,src:t,onError:()=>o(!0)}):(0,eo.jsx)(Il,{})})},Uk=({className:e,lineClamp:t=!1,cropText:n=!1,children:r})=>{let o=(0,Ot.useContext)(Ol);return(0,eo.jsx)("div",{className:(0,Lf.default)(o.content,e,{[o.contentIsCropped]:n,[o.lineClamp]:t}),children:r})},Bk=({as:e="h1",cropText:t=!1,className:n,children:r,...o})=>{let i=(0,Ot.useContext)(Ol);return Ot.default.createElement(e,{className:(0,Lf.default)(i.title,n,{[i.contentIsCropped]:t}),...o},r)},Nl=({children:e})=>{let t=A("Card",Af);return(0,eo.jsx)("div",{className:t.root,children:(0,eo.jsx)(Ol.Provider,{value:t,children:e})})};Nl.Image=Hk;Nl.Content=Uk;Nl.Title=Bk;var fe=Nl;var mv=w(te());var pv={root:"H"};var gv=w(b());var zk={"arrow-up":"\u25B2","arrow-down":"\u25BC",tab:"tab",esc:"Esc",enter:"\u21B5"},Vk=({className:e,keyCode:t,...n})=>{let r=A("KeyboardHint",pv);return(0,gv.jsx)("span",{"data-key":zk[t],className:(0,mv.default)(e,r.root),...n})},Ml=Vk;var yv=w(te());var hv={root:"Go"};var vv=w(b()),$k=({className:e,children:t,...n})=>{let r=A("Label",hv);return(0,vv.jsx)("span",{...n,className:(0,yv.default)(e,r.root),children:t})},_l=$k;var Sv={root:"No",subTitleContainer:"Ao",subtitle:"Fo",suggestions:"Ho"};var Zo=w(b()),qk=({title:e,children:t,type:n,...r})=>{let o=A("Section",Sv);return(0,Zo.jsxs)("section",{...r,className:o.root,"data-section-type":n,children:[e&&(0,Zo.jsx)("div",{className:o.subTitleContainer,children:(0,Zo.jsx)("span",{className:o.subtitle,children:e})}),(0,Zo.jsx)("div",{className:o.suggestions,children:t})]})},In=qk;var xv=w(te()),Ev=w(D());var wv={root:"Lo"};var Cv=w(b()),Yk=Ev.default.forwardRef(({className:e,children:t},n)=>{let r=A("SectionList",wv);return(0,Cv.jsx)("div",{ref:n,className:(0,xv.default)(r.root,e),children:t})}),Dl=Yk;var Jo=w(te()),Ze=w(D());var If={fadein:"L",root:"e",isClickable:"M",isSelected:"Mo",actions:"R",actionsIsFixed:"Ro",actionButton:"t",dropdownList:"T",dropdownButton:"U",dropdownItem:"B",dropdownItemButton:"D",actionButtonIsPrimary:"To",actionButtonIsDisabled:"Uo",labels:"Bo",label:"Do",iconButtons:"I",iconButton:"n"};var ut=w(b()),to=(0,Ze.createContext)(If),Qk=({fixed:e,children:t,...n})=>{let r=(0,Ze.useContext)(to);return(0,ut.jsx)("div",{...n,className:(0,Jo.default)(r.actions,{[r.actionsIsFixed]:e}),children:t})};function bv(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type===Tv}var Tv=({className:e,icon:t,title:n,...r})=>{let o=(0,Ze.useContext)(to);return(0,ut.jsx)("button",{type:"button",className:(0,Jo.default)(o.iconButton,e),title:n,"aria-label":n,...r,children:t})},Zk=({className:e,primary:t,disabled:n,label:r,children:o})=>{let i=(0,Ze.useContext)(to);return(0,ut.jsxs)("div",{className:(0,Jo.default)(e,i.actionButton,i.dropdownButton,{[i.actionButtonIsPrimary]:t,[i.actionButtonIsDisabled]:n}),onMouseDown:s=>s.stopPropagation(),onClick:s=>s.stopPropagation(),children:[r,(0,ut.jsx)("ul",{className:i.dropdownList,children:o})]})},Jk=({index:e,label:t,onClick:n})=>{let r=(0,Ze.useContext)(to);return(0,ut.jsx)("li",{className:r.dropdownItem,children:(0,ut.jsx)("button",{className:r.dropdownItemButton,type:"button","data-index":e,onClick:n,children:t})})},eP=({className:e,primary:t,disabled:n,onClick:r,label:o})=>{let i=(0,Ze.useContext)(to);return(0,ut.jsx)("button",{type:"button",className:(0,Jo.default)(e,i.actionButton,{[i.actionButtonIsPrimary]:t,[i.actionButtonIsDisabled]:n}),onClick:r??(s=>s.stopPropagation()),disabled:n,"aria-hidden":n,children:o})},tP=({labels:e})=>{let t=(0,Ze.useContext)(to);return(0,ut.jsx)("div",{className:t.labels,children:e.map(n=>(0,ut.jsx)("span",{className:t.label,children:n},n))})},no=Ze.default.forwardRef(({className:e,selected:t,onClick:n,children:r,as:o="div",...i},s)=>{let a=A("Suggestion",If),l=(0,Ze.useCallback)(f=>{f.preventDefault(),n&&n(f)},[n]),u=Ze.default.Children.toArray(r).filter(bv),c=Ze.default.Children.toArray(r).filter(f=>!bv(f));return(0,ut.jsx)(o,{...i,ref:s,className:(0,Jo.default)(e,a.root,{[a.isSelected]:t,[a.isClickable]:!!n}),onClick:l,children:(0,ut.jsxs)(to.Provider,{value:a,children:[c,(0,ut.jsx)("div",{className:a.iconButtons,children:u})]})})});no.Labels=tP;no.Actions=Qk;no.ActionButton=eP;no.DropdownButton=Zk;no.DropdownItem=Jk;no.IconButton=Tv;var oe=no;var Pv=w(te());var kv={root:"Io",isWithDivider:"Oo"};var Rv=w(b()),rP=({withDivider:e,children:t})=>{let n=A("SuggestionList",kv);return(0,Rv.jsx)("div",{"data-testid":"suggestions-overlay-list",className:(0,Pv.default)(n.root,{[n.isWithDivider]:e}),children:t})},ht=rP;var Lv=w(te());var Av={root:"u",isCollapsed:"O"};var Fl=w(b()),iP=({className:e,isCollapsed:t,title:n,onClick:r})=>{let o=A("ToggleButton",Av);return(0,Fl.jsx)("button",{type:"button",className:(0,Lv.default)(o.root,e,{[o.isCollapsed]:t}),onClick:r,title:n,children:(0,Fl.jsx)("svg",{width:"14",height:"8",viewBox:"-2.5 -5 75 60",preserveAspectRatio:"none",children:(0,Fl.jsx)("path",{d:"M0,0 l35,50 l35,-50",fill:"none",stroke:"grey",strokeLinecap:"round",strokeWidth:"6"})})})},ro=iP;var Iv=/(?:[.,;:!?\\n]|:\\)|:\\(|:-\\)|:-\\()/g,Hl=/(((\$!\{)|(\{))[a-zA-Z0-9_.]+\})/g;var Ov=/x-deepdesk-(([a-z0-9\-_])+-version)/,On=(v=>(v.SEARCH="search",v.TEMPLATE="template",v.ELASTIC_SEARCH="search-autocomplete",v.GPT="gpt",v.TRIE="trie",v.TRIE_WITH_TYPOS="trie-with-typos",v.SEMANTIC="semantic",v.TEXT_RECOMMENDATION="text_recommendation",v.URL_RECOMMENDATION="url_recommendation",v.LINK_RECOMMENDATION="link_recommendation",v.PERSONAL_COLLECTION="personal-collection",v.PERSONAL_COLLECTION_SEARCH="personal-collection-search",v.SEARCH_OVERLAY="search-overlay",v.SEARCH_PREVIEW="search-preview",v.SEARCH_URL="search-url",v))(On||{}),oo=(i=>(i.ENTER="enter",i.TAB="tab",i.ARROW="arrow",i.HOTKEY="hotkey",i.MOUSE="mouse",i))(oo||{});var qt=w(Qu());var cC=w(D());function Bt(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(!1)var o,i;throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map(function(s){return"'"+s+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Un(e){return!!e&&!!e[ve]}function en(e){var t;return!!e&&(function(n){if(!n||typeof n!="object")return!1;var r=Object.getPrototypeOf(n);if(r===null)return!0;var o=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return o===Object||typeof o=="function"&&Function.toString.call(o)===uA}(e)||Array.isArray(e)||!!e[_w]||!!(!((t=e.constructor)===null||t===void 0)&&t[_w])||Xm(e)||Qm(e))}function xo(e,t,n){n===void 0&&(n=!1),Ni(e)===0?(n?Object.keys:Oi)(e).forEach(function(r){n&&typeof r=="symbol"||t(r,e[r],e)}):e.forEach(function(r,o){return t(o,r,e)})}function Ni(e){var t=e[ve];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Xm(e)?2:Qm(e)?3:0}function Ii(e,t){return Ni(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function nA(e,t){return Ni(e)===2?e.get(t):e[t]}function Dw(e,t,n){var r=Ni(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Fw(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function Xm(e){return aA&&e instanceof Map}function Qm(e){return lA&&e instanceof Set}function Ar(e){return e.o||e.t}function Zm(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=Bw(e);delete t[ve];for(var n=Oi(t),r=0;r<n.length;r++){var o=n[r],i=t[o];i.writable===!1&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function Jm(e,t){return t===void 0&&(t=!1),eg(e)||Un(e)||!en(e)||(Ni(e)>1&&(e.set=e.add=e.clear=e.delete=rA),Object.freeze(e),t&&xo(e,function(n,r){return Jm(r,!0)},!0)),e}function rA(){Bt(2)}function eg(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function xn(e){var t=Ym[e];return t||Bt(18,e),t}function oA(e,t){Ym[e]||(Ym[e]=t)}function Wm(){return ya}function zm(e,t){t&&(xn("Patches"),e.u=[],e.s=[],e.v=t)}function Zu(e){qm(e),e.p.forEach(iA),e.p=null}function qm(e){e===ya&&(ya=e.l)}function Aw(e){return ya={p:[],l:ya,h:e,m:!0,_:0}}function iA(e){var t=e[ve];t.i===0||t.i===1?t.j():t.g=!0}function Vm(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.O||xn("ES5").S(t,e,r),r?(n[ve].P&&(Zu(t),Bt(4)),en(e)&&(e=Ju(t,e),t.l||ec(t,e)),t.u&&xn("Patches").M(n[ve].t,e,t.u,t.s)):e=Ju(t,n,[]),Zu(t),t.u&&t.v(t.u,t.s),e!==Uw?e:void 0}function Ju(e,t,n){if(eg(t))return t;var r=t[ve];if(!r)return xo(t,function(a,l){return Lw(e,r,t,a,l,n)},!0),t;if(r.A!==e)return t;if(!r.P)return ec(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=r.i===4||r.i===5?r.o=Zm(r.k):r.o,i=o,s=!1;r.i===3&&(i=new Set(o),o.clear(),s=!0),xo(i,function(a,l){return Lw(e,r,o,a,l,n,s)}),ec(e,o,!1),n&&e.u&&xn("Patches").N(r,n,e.u,e.s)}return r.o}function Lw(e,t,n,r,o,i,s){if(Un(o)){var a=Ju(e,o,i&&t&&t.i!==3&&!Ii(t.R,r)?i.concat(r):void 0);if(Dw(n,r,a),!Un(a))return;e.m=!1}else s&&n.add(o);if(en(o)&&!eg(o)){if(!e.h.D&&e._<1)return;Ju(e,o),t&&t.A.l||ec(e,o)}}function ec(e,t,n){n===void 0&&(n=!1),!e.l&&e.h.D&&e.m&&Jm(t,n)}function Km(e,t){var n=e[ve];return(n?Ar(n):e)[t]}function Iw(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function Lr(e){e.P||(e.P=!0,e.l&&Lr(e.l))}function $m(e){e.o||(e.o=Zm(e.t))}function Gm(e,t,n){var r=Xm(t)?xn("MapSet").F(t,n):Qm(t)?xn("MapSet").T(t,n):e.O?function(o,i){var s=Array.isArray(o),a={i:s?1:0,A:i?i.A:Wm(),P:!1,I:!1,R:{},l:i,t:o,k:null,o:null,j:null,C:!1},l=a,u=va;s&&(l=[a],u=ha);var c=Proxy.revocable(l,u),f=c.revoke,d=c.proxy;return a.k=d,a.j=f,d}(t,n):xn("ES5").J(t,n);return(n?n.A:Wm()).p.push(r),r}function sA(e){return Un(e)||Bt(22,e),function t(n){if(!en(n))return n;var r,o=n[ve],i=Ni(n);if(o){if(!o.P&&(o.i<4||!xn("ES5").K(o)))return o.t;o.I=!0,r=Ow(n,i),o.I=!1}else r=Ow(n,i);return xo(r,function(s,a){o&&nA(o.t,s)===a||Dw(r,s,t(a))}),i===3?new Set(r):r}(e)}function Ow(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Zm(e)}function Hw(){function e(s,a){var l=i[s];return l?l.enumerable=a:i[s]=l={configurable:!0,enumerable:a,get:function(){var u=this[ve];return va.get(u,s)},set:function(u){var c=this[ve];va.set(c,s,u)}},l}function t(s){for(var a=s.length-1;a>=0;a--){var l=s[a][ve];if(!l.P)switch(l.i){case 5:r(l)&&Lr(l);break;case 4:n(l)&&Lr(l)}}}function n(s){for(var a=s.t,l=s.k,u=Oi(l),c=u.length-1;c>=0;c--){var f=u[c];if(f!==ve){var d=a[f];if(d===void 0&&!Ii(a,f))return!0;var m=l[f],y=m&&m[ve];if(y?y.t!==d:!Fw(m,d))return!0}}var v=!!a[ve];return u.length!==Oi(a).length+(v?0:1)}function r(s){var a=s.k;if(a.length!==s.t.length)return!0;var l=Object.getOwnPropertyDescriptor(a,a.length-1);if(l&&!l.get)return!0;for(var u=0;u<a.length;u++)if(!a.hasOwnProperty(u))return!0;return!1}function o(s){s.g&&Bt(3,JSON.stringify(Ar(s)))}var i={};oA("ES5",{J:function(s,a){var l=Array.isArray(s),u=function(f,d){if(f){for(var m=Array(d.length),y=0;y<d.length;y++)Object.defineProperty(m,""+y,e(y,!0));return m}var v=Bw(d);delete v[ve];for(var p=Oi(v),g=0;g<p.length;g++){var h=p[g];v[h]=e(h,f||!!v[h].enumerable)}return Object.create(Object.getPrototypeOf(d),v)}(l,s),c={i:l?5:4,A:a?a.A:Wm(),P:!1,I:!1,R:{},l:a,t:s,k:u,o:null,g:!1,C:!1};return Object.defineProperty(u,ve,{value:c,writable:!0}),u},S:function(s,a,l){l?Un(a)&&a[ve].A===s&&t(s.p):(s.u&&function u(c){if(c&&typeof c=="object"){var f=c[ve];if(f){var d=f.t,m=f.k,y=f.R,v=f.i;if(v===4)xo(m,function(x){x!==ve&&(d[x]!==void 0||Ii(d,x)?y[x]||u(m[x]):(y[x]=!0,Lr(f)))}),xo(d,function(x){m[x]!==void 0||Ii(m,x)||(y[x]=!1,Lr(f))});else if(v===5){if(r(f)&&(Lr(f),y.length=!0),m.length<d.length)for(var p=m.length;p<d.length;p++)y[p]=!1;else for(var g=d.length;g<m.length;g++)y[g]=!0;for(var h=Math.min(m.length,d.length),S=0;S<h;S++)m.hasOwnProperty(S)||(y[S]=!0),y[S]===void 0&&u(m[S])}}}}(s.p[0]),t(s.p))},K:function(s){return s.i===4?n(s):r(s)}})}var Nw,ya,tg=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",aA=typeof Map<"u",lA=typeof Set<"u",Mw=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Uw=tg?Symbol.for("immer-nothing"):((Nw={})["immer-nothing"]=!0,Nw),_w=tg?Symbol.for("immer-draftable"):"__$immer_draftable",ve=tg?Symbol.for("immer-state"):"__$immer_state";var uA=""+Object.prototype.constructor,Oi=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,Bw=Object.getOwnPropertyDescriptors||function(e){var t={};return Oi(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},Ym={},va={get:function(e,t){if(t===ve)return e;var n=Ar(e);if(!Ii(n,t))return function(o,i,s){var a,l=Iw(i,s);return l?"value"in l?l.value:(a=l.get)===null||a===void 0?void 0:a.call(o.k):void 0}(e,n,t);var r=n[t];return e.I||!en(r)?r:r===Km(e.t,t)?($m(e),e.o[t]=Gm(e.A.h,r,e)):r},has:function(e,t){return t in Ar(e)},ownKeys:function(e){return Reflect.ownKeys(Ar(e))},set:function(e,t,n){var r=Iw(Ar(e),t);if(r!=null&&r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=Km(Ar(e),t),i=o==null?void 0:o[ve];if(i&&i.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(Fw(n,o)&&(n!==void 0||Ii(e.t,t)))return!0;$m(e),Lr(e)}return e.o[t]===n&&(n!==void 0||t in e.o)||Number.isNaN(n)&&Number.isNaN(e.o[t])||(e.o[t]=n,e.R[t]=!0),!0},deleteProperty:function(e,t){return Km(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,$m(e),Lr(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=Ar(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty:function(){Bt(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){Bt(12)}},ha={};xo(va,function(e,t){ha[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),ha.deleteProperty=function(e,t){return ha.set.call(this,e,t,void 0)},ha.set=function(e,t,n){return va.set.call(this,e[0],t,n,e[0])};var cA=function(){function e(n){var r=this;this.O=Mw,this.D=!0,this.produce=function(o,i,s){if(typeof o=="function"&&typeof i!="function"){var a=i;i=o;var l=r;return function(v){var p=this;v===void 0&&(v=a);for(var g=arguments.length,h=Array(g>1?g-1:0),S=1;S<g;S++)h[S-1]=arguments[S];return l.produce(v,function(x){var T;return(T=i).call.apply(T,[p,x].concat(h))})}}var u;if(typeof i!="function"&&Bt(6),s!==void 0&&typeof s!="function"&&Bt(7),en(o)){var c=Aw(r),f=Gm(r,o,void 0),d=!0;try{u=i(f),d=!1}finally{d?Zu(c):qm(c)}return typeof Promise<"u"&&u instanceof Promise?u.then(function(v){return zm(c,s),Vm(v,c)},function(v){throw Zu(c),v}):(zm(c,s),Vm(u,c))}if(!o||typeof o!="object"){if((u=i(o))===void 0&&(u=o),u===Uw&&(u=void 0),r.D&&Jm(u,!0),s){var m=[],y=[];xn("Patches").M(o,u,m,y),s(m,y)}return u}Bt(21,o)},this.produceWithPatches=function(o,i){if(typeof o=="function")return function(u){for(var c=arguments.length,f=Array(c>1?c-1:0),d=1;d<c;d++)f[d-1]=arguments[d];return r.produceWithPatches(u,function(m){return o.apply(void 0,[m].concat(f))})};var s,a,l=r.produce(o,i,function(u,c){s=u,a=c});return typeof Promise<"u"&&l instanceof Promise?l.then(function(u){return[u,s,a]}):[l,s,a]},typeof(n==null?void 0:n.useProxies)=="boolean"&&this.setUseProxies(n.useProxies),typeof(n==null?void 0:n.autoFreeze)=="boolean"&&this.setAutoFreeze(n.autoFreeze)}var t=e.prototype;return t.createDraft=function(n){en(n)||Bt(8),Un(n)&&(n=sA(n));var r=Aw(this),o=Gm(this,n,void 0);return o[ve].C=!0,qm(r),o},t.finishDraft=function(n,r){var o=n&&n[ve],i=o.A;return zm(i,r),Vm(void 0,i)},t.setAutoFreeze=function(n){this.D=n},t.setUseProxies=function(n){n&&!Mw&&Bt(20),this.O=n},t.applyPatches=function(n,r){var o;for(o=r.length-1;o>=0;o--){var i=r[o];if(i.path.length===0&&i.op==="replace"){n=i.value;break}}o>-1&&(r=r.slice(o+1));var s=xn("Patches").$;return Un(n)?s(n,r):this.produce(n,function(a){return s(a,r)})},e}(),St=new cA,dA=St.produce,d_=St.produceWithPatches.bind(St),f_=St.setAutoFreeze.bind(St),p_=St.setUseProxies.bind(St),m_=St.applyPatches.bind(St),g_=St.createDraft.bind(St),h_=St.finishDraft.bind(St),tc=dA;function Ir(e){"@babel/helpers - typeof";return Ir=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ir(e)}function ng(e,t){if(Ir(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ir(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rg(e){var t=ng(e,"string");return Ir(t)==="symbol"?t:String(t)}function og(e,t,n){return t=rg(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function nc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jw(Object(n),!0).forEach(function(r){og(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jw(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qe(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var zw=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),ig=function(){return Math.random().toString(36).substring(7).split("").join(".")},rc={INIT:"@@redux/INIT"+ig(),REPLACE:"@@redux/REPLACE"+ig(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+ig()}};function fA(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function sg(e,t,n){var r;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(qe(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(qe(1));return n(sg)(e,t)}if(typeof e!="function")throw new Error(qe(2));var o=e,i=t,s=[],a=s,l=!1;function u(){a===s&&(a=s.slice())}function c(){if(l)throw new Error(qe(3));return i}function f(v){if(typeof v!="function")throw new Error(qe(4));if(l)throw new Error(qe(5));var p=!0;return u(),a.push(v),function(){if(p){if(l)throw new Error(qe(6));p=!1,u();var h=a.indexOf(v);a.splice(h,1),s=null}}}function d(v){if(!fA(v))throw new Error(qe(7));if(typeof v.type>"u")throw new Error(qe(8));if(l)throw new Error(qe(9));try{l=!0,i=o(i,v)}finally{l=!1}for(var p=s=a,g=0;g<p.length;g++){var h=p[g];h()}return v}function m(v){if(typeof v!="function")throw new Error(qe(10));o=v,d({type:rc.REPLACE})}function y(){var v,p=f;return v={subscribe:function(h){if(typeof h!="object"||h===null)throw new Error(qe(11));function S(){h.next&&h.next(c())}S();var x=p(S);return{unsubscribe:x}}},v[zw]=function(){return this},v}return d({type:rc.INIT}),r={dispatch:d,subscribe:f,getState:c,replaceReducer:m},r[zw]=y,r}function pA(e){Object.keys(e).forEach(function(t){var n=e[t],r=n(void 0,{type:rc.INIT});if(typeof r>"u")throw new Error(qe(12));if(typeof n(void 0,{type:rc.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(qe(13))})}function oc(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];typeof e[o]=="function"&&(n[o]=e[o])}var i=Object.keys(n),s,a;try{pA(n)}catch(l){a=l}return function(u,c){if(u===void 0&&(u={}),a)throw a;if(!1)var f;for(var d=!1,m={},y=0;y<i.length;y++){var v=i[y],p=n[v],g=u[v],h=p(g,c);if(typeof h>"u"){var S=c&&c.type;throw new Error(qe(14))}m[v]=h,d=d||h!==g}return d=d||i.length!==Object.keys(u).length,d?m:u}}function Mi(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length===0?function(r){return r}:t.length===1?t[0]:t.reduce(function(r,o){return function(){return r(o.apply(void 0,arguments))}})}function Vw(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return function(){var o=r.apply(void 0,arguments),i=function(){throw new Error(qe(15))},s={getState:o.getState,dispatch:function(){return i.apply(void 0,arguments)}},a=t.map(function(l){return l(s)});return i=Mi.apply(void 0,a)(o.dispatch),nc(nc({},o),{},{dispatch:i})}}}function Kw(e){var t=function(r){var o=r.dispatch,i=r.getState;return function(s){return function(a){return typeof a=="function"?a(o,i,e):s(a)}}};return t}var $w=Kw();$w.withExtraArgument=Kw;var ag=$w;var Xw=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),mA=function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,o=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){n.label=u[1];break}if(u[0]===6&&n.label<i[1]){n.label=i[1],i=u;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(u);break}i[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],o=0}finally{r=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},_i=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e},gA=Object.defineProperty,hA=Object.defineProperties,yA=Object.getOwnPropertyDescriptors,Ww=Object.getOwnPropertySymbols,vA=Object.prototype.hasOwnProperty,SA=Object.prototype.propertyIsEnumerable,qw=function(e,t,n){return t in e?gA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Or=function(e,t){for(var n in t||(t={}))vA.call(t,n)&&qw(e,n,t[n]);if(Ww)for(var r=0,o=Ww(t);r<o.length;r++){var n=o[r];SA.call(t,n)&&qw(e,n,t[n])}return e},lg=function(e,t){return hA(e,yA(t))},wA=function(e,t,n){return new Promise(function(r,o){var i=function(l){try{a(n.next(l))}catch(u){o(u)}},s=function(l){try{a(n.throw(l))}catch(u){o(u)}},a=function(l){return l.done?r(l.value):Promise.resolve(l.value).then(i,s)};a((n=n.apply(e,t)).next())})};var xA=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Mi:Mi.apply(null,arguments)},M_=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}};function EA(e){if(typeof e!="object"||e===null)return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var n=t;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return t===n}var CA=function(e){Xw(t,e);function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.apply(this,n)||this;return Object.setPrototypeOf(o,t.prototype),o}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.prototype.concat.apply(this,n)},t.prototype.prepend=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n.length===1&&Array.isArray(n[0])?new(t.bind.apply(t,_i([void 0],n[0].concat(this)))):new(t.bind.apply(t,_i([void 0],n.concat(this))))},t}(Array),bA=function(e){Xw(t,e);function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.apply(this,n)||this;return Object.setPrototypeOf(o,t.prototype),o}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.prototype.concat.apply(this,n)},t.prototype.prepend=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n.length===1&&Array.isArray(n[0])?new(t.bind.apply(t,_i([void 0],n[0].concat(this)))):new(t.bind.apply(t,_i([void 0],n.concat(this))))},t}(Array);function dg(e){return en(e)?tc(e,function(){}):e}function TA(e){return typeof e=="boolean"}function kA(){return function(t){return PA(t)}}function PA(e){e===void 0&&(e={});var t=e.thunk,n=t===void 0?!0:t,r=e.immutableCheck,o=r===void 0?!0:r,i=e.serializableCheck,s=i===void 0?!0:i,a=new CA;if(n&&(TA(n)?a.push(ag):a.push(ag.withExtraArgument(n.extraArgument))),!1){if(o)var l;if(s)var u}return a}var ug=!0;function Qw(e){var t=kA(),n=e||{},r=n.reducer,o=r===void 0?void 0:r,i=n.middleware,s=i===void 0?t():i,a=n.devTools,l=a===void 0?!0:a,u=n.preloadedState,c=u===void 0?void 0:u,f=n.enhancers,d=f===void 0?void 0:f,m;if(typeof o=="function")m=o;else if(EA(o))m=oc(o);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var y=s;if(typeof y=="function"&&(y=y(t),!ug&&!Array.isArray(y)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!ug&&y.some(function(x){return typeof x!="function"}))throw new Error("each middleware provided to configureStore must be a function");var v=Vw.apply(void 0,y),p=Mi;l&&(p=xA(Or({trace:!ug},typeof l=="object"&&l)));var g=new bA(v),h=g;Array.isArray(d)?h=_i([v],d):typeof d=="function"&&(h=d(g));var S=p.apply(void 0,h);return sg(m,c,S)}function we(e,t){function n(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(t){var i=t.apply(void 0,r);if(!i)throw new Error("prepareAction did not return an object");return Or(Or({type:e,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:e,payload:r[0]}}return n.toString=function(){return""+e},n.type=e,n.match=function(r){return r.type===e},n}function Zw(e){var t={},n=[],r,o={addCase:function(i,s){var a=typeof i=="string"?i:i.type;if(a in t)throw new Error("addCase cannot be called with two reducers for the same action type");return t[a]=s,o},addMatcher:function(i,s){return n.push({matcher:i,reducer:s}),o},addDefaultCase:function(i){return r=i,o}};return e(o),[t,n,r]}function RA(e){return typeof e=="function"}function AA(e,t,n,r){n===void 0&&(n=[]);var o=typeof t=="function"?Zw(t):[t,n,r],i=o[0],s=o[1],a=o[2],l;if(RA(e))l=function(){return dg(e())};else{var u=dg(e);l=function(){return u}}function c(f,d){f===void 0&&(f=l());var m=_i([i[d.type]],s.filter(function(y){var v=y.matcher;return v(d)}).map(function(y){var v=y.reducer;return v}));return m.filter(function(y){return!!y}).length===0&&(m=[a]),m.reduce(function(y,v){if(v)if(Un(y)){var p=y,g=v(p,d);return g===void 0?y:g}else{if(en(y))return tc(y,function(h){return v(h,d)});var g=v(y,d);if(g===void 0){if(y===null)return y;throw Error("A case reducer on a non-draftable value must not return undefined")}return g}return y},f)}return c.getInitialState=l,c}function LA(e,t){return e+"/"+t}function W(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");typeof process<"u";var n=typeof e.initialState=="function"?e.initialState:dg(e.initialState),r=e.reducers||{},o=Object.keys(r),i={},s={},a={};o.forEach(function(c){var f=r[c],d=LA(t,c),m,y;"reducer"in f?(m=f.reducer,y=f.prepare):m=f,i[c]=m,s[d]=m,a[c]=y?we(d,y):we(d)});function l(){var c=typeof e.extraReducers=="function"?Zw(e.extraReducers):[e.extraReducers],f=c[0],d=f===void 0?{}:f,m=c[1],y=m===void 0?[]:m,v=c[2],p=v===void 0?void 0:v,g=Or(Or({},d),s);return AA(n,function(h){for(var S in g)h.addCase(S,g[S]);for(var x=0,T=y;x<T.length;x++){var C=T[x];h.addMatcher(C.matcher,C.reducer)}p&&h.addDefaultCase(p)})}var u;return{name:t,reducer:function(c,f){return u||(u=l()),u(c,f)},actions:a,caseReducers:i,getInitialState:function(){return u||(u=l()),u.getInitialState()}}}var IA="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",OA=function(e){e===void 0&&(e=21);for(var t="",n=e;n--;)t+=IA[Math.random()*64|0];return t},NA=["name","message","stack","code"],cg=function(){function e(t,n){this.payload=t,this.meta=n}return e}(),Gw=function(){function e(t,n){this.payload=t,this.meta=n}return e}(),MA=function(e){if(typeof e=="object"&&e!==null){for(var t={},n=0,r=NA;n<r.length;n++){var o=r[n];typeof e[o]=="string"&&(t[o]=e[o])}return t}return{message:String(e)}},B=function(){function e(t,n,r){var o=we(t+"/fulfilled",function(c,f,d,m){return{payload:c,meta:lg(Or({},m||{}),{arg:d,requestId:f,requestStatus:"fulfilled"})}}),i=we(t+"/pending",function(c,f,d){return{payload:void 0,meta:lg(Or({},d||{}),{arg:f,requestId:c,requestStatus:"pending"})}}),s=we(t+"/rejected",function(c,f,d,m,y){return{payload:m,error:(r&&r.serializeError||MA)(c||"Rejected"),meta:lg(Or({},y||{}),{arg:d,requestId:f,rejectedWithValue:!!m,requestStatus:"rejected",aborted:(c==null?void 0:c.name)==="AbortError",condition:(c==null?void 0:c.name)==="ConditionError"})}}),a=!1,l=typeof AbortController<"u"?AbortController:function(){function c(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return c.prototype.abort=function(){},c}();function u(c){return function(f,d,m){var y=r!=null&&r.idGenerator?r.idGenerator(c):OA(),v=new l,p,g=!1;function h(x){p=x,v.abort()}var S=function(){return wA(this,null,function(){var x,T,C,k,L,I,N;return mA(this,function(V){switch(V.label){case 0:return V.trys.push([0,4,,5]),k=(x=r==null?void 0:r.condition)==null?void 0:x.call(r,c,{getState:d,extra:m}),DA(k)?[4,k]:[3,2];case 1:k=V.sent(),V.label=2;case 2:if(k===!1||v.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return g=!0,L=new Promise(function(_,ee){return v.signal.addEventListener("abort",function(){return ee({name:"AbortError",message:p||"Aborted"})})}),f(i(y,c,(T=r==null?void 0:r.getPendingMeta)==null?void 0:T.call(r,{requestId:y,arg:c},{getState:d,extra:m}))),[4,Promise.race([L,Promise.resolve(n(c,{dispatch:f,getState:d,extra:m,requestId:y,signal:v.signal,abort:h,rejectWithValue:function(_,ee){return new cg(_,ee)},fulfillWithValue:function(_,ee){return new Gw(_,ee)}})).then(function(_){if(_ instanceof cg)throw _;return _ instanceof Gw?o(_.payload,y,c,_.meta):o(_,y,c)})])];case 3:return C=V.sent(),[3,5];case 4:return I=V.sent(),C=I instanceof cg?s(null,y,c,I.payload,I.meta):s(I,y,c),[3,5];case 5:return N=r&&!r.dispatchConditionRejection&&s.match(C)&&C.meta.condition,N||f(C),[2,C]}})})}();return Object.assign(S,{abort:h,requestId:y,arg:c,unwrap:function(){return S.then(_A)}})}}return Object.assign(u,{pending:i,rejected:s,fulfilled:o,typePrefix:t})}return e.withTypes=function(){return e},e}();function _A(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function DA(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var FA="task",Jw="listener",ex="completed",fg="cancelled",H_="task-"+fg,U_="task-"+ex,B_=Jw+"-"+fg,j_=Jw+"-"+ex,z_=function(){function e(t){this.code=t,this.name="TaskAbortError",this.message=FA+" "+fg+" (reason: "+t+")"}return e}();var pg="listenerMiddleware";var V_=we(pg+"/add"),K_=we(pg+"/removeAll"),$_=we(pg+"/remove");var Yw,W_=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(Yw||(Yw=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},HA=function(e){return function(t){setTimeout(t,e)}},q_=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:HA(10);Hw();var zx=w(gg()),Vx=w(ax());var hg=w(Qu());function nL(e){e()}var lx=nL,ux=e=>lx=e,cx=()=>lx;var Fi=w(D());var px=w(D());var sc=w(D()),dx=Symbol.for(`react-redux-context-${sc.version}`),fx=globalThis;function rL(){let e=fx[dx];return e||(e=(0,sc.createContext)(null),fx[dx]=e),e}var Ge=new Proxy({},new Proxy({},{get(e,t){let n=rL();return(r,...o)=>Reflect[t](n,...o)}}));function Sa(e=Ge){return function(){return(0,px.useContext)(e)}}var ac=Sa();var lc=()=>{throw new Error("uSES not initialized!")};var mx=lc,gx=e=>{mx=e},oL=(e,t)=>e===t;function hx(e=Ge){let t=e===Ge?ac:Sa(e);return function(r,o={}){let{equalityFn:i=oL,stabilityCheck:s=void 0,noopCheck:a=void 0}=typeof o=="function"?{equalityFn:o}:o,{store:l,subscription:u,getServerState:c,stabilityCheck:f,noopCheck:d}=t(),m=(0,Fi.useRef)(!0),y=(0,Fi.useCallback)({[r.name](p){return r(p)}}[r.name],[r,f,s]),v=mx(u.addNestedSub,l.getState,c||l.getState,y,i);return(0,Fi.useDebugValue)(v),v}}var O=hx();function Bn(){return Bn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bn.apply(this,arguments)}function wa(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var kg=w(Px()),ae=w(D()),Hx=w(Ix());var wL=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function xL(e,t,n,r,{areStatesEqual:o,areOwnPropsEqual:i,areStatePropsEqual:s}){let a=!1,l,u,c,f,d;function m(h,S){return l=h,u=S,c=e(l,u),f=t(r,u),d=n(c,f,u),a=!0,d}function y(){return c=e(l,u),t.dependsOnOwnProps&&(f=t(r,u)),d=n(c,f,u),d}function v(){return e.dependsOnOwnProps&&(c=e(l,u)),t.dependsOnOwnProps&&(f=t(r,u)),d=n(c,f,u),d}function p(){let h=e(l,u),S=!s(h,c);return c=h,S&&(d=n(c,f,u)),d}function g(h,S){let x=!i(S,u),T=!o(h,l,S,u);return l=h,u=S,x&&T?y():x?v():T?p():d}return function(S,x){return a?g(S,x):m(S,x)}}function bg(e,t){let{initMapStateToProps:n,initMapDispatchToProps:r,initMergeProps:o}=t,i=wa(t,wL),s=n(e,i),a=r(e,i),l=o(e,i);return xL(s,a,l,e,i)}function Tg(e,t){let n={};for(let r in e){let o=e[r];typeof o=="function"&&(n[r]=(...i)=>t(o(...i)))}return n}function xa(e){return function(n){let r=e(n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function Ox(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}function Ac(e,t){return function(r,{displayName:o}){let i=function(a,l){return i.dependsOnOwnProps?i.mapToProps(a,l):i.mapToProps(a,void 0)};return i.dependsOnOwnProps=!0,i.mapToProps=function(a,l){i.mapToProps=e,i.dependsOnOwnProps=Ox(e);let u=i(a,l);return typeof u=="function"&&(i.mapToProps=u,i.dependsOnOwnProps=Ox(u),u=i(a,l)),u},i}}function Hi(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function Nx(e){return e&&typeof e=="object"?xa(t=>Tg(e,t)):e?typeof e=="function"?Ac(e,"mapDispatchToProps"):Hi(e,"mapDispatchToProps"):xa(t=>({dispatch:t}))}function Mx(e){return e?typeof e=="function"?Ac(e,"mapStateToProps"):Hi(e,"mapStateToProps"):xa(()=>({}))}function EL(e,t,n){return Bn({},n,e,t)}function CL(e){return function(n,{displayName:r,areMergedPropsEqual:o}){let i=!1,s;return function(l,u,c){let f=e(l,u,c);return i?o(f,s)||(s=f):(i=!0,s=f),s}}}function _x(e){return e?typeof e=="function"?CL(e):Hi(e,"mergeProps"):()=>EL}function bL(){let e=cx(),t=null,n=null;return{clear(){t=null,n=null},notify(){e(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){let r=[],o=t;for(;o;)r.push(o),o=o.next;return r},subscribe(r){let o=!0,i=n={callback:r,next:null,prev:n};return i.prev?i.prev.next=i:t=i,function(){!o||t===null||(o=!1,i.next?i.next.prev=i.prev:n=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}var Dx={notify(){},get:()=>[]};function Lc(e,t){let n,r=Dx;function o(f){return l(),r.subscribe(f)}function i(){r.notify()}function s(){c.onStateChange&&c.onStateChange()}function a(){return!!n}function l(){n||(n=t?t.addNestedSub(s):e.subscribe(s),r=bL())}function u(){n&&(n(),n=void 0,r.clear(),r=Dx)}let c={addNestedSub:o,notifyNestedSubs:i,handleChangeWrapper:s,isSubscribed:a,trySubscribe:l,tryUnsubscribe:u,getListeners:()=>r};return c}var Ic=w(D()),TL=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Ui=TL?Ic.useLayoutEffect:Ic.useEffect;function Fx(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Bi(e,t){if(Fx(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!Fx(e[n[o]],t[n[o]]))return!1;return!0}var kL=["reactReduxForwardedRef"],Ux=lc,Bx=e=>{Ux=e};var PL=[null,null];function RL(e,t,n){Ui(()=>e(...t),n)}function AL(e,t,n,r,o,i){e.current=r,n.current=!1,o.current&&(o.current=null,i())}function LL(e,t,n,r,o,i,s,a,l,u,c){if(!e)return()=>{};let f=!1,d=null,m=()=>{if(f||!a.current)return;let v=t.getState(),p,g;try{p=r(v,o.current)}catch(h){g=h,d=h}g||(d=null),p===i.current?s.current||u():(i.current=p,l.current=p,s.current=!0,c())};return n.onStateChange=m,n.trySubscribe(),m(),()=>{if(f=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}function IL(e,t){return e===t}function OL(e,t,n,{pure:r,areStatesEqual:o=IL,areOwnPropsEqual:i=Bi,areStatePropsEqual:s=Bi,areMergedPropsEqual:a=Bi,forwardRef:l=!1,context:u=Ge}={}){let c=u,f=Mx(e),d=Nx(t),m=_x(n),y=!!e;return p=>{let g=p.displayName||p.name||"Component",h=`Connect(${g})`,S={shouldHandleStateChanges:y,displayName:h,wrappedComponentName:g,WrappedComponent:p,initMapStateToProps:f,initMapDispatchToProps:d,initMergeProps:m,areStatesEqual:o,areStatePropsEqual:s,areOwnPropsEqual:i,areMergedPropsEqual:a};function x(k){let[L,I,N]=(0,ae.useMemo)(()=>{let{reactReduxForwardedRef:st}=k,Lt=wa(k,kL);return[k.context,st,Lt]},[k]),V=(0,ae.useMemo)(()=>L&&L.Consumer&&(0,Hx.isContextConsumer)(ae.default.createElement(L.Consumer,null))?L:c,[L,c]),_=(0,ae.useContext)(V),ee=!!k.store&&!!k.store.getState&&!!k.store.dispatch,Yr=!!_&&!!_.store,it=ee?k.store:_.store,Gt=Yr?_.getServerState:it.getState,At=(0,ae.useMemo)(()=>bg(it.dispatch,S),[it]),[H,q]=(0,ae.useMemo)(()=>{if(!y)return PL;let st=Lc(it,ee?void 0:_.subscription),Lt=st.notifyNestedSubs.bind(st);return[st,Lt]},[it,ee,_]),ir=(0,ae.useMemo)(()=>ee?_:Bn({},_,{subscription:H}),[ee,_,H]),he=(0,ae.useRef)(),sr=(0,ae.useRef)(N),$=(0,ae.useRef)(),ar=(0,ae.useRef)(!1),vl=(0,ae.useRef)(!1),$o=(0,ae.useRef)(!1),Xr=(0,ae.useRef)();Ui(()=>($o.current=!0,()=>{$o.current=!1}),[]);let ds=(0,ae.useMemo)(()=>()=>$.current&&N===sr.current?$.current:At(it.getState(),N),[it,N]),Sl=(0,ae.useMemo)(()=>Lt=>H?LL(y,it,H,At,sr,he,ar,$o,$,q,Lt):()=>{},[H]);RL(AL,[sr,he,ar,N,$,q]);let Yt;try{Yt=Ux(Sl,ds,Gt?()=>At(Gt(),N):ds)}catch(st){throw Xr.current&&(st.message+=`
|
|
9
|
+
Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}De!==5&&(De=2),l=Nm(l,a),d=s;do{switch(d.tag){case 3:i=l,d.flags|=4096,t&=-t,d.lanes|=t;var T=pw(d,i,t);b0(d,T);break e;case 1:i=l;var C=d.type,k=d.stateNode;if(!(d.flags&64)&&(typeof C.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(yn===null||!yn.has(k)))){d.flags|=4096,t&=-t,d.lanes|=t;var L=mw(d,i,t);b0(d,L);break e}}d=d.return}while(d!==null)}Ew(n)}catch(I){t=I,Pe===n&&n!==null&&(Pe=n=n.return);continue}break}while(1)}function ww(){var e=Mu.current;return Mu.current=Nu,e===null?Nu:e}function Hs(e,t){var n=K;K|=16;var r=ww();Je===e&&$e===t||wi(e,t);do try{BR();break}catch(o){Sw(e,o)}while(1);if(Cm(),K=n,Mu.current=r,Pe!==null)throw Error(P(261));return Je=null,$e=0,De}function BR(){for(;Pe!==null;)xw(Pe)}function jR(){for(;Pe!==null&&!ER();)xw(Pe)}function xw(e){var t=bw(e.alternate,e,ho);e.memoizedProps=e.pendingProps,t===null?Ew(e):Pe=t,Mm.current=null}function Ew(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&2048){if(n=OR(t),n!==null){n.flags&=2047,Pe=n;return}e!==null&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}else{if(n=IR(n,t,ho),n!==null){Pe=n;return}if(n=t,n.tag!==24&&n.tag!==23||n.memoizedState===null||ho&1073741824||!(n.mode&4)){for(var r=0,o=n.child;o!==null;)r|=o.lanes|o.childLanes,o=o.sibling;n.childLanes=r}e!==null&&!(e.flags&2048)&&(e.firstEffect===null&&(e.firstEffect=t.firstEffect),t.lastEffect!==null&&(e.lastEffect!==null&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(e.lastEffect!==null?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}if(t=t.sibling,t!==null){Pe=t;return}Pe=t=e}while(t!==null);De===0&&(De=5)}function so(e){var t=bi();return go(99,zR.bind(null,e,t)),null}function zR(e,t){do Rr();while(Gs!==null);if(K&48)throw Error(P(327));var n=e.finishedWork;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(P(177));e.callbackNode=null;var r=n.lanes|n.childLanes,o=r,i=e.pendingLanes&~o;e.pendingLanes=o,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=o,e.mutableReadLanes&=o,e.entangledLanes&=o,o=e.entanglements;for(var s=e.eventTimes,a=e.expirationTimes;0<i;){var l=31-Cr(i),u=1<<l;o[l]=0,s[l]=-1,a[l]=-1,i&=~u}if(Fn!==null&&!(r&24)&&Fn.has(e)&&Fn.delete(e),e===Je&&(Pe=Je=null,$e=0),1<n.flags?n.lastEffect!==null?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,r!==null){if(o=K,K|=32,Mm.current=null,Jf=iu,s=d0(),kp(s)){if("selectionStart"in s)a={start:s.selectionStart,end:s.selectionEnd};else e:if(a=(a=s.ownerDocument)&&a.defaultView||window,(u=a.getSelection&&a.getSelection())&&u.rangeCount!==0){a=u.anchorNode,i=u.anchorOffset,l=u.focusNode,u=u.focusOffset;try{a.nodeType,l.nodeType}catch{a=null;break e}var c=0,f=-1,d=-1,m=0,y=0,v=s,p=null;t:for(;;){for(var g;v!==a||i!==0&&v.nodeType!==3||(f=c+i),v!==l||u!==0&&v.nodeType!==3||(d=c+u),v.nodeType===3&&(c+=v.nodeValue.length),(g=v.firstChild)!==null;)p=v,v=g;for(;;){if(v===s)break t;if(p===a&&++m===i&&(f=c),p===l&&++y===u&&(d=c),(g=v.nextSibling)!==null)break;v=p,p=v.parentNode}v=g}a=f===-1||d===-1?null:{start:f,end:d}}else a=null;a=a||{start:0,end:0}}else a=null;ep={focusedElem:s,selectionRange:a},iu=!1,Xs=null,fu=!1,M=r;do try{VR()}catch(I){if(M===null)throw Error(P(330));xr(M,I),M=M.nextEffect}while(M!==null);Xs=null,M=r;do try{for(s=e;M!==null;){var h=M.flags;if(h&16&&Zs(M.stateNode,""),h&128){var S=M.alternate;if(S!==null){var x=S.ref;x!==null&&(typeof x=="function"?x(null):x.current=null)}}switch(h&1038){case 2:Y0(M),M.flags&=-3;break;case 6:Y0(M),M.flags&=-3,ap(M.alternate,M);break;case 1024:M.flags&=-1025;break;case 1028:M.flags&=-1025,ap(M.alternate,M);break;case 4:ap(M.alternate,M);break;case 8:a=M,gw(s,a);var T=a.alternate;q0(a),T!==null&&q0(T)}M=M.nextEffect}}catch(I){if(M===null)throw Error(P(330));xr(M,I),M=M.nextEffect}while(M!==null);if(x=ep,S=d0(),h=x.focusedElem,s=x.selectionRange,S!==h&&h&&h.ownerDocument&&NS(h.ownerDocument.documentElement,h)){for(s!==null&&kp(h)&&(S=s.start,x=s.end,x===void 0&&(x=S),"selectionStart"in h?(h.selectionStart=S,h.selectionEnd=Math.min(x,h.value.length)):(x=(S=h.ownerDocument||document)&&S.defaultView||window,x.getSelection&&(x=x.getSelection(),a=h.textContent.length,T=Math.min(s.start,a),s=s.end===void 0?T:Math.min(s.end,a),!x.extend&&T>s&&(a=s,s=T,T=a),a=c0(h,T),i=c0(h,s),a&&i&&(x.rangeCount!==1||x.anchorNode!==a.node||x.anchorOffset!==a.offset||x.focusNode!==i.node||x.focusOffset!==i.offset)&&(S=S.createRange(),S.setStart(a.node,a.offset),x.removeAllRanges(),T>s?(x.addRange(S),x.extend(i.node,i.offset)):(S.setEnd(i.node,i.offset),x.addRange(S)))))),S=[],x=h;x=x.parentNode;)x.nodeType===1&&S.push({element:x,left:x.scrollLeft,top:x.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<S.length;h++)x=S[h],x.element.scrollLeft=x.left,x.element.scrollTop=x.top}iu=!!Jf,ep=Jf=null,e.current=n,M=r;do try{for(h=e;M!==null;){var C=M.flags;if(C&36&&DR(h,M.alternate,M),C&128){S=void 0;var k=M.ref;if(k!==null){var L=M.stateNode;switch(M.tag){case 5:S=L;break;default:S=L}typeof k=="function"?k(S):k.current=S}}M=M.nextEffect}}catch(I){if(M===null)throw Error(P(330));xr(M,I),M=M.nextEffect}while(M!==null);M=null,bR(),K=o}else e.current=n;if(Tr)Tr=!1,Gs=e,Fs=t;else for(M=r;M!==null;)t=M.nextEffect,M.nextEffect=null,M.flags&8&&(C=M,C.sibling=null,C.stateNode=null),M=t;if(r=e.pendingLanes,r===0&&(yn=null),r===1?e===Yp?Ys++:(Ys=0,Yp=e):Ys=0,n=n.stateNode,po&&typeof po.onCommitFiberRoot=="function")try{po.onCommitFiberRoot(xm,n,void 0,(n.current.flags&64)===64)}catch{}if(Ht(e,Ke()),_u)throw _u=!1,e=Wp,Wp=null,e;return K&8||wn(),null}function VR(){for(;M!==null;){var e=M.alternate;fu||Xs===null||(M.flags&8?Qv(M,Xs)&&(fu=!0):M.tag===13&&FR(e,M)&&Qv(M,Xs)&&(fu=!0));var t=M.flags;t&256&&_R(e,M),!(t&512)||Tr||(Tr=!0,sa(97,function(){return Rr(),null})),M=M.nextEffect}}function Rr(){if(Fs!==90){var e=97<Fs?97:Fs;return Fs=90,go(e,$R)}return!1}function KR(e,t){qp.push(t,e),Tr||(Tr=!0,sa(97,function(){return Rr(),null}))}function Cw(e,t){Gp.push(t,e),Tr||(Tr=!0,sa(97,function(){return Rr(),null}))}function $R(){if(Gs===null)return!1;var e=Gs;if(Gs=null,K&48)throw Error(P(331));var t=K;K|=32;var n=Gp;Gp=[];for(var r=0;r<n.length;r+=2){var o=n[r],i=n[r+1],s=o.destroy;if(o.destroy=void 0,typeof s=="function")try{s()}catch(l){if(i===null)throw Error(P(330));xr(i,l)}}for(n=qp,qp=[],r=0;r<n.length;r+=2){o=n[r],i=n[r+1];try{var a=o.create;o.destroy=a()}catch(l){if(i===null)throw Error(P(330));xr(i,l)}}for(a=e.current.firstEffect;a!==null;)e=a.nextEffect,a.nextEffect=null,a.flags&8&&(a.sibling=null,a.stateNode=null),a=e;return K=t,wn(),!0}function Q0(e,t,n){t=Nm(n,t),t=pw(e,t,1),vr(e,t),t=yt(),e=Yu(e,1),e!==null&&(ju(e,1,t),Ht(e,t))}function xr(e,t){if(e.tag===3)Q0(e,e,t);else for(var n=e.return;n!==null;){if(n.tag===3){Q0(n,e,t);break}else if(n.tag===1){var r=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(yn===null||!yn.has(r))){e=Nm(t,e);var o=mw(n,e,1);if(vr(n,o),o=yt(),n=Yu(n,1),n!==null)ju(n,1,o),Ht(n,o);else if(typeof r.componentDidCatch=="function"&&(yn===null||!yn.has(r)))try{r.componentDidCatch(t,e)}catch{}break}}n=n.return}}function WR(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=yt(),e.pingedLanes|=e.suspendedLanes&n,Je===e&&($e&n)===n&&(De===4||De===3&&($e&62914560)===$e&&500>Ke()-Dm?wi(e,0):_m|=n),Ht(e,t)}function qR(e,t){var n=e.stateNode;n!==null&&n.delete(t),t=0,t===0&&(t=e.mode,t&2?t&4?(Mn===0&&(Mn=Ri),t=ii(62914560&~Mn),t===0&&(t=4194304)):t=bi()===99?1:2:t=1),n=yt(),e=Yu(e,t),e!==null&&(ju(e,t,n),Ht(e,n))}var bw;bw=function(e,t,n){var r=t.lanes;if(e!==null)if(e.memoizedProps!==t.pendingProps||ft.current)Jt=!0;else if(n&r)Jt=!!(e.flags&16384);else{switch(Jt=!1,t.tag){case 3:F0(t),op();break;case 5:R0(t);break;case 1:pt(t.type)&&lu(t);break;case 4:Mp(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var o=t.type._context;Ee(Cu,o._currentValue),o._currentValue=r;break;case 13:if(t.memoizedState!==null)return n&t.child.childLanes?H0(e,t,n):(Ee(xe,xe.current&1),t=Dn(e,t,n),t!==null?t.sibling:null);Ee(xe,xe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&64){if(r)return V0(e,t,n);t.flags|=64}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Ee(xe,xe.current),r)break;return null;case 23:case 24:return t.lanes=0,ip(e,t,n)}return Dn(e,t,n)}else Jt=!1;switch(t.lanes=0,t.tag){case 2:if(r=t.type,e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,o=Ci(t,We.current),yi(t,n),o=Am(null,t,r,e,o,n),t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,pt(r)){var i=!0;lu(t)}else i=!1;t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Tm(t);var s=r.getDerivedStateFromProps;typeof s=="function"&&ku(t,r,s,e),o.updater=qu,t.stateNode=o,o._reactInternals=t,Np(t,r,e,n),t=Hp(null,t,r,!0,i,n)}else t.tag=0,dt(null,t,o,n),t=t.child;return t;case 16:o=t.elementType;e:{switch(e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=o._init,o=i(o._payload),t.type=o,i=t.tag=YR(o),e=Zt(o,e),i){case 0:t=Fp(null,t,o,e,n);break e;case 1:t=D0(null,t,o,e,n);break e;case 11:t=M0(null,t,o,e,n);break e;case 14:t=_0(null,t,o,Zt(o.type,e),r,n);break e}throw Error(P(306,o,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Zt(r,o),Fp(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Zt(r,o),D0(e,t,r,o,n);case 3:if(F0(t),r=t.updateQueue,e===null||r===null)throw Error(P(282));if(r=t.pendingProps,o=t.memoizedState,o=o!==null?o.element:null,YS(e,t),aa(t,r,null,n),r=t.memoizedState.element,r===o)op(),t=Dn(e,t,n);else{if(o=t.stateNode,(i=o.hydrate)&&(pr=hi(t.stateNode.containerInfo.firstChild),_n=t,i=Sn=!0),i){if(e=o.mutableSourceEagerHydrationData,e!=null)for(o=0;o<e.length;o+=2)i=e[o],i._workInProgressVersionPrimary=e[o+1],vi.push(i);for(n=JS(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|1024,n=n.sibling}else dt(e,t,r,n),op();t=t.child}return t;case 5:return R0(t),e===null&&_p(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Ap(r,o)?s=null:i!==null&&Ap(r,i)&&(t.flags|=16),uw(e,t),dt(e,t,s,n),t.child;case 6:return e===null&&_p(t),null;case 13:return H0(e,t,n);case 4:return Mp(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Pu(t,null,r,n):dt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Zt(r,o),M0(e,t,r,o,n);case 7:return dt(e,t,t.pendingProps,n),t.child;case 8:return dt(e,t,t.pendingProps.children,n),t.child;case 12:return dt(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,o=t.pendingProps,s=t.memoizedProps,i=o.value;var a=t.type._context;if(Ee(Cu,a._currentValue),a._currentValue=i,s!==null)if(a=s.value,i=Mt(a,i)?0:(typeof r._calculateChangedBits=="function"?r._calculateChangedBits(a,i):1073741823)|0,i===0){if(s.children===o.children&&!ft.current){t=Dn(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){s=a.child;for(var u=l.firstContext;u!==null;){if(u.context===r&&u.observedBits&i){a.tag===1&&(u=yr(-1,n&-n),u.tag=2,vr(a,u)),a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),GS(a.return,n),l.lanes|=n;break}u=u.next}}else s=a.tag===10&&a.type===t.type?null:a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===t){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}dt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,i=t.pendingProps,r=i.children,yi(t,n),o=Ft(o,i.unstable_observedBits),r=r(o),t.flags|=1,dt(e,t,r,n),t.child;case 14:return o=t.type,i=Zt(o,t.pendingProps),i=Zt(o.type,i),_0(e,t,o,i,r,n);case 15:return lw(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Zt(r,o),e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,pt(r)?(e=!0,lu(t)):e=!1,yi(t,n),QS(t,r,o),Np(t,r,o,n),Hp(null,t,r,!0,e,n);case 19:return V0(e,t,n);case 23:return ip(e,t,n);case 24:return ip(e,t,n)}throw Error(P(156,t.tag))};function GR(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function _t(e,t,n,r){return new GR(e,t,n,r)}function Hm(e){return e=e.prototype,!(!e||!e.isReactComponent)}function YR(e){if(typeof e=="function")return Hm(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Hu)return 11;if(e===Uu)return 14}return 2}function kr(e,t){var n=e.alternate;return n===null?(n=_t(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function pu(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Hm(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case cr:return xi(n.children,o,i,t);case eS:s=8,o|=16;break;case em:s=8,o|=1;break;case Us:return e=_t(12,n,t,o|8),e.elementType=Us,e.type=Us,e.lanes=i,e;case Bs:return e=_t(13,n,t,o),e.type=Bs,e.elementType=Bs,e.lanes=i,e;case mu:return e=_t(19,n,t,o),e.elementType=mu,e.lanes=i,e;case sm:return Um(n,o,i,t);case dp:return e=_t(24,n,t,o),e.elementType=dp,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case tm:s=10;break e;case nm:s=9;break e;case Hu:s=11;break e;case Uu:s=14;break e;case rm:s=16,r=null;break e;case om:s=22;break e}throw Error(P(130,e==null?e:typeof e,""))}return t=_t(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function xi(e,t,n,r){return e=_t(7,e,r,t),e.lanes=n,e}function Um(e,t,n,r){return e=_t(23,e,r,t),e.elementType=sm,e.lanes=n,e}function lp(e,t,n){return e=_t(6,e,null,t),e.lanes=n,e}function up(e,t,n){return t=_t(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function XR(e,t,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=qf(0),this.expirationTimes=qf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qf(0),this.mutableSourceEagerHydrationData=null}function QR(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ao,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Du(e,t,n,r){var o=t.current,i=yt(),s=Sr(o);e:if(n){n=n._reactInternals;t:{if(So(n)!==n||n.tag!==1)throw Error(P(170));var a=n;do{switch(a.tag){case 3:a=a.stateNode.context;break t;case 1:if(pt(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break t}}a=a.return}while(a!==null);throw Error(P(171))}if(n.tag===1){var l=n.type;if(pt(l)){n=jS(n,l,a);break e}}n=a}else n=br;return t.context===null?t.context=n:t.pendingContext=n,t=yr(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),vr(o,t),wr(o,s,i),s}function cp(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Z0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Bm(e,t){Z0(e,t),(e=e.alternate)&&Z0(e,t)}function ZR(){return null}function jm(e,t,n){var r=n!=null&&n.hydrationOptions!=null&&n.hydrationOptions.mutableSources||null;if(n=new XR(e,t,n!=null&&n.hydrate===!0),t=_t(3,null,null,t===2?7:t===1?3:0),n.current=t,t.stateNode=n,Tm(t),e[Pi]=n.current,DS(e.nodeType===8?e.parentNode:e),r)for(e=0;e<r.length;e++){t=r[e];var o=t._getVersion;o=o(t._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[t,o]:n.mutableSourceEagerHydrationData.push(t,o)}this._internalRoot=n}jm.prototype.render=function(e){Du(e,this._internalRoot,null,null)};jm.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;Du(null,e,null,function(){t[Pi]=null})};function ga(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function JR(e,t){if(t||(t=e?e.nodeType===9?e.documentElement:e.firstChild:null,t=!(!t||t.nodeType!==1||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new jm(e,0,t?{hydrate:!0}:void 0)}function Xu(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i._internalRoot;if(typeof o=="function"){var a=o;o=function(){var u=cp(s);a.call(u)}}Du(t,s,e,o)}else{if(i=n._reactRootContainer=JR(n,r),s=i._internalRoot,typeof o=="function"){var l=o;o=function(){var u=cp(s);l.call(u)}}vw(function(){Du(t,s,e,o)})}return cp(s)}gS=function(e){if(e.tag===13){var t=yt();wr(e,4,t),Bm(e,4)}};dm=function(e){if(e.tag===13){var t=yt();wr(e,67108864,t),Bm(e,67108864)}};hS=function(e){if(e.tag===13){var t=yt(),n=Sr(e);wr(e,n,t),Bm(e,n)}};yS=function(e,t){return t()};xp=function(e,t,n){switch(t){case"input":if(pp(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=$u(r);if(!o)throw Error(P(90));nS(r),pp(r,o)}}}break;case"textarea":oS(e,n);break;case"select":t=n.value,t!=null&&pi(e,!!n.multiple,t,!1)}};lm=yw;dS=function(e,t,n,r,o){var i=K;K|=4;try{return go(98,e.bind(null,t,n,r,o))}finally{K=i,K===0&&(Li(),wn())}};um=function(){!(K&49)&&(UR(),Rr())};fS=function(e,t){var n=K;K|=2;try{return e(t)}finally{K=n,K===0&&(Li(),wn())}};function Tw(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ga(t))throw Error(P(200));return QR(e,t,null,n)}var eA={Events:[fa,ui,$u,uS,cS,Rr,{current:!1}]},Os={findFiberByHostInstance:uo,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},tA={bundleType:Os.bundleType,version:Os.version,rendererPackageName:Os.rendererPackageName,rendererConfig:Os.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:vo.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=mS(e),e===null?null:e.stateNode},findFiberByHostInstance:Os.findFiberByHostInstance||ZR,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Ns=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Ns.isDisabled&&Ns.supportsFiber))try{xm=Ns.inject(tA),po=Ns}catch{}var Ns;Ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=eA;Ut.createPortal=Tw;Ut.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(P(188)):Error(P(268,Object.keys(e)));return e=mS(t),e=e===null?null:e.stateNode,e};Ut.flushSync=function(e,t){var n=K;if(n&48)return e(t);K|=1;try{if(e)return go(99,e.bind(null,t))}finally{K=n,wn()}};Ut.hydrate=function(e,t,n){if(!ga(t))throw Error(P(200));return Xu(null,e,t,!0,n)};Ut.render=function(e,t,n){if(!ga(t))throw Error(P(200));return Xu(null,e,t,!1,n)};Ut.unmountComponentAtNode=function(e){if(!ga(e))throw Error(P(40));return e._reactRootContainer?(vw(function(){Xu(null,null,e,!1,function(){e._reactRootContainer=null,e[Pi]=null})}),!0):!1};Ut.unstable_batchedUpdates=yw;Ut.unstable_createPortal=function(e,t){return Tw(e,t,2<arguments.length&&arguments[2]!==void 0?arguments[2]:null)};Ut.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!ga(n))throw Error(P(200));if(e==null||e._reactInternals===void 0)throw Error(P(38));return Xu(e,t,n,!1,r)};Ut.version="17.0.2"});var Qu=Ce((d_,Rw)=>{"use strict";function Pw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Pw)}catch(e){console.error(e)}}Pw(),Rw.exports=kw()});var nx=Ce(tx=>{"use strict";var Di=D();function UA(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var BA=typeof Object.is=="function"?Object.is:UA,jA=Di.useState,zA=Di.useEffect,VA=Di.useLayoutEffect,KA=Di.useDebugValue;function $A(e,t){var n=t(),r=jA({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return VA(function(){o.value=n,o.getSnapshot=t,mg(o)&&i({inst:o})},[e,n,t]),zA(function(){return mg(o)&&i({inst:o}),e(function(){mg(o)&&i({inst:o})})},[e]),KA(n),n}function mg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!BA(e,n)}catch{return!0}}function WA(e,t){return t()}var qA=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?WA:$A;tx.useSyncExternalStore=Di.useSyncExternalStore!==void 0?Di.useSyncExternalStore:qA});var gg=Ce((Z_,rx)=>{"use strict";rx.exports=nx()});var ix=Ce(ox=>{"use strict";var ic=D(),GA=gg();function YA(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var XA=typeof Object.is=="function"?Object.is:YA,QA=GA.useSyncExternalStore,ZA=ic.useRef,JA=ic.useEffect,eL=ic.useMemo,tL=ic.useDebugValue;ox.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=ZA(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=eL(function(){function l(m){if(!u){if(u=!0,c=m,m=r(m),o!==void 0&&s.hasValue){var y=s.value;if(o(y,m))return f=y}return f=m}if(y=f,XA(c,m))return y;var v=r(m);return o!==void 0&&o(y,v)?y:(c=m,f=v)}var u=!1,c,f,d=n===void 0?null:n;return[function(){return l(t())},d===null?void 0:function(){return l(d())}]},[t,n,r,o]);var a=QA(e,i[0],i[1]);return JA(function(){s.hasValue=!0,s.value=a},[a]),tL(a),a}});var ax=Ce((eD,sx)=>{"use strict";sx.exports=ix()});var vx=Ce(ie=>{"use strict";var Me=typeof Symbol=="function"&&Symbol.for,yg=Me?Symbol.for("react.element"):60103,vg=Me?Symbol.for("react.portal"):60106,uc=Me?Symbol.for("react.fragment"):60107,cc=Me?Symbol.for("react.strict_mode"):60108,dc=Me?Symbol.for("react.profiler"):60114,fc=Me?Symbol.for("react.provider"):60109,pc=Me?Symbol.for("react.context"):60110,Sg=Me?Symbol.for("react.async_mode"):60111,mc=Me?Symbol.for("react.concurrent_mode"):60111,gc=Me?Symbol.for("react.forward_ref"):60112,hc=Me?Symbol.for("react.suspense"):60113,iL=Me?Symbol.for("react.suspense_list"):60120,yc=Me?Symbol.for("react.memo"):60115,vc=Me?Symbol.for("react.lazy"):60116,sL=Me?Symbol.for("react.block"):60121,aL=Me?Symbol.for("react.fundamental"):60117,lL=Me?Symbol.for("react.responder"):60118,uL=Me?Symbol.for("react.scope"):60119;function wt(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case yg:switch(e=e.type,e){case Sg:case mc:case uc:case dc:case cc:case hc:return e;default:switch(e=e&&e.$$typeof,e){case pc:case gc:case vc:case yc:case fc:return e;default:return t}}case vg:return t}}}function yx(e){return wt(e)===mc}ie.AsyncMode=Sg;ie.ConcurrentMode=mc;ie.ContextConsumer=pc;ie.ContextProvider=fc;ie.Element=yg;ie.ForwardRef=gc;ie.Fragment=uc;ie.Lazy=vc;ie.Memo=yc;ie.Portal=vg;ie.Profiler=dc;ie.StrictMode=cc;ie.Suspense=hc;ie.isAsyncMode=function(e){return yx(e)||wt(e)===Sg};ie.isConcurrentMode=yx;ie.isContextConsumer=function(e){return wt(e)===pc};ie.isContextProvider=function(e){return wt(e)===fc};ie.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===yg};ie.isForwardRef=function(e){return wt(e)===gc};ie.isFragment=function(e){return wt(e)===uc};ie.isLazy=function(e){return wt(e)===vc};ie.isMemo=function(e){return wt(e)===yc};ie.isPortal=function(e){return wt(e)===vg};ie.isProfiler=function(e){return wt(e)===dc};ie.isStrictMode=function(e){return wt(e)===cc};ie.isSuspense=function(e){return wt(e)===hc};ie.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===uc||e===mc||e===dc||e===cc||e===hc||e===iL||typeof e=="object"&&e!==null&&(e.$$typeof===vc||e.$$typeof===yc||e.$$typeof===fc||e.$$typeof===pc||e.$$typeof===gc||e.$$typeof===aL||e.$$typeof===lL||e.$$typeof===uL||e.$$typeof===sL)};ie.typeOf=wt});var wx=Ce((mD,Sx)=>{"use strict";Sx.exports=vx()});var Px=Ce((gD,kx)=>{"use strict";var wg=wx(),cL={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},dL={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},fL={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},bx={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},xg={};xg[wg.ForwardRef]=fL;xg[wg.Memo]=bx;function xx(e){return wg.isMemo(e)?bx:xg[e.$$typeof]||cL}var pL=Object.defineProperty,mL=Object.getOwnPropertyNames,Ex=Object.getOwnPropertySymbols,gL=Object.getOwnPropertyDescriptor,hL=Object.getPrototypeOf,Cx=Object.prototype;function Tx(e,t,n){if(typeof t!="string"){if(Cx){var r=hL(t);r&&r!==Cx&&Tx(e,r,n)}var o=mL(t);Ex&&(o=o.concat(Ex(t)));for(var i=xx(e),s=xx(t),a=0;a<o.length;++a){var l=o[a];if(!dL[l]&&!(n&&n[l])&&!(s&&s[l])&&!(i&&i[l])){var u=gL(t,l);try{pL(e,l,u)}catch{}}}}return e}kx.exports=Tx});var Ax=Ce(se=>{"use strict";var Eg=Symbol.for("react.element"),Cg=Symbol.for("react.portal"),Sc=Symbol.for("react.fragment"),wc=Symbol.for("react.strict_mode"),xc=Symbol.for("react.profiler"),Ec=Symbol.for("react.provider"),Cc=Symbol.for("react.context"),yL=Symbol.for("react.server_context"),bc=Symbol.for("react.forward_ref"),Tc=Symbol.for("react.suspense"),kc=Symbol.for("react.suspense_list"),Pc=Symbol.for("react.memo"),Rc=Symbol.for("react.lazy"),vL=Symbol.for("react.offscreen"),Rx;Rx=Symbol.for("react.module.reference");function jt(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Eg:switch(e=e.type,e){case Sc:case xc:case wc:case Tc:case kc:return e;default:switch(e=e&&e.$$typeof,e){case yL:case Cc:case bc:case Rc:case Pc:case Ec:return e;default:return t}}case Cg:return t}}}se.ContextConsumer=Cc;se.ContextProvider=Ec;se.Element=Eg;se.ForwardRef=bc;se.Fragment=Sc;se.Lazy=Rc;se.Memo=Pc;se.Portal=Cg;se.Profiler=xc;se.StrictMode=wc;se.Suspense=Tc;se.SuspenseList=kc;se.isAsyncMode=function(){return!1};se.isConcurrentMode=function(){return!1};se.isContextConsumer=function(e){return jt(e)===Cc};se.isContextProvider=function(e){return jt(e)===Ec};se.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Eg};se.isForwardRef=function(e){return jt(e)===bc};se.isFragment=function(e){return jt(e)===Sc};se.isLazy=function(e){return jt(e)===Rc};se.isMemo=function(e){return jt(e)===Pc};se.isPortal=function(e){return jt(e)===Cg};se.isProfiler=function(e){return jt(e)===xc};se.isStrictMode=function(e){return jt(e)===wc};se.isSuspense=function(e){return jt(e)===Tc};se.isSuspenseList=function(e){return jt(e)===kc};se.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Sc||e===xc||e===wc||e===Tc||e===kc||e===vL||typeof e=="object"&&e!==null&&(e.$$typeof===Rc||e.$$typeof===Pc||e.$$typeof===Ec||e.$$typeof===Cc||e.$$typeof===bc||e.$$typeof===Rx||e.getModuleId!==void 0)};se.typeOf=jt});var Ix=Ce((yD,Lx)=>{"use strict";Lx.exports=Ax()});var Jg=Ce((M5,nE)=>{"use strict";var CI="Expected a function",eE=NaN,bI="[object Symbol]",TI=/^\s+|\s+$/g,kI=/^[-+]0x[0-9a-f]+$/i,PI=/^0b[01]+$/i,RI=/^0o[0-7]+$/i,AI=parseInt,LI=typeof global=="object"&&global&&global.Object===Object&&global,II=typeof self=="object"&&self&&self.Object===Object&&self,OI=LI||II||Function("return this")(),NI=Object.prototype,MI=NI.toString,_I=Math.max,DI=Math.min,Qg=function(){return OI.Date.now()};function FI(e,t,n){var r,o,i,s,a,l,u=0,c=!1,f=!1,d=!0;if(typeof e!="function")throw new TypeError(CI);t=tE(t)||0,Zg(n)&&(c=!!n.leading,f="maxWait"in n,i=f?_I(tE(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d);function m(C){var k=r,L=o;return r=o=void 0,u=C,s=e.apply(L,k),s}function y(C){return u=C,a=setTimeout(g,t),c?m(C):s}function v(C){var k=C-l,L=C-u,I=t-k;return f?DI(I,i-L):I}function p(C){var k=C-l,L=C-u;return l===void 0||k>=t||k<0||f&&L>=i}function g(){var C=Qg();if(p(C))return h(C);a=setTimeout(g,v(C))}function h(C){return a=void 0,d&&r?m(C):(r=o=void 0,s)}function S(){a!==void 0&&clearTimeout(a),u=0,r=l=o=a=void 0}function x(){return a===void 0?s:h(Qg())}function T(){var C=Qg(),k=p(C);if(r=arguments,o=this,l=C,k){if(a===void 0)return y(l);if(f)return a=setTimeout(g,t),m(l)}return a===void 0&&(a=setTimeout(g,t)),s}return T.cancel=S,T.flush=x,T}function Zg(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function HI(e){return!!e&&typeof e=="object"}function UI(e){return typeof e=="symbol"||HI(e)&&MI.call(e)==bI}function tE(e){if(typeof e=="number")return e;if(UI(e))return eE;if(Zg(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Zg(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(TI,"");var n=PI.test(e);return n||RI.test(e)?AI(e.slice(2),n?2:8):kI.test(e)?eE:+e}nE.exports=FI});var dE=Ce((J5,cE)=>{"use strict";var WI=/["'&<>]/;cE.exports=qI;function qI(e){var t=""+e,n=WI.exec(t);if(!n)return t;var r,o="",i=0,s=0;for(i=n.index;i<t.length;i++){switch(t.charCodeAt(i)){case 34:r=""";break;case 38:r="&";break;case 39:r="'";break;case 60:r="<";break;case 62:r=">";break;default:continue}s!==i&&(o+=t.substring(s,i)),s=i+1,o+=r}return s!==i?o+t.substring(s,i):o}});var l2={};Qe(l2,{Card:()=>fe,ContentEditableInput:()=>zo,DeepdeskAPI:()=>or,DeepdeskSDK:()=>yl,HTTPClient:()=>pn,InputMediator:()=>rr,InputType:()=>oo,KeyboardHint:()=>Ml,Label:()=>_l,Locale:()=>Ca,Section:()=>In,SectionList:()=>Dl,Sources:()=>On,Suggestion:()=>oe,SuggestionList:()=>ht,TextAreaInput:()=>Vo,ToggleButton:()=>ro,attachFile:()=>ak,authenticateWithKey:()=>ik,createFullRange:()=>as,createOverlayContainer:()=>hl,createRangeFromOffsets:()=>Gr,escapeHTML:()=>Wi,fetchPlatformConfig:()=>sk,formatTextMarkup:()=>ok,getRangeOffsets:()=>fl,getRangeText:()=>pl,insertCKEditor:()=>rk,isHTML:()=>Sd,isSupportedInputElement:()=>ff,updateContentEditable:()=>tk,updateTextArea:()=>ek,useStyles:()=>A,waitForElementVisibilityChange:()=>gf});var Lf=w(te()),Ot=w(D());var Ll=w(D()),av=w(te()),hs=Ll.default.createContext({});function A(e,t){let{debug:n,...r}=(0,Ll.useContext)(hs),o=r[e];return o?Object.entries(t).reduce((i,[s,a])=>{let l=o[s];return{...i,[s]:(0,av.default)(a,l,n?`${e}__${s}`:!1)}},{}):t}var lv={root:"jo"};var Jr=w(b()),Il=()=>(0,Jr.jsxs)("svg",{className:lv.root,width:"185",height:"170",viewBox:"0 0 185 170",xmlns:"http://www.w3.org/2000/svg",children:[(0,Jr.jsx)("defs",{children:(0,Jr.jsx)("style",{children:".cls-1 { fill: #b3b3b3; }"})}),(0,Jr.jsx)("title",{children:"Failed loading image"}),(0,Jr.jsx)("path",{className:"cls-1",d:"M15 130.896V16.994c0-1.097.898-1.994 2.007-1.994h150.986A2 2 0 0 1 170 16.994v69.147L133.015 51 87.26 120.377l-35.863-17.758L15 130.896zM2 0C.895 0 0 .887 0 2v166c0 1.105.887 2 2 2h181c1.105 0 2-.887 2-2V2c0-1.105-.887-2-2-2H2zm49 72c11.046 0 20-9.178 20-20.5S62.046 31 51 31s-20 9.178-20 20.5S39.954 72 51 72z",fillRule:"evenodd"})]});var Af={root:"Yo",imageWrapper:"F",image:"qo",content:"m",title:"Co",contentIsCropped:"So",lineClamp:"Eo"};var eo=w(b()),Ol=(0,Ot.createContext)(Af),Hk=({title:e,src:t})=>{let n=(0,Ot.useContext)(Ol),[r,o]=(0,Ot.useState)(!1);return(0,Ot.useEffect)(()=>{o(!1)},[t]),(0,eo.jsx)("div",{className:n.imageWrapper,children:t&&!r?(0,eo.jsx)("img",{className:n.image,alt:e,src:t,onError:()=>o(!0)}):(0,eo.jsx)(Il,{})})},Uk=({className:e,lineClamp:t=!1,cropText:n=!1,children:r})=>{let o=(0,Ot.useContext)(Ol);return(0,eo.jsx)("div",{className:(0,Lf.default)(o.content,e,{[o.contentIsCropped]:n,[o.lineClamp]:t}),children:r})},Bk=({as:e="h1",cropText:t=!1,className:n,children:r,...o})=>{let i=(0,Ot.useContext)(Ol);return Ot.default.createElement(e,{className:(0,Lf.default)(i.title,n,{[i.contentIsCropped]:t}),...o},r)},Nl=({children:e})=>{let t=A("Card",Af);return(0,eo.jsx)("div",{className:t.root,children:(0,eo.jsx)(Ol.Provider,{value:t,children:e})})};Nl.Image=Hk;Nl.Content=Uk;Nl.Title=Bk;var fe=Nl;var mv=w(te());var pv={root:"H"};var gv=w(b());var zk={"arrow-up":"\u25B2","arrow-down":"\u25BC",tab:"tab",esc:"Esc",enter:"\u21B5"},Vk=({className:e,keyCode:t,...n})=>{let r=A("KeyboardHint",pv);return(0,gv.jsx)("span",{"data-key":zk[t],className:(0,mv.default)(e,r.root),...n})},Ml=Vk;var yv=w(te());var hv={root:"Go"};var vv=w(b()),$k=({className:e,children:t,...n})=>{let r=A("Label",hv);return(0,vv.jsx)("span",{...n,className:(0,yv.default)(e,r.root),children:t})},_l=$k;var Sv={root:"No",subTitleContainer:"Ao",subtitle:"Fo",suggestions:"Ho"};var Zo=w(b()),qk=({title:e,children:t,type:n,...r})=>{let o=A("Section",Sv);return(0,Zo.jsxs)("section",{...r,className:o.root,"data-section-type":n,children:[e&&(0,Zo.jsx)("div",{className:o.subTitleContainer,children:(0,Zo.jsx)("span",{className:o.subtitle,children:e})}),(0,Zo.jsx)("div",{className:o.suggestions,children:t})]})},In=qk;var xv=w(te()),Ev=w(D());var wv={root:"Lo"};var Cv=w(b()),Yk=Ev.default.forwardRef(({className:e,children:t},n)=>{let r=A("SectionList",wv);return(0,Cv.jsx)("div",{ref:n,className:(0,xv.default)(r.root,e),children:t})}),Dl=Yk;var Jo=w(te()),Ze=w(D());var If={fadein:"L",root:"e",isClickable:"M",isSelected:"Mo",actions:"R",actionsIsFixed:"Ro",actionButton:"t",dropdownList:"T",dropdownButton:"U",dropdownItem:"B",dropdownItemButton:"D",actionButtonIsPrimary:"To",actionButtonIsDisabled:"Uo",labels:"Bo",label:"Do",iconButtons:"I",iconButton:"n"};var ut=w(b()),to=(0,Ze.createContext)(If),Qk=({fixed:e,children:t,...n})=>{let r=(0,Ze.useContext)(to);return(0,ut.jsx)("div",{...n,className:(0,Jo.default)(r.actions,{[r.actionsIsFixed]:e}),children:t})};function bv(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type===Tv}var Tv=({className:e,icon:t,title:n,...r})=>{let o=(0,Ze.useContext)(to);return(0,ut.jsx)("button",{type:"button",className:(0,Jo.default)(o.iconButton,e),title:n,"aria-label":n,...r,children:t})},Zk=({className:e,primary:t,disabled:n,label:r,children:o})=>{let i=(0,Ze.useContext)(to);return(0,ut.jsxs)("div",{className:(0,Jo.default)(e,i.actionButton,i.dropdownButton,{[i.actionButtonIsPrimary]:t,[i.actionButtonIsDisabled]:n}),onMouseDown:s=>s.stopPropagation(),onClick:s=>s.stopPropagation(),children:[r,(0,ut.jsx)("ul",{className:i.dropdownList,children:o})]})},Jk=({index:e,label:t,onClick:n})=>{let r=(0,Ze.useContext)(to);return(0,ut.jsx)("li",{className:r.dropdownItem,children:(0,ut.jsx)("button",{className:r.dropdownItemButton,type:"button","data-index":e,onClick:n,children:t})})},eP=({className:e,primary:t,disabled:n,onClick:r,label:o})=>{let i=(0,Ze.useContext)(to);return(0,ut.jsx)("button",{type:"button",className:(0,Jo.default)(e,i.actionButton,{[i.actionButtonIsPrimary]:t,[i.actionButtonIsDisabled]:n}),onClick:r??(s=>s.stopPropagation()),disabled:n,"aria-hidden":n,children:o})},tP=({labels:e})=>{let t=(0,Ze.useContext)(to);return(0,ut.jsx)("div",{className:t.labels,children:e.map(n=>(0,ut.jsx)("span",{className:t.label,children:n},n))})},no=Ze.default.forwardRef(({className:e,selected:t,onClick:n,children:r,as:o="div",...i},s)=>{let a=A("Suggestion",If),l=(0,Ze.useCallback)(f=>{f.preventDefault(),n&&n(f)},[n]),u=Ze.default.Children.toArray(r).filter(bv),c=Ze.default.Children.toArray(r).filter(f=>!bv(f));return(0,ut.jsx)(o,{...i,ref:s,className:(0,Jo.default)(e,a.root,{[a.isSelected]:t,[a.isClickable]:!!n}),onClick:l,children:(0,ut.jsxs)(to.Provider,{value:a,children:[c,(0,ut.jsx)("div",{className:a.iconButtons,children:u})]})})});no.Labels=tP;no.Actions=Qk;no.ActionButton=eP;no.DropdownButton=Zk;no.DropdownItem=Jk;no.IconButton=Tv;var oe=no;var Pv=w(te());var kv={root:"Io",isWithDivider:"Oo"};var Rv=w(b()),rP=({withDivider:e,children:t})=>{let n=A("SuggestionList",kv);return(0,Rv.jsx)("div",{"data-testid":"suggestions-overlay-list",className:(0,Pv.default)(n.root,{[n.isWithDivider]:e}),children:t})},ht=rP;var Lv=w(te());var Av={root:"u",isCollapsed:"O"};var Fl=w(b()),iP=({className:e,isCollapsed:t,title:n,onClick:r})=>{let o=A("ToggleButton",Av);return(0,Fl.jsx)("button",{type:"button",className:(0,Lv.default)(o.root,e,{[o.isCollapsed]:t}),onClick:r,title:n,children:(0,Fl.jsx)("svg",{width:"14",height:"8",viewBox:"-2.5 -5 75 60",preserveAspectRatio:"none",children:(0,Fl.jsx)("path",{d:"M0,0 l35,50 l35,-50",fill:"none",stroke:"grey",strokeLinecap:"round",strokeWidth:"6"})})})},ro=iP;var Iv=/(?:[.,;:!?\\n]|:\\)|:\\(|:-\\)|:-\\()/g,Hl=/(((\$!\{)|(\{))[a-zA-Z0-9_.]+\})/g;var Ov=/x-deepdesk-(([a-z0-9\-_])+-version)/,On=(v=>(v.SEARCH="search",v.TEMPLATE="template",v.ELASTIC_SEARCH="search-autocomplete",v.GPT="gpt",v.TRIE="trie",v.TRIE_WITH_TYPOS="trie-with-typos",v.SEMANTIC="semantic",v.TEXT_RECOMMENDATION="text_recommendation",v.URL_RECOMMENDATION="url_recommendation",v.LINK_RECOMMENDATION="link_recommendation",v.PERSONAL_COLLECTION="personal-collection",v.PERSONAL_COLLECTION_SEARCH="personal-collection-search",v.SEARCH_OVERLAY="search-overlay",v.SEARCH_PREVIEW="search-preview",v.SEARCH_URL="search-url",v))(On||{}),oo=(i=>(i.ENTER="enter",i.TAB="tab",i.ARROW="arrow",i.HOTKEY="hotkey",i.MOUSE="mouse",i))(oo||{});var qt=w(Qu());var cC=w(D());function Bt(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(!1)var o,i;throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map(function(s){return"'"+s+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Un(e){return!!e&&!!e[ve]}function en(e){var t;return!!e&&(function(n){if(!n||typeof n!="object")return!1;var r=Object.getPrototypeOf(n);if(r===null)return!0;var o=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return o===Object||typeof o=="function"&&Function.toString.call(o)===uA}(e)||Array.isArray(e)||!!e[_w]||!!(!((t=e.constructor)===null||t===void 0)&&t[_w])||Xm(e)||Qm(e))}function xo(e,t,n){n===void 0&&(n=!1),Ni(e)===0?(n?Object.keys:Oi)(e).forEach(function(r){n&&typeof r=="symbol"||t(r,e[r],e)}):e.forEach(function(r,o){return t(o,r,e)})}function Ni(e){var t=e[ve];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Xm(e)?2:Qm(e)?3:0}function Ii(e,t){return Ni(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function nA(e,t){return Ni(e)===2?e.get(t):e[t]}function Dw(e,t,n){var r=Ni(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Fw(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function Xm(e){return aA&&e instanceof Map}function Qm(e){return lA&&e instanceof Set}function Ar(e){return e.o||e.t}function Zm(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=Bw(e);delete t[ve];for(var n=Oi(t),r=0;r<n.length;r++){var o=n[r],i=t[o];i.writable===!1&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function Jm(e,t){return t===void 0&&(t=!1),eg(e)||Un(e)||!en(e)||(Ni(e)>1&&(e.set=e.add=e.clear=e.delete=rA),Object.freeze(e),t&&xo(e,function(n,r){return Jm(r,!0)},!0)),e}function rA(){Bt(2)}function eg(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function xn(e){var t=Ym[e];return t||Bt(18,e),t}function oA(e,t){Ym[e]||(Ym[e]=t)}function Wm(){return ya}function zm(e,t){t&&(xn("Patches"),e.u=[],e.s=[],e.v=t)}function Zu(e){qm(e),e.p.forEach(iA),e.p=null}function qm(e){e===ya&&(ya=e.l)}function Aw(e){return ya={p:[],l:ya,h:e,m:!0,_:0}}function iA(e){var t=e[ve];t.i===0||t.i===1?t.j():t.g=!0}function Vm(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.O||xn("ES5").S(t,e,r),r?(n[ve].P&&(Zu(t),Bt(4)),en(e)&&(e=Ju(t,e),t.l||ec(t,e)),t.u&&xn("Patches").M(n[ve].t,e,t.u,t.s)):e=Ju(t,n,[]),Zu(t),t.u&&t.v(t.u,t.s),e!==Uw?e:void 0}function Ju(e,t,n){if(eg(t))return t;var r=t[ve];if(!r)return xo(t,function(a,l){return Lw(e,r,t,a,l,n)},!0),t;if(r.A!==e)return t;if(!r.P)return ec(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=r.i===4||r.i===5?r.o=Zm(r.k):r.o,i=o,s=!1;r.i===3&&(i=new Set(o),o.clear(),s=!0),xo(i,function(a,l){return Lw(e,r,o,a,l,n,s)}),ec(e,o,!1),n&&e.u&&xn("Patches").N(r,n,e.u,e.s)}return r.o}function Lw(e,t,n,r,o,i,s){if(Un(o)){var a=Ju(e,o,i&&t&&t.i!==3&&!Ii(t.R,r)?i.concat(r):void 0);if(Dw(n,r,a),!Un(a))return;e.m=!1}else s&&n.add(o);if(en(o)&&!eg(o)){if(!e.h.D&&e._<1)return;Ju(e,o),t&&t.A.l||ec(e,o)}}function ec(e,t,n){n===void 0&&(n=!1),!e.l&&e.h.D&&e.m&&Jm(t,n)}function Km(e,t){var n=e[ve];return(n?Ar(n):e)[t]}function Iw(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function Lr(e){e.P||(e.P=!0,e.l&&Lr(e.l))}function $m(e){e.o||(e.o=Zm(e.t))}function Gm(e,t,n){var r=Xm(t)?xn("MapSet").F(t,n):Qm(t)?xn("MapSet").T(t,n):e.O?function(o,i){var s=Array.isArray(o),a={i:s?1:0,A:i?i.A:Wm(),P:!1,I:!1,R:{},l:i,t:o,k:null,o:null,j:null,C:!1},l=a,u=va;s&&(l=[a],u=ha);var c=Proxy.revocable(l,u),f=c.revoke,d=c.proxy;return a.k=d,a.j=f,d}(t,n):xn("ES5").J(t,n);return(n?n.A:Wm()).p.push(r),r}function sA(e){return Un(e)||Bt(22,e),function t(n){if(!en(n))return n;var r,o=n[ve],i=Ni(n);if(o){if(!o.P&&(o.i<4||!xn("ES5").K(o)))return o.t;o.I=!0,r=Ow(n,i),o.I=!1}else r=Ow(n,i);return xo(r,function(s,a){o&&nA(o.t,s)===a||Dw(r,s,t(a))}),i===3?new Set(r):r}(e)}function Ow(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Zm(e)}function Hw(){function e(s,a){var l=i[s];return l?l.enumerable=a:i[s]=l={configurable:!0,enumerable:a,get:function(){var u=this[ve];return va.get(u,s)},set:function(u){var c=this[ve];va.set(c,s,u)}},l}function t(s){for(var a=s.length-1;a>=0;a--){var l=s[a][ve];if(!l.P)switch(l.i){case 5:r(l)&&Lr(l);break;case 4:n(l)&&Lr(l)}}}function n(s){for(var a=s.t,l=s.k,u=Oi(l),c=u.length-1;c>=0;c--){var f=u[c];if(f!==ve){var d=a[f];if(d===void 0&&!Ii(a,f))return!0;var m=l[f],y=m&&m[ve];if(y?y.t!==d:!Fw(m,d))return!0}}var v=!!a[ve];return u.length!==Oi(a).length+(v?0:1)}function r(s){var a=s.k;if(a.length!==s.t.length)return!0;var l=Object.getOwnPropertyDescriptor(a,a.length-1);if(l&&!l.get)return!0;for(var u=0;u<a.length;u++)if(!a.hasOwnProperty(u))return!0;return!1}function o(s){s.g&&Bt(3,JSON.stringify(Ar(s)))}var i={};oA("ES5",{J:function(s,a){var l=Array.isArray(s),u=function(f,d){if(f){for(var m=Array(d.length),y=0;y<d.length;y++)Object.defineProperty(m,""+y,e(y,!0));return m}var v=Bw(d);delete v[ve];for(var p=Oi(v),g=0;g<p.length;g++){var h=p[g];v[h]=e(h,f||!!v[h].enumerable)}return Object.create(Object.getPrototypeOf(d),v)}(l,s),c={i:l?5:4,A:a?a.A:Wm(),P:!1,I:!1,R:{},l:a,t:s,k:u,o:null,g:!1,C:!1};return Object.defineProperty(u,ve,{value:c,writable:!0}),u},S:function(s,a,l){l?Un(a)&&a[ve].A===s&&t(s.p):(s.u&&function u(c){if(c&&typeof c=="object"){var f=c[ve];if(f){var d=f.t,m=f.k,y=f.R,v=f.i;if(v===4)xo(m,function(x){x!==ve&&(d[x]!==void 0||Ii(d,x)?y[x]||u(m[x]):(y[x]=!0,Lr(f)))}),xo(d,function(x){m[x]!==void 0||Ii(m,x)||(y[x]=!1,Lr(f))});else if(v===5){if(r(f)&&(Lr(f),y.length=!0),m.length<d.length)for(var p=m.length;p<d.length;p++)y[p]=!1;else for(var g=d.length;g<m.length;g++)y[g]=!0;for(var h=Math.min(m.length,d.length),S=0;S<h;S++)m.hasOwnProperty(S)||(y[S]=!0),y[S]===void 0&&u(m[S])}}}}(s.p[0]),t(s.p))},K:function(s){return s.i===4?n(s):r(s)}})}var Nw,ya,tg=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",aA=typeof Map<"u",lA=typeof Set<"u",Mw=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Uw=tg?Symbol.for("immer-nothing"):((Nw={})["immer-nothing"]=!0,Nw),_w=tg?Symbol.for("immer-draftable"):"__$immer_draftable",ve=tg?Symbol.for("immer-state"):"__$immer_state";var uA=""+Object.prototype.constructor,Oi=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,Bw=Object.getOwnPropertyDescriptors||function(e){var t={};return Oi(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},Ym={},va={get:function(e,t){if(t===ve)return e;var n=Ar(e);if(!Ii(n,t))return function(o,i,s){var a,l=Iw(i,s);return l?"value"in l?l.value:(a=l.get)===null||a===void 0?void 0:a.call(o.k):void 0}(e,n,t);var r=n[t];return e.I||!en(r)?r:r===Km(e.t,t)?($m(e),e.o[t]=Gm(e.A.h,r,e)):r},has:function(e,t){return t in Ar(e)},ownKeys:function(e){return Reflect.ownKeys(Ar(e))},set:function(e,t,n){var r=Iw(Ar(e),t);if(r!=null&&r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=Km(Ar(e),t),i=o==null?void 0:o[ve];if(i&&i.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(Fw(n,o)&&(n!==void 0||Ii(e.t,t)))return!0;$m(e),Lr(e)}return e.o[t]===n&&(n!==void 0||t in e.o)||Number.isNaN(n)&&Number.isNaN(e.o[t])||(e.o[t]=n,e.R[t]=!0),!0},deleteProperty:function(e,t){return Km(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,$m(e),Lr(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=Ar(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty:function(){Bt(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){Bt(12)}},ha={};xo(va,function(e,t){ha[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),ha.deleteProperty=function(e,t){return ha.set.call(this,e,t,void 0)},ha.set=function(e,t,n){return va.set.call(this,e[0],t,n,e[0])};var cA=function(){function e(n){var r=this;this.O=Mw,this.D=!0,this.produce=function(o,i,s){if(typeof o=="function"&&typeof i!="function"){var a=i;i=o;var l=r;return function(v){var p=this;v===void 0&&(v=a);for(var g=arguments.length,h=Array(g>1?g-1:0),S=1;S<g;S++)h[S-1]=arguments[S];return l.produce(v,function(x){var T;return(T=i).call.apply(T,[p,x].concat(h))})}}var u;if(typeof i!="function"&&Bt(6),s!==void 0&&typeof s!="function"&&Bt(7),en(o)){var c=Aw(r),f=Gm(r,o,void 0),d=!0;try{u=i(f),d=!1}finally{d?Zu(c):qm(c)}return typeof Promise<"u"&&u instanceof Promise?u.then(function(v){return zm(c,s),Vm(v,c)},function(v){throw Zu(c),v}):(zm(c,s),Vm(u,c))}if(!o||typeof o!="object"){if((u=i(o))===void 0&&(u=o),u===Uw&&(u=void 0),r.D&&Jm(u,!0),s){var m=[],y=[];xn("Patches").M(o,u,m,y),s(m,y)}return u}Bt(21,o)},this.produceWithPatches=function(o,i){if(typeof o=="function")return function(u){for(var c=arguments.length,f=Array(c>1?c-1:0),d=1;d<c;d++)f[d-1]=arguments[d];return r.produceWithPatches(u,function(m){return o.apply(void 0,[m].concat(f))})};var s,a,l=r.produce(o,i,function(u,c){s=u,a=c});return typeof Promise<"u"&&l instanceof Promise?l.then(function(u){return[u,s,a]}):[l,s,a]},typeof(n==null?void 0:n.useProxies)=="boolean"&&this.setUseProxies(n.useProxies),typeof(n==null?void 0:n.autoFreeze)=="boolean"&&this.setAutoFreeze(n.autoFreeze)}var t=e.prototype;return t.createDraft=function(n){en(n)||Bt(8),Un(n)&&(n=sA(n));var r=Aw(this),o=Gm(this,n,void 0);return o[ve].C=!0,qm(r),o},t.finishDraft=function(n,r){var o=n&&n[ve],i=o.A;return zm(i,r),Vm(void 0,i)},t.setAutoFreeze=function(n){this.D=n},t.setUseProxies=function(n){n&&!Mw&&Bt(20),this.O=n},t.applyPatches=function(n,r){var o;for(o=r.length-1;o>=0;o--){var i=r[o];if(i.path.length===0&&i.op==="replace"){n=i.value;break}}o>-1&&(r=r.slice(o+1));var s=xn("Patches").$;return Un(n)?s(n,r):this.produce(n,function(a){return s(a,r)})},e}(),St=new cA,dA=St.produce,f_=St.produceWithPatches.bind(St),p_=St.setAutoFreeze.bind(St),m_=St.setUseProxies.bind(St),g_=St.applyPatches.bind(St),h_=St.createDraft.bind(St),y_=St.finishDraft.bind(St),tc=dA;function Ir(e){"@babel/helpers - typeof";return Ir=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ir(e)}function ng(e,t){if(Ir(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ir(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rg(e){var t=ng(e,"string");return Ir(t)==="symbol"?t:String(t)}function og(e,t,n){return t=rg(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function nc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jw(Object(n),!0).forEach(function(r){og(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jw(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qe(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var zw=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),ig=function(){return Math.random().toString(36).substring(7).split("").join(".")},rc={INIT:"@@redux/INIT"+ig(),REPLACE:"@@redux/REPLACE"+ig(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+ig()}};function fA(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function sg(e,t,n){var r;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(qe(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(qe(1));return n(sg)(e,t)}if(typeof e!="function")throw new Error(qe(2));var o=e,i=t,s=[],a=s,l=!1;function u(){a===s&&(a=s.slice())}function c(){if(l)throw new Error(qe(3));return i}function f(v){if(typeof v!="function")throw new Error(qe(4));if(l)throw new Error(qe(5));var p=!0;return u(),a.push(v),function(){if(p){if(l)throw new Error(qe(6));p=!1,u();var h=a.indexOf(v);a.splice(h,1),s=null}}}function d(v){if(!fA(v))throw new Error(qe(7));if(typeof v.type>"u")throw new Error(qe(8));if(l)throw new Error(qe(9));try{l=!0,i=o(i,v)}finally{l=!1}for(var p=s=a,g=0;g<p.length;g++){var h=p[g];h()}return v}function m(v){if(typeof v!="function")throw new Error(qe(10));o=v,d({type:rc.REPLACE})}function y(){var v,p=f;return v={subscribe:function(h){if(typeof h!="object"||h===null)throw new Error(qe(11));function S(){h.next&&h.next(c())}S();var x=p(S);return{unsubscribe:x}}},v[zw]=function(){return this},v}return d({type:rc.INIT}),r={dispatch:d,subscribe:f,getState:c,replaceReducer:m},r[zw]=y,r}function pA(e){Object.keys(e).forEach(function(t){var n=e[t],r=n(void 0,{type:rc.INIT});if(typeof r>"u")throw new Error(qe(12));if(typeof n(void 0,{type:rc.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(qe(13))})}function oc(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];typeof e[o]=="function"&&(n[o]=e[o])}var i=Object.keys(n),s,a;try{pA(n)}catch(l){a=l}return function(u,c){if(u===void 0&&(u={}),a)throw a;if(!1)var f;for(var d=!1,m={},y=0;y<i.length;y++){var v=i[y],p=n[v],g=u[v],h=p(g,c);if(typeof h>"u"){var S=c&&c.type;throw new Error(qe(14))}m[v]=h,d=d||h!==g}return d=d||i.length!==Object.keys(u).length,d?m:u}}function Mi(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length===0?function(r){return r}:t.length===1?t[0]:t.reduce(function(r,o){return function(){return r(o.apply(void 0,arguments))}})}function Vw(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return function(){var o=r.apply(void 0,arguments),i=function(){throw new Error(qe(15))},s={getState:o.getState,dispatch:function(){return i.apply(void 0,arguments)}},a=t.map(function(l){return l(s)});return i=Mi.apply(void 0,a)(o.dispatch),nc(nc({},o),{},{dispatch:i})}}}function Kw(e){var t=function(r){var o=r.dispatch,i=r.getState;return function(s){return function(a){return typeof a=="function"?a(o,i,e):s(a)}}};return t}var $w=Kw();$w.withExtraArgument=Kw;var ag=$w;var Xw=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),mA=function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,o=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){n.label=u[1];break}if(u[0]===6&&n.label<i[1]){n.label=i[1],i=u;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(u);break}i[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],o=0}finally{r=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},_i=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e},gA=Object.defineProperty,hA=Object.defineProperties,yA=Object.getOwnPropertyDescriptors,Ww=Object.getOwnPropertySymbols,vA=Object.prototype.hasOwnProperty,SA=Object.prototype.propertyIsEnumerable,qw=function(e,t,n){return t in e?gA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Or=function(e,t){for(var n in t||(t={}))vA.call(t,n)&&qw(e,n,t[n]);if(Ww)for(var r=0,o=Ww(t);r<o.length;r++){var n=o[r];SA.call(t,n)&&qw(e,n,t[n])}return e},lg=function(e,t){return hA(e,yA(t))},wA=function(e,t,n){return new Promise(function(r,o){var i=function(l){try{a(n.next(l))}catch(u){o(u)}},s=function(l){try{a(n.throw(l))}catch(u){o(u)}},a=function(l){return l.done?r(l.value):Promise.resolve(l.value).then(i,s)};a((n=n.apply(e,t)).next())})};var xA=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Mi:Mi.apply(null,arguments)},__=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}};function EA(e){if(typeof e!="object"||e===null)return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var n=t;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return t===n}var CA=function(e){Xw(t,e);function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.apply(this,n)||this;return Object.setPrototypeOf(o,t.prototype),o}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.prototype.concat.apply(this,n)},t.prototype.prepend=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n.length===1&&Array.isArray(n[0])?new(t.bind.apply(t,_i([void 0],n[0].concat(this)))):new(t.bind.apply(t,_i([void 0],n.concat(this))))},t}(Array),bA=function(e){Xw(t,e);function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.apply(this,n)||this;return Object.setPrototypeOf(o,t.prototype),o}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.prototype.concat.apply(this,n)},t.prototype.prepend=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n.length===1&&Array.isArray(n[0])?new(t.bind.apply(t,_i([void 0],n[0].concat(this)))):new(t.bind.apply(t,_i([void 0],n.concat(this))))},t}(Array);function dg(e){return en(e)?tc(e,function(){}):e}function TA(e){return typeof e=="boolean"}function kA(){return function(t){return PA(t)}}function PA(e){e===void 0&&(e={});var t=e.thunk,n=t===void 0?!0:t,r=e.immutableCheck,o=r===void 0?!0:r,i=e.serializableCheck,s=i===void 0?!0:i,a=new CA;if(n&&(TA(n)?a.push(ag):a.push(ag.withExtraArgument(n.extraArgument))),!1){if(o)var l;if(s)var u}return a}var ug=!0;function Qw(e){var t=kA(),n=e||{},r=n.reducer,o=r===void 0?void 0:r,i=n.middleware,s=i===void 0?t():i,a=n.devTools,l=a===void 0?!0:a,u=n.preloadedState,c=u===void 0?void 0:u,f=n.enhancers,d=f===void 0?void 0:f,m;if(typeof o=="function")m=o;else if(EA(o))m=oc(o);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var y=s;if(typeof y=="function"&&(y=y(t),!ug&&!Array.isArray(y)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!ug&&y.some(function(x){return typeof x!="function"}))throw new Error("each middleware provided to configureStore must be a function");var v=Vw.apply(void 0,y),p=Mi;l&&(p=xA(Or({trace:!ug},typeof l=="object"&&l)));var g=new bA(v),h=g;Array.isArray(d)?h=_i([v],d):typeof d=="function"&&(h=d(g));var S=p.apply(void 0,h);return sg(m,c,S)}function we(e,t){function n(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(t){var i=t.apply(void 0,r);if(!i)throw new Error("prepareAction did not return an object");return Or(Or({type:e,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:e,payload:r[0]}}return n.toString=function(){return""+e},n.type=e,n.match=function(r){return r.type===e},n}function Zw(e){var t={},n=[],r,o={addCase:function(i,s){var a=typeof i=="string"?i:i.type;if(a in t)throw new Error("addCase cannot be called with two reducers for the same action type");return t[a]=s,o},addMatcher:function(i,s){return n.push({matcher:i,reducer:s}),o},addDefaultCase:function(i){return r=i,o}};return e(o),[t,n,r]}function RA(e){return typeof e=="function"}function AA(e,t,n,r){n===void 0&&(n=[]);var o=typeof t=="function"?Zw(t):[t,n,r],i=o[0],s=o[1],a=o[2],l;if(RA(e))l=function(){return dg(e())};else{var u=dg(e);l=function(){return u}}function c(f,d){f===void 0&&(f=l());var m=_i([i[d.type]],s.filter(function(y){var v=y.matcher;return v(d)}).map(function(y){var v=y.reducer;return v}));return m.filter(function(y){return!!y}).length===0&&(m=[a]),m.reduce(function(y,v){if(v)if(Un(y)){var p=y,g=v(p,d);return g===void 0?y:g}else{if(en(y))return tc(y,function(h){return v(h,d)});var g=v(y,d);if(g===void 0){if(y===null)return y;throw Error("A case reducer on a non-draftable value must not return undefined")}return g}return y},f)}return c.getInitialState=l,c}function LA(e,t){return e+"/"+t}function W(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");typeof process<"u";var n=typeof e.initialState=="function"?e.initialState:dg(e.initialState),r=e.reducers||{},o=Object.keys(r),i={},s={},a={};o.forEach(function(c){var f=r[c],d=LA(t,c),m,y;"reducer"in f?(m=f.reducer,y=f.prepare):m=f,i[c]=m,s[d]=m,a[c]=y?we(d,y):we(d)});function l(){var c=typeof e.extraReducers=="function"?Zw(e.extraReducers):[e.extraReducers],f=c[0],d=f===void 0?{}:f,m=c[1],y=m===void 0?[]:m,v=c[2],p=v===void 0?void 0:v,g=Or(Or({},d),s);return AA(n,function(h){for(var S in g)h.addCase(S,g[S]);for(var x=0,T=y;x<T.length;x++){var C=T[x];h.addMatcher(C.matcher,C.reducer)}p&&h.addDefaultCase(p)})}var u;return{name:t,reducer:function(c,f){return u||(u=l()),u(c,f)},actions:a,caseReducers:i,getInitialState:function(){return u||(u=l()),u.getInitialState()}}}var IA="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",OA=function(e){e===void 0&&(e=21);for(var t="",n=e;n--;)t+=IA[Math.random()*64|0];return t},NA=["name","message","stack","code"],cg=function(){function e(t,n){this.payload=t,this.meta=n}return e}(),Gw=function(){function e(t,n){this.payload=t,this.meta=n}return e}(),MA=function(e){if(typeof e=="object"&&e!==null){for(var t={},n=0,r=NA;n<r.length;n++){var o=r[n];typeof e[o]=="string"&&(t[o]=e[o])}return t}return{message:String(e)}},B=function(){function e(t,n,r){var o=we(t+"/fulfilled",function(c,f,d,m){return{payload:c,meta:lg(Or({},m||{}),{arg:d,requestId:f,requestStatus:"fulfilled"})}}),i=we(t+"/pending",function(c,f,d){return{payload:void 0,meta:lg(Or({},d||{}),{arg:f,requestId:c,requestStatus:"pending"})}}),s=we(t+"/rejected",function(c,f,d,m,y){return{payload:m,error:(r&&r.serializeError||MA)(c||"Rejected"),meta:lg(Or({},y||{}),{arg:d,requestId:f,rejectedWithValue:!!m,requestStatus:"rejected",aborted:(c==null?void 0:c.name)==="AbortError",condition:(c==null?void 0:c.name)==="ConditionError"})}}),a=!1,l=typeof AbortController<"u"?AbortController:function(){function c(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return c.prototype.abort=function(){},c}();function u(c){return function(f,d,m){var y=r!=null&&r.idGenerator?r.idGenerator(c):OA(),v=new l,p,g=!1;function h(x){p=x,v.abort()}var S=function(){return wA(this,null,function(){var x,T,C,k,L,I,N;return mA(this,function(V){switch(V.label){case 0:return V.trys.push([0,4,,5]),k=(x=r==null?void 0:r.condition)==null?void 0:x.call(r,c,{getState:d,extra:m}),DA(k)?[4,k]:[3,2];case 1:k=V.sent(),V.label=2;case 2:if(k===!1||v.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return g=!0,L=new Promise(function(_,ee){return v.signal.addEventListener("abort",function(){return ee({name:"AbortError",message:p||"Aborted"})})}),f(i(y,c,(T=r==null?void 0:r.getPendingMeta)==null?void 0:T.call(r,{requestId:y,arg:c},{getState:d,extra:m}))),[4,Promise.race([L,Promise.resolve(n(c,{dispatch:f,getState:d,extra:m,requestId:y,signal:v.signal,abort:h,rejectWithValue:function(_,ee){return new cg(_,ee)},fulfillWithValue:function(_,ee){return new Gw(_,ee)}})).then(function(_){if(_ instanceof cg)throw _;return _ instanceof Gw?o(_.payload,y,c,_.meta):o(_,y,c)})])];case 3:return C=V.sent(),[3,5];case 4:return I=V.sent(),C=I instanceof cg?s(null,y,c,I.payload,I.meta):s(I,y,c),[3,5];case 5:return N=r&&!r.dispatchConditionRejection&&s.match(C)&&C.meta.condition,N||f(C),[2,C]}})})}();return Object.assign(S,{abort:h,requestId:y,arg:c,unwrap:function(){return S.then(_A)}})}}return Object.assign(u,{pending:i,rejected:s,fulfilled:o,typePrefix:t})}return e.withTypes=function(){return e},e}();function _A(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function DA(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var FA="task",Jw="listener",ex="completed",fg="cancelled",U_="task-"+fg,B_="task-"+ex,j_=Jw+"-"+fg,z_=Jw+"-"+ex,V_=function(){function e(t){this.code=t,this.name="TaskAbortError",this.message=FA+" "+fg+" (reason: "+t+")"}return e}();var pg="listenerMiddleware";var K_=we(pg+"/add"),$_=we(pg+"/removeAll"),W_=we(pg+"/remove");var Yw,q_=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(Yw||(Yw=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},HA=function(e){return function(t){setTimeout(t,e)}},G_=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:HA(10);Hw();var zx=w(gg()),Vx=w(ax());var hg=w(Qu());function nL(e){e()}var lx=nL,ux=e=>lx=e,cx=()=>lx;var Fi=w(D());var px=w(D());var sc=w(D()),dx=Symbol.for(`react-redux-context-${sc.version}`),fx=globalThis;function rL(){let e=fx[dx];return e||(e=(0,sc.createContext)(null),fx[dx]=e),e}var Ge=new Proxy({},new Proxy({},{get(e,t){let n=rL();return(r,...o)=>Reflect[t](n,...o)}}));function Sa(e=Ge){return function(){return(0,px.useContext)(e)}}var ac=Sa();var lc=()=>{throw new Error("uSES not initialized!")};var mx=lc,gx=e=>{mx=e},oL=(e,t)=>e===t;function hx(e=Ge){let t=e===Ge?ac:Sa(e);return function(r,o={}){let{equalityFn:i=oL,stabilityCheck:s=void 0,noopCheck:a=void 0}=typeof o=="function"?{equalityFn:o}:o,{store:l,subscription:u,getServerState:c,stabilityCheck:f,noopCheck:d}=t(),m=(0,Fi.useRef)(!0),y=(0,Fi.useCallback)({[r.name](p){return r(p)}}[r.name],[r,f,s]),v=mx(u.addNestedSub,l.getState,c||l.getState,y,i);return(0,Fi.useDebugValue)(v),v}}var O=hx();function Bn(){return Bn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bn.apply(this,arguments)}function wa(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var kg=w(Px()),ae=w(D()),Hx=w(Ix());var wL=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function xL(e,t,n,r,{areStatesEqual:o,areOwnPropsEqual:i,areStatePropsEqual:s}){let a=!1,l,u,c,f,d;function m(h,S){return l=h,u=S,c=e(l,u),f=t(r,u),d=n(c,f,u),a=!0,d}function y(){return c=e(l,u),t.dependsOnOwnProps&&(f=t(r,u)),d=n(c,f,u),d}function v(){return e.dependsOnOwnProps&&(c=e(l,u)),t.dependsOnOwnProps&&(f=t(r,u)),d=n(c,f,u),d}function p(){let h=e(l,u),S=!s(h,c);return c=h,S&&(d=n(c,f,u)),d}function g(h,S){let x=!i(S,u),T=!o(h,l,S,u);return l=h,u=S,x&&T?y():x?v():T?p():d}return function(S,x){return a?g(S,x):m(S,x)}}function bg(e,t){let{initMapStateToProps:n,initMapDispatchToProps:r,initMergeProps:o}=t,i=wa(t,wL),s=n(e,i),a=r(e,i),l=o(e,i);return xL(s,a,l,e,i)}function Tg(e,t){let n={};for(let r in e){let o=e[r];typeof o=="function"&&(n[r]=(...i)=>t(o(...i)))}return n}function xa(e){return function(n){let r=e(n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function Ox(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}function Ac(e,t){return function(r,{displayName:o}){let i=function(a,l){return i.dependsOnOwnProps?i.mapToProps(a,l):i.mapToProps(a,void 0)};return i.dependsOnOwnProps=!0,i.mapToProps=function(a,l){i.mapToProps=e,i.dependsOnOwnProps=Ox(e);let u=i(a,l);return typeof u=="function"&&(i.mapToProps=u,i.dependsOnOwnProps=Ox(u),u=i(a,l)),u},i}}function Hi(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function Nx(e){return e&&typeof e=="object"?xa(t=>Tg(e,t)):e?typeof e=="function"?Ac(e,"mapDispatchToProps"):Hi(e,"mapDispatchToProps"):xa(t=>({dispatch:t}))}function Mx(e){return e?typeof e=="function"?Ac(e,"mapStateToProps"):Hi(e,"mapStateToProps"):xa(()=>({}))}function EL(e,t,n){return Bn({},n,e,t)}function CL(e){return function(n,{displayName:r,areMergedPropsEqual:o}){let i=!1,s;return function(l,u,c){let f=e(l,u,c);return i?o(f,s)||(s=f):(i=!0,s=f),s}}}function _x(e){return e?typeof e=="function"?CL(e):Hi(e,"mergeProps"):()=>EL}function bL(){let e=cx(),t=null,n=null;return{clear(){t=null,n=null},notify(){e(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){let r=[],o=t;for(;o;)r.push(o),o=o.next;return r},subscribe(r){let o=!0,i=n={callback:r,next:null,prev:n};return i.prev?i.prev.next=i:t=i,function(){!o||t===null||(o=!1,i.next?i.next.prev=i.prev:n=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}var Dx={notify(){},get:()=>[]};function Lc(e,t){let n,r=Dx;function o(f){return l(),r.subscribe(f)}function i(){r.notify()}function s(){c.onStateChange&&c.onStateChange()}function a(){return!!n}function l(){n||(n=t?t.addNestedSub(s):e.subscribe(s),r=bL())}function u(){n&&(n(),n=void 0,r.clear(),r=Dx)}let c={addNestedSub:o,notifyNestedSubs:i,handleChangeWrapper:s,isSubscribed:a,trySubscribe:l,tryUnsubscribe:u,getListeners:()=>r};return c}var Ic=w(D()),TL=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Ui=TL?Ic.useLayoutEffect:Ic.useEffect;function Fx(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Bi(e,t){if(Fx(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!Fx(e[n[o]],t[n[o]]))return!1;return!0}var kL=["reactReduxForwardedRef"],Ux=lc,Bx=e=>{Ux=e};var PL=[null,null];function RL(e,t,n){Ui(()=>e(...t),n)}function AL(e,t,n,r,o,i){e.current=r,n.current=!1,o.current&&(o.current=null,i())}function LL(e,t,n,r,o,i,s,a,l,u,c){if(!e)return()=>{};let f=!1,d=null,m=()=>{if(f||!a.current)return;let v=t.getState(),p,g;try{p=r(v,o.current)}catch(h){g=h,d=h}g||(d=null),p===i.current?s.current||u():(i.current=p,l.current=p,s.current=!0,c())};return n.onStateChange=m,n.trySubscribe(),m(),()=>{if(f=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}function IL(e,t){return e===t}function OL(e,t,n,{pure:r,areStatesEqual:o=IL,areOwnPropsEqual:i=Bi,areStatePropsEqual:s=Bi,areMergedPropsEqual:a=Bi,forwardRef:l=!1,context:u=Ge}={}){let c=u,f=Mx(e),d=Nx(t),m=_x(n),y=!!e;return p=>{let g=p.displayName||p.name||"Component",h=`Connect(${g})`,S={shouldHandleStateChanges:y,displayName:h,wrappedComponentName:g,WrappedComponent:p,initMapStateToProps:f,initMapDispatchToProps:d,initMergeProps:m,areStatesEqual:o,areStatePropsEqual:s,areOwnPropsEqual:i,areMergedPropsEqual:a};function x(k){let[L,I,N]=(0,ae.useMemo)(()=>{let{reactReduxForwardedRef:st}=k,Lt=wa(k,kL);return[k.context,st,Lt]},[k]),V=(0,ae.useMemo)(()=>L&&L.Consumer&&(0,Hx.isContextConsumer)(ae.default.createElement(L.Consumer,null))?L:c,[L,c]),_=(0,ae.useContext)(V),ee=!!k.store&&!!k.store.getState&&!!k.store.dispatch,Yr=!!_&&!!_.store,it=ee?k.store:_.store,Gt=Yr?_.getServerState:it.getState,At=(0,ae.useMemo)(()=>bg(it.dispatch,S),[it]),[H,q]=(0,ae.useMemo)(()=>{if(!y)return PL;let st=Lc(it,ee?void 0:_.subscription),Lt=st.notifyNestedSubs.bind(st);return[st,Lt]},[it,ee,_]),ir=(0,ae.useMemo)(()=>ee?_:Bn({},_,{subscription:H}),[ee,_,H]),he=(0,ae.useRef)(),sr=(0,ae.useRef)(N),$=(0,ae.useRef)(),ar=(0,ae.useRef)(!1),vl=(0,ae.useRef)(!1),$o=(0,ae.useRef)(!1),Xr=(0,ae.useRef)();Ui(()=>($o.current=!0,()=>{$o.current=!1}),[]);let ds=(0,ae.useMemo)(()=>()=>$.current&&N===sr.current?$.current:At(it.getState(),N),[it,N]),Sl=(0,ae.useMemo)(()=>Lt=>H?LL(y,it,H,At,sr,he,ar,$o,$,q,Lt):()=>{},[H]);RL(AL,[sr,he,ar,N,$,q]);let Yt;try{Yt=Ux(Sl,ds,Gt?()=>At(Gt(),N):ds)}catch(st){throw Xr.current&&(st.message+=`
|
|
10
10
|
The error may be correlated with this previous error:
|
|
11
11
|
${Xr.current.stack}
|
|
12
12
|
|
|
@@ -16,16 +16,17 @@ Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
|
16
16
|
`);return o=o.replace(/\n{3,}/g,`
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
`),o=o.replace(/\n/g,"<br/>"),o}createContainer(t){var n;let o=(typeof global<"u"&&global.INTERWEAVE_SSR_POLYFILL||JI)();if(!o)return;let i=(n=this.props.containerTagName)!==null&&n!==void 0?n:"body",s=i==="body"||i==="fragment"?o.body:o.createElement(i);return t.match(XI)||(s.innerHTML=this.convertLineBreaks(this.props.escapeHtml?(0,pE.default)(t):t)),s}extractAttributes(t){let{allowAttributes:n}=this.props,r={},o=0;return t.nodeType!==fE||!t.attributes||([...t.attributes].forEach(i=>{let{name:s,value:a}=i,l=s.toLowerCase(),u=hd[l]||hd[s];if(!this.isSafe(t)||!l.match(QI)&&(!n&&(!u||u===sh)||l.startsWith("on")||a.replace(/(\s|\0|�([9AD]);)/,"").match(/(javascript|vbscript|livescript|xss):/i)))return;let c=l==="style"?this.extractStyleAttribute(t):a;u===Hr?c=!0:u===Ao?c=Number.parseFloat(String(c)):u!==gd&&(c=String(c)),r[ah[l]||l]=this.applyAttributeFilters(l,c),o+=1}),o===0)?null:r}extractStyleAttribute(t){let n={};return Array.from(t.style).forEach(r=>{let o=t.style[r];(typeof o=="string"||typeof o=="number")&&(n[r.replace(/-([a-z])/g,(i,s)=>String(s).toUpperCase())]=o)}),n}getTagConfig(t){let n={children:[],content:0,invalid:[],parent:[],self:!0,tagName:"",type:0,void:!1};return Ba[t]?{...n,...Ba[t],tagName:t}:n}isSafe(t){if(typeof HTMLAnchorElement<"u"&&t instanceof HTMLAnchorElement){let n=t.getAttribute("href");if(n!=null&&n.startsWith("#"))return!0;let r=t.protocol.toLowerCase();return r===":"||r==="http:"||r==="https:"||r==="mailto:"||r==="tel:"}return!0}isTagAllowed(t){return this.banned.has(t)||this.blocked.has(t)?!1:this.props.allowElements||this.allowed.has(t)}parse(){return this.container?this.parseNode(this.container,this.getTagConfig(this.container.nodeName.toLowerCase())):[]}parseNode(t,n){let{noHtml:r,noHtmlExceptMatchers:o,allowElements:i,transform:s,transformOnlyAllowList:a}=this.props,l=[],u="";return[...t.childNodes].forEach(c=>{if(c.nodeType===fE){let d=c.nodeName.toLowerCase(),m=this.getTagConfig(d);u&&(l.push(u),u="");let y=this.applyNodeFilters(d,c);if(!y)return;let v;if(s&&!(a&&!this.isTagAllowed(d))){this.keyIndex+=1;let p=this.keyIndex;v=this.parseNode(y,m);let g=s(y,v,m);if(g===null)return;if(typeof g<"u"){l.push(Io.default.cloneElement(g,{key:p}));return}this.keyIndex=p-1}if(this.banned.has(d))return;if(!(r||o&&d!=="br")&&this.isTagAllowed(d)&&(i||this.canRenderChild(n,m))){var f;this.keyIndex+=1;let p=this.extractAttributes(y),g={tagName:d};p&&(g.attributes=p),m.void&&(g.selfClose=m.void),l.push(Io.default.createElement(yd,{...g,key:this.keyIndex},(f=v)!==null&&f!==void 0?f:this.parseNode(y,m)))}else l=[...l,...this.parseNode(y,m.tagName?m:n)]}else if(c.nodeType===YI){let d=r&&!o?c.textContent:this.applyMatchers(c.textContent||"",n);Array.isArray(d)?l=[...l,...d]:u+=d}}),u&&l.push(u),l}replaceTokens(t,n){if(!t.includes("{{{"))return t;let r=[],o=t,i=null;for(;i=o.match(ZI);){let[s,a]=i,l=i.index,u=s.includes("/");l>0&&(r.push(o.slice(0,l)),o=o.slice(l));let{children:c,matcher:f,props:d}=n[a],m;if(u)m=s.length,r.push(f.createElement(c,d));else{let y=o.match(new RegExp(`{{{/${a}}}}`));m=y.index+y[0].length,r.push(f.createElement(this.replaceTokens(o.slice(s.length,y.index),n),d))}o=o.slice(m)}return o.length>0&&r.push(o),r.length===0?"":r.length===1&&typeof r[0]=="string"?r[0]:r}};function eO(e){var t;let{attributes:n,className:r,containerTagName:o,content:i,emptyContent:s,parsedContent:a,tagName:l,noWrap:u}=e,c=(t=o??l)!==null&&t!==void 0?t:"span",f=c==="fragment"?!0:u,d;if(a)d=a;else{let m=new vd(i??"",e).parse();m.length>0&&(d=m)}return d||(d=s),f?Io.default.createElement(Io.default.Fragment,null,d):Io.default.createElement(yd,{attributes:n,className:r,tagName:c},d)}function $i(e){let{attributes:t,className:n,content:r="",disableFilters:o=!1,disableMatchers:i=!1,emptyContent:s=null,filters:a=[],matchers:l=[],onAfterParse:u=null,onBeforeParse:c=null,tagName:f="span",noWrap:d=!1,...m}=e,y=i?[]:l,v=o?[]:a,p=c?[c]:[],g=u?[u]:[];y.forEach(T=>{T.onBeforeParse&&p.push(T.onBeforeParse.bind(T)),T.onAfterParse&&g.push(T.onAfterParse.bind(T))});let h=p.reduce((T,C)=>C(T,e),r??""),S=new vd(h,m,y,v),x=g.reduce((T,C)=>C(T,e),S.parse());return Io.default.createElement(eO,{attributes:t,className:n,containerTagName:e.containerTagName,emptyContent:s,noWrap:d,parsedContent:x.length===0?void 0:x,tagName:f})}var tO=/[.*+?^${}()|[\]\\]/g,nO=/[^0-9A-Za-zÀ-ÖØ-öø-ÿ](?=[0-9A-Za-zÀ-ÖØ-öø-ÿ]*$)/;function rO(e){return e.replace(tO,"\\$&")}function oO(e,t){let n=e.split("").findIndex((r,o)=>r!==t[o]);return n>-1?n:Math.min(e.length,t.length)}function iO(e){return e.search(nO)}function mE(e,t=[]){let n=e;return t.forEach(r=>{if(!r)return;let o=new RegExp(`\\b(${rO(r)})\\b`,"gi");n=n.replace(o,"<strong>$1</strong>")}),n}function gE(e){return e.replace(Hl,'<mark data-type="placeholder">$1</mark>')}function Wi(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function sO(e,t){return e.split("").map((s,a)=>({char:s,index:a})).filter(({char:s,index:a})=>/\s/.test(s)&&a<=t).map(({index:s})=>s).reverse()[0]}function uh(e,t,n={}){if(t){let r=oO(t.toLowerCase(),e.toLowerCase()),o=Wi(e.substring(r,e.length));if(n.stripAgentPart){let l=e.substring(0,r),u=iO(l);return`<span style="opacity: 0.5">${l.substring(u+1)}</span>${o}`}let s=t.split(Iv).length>3||t.length>30?sO(t.trim(),r):0;return`${`${s>0?"\u2026":""}${Wi(e.substring(s,r))}`}<strong>${o}</strong>`}return e}var aO=/(<\/[a-zA-Z]+[0-9]?>|<[a-zA-Z]+\s?\/>|<br>)/i;function Sd(e){return aO.test(e)}function hE(e){let t=document.createElement("template");return t.innerHTML=e,t.content.textContent??""}var He=w(D()),yE=w(te());var ch={root:"Le",trigger:"_",content:"Me",contentOpen:"Re",contentTop:"Te",contentBottom:"Ue",item:"oo"};var Oo=w(b()),uO=0,vE=He.default.createContext(null),cO=()=>{let e=(0,He.useContext)(vE);if(!e)throw new Error("Invalid DropdownContext");return e},SE=({trigger:e,children:t,position:n="bottom"})=>{let r=(0,He.useMemo)(()=>++uO,[]),o=(0,He.useRef)(null),i=(0,He.useRef)(null),s=A("Dropdown",ch),[a,l]=(0,He.useState)(!1),[u,c]=(0,He.useState)(n),f=m=>{m.preventDefault(),m.stopPropagation(),l(!a)},d=(0,He.useCallback)(([m])=>{!m.isIntersecting&&a&&c(u==="top"?"bottom":"top")},[a]);return(0,He.useEffect)(()=>{let m=y=>{o.current&&!o.current.contains(y.target)&&l(!1)};return document.addEventListener("click",m),()=>{document.removeEventListener("click",m)}},[]),(0,He.useEffect)(()=>{if(!i.current&&!a)return()=>{};let m=new IntersectionObserver(d,{root:null,rootMargin:"0px",threshold:1});return i.current&&m.observe(i.current),()=>{i.current&&m.unobserve(i.current)}},[i,a]),(0,Oo.jsx)(vE.Provider,{value:{setIsOpen:l},children:(0,Oo.jsxs)("div",{ref:o,className:s.root,children:[(0,Oo.jsx)("button",{id:`dropdown-${r}`,"data-testid":"dropdown-trigger","aria-haspopup":"true","aria-expanded":a,"aria-label":"Dropdown trigger",type:"button",className:s.trigger,onClick:f,children:e}),(0,Oo.jsx)("div",{"data-testid":"dropdown-content",ref:i,"aria-hidden":!a,"aria-labelledby":`dropdown-${r}`,className:(0,yE.default)(s.content,{[s.contentOpen]:a,[s.contentTop]:u==="top",[s.contentBottom]:u==="bottom"}),children:t})]})})};function dO({as:e,children:t,onClick:n,...r}){let o=e||"button",i=A("Dropdown",ch),{setIsOpen:s}=cO(),a=l=>{s(!1),n(l),l.stopPropagation()};return(0,Oo.jsx)(o,{type:"button",className:i.item,onClick:a,...r,children:t})}SE.Item=dO;var dh=SE;var fh=w(b()),wE=e=>(0,fh.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"14",viewBox:"0 0 448 512",...e,children:(0,fh.jsx)("path",{fill:"currentColor",d:"M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z"})});var No={};Qe(No,{enUS:()=>fO,nlNL:()=>pO});var fO={preview:[{type:0,value:"Preview"}],useSuggestion:[{type:0,value:"Add"}],sendSuggestion:[{type:0,value:"Send"}],suggestionSent:[{type:0,value:"Sent"}],sendingError:[{type:0,value:"Sending failed"}],tryAgain:[{type:0,value:"Try again"}],editSuggestion:[{type:0,value:"Edit"}],visitUrl:[{type:0,value:"Visit"}],giveFeedback:[{type:0,value:"Give feedback"}],answer:[{type:0,value:"Answer"}]},pO={preview:[{type:0,value:"Preview"}],useSuggestion:[{type:0,value:"Gebruik"}],sendSuggestion:[{type:0,value:"Verzenden"}],suggestionSent:[{type:0,value:"Verzonden"}],sendingError:[{type:0,value:"Verzenden mislukt"}],tryAgain:[{type:0,value:"Probeer opnieuw"}],editSuggestion:[{type:0,value:"Bewerken"}],visitUrl:[{type:0,value:"Bekijk"}],giveFeedback:[{type:0,value:"Geef feedback"}],answer:[{type:0,value:"Antwoord"}]};var wd=w(b()),mO="%0d%0a%0d%0a%0d%0a",gO=(e,t)=>{let n=[`Suggestie: ${encodeURIComponent(t)}`,"Beschrijf je feedback:"];return`mailto:${e.join(",")}?subject=Suggestie feedback&body=${n.join(mO)}`},hO=({suggestion:e,onFeedback:t})=>{let n=G(No),r=j("suggestionFeedbackEmailAddresses");return!r||r.length===0?null:(0,wd.jsx)(dh,{trigger:(0,wd.jsx)(wE,{"data-testid":"feedback-dropdown-trigger"}),children:(0,wd.jsx)(dh.Item,{as:"a",href:gO(r,e),onClick:t,children:n("giveFeedback")})})},xd=hO;var Ed=w(D()),CE=w(b()),xE=Ed.default.createContext(void 0);function Ur(){let e=Ed.default.useContext(xE);if(e===void 0)throw new Error("useCommandPalette must be used within the CommandPalette component");return e}var EE=({children:e,page:t,isOpen:n,onChangeOpen:r,selected:o,setSelected:i})=>{let s=Ed.default.useMemo(()=>({page:t,isOpen:n,onChangeOpen:r,selected:o,setSelected:i}),[n,t,o]);return(0,CE.jsx)(xE.Provider,{value:s,children:e})};var Ct=w(b());function ph({closeOnSelect:e=!0,lineClamp:t,children:n,onClick:r,onFeedback:o,onSourceClick:i,description:s,sources:a,id:l,styles:u,...c}){let{selected:f,onChangeOpen:d}=Ur(),m=A("CommandPalette",Vt);function y(v){r(v),e&&d(!1)}return(0,Ct.jsxs)("div",{className:(0,ja.default)(m.listItem,l===f&&m.listItemSelected),children:[(0,Ct.jsx)("button",{type:"button",className:(0,ja.default)(m.listItemAction,m.listItemPrimaryAction),"aria-disabled":c.disabled??!1,onClick:y,"data-command-palette-item":!0,"data-item-id":l,...c,children:(0,Ct.jsxs)("div",{className:m.listItemContent,children:[typeof n=="string"?(0,Ct.jsx)("p",{className:(0,ja.default)(m.listItemText,m.truncate,u==null?void 0:u.title),children:n}):n,s&&(0,Ct.jsx)($i,{tagName:"p",allowList:[],content:Sd(s)?hE(s):s,className:(0,ja.default)(m.listItemDescription,u==null?void 0:u.description,t?m.lineClamp:m.truncate)})]})}),o&&(0,Ct.jsx)("div",{className:m.listItemActions,children:(0,Ct.jsx)(xd,{suggestion:String(n),onFeedback:o})}),a&&(0,Ct.jsxs)("div",{className:m.sources,children:[(0,Ct.jsx)("span",{className:m.sourcesTitle,children:"Sources"}),a.map(v=>v.url?(0,Ct.jsx)("a",{className:m.source,href:v.url,target:"_blank",title:v.url,rel:"noopener noreferrer",onClick:()=>i&&i(v),children:v.name},v.url):(0,Ct.jsx)("span",{className:m.source,children:v.name},v.name))]})]})}var za=w(b()),bE=()=>(0,za.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 512","aria-labelledby":"angleLeftTitle",children:[(0,za.jsx)("title",{id:"angleLeftTitle",children:"AngleLeft"}),(0,za.jsx)("path",{d:"M192 448c-8.188 0-16.38-3.125-22.62-9.375l-160-160c-12.5-12.5-12.5-32.75 0-45.25l160-160c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25L77.25 256l137.4 137.4c12.5 12.5 12.5 32.75 0 45.25C208.4 444.9 200.2 448 192 448z"})]});var Mo=w(b());function mh({children:e,title:t,id:n,onDismiss:r}){let o=G(Po),i=A("CommandPalette",Vt),{page:s}=Ur();return s!==n?null:(0,Mo.jsxs)("div",{className:i.page,id:`page_${n}`,tabIndex:-1,children:[r&&(0,Mo.jsxs)("div",{className:i.pageNav,children:[(0,Mo.jsxs)("button",{className:i.pageBackButton,type:"button",onClick:r,children:[(0,Mo.jsx)(bE,{}),o("back")]}),t&&(0,Mo.jsx)("h3",{className:i.pageTitle,children:t})]}),e]})}var TE=w(D());var Va=w(b()),qi=()=>(0,Va.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 24 24",width:"1em",fill:"currentColor",children:[(0,Va.jsx)("path",{d:"M0 0h24v24H0z",fill:"none"}),(0,Va.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})]});var sn=w(b());function yO({onChange:e,onChangeType:t,placeholder:n,typePlaceholder:r,types:o,value:i,selectedType:s},a){let l=A("CommandPalette",Vt);return(0,sn.jsxs)("div",{className:l.search,children:[(0,sn.jsx)("div",{className:l.searchIcon,children:(0,sn.jsx)(qi,{})}),(0,sn.jsxs)("div",{className:l.searchInputWrapper,children:[(0,sn.jsx)("input",{ref:a,spellCheck:!1,autoComplete:"off",onChange:u=>{e(u.currentTarget.value)},onFocus:u=>{u.currentTarget.select()},className:l.searchInput,placeholder:n,value:i,type:"text",id:"command-palette-search-input",autoFocus:!0}),o&&o.length>0&&(0,sn.jsx)("div",{className:l.selectWrapper,children:(0,sn.jsxs)("select",{"data-testid":"command-palette-type-select",className:l.select,onChange:u=>t(u.target.value===r?void 0:u.target.value),value:s||r,children:[r&&(0,sn.jsx)("option",{children:r}),o.map(u=>(0,sn.jsx)("option",{value:u.value,children:u.label},u.value))]})})]})]})}var kE=(0,TE.forwardRef)(yO);var gh=w(te());var Cd=w(b()),vO=({onClick:e,shortKeys:t,children:n,...r})=>{let o=A("CommandPalette",Vt);return(0,Cd.jsxs)("button",{type:"button",...r,onClick:e,className:(0,gh.default)(o.actionButton,r.className,{[o.hasShortKeys]:t&&t.length>0}),children:[n,t&&t.map(i=>(0,Cd.jsx)("span",{className:(0,gh.default)(o.actionShortcut,i===8629&&o.actionShortcutFixKerning),children:typeof i=="number"?String.fromCharCode(i):i},i))]})},PE=vO;var Ka=w(b()),SO="[data-command-palette-item]";function Gi({placeholder:e="Start typing to search...",typePlaceholder:t="All types",defaultPage:n="search",page:r,onChangePage:o,onChangeSearch:i,onChangeType:s,onChangeOpen:a,selectedType:l,types:u,children:c,isOpen:f,search:d}){let[m,y]=(0,qn.useState)(),v=(0,qn.useRef)(null),p=()=>{o&&o(n),s(void 0),i(""),a(!1)},g=()=>{var N;if(r!==n&&o){o(n);return}if(l&&s){s(void 0),(N=v.current)==null||N.focus();return}if(d.length>0){i("");return}a(!1)},h=()=>{let N=S();N.length!==0&&y(N[0].dataset.itemId)},S=()=>Array.from(document.querySelectorAll(SO)||[]),x=N=>document.querySelector(`[data-item-id=${N}]`),T=N=>{let V=x(N);V&&y(V.dataset.itemId)},C=N=>{let V=x(N);V&&V.scrollIntoView({behavior:"smooth"})},k=()=>{if(!m)return;let N=S(),V=x(m);if(!V)return;let _=N.indexOf(V),ee=N[_+1];ee&&ee.dataset.itemId?T(ee.dataset.itemId):h()},L=()=>{if(!m)return;let N=S(),V=x(m);if(!V)return;let _=N.indexOf(V),ee=N[_-1];ee&&ee.dataset.itemId?T(ee.dataset.itemId):T(N[N.length-1].dataset.itemId)},I=(0,qn.useCallback)(N=>{switch(N.key){case"ArrowDown":{N.preventDefault(),k();break}case"ArrowUp":{N.preventDefault(),L();break}case"Enter":{if(m){let V=x(m);V==null||V.click()}break}}},[m]);return(0,qn.useEffect)(()=>{h()},[d,r,l,f]),(0,qn.useEffect)(()=>{m&&C(m)},[m]),(0,Ka.jsx)(ud,{autoFocus:!0,contentAriaLabel:"Search Results",overlayAriaLabel:"Command Palette",isOpen:f,onBack:g,onClose:p,onKeyDown:I,children:(0,Ka.jsxs)(EE,{selected:m,setSelected:y,isOpen:f,onChangeOpen:a,page:r,children:[r===n&&(0,Ka.jsx)(kE,{ref:v,onChange:i,onChangeType:s,placeholder:e,value:d,selectedType:l,types:u,typePlaceholder:t}),c]})})}Gi.Page=mh;Gi.List=eh;Gi.Image=sE;Gi.ListItem=ph;Gi.Button=PE;var ge=Gi;var RE=w(D());function AE(e,t){(0,RE.useEffect)(()=>{let n=r=>{var o;((o=navigator==null?void 0:navigator.platform)!=null&&o.toLowerCase().includes("mac")?r.metaKey:r.ctrlKey)&&r.key===e&&(r.preventDefault(),r.stopPropagation(),t())};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}},[])}var $a=w(D());var LE={data:null,fetchState:"idle"},bd=e=>{var i;let t=[],{visitorName:n}=e.info.visitorInfo??{},{agentName:r,agentNickname:o}=e.info.agentInfo??{};return r&&r!==n&&t.push(r),o&&o!==n&&t.push(o),((i=e.entities.data)==null?void 0:i.filter(s=>!t.includes(s.text)))??null},an=B("entities/getEntities",async(e,t)=>{let{deepdeskAPI:n,dynamicThunkObject:r}=t.extra;if(!r.conversationQuery)return Promise.resolve([]);let o=r.conversationQuery,i=await o();return i.length===0?Promise.resolve([]):n.getEntities(i)}),wO=e=>e.filter((t,n)=>n===e.findIndex(r=>r.text===t.text)),xO=W({name:"entities",initialState:LE,reducers:{},extraReducers:e=>{e.addCase(an.pending,t=>{t.fetchState="loading"}).addCase(an.rejected,t=>{t.fetchState="error"}).addCase(an.fulfilled,(t,n)=>{t.fetchState="done",t.data=wO(t.data?[...t.data,...n.payload]:n.payload)}).addCase(le,()=>LE)}}),IE=xO.reducer;var hh={};Qe(hh,{enUS:()=>EO,nlNL:()=>CO});var EO={noResults:[{type:0,value:"No entities have been found"}],copy:[{type:0,value:"Copy"}],use:[{type:0,value:"Use"}]},CO={noResults:[{type:0,value:"Er zijn geen entiteiten gevonden"}],copy:[{type:0,value:"Kopieer"}],use:[{type:0,value:"Gebruik"}]};var OE={root:"Be",empty:"De"};var Yi=w(b()),TO=({onCopy:e})=>{let t=(0,$a.useRef)(null),n=A("EntitiesList",OE),r=O(bd),{setSelected:o}=Ur(),i=G(hh),s=Y();return(0,$a.useEffect)(()=>{s(an())},[]),(0,$a.useEffect)(()=>{t.current&&(t.current.focus(),o("entity-0"))},[t]),(0,Yi.jsxs)("div",{className:n.root,ref:t,tabIndex:-1,children:[r&&r.length>0&&(0,Yi.jsx)(ge.List,{children:r.map((a,l)=>(0,Yi.jsx)(ge.ListItem,{id:`entity-${l}`,closeOnSelect:!0,onClick:()=>e(a),children:a.text},a.text))},"entities"),r&&r.length===0&&(0,Yi.jsx)("p",{className:n.empty,children:i("noResults")})]})},NE=TO;var ln=w(D());var ME={data:null,fetchState:"idle"},_E=e=>e.summary.data,DE=e=>e.summary.fetchState==="error",FE=e=>e.summary.model,Gn=B("summary/getSummary",async(e,t)=>{var c,f,d;let n=t.getState().profile.data,r=(c=t.getState().conversation.current)==null?void 0:c.sessionId,o=(d=(f=t.getState().info)==null?void 0:f.agentInfo)==null?void 0:d.agentId;if(!n)throw new Error("Profile is not defined");let{deepdeskAPI:i,dynamicThunkObject:s}=t.extra;if(!s.conversationQuery)return Promise.reject(new Error("setConversationQuery method is not defined"));let a=s.conversationQuery,l=await a();if(l.length===0)return Promise.reject(new Error("No messages are included"));let u=await i.getSummary(l,{externalConversationId:r,agentId:o,promptInstruction:n.summarizerPromptInstruction,model:n.summarizerModel});return u.summary?u:Promise.reject(new Error("Summary is not provided"))}),kO=W({name:"summary",initialState:ME,reducers:{},extraReducers:e=>{e.addCase(Gn.pending,t=>{t.data=null,t.fetchState="loading"}).addCase(Gn.rejected,t=>{t.data=null,t.fetchState="error"}).addCase(Gn.fulfilled,(t,n)=>{t.fetchState="done",n.payload&&(t.data=n.payload.summary,t.model=n.payload.model)}).addCase(le,()=>ME)}}),HE=kO.reducer;var yh={};Qe(yh,{enUS:()=>PO,nlNL:()=>RO});var PO={copy:[{type:0,value:"Copy"}],error:[{type:0,value:"Could not generate a summary"}],loading:[{type:0,value:"Generating summary, this may take a few moments."}]},RO={copy:[{type:0,value:"Kopieer"}],error:[{type:0,value:"Kon helaas geen samenvatting genereren."}],loading:[{type:0,value:"Samenvatting wordt gemaakt, dit kan even duren."}]};var UE={root:"Ie",actions:"Oe",main:"Xe",textInput:"eo",loading:"Je",error:"Ke"};var Yn=w(b()),LO=({onCopy:e})=>{let t=(0,ln.useRef)(null),n=A("SummaryForm",UE),[r,o]=(0,ln.useState)(""),i=G(yh),s=O(FE),a=O(_E),l=O(DE),u=Y(),c=()=>{u(Ye({name:"summary copied to clipboard",data:{originalText:a,finalText:r,model:s},options:{includeConversationData:!0}})),e(r)},f=()=>{let d=document.getSelection();d&&u(Ye({name:"summary copied to clipboard",data:{originalText:a,finalText:d==null?void 0:d.toString(),model:s},options:{includeConversationData:!0}}))};return(0,ln.useEffect)(()=>{u(Gn())},[]),(0,ln.useEffect)(()=>{o(a||"")},[a]),(0,ln.useEffect)(()=>{t.current&&a&&t.current.focus()},[t,a]),(0,ln.useEffect)(()=>{let d=m=>{m.key==="Enter"&&m.shiftKey&&c()};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[r]),(0,Yn.jsx)("div",{className:n.root,tabIndex:-1,children:l?(0,Yn.jsx)("p",{className:n.error,children:i("error")}):(0,Yn.jsxs)(ln.Fragment,{children:[(0,Yn.jsx)("div",{className:n.main,children:(0,Yn.jsx)("textarea",{placeholder:a?void 0:i("loading"),disabled:!a,className:n.textInput,ref:t,value:r,onCopy:f,onChange:d=>o(d.target.value)})}),(0,Yn.jsx)("div",{className:n.actions,children:(0,Yn.jsx)(ge.Button,{shortKeys:[8679,8629],onClick:c,children:i("copy")})})]})})},BE=LO;var Wa={};Qe(Wa,{enUS:()=>IO,nlNL:()=>OO});var IO={personalCollectionLink:[{type:0,value:"Go to Personal Collection"}],searchPlaceholder:[{type:0,value:"Start typing to search..."}],urlSuggestions:[{type:0,value:"Link suggestions"}],personalSuggestions:[{type:0,value:"Personal suggestions"}],pinnedMessages:[{type:0,value:"Pinned messages"}],imageSuggestions:[{type:0,value:"Images"}],typePlaceholder:[{type:0,value:"All types"}],navigation:[{type:0,value:"Navigation"}],entitiesClipboard:[{type:0,value:"Conversation clipper"}],entitiesTitle:[{type:0,value:"Copy to your clipboard"}],summaryClipboard:[{type:0,value:"Summarize conversation"}],summaryTitle:[{type:0,value:"Conversation summary"}],knowledgeAssist:[{type:0,value:"Knowledge assist"}],commands:[{type:0,value:"Commands"}],use:[{type:0,value:"Use"}],preview:[{type:0,value:"Preview"}],warning:[{type:0,value:"Are you sure you want to discard the message?"}]},OO={personalCollectionLink:[{type:0,value:"Ga naar persoonlijke collectie"}],searchPlaceholder:[{type:0,value:"Begin met typen om te zoeken..."}],personalSuggestions:[{type:0,value:"Persoonlijke suggesties"}],urlSuggestions:[{type:0,value:"Link suggesties"}],imageSuggestions:[{type:0,value:"Afbeeldingen"}],navigation:[{type:0,value:"Navigatie"}],typePlaceholder:[{type:0,value:"Alle types"}],pinnedMessages:[{type:0,value:"Actueel"}],entitiesClipboard:[{type:0,value:"Klembord"}],entitiesTitle:[{type:0,value:"Kopieer naar klembord"}],summaryClipboard:[{type:0,value:"Gesprek samenvatten"}],summaryTitle:[{type:0,value:"Gesprek samenvatting"}],knowledgeAssist:[{type:0,value:"Knowledge assist"}],commands:[{type:0,value:"Acties"}],use:[{type:0,value:"Gebruik"}],preview:[{type:0,value:"Bewerk"}],warning:[{type:0,value:"Weet je zeker dat je de wijzigingen wilt weggooien?"}]};var Br=w(D());var vh={};Qe(vh,{enUS:()=>NO,nlNL:()=>MO});var NO={use:[{type:0,value:"Use"}],loading:[{type:0,value:"Loading..."}],error:[{type:0,value:"Something went wrong, please try again later."}],anotherQuestion:[{type:0,value:"Send a message..."}],reset:[{type:0,value:"Reset conversation"}]},MO={use:[{type:0,value:"Gebruik"}],loading:[{type:0,value:"Laden..."}],error:[{type:0,value:"Er ging iets mis, probeer het later opnieuw."}],anotherQuestion:[{type:0,value:"Stuur een bericht..."}],reset:[{type:0,value:"Reset gesprek"}]};var jE={root:"io",title:"Pe",empty:"Qe",status:"Ve",form:"ro",input:"to",submit:"We",question:"Ze",answer:"_e",alignRight:"oi"};var DO={data:null,fetchState:"idle"},zE=e=>{var t;return(t=e.knowledgeAssistant)==null?void 0:t.data},qa=B("knowledgeAssistant/getKnowledgeAssistant",async(e,t)=>{var s;let{deepdeskAPI:n}=t.extra,r=t.getState(),o=r.conversation.current;if(!o||!o.profileCode)throw new Error("No conversation of conversation profileCode found");let i=(s=r.profile.data)==null?void 0:s.knowledgeAssistant;return i?n.getKnowledgeAssistant(i):null}),FO=W({name:"knowledgeAssistant",initialState:DO,reducers:{},extraReducers:e=>{e.addCase(qa.pending,t=>{t.fetchState="loading"}).addCase(qa.rejected,t=>{t.fetchState="error"}).addCase(qa.fulfilled,(t,n)=>{t.fetchState="done",t.data=n.payload})}}),VE=FO.reducer;var Sh={data:[],fetchState:"idle"},KE=e=>{var t;return(t=e.answer)==null?void 0:t.data},$E=e=>e.answer.fetchState,Qi=we("answer/resetKnowledgeSearch"),Xi=B("answer/getAnswer",async(e,t)=>{var l,u,c;let{deepdeskAPI:n}=t.extra,r=t.getState().answer.data,o=zE(t.getState()),i=(l=t.getState().conversation.current)==null?void 0:l.sessionId,s=(c=(u=t.getState().info)==null?void 0:u.agentInfo)==null?void 0:c.agentId;if(!o)throw new Error("KnowledgeAssistant is not defined");let a=await n.knowledgeAssist({promptInstruction:o.prompt,question:e},r,o.code,{agentId:s,conversationId:i});return{question:e,answer:a}}),HO=W({name:"answer",initialState:Sh,reducers:{},extraReducers:e=>{e.addCase(Xi.pending,t=>{t.fetchState="loading"}).addCase(Xi.rejected,t=>{t.fetchState="error"}).addCase(Xi.fulfilled,(t,n)=>{t.fetchState="done",t.data=[...t.data,n.payload]}).addCase(le,()=>Sh).addCase(Qi,()=>Sh)}}),WE=HO.reducer;var Ga=w(b()),qE=()=>(0,Ga.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512","aria-labelledby":"paperPlaneTitle",children:[(0,Ga.jsx)("title",{id:"paperPlaneTitle",children:"PaperPlane"}),(0,Ga.jsx)("path",{d:"M498.1 5.6c10.1 7 15.4 19.1 13.5 31.2l-64 416c-1.5 9.7-7.4 18.2-16 23s-18.9 5.4-28 1.6L284 427.7l-68.5 74.1c-8.9 9.7-22.9 12.9-35.2 8.1S160 493.2 160 480V396.4c0-4 1.5-7.8 4.2-10.7L331.8 202.8c5.8-6.3 5.6-16-.4-22s-15.7-6.4-22-.7L106 360.8 17.7 316.6C7.1 311.3 .3 300.7 0 288.9s5.9-22.8 16.1-28.7l448-256c10.7-6.1 23.9-5.5 34 1.4z"})]});var bt=w(b()),UO=({onUse:e,onResetQuestion:t,question:n})=>{let[r,o]=Br.default.useState(""),{setSelected:i}=Ur(),s=(0,Br.useRef)(null),a=A("EntitiesList",jE),l=G(vh),u=Y(),c=O(KE),f=O($E),d=async y=>{y.preventDefault(),y.stopPropagation(),r!==""&&u(Xi(r))},m=(y,v)=>{u(Ye({name:"knowledge assist source viewed",data:{question:v,sourceViewed:y.url||y.name},options:{includeConversationData:!0}}))};return(0,Br.useEffect)(()=>{var y;n&&f==="idle"?u(Xi(n)):(y=s.current)==null||y.focus()},[s,f]),(0,Br.useEffect)(()=>{f==="done"&&(u(Ye({name:"knowledge assist question answered",data:{question:r||n,sources:c[c.length-1].answer.sources,answer:c[c.length-1].answer.answer,isFollowUpQuestion:c.length>1},options:{includeConversationData:!0}})),i(`knowledge-assist-${c.length-1}`),o(""))},[f,c]),(0,Br.useEffect)(()=>{s.current&&s.current.scrollIntoView({behavior:"smooth"})},[s,c]),(0,bt.jsxs)("div",{className:a.root,children:[c.length>0&&(0,bt.jsx)("div",{className:a.alignRight,children:(0,bt.jsx)(ge.Button,{onClick:t,children:l("reset")})}),c.map(({question:y,answer:v},p)=>(0,bt.jsx)(ge.List,{children:(0,bt.jsx)(ge.ListItem,{id:`knowledge-assist-${p}`,"data-testid":"knowledge-search-answer",description:v.answer,closeOnSelect:!0,onClick:()=>e(v.answer),onSourceClick:g=>m(g,y),sources:v.sources,styles:{title:a.question,description:a.answer},children:y})},`${v.answer}_${p}`)),f==="loading"&&(0,bt.jsx)("p",{className:a.status,children:l("loading")}),f==="error"&&(0,bt.jsx)("p",{className:a.status,children:l("error")}),(0,bt.jsxs)("form",{className:a.form,onSubmit:d,children:[(0,bt.jsx)("input",{ref:s,placeholder:l("anotherQuestion"),className:a.input,type:"text",value:r,onFocus:()=>{i(void 0)},onChange:y=>{i(void 0),o(y.target.value)}}),(0,bt.jsx)("button",{type:"submit",className:a.submit,children:(0,bt.jsx)(qE,{})})]})]})},GE=UO;var BO={data:null,fetchState:"idle"},jr=e=>e.profile.data,Td=e=>e.profile.data?e.profile.data.uiConfig.widget.types.filter(t=>t.isActive):[],Ya=B("profile/getProfile",async(e,t)=>{var i;let{deepdeskAPI:n}=t.extra,r=t.getState(),o=r.conversation.current;if(!o||!o.profileCode)throw new Error("No conversation of conversation profileCode found");return((i=r.profile.data)==null?void 0:i.code)===o.profileCode?r.profile.data:n.getProfile(o.profileCode)}),jO=W({name:"profile",initialState:BO,reducers:{},extraReducers:e=>{e.addCase(Ya.pending,t=>{t.fetchState="loading"}).addCase(Ya.rejected,t=>{t.fetchState="error"}).addCase(Ya.fulfilled,(t,n)=>{t.fetchState="done",t.data=n.payload})}}),YE=jO.reducer;var iC=w(D());var zO=["{amount}"," {amount}","{date}","{email}","{iban}","{name}","{postal_code}","{street}","{tarif}","{usage}","{3_digits}","{4_digits}","{5_digits}","{6_digits}","{7_digits}","{8_digits}","{9_digits}","{10_digits}"],VO=new RegExp(zO.map(e=>`(?:${e.replace("{","\\{").replace("}","\\}")})`).join("|"));function XE(e,t){let n=e.split(VO),r=0,o=[];for(let i=0;i<n.length;i++){let s=n[i];if(o.push(s),i===n.length-1)break;if(t.indexOf(s)===-1)return e;let a=n[i+1],l=i===n.length-2;r+=s.length;let u=r;if(l){let f=a.charAt(0),d=0;do u=f?t.indexOf(f,u+1):-1,d+=1;while(u!==-1&&a.indexOf(t.slice(u))!==0);if(u===-1&&d>2)return e}else u=a&&a!==""?t.indexOf(a,r):-1;let c=u===-1?t.slice(r):t.slice(r,u);o.push(c),r=u}return o.join("")}function QE(e,t){return typeof t=="boolean"?e:e.slice(0,t)}var JE={suggestions:[],fetchState:"idle",isInitialRequest:null},ZE={default:JE},eC=e=>t=>{var n;return((n=t.textSuggestions[e])==null?void 0:n.suggestions)??[]},tC=e=>{let t=Object.keys(e.textSuggestions).map(n=>{var r;return(r=e.textSuggestions[n])==null?void 0:r.fetchState});return t.length===0?!0:t.every(n=>n!=="done")},kd=e=>e.textSuggestions,nC=e=>{let t=e.toLowerCase();return n=>{let r=n.text.toLowerCase();return r.startsWith(t)&&r.length>t.length}},Pd=we("textSuggestions/refresh"),un=B("textSuggestions/recommendations",async(e,t)=>{var u;let{deepdeskAPI:n}=t.extra,r=t.getState(),o=(u=r.conversation.current)==null?void 0:u.id,{textSuggestionsCount:i,inlineSuggestions:s}=r.settings,a=Vi(r);if(!o)throw new Error("No current conversation to fetch text suggestions");let l=await n.getTextSuggestions(o,Ra(r),e);if(e==="default"){let c=s?l.filter(nC(a)):l;t.dispatch(En(c.slice(0,i)))}return l}),Xa=B("textSuggestions/autocompletions",async(e,t)=>{var u;let{deepdeskAPI:n}=t.extra,r=t.getState(),o=(u=r.conversation.current)==null?void 0:u.id,{textSuggestionsCount:i,deanonymize:s,inlineSuggestions:a}=r.settings;if(!o)throw new Error("No current conversation to fetch text suggestions");let l=await n.getAutocompleteSuggestions(o,{...Ra(r),input:e});if(!t.getState().input.text)throw new Error("Abort");return a&&(l=l.filter(nC(e))),s&&(l=l.map(c=>({...c,text:c.source!=="trie-with-typos"?XE(c.text,e):c.text}))),l=QE(l,i),t.dispatch(En(l)),l}),rC=W({name:"textSuggestions",initialState:ZE,reducers:{setTextSuggestions:{reducer(e,t){let{contentType:n}=t.payload;e[n].fetchState="done",e[n].suggestions=t.payload.suggestions},prepare(e,t){return{payload:{contentType:e,suggestions:t}}}},setSuggestionState(e,t){return t.payload}},extraReducers:e=>{e.addCase(un.pending,(t,n)=>{let r=n.meta.arg,o=t[r]||JE;return{...t,[r]:{...o,fetchState:"loading",isInitialRequest:o.isInitialRequest===null}}}).addCase(un.rejected,(t,n)=>{let r=n.meta.arg;t[r]&&(t[r].fetchState="error")}).addCase(un.fulfilled,(t,n)=>{let r=n.meta.arg;t[r]&&(t[r].fetchState="done",t[r].suggestions=n.payload)}).addCase(Xa.pending,t=>{t.default.fetchState="loading"}).addCase(Xa.rejected,t=>{t.default.fetchState="error"}).addCase(Xa.fulfilled,(t,n)=>{t.default.fetchState="done",t.default.suggestions=n.payload}).addCase(le,()=>ZE)}}),{setTextSuggestions:dF,setSuggestionState:fF}=rC.actions,oC=rC.reducer;var _o=w(b()),KO=({commands:e,onClick:t})=>{var a,l,u;let n=Y(),r=G(Wa),o=O(jr),i=O(kd),s=((u=(l=(a=o==null?void 0:o.uiConfig)==null?void 0:a.search)==null?void 0:l.initialTypes)==null?void 0:u.filter(({isActive:c})=>c))||[];return(0,iC.useEffect)(()=>{s.forEach(({type:c})=>{(!i[c]||i[c].suggestions.length===0)&&n(un(c))})},[]),(0,_o.jsxs)("div",{children:[e.length>0&&(0,_o.jsx)(ge.List,{heading:r("commands"),children:e.map((c,f)=>(0,_o.jsx)(ge.ListItem,{id:`command-${f}`,closeOnSelect:!1,onClick:c.onClick,children:c.label},c.label))}),s.map(({type:c,title:f})=>{var d;return(0,_o.jsx)(ge.List,{heading:f,orientation:"vertical",children:(d=i[c])==null?void 0:d.suggestions.map((m,y)=>(0,_o.jsx)(ge.ListItem,{id:`${c}-${y}`,closeOnSelect:!1,description:m.text,onClick:()=>t(m.text,m),"data-testid":"search-overlay-suggestion",children:m.title},`${m.id}-${m.text}`))},c)})]})},sC=KO;var Ue=w(b()),WO=200,qO=5,GO=4,aC=(e,t)=>!t||e.toLowerCase().includes(t.toLowerCase()),YO=()=>{let e=Y(),t=zt(),n=G(Wa),[r,o]=(0,mt.useState)(!1),[i,s]=(0,mt.useState)(""),a=O(R1),l=O(jr),[u,c]=(0,mt.useState)(),f=O(tt),d=j("showSearch"),m=j("showEntitiesCommand"),y=j("showSummaryCommand"),v=j("showKnowledgeSearch"),p=j("showImageSearch"),g=j("searchTriggerKey"),h=O(rE),S=O(A1),x=O(L1),T=O(P1),C=H=>Gt(S.filter(q=>q.type===H.toUpperCase()),H),k=[{value:"PERSONAL",label:n("personalSuggestions"),list:C("PERSONAL"),lineClamp:!1,listOrientation:"vertical",shouldShow:!0},{value:"URL",label:n("urlSuggestions"),list:C("URL"),lineClamp:!1,listOrientation:"vertical",shouldShow:!0},{value:"STICKYMESSAGE",label:n("pinnedMessages"),list:C("STICKYMESSAGE"),lineClamp:!1,listOrientation:"vertical",shouldShow:!0},{value:"IMAGE",label:n("imageSuggestions"),lineClamp:!1,list:C("IMAGE"),listOrientation:"horizontal",shouldShow:p}].filter(H=>H.shouldShow),L=[{label:n("entitiesClipboard"),onClick:()=>e(tn("entities")),shouldShow:m&&aC(n("entitiesClipboard"),i)},{label:n("summaryClipboard"),onClick:()=>e(tn("summary")),shouldShow:y&&aC(n("summaryClipboard"),i)},{label:i?`${n("knowledgeAssist")}: ${i}`:n("knowledgeAssist"),onClick:()=>e(tn("knowledgeAssist")),shouldShow:v}].filter(H=>H.shouldShow),I=(h==null?void 0:h.map(H=>({value:H.code.toUpperCase(),label:`${H.name}s`,list:C(H.code.toUpperCase()),listOrientation:"vertical",lineClamp:!0})))||[],N=(0,mt.useCallback)((0,lC.default)((H,q)=>{e(Co({query:H,type:q,tags:["search-overlay"],size:u?50:20}))},WO),[u]),V=(0,mt.useCallback)((H,q)=>{switch(q.type){case"IMAGE":t.send(Bg,{suggestion:q});break;default:t.send(Dr,{text:H,suggestion:q})}e(xt(!1))},[e]),_=H=>{ko(H.text),e(Ye({name:"entity copied",data:{entity:H,type:"copy"}})),e(xt(!1))},ee=(0,mt.useCallback)(H=>{e(Ye({name:"suggestion feedback",data:{text:H.text,source:"search",context:i},options:{includeConversationData:!0}}))},[i]),Yr=H=>{t.send(Dr,{text:H,suggestion:{source:"knowledge-assist",text:H}}),e(Ye({name:"answer used",data:{originalText:H},options:{includeConversationData:!0}})),s(""),e(tn("search")),e(Qi()),e(xt(!1))},it=H=>{ko(H),e(xt(!1))};function Gt(H,q){return H.slice(0,u?10:q.toLowerCase()==="image"?GO:qO)}function At(H){return q=>{r?window.confirm(n("warning"))&&(H(q),o(!1)):H(q)}}return(0,mt.useEffect)(()=>{i?N(i,u):e(qc())},[i,u]),(0,mt.useEffect)(()=>{a==="search"&&e(Qi())},[a]),(0,mt.useEffect)(()=>{f&&e(Da())},[f]),AE(g,()=>e(xt(!0))),!d||!l?null:(0,Ue.jsxs)(ge,{placeholder:n("searchPlaceholder"),typePlaceholder:n("typePlaceholder"),onChangeSearch:s,onChangeOpen:At(H=>e(xt(H))),onChangeType:H=>c(H),onChangePage:At(H=>e(tn(H))),selectedType:u,search:i,page:a,isOpen:T,types:[...I,...k],children:[(0,Ue.jsxs)(ge.Page,{id:"search",children:[i.length===0&&(0,Ue.jsx)(sC,{commands:L,onClick:V}),i.length>0&&(0,Ue.jsxs)(mt.Fragment,{children:[L.length>0&&(0,Ue.jsx)(ge.List,{heading:n("commands"),children:L.map((H,q)=>(0,Ue.jsx)(ge.ListItem,{closeOnSelect:!1,onClick:H.onClick,id:`commands-${q}`,children:H.label},H.label))}),[...I,...k].map(({value:H,label:q,list:ir,lineClamp:he,listOrientation:sr})=>(0,Ue.jsx)(ge.List,{heading:q,orientation:sr==="horizontal"?"horizontal":"vertical",onShowAll:()=>c(H),hasMore:!u&&x[H.toLowerCase()]>Gt(ir,H).length,children:Gt(ir,H).map($=>(0,Ue.jsx)(ge.ListItem,{id:`${H}-${$.id}`,closeOnSelect:!1,lineClamp:he,onClick:()=>V($.text,$),description:H!=="IMAGE"?$.title&&$.text:void 0,onFeedback:H!=="IMAGE"?()=>ee($):void 0,children:H==="IMAGE"?(0,Ue.jsx)(ge.Image,{title:$.title||$.text,src:$.image}):$.title||$.text},`${$.id}-${$.text}`))},H))]})]}),(0,Ue.jsx)(ge.Page,{id:"entities",title:n("entitiesTitle"),onDismiss:At(()=>{e(tn("search"))}),children:(0,Ue.jsx)(NE,{onCopy:_})}),(0,Ue.jsx)(ge.Page,{id:"summary",title:n("summaryTitle"),onDismiss:At(()=>{e(tn("search"))}),children:(0,Ue.jsx)(BE,{onCopy:it})}),(0,Ue.jsx)(ge.Page,{id:"knowledgeAssist",title:n("knowledgeAssist"),onDismiss:At(()=>{e(Qi()),e(tn("search"))}),children:(0,Ue.jsx)(GE,{question:i,onUse:Yr,onResetQuestion:()=>{e(Qi()),s("")}})})]})},uC=YO;var Qa=w(b()),XO=()=>{let e=j("showSearch"),t=j("isEmbedded");return(0,Qa.jsxs)(cC.Fragment,{children:[e&&(0,Qa.jsx)(uC,{}),t&&(0,Qa.jsx)(Z1,{})]})},dC=XO;var gC=w(te());var Rd=w(b()),fC=({className:e})=>(0,Rd.jsx)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 512 512",xmlSpace:"preserve",className:e,children:(0,Rd.jsx)("g",{children:(0,Rd.jsx)("path",{d:`M163.4,233h186v-70c0-25.6-9.4-47.8-27.3-65.7C304.2,79.4,282,70,256.4,70s-47.8,9.4-65.7,27.3
|
|
19
|
+
`),o=o.replace(/\n/g,"<br/>"),o}createContainer(t){var n;let o=(typeof global<"u"&&global.INTERWEAVE_SSR_POLYFILL||JI)();if(!o)return;let i=(n=this.props.containerTagName)!==null&&n!==void 0?n:"body",s=i==="body"||i==="fragment"?o.body:o.createElement(i);return t.match(XI)||(s.innerHTML=this.convertLineBreaks(this.props.escapeHtml?(0,pE.default)(t):t)),s}extractAttributes(t){let{allowAttributes:n}=this.props,r={},o=0;return t.nodeType!==fE||!t.attributes||([...t.attributes].forEach(i=>{let{name:s,value:a}=i,l=s.toLowerCase(),u=hd[l]||hd[s];if(!this.isSafe(t)||!l.match(QI)&&(!n&&(!u||u===sh)||l.startsWith("on")||a.replace(/(\s|\0|�([9AD]);)/,"").match(/(javascript|vbscript|livescript|xss):/i)))return;let c=l==="style"?this.extractStyleAttribute(t):a;u===Hr?c=!0:u===Ao?c=Number.parseFloat(String(c)):u!==gd&&(c=String(c)),r[ah[l]||l]=this.applyAttributeFilters(l,c),o+=1}),o===0)?null:r}extractStyleAttribute(t){let n={};return Array.from(t.style).forEach(r=>{let o=t.style[r];(typeof o=="string"||typeof o=="number")&&(n[r.replace(/-([a-z])/g,(i,s)=>String(s).toUpperCase())]=o)}),n}getTagConfig(t){let n={children:[],content:0,invalid:[],parent:[],self:!0,tagName:"",type:0,void:!1};return Ba[t]?{...n,...Ba[t],tagName:t}:n}isSafe(t){if(typeof HTMLAnchorElement<"u"&&t instanceof HTMLAnchorElement){let n=t.getAttribute("href");if(n!=null&&n.startsWith("#"))return!0;let r=t.protocol.toLowerCase();return r===":"||r==="http:"||r==="https:"||r==="mailto:"||r==="tel:"}return!0}isTagAllowed(t){return this.banned.has(t)||this.blocked.has(t)?!1:this.props.allowElements||this.allowed.has(t)}parse(){return this.container?this.parseNode(this.container,this.getTagConfig(this.container.nodeName.toLowerCase())):[]}parseNode(t,n){let{noHtml:r,noHtmlExceptMatchers:o,allowElements:i,transform:s,transformOnlyAllowList:a}=this.props,l=[],u="";return[...t.childNodes].forEach(c=>{if(c.nodeType===fE){let d=c.nodeName.toLowerCase(),m=this.getTagConfig(d);u&&(l.push(u),u="");let y=this.applyNodeFilters(d,c);if(!y)return;let v;if(s&&!(a&&!this.isTagAllowed(d))){this.keyIndex+=1;let p=this.keyIndex;v=this.parseNode(y,m);let g=s(y,v,m);if(g===null)return;if(typeof g<"u"){l.push(Io.default.cloneElement(g,{key:p}));return}this.keyIndex=p-1}if(this.banned.has(d))return;if(!(r||o&&d!=="br")&&this.isTagAllowed(d)&&(i||this.canRenderChild(n,m))){var f;this.keyIndex+=1;let p=this.extractAttributes(y),g={tagName:d};p&&(g.attributes=p),m.void&&(g.selfClose=m.void),l.push(Io.default.createElement(yd,{...g,key:this.keyIndex},(f=v)!==null&&f!==void 0?f:this.parseNode(y,m)))}else l=[...l,...this.parseNode(y,m.tagName?m:n)]}else if(c.nodeType===YI){let d=r&&!o?c.textContent:this.applyMatchers(c.textContent||"",n);Array.isArray(d)?l=[...l,...d]:u+=d}}),u&&l.push(u),l}replaceTokens(t,n){if(!t.includes("{{{"))return t;let r=[],o=t,i=null;for(;i=o.match(ZI);){let[s,a]=i,l=i.index,u=s.includes("/");l>0&&(r.push(o.slice(0,l)),o=o.slice(l));let{children:c,matcher:f,props:d}=n[a],m;if(u)m=s.length,r.push(f.createElement(c,d));else{let y=o.match(new RegExp(`{{{/${a}}}}`));m=y.index+y[0].length,r.push(f.createElement(this.replaceTokens(o.slice(s.length,y.index),n),d))}o=o.slice(m)}return o.length>0&&r.push(o),r.length===0?"":r.length===1&&typeof r[0]=="string"?r[0]:r}};function eO(e){var t;let{attributes:n,className:r,containerTagName:o,content:i,emptyContent:s,parsedContent:a,tagName:l,noWrap:u}=e,c=(t=o??l)!==null&&t!==void 0?t:"span",f=c==="fragment"?!0:u,d;if(a)d=a;else{let m=new vd(i??"",e).parse();m.length>0&&(d=m)}return d||(d=s),f?Io.default.createElement(Io.default.Fragment,null,d):Io.default.createElement(yd,{attributes:n,className:r,tagName:c},d)}function $i(e){let{attributes:t,className:n,content:r="",disableFilters:o=!1,disableMatchers:i=!1,emptyContent:s=null,filters:a=[],matchers:l=[],onAfterParse:u=null,onBeforeParse:c=null,tagName:f="span",noWrap:d=!1,...m}=e,y=i?[]:l,v=o?[]:a,p=c?[c]:[],g=u?[u]:[];y.forEach(T=>{T.onBeforeParse&&p.push(T.onBeforeParse.bind(T)),T.onAfterParse&&g.push(T.onAfterParse.bind(T))});let h=p.reduce((T,C)=>C(T,e),r??""),S=new vd(h,m,y,v),x=g.reduce((T,C)=>C(T,e),S.parse());return Io.default.createElement(eO,{attributes:t,className:n,containerTagName:e.containerTagName,emptyContent:s,noWrap:d,parsedContent:x.length===0?void 0:x,tagName:f})}var tO=/[.*+?^${}()|[\]\\]/g,nO=/[^0-9A-Za-zÀ-ÖØ-öø-ÿ](?=[0-9A-Za-zÀ-ÖØ-öø-ÿ]*$)/;function rO(e){return e.replace(tO,"\\$&")}function oO(e,t){let n=e.split("").findIndex((r,o)=>r!==t[o]);return n>-1?n:Math.min(e.length,t.length)}function iO(e){return e.search(nO)}function mE(e,t=[]){let n=e;return t.forEach(r=>{if(!r)return;let o=new RegExp(`\\b(${rO(r)})\\b`,"gi");n=n.replace(o,"<strong>$1</strong>")}),n}function gE(e){return e.replace(Hl,'<mark data-type="placeholder">$1</mark>')}function Wi(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function sO(e,t){return e.split("").map((s,a)=>({char:s,index:a})).filter(({char:s,index:a})=>/\s/.test(s)&&a<=t).map(({index:s})=>s).reverse()[0]}function uh(e,t,n={}){if(t){let r=oO(t.toLowerCase(),e.toLowerCase()),o=Wi(e.substring(r,e.length));if(n.stripAgentPart){let l=e.substring(0,r),u=iO(l);return`<span style="opacity: 0.5">${l.substring(u+1)}</span>${o}`}let s=t.split(Iv).length>3||t.length>30?sO(t.trim(),r):0;return`${`${s>0?"\u2026":""}${Wi(e.substring(s,r))}`}<strong>${o}</strong>`}return e}var aO=/(<\/[a-zA-Z]+[0-9]?>|<[a-zA-Z]+\s?\/>|<br>)/i;function Sd(e){return aO.test(e)}function hE(e){let t=document.createElement("template");return t.innerHTML=e,t.content.textContent??""}var He=w(D()),yE=w(te());var ch={root:"Le",trigger:"_",content:"Me",contentOpen:"Re",contentTop:"Te",contentBottom:"Ue",item:"oo"};var Oo=w(b()),uO=0,vE=He.default.createContext(null),cO=()=>{let e=(0,He.useContext)(vE);if(!e)throw new Error("Invalid DropdownContext");return e},SE=({trigger:e,children:t,position:n="bottom"})=>{let r=(0,He.useMemo)(()=>++uO,[]),o=(0,He.useRef)(null),i=(0,He.useRef)(null),s=A("Dropdown",ch),[a,l]=(0,He.useState)(!1),[u,c]=(0,He.useState)(n),f=m=>{m.preventDefault(),m.stopPropagation(),l(!a)},d=(0,He.useCallback)(([m])=>{!m.isIntersecting&&a&&c(u==="top"?"bottom":"top")},[a]);return(0,He.useEffect)(()=>{let m=y=>{o.current&&!o.current.contains(y.target)&&l(!1)};return document.addEventListener("click",m),()=>{document.removeEventListener("click",m)}},[]),(0,He.useEffect)(()=>{if(!i.current&&!a)return()=>{};let m=new IntersectionObserver(d,{root:null,rootMargin:"0px",threshold:1});return i.current&&m.observe(i.current),()=>{i.current&&m.unobserve(i.current)}},[i,a]),(0,Oo.jsx)(vE.Provider,{value:{setIsOpen:l},children:(0,Oo.jsxs)("div",{ref:o,className:s.root,children:[(0,Oo.jsx)("button",{id:`dropdown-${r}`,"data-testid":"dropdown-trigger","aria-haspopup":"true","aria-expanded":a,"aria-label":"Dropdown trigger",type:"button",className:s.trigger,onClick:f,children:e}),(0,Oo.jsx)("div",{"data-testid":"dropdown-content",ref:i,"aria-hidden":!a,"aria-labelledby":`dropdown-${r}`,className:(0,yE.default)(s.content,{[s.contentOpen]:a,[s.contentTop]:u==="top",[s.contentBottom]:u==="bottom"}),children:t})]})})};function dO({as:e,children:t,onClick:n,...r}){let o=e||"button",i=A("Dropdown",ch),{setIsOpen:s}=cO(),a=l=>{s(!1),n(l),l.stopPropagation()};return(0,Oo.jsx)(o,{type:"button",className:i.item,onClick:a,...r,children:t})}SE.Item=dO;var dh=SE;var fh=w(b()),wE=e=>(0,fh.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"14",viewBox:"0 0 448 512",...e,children:(0,fh.jsx)("path",{fill:"currentColor",d:"M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z"})});var No={};Qe(No,{enUS:()=>fO,nlNL:()=>pO});var fO={preview:[{type:0,value:"Preview"}],useSuggestion:[{type:0,value:"Add"}],sendSuggestion:[{type:0,value:"Send"}],suggestionSent:[{type:0,value:"Sent"}],sendingError:[{type:0,value:"Sending failed"}],tryAgain:[{type:0,value:"Try again"}],editSuggestion:[{type:0,value:"Edit"}],visitUrl:[{type:0,value:"Visit"}],giveFeedback:[{type:0,value:"Give feedback"}],answer:[{type:0,value:"Answer"}]},pO={preview:[{type:0,value:"Preview"}],useSuggestion:[{type:0,value:"Gebruik"}],sendSuggestion:[{type:0,value:"Verzenden"}],suggestionSent:[{type:0,value:"Verzonden"}],sendingError:[{type:0,value:"Verzenden mislukt"}],tryAgain:[{type:0,value:"Probeer opnieuw"}],editSuggestion:[{type:0,value:"Bewerken"}],visitUrl:[{type:0,value:"Bekijk"}],giveFeedback:[{type:0,value:"Geef feedback"}],answer:[{type:0,value:"Antwoord"}]};var wd=w(b()),mO="%0d%0a%0d%0a%0d%0a",gO=(e,t)=>{let n=[`Suggestie: ${encodeURIComponent(t)}`,"Beschrijf je feedback:"];return`mailto:${e.join(",")}?subject=Suggestie feedback&body=${n.join(mO)}`},hO=({suggestion:e,onFeedback:t})=>{let n=G(No),r=j("suggestionFeedbackEmailAddresses");return!r||r.length===0?null:(0,wd.jsx)(dh,{trigger:(0,wd.jsx)(wE,{"data-testid":"feedback-dropdown-trigger"}),children:(0,wd.jsx)(dh.Item,{as:"a",href:gO(r,e),onClick:t,children:n("giveFeedback")})})},xd=hO;var Ed=w(D()),CE=w(b()),xE=Ed.default.createContext(void 0);function Ur(){let e=Ed.default.useContext(xE);if(e===void 0)throw new Error("useCommandPalette must be used within the CommandPalette component");return e}var EE=({children:e,page:t,isOpen:n,onChangeOpen:r,selected:o,setSelected:i})=>{let s=Ed.default.useMemo(()=>({page:t,isOpen:n,onChangeOpen:r,selected:o,setSelected:i}),[n,t,o]);return(0,CE.jsx)(xE.Provider,{value:s,children:e})};var Ct=w(b());function ph({closeOnSelect:e=!0,lineClamp:t,children:n,onClick:r,onFeedback:o,onSourceClick:i,description:s,sources:a,id:l,styles:u,...c}){let{selected:f,onChangeOpen:d}=Ur(),m=A("CommandPalette",Vt);function y(v){r(v),e&&d(!1)}return(0,Ct.jsxs)("div",{className:(0,ja.default)(m.listItem,l===f&&m.listItemSelected),children:[(0,Ct.jsx)("button",{type:"button",className:(0,ja.default)(m.listItemAction,m.listItemPrimaryAction),"aria-disabled":c.disabled??!1,onClick:y,"data-command-palette-item":!0,"data-item-id":l,...c,children:(0,Ct.jsxs)("div",{className:m.listItemContent,children:[typeof n=="string"?(0,Ct.jsx)("p",{className:(0,ja.default)(m.listItemText,m.truncate,u==null?void 0:u.title),children:n}):n,s&&(0,Ct.jsx)($i,{tagName:"p",allowList:[],content:Sd(s)?hE(s):s,className:(0,ja.default)(m.listItemDescription,u==null?void 0:u.description,t?m.lineClamp:m.truncate)})]})}),o&&(0,Ct.jsx)("div",{className:m.listItemActions,children:(0,Ct.jsx)(xd,{suggestion:String(n),onFeedback:o})}),a&&(0,Ct.jsxs)("div",{className:m.sources,children:[(0,Ct.jsx)("span",{className:m.sourcesTitle,children:"Sources"}),a.map(v=>v.url?(0,Ct.jsx)("a",{className:m.source,href:v.url,target:"_blank",title:v.url,rel:"noopener noreferrer",onClick:()=>i&&i(v),children:v.name},v.url):(0,Ct.jsx)("span",{className:m.source,children:v.name},v.name))]})]})}var za=w(b()),bE=()=>(0,za.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 512","aria-labelledby":"angleLeftTitle",children:[(0,za.jsx)("title",{id:"angleLeftTitle",children:"AngleLeft"}),(0,za.jsx)("path",{d:"M192 448c-8.188 0-16.38-3.125-22.62-9.375l-160-160c-12.5-12.5-12.5-32.75 0-45.25l160-160c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25L77.25 256l137.4 137.4c12.5 12.5 12.5 32.75 0 45.25C208.4 444.9 200.2 448 192 448z"})]});var Mo=w(b());function mh({children:e,title:t,id:n,onDismiss:r}){let o=G(Po),i=A("CommandPalette",Vt),{page:s}=Ur();return s!==n?null:(0,Mo.jsxs)("div",{className:i.page,id:`page_${n}`,tabIndex:-1,children:[r&&(0,Mo.jsxs)("div",{className:i.pageNav,children:[(0,Mo.jsxs)("button",{className:i.pageBackButton,type:"button",onClick:r,children:[(0,Mo.jsx)(bE,{}),o("back")]}),t&&(0,Mo.jsx)("h3",{className:i.pageTitle,children:t})]}),e]})}var TE=w(D());var Va=w(b()),qi=()=>(0,Va.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 24 24",width:"1em",fill:"currentColor",children:[(0,Va.jsx)("path",{d:"M0 0h24v24H0z",fill:"none"}),(0,Va.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})]});var sn=w(b());function yO({onChange:e,onChangeType:t,placeholder:n,typePlaceholder:r,types:o,value:i,selectedType:s},a){let l=A("CommandPalette",Vt);return(0,sn.jsxs)("div",{className:l.search,children:[(0,sn.jsx)("div",{className:l.searchIcon,children:(0,sn.jsx)(qi,{})}),(0,sn.jsxs)("div",{className:l.searchInputWrapper,children:[(0,sn.jsx)("input",{ref:a,spellCheck:!1,autoComplete:"off",onChange:u=>{e(u.currentTarget.value)},onFocus:u=>{u.currentTarget.select()},className:l.searchInput,placeholder:n,value:i,type:"text",id:"command-palette-search-input",autoFocus:!0}),o&&o.length>0&&(0,sn.jsx)("div",{className:l.selectWrapper,children:(0,sn.jsxs)("select",{"data-testid":"command-palette-type-select",className:l.select,onChange:u=>t(u.target.value===r?void 0:u.target.value),value:s||r,children:[r&&(0,sn.jsx)("option",{children:r}),o.map(u=>(0,sn.jsx)("option",{value:u.value,children:u.label},u.value))]})})]})]})}var kE=(0,TE.forwardRef)(yO);var gh=w(te());var Cd=w(b()),vO=({onClick:e,shortKeys:t,children:n,...r})=>{let o=A("CommandPalette",Vt);return(0,Cd.jsxs)("button",{type:"button",...r,onClick:e,className:(0,gh.default)(o.actionButton,r.className,{[o.hasShortKeys]:t&&t.length>0}),children:[n,t&&t.map(i=>(0,Cd.jsx)("span",{className:(0,gh.default)(o.actionShortcut,i===8629&&o.actionShortcutFixKerning),children:typeof i=="number"?String.fromCharCode(i):i},i))]})},PE=vO;var Ka=w(b()),SO="[data-command-palette-item]";function Gi({placeholder:e="Start typing to search...",typePlaceholder:t="All types",defaultPage:n="search",page:r,onChangePage:o,onChangeSearch:i,onChangeType:s,onChangeOpen:a,selectedType:l,types:u,children:c,isOpen:f,search:d}){let[m,y]=(0,qn.useState)(),v=(0,qn.useRef)(null),p=()=>{o&&o(n),s(void 0),i(""),a(!1)},g=()=>{var N;if(r!==n&&o){o(n);return}if(l&&s){s(void 0),(N=v.current)==null||N.focus();return}if(d.length>0){i("");return}a(!1)},h=()=>{let N=S();N.length!==0&&y(N[0].dataset.itemId)},S=()=>Array.from(document.querySelectorAll(SO)||[]),x=N=>document.querySelector(`[data-item-id=${N}]`),T=N=>{let V=x(N);V&&y(V.dataset.itemId)},C=N=>{let V=x(N);V&&V.scrollIntoView({behavior:"smooth"})},k=()=>{if(!m)return;let N=S(),V=x(m);if(!V)return;let _=N.indexOf(V),ee=N[_+1];ee&&ee.dataset.itemId?T(ee.dataset.itemId):h()},L=()=>{if(!m)return;let N=S(),V=x(m);if(!V)return;let _=N.indexOf(V),ee=N[_-1];ee&&ee.dataset.itemId?T(ee.dataset.itemId):T(N[N.length-1].dataset.itemId)},I=(0,qn.useCallback)(N=>{switch(N.key){case"ArrowDown":{N.preventDefault(),k();break}case"ArrowUp":{N.preventDefault(),L();break}case"Enter":{if(m){let V=x(m);V==null||V.click()}break}}},[m]);return(0,qn.useEffect)(()=>{h()},[d,r,l,f]),(0,qn.useEffect)(()=>{m&&C(m)},[m]),(0,Ka.jsx)(ud,{autoFocus:!0,contentAriaLabel:"Search Results",overlayAriaLabel:"Command Palette",isOpen:f,onBack:g,onClose:p,onKeyDown:I,children:(0,Ka.jsxs)(EE,{selected:m,setSelected:y,isOpen:f,onChangeOpen:a,page:r,children:[r===n&&(0,Ka.jsx)(kE,{ref:v,onChange:i,onChangeType:s,placeholder:e,value:d,selectedType:l,types:u,typePlaceholder:t}),c]})})}Gi.Page=mh;Gi.List=eh;Gi.Image=sE;Gi.ListItem=ph;Gi.Button=PE;var ge=Gi;var RE=w(D());function AE(e,t){(0,RE.useEffect)(()=>{let n=r=>{var o;((o=navigator==null?void 0:navigator.platform)!=null&&o.toLowerCase().includes("mac")?r.metaKey:r.ctrlKey)&&r.key===e&&(r.preventDefault(),r.stopPropagation(),t())};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}},[])}var $a=w(D());var LE={data:null,fetchState:"idle"},bd=e=>{var i;let t=[],{visitorName:n}=e.info.visitorInfo??{},{agentName:r,agentNickname:o}=e.info.agentInfo??{};return r&&r!==n&&t.push(r),o&&o!==n&&t.push(o),((i=e.entities.data)==null?void 0:i.filter(s=>!t.includes(s.text)))??null},an=B("entities/getEntities",async(e,t)=>{let{deepdeskAPI:n,dynamicThunkObject:r}=t.extra;if(!r.conversationQuery)return Promise.resolve([]);let o=r.conversationQuery,i=await o();return i.length===0?Promise.resolve([]):n.getEntities(i)}),wO=e=>e.filter((t,n)=>n===e.findIndex(r=>r.text===t.text)),xO=W({name:"entities",initialState:LE,reducers:{},extraReducers:e=>{e.addCase(an.pending,t=>{t.fetchState="loading"}).addCase(an.rejected,t=>{t.fetchState="error"}).addCase(an.fulfilled,(t,n)=>{t.fetchState="done",t.data=wO(t.data?[...t.data,...n.payload]:n.payload)}).addCase(le,()=>LE)}}),IE=xO.reducer;var hh={};Qe(hh,{enUS:()=>EO,nlNL:()=>CO});var EO={noResults:[{type:0,value:"No entities have been found"}],copy:[{type:0,value:"Copy"}],use:[{type:0,value:"Use"}]},CO={noResults:[{type:0,value:"Er zijn geen entiteiten gevonden"}],copy:[{type:0,value:"Kopieer"}],use:[{type:0,value:"Gebruik"}]};var OE={root:"Be",empty:"De"};var Yi=w(b()),TO=({onCopy:e})=>{let t=(0,$a.useRef)(null),n=A("EntitiesList",OE),r=O(bd),{setSelected:o}=Ur(),i=G(hh),s=Y();return(0,$a.useEffect)(()=>{s(an())},[]),(0,$a.useEffect)(()=>{t.current&&(t.current.focus(),o("entity-0"))},[t]),(0,Yi.jsxs)("div",{className:n.root,ref:t,tabIndex:-1,children:[r&&r.length>0&&(0,Yi.jsx)(ge.List,{children:r.map((a,l)=>(0,Yi.jsx)(ge.ListItem,{id:`entity-${l}`,closeOnSelect:!0,onClick:()=>e(a),children:a.text},a.text))},"entities"),r&&r.length===0&&(0,Yi.jsx)("p",{className:n.empty,children:i("noResults")})]})},NE=TO;var ln=w(D());var ME={data:null,fetchState:"idle"},_E=e=>e.summary.data,DE=e=>e.summary.fetchState==="error",FE=e=>e.summary.model,Gn=B("summary/getSummary",async(e,t)=>{var c,f,d;let n=t.getState().profile.data,r=(c=t.getState().conversation.current)==null?void 0:c.sessionId,o=(d=(f=t.getState().info)==null?void 0:f.agentInfo)==null?void 0:d.agentId;if(!n)throw new Error("Profile is not defined");let{deepdeskAPI:i,dynamicThunkObject:s}=t.extra;if(!s.conversationQuery)return Promise.reject(new Error("setConversationQuery method is not defined"));let a=s.conversationQuery,l=await a();if(l.length===0)return Promise.reject(new Error("No messages are included"));let u=await i.getSummary(l,{externalConversationId:r,agentId:o,promptInstruction:n.summarizerPromptInstruction,model:n.summarizerModel});return u.summary?u:Promise.reject(new Error("Summary is not provided"))}),kO=W({name:"summary",initialState:ME,reducers:{},extraReducers:e=>{e.addCase(Gn.pending,t=>{t.data=null,t.fetchState="loading"}).addCase(Gn.rejected,t=>{t.data=null,t.fetchState="error"}).addCase(Gn.fulfilled,(t,n)=>{t.fetchState="done",n.payload&&(t.data=n.payload.summary,t.model=n.payload.model)}).addCase(le,()=>ME)}}),HE=kO.reducer;var yh={};Qe(yh,{enUS:()=>PO,nlNL:()=>RO});var PO={copy:[{type:0,value:"Copy"}],error:[{type:0,value:"Could not generate a summary"}],loading:[{type:0,value:"Generating summary, this may take a few moments."}]},RO={copy:[{type:0,value:"Kopieer"}],error:[{type:0,value:"Kon helaas geen samenvatting genereren."}],loading:[{type:0,value:"Samenvatting wordt gemaakt, dit kan even duren."}]};var UE={root:"Ie",actions:"Oe",main:"Xe",textInput:"eo",loading:"Je",error:"Ke"};var Yn=w(b()),LO=({onCopy:e})=>{let t=(0,ln.useRef)(null),n=A("SummaryForm",UE),[r,o]=(0,ln.useState)(""),i=G(yh),s=O(FE),a=O(_E),l=O(DE),u=Y(),c=()=>{u(Ye({name:"summary copied to clipboard",data:{originalText:a,finalText:r,model:s},options:{includeConversationData:!0}})),e(r)},f=()=>{let d=document.getSelection();d&&u(Ye({name:"summary copied to clipboard",data:{originalText:a,finalText:d==null?void 0:d.toString(),model:s},options:{includeConversationData:!0}}))};return(0,ln.useEffect)(()=>{u(Gn())},[]),(0,ln.useEffect)(()=>{o(a||"")},[a]),(0,ln.useEffect)(()=>{t.current&&a&&t.current.focus()},[t,a]),(0,ln.useEffect)(()=>{let d=m=>{m.key==="Enter"&&m.shiftKey&&c()};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[r]),(0,Yn.jsx)("div",{className:n.root,tabIndex:-1,children:l?(0,Yn.jsx)("p",{className:n.error,children:i("error")}):(0,Yn.jsxs)(ln.Fragment,{children:[(0,Yn.jsx)("div",{className:n.main,children:(0,Yn.jsx)("textarea",{placeholder:a?void 0:i("loading"),disabled:!a,className:n.textInput,ref:t,value:r,onCopy:f,onChange:d=>o(d.target.value)})}),(0,Yn.jsx)("div",{className:n.actions,children:(0,Yn.jsx)(ge.Button,{shortKeys:[8679,8629],onClick:c,children:i("copy")})})]})})},BE=LO;var Wa={};Qe(Wa,{enUS:()=>IO,nlNL:()=>OO});var IO={personalCollectionLink:[{type:0,value:"Go to Personal Collection"}],searchPlaceholder:[{type:0,value:"Start typing to search..."}],urlSuggestions:[{type:0,value:"Link suggestions"}],personalSuggestions:[{type:0,value:"Personal suggestions"}],pinnedMessages:[{type:0,value:"Pinned messages"}],imageSuggestions:[{type:0,value:"Images"}],typePlaceholder:[{type:0,value:"All types"}],navigation:[{type:0,value:"Navigation"}],entitiesClipboard:[{type:0,value:"Conversation clipper"}],entitiesTitle:[{type:0,value:"Copy to your clipboard"}],summaryClipboard:[{type:0,value:"Summarize conversation"}],summaryTitle:[{type:0,value:"Conversation summary"}],knowledgeAssist:[{type:0,value:"Knowledge assist"}],commands:[{type:0,value:"Commands"}],use:[{type:0,value:"Use"}],preview:[{type:0,value:"Preview"}],warning:[{type:0,value:"Are you sure you want to discard the message?"}]},OO={personalCollectionLink:[{type:0,value:"Ga naar persoonlijke collectie"}],searchPlaceholder:[{type:0,value:"Begin met typen om te zoeken..."}],personalSuggestions:[{type:0,value:"Persoonlijke suggesties"}],urlSuggestions:[{type:0,value:"Link suggesties"}],imageSuggestions:[{type:0,value:"Afbeeldingen"}],navigation:[{type:0,value:"Navigatie"}],typePlaceholder:[{type:0,value:"Alle types"}],pinnedMessages:[{type:0,value:"Actueel"}],entitiesClipboard:[{type:0,value:"Klembord"}],entitiesTitle:[{type:0,value:"Kopieer naar klembord"}],summaryClipboard:[{type:0,value:"Gesprek samenvatten"}],summaryTitle:[{type:0,value:"Gesprek samenvatting"}],knowledgeAssist:[{type:0,value:"Knowledge assist"}],commands:[{type:0,value:"Acties"}],use:[{type:0,value:"Gebruik"}],preview:[{type:0,value:"Bewerk"}],warning:[{type:0,value:"Weet je zeker dat je de wijzigingen wilt weggooien?"}]};var Br=w(D());var vh={};Qe(vh,{enUS:()=>NO,nlNL:()=>MO});var NO={use:[{type:0,value:"Use"}],loading:[{type:0,value:"Loading..."}],error:[{type:0,value:"Something went wrong, please try again later."}],anotherQuestion:[{type:0,value:"Send a message..."}],reset:[{type:0,value:"Reset conversation"}]},MO={use:[{type:0,value:"Gebruik"}],loading:[{type:0,value:"Laden..."}],error:[{type:0,value:"Er ging iets mis, probeer het later opnieuw."}],anotherQuestion:[{type:0,value:"Stuur een bericht..."}],reset:[{type:0,value:"Reset gesprek"}]};var jE={root:"io",title:"Pe",empty:"Qe",status:"Ve",form:"ro",input:"to",submit:"We",question:"Ze",answer:"_e",alignRight:"oi"};var DO={data:null,fetchState:"idle"},zE=e=>{var t;return(t=e.knowledgeAssistant)==null?void 0:t.data},qa=B("knowledgeAssistant/getKnowledgeAssistant",async(e,t)=>{var s;let{deepdeskAPI:n}=t.extra,r=t.getState(),o=r.conversation.current;if(!o||!o.profileCode)throw new Error("No conversation of conversation profileCode found");let i=(s=r.profile.data)==null?void 0:s.knowledgeAssistant;return i?n.getKnowledgeAssistant(i):null}),FO=W({name:"knowledgeAssistant",initialState:DO,reducers:{},extraReducers:e=>{e.addCase(qa.pending,t=>{t.fetchState="loading"}).addCase(qa.rejected,t=>{t.fetchState="error"}).addCase(qa.fulfilled,(t,n)=>{t.fetchState="done",t.data=n.payload})}}),VE=FO.reducer;var Sh={data:[],fetchState:"idle"},KE=e=>{var t;return(t=e.answer)==null?void 0:t.data},$E=e=>e.answer.fetchState,Qi=we("answer/resetKnowledgeSearch"),Xi=B("answer/getAnswer",async(e,t)=>{var l,u,c;let{deepdeskAPI:n}=t.extra,r=t.getState().answer.data,o=zE(t.getState()),i=(l=t.getState().conversation.current)==null?void 0:l.sessionId,s=(c=(u=t.getState().info)==null?void 0:u.agentInfo)==null?void 0:c.agentId;if(!o)throw new Error("KnowledgeAssistant is not defined");let a=await n.knowledgeAssist({promptInstruction:o.prompt,question:e},r,o.code,{agentId:s,conversationId:i});return{question:e,answer:a}}),HO=W({name:"answer",initialState:Sh,reducers:{},extraReducers:e=>{e.addCase(Xi.pending,t=>{t.fetchState="loading"}).addCase(Xi.rejected,t=>{t.fetchState="error"}).addCase(Xi.fulfilled,(t,n)=>{t.fetchState="done",t.data=[...t.data,n.payload]}).addCase(le,()=>Sh).addCase(Qi,()=>Sh)}}),WE=HO.reducer;var Ga=w(b()),qE=()=>(0,Ga.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512","aria-labelledby":"paperPlaneTitle",children:[(0,Ga.jsx)("title",{id:"paperPlaneTitle",children:"PaperPlane"}),(0,Ga.jsx)("path",{d:"M498.1 5.6c10.1 7 15.4 19.1 13.5 31.2l-64 416c-1.5 9.7-7.4 18.2-16 23s-18.9 5.4-28 1.6L284 427.7l-68.5 74.1c-8.9 9.7-22.9 12.9-35.2 8.1S160 493.2 160 480V396.4c0-4 1.5-7.8 4.2-10.7L331.8 202.8c5.8-6.3 5.6-16-.4-22s-15.7-6.4-22-.7L106 360.8 17.7 316.6C7.1 311.3 .3 300.7 0 288.9s5.9-22.8 16.1-28.7l448-256c10.7-6.1 23.9-5.5 34 1.4z"})]});var bt=w(b()),UO=({onUse:e,onResetQuestion:t,question:n})=>{let[r,o]=Br.default.useState(""),{setSelected:i}=Ur(),s=(0,Br.useRef)(null),a=A("EntitiesList",jE),l=G(vh),u=Y(),c=O(KE),f=O($E),d=async y=>{y.preventDefault(),y.stopPropagation(),r!==""&&u(Xi(r))},m=(y,v)=>{u(Ye({name:"knowledge assist source viewed",data:{question:v,sourceViewed:y.url||y.name},options:{includeConversationData:!0}}))};return(0,Br.useEffect)(()=>{var y;n&&f==="idle"?u(Xi(n)):(y=s.current)==null||y.focus()},[s,f]),(0,Br.useEffect)(()=>{f==="done"&&(u(Ye({name:"knowledge assist question answered",data:{question:r||n,sources:c[c.length-1].answer.sources,answer:c[c.length-1].answer.answer,isFollowUpQuestion:c.length>1},options:{includeConversationData:!0}})),i(`knowledge-assist-${c.length-1}`),o(""))},[f,c]),(0,Br.useEffect)(()=>{s.current&&s.current.scrollIntoView({behavior:"smooth"})},[s,c]),(0,bt.jsxs)("div",{className:a.root,children:[c.length>0&&(0,bt.jsx)("div",{className:a.alignRight,children:(0,bt.jsx)(ge.Button,{onClick:t,children:l("reset")})}),c.map(({question:y,answer:v},p)=>(0,bt.jsx)(ge.List,{children:(0,bt.jsx)(ge.ListItem,{id:`knowledge-assist-${p}`,"data-testid":"knowledge-search-answer",description:v.answer,closeOnSelect:!0,onClick:()=>e(v.answer),onSourceClick:g=>m(g,y),sources:v.sources,styles:{title:a.question,description:a.answer},children:y})},`${v.answer}_${p}`)),f==="loading"&&(0,bt.jsx)("p",{className:a.status,children:l("loading")}),f==="error"&&(0,bt.jsx)("p",{className:a.status,children:l("error")}),(0,bt.jsxs)("form",{className:a.form,onSubmit:d,children:[(0,bt.jsx)("input",{ref:s,placeholder:l("anotherQuestion"),className:a.input,type:"text",value:r,onFocus:()=>{i(void 0)},onChange:y=>{i(void 0),o(y.target.value)}}),(0,bt.jsx)("button",{type:"submit",className:a.submit,children:(0,bt.jsx)(qE,{})})]})]})},GE=UO;var BO={data:null,fetchState:"idle"},jr=e=>e.profile.data,Td=e=>e.profile.data?e.profile.data.uiConfig.widget.types.filter(t=>t.isActive):[],Ya=B("profile/getProfile",async(e,t)=>{var i;let{deepdeskAPI:n}=t.extra,r=t.getState(),o=r.conversation.current;if(!o||!o.profileCode)throw new Error("No conversation of conversation profileCode found");return((i=r.profile.data)==null?void 0:i.code)===o.profileCode?r.profile.data:n.getProfile(o.profileCode)}),jO=W({name:"profile",initialState:BO,reducers:{},extraReducers:e=>{e.addCase(Ya.pending,t=>{t.fetchState="loading"}).addCase(Ya.rejected,t=>{t.fetchState="error"}).addCase(Ya.fulfilled,(t,n)=>{t.fetchState="done",t.data=n.payload})}}),YE=jO.reducer;var iC=w(D());var zO=["{amount}"," {amount}","{date}","{email}","{iban}","{name}","{postal_code}","{street}","{tarif}","{usage}","{3_digits}","{4_digits}","{5_digits}","{6_digits}","{7_digits}","{8_digits}","{9_digits}","{10_digits}"],VO=new RegExp(zO.map(e=>`(?:${e.replace("{","\\{").replace("}","\\}")})`).join("|"));function XE(e,t){let n=e.split(VO),r=0,o=[];for(let i=0;i<n.length;i++){let s=n[i];if(o.push(s),i===n.length-1)break;if(t.indexOf(s)===-1)return e;let a=n[i+1],l=i===n.length-2;r+=s.length;let u=r;if(l){let f=a.charAt(0),d=0;do u=f?t.indexOf(f,u+1):-1,d+=1;while(u!==-1&&a.indexOf(t.slice(u))!==0);if(u===-1&&d>2)return e}else u=a&&a!==""?t.indexOf(a,r):-1;let c=u===-1?t.slice(r):t.slice(r,u);o.push(c),r=u}return o.join("")}function QE(e,t){return typeof t=="boolean"?e:e.slice(0,t)}var JE={suggestions:[],fetchState:"idle",isInitialRequest:null},ZE={default:JE},eC=e=>t=>{var n;return((n=t.textSuggestions[e])==null?void 0:n.suggestions)??[]},tC=e=>{let t=Object.keys(e.textSuggestions).map(n=>{var r;return(r=e.textSuggestions[n])==null?void 0:r.fetchState});return t.length===0?!0:t.every(n=>n!=="done")},kd=e=>e.textSuggestions,nC=e=>{let t=e.toLowerCase();return n=>{let r=n.text.toLowerCase();return r.startsWith(t)&&r.length>t.length}},Pd=we("textSuggestions/refresh"),un=B("textSuggestions/recommendations",async(e,t)=>{var u;let{deepdeskAPI:n}=t.extra,r=t.getState(),o=(u=r.conversation.current)==null?void 0:u.id,{textSuggestionsCount:i,inlineSuggestions:s}=r.settings,a=Vi(r);if(!o)throw new Error("No current conversation to fetch text suggestions");let l=await n.getTextSuggestions(o,Ra(r),e);if(e==="default"){let c=s?l.filter(nC(a)):l;t.dispatch(En(c.slice(0,i)))}return l}),Xa=B("textSuggestions/autocompletions",async(e,t)=>{var u;let{deepdeskAPI:n}=t.extra,r=t.getState(),o=(u=r.conversation.current)==null?void 0:u.id,{textSuggestionsCount:i,deanonymize:s,inlineSuggestions:a}=r.settings;if(!o)throw new Error("No current conversation to fetch text suggestions");let l=await n.getAutocompleteSuggestions(o,{...Ra(r),input:e});if(!t.getState().input.text)throw new Error("Abort");return a&&(l=l.filter(nC(e))),s&&(l=l.map(c=>({...c,text:c.source!=="trie-with-typos"?XE(c.text,e):c.text}))),l=QE(l,i),t.dispatch(En(l)),l}),rC=W({name:"textSuggestions",initialState:ZE,reducers:{setTextSuggestions:{reducer(e,t){let{contentType:n}=t.payload;e[n].fetchState="done",e[n].suggestions=t.payload.suggestions},prepare(e,t){return{payload:{contentType:e,suggestions:t}}}},setSuggestionState(e,t){return t.payload}},extraReducers:e=>{e.addCase(un.pending,(t,n)=>{let r=n.meta.arg,o=t[r]||JE;return{...t,[r]:{...o,fetchState:"loading",isInitialRequest:o.isInitialRequest===null}}}).addCase(un.rejected,(t,n)=>{let r=n.meta.arg;t[r]&&(t[r].fetchState="error")}).addCase(un.fulfilled,(t,n)=>{let r=n.meta.arg;t[r]&&(t[r].fetchState="done",t[r].suggestions=n.payload)}).addCase(Xa.pending,t=>{t.default.fetchState="loading"}).addCase(Xa.rejected,t=>{t.default.fetchState="error"}).addCase(Xa.fulfilled,(t,n)=>{t.default.fetchState="done",t.default.suggestions=n.payload}).addCase(le,()=>ZE)}}),{setTextSuggestions:fF,setSuggestionState:pF}=rC.actions,oC=rC.reducer;var _o=w(b()),KO=({commands:e,onClick:t})=>{var a,l,u;let n=Y(),r=G(Wa),o=O(jr),i=O(kd),s=((u=(l=(a=o==null?void 0:o.uiConfig)==null?void 0:a.search)==null?void 0:l.initialTypes)==null?void 0:u.filter(({isActive:c})=>c))||[];return(0,iC.useEffect)(()=>{s.forEach(({type:c})=>{(!i[c]||i[c].suggestions.length===0)&&n(un(c))})},[]),(0,_o.jsxs)("div",{children:[e.length>0&&(0,_o.jsx)(ge.List,{heading:r("commands"),children:e.map((c,f)=>(0,_o.jsx)(ge.ListItem,{id:`command-${f}`,closeOnSelect:!1,onClick:c.onClick,children:c.label},c.label))}),s.map(({type:c,title:f})=>{var d;return(0,_o.jsx)(ge.List,{heading:f,orientation:"vertical",children:(d=i[c])==null?void 0:d.suggestions.map((m,y)=>(0,_o.jsx)(ge.ListItem,{id:`${c}-${y}`,closeOnSelect:!1,description:m.text,onClick:()=>t(m.text,m),"data-testid":"search-overlay-suggestion",children:m.title},`${m.id}-${m.text}`))},c)})]})},sC=KO;var Ue=w(b()),WO=200,qO=5,GO=4,aC=(e,t)=>!t||e.toLowerCase().includes(t.toLowerCase()),YO=()=>{let e=Y(),t=zt(),n=G(Wa),[r,o]=(0,mt.useState)(!1),[i,s]=(0,mt.useState)(""),a=O(R1),l=O(jr),[u,c]=(0,mt.useState)(),f=O(tt),d=j("showSearch"),m=j("showEntitiesCommand"),y=j("showSummaryCommand"),v=j("showKnowledgeSearch"),p=j("showImageSearch"),g=j("searchTriggerKey"),h=O(rE),S=O(A1),x=O(L1),T=O(P1),C=H=>Gt(S.filter(q=>q.type===H.toUpperCase()),H),k=[{value:"PERSONAL",label:n("personalSuggestions"),list:C("PERSONAL"),lineClamp:!1,listOrientation:"vertical",shouldShow:!0},{value:"URL",label:n("urlSuggestions"),list:C("URL"),lineClamp:!1,listOrientation:"vertical",shouldShow:!0},{value:"STICKYMESSAGE",label:n("pinnedMessages"),list:C("STICKYMESSAGE"),lineClamp:!1,listOrientation:"vertical",shouldShow:!0},{value:"IMAGE",label:n("imageSuggestions"),lineClamp:!1,list:C("IMAGE"),listOrientation:"horizontal",shouldShow:p}].filter(H=>H.shouldShow),L=[{label:n("entitiesClipboard"),onClick:()=>e(tn("entities")),shouldShow:m&&aC(n("entitiesClipboard"),i)},{label:n("summaryClipboard"),onClick:()=>e(tn("summary")),shouldShow:y&&aC(n("summaryClipboard"),i)},{label:i?`${n("knowledgeAssist")}: ${i}`:n("knowledgeAssist"),onClick:()=>e(tn("knowledgeAssist")),shouldShow:v}].filter(H=>H.shouldShow),I=(h==null?void 0:h.map(H=>({value:H.code.toUpperCase(),label:`${H.name}s`,list:C(H.code.toUpperCase()),listOrientation:"vertical",lineClamp:!0})))||[],N=(0,mt.useCallback)((0,lC.default)((H,q)=>{e(Co({query:H,type:q,tags:["search-overlay"],size:u?50:20}))},WO),[u]),V=(0,mt.useCallback)((H,q)=>{switch(q.type){case"IMAGE":t.send(Bg,{suggestion:q});break;default:t.send(Dr,{text:H,suggestion:q})}e(xt(!1))},[e]),_=H=>{ko(H.text),e(Ye({name:"entity copied",data:{entity:H,type:"copy"}})),e(xt(!1))},ee=(0,mt.useCallback)(H=>{e(Ye({name:"suggestion feedback",data:{text:H.text,source:"search",context:i},options:{includeConversationData:!0}}))},[i]),Yr=H=>{t.send(Dr,{text:H,suggestion:{source:"knowledge-assist",text:H}}),e(Ye({name:"answer used",data:{originalText:H},options:{includeConversationData:!0}})),s(""),e(tn("search")),e(Qi()),e(xt(!1))},it=H=>{ko(H),e(xt(!1))};function Gt(H,q){return H.slice(0,u?10:q.toLowerCase()==="image"?GO:qO)}function At(H){return q=>{r?window.confirm(n("warning"))&&(H(q),o(!1)):H(q)}}return(0,mt.useEffect)(()=>{i?N(i,u):e(qc())},[i,u]),(0,mt.useEffect)(()=>{a==="search"&&e(Qi())},[a]),(0,mt.useEffect)(()=>{f&&e(Da())},[f]),AE(g,()=>e(xt(!0))),!d||!l?null:(0,Ue.jsxs)(ge,{placeholder:n("searchPlaceholder"),typePlaceholder:n("typePlaceholder"),onChangeSearch:s,onChangeOpen:At(H=>e(xt(H))),onChangeType:H=>c(H),onChangePage:At(H=>e(tn(H))),selectedType:u,search:i,page:a,isOpen:T,types:[...I,...k],children:[(0,Ue.jsxs)(ge.Page,{id:"search",children:[i.length===0&&(0,Ue.jsx)(sC,{commands:L,onClick:V}),i.length>0&&(0,Ue.jsxs)(mt.Fragment,{children:[L.length>0&&(0,Ue.jsx)(ge.List,{heading:n("commands"),children:L.map((H,q)=>(0,Ue.jsx)(ge.ListItem,{closeOnSelect:!1,onClick:H.onClick,id:`commands-${q}`,children:H.label},H.label))}),[...I,...k].map(({value:H,label:q,list:ir,lineClamp:he,listOrientation:sr})=>(0,Ue.jsx)(ge.List,{heading:q,orientation:sr==="horizontal"?"horizontal":"vertical",onShowAll:()=>c(H),hasMore:!u&&x[H.toLowerCase()]>Gt(ir,H).length,children:Gt(ir,H).map($=>(0,Ue.jsx)(ge.ListItem,{id:`${H}-${$.id}`,closeOnSelect:!1,lineClamp:he,onClick:()=>V($.text,$),description:H!=="IMAGE"?$.title&&$.text:void 0,onFeedback:H!=="IMAGE"?()=>ee($):void 0,children:H==="IMAGE"?(0,Ue.jsx)(ge.Image,{title:$.title||$.text,src:$.image}):$.title||$.text},`${$.id}-${$.text}`))},H))]})]}),(0,Ue.jsx)(ge.Page,{id:"entities",title:n("entitiesTitle"),onDismiss:At(()=>{e(tn("search"))}),children:(0,Ue.jsx)(NE,{onCopy:_})}),(0,Ue.jsx)(ge.Page,{id:"summary",title:n("summaryTitle"),onDismiss:At(()=>{e(tn("search"))}),children:(0,Ue.jsx)(BE,{onCopy:it})}),(0,Ue.jsx)(ge.Page,{id:"knowledgeAssist",title:n("knowledgeAssist"),onDismiss:At(()=>{e(Qi()),e(tn("search"))}),children:(0,Ue.jsx)(GE,{question:i,onUse:Yr,onResetQuestion:()=>{e(Qi()),s("")}})})]})},uC=YO;var Qa=w(b()),XO=()=>{let e=j("showSearch"),t=j("isEmbedded");return(0,Qa.jsxs)(cC.Fragment,{children:[e&&(0,Qa.jsx)(uC,{}),t&&(0,Qa.jsx)(Z1,{})]})},dC=XO;var gC=w(te());var Rd=w(b()),fC=({className:e})=>(0,Rd.jsx)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 512 512",xmlSpace:"preserve",className:e,children:(0,Rd.jsx)("g",{children:(0,Rd.jsx)("path",{d:`M163.4,233h186v-70c0-25.6-9.4-47.8-27.3-65.7C304.2,79.4,282,70,256.4,70s-47.8,9.4-65.7,27.3
|
|
20
20
|
c-17.9,17.9-27.3,40.1-27.3,65.7C163.4,163,163.4,233,163.4,233z M465.5,267.9V477c0,9.4-3.4,17.9-10.2,24.7
|
|
21
21
|
c-6.8,6.8-15.4,10.2-24.7,10.2h-349c-9.4,0-17.9-3.4-24.7-10.2c-6.8-6.8-10.2-15.4-10.2-24.7V267.9c0-9.4,3.4-17.9,10.2-24.7
|
|
22
22
|
c6.8-6.8,15.4-10.2,24.7-10.2h11.9v-70c0-44.4,16.2-82.8,47.8-115.2S212.1,0,256.4,0s82.8,16.2,115.2,47.8
|
|
23
23
|
c32.4,32.4,47.8,70,47.8,115.2v70h11.9c9.4,0,17.9,3.4,24.7,10.2C462.1,250,465.5,257.7,465.5,267.9z`})})});var wh=w(b()),QO={green:"#0A5E52",pink:"#CD8EF2",red:"#DF341D",yellow:"#DEBD00"},pC=({className:e,color:t})=>(0,wh.jsx)("svg",{className:e,viewBox:"0 0 345 345",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,wh.jsx)("path",{d:"M172.03 0.0199966H0V86.03C47.5 86.03 86 124.54 86 172.04C86 124.54 124.51 86.03 172.01 86.03C219.51 86.03 258.03 124.54 258.03 172.04C258.03 219.54 219.52 258.05 172.01 258.05C124.5 258.05 86 219.54 86 172.04C86 219.54 47.5 258.05 0 258.05V344.06H172.03C267.04 344.06 344.06 267.04 344.06 172.03C344.06 77.02 267.04 0 172.03 0V0.0199966Z",fill:QO[t||"pink"]})});var mC={root:"j",text:"Y",isLoggedIn:"ei",isLoggedOut:"no",icon:"ii",logo:"ri",lock:"ti"};var xh={};Qe(xh,{enUS:()=>JO,nlNL:()=>eN});var JO={signin:[{type:0,value:"Sign in to "},{type:1,value:"productName"}],search:[{type:1,value:"productName"},{type:0,value:" Search"}]},eN={signin:[{type:0,value:"Log in bij "},{type:1,value:"productName"}],search:[{type:1,value:"productName"},{type:0,value:" Zoeken"}]};var Do=w(b()),hC=({onLogIn:e})=>{let t=G(xh),n=j("floatingMenu"),r=j("productName"),o=Y(),i=O(tt),s=A("FloatingMenu",mC);if(i===null||n===!1)return null;let a=()=>{i===!0?o(xt(!0)):e()};return(0,Do.jsxs)("button",{className:(0,gC.default)(s.root,{[s.isLoggedIn]:i,[s.isLoggedOut]:!i}),onClick:a,children:[(0,Do.jsx)("div",{className:s.text,children:t(i?"search":"signin",{productName:r})}),(0,Do.jsxs)("div",{className:s.icon,children:[(0,Do.jsx)(pC,{className:s.logo,color:"pink"}),i===!1&&(0,Do.jsx)(fC,{className:s.lock})]})]})};var Od=w(D());var yC=w(D());function Zi(e){(0,yC.useEffect)(()=>{let t=n=>{n.isWithinRoot||e(n)};return document.body.addEventListener("mouseup",t),()=>{document.body.removeEventListener("mouseup",t)}},[e])}function Fo(e){e.addEventListener("mouseup",t=>{t.isWithinRoot=!0},!0)}function Ji(e){let{showMidSentenceSuggestions:t,showSuggestionsBeforePattern:n,showSuggestionsAfterPattern:r}=e.settings,{text:o,selection:i}=e.input.userCommitted;return i.start!==i.end?!1:i.end>=o.length?!0:t?n&&new RegExp(n).test(o.substring(i.end))||r&&new RegExp(r).test(o.substring(0,i.end))?!0:n===!1&&r===!1:!1}var tN={showTabHint:!1,inputHasFocus:!1,overlayCollapsed:!1,openOverlayWhenTyping:!1,overlayCollapsedUserOverwrite:!1};var Ad=({ui:e})=>e.overlayCollapsed;var vC=W({name:"ui",initialState:tN,reducers:{setShowTabHint(e,t){e.showTabHint=t.payload},setInputHasFocus(e,t){e.overlayCollapsedUserOverwrite!==!0&&(t.payload===!0&&(e.overlayCollapsed=!1),e.inputHasFocus=t.payload)},setOverlayCollapsed(e,t){t.payload.collapse===!1&&(e.openOverlayWhenTyping=!1),!(t.payload.skipWhenInputFocus&&e.inputHasFocus)&&(e.overlayCollapsed=t.payload.collapse)},setOpenOverlayWhenTyping(e,t){e.openOverlayWhenTyping=t.payload},setOverlayCollapsedUserOverwrite(e,t){e.overlayCollapsedUserOverwrite=t.payload,e.overlayCollapsed=t.payload}}}),{setShowTabHint:Za,setInputHasFocus:Eh,setOverlayCollapsed:zr,setOpenOverlayWhenTyping:SC,setOverlayCollapsedUserOverwrite:wC}=vC.actions,xC=vC.reducer;var Ld=w(D());var es=w(D());var EC=w(D());function CC(e,t,n){(0,EC.useEffect)(()=>{let r=e.current;return r?(r.addEventListener(t,n),()=>{r.removeEventListener(t,n)}):()=>{}},[e,t,n])}var bC={root:"ni",actions:"ai",badge:"pi",formattedText:"ao"};var Ho=w(b()),oN=["search","personal-collection-search","search-autocomplete"];function iN(e,t,n,r={}){let o="";return oN.includes(t)?o=mE(uh(e,n,{stripAgentPart:!0}),r.searchKeywords??[n]):o=uh(e,n,r),r.placeholders===!0&&(o=gE(o)),o}var sN=()=>{},aN=({index:e,selected:t,suggestion:n,onFeedback:r})=>{let o=j("inlineSuggestions"),i=O(Vi),s=Y(),a=A("TextSuggestion",bC),l=(0,es.useRef)(null);(0,es.useEffect)(()=>{let c=setTimeout(()=>{s(m1({text:n.text,suggestion:n}))},500);return()=>{clearTimeout(c)}},[n]),CC(l,"click",()=>{s(_r(e)),s(Cn({suggestion:n,text:n.text,eventMetrics:{inputType:"mouse"},replace:"until-selection-end"}))});let u=(0,es.useMemo)(()=>iN(n.text,n.source,i,{stripAgentPart:o,placeholders:!0,searchKeywords:n.searchKeywords}),[o,n.text,n.source,i,n.searchKeywords]);return n.source==="gpt"&&!o?null:(0,Ho.jsxs)("div",{className:a.root,onMouseEnter:()=>s(_r(e)),children:[(0,Ho.jsx)(oe,{ref:l,as:"button","data-testid":"suggestions-overlay-item",selected:t,onClick:sN,children:(0,Ho.jsx)($i,{containerTagName:"div",noWrap:!1,tagName:"span",className:a.formattedText,content:u})}),t&&r&&(0,Ho.jsx)("div",{className:a.actions,children:(0,Ho.jsx)(xd,{onFeedback:()=>r(n),suggestion:n.text})})]})},TC=aN;var Ch=w(b()),lN=({onFeedback:e,suggestions:t,selectedIndex:n,reverse:r})=>{let o=(0,Ld.useMemo)(()=>{let i=t.map((s,a)=>(0,Ch.jsx)(TC,{index:a,selected:a===n,suggestion:s,onFeedback:e},`${s.text}-${s.source}`));return r?i.reverse():i},[t,n,r]);return(0,Ch.jsx)(Ld.Fragment,{children:o})},Id=lN;var kC={root:"di",paper:"li"};var Ja=w(b()),cN=({textSuggestions:e,selectedIndex:t})=>{let n=(0,Od.useRef)(null),r=A("InlineSuggestionsOverlay",kC),o=O(Ji),i=Y(),s=O(tt),a=O(zi),l=O(Ad),u=j("showTextSuggestions");return Zi(()=>{setTimeout(()=>{i(zr({collapse:!0,skipWhenInputFocus:!0}))})}),(0,Od.useEffect)(()=>{let c=n.current;if(!c||!c.parentElement)return;c.parentElement.style.left="0px";let f=c.getBoundingClientRect();c.parentElement.style.left=`${Math.min(window.innerWidth-4-f.right,0)}px`}),l||!o||!u||e.length===0||s!==!0||a===!1?null:(0,Ja.jsx)("div",{className:r.root,"data-variant":"inline",children:(0,Ja.jsx)("div",{ref:n,className:r.paper,children:(0,Ja.jsx)(ht,{children:(0,Ja.jsx)(Id,{suggestions:e,selectedIndex:t})})})})},dN=({input:e})=>({selectedIndex:e.selectedSuggestionIndex,textSuggestions:e.textSuggestions}),PC=jn(dN)(cN);var el=w(b()),fN=({children:e})=>{let n=j("locale").replace("-","");return(0,el.jsx)(Gg.Provider,{value:n,children:e})},pN=({store:e,customStyles:t={},children:n})=>(0,el.jsx)(Pg,{store:e,children:(0,el.jsx)(fN,{children:(0,el.jsx)(hs.Provider,{value:t,children:n})})}),Uo=pN;var Md=w(te()),ts=w(D());var RC=w(D());function AC(e,t){let[n,r]=(0,RC.useState)(()=>{if(typeof window>"u")return t;try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch(i){return z.error(i),t}});return[n,i=>{try{let s=i instanceof Function?i(n):i;r(s),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(s))}catch(s){z.error(s)}}]}var LC=()=>/Mac/i.test(navigator.platform);var OC=w(te()),Xn=w(D());var bh={};Qe(bh,{enUS:()=>mN,nlNL:()=>gN});var mN={loginPlease:[{type:8,value:"login",children:[{type:0,value:"Sign in"}]},{type:0,value:" to enable "},{type:1,value:"productName"},{type:0,value:"."}],snooze:[{type:0,value:"Snooze for "},{type:8,value:"min",children:[{type:0,value:"10 minutes"}]},{type:0,value:", "},{type:8,value:"hour",children:[{type:0,value:"1 hour"}]},{type:0,value:" or "},{type:8,value:"day",children:[{type:0,value:"1 day"}]}]},gN={loginPlease:[{type:8,value:"login",children:[{type:0,value:"Log in"}]},{type:0,value:" bij "},{type:1,value:"productName"},{type:0,value:"."}],snooze:[{type:0,value:"Snooze voor "},{type:8,value:"min",children:[{type:0,value:"10 minuten"}]},{type:0,value:", "},{type:8,value:"hour",children:[{type:0,value:"1 uur"}]},{type:0,value:" of "},{type:8,value:"day",children:[{type:0,value:"1 dag"}]}]};var IC={root:"si",anchor:"ci",anchorButton:"xi"};var Vr=w(b()),Th=(e,t,n)=>r=>(0,Vr.jsx)("button",{className:e.anchorButton,type:"button",value:t,onClick:n,children:r},t),yN=({className:e,loginUrl:t,isEmbedded:n,onSnooze:r,onLogIn:o})=>{let i=G(bh),s=zt(),a=A("Login",IC),l=j("productName"),u=(0,Xn.useCallback)(p=>{p.preventDefault(),r&&r(parseInt(p.target.value,10))},[]),c=(0,Xn.useCallback)(p=>{p.preventDefault(),s.send(Ki,!0)},[t]),f=(0,Xn.useMemo)(()=>p=>(0,Vr.jsx)("a",{onClick:h=>{h.preventDefault(),o()},href:t,className:a.anchor,target:"_blank",rel:"noreferrer",children:p},"login"),[t]),d=(0,Xn.useCallback)(p=>(0,Vr.jsx)("button",{type:"button",className:a.anchorButton,onClick:c,children:p},"prompt"),[c]),{min:m,hour:y,day:v}=(0,Xn.useMemo)(()=>({min:Th(a,60*10,u),hour:Th(a,60*60,u),day:Th(a,60*60*12,u)}),[]);return(0,Vr.jsxs)("div",{className:(0,OC.default)(e,a.root),children:[i("loginPlease",{login:n?d:f,productName:l}),r&&(0,Vr.jsxs)(Xn.Fragment,{children:[(0,Vr.jsx)("br",{}),i("snooze",{min:m,hour:y,day:v})]})]})},Nd=yN;var NC={root:"po",text:"fi"};var tl=w(b()),SN=({title:e})=>{let t=A("SearchTrigger",NC),n=Y();return(0,tl.jsxs)("button",{type:"button",className:t.root,onClick:()=>n(xt(!0)),children:[(0,tl.jsx)(qi,{}),(0,tl.jsx)("span",{className:t.text,children:e})]})},MC=SN;var kh={};Qe(kh,{enUS:()=>wN,nlNL:()=>xN});var wN={arrowHint:[{type:0,value:"Tip: use arrow keys to navigate suggestions"}],searchHintWindows:[{type:0,value:"Press CTRL+"},{type:1,value:"searchTriggerKey"},{type:0,value:" to search"}],searchHintMac:[{type:0,value:"Press CMD+"},{type:1,value:"searchTriggerKey"},{type:0,value:" to search"}],open:[{type:0,value:"Open "},{type:1,value:"productName"}],collapse:[{type:0,value:"Close"}],search:[{type:0,value:"Search"}]},xN={arrowHint:[{type:0,value:"Tip: Selecteer suggesties met pijltoetsen"}],searchHintWindows:[{type:0,value:"Druk CTRL+"},{type:1,value:"searchTriggerKey"},{type:0,value:" om te zoeken"}],searchHintMac:[{type:0,value:"Druk CMD+"},{type:1,value:"searchTriggerKey"},{type:0,value:" om te zoeken"}],open:[{type:0,value:"Open "},{type:1,value:"productName"}],collapse:[{type:0,value:"Sluiten"}],search:[{type:0,value:"Zoeken"}]};var _C={root:"gi",isInline:"q",toggleButton:"bi",toggleButtonWrapper:"C",toggleButtonWrapperHidden:"hi",isCollapsed:"do",collapsible:"mi",hints:"lo",hintsHidden:"ui",triggers:"so",triggersRight:"yi"};var Se=w(b()),CN=({textSuggestions:e,selectedIndex:t,onLogIn:n})=>{let r=A("SuggestionsOverlay",_C),o=G(kh),i=O(Ji),s=c1(),a=Y(),l=(0,ts.useRef)(null),u=j("searchTriggerKey"),c=j("productName"),f=O(Ad),d=O(tt),m=O(zi),[y,v]=(0,ts.useState)(null),p=j("showSearch"),g=j("showTextSuggestions"),h=j("adminUrl"),S=j("isEmbedded"),[x,T]=AC("dd-snooze-until-ms",0),C=f||x>Date.now(),k=O(_=>_.input.text),L=e.filter(_=>_.source!=="gpt").length,I=()=>{C&&T(0),a(wC(!C))},N=_=>{a(Ye({name:"suggestion feedback",data:{text:_.text,source:"overlay",context:k},options:{includeConversationData:!0}}))},V=_=>{let ee=Date.now()+_*1e3;T(ee),z.info(`Snooze until: ${new Date(ee)}`),a(zr({collapse:!0}))};return(0,ts.useEffect)(()=>{L===0&&v(null)},[e,L]),Zi(()=>{a(zr({collapse:!0,skipWhenInputFocus:!0}))}),d===null||m===!1?null:d===!1?(0,Se.jsxs)("div",{ref:l,className:(0,Md.default)(r.root,{[r.isCollapsed]:C}),children:[!C&&(0,Se.jsxs)("div",{className:r.triggers,children:[(0,Se.jsx)("div",{style:{flex:1}}),(0,Se.jsx)("div",{className:r.triggersRight,children:(0,Se.jsx)(ro,{className:r.toggleButton,title:o("collapse"),onClick:I,isCollapsed:!1})})]}),(0,Se.jsx)("div",{className:r.toggleButtonWrapper,children:(0,Se.jsx)(ro,{className:r.toggleButton,title:o("open",{productName:c}),onClick:I,isCollapsed:!0})}),(0,Se.jsx)("div",{className:r.collapsible,children:(0,Se.jsx)(Nd,{loginUrl:h,isEmbedded:S,onLogIn:n,onSnooze:V})})]}):!s||!i?null:(0,Se.jsxs)("div",{ref:l,className:(0,Md.default)(r.root,{[r.isCollapsed]:C}),children:[!C&&(0,Se.jsxs)("div",{className:r.triggers,children:[(0,Se.jsx)("div",{style:{flex:1},children:p&&(0,Se.jsx)("div",{style:{display:"inline-block"},onFocus:()=>{},onMouseOver:()=>v(o(LC()?"searchHintMac":"searchHintWindows",{searchTriggerKey:u.toUpperCase()})),onMouseLeave:()=>v(null),children:(0,Se.jsx)(MC,{title:o("search")})})}),(0,Se.jsxs)("div",{className:r.triggersRight,onFocus:()=>{},children:[(0,Se.jsx)("div",{className:(0,Md.default)(!y&&r.hintsHidden,r.hints),children:y}),(0,Se.jsx)(ro,{className:r.toggleButton,title:o("collapse"),onClick:I,isCollapsed:!1})]})]}),(0,Se.jsx)("div",{className:r.toggleButtonWrapper,children:(0,Se.jsx)(ro,{className:r.toggleButton,title:o("open",{productName:c}),onClick:I,isCollapsed:!0})}),L>0&&g&&(0,Se.jsx)("div",{className:r.collapsible,onFocus:()=>{},children:(0,Se.jsx)(ht,{children:(0,Se.jsx)(Id,{onFeedback:N,suggestions:e,selectedIndex:t,reverse:!0})})})]})},bN=({input:e})=>({selectedIndex:e.selectedSuggestionIndex,textSuggestions:e.textSuggestions}),DC=jn(bN)(CN);var Yd=w(te());var Jn=w(D());var ns=w(D());function _d(e){return e.contentEditable==="true"}function TN(e){let t=0,n=0,r=window.getSelection();if(r.rangeCount!==0){let o=r.getRangeAt(0),i=o.cloneRange();i.selectNodeContents(e),i.setEnd(o.endContainer,o.endOffset),n=i.toString().length,i.selectNodeContents(e),i.setEnd(o.startContainer,o.startOffset),t=i.toString().length}return{selectionStart:t,selectionEnd:n}}function FC(e){let{selectionStart:t,selectionEnd:n}=_d(e)?TN(e):e;return[t,n]}function HC(e){let[,t]=(0,ns.useState)(),n=(0,ns.useRef)(null);return n.current=FC(e),(0,ns.useEffect)(()=>{let r=()=>{let[o,i]=n.current??[],s=FC(e);(!s||o!==s[0]||i!==s[1])&&(n.current=s,t({}))};return e.addEventListener("keyup",r),e.addEventListener("click",r),e.addEventListener("focus",r),document.addEventListener("selectionchange",r),()=>{e.removeEventListener("keyup",r),e.removeEventListener("click",r),e.removeEventListener("focus",r),document.removeEventListener("selectionchange",r)}},[e]),n.current}function UC(e,t){if(!t)return;let n=e,{value:r}=n,[o,i]=t,s=r.match(Hl);if(!s||s.length===0)return;let a=0;s.find(l=>{let u=r.indexOf(l,a);return o>u&&i<u+l.length?(n.selectionStart=u,n.selectionEnd=u+l.length,!0):(a=u+l.length,!1)})}var BC=w(D()),kN=["div","span","mark","strong","b","i","u","em"];function Ph(e,t,n=0){var i;let r=e[e.length-1],o=typeof r=="object"&&r!==null?(i=r.props)==null?void 0:i.tagName:void 0;if(o==="br")return e.pop(),[...e,...t,r];if(kN.includes(o)){let s=Array.isArray(r.props.children)?r.props.children:[r.props.children];return[...e.slice(0,e.length-1),(0,BC.cloneElement)(r,{children:Ph(s,t,n+1)})]}return[...e,...t]}function Kr(e){return e.tagName.toLowerCase()==="textarea"}var cn={root:"wi",container:"vi",agentText:"co",tabText:"xo",hint:"S",matchSelection:"fo",focus:"ki",resetIndent:"zi",matchKeyword:"p",matchPlaceholder:"d",hover:"go",hintText:"ji",popover:"Yi",popoverRoot:"qi",popoverContentContainer:"bo",popoverContent:"Ci",selectionOptions:"Si",selectionOptionsIsHidden:"Ei",selectionOptionsButton:"Gi",caret:"Ni",popoverSuggestionsRoot:"Ai",suggestionsOverlayInputStyles:"Fi"};var XC=w(te());var Kd=w(D());var rs=w(D());function jC(e,t){let n;return[(...r)=>{window.cancelAnimationFrame(n);let o=t?t(...r):r;n=window.requestAnimationFrame(()=>{e(...o)})},()=>window.cancelAnimationFrame(n)]}function Dd(e){let t=(0,rs.useRef)(null),[n,r]=(0,rs.useState)(!1);return(0,rs.useEffect)(()=>{let o=!1,i=parseFloat(window.getComputedStyle(document.body).zoom??"1"),[s,a]=jC((c,f)=>{let d=t.current;if(!d)return;let m=c/i,y=f/i,v=d.getBoundingClientRect(),p=m>v.x&&m<v.x+v.width&&y>v.y&&y<v.y+v.height;p&&!o?(o=!0,r(!0)):!p&&o&&(o=!1,r(!1))},({clientX:c,clientY:f})=>[c,f]),[l,u]=jC(()=>{o=!1,r(!1)});return e.addEventListener("mousemove",s),e.addEventListener("mouseleave",l),()=>{a(),u(),e.removeEventListener("mousemove",s),e.removeEventListener("mouseleave",l)}},[t]),[t,n]}function zC(e){return e.replace(/[.*+^${}()|[\]\\]/g,"\\$&")}function Fd(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function VC(e){return e!=null}var Ah=w(te()),Kt=w(D());var Hd=w(D()),RN=["bottom","height","left","right","top","width"],AN=(e={},t={})=>RN.some(n=>e[n]!==t[n]),Qn=new Map,KC,$C=()=>{let e=[],t=[];Qn.forEach((n,r)=>{if(r instanceof Element&&!r.isConnected){t.push(r);return}let o=r.getBoundingClientRect();AN(o,n.rect)&&(n.rect=o,e.push(n))}),t.forEach(n=>{Qn.delete(n)}),e.forEach(n=>{n.callbacks.forEach(r=>r(n.rect))}),KC=window.requestAnimationFrame($C)};function LN(e,t){return{observe(){let n=Qn.size===0;if(Qn.has(e)){let r=Qn.get(e);r.callbacks.push(t),r.rect&&t(r.rect)}else Qn.set(e,{rect:void 0,hasRectChanged:!1,callbacks:[t]});n&&$C()},unobserve(){let n=Qn.get(e);if(n){let r=n.callbacks.indexOf(t);r>=0&&n.callbacks.splice(r,1),n.callbacks.length||Qn.delete(e),Qn.size||cancelAnimationFrame(KC)}}}}function Rh(e){let[t,n]=(0,Hd.useState)(null);return(0,Hd.useLayoutEffect)(()=>{if(!e.current)return;let r=LN(e.current,o=>{n(o)});return r.observe(),()=>{r.unobserve()}},[e]),t}var os=w(D()),qC=w(Qu());var WC={root:"Hi"};var GC=({children:e,parentNode:t})=>{let[n,r]=(0,os.useState)(null),o=(0,os.useContext)(hs);return(0,os.useLayoutEffect)(()=>{let i=document.createElement("div");return Fo(i),i.classList.add(WC.root),o!=null&&o.portalRootNode&&i.classList.add(o==null?void 0:o.portalRootNode),(t||document.body).appendChild(i),r(i),()=>{i.isConnected&&i.remove()}},[]),n?(0,qC.createPortal)(e,n):null};var bn={ref:"Li",root:"o",positionAbove:"l",positionBelow:"s",positionLeft:"c",positionRight:"x",alignStart:"f",alignCenter:"g",alignEnd:"b"};var Ud=w(b()),Bd=(e=!1)=>{let[t,n]=(0,Kt.useState)(e),r=(0,Kt.useCallback)(()=>n(!0),[]),o=(0,Kt.useCallback)(()=>n(!1),[]),i=(0,Kt.useCallback)(()=>n(a=>!a),[]),s=(0,Kt.useRef)(null);return{opened:t,open:r,close:o,toggle:i,triggerRef:s}};function Lh(e,t=null,n=0){if(!e)return{display:"none"};let r=t?e.top-t.top<0||e.top<t.top-n?t.top-n:e.top+e.height>t.top+t.height+n?t.top+t.height+n-e.height:e.top:e.top,o=t?e.left<t.left-n?t.left-n:e.left+e.width>t.left+t.width+n?t.left+t.width+n-e.width:e.left:e.left;return{top:r,left:o,height:e.height,width:e.width}}var is=({className:e,triggerRef:t,boundaryRef:n=(0,Kt.createRef)(),position:r="above",align:o="center",children:i,toStyle:s=Lh,parentNode:a,...l})=>{let u=Rh(t),c=Rh(n),f=(0,Kt.useMemo)(()=>s(u,c,0),[u,c]);return(0,Ud.jsx)(GC,{parentNode:a,children:(0,Ud.jsx)("div",{className:(0,Ah.default)(bn.ref,{[bn.positionAbove]:r==="above",[bn.positionBelow]:r==="below",[bn.positionLeft]:r==="left",[bn.positionRight]:r==="right",[bn.alignStart]:o==="start",[bn.alignCenter]:o==="center",[bn.alignEnd]:o==="end"}),style:f,...l,role:"dialog",children:(0,Ud.jsx)("div",{className:(0,Ah.default)(e,bn.root),children:i})})})};var YC=w(te()),jd=w(D());var Ih=w(b()),zd=(0,jd.forwardRef)(({className:e,children:t,...n},r)=>{let o=(0,jd.useRef)(null),i=A("TabCompletion",cn);return(0,Ih.jsx)("div",{ref:Fd([o,r]),className:(0,YC.default)(e,i.popoverContentContainer),...n,children:(0,Ih.jsx)("div",{className:i.popoverContent,children:t})})});var $r=w(b()),NN=e=>t=>{let n=Lh(t);return"top"in n&&(n.width=e.width-(t.left-e.left)-10),n},MN=({inputElement:e,boundaryRef:t,inputStyle:n,children:r,suggestion:o})=>{let i=A("TabCompletion",cn),s=Bd(),a=(0,Kd.useMemo)(()=>NN(e.getBoundingClientRect()),[e]),[l,u]=Dd(e);return(0,Kd.useEffect)(()=>{u?s.open():s.close()},[u]),(0,$r.jsxs)("span",{children:[(0,$r.jsx)("mark",{ref:Fd([l,s.triggerRef]),className:(0,XC.default)(i.matchKeyword,{[i.hover]:u}),"aria-haspopup":"dialog","aria-expanded":s.opened?"true":"false",children:r}),s.opened&&(0,$r.jsx)(is,{className:i.popover,triggerRef:s.triggerRef,boundaryRef:t,position:"below",align:"start",toStyle:a,children:(0,$r.jsx)(zd,{style:n,children:(0,$r.jsx)("div",{className:i.hintText,children:o})})})]})},Vd=class extends $n{keywordMatches=[];preparedKeywordMatches=[];usedKeywordMatches=new Set;onBeforeParse(t,n){return n.keywordMatches&&n.keywordMatches!==this.keywordMatches&&(this.preparedKeywordMatches=n.keywordMatches.map(r=>({...r,keywordRegex:new RegExp(`\\b${zC(r.keyword)}\\b`,"i")})),this.keywordMatches=n.keywordMatches),this.usedKeywordMatches.clear(),t}match(t){let n=this.preparedKeywordMatches.map(o=>{if(this.usedKeywordMatches.has(o))return null;let i=t.match(o.keywordRegex);if(!i)return null;let s=t.charAt(i.index-1),a=t.charAt(i.index+o.keyword.length);return s==="{"&&a==="}"?null:{index:i.index,length:i[0].length,match:i[0],matchString:i[0],suggestion:o.suggestion,preparedKeywordMatch:o,valid:!0}}).filter(VC);if(n.length===0)return null;let r=n.reduce((o,i)=>i.index<o.index?i:o);return this.usedKeywordMatches.add(r.preparedKeywordMatch),r}replaceWith(t,n){return(0,$r.jsx)(MN,{inputElement:n.inputElement,suggestion:n.suggestion,inputStyle:n.inputStyle,boundaryRef:n.boundaryRef,children:t},`keyword_${n.matchString}_${n.key}`)}asTag(){return"mark"}};var QC=w(te());var Oh=w(b()),_N=({inputElement:e,children:t})=>{let n=A("TabCompletion",cn),[r,o]=Dd(e);return(0,Oh.jsx)("mark",{ref:r,className:(0,QC.default)(n.matchPlaceholder,{[n.hover]:o}),children:t})},$d=class extends $n{match(t){let n=t.match(/(((\$!\{)|(\{))[a-zA-Z0-9_.]+\}(?!\}))/);return n?{index:n.index,length:n[0].length,match:n[0],matchString:n[0],valid:!0}:null}replaceWith(t,n){return(0,Oh.jsx)(_N,{inputElement:n.inputElement,children:t},`placeholder_${n.matchString}_${n.key}`)}asTag(){return"mark"}};var qd=w(te());var rt=w(D());var Nh=w(b()),ZC=()=>(0,Nh.jsx)("svg",{width:"1.3em",height:"1.3em",focusable:"false","aria-hidden":"true",viewBox:"0 0 24 24","data-testid":"InsertLinkIcon",tabIndex:-1,children:(0,Nh.jsx)("path",{fill:"currentColor",d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"})});var Wr=w(D());var eb=w(Jg());var JC={root:"Mi",content:"Ri"};function Wd(e,t,n){var o;let r=((o=e.imageSizes)==null?void 0:o[t])||e.image||n;if(!r)return null;try{return new URL(r).toString()}catch{return null}}function Mh(e){return e.replace("https://www.","").replace("https://","")}var $t=w(b()),FN=3,HN=e=>({image:e.image||"",text:e.text,id:e.id,title:e.title}),UN=({onSelectLink:e,onDismiss:t,placeholder:n,visitUrlText:r,linkCount:o=FN})=>{let i=A("LinkSearch",JC),[s,a]=(0,Wr.useState)(""),l=Y(),u=O(eC("url")),c=O(I1("URL",HN)),[f,d]=(0,Wr.useState)(c.length-1),m=j("fallbackImage"),y=h=>{let S=h.target;a(S.value)},v=(h,S)=>{h.stopPropagation(),h.preventDefault(),window.open(S,"_blank")},p=h=>{var T;let S=f-1<0?c.length-1:f-1,x=f+1===c.length?0:f+1;h.code==="Escape"&&(a(""),t()),h.code==="ArrowUp"&&d(S),h.code==="ArrowDown"&&d(x),h.code==="Enter"&&e(((T=c[f])==null?void 0:T.text)||s)},g=(0,Wr.useCallback)((0,eb.default)(h=>{l(Co({query:h,type:"URL",tags:["link-search"]}))},300),[]);return(0,Wr.useEffect)(()=>{s&&g(s)},[s]),(0,Wr.useEffect)(()=>()=>{l(qc())},[]),(0,$t.jsxs)("div",{className:i.root,children:[(0,$t.jsx)(ht,{withDivider:!0,children:(s?c:u).slice(0,o).map((h,S)=>(0,$t.jsx)(oe,{selected:f===S,onClick:()=>e(h.text),"data-testid":"linksearch-suggestion",children:(0,$t.jsxs)(fe,{children:[(0,$t.jsx)(fe.Image,{src:Wd(h,"small",m||void 0),title:h.title||h.text}),(0,$t.jsxs)(fe.Content,{className:i.content,cropText:!0,children:[(0,$t.jsx)(fe.Title,{children:h.title||Mh(h.text)}),h.title&&Mh(h.text)]}),(0,$t.jsx)(oe.Actions,{children:(0,$t.jsx)(oe.ActionButton,{label:r,onClick:x=>v(x,h.text)})})]})},h.text))}),(0,$t.jsx)(_a,{value:s,onChange:y,autoFocus:!0,placeholder:n,onKeyUp:p})]})},tb=UN;var _h={};Qe(_h,{enUS:()=>BN,nlNL:()=>jN});var BN={insertLink:[{type:0,value:"Insert link"}],linkInputPlaceholder:[{type:0,value:"Search, type or paste link"}],visitUrl:[{type:0,value:"Visit"}]},jN={insertLink:[{type:0,value:"Voeg link toe"}],linkInputPlaceholder:[{type:0,value:"Zoek, typ of plak link"}],visitUrl:[{type:0,value:"Bekijk"}]};var nt=w(b()),zN=(0,rt.forwardRef)((e,t)=>{let n=A("TabCompletion",cn);return(0,nt.jsx)("mark",{ref:t,className:(0,qd.default)(n.matchSelection)},"selection-start")}),VN=({startRef:e,boundaryRef:t,inputStyle:n,inputElement:r,children:o})=>{let i=G(_h),s=A("TabCompletion",cn),a=(0,rt.useRef)(null),l=(0,rt.useRef)(null),[u,c]=(0,rt.useState)(null),f=Y(),d=Bd(document.activeElement===r),[m]=(0,rt.useState)(()=>document.createRange());d.triggerRef.current=m,(0,rt.useEffect)(()=>()=>m.detach(),[]),(0,rt.useEffect)(()=>{let v=e.current,p=a.current;!v||!p||(m.setStart(v,0),m.setEnd(p,0))},[e.current,a.current]),Zi(()=>{d.close()});let y=(0,rt.useCallback)(v=>{let p=m.toString(),g=/^http(s?):\/\//.test(v)?v:`https://${v}`;f(zc({text:`[${p}](${g})`,replace:"selection"}))},[]);return(0,nt.jsxs)("span",{children:[(0,nt.jsx)("mark",{ref:a,className:(0,qd.default)(s.matchSelection),"aria-haspopup":"dialog","aria-expanded":d.opened?"true":"false",children:o}),d.opened&&(0,nt.jsx)(is,{className:s.popoverRoot,triggerRef:d.triggerRef,boundaryRef:t,position:"above",align:"start",children:(0,nt.jsxs)(zd,{style:n,ref:l,children:[(0,nt.jsx)("div",{className:(0,qd.default)(s.selectionOptions,{[s.selectionOptionsIsHidden]:u!==null}),children:(0,nt.jsxs)("button",{type:"button",tabIndex:u===null?-1:void 0,className:s.selectionOptionsButton,onClick:()=>c("insertLink"),children:[(0,nt.jsx)(ZC,{}),(0,nt.jsx)("span",{children:"\xA0"}),(0,nt.jsx)("span",{children:i("insertLink")})]})}),u==="insertLink"&&(0,nt.jsx)(tb,{placeholder:i("linkInputPlaceholder"),visitUrlText:i("visitUrl"),onSelectLink:y,onDismiss:()=>{c(null),d.close()}})]})})]},"selection-end")},Gd=class extends $n{charCount=0;foundIndex=0;startRef=null;props;onBeforeParse(t,n){return this.props=n,this.charCount=0,this.startRef=(0,rt.createRef)(),this.foundIndex=0,t}match(t){if(!this.props||this.props.selection===null||this.foundIndex===2)return null;let[n,r]=this.props.selection;if(n===r)return null;let o=this.foundIndex===0?n:r,i=o>=this.charCount&&o<=this.charCount+t.length?{index:o-this.charCount,length:0,match:"",valid:!0}:null;i&&this.foundIndex++;let s=this.foundIndex===1;return i&&s?this.charCount+=o-this.charCount:this.charCount+=t.length,i?{isStart:s,...i}:null}replaceWith(t,n){return n.isStart?(0,nt.jsx)(zN,{ref:this.startRef}):(0,nt.jsx)(VN,{inputElement:n.inputElement,startRef:this.startRef,boundaryRef:n.boundaryRef,inputStyle:n.inputStyle})}asTag(){return"mark"}};var Zn=w(b()),KN=({enabled:e,content:t,tabText:n,showTabHint:r,showTabCompletion:o,showStyleSuggestions:i,keywordMatches:s,inputElement:a,source:l})=>{let u=A("TabCompletion",cn),c=j("insertLink"),f=j("showMidSentenceSuggestions"),d=j("inlineSuggestions"),m=HC(a),y=(0,Jn.useRef)(null),v=O(tt);(0,Jn.useEffect)(()=>{Kr(a)&&m&&UC(a,m)},[m]);let p=(0,Jn.useCallback)(S=>{if(!o||!n)return S;let x=[(0,Zn.jsx)("span",{className:u.resetIndent,children:"\u200B"},"u200B"),(0,Zn.jsx)("span",{"data-testid":"tab-completion",className:(0,Yd.default)(u.tabText,u.resetIndent),"data-source":l,children:n},"tabText")];return r&&x.push((0,Zn.jsx)("span",{className:(0,Yd.default)(u.hint,u.resetIndent),children:(0,Zn.jsx)(Ml,{keyCode:"tab"},"tabHint")})),Ph(S,x)},[o,n,r]),g=(0,Jn.useMemo)(()=>{let S=[];return c&&S.push(new Gd("selection")),S.push(new $d("placeholders")),i&&S.push(new Vd("keywords")),S},[d,c,i]),h=(0,Jn.useMemo)(()=>{let S=window.getComputedStyle(a);return{"--dd-color":S.color,"--dd-font-size":S.fontSize,"--dd-font-family":S.fontFamily,"--dd-font-variant":S.fontVariant}},[]);return!e||!v?null:(0,Zn.jsxs)("div",{ref:S=>{S!=null&&S.parentElement&&(y.current=S==null?void 0:S.parentElement)},className:u.root,style:h,children:[(0,Zn.jsx)($i,{tagName:"span",containerTagName:"div",className:(0,Yd.default)(u.container,u.agentText),disableLineBreaks:Kr(a),content:t||"\u200B",onAfterParse:p,matchers:g,selection:m,keywordMatches:s,inputElement:a,inputStyle:h,boundaryRef:y,inlineSuggestionsOnlyAtEnd:!f}),(0,Zn.jsx)("br",{})]})},$N=({input:e,ui:t,settings:n,styleSuggestions:r,conversation:o})=>{var v;let{tabCompletionSuggestion:i}=e,s=(i==null?void 0:i.text)||"",a=(i==null?void 0:i.source)||"",l=e.html??Wi(e.text),u=s.indexOf(e.text)===0?s.slice(e.text.length):"",{showTabHint:c}=t,{isSupported:f}=o,{showTabCompletion:d,visible:m,showStyleSuggestions:y}=n;return{showTabHint:c,showStyleSuggestions:y,showTabCompletion:d,content:l,tabText:u,source:a,keywordMatches:((v=r.list)==null?void 0:v.keywordMatches)??[],enabled:m&&f!==!1}},nb=jn($N)(KN);var vT=w(te()),ST=w(D());var rb={list:[],fetchState:"idle",isInitialRequest:null},ib=e=>e.autoflows.list||[],ob=e=>t=>{var n;return(n=t.list)==null?void 0:n.find(r=>r.triggerPayload===e)},er=B("autoflows/getAll",async(e,t)=>{let{deepdeskBrokerAPI:n}=t.extra;if(!n)throw new Error("Deepdesk Broker not initialized");return n.getAutoflows(e)}),Dh=B("autoflows/start",async(e,t)=>{let{dispatch:n}=t,{deepdeskBrokerAPI:r}=t.extra;if(!r)throw new Error("Deepdesk Broker not initialized");await r.startAutoflowSession(e),await n(er(e.platformSessionId))}),Fh=B("autoflows/stop",async(e,t)=>{let{dispatch:n}=t,{deepdeskBrokerAPI:r}=t.extra;if(!r)throw new Error("Deepdesk Broker not initialized");await r.stopAutoflowSession(e.platformSessionId),await n(er(e.platformSessionId))}),WN=W({name:"autoflows",initialState:rb,reducers:{},extraReducers:e=>{e.addCase(Dh.pending,(t,n)=>{let r=ob(n.meta.arg.triggerPayload)(t);r.state="Started",r.isBusy=!0}),e.addCase(Fh.pending,(t,n)=>{let r=ob(n.meta.arg.triggerPayload)(t);r.state="Aborted",r.isBusy=!0}),e.addCase(er.pending,t=>{t.isInitialRequest=t.isInitialRequest===null,t.fetchState="loading"}),e.addCase(er.rejected,t=>{t.fetchState="error"}),e.addCase(er.fulfilled,(t,n)=>{t.list=n.payload,t.fetchState="done"}),e.addCase(le,()=>rb)}}),sb=B("autoflows/openStream",(e,t)=>{let{dispatch:n}=t,{deepdeskBrokerAPI:r}=t.extra;if(!r)throw new Error("Deepdesk Broker not initialized");let o=r.openStream(e);o.on("sessionAborted",()=>{n(er(e))}),o.on("sessionCompleted",()=>{n(er(e))})}),ab=B("autoflows/closeStream",(e,t)=>{let{deepdeskBrokerAPI:n}=t.extra;if(!n)throw new Error("Deepdesk Broker not initialized");n.closeStream(e)}),lb=WN.reducer;var ub={list:[],fetchState:"idle",isInitialRequest:null,sentSuggestions:[],errorSuggestions:[],answeredSuggestions:[]},cb=e=>e.customMessages.list,db=e=>t=>!!t.customMessages.sentSuggestions.find(n=>n===e),fb=e=>t=>!!t.customMessages.answeredSuggestions.find(n=>n===e),pb=e=>t=>!!t.customMessages.errorSuggestions.find(n=>n===e),nl=B("customMessages/getAll",async(e,t)=>{let{deepdeskBrokerAPI:n}=t.extra;if(!n)throw new Error("Deepdesk Broker not initialized");return n.getCustomMessages(e)}),Xd=B("customMessages/send",async(e,t)=>{let{platformSessionId:n,suggestion:r}=e,{deepdeskBrokerAPI:o}=t.extra;if(!o)throw new Error("Deepdesk Broker not initialized");await o.sendCustomMessage(n,r)}),Qd=B("customMessages/answer",async(e,t)=>{let{platformSessionId:n,reply:r}=e,{deepdeskBrokerAPI:o}=t.extra;if(!o)throw new Error("Deepdesk Broker not initialized");await o.answerCustomMessage(n,r)}),mb=W({name:"customMessages",initialState:ub,reducers:{onCustomMessage(e,t){Array.isArray(t.payload)?e.list=t.payload:e.list=[t.payload]}},extraReducers:e=>{e.addCase(nl.pending,t=>{t.isInitialRequest=t.isInitialRequest===null,t.fetchState="loading"}).addCase(nl.rejected,t=>{t.fetchState="error"}).addCase(nl.fulfilled,(t,n)=>{t.fetchState="done",t.list=n.payload||[]}).addCase(Xd.pending,(t,n)=>{t.sentSuggestions.push(n.meta.arg.suggestion.text),t.errorSuggestions=t.errorSuggestions.filter(r=>n.meta.arg.suggestion.text!==r)}).addCase(Xd.rejected,(t,n)=>{let r=t.sentSuggestions.indexOf(n.meta.arg.suggestion.text);t.errorSuggestions.push(...t.sentSuggestions.splice(r,1))}).addCase(Qd.pending,(t,n)=>{t.sentSuggestions.push(n.meta.arg.suggestion.text),t.answeredSuggestions.push(n.meta.arg.suggestion.text)}).addCase(Qd.rejected,(t,n)=>{let r=t.answeredSuggestions.indexOf(n.meta.arg.suggestion.text);t.errorSuggestions.push(...t.sentSuggestions.splice(r,1)),t.answeredSuggestions.splice(r,1)}).addCase(le,()=>ub)}}),gb=B("customMessages/openStream",(e,t)=>{let{dispatch:n}=t,{deepdeskBrokerAPI:r}=t.extra;if(!r)throw new Error("Deepdesk Broker not initialized");r.openStream(e).on("customMessageSuggestion",i=>{n(mb.actions.onCustomMessage(i))})}),hb=B("customMessages/closeStream",(e,t)=>{let{deepdeskBrokerAPI:n}=t.extra;if(!n)throw new Error("Deepdesk Broker not initialized");n.closeStream(e)}),yb=mb.reducer;var qN={token:null,accountUrl:null,interval:null},vb=e=>t=>{let{passwordlessToken:{token:n,accountUrl:r}}=t;return n&&r?`${r}/apis/admin/session/passwordless/login/?token=${n}&redirect=${e}`:null},Hh=B("passwordlessToken/getTemporaryPasswordlessToken",async(e,t)=>{let{deepdeskAPI:n}=t.extra,r=await n.requestPasswordlessToken();return{accountUrl:n.client.baseUrl,token:r}}),Uh=B("passwordlessToken/pollPasswordlessToken",(e={},t)=>{let{interval:n=1e3*60*10}=e,{dispatch:r}=t;return r(Hh()),setInterval(()=>r(Hh()),n)}),Sb=W({name:"passwordlessToken",initialState:qN,reducers:{stopPollPasswordlessToken(e){e.interval&&clearInterval(e.interval),e.interval=null}},extraReducers:e=>{e.addCase(Hh.fulfilled,(t,n)=>{t.token=n.payload.token,t.accountUrl=n.payload.accountUrl}),e.addCase(Uh.fulfilled,(t,n)=>{t.interval=n.payload})}}),{stopPollPasswordlessToken:wb}=Sb.actions,xb=Sb.reducer;var Bh={cues:[],fetchState:"idle"},Eb=e=>{var t;return(t=e.rules)==null?void 0:t.cues},GN=we("rules/resetCues"),Bo=B("rules/evaluate",async(e,t)=>{var n,r;try{let{deepdeskAPI:o}=t.extra,i=t.getState(),s=(n=i.conversation.current)==null?void 0:n.id;if(!s)throw new Error("No current conversation to evaluate rules");if(!(await o.getAccount()).ruleEngine)throw new Error("Rule engine is not enabled for this account");if(!(await o.getRules()).some(c=>c.label===e.label))throw new Error(`No rules found with label: ${e.label}`);return await o.evaluateRule(e.label,s,{tags:((r=i.conversation.current)==null?void 0:r.tags)||void 0,...e.params})}catch(o){return z.info(o.message),[]}}),Cb=W({name:"answer",initialState:Bh,reducers:{removeCue(e,t){e.cues=e.cues.filter(n=>n.rule.id!==t.payload.id)}},extraReducers:e=>{e.addCase(Bo.pending,t=>{t.fetchState="loading"}).addCase(Bo.rejected,t=>{t.fetchState="error"}).addCase(Bo.fulfilled,(t,n)=>{let r=n.payload.map(i=>i.rule.id),o=t.cues.filter(i=>!r.includes(i.rule.id));t.fetchState="done",t.cues=[...n.payload,...o]}).addCase(le,()=>Bh).addCase(GN.toString(),()=>Bh)}}),{removeCue:bb}=Cb.actions,Tb=Cb.reducer;function kb(e){let{customMessages:t,autoflows:n}=e;return n.fetchState==="loading"&&n.isInitialRequest===!0||t.fetchState==="loading"&&t.isInitialRequest===!0}var _b=w(D());var Ob=w(te()),Nb=w(D());var Rb=w(te());var Pb={root:"Ti"};var Lb=w(b()),XN=({className:e,children:t})=>{let n=A("Unicode",Pb);return(0,Lb.jsx)("span",{className:(0,Rb.default)(e,n.root),children:t})},Ab=XN;var Ib={isDisabled:"Ui",buttonStart:"Bi",root:"Di",buttonStop:"ho",stateBadge:"h",isCompleted:"Ii",isStarted:"Oi",isAborted:"Xi"};var jh={};Qe(jh,{enUS:()=>ZN,nlNL:()=>JN});var ZN={start:[{type:0,value:"Start"}],stop:[{type:0,value:"Stop"}],aborted:[{type:0,value:"Stopped"}],completed:[{type:0,value:"Completed"}],Aborted:[{type:0,value:"Stopped"}],Started:[{type:0,value:"Running"}],Completed:[{type:0,value:"Completed"}]},JN={start:[{type:0,value:"Start"}],stop:[{type:0,value:"Stop"}],aborted:[{type:0,value:"Stopped"}],completed:[{type:0,value:"Completed"}],Aborted:[{type:0,value:"Stopped"}],Started:[{type:0,value:"Running"}],Completed:[{type:0,value:"Completed"}]};var Tt=w(b()),tM=({disabled:e,state:t,displayName:n,description:r,onStartAutoflow:o,onStopAutoflow:i})=>{let s=A("Autoflow",Ib),a=G(jh),l=t==="Started"?"stop":"start",u=l==="start"?"\u25B6":l==="stop"?"\u25FC":"";return(0,Tt.jsxs)(oe,{className:(0,Ob.default)(s.root,{[s.isDisabled]:e,[s.isCompleted]:t==="Completed",[s.isAborted]:t==="Aborted",[s.isStarted]:t==="Started"}),children:[(0,Tt.jsx)(fe,{children:(0,Tt.jsxs)(fe.Content,{children:[(0,Tt.jsxs)(fe.Title,{children:[t&&(0,Tt.jsx)("span",{className:s.stateBadge,children:a(t)}),n]}),(0,Tt.jsx)("span",{children:r})]})}),(0,Tt.jsx)(oe.Actions,{fixed:t==="Started",children:(0,Tt.jsx)(oe.ActionButton,{primary:!0,className:l==="start"?s.buttonStart:s.buttonStop,onClick:t==="Started"?i:o,disabled:e,label:(0,Tt.jsxs)(Nb.Fragment,{children:[(0,Tt.jsx)(Ab,{children:u})," ",(0,Tt.jsx)("span",{children:a(l)})]})})})]})},Mb=tM;var zh=w(b()),nM=(e,t)=>{let n=t.filter(r=>r.state==="Started");return n.length>0?n.indexOf(e)===-1:!1},rM=({autoflows:e,onStartAutoflow:t,onStopAutoflow:n,platformSessionId:r})=>(0,zh.jsx)(_b.Fragment,{children:e.map(o=>(0,zh.jsx)(Mb,{displayName:o.displayName,description:o.description,disabled:o.isBusy||nM(o,e),state:o.state,onStartAutoflow:()=>t({platformSessionId:r,triggerPayload:o.triggerPayload}),onStopAutoflow:()=>n({platformSessionId:r,triggerPayload:o.triggerPayload})},o.displayName))}),oM=({autoflows:e,conversation:t})=>{var n;return{autoflows:e.list,platformSessionId:(n=t.current)==null?void 0:n.sessionId}},iM={onStartAutoflow:Dh,onStopAutoflow:Fh},Db=jn(oM,iM)(rM);var Fb=w(te()),Vh=w(D());var tr={root:"mo",title:"uo",isUsed:"Ji",quickReplies:"Ki",quickReply:"Pi",hasError:"Qi",label:"Vi",errorIcon:"Wi"};var gt=w(b()),aM=({suggestion:e})=>{let t=G(No),n=Y(),r=O(db(e.text)),o=O(fb(e.text)),i=O(pb(e.text)),s=O(_c),{replyOptions:a}=e,l=(0,Vh.useCallback)(c=>{c.preventDefault(),c.stopPropagation(),!(r||!s)&&n(Xd({platformSessionId:s,suggestion:e}))},[e,r,n,s]),u=(0,Vh.useCallback)(c=>{if(c.preventDefault(),c.stopPropagation(),!s||!a)return;let f=parseInt(c.target.dataset.index,10),d=a[f];n(Qd({platformSessionId:s,reply:d,suggestion:e}))},[e,r,n,s]);return(0,gt.jsxs)(oe,{onClick:l,className:(0,Fb.default)(tr.root,{[tr.isUsed]:r,[tr.hasError]:i}),children:[(0,gt.jsx)(fe,{children:(0,gt.jsxs)(fe.Content,{children:[(0,gt.jsxs)(fe.Title,{className:tr.title,children:[e.text," ",(0,gt.jsx)(_l,{className:tr.label,children:"analyse tool"})," ",i&&(0,gt.jsx)("span",{className:tr.errorIcon,role:"img","aria-label":t("sendingError"),title:t("sendingError"),children:"!"})]}),a&&a.length>0&&(0,gt.jsx)("ul",{className:tr.quickReplies,children:a.map(c=>(0,gt.jsx)("li",{className:tr.quickReply,children:c.title},c.title))})]})}),(0,gt.jsxs)(oe.Actions,{fixed:i||r,children:[a&&a.length>0&&(0,gt.jsx)(oe.DropdownButton,{label:t("answer"),disabled:o,children:a.map((c,f)=>(0,gt.jsx)(oe.DropdownItem,{index:f,label:c.title,onClick:u},c.title))}),(0,gt.jsx)(oe.ActionButton,{primary:!0,disabled:r,onClick:l,label:t(r?"suggestionSent":i?"tryAgain":"sendSuggestion")})]})]})},Hb=aM;var Zd=w(D());var Wh=w(te());var Kh=w(b()),$h=()=>(0,Kh.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",children:(0,Kh.jsx)("path",{d:"M502.6 70.63l-61.25-61.25C435.4 3.371 427.2 0 418.7 0H255.1c-35.35 0-64 28.66-64 64l.0195 256C192 355.4 220.7 384 256 384h192c35.2 0 64-28.8 64-64V93.25C512 84.77 508.6 76.63 502.6 70.63zM464 320c0 8.836-7.164 16-16 16H255.1c-8.838 0-16-7.164-16-16L239.1 64.13c0-8.836 7.164-16 16-16h128L384 96c0 17.67 14.33 32 32 32h47.1V320zM272 448c0 8.836-7.164 16-16 16H63.1c-8.838 0-16-7.164-16-16L47.98 192.1c0-8.836 7.164-16 16-16H160V128H63.99c-35.35 0-64 28.65-64 64l.0098 256C.002 483.3 28.66 512 64 512h192c35.2 0 64-28.8 64-64v-32h-47.1L272 448z"})});var Ub={root:"Zi",entity:"r",entityText:"_i",iconWrapper:"or",icon:"er",iconClicked:"ir"};var Tn=w(b()),uM=({entities:e})=>{let t=A("EntitiesWidgetList",Ub),[n,r]=(0,Zd.useState)(void 0),o=Y(),i=()=>{r(void 0)},s=a=>{e&&(r(e.indexOf(a)),ko(a.text),o(Ye({name:"entity copied",data:{entity:a,type:"copy"}})))};return(0,Zd.useEffect)(()=>{let a=setTimeout(i,500);return()=>{clearTimeout(a)}},[n]),!e||e.length===0?null:(0,Tn.jsx)("div",{className:t.root,"data-testid":"widget-entities-list",children:e.map((a,l)=>(0,Tn.jsxs)("button",{title:a.text,className:t.entity,type:"button",onClick:()=>s(a),children:[(0,Tn.jsx)("span",{className:t.entityText,children:a.text}),(0,Tn.jsxs)("span",{className:t.iconWrapper,children:[(0,Tn.jsx)("span",{className:(0,Wh.default)(t.icon),children:(0,Tn.jsx)($h,{})}),(0,Tn.jsx)("span",{className:(0,Wh.default)(t.icon,n===l&&t.iconClicked),children:(0,Tn.jsx)($h,{})})]})]},a.text))})},Bb=uM;var qh=w(b()),jb=()=>(0,qh.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,qh.jsx)("path",{d:"M17 13.5v6H5v-12h6m3-3h6v6m0-6-9 9",stroke:"currentColor",strokeWidth:"1.5",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"})});var Gh=w(b()),zb=()=>(0,Gh.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 -960 960 960",width:"1em",children:(0,Gh.jsx)("path",{d:"M543-340q16.595 0 28.798-12.202Q584-364.405 584-381t-12.202-28.798Q559.595-422 543-422t-28.798 12.202Q502-397.595 502-381t12.202 28.798Q526.405-340 543-340Zm-25-126h47q2-29 8.5-43t32.5-39q27-26 37.5-45.395Q654-612.79 654-639q0-45.882-31.5-74.941Q591-743 540-743q-38 0-68 20.5T428-665l45 19q11-25 27.5-38t39.5-13q29.778 0 48.389 17Q607-663 607-637q0 20-9 35t-32 32q-32 29-40 46.5t-8 57.5ZM260-200q-24 0-42-18t-18-42v-560q0-24 18-42t42-18h560q24 0 42 18t18 42v560q0 24-18 42t-42 18H260Zm0-60h560v-560H260v560ZM140-80q-24 0-42-18t-18-42v-620h60v620h620v60H140Zm120-740v560-560Z"})});var Yh=w(b()),Vb=()=>(0,Yh.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 -960 960 960",width:"1em",children:(0,Yh.jsx)("path",{d:"M319-250h322v-60H319v60Zm0-170h322v-60H319v60ZM220-80q-24 0-42-18t-18-42v-680q0-24 18-42t42-18h361l219 219v521q0 24-18 42t-42 18H220Zm331-554v-186H220v680h520v-494H551ZM220-820v186-186 680-680Z"})});function Kb(e){return B("analytics/logEvent",(t,n)=>{var i,s,a;let r=(s=(i=n.getState())==null?void 0:i.conversation.current)==null?void 0:s.id,o=(a=n.getState())==null?void 0:a.info.agentInfo;return n.extra.deepdeskAPI.sendEvent(t.name,{conversationId:r,...o,data:t.data})})(e)}function Jd(){let e=Y();return async(t,n)=>{await e(Kb({name:t,data:n}))}}var ay=w(te()),of=w(D());var rl=w(b()),$b=({className:e})=>(0,rl.jsxs)("svg",{viewBox:"0 0 12 12",version:"1.1",xmlns:"http://www.w3.org/2000/svg",className:e,children:[(0,rl.jsx)("line",{x1:"2",y1:"10",x2:"10",y2:"2",stroke:"black",strokeWidth:"1"}),(0,rl.jsx)("line",{x1:"2",y1:"2",x2:"10",y2:"10",stroke:"black",strokeWidth:"1"})]});var Xh=w(b()),Wb=e=>(0,Xh.jsx)("svg",{width:"16",height:"16",fill:"#000000",...e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Xh.jsx)("path",{fillRule:"evenodd",d:"M6.57086468,14.9173453 C6.38997052,14.9711236 6.19835748,15 6,15 L4,15 C2.8954305,15 2,14.1045695 2,13 L2,4 C2,2.8954305 2.8954305,2 4,2 L6,2 C6.68685475,2 7.29284112,2.34623869 7.65294381,2.87370078 C7.95642355,2.67736738 8.29504785,2.51351337 8.66312366,2.3818197 C9.50544052,2.08044754 10.3408482,1.9879107 10.9989281,1.99971266 C11.0150698,2.00005426 13.3487605,2.00015005 18,2 C20.7551411,2 22,6.05643086 22,12 C22,13.6824804 20.8695981,15 19,15 L15.9269768,15 C15.9359266,15.0245465 15.9451954,15.0497804 15.9547911,15.0757271 C16.007193,15.2174219 16.2391583,15.8256341 16.2970775,15.9810953 C16.4872151,16.4914441 16.6259612,16.9026411 16.7382242,17.3098712 C16.9079007,17.9253665 17,18.4798886 17,19 C17,20.4720069 16.091867,21.3862822 14.748281,21.777514 C14.1422801,21.9539723 13.6147967,22.0000922 13.0076976,22.0000008 L12.5204954,22 L12.2202699,21.6261158 C11.2556275,20.4248034 7.64562469,16.4822788 6.57086468,14.9173453 Z M8,13 C8,13.2401953 8.04443154,13.4528921 8.14171093,13.6800176 C8.40663864,14.2985643 11.914268,18.1371493 13.4599624,19.9848695 C13.7113931,19.9660111 13.9483736,19.9273712 14.1891338,19.8572655 C14.7621788,19.6904035 15,19.4509737 15,19 C15,18.6834183 14.9359344,18.2976852 14.8101464,17.8413935 C14.7161494,17.500423 14.5944107,17.1396301 14.4229225,16.6793379 C14.3689242,16.5344009 14.1358033,15.923159 14.0789589,15.7694517 C13.9489218,15.4178313 13.8632547,15.1589343 13.8046536,14.9236885 C13.5555377,13.9236468 13.8054549,13 15,13 L19,13 C19.6912225,13 20,12.6401099 20,12 C20,7.20925475 19.015127,4 18,4 C15.9322103,4 15.9322103,4 10.9655994,3.99940813 C10.5253746,3.99154158 9.91062406,4.05963657 9.33687634,4.2649175 C8.45196659,4.58152894 8,5.09776992 8,6 L8,13 Z M4,4 L4,13 L6,13 L6,4 L4,4 Z"})});var Qh=w(b()),qb=e=>(0,Qh.jsx)("svg",{width:"16",height:"16",fill:"#000000",...e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Qh.jsx)("path",{fillRule:"evenodd",d:"M7.65336736,21.1256786 C7.2933164,21.6534897 6.68712411,22 6,22 L4,22 C2.8954305,22 2,21.1045695 2,20 L2,11 C2,9.8954305 2.8954305,9 4,9 L6,9 C6.198171,9 6.38961023,9.02882212 6.57035446,9.08250314 C7.6444817,7.51807482 11.2554748,3.57449216 12.2202699,2.37298955 L12.5204954,1.99910538 L13,1.99910538 C13.6147967,1.99901314 14.1422801,2.04513312 14.748281,2.22159137 C16.091867,2.61282321 17,3.52709845 17,4.99910538 C17,5.51921677 16.9079007,6.07373891 16.7382242,6.68923415 C16.6259612,7.09646424 16.4872151,7.50766133 16.2970775,8.01801005 C16.2391583,8.17347129 16.007193,8.78168345 15.9547911,8.92337824 C15.9451954,8.94932503 15.9359266,8.9745589 15.9269768,8.99910538 L19,8.99910538 C20.8695981,8.99910538 22,10.316625 22,11.9991054 C22,17.9426745 20.7551411,21.9991054 18,21.9991054 L11.0344006,21.9985135 C10.3408482,22.0111947 9.50544052,21.9186578 8.66312366,21.6172857 C8.29521907,21.4856533 7.9567386,21.3218904 7.65336736,21.1256786 Z M8,17.9991054 C8,18.9013355 8.45196659,19.4175764 9.33687634,19.7341879 C9.91062406,19.9394688 10.5253746,20.0075638 10.963066,19.9997143 C10.9703499,19.9995545 10.9703499,19.9995545 11,19.9991054 L18,19.9991054 C19.015127,19.9991054 20,16.7898506 20,11.9991054 C20,11.3589955 19.6912225,10.9991054 19,10.9991054 L15,10.9991054 C13.8054549,10.9991054 13.5555377,10.0754586 13.8046536,9.07541689 C13.8632547,8.84017106 13.9489218,8.5812741 14.0789589,8.22965366 C14.1358033,8.07594642 14.3689242,7.46470447 14.4229225,7.31976744 C14.5944107,6.85947528 14.7161494,6.4986824 14.8101464,6.1577119 C14.9359344,5.70142019 15,5.31568707 15,4.99910538 C15,4.54813166 14.7621788,4.30870189 14.1891338,4.1418399 C13.9483736,4.07173418 13.7113931,4.0330943 13.4599624,4.01423587 C11.914268,5.86195611 8.40663864,9.70054105 8.14171093,10.3190878 C8.04443154,10.5462133 8,10.7589101 8,10.9991054 L8,17.9991054 Z M4,11 L4,20 L6,20 L6,11 L4,11 Z"})});function ss(e,t){var r;let n=e.cloneNode(!0);n.style.top=`${e.offsetTop}px`,n.style.left=`${e.offsetLeft}px`,n.style.position="absolute",n.classList.add(t),n.addEventListener("animationend",()=>n.remove()),(r=e.parentElement)==null||r.appendChild(n)}var{entries:tT,setPrototypeOf:Gb,isFrozen:cM,getPrototypeOf:dM,getOwnPropertyDescriptor:fM}=Object,{freeze:ot,seal:fn,create:nT}=Object,{apply:ry,construct:oy}=typeof Reflect<"u"&&Reflect;ot||(ot=function(t){return t});fn||(fn=function(t){return t});ry||(ry=function(t,n,r){return t.apply(n,r)});oy||(oy=function(t,n){return new t(...n)});var ef=Pt(Array.prototype.forEach),Yb=Pt(Array.prototype.pop),ol=Pt(Array.prototype.push),rf=Pt(String.prototype.toLowerCase),Zh=Pt(String.prototype.toString),pM=Pt(String.prototype.match),il=Pt(String.prototype.replace),mM=Pt(String.prototype.indexOf),gM=Pt(String.prototype.trim),dn=Pt(Object.prototype.hasOwnProperty),kt=Pt(RegExp.prototype.test),sl=hM(TypeError);function Pt(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return ry(e,t,r)}}function hM(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return oy(e,n)}}function X(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:rf;Gb&&Gb(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){let i=n(o);i!==o&&(cM(t)||(t[r]=i),o=i)}e[o]=!0}return e}function yM(e){for(let t=0;t<e.length;t++)dn(e,t)||(e[t]=null);return e}function jo(e){let t=nT(null);for(let[n,r]of tT(e))dn(e,n)&&(Array.isArray(r)?t[n]=yM(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=jo(r):t[n]=r);return t}function tf(e,t){for(;e!==null;){let r=fM(e,t);if(r){if(r.get)return Pt(r.get);if(typeof r.value=="function")return Pt(r.value)}e=dM(e)}function n(){return null}return n}var Xb=ot(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Jh=ot(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ey=ot(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),vM=ot(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ty=ot(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),SM=ot(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Qb=ot(["#text"]),Zb=ot(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),ny=ot(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Jb=ot(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),nf=ot(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),wM=fn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),xM=fn(/<%[\w\W]*|[\w\W]*%>/gm),EM=fn(/\${[\w\W]*}/gm),CM=fn(/^data-[\-\w.\u00B7-\uFFFF]/),bM=fn(/^aria-[\-\w]+$/),rT=fn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),TM=fn(/^(?:\w+script|data):/i),kM=fn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),oT=fn(/^html$/i),eT=Object.freeze({__proto__:null,MUSTACHE_EXPR:wM,ERB_EXPR:xM,TMPLIT_EXPR:EM,DATA_ATTR:CM,ARIA_ATTR:bM,IS_ALLOWED_URI:rT,IS_SCRIPT_OR_DATA:TM,ATTR_WHITESPACE:kM,DOCTYPE_NAME:oT}),PM=function(){return typeof window>"u"?null:window},RM=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null,o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(r=n.getAttribute(o));let i="dompurify"+(r?"#"+r:"");try{return t.createPolicy(i,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function iT(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:PM(),t=U=>iT(U);if(t.version="3.0.9",t.removed=[],!e||!e.document||e.document.nodeType!==9)return t.isSupported=!1,t;let{document:n}=e,r=n,o=r.currentScript,{DocumentFragment:i,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:u,NamedNodeMap:c=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:d,trustedTypes:m}=e,y=l.prototype,v=tf(y,"cloneNode"),p=tf(y,"nextSibling"),g=tf(y,"childNodes"),h=tf(y,"parentNode");if(typeof s=="function"){let U=n.createElement("template");U.content&&U.content.ownerDocument&&(n=U.content.ownerDocument)}let S,x="",{implementation:T,createNodeIterator:C,createDocumentFragment:k,getElementsByTagName:L}=n,{importNode:I}=r,N={};t.isSupported=typeof tT=="function"&&typeof h=="function"&&T&&T.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:V,ERB_EXPR:_,TMPLIT_EXPR:ee,DATA_ATTR:Yr,ARIA_ATTR:it,IS_SCRIPT_OR_DATA:Gt,ATTR_WHITESPACE:At}=eT,{IS_ALLOWED_URI:H}=eT,q=null,ir=X({},[...Xb,...Jh,...ey,...ty,...Qb]),he=null,sr=X({},[...Zb,...ny,...Jb,...nf]),$=Object.seal(nT(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ar=null,vl=null,$o=!0,Xr=!0,ds=!1,Sl=!0,Yt=!1,Xt=!1,wl=!1,st=!1,Lt=!1,xl=!1,El=!1,xy=!0,Ey=!1,lk="user-content-",hf=!0,fs=!1,Wo={},qo=null,Cy=X({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),by=null,Ty=X({},["audio","video","img","source","image","track"]),yf=null,ky=X({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Cl="http://www.w3.org/1998/Math/MathML",bl="http://www.w3.org/2000/svg",Rn="http://www.w3.org/1999/xhtml",Go=Rn,vf=!1,Sf=null,uk=X({},[Cl,bl,Rn],Zh),ps=null,ck=["application/xhtml+xml","text/html"],dk="text/html",Oe=null,Yo=null,fk=n.createElement("form"),Py=function(E){return E instanceof RegExp||E instanceof Function},wf=function(){let E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Yo&&Yo===E)){if((!E||typeof E!="object")&&(E={}),E=jo(E),ps=ck.indexOf(E.PARSER_MEDIA_TYPE)===-1?dk:E.PARSER_MEDIA_TYPE,Oe=ps==="application/xhtml+xml"?Zh:rf,q=dn(E,"ALLOWED_TAGS")?X({},E.ALLOWED_TAGS,Oe):ir,he=dn(E,"ALLOWED_ATTR")?X({},E.ALLOWED_ATTR,Oe):sr,Sf=dn(E,"ALLOWED_NAMESPACES")?X({},E.ALLOWED_NAMESPACES,Zh):uk,yf=dn(E,"ADD_URI_SAFE_ATTR")?X(jo(ky),E.ADD_URI_SAFE_ATTR,Oe):ky,by=dn(E,"ADD_DATA_URI_TAGS")?X(jo(Ty),E.ADD_DATA_URI_TAGS,Oe):Ty,qo=dn(E,"FORBID_CONTENTS")?X({},E.FORBID_CONTENTS,Oe):Cy,ar=dn(E,"FORBID_TAGS")?X({},E.FORBID_TAGS,Oe):{},vl=dn(E,"FORBID_ATTR")?X({},E.FORBID_ATTR,Oe):{},Wo=dn(E,"USE_PROFILES")?E.USE_PROFILES:!1,$o=E.ALLOW_ARIA_ATTR!==!1,Xr=E.ALLOW_DATA_ATTR!==!1,ds=E.ALLOW_UNKNOWN_PROTOCOLS||!1,Sl=E.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Yt=E.SAFE_FOR_TEMPLATES||!1,Xt=E.WHOLE_DOCUMENT||!1,Lt=E.RETURN_DOM||!1,xl=E.RETURN_DOM_FRAGMENT||!1,El=E.RETURN_TRUSTED_TYPE||!1,st=E.FORCE_BODY||!1,xy=E.SANITIZE_DOM!==!1,Ey=E.SANITIZE_NAMED_PROPS||!1,hf=E.KEEP_CONTENT!==!1,fs=E.IN_PLACE||!1,H=E.ALLOWED_URI_REGEXP||rT,Go=E.NAMESPACE||Rn,$=E.CUSTOM_ELEMENT_HANDLING||{},E.CUSTOM_ELEMENT_HANDLING&&Py(E.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&($.tagNameCheck=E.CUSTOM_ELEMENT_HANDLING.tagNameCheck),E.CUSTOM_ELEMENT_HANDLING&&Py(E.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&($.attributeNameCheck=E.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),E.CUSTOM_ELEMENT_HANDLING&&typeof E.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&($.allowCustomizedBuiltInElements=E.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Yt&&(Xr=!1),xl&&(Lt=!0),Wo&&(q=X({},Qb),he=[],Wo.html===!0&&(X(q,Xb),X(he,Zb)),Wo.svg===!0&&(X(q,Jh),X(he,ny),X(he,nf)),Wo.svgFilters===!0&&(X(q,ey),X(he,ny),X(he,nf)),Wo.mathMl===!0&&(X(q,ty),X(he,Jb),X(he,nf))),E.ADD_TAGS&&(q===ir&&(q=jo(q)),X(q,E.ADD_TAGS,Oe)),E.ADD_ATTR&&(he===sr&&(he=jo(he)),X(he,E.ADD_ATTR,Oe)),E.ADD_URI_SAFE_ATTR&&X(yf,E.ADD_URI_SAFE_ATTR,Oe),E.FORBID_CONTENTS&&(qo===Cy&&(qo=jo(qo)),X(qo,E.FORBID_CONTENTS,Oe)),hf&&(q["#text"]=!0),Xt&&X(q,["html","head","body"]),q.table&&(X(q,["tbody"]),delete ar.tbody),E.TRUSTED_TYPES_POLICY){if(typeof E.TRUSTED_TYPES_POLICY.createHTML!="function")throw sl('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof E.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw sl('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=E.TRUSTED_TYPES_POLICY,x=S.createHTML("")}else S===void 0&&(S=RM(m,o)),S!==null&&typeof x=="string"&&(x=S.createHTML(""));ot&&ot(E),Yo=E}},Ry=X({},["mi","mo","mn","ms","mtext"]),Ay=X({},["foreignobject","desc","title","annotation-xml"]),pk=X({},["title","style","font","a","script"]),Ly=X({},[...Jh,...ey,...vM]),Iy=X({},[...ty,...SM]),mk=function(E){let R=h(E);(!R||!R.tagName)&&(R={namespaceURI:Go,tagName:"template"});let F=rf(E.tagName),ce=rf(R.tagName);return Sf[E.namespaceURI]?E.namespaceURI===bl?R.namespaceURI===Rn?F==="svg":R.namespaceURI===Cl?F==="svg"&&(ce==="annotation-xml"||Ry[ce]):!!Ly[F]:E.namespaceURI===Cl?R.namespaceURI===Rn?F==="math":R.namespaceURI===bl?F==="math"&&Ay[ce]:!!Iy[F]:E.namespaceURI===Rn?R.namespaceURI===bl&&!Ay[ce]||R.namespaceURI===Cl&&!Ry[ce]?!1:!Iy[F]&&(pk[F]||!Ly[F]):!!(ps==="application/xhtml+xml"&&Sf[E.namespaceURI]):!1},Qr=function(E){ol(t.removed,{element:E});try{E.parentNode.removeChild(E)}catch{E.remove()}},xf=function(E,R){try{ol(t.removed,{attribute:R.getAttributeNode(E),from:R})}catch{ol(t.removed,{attribute:null,from:R})}if(R.removeAttribute(E),E==="is"&&!he[E])if(Lt||xl)try{Qr(R)}catch{}else try{R.setAttribute(E,"")}catch{}},Oy=function(E){let R=null,F=null;if(st)E="<remove></remove>"+E;else{let je=pM(E,/^[\r\n\t ]+/);F=je&&je[0]}ps==="application/xhtml+xml"&&Go===Rn&&(E='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+E+"</body></html>");let ce=S?S.createHTML(E):E;if(Go===Rn)try{R=new d().parseFromString(ce,ps)}catch{}if(!R||!R.documentElement){R=T.createDocument(Go,"template",null);try{R.documentElement.innerHTML=vf?x:ce}catch{}}let Be=R.body||R.documentElement;return E&&F&&Be.insertBefore(n.createTextNode(F),Be.childNodes[0]||null),Go===Rn?L.call(R,Xt?"html":"body")[0]:Xt?R.documentElement:Be},Ny=function(E){return C.call(E.ownerDocument||E,E,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null)},gk=function(E){return E instanceof f&&(typeof E.nodeName!="string"||typeof E.textContent!="string"||typeof E.removeChild!="function"||!(E.attributes instanceof c)||typeof E.removeAttribute!="function"||typeof E.setAttribute!="function"||typeof E.namespaceURI!="string"||typeof E.insertBefore!="function"||typeof E.hasChildNodes!="function")},My=function(E){return typeof a=="function"&&E instanceof a},An=function(E,R,F){N[E]&&ef(N[E],ce=>{ce.call(t,R,F,Yo)})},_y=function(E){let R=null;if(An("beforeSanitizeElements",E,null),gk(E))return Qr(E),!0;let F=Oe(E.nodeName);if(An("uponSanitizeElement",E,{tagName:F,allowedTags:q}),E.hasChildNodes()&&!My(E.firstElementChild)&&kt(/<[/\w]/g,E.innerHTML)&&kt(/<[/\w]/g,E.textContent))return Qr(E),!0;if(!q[F]||ar[F]){if(!ar[F]&&Fy(F)&&($.tagNameCheck instanceof RegExp&&kt($.tagNameCheck,F)||$.tagNameCheck instanceof Function&&$.tagNameCheck(F)))return!1;if(hf&&!qo[F]){let ce=h(E)||E.parentNode,Be=g(E)||E.childNodes;if(Be&&ce){let je=Be.length;for(let at=je-1;at>=0;--at)ce.insertBefore(v(Be[at],!0),p(E))}}return Qr(E),!0}return E instanceof l&&!mk(E)||(F==="noscript"||F==="noembed"||F==="noframes")&&kt(/<\/no(script|embed|frames)/i,E.innerHTML)?(Qr(E),!0):(Yt&&E.nodeType===3&&(R=E.textContent,ef([V,_,ee],ce=>{R=il(R,ce," ")}),E.textContent!==R&&(ol(t.removed,{element:E.cloneNode()}),E.textContent=R)),An("afterSanitizeElements",E,null),!1)},Dy=function(E,R,F){if(xy&&(R==="id"||R==="name")&&(F in n||F in fk))return!1;if(!(Xr&&!vl[R]&&kt(Yr,R))){if(!($o&&kt(it,R))){if(!he[R]||vl[R]){if(!(Fy(E)&&($.tagNameCheck instanceof RegExp&&kt($.tagNameCheck,E)||$.tagNameCheck instanceof Function&&$.tagNameCheck(E))&&($.attributeNameCheck instanceof RegExp&&kt($.attributeNameCheck,R)||$.attributeNameCheck instanceof Function&&$.attributeNameCheck(R))||R==="is"&&$.allowCustomizedBuiltInElements&&($.tagNameCheck instanceof RegExp&&kt($.tagNameCheck,F)||$.tagNameCheck instanceof Function&&$.tagNameCheck(F))))return!1}else if(!yf[R]){if(!kt(H,il(F,At,""))){if(!((R==="src"||R==="xlink:href"||R==="href")&&E!=="script"&&mM(F,"data:")===0&&by[E])){if(!(ds&&!kt(Gt,il(F,At,"")))){if(F)return!1}}}}}}return!0},Fy=function(E){return E!=="annotation-xml"&&E.indexOf("-")>0},Hy=function(E){An("beforeSanitizeAttributes",E,null);let{attributes:R}=E;if(!R)return;let F={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:he},ce=R.length;for(;ce--;){let Be=R[ce],{name:je,namespaceURI:at,value:Zr}=Be,ms=Oe(je),lt=je==="value"?Zr:gM(Zr);if(F.attrName=ms,F.attrValue=lt,F.keepAttr=!0,F.forceKeepAttr=void 0,An("uponSanitizeAttribute",E,F),lt=F.attrValue,F.forceKeepAttr||(xf(je,E),!F.keepAttr))continue;if(!Sl&&kt(/\/>/i,lt)){xf(je,E);continue}Yt&&ef([V,_,ee],By=>{lt=il(lt,By," ")});let Uy=Oe(E.nodeName);if(Dy(Uy,ms,lt)){if(Ey&&(ms==="id"||ms==="name")&&(xf(je,E),lt=lk+lt),S&&typeof m=="object"&&typeof m.getAttributeType=="function"&&!at)switch(m.getAttributeType(Uy,ms)){case"TrustedHTML":{lt=S.createHTML(lt);break}case"TrustedScriptURL":{lt=S.createScriptURL(lt);break}}try{at?E.setAttributeNS(at,je,lt):E.setAttribute(je,lt),Yb(t.removed)}catch{}}}An("afterSanitizeAttributes",E,null)},hk=function U(E){let R=null,F=Ny(E);for(An("beforeSanitizeShadowDOM",E,null);R=F.nextNode();)An("uponSanitizeShadowNode",R,null),!_y(R)&&(R.content instanceof i&&U(R.content),Hy(R));An("afterSanitizeShadowDOM",E,null)};return t.sanitize=function(U){let E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},R=null,F=null,ce=null,Be=null;if(vf=!U,vf&&(U="<!-->"),typeof U!="string"&&!My(U))if(typeof U.toString=="function"){if(U=U.toString(),typeof U!="string")throw sl("dirty is not a string, aborting")}else throw sl("toString is not a function");if(!t.isSupported)return U;if(wl||wf(E),t.removed=[],typeof U=="string"&&(fs=!1),fs){if(U.nodeName){let Zr=Oe(U.nodeName);if(!q[Zr]||ar[Zr])throw sl("root node is forbidden and cannot be sanitized in-place")}}else if(U instanceof a)R=Oy("<!---->"),F=R.ownerDocument.importNode(U,!0),F.nodeType===1&&F.nodeName==="BODY"||F.nodeName==="HTML"?R=F:R.appendChild(F);else{if(!Lt&&!Yt&&!Xt&&U.indexOf("<")===-1)return S&&El?S.createHTML(U):U;if(R=Oy(U),!R)return Lt?null:El?x:""}R&&st&&Qr(R.firstChild);let je=Ny(fs?U:R);for(;ce=je.nextNode();)_y(ce)||(ce.content instanceof i&&hk(ce.content),Hy(ce));if(fs)return U;if(Lt){if(xl)for(Be=k.call(R.ownerDocument);R.firstChild;)Be.appendChild(R.firstChild);else Be=R;return(he.shadowroot||he.shadowrootmode)&&(Be=I.call(r,Be,!0)),Be}let at=Xt?R.outerHTML:R.innerHTML;return Xt&&q["!doctype"]&&R.ownerDocument&&R.ownerDocument.doctype&&R.ownerDocument.doctype.name&&kt(oT,R.ownerDocument.doctype.name)&&(at="<!DOCTYPE "+R.ownerDocument.doctype.name+`>
|
|
24
|
-
`+at),Yt&&ef([V,_,ee],Zr=>{at=il(at,Zr," ")}),S&&El?S.createHTML(at):at},t.setConfig=function(){let U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};wf(U),wl=!0},t.clearConfig=function(){Yo=null,wl=!1},t.isValidAttribute=function(U,E,R){Yo||wf({});let F=Oe(U),ce=Oe(E);return Dy(F,ce,R)},t.addHook=function(U,E){typeof E=="function"&&(N[U]=N[U]||[],ol(N[U],E))},t.removeHook=function(U){if(N[U])return Yb(N[U])},t.removeHooks=function(U){N[U]&&(N[U]=[])},t.removeAllHooks=function(){N={}},t}var sT=iT();var qr=w(D());var AM={"":["<em>","</em>"],_:["<strong>","</strong>"],"*":["<strong>","</strong>"],"~":["<s>","</s>"],"\n":["<br />"]," ":["<br />"],"-":["<hr />"]};function aT(e){return e.replace(RegExp("^"+(e.match(/^(\t| )+/)||"")[0],"gm"),"")}function al(e){return(e+"").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function ll(e,t){var n,r,o,i,s,a=/((?:^|\n+)(?:\n---+|\* \*(?: \*)+)\n)|(?:^``` *(\w*)\n([\s\S]*?)\n```$)|((?:(?:^|\n+)(?:\t| {2,}).+)+\n*)|((?:(?:^|\n)([>*+-]|\d+\.)\s+.*)+)|(?:!\[([^\]]*?)\]\(([^)]+?)\))|(\[)|(\](?:\(([^)]+?)\))?)|(?:(?:^|\n+)([^\s].*)\n(-{3,}|={3,})(?:\n+|$))|(?:(?:^|\n+)(#{1,6})\s*(.+)(?:\n+|$))|(?:`([^`].*?)`)|( \n\n*|\n{2,}|__|\*\*|[_*]|~~)/gm,l=[],u="",c=t||{},f=0;function d(y){var v=AM[y[1]||""],p=l[l.length-1]==y;return v?v[1]?(p?l.pop():l.push(y),v[0|p]):v[0]:y}function m(){for(var y="";l.length;)y+=d(l[l.length-1]);return y}for(e=e.replace(/^\[(.+?)\]:\s*(.+)$/gm,function(y,v,p){return c[v.toLowerCase()]=p,""}).replace(/^\n+|\n+$/g,"");o=a.exec(e);)r=e.substring(f,o.index),f=a.lastIndex,n=o[0],r.match(/[^\\](\\\\)*\\$/)||((s=o[3]||o[4])?n='<pre class="code '+(o[4]?"poetry":o[2].toLowerCase())+'"><code'+(o[2]?' class="language-'+o[2].toLowerCase()+'"':"")+">"+aT(al(s).replace(/^\n+|\n+$/g,""))+"</code></pre>":(s=o[6])?(s.match(/\./)&&(o[5]=o[5].replace(/^\d+/gm,"")),i=ll(aT(o[5].replace(/^\s*[>*+.-]/gm,""))),s==">"?s="blockquote":(s=s.match(/\./)?"ol":"ul",i=i.replace(/^(.*)(\n|$)/gm,"<li>$1</li>")),n="<"+s+">"+i+"</"+s+">"):o[8]?n='<img src="'+al(o[8])+'" alt="'+al(o[7])+'">':o[10]?(u=u.replace("<a>",'<a href="'+al(o[11]||c[r.toLowerCase()])+'">'),n=m()+"</a>"):o[9]?n="<a>":o[12]||o[14]?n="<"+(s="h"+(o[14]?o[14].length:o[13]>"="?1:2))+">"+ll(o[12]||o[15],c)+"</"+s+">":o[16]?n="<code>"+al(o[16])+"</code>":(o[17]||o[1])&&(n=d(o[17]||"--"))),u+=r,u+=n;return(u+e.substring(f)+m()).replace(/^\n+|\n+$/g,"")}var lT={fadeup:"E",root:"i",popover:"rr",options:"yo",copyIcon:"G",option:"wo",divider:"tr"};var nr=w(b());function IM(e){return`<button type="button" class=${e}><svg version="1.1" x="0px" y="0px" viewBox="0 0 115.77 122.88" width="10px" height="10px" fill="black"><g><path d="M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"/></g></svg></button>`}function iy(e){let t=e.cloneNode(!0);return t.querySelectorAll("div,button").forEach(n=>n.remove()),t.textContent??""}var OM=({content:e,useLabel:t,copyLabel:n,onCopy:r,onUse:o})=>{let i=A("Markdown",lT),s=(0,qr.useRef)(null),[a,l]=(0,qr.useState)(null),u=(0,qr.useMemo)(()=>{let y=ll(e);return sT.sanitize(y).replace(/<\/code>/g,`${IM(i.copyIcon)}</code>`)},[e]),c=y=>{var g;let v=y.target,p=!!((g=s.current)!=null&&g.querySelector("code"));a||p&&v.tagName!=="CODE"||!p&&v!==s.current||(v.addEventListener("mouseleave",()=>l(null),{once:!0}),l(v))},f=()=>{if(!a)return;l(null);let y=a.querySelector("button");y&&(ss(y,i.fadeup),r(iy(a)))},d=y=>{y.target.tagName.toLowerCase()==="button"&&(ss(y.target,i.fadeup),r(iy(y.target.parentElement)))},m=()=>{a&&(l(null),o(iy(a)))};return(0,nr.jsxs)(qr.Fragment,{children:[a&&(0,nr.jsx)(is,{triggerRef:{current:a},parentNode:a,className:i.popover,children:(0,nr.jsxs)("div",{className:i.options,children:[(0,nr.jsx)("button",{type:"button",className:i.option,onClick:f,children:n}),(0,nr.jsx)("div",{className:i.divider}),(0,nr.jsx)("button",{type:"button",className:i.option,onClick:m,children:t})]})}),(0,nr.jsx)("div",{ref:s,className:i.root,dangerouslySetInnerHTML:{__html:u},onMouseOver:c,onClick:d})]})},uT=OM;var sy={};Qe(sy,{enUS:()=>NM,nlNL:()=>MM});var NM={useCue:[{type:0,value:"Use"}],copyCue:[{type:0,value:"Copy"}],removeCue:[{type:0,value:"Close"}],thumbsUp:[{type:0,value:"Thumbs up"}],thumbsDown:[{type:0,value:"Thumbs down"}]},MM={useCue:[{type:0,value:"Gebruik"}],copyCue:[{type:0,value:"Kopieer"}],removeCue:[{type:0,value:"Sluiten"}],thumbsUp:[{type:0,value:"Thumbs up"}],thumbsDown:[{type:0,value:"Thumbs down"}]};var cT={fadeup:"N",fadedown:"A",selected:"vo",thumbsUp:"nr",thumbsDown:"ar"};var Rt=w(b()),DM=({cue:e,onRemove:t,onCopy:n,onUse:r,onThumbsUp:o,onThumbsDown:i})=>{let s=A("WidgetCue",cT),a=G(sy),l=Jd(),[u,c]=(0,of.useState)(null),f=p=>{n&&n(p,e)},d=p=>{r&&r(p,e)},m=p=>{p.preventDefault(),p.stopPropagation(),t(e)},y=p=>{p.preventDefault(),p.stopPropagation(),ss(p.target,s.fadeup),c("up"),o(e)},v=p=>{p.preventDefault(),p.stopPropagation(),ss(p.target,s.fadedown),c("down"),i(e)};return(0,of.useEffect)(()=>{l("Assistant response displayed",{name:e.rule.name,description:e.rule.description,group:e.rule.label})},[]),(0,Rt.jsxs)(oe,{"data-testid":"cue",children:[(0,Rt.jsx)(fe,{children:(0,Rt.jsxs)(fe.Content,{children:[e.title&&(0,Rt.jsx)(fe.Title,{"data-testid":"widget-cue-title",children:e.title}),(0,Rt.jsx)(uT,{content:e.text,useLabel:a("useCue"),copyLabel:a("copyCue"),onCopy:f,onUse:d})]})}),(0,Rt.jsx)(oe.IconButton,{title:a("thumbsUp"),onClick:y,icon:(0,Rt.jsx)(qb,{}),className:(0,ay.default)(s.thumbsUp,u==="up"&&s.selected),disabled:!!u}),(0,Rt.jsx)(oe.IconButton,{title:a("thumbsDown"),onClick:v,icon:(0,Rt.jsx)(Wb,{}),className:(0,ay.default)(s.thumbsDown,u==="down"&&s.selected),disabled:!!u}),(0,Rt.jsx)(oe.IconButton,{title:a("removeCue"),onClick:m,icon:(0,Rt.jsx)($b,{})})]})},dT=DM;var ul=w(b()),FM=({cues:e})=>{let t=Y(),n=zt(),r=Jd(),o=u=>{t(bb({id:u.rule.id})),r("Assistant response closed",{name:u.rule.name,group:u.rule.label,description:u.rule.description})},i=(u,c)=>{ko(u),r("Assistant response copied",{name:c.rule.name,group:c.rule.label,description:c.rule.description,copiedText:u})},s=(u,c)=>{n.send(Dr,{text:u,suggestion:{source:"cue",sourceText:u}}),r("Assistant response used",{name:c.rule.name,group:c.rule.label,description:c.rule.description,usedText:u})},a=u=>{r("Assistant response feedback",{name:u.rule.name,group:u.rule.label,description:u.rule.description,thumb:"up"})},l=u=>{r("Assistant response feedback",{name:u.rule.name,group:u.rule.label,description:u.rule.description,thumb:"down"})};return(0,ul.jsx)(ul.Fragment,{children:e.map(u=>(0,ul.jsx)(dT,{cue:u,onRemove:o,onCopy:i,onUse:s,onThumbsDown:l,onThumbsUp:a},u.rule.id))})},fT=FM;var mT=w(D());var HM=/(https?:\/\/[^\s]+)/,pT=e=>e.split(" ").find(t=>HM.test(t));var Wt=w(b()),UM=({suggestion:e,lines:t,onUse:n})=>{var c;let r=e.text||e.url||e.message,o=pT(r),i=G(No),s=j("showImages"),a=j("fallbackImage"),l=f=>{f.preventDefault(),f.stopPropagation(),n(r)},u=(0,mT.useCallback)(f=>{window.open(o,"_blank"),f.stopPropagation(),f.preventDefault()},[o]);return(0,Wt.jsxs)(oe,{onClick:l,"data-testid":"edit-suggestion",children:[(0,Wt.jsxs)(fe,{children:[s&&e.image&&(0,Wt.jsx)(fe.Image,{src:Wd(e,"small",a||void 0),title:e.title}),(0,Wt.jsxs)(fe.Content,{children:[e.title&&(0,Wt.jsx)(fe.Title,{"data-testid":"widget-suggestion-title",children:e.title}),e.searchKeywords&&((c=e.searchKeywords)==null?void 0:c.length)>0&&(0,Wt.jsx)(oe.Labels,{labels:e.searchKeywords}),(0,Wt.jsx)(fe.Content,{cropText:t==="single",lineClamp:t==="multiple",children:r})]})]}),(0,Wt.jsxs)(oe.Actions,{children:[o&&(0,Wt.jsx)(oe.ActionButton,{onClick:u,label:i("visitUrl")}),(0,Wt.jsx)(oe.ActionButton,{primary:!0,onClick:l,label:i("useSuggestion")})]})]})},gT=UM;var cl=w(b()),BM=({lines:e,suggestions:t})=>{let n=zt(),r=(o,i)=>{n.send(Dr,{text:o,suggestion:{...i,source:i.source,sourceText:i.text}})};return(0,cl.jsx)(cl.Fragment,{children:t.map(o=>(0,cl.jsx)(gT,{suggestion:o,lines:e,onUse:i=>r(i,o)},o.text||o.url||o.message))})},hT=BM;var ly={};Qe(ly,{enUS:()=>jM,nlNL:()=>zM});var jM={waiting:[{type:0,value:"Loading\u2026"}],notSupported:[{type:0,value:"This conversation is not supported"}],noResults:[{type:0,value:"No results found\u2026"}],titleAutoflows:[{type:0,value:"Autoflows"}],titleCustomMessages:[{type:0,value:"Quick replies"}],titleCues:[{type:0,value:"Assistant updates"}],actions:[{type:0,value:"Shortcuts"}],linkStudioLogin:[{type:0,value:"My "},{type:1,value:"productName"}],linkSummary:[{type:0,value:"Summarize"}],linkKnowledgeSearch:[{type:0,value:"Knowledge Assist"}],linkSearch:[{type:0,value:"Search"}]},zM={waiting:[{type:0,value:"Laden\u2026"}],notSupported:[{type:0,value:"Dit gesprek wordt niet ondersteund"}],noResults:[{type:0,value:"Geen resultaten gevonden\u2026"}],titleAutoflows:[{type:0,value:"Autoflows"}],titleCustomMessages:[{type:0,value:"Quick replies"}],titleCues:[{type:0,value:"Assistant updates"}],actions:[{type:0,value:"Shortcuts"}],linkStudioLogin:[{type:0,value:"Mijn "},{type:1,value:"productName"}],linkSummary:[{type:0,value:"Gesprek samenvatten"}],linkKnowledgeSearch:[{type:0,value:"Knowledge assist"}],linkSearch:[{type:0,value:"Zoeken"}]};var yT={root:"pr",loginText:"dr",stateText:"ko",sectionList:"lr",shortcutList:"sr",shortcut:"cr",link:"zo"};var Q=w(b()),sf=(e,t)=>{let n=O(tt);(0,ST.useEffect)(()=>n?t.every(r=>!!r)?e():()=>{}:()=>{},[...t,n])},KM=({onLogIn:e})=>{let t=G(ly),n=Y(),r=j("isEmbedded"),o=A("Widget",yT),i=j("showAutoflows"),s=j("showCustomMessages"),a=j("showSummaryCommand"),l=j("showKnowledgeSearch"),u=j("showSearch"),c=O(jr),f=O(Td),d=O(ib),m=O(Eb),y=O(bd),v=O(cb),p=O(Dc),g=O(zi),h=O(tt),S=O(_c),x=O(kb),T=O(kd),C=zt(),k=O(tC),L=O(vb("/admin/")),I=j("adminUrl"),N=j("productName");if(sf(()=>(n(nl(S)),n(gb(S)),()=>{n(hb(S))}),[n,g,s,S]),sf(()=>(n(er(S)),n(sb(S)),()=>{n(ab(S))}),[n,g,i,S]),sf(()=>{f.forEach(({type:_})=>{n(_==="entities"?an():un(_))})},[n,g,p,c]),sf(()=>(n(Uh()),()=>{n(wb())}),[n]),g===!1)return(0,Q.jsx)("div",{className:o.stateText,children:(0,Q.jsx)("div",{children:(0,Q.jsx)("p",{children:t("notSupported")})})},"supported");if(h===!1)return(0,Q.jsx)("div",{className:o.loginText,children:(0,Q.jsx)("div",{children:(0,Q.jsx)(Nd,{isEmbedded:r,loginUrl:I,onLogIn:e})})},"login");if(!c||!S||h===null||k||x)return(0,Q.jsx)("div",{className:o.stateText,children:(0,Q.jsx)("div",{children:(0,Q.jsx)("p",{children:t("waiting")})})},"waiting");let V=u||a||l||L;return(0,Q.jsx)("div",{className:(0,vT.default)(o.root),"data-testid":"widget",children:(0,Q.jsxs)(Dl,{className:o.sectionList,children:[V&&(0,Q.jsx)(In,{title:t("actions"),type:"shortcuts",children:(0,Q.jsxs)("div",{className:o.shortcutList,children:[u&&(0,Q.jsxs)("button",{className:o.shortcut,"data-testid":"shortcut-search",onClick:()=>C.send("ShowCommandPalette",{isOpen:!0}),children:[(0,Q.jsx)(qi,{}),t("linkSearch")]}),a&&(0,Q.jsxs)("button",{className:o.shortcut,"data-testid":"shortcut-summary",onClick:()=>C.send("ShowCommandPalette",{isOpen:!0,page:"summary"}),children:[(0,Q.jsx)(Vb,{}),t("linkSummary")]}),l&&(0,Q.jsxs)("button",{className:o.shortcut,"data-testid":"shortcut-knowledge-assist",onClick:()=>C.send("ShowCommandPalette",{isOpen:!0,page:"knowledgeAssist"}),children:[(0,Q.jsx)(zb,{}),t("linkKnowledgeSearch")]}),L&&(0,Q.jsxs)("a",{className:o.shortcut,target:"_blank",href:L,"data-testid":"shortcut-studio-login",rel:"noreferrer",children:[(0,Q.jsx)(jb,{}),t("linkStudioLogin",{productName:N})]})]})}),s&&v.length>0&&(0,Q.jsx)(In,{type:"custom-messages","data-testid":"custom-messages",children:(0,Q.jsx)(ht,{withDivider:!0,children:v.map(_=>(0,Q.jsx)(Hb,{suggestion:_},_.text))})}),i&&d.length>0&&(0,Q.jsx)(In,{type:"autoflows",title:t("titleAutoflows"),"data-testid":"autoflows",children:(0,Q.jsx)(ht,{withDivider:!0,children:(0,Q.jsx)(Db,{})})}),f.map(({type:_,title:ee,amount:Yr,lines:it})=>{var Gt;switch(_){case"entities":return y&&y.length>0&&(0,Q.jsx)(In,{type:_,title:ee,"data-testid":`type-${_}`,children:(0,Q.jsx)(Bb,{entities:y})},_);case"cues":return m&&m.length>0&&(0,Q.jsx)(In,{type:_,title:ee,"data-testid":`type-${_}`,children:(0,Q.jsx)(ht,{withDivider:!0,children:(0,Q.jsx)(fT,{cues:m})})},_);default:return((Gt=T[_])==null?void 0:Gt.fetchState)==="done"&&T[_].suggestions.length>0&&(0,Q.jsx)(In,{type:_,title:ee,"data-testid":`type-${_}`,children:(0,Q.jsx)(ht,{withDivider:!0,children:(0,Q.jsx)(hT,{lines:it,contentType:_,suggestions:T[_].suggestions.slice(0,Yr)||[]})})},_)}})]})})},wT=KM;function as(e){let t=new Range;return t.selectNodeContents(e),t}function xT(e,t,n){try{return Gr(e,t,n),!0}catch{return!1}}function af(e){return"tagName"in e&&(e.tagName==="DIV"||e.tagName==="P")}function lf(e){return"tagName"in e&&e.tagName==="BR"}var dl=/[\u200B-\u200D\uFEFF]/g;function Gr(e,t,n){let r=new Range;if(e.firstChild===null&&t===0&&n===0)return r.selectNodeContents(e),r;let o=0,i=!1;function s(l,u){let c=-1,f=/[\u200B-\u200D\uFEFF]/;if(!f.test(l))return u;for(let d=0;d<=l.length;d++)if(f.test(l[d])||c++,c===u)return d;throw new Error("Offset out of range")}function a(l){switch(l.nodeType){case Node.TEXT_NODE:{let u=l.textContent,c=u.replace(dl,""),f=o+c.length,d=t>=o&&t<=f,m=n>=o&&n<=f;if(d){let y=s(u,t-o);y===0&&!m?r.setStartBefore(l):r.setStart(l,y)}m&&(r.setEnd(l,s(u,n-o)),i=!0),o=f;break}case Node.ELEMENT_NODE:{if(lf(l)&&(o===t&&r.setStartBefore(l),o++,o===n)){r.setEndAfter(l),i=!0;return}for(let c=0;c<l.childNodes.length&&(a(l.childNodes[c]),!i);c++);let u=l.lastChild;af(l)&&u&&!af(u)&&!lf(u)&&o++;break}default:break}}if(a(e),r.startContainer===document)throw new Error("Offsets out of bound");return r}function fl(e,t){if(!e.contains(t.startContainer)||!e.contains(t.endContainer))throw new Error("Range not within root element");let{startContainer:n,startOffset:r,endContainer:o,endOffset:i,collapsed:s}=t,a,l,u=0;function c(f){let d=f===n,m=f===o;switch(f.nodeType){case Node.TEXT_NODE:{let y=f.textContent;d&&(a=u+y.substring(0,r).replace(dl,"").length),m&&(l=u+y.substring(0,i).replace(dl,"").length),u+=y.replace(dl,"").length;break}case Node.ELEMENT_NODE:{let y=f.nextSibling===null;lf(f)&&!y&&u++;for(let v=0;v<f.childNodes.length;v++){let p=d&&v===r,g=m&&v===i;if(p&&(a=u),g&&(l=u),l!==void 0||((!p||!s)&&c(f.childNodes[v]),m&&v===i-1&&(l=u),l!==void 0))break}!m&&af(f)&&!y&&u++,m&&(l=u);break}default:break}}if(c(e),l===void 0)throw new Error("Could not determine start and end");return{start:a??l,end:l}}function pl(e,t){if(!e.contains(t.startContainer)||!e.contains(t.endContainer))throw new Error("Range not within root element");let{startContainer:n,startOffset:r,endContainer:o,endOffset:i}=t,s=-1,a="";function l(u){let c=u===n,f=u===o;switch(c&&s++,u.nodeType){case Node.TEXT_NODE:{if(s!==0)return;let d=c?r:0,m=f?i:void 0,y=u.textContent.replace(dl,"");d===0&&m===void 0?a+=y:a+=y.substring(d,m);break}case Node.ELEMENT_NODE:{let d=u.nextSibling===null;s===0&&lf(u)&&!d&&(a+=`
|
|
24
|
+
`+at),Yt&&ef([V,_,ee],Zr=>{at=il(at,Zr," ")}),S&&El?S.createHTML(at):at},t.setConfig=function(){let U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};wf(U),wl=!0},t.clearConfig=function(){Yo=null,wl=!1},t.isValidAttribute=function(U,E,R){Yo||wf({});let F=Oe(U),ce=Oe(E);return Dy(F,ce,R)},t.addHook=function(U,E){typeof E=="function"&&(N[U]=N[U]||[],ol(N[U],E))},t.removeHook=function(U){if(N[U])return Yb(N[U])},t.removeHooks=function(U){N[U]&&(N[U]=[])},t.removeAllHooks=function(){N={}},t}var sT=iT();var qr=w(D());var AM={"":["<em>","</em>"],_:["<strong>","</strong>"],"*":["<strong>","</strong>"],"~":["<s>","</s>"],"\n":["<br />"]," ":["<br />"],"-":["<hr />"]};function aT(e){return e.replace(RegExp("^"+(e.match(/^(\t| )+/)||"")[0],"gm"),"")}function al(e){return(e+"").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function ll(e,t){var n,r,o,i,s,a=/((?:^|\n+)(?:\n---+|\* \*(?: \*)+)\n)|(?:^``` *(\w*)\n([\s\S]*?)\n```$)|((?:(?:^|\n+)(?:\t| {2,}).+)+\n*)|((?:(?:^|\n)([>*+-]|\d+\.)\s+.*)+)|(?:!\[([^\]]*?)\]\(([^)]+?)\))|(\[)|(\](?:\(([^)]+?)\))?)|(?:(?:^|\n+)([^\s].*)\n(-{3,}|={3,})(?:\n+|$))|(?:(?:^|\n+)(#{1,6})\s*(.+)(?:\n+|$))|(?:`([^`].*?)`)|( \n\n*|\n{2,}|__|\*\*|[_*]|~~)/gm,l=[],u="",c=t||{},f=0;function d(y){var v=AM[y[1]||""],p=l[l.length-1]==y;return v?v[1]?(p?l.pop():l.push(y),v[0|p]):v[0]:y}function m(){for(var y="";l.length;)y+=d(l[l.length-1]);return y}for(e=e.replace(/^\[(.+?)\]:\s*(.+)$/gm,function(y,v,p){return c[v.toLowerCase()]=p,""}).replace(/^\n+|\n+$/g,"");o=a.exec(e);)r=e.substring(f,o.index),f=a.lastIndex,n=o[0],r.match(/[^\\](\\\\)*\\$/)||((s=o[3]||o[4])?n='<pre class="code '+(o[4]?"poetry":o[2].toLowerCase())+'"><code'+(o[2]?' class="language-'+o[2].toLowerCase()+'"':"")+">"+aT(al(s).replace(/^\n+|\n+$/g,""))+"</code></pre>":(s=o[6])?(s.match(/\./)&&(o[5]=o[5].replace(/^\d+/gm,"")),i=ll(aT(o[5].replace(/^\s*[>*+.-]/gm,""))),s==">"?s="blockquote":(s=s.match(/\./)?"ol":"ul",i=i.replace(/^(.*)(\n|$)/gm,"<li>$1</li>")),n="<"+s+">"+i+"</"+s+">"):o[8]?n='<img src="'+al(o[8])+'" alt="'+al(o[7])+'">':o[10]?(u=u.replace("<a>",'<a href="'+al(o[11]||c[r.toLowerCase()])+'">'),n=m()+"</a>"):o[9]?n="<a>":o[12]||o[14]?n="<"+(s="h"+(o[14]?o[14].length:o[13]>"="?1:2))+">"+ll(o[12]||o[15],c)+"</"+s+">":o[16]?n="<code>"+al(o[16])+"</code>":(o[17]||o[1])&&(n=d(o[17]||"--"))),u+=r,u+=n;return(u+e.substring(f)+m()).replace(/^\n+|\n+$/g,"")}var lT={fadeup:"E",root:"i",popover:"rr",options:"yo",copyIcon:"G",option:"wo",divider:"tr"};var nr=w(b());function IM(e){return`<button type="button" class=${e}><svg version="1.1" x="0px" y="0px" viewBox="0 0 115.77 122.88" width="10px" height="10px" fill="black"><g><path d="M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"/></g></svg></button>`}function iy(e){let t=e.cloneNode(!0);return t.querySelectorAll("div,button").forEach(n=>n.remove()),t.textContent??""}function OM(e){return e.replace(/\r\n/g,`
|
|
25
|
+
`)}var NM=({content:e,useLabel:t,copyLabel:n,onCopy:r,onUse:o})=>{let i=A("Markdown",lT),s=(0,qr.useRef)(null),[a,l]=(0,qr.useState)(null),u=(0,qr.useMemo)(()=>{let y=ll(OM(e));return sT.sanitize(y).replace(/<\/code>/g,`${IM(i.copyIcon)}</code>`)},[e]),c=y=>{var g;let v=y.target,p=!!((g=s.current)!=null&&g.querySelector("code"));a||p&&v.tagName!=="CODE"||!p&&v!==s.current||(v.addEventListener("mouseleave",()=>l(null),{once:!0}),l(v))},f=()=>{if(!a)return;l(null);let y=a.querySelector("button");y&&(ss(y,i.fadeup),r(iy(a)))},d=y=>{y.target.tagName.toLowerCase()==="button"&&(ss(y.target,i.fadeup),r(iy(y.target.parentElement)))},m=()=>{a&&(l(null),o(iy(a)))};return(0,nr.jsxs)(qr.Fragment,{children:[a&&(0,nr.jsx)(is,{triggerRef:{current:a},parentNode:a,className:i.popover,children:(0,nr.jsxs)("div",{className:i.options,children:[(0,nr.jsx)("button",{type:"button",className:i.option,onClick:f,children:n}),(0,nr.jsx)("div",{className:i.divider}),(0,nr.jsx)("button",{type:"button",className:i.option,onClick:m,children:t})]})}),(0,nr.jsx)("div",{ref:s,className:i.root,dangerouslySetInnerHTML:{__html:u},onMouseOver:c,onClick:d})]})},uT=NM;var sy={};Qe(sy,{enUS:()=>MM,nlNL:()=>_M});var MM={useCue:[{type:0,value:"Use"}],copyCue:[{type:0,value:"Copy"}],removeCue:[{type:0,value:"Close"}],thumbsUp:[{type:0,value:"Thumbs up"}],thumbsDown:[{type:0,value:"Thumbs down"}]},_M={useCue:[{type:0,value:"Gebruik"}],copyCue:[{type:0,value:"Kopieer"}],removeCue:[{type:0,value:"Sluiten"}],thumbsUp:[{type:0,value:"Thumbs up"}],thumbsDown:[{type:0,value:"Thumbs down"}]};var cT={fadeup:"N",fadedown:"A",selected:"vo",thumbsUp:"nr",thumbsDown:"ar"};var Rt=w(b()),FM=({cue:e,onRemove:t,onCopy:n,onUse:r,onThumbsUp:o,onThumbsDown:i})=>{let s=A("WidgetCue",cT),a=G(sy),l=Jd(),[u,c]=(0,of.useState)(null),f=p=>{n&&n(p,e)},d=p=>{r&&r(p,e)},m=p=>{p.preventDefault(),p.stopPropagation(),t(e)},y=p=>{p.preventDefault(),p.stopPropagation(),ss(p.target,s.fadeup),c("up"),o(e)},v=p=>{p.preventDefault(),p.stopPropagation(),ss(p.target,s.fadedown),c("down"),i(e)};return(0,of.useEffect)(()=>{l("Assistant response displayed",{name:e.rule.name,description:e.rule.description,group:e.rule.label})},[]),(0,Rt.jsxs)(oe,{"data-testid":"cue",children:[(0,Rt.jsx)(fe,{children:(0,Rt.jsxs)(fe.Content,{children:[e.title&&(0,Rt.jsx)(fe.Title,{"data-testid":"widget-cue-title",children:e.title}),(0,Rt.jsx)(uT,{content:e.text,useLabel:a("useCue"),copyLabel:a("copyCue"),onCopy:f,onUse:d})]})}),(0,Rt.jsx)(oe.IconButton,{title:a("thumbsUp"),onClick:y,icon:(0,Rt.jsx)(qb,{}),className:(0,ay.default)(s.thumbsUp,u==="up"&&s.selected),disabled:!!u}),(0,Rt.jsx)(oe.IconButton,{title:a("thumbsDown"),onClick:v,icon:(0,Rt.jsx)(Wb,{}),className:(0,ay.default)(s.thumbsDown,u==="down"&&s.selected),disabled:!!u}),(0,Rt.jsx)(oe.IconButton,{title:a("removeCue"),onClick:m,icon:(0,Rt.jsx)($b,{})})]})},dT=FM;var ul=w(b()),HM=({cues:e})=>{let t=Y(),n=zt(),r=Jd(),o=u=>{t(bb({id:u.rule.id})),r("Assistant response closed",{name:u.rule.name,group:u.rule.label,description:u.rule.description})},i=(u,c)=>{ko(u),r("Assistant response copied",{name:c.rule.name,group:c.rule.label,description:c.rule.description,copiedText:u})},s=(u,c)=>{n.send(Dr,{text:u,suggestion:{source:"cue",sourceText:u}}),r("Assistant response used",{name:c.rule.name,group:c.rule.label,description:c.rule.description,usedText:u})},a=u=>{r("Assistant response feedback",{name:u.rule.name,group:u.rule.label,description:u.rule.description,thumb:"up"})},l=u=>{r("Assistant response feedback",{name:u.rule.name,group:u.rule.label,description:u.rule.description,thumb:"down"})};return(0,ul.jsx)(ul.Fragment,{children:e.map(u=>(0,ul.jsx)(dT,{cue:u,onRemove:o,onCopy:i,onUse:s,onThumbsDown:l,onThumbsUp:a},u.rule.id))})},fT=HM;var mT=w(D());var UM=/(https?:\/\/[^\s]+)/,pT=e=>e.split(" ").find(t=>UM.test(t));var Wt=w(b()),BM=({suggestion:e,lines:t,onUse:n})=>{var c;let r=e.text||e.url||e.message,o=pT(r),i=G(No),s=j("showImages"),a=j("fallbackImage"),l=f=>{f.preventDefault(),f.stopPropagation(),n(r)},u=(0,mT.useCallback)(f=>{window.open(o,"_blank"),f.stopPropagation(),f.preventDefault()},[o]);return(0,Wt.jsxs)(oe,{onClick:l,"data-testid":"edit-suggestion",children:[(0,Wt.jsxs)(fe,{children:[s&&e.image&&(0,Wt.jsx)(fe.Image,{src:Wd(e,"small",a||void 0),title:e.title}),(0,Wt.jsxs)(fe.Content,{children:[e.title&&(0,Wt.jsx)(fe.Title,{"data-testid":"widget-suggestion-title",children:e.title}),e.searchKeywords&&((c=e.searchKeywords)==null?void 0:c.length)>0&&(0,Wt.jsx)(oe.Labels,{labels:e.searchKeywords}),(0,Wt.jsx)(fe.Content,{cropText:t==="single",lineClamp:t==="multiple",children:r})]})]}),(0,Wt.jsxs)(oe.Actions,{children:[o&&(0,Wt.jsx)(oe.ActionButton,{onClick:u,label:i("visitUrl")}),(0,Wt.jsx)(oe.ActionButton,{primary:!0,onClick:l,label:i("useSuggestion")})]})]})},gT=BM;var cl=w(b()),jM=({lines:e,suggestions:t})=>{let n=zt(),r=(o,i)=>{n.send(Dr,{text:o,suggestion:{...i,source:i.source,sourceText:i.text}})};return(0,cl.jsx)(cl.Fragment,{children:t.map(o=>(0,cl.jsx)(gT,{suggestion:o,lines:e,onUse:i=>r(i,o)},o.text||o.url||o.message))})},hT=jM;var ly={};Qe(ly,{enUS:()=>zM,nlNL:()=>VM});var zM={waiting:[{type:0,value:"Loading\u2026"}],notSupported:[{type:0,value:"This conversation is not supported"}],noResults:[{type:0,value:"No results found\u2026"}],titleAutoflows:[{type:0,value:"Autoflows"}],titleCustomMessages:[{type:0,value:"Quick replies"}],titleCues:[{type:0,value:"Assistant updates"}],actions:[{type:0,value:"Shortcuts"}],linkStudioLogin:[{type:0,value:"My "},{type:1,value:"productName"}],linkSummary:[{type:0,value:"Summarize"}],linkKnowledgeSearch:[{type:0,value:"Knowledge Assist"}],linkSearch:[{type:0,value:"Search"}]},VM={waiting:[{type:0,value:"Laden\u2026"}],notSupported:[{type:0,value:"Dit gesprek wordt niet ondersteund"}],noResults:[{type:0,value:"Geen resultaten gevonden\u2026"}],titleAutoflows:[{type:0,value:"Autoflows"}],titleCustomMessages:[{type:0,value:"Quick replies"}],titleCues:[{type:0,value:"Assistant updates"}],actions:[{type:0,value:"Shortcuts"}],linkStudioLogin:[{type:0,value:"Mijn "},{type:1,value:"productName"}],linkSummary:[{type:0,value:"Gesprek samenvatten"}],linkKnowledgeSearch:[{type:0,value:"Knowledge assist"}],linkSearch:[{type:0,value:"Zoeken"}]};var yT={root:"pr",loginText:"dr",stateText:"ko",sectionList:"lr",shortcutList:"sr",shortcut:"cr",link:"zo"};var Q=w(b()),sf=(e,t)=>{let n=O(tt);(0,ST.useEffect)(()=>n?t.every(r=>!!r)?e():()=>{}:()=>{},[...t,n])},$M=({onLogIn:e})=>{let t=G(ly),n=Y(),r=j("isEmbedded"),o=A("Widget",yT),i=j("showAutoflows"),s=j("showCustomMessages"),a=j("showSummaryCommand"),l=j("showKnowledgeSearch"),u=j("showSearch"),c=O(jr),f=O(Td),d=O(ib),m=O(Eb),y=O(bd),v=O(cb),p=O(Dc),g=O(zi),h=O(tt),S=O(_c),x=O(kb),T=O(kd),C=zt(),k=O(tC),L=O(vb("/admin/")),I=j("adminUrl"),N=j("productName");if(sf(()=>(n(nl(S)),n(gb(S)),()=>{n(hb(S))}),[n,g,s,S]),sf(()=>(n(er(S)),n(sb(S)),()=>{n(ab(S))}),[n,g,i,S]),sf(()=>{f.forEach(({type:_})=>{n(_==="entities"?an():un(_))})},[n,g,p,c]),sf(()=>(n(Uh()),()=>{n(wb())}),[n]),g===!1)return(0,Q.jsx)("div",{className:o.stateText,children:(0,Q.jsx)("div",{children:(0,Q.jsx)("p",{children:t("notSupported")})})},"supported");if(h===!1)return(0,Q.jsx)("div",{className:o.loginText,children:(0,Q.jsx)("div",{children:(0,Q.jsx)(Nd,{isEmbedded:r,loginUrl:I,onLogIn:e})})},"login");if(!c||!S||h===null||k||x)return(0,Q.jsx)("div",{className:o.stateText,children:(0,Q.jsx)("div",{children:(0,Q.jsx)("p",{children:t("waiting")})})},"waiting");let V=u||a||l||L;return(0,Q.jsx)("div",{className:(0,vT.default)(o.root),"data-testid":"widget",children:(0,Q.jsxs)(Dl,{className:o.sectionList,children:[V&&(0,Q.jsx)(In,{title:t("actions"),type:"shortcuts",children:(0,Q.jsxs)("div",{className:o.shortcutList,children:[u&&(0,Q.jsxs)("button",{className:o.shortcut,"data-testid":"shortcut-search",onClick:()=>C.send("ShowCommandPalette",{isOpen:!0}),children:[(0,Q.jsx)(qi,{}),t("linkSearch")]}),a&&(0,Q.jsxs)("button",{className:o.shortcut,"data-testid":"shortcut-summary",onClick:()=>C.send("ShowCommandPalette",{isOpen:!0,page:"summary"}),children:[(0,Q.jsx)(Vb,{}),t("linkSummary")]}),l&&(0,Q.jsxs)("button",{className:o.shortcut,"data-testid":"shortcut-knowledge-assist",onClick:()=>C.send("ShowCommandPalette",{isOpen:!0,page:"knowledgeAssist"}),children:[(0,Q.jsx)(zb,{}),t("linkKnowledgeSearch")]}),L&&(0,Q.jsxs)("a",{className:o.shortcut,target:"_blank",href:L,"data-testid":"shortcut-studio-login",rel:"noreferrer",children:[(0,Q.jsx)(jb,{}),t("linkStudioLogin",{productName:N})]})]})}),s&&v.length>0&&(0,Q.jsx)(In,{type:"custom-messages","data-testid":"custom-messages",children:(0,Q.jsx)(ht,{withDivider:!0,children:v.map(_=>(0,Q.jsx)(Hb,{suggestion:_},_.text))})}),i&&d.length>0&&(0,Q.jsx)(In,{type:"autoflows",title:t("titleAutoflows"),"data-testid":"autoflows",children:(0,Q.jsx)(ht,{withDivider:!0,children:(0,Q.jsx)(Db,{})})}),f.map(({type:_,title:ee,amount:Yr,lines:it})=>{var Gt;switch(_){case"entities":return y&&y.length>0&&(0,Q.jsx)(In,{type:_,title:ee,"data-testid":`type-${_}`,children:(0,Q.jsx)(Bb,{entities:y})},_);case"cues":return m&&m.length>0&&(0,Q.jsx)(In,{type:_,title:ee,"data-testid":`type-${_}`,children:(0,Q.jsx)(ht,{withDivider:!0,children:(0,Q.jsx)(fT,{cues:m})})},_);default:return((Gt=T[_])==null?void 0:Gt.fetchState)==="done"&&T[_].suggestions.length>0&&(0,Q.jsx)(In,{type:_,title:ee,"data-testid":`type-${_}`,children:(0,Q.jsx)(ht,{withDivider:!0,children:(0,Q.jsx)(hT,{lines:it,contentType:_,suggestions:T[_].suggestions.slice(0,Yr)||[]})})},_)}})]})})},wT=$M;function as(e){let t=new Range;return t.selectNodeContents(e),t}function xT(e,t,n){try{return Gr(e,t,n),!0}catch{return!1}}function af(e){return"tagName"in e&&(e.tagName==="DIV"||e.tagName==="P")}function lf(e){return"tagName"in e&&e.tagName==="BR"}var dl=/[\u200B-\u200D\uFEFF]/g;function Gr(e,t,n){let r=new Range;if(e.firstChild===null&&t===0&&n===0)return r.selectNodeContents(e),r;let o=0,i=!1;function s(l,u){let c=-1,f=/[\u200B-\u200D\uFEFF]/;if(!f.test(l))return u;for(let d=0;d<=l.length;d++)if(f.test(l[d])||c++,c===u)return d;throw new Error("Offset out of range")}function a(l){switch(l.nodeType){case Node.TEXT_NODE:{let u=l.textContent,c=u.replace(dl,""),f=o+c.length,d=t>=o&&t<=f,m=n>=o&&n<=f;if(d){let y=s(u,t-o);y===0&&!m?r.setStartBefore(l):r.setStart(l,y)}m&&(r.setEnd(l,s(u,n-o)),i=!0),o=f;break}case Node.ELEMENT_NODE:{if(lf(l)&&(o===t&&r.setStartBefore(l),o++,o===n)){r.setEndAfter(l),i=!0;return}for(let c=0;c<l.childNodes.length&&(a(l.childNodes[c]),!i);c++);let u=l.lastChild;af(l)&&u&&!af(u)&&!lf(u)&&o++;break}default:break}}if(a(e),r.startContainer===document)throw new Error("Offsets out of bound");return r}function fl(e,t){if(!e.contains(t.startContainer)||!e.contains(t.endContainer))throw new Error("Range not within root element");let{startContainer:n,startOffset:r,endContainer:o,endOffset:i,collapsed:s}=t,a,l,u=0;function c(f){let d=f===n,m=f===o;switch(f.nodeType){case Node.TEXT_NODE:{let y=f.textContent;d&&(a=u+y.substring(0,r).replace(dl,"").length),m&&(l=u+y.substring(0,i).replace(dl,"").length),u+=y.replace(dl,"").length;break}case Node.ELEMENT_NODE:{let y=f.nextSibling===null;lf(f)&&!y&&u++;for(let v=0;v<f.childNodes.length;v++){let p=d&&v===r,g=m&&v===i;if(p&&(a=u),g&&(l=u),l!==void 0||((!p||!s)&&c(f.childNodes[v]),m&&v===i-1&&(l=u),l!==void 0))break}!m&&af(f)&&!y&&u++,m&&(l=u);break}default:break}}if(c(e),l===void 0)throw new Error("Could not determine start and end");return{start:a??l,end:l}}function pl(e,t){if(!e.contains(t.startContainer)||!e.contains(t.endContainer))throw new Error("Range not within root element");let{startContainer:n,startOffset:r,endContainer:o,endOffset:i}=t,s=-1,a="";function l(u){let c=u===n,f=u===o;switch(c&&s++,u.nodeType){case Node.TEXT_NODE:{if(s!==0)return;let d=c?r:0,m=f?i:void 0,y=u.textContent.replace(dl,"");d===0&&m===void 0?a+=y:a+=y.substring(d,m);break}case Node.ELEMENT_NODE:{let d=u.nextSibling===null;s===0&&lf(u)&&!d&&(a+=`
|
|
25
26
|
`);for(let m=c?r:0;m<(f?Math.min(i,u.childNodes.length):u.childNodes.length)&&(l(u.childNodes[m]),s!==1);m++);!f&&s===0&&af(u)&&!d&&(a+=`
|
|
26
|
-
`);break}default:break}f&&s++}return l(e),a}var ET=(s=>(s.CUT="Cut",s.BACKSPACE="Backspace",s.DELETE="Delete",s.ERASEEOF="EraseEof",s.UNDO="Undo",s.CLEAR="Clear",s))(ET||{}),rr=class{constructor(t){this.element=t;this.currentText=this.getText(),this.currentHTML=this.getHTML(),this.listen()}eventListeners={};disposeHandlers=[];currentText="";currentCaret=null;currentSelection={start:0,end:0};currentHTML="";isFocused=!1;isActive=!0;isSettingValue=!1;isSubmitting=!1;isPossibleClearInputAction=!1;isDisposed=!1;addEventListener(t,n){let r=o=>{n(o)};this.element.addEventListener(t,r),this.disposeHandlers.push(()=>{this.element.removeEventListener(t,r)})}removeEventListener(t,n){this.element.removeEventListener(t,n)}triggerChange(){let t=this.getText(),n=this.getHTML(),r=t!==this.currentText;this.isActive&&(t===""&&this.currentText!==""&&!this.isSettingValue&&!this.isPossibleClearInputAction&&(this.isSubmitting=!0,this.emit("submit")),!this.isSettingValue&&r&&!this.isSubmitting&&this.emit("change",{plainText:t}),r&&(this.currentSelection=this.getSelection()),this.currentText=t,this.isSubmitting=!1,(this.currentHTML!==n||n===null&&r)&&(this.emit("updated",{plainText:t}),this.triggerCaretPosition(),this.currentHTML=n))}triggerSelection(){let t=this.getSelection();(t.start!==this.currentSelection.start||t.end!==this.currentSelection.end)&&(this.currentSelection=t,this.emit("selection",t),this.triggerCaretPosition())}triggerCaretPosition(){let t=this.getCaretPosition();Nr(t,this.currentCaret)||(this.currentCaret=t,this.emit("caret",t))}handleKeyUp(t){let{key:n,shiftKey:r}=t;(n==="Enter"&&r===!0||n==="Backspace")&&this.triggerChange(),this.triggerSelection()}handleClick(){this.triggerSelection()}handleFocus(){this.isFocused||this.emit("focus"),this.triggerSelection(),this.isFocused=!0}handleBlur(){this.isPossibleClearInputAction=!1,this.isFocused&&this.emit("blur"),this.isFocused=!1}handleKeyDown(t){let{key:n,ctrlKey:r,metaKey:o}=t;this.isPossibleClearInputAction=Object.values(ET).includes(n)||n.toLowerCase()==="z"&&(r||o),this.emit("keydown",t)}handleCut(){this.isPossibleClearInputAction=!0,this.emit("cut",{selectionText:this.getSelectedText()})}handlePaste(t){var r,o;let n=((r=t.clipboardData)==null?void 0:r.getData("text"))||((o=t.clipboardData)==null?void 0:o.getData("text/plain"))||"";this.emit("paste",{pastedText:n,selectionText:this.getSelectedText()})}listen(t={shouldObserve:!0}){this.addEventListener("keydown",r=>this.handleKeyDown(r)),this.addEventListener("keyup",r=>this.handleKeyUp(r)),this.addEventListener("input",()=>this.triggerChange()),this.addEventListener("change",()=>this.triggerChange()),this.addEventListener("focus",()=>this.handleFocus()),this.addEventListener("blur",()=>this.handleBlur()),this.addEventListener("cut",()=>this.handleCut()),this.addEventListener("paste",r=>this.handlePaste(r)),this.addEventListener("click",()=>this.triggerSelection()),document.activeElement===this.element&&setTimeout(()=>{this.handleFocus()},0);let n=new MutationObserver(()=>{this.element.isConnected||(this.emit("unmounted"),this.dispose())});t!=null&&t.shouldObserve&&n.observe(document.body,{subtree:!0,childList:!0}),this.disposeHandlers.push(()=>{n.disconnect()}),this.currentSelection=this.getSelection()}focus(){this.element.focus()}emit(t,...n){this.isDisposed||this.eventListeners[t]&&this.eventListeners[t].forEach(r=>{r(...n)})}on(t,n){this.isDisposed||(this.eventListeners[t]||(this.eventListeners[t]=[]),this.eventListeners[t].push(n))}activate(){let t=this.isActive===!1;this.isActive=!0,t&&this.triggerChange()}deactivate(){this.isActive=!1}dispose(){this.disposeHandlers.forEach(t=>t()),this.eventListeners={},this.isDisposed=!0}};function CT(e){return e.top!==0||e.left!==0||e.height!==0||e.width!==0}var zo=class extends rr{observer;lastKnownSelection=null;getRootNode(){return this.element.getRootNode()}getText(){let t=new Range;return t.selectNodeContents(this.element),pl(this.element,t)}getHTML(){return this.element.innerHTML||""}getRange(){var i;let t=this.getRootNode();if(t.activeElement!==this.element)return null;let n="getSelection"in t?t.getSelection():window.getSelection();if(!n)return null;let r="getComposedRanges"in n&&t instanceof ShadowRoot?(i=n.getComposedRanges(t))==null?void 0:i[0]:n.rangeCount>0?n.getRangeAt(0):null;if(!r)return null;let o=this.element.ownerDocument.createRange();return o.setStart(r==null?void 0:r.startContainer,r==null?void 0:r.startOffset),o.setEnd(r==null?void 0:r.endContainer,r==null?void 0:r.endOffset),!o||!this.element.contains(o.startContainer)||!this.element.contains(o.endContainer)?null:o}getCaretPosition(){let t=this.getRange();if(!t||!t.collapsed||!("getBoundingClientRect"in t))return null;let n=t.getBoundingClientRect();return!CT(n)&&(t.insertNode(this.element.ownerDocument.createTextNode("\u2060")),n=t.getBoundingClientRect(),t.deleteContents(),!CT(n))?null:{top:n.top+n.height,left:n.left}}getSelection(){let t=this.getRange();if(t)return fl(this.element,t);let n=this.lastKnownSelection;if(n&&xT(this.element,n.start,n.end))return n;let r=as(this.element);return r.collapse(!1),fl(this.element,r)}getSelectedText(){let{start:t,end:n}=this.getSelection();return pl(this.element,Gr(this.element,t,n))}applyChanges(t){var o;if(!this.isActive)return;this.isSettingValue=!0;let n=this.getText(),r=t(this.element);return(o=this.observer)==null||o.takeRecords(),Promise.resolve(r).then(()=>{this.currentText=this.getText(),n!==this.currentText&&this.triggerChange(),this.isSettingValue=!1})}listen(t={shouldObserve:!0}){super.listen(t),this.observer=new MutationObserver(()=>{setTimeout(()=>{this.triggerChange()},0)}),t!=null&&t.shouldObserve&&this.observer.observe(this.element,{attributes:!0,characterData:!0,childList:!0,subtree:!0});let n=this.element.isContentEditable,r=new MutationObserver(()=>{this.element.isContentEditable!==n&&(n=this.element.isContentEditable,this.emit(this.element.isContentEditable?"enabled":"disabled"))});r.observe(this.element,{attributes:!0,attributeFilter:["contenteditable"]}),this.disposeHandlers.push(()=>r.disconnect())}dispose(){super.dispose(),this.observer&&this.observer.disconnect()}};var Vo=class extends rr{lastKnownSelection=null;getText(){return this.element.value}getHTML(){return null}getSelection(){let{selectionStart:t,selectionEnd:n}=this.element;return{start:t,end:n}}getSelectedText(){let t=this.getSelection();return t?this.getText().slice(t.start,t.end):""}getCaretPosition(){return null}applyChanges(t){if(!this.isActive)return;this.isSettingValue=!0;let n=this.getText(),r=t(this.element);return Promise.resolve(r).then(()=>{this.currentText=this.getText(),n!==this.currentText&&this.triggerChange(),this.isSettingValue=!1})}listen(){super.listen();let t=Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype,"value");Object.defineProperty(this.element,"value",{configurable:!0,get:()=>{var o;return(o=t==null?void 0:t.get)==null?void 0:o.call(this.element)},set:o=>{var i;(i=t==null?void 0:t.set)==null||i.call(this.element,o),this.triggerChange()}});let n=this.element.disabled,r=new MutationObserver(()=>{this.element.disabled!==n&&(n=this.element.disabled,this.emit(n?"disabled":"enabled"))});r.observe(this.element,{attributes:!0,attributeFilter:["disabled"]}),this.disposeHandlers.push(()=>r.disconnect())}};function bT(e,t,n){let r=`deepdesk-iframe-${e}`,o=document.getElementById(r);if(o)return o;let i=document.createElement("iframe"),s=new URL(t);return Object.entries(n).forEach(([a,l])=>{s.searchParams.append(a,l)}),i.style.position="absolute",i.style.left="-999em",i.style.width="0px",i.style.height="0px",i.tabIndex=-1,i.id=r,i.title=`iframe-${e}`,i.src=s.toString(),window.document.body.appendChild(i),i}function $M(e){if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}}var uy=class{constructor(t){this.name=t;this.broadcastChannel=new BroadcastChannel(t)}broadcastChannel;disposeHandlers=[];onMessage(t){this.broadcastChannel.addEventListener("message",t),this.disposeHandlers.push(()=>{this.broadcastChannel.removeEventListener("message",t)})}postMessage(t){this.broadcastChannel.postMessage(JSON.stringify(t))}close(){this.disposeHandlers.forEach(t=>t()),this.broadcastChannel.close()}},cy=class{constructor(t,n,r){this.name=t;this.targetOrigin=n;this.options=r;this.iframe=bT(t,`${this.targetOrigin}/sdk/proxy/proxy.html`,{channel:this.name,host:window.location.origin,debug:"1"}),document.body.appendChild(this.iframe)}iframe;disposeHandlers=[];onMessage(t){window.addEventListener("message",t),this.disposeHandlers.push(()=>{window.removeEventListener("message",t)})}postMessage(t){var n;(n=this.iframe.contentWindow)==null||n.postMessage(JSON.stringify(t),this.targetOrigin)}close(){var t;this.disposeHandlers.forEach(n=>n()),(t=this.iframe)==null||t.remove()}},dy=class{constructor(t){this.params=t;this.deepdeskUrl=t.deepdeskUrl,this.eventMap=t.eventMap,this.sessionId="deepdesk-general",this.defaultChannel=this.createChannel("deepdesk-general")}sessionId;deepdeskUrl;channel;defaultChannel;eventMap;get isCrossOrigin(){return this.params.deepdeskUrl!==(this.params.origin||window.location.origin)}setSessionId(t){this.sessionId!==t&&(this.cleanup(),z.info("Set sessionId",t),this.sessionId=t,this.channel=this.createChannel(t))}createChannel(t){let n=this.params.createCustomChannel?this.params.createCustomChannel(t):this.isCrossOrigin?new cy(t,this.deepdeskUrl,{debug:!0}):new uy(t),r=o=>{var s,a;if(o.origin!==this.deepdeskUrl)return;let i=$M(o.data);typeof i!="object"||i.type!=="event"||i.channel!==t||(z.info("Received broadcast event",this.sessionId,o),(a=(s=this.eventMap)[i.name])==null||a.call(s,i.payload))};return n.onMessage(r),n}send(t,n,r){var s,a;z.info("Broadcast event",{sessionId:this.sessionId,name:t,payload:n});let o={type:"event",name:t,payload:n};r!==!1&&((a=(s=this.eventMap)[t])==null||a.call(s,n));let i=this.sessionId==="deepdesk-general"?this.defaultChannel:this.channel;i==null||i.postMessage({...o,channel:this.sessionId})}cleanup(t=!1){var n,r;(n=this.channel)==null||n.close(),delete this.channel,t&&((r=this.defaultChannel)==null||r.close(),delete this.defaultChannel)}},TT=dy;var ls=class extends Error{constructor(n,r){super(n);this.body=r}name="CustomError"};var fy=e=>new Promise(t=>{setTimeout(t,e)});var us=class extends ls{name="ClientError"},my=class extends ls{name="ServerError"},py=new Map,pn=class e{constructor(t="",n={}){this.baseUrl=t;this.options=n;n.fetch&&(this.fetch=n.fetch)}latestRequestByUrl={};csrfToken;fetch=window.fetch.bind(window);static refreshingToken=null;patchFetch(t){this.fetch=t(this.fetch)}setCsrfToken(t){this.csrfToken=t}request(t,n={}){return new Promise((r,o)=>{let i={isAborted:!1,reject:o},s=`${this.baseUrl}${t}`,a=this.fetch,l=n.method===void 0||n.method.toLowerCase()==="get",{useCache:u=!1,abortLatest:c=!1,attempts:f=1,retryDelay:d=500,refreshTokenOn401:m=!0,retryOnError:y=C=>C instanceof TypeError,retryOnResponse:v=C=>C.status>=500,version:p="v1",...g}=n;if(u)if(l){if(py.has(s)){r(py.get(s));return}}else throw new Error(`Can't use 'useCache' for ${n.method}`);let h={credentials:"include",...g,headers:{"Content-Type":"application/json",...g.headers}};!l&&this.csrfToken&&(h.headers={...h.headers,"X-CSRFToken":this.csrfToken}),typeof p=="string"&&(h.headers={...h.headers,"X-Deepdesk-API-Version":p});let S=f,x=!1;if(!a)throw new Error("fetch is not set");this.latestRequestByUrl[s]&&c&&(this.latestRequestByUrl[s].isAborted=!0,this.latestRequestByUrl[s].reject(new Error("Aborted"))),this.latestRequestByUrl[s]=i;let T=async()=>(S--,a(s,h).then(async C=>v(C)&&!i.isAborted&&S>0?(await fy(d),T()):C.status===401&&m===!0&&x===!1?(x=!0,await this.refreshToken(),T()):C).catch(async C=>{if(y(C)&&!i.isAborted&&S>0)return await fy(d),T();throw C}));T().then(C=>C.json().catch(()=>null).then(k=>{C.status>=500?o(new my("Server Error",k)):C.status===401?o(new us("Unauthorized",k)):C.status===403?o(new us("Forbidden",k)):C.status===404?o(new us("Not Found",k)):C.status>=400&&o(new us("Bad Request",k)),delete this.latestRequestByUrl[s],u&&py.set(s,k),r(k)})).catch(C=>{o(C)})})}async validateToken(){let{has_valid_access_token:t}=await this.get("/auth/validate");if(!t)return!1;let{is_logged_in:n}=await this.get("/apis/admin/session/validate/",{version:null});return!!n}refreshToken(){return e.refreshingToken||(e.refreshingToken=this.get("/auth/refresh",{refreshTokenOn401:!1}).finally(()=>{setTimeout(()=>{e.refreshingToken=null},1e3*60)})),e.refreshingToken}get(t,n){return this.request(t,n)}post(t,n,r){return this.request(t,{method:"POST",body:JSON.stringify(n),...r})}patch(t,n,r){return this.request(t,{method:"PATCH",body:JSON.stringify(n),...r})}put(t,n,r){return this.request(t,{method:"PUT",body:JSON.stringify(n),...r})}delete(t,n){return this.request(t,{method:"DELETE",...n})}};var WM;(t=>{let e;(l=>(l.SEND_MESSAGE="Send Message",l.HANDLING_TIME="Handling Time",l.START_AUTOFLOW="Start Autoflow",l.ABORT_AUTOFLOW="Abort Autoflow",l.ADD_TO_PERSONAL_COLLECTION="Add to personal collection",l.DELETE_FROM_PERSONAL_COLLECTION="Delete from personal collection"))(e=t.EventType||={})})(WM||={});function uf(e){return{...J(e),tags:e.tags}}var or=class e{constructor(t,n={}){this.options=n;this.client=new pn(t,{fetch:n.fetch}),this.client.patchFetch(r=>async(o,i)=>{let s=await r(o,i);return this.handleDeepdeskVersionHeaders(s),s})}latestReceivedDeepdeskVersions={};client;shouldFetchCsrfToken=!0;static exchangeTokenPromise=null;async preflight(){if(this.shouldFetchCsrfToken){this.shouldFetchCsrfToken=!1;let t=await this.getCsrfToken();this.client.setCsrfToken(t)}return this.options.token?(e.exchangeTokenPromise||(e.exchangeTokenPromise=this.exchangeTokenForAccessCookie(this.options.token)),e.exchangeTokenPromise):Promise.resolve()}async createConversation(t){await this.preflight(),z.info(`Creating conversation for session ${t.sessionId} and agent ${t.agentId}`);let n=await this.client.post("/api/conversations",{...Ae(t),tags:t.tags},{version:"v2"});return uf(n)}async getProfile(t){let n=await this.client.get(`/apis/admin/profiles/${t}/`,{version:null,useCache:!0});return J(n)}async getKnowledgeAssistant(t){let n=await this.client.get(`/apis/admin/knowledge-assist/assistants/${t}/`,{version:null,useCache:!0});return J(n)}async getContentTypes(){let t=await this.client.get("/apis/admin/content-types/",{version:null,useCache:!0});return J(t)}async getAccount(){let t=await this.client.get("/apis/admin/account/",{version:null,useCache:!0});return J(t)}async getPlatformConfig(){let{config:t}=await this.client.get("/platform/config/",{version:null,useCache:!0});return J(t)}async checkUserExists(t){let{exists:n}=await this.client.get(`/apis/admin/users/exists?external_id=${t}`);return n}async getConversationBySessionId(t,n={}){await this.preflight(),z.info(`Getting conversation for session ${t}`);let{attempts:r=1,retryDelay:o=1e3}=n,i=await this.client.get(`/api/conversations/by_session_id/${t}`,{attempts:r,retryDelay:o,retryOnResponse:s=>s.status===404||s.status>=500,version:"v2"});return z.info(`Successfully retrieved conversation ${i.id} for session ${t}`),uf(i)}async isConversationSupported(t,n={}){z.info(`Check if conversation for session ${t} is supported`);let{attempts:r=1,retryDelay:o=1e3}=n;return(await this.client.get(`/api/conversations/by_session_id/${t}/active_profile`,{attempts:r,retryDelay:o,retryOnResponse:s=>s.status===404||s.status>=500,version:"v2"})).has_active_profile}async updateConversation(t,n){let r=Ae(n);n.tags&&(r.tags=n.tags);let o=await this.client.put(`/api/conversations/${t}`,r,{version:"v2"});return uf(o)}async postMessages(t,n){return(await this.client.post(`/api/conversations/${t}/messages`,n.map(o=>({...Ae(o),tags:o.tags})),{version:"v2"})).map(o=>uf(o))}async sendEvent(t,n){let{data:r,...o}=n,i=Object.entries(this.latestReceivedDeepdeskVersions).reduce((s,[a,l])=>({...s,[a]:l}),{});return this.client.post("/api/events",Ae({...i,...o,data:r,name:t}),{version:"v2"})}async sendEventV1(t,n){let r=Object.entries(this.latestReceivedDeepdeskVersions).reduce((o,[i,s])=>({...o,[i]:s}),{});return this.client.post("/api/events",{event:t,data:Ae({...n,...r})})}async getEntities(t){return(await this.client.post("/api/entities",{messages:t.filter(r=>r.text)})).entities}async getSummary(t,n={}){let r=await this.client.post("/api/summary",{conversation:{messages:t.filter(o=>o.text&&o.source),agent_id:n.agentId,id:n.externalConversationId},prompt_instruction:n.promptInstruction,model:n.model});return J(r)}async getTemporaryExchangeToken(){return(await this.client.get("/auth/exchange-token",{version:null})).jwt}async exchangeTokenForAccessCookie(t){return this.client.post("/apis/admin/session/jwt/",{jwt:t},{version:null}).catch(n=>{throw z.warn(`Invalid token '${t}'`),n})}async authenticateWithKey(t,n){await this.preflight(),await this.client.post("/apis/admin/session/api-key/",Ae(n),{version:null,refreshTokenOn401:!1,headers:{apikey:t}})}async getTextSuggestions(t,n={},r){return r==="sticky-messages"?this.getPinnedMessages(t):(await this.client.post(`/api/conversations/${t}/recommend/${r}`,Ae(n),{abortLatest:!0})).map(i=>({...J(i),text:i.text||i.url||i.message,source:r,type:r})).filter((i,s,a)=>s===a.findIndex(l=>l.text===i.text))}async isLoggedIn(){return await this.preflight(),this.client.validateToken()}async getAutocompleteSuggestions(t,n){return(await this.client.post(`/api/conversations/${t}/autocomplete`,Ae(n),{abortLatest:!0})).map(o=>({score:1,source:o.source,sourceText:o.source_text,text:o.label,trainingJobs:o.training_jobs,searchKeywords:o.search_keywords,type:o.source})).filter((o,i,s)=>i===s.findIndex(a=>a.text===o.text))}async getPinnedMessages(t){let n=await this.client.get(`/api/conversations/${t}/sticky-messages`,{abortLatest:!0});return J(n).map(r=>({...r,text:r.message,source:"sticky-messages",type:"pinned-message"}))}async getStyleSuggestions(t){let n=await this.client.post("/api/style-suggestions",Ae(t),{abortLatest:!0});return J(n)}async search(t){let n=await this.client.post(`/api/profiles/${t.profile}/search`,Ae(t),{version:"v2"});return J(n)}async knowledgeAssist(t,n,r,o={}){let i=await this.client.post(`/api/knowledge-assist/assistants/${r}/search`,Ae({question:t.question,promptInstruction:t.promptInstruction,chatHistory:n.map(s=>({question:s.question,answer:s.answer.answer})),agentId:o.agentId,conversationId:o.conversationId}),{version:"v2"});return J(i)}async requestLoginByEmail(t){let n=await this.client.post("/apis/admin/session/passwordless/request/",{email:t},{version:null});return J(n)}async requestPasswordlessToken(){let t=await this.client.get("/apis/admin/session/passwordless/request/",{version:null});return J(t.token)}async getCsrfToken(){let{token:t}=await this.client.get("/apis/admin/session/csrf/",{version:null});return t}async verifyLoginToken(t){let n=await this.client.post("/apis/admin/session/passwordless/login/",{token:t},{version:null});return J(n)}async evaluateRule(t,n,r,o={}){let i=new URLSearchParams;o.raiseForFailingConditions&&i.set("raise_for_failing_conditions","true");let s=await this.client.post(`/api/conversations/${n}/rules/${t}/evaluate?${i.toString()}`,r,{version:"v2"});return J(s.cues)}async getRules(){let t=new URLSearchParams,n=await this.client.get(`/apis/admin/rule-engine/rules/?${t.toString()}`,{version:null,useCache:!0});return J(n)}async translateMessages(t){let n=await this.client.post("/api/translate",Ae(t),{version:"v2"});return J(n)}handleDeepdeskVersionHeaders(t){t.headers.forEach((n,r)=>{let o=r.toLowerCase(),i=o.match(Ov);if(!n||!i)return;let s=i[1].replace("-","_"),a=this.latestReceivedDeepdeskVersions[s];a&&n&&a!==n&&z.warn(`Overwritten Version header ${o}: ${JSON.stringify(a)} -> ${JSON.stringify(n)}`),this.latestReceivedDeepdeskVersions[s]=n})}};var ml=class{constructor(t,n){this.url=t;this.options={timeout:25e3,...n}}eventListeners={};options;timeoutTimer;eventSource;proxyEvent(t){this.eventSource.addEventListener(Dg(t),n=>{let{data:r}=n;try{let o=JSON.parse(r);this.emit(t,J(o))}catch{z.warn(`Invalid JSON for ${t}: ${r}`)}})}connect(){clearTimeout(this.timeoutTimer);let t=new EventSource(this.url,{withCredentials:!0});this.eventSource=t;let n=!1;t.onopen=()=>{n=!0},t.onerror=()=>{n&&t.readyState===2&&this.connect()},this.timeoutTimer=setTimeout(()=>{t.close(),this.connect()},this.options.timeout),Object.keys(this.eventListeners).forEach(r=>{this.proxyEvent(r)})}disconnect(){var t;clearTimeout(this.timeoutTimer),this.eventListeners={},(t=this.eventSource)==null||t.close()}emit(t,n){this.eventListeners[t]&&this.eventListeners[t].forEach(r=>r(n))}on(t,n){return this.eventListeners[t]||(this.eventListeners[t]=[]),this.eventListeners[t].push(n),this.proxyEvent(t),()=>{this.off(t,n)}}off(t,n){let r;this.eventListeners[t]&&(r=this.eventListeners[t].indexOf(n),r>-1&&this.eventListeners[t].splice(r,1))}};var qM;(t=>{let e;(i=>(i.Started="Started",i.Aborted="Aborted",i.Completed="Completed"))(e=t.AutoflowSessionState||={})})(qM||={});var gl=class{constructor(t,n={}){this.apiUrl=t;this.client=new pn(t,n)}client;streams={};logger=z;async getCustomMessages(t){let n=await this.client.get(`/sessions/${t}/suggestions`);return J(n.suggestions)}async sendCustomMessage(t,n){let r=await this.client.post(`/sessions/${t}/messages`,Ae(n));return J(r)}async answerCustomMessage(t,n){await this.client.post(`/sessions/${t}/answers`,Ae(n))}async getAutoflows(t){let n=await this.client.get(`/sessions/${t}/autoflows`);return J(n.autoflows)}async startAutoflowSession(t){let n=await this.client.post("/autoflow-sessions",Ae(t));return J(n)}async stopAutoflowSession(t){await this.client.delete(`/autoflow-sessions/${t}`)}openStream(t){return this.streams[t]||(this.streams[t]=new ml(`${this.apiUrl}/sessions/${t}/events`),this.streams[t].connect()),this.streams[t]}closeStream(t){this.streams[t]||(this.streams[t].disconnect(),delete this.streams[t])}};var kT={startTime:null,stopTime:null},PT=W({name:"handlingTime",initialState:kT,reducers:{handlingTimeStart(e){if(e.startTime&&!e.stopTime)throw new Error("Timing already started");e.startTime=new Date,e.stopTime=null},handlingTimeStop(e){if(!e.startTime)throw new Error("Timing not started");e.stopTime=new Date},handlingTimeReset(e){e.startTime=null,e.stopTime=null}},extraReducers:e=>{e.addCase(le,()=>kT)}}),{handlingTimeStart:RT,handlingTimeStop:cf,handlingTimeReset:AT}=PT.actions,LT=PT.reducer;var IT=(e={})=>{let t={onAuthError:ji(!1),...e};return n=>r=>o=>("error"in o&&o.error.message==="Unauthorized"&&n.dispatch(t.onAuthError),r(o))};var df={list:{keywordMatches:[]},fetchState:"idle",isInitialRequest:null};var Ko=B("styleSuggestions/getAll",async({text:e},t)=>{var s;let{deepdeskAPI:n}=t.extra,r=t.getState(),{showStyleSuggestions:o}=r.settings,i=(s=r.conversation.current)==null?void 0:s.profileCode;if(!o)return df.list;if(!i)throw new Error("No current conversation to fetch pinned messages");return n.getStyleSuggestions({profileCode:i,message:e})}),GM=W({name:"styleSuggestions",initialState:df,reducers:{},extraReducers:e=>{e.addCase(Ko.pending,t=>{t.isInitialRequest=t.isInitialRequest===null,t.fetchState="loading"}).addCase(Ko.rejected,t=>{t.fetchState="error"}).addCase(Ko.fulfilled,(t,n)=>{t.fetchState="done",Nr(t.list,n.payload)||(t.list=n.payload)}).addCase(Eo,t=>{t.list=df.list}).addCase(le,()=>df)}}),OT=GM.reducer;var NT=(e={})=>{let t,n=!0,r={getStyleSuggestions:Ko,debounce:500,...e};return o=>i=>s=>{var m;let a=o.getState().input.text,l=i(s),u=o.getState();if(u.auth.isLoggedIn!==!0)return l;let{showStyleSuggestions:c}=u.settings;if(!((m=u.conversation.current)==null?void 0:m.id)||!c)return l;let{text:d}=u.input;return d===a&&!n||(clearTimeout(t),d==="")||(t=setTimeout(()=>{n=!1,o.dispatch(r.getStyleSuggestions({text:d}))},e.debounce)),l}};function YM(e,t){return e.text===t.text&&e.selection.start===t.selection.start&&e.selection.end===t.selection.end}var MT=(e={})=>{let t={getTextSuggestions:un,getAutocompleteSuggestions:Xa,debounce:200,check:Ji,...e},n;return r=>o=>i=>{var v;let{input:{userCommitted:s}}=r.getState(),a=o(i),l=r.getState();if(l.auth.isLoggedIn!==!0)return a;let{recommendTextSuggestions:u,showTabCompletion:c}=l.settings,f=(v=l.conversation.current)==null?void 0:v.id,d=i.type===Pd.toString();if(!f||!u&&!c)return a;let{input:{userCommitted:m}}=l;return YM(m,s)&&!d||(clearTimeout(n),!t.check(l))||(n=setTimeout(()=>{let p=Vi(l);p===""?r.dispatch(t.getTextSuggestions("default")):r.dispatch(t.getAutocompleteSuggestions(p))},d?0:t.debounce)),a}};var _T=Ko.fulfilled.toString();function XM(e,t){let n=new Set([...t.keywordMatches.map(o=>o.keyword)]),r=[];return n.forEach(o=>{let i=e.keywordMatches.filter(l=>l.keyword===o),s=t.keywordMatches.filter(l=>l.keyword===o),a=s.length-i.length;a<=0||r.push(...s.slice(0,a))}),r}var DT=e=>t=>n=>r=>{var u;if(r.type!==_T){n(r);return}let o=t.getState().styleSuggestions.list;n(r);let i=t.getState(),s=i.styleSuggestions.list,a=(u=i.conversation)==null?void 0:u.current;if(o===s)return;let l=XM(o,s);r.type===_T&&l.length>0&&e.sendEvent("style suggested",{conversationId:a==null?void 0:a.id,data:{keywordMatches:l}})};var QM=oc({answer:WE,auth:Zx,autoflows:lb,conversation:a1,contentTypes:oE,customMessages:yb,passwordlessToken:xb,entities:IE,knowledgeAssistant:VE,handlingTime:LT,info:k1,input:E1,settings:$x,profile:YE,search:N1,summary:HE,styleSuggestions:OT,ui:xC,rules:Tb,textSuggestions:oC});function FT(e){return Qw({reducer:QM,middleware:t=>[...t({thunk:{extraArgument:{dynamicThunkObject:e.dynamicThunkObject,deepdeskAPI:e.deepdeskAPI,deepdeskBrokerAPI:e.deepdeskBrokerAPI}},serializableCheck:!1}),IT(),MT({debounce:200}),NT({debounce:500}),DT(e.deepdeskAPI),...e.middleware?e.middleware:[]],preloadedState:e.preloadedState})}var ZM=e=>{var t;return((t=e==null?void 0:e.type)==null?void 0:t.toLowerCase())??"unknown"},JM=e=>t=>n=>r=>{var a;let o=t.getState(),i=Ag("inlineSuggestions")(o);switch(r.type){case ji.toString():{!r.payload&&e.emit("logout",void 0);break}case an.fulfilled.toString():r.payload.length>0&&e.sendEvent("entities found",{conversationId:o.conversation.current.id,data:{entities:r.payload}});break;case Gn.fulfilled.toString():e.sendEvent("conversation summarized",{conversationId:o.conversation.current.id,data:{summary:r.payload.summary}});break;case Ye.toString():e.sendEvent(r.payload.name,{conversationId:((a=r.payload.options)==null?void 0:a.includeConversationData)&&o.conversation.current.id,data:r.payload.data});break;case Vc.toString():e.handleKeyDown(r.payload);break;case Eo.toString():e.logSendMessage(r.payload);break;case Kc.toString():e.handleInputChanged(r.payload);break;case Bo.fulfilled.toString():r.isBroadcasted||e.broadcast(Ug,r,!1),e.emit("cues",r.payload);break;default:break}let s=n(r);switch(r.type){case Eo.toString():e.handleAfterSendMessage(r.payload);break;case Za.toString():e.onUpdateShowTabHint(r.payload);break;case cf.toString():e.logHandlingTime();break;case Cn.toString():{let{start:l,end:u}=o.input.selection;e.emit("select-suggestion",{type:ZM(r.payload.suggestion),...r.payload,replace:r.payload.replace==="selection"?{start:l,end:u}:{start:0,end:u}},{mayApplyChanges:!0}),i&&(t.dispatch(En([])),t.dispatch(Kn()));break}case zc.toString():{let{start:l,end:u}=o.input.selection;e.emit("replace",{...r.payload,replace:r.payload.replace==="selection"?{start:l,end:u}:{start:0,end:u}},{mayApplyChanges:!0});break}case ka.toString():{let l=t.getState(),{text:u,selection:c}=l.input.userCommitted;e.emit("reset",{text:u,selectionAfter:c},{mayApplyChanges:!0});break}case $c.toString():e.emit("select-image",r.payload,{mayApplyChanges:!0}),e.sendEvent("Image attached",{conversationId:o.conversation.current.id,data:{path:r.payload.suggestion.image,title:r.payload.suggestion.title}});break;case En.toString():{i&&r.payload.length>0&&t.dispatch(_r(0));break}default:break}return s},HT=JM;function gy(e){return e.toISOString().replace("T"," ").replace("Z","")}function UT(e,t){var o,i,s;let{startTime:n,stopTime:r}=e.handlingTime;if(!n||!r)throw new Error("No startTime and stopTime for handling time metrics");return{conversationId:e.conversation.current.id,clientVersion:t.version,agentId:(o=e.info.agentInfo)==null?void 0:o.agentId,agentName:(i=e.info.agentInfo)==null?void 0:i.agentName,agentEmail:(s=e.info.agentInfo)==null?void 0:s.agentEmail,timeStart:gy(n),timeStop:gy(r)}}function BT(e,t,n){var k,L,I;let{text:r,metrics:{numCharsTyped:o,numCharsPasted:i,numCharsCut:s,numCharsDeleted:a,numPaste:l,agentStartedTypingTimestamp:u,externalTimeTotalSeconds:c,pastes:f,cuts:d,deletions:m,textSuggestions:y,offeredTextSuggestions:v}}=t[e],p=r.length,h=y.reduce((N,{text:V,searchTerm:_})=>N+V.length-(_?_.length:0),0),S=u??Date.now(),x=(Date.now()-S)/1e3+(c||0),T=o/x,C=y.reduce((N,{searchTerm:V})=>N+(V?V.length:0),0);return{conversationId:t.conversation.current.id,source:"agent",text:r,clientVersion:n.version,pastes:f,cuts:d,deletions:m,lenTextTyped:o+C,lenTextTotal:p,lenTextAssisted:h,lenTextPasted:i,lenTextCut:s,lenTextDeleted:a,timeTotalSeconds:x,charsPerSecond:T,numPastes:l,textSuggestionsV2:y,suggestionsCounters:[{source:"gpt",countOffered:v.filter(N=>N.source==="gpt").length}],agentId:(k=t.info.agentInfo)==null?void 0:k.agentId,agentName:(L=t.info.agentInfo)==null?void 0:L.agentName,agentEmail:(I=t.info.agentInfo)==null?void 0:I.agentEmail}}function hy(e,t){var i;let n=e.closest(t);if(n)return n;let r=e.getRootNode().host;if(r instanceof HTMLElement)return hy(r,t);let o=(i=e.ownerDocument.defaultView)==null?void 0:i.frameElement;return o?hy(o,t):null}function jT(e,t){return hy(e,t)}function zT(e){return typeof e=="object"&&e!==null&&"name"in e&&"message"in e}function e2(e){return typeof e=="object"&&e!==null&&"tagName"in e}function ff(e){return e2(e)&&(Kr(e)||_d(e))}var VT,kn=new Map,t2=["bottom","height","left","right","top","width"],n2=(e={},t={})=>t2.some(n=>e[n]!==t[n]);function KT(e){var n,r;if(e.ownerDocument===document)return[];let t=((r=(n=e.ownerDocument)==null?void 0:n.defaultView)==null?void 0:r.frameElement)??null;return t?[t,...KT(t)]:[]}function $T(e,t){return!e||!t?null:{...e,top:e.top+t.top,left:e.left+t.left}}var pf=!1,WT=()=>{pf=!0;let e=[];if(kn.forEach((t,n)=>{if(!n.isConnected){t.rect=null,e.push(t),kn.delete(n);return}let r=n.getBoundingClientRect();n2(r,t.rect)&&(t.rect=r,e.push(t))}),e.forEach(t=>{let n=t.parentRects?t.parentRects.reduce($T,t.rect):t.rect;t.callbacks.forEach(r=>r(n))}),kn.size===0){pf=!1;return}VT=window.requestAnimationFrame(WT)};function yy(e,t){let n=KT(e),r=[],o=n.map((i,s)=>yy(i,a=>{r[s]=a;let l=kn.get(e);if(!l)return;let u=r.reduce($T,l.rect);l.callbacks.forEach(c=>c(u))}));return{observe(i=!0){if(o.forEach(s=>s.observe(!1)),kn.has(e)){let s=kn.get(e);s.callbacks.push(t),s.rect&&t(s.rect)}else kn.set(e,{rect:void 0,callbacks:[t],parentRects:r});i&&!pf&&WT()},unobserve(){o.forEach(s=>s.unobserve());let i=kn.get(e);if(i){let s=i.callbacks.indexOf(t);s>=0&&i.callbacks.splice(s,1),i.callbacks.length||kn.delete(e),kn.size||(cancelAnimationFrame(VT),pf=!1)}}}}var qT,Pn=new Map,GT=()=>{Pn.forEach((e,t)=>{if(!t.isConnected){Pn.delete(t);return}let{clientHeight:n,scrollHeight:r}=t,o=r>n;e.visible!==o&&(e.visible=o,e.callbacks.forEach(i=>i(e.visible)))}),Pn.size!==0&&(qT=window.requestAnimationFrame(GT))};function YT(e,t){return{observe(){let n=Pn.size===0;Pn.has(e)?Pn.get(e).callbacks.push(t):Pn.set(e,{visible:void 0,callbacks:[t]}),n&>()},unobserve(){let n=Pn.get(e);if(n){let r=n.callbacks.indexOf(t);r>=0&&n.callbacks.splice(r,1),n.callbacks.length||Pn.delete(e),Pn.size||cancelAnimationFrame(qT)}}}}var vy=["borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","borderStyle","boxSizing","color","overflowWrap","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontWeight","fontKerning","lineHeight","letterSpacing","paddingLeft","paddingTop","paddingRight","paddingBottom","width","height","textIndent","whiteSpace","wordBreak","wordSpacing","wordWrap"];function Sy(e,t,n){return n.forEach(r=>{t.style[r]=e[r]})}function cs(e){return parseFloat(e)}function mf(e){return Math.round(e*1e6)}function XT(e){return e/1e6}function wy(e,t,n){if(e.boxSizing==="content-box")return;let{clientWidth:r}=t,o=cs(e.width),i=cs(e.borderLeftWidth),s=cs(e.borderRightWidth),a=cs(e.paddingRight),l=XT(mf(o)-mf(i)-mf(s)),u=XT(mf(r));if(l-u>2){let c=l-u;n.style.paddingRight=`${a+c}px`}}function hl(e,t={}){var c;let n=t.overlayContainer||document.createElement("div");n.style.display="none",n.style.position=t.position??"fixed",n.style.pointerEvents="none",n.style.borderColor="transparent",Fo(n);let r=window.getComputedStyle(e),o=!0,i=()=>{n.scrollTop=e.scrollTop};Sy(r,n,vy),wy(r,e,n),t.mirrorOverflow&&(n.style.overflow="hidden",e.addEventListener("scroll",i));let s=YT(e,()=>{Sy(r,n,vy),wy(r,e,n),i(),setTimeout(i,0)}),a,l=!0,u=yy(e,f=>{if(f===null){t.onRemove&&t.onRemove(),n.remove();return}if(!l&&t.onMoveStart&&(Promise.resolve().then(()=>t.onMoveStart()),l=!0),clearTimeout(a),a=setTimeout(()=>{t.onMoveEnd&&t.onMoveEnd(),l=!1},200),f.height===0&&f.width===0){if(o===!0)return;t.onHide&&t.onHide(),n.style.display="none",o=!0;return}if(Sy(r,n,vy),wy(r,e,n),i(),n.style.top=`${f.top}px`,n.style.left=`${f.left}px`,t.closestScrollElement&&t.closestScrollElement!==e){let d=t.closestScrollElement.getBoundingClientRect(),m=window.getComputedStyle(t.closestScrollElement),y=cs(m.borderTopWidth),v=cs(m.borderBottomWidth),p=d.top+y-f.top,g=f.top+f.height+-(d.top+d.height-v);n.style.clipPath=`inset(${p}px 0px ${g}px 0px)`}o&&(n.style.display="block",t.onShow&&t.onShow(),o=!1)});return t.appendTo?t.appendTo.appendChild(n):(c=e.parentElement)==null||c.appendChild(n),u.observe(),s.observe(),[n,()=>{e.removeEventListener("scroll",i),u.unobserve(),s.unobserve()}]}var QT=(e,t)=>({value(){try{let n=sessionStorage.getItem(`dd-${e}`);if(!n)return t;try{return JSON.parse(n)}catch{return t}}catch{return t}},update(n){try{sessionStorage.setItem(`dd-${e}`,JSON.stringify(n))}catch{z.warn("[Deepdesk] SessionStorage is blocked by browser")}}});function r2(e){return e.offsetParent!==null}function ZT(e){if(!r2(e))return!1;let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function gf(e,t,n=100){let r=ZT(e);t({isVisible:r});let o=setInterval(()=>{let i=ZT(e);i!==r&&(r=i,t({isVisible:r}))},n);return()=>{clearTimeout(o)}}var Ie=w(b());var JT=QT("showTabHint",!0),yl=class e{static version="11.2.0";static count=0;deepdeskApi;inputMediator=null;version;broadcastEvents;eventListeners={};unmountHandlers=[];widgetRoot=null;dynamicThunkObject={};isMounted=!1;instanceId;shouldRender=!0;store;constructor({deepdeskUrl:t,brokerUrl:n,version:r=e.version||"unknown",locale:o="en-US",token:i,fetch:s,productName:a,createCustomChannel:l}){let u=t.replace(/\/api$/,"");this.deepdeskApi=new or(u,{token:i,fetch:s}),this.version=r,this.instanceId=e.count++;let c={deepdeskAPI:this.deepdeskApi,dynamicThunkObject:this.dynamicThunkObject,middleware:[HT({broadcast:(f,d,m)=>{this.broadcastEvents.send(f,d,m)},emit:(f,d,m)=>this.emit(f,d,m),handleAfterSendMessage:f=>this.handleAfterSendMessage(f),handleInputChanged:f=>this.handleInputChanged(f),handleKeyDown:f=>this.handleKeyDown(f),logHandlingTime:()=>this.logHandlingTime(),logSendMessage:f=>this.logSendMessage(f),onUpdateShowTabHint:f=>JT.update(f),sendEvent:(f,d)=>this.deepdeskApi.sendEvent(f,d)})]};n&&Object.assign(c,{deepdeskBrokerAPI:new gl(n)}),this.store=FT(c),this.broadcastEvents=new TT({debug:!0,deepdeskUrl:u,eventMap:M1(this.store),createCustomChannel:l}),this.store.dispatch(Za(JT.value())),this.store.dispatch(Nc({locale:o,adminUrl:u,productName:a}))}get state(){return this.store.getState()}get settings(){return this.state.settings}get selectedTextSuggestion(){return this.state.input.textSuggestions[this.state.input.selectedSuggestionIndex]??null}hasConversation(){return!!this.state.conversation.current}conversationId(){if(!this.hasConversation())throw new Error("No conversation loaded");return this.state.conversation.current.id}sessionId(){if(!this.hasConversation())throw new Error("No conversation loaded");return this.state.conversation.current.sessionId}shouldAbort(){return this.state.conversation.isSupported===!1?(z.warn("Conversation is not supported"),!0):this.hasConversation()?this.state.profile.data?!1:(z.warn("Profile has not been loaded (yet)"),!0):(z.warn("No conversation loaded (yet)"),!0)}login(){return this.store.dispatch(ji(null)),this.store.dispatch(zn()),new Promise(t=>{let n=this.store.subscribe(()=>{let r=this.store.getState();tt(r)&&Wx(r)!=="loading"&&(n(),t())});this.unmountHandlers.push(()=>{n()})})}async isLoggedIn(){return(await this.store.dispatch(zn())).payload}async setPlatformAgentId(t){try{if((await this.deepdeskApi.client.get("/apis/admin/session/me/",{version:null})).external_id)return;await this.deepdeskApi.client.request("/apis/admin/session/me/",{method:"PATCH",body:JSON.stringify({external_id:t}),version:null})}catch(n){z.warn("Failed to attach user:",n)}}async isConversationSupported(t,n){return(await this.store.dispatch(Ng({sessionId:t,options:n}))).payload}async createConversation(t){return this.hasConversation()&&this.sessionId()!==t.sessionId&&this.resetConversation(),(await this.store.dispatch(Fc(t))).payload}async getConversationBySessionId(t,n){return this.hasConversation()&&this.sessionId()!==t&&this.resetConversation(),(await this.store.dispatch(Hc({sessionId:t,options:n}))).payload}async upsertConversation(t){return this.hasConversation()&&this.sessionId()!==t.sessionId&&this.resetConversation(),(await this.store.dispatch(Mg(t))).payload}async postMessages(t){return(await this.store.dispatch(Bc(t))).payload}async updateConversation(t){return(await this.store.dispatch(Uc(t))).payload}resetConversation(){this.store.dispatch(le()),this.loadProfileConfigPromise=null,this.dynamicThunkObject.conversationQuery=null}async getSummary(){let t=await this.store.dispatch(Gn());if(t.error)throw new Error(t.error.message);return t.payload.summary}configure(t){this.store.dispatch(Nc(t))}setVisitorInfo(t){this.store.dispatch(T1(t))}async setAgentInfo(t){await this.store.dispatch(Pa(t))}async setAgentSettings(t){await this.store.dispatch(Fg(t))}async getAgentSettings(){return(await this.store.dispatch(Hg())).payload}async refresh(){if(this.shouldAbort())return Promise.resolve();this.inputMediator&&this.handleInputChanged(this.inputMediator.getText());let t=[];return this.store.dispatch(Pd()),t.push(this.refreshWidgetSuggestions()),Promise.all(t).then(()=>{})}notifyInputChanged(t){this.store.dispatch(Kc(t))}notifyKeyDown(t){this.store.dispatch(Vc(t))}notifyPaste(t,n){this.store.dispatch(v1({text:t,selectionText:n}))}notifyCut(t){this.store.dispatch(h1(t))}notifyExternalSuggestion(t){this.store.dispatch(Cn(t)),this.store.dispatch(Kn())}async evaluateRule(t,n={}){let{payload:r,error:o}=await this.store.dispatch(Bo({label:t,params:n}));if(o)throw new Error(o.message);return r}handleInputChanged(t){let{overlayCollapsed:n,openOverlayWhenTyping:r}=this.state.ui;n&&r&&this.store.dispatch(zr({collapse:!1})),this.inputMediator&&this.store.dispatch(d1({text:t,html:this.inputMediator.getHTML(),selection:this.inputMediator.getSelection()})),!this.shouldAbort()&&(this.isMounted||this.store.dispatch(En([])))}handleKeyDown(t){let{overlayCollapsed:n}=this.state.ui,{textSuggestions:r,selectedSuggestionIndex:o,selection:i}=this.state.input,{inlineSuggestions:s}=this.state.settings,a=r.length>0,l=o!==-1;if(this.store.dispatch(y1(l1(t))),t.key!=="Tab"&&!this.settings.showTextSuggestions)return;let u=()=>{n||!a||i&&(t.shiftKey||(this.store.dispatch(p1()),s||this.stageSelectedSuggestion({inputType:"arrow"}),t.preventDefault()))},c=()=>{n||!a||s&&o<=0||i&&(t.shiftKey||(this.store.dispatch(g1()),t.preventDefault(),!s&&(this.state.input.selectedSuggestionIndex===-1?this.store.dispatch(ka()):this.stageSelectedSuggestion({inputType:"arrow"}))))};switch(t.key){case"Up":case"ArrowUp":s?c():u();return;case"Down":case"ArrowDown":{s?u():c();return}case"Esc":case"Escape":{s&&l&&this.store.dispatch(_r(-1)),this.state.input.selectedSuggestionIndex!==-1?(this.store.dispatch(_r(-1)),this.store.dispatch(ka()),t.preventDefault()):n||(this.store.dispatch(zr({collapse:!0})),this.store.dispatch(SC(!0)),t.preventDefault());return}case"Tab":{let{userCommitted:f}=this.state.input,d=f.text.substring(0,f.selection.end),{tabCompletionSuggestion:m}=this.state.input;this.store.dispatch(Za(!1)),this.state.input.selectedSuggestionIndex>-1?this.stageSelectedSuggestion({inputType:"tab"}):!s&&this.settings.showTabCompletion&&m&&m.text.startsWith(d)&&(this.store.dispatch(Cn({text:m.text,suggestion:m,eventMetrics:{inputType:"tab"},replace:"until-selection-end"})),this.store.dispatch(Kn())),t.preventDefault();break}default:}}handleAfterSendMessage(t){this.emit("send-message",t),this.store.dispatch(S1()),this.store.dispatch(En([]))}handlingTimeStart(){this.state.handlingTime.startTime||(z.info("Start handling time"),this.store.dispatch(RT()))}handlingTimeStop(){this.state.handlingTime.startTime&&(z.info("Stop handling time"),this.store.dispatch(cf()))}logSendMessage(t){let n=BT("input",this.state,{version:this.version});t&&(Object.assign(n,{text:t}),Object.assign(n,{lenTextTotal:t.length})),this.deepdeskApi.sendEventV1("Send Message",n),this.emit("send-message-event",n)}logHandlingTime(){let t=UT(this.state,{version:this.version});this.deepdeskApi.sendEventV1("Handling Time",t),this.store.dispatch(AT())}notifySubmit(t={}){this.shouldAbort()||(this.store.dispatch(Kn()),this.store.dispatch(Eo(t.text??this.state.input.text)))}stageSelectedSuggestion(t){let n=this.state.input.selectedSuggestionIndex,{textSuggestions:r}=this.state.input;this.store.dispatch(Cn({text:r[n].text,suggestion:r[n],eventMetrics:t,replace:"until-selection-end"}))}emit(t,n,r={}){let o=()=>{this.eventListeners[t]&&this.eventListeners[t].forEach(i=>{try{i(n)}catch(s){z.warn(`The following error occurred in deepdeskSDK.on('${t}', handler)`),z.error(s)}})};this.inputMediator&&r.mayApplyChanges?this.inputMediator.applyChanges(o):o()}on(t,n){return this.eventListeners[t]||(this.eventListeners[t]=[]),this.eventListeners[t].push(n),()=>{this.off(t,n)}}off(t,n){if(!t&&!n){this.eventListeners={};return}let r;this.eventListeners[t]&&(r=this.eventListeners[t].indexOf(n),r>-1&&this.eventListeners[t].splice(r,1))}setConversationQuery(t){this.dynamicThunkObject.conversationQuery=t}whenConversationLoaded(t){let n=()=>this.loadProfileConfig().then(()=>t());this.hasConversation()&&n();let r=this.hasConversation();this.store.subscribe(()=>{this.hasConversation()!==r&&(r=this.hasConversation(),r&&n())})}overlayContainerFactory(t,n,r,o){let[i,s]=hl(n,r);return i.setAttribute("translate","no"),i.dataset.testid=t,o&&i.classList.add(o),this.unmountHandlers.push(()=>{(0,qt.unmountComponentAtNode)(i),s(),i.remove()}),i}createInlineContainer(t,n){var s;let r=document.createElement("div");r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.style.height="0px",r.style.width="0px";let o=document.createElement("div");o.style.display="none",o.style.position="absolute",o.style.height="0px",o.style.width="0px",o.style.backgroundColor="red",r.appendChild(o);let i=(s=t.ownerDocument.defaultView)==null?void 0:s.frameElement;if(i){let[a,l]=hl(i,{appendTo:document.body,onMoveStart:()=>{o.style.display="none"}});a.dataset.testid=n,a.style.zIndex="2",a.appendChild(r),this.unmountHandlers.push(()=>{(0,qt.unmountComponentAtNode)(o),l()})}else document.body.appendChild(r);return o}createContainer(t,n=document.body){let r=window.getComputedStyle(n),o=document.createElement("div");return Fo(o),o.dataset.testid=t,o.style.color=r.color,o.style.fontSize=r.fontSize,o.style.fontFamily=r.fontFamily,o.style.fontVariant=r.fontVariant,o.setAttribute("translate","no"),n.appendChild(o),this.unmountHandlers.push(()=>{(0,qt.unmountComponentAtNode)(o),o.remove()}),o}storeMetrics(){try{let t=`dd-metrics-${this.conversationId()}`,n=JSON.stringify({text:this.state.input.text,metrics:this.state.input.metrics});window.sessionStorage.setItem(t,n),z.info(`Stored analytics for ${this.conversationId()}`)}catch{}}restoreMetrics(){try{let t=`dd-metrics-${this.conversationId()}`,n=window.sessionStorage.getItem(t);if(!n)return;let r=JSON.parse(n);r.text.trim()===this.state.input.text.trim()?(z.info(`Restored metrics for ${this.conversationId()}`),this.store.dispatch(x1(r.metrics))):z.warn(`Metrics mismatch, disregarding stored metrics for ${this.conversationId()}`),window.sessionStorage.removeItem(t)}catch{}}mount(t,n={}){if(this.isMounted)throw new Error("[Deepdesk] This instance was already mounted. Make sure to unmount before you remount.");if(!ff(t))throw new Error("[Deepdesk] Only mount on textarea or contentEditable div.");if(!this.shouldRender)return;let{customStyles:r={},showStyleSuggestions:o,showTabCompletion:i,showTextSuggestions:s,textSuggestionsCount:a,showMidSentenceSuggestions:l,showSuggestionsBeforePattern:u,showSuggestionsAfterPattern:c,isEmbedded:f,detectSubmit:d,insertLink:m,inputMediator:y,closestScrollSelector:v,appendOverlayTo:p,inlineSuggestions:g,floatingMenu:h}=n;this.configure({showStyleSuggestions:o,showTabCompletion:i,textSuggestionsCount:a,showMidSentenceSuggestions:l,showSuggestionsBeforePattern:u,showSuggestionsAfterPattern:c,showTextSuggestions:s,insertLink:m,isEmbedded:f,inlineSuggestions:g,floatingMenu:!!h}),n.automaticHandlingTime&&this.setupHandlingTime(t),Fo(t),this.inputMediator=y||(Kr(t)?new Vo(t):new zo(t)),this.inputMediator.on("change",({plainText:T})=>{this.notifyInputChanged(T)}),this.inputMediator.on("updated",()=>{this.inputMediator&&this.store.dispatch(w1({text:this.inputMediator.getText(),html:this.inputMediator.getHTML(),selection:this.inputMediator.getSelection()}))}),this.inputMediator.on("keydown",T=>{this.notifyKeyDown(T)}),this.inputMediator.on("paste",({pastedText:T,selectionText:C})=>{this.notifyPaste(T,C)}),this.inputMediator.on("cut",({selectionText:T})=>{this.notifyCut(T)});let S=v&&jT(t,v)||void 0;if(g){let{customStyles:T,appendOverlayTo:C}=n;if(Kr(t))throw new Error("[Deepdesk] Inline suggestion is not supported for textarea yet.");let k=this.createInlineContainer(t,"deepdesk-caret");(0,qt.render)((0,Ie.jsx)(Uo,{store:this.store,customStyles:T,children:(0,Ie.jsx)(bo,{broadcastEvents:this.broadcastEvents,children:(0,Ie.jsx)(PC,{})})}),k),this.inputMediator.on("caret",I=>{this.store.dispatch(En([])),I?(k.style.display="block",k.style.top=`${I.top}px`,k.style.left=`${I.left}px`):k.style.display="none"});let L=this.overlayContainerFactory("floating-menu",S||t,{appendTo:typeof h=="object"&&"appendOverlayTo"in h?h.appendOverlayTo:C},T==null?void 0:T.floatingMenuRootNode);(0,qt.render)((0,Ie.jsx)(Uo,{store:this.store,customStyles:T,children:(0,Ie.jsx)(bo,{broadcastEvents:this.broadcastEvents,children:(0,Ie.jsx)(hC,{onLogIn:()=>this.loginViaPopup().catch(I=>z.warn(I.message))})})}),L)}else{let T=this.overlayContainerFactory("deepdesk-tab-completion",S||t,{appendTo:p,closestScrollElement:S,mirrorOverflow:!0,onRemove:()=>this.unmount()},r==null?void 0:r.rootNode),C=this.overlayContainerFactory("deepdesk-suggestions-overlay",S||t,{appendTo:p},r==null?void 0:r.suggestionsRootNode);(0,qt.render)((0,Ie.jsx)(Uo,{store:this.store,customStyles:r,children:(0,Ie.jsx)(bo,{broadcastEvents:this.broadcastEvents,children:(0,Ie.jsx)(nb,{inputElement:t})})}),T),(0,qt.render)((0,Ie.jsx)(Uo,{store:this.store,customStyles:r,children:(0,Ie.jsx)(bo,{broadcastEvents:this.broadcastEvents,children:(0,Ie.jsx)(DC,{onLogIn:()=>this.loginViaPopup().catch(k=>z.warn(k.message))})})}),C)}(0,qt.render)((0,Ie.jsx)(Uo,{store:this.store,customStyles:r,children:(0,Ie.jsx)(bo,{broadcastEvents:this.broadcastEvents,children:(0,Ie.jsx)(dC,{})})}),this.createContainer("deepdesk-overlays"));let x;this.inputMediator.on("selection",T=>{clearTimeout(x),T===null?x=setTimeout(()=>{T!==null&&this.store.dispatch(_g(T))},500):this.store.dispatch(_g(T))}),this.inputMediator.on("disabled",()=>{var T;(T=this.inputMediator)==null||T.deactivate(),this.configure({visible:!1})}),this.inputMediator.on("enabled",()=>{this.inputMediator&&(this.configure({visible:!0}),this.inputMediator.activate())}),this.inputMediator.on("submit",()=>{d&&this.notifySubmit()}),this.inputMediator.on("blur",()=>this.store.dispatch(Eh(!1))),this.inputMediator.on("focus",()=>this.store.dispatch(Eh(!0))),this.store.dispatch(f1({text:this.inputMediator.getText(),html:this.inputMediator.getHTML(),selection:this.inputMediator.getSelection()})),this.unmountHandlers.push(()=>{this.state.input.text!==""&&(this.store.dispatch(Kn()),this.storeMetrics())}),this.whenConversationLoaded(()=>{var T;this.restoreMetrics(),this.refresh(),this.broadcastEvents.setSessionId((T=this.state.conversation.current)==null?void 0:T.sessionId)}),this.isMounted=!0}unmount(){var t;this.unmountHandlers.forEach(n=>n()),this.unmountHandlers=[],(t=this.inputMediator)==null||t.dispose(),this.broadcastEvents.cleanup(),this.isMounted=!1}renderWidget(t,n={}){if(this.widgetRoot&&z.warn("A widget was already rendered for this instance. Make sure to unmountWidget before rerendering"),!this.shouldRender)return;let{customStyles:r,showImages:o,isEmbedded:i}=n;this.widgetRoot=t,this.configure({showImages:o,isEmbedded:i}),(0,qt.render)((0,Ie.jsx)(Uo,{store:this.store,customStyles:r,children:(0,Ie.jsx)(bo,{broadcastEvents:this.broadcastEvents,children:(0,Ie.jsx)(wT,{onLogIn:()=>this.loginViaPopup().catch(s=>z.warn(s.message))})})}),t),this.whenConversationLoaded(()=>{var s;this.broadcastEvents.setSessionId((s=this.state.conversation.current)==null?void 0:s.sessionId)})}unmountWidget(){this.widgetRoot&&(0,qt.unmountComponentAtNode)(this.widgetRoot),this.widgetRoot=null}setupHandlingTime(t){let n=gf(t,({isVisible:r})=>{r?this.handlingTimeStart():this.handlingTimeStop()});this.unmountHandlers.push(()=>{this.handlingTimeStop(),n()}),this.whenConversationLoaded(()=>{this.handlingTimeStart()})}handleError(t){zT(t)&&t.message==="Unauthorized"&&this.login()}loadProfileConfigPromise=null;loadProfileConfig(){return this.loadProfileConfigPromise?this.loadProfileConfigPromise:(this.loadProfileConfigPromise=Promise.resolve().then(async()=>{await this.store.dispatch(Ya());let t=jr(this.state);t&&(await this.store.dispatch(qa()),this.store.dispatch(Nc({showSearch:t.search,showAutoflows:t.autoflows,showCustomMessages:t.customMessages,showImageSearch:t.imageSearch,showEntitiesCommand:t.entitiesCommand,showSummaryCommand:t.summarizer,showKnowledgeSearch:!!t.knowledgeAssistant,recommendTextSuggestions:t.recommendTextSuggestions})))}),this.loadProfileConfigPromise)}async loginViaPopup(t){return new Promise((n,r)=>{let o=new MessageChannel,i=o.port1,s=this.state.settings.adminUrl,a=new URL(t!=null&&t.url?t==null?void 0:t.url:`${s}/platform/sso/`);a.searchParams.append("redirect","/sdk/popup/close.html");let l=!1,u=()=>{c&&!c.closed&&c.close(),window.removeEventListener("message",f),clearInterval(d)};i.onmessage=async m=>{var y,v;if((y=m.data)!=null&&y.jwt)try{await this.deepdeskApi.exchangeTokenForAccessCookie((v=m.data)==null?void 0:v.jwt),await this.isLoggedIn(),this.broadcastEvents.send(Aa),l=!0,o.port1.close(),n()}catch(p){console.error(p),r(p)}finally{l=!0,u()}};let c=window.open(a.toString(),"deepdesk-login","scrollbars=no,left=100,top=150,width=500,height=500");c===null&&r(new Error("Popup blocked by browser"));let f=async m=>{var y;if(m.origin===a.origin)switch((y=m.data)==null?void 0:y.type){case"deepdesk-popup-loaded":{try{let v=JSON.stringify({type:"deepdesk-popup-create-channel"});c==null||c.postMessage(v,a.origin,[o.port2])}catch(v){z.error("Error posting message to popup",v),r(v)}break}case"deepdesk-popup-error":{u(),m.data.message==="Timeout"&&z.warn("Popup timed out. Check if the account's platform url is configured correctly."),r(new Error(m.data.message));break}}};window.addEventListener("message",f);let d=setInterval(()=>{c&&!c.closed||(u(),l||r(new Error("Popup closed by user")))},200);this.unmountHandlers.push(u)})}translateMessages(t){return this.deepdeskApi.translateMessages(t)}async checkForTrialMode(t){try{let{account:n}=await this.deepdeskApi.getPlatformConfig();if(!n.isTrial){this.shouldRender=!0;return}if(z.info("Trial is active"),!await this.deepdeskApi.checkUserExists(t))throw new Error("User is not in trial");this.shouldRender=!0}catch(n){let{message:r}=n;z.info(r),this.shouldRender=!1}}async refreshWidgetSuggestions(){if(!this.widgetRoot||this.shouldAbort())return;let{uiConfig:t}=this.state.profile.data;if(!t.widget)return;let n=Td(this.state);try{n.forEach(({type:r})=>{r==="entities"?this.store.dispatch(an()):this.store.dispatch(un(r))})}catch(r){this.handleError(r)}}};async function ek(e,t,n={}){let{value:r}=e,{start:o,end:i}=n.replace??{start:0,end:r.length},s=`${r.slice(0,o)}${t}${r.slice(i)}`,a=n.selectionAfter??{start:o+t.length,end:o+t.length},l=()=>{if(n.setValue)return n.setValue(s);e.value=s};return Promise.resolve(l()).then(()=>{e.selectionStart=a.start,e.selectionEnd=a.end,e.blur(),e.focus()})}async function tk(e,t,n={}){let r=n.replace?Gr(e,n.replace.start,n.replace.end):as(e),o,i=()=>{if(n.setRange)return n.setRange(r.cloneRange());r.deleteContents(),o=document.createElement("span"),r.insertNode(o),n.insertBRs!==!1?t.split(`
|
|
27
|
-
`).reverse().forEach((s,a)=>{a>0&&r.insertNode(document.createElement("br")),r.insertNode(document.createTextNode(s))}):r.insertNode(document.createTextNode(t))};return Promise.resolve(i()).then(()=>{try{if(n.selectionAfter!==!1){e.focus();let s=n.selectionAfter?Gr(e,n.selectionAfter.start,n.selectionAfter.end):(r.collapse(!1),r),a=window.getSelection();a==null||a.removeAllRanges(),a==null||a.addRange(s)}if(!o)return;o.scrollIntoView&&o.scrollIntoView({block:"nearest",inline:"nearest"})}finally{o&&o.remove()}})}function
|
|
28
|
-
`).forEach((n,r)=>{r>0&&t.appendChild(document.createElement("br"));let o={index:0},i=0;for(;o=n.slice(i).match(/(\[([^\]]+)])\(([^)]+)\)/);){let s=document.createElement("a");s.href=o[3],s.setAttribute("target","_blank"),s.setAttribute("rel","noopener noreferrer"),s.appendChild(document.createTextNode(o[2])),t.appendChild(document.createTextNode(n.slice(i,i+o.index))),t.appendChild(s),i=i+o.index+o[0].length}t.appendChild(document.createTextNode(n.slice(i)))}),t}function nk(e,t){return!e.contains(t)||t===e?null:t.parentNode===e?t:nk(e,t.parentNode)}async function rk(e,t,{isBlock:n,isHTML:r}={}){let o;e.dispatchEvent(new InputEvent("beforeinput",{inputType:"insertText",data:t,bubbles:!0,cancelable:!0}));let i=()=>{let s=e.ownerDocument.defaultView??window,a=s.getSelection();if((!a||a.rangeCount===0)&&(e.focus(),a=s.getSelection()),!a||a.rangeCount===0)return;let l=a.getRangeAt(0);if(!l)return;o=document.createElement("span"),l.insertNode(o);let u=r?
|
|
27
|
+
`);break}default:break}f&&s++}return l(e),a}var ET=(s=>(s.CUT="Cut",s.BACKSPACE="Backspace",s.DELETE="Delete",s.ERASEEOF="EraseEof",s.UNDO="Undo",s.CLEAR="Clear",s))(ET||{}),rr=class{constructor(t){this.element=t;this.currentText=this.getText(),this.currentHTML=this.getHTML(),this.listen()}eventListeners={};disposeHandlers=[];currentText="";currentCaret=null;currentSelection={start:0,end:0};currentHTML="";isFocused=!1;isActive=!0;isSettingValue=!1;isSubmitting=!1;isPossibleClearInputAction=!1;isDisposed=!1;addEventListener(t,n){let r=o=>{n(o)};this.element.addEventListener(t,r),this.disposeHandlers.push(()=>{this.element.removeEventListener(t,r)})}removeEventListener(t,n){this.element.removeEventListener(t,n)}triggerChange(){let t=this.getText(),n=this.getHTML(),r=t!==this.currentText;this.isActive&&(t===""&&this.currentText!==""&&!this.isSettingValue&&!this.isPossibleClearInputAction&&(this.isSubmitting=!0,this.emit("submit")),!this.isSettingValue&&r&&!this.isSubmitting&&this.emit("change",{plainText:t}),r&&(this.currentSelection=this.getSelection()),this.currentText=t,this.isSubmitting=!1,(this.currentHTML!==n||n===null&&r)&&(this.emit("updated",{plainText:t}),this.triggerCaretPosition(),this.currentHTML=n))}triggerSelection(){let t=this.getSelection();(t.start!==this.currentSelection.start||t.end!==this.currentSelection.end)&&(this.currentSelection=t,this.emit("selection",t),this.triggerCaretPosition())}triggerCaretPosition(){let t=this.getCaretPosition();Nr(t,this.currentCaret)||(this.currentCaret=t,this.emit("caret",t))}handleKeyUp(t){let{key:n,shiftKey:r}=t;(n==="Enter"&&r===!0||n==="Backspace")&&this.triggerChange(),this.triggerSelection()}handleClick(){this.triggerSelection()}handleFocus(){this.isFocused||this.emit("focus"),this.triggerSelection(),this.isFocused=!0}handleBlur(){this.isPossibleClearInputAction=!1,this.isFocused&&this.emit("blur"),this.isFocused=!1}handleKeyDown(t){let{key:n,ctrlKey:r,metaKey:o}=t;this.isPossibleClearInputAction=Object.values(ET).includes(n)||n.toLowerCase()==="z"&&(r||o),this.emit("keydown",t)}handleCut(){this.isPossibleClearInputAction=!0,this.emit("cut",{selectionText:this.getSelectedText()})}handlePaste(t){var r,o;let n=((r=t.clipboardData)==null?void 0:r.getData("text"))||((o=t.clipboardData)==null?void 0:o.getData("text/plain"))||"";this.emit("paste",{pastedText:n,selectionText:this.getSelectedText()})}listen(t={shouldObserve:!0}){this.addEventListener("keydown",r=>this.handleKeyDown(r)),this.addEventListener("keyup",r=>this.handleKeyUp(r)),this.addEventListener("input",()=>this.triggerChange()),this.addEventListener("change",()=>this.triggerChange()),this.addEventListener("focus",()=>this.handleFocus()),this.addEventListener("blur",()=>this.handleBlur()),this.addEventListener("cut",()=>this.handleCut()),this.addEventListener("paste",r=>this.handlePaste(r)),this.addEventListener("click",()=>this.triggerSelection()),document.activeElement===this.element&&setTimeout(()=>{this.handleFocus()},0);let n=new MutationObserver(()=>{this.element.isConnected||(this.emit("unmounted"),this.dispose())});t!=null&&t.shouldObserve&&n.observe(document.body,{subtree:!0,childList:!0}),this.disposeHandlers.push(()=>{n.disconnect()}),this.currentSelection=this.getSelection()}focus(){this.element.focus()}emit(t,...n){this.isDisposed||this.eventListeners[t]&&this.eventListeners[t].forEach(r=>{r(...n)})}on(t,n){this.isDisposed||(this.eventListeners[t]||(this.eventListeners[t]=[]),this.eventListeners[t].push(n))}activate(){let t=this.isActive===!1;this.isActive=!0,t&&this.triggerChange()}deactivate(){this.isActive=!1}dispose(){this.disposeHandlers.forEach(t=>t()),this.eventListeners={},this.isDisposed=!0}};function CT(e){return e.top!==0||e.left!==0||e.height!==0||e.width!==0}var zo=class extends rr{observer;lastKnownSelection=null;getRootNode(){return this.element.getRootNode()}getText(){let t=new Range;return t.selectNodeContents(this.element),pl(this.element,t)}getHTML(){return this.element.innerHTML||""}getRange(){var i;let t=this.getRootNode();if(t.activeElement!==this.element)return null;let n="getSelection"in t?t.getSelection():window.getSelection();if(!n)return null;let r="getComposedRanges"in n&&t instanceof ShadowRoot?(i=n.getComposedRanges(t))==null?void 0:i[0]:n.rangeCount>0?n.getRangeAt(0):null;if(!r)return null;let o=this.element.ownerDocument.createRange();return o.setStart(r==null?void 0:r.startContainer,r==null?void 0:r.startOffset),o.setEnd(r==null?void 0:r.endContainer,r==null?void 0:r.endOffset),!o||!this.element.contains(o.startContainer)||!this.element.contains(o.endContainer)?null:o}getCaretPosition(){let t=this.getRange();if(!t||!t.collapsed||!("getBoundingClientRect"in t))return null;let n=t.getBoundingClientRect();return!CT(n)&&(t.insertNode(this.element.ownerDocument.createTextNode("\u2060")),n=t.getBoundingClientRect(),t.deleteContents(),!CT(n))?null:{top:n.top+n.height,left:n.left}}getSelection(){let t=this.getRange();if(t)return fl(this.element,t);let n=this.lastKnownSelection;if(n&&xT(this.element,n.start,n.end))return n;let r=as(this.element);return r.collapse(!1),fl(this.element,r)}getSelectedText(){let{start:t,end:n}=this.getSelection();return pl(this.element,Gr(this.element,t,n))}applyChanges(t){var o;if(!this.isActive)return;this.isSettingValue=!0;let n=this.getText(),r=t(this.element);return(o=this.observer)==null||o.takeRecords(),Promise.resolve(r).then(()=>{this.currentText=this.getText(),n!==this.currentText&&this.triggerChange(),this.isSettingValue=!1})}listen(t={shouldObserve:!0}){super.listen(t),this.observer=new MutationObserver(()=>{setTimeout(()=>{this.triggerChange()},0)}),t!=null&&t.shouldObserve&&this.observer.observe(this.element,{attributes:!0,characterData:!0,childList:!0,subtree:!0});let n=this.element.isContentEditable,r=new MutationObserver(()=>{this.element.isContentEditable!==n&&(n=this.element.isContentEditable,this.emit(this.element.isContentEditable?"enabled":"disabled"))});r.observe(this.element,{attributes:!0,attributeFilter:["contenteditable"]}),this.disposeHandlers.push(()=>r.disconnect())}dispose(){super.dispose(),this.observer&&this.observer.disconnect()}};var Vo=class extends rr{lastKnownSelection=null;getText(){return this.element.value}getHTML(){return null}getSelection(){let{selectionStart:t,selectionEnd:n}=this.element;return{start:t,end:n}}getSelectedText(){let t=this.getSelection();return t?this.getText().slice(t.start,t.end):""}getCaretPosition(){return null}applyChanges(t){if(!this.isActive)return;this.isSettingValue=!0;let n=this.getText(),r=t(this.element);return Promise.resolve(r).then(()=>{this.currentText=this.getText(),n!==this.currentText&&this.triggerChange(),this.isSettingValue=!1})}listen(){super.listen();let t=Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype,"value");Object.defineProperty(this.element,"value",{configurable:!0,get:()=>{var o;return(o=t==null?void 0:t.get)==null?void 0:o.call(this.element)},set:o=>{var i;(i=t==null?void 0:t.set)==null||i.call(this.element,o),this.triggerChange()}});let n=this.element.disabled,r=new MutationObserver(()=>{this.element.disabled!==n&&(n=this.element.disabled,this.emit(n?"disabled":"enabled"))});r.observe(this.element,{attributes:!0,attributeFilter:["disabled"]}),this.disposeHandlers.push(()=>r.disconnect())}};function bT(e,t,n){let r=`deepdesk-iframe-${e}`,o=document.getElementById(r);if(o)return o;let i=document.createElement("iframe"),s=new URL(t);return Object.entries(n).forEach(([a,l])=>{s.searchParams.append(a,l)}),i.style.position="absolute",i.style.left="-999em",i.style.width="0px",i.style.height="0px",i.tabIndex=-1,i.id=r,i.title=`iframe-${e}`,i.src=s.toString(),window.document.body.appendChild(i),i}function WM(e){if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}}var uy=class{constructor(t){this.name=t;this.broadcastChannel=new BroadcastChannel(t)}broadcastChannel;disposeHandlers=[];onMessage(t){this.broadcastChannel.addEventListener("message",t),this.disposeHandlers.push(()=>{this.broadcastChannel.removeEventListener("message",t)})}postMessage(t){this.broadcastChannel.postMessage(JSON.stringify(t))}close(){this.disposeHandlers.forEach(t=>t()),this.broadcastChannel.close()}},cy=class{constructor(t,n,r){this.name=t;this.targetOrigin=n;this.options=r;this.iframe=bT(t,`${this.targetOrigin}/sdk/proxy/proxy.html`,{channel:this.name,host:window.location.origin,debug:"1"}),document.body.appendChild(this.iframe)}iframe;disposeHandlers=[];onMessage(t){window.addEventListener("message",t),this.disposeHandlers.push(()=>{window.removeEventListener("message",t)})}postMessage(t){var n;(n=this.iframe.contentWindow)==null||n.postMessage(JSON.stringify(t),this.targetOrigin)}close(){var t;this.disposeHandlers.forEach(n=>n()),(t=this.iframe)==null||t.remove()}},dy=class{constructor(t){this.params=t;this.deepdeskUrl=t.deepdeskUrl,this.eventMap=t.eventMap,this.sessionId="deepdesk-general",this.defaultChannel=this.createChannel("deepdesk-general")}sessionId;deepdeskUrl;channel;defaultChannel;eventMap;get isCrossOrigin(){return this.params.deepdeskUrl!==(this.params.origin||window.location.origin)}setSessionId(t){this.sessionId!==t&&(this.cleanup(),z.info("Set sessionId",t),this.sessionId=t,this.channel=this.createChannel(t))}createChannel(t){let n=this.params.createCustomChannel?this.params.createCustomChannel(t):this.isCrossOrigin?new cy(t,this.deepdeskUrl,{debug:!0}):new uy(t),r=o=>{var s,a;if(o.origin!==this.deepdeskUrl)return;let i=WM(o.data);typeof i!="object"||i.type!=="event"||i.channel!==t||(z.info("Received broadcast event",this.sessionId,o),(a=(s=this.eventMap)[i.name])==null||a.call(s,i.payload))};return n.onMessage(r),n}send(t,n,r){var s,a;z.info("Broadcast event",{sessionId:this.sessionId,name:t,payload:n});let o={type:"event",name:t,payload:n};r!==!1&&((a=(s=this.eventMap)[t])==null||a.call(s,n));let i=this.sessionId==="deepdesk-general"?this.defaultChannel:this.channel;i==null||i.postMessage({...o,channel:this.sessionId})}cleanup(t=!1){var n,r;(n=this.channel)==null||n.close(),delete this.channel,t&&((r=this.defaultChannel)==null||r.close(),delete this.defaultChannel)}},TT=dy;var ls=class extends Error{constructor(n,r){super(n);this.body=r}name="CustomError"};var fy=e=>new Promise(t=>{setTimeout(t,e)});var us=class extends ls{name="ClientError"},my=class extends ls{name="ServerError"},py=new Map,pn=class e{constructor(t="",n={}){this.baseUrl=t;this.options=n;n.fetch&&(this.fetch=n.fetch)}latestRequestByUrl={};csrfToken;fetch=window.fetch.bind(window);static refreshingToken=null;patchFetch(t){this.fetch=t(this.fetch)}setCsrfToken(t){this.csrfToken=t}request(t,n={}){return new Promise((r,o)=>{let i={isAborted:!1,reject:o},s=`${this.baseUrl}${t}`,a=this.fetch,l=n.method===void 0||n.method.toLowerCase()==="get",{useCache:u=!1,abortLatest:c=!1,attempts:f=1,retryDelay:d=500,refreshTokenOn401:m=!0,retryOnError:y=C=>C instanceof TypeError,retryOnResponse:v=C=>C.status>=500,version:p="v1",...g}=n;if(u)if(l){if(py.has(s)){r(py.get(s));return}}else throw new Error(`Can't use 'useCache' for ${n.method}`);let h={credentials:"include",...g,headers:{"Content-Type":"application/json",...g.headers}};!l&&this.csrfToken&&(h.headers={...h.headers,"X-CSRFToken":this.csrfToken}),typeof p=="string"&&(h.headers={...h.headers,"X-Deepdesk-API-Version":p});let S=f,x=!1;if(!a)throw new Error("fetch is not set");this.latestRequestByUrl[s]&&c&&(this.latestRequestByUrl[s].isAborted=!0,this.latestRequestByUrl[s].reject(new Error("Aborted"))),this.latestRequestByUrl[s]=i;let T=async()=>(S--,a(s,h).then(async C=>v(C)&&!i.isAborted&&S>0?(await fy(d),T()):C.status===401&&m===!0&&x===!1?(x=!0,await this.refreshToken(),T()):C).catch(async C=>{if(y(C)&&!i.isAborted&&S>0)return await fy(d),T();throw C}));T().then(C=>C.json().catch(()=>null).then(k=>{C.status>=500?o(new my("Server Error",k)):C.status===401?o(new us("Unauthorized",k)):C.status===403?o(new us("Forbidden",k)):C.status===404?o(new us("Not Found",k)):C.status>=400&&o(new us("Bad Request",k)),delete this.latestRequestByUrl[s],u&&py.set(s,k),r(k)})).catch(C=>{o(C)})})}async validateToken(){let{has_valid_access_token:t}=await this.get("/auth/validate");if(!t)return!1;let{is_logged_in:n}=await this.get("/apis/admin/session/validate/",{version:null});return!!n}refreshToken(){return e.refreshingToken||(e.refreshingToken=this.get("/auth/refresh",{refreshTokenOn401:!1}).finally(()=>{setTimeout(()=>{e.refreshingToken=null},1e3*60)})),e.refreshingToken}get(t,n){return this.request(t,n)}post(t,n,r){return this.request(t,{method:"POST",body:JSON.stringify(n),...r})}patch(t,n,r){return this.request(t,{method:"PATCH",body:JSON.stringify(n),...r})}put(t,n,r){return this.request(t,{method:"PUT",body:JSON.stringify(n),...r})}delete(t,n){return this.request(t,{method:"DELETE",...n})}};var qM;(t=>{let e;(l=>(l.SEND_MESSAGE="Send Message",l.HANDLING_TIME="Handling Time",l.START_AUTOFLOW="Start Autoflow",l.ABORT_AUTOFLOW="Abort Autoflow",l.ADD_TO_PERSONAL_COLLECTION="Add to personal collection",l.DELETE_FROM_PERSONAL_COLLECTION="Delete from personal collection"))(e=t.EventType||={})})(qM||={});function uf(e){return{...J(e),tags:e.tags}}var or=class e{constructor(t,n={}){this.options=n;this.client=new pn(t,{fetch:n.fetch}),this.client.patchFetch(r=>async(o,i)=>{let s=await r(o,i);return this.handleDeepdeskVersionHeaders(s),s})}latestReceivedDeepdeskVersions={};client;shouldFetchCsrfToken=!0;static exchangeTokenPromise=null;async preflight(){if(this.shouldFetchCsrfToken){this.shouldFetchCsrfToken=!1;let t=await this.getCsrfToken();this.client.setCsrfToken(t)}return this.options.token?(e.exchangeTokenPromise||(e.exchangeTokenPromise=this.exchangeTokenForAccessCookie(this.options.token)),e.exchangeTokenPromise):Promise.resolve()}async createConversation(t){await this.preflight(),z.info(`Creating conversation for session ${t.sessionId} and agent ${t.agentId}`);let n=await this.client.post("/api/conversations",{...Ae(t),tags:t.tags},{version:"v2"});return uf(n)}async getProfile(t){let n=await this.client.get(`/apis/admin/profiles/${t}/`,{version:null,useCache:!0});return J(n)}async getKnowledgeAssistant(t){let n=await this.client.get(`/apis/admin/knowledge-assist/assistants/${t}/`,{version:null,useCache:!0});return J(n)}async getContentTypes(){let t=await this.client.get("/apis/admin/content-types/",{version:null,useCache:!0});return J(t)}async getAccount(){let t=await this.client.get("/apis/admin/account/",{version:null,useCache:!0});return J(t)}async getPlatformConfig(){let{config:t}=await this.client.get("/platform/config/",{version:null,useCache:!0});return J(t)}async checkUserExists(t){let{exists:n}=await this.client.get(`/apis/admin/users/exists?external_id=${t}`);return n}async getConversationBySessionId(t,n={}){await this.preflight(),z.info(`Getting conversation for session ${t}`);let{attempts:r=1,retryDelay:o=1e3}=n,i=await this.client.get(`/api/conversations/by_session_id/${t}`,{attempts:r,retryDelay:o,retryOnResponse:s=>s.status===404||s.status>=500,version:"v2"});return z.info(`Successfully retrieved conversation ${i.id} for session ${t}`),uf(i)}async isConversationSupported(t,n={}){z.info(`Check if conversation for session ${t} is supported`);let{attempts:r=1,retryDelay:o=1e3}=n;return(await this.client.get(`/api/conversations/by_session_id/${t}/active_profile`,{attempts:r,retryDelay:o,retryOnResponse:s=>s.status===404||s.status>=500,version:"v2"})).has_active_profile}async updateConversation(t,n){let r=Ae(n);n.tags&&(r.tags=n.tags);let o=await this.client.put(`/api/conversations/${t}`,r,{version:"v2"});return uf(o)}async postMessages(t,n){return(await this.client.post(`/api/conversations/${t}/messages`,n.map(o=>({...Ae(o),tags:o.tags})),{version:"v2"})).map(o=>uf(o))}async sendEvent(t,n){let{data:r,...o}=n,i=Object.entries(this.latestReceivedDeepdeskVersions).reduce((s,[a,l])=>({...s,[a]:l}),{});return this.client.post("/api/events",Ae({...i,...o,data:r,name:t}),{version:"v2"})}async sendEventV1(t,n){let r=Object.entries(this.latestReceivedDeepdeskVersions).reduce((o,[i,s])=>({...o,[i]:s}),{});return this.client.post("/api/events",{event:t,data:Ae({...n,...r})})}async getEntities(t){return(await this.client.post("/api/entities",{messages:t.filter(r=>r.text)})).entities}async getSummary(t,n={}){let r=await this.client.post("/api/summary",{conversation:{messages:t.filter(o=>o.text&&o.source),agent_id:n.agentId,id:n.externalConversationId},prompt_instruction:n.promptInstruction,model:n.model});return J(r)}async getTemporaryExchangeToken(){return(await this.client.get("/auth/exchange-token",{version:null})).jwt}async exchangeTokenForAccessCookie(t){return this.client.post("/apis/admin/session/jwt/",{jwt:t},{version:null}).catch(n=>{throw z.warn(`Invalid token '${t}'`),n})}async authenticateWithKey(t,n){await this.preflight(),await this.client.post("/apis/admin/session/api-key/",Ae(n),{version:null,refreshTokenOn401:!1,headers:{apikey:t}})}async getTextSuggestions(t,n={},r){return r==="sticky-messages"?this.getPinnedMessages(t):(await this.client.post(`/api/conversations/${t}/recommend/${r}`,Ae(n),{abortLatest:!0})).map(i=>({...J(i),text:i.text||i.url||i.message,source:r,type:r})).filter((i,s,a)=>s===a.findIndex(l=>l.text===i.text))}async isLoggedIn(){return await this.preflight(),this.client.validateToken()}async getAutocompleteSuggestions(t,n){return(await this.client.post(`/api/conversations/${t}/autocomplete`,Ae(n),{abortLatest:!0})).map(o=>({score:1,source:o.source,sourceText:o.source_text,text:o.label,trainingJobs:o.training_jobs,searchKeywords:o.search_keywords,type:o.source})).filter((o,i,s)=>i===s.findIndex(a=>a.text===o.text))}async getPinnedMessages(t){let n=await this.client.get(`/api/conversations/${t}/sticky-messages`,{abortLatest:!0});return J(n).map(r=>({...r,text:r.message,source:"sticky-messages",type:"pinned-message"}))}async getStyleSuggestions(t){let n=await this.client.post("/api/style-suggestions",Ae(t),{abortLatest:!0});return J(n)}async search(t){let n=await this.client.post(`/api/profiles/${t.profile}/search`,Ae(t),{version:"v2"});return J(n)}async knowledgeAssist(t,n,r,o={}){let i=await this.client.post(`/api/knowledge-assist/assistants/${r}/search`,Ae({question:t.question,promptInstruction:t.promptInstruction,chatHistory:n.map(s=>({question:s.question,answer:s.answer.answer})),agentId:o.agentId,conversationId:o.conversationId}),{version:"v2"});return J(i)}async requestLoginByEmail(t){let n=await this.client.post("/apis/admin/session/passwordless/request/",{email:t},{version:null});return J(n)}async requestPasswordlessToken(){let t=await this.client.get("/apis/admin/session/passwordless/request/",{version:null});return J(t.token)}async getCsrfToken(){let{token:t}=await this.client.get("/apis/admin/session/csrf/",{version:null});return t}async verifyLoginToken(t){let n=await this.client.post("/apis/admin/session/passwordless/login/",{token:t},{version:null});return J(n)}async evaluateRule(t,n,r,o={}){let i=new URLSearchParams;o.raiseForFailingConditions&&i.set("raise_for_failing_conditions","true");let s=await this.client.post(`/api/conversations/${n}/rules/${t}/evaluate?${i.toString()}`,r,{version:"v2"});return J(s.cues)}async getRules(){let t=new URLSearchParams,n=await this.client.get(`/apis/admin/rule-engine/rules/?${t.toString()}`,{version:null,useCache:!0});return J(n)}async translateMessages(t){let n=await this.client.post("/api/translate",Ae(t),{version:"v2"});return J(n)}handleDeepdeskVersionHeaders(t){t.headers.forEach((n,r)=>{let o=r.toLowerCase(),i=o.match(Ov);if(!n||!i)return;let s=i[1].replace("-","_"),a=this.latestReceivedDeepdeskVersions[s];a&&n&&a!==n&&z.warn(`Overwritten Version header ${o}: ${JSON.stringify(a)} -> ${JSON.stringify(n)}`),this.latestReceivedDeepdeskVersions[s]=n})}};var ml=class{constructor(t,n){this.url=t;this.options={timeout:25e3,...n}}eventListeners={};options;timeoutTimer;eventSource;proxyEvent(t){this.eventSource.addEventListener(Dg(t),n=>{let{data:r}=n;try{let o=JSON.parse(r);this.emit(t,J(o))}catch{z.warn(`Invalid JSON for ${t}: ${r}`)}})}connect(){clearTimeout(this.timeoutTimer);let t=new EventSource(this.url,{withCredentials:!0});this.eventSource=t;let n=!1;t.onopen=()=>{n=!0},t.onerror=()=>{n&&t.readyState===2&&this.connect()},this.timeoutTimer=setTimeout(()=>{t.close(),this.connect()},this.options.timeout),Object.keys(this.eventListeners).forEach(r=>{this.proxyEvent(r)})}disconnect(){var t;clearTimeout(this.timeoutTimer),this.eventListeners={},(t=this.eventSource)==null||t.close()}emit(t,n){this.eventListeners[t]&&this.eventListeners[t].forEach(r=>r(n))}on(t,n){return this.eventListeners[t]||(this.eventListeners[t]=[]),this.eventListeners[t].push(n),this.proxyEvent(t),()=>{this.off(t,n)}}off(t,n){let r;this.eventListeners[t]&&(r=this.eventListeners[t].indexOf(n),r>-1&&this.eventListeners[t].splice(r,1))}};var GM;(t=>{let e;(i=>(i.Started="Started",i.Aborted="Aborted",i.Completed="Completed"))(e=t.AutoflowSessionState||={})})(GM||={});var gl=class{constructor(t,n={}){this.apiUrl=t;this.client=new pn(t,n)}client;streams={};logger=z;async getCustomMessages(t){let n=await this.client.get(`/sessions/${t}/suggestions`);return J(n.suggestions)}async sendCustomMessage(t,n){let r=await this.client.post(`/sessions/${t}/messages`,Ae(n));return J(r)}async answerCustomMessage(t,n){await this.client.post(`/sessions/${t}/answers`,Ae(n))}async getAutoflows(t){let n=await this.client.get(`/sessions/${t}/autoflows`);return J(n.autoflows)}async startAutoflowSession(t){let n=await this.client.post("/autoflow-sessions",Ae(t));return J(n)}async stopAutoflowSession(t){await this.client.delete(`/autoflow-sessions/${t}`)}openStream(t){return this.streams[t]||(this.streams[t]=new ml(`${this.apiUrl}/sessions/${t}/events`),this.streams[t].connect()),this.streams[t]}closeStream(t){this.streams[t]||(this.streams[t].disconnect(),delete this.streams[t])}};var kT={startTime:null,stopTime:null},PT=W({name:"handlingTime",initialState:kT,reducers:{handlingTimeStart(e){if(e.startTime&&!e.stopTime)throw new Error("Timing already started");e.startTime=new Date,e.stopTime=null},handlingTimeStop(e){if(!e.startTime)throw new Error("Timing not started");e.stopTime=new Date},handlingTimeReset(e){e.startTime=null,e.stopTime=null}},extraReducers:e=>{e.addCase(le,()=>kT)}}),{handlingTimeStart:RT,handlingTimeStop:cf,handlingTimeReset:AT}=PT.actions,LT=PT.reducer;var IT=(e={})=>{let t={onAuthError:ji(!1),...e};return n=>r=>o=>("error"in o&&o.error.message==="Unauthorized"&&n.dispatch(t.onAuthError),r(o))};var df={list:{keywordMatches:[]},fetchState:"idle",isInitialRequest:null};var Ko=B("styleSuggestions/getAll",async({text:e},t)=>{var s;let{deepdeskAPI:n}=t.extra,r=t.getState(),{showStyleSuggestions:o}=r.settings,i=(s=r.conversation.current)==null?void 0:s.profileCode;if(!o)return df.list;if(!i)throw new Error("No current conversation to fetch pinned messages");return n.getStyleSuggestions({profileCode:i,message:e})}),YM=W({name:"styleSuggestions",initialState:df,reducers:{},extraReducers:e=>{e.addCase(Ko.pending,t=>{t.isInitialRequest=t.isInitialRequest===null,t.fetchState="loading"}).addCase(Ko.rejected,t=>{t.fetchState="error"}).addCase(Ko.fulfilled,(t,n)=>{t.fetchState="done",Nr(t.list,n.payload)||(t.list=n.payload)}).addCase(Eo,t=>{t.list=df.list}).addCase(le,()=>df)}}),OT=YM.reducer;var NT=(e={})=>{let t,n=!0,r={getStyleSuggestions:Ko,debounce:500,...e};return o=>i=>s=>{var m;let a=o.getState().input.text,l=i(s),u=o.getState();if(u.auth.isLoggedIn!==!0)return l;let{showStyleSuggestions:c}=u.settings;if(!((m=u.conversation.current)==null?void 0:m.id)||!c)return l;let{text:d}=u.input;return d===a&&!n||(clearTimeout(t),d==="")||(t=setTimeout(()=>{n=!1,o.dispatch(r.getStyleSuggestions({text:d}))},e.debounce)),l}};function XM(e,t){return e.text===t.text&&e.selection.start===t.selection.start&&e.selection.end===t.selection.end}var MT=(e={})=>{let t={getTextSuggestions:un,getAutocompleteSuggestions:Xa,debounce:200,check:Ji,...e},n;return r=>o=>i=>{var v;let{input:{userCommitted:s}}=r.getState(),a=o(i),l=r.getState();if(l.auth.isLoggedIn!==!0)return a;let{recommendTextSuggestions:u,showTabCompletion:c}=l.settings,f=(v=l.conversation.current)==null?void 0:v.id,d=i.type===Pd.toString();if(!f||!u&&!c)return a;let{input:{userCommitted:m}}=l;return XM(m,s)&&!d||(clearTimeout(n),!t.check(l))||(n=setTimeout(()=>{let p=Vi(l);p===""?r.dispatch(t.getTextSuggestions("default")):r.dispatch(t.getAutocompleteSuggestions(p))},d?0:t.debounce)),a}};var _T=Ko.fulfilled.toString();function QM(e,t){let n=new Set([...t.keywordMatches.map(o=>o.keyword)]),r=[];return n.forEach(o=>{let i=e.keywordMatches.filter(l=>l.keyword===o),s=t.keywordMatches.filter(l=>l.keyword===o),a=s.length-i.length;a<=0||r.push(...s.slice(0,a))}),r}var DT=e=>t=>n=>r=>{var u;if(r.type!==_T){n(r);return}let o=t.getState().styleSuggestions.list;n(r);let i=t.getState(),s=i.styleSuggestions.list,a=(u=i.conversation)==null?void 0:u.current;if(o===s)return;let l=QM(o,s);r.type===_T&&l.length>0&&e.sendEvent("style suggested",{conversationId:a==null?void 0:a.id,data:{keywordMatches:l}})};var ZM=oc({answer:WE,auth:Zx,autoflows:lb,conversation:a1,contentTypes:oE,customMessages:yb,passwordlessToken:xb,entities:IE,knowledgeAssistant:VE,handlingTime:LT,info:k1,input:E1,settings:$x,profile:YE,search:N1,summary:HE,styleSuggestions:OT,ui:xC,rules:Tb,textSuggestions:oC});function FT(e){return Qw({reducer:ZM,middleware:t=>[...t({thunk:{extraArgument:{dynamicThunkObject:e.dynamicThunkObject,deepdeskAPI:e.deepdeskAPI,deepdeskBrokerAPI:e.deepdeskBrokerAPI}},serializableCheck:!1}),IT(),MT({debounce:200}),NT({debounce:500}),DT(e.deepdeskAPI),...e.middleware?e.middleware:[]],preloadedState:e.preloadedState})}var JM=e=>{var t;return((t=e==null?void 0:e.type)==null?void 0:t.toLowerCase())??"unknown"},e2=e=>t=>n=>r=>{var a;let o=t.getState(),i=Ag("inlineSuggestions")(o);switch(r.type){case ji.toString():{!r.payload&&e.emit("logout",void 0);break}case an.fulfilled.toString():r.payload.length>0&&e.sendEvent("entities found",{conversationId:o.conversation.current.id,data:{entities:r.payload}});break;case Ye.toString():e.sendEvent(r.payload.name,{conversationId:((a=r.payload.options)==null?void 0:a.includeConversationData)&&o.conversation.current.id,data:r.payload.data});break;case Vc.toString():e.handleKeyDown(r.payload);break;case Eo.toString():e.logSendMessage(r.payload);break;case Kc.toString():e.handleInputChanged(r.payload);break;case Bo.fulfilled.toString():r.isBroadcasted||e.broadcast(Ug,r,!1),e.emit("cues",r.payload);break;default:break}let s=n(r);switch(r.type){case Eo.toString():e.handleAfterSendMessage(r.payload);break;case Za.toString():e.onUpdateShowTabHint(r.payload);break;case cf.toString():e.logHandlingTime();break;case Cn.toString():{let{start:l,end:u}=o.input.selection;e.emit("select-suggestion",{type:JM(r.payload.suggestion),...r.payload,replace:r.payload.replace==="selection"?{start:l,end:u}:{start:0,end:u}},{mayApplyChanges:!0}),i&&(t.dispatch(En([])),t.dispatch(Kn()));break}case zc.toString():{let{start:l,end:u}=o.input.selection;e.emit("replace",{...r.payload,replace:r.payload.replace==="selection"?{start:l,end:u}:{start:0,end:u}},{mayApplyChanges:!0});break}case ka.toString():{let l=t.getState(),{text:u,selection:c}=l.input.userCommitted;e.emit("reset",{text:u,selectionAfter:c},{mayApplyChanges:!0});break}case $c.toString():e.emit("select-image",r.payload,{mayApplyChanges:!0}),e.sendEvent("Image attached",{conversationId:o.conversation.current.id,data:{path:r.payload.suggestion.image,title:r.payload.suggestion.title}});break;case En.toString():{i&&r.payload.length>0&&t.dispatch(_r(0));break}case Gn.fulfilled.toString():{e.sendEvent("conversation summarized",{conversationId:o.conversation.current.id,data:{summary:r.payload.summary,model:t.getState().summary.model}});break}default:break}return s},HT=e2;function gy(e){return e.toISOString().replace("T"," ").replace("Z","")}function UT(e,t){var o,i,s;let{startTime:n,stopTime:r}=e.handlingTime;if(!n||!r)throw new Error("No startTime and stopTime for handling time metrics");return{conversationId:e.conversation.current.id,clientVersion:t.version,agentId:(o=e.info.agentInfo)==null?void 0:o.agentId,agentName:(i=e.info.agentInfo)==null?void 0:i.agentName,agentEmail:(s=e.info.agentInfo)==null?void 0:s.agentEmail,timeStart:gy(n),timeStop:gy(r)}}function BT(e,t,n){var k,L,I;let{text:r,metrics:{numCharsTyped:o,numCharsPasted:i,numCharsCut:s,numCharsDeleted:a,numPaste:l,agentStartedTypingTimestamp:u,externalTimeTotalSeconds:c,pastes:f,cuts:d,deletions:m,textSuggestions:y,offeredTextSuggestions:v}}=t[e],p=r.length,h=y.reduce((N,{text:V,searchTerm:_})=>N+V.length-(_?_.length:0),0),S=u??Date.now(),x=(Date.now()-S)/1e3+(c||0),T=o/x,C=y.reduce((N,{searchTerm:V})=>N+(V?V.length:0),0);return{conversationId:t.conversation.current.id,source:"agent",text:r,clientVersion:n.version,pastes:f,cuts:d,deletions:m,lenTextTyped:o+C,lenTextTotal:p,lenTextAssisted:h,lenTextPasted:i,lenTextCut:s,lenTextDeleted:a,timeTotalSeconds:x,charsPerSecond:T,numPastes:l,textSuggestionsV2:y,suggestionsCounters:[{source:"gpt",countOffered:v.filter(N=>N.source==="gpt").length}],agentId:(k=t.info.agentInfo)==null?void 0:k.agentId,agentName:(L=t.info.agentInfo)==null?void 0:L.agentName,agentEmail:(I=t.info.agentInfo)==null?void 0:I.agentEmail}}function hy(e,t){var i;let n=e.closest(t);if(n)return n;let r=e.getRootNode().host;if(r instanceof HTMLElement)return hy(r,t);let o=(i=e.ownerDocument.defaultView)==null?void 0:i.frameElement;return o?hy(o,t):null}function jT(e,t){return hy(e,t)}function zT(e){return typeof e=="object"&&e!==null&&"name"in e&&"message"in e}function t2(e){return typeof e=="object"&&e!==null&&"tagName"in e}function ff(e){return t2(e)&&(Kr(e)||_d(e))}var VT,kn=new Map,n2=["bottom","height","left","right","top","width"],r2=(e={},t={})=>n2.some(n=>e[n]!==t[n]);function KT(e){var n,r;if(e.ownerDocument===document)return[];let t=((r=(n=e.ownerDocument)==null?void 0:n.defaultView)==null?void 0:r.frameElement)??null;return t?[t,...KT(t)]:[]}function $T(e,t){return!e||!t?null:{...e,top:e.top+t.top,left:e.left+t.left}}var pf=!1,WT=()=>{pf=!0;let e=[];if(kn.forEach((t,n)=>{if(!n.isConnected){t.rect=null,e.push(t),kn.delete(n);return}let r=n.getBoundingClientRect();r2(r,t.rect)&&(t.rect=r,e.push(t))}),e.forEach(t=>{let n=t.parentRects?t.parentRects.reduce($T,t.rect):t.rect;t.callbacks.forEach(r=>r(n))}),kn.size===0){pf=!1;return}VT=window.requestAnimationFrame(WT)};function yy(e,t){let n=KT(e),r=[],o=n.map((i,s)=>yy(i,a=>{r[s]=a;let l=kn.get(e);if(!l)return;let u=r.reduce($T,l.rect);l.callbacks.forEach(c=>c(u))}));return{observe(i=!0){if(o.forEach(s=>s.observe(!1)),kn.has(e)){let s=kn.get(e);s.callbacks.push(t),s.rect&&t(s.rect)}else kn.set(e,{rect:void 0,callbacks:[t],parentRects:r});i&&!pf&&WT()},unobserve(){o.forEach(s=>s.unobserve());let i=kn.get(e);if(i){let s=i.callbacks.indexOf(t);s>=0&&i.callbacks.splice(s,1),i.callbacks.length||kn.delete(e),kn.size||(cancelAnimationFrame(VT),pf=!1)}}}}var qT,Pn=new Map,GT=()=>{Pn.forEach((e,t)=>{if(!t.isConnected){Pn.delete(t);return}let{clientHeight:n,scrollHeight:r}=t,o=r>n;e.visible!==o&&(e.visible=o,e.callbacks.forEach(i=>i(e.visible)))}),Pn.size!==0&&(qT=window.requestAnimationFrame(GT))};function YT(e,t){return{observe(){let n=Pn.size===0;Pn.has(e)?Pn.get(e).callbacks.push(t):Pn.set(e,{visible:void 0,callbacks:[t]}),n&>()},unobserve(){let n=Pn.get(e);if(n){let r=n.callbacks.indexOf(t);r>=0&&n.callbacks.splice(r,1),n.callbacks.length||Pn.delete(e),Pn.size||cancelAnimationFrame(qT)}}}}var vy=["borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","borderStyle","boxSizing","color","overflowWrap","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontWeight","fontKerning","lineHeight","letterSpacing","paddingLeft","paddingTop","paddingRight","paddingBottom","width","height","textIndent","whiteSpace","wordBreak","wordSpacing","wordWrap"];function Sy(e,t,n){return n.forEach(r=>{t.style[r]=e[r]})}function cs(e){return parseFloat(e)}function mf(e){return Math.round(e*1e6)}function XT(e){return e/1e6}function wy(e,t,n){if(e.boxSizing==="content-box")return;let{clientWidth:r}=t,o=cs(e.width),i=cs(e.borderLeftWidth),s=cs(e.borderRightWidth),a=cs(e.paddingRight),l=XT(mf(o)-mf(i)-mf(s)),u=XT(mf(r));if(l-u>2){let c=l-u;n.style.paddingRight=`${a+c}px`}}function hl(e,t={}){var c;let n=t.overlayContainer||document.createElement("div");n.style.display="none",n.style.position=t.position??"fixed",n.style.pointerEvents="none",n.style.borderColor="transparent",Fo(n);let r=window.getComputedStyle(e),o=!0,i=()=>{n.scrollTop=e.scrollTop};Sy(r,n,vy),wy(r,e,n),t.mirrorOverflow&&(n.style.overflow="hidden",e.addEventListener("scroll",i));let s=YT(e,()=>{Sy(r,n,vy),wy(r,e,n),i(),setTimeout(i,0)}),a,l=!0,u=yy(e,f=>{if(f===null){t.onRemove&&t.onRemove(),n.remove();return}if(!l&&t.onMoveStart&&(Promise.resolve().then(()=>t.onMoveStart()),l=!0),clearTimeout(a),a=setTimeout(()=>{t.onMoveEnd&&t.onMoveEnd(),l=!1},200),f.height===0&&f.width===0){if(o===!0)return;t.onHide&&t.onHide(),n.style.display="none",o=!0;return}if(Sy(r,n,vy),wy(r,e,n),i(),n.style.top=`${f.top}px`,n.style.left=`${f.left}px`,t.closestScrollElement&&t.closestScrollElement!==e){let d=t.closestScrollElement.getBoundingClientRect(),m=window.getComputedStyle(t.closestScrollElement),y=cs(m.borderTopWidth),v=cs(m.borderBottomWidth),p=d.top+y-f.top,g=f.top+f.height+-(d.top+d.height-v);n.style.clipPath=`inset(${p}px 0px ${g}px 0px)`}o&&(n.style.display="block",t.onShow&&t.onShow(),o=!1)});return t.appendTo?t.appendTo.appendChild(n):(c=e.parentElement)==null||c.appendChild(n),u.observe(),s.observe(),[n,()=>{e.removeEventListener("scroll",i),u.unobserve(),s.unobserve()}]}var QT=(e,t)=>({value(){try{let n=sessionStorage.getItem(`dd-${e}`);if(!n)return t;try{return JSON.parse(n)}catch{return t}}catch{return t}},update(n){try{sessionStorage.setItem(`dd-${e}`,JSON.stringify(n))}catch{z.warn("[Deepdesk] SessionStorage is blocked by browser")}}});function o2(e){return e.offsetParent!==null}function ZT(e){if(!o2(e))return!1;let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function gf(e,t,n=100){let r=ZT(e);t({isVisible:r});let o=setInterval(()=>{let i=ZT(e);i!==r&&(r=i,t({isVisible:r}))},n);return()=>{clearTimeout(o)}}var Ie=w(b());var JT=QT("showTabHint",!0),yl=class e{static version="11.2.1-beta.1";static count=0;deepdeskApi;inputMediator=null;version;broadcastEvents;eventListeners={};unmountHandlers=[];widgetRoot=null;dynamicThunkObject={};isMounted=!1;instanceId;shouldRender=!0;store;constructor({deepdeskUrl:t,brokerUrl:n,version:r=e.version||"unknown",locale:o="en-US",token:i,fetch:s,productName:a,createCustomChannel:l}){let u=t.replace(/\/api$/,"");this.deepdeskApi=new or(u,{token:i,fetch:s}),this.version=r,this.instanceId=e.count++;let c={deepdeskAPI:this.deepdeskApi,dynamicThunkObject:this.dynamicThunkObject,middleware:[HT({broadcast:(f,d,m)=>{this.broadcastEvents.send(f,d,m)},emit:(f,d,m)=>this.emit(f,d,m),handleAfterSendMessage:f=>this.handleAfterSendMessage(f),handleInputChanged:f=>this.handleInputChanged(f),handleKeyDown:f=>this.handleKeyDown(f),logHandlingTime:()=>this.logHandlingTime(),logSendMessage:f=>this.logSendMessage(f),onUpdateShowTabHint:f=>JT.update(f),sendEvent:(f,d)=>this.deepdeskApi.sendEvent(f,d)})]};n&&Object.assign(c,{deepdeskBrokerAPI:new gl(n)}),this.store=FT(c),this.broadcastEvents=new TT({debug:!0,deepdeskUrl:u,eventMap:M1(this.store),createCustomChannel:l}),this.store.dispatch(Za(JT.value())),this.store.dispatch(Nc({locale:o,adminUrl:u,productName:a}))}get state(){return this.store.getState()}get settings(){return this.state.settings}get selectedTextSuggestion(){return this.state.input.textSuggestions[this.state.input.selectedSuggestionIndex]??null}hasConversation(){return!!this.state.conversation.current}conversationId(){if(!this.hasConversation())throw new Error("No conversation loaded");return this.state.conversation.current.id}sessionId(){if(!this.hasConversation())throw new Error("No conversation loaded");return this.state.conversation.current.sessionId}shouldAbort(){return this.state.conversation.isSupported===!1?(z.warn("Conversation is not supported"),!0):this.hasConversation()?this.state.profile.data?!1:(z.warn("Profile has not been loaded (yet)"),!0):(z.warn("No conversation loaded (yet)"),!0)}login(){return this.store.dispatch(ji(null)),this.store.dispatch(zn()),new Promise(t=>{let n=this.store.subscribe(()=>{let r=this.store.getState();tt(r)&&Wx(r)!=="loading"&&(n(),t())});this.unmountHandlers.push(()=>{n()})})}async isLoggedIn(){return(await this.store.dispatch(zn())).payload}async setPlatformAgentId(t){try{if((await this.deepdeskApi.client.get("/apis/admin/session/me/",{version:null})).external_id)return;await this.deepdeskApi.client.request("/apis/admin/session/me/",{method:"PATCH",body:JSON.stringify({external_id:t}),version:null})}catch(n){z.warn("Failed to attach user:",n)}}async isConversationSupported(t,n){return(await this.store.dispatch(Ng({sessionId:t,options:n}))).payload}async createConversation(t){return this.hasConversation()&&this.sessionId()!==t.sessionId&&this.resetConversation(),(await this.store.dispatch(Fc(t))).payload}async getConversationBySessionId(t,n){return this.hasConversation()&&this.sessionId()!==t&&this.resetConversation(),(await this.store.dispatch(Hc({sessionId:t,options:n}))).payload}async upsertConversation(t){return this.hasConversation()&&this.sessionId()!==t.sessionId&&this.resetConversation(),(await this.store.dispatch(Mg(t))).payload}async postMessages(t){return(await this.store.dispatch(Bc(t))).payload}async updateConversation(t){return(await this.store.dispatch(Uc(t))).payload}resetConversation(){this.store.dispatch(le()),this.loadProfileConfigPromise=null,this.dynamicThunkObject.conversationQuery=null}async getSummary(){let t=await this.store.dispatch(Gn());if(t.error)throw new Error(t.error.message);return t.payload.summary}configure(t){this.store.dispatch(Nc(t))}setVisitorInfo(t){this.store.dispatch(T1(t))}async setAgentInfo(t){await this.store.dispatch(Pa(t))}async setAgentSettings(t){await this.store.dispatch(Fg(t))}async getAgentSettings(){return(await this.store.dispatch(Hg())).payload}async refresh(){if(this.shouldAbort())return Promise.resolve();this.inputMediator&&this.handleInputChanged(this.inputMediator.getText());let t=[];return this.store.dispatch(Pd()),t.push(this.refreshWidgetSuggestions()),Promise.all(t).then(()=>{})}notifyInputChanged(t){this.store.dispatch(Kc(t))}notifyKeyDown(t){this.store.dispatch(Vc(t))}notifyPaste(t,n){this.store.dispatch(v1({text:t,selectionText:n}))}notifyCut(t){this.store.dispatch(h1(t))}notifyExternalSuggestion(t){this.store.dispatch(Cn(t)),this.store.dispatch(Kn())}async evaluateRule(t,n={}){let{payload:r,error:o}=await this.store.dispatch(Bo({label:t,params:n}));if(o)throw new Error(o.message);return r}handleInputChanged(t){let{overlayCollapsed:n,openOverlayWhenTyping:r}=this.state.ui;n&&r&&this.store.dispatch(zr({collapse:!1})),this.inputMediator&&this.store.dispatch(d1({text:t,html:this.inputMediator.getHTML(),selection:this.inputMediator.getSelection()})),!this.shouldAbort()&&(this.isMounted||this.store.dispatch(En([])))}handleKeyDown(t){let{overlayCollapsed:n}=this.state.ui,{textSuggestions:r,selectedSuggestionIndex:o,selection:i}=this.state.input,{inlineSuggestions:s}=this.state.settings,a=r.length>0,l=o!==-1;if(this.store.dispatch(y1(l1(t))),t.key!=="Tab"&&!this.settings.showTextSuggestions)return;let u=()=>{n||!a||i&&(t.shiftKey||(this.store.dispatch(p1()),s||this.stageSelectedSuggestion({inputType:"arrow"}),t.preventDefault()))},c=()=>{n||!a||s&&o<=0||i&&(t.shiftKey||(this.store.dispatch(g1()),t.preventDefault(),!s&&(this.state.input.selectedSuggestionIndex===-1?this.store.dispatch(ka()):this.stageSelectedSuggestion({inputType:"arrow"}))))};switch(t.key){case"Up":case"ArrowUp":s?c():u();return;case"Down":case"ArrowDown":{s?u():c();return}case"Esc":case"Escape":{s&&l&&this.store.dispatch(_r(-1)),this.state.input.selectedSuggestionIndex!==-1?(this.store.dispatch(_r(-1)),this.store.dispatch(ka()),t.preventDefault()):n||(this.store.dispatch(zr({collapse:!0})),this.store.dispatch(SC(!0)),t.preventDefault());return}case"Tab":{let{userCommitted:f}=this.state.input,d=f.text.substring(0,f.selection.end),{tabCompletionSuggestion:m}=this.state.input;this.store.dispatch(Za(!1)),this.state.input.selectedSuggestionIndex>-1?this.stageSelectedSuggestion({inputType:"tab"}):!s&&this.settings.showTabCompletion&&m&&m.text.startsWith(d)&&(this.store.dispatch(Cn({text:m.text,suggestion:m,eventMetrics:{inputType:"tab"},replace:"until-selection-end"})),this.store.dispatch(Kn())),t.preventDefault();break}default:}}handleAfterSendMessage(t){this.emit("send-message",t),this.store.dispatch(S1()),this.store.dispatch(En([]))}handlingTimeStart(){this.state.handlingTime.startTime||(z.info("Start handling time"),this.store.dispatch(RT()))}handlingTimeStop(){this.state.handlingTime.startTime&&(z.info("Stop handling time"),this.store.dispatch(cf()))}logSendMessage(t){let n=BT("input",this.state,{version:this.version});t&&(Object.assign(n,{text:t}),Object.assign(n,{lenTextTotal:t.length})),this.deepdeskApi.sendEventV1("Send Message",n),this.emit("send-message-event",n)}logHandlingTime(){let t=UT(this.state,{version:this.version});this.deepdeskApi.sendEventV1("Handling Time",t),this.store.dispatch(AT())}notifySubmit(t={}){this.shouldAbort()||(this.store.dispatch(Kn()),this.store.dispatch(Eo(t.text??this.state.input.text)))}stageSelectedSuggestion(t){let n=this.state.input.selectedSuggestionIndex,{textSuggestions:r}=this.state.input;this.store.dispatch(Cn({text:r[n].text,suggestion:r[n],eventMetrics:t,replace:"until-selection-end"}))}emit(t,n,r={}){let o=()=>{this.eventListeners[t]&&this.eventListeners[t].forEach(i=>{try{i(n)}catch(s){z.warn(`The following error occurred in deepdeskSDK.on('${t}', handler)`),z.error(s)}})};this.inputMediator&&r.mayApplyChanges?this.inputMediator.applyChanges(o):o()}on(t,n){return this.eventListeners[t]||(this.eventListeners[t]=[]),this.eventListeners[t].push(n),()=>{this.off(t,n)}}off(t,n){if(!t&&!n){this.eventListeners={};return}let r;this.eventListeners[t]&&(r=this.eventListeners[t].indexOf(n),r>-1&&this.eventListeners[t].splice(r,1))}setConversationQuery(t){this.dynamicThunkObject.conversationQuery=t}whenConversationLoaded(t){let n=()=>this.loadProfileConfig().then(()=>t());this.hasConversation()&&n();let r=this.hasConversation();this.store.subscribe(()=>{this.hasConversation()!==r&&(r=this.hasConversation(),r&&n())})}overlayContainerFactory(t,n,r,o){let[i,s]=hl(n,r);return i.setAttribute("translate","no"),i.dataset.testid=t,o&&i.classList.add(o),this.unmountHandlers.push(()=>{(0,qt.unmountComponentAtNode)(i),s(),i.remove()}),i}createInlineContainer(t,n){var s;let r=document.createElement("div");r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.style.height="0px",r.style.width="0px";let o=document.createElement("div");o.style.display="none",o.style.position="absolute",o.style.height="0px",o.style.width="0px",o.style.backgroundColor="red",r.appendChild(o);let i=(s=t.ownerDocument.defaultView)==null?void 0:s.frameElement;if(i){let[a,l]=hl(i,{appendTo:document.body,onMoveStart:()=>{o.style.display="none"}});a.dataset.testid=n,a.style.zIndex="2",a.appendChild(r),this.unmountHandlers.push(()=>{(0,qt.unmountComponentAtNode)(o),l()})}else document.body.appendChild(r);return o}createContainer(t,n=document.body){let r=window.getComputedStyle(n),o=document.createElement("div");return Fo(o),o.dataset.testid=t,o.style.color=r.color,o.style.fontSize=r.fontSize,o.style.fontFamily=r.fontFamily,o.style.fontVariant=r.fontVariant,o.setAttribute("translate","no"),n.appendChild(o),this.unmountHandlers.push(()=>{(0,qt.unmountComponentAtNode)(o),o.remove()}),o}storeMetrics(){try{let t=`dd-metrics-${this.conversationId()}`,n=JSON.stringify({text:this.state.input.text,metrics:this.state.input.metrics});window.sessionStorage.setItem(t,n),z.info(`Stored analytics for ${this.conversationId()}`)}catch{}}restoreMetrics(){try{let t=`dd-metrics-${this.conversationId()}`,n=window.sessionStorage.getItem(t);if(!n)return;let r=JSON.parse(n);r.text.trim()===this.state.input.text.trim()?(z.info(`Restored metrics for ${this.conversationId()}`),this.store.dispatch(x1(r.metrics))):z.warn(`Metrics mismatch, disregarding stored metrics for ${this.conversationId()}`),window.sessionStorage.removeItem(t)}catch{}}mount(t,n={}){if(this.isMounted)throw new Error("[Deepdesk] This instance was already mounted. Make sure to unmount before you remount.");if(!ff(t))throw new Error("[Deepdesk] Only mount on textarea or contentEditable div.");if(!this.shouldRender)return;let{customStyles:r={},showStyleSuggestions:o,showTabCompletion:i,showTextSuggestions:s,textSuggestionsCount:a,showMidSentenceSuggestions:l,showSuggestionsBeforePattern:u,showSuggestionsAfterPattern:c,isEmbedded:f,detectSubmit:d,insertLink:m,inputMediator:y,closestScrollSelector:v,appendOverlayTo:p,inlineSuggestions:g,floatingMenu:h}=n;this.configure({showStyleSuggestions:o,showTabCompletion:i,textSuggestionsCount:a,showMidSentenceSuggestions:l,showSuggestionsBeforePattern:u,showSuggestionsAfterPattern:c,showTextSuggestions:s,insertLink:m,isEmbedded:f,inlineSuggestions:g,floatingMenu:!!h}),n.automaticHandlingTime&&this.setupHandlingTime(t),Fo(t),this.inputMediator=y||(Kr(t)?new Vo(t):new zo(t)),this.inputMediator.on("change",({plainText:T})=>{this.notifyInputChanged(T)}),this.inputMediator.on("updated",()=>{this.inputMediator&&this.store.dispatch(w1({text:this.inputMediator.getText(),html:this.inputMediator.getHTML(),selection:this.inputMediator.getSelection()}))}),this.inputMediator.on("keydown",T=>{this.notifyKeyDown(T)}),this.inputMediator.on("paste",({pastedText:T,selectionText:C})=>{this.notifyPaste(T,C)}),this.inputMediator.on("cut",({selectionText:T})=>{this.notifyCut(T)});let S=v&&jT(t,v)||void 0;if(g){let{customStyles:T,appendOverlayTo:C}=n;if(Kr(t))throw new Error("[Deepdesk] Inline suggestion is not supported for textarea yet.");let k=this.createInlineContainer(t,"deepdesk-caret");(0,qt.render)((0,Ie.jsx)(Uo,{store:this.store,customStyles:T,children:(0,Ie.jsx)(bo,{broadcastEvents:this.broadcastEvents,children:(0,Ie.jsx)(PC,{})})}),k),this.inputMediator.on("caret",I=>{this.store.dispatch(En([])),I?(k.style.display="block",k.style.top=`${I.top}px`,k.style.left=`${I.left}px`):k.style.display="none"});let L=this.overlayContainerFactory("floating-menu",S||t,{appendTo:typeof h=="object"&&"appendOverlayTo"in h?h.appendOverlayTo:C},T==null?void 0:T.floatingMenuRootNode);(0,qt.render)((0,Ie.jsx)(Uo,{store:this.store,customStyles:T,children:(0,Ie.jsx)(bo,{broadcastEvents:this.broadcastEvents,children:(0,Ie.jsx)(hC,{onLogIn:()=>this.loginViaPopup().catch(I=>z.warn(I.message))})})}),L)}else{let T=this.overlayContainerFactory("deepdesk-tab-completion",S||t,{appendTo:p,closestScrollElement:S,mirrorOverflow:!0,onRemove:()=>this.unmount()},r==null?void 0:r.rootNode),C=this.overlayContainerFactory("deepdesk-suggestions-overlay",S||t,{appendTo:p},r==null?void 0:r.suggestionsRootNode);(0,qt.render)((0,Ie.jsx)(Uo,{store:this.store,customStyles:r,children:(0,Ie.jsx)(bo,{broadcastEvents:this.broadcastEvents,children:(0,Ie.jsx)(nb,{inputElement:t})})}),T),(0,qt.render)((0,Ie.jsx)(Uo,{store:this.store,customStyles:r,children:(0,Ie.jsx)(bo,{broadcastEvents:this.broadcastEvents,children:(0,Ie.jsx)(DC,{onLogIn:()=>this.loginViaPopup().catch(k=>z.warn(k.message))})})}),C)}(0,qt.render)((0,Ie.jsx)(Uo,{store:this.store,customStyles:r,children:(0,Ie.jsx)(bo,{broadcastEvents:this.broadcastEvents,children:(0,Ie.jsx)(dC,{})})}),this.createContainer("deepdesk-overlays"));let x;this.inputMediator.on("selection",T=>{clearTimeout(x),T===null?x=setTimeout(()=>{T!==null&&this.store.dispatch(_g(T))},500):this.store.dispatch(_g(T))}),this.inputMediator.on("disabled",()=>{var T;(T=this.inputMediator)==null||T.deactivate(),this.configure({visible:!1})}),this.inputMediator.on("enabled",()=>{this.inputMediator&&(this.configure({visible:!0}),this.inputMediator.activate())}),this.inputMediator.on("submit",()=>{d&&this.notifySubmit()}),this.inputMediator.on("blur",()=>this.store.dispatch(Eh(!1))),this.inputMediator.on("focus",()=>this.store.dispatch(Eh(!0))),this.store.dispatch(f1({text:this.inputMediator.getText(),html:this.inputMediator.getHTML(),selection:this.inputMediator.getSelection()})),this.unmountHandlers.push(()=>{this.state.input.text!==""&&(this.store.dispatch(Kn()),this.storeMetrics())}),this.whenConversationLoaded(()=>{var T;this.restoreMetrics(),this.refresh(),this.broadcastEvents.setSessionId((T=this.state.conversation.current)==null?void 0:T.sessionId)}),this.isMounted=!0}unmount(){var t;this.unmountHandlers.forEach(n=>n()),this.unmountHandlers=[],(t=this.inputMediator)==null||t.dispose(),this.broadcastEvents.cleanup(),this.isMounted=!1}renderWidget(t,n={}){if(this.widgetRoot&&z.warn("A widget was already rendered for this instance. Make sure to unmountWidget before rerendering"),!this.shouldRender)return;let{customStyles:r,showImages:o,isEmbedded:i}=n;this.widgetRoot=t,this.configure({showImages:o,isEmbedded:i}),(0,qt.render)((0,Ie.jsx)(Uo,{store:this.store,customStyles:r,children:(0,Ie.jsx)(bo,{broadcastEvents:this.broadcastEvents,children:(0,Ie.jsx)(wT,{onLogIn:()=>this.loginViaPopup().catch(s=>z.warn(s.message))})})}),t),this.whenConversationLoaded(()=>{var s;this.broadcastEvents.setSessionId((s=this.state.conversation.current)==null?void 0:s.sessionId)})}unmountWidget(){this.widgetRoot&&(0,qt.unmountComponentAtNode)(this.widgetRoot),this.widgetRoot=null}setupHandlingTime(t){let n=gf(t,({isVisible:r})=>{r?this.handlingTimeStart():this.handlingTimeStop()});this.unmountHandlers.push(()=>{this.handlingTimeStop(),n()}),this.whenConversationLoaded(()=>{this.handlingTimeStart()})}handleError(t){zT(t)&&t.message==="Unauthorized"&&this.login()}loadProfileConfigPromise=null;loadProfileConfig(){return this.loadProfileConfigPromise?this.loadProfileConfigPromise:(this.loadProfileConfigPromise=Promise.resolve().then(async()=>{await this.store.dispatch(Ya());let t=jr(this.state);t&&(await this.store.dispatch(qa()),this.store.dispatch(Nc({showSearch:t.search,showAutoflows:t.autoflows,showCustomMessages:t.customMessages,showImageSearch:t.imageSearch,showEntitiesCommand:t.entitiesCommand,showSummaryCommand:t.summarizer,showKnowledgeSearch:!!t.knowledgeAssistant,recommendTextSuggestions:t.recommendTextSuggestions})))}),this.loadProfileConfigPromise)}async loginViaPopup(t){return new Promise((n,r)=>{let o=new MessageChannel,i=o.port1,s=this.state.settings.adminUrl,a=new URL(t!=null&&t.url?t==null?void 0:t.url:`${s}/platform/sso/`);a.searchParams.append("redirect","/sdk/popup/close.html");let l=!1,u=()=>{c&&!c.closed&&c.close(),window.removeEventListener("message",f),clearInterval(d)};i.onmessage=async m=>{var y,v;if((y=m.data)!=null&&y.jwt)try{await this.deepdeskApi.exchangeTokenForAccessCookie((v=m.data)==null?void 0:v.jwt),await this.isLoggedIn(),this.broadcastEvents.send(Aa),l=!0,o.port1.close(),n()}catch(p){console.error(p),r(p)}finally{l=!0,u()}};let c=window.open(a.toString(),"deepdesk-login","scrollbars=no,left=100,top=150,width=500,height=500");c===null&&r(new Error("Popup blocked by browser"));let f=async m=>{var y;if(m.origin===a.origin)switch((y=m.data)==null?void 0:y.type){case"deepdesk-popup-loaded":{try{let v=JSON.stringify({type:"deepdesk-popup-create-channel"});c==null||c.postMessage(v,a.origin,[o.port2])}catch(v){z.error("Error posting message to popup",v),r(v)}break}case"deepdesk-popup-error":{u(),m.data.message==="Timeout"&&z.warn("Popup timed out. Check if the account's platform url is configured correctly."),r(new Error(m.data.message));break}}};window.addEventListener("message",f);let d=setInterval(()=>{c&&!c.closed||(u(),l||r(new Error("Popup closed by user")))},200);this.unmountHandlers.push(u)})}translateMessages(t){return this.deepdeskApi.translateMessages(t)}async checkForTrialMode(t){try{let{account:n}=await this.deepdeskApi.getPlatformConfig();if(!n.isTrial){this.shouldRender=!0;return}if(z.info("Trial is active"),!await this.deepdeskApi.checkUserExists(t))throw new Error("User is not in trial");this.shouldRender=!0}catch(n){let{message:r}=n;z.info(r),this.shouldRender=!1}}async refreshWidgetSuggestions(){if(!this.widgetRoot||this.shouldAbort())return;let{uiConfig:t}=this.state.profile.data;if(!t.widget)return;let n=Td(this.state);try{n.forEach(({type:r})=>{r==="entities"?this.store.dispatch(an()):this.store.dispatch(un(r))})}catch(r){this.handleError(r)}}};async function ek(e,t,n={}){let{value:r}=e,{start:o,end:i}=n.replace??{start:0,end:r.length},s=`${r.slice(0,o)}${t}${r.slice(i)}`,a=n.selectionAfter??{start:o+t.length,end:o+t.length},l=()=>{if(n.setValue)return n.setValue(s);e.value=s};return Promise.resolve(l()).then(()=>{e.selectionStart=a.start,e.selectionEnd=a.end,e.blur(),e.focus()})}async function tk(e,t,n={}){let r=n.replace?Gr(e,n.replace.start,n.replace.end):as(e),o,i=()=>{if(n.setRange)return n.setRange(r.cloneRange());r.deleteContents(),o=document.createElement("span"),r.insertNode(o),n.insertBRs!==!1?t.split(`
|
|
28
|
+
`).reverse().forEach((s,a)=>{a>0&&r.insertNode(document.createElement("br")),r.insertNode(document.createTextNode(s))}):r.insertNode(document.createTextNode(t))};return Promise.resolve(i()).then(()=>{try{if(n.selectionAfter!==!1){e.focus();let s=n.selectionAfter?Gr(e,n.selectionAfter.start,n.selectionAfter.end):(r.collapse(!1),r),a=window.getSelection();a==null||a.removeAllRanges(),a==null||a.addRange(s)}if(!o)return;o.scrollIntoView&&o.scrollIntoView({block:"nearest",inline:"nearest"})}finally{o&&o.remove()}})}function i2(e){let t=document.createElement("template");return t.innerHTML=e.replace(/(\[([^\]]+)])\(([^)]+)\)/g,'<a href="$3" target="_blank" rel="noopener noreferrer">$2</a>'),t.content}function s2(e){let t=document.createDocumentFragment();return e.split(`
|
|
29
|
+
`).forEach((n,r)=>{r>0&&t.appendChild(document.createElement("br"));let o={index:0},i=0;for(;o=n.slice(i).match(/(\[([^\]]+)])\(([^)]+)\)/);){let s=document.createElement("a");s.href=o[3],s.setAttribute("target","_blank"),s.setAttribute("rel","noopener noreferrer"),s.appendChild(document.createTextNode(o[2])),t.appendChild(document.createTextNode(n.slice(i,i+o.index))),t.appendChild(s),i=i+o.index+o[0].length}t.appendChild(document.createTextNode(n.slice(i)))}),t}function nk(e,t){return!e.contains(t)||t===e?null:t.parentNode===e?t:nk(e,t.parentNode)}async function rk(e,t,{isBlock:n,isHTML:r}={}){let o;e.dispatchEvent(new InputEvent("beforeinput",{inputType:"insertText",data:t,bubbles:!0,cancelable:!0}));let i=()=>{let s=e.ownerDocument.defaultView??window,a=s.getSelection();if((!a||a.rangeCount===0)&&(e.focus(),a=s.getSelection()),!a||a.rangeCount===0)return;let l=a.getRangeAt(0);if(!l)return;o=document.createElement("span"),l.insertNode(o);let u=r?i2(t):s2(t);if(n){let c=l.startContainer===e?e.childNodes[l.startOffset]:l.startContainer,f=nk(e,c)??e.firstChild;e.insertBefore(u,(f==null?void 0:f.nextSibling)??null)}else l.insertNode(u),l.collapse(!1)};return Promise.resolve(i()).then(()=>{if(e.dispatchEvent(new InputEvent("input",{inputType:"insertText",data:t,bubbles:!0,cancelable:!0})),e.focus(),!!o)try{o.scrollIntoView&&o.scrollIntoView({block:"nearest",inline:"nearest"})}finally{o&&o.remove()}})}function ok(e){return e.replace(/\[([\w\s\d]+)\]\((https?:\/\/[^\s]+)\)/g,'<a href="$2" target="_blank" rel="noreferrer">$1</a>')}async function ik(e,t,n){await new or(e).authenticateWithKey(t,n)}async function sk(e){let n=await new pn(e).get("/platform/config/",{version:null,useCache:!0});return J(n)}async function a2(e){let n=await(e.fetch??window.fetch)(e.url),r=await n.blob();return new File([r],e.name,{type:e.mimeType??n.headers.get("Content-Type")??"image/jpeg"})}async function ak(e,t){let n=await a2(t),r=new Event("change",{bubbles:!0,cancelable:!0});try{Object.defineProperty(e,"files",{configurable:!0,get:()=>[n]}),e.dispatchEvent(r)}finally{Object.hasOwn(e,"files")&&delete e.files}}return Ek(l2);})();
|
|
29
30
|
/*! Bundled license information:
|
|
30
31
|
|
|
31
32
|
classnames/index.js:
|