solace-agent-mesh 0.2.1__py3-none-any.whl → 0.2.3__py3-none-any.whl
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.
Potentially problematic release.
This version of solace-agent-mesh might be problematic. Click here for more details.
- solace_agent_mesh/agents/global/actions/plantuml_diagram.py +94 -36
- solace_agent_mesh/assets/web-visualizer/assets/{index-C5awueeJ.js → index-DnDr1pnu.js} +33 -33
- solace_agent_mesh/assets/web-visualizer/index.html +1 -1
- solace_agent_mesh/cli/__init__.py +1 -1
- solace_agent_mesh/cli/commands/add/agent.py +1 -1
- solace_agent_mesh/cli/commands/add/copy_from_plugin.py +1 -1
- solace_agent_mesh/cli/commands/add/gateway.py +2 -2
- solace_agent_mesh/cli/commands/init/check_if_already_done.py +1 -1
- solace_agent_mesh/cli/commands/init/init.py +17 -48
- solace_agent_mesh/cli/commands/init/web_init_step.py +32 -0
- solace_agent_mesh/cli/commands/plugin/create.py +3 -3
- solace_agent_mesh/cli/main.py +6 -0
- solace_agent_mesh/config_portal/frontend/static/client/Solace_community_logo.png +0 -0
- solace_agent_mesh/config_portal/frontend/static/client/assets/_index-DMmCawWe.js +42 -0
- solace_agent_mesh/config_portal/frontend/static/client/assets/{manifest-8147e469.js → manifest-dd988f05.js} +1 -1
- solace_agent_mesh/config_portal/frontend/static/client/assets/root-DX4gQ516.css +1 -0
- solace_agent_mesh/config_portal/frontend/static/client/index.html +2 -2
- solace_agent_mesh/orchestrator/components/orchestrator_stimulus_processor_component.py +18 -1
- solace_agent_mesh/services/history_service/history_providers/sql_history_provider.py +1 -1
- solace_agent_mesh/services/llm_service/components/llm_request_component.py +54 -31
- solace_agent_mesh/templates/rest-api-default-config.yaml +4 -2
- solace_agent_mesh/templates/web-default-config.yaml +4 -2
- {solace_agent_mesh-0.2.1.dist-info → solace_agent_mesh-0.2.3.dist-info}/METADATA +2 -2
- {solace_agent_mesh-0.2.1.dist-info → solace_agent_mesh-0.2.3.dist-info}/RECORD +28 -26
- solace_agent_mesh/config_portal/frontend/static/client/assets/_index-DRPGOzHj.js +0 -42
- solace_agent_mesh/config_portal/frontend/static/client/assets/root-hhS5izs8.css +0 -1
- /solace_agent_mesh/config_portal/frontend/static/client/assets/{root-DgMDqKDc.js → root-BApq5dPK.js} +0 -0
- {solace_agent_mesh-0.2.1.dist-info → solace_agent_mesh-0.2.3.dist-info}/WHEEL +0 -0
- {solace_agent_mesh-0.2.1.dist-info → solace_agent_mesh-0.2.3.dist-info}/entry_points.txt +0 -0
- {solace_agent_mesh-0.2.1.dist-info → solace_agent_mesh-0.2.3.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function Bf(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const c in s)if(c!=="default"&&!(c in e)){const o=Object.getOwnPropertyDescriptor(s,c);o&&Object.defineProperty(e,c,o.get?o:{enumerable:!0,get:()=>s[c]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))s(c);new MutationObserver(c=>{for(const o of c)if(o.type==="childList")for(const h of o.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&s(h)}).observe(document,{childList:!0,subtree:!0});function n(c){const o={};return c.integrity&&(o.integrity=c.integrity),c.referrerPolicy&&(o.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?o.credentials="include":c.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(c){if(c.ep)return;c.ep=!0;const o=n(c);fetch(c.href,o)}})();var Gf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ql(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lh={exports:{}},$o={},Uh={exports:{}},tt={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@ function Uf(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var mi=Symbol.for("react.element")
|
|
9
|
+
*/var mi=Symbol.for("react.element"),$f=Symbol.for("react.portal"),Wf=Symbol.for("react.fragment"),qf=Symbol.for("react.strict_mode"),Vf=Symbol.for("react.profiler"),jf=Symbol.for("react.provider"),Hf=Symbol.for("react.context"),Yf=Symbol.for("react.forward_ref"),zf=Symbol.for("react.suspense"),Qf=Symbol.for("react.memo"),Kf=Symbol.for("react.lazy"),lc=Symbol.iterator;function Xf(e){return e===null||typeof e!="object"?null:(e=lc&&e[lc]||e["@@iterator"],typeof e=="function"?e:null)}var xh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Fh=Object.assign,kh={};function ys(e,t,n){this.props=e,this.context=t,this.refs=kh,this.updater=n||xh}ys.prototype.isReactComponent={};ys.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ys.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Bh(){}Bh.prototype=ys.prototype;function Kl(e,t,n){this.props=e,this.context=t,this.refs=kh,this.updater=n||xh}var Xl=Kl.prototype=new Bh;Xl.constructor=Kl;Fh(Xl,ys.prototype);Xl.isPureReactComponent=!0;var uc=Array.isArray,Gh=Object.prototype.hasOwnProperty,Jl={current:null},$h={key:!0,ref:!0,__self:!0,__source:!0};function Wh(e,t,n){var s,c={},o=null,h=null;if(t!=null)for(s in t.ref!==void 0&&(h=t.ref),t.key!==void 0&&(o=""+t.key),t)Gh.call(t,s)&&!$h.hasOwnProperty(s)&&(c[s]=t[s]);var r=arguments.length-2;if(r===1)c.children=n;else if(1<r){for(var a=Array(r),u=0;u<r;u++)a[u]=arguments[u+2];c.children=a}if(e&&e.defaultProps)for(s in r=e.defaultProps,r)c[s]===void 0&&(c[s]=r[s]);return{$$typeof:mi,type:e,key:o,ref:h,props:c,_owner:Jl.current}}function Jf(e,t){return{$$typeof:mi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Zl(e){return typeof e=="object"&&e!==null&&e.$$typeof===mi}function Zf(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var cc=/\/+/g;function _a(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Zf(""+e.key):t.toString(36)}function Ki(e,t,n,s,c){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var h=!1;if(e===null)h=!0;else switch(o){case"string":case"number":h=!0;break;case"object":switch(e.$$typeof){case mi:case $f:h=!0}}if(h)return h=e,c=c(h),e=s===""?"."+_a(h,0):s,uc(c)?(n="",e!=null&&(n=e.replace(cc,"$&/")+"/"),Ki(c,t,n,"",function(u){return u})):c!=null&&(Zl(c)&&(c=Jf(c,n+(!c.key||h&&h.key===c.key?"":(""+c.key).replace(cc,"$&/")+"/")+e)),t.push(c)),1;if(h=0,s=s===""?".":s+":",uc(e))for(var r=0;r<e.length;r++){o=e[r];var a=s+_a(o,r);h+=Ki(o,t,n,a,c)}else if(a=Xf(e),typeof a=="function")for(e=a.call(e),r=0;!(o=e.next()).done;)o=o.value,a=s+_a(o,r++),h+=Ki(o,t,n,a,c);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return h}function Di(e,t,n){if(e==null)return e;var s=[],c=0;return Ki(e,s,"","",function(o){return t.call(n,o,c++)}),s}function e_(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Qt={current:null},Xi={transition:null},t_={ReactCurrentDispatcher:Qt,ReactCurrentBatchConfig:Xi,ReactCurrentOwner:Jl};function qh(){throw Error("act(...) is not supported in production builds of React.")}tt.Children={map:Di,forEach:function(e,t,n){Di(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Di(e,function(){t++}),t},toArray:function(e){return Di(e,function(t){return t})||[]},only:function(e){if(!Zl(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};tt.Component=ys;tt.Fragment=Wf;tt.Profiler=Vf;tt.PureComponent=Kl;tt.StrictMode=qf;tt.Suspense=zf;tt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=t_;tt.act=qh;tt.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var s=Fh({},e.props),c=e.key,o=e.ref,h=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,h=Jl.current),t.key!==void 0&&(c=""+t.key),e.type&&e.type.defaultProps)var r=e.type.defaultProps;for(a in t)Gh.call(t,a)&&!$h.hasOwnProperty(a)&&(s[a]=t[a]===void 0&&r!==void 0?r[a]:t[a])}var a=arguments.length-2;if(a===1)s.children=n;else if(1<a){r=Array(a);for(var u=0;u<a;u++)r[u]=arguments[u+2];s.children=r}return{$$typeof:mi,type:e.type,key:c,ref:o,props:s,_owner:h}};tt.createContext=function(e){return e={$$typeof:Hf,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:jf,_context:e},e.Consumer=e};tt.createElement=Wh;tt.createFactory=function(e){var t=Wh.bind(null,e);return t.type=e,t};tt.createRef=function(){return{current:null}};tt.forwardRef=function(e){return{$$typeof:Yf,render:e}};tt.isValidElement=Zl;tt.lazy=function(e){return{$$typeof:Kf,_payload:{_status:-1,_result:e},_init:e_}};tt.memo=function(e,t){return{$$typeof:Qf,type:e,compare:t===void 0?null:t}};tt.startTransition=function(e){var t=Xi.transition;Xi.transition={};try{e()}finally{Xi.transition=t}};tt.unstable_act=qh;tt.useCallback=function(e,t){return Qt.current.useCallback(e,t)};tt.useContext=function(e){return Qt.current.useContext(e)};tt.useDebugValue=function(){};tt.useDeferredValue=function(e){return Qt.current.useDeferredValue(e)};tt.useEffect=function(e,t){return Qt.current.useEffect(e,t)};tt.useId=function(){return Qt.current.useId()};tt.useImperativeHandle=function(e,t,n){return Qt.current.useImperativeHandle(e,t,n)};tt.useInsertionEffect=function(e,t){return Qt.current.useInsertionEffect(e,t)};tt.useLayoutEffect=function(e,t){return Qt.current.useLayoutEffect(e,t)};tt.useMemo=function(e,t){return Qt.current.useMemo(e,t)};tt.useReducer=function(e,t,n){return Qt.current.useReducer(e,t,n)};tt.useRef=function(e){return Qt.current.useRef(e)};tt.useState=function(e){return Qt.current.useState(e)};tt.useSyncExternalStore=function(e,t,n){return Qt.current.useSyncExternalStore(e,t,n)};tt.useTransition=function(){return Qt.current.useTransition()};tt.version="18.3.1";Uh.exports=tt;var Ae=Uh.exports;const Vh=Ql(Ae),n_=Bf({__proto__:null,default:Vh},[Ae]);/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.production.min.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@ function Uf(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var r_=Ae,s_=Symbol.for("react.element"),i_=Symbol.for("react.fragment"),o_=Object.prototype.hasOwnProperty,a_=r_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l_={key:!0,ref:!0,__self:!0,__source:!0};function jh(e,t,n){var s,c={},o=null,h=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(h=t.ref);for(s in t)o_.call(t,s)&&!l_.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:s_,type:e,key:o,ref:h,props:c,_owner:a_.current}}$o.Fragment=i_;$o.jsx=jh;$o.jsxs=jh;Lh.exports=$o;var le=Lh.exports,Ha={},Hh={exports:{}},un={},Yh={exports:{}},zh={};/**
|
|
18
18
|
* @license React
|
|
19
19
|
* scheduler.production.min.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@ function Uf(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(e){function t(F,$){var R=F.length;F.push($);e:for(;0<R;){var B=R-1>>>1,M=F[B];if(0<c(M,$))F[B]=$,F[R]=M,R=B;else break e}}function n(F){return F.length===0?null:F[0]}function s(F){if(F.length===0)return null;var $=F[0],R=F.pop();if(R!==$){F[0]=R;e:for(var B=0,M=F.length,re=M>>>1;B<re;){var se=2*(B+1)-1,fe=F[se],ce=se+1,Te=F[ce];if(0>c(fe,R))ce<M&&0>c(Te,fe)?(F[B]=Te,F[ce]=R,B=ce):(F[B]=fe,F[se]=R,B=se);else if(ce<M&&0>c(Te,R))F[B]=Te,F[ce]=R,B=ce;else break e}}return $}function c(F,$){var R=F.sortIndex-$.sortIndex;return R!==0?R:F.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var h=Date,r=h.now();e.unstable_now=function(){return h.now()-r}}var a=[],u=[],l=1,d=null,
|
|
25
|
+
*/(function(e){function t(F,$){var R=F.length;F.push($);e:for(;0<R;){var B=R-1>>>1,M=F[B];if(0<c(M,$))F[B]=$,F[R]=M,R=B;else break e}}function n(F){return F.length===0?null:F[0]}function s(F){if(F.length===0)return null;var $=F[0],R=F.pop();if(R!==$){F[0]=R;e:for(var B=0,M=F.length,re=M>>>1;B<re;){var se=2*(B+1)-1,fe=F[se],ce=se+1,Te=F[ce];if(0>c(fe,R))ce<M&&0>c(Te,fe)?(F[B]=Te,F[ce]=R,B=ce):(F[B]=fe,F[se]=R,B=se);else if(ce<M&&0>c(Te,R))F[B]=Te,F[ce]=R,B=ce;else break e}}return $}function c(F,$){var R=F.sortIndex-$.sortIndex;return R!==0?R:F.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var h=Date,r=h.now();e.unstable_now=function(){return h.now()-r}}var a=[],u=[],l=1,d=null,_=3,p=!1,f=!1,S=!1,C=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(F){for(var $=n(u);$!==null;){if($.callback===null)s(u);else if($.startTime<=F)s(u),$.sortIndex=$.expirationTime,t(a,$);else break;$=n(u)}}function y(F){if(S=!1,T(F),!f)if(n(a)!==null)f=!0,k(E);else{var $=n(u);$!==null&&J(y,$.startTime-F)}}function E(F,$){f=!1,S&&(S=!1,g(A),A=-1),p=!0;var R=_;try{for(T($),d=n(a);d!==null&&(!(d.expirationTime>$)||F&&!q());){var B=d.callback;if(typeof B=="function"){d.callback=null,_=d.priorityLevel;var M=B(d.expirationTime<=$);$=e.unstable_now(),typeof M=="function"?d.callback=M:d===n(a)&&s(a),T($)}else s(a);d=n(a)}if(d!==null)var re=!0;else{var se=n(u);se!==null&&J(y,se.startTime-$),re=!1}return re}finally{d=null,_=R,p=!1}}var I=!1,N=null,A=-1,L=5,D=-1;function q(){return!(e.unstable_now()-D<L)}function Y(){if(N!==null){var F=e.unstable_now();D=F;var $=!0;try{$=N(!0,F)}finally{$?Q():(I=!1,N=null)}}else I=!1}var Q;if(typeof m=="function")Q=function(){m(Y)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,x=W.port2;W.port1.onmessage=Y,Q=function(){x.postMessage(null)}}else Q=function(){C(Y,0)};function k(F){N=F,I||(I=!0,Q())}function J(F,$){A=C(function(){F(e.unstable_now())},$)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(F){F.callback=null},e.unstable_continueExecution=function(){f||p||(f=!0,k(E))},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(F){switch(_){case 1:case 2:case 3:var $=3;break;default:$=_}var R=_;_=$;try{return F()}finally{_=R}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(F,$){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var R=_;_=F;try{return $()}finally{_=R}},e.unstable_scheduleCallback=function(F,$,R){var B=e.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0<R?B+R:B):R=B,F){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=R+M,F={id:l++,callback:$,priorityLevel:F,startTime:R,expirationTime:M,sortIndex:-1},R>B?(F.sortIndex=R,t(u,F),n(a)===null&&F===n(u)&&(S?(g(A),A=-1):S=!0,J(y,R-B))):(F.sortIndex=M,t(a,F),f||p||(f=!0,k(E))),F},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(F){var $=_;return function(){var R=_;_=$;try{return F.apply(this,arguments)}finally{_=R}}}})(zh);Yh.exports=zh;var u_=Yh.exports;/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.min.js
|
|
28
28
|
*
|
|
@@ -30,14 +30,14 @@ function Uf(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&
|
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var
|
|
33
|
+
*/var c_=Ae,ln=u_;function Me(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 Qh=new Set,Js={};function Fr(e,t){ps(e,t),ps(e+"Capture",t)}function ps(e,t){for(Js[e]=t,e=0;e<t.length;e++)Qh.add(t[e])}var jn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ya=Object.prototype.hasOwnProperty,h_=/^[: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]*$/,hc={},dc={};function d_(e){return Ya.call(dc,e)?!0:Ya.call(hc,e)?!1:h_.test(e)?dc[e]=!0:(hc[e]=!0,!1)}function p_(e,t,n,s){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function f_(e,t,n,s){if(t===null||typeof t>"u"||p_(e,t,n,s))return!0;if(s)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 Kt(e,t,n,s,c,o,h){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=c,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=h}var Bt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Bt[e]=new Kt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Bt[t]=new Kt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Bt[e]=new Kt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Bt[e]=new Kt(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){Bt[e]=new Kt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Bt[e]=new Kt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Bt[e]=new Kt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Bt[e]=new Kt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Bt[e]=new Kt(e,5,!1,e.toLowerCase(),null,!1,!1)});var eu=/[\-:]([a-z])/g;function tu(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(eu,tu);Bt[t]=new Kt(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(eu,tu);Bt[t]=new Kt(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(eu,tu);Bt[t]=new Kt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Bt[e]=new Kt(e,1,!1,e.toLowerCase(),null,!1,!1)});Bt.xlinkHref=new Kt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Bt[e]=new Kt(e,1,!1,e.toLowerCase(),null,!0,!0)});function nu(e,t,n,s){var c=Bt.hasOwnProperty(t)?Bt[t]:null;(c!==null?c.type!==0:s||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(f_(t,n,c,s)&&(n=null),s||c===null?d_(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):c.mustUseProperty?e[c.propertyName]=n===null?c.type===3?!1:"":n:(t=c.attributeName,s=c.attributeNamespace,n===null?e.removeAttribute(t):(c=c.type,n=c===3||c===4&&n===!0?"":""+n,s?e.setAttributeNS(s,t,n):e.setAttribute(t,n))))}var Kn=c_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Mi=Symbol.for("react.element"),Qr=Symbol.for("react.portal"),Kr=Symbol.for("react.fragment"),ru=Symbol.for("react.strict_mode"),za=Symbol.for("react.profiler"),Kh=Symbol.for("react.provider"),Xh=Symbol.for("react.context"),su=Symbol.for("react.forward_ref"),Qa=Symbol.for("react.suspense"),Ka=Symbol.for("react.suspense_list"),iu=Symbol.for("react.memo"),er=Symbol.for("react.lazy"),Jh=Symbol.for("react.offscreen"),pc=Symbol.iterator;function ws(e){return e===null||typeof e!="object"?null:(e=pc&&e[pc]||e["@@iterator"],typeof e=="function"?e:null)}var St=Object.assign,ga;function ks(e){if(ga===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ga=t&&t[1]||""}return`
|
|
34
34
|
`+ga+e}var ma=!1;function Ea(e,t){if(!e||ma)return"";ma=!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(u){var s=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){s=u}e.call(t.prototype)}else{try{throw Error()}catch(u){s=u}e()}}catch(u){if(u&&s&&typeof u.stack=="string"){for(var c=u.stack.split(`
|
|
35
35
|
`),o=s.stack.split(`
|
|
36
36
|
`),h=c.length-1,r=o.length-1;1<=h&&0<=r&&c[h]!==o[r];)r--;for(;1<=h&&0<=r;h--,r--)if(c[h]!==o[r]){if(h!==1||r!==1)do if(h--,r--,0>r||c[h]!==o[r]){var a=`
|
|
37
|
-
`+c[h].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=h&&0<=r);break}}}finally{ma=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ks(e):""}function h_(e){switch(e.tag){case 5:return ks(e.type);case 16:return ks("Lazy");case 13:return ks("Suspense");case 19:return ks("SuspenseList");case 0:case 2:case 15:return e=Ea(e.type,!1),e;case 11:return e=Ea(e.type.render,!1),e;case 1:return e=Ea(e.type,!0),e;default:return""}}function Xa(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Kr:return"Fragment";case Qr:return"Portal";case za:return"Profiler";case nu:return"StrictMode";case Qa:return"Suspense";case Ka:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Xh:return(e.displayName||"Context")+".Consumer";case Kh:return(e._context.displayName||"Context")+".Provider";case ru:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case su:return t=e.displayName||null,t!==null?t:Xa(e.type)||"Memo";case er:t=e._payload,e=e._init;try{return Xa(e(t))}catch{}}return null}function d_(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Xa(t);case 8:return t===nu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function mr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Zh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function p_(e){var t=Zh(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var c=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(h){s=""+h,o.call(this,h)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(h){s=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function bi(e){e._valueTracker||(e._valueTracker=p_(e))}function ed(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=Zh(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function po(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ja(e,t){var n=t.checked;return St({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function pc(e,t){var n=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;n=mr(t.value!=null?t.value:n),e._wrapperState={initialChecked:s,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function td(e,t){t=t.checked,t!=null&&tu(e,"checked",t,!1)}function Za(e,t){td(e,t);var n=mr(t.value),s=t.type;if(n!=null)s==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?el(e,t.type,n):t.hasOwnProperty("defaultValue")&&el(e,t.type,mr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function fc(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function el(e,t,n){(t!=="number"||po(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Bs=Array.isArray;function as(e,t,n,s){if(e=e.options,t){t={};for(var c=0;c<n.length;c++)t["$"+n[c]]=!0;for(n=0;n<e.length;n++)c=t.hasOwnProperty("$"+e[n].value),e[n].selected!==c&&(e[n].selected=c),c&&s&&(e[n].defaultSelected=!0)}else{for(n=""+mr(n),t=null,c=0;c<e.length;c++){if(e[c].value===n){e[c].selected=!0,s&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function tl(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Me(91));return St({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function _c(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(Me(92));if(Bs(n)){if(1<n.length)throw Error(Me(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:mr(n)}}function nd(e,t){var n=mr(t.value),s=mr(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),s!=null&&(e.defaultValue=""+s)}function gc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function rd(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function nl(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?rd(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Li,sd=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,s,c){MSApp.execUnsafeLocalFunction(function(){return e(t,n,s,c)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Li=Li||document.createElement("div"),Li.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Li.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Zs(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var qs={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},f_=["Webkit","ms","Moz","O"];Object.keys(qs).forEach(function(e){f_.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),qs[t]=qs[e]})});function id(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||qs.hasOwnProperty(e)&&qs[e]?(""+t).trim():t+"px"}function od(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var s=n.indexOf("--")===0,c=id(n,t[n],s);n==="float"&&(n="cssFloat"),s?e.setProperty(n,c):e[n]=c}}var __=St({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function rl(e,t){if(t){if(__[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Me(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Me(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Me(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Me(62))}}function sl(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var il=null;function iu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ol=null,ls=null,us=null;function mc(e){if(e=Ti(e)){if(typeof ol!="function")throw Error(Me(280));var t=e.stateNode;t&&(t=Ho(t),ol(e.stateNode,e.type,t))}}function ad(e){ls?us?us.push(e):us=[e]:ls=e}function ld(){if(ls){var e=ls,t=us;if(us=ls=null,mc(e),t)for(e=0;e<t.length;e++)mc(t[e])}}function ud(e,t){return e(t)}function cd(){}var Sa=!1;function hd(e,t,n){if(Sa)return e(t,n);Sa=!0;try{return ud(e,t,n)}finally{Sa=!1,(ls!==null||us!==null)&&(cd(),ld())}}function ei(e,t){var n=e.stateNode;if(n===null)return null;var s=Ho(n);if(s===null)return null;n=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(Me(231,t,typeof n));return n}var al=!1;if(jn)try{var Ps={};Object.defineProperty(Ps,"passive",{get:function(){al=!0}}),window.addEventListener("test",Ps,Ps),window.removeEventListener("test",Ps,Ps)}catch{al=!1}function g_(e,t,n,s,c,o,h,r,a){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(l){this.onError(l)}}var Vs=!1,fo=null,_o=!1,ll=null,m_={onError:function(e){Vs=!0,fo=e}};function E_(e,t,n,s,c,o,h,r,a){Vs=!1,fo=null,g_.apply(m_,arguments)}function S_(e,t,n,s,c,o,h,r,a){if(E_.apply(this,arguments),Vs){if(Vs){var u=fo;Vs=!1,fo=null}else throw Error(Me(198));_o||(_o=!0,ll=u)}}function kr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function dd(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Ec(e){if(kr(e)!==e)throw Error(Me(188))}function T_(e){var t=e.alternate;if(!t){if(t=kr(e),t===null)throw Error(Me(188));return t!==e?null:e}for(var n=e,s=t;;){var c=n.return;if(c===null)break;var o=c.alternate;if(o===null){if(s=c.return,s!==null){n=s;continue}break}if(c.child===o.child){for(o=c.child;o;){if(o===n)return Ec(c),e;if(o===s)return Ec(c),t;o=o.sibling}throw Error(Me(188))}if(n.return!==s.return)n=c,s=o;else{for(var h=!1,r=c.child;r;){if(r===n){h=!0,n=c,s=o;break}if(r===s){h=!0,s=c,n=o;break}r=r.sibling}if(!h){for(r=o.child;r;){if(r===n){h=!0,n=o,s=c;break}if(r===s){h=!0,s=o,n=c;break}r=r.sibling}if(!h)throw Error(Me(189))}}if(n.alternate!==s)throw Error(Me(190))}if(n.tag!==3)throw Error(Me(188));return n.stateNode.current===n?e:t}function pd(e){return e=T_(e),e!==null?fd(e):null}function fd(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=fd(e);if(t!==null)return t;e=e.sibling}return null}var _d=ln.unstable_scheduleCallback,Sc=ln.unstable_cancelCallback,y_=ln.unstable_shouldYield,I_=ln.unstable_requestPaint,Ot=ln.unstable_now,C_=ln.unstable_getCurrentPriorityLevel,ou=ln.unstable_ImmediatePriority,gd=ln.unstable_UserBlockingPriority,go=ln.unstable_NormalPriority,R_=ln.unstable_LowPriority,md=ln.unstable_IdlePriority,Wo=null,Un=null;function v_(e){if(Un&&typeof Un.onCommitFiberRoot=="function")try{Un.onCommitFiberRoot(Wo,e,void 0,(e.current.flags&128)===128)}catch{}}var An=Math.clz32?Math.clz32:A_,N_=Math.log,O_=Math.LN2;function A_(e){return e>>>=0,e===0?32:31-(N_(e)/O_|0)|0}var Ui=64,xi=4194304;function Gs(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function mo(e,t){var n=e.pendingLanes;if(n===0)return 0;var s=0,c=e.suspendedLanes,o=e.pingedLanes,h=n&268435455;if(h!==0){var r=h&~c;r!==0?s=Gs(r):(o&=h,o!==0&&(s=Gs(o)))}else h=n&~c,h!==0?s=Gs(h):o!==0&&(s=Gs(o));if(s===0)return 0;if(t!==0&&t!==s&&!(t&c)&&(c=s&-s,o=t&-t,c>=o||c===16&&(o&4194240)!==0))return t;if(s&4&&(s|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0<t;)n=31-An(t),c=1<<n,s|=e[n],t&=~c;return s}function w_(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function P_(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,c=e.expirationTimes,o=e.pendingLanes;0<o;){var h=31-An(o),r=1<<h,a=c[h];a===-1?(!(r&n)||r&s)&&(c[h]=w_(r,t)):a<=t&&(e.expiredLanes|=r),o&=~r}}function ul(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ed(){var e=Ui;return Ui<<=1,!(Ui&4194240)&&(Ui=64),e}function Ta(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ei(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-An(t),e[t]=n}function D_(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var s=e.eventTimes;for(e=e.expirationTimes;0<n;){var c=31-An(n),o=1<<c;t[c]=0,s[c]=-1,e[c]=-1,n&=~o}}function au(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-An(n),c=1<<s;c&t|e[s]&t&&(e[s]|=t),n&=~c}}var ut=0;function Sd(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Td,lu,yd,Id,Cd,cl=!1,Fi=[],ar=null,lr=null,ur=null,ti=new Map,ni=new Map,nr=[],M_="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Tc(e,t){switch(e){case"focusin":case"focusout":ar=null;break;case"dragenter":case"dragleave":lr=null;break;case"mouseover":case"mouseout":ur=null;break;case"pointerover":case"pointerout":ti.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ni.delete(t.pointerId)}}function Ds(e,t,n,s,c,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:o,targetContainers:[c]},t!==null&&(t=Ti(t),t!==null&&lu(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function b_(e,t,n,s,c){switch(t){case"focusin":return ar=Ds(ar,e,t,n,s,c),!0;case"dragenter":return lr=Ds(lr,e,t,n,s,c),!0;case"mouseover":return ur=Ds(ur,e,t,n,s,c),!0;case"pointerover":var o=c.pointerId;return ti.set(o,Ds(ti.get(o)||null,e,t,n,s,c)),!0;case"gotpointercapture":return o=c.pointerId,ni.set(o,Ds(ni.get(o)||null,e,t,n,s,c)),!0}return!1}function Rd(e){var t=Or(e.target);if(t!==null){var n=kr(t);if(n!==null){if(t=n.tag,t===13){if(t=dd(n),t!==null){e.blockedOn=t,Cd(e.priority,function(){yd(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ji(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=hl(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);il=s,n.target.dispatchEvent(s),il=null}else return t=Ti(n),t!==null&&lu(t),e.blockedOn=n,!1;t.shift()}return!0}function yc(e,t,n){Ji(e)&&n.delete(t)}function L_(){cl=!1,ar!==null&&Ji(ar)&&(ar=null),lr!==null&&Ji(lr)&&(lr=null),ur!==null&&Ji(ur)&&(ur=null),ti.forEach(yc),ni.forEach(yc)}function Ms(e,t){e.blockedOn===t&&(e.blockedOn=null,cl||(cl=!0,ln.unstable_scheduleCallback(ln.unstable_NormalPriority,L_)))}function ri(e){function t(c){return Ms(c,e)}if(0<Fi.length){Ms(Fi[0],e);for(var n=1;n<Fi.length;n++){var s=Fi[n];s.blockedOn===e&&(s.blockedOn=null)}}for(ar!==null&&Ms(ar,e),lr!==null&&Ms(lr,e),ur!==null&&Ms(ur,e),ti.forEach(t),ni.forEach(t),n=0;n<nr.length;n++)s=nr[n],s.blockedOn===e&&(s.blockedOn=null);for(;0<nr.length&&(n=nr[0],n.blockedOn===null);)Rd(n),n.blockedOn===null&&nr.shift()}var cs=Kn.ReactCurrentBatchConfig,Eo=!0;function U_(e,t,n,s){var c=ut,o=cs.transition;cs.transition=null;try{ut=1,uu(e,t,n,s)}finally{ut=c,cs.transition=o}}function x_(e,t,n,s){var c=ut,o=cs.transition;cs.transition=null;try{ut=4,uu(e,t,n,s)}finally{ut=c,cs.transition=o}}function uu(e,t,n,s){if(Eo){var c=hl(e,t,n,s);if(c===null)Pa(e,t,s,So,n),Tc(e,s);else if(b_(c,e,t,n,s))s.stopPropagation();else if(Tc(e,s),t&4&&-1<M_.indexOf(e)){for(;c!==null;){var o=Ti(c);if(o!==null&&Td(o),o=hl(e,t,n,s),o===null&&Pa(e,t,s,So,n),o===c)break;c=o}c!==null&&s.stopPropagation()}else Pa(e,t,s,null,n)}}var So=null;function hl(e,t,n,s){if(So=null,e=iu(s),e=Or(e),e!==null)if(t=kr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=dd(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return So=e,null}function vd(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(C_()){case ou:return 1;case gd:return 4;case go:case R_:return 16;case md:return 536870912;default:return 16}default:return 16}}var sr=null,cu=null,Zi=null;function Nd(){if(Zi)return Zi;var e,t=cu,n=t.length,s,c="value"in sr?sr.value:sr.textContent,o=c.length;for(e=0;e<n&&t[e]===c[e];e++);var h=n-e;for(s=1;s<=h&&t[n-s]===c[o-s];s++);return Zi=c.slice(e,1<s?1-s:void 0)}function eo(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ki(){return!0}function Ic(){return!1}function cn(e){function t(n,s,c,o,h){this._reactName=n,this._targetInst=c,this.type=s,this.nativeEvent=o,this.target=h,this.currentTarget=null;for(var r in e)e.hasOwnProperty(r)&&(n=e[r],this[r]=n?n(o):o[r]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?ki:Ic,this.isPropagationStopped=Ic,this}return St(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=ki)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ki)},persist:function(){},isPersistent:ki}),t}var Is={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hu=cn(Is),Si=St({},Is,{view:0,detail:0}),F_=cn(Si),ya,Ia,bs,qo=St({},Si,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:du,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==bs&&(bs&&e.type==="mousemove"?(ya=e.screenX-bs.screenX,Ia=e.screenY-bs.screenY):Ia=ya=0,bs=e),ya)},movementY:function(e){return"movementY"in e?e.movementY:Ia}}),Cc=cn(qo),k_=St({},qo,{dataTransfer:0}),B_=cn(k_),G_=St({},Si,{relatedTarget:0}),Ca=cn(G_),$_=St({},Is,{animationName:0,elapsedTime:0,pseudoElement:0}),W_=cn($_),q_=St({},Is,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),V_=cn(q_),j_=St({},Is,{data:0}),Rc=cn(j_),H_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Y_={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},z_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Q_(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=z_[e])?!!t[e]:!1}function du(){return Q_}var K_=St({},Si,{key:function(e){if(e.key){var t=H_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=eo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Y_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:du,charCode:function(e){return e.type==="keypress"?eo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?eo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),X_=cn(K_),J_=St({},qo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),vc=cn(J_),Z_=St({},Si,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:du}),eg=cn(Z_),tg=St({},Is,{propertyName:0,elapsedTime:0,pseudoElement:0}),ng=cn(tg),rg=St({},qo,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),sg=cn(rg),ig=[9,13,27,32],pu=jn&&"CompositionEvent"in window,js=null;jn&&"documentMode"in document&&(js=document.documentMode);var og=jn&&"TextEvent"in window&&!js,Od=jn&&(!pu||js&&8<js&&11>=js),Nc=" ",Oc=!1;function Ad(e,t){switch(e){case"keyup":return ig.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xr=!1;function ag(e,t){switch(e){case"compositionend":return wd(t);case"keypress":return t.which!==32?null:(Oc=!0,Nc);case"textInput":return e=t.data,e===Nc&&Oc?null:e;default:return null}}function lg(e,t){if(Xr)return e==="compositionend"||!pu&&Ad(e,t)?(e=Nd(),Zi=cu=sr=null,Xr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Od&&t.locale!=="ko"?null:t.data;default:return null}}var ug={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ac(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ug[e.type]:t==="textarea"}function Pd(e,t,n,s){ad(s),t=To(t,"onChange"),0<t.length&&(n=new hu("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var Hs=null,si=null;function cg(e){$d(e,0)}function Vo(e){var t=es(e);if(ed(t))return e}function hg(e,t){if(e==="change")return t}var Dd=!1;if(jn){var Ra;if(jn){var va="oninput"in document;if(!va){var wc=document.createElement("div");wc.setAttribute("oninput","return;"),va=typeof wc.oninput=="function"}Ra=va}else Ra=!1;Dd=Ra&&(!document.documentMode||9<document.documentMode)}function Pc(){Hs&&(Hs.detachEvent("onpropertychange",Md),si=Hs=null)}function Md(e){if(e.propertyName==="value"&&Vo(si)){var t=[];Pd(t,si,e,iu(e)),hd(cg,t)}}function dg(e,t,n){e==="focusin"?(Pc(),Hs=t,si=n,Hs.attachEvent("onpropertychange",Md)):e==="focusout"&&Pc()}function pg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Vo(si)}function fg(e,t){if(e==="click")return Vo(t)}function _g(e,t){if(e==="input"||e==="change")return Vo(t)}function gg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pn=typeof Object.is=="function"?Object.is:gg;function ii(e,t){if(Pn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var c=n[s];if(!Ya.call(t,c)||!Pn(e[c],t[c]))return!1}return!0}function Dc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Mc(e,t){var n=Dc(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Dc(n)}}function bd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?bd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ld(){for(var e=window,t=po();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=po(e.document)}return t}function fu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function mg(e){var t=Ld(),n=e.focusedElem,s=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&bd(n.ownerDocument.documentElement,n)){if(s!==null&&fu(n)){if(t=s.start,e=s.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var c=n.textContent.length,o=Math.min(s.start,c);s=s.end===void 0?o:Math.min(s.end,c),!e.extend&&o>s&&(c=s,s=o,o=c),c=Mc(n,o);var h=Mc(n,s);c&&h&&(e.rangeCount!==1||e.anchorNode!==c.node||e.anchorOffset!==c.offset||e.focusNode!==h.node||e.focusOffset!==h.offset)&&(t=t.createRange(),t.setStart(c.node,c.offset),e.removeAllRanges(),o>s?(e.addRange(t),e.extend(h.node,h.offset)):(t.setEnd(h.node,h.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Eg=jn&&"documentMode"in document&&11>=document.documentMode,Jr=null,dl=null,Ys=null,pl=!1;function bc(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;pl||Jr==null||Jr!==po(s)||(s=Jr,"selectionStart"in s&&fu(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Ys&&ii(Ys,s)||(Ys=s,s=To(dl,"onSelect"),0<s.length&&(t=new hu("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=Jr)))}function Bi(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Zr={animationend:Bi("Animation","AnimationEnd"),animationiteration:Bi("Animation","AnimationIteration"),animationstart:Bi("Animation","AnimationStart"),transitionend:Bi("Transition","TransitionEnd")},Na={},Ud={};jn&&(Ud=document.createElement("div").style,"AnimationEvent"in window||(delete Zr.animationend.animation,delete Zr.animationiteration.animation,delete Zr.animationstart.animation),"TransitionEvent"in window||delete Zr.transitionend.transition);function jo(e){if(Na[e])return Na[e];if(!Zr[e])return e;var t=Zr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ud)return Na[e]=t[n];return e}var xd=jo("animationend"),Fd=jo("animationiteration"),kd=jo("animationstart"),Bd=jo("transitionend"),Gd=new Map,Lc="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Sr(e,t){Gd.set(e,t),Fr(t,[e])}for(var Oa=0;Oa<Lc.length;Oa++){var Aa=Lc[Oa],Sg=Aa.toLowerCase(),Tg=Aa[0].toUpperCase()+Aa.slice(1);Sr(Sg,"on"+Tg)}Sr(xd,"onAnimationEnd");Sr(Fd,"onAnimationIteration");Sr(kd,"onAnimationStart");Sr("dblclick","onDoubleClick");Sr("focusin","onFocus");Sr("focusout","onBlur");Sr(Bd,"onTransitionEnd");ps("onMouseEnter",["mouseout","mouseover"]);ps("onMouseLeave",["mouseout","mouseover"]);ps("onPointerEnter",["pointerout","pointerover"]);ps("onPointerLeave",["pointerout","pointerover"]);Fr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Fr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Fr("onBeforeInput",["compositionend","keypress","textInput","paste"]);Fr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Fr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Fr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $s="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),yg=new Set("cancel close invalid load scroll toggle".split(" ").concat($s));function Uc(e,t,n){var s=e.type||"unknown-event";e.currentTarget=n,S_(s,t,void 0,e),e.currentTarget=null}function $d(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],c=s.event;s=s.listeners;e:{var o=void 0;if(t)for(var h=s.length-1;0<=h;h--){var r=s[h],a=r.instance,u=r.currentTarget;if(r=r.listener,a!==o&&c.isPropagationStopped())break e;Uc(c,r,u),o=a}else for(h=0;h<s.length;h++){if(r=s[h],a=r.instance,u=r.currentTarget,r=r.listener,a!==o&&c.isPropagationStopped())break e;Uc(c,r,u),o=a}}}if(_o)throw e=ll,_o=!1,ll=null,e}function pt(e,t){var n=t[El];n===void 0&&(n=t[El]=new Set);var s=e+"__bubble";n.has(s)||(Wd(t,e,2,!1),n.add(s))}function wa(e,t,n){var s=0;t&&(s|=4),Wd(n,e,s,t)}var Gi="_reactListening"+Math.random().toString(36).slice(2);function oi(e){if(!e[Gi]){e[Gi]=!0,Qh.forEach(function(n){n!=="selectionchange"&&(yg.has(n)||wa(n,!1,e),wa(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Gi]||(t[Gi]=!0,wa("selectionchange",!1,t))}}function Wd(e,t,n,s){switch(vd(t)){case 1:var c=U_;break;case 4:c=x_;break;default:c=uu}n=c.bind(null,t,n,e),c=void 0,!al||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),s?c!==void 0?e.addEventListener(t,n,{capture:!0,passive:c}):e.addEventListener(t,n,!0):c!==void 0?e.addEventListener(t,n,{passive:c}):e.addEventListener(t,n,!1)}function Pa(e,t,n,s,c){var o=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var h=s.tag;if(h===3||h===4){var r=s.stateNode.containerInfo;if(r===c||r.nodeType===8&&r.parentNode===c)break;if(h===4)for(h=s.return;h!==null;){var a=h.tag;if((a===3||a===4)&&(a=h.stateNode.containerInfo,a===c||a.nodeType===8&&a.parentNode===c))return;h=h.return}for(;r!==null;){if(h=Or(r),h===null)return;if(a=h.tag,a===5||a===6){s=o=h;continue e}r=r.parentNode}}s=s.return}hd(function(){var u=o,l=iu(n),d=[];e:{var f=Gd.get(e);if(f!==void 0){var p=hu,_=e;switch(e){case"keypress":if(eo(n)===0)break e;case"keydown":case"keyup":p=X_;break;case"focusin":_="focus",p=Ca;break;case"focusout":_="blur",p=Ca;break;case"beforeblur":case"afterblur":p=Ca;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=Cc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=B_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=eg;break;case xd:case Fd:case kd:p=W_;break;case Bd:p=ng;break;case"scroll":p=F_;break;case"wheel":p=sg;break;case"copy":case"cut":case"paste":p=V_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=vc}var S=(t&4)!==0,C=!S&&e==="scroll",g=S?f!==null?f+"Capture":null:f;S=[];for(var m=u,T;m!==null;){T=m;var y=T.stateNode;if(T.tag===5&&y!==null&&(T=y,g!==null&&(y=ei(m,g),y!=null&&S.push(ai(m,y,T)))),C)break;m=m.return}0<S.length&&(f=new p(f,_,null,n,l),d.push({event:f,listeners:S}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&n!==il&&(_=n.relatedTarget||n.fromElement)&&(Or(_)||_[Hn]))break e;if((p||f)&&(f=l.window===l?l:(f=l.ownerDocument)?f.defaultView||f.parentWindow:window,p?(_=n.relatedTarget||n.toElement,p=u,_=_?Or(_):null,_!==null&&(C=kr(_),_!==C||_.tag!==5&&_.tag!==6)&&(_=null)):(p=null,_=u),p!==_)){if(S=Cc,y="onMouseLeave",g="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(S=vc,y="onPointerLeave",g="onPointerEnter",m="pointer"),C=p==null?f:es(p),T=_==null?f:es(_),f=new S(y,m+"leave",p,n,l),f.target=C,f.relatedTarget=T,y=null,Or(l)===u&&(S=new S(g,m+"enter",_,n,l),S.target=T,S.relatedTarget=C,y=S),C=y,p&&_)t:{for(S=p,g=_,m=0,T=S;T;T=zr(T))m++;for(T=0,y=g;y;y=zr(y))T++;for(;0<m-T;)S=zr(S),m--;for(;0<T-m;)g=zr(g),T--;for(;m--;){if(S===g||g!==null&&S===g.alternate)break t;S=zr(S),g=zr(g)}S=null}else S=null;p!==null&&xc(d,f,p,S,!1),_!==null&&C!==null&&xc(d,C,_,S,!0)}}e:{if(f=u?es(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var E=hg;else if(Ac(f))if(Dd)E=_g;else{E=pg;var I=dg}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(E=fg);if(E&&(E=E(e,u))){Pd(d,E,n,l);break e}I&&I(e,f,u),e==="focusout"&&(I=f._wrapperState)&&I.controlled&&f.type==="number"&&el(f,"number",f.value)}switch(I=u?es(u):window,e){case"focusin":(Ac(I)||I.contentEditable==="true")&&(Jr=I,dl=u,Ys=null);break;case"focusout":Ys=dl=Jr=null;break;case"mousedown":pl=!0;break;case"contextmenu":case"mouseup":case"dragend":pl=!1,bc(d,n,l);break;case"selectionchange":if(Eg)break;case"keydown":case"keyup":bc(d,n,l)}var N;if(pu)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else Xr?Ad(e,n)&&(A="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(A="onCompositionStart");A&&(Od&&n.locale!=="ko"&&(Xr||A!=="onCompositionStart"?A==="onCompositionEnd"&&Xr&&(N=Nd()):(sr=l,cu="value"in sr?sr.value:sr.textContent,Xr=!0)),I=To(u,A),0<I.length&&(A=new Rc(A,e,null,n,l),d.push({event:A,listeners:I}),N?A.data=N:(N=wd(n),N!==null&&(A.data=N)))),(N=og?ag(e,n):lg(e,n))&&(u=To(u,"onBeforeInput"),0<u.length&&(l=new Rc("onBeforeInput","beforeinput",null,n,l),d.push({event:l,listeners:u}),l.data=N))}$d(d,t)})}function ai(e,t,n){return{instance:e,listener:t,currentTarget:n}}function To(e,t){for(var n=t+"Capture",s=[];e!==null;){var c=e,o=c.stateNode;c.tag===5&&o!==null&&(c=o,o=ei(e,n),o!=null&&s.unshift(ai(e,o,c)),o=ei(e,t),o!=null&&s.push(ai(e,o,c))),e=e.return}return s}function zr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function xc(e,t,n,s,c){for(var o=t._reactName,h=[];n!==null&&n!==s;){var r=n,a=r.alternate,u=r.stateNode;if(a!==null&&a===s)break;r.tag===5&&u!==null&&(r=u,c?(a=ei(n,o),a!=null&&h.unshift(ai(n,a,r))):c||(a=ei(n,o),a!=null&&h.push(ai(n,a,r)))),n=n.return}h.length!==0&&e.push({event:t,listeners:h})}var Ig=/\r\n?/g,Cg=/\u0000|\uFFFD/g;function Fc(e){return(typeof e=="string"?e:""+e).replace(Ig,`
|
|
38
|
-
`).replace(Cg,"")}function $i(e,t,n){if(t=Fc(t),Fc(e)!==t&&n)throw Error(Me(425))}function yo(){}var fl=null,_l=null;function gl(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ml=typeof setTimeout=="function"?setTimeout:void 0,Rg=typeof clearTimeout=="function"?clearTimeout:void 0,kc=typeof Promise=="function"?Promise:void 0,vg=typeof queueMicrotask=="function"?queueMicrotask:typeof kc<"u"?function(e){return kc.resolve(null).then(e).catch(Ng)}:ml;function Ng(e){setTimeout(function(){throw e})}function Da(e,t){var n=t,s=0;do{var c=n.nextSibling;if(e.removeChild(n),c&&c.nodeType===8)if(n=c.data,n==="/$"){if(s===0){e.removeChild(c),ri(t);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=c}while(n);ri(t)}function cr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Bc(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Cs=Math.random().toString(36).slice(2),Ln="__reactFiber$"+Cs,li="__reactProps$"+Cs,Hn="__reactContainer$"+Cs,El="__reactEvents$"+Cs,Og="__reactListeners$"+Cs,Ag="__reactHandles$"+Cs;function Or(e){var t=e[Ln];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Hn]||n[Ln]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Bc(e);e!==null;){if(n=e[Ln])return n;e=Bc(e)}return t}e=n,n=e.parentNode}return null}function Ti(e){return e=e[Ln]||e[Hn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function es(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Me(33))}function Ho(e){return e[li]||null}var Sl=[],ts=-1;function Tr(e){return{current:e}}function ft(e){0>ts||(e.current=Sl[ts],Sl[ts]=null,ts--)}function ht(e,t){ts++,Sl[ts]=e.current,e.current=t}var Er={},Ht=Tr(Er),Zt=Tr(!1),Mr=Er;function fs(e,t){var n=e.type.contextTypes;if(!n)return Er;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var c={},o;for(o in n)c[o]=t[o];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=c),c}function en(e){return e=e.childContextTypes,e!=null}function Io(){ft(Zt),ft(Ht)}function Gc(e,t,n){if(Ht.current!==Er)throw Error(Me(168));ht(Ht,t),ht(Zt,n)}function qd(e,t,n){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return n;s=s.getChildContext();for(var c in s)if(!(c in t))throw Error(Me(108,d_(e)||"Unknown",c));return St({},n,s)}function Co(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Er,Mr=Ht.current,ht(Ht,e),ht(Zt,Zt.current),!0}function $c(e,t,n){var s=e.stateNode;if(!s)throw Error(Me(169));n?(e=qd(e,t,Mr),s.__reactInternalMemoizedMergedChildContext=e,ft(Zt),ft(Ht),ht(Ht,e)):ft(Zt),ht(Zt,n)}var $n=null,Yo=!1,Ma=!1;function Vd(e){$n===null?$n=[e]:$n.push(e)}function wg(e){Yo=!0,Vd(e)}function yr(){if(!Ma&&$n!==null){Ma=!0;var e=0,t=ut;try{var n=$n;for(ut=1;e<n.length;e++){var s=n[e];do s=s(!0);while(s!==null)}$n=null,Yo=!1}catch(c){throw $n!==null&&($n=$n.slice(e+1)),_d(ou,yr),c}finally{ut=t,Ma=!1}}return null}var ns=[],rs=0,Ro=null,vo=0,_n=[],gn=0,br=null,Wn=1,qn="";function vr(e,t){ns[rs++]=vo,ns[rs++]=Ro,Ro=e,vo=t}function jd(e,t,n){_n[gn++]=Wn,_n[gn++]=qn,_n[gn++]=br,br=e;var s=Wn;e=qn;var c=32-An(s)-1;s&=~(1<<c),n+=1;var o=32-An(t)+c;if(30<o){var h=c-c%5;o=(s&(1<<h)-1).toString(32),s>>=h,c-=h,Wn=1<<32-An(t)+c|n<<c|s,qn=o+e}else Wn=1<<o|n<<c|s,qn=e}function _u(e){e.return!==null&&(vr(e,1),jd(e,1,0))}function gu(e){for(;e===Ro;)Ro=ns[--rs],ns[rs]=null,vo=ns[--rs],ns[rs]=null;for(;e===br;)br=_n[--gn],_n[gn]=null,qn=_n[--gn],_n[gn]=null,Wn=_n[--gn],_n[gn]=null}var an=null,on=null,gt=!1,On=null;function Hd(e,t){var n=En(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Wc(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,an=e,on=cr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,an=e,on=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=br!==null?{id:Wn,overflow:qn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=En(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,an=e,on=null,!0):!1;default:return!1}}function Tl(e){return(e.mode&1)!==0&&(e.flags&128)===0}function yl(e){if(gt){var t=on;if(t){var n=t;if(!Wc(e,t)){if(Tl(e))throw Error(Me(418));t=cr(n.nextSibling);var s=an;t&&Wc(e,t)?Hd(s,n):(e.flags=e.flags&-4097|2,gt=!1,an=e)}}else{if(Tl(e))throw Error(Me(418));e.flags=e.flags&-4097|2,gt=!1,an=e}}}function qc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;an=e}function Wi(e){if(e!==an)return!1;if(!gt)return qc(e),gt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!gl(e.type,e.memoizedProps)),t&&(t=on)){if(Tl(e))throw Yd(),Error(Me(418));for(;t;)Hd(e,t),t=cr(t.nextSibling)}if(qc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Me(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){on=cr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}on=null}}else on=an?cr(e.stateNode.nextSibling):null;return!0}function Yd(){for(var e=on;e;)e=cr(e.nextSibling)}function _s(){on=an=null,gt=!1}function mu(e){On===null?On=[e]:On.push(e)}var Pg=Kn.ReactCurrentBatchConfig;function Ls(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(Me(309));var s=n.stateNode}if(!s)throw Error(Me(147,e));var c=s,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(h){var r=c.refs;h===null?delete r[o]:r[o]=h},t._stringRef=o,t)}if(typeof e!="string")throw Error(Me(284));if(!n._owner)throw Error(Me(290,e))}return e}function qi(e,t){throw e=Object.prototype.toString.call(t),Error(Me(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Vc(e){var t=e._init;return t(e._payload)}function zd(e){function t(g,m){if(e){var T=g.deletions;T===null?(g.deletions=[m],g.flags|=16):T.push(m)}}function n(g,m){if(!e)return null;for(;m!==null;)t(g,m),m=m.sibling;return null}function s(g,m){for(g=new Map;m!==null;)m.key!==null?g.set(m.key,m):g.set(m.index,m),m=m.sibling;return g}function c(g,m){return g=fr(g,m),g.index=0,g.sibling=null,g}function o(g,m,T){return g.index=T,e?(T=g.alternate,T!==null?(T=T.index,T<m?(g.flags|=2,m):T):(g.flags|=2,m)):(g.flags|=1048576,m)}function h(g){return e&&g.alternate===null&&(g.flags|=2),g}function r(g,m,T,y){return m===null||m.tag!==6?(m=Ba(T,g.mode,y),m.return=g,m):(m=c(m,T),m.return=g,m)}function a(g,m,T,y){var E=T.type;return E===Kr?l(g,m,T.props.children,y,T.key):m!==null&&(m.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===er&&Vc(E)===m.type)?(y=c(m,T.props),y.ref=Ls(g,m,T),y.return=g,y):(y=ao(T.type,T.key,T.props,null,g.mode,y),y.ref=Ls(g,m,T),y.return=g,y)}function u(g,m,T,y){return m===null||m.tag!==4||m.stateNode.containerInfo!==T.containerInfo||m.stateNode.implementation!==T.implementation?(m=Ga(T,g.mode,y),m.return=g,m):(m=c(m,T.children||[]),m.return=g,m)}function l(g,m,T,y,E){return m===null||m.tag!==7?(m=Dr(T,g.mode,y,E),m.return=g,m):(m=c(m,T),m.return=g,m)}function d(g,m,T){if(typeof m=="string"&&m!==""||typeof m=="number")return m=Ba(""+m,g.mode,T),m.return=g,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Mi:return T=ao(m.type,m.key,m.props,null,g.mode,T),T.ref=Ls(g,null,m),T.return=g,T;case Qr:return m=Ga(m,g.mode,T),m.return=g,m;case er:var y=m._init;return d(g,y(m._payload),T)}if(Bs(m)||ws(m))return m=Dr(m,g.mode,T,null),m.return=g,m;qi(g,m)}return null}function f(g,m,T,y){var E=m!==null?m.key:null;if(typeof T=="string"&&T!==""||typeof T=="number")return E!==null?null:r(g,m,""+T,y);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case Mi:return T.key===E?a(g,m,T,y):null;case Qr:return T.key===E?u(g,m,T,y):null;case er:return E=T._init,f(g,m,E(T._payload),y)}if(Bs(T)||ws(T))return E!==null?null:l(g,m,T,y,null);qi(g,T)}return null}function p(g,m,T,y,E){if(typeof y=="string"&&y!==""||typeof y=="number")return g=g.get(T)||null,r(m,g,""+y,E);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Mi:return g=g.get(y.key===null?T:y.key)||null,a(m,g,y,E);case Qr:return g=g.get(y.key===null?T:y.key)||null,u(m,g,y,E);case er:var I=y._init;return p(g,m,T,I(y._payload),E)}if(Bs(y)||ws(y))return g=g.get(T)||null,l(m,g,y,E,null);qi(m,y)}return null}function _(g,m,T,y){for(var E=null,I=null,N=m,A=m=0,L=null;N!==null&&A<T.length;A++){N.index>A?(L=N,N=null):L=N.sibling;var D=f(g,N,T[A],y);if(D===null){N===null&&(N=L);break}e&&N&&D.alternate===null&&t(g,N),m=o(D,m,A),I===null?E=D:I.sibling=D,I=D,N=L}if(A===T.length)return n(g,N),gt&&vr(g,A),E;if(N===null){for(;A<T.length;A++)N=d(g,T[A],y),N!==null&&(m=o(N,m,A),I===null?E=N:I.sibling=N,I=N);return gt&&vr(g,A),E}for(N=s(g,N);A<T.length;A++)L=p(N,g,A,T[A],y),L!==null&&(e&&L.alternate!==null&&N.delete(L.key===null?A:L.key),m=o(L,m,A),I===null?E=L:I.sibling=L,I=L);return e&&N.forEach(function(q){return t(g,q)}),gt&&vr(g,A),E}function S(g,m,T,y){var E=ws(T);if(typeof E!="function")throw Error(Me(150));if(T=E.call(T),T==null)throw Error(Me(151));for(var I=E=null,N=m,A=m=0,L=null,D=T.next();N!==null&&!D.done;A++,D=T.next()){N.index>A?(L=N,N=null):L=N.sibling;var q=f(g,N,D.value,y);if(q===null){N===null&&(N=L);break}e&&N&&q.alternate===null&&t(g,N),m=o(q,m,A),I===null?E=q:I.sibling=q,I=q,N=L}if(D.done)return n(g,N),gt&&vr(g,A),E;if(N===null){for(;!D.done;A++,D=T.next())D=d(g,D.value,y),D!==null&&(m=o(D,m,A),I===null?E=D:I.sibling=D,I=D);return gt&&vr(g,A),E}for(N=s(g,N);!D.done;A++,D=T.next())D=p(N,g,A,D.value,y),D!==null&&(e&&D.alternate!==null&&N.delete(D.key===null?A:D.key),m=o(D,m,A),I===null?E=D:I.sibling=D,I=D);return e&&N.forEach(function(Y){return t(g,Y)}),gt&&vr(g,A),E}function C(g,m,T,y){if(typeof T=="object"&&T!==null&&T.type===Kr&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case Mi:e:{for(var E=T.key,I=m;I!==null;){if(I.key===E){if(E=T.type,E===Kr){if(I.tag===7){n(g,I.sibling),m=c(I,T.props.children),m.return=g,g=m;break e}}else if(I.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===er&&Vc(E)===I.type){n(g,I.sibling),m=c(I,T.props),m.ref=Ls(g,I,T),m.return=g,g=m;break e}n(g,I);break}else t(g,I);I=I.sibling}T.type===Kr?(m=Dr(T.props.children,g.mode,y,T.key),m.return=g,g=m):(y=ao(T.type,T.key,T.props,null,g.mode,y),y.ref=Ls(g,m,T),y.return=g,g=y)}return h(g);case Qr:e:{for(I=T.key;m!==null;){if(m.key===I)if(m.tag===4&&m.stateNode.containerInfo===T.containerInfo&&m.stateNode.implementation===T.implementation){n(g,m.sibling),m=c(m,T.children||[]),m.return=g,g=m;break e}else{n(g,m);break}else t(g,m);m=m.sibling}m=Ga(T,g.mode,y),m.return=g,g=m}return h(g);case er:return I=T._init,C(g,m,I(T._payload),y)}if(Bs(T))return _(g,m,T,y);if(ws(T))return S(g,m,T,y);qi(g,T)}return typeof T=="string"&&T!==""||typeof T=="number"?(T=""+T,m!==null&&m.tag===6?(n(g,m.sibling),m=c(m,T),m.return=g,g=m):(n(g,m),m=Ba(T,g.mode,y),m.return=g,g=m),h(g)):n(g,m)}return C}var gs=zd(!0),Qd=zd(!1),No=Tr(null),Oo=null,ss=null,Eu=null;function Su(){Eu=ss=Oo=null}function Tu(e){var t=No.current;ft(No),e._currentValue=t}function Il(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function hs(e,t){Oo=e,Eu=ss=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Jt=!0),e.firstContext=null)}function Tn(e){var t=e._currentValue;if(Eu!==e)if(e={context:e,memoizedValue:t,next:null},ss===null){if(Oo===null)throw Error(Me(308));ss=e,Oo.dependencies={lanes:0,firstContext:e}}else ss=ss.next=e;return t}var Ar=null;function yu(e){Ar===null?Ar=[e]:Ar.push(e)}function Kd(e,t,n,s){var c=t.interleaved;return c===null?(n.next=n,yu(t)):(n.next=c.next,c.next=n),t.interleaved=n,Yn(e,s)}function Yn(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}var tr=!1;function Iu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xd(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Vn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function hr(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,it&2){var c=s.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),s.pending=t,Yn(e,n)}return c=s.interleaved,c===null?(t.next=t,yu(s)):(t.next=c.next,c.next=t),s.interleaved=t,Yn(e,n)}function to(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,au(e,n)}}function jc(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var c=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var h={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?c=o=h:o=o.next=h,n=n.next}while(n!==null);o===null?c=o=t:o=o.next=t}else c=o=t;n={baseState:s.baseState,firstBaseUpdate:c,lastBaseUpdate:o,shared:s.shared,effects:s.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ao(e,t,n,s){var c=e.updateQueue;tr=!1;var o=c.firstBaseUpdate,h=c.lastBaseUpdate,r=c.shared.pending;if(r!==null){c.shared.pending=null;var a=r,u=a.next;a.next=null,h===null?o=u:h.next=u,h=a;var l=e.alternate;l!==null&&(l=l.updateQueue,r=l.lastBaseUpdate,r!==h&&(r===null?l.firstBaseUpdate=u:r.next=u,l.lastBaseUpdate=a))}if(o!==null){var d=c.baseState;h=0,l=u=a=null,r=o;do{var f=r.lane,p=r.eventTime;if((s&f)===f){l!==null&&(l=l.next={eventTime:p,lane:0,tag:r.tag,payload:r.payload,callback:r.callback,next:null});e:{var _=e,S=r;switch(f=t,p=n,S.tag){case 1:if(_=S.payload,typeof _=="function"){d=_.call(p,d,f);break e}d=_;break e;case 3:_.flags=_.flags&-65537|128;case 0:if(_=S.payload,f=typeof _=="function"?_.call(p,d,f):_,f==null)break e;d=St({},d,f);break e;case 2:tr=!0}}r.callback!==null&&r.lane!==0&&(e.flags|=64,f=c.effects,f===null?c.effects=[r]:f.push(r))}else p={eventTime:p,lane:f,tag:r.tag,payload:r.payload,callback:r.callback,next:null},l===null?(u=l=p,a=d):l=l.next=p,h|=f;if(r=r.next,r===null){if(r=c.shared.pending,r===null)break;f=r,r=f.next,f.next=null,c.lastBaseUpdate=f,c.shared.pending=null}}while(!0);if(l===null&&(a=d),c.baseState=a,c.firstBaseUpdate=u,c.lastBaseUpdate=l,t=c.shared.interleaved,t!==null){c=t;do h|=c.lane,c=c.next;while(c!==t)}else o===null&&(c.shared.lanes=0);Ur|=h,e.lanes=h,e.memoizedState=d}}function Hc(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var s=e[t],c=s.callback;if(c!==null){if(s.callback=null,s=n,typeof c!="function")throw Error(Me(191,c));c.call(s)}}}var yi={},xn=Tr(yi),ui=Tr(yi),ci=Tr(yi);function wr(e){if(e===yi)throw Error(Me(174));return e}function Cu(e,t){switch(ht(ci,t),ht(ui,e),ht(xn,yi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:nl(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=nl(t,e)}ft(xn),ht(xn,t)}function ms(){ft(xn),ft(ui),ft(ci)}function Jd(e){wr(ci.current);var t=wr(xn.current),n=nl(t,e.type);t!==n&&(ht(ui,e),ht(xn,n))}function Ru(e){ui.current===e&&(ft(xn),ft(ui))}var mt=Tr(0);function wo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ba=[];function vu(){for(var e=0;e<ba.length;e++)ba[e]._workInProgressVersionPrimary=null;ba.length=0}var no=Kn.ReactCurrentDispatcher,La=Kn.ReactCurrentBatchConfig,Lr=0,Et=null,bt=null,Ut=null,Po=!1,zs=!1,hi=0,Dg=0;function qt(){throw Error(Me(321))}function Nu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Pn(e[n],t[n]))return!1;return!0}function Ou(e,t,n,s,c,o){if(Lr=o,Et=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,no.current=e===null||e.memoizedState===null?Ug:xg,e=n(s,c),zs){o=0;do{if(zs=!1,hi=0,25<=o)throw Error(Me(301));o+=1,Ut=bt=null,t.updateQueue=null,no.current=Fg,e=n(s,c)}while(zs)}if(no.current=Do,t=bt!==null&&bt.next!==null,Lr=0,Ut=bt=Et=null,Po=!1,t)throw Error(Me(300));return e}function Au(){var e=hi!==0;return hi=0,e}function bn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?Et.memoizedState=Ut=e:Ut=Ut.next=e,Ut}function yn(){if(bt===null){var e=Et.alternate;e=e!==null?e.memoizedState:null}else e=bt.next;var t=Ut===null?Et.memoizedState:Ut.next;if(t!==null)Ut=t,bt=e;else{if(e===null)throw Error(Me(310));bt=e,e={memoizedState:bt.memoizedState,baseState:bt.baseState,baseQueue:bt.baseQueue,queue:bt.queue,next:null},Ut===null?Et.memoizedState=Ut=e:Ut=Ut.next=e}return Ut}function di(e,t){return typeof t=="function"?t(e):t}function Ua(e){var t=yn(),n=t.queue;if(n===null)throw Error(Me(311));n.lastRenderedReducer=e;var s=bt,c=s.baseQueue,o=n.pending;if(o!==null){if(c!==null){var h=c.next;c.next=o.next,o.next=h}s.baseQueue=c=o,n.pending=null}if(c!==null){o=c.next,s=s.baseState;var r=h=null,a=null,u=o;do{var l=u.lane;if((Lr&l)===l)a!==null&&(a=a.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),s=u.hasEagerState?u.eagerState:e(s,u.action);else{var d={lane:l,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};a===null?(r=a=d,h=s):a=a.next=d,Et.lanes|=l,Ur|=l}u=u.next}while(u!==null&&u!==o);a===null?h=s:a.next=r,Pn(s,t.memoizedState)||(Jt=!0),t.memoizedState=s,t.baseState=h,t.baseQueue=a,n.lastRenderedState=s}if(e=n.interleaved,e!==null){c=e;do o=c.lane,Et.lanes|=o,Ur|=o,c=c.next;while(c!==e)}else c===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function xa(e){var t=yn(),n=t.queue;if(n===null)throw Error(Me(311));n.lastRenderedReducer=e;var s=n.dispatch,c=n.pending,o=t.memoizedState;if(c!==null){n.pending=null;var h=c=c.next;do o=e(o,h.action),h=h.next;while(h!==c);Pn(o,t.memoizedState)||(Jt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,s]}function Zd(){}function ep(e,t){var n=Et,s=yn(),c=t(),o=!Pn(s.memoizedState,c);if(o&&(s.memoizedState=c,Jt=!0),s=s.queue,wu(rp.bind(null,n,s,e),[e]),s.getSnapshot!==t||o||Ut!==null&&Ut.memoizedState.tag&1){if(n.flags|=2048,pi(9,np.bind(null,n,s,c,t),void 0,null),xt===null)throw Error(Me(349));Lr&30||tp(n,t,c)}return c}function tp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Et.updateQueue,t===null?(t={lastEffect:null,stores:null},Et.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function np(e,t,n,s){t.value=n,t.getSnapshot=s,sp(t)&&ip(e)}function rp(e,t,n){return n(function(){sp(t)&&ip(e)})}function sp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Pn(e,n)}catch{return!0}}function ip(e){var t=Yn(e,1);t!==null&&wn(t,e,1,-1)}function Yc(e){var t=bn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:di,lastRenderedState:e},t.queue=e,e=e.dispatch=Lg.bind(null,Et,e),[t.memoizedState,e]}function pi(e,t,n,s){return e={tag:e,create:t,destroy:n,deps:s,next:null},t=Et.updateQueue,t===null?(t={lastEffect:null,stores:null},Et.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e)),e}function op(){return yn().memoizedState}function ro(e,t,n,s){var c=bn();Et.flags|=e,c.memoizedState=pi(1|t,n,void 0,s===void 0?null:s)}function zo(e,t,n,s){var c=yn();s=s===void 0?null:s;var o=void 0;if(bt!==null){var h=bt.memoizedState;if(o=h.destroy,s!==null&&Nu(s,h.deps)){c.memoizedState=pi(t,n,o,s);return}}Et.flags|=e,c.memoizedState=pi(1|t,n,o,s)}function zc(e,t){return ro(8390656,8,e,t)}function wu(e,t){return zo(2048,8,e,t)}function ap(e,t){return zo(4,2,e,t)}function lp(e,t){return zo(4,4,e,t)}function up(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function cp(e,t,n){return n=n!=null?n.concat([e]):null,zo(4,4,up.bind(null,t,e),n)}function Pu(){}function hp(e,t){var n=yn();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&Nu(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function dp(e,t){var n=yn();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&Nu(t,s[1])?s[0]:(e=e(),n.memoizedState=[e,t],e)}function pp(e,t,n){return Lr&21?(Pn(n,t)||(n=Ed(),Et.lanes|=n,Ur|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Jt=!0),e.memoizedState=n)}function Mg(e,t){var n=ut;ut=n!==0&&4>n?n:4,e(!0);var s=La.transition;La.transition={};try{e(!1),t()}finally{ut=n,La.transition=s}}function fp(){return yn().memoizedState}function bg(e,t,n){var s=pr(e);if(n={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null},_p(e))gp(t,n);else if(n=Kd(e,t,n,s),n!==null){var c=zt();wn(n,e,s,c),mp(n,t,s)}}function Lg(e,t,n){var s=pr(e),c={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null};if(_p(e))gp(t,c);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var h=t.lastRenderedState,r=o(h,n);if(c.hasEagerState=!0,c.eagerState=r,Pn(r,h)){var a=t.interleaved;a===null?(c.next=c,yu(t)):(c.next=a.next,a.next=c),t.interleaved=c;return}}catch{}finally{}n=Kd(e,t,c,s),n!==null&&(c=zt(),wn(n,e,s,c),mp(n,t,s))}}function _p(e){var t=e.alternate;return e===Et||t!==null&&t===Et}function gp(e,t){zs=Po=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function mp(e,t,n){if(n&4194240){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,au(e,n)}}var Do={readContext:Tn,useCallback:qt,useContext:qt,useEffect:qt,useImperativeHandle:qt,useInsertionEffect:qt,useLayoutEffect:qt,useMemo:qt,useReducer:qt,useRef:qt,useState:qt,useDebugValue:qt,useDeferredValue:qt,useTransition:qt,useMutableSource:qt,useSyncExternalStore:qt,useId:qt,unstable_isNewReconciler:!1},Ug={readContext:Tn,useCallback:function(e,t){return bn().memoizedState=[e,t===void 0?null:t],e},useContext:Tn,useEffect:zc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ro(4194308,4,up.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ro(4194308,4,e,t)},useInsertionEffect:function(e,t){return ro(4,2,e,t)},useMemo:function(e,t){var n=bn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var s=bn();return t=n!==void 0?n(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=bg.bind(null,Et,e),[s.memoizedState,e]},useRef:function(e){var t=bn();return e={current:e},t.memoizedState=e},useState:Yc,useDebugValue:Pu,useDeferredValue:function(e){return bn().memoizedState=e},useTransition:function(){var e=Yc(!1),t=e[0];return e=Mg.bind(null,e[1]),bn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var s=Et,c=bn();if(gt){if(n===void 0)throw Error(Me(407));n=n()}else{if(n=t(),xt===null)throw Error(Me(349));Lr&30||tp(s,t,n)}c.memoizedState=n;var o={value:n,getSnapshot:t};return c.queue=o,zc(rp.bind(null,s,o,e),[e]),s.flags|=2048,pi(9,np.bind(null,s,o,n,t),void 0,null),n},useId:function(){var e=bn(),t=xt.identifierPrefix;if(gt){var n=qn,s=Wn;n=(s&~(1<<32-An(s)-1)).toString(32)+n,t=":"+t+"R"+n,n=hi++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Dg++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},xg={readContext:Tn,useCallback:hp,useContext:Tn,useEffect:wu,useImperativeHandle:cp,useInsertionEffect:ap,useLayoutEffect:lp,useMemo:dp,useReducer:Ua,useRef:op,useState:function(){return Ua(di)},useDebugValue:Pu,useDeferredValue:function(e){var t=yn();return pp(t,bt.memoizedState,e)},useTransition:function(){var e=Ua(di)[0],t=yn().memoizedState;return[e,t]},useMutableSource:Zd,useSyncExternalStore:ep,useId:fp,unstable_isNewReconciler:!1},Fg={readContext:Tn,useCallback:hp,useContext:Tn,useEffect:wu,useImperativeHandle:cp,useInsertionEffect:ap,useLayoutEffect:lp,useMemo:dp,useReducer:xa,useRef:op,useState:function(){return xa(di)},useDebugValue:Pu,useDeferredValue:function(e){var t=yn();return bt===null?t.memoizedState=e:pp(t,bt.memoizedState,e)},useTransition:function(){var e=xa(di)[0],t=yn().memoizedState;return[e,t]},useMutableSource:Zd,useSyncExternalStore:ep,useId:fp,unstable_isNewReconciler:!1};function Rn(e,t){if(e&&e.defaultProps){t=St({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Cl(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:St({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Qo={isMounted:function(e){return(e=e._reactInternals)?kr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var s=zt(),c=pr(e),o=Vn(s,c);o.payload=t,n!=null&&(o.callback=n),t=hr(e,o,c),t!==null&&(wn(t,e,c,s),to(t,e,c))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=zt(),c=pr(e),o=Vn(s,c);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=hr(e,o,c),t!==null&&(wn(t,e,c,s),to(t,e,c))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=zt(),s=pr(e),c=Vn(n,s);c.tag=2,t!=null&&(c.callback=t),t=hr(e,c,s),t!==null&&(wn(t,e,s,n),to(t,e,s))}};function Qc(e,t,n,s,c,o,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,o,h):t.prototype&&t.prototype.isPureReactComponent?!ii(n,s)||!ii(c,o):!0}function Ep(e,t,n){var s=!1,c=Er,o=t.contextType;return typeof o=="object"&&o!==null?o=Tn(o):(c=en(t)?Mr:Ht.current,s=t.contextTypes,o=(s=s!=null)?fs(e,c):Er),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Qo,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=c,e.__reactInternalMemoizedMaskedChildContext=o),t}function Kc(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&Qo.enqueueReplaceState(t,t.state,null)}function Rl(e,t,n,s){var c=e.stateNode;c.props=n,c.state=e.memoizedState,c.refs={},Iu(e);var o=t.contextType;typeof o=="object"&&o!==null?c.context=Tn(o):(o=en(t)?Mr:Ht.current,c.context=fs(e,o)),c.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(Cl(e,t,o,n),c.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(t=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),t!==c.state&&Qo.enqueueReplaceState(c,c.state,null),Ao(e,n,c,s),c.state=e.memoizedState),typeof c.componentDidMount=="function"&&(e.flags|=4194308)}function Es(e,t){try{var n="",s=t;do n+=h_(s),s=s.return;while(s);var c=n}catch(o){c=`
|
|
37
|
+
`+c[h].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=h&&0<=r);break}}}finally{ma=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ks(e):""}function __(e){switch(e.tag){case 5:return ks(e.type);case 16:return ks("Lazy");case 13:return ks("Suspense");case 19:return ks("SuspenseList");case 0:case 2:case 15:return e=Ea(e.type,!1),e;case 11:return e=Ea(e.type.render,!1),e;case 1:return e=Ea(e.type,!0),e;default:return""}}function Xa(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Kr:return"Fragment";case Qr:return"Portal";case za:return"Profiler";case ru:return"StrictMode";case Qa:return"Suspense";case Ka:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Xh:return(e.displayName||"Context")+".Consumer";case Kh:return(e._context.displayName||"Context")+".Provider";case su:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case iu:return t=e.displayName||null,t!==null?t:Xa(e.type)||"Memo";case er:t=e._payload,e=e._init;try{return Xa(e(t))}catch{}}return null}function g_(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Xa(t);case 8:return t===ru?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function mr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Zh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function m_(e){var t=Zh(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var c=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(h){s=""+h,o.call(this,h)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(h){s=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function bi(e){e._valueTracker||(e._valueTracker=m_(e))}function ed(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=Zh(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function po(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ja(e,t){var n=t.checked;return St({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function fc(e,t){var n=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;n=mr(t.value!=null?t.value:n),e._wrapperState={initialChecked:s,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function td(e,t){t=t.checked,t!=null&&nu(e,"checked",t,!1)}function Za(e,t){td(e,t);var n=mr(t.value),s=t.type;if(n!=null)s==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?el(e,t.type,n):t.hasOwnProperty("defaultValue")&&el(e,t.type,mr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function _c(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function el(e,t,n){(t!=="number"||po(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Bs=Array.isArray;function as(e,t,n,s){if(e=e.options,t){t={};for(var c=0;c<n.length;c++)t["$"+n[c]]=!0;for(n=0;n<e.length;n++)c=t.hasOwnProperty("$"+e[n].value),e[n].selected!==c&&(e[n].selected=c),c&&s&&(e[n].defaultSelected=!0)}else{for(n=""+mr(n),t=null,c=0;c<e.length;c++){if(e[c].value===n){e[c].selected=!0,s&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function tl(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Me(91));return St({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function gc(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(Me(92));if(Bs(n)){if(1<n.length)throw Error(Me(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:mr(n)}}function nd(e,t){var n=mr(t.value),s=mr(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),s!=null&&(e.defaultValue=""+s)}function mc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function rd(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function nl(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?rd(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Li,sd=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,s,c){MSApp.execUnsafeLocalFunction(function(){return e(t,n,s,c)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Li=Li||document.createElement("div"),Li.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Li.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Zs(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var qs={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},E_=["Webkit","ms","Moz","O"];Object.keys(qs).forEach(function(e){E_.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),qs[t]=qs[e]})});function id(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||qs.hasOwnProperty(e)&&qs[e]?(""+t).trim():t+"px"}function od(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var s=n.indexOf("--")===0,c=id(n,t[n],s);n==="float"&&(n="cssFloat"),s?e.setProperty(n,c):e[n]=c}}var S_=St({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function rl(e,t){if(t){if(S_[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Me(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Me(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Me(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Me(62))}}function sl(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var il=null;function ou(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ol=null,ls=null,us=null;function Ec(e){if(e=Ti(e)){if(typeof ol!="function")throw Error(Me(280));var t=e.stateNode;t&&(t=Ho(t),ol(e.stateNode,e.type,t))}}function ad(e){ls?us?us.push(e):us=[e]:ls=e}function ld(){if(ls){var e=ls,t=us;if(us=ls=null,Ec(e),t)for(e=0;e<t.length;e++)Ec(t[e])}}function ud(e,t){return e(t)}function cd(){}var Sa=!1;function hd(e,t,n){if(Sa)return e(t,n);Sa=!0;try{return ud(e,t,n)}finally{Sa=!1,(ls!==null||us!==null)&&(cd(),ld())}}function ei(e,t){var n=e.stateNode;if(n===null)return null;var s=Ho(n);if(s===null)return null;n=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(Me(231,t,typeof n));return n}var al=!1;if(jn)try{var Ps={};Object.defineProperty(Ps,"passive",{get:function(){al=!0}}),window.addEventListener("test",Ps,Ps),window.removeEventListener("test",Ps,Ps)}catch{al=!1}function T_(e,t,n,s,c,o,h,r,a){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(l){this.onError(l)}}var Vs=!1,fo=null,_o=!1,ll=null,y_={onError:function(e){Vs=!0,fo=e}};function I_(e,t,n,s,c,o,h,r,a){Vs=!1,fo=null,T_.apply(y_,arguments)}function C_(e,t,n,s,c,o,h,r,a){if(I_.apply(this,arguments),Vs){if(Vs){var u=fo;Vs=!1,fo=null}else throw Error(Me(198));_o||(_o=!0,ll=u)}}function kr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function dd(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Sc(e){if(kr(e)!==e)throw Error(Me(188))}function R_(e){var t=e.alternate;if(!t){if(t=kr(e),t===null)throw Error(Me(188));return t!==e?null:e}for(var n=e,s=t;;){var c=n.return;if(c===null)break;var o=c.alternate;if(o===null){if(s=c.return,s!==null){n=s;continue}break}if(c.child===o.child){for(o=c.child;o;){if(o===n)return Sc(c),e;if(o===s)return Sc(c),t;o=o.sibling}throw Error(Me(188))}if(n.return!==s.return)n=c,s=o;else{for(var h=!1,r=c.child;r;){if(r===n){h=!0,n=c,s=o;break}if(r===s){h=!0,s=c,n=o;break}r=r.sibling}if(!h){for(r=o.child;r;){if(r===n){h=!0,n=o,s=c;break}if(r===s){h=!0,s=o,n=c;break}r=r.sibling}if(!h)throw Error(Me(189))}}if(n.alternate!==s)throw Error(Me(190))}if(n.tag!==3)throw Error(Me(188));return n.stateNode.current===n?e:t}function pd(e){return e=R_(e),e!==null?fd(e):null}function fd(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=fd(e);if(t!==null)return t;e=e.sibling}return null}var _d=ln.unstable_scheduleCallback,Tc=ln.unstable_cancelCallback,v_=ln.unstable_shouldYield,N_=ln.unstable_requestPaint,Ot=ln.unstable_now,O_=ln.unstable_getCurrentPriorityLevel,au=ln.unstable_ImmediatePriority,gd=ln.unstable_UserBlockingPriority,go=ln.unstable_NormalPriority,A_=ln.unstable_LowPriority,md=ln.unstable_IdlePriority,Wo=null,Un=null;function w_(e){if(Un&&typeof Un.onCommitFiberRoot=="function")try{Un.onCommitFiberRoot(Wo,e,void 0,(e.current.flags&128)===128)}catch{}}var An=Math.clz32?Math.clz32:M_,P_=Math.log,D_=Math.LN2;function M_(e){return e>>>=0,e===0?32:31-(P_(e)/D_|0)|0}var Ui=64,xi=4194304;function Gs(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function mo(e,t){var n=e.pendingLanes;if(n===0)return 0;var s=0,c=e.suspendedLanes,o=e.pingedLanes,h=n&268435455;if(h!==0){var r=h&~c;r!==0?s=Gs(r):(o&=h,o!==0&&(s=Gs(o)))}else h=n&~c,h!==0?s=Gs(h):o!==0&&(s=Gs(o));if(s===0)return 0;if(t!==0&&t!==s&&!(t&c)&&(c=s&-s,o=t&-t,c>=o||c===16&&(o&4194240)!==0))return t;if(s&4&&(s|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0<t;)n=31-An(t),c=1<<n,s|=e[n],t&=~c;return s}function b_(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function L_(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,c=e.expirationTimes,o=e.pendingLanes;0<o;){var h=31-An(o),r=1<<h,a=c[h];a===-1?(!(r&n)||r&s)&&(c[h]=b_(r,t)):a<=t&&(e.expiredLanes|=r),o&=~r}}function ul(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ed(){var e=Ui;return Ui<<=1,!(Ui&4194240)&&(Ui=64),e}function Ta(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ei(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-An(t),e[t]=n}function U_(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var s=e.eventTimes;for(e=e.expirationTimes;0<n;){var c=31-An(n),o=1<<c;t[c]=0,s[c]=-1,e[c]=-1,n&=~o}}function lu(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-An(n),c=1<<s;c&t|e[s]&t&&(e[s]|=t),n&=~c}}var ut=0;function Sd(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Td,uu,yd,Id,Cd,cl=!1,Fi=[],ar=null,lr=null,ur=null,ti=new Map,ni=new Map,nr=[],x_="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function yc(e,t){switch(e){case"focusin":case"focusout":ar=null;break;case"dragenter":case"dragleave":lr=null;break;case"mouseover":case"mouseout":ur=null;break;case"pointerover":case"pointerout":ti.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ni.delete(t.pointerId)}}function Ds(e,t,n,s,c,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:o,targetContainers:[c]},t!==null&&(t=Ti(t),t!==null&&uu(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function F_(e,t,n,s,c){switch(t){case"focusin":return ar=Ds(ar,e,t,n,s,c),!0;case"dragenter":return lr=Ds(lr,e,t,n,s,c),!0;case"mouseover":return ur=Ds(ur,e,t,n,s,c),!0;case"pointerover":var o=c.pointerId;return ti.set(o,Ds(ti.get(o)||null,e,t,n,s,c)),!0;case"gotpointercapture":return o=c.pointerId,ni.set(o,Ds(ni.get(o)||null,e,t,n,s,c)),!0}return!1}function Rd(e){var t=Or(e.target);if(t!==null){var n=kr(t);if(n!==null){if(t=n.tag,t===13){if(t=dd(n),t!==null){e.blockedOn=t,Cd(e.priority,function(){yd(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ji(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=hl(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);il=s,n.target.dispatchEvent(s),il=null}else return t=Ti(n),t!==null&&uu(t),e.blockedOn=n,!1;t.shift()}return!0}function Ic(e,t,n){Ji(e)&&n.delete(t)}function k_(){cl=!1,ar!==null&&Ji(ar)&&(ar=null),lr!==null&&Ji(lr)&&(lr=null),ur!==null&&Ji(ur)&&(ur=null),ti.forEach(Ic),ni.forEach(Ic)}function Ms(e,t){e.blockedOn===t&&(e.blockedOn=null,cl||(cl=!0,ln.unstable_scheduleCallback(ln.unstable_NormalPriority,k_)))}function ri(e){function t(c){return Ms(c,e)}if(0<Fi.length){Ms(Fi[0],e);for(var n=1;n<Fi.length;n++){var s=Fi[n];s.blockedOn===e&&(s.blockedOn=null)}}for(ar!==null&&Ms(ar,e),lr!==null&&Ms(lr,e),ur!==null&&Ms(ur,e),ti.forEach(t),ni.forEach(t),n=0;n<nr.length;n++)s=nr[n],s.blockedOn===e&&(s.blockedOn=null);for(;0<nr.length&&(n=nr[0],n.blockedOn===null);)Rd(n),n.blockedOn===null&&nr.shift()}var cs=Kn.ReactCurrentBatchConfig,Eo=!0;function B_(e,t,n,s){var c=ut,o=cs.transition;cs.transition=null;try{ut=1,cu(e,t,n,s)}finally{ut=c,cs.transition=o}}function G_(e,t,n,s){var c=ut,o=cs.transition;cs.transition=null;try{ut=4,cu(e,t,n,s)}finally{ut=c,cs.transition=o}}function cu(e,t,n,s){if(Eo){var c=hl(e,t,n,s);if(c===null)Pa(e,t,s,So,n),yc(e,s);else if(F_(c,e,t,n,s))s.stopPropagation();else if(yc(e,s),t&4&&-1<x_.indexOf(e)){for(;c!==null;){var o=Ti(c);if(o!==null&&Td(o),o=hl(e,t,n,s),o===null&&Pa(e,t,s,So,n),o===c)break;c=o}c!==null&&s.stopPropagation()}else Pa(e,t,s,null,n)}}var So=null;function hl(e,t,n,s){if(So=null,e=ou(s),e=Or(e),e!==null)if(t=kr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=dd(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return So=e,null}function vd(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(O_()){case au:return 1;case gd:return 4;case go:case A_:return 16;case md:return 536870912;default:return 16}default:return 16}}var sr=null,hu=null,Zi=null;function Nd(){if(Zi)return Zi;var e,t=hu,n=t.length,s,c="value"in sr?sr.value:sr.textContent,o=c.length;for(e=0;e<n&&t[e]===c[e];e++);var h=n-e;for(s=1;s<=h&&t[n-s]===c[o-s];s++);return Zi=c.slice(e,1<s?1-s:void 0)}function eo(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ki(){return!0}function Cc(){return!1}function cn(e){function t(n,s,c,o,h){this._reactName=n,this._targetInst=c,this.type=s,this.nativeEvent=o,this.target=h,this.currentTarget=null;for(var r in e)e.hasOwnProperty(r)&&(n=e[r],this[r]=n?n(o):o[r]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?ki:Cc,this.isPropagationStopped=Cc,this}return St(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=ki)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ki)},persist:function(){},isPersistent:ki}),t}var Is={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},du=cn(Is),Si=St({},Is,{view:0,detail:0}),$_=cn(Si),ya,Ia,bs,qo=St({},Si,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==bs&&(bs&&e.type==="mousemove"?(ya=e.screenX-bs.screenX,Ia=e.screenY-bs.screenY):Ia=ya=0,bs=e),ya)},movementY:function(e){return"movementY"in e?e.movementY:Ia}}),Rc=cn(qo),W_=St({},qo,{dataTransfer:0}),q_=cn(W_),V_=St({},Si,{relatedTarget:0}),Ca=cn(V_),j_=St({},Is,{animationName:0,elapsedTime:0,pseudoElement:0}),H_=cn(j_),Y_=St({},Is,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),z_=cn(Y_),Q_=St({},Is,{data:0}),vc=cn(Q_),K_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},X_={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},J_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Z_(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=J_[e])?!!t[e]:!1}function pu(){return Z_}var eg=St({},Si,{key:function(e){if(e.key){var t=K_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=eo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?X_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pu,charCode:function(e){return e.type==="keypress"?eo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?eo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),tg=cn(eg),ng=St({},qo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Nc=cn(ng),rg=St({},Si,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pu}),sg=cn(rg),ig=St({},Is,{propertyName:0,elapsedTime:0,pseudoElement:0}),og=cn(ig),ag=St({},qo,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),lg=cn(ag),ug=[9,13,27,32],fu=jn&&"CompositionEvent"in window,js=null;jn&&"documentMode"in document&&(js=document.documentMode);var cg=jn&&"TextEvent"in window&&!js,Od=jn&&(!fu||js&&8<js&&11>=js),Oc=" ",Ac=!1;function Ad(e,t){switch(e){case"keyup":return ug.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xr=!1;function hg(e,t){switch(e){case"compositionend":return wd(t);case"keypress":return t.which!==32?null:(Ac=!0,Oc);case"textInput":return e=t.data,e===Oc&&Ac?null:e;default:return null}}function dg(e,t){if(Xr)return e==="compositionend"||!fu&&Ad(e,t)?(e=Nd(),Zi=hu=sr=null,Xr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Od&&t.locale!=="ko"?null:t.data;default:return null}}var pg={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function wc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!pg[e.type]:t==="textarea"}function Pd(e,t,n,s){ad(s),t=To(t,"onChange"),0<t.length&&(n=new du("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var Hs=null,si=null;function fg(e){$d(e,0)}function Vo(e){var t=es(e);if(ed(t))return e}function _g(e,t){if(e==="change")return t}var Dd=!1;if(jn){var Ra;if(jn){var va="oninput"in document;if(!va){var Pc=document.createElement("div");Pc.setAttribute("oninput","return;"),va=typeof Pc.oninput=="function"}Ra=va}else Ra=!1;Dd=Ra&&(!document.documentMode||9<document.documentMode)}function Dc(){Hs&&(Hs.detachEvent("onpropertychange",Md),si=Hs=null)}function Md(e){if(e.propertyName==="value"&&Vo(si)){var t=[];Pd(t,si,e,ou(e)),hd(fg,t)}}function gg(e,t,n){e==="focusin"?(Dc(),Hs=t,si=n,Hs.attachEvent("onpropertychange",Md)):e==="focusout"&&Dc()}function mg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Vo(si)}function Eg(e,t){if(e==="click")return Vo(t)}function Sg(e,t){if(e==="input"||e==="change")return Vo(t)}function Tg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pn=typeof Object.is=="function"?Object.is:Tg;function ii(e,t){if(Pn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var c=n[s];if(!Ya.call(t,c)||!Pn(e[c],t[c]))return!1}return!0}function Mc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function bc(e,t){var n=Mc(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Mc(n)}}function bd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?bd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ld(){for(var e=window,t=po();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=po(e.document)}return t}function _u(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function yg(e){var t=Ld(),n=e.focusedElem,s=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&bd(n.ownerDocument.documentElement,n)){if(s!==null&&_u(n)){if(t=s.start,e=s.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var c=n.textContent.length,o=Math.min(s.start,c);s=s.end===void 0?o:Math.min(s.end,c),!e.extend&&o>s&&(c=s,s=o,o=c),c=bc(n,o);var h=bc(n,s);c&&h&&(e.rangeCount!==1||e.anchorNode!==c.node||e.anchorOffset!==c.offset||e.focusNode!==h.node||e.focusOffset!==h.offset)&&(t=t.createRange(),t.setStart(c.node,c.offset),e.removeAllRanges(),o>s?(e.addRange(t),e.extend(h.node,h.offset)):(t.setEnd(h.node,h.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Ig=jn&&"documentMode"in document&&11>=document.documentMode,Jr=null,dl=null,Ys=null,pl=!1;function Lc(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;pl||Jr==null||Jr!==po(s)||(s=Jr,"selectionStart"in s&&_u(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Ys&&ii(Ys,s)||(Ys=s,s=To(dl,"onSelect"),0<s.length&&(t=new du("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=Jr)))}function Bi(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Zr={animationend:Bi("Animation","AnimationEnd"),animationiteration:Bi("Animation","AnimationIteration"),animationstart:Bi("Animation","AnimationStart"),transitionend:Bi("Transition","TransitionEnd")},Na={},Ud={};jn&&(Ud=document.createElement("div").style,"AnimationEvent"in window||(delete Zr.animationend.animation,delete Zr.animationiteration.animation,delete Zr.animationstart.animation),"TransitionEvent"in window||delete Zr.transitionend.transition);function jo(e){if(Na[e])return Na[e];if(!Zr[e])return e;var t=Zr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ud)return Na[e]=t[n];return e}var xd=jo("animationend"),Fd=jo("animationiteration"),kd=jo("animationstart"),Bd=jo("transitionend"),Gd=new Map,Uc="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Sr(e,t){Gd.set(e,t),Fr(t,[e])}for(var Oa=0;Oa<Uc.length;Oa++){var Aa=Uc[Oa],Cg=Aa.toLowerCase(),Rg=Aa[0].toUpperCase()+Aa.slice(1);Sr(Cg,"on"+Rg)}Sr(xd,"onAnimationEnd");Sr(Fd,"onAnimationIteration");Sr(kd,"onAnimationStart");Sr("dblclick","onDoubleClick");Sr("focusin","onFocus");Sr("focusout","onBlur");Sr(Bd,"onTransitionEnd");ps("onMouseEnter",["mouseout","mouseover"]);ps("onMouseLeave",["mouseout","mouseover"]);ps("onPointerEnter",["pointerout","pointerover"]);ps("onPointerLeave",["pointerout","pointerover"]);Fr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Fr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Fr("onBeforeInput",["compositionend","keypress","textInput","paste"]);Fr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Fr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Fr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $s="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),vg=new Set("cancel close invalid load scroll toggle".split(" ").concat($s));function xc(e,t,n){var s=e.type||"unknown-event";e.currentTarget=n,C_(s,t,void 0,e),e.currentTarget=null}function $d(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],c=s.event;s=s.listeners;e:{var o=void 0;if(t)for(var h=s.length-1;0<=h;h--){var r=s[h],a=r.instance,u=r.currentTarget;if(r=r.listener,a!==o&&c.isPropagationStopped())break e;xc(c,r,u),o=a}else for(h=0;h<s.length;h++){if(r=s[h],a=r.instance,u=r.currentTarget,r=r.listener,a!==o&&c.isPropagationStopped())break e;xc(c,r,u),o=a}}}if(_o)throw e=ll,_o=!1,ll=null,e}function pt(e,t){var n=t[El];n===void 0&&(n=t[El]=new Set);var s=e+"__bubble";n.has(s)||(Wd(t,e,2,!1),n.add(s))}function wa(e,t,n){var s=0;t&&(s|=4),Wd(n,e,s,t)}var Gi="_reactListening"+Math.random().toString(36).slice(2);function oi(e){if(!e[Gi]){e[Gi]=!0,Qh.forEach(function(n){n!=="selectionchange"&&(vg.has(n)||wa(n,!1,e),wa(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Gi]||(t[Gi]=!0,wa("selectionchange",!1,t))}}function Wd(e,t,n,s){switch(vd(t)){case 1:var c=B_;break;case 4:c=G_;break;default:c=cu}n=c.bind(null,t,n,e),c=void 0,!al||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),s?c!==void 0?e.addEventListener(t,n,{capture:!0,passive:c}):e.addEventListener(t,n,!0):c!==void 0?e.addEventListener(t,n,{passive:c}):e.addEventListener(t,n,!1)}function Pa(e,t,n,s,c){var o=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var h=s.tag;if(h===3||h===4){var r=s.stateNode.containerInfo;if(r===c||r.nodeType===8&&r.parentNode===c)break;if(h===4)for(h=s.return;h!==null;){var a=h.tag;if((a===3||a===4)&&(a=h.stateNode.containerInfo,a===c||a.nodeType===8&&a.parentNode===c))return;h=h.return}for(;r!==null;){if(h=Or(r),h===null)return;if(a=h.tag,a===5||a===6){s=o=h;continue e}r=r.parentNode}}s=s.return}hd(function(){var u=o,l=ou(n),d=[];e:{var _=Gd.get(e);if(_!==void 0){var p=du,f=e;switch(e){case"keypress":if(eo(n)===0)break e;case"keydown":case"keyup":p=tg;break;case"focusin":f="focus",p=Ca;break;case"focusout":f="blur",p=Ca;break;case"beforeblur":case"afterblur":p=Ca;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=Rc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=q_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=sg;break;case xd:case Fd:case kd:p=H_;break;case Bd:p=og;break;case"scroll":p=$_;break;case"wheel":p=lg;break;case"copy":case"cut":case"paste":p=z_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Nc}var S=(t&4)!==0,C=!S&&e==="scroll",g=S?_!==null?_+"Capture":null:_;S=[];for(var m=u,T;m!==null;){T=m;var y=T.stateNode;if(T.tag===5&&y!==null&&(T=y,g!==null&&(y=ei(m,g),y!=null&&S.push(ai(m,y,T)))),C)break;m=m.return}0<S.length&&(_=new p(_,f,null,n,l),d.push({event:_,listeners:S}))}}if(!(t&7)){e:{if(_=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",_&&n!==il&&(f=n.relatedTarget||n.fromElement)&&(Or(f)||f[Hn]))break e;if((p||_)&&(_=l.window===l?l:(_=l.ownerDocument)?_.defaultView||_.parentWindow:window,p?(f=n.relatedTarget||n.toElement,p=u,f=f?Or(f):null,f!==null&&(C=kr(f),f!==C||f.tag!==5&&f.tag!==6)&&(f=null)):(p=null,f=u),p!==f)){if(S=Rc,y="onMouseLeave",g="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(S=Nc,y="onPointerLeave",g="onPointerEnter",m="pointer"),C=p==null?_:es(p),T=f==null?_:es(f),_=new S(y,m+"leave",p,n,l),_.target=C,_.relatedTarget=T,y=null,Or(l)===u&&(S=new S(g,m+"enter",f,n,l),S.target=T,S.relatedTarget=C,y=S),C=y,p&&f)t:{for(S=p,g=f,m=0,T=S;T;T=zr(T))m++;for(T=0,y=g;y;y=zr(y))T++;for(;0<m-T;)S=zr(S),m--;for(;0<T-m;)g=zr(g),T--;for(;m--;){if(S===g||g!==null&&S===g.alternate)break t;S=zr(S),g=zr(g)}S=null}else S=null;p!==null&&Fc(d,_,p,S,!1),f!==null&&C!==null&&Fc(d,C,f,S,!0)}}e:{if(_=u?es(u):window,p=_.nodeName&&_.nodeName.toLowerCase(),p==="select"||p==="input"&&_.type==="file")var E=_g;else if(wc(_))if(Dd)E=Sg;else{E=mg;var I=gg}else(p=_.nodeName)&&p.toLowerCase()==="input"&&(_.type==="checkbox"||_.type==="radio")&&(E=Eg);if(E&&(E=E(e,u))){Pd(d,E,n,l);break e}I&&I(e,_,u),e==="focusout"&&(I=_._wrapperState)&&I.controlled&&_.type==="number"&&el(_,"number",_.value)}switch(I=u?es(u):window,e){case"focusin":(wc(I)||I.contentEditable==="true")&&(Jr=I,dl=u,Ys=null);break;case"focusout":Ys=dl=Jr=null;break;case"mousedown":pl=!0;break;case"contextmenu":case"mouseup":case"dragend":pl=!1,Lc(d,n,l);break;case"selectionchange":if(Ig)break;case"keydown":case"keyup":Lc(d,n,l)}var N;if(fu)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else Xr?Ad(e,n)&&(A="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(A="onCompositionStart");A&&(Od&&n.locale!=="ko"&&(Xr||A!=="onCompositionStart"?A==="onCompositionEnd"&&Xr&&(N=Nd()):(sr=l,hu="value"in sr?sr.value:sr.textContent,Xr=!0)),I=To(u,A),0<I.length&&(A=new vc(A,e,null,n,l),d.push({event:A,listeners:I}),N?A.data=N:(N=wd(n),N!==null&&(A.data=N)))),(N=cg?hg(e,n):dg(e,n))&&(u=To(u,"onBeforeInput"),0<u.length&&(l=new vc("onBeforeInput","beforeinput",null,n,l),d.push({event:l,listeners:u}),l.data=N))}$d(d,t)})}function ai(e,t,n){return{instance:e,listener:t,currentTarget:n}}function To(e,t){for(var n=t+"Capture",s=[];e!==null;){var c=e,o=c.stateNode;c.tag===5&&o!==null&&(c=o,o=ei(e,n),o!=null&&s.unshift(ai(e,o,c)),o=ei(e,t),o!=null&&s.push(ai(e,o,c))),e=e.return}return s}function zr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Fc(e,t,n,s,c){for(var o=t._reactName,h=[];n!==null&&n!==s;){var r=n,a=r.alternate,u=r.stateNode;if(a!==null&&a===s)break;r.tag===5&&u!==null&&(r=u,c?(a=ei(n,o),a!=null&&h.unshift(ai(n,a,r))):c||(a=ei(n,o),a!=null&&h.push(ai(n,a,r)))),n=n.return}h.length!==0&&e.push({event:t,listeners:h})}var Ng=/\r\n?/g,Og=/\u0000|\uFFFD/g;function kc(e){return(typeof e=="string"?e:""+e).replace(Ng,`
|
|
38
|
+
`).replace(Og,"")}function $i(e,t,n){if(t=kc(t),kc(e)!==t&&n)throw Error(Me(425))}function yo(){}var fl=null,_l=null;function gl(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ml=typeof setTimeout=="function"?setTimeout:void 0,Ag=typeof clearTimeout=="function"?clearTimeout:void 0,Bc=typeof Promise=="function"?Promise:void 0,wg=typeof queueMicrotask=="function"?queueMicrotask:typeof Bc<"u"?function(e){return Bc.resolve(null).then(e).catch(Pg)}:ml;function Pg(e){setTimeout(function(){throw e})}function Da(e,t){var n=t,s=0;do{var c=n.nextSibling;if(e.removeChild(n),c&&c.nodeType===8)if(n=c.data,n==="/$"){if(s===0){e.removeChild(c),ri(t);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=c}while(n);ri(t)}function cr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Gc(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Cs=Math.random().toString(36).slice(2),Ln="__reactFiber$"+Cs,li="__reactProps$"+Cs,Hn="__reactContainer$"+Cs,El="__reactEvents$"+Cs,Dg="__reactListeners$"+Cs,Mg="__reactHandles$"+Cs;function Or(e){var t=e[Ln];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Hn]||n[Ln]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Gc(e);e!==null;){if(n=e[Ln])return n;e=Gc(e)}return t}e=n,n=e.parentNode}return null}function Ti(e){return e=e[Ln]||e[Hn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function es(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Me(33))}function Ho(e){return e[li]||null}var Sl=[],ts=-1;function Tr(e){return{current:e}}function ft(e){0>ts||(e.current=Sl[ts],Sl[ts]=null,ts--)}function ht(e,t){ts++,Sl[ts]=e.current,e.current=t}var Er={},Ht=Tr(Er),Zt=Tr(!1),Mr=Er;function fs(e,t){var n=e.type.contextTypes;if(!n)return Er;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var c={},o;for(o in n)c[o]=t[o];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=c),c}function en(e){return e=e.childContextTypes,e!=null}function Io(){ft(Zt),ft(Ht)}function $c(e,t,n){if(Ht.current!==Er)throw Error(Me(168));ht(Ht,t),ht(Zt,n)}function qd(e,t,n){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return n;s=s.getChildContext();for(var c in s)if(!(c in t))throw Error(Me(108,g_(e)||"Unknown",c));return St({},n,s)}function Co(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Er,Mr=Ht.current,ht(Ht,e),ht(Zt,Zt.current),!0}function Wc(e,t,n){var s=e.stateNode;if(!s)throw Error(Me(169));n?(e=qd(e,t,Mr),s.__reactInternalMemoizedMergedChildContext=e,ft(Zt),ft(Ht),ht(Ht,e)):ft(Zt),ht(Zt,n)}var $n=null,Yo=!1,Ma=!1;function Vd(e){$n===null?$n=[e]:$n.push(e)}function bg(e){Yo=!0,Vd(e)}function yr(){if(!Ma&&$n!==null){Ma=!0;var e=0,t=ut;try{var n=$n;for(ut=1;e<n.length;e++){var s=n[e];do s=s(!0);while(s!==null)}$n=null,Yo=!1}catch(c){throw $n!==null&&($n=$n.slice(e+1)),_d(au,yr),c}finally{ut=t,Ma=!1}}return null}var ns=[],rs=0,Ro=null,vo=0,_n=[],gn=0,br=null,Wn=1,qn="";function vr(e,t){ns[rs++]=vo,ns[rs++]=Ro,Ro=e,vo=t}function jd(e,t,n){_n[gn++]=Wn,_n[gn++]=qn,_n[gn++]=br,br=e;var s=Wn;e=qn;var c=32-An(s)-1;s&=~(1<<c),n+=1;var o=32-An(t)+c;if(30<o){var h=c-c%5;o=(s&(1<<h)-1).toString(32),s>>=h,c-=h,Wn=1<<32-An(t)+c|n<<c|s,qn=o+e}else Wn=1<<o|n<<c|s,qn=e}function gu(e){e.return!==null&&(vr(e,1),jd(e,1,0))}function mu(e){for(;e===Ro;)Ro=ns[--rs],ns[rs]=null,vo=ns[--rs],ns[rs]=null;for(;e===br;)br=_n[--gn],_n[gn]=null,qn=_n[--gn],_n[gn]=null,Wn=_n[--gn],_n[gn]=null}var an=null,on=null,gt=!1,On=null;function Hd(e,t){var n=En(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function qc(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,an=e,on=cr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,an=e,on=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=br!==null?{id:Wn,overflow:qn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=En(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,an=e,on=null,!0):!1;default:return!1}}function Tl(e){return(e.mode&1)!==0&&(e.flags&128)===0}function yl(e){if(gt){var t=on;if(t){var n=t;if(!qc(e,t)){if(Tl(e))throw Error(Me(418));t=cr(n.nextSibling);var s=an;t&&qc(e,t)?Hd(s,n):(e.flags=e.flags&-4097|2,gt=!1,an=e)}}else{if(Tl(e))throw Error(Me(418));e.flags=e.flags&-4097|2,gt=!1,an=e}}}function Vc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;an=e}function Wi(e){if(e!==an)return!1;if(!gt)return Vc(e),gt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!gl(e.type,e.memoizedProps)),t&&(t=on)){if(Tl(e))throw Yd(),Error(Me(418));for(;t;)Hd(e,t),t=cr(t.nextSibling)}if(Vc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Me(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){on=cr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}on=null}}else on=an?cr(e.stateNode.nextSibling):null;return!0}function Yd(){for(var e=on;e;)e=cr(e.nextSibling)}function _s(){on=an=null,gt=!1}function Eu(e){On===null?On=[e]:On.push(e)}var Lg=Kn.ReactCurrentBatchConfig;function Ls(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(Me(309));var s=n.stateNode}if(!s)throw Error(Me(147,e));var c=s,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(h){var r=c.refs;h===null?delete r[o]:r[o]=h},t._stringRef=o,t)}if(typeof e!="string")throw Error(Me(284));if(!n._owner)throw Error(Me(290,e))}return e}function qi(e,t){throw e=Object.prototype.toString.call(t),Error(Me(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function jc(e){var t=e._init;return t(e._payload)}function zd(e){function t(g,m){if(e){var T=g.deletions;T===null?(g.deletions=[m],g.flags|=16):T.push(m)}}function n(g,m){if(!e)return null;for(;m!==null;)t(g,m),m=m.sibling;return null}function s(g,m){for(g=new Map;m!==null;)m.key!==null?g.set(m.key,m):g.set(m.index,m),m=m.sibling;return g}function c(g,m){return g=fr(g,m),g.index=0,g.sibling=null,g}function o(g,m,T){return g.index=T,e?(T=g.alternate,T!==null?(T=T.index,T<m?(g.flags|=2,m):T):(g.flags|=2,m)):(g.flags|=1048576,m)}function h(g){return e&&g.alternate===null&&(g.flags|=2),g}function r(g,m,T,y){return m===null||m.tag!==6?(m=Ba(T,g.mode,y),m.return=g,m):(m=c(m,T),m.return=g,m)}function a(g,m,T,y){var E=T.type;return E===Kr?l(g,m,T.props.children,y,T.key):m!==null&&(m.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===er&&jc(E)===m.type)?(y=c(m,T.props),y.ref=Ls(g,m,T),y.return=g,y):(y=ao(T.type,T.key,T.props,null,g.mode,y),y.ref=Ls(g,m,T),y.return=g,y)}function u(g,m,T,y){return m===null||m.tag!==4||m.stateNode.containerInfo!==T.containerInfo||m.stateNode.implementation!==T.implementation?(m=Ga(T,g.mode,y),m.return=g,m):(m=c(m,T.children||[]),m.return=g,m)}function l(g,m,T,y,E){return m===null||m.tag!==7?(m=Dr(T,g.mode,y,E),m.return=g,m):(m=c(m,T),m.return=g,m)}function d(g,m,T){if(typeof m=="string"&&m!==""||typeof m=="number")return m=Ba(""+m,g.mode,T),m.return=g,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Mi:return T=ao(m.type,m.key,m.props,null,g.mode,T),T.ref=Ls(g,null,m),T.return=g,T;case Qr:return m=Ga(m,g.mode,T),m.return=g,m;case er:var y=m._init;return d(g,y(m._payload),T)}if(Bs(m)||ws(m))return m=Dr(m,g.mode,T,null),m.return=g,m;qi(g,m)}return null}function _(g,m,T,y){var E=m!==null?m.key:null;if(typeof T=="string"&&T!==""||typeof T=="number")return E!==null?null:r(g,m,""+T,y);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case Mi:return T.key===E?a(g,m,T,y):null;case Qr:return T.key===E?u(g,m,T,y):null;case er:return E=T._init,_(g,m,E(T._payload),y)}if(Bs(T)||ws(T))return E!==null?null:l(g,m,T,y,null);qi(g,T)}return null}function p(g,m,T,y,E){if(typeof y=="string"&&y!==""||typeof y=="number")return g=g.get(T)||null,r(m,g,""+y,E);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Mi:return g=g.get(y.key===null?T:y.key)||null,a(m,g,y,E);case Qr:return g=g.get(y.key===null?T:y.key)||null,u(m,g,y,E);case er:var I=y._init;return p(g,m,T,I(y._payload),E)}if(Bs(y)||ws(y))return g=g.get(T)||null,l(m,g,y,E,null);qi(m,y)}return null}function f(g,m,T,y){for(var E=null,I=null,N=m,A=m=0,L=null;N!==null&&A<T.length;A++){N.index>A?(L=N,N=null):L=N.sibling;var D=_(g,N,T[A],y);if(D===null){N===null&&(N=L);break}e&&N&&D.alternate===null&&t(g,N),m=o(D,m,A),I===null?E=D:I.sibling=D,I=D,N=L}if(A===T.length)return n(g,N),gt&&vr(g,A),E;if(N===null){for(;A<T.length;A++)N=d(g,T[A],y),N!==null&&(m=o(N,m,A),I===null?E=N:I.sibling=N,I=N);return gt&&vr(g,A),E}for(N=s(g,N);A<T.length;A++)L=p(N,g,A,T[A],y),L!==null&&(e&&L.alternate!==null&&N.delete(L.key===null?A:L.key),m=o(L,m,A),I===null?E=L:I.sibling=L,I=L);return e&&N.forEach(function(q){return t(g,q)}),gt&&vr(g,A),E}function S(g,m,T,y){var E=ws(T);if(typeof E!="function")throw Error(Me(150));if(T=E.call(T),T==null)throw Error(Me(151));for(var I=E=null,N=m,A=m=0,L=null,D=T.next();N!==null&&!D.done;A++,D=T.next()){N.index>A?(L=N,N=null):L=N.sibling;var q=_(g,N,D.value,y);if(q===null){N===null&&(N=L);break}e&&N&&q.alternate===null&&t(g,N),m=o(q,m,A),I===null?E=q:I.sibling=q,I=q,N=L}if(D.done)return n(g,N),gt&&vr(g,A),E;if(N===null){for(;!D.done;A++,D=T.next())D=d(g,D.value,y),D!==null&&(m=o(D,m,A),I===null?E=D:I.sibling=D,I=D);return gt&&vr(g,A),E}for(N=s(g,N);!D.done;A++,D=T.next())D=p(N,g,A,D.value,y),D!==null&&(e&&D.alternate!==null&&N.delete(D.key===null?A:D.key),m=o(D,m,A),I===null?E=D:I.sibling=D,I=D);return e&&N.forEach(function(Y){return t(g,Y)}),gt&&vr(g,A),E}function C(g,m,T,y){if(typeof T=="object"&&T!==null&&T.type===Kr&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case Mi:e:{for(var E=T.key,I=m;I!==null;){if(I.key===E){if(E=T.type,E===Kr){if(I.tag===7){n(g,I.sibling),m=c(I,T.props.children),m.return=g,g=m;break e}}else if(I.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===er&&jc(E)===I.type){n(g,I.sibling),m=c(I,T.props),m.ref=Ls(g,I,T),m.return=g,g=m;break e}n(g,I);break}else t(g,I);I=I.sibling}T.type===Kr?(m=Dr(T.props.children,g.mode,y,T.key),m.return=g,g=m):(y=ao(T.type,T.key,T.props,null,g.mode,y),y.ref=Ls(g,m,T),y.return=g,g=y)}return h(g);case Qr:e:{for(I=T.key;m!==null;){if(m.key===I)if(m.tag===4&&m.stateNode.containerInfo===T.containerInfo&&m.stateNode.implementation===T.implementation){n(g,m.sibling),m=c(m,T.children||[]),m.return=g,g=m;break e}else{n(g,m);break}else t(g,m);m=m.sibling}m=Ga(T,g.mode,y),m.return=g,g=m}return h(g);case er:return I=T._init,C(g,m,I(T._payload),y)}if(Bs(T))return f(g,m,T,y);if(ws(T))return S(g,m,T,y);qi(g,T)}return typeof T=="string"&&T!==""||typeof T=="number"?(T=""+T,m!==null&&m.tag===6?(n(g,m.sibling),m=c(m,T),m.return=g,g=m):(n(g,m),m=Ba(T,g.mode,y),m.return=g,g=m),h(g)):n(g,m)}return C}var gs=zd(!0),Qd=zd(!1),No=Tr(null),Oo=null,ss=null,Su=null;function Tu(){Su=ss=Oo=null}function yu(e){var t=No.current;ft(No),e._currentValue=t}function Il(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function hs(e,t){Oo=e,Su=ss=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Jt=!0),e.firstContext=null)}function Tn(e){var t=e._currentValue;if(Su!==e)if(e={context:e,memoizedValue:t,next:null},ss===null){if(Oo===null)throw Error(Me(308));ss=e,Oo.dependencies={lanes:0,firstContext:e}}else ss=ss.next=e;return t}var Ar=null;function Iu(e){Ar===null?Ar=[e]:Ar.push(e)}function Kd(e,t,n,s){var c=t.interleaved;return c===null?(n.next=n,Iu(t)):(n.next=c.next,c.next=n),t.interleaved=n,Yn(e,s)}function Yn(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}var tr=!1;function Cu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xd(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Vn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function hr(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,it&2){var c=s.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),s.pending=t,Yn(e,n)}return c=s.interleaved,c===null?(t.next=t,Iu(s)):(t.next=c.next,c.next=t),s.interleaved=t,Yn(e,n)}function to(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,lu(e,n)}}function Hc(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var c=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var h={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?c=o=h:o=o.next=h,n=n.next}while(n!==null);o===null?c=o=t:o=o.next=t}else c=o=t;n={baseState:s.baseState,firstBaseUpdate:c,lastBaseUpdate:o,shared:s.shared,effects:s.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ao(e,t,n,s){var c=e.updateQueue;tr=!1;var o=c.firstBaseUpdate,h=c.lastBaseUpdate,r=c.shared.pending;if(r!==null){c.shared.pending=null;var a=r,u=a.next;a.next=null,h===null?o=u:h.next=u,h=a;var l=e.alternate;l!==null&&(l=l.updateQueue,r=l.lastBaseUpdate,r!==h&&(r===null?l.firstBaseUpdate=u:r.next=u,l.lastBaseUpdate=a))}if(o!==null){var d=c.baseState;h=0,l=u=a=null,r=o;do{var _=r.lane,p=r.eventTime;if((s&_)===_){l!==null&&(l=l.next={eventTime:p,lane:0,tag:r.tag,payload:r.payload,callback:r.callback,next:null});e:{var f=e,S=r;switch(_=t,p=n,S.tag){case 1:if(f=S.payload,typeof f=="function"){d=f.call(p,d,_);break e}d=f;break e;case 3:f.flags=f.flags&-65537|128;case 0:if(f=S.payload,_=typeof f=="function"?f.call(p,d,_):f,_==null)break e;d=St({},d,_);break e;case 2:tr=!0}}r.callback!==null&&r.lane!==0&&(e.flags|=64,_=c.effects,_===null?c.effects=[r]:_.push(r))}else p={eventTime:p,lane:_,tag:r.tag,payload:r.payload,callback:r.callback,next:null},l===null?(u=l=p,a=d):l=l.next=p,h|=_;if(r=r.next,r===null){if(r=c.shared.pending,r===null)break;_=r,r=_.next,_.next=null,c.lastBaseUpdate=_,c.shared.pending=null}}while(!0);if(l===null&&(a=d),c.baseState=a,c.firstBaseUpdate=u,c.lastBaseUpdate=l,t=c.shared.interleaved,t!==null){c=t;do h|=c.lane,c=c.next;while(c!==t)}else o===null&&(c.shared.lanes=0);Ur|=h,e.lanes=h,e.memoizedState=d}}function Yc(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var s=e[t],c=s.callback;if(c!==null){if(s.callback=null,s=n,typeof c!="function")throw Error(Me(191,c));c.call(s)}}}var yi={},xn=Tr(yi),ui=Tr(yi),ci=Tr(yi);function wr(e){if(e===yi)throw Error(Me(174));return e}function Ru(e,t){switch(ht(ci,t),ht(ui,e),ht(xn,yi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:nl(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=nl(t,e)}ft(xn),ht(xn,t)}function ms(){ft(xn),ft(ui),ft(ci)}function Jd(e){wr(ci.current);var t=wr(xn.current),n=nl(t,e.type);t!==n&&(ht(ui,e),ht(xn,n))}function vu(e){ui.current===e&&(ft(xn),ft(ui))}var mt=Tr(0);function wo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ba=[];function Nu(){for(var e=0;e<ba.length;e++)ba[e]._workInProgressVersionPrimary=null;ba.length=0}var no=Kn.ReactCurrentDispatcher,La=Kn.ReactCurrentBatchConfig,Lr=0,Et=null,bt=null,Ut=null,Po=!1,zs=!1,hi=0,Ug=0;function qt(){throw Error(Me(321))}function Ou(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Pn(e[n],t[n]))return!1;return!0}function Au(e,t,n,s,c,o){if(Lr=o,Et=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,no.current=e===null||e.memoizedState===null?Bg:Gg,e=n(s,c),zs){o=0;do{if(zs=!1,hi=0,25<=o)throw Error(Me(301));o+=1,Ut=bt=null,t.updateQueue=null,no.current=$g,e=n(s,c)}while(zs)}if(no.current=Do,t=bt!==null&&bt.next!==null,Lr=0,Ut=bt=Et=null,Po=!1,t)throw Error(Me(300));return e}function wu(){var e=hi!==0;return hi=0,e}function bn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?Et.memoizedState=Ut=e:Ut=Ut.next=e,Ut}function yn(){if(bt===null){var e=Et.alternate;e=e!==null?e.memoizedState:null}else e=bt.next;var t=Ut===null?Et.memoizedState:Ut.next;if(t!==null)Ut=t,bt=e;else{if(e===null)throw Error(Me(310));bt=e,e={memoizedState:bt.memoizedState,baseState:bt.baseState,baseQueue:bt.baseQueue,queue:bt.queue,next:null},Ut===null?Et.memoizedState=Ut=e:Ut=Ut.next=e}return Ut}function di(e,t){return typeof t=="function"?t(e):t}function Ua(e){var t=yn(),n=t.queue;if(n===null)throw Error(Me(311));n.lastRenderedReducer=e;var s=bt,c=s.baseQueue,o=n.pending;if(o!==null){if(c!==null){var h=c.next;c.next=o.next,o.next=h}s.baseQueue=c=o,n.pending=null}if(c!==null){o=c.next,s=s.baseState;var r=h=null,a=null,u=o;do{var l=u.lane;if((Lr&l)===l)a!==null&&(a=a.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),s=u.hasEagerState?u.eagerState:e(s,u.action);else{var d={lane:l,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};a===null?(r=a=d,h=s):a=a.next=d,Et.lanes|=l,Ur|=l}u=u.next}while(u!==null&&u!==o);a===null?h=s:a.next=r,Pn(s,t.memoizedState)||(Jt=!0),t.memoizedState=s,t.baseState=h,t.baseQueue=a,n.lastRenderedState=s}if(e=n.interleaved,e!==null){c=e;do o=c.lane,Et.lanes|=o,Ur|=o,c=c.next;while(c!==e)}else c===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function xa(e){var t=yn(),n=t.queue;if(n===null)throw Error(Me(311));n.lastRenderedReducer=e;var s=n.dispatch,c=n.pending,o=t.memoizedState;if(c!==null){n.pending=null;var h=c=c.next;do o=e(o,h.action),h=h.next;while(h!==c);Pn(o,t.memoizedState)||(Jt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,s]}function Zd(){}function ep(e,t){var n=Et,s=yn(),c=t(),o=!Pn(s.memoizedState,c);if(o&&(s.memoizedState=c,Jt=!0),s=s.queue,Pu(rp.bind(null,n,s,e),[e]),s.getSnapshot!==t||o||Ut!==null&&Ut.memoizedState.tag&1){if(n.flags|=2048,pi(9,np.bind(null,n,s,c,t),void 0,null),xt===null)throw Error(Me(349));Lr&30||tp(n,t,c)}return c}function tp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Et.updateQueue,t===null?(t={lastEffect:null,stores:null},Et.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function np(e,t,n,s){t.value=n,t.getSnapshot=s,sp(t)&&ip(e)}function rp(e,t,n){return n(function(){sp(t)&&ip(e)})}function sp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Pn(e,n)}catch{return!0}}function ip(e){var t=Yn(e,1);t!==null&&wn(t,e,1,-1)}function zc(e){var t=bn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:di,lastRenderedState:e},t.queue=e,e=e.dispatch=kg.bind(null,Et,e),[t.memoizedState,e]}function pi(e,t,n,s){return e={tag:e,create:t,destroy:n,deps:s,next:null},t=Et.updateQueue,t===null?(t={lastEffect:null,stores:null},Et.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e)),e}function op(){return yn().memoizedState}function ro(e,t,n,s){var c=bn();Et.flags|=e,c.memoizedState=pi(1|t,n,void 0,s===void 0?null:s)}function zo(e,t,n,s){var c=yn();s=s===void 0?null:s;var o=void 0;if(bt!==null){var h=bt.memoizedState;if(o=h.destroy,s!==null&&Ou(s,h.deps)){c.memoizedState=pi(t,n,o,s);return}}Et.flags|=e,c.memoizedState=pi(1|t,n,o,s)}function Qc(e,t){return ro(8390656,8,e,t)}function Pu(e,t){return zo(2048,8,e,t)}function ap(e,t){return zo(4,2,e,t)}function lp(e,t){return zo(4,4,e,t)}function up(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function cp(e,t,n){return n=n!=null?n.concat([e]):null,zo(4,4,up.bind(null,t,e),n)}function Du(){}function hp(e,t){var n=yn();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&Ou(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function dp(e,t){var n=yn();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&Ou(t,s[1])?s[0]:(e=e(),n.memoizedState=[e,t],e)}function pp(e,t,n){return Lr&21?(Pn(n,t)||(n=Ed(),Et.lanes|=n,Ur|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Jt=!0),e.memoizedState=n)}function xg(e,t){var n=ut;ut=n!==0&&4>n?n:4,e(!0);var s=La.transition;La.transition={};try{e(!1),t()}finally{ut=n,La.transition=s}}function fp(){return yn().memoizedState}function Fg(e,t,n){var s=pr(e);if(n={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null},_p(e))gp(t,n);else if(n=Kd(e,t,n,s),n!==null){var c=zt();wn(n,e,s,c),mp(n,t,s)}}function kg(e,t,n){var s=pr(e),c={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null};if(_p(e))gp(t,c);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var h=t.lastRenderedState,r=o(h,n);if(c.hasEagerState=!0,c.eagerState=r,Pn(r,h)){var a=t.interleaved;a===null?(c.next=c,Iu(t)):(c.next=a.next,a.next=c),t.interleaved=c;return}}catch{}finally{}n=Kd(e,t,c,s),n!==null&&(c=zt(),wn(n,e,s,c),mp(n,t,s))}}function _p(e){var t=e.alternate;return e===Et||t!==null&&t===Et}function gp(e,t){zs=Po=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function mp(e,t,n){if(n&4194240){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,lu(e,n)}}var Do={readContext:Tn,useCallback:qt,useContext:qt,useEffect:qt,useImperativeHandle:qt,useInsertionEffect:qt,useLayoutEffect:qt,useMemo:qt,useReducer:qt,useRef:qt,useState:qt,useDebugValue:qt,useDeferredValue:qt,useTransition:qt,useMutableSource:qt,useSyncExternalStore:qt,useId:qt,unstable_isNewReconciler:!1},Bg={readContext:Tn,useCallback:function(e,t){return bn().memoizedState=[e,t===void 0?null:t],e},useContext:Tn,useEffect:Qc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ro(4194308,4,up.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ro(4194308,4,e,t)},useInsertionEffect:function(e,t){return ro(4,2,e,t)},useMemo:function(e,t){var n=bn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var s=bn();return t=n!==void 0?n(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=Fg.bind(null,Et,e),[s.memoizedState,e]},useRef:function(e){var t=bn();return e={current:e},t.memoizedState=e},useState:zc,useDebugValue:Du,useDeferredValue:function(e){return bn().memoizedState=e},useTransition:function(){var e=zc(!1),t=e[0];return e=xg.bind(null,e[1]),bn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var s=Et,c=bn();if(gt){if(n===void 0)throw Error(Me(407));n=n()}else{if(n=t(),xt===null)throw Error(Me(349));Lr&30||tp(s,t,n)}c.memoizedState=n;var o={value:n,getSnapshot:t};return c.queue=o,Qc(rp.bind(null,s,o,e),[e]),s.flags|=2048,pi(9,np.bind(null,s,o,n,t),void 0,null),n},useId:function(){var e=bn(),t=xt.identifierPrefix;if(gt){var n=qn,s=Wn;n=(s&~(1<<32-An(s)-1)).toString(32)+n,t=":"+t+"R"+n,n=hi++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Ug++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Gg={readContext:Tn,useCallback:hp,useContext:Tn,useEffect:Pu,useImperativeHandle:cp,useInsertionEffect:ap,useLayoutEffect:lp,useMemo:dp,useReducer:Ua,useRef:op,useState:function(){return Ua(di)},useDebugValue:Du,useDeferredValue:function(e){var t=yn();return pp(t,bt.memoizedState,e)},useTransition:function(){var e=Ua(di)[0],t=yn().memoizedState;return[e,t]},useMutableSource:Zd,useSyncExternalStore:ep,useId:fp,unstable_isNewReconciler:!1},$g={readContext:Tn,useCallback:hp,useContext:Tn,useEffect:Pu,useImperativeHandle:cp,useInsertionEffect:ap,useLayoutEffect:lp,useMemo:dp,useReducer:xa,useRef:op,useState:function(){return xa(di)},useDebugValue:Du,useDeferredValue:function(e){var t=yn();return bt===null?t.memoizedState=e:pp(t,bt.memoizedState,e)},useTransition:function(){var e=xa(di)[0],t=yn().memoizedState;return[e,t]},useMutableSource:Zd,useSyncExternalStore:ep,useId:fp,unstable_isNewReconciler:!1};function Rn(e,t){if(e&&e.defaultProps){t=St({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Cl(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:St({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Qo={isMounted:function(e){return(e=e._reactInternals)?kr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var s=zt(),c=pr(e),o=Vn(s,c);o.payload=t,n!=null&&(o.callback=n),t=hr(e,o,c),t!==null&&(wn(t,e,c,s),to(t,e,c))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=zt(),c=pr(e),o=Vn(s,c);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=hr(e,o,c),t!==null&&(wn(t,e,c,s),to(t,e,c))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=zt(),s=pr(e),c=Vn(n,s);c.tag=2,t!=null&&(c.callback=t),t=hr(e,c,s),t!==null&&(wn(t,e,s,n),to(t,e,s))}};function Kc(e,t,n,s,c,o,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,o,h):t.prototype&&t.prototype.isPureReactComponent?!ii(n,s)||!ii(c,o):!0}function Ep(e,t,n){var s=!1,c=Er,o=t.contextType;return typeof o=="object"&&o!==null?o=Tn(o):(c=en(t)?Mr:Ht.current,s=t.contextTypes,o=(s=s!=null)?fs(e,c):Er),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Qo,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=c,e.__reactInternalMemoizedMaskedChildContext=o),t}function Xc(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&Qo.enqueueReplaceState(t,t.state,null)}function Rl(e,t,n,s){var c=e.stateNode;c.props=n,c.state=e.memoizedState,c.refs={},Cu(e);var o=t.contextType;typeof o=="object"&&o!==null?c.context=Tn(o):(o=en(t)?Mr:Ht.current,c.context=fs(e,o)),c.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(Cl(e,t,o,n),c.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(t=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),t!==c.state&&Qo.enqueueReplaceState(c,c.state,null),Ao(e,n,c,s),c.state=e.memoizedState),typeof c.componentDidMount=="function"&&(e.flags|=4194308)}function Es(e,t){try{var n="",s=t;do n+=__(s),s=s.return;while(s);var c=n}catch(o){c=`
|
|
39
39
|
Error generating stack: `+o.message+`
|
|
40
|
-
`+o.stack}return{value:e,source:t,stack:c,digest:null}}function Fa(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function vl(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var kg=typeof WeakMap=="function"?WeakMap:Map;function Sp(e,t,n){n=Vn(-1,n),n.tag=3,n.payload={element:null};var s=t.value;return n.callback=function(){bo||(bo=!0,Ul=s),vl(e,t)},n}function Tp(e,t,n){n=Vn(-1,n),n.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var c=t.value;n.payload=function(){return s(c)},n.callback=function(){vl(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){vl(e,t),typeof s!="function"&&(dr===null?dr=new Set([this]):dr.add(this));var h=t.stack;this.componentDidCatch(t.value,{componentStack:h!==null?h:""})}),n}function Xc(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new kg;var c=new Set;s.set(t,c)}else c=s.get(t),c===void 0&&(c=new Set,s.set(t,c));c.has(n)||(c.add(n),e=Jg.bind(null,e,t,n),t.then(e,e))}function Jc(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Zc(e,t,n,s,c){return e.mode&1?(e.flags|=65536,e.lanes=c,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Vn(-1,1),t.tag=2,hr(n,t,1))),n.lanes|=1),e)}var Bg=Kn.ReactCurrentOwner,Jt=!1;function Yt(e,t,n,s){t.child=e===null?Qd(t,null,n,s):gs(t,e.child,n,s)}function eh(e,t,n,s,c){n=n.render;var o=t.ref;return hs(t,c),s=Ou(e,t,n,s,o,c),n=Au(),e!==null&&!Jt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~c,zn(e,t,c)):(gt&&n&&_u(t),t.flags|=1,Yt(e,t,s,c),t.child)}function th(e,t,n,s,c){if(e===null){var o=n.type;return typeof o=="function"&&!ku(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,yp(e,t,o,s,c)):(e=ao(n.type,null,s,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&c)){var h=o.memoizedProps;if(n=n.compare,n=n!==null?n:ii,n(h,s)&&e.ref===t.ref)return zn(e,t,c)}return t.flags|=1,e=fr(o,s),e.ref=t.ref,e.return=t,t.child=e}function yp(e,t,n,s,c){if(e!==null){var o=e.memoizedProps;if(ii(o,s)&&e.ref===t.ref)if(Jt=!1,t.pendingProps=s=o,(e.lanes&c)!==0)e.flags&131072&&(Jt=!0);else return t.lanes=e.lanes,zn(e,t,c)}return Nl(e,t,n,s,c)}function Ip(e,t,n){var s=t.pendingProps,c=s.children,o=e!==null?e.memoizedState:null;if(s.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ht(os,sn),sn|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ht(os,sn),sn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=o!==null?o.baseLanes:n,ht(os,sn),sn|=s}else o!==null?(s=o.baseLanes|n,t.memoizedState=null):s=n,ht(os,sn),sn|=s;return Yt(e,t,c,n),t.child}function Cp(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Nl(e,t,n,s,c){var o=en(n)?Mr:Ht.current;return o=fs(t,o),hs(t,c),n=Ou(e,t,n,s,o,c),s=Au(),e!==null&&!Jt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~c,zn(e,t,c)):(gt&&s&&_u(t),t.flags|=1,Yt(e,t,n,c),t.child)}function nh(e,t,n,s,c){if(en(n)){var o=!0;Co(t)}else o=!1;if(hs(t,c),t.stateNode===null)so(e,t),Ep(t,n,s),Rl(t,n,s,c),s=!0;else if(e===null){var h=t.stateNode,r=t.memoizedProps;h.props=r;var a=h.context,u=n.contextType;typeof u=="object"&&u!==null?u=Tn(u):(u=en(n)?Mr:Ht.current,u=fs(t,u));var l=n.getDerivedStateFromProps,d=typeof l=="function"||typeof h.getSnapshotBeforeUpdate=="function";d||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(r!==s||a!==u)&&Kc(t,h,s,u),tr=!1;var f=t.memoizedState;h.state=f,Ao(t,s,h,c),a=t.memoizedState,r!==s||f!==a||Zt.current||tr?(typeof l=="function"&&(Cl(t,n,l,s),a=t.memoizedState),(r=tr||Qc(t,n,r,s,f,a,u))?(d||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=a),h.props=s,h.state=a,h.context=u,s=r):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{h=t.stateNode,Xd(e,t),r=t.memoizedProps,u=t.type===t.elementType?r:Rn(t.type,r),h.props=u,d=t.pendingProps,f=h.context,a=n.contextType,typeof a=="object"&&a!==null?a=Tn(a):(a=en(n)?Mr:Ht.current,a=fs(t,a));var p=n.getDerivedStateFromProps;(l=typeof p=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(r!==d||f!==a)&&Kc(t,h,s,a),tr=!1,f=t.memoizedState,h.state=f,Ao(t,s,h,c);var _=t.memoizedState;r!==d||f!==_||Zt.current||tr?(typeof p=="function"&&(Cl(t,n,p,s),_=t.memoizedState),(u=tr||Qc(t,n,u,s,f,_,a)||!1)?(l||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(s,_,a),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(s,_,a)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||r===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||r===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=_),h.props=s,h.state=_,h.context=a,s=u):(typeof h.componentDidUpdate!="function"||r===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||r===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),s=!1)}return Ol(e,t,n,s,o,c)}function Ol(e,t,n,s,c,o){Cp(e,t);var h=(t.flags&128)!==0;if(!s&&!h)return c&&$c(t,n,!1),zn(e,t,o);s=t.stateNode,Bg.current=t;var r=h&&typeof n.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&h?(t.child=gs(t,e.child,null,o),t.child=gs(t,null,r,o)):Yt(e,t,r,o),t.memoizedState=s.state,c&&$c(t,n,!0),t.child}function Rp(e){var t=e.stateNode;t.pendingContext?Gc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Gc(e,t.context,!1),Cu(e,t.containerInfo)}function rh(e,t,n,s,c){return _s(),mu(c),t.flags|=256,Yt(e,t,n,s),t.child}var Al={dehydrated:null,treeContext:null,retryLane:0};function wl(e){return{baseLanes:e,cachePool:null,transitions:null}}function vp(e,t,n){var s=t.pendingProps,c=mt.current,o=!1,h=(t.flags&128)!==0,r;if((r=h)||(r=e!==null&&e.memoizedState===null?!1:(c&2)!==0),r?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(c|=1),ht(mt,c&1),e===null)return yl(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(h=s.children,e=s.fallback,o?(s=t.mode,o=t.child,h={mode:"hidden",children:h},!(s&1)&&o!==null?(o.childLanes=0,o.pendingProps=h):o=Jo(h,s,0,null),e=Dr(e,s,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=wl(n),t.memoizedState=Al,e):Du(t,h));if(c=e.memoizedState,c!==null&&(r=c.dehydrated,r!==null))return Gg(e,t,h,s,r,c,n);if(o){o=s.fallback,h=t.mode,c=e.child,r=c.sibling;var a={mode:"hidden",children:s.children};return!(h&1)&&t.child!==c?(s=t.child,s.childLanes=0,s.pendingProps=a,t.deletions=null):(s=fr(c,a),s.subtreeFlags=c.subtreeFlags&14680064),r!==null?o=fr(r,o):(o=Dr(o,h,n,null),o.flags|=2),o.return=t,s.return=t,s.sibling=o,t.child=s,s=o,o=t.child,h=e.child.memoizedState,h=h===null?wl(n):{baseLanes:h.baseLanes|n,cachePool:null,transitions:h.transitions},o.memoizedState=h,o.childLanes=e.childLanes&~n,t.memoizedState=Al,s}return o=e.child,e=o.sibling,s=fr(o,{mode:"visible",children:s.children}),!(t.mode&1)&&(s.lanes=n),s.return=t,s.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=s,t.memoizedState=null,s}function Du(e,t){return t=Jo({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Vi(e,t,n,s){return s!==null&&mu(s),gs(t,e.child,null,n),e=Du(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Gg(e,t,n,s,c,o,h){if(n)return t.flags&256?(t.flags&=-257,s=Fa(Error(Me(422))),Vi(e,t,h,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=s.fallback,c=t.mode,s=Jo({mode:"visible",children:s.children},c,0,null),o=Dr(o,c,h,null),o.flags|=2,s.return=t,o.return=t,s.sibling=o,t.child=s,t.mode&1&&gs(t,e.child,null,h),t.child.memoizedState=wl(h),t.memoizedState=Al,o);if(!(t.mode&1))return Vi(e,t,h,null);if(c.data==="$!"){if(s=c.nextSibling&&c.nextSibling.dataset,s)var r=s.dgst;return s=r,o=Error(Me(419)),s=Fa(o,s,void 0),Vi(e,t,h,s)}if(r=(h&e.childLanes)!==0,Jt||r){if(s=xt,s!==null){switch(h&-h){case 4:c=2;break;case 16:c=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:c=32;break;case 536870912:c=268435456;break;default:c=0}c=c&(s.suspendedLanes|h)?0:c,c!==0&&c!==o.retryLane&&(o.retryLane=c,Yn(e,c),wn(s,e,c,-1))}return Fu(),s=Fa(Error(Me(421))),Vi(e,t,h,s)}return c.data==="$?"?(t.flags|=128,t.child=e.child,t=Zg.bind(null,e),c._reactRetry=t,null):(e=o.treeContext,on=cr(c.nextSibling),an=t,gt=!0,On=null,e!==null&&(_n[gn++]=Wn,_n[gn++]=qn,_n[gn++]=br,Wn=e.id,qn=e.overflow,br=t),t=Du(t,s.children),t.flags|=4096,t)}function sh(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Il(e.return,t,n)}function ka(e,t,n,s,c){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:c}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=s,o.tail=n,o.tailMode=c)}function Np(e,t,n){var s=t.pendingProps,c=s.revealOrder,o=s.tail;if(Yt(e,t,s.children,n),s=mt.current,s&2)s=s&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&sh(e,n,t);else if(e.tag===19)sh(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}s&=1}if(ht(mt,s),!(t.mode&1))t.memoizedState=null;else switch(c){case"forwards":for(n=t.child,c=null;n!==null;)e=n.alternate,e!==null&&wo(e)===null&&(c=n),n=n.sibling;n=c,n===null?(c=t.child,t.child=null):(c=n.sibling,n.sibling=null),ka(t,!1,c,n,o);break;case"backwards":for(n=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&wo(e)===null){t.child=c;break}e=c.sibling,c.sibling=n,n=c,c=e}ka(t,!0,n,null,o);break;case"together":ka(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function so(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function zn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ur|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Me(153));if(t.child!==null){for(e=t.child,n=fr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=fr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function $g(e,t,n){switch(t.tag){case 3:Rp(t),_s();break;case 5:Jd(t);break;case 1:en(t.type)&&Co(t);break;case 4:Cu(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,c=t.memoizedProps.value;ht(No,s._currentValue),s._currentValue=c;break;case 13:if(s=t.memoizedState,s!==null)return s.dehydrated!==null?(ht(mt,mt.current&1),t.flags|=128,null):n&t.child.childLanes?vp(e,t,n):(ht(mt,mt.current&1),e=zn(e,t,n),e!==null?e.sibling:null);ht(mt,mt.current&1);break;case 19:if(s=(n&t.childLanes)!==0,e.flags&128){if(s)return Np(e,t,n);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),ht(mt,mt.current),s)break;return null;case 22:case 23:return t.lanes=0,Ip(e,t,n)}return zn(e,t,n)}var Op,Pl,Ap,wp;Op=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&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.sibling.return=n.return,n=n.sibling}};Pl=function(){};Ap=function(e,t,n,s){var c=e.memoizedProps;if(c!==s){e=t.stateNode,wr(xn.current);var o=null;switch(n){case"input":c=Ja(e,c),s=Ja(e,s),o=[];break;case"select":c=St({},c,{value:void 0}),s=St({},s,{value:void 0}),o=[];break;case"textarea":c=tl(e,c),s=tl(e,s),o=[];break;default:typeof c.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=yo)}rl(n,s);var h;n=null;for(u in c)if(!s.hasOwnProperty(u)&&c.hasOwnProperty(u)&&c[u]!=null)if(u==="style"){var r=c[u];for(h in r)r.hasOwnProperty(h)&&(n||(n={}),n[h]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Js.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in s){var a=s[u];if(r=c!=null?c[u]:void 0,s.hasOwnProperty(u)&&a!==r&&(a!=null||r!=null))if(u==="style")if(r){for(h in r)!r.hasOwnProperty(h)||a&&a.hasOwnProperty(h)||(n||(n={}),n[h]="");for(h in a)a.hasOwnProperty(h)&&r[h]!==a[h]&&(n||(n={}),n[h]=a[h])}else n||(o||(o=[]),o.push(u,n)),n=a;else u==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,r=r?r.__html:void 0,a!=null&&r!==a&&(o=o||[]).push(u,a)):u==="children"?typeof a!="string"&&typeof a!="number"||(o=o||[]).push(u,""+a):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Js.hasOwnProperty(u)?(a!=null&&u==="onScroll"&&pt("scroll",e),o||r===a||(o=[])):(o=o||[]).push(u,a))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};wp=function(e,t,n,s){n!==s&&(t.flags|=4)};function Us(e,t){if(!gt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Vt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var c=e.child;c!==null;)n|=c.lanes|c.childLanes,s|=c.subtreeFlags&14680064,s|=c.flags&14680064,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)n|=c.lanes|c.childLanes,s|=c.subtreeFlags,s|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function Wg(e,t,n){var s=t.pendingProps;switch(gu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vt(t),null;case 1:return en(t.type)&&Io(),Vt(t),null;case 3:return s=t.stateNode,ms(),ft(Zt),ft(Ht),vu(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Wi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,On!==null&&(kl(On),On=null))),Pl(e,t),Vt(t),null;case 5:Ru(t);var c=wr(ci.current);if(n=t.type,e!==null&&t.stateNode!=null)Ap(e,t,n,s,c),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!s){if(t.stateNode===null)throw Error(Me(166));return Vt(t),null}if(e=wr(xn.current),Wi(t)){s=t.stateNode,n=t.type;var o=t.memoizedProps;switch(s[Ln]=t,s[li]=o,e=(t.mode&1)!==0,n){case"dialog":pt("cancel",s),pt("close",s);break;case"iframe":case"object":case"embed":pt("load",s);break;case"video":case"audio":for(c=0;c<$s.length;c++)pt($s[c],s);break;case"source":pt("error",s);break;case"img":case"image":case"link":pt("error",s),pt("load",s);break;case"details":pt("toggle",s);break;case"input":pc(s,o),pt("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!o.multiple},pt("invalid",s);break;case"textarea":_c(s,o),pt("invalid",s)}rl(n,o),c=null;for(var h in o)if(o.hasOwnProperty(h)){var r=o[h];h==="children"?typeof r=="string"?s.textContent!==r&&(o.suppressHydrationWarning!==!0&&$i(s.textContent,r,e),c=["children",r]):typeof r=="number"&&s.textContent!==""+r&&(o.suppressHydrationWarning!==!0&&$i(s.textContent,r,e),c=["children",""+r]):Js.hasOwnProperty(h)&&r!=null&&h==="onScroll"&&pt("scroll",s)}switch(n){case"input":bi(s),fc(s,o,!0);break;case"textarea":bi(s),gc(s);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(s.onclick=yo)}s=c,t.updateQueue=s,s!==null&&(t.flags|=4)}else{h=c.nodeType===9?c:c.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=rd(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=h.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=h.createElement(n,{is:s.is}):(e=h.createElement(n),n==="select"&&(h=e,s.multiple?h.multiple=!0:s.size&&(h.size=s.size))):e=h.createElementNS(e,n),e[Ln]=t,e[li]=s,Op(e,t,!1,!1),t.stateNode=e;e:{switch(h=sl(n,s),n){case"dialog":pt("cancel",e),pt("close",e),c=s;break;case"iframe":case"object":case"embed":pt("load",e),c=s;break;case"video":case"audio":for(c=0;c<$s.length;c++)pt($s[c],e);c=s;break;case"source":pt("error",e),c=s;break;case"img":case"image":case"link":pt("error",e),pt("load",e),c=s;break;case"details":pt("toggle",e),c=s;break;case"input":pc(e,s),c=Ja(e,s),pt("invalid",e);break;case"option":c=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},c=St({},s,{value:void 0}),pt("invalid",e);break;case"textarea":_c(e,s),c=tl(e,s),pt("invalid",e);break;default:c=s}rl(n,c),r=c;for(o in r)if(r.hasOwnProperty(o)){var a=r[o];o==="style"?od(e,a):o==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&sd(e,a)):o==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&Zs(e,a):typeof a=="number"&&Zs(e,""+a):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Js.hasOwnProperty(o)?a!=null&&o==="onScroll"&&pt("scroll",e):a!=null&&tu(e,o,a,h))}switch(n){case"input":bi(e),fc(e,s,!1);break;case"textarea":bi(e),gc(e);break;case"option":s.value!=null&&e.setAttribute("value",""+mr(s.value));break;case"select":e.multiple=!!s.multiple,o=s.value,o!=null?as(e,!!s.multiple,o,!1):s.defaultValue!=null&&as(e,!!s.multiple,s.defaultValue,!0);break;default:typeof c.onClick=="function"&&(e.onclick=yo)}switch(n){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Vt(t),null;case 6:if(e&&t.stateNode!=null)wp(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(Me(166));if(n=wr(ci.current),wr(xn.current),Wi(t)){if(s=t.stateNode,n=t.memoizedProps,s[Ln]=t,(o=s.nodeValue!==n)&&(e=an,e!==null))switch(e.tag){case 3:$i(s.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&$i(s.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else s=(n.nodeType===9?n:n.ownerDocument).createTextNode(s),s[Ln]=t,t.stateNode=s}return Vt(t),null;case 13:if(ft(mt),s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(gt&&on!==null&&t.mode&1&&!(t.flags&128))Yd(),_s(),t.flags|=98560,o=!1;else if(o=Wi(t),s!==null&&s.dehydrated!==null){if(e===null){if(!o)throw Error(Me(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(Me(317));o[Ln]=t}else _s(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Vt(t),o=!1}else On!==null&&(kl(On),On=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(s=s!==null,s!==(e!==null&&e.memoizedState!==null)&&s&&(t.child.flags|=8192,t.mode&1&&(e===null||mt.current&1?Lt===0&&(Lt=3):Fu())),t.updateQueue!==null&&(t.flags|=4),Vt(t),null);case 4:return ms(),Pl(e,t),e===null&&oi(t.stateNode.containerInfo),Vt(t),null;case 10:return Tu(t.type._context),Vt(t),null;case 17:return en(t.type)&&Io(),Vt(t),null;case 19:if(ft(mt),o=t.memoizedState,o===null)return Vt(t),null;if(s=(t.flags&128)!==0,h=o.rendering,h===null)if(s)Us(o,!1);else{if(Lt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(h=wo(e),h!==null){for(t.flags|=128,Us(o,!1),s=h.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=n,n=t.child;n!==null;)o=n,e=s,o.flags&=14680066,h=o.alternate,h===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=h.childLanes,o.lanes=h.lanes,o.child=h.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=h.memoizedProps,o.memoizedState=h.memoizedState,o.updateQueue=h.updateQueue,o.type=h.type,e=h.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ht(mt,mt.current&1|2),t.child}e=e.sibling}o.tail!==null&&Ot()>Ss&&(t.flags|=128,s=!0,Us(o,!1),t.lanes=4194304)}else{if(!s)if(e=wo(h),e!==null){if(t.flags|=128,s=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Us(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!gt)return Vt(t),null}else 2*Ot()-o.renderingStartTime>Ss&&n!==1073741824&&(t.flags|=128,s=!0,Us(o,!1),t.lanes=4194304);o.isBackwards?(h.sibling=t.child,t.child=h):(n=o.last,n!==null?n.sibling=h:t.child=h,o.last=h)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ot(),t.sibling=null,n=mt.current,ht(mt,s?n&1|2:n&1),t):(Vt(t),null);case 22:case 23:return xu(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&t.mode&1?sn&1073741824&&(Vt(t),t.subtreeFlags&6&&(t.flags|=8192)):Vt(t),null;case 24:return null;case 25:return null}throw Error(Me(156,t.tag))}function qg(e,t){switch(gu(t),t.tag){case 1:return en(t.type)&&Io(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ms(),ft(Zt),ft(Ht),vu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ru(t),null;case 13:if(ft(mt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Me(340));_s()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ft(mt),null;case 4:return ms(),null;case 10:return Tu(t.type._context),null;case 22:case 23:return xu(),null;case 24:return null;default:return null}}var ji=!1,jt=!1,Vg=typeof WeakSet=="function"?WeakSet:Set,ke=null;function is(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){Rt(e,t,s)}else n.current=null}function Dl(e,t,n){try{n()}catch(s){Rt(e,t,s)}}var ih=!1;function jg(e,t){if(fl=Eo,e=Ld(),fu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var c=s.anchorOffset,o=s.focusNode;s=s.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var h=0,r=-1,a=-1,u=0,l=0,d=e,f=null;t:for(;;){for(var p;d!==n||c!==0&&d.nodeType!==3||(r=h+c),d!==o||s!==0&&d.nodeType!==3||(a=h+s),d.nodeType===3&&(h+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++u===c&&(r=h),f===o&&++l===s&&(a=h),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=r===-1||a===-1?null:{start:r,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(_l={focusedElem:e,selectionRange:n},Eo=!1,ke=t;ke!==null;)if(t=ke,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ke=e;else for(;ke!==null;){t=ke;try{var _=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var S=_.memoizedProps,C=_.memoizedState,g=t.stateNode,m=g.getSnapshotBeforeUpdate(t.elementType===t.type?S:Rn(t.type,S),C);g.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var T=t.stateNode.containerInfo;T.nodeType===1?T.textContent="":T.nodeType===9&&T.documentElement&&T.removeChild(T.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Me(163))}}catch(y){Rt(t,t.return,y)}if(e=t.sibling,e!==null){e.return=t.return,ke=e;break}ke=t.return}return _=ih,ih=!1,_}function Qs(e,t,n){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var c=s=s.next;do{if((c.tag&e)===e){var o=c.destroy;c.destroy=void 0,o!==void 0&&Dl(t,n,o)}c=c.next}while(c!==s)}}function Ko(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var s=n.create;n.destroy=s()}n=n.next}while(n!==t)}}function Ml(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Pp(e){var t=e.alternate;t!==null&&(e.alternate=null,Pp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ln],delete t[li],delete t[El],delete t[Og],delete t[Ag])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Dp(e){return e.tag===5||e.tag===3||e.tag===4}function oh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Dp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function bl(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,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=yo));else if(s!==4&&(e=e.child,e!==null))for(bl(e,t,n),e=e.sibling;e!==null;)bl(e,t,n),e=e.sibling}function Ll(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(Ll(e,t,n),e=e.sibling;e!==null;)Ll(e,t,n),e=e.sibling}var Ft=null,vn=!1;function Zn(e,t,n){for(n=n.child;n!==null;)Mp(e,t,n),n=n.sibling}function Mp(e,t,n){if(Un&&typeof Un.onCommitFiberUnmount=="function")try{Un.onCommitFiberUnmount(Wo,n)}catch{}switch(n.tag){case 5:jt||is(n,t);case 6:var s=Ft,c=vn;Ft=null,Zn(e,t,n),Ft=s,vn=c,Ft!==null&&(vn?(e=Ft,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ft.removeChild(n.stateNode));break;case 18:Ft!==null&&(vn?(e=Ft,n=n.stateNode,e.nodeType===8?Da(e.parentNode,n):e.nodeType===1&&Da(e,n),ri(e)):Da(Ft,n.stateNode));break;case 4:s=Ft,c=vn,Ft=n.stateNode.containerInfo,vn=!0,Zn(e,t,n),Ft=s,vn=c;break;case 0:case 11:case 14:case 15:if(!jt&&(s=n.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){c=s=s.next;do{var o=c,h=o.destroy;o=o.tag,h!==void 0&&(o&2||o&4)&&Dl(n,t,h),c=c.next}while(c!==s)}Zn(e,t,n);break;case 1:if(!jt&&(is(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=n.memoizedProps,s.state=n.memoizedState,s.componentWillUnmount()}catch(r){Rt(n,t,r)}Zn(e,t,n);break;case 21:Zn(e,t,n);break;case 22:n.mode&1?(jt=(s=jt)||n.memoizedState!==null,Zn(e,t,n),jt=s):Zn(e,t,n);break;default:Zn(e,t,n)}}function ah(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Vg),t.forEach(function(s){var c=em.bind(null,e,s);n.has(s)||(n.add(s),s.then(c,c))})}}function Cn(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var c=n[s];try{var o=e,h=t,r=h;e:for(;r!==null;){switch(r.tag){case 5:Ft=r.stateNode,vn=!1;break e;case 3:Ft=r.stateNode.containerInfo,vn=!0;break e;case 4:Ft=r.stateNode.containerInfo,vn=!0;break e}r=r.return}if(Ft===null)throw Error(Me(160));Mp(o,h,c),Ft=null,vn=!1;var a=c.alternate;a!==null&&(a.return=null),c.return=null}catch(u){Rt(c,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)bp(t,e),t=t.sibling}function bp(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Cn(t,e),Mn(e),s&4){try{Qs(3,e,e.return),Ko(3,e)}catch(S){Rt(e,e.return,S)}try{Qs(5,e,e.return)}catch(S){Rt(e,e.return,S)}}break;case 1:Cn(t,e),Mn(e),s&512&&n!==null&&is(n,n.return);break;case 5:if(Cn(t,e),Mn(e),s&512&&n!==null&&is(n,n.return),e.flags&32){var c=e.stateNode;try{Zs(c,"")}catch(S){Rt(e,e.return,S)}}if(s&4&&(c=e.stateNode,c!=null)){var o=e.memoizedProps,h=n!==null?n.memoizedProps:o,r=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{r==="input"&&o.type==="radio"&&o.name!=null&&td(c,o),sl(r,h);var u=sl(r,o);for(h=0;h<a.length;h+=2){var l=a[h],d=a[h+1];l==="style"?od(c,d):l==="dangerouslySetInnerHTML"?sd(c,d):l==="children"?Zs(c,d):tu(c,l,d,u)}switch(r){case"input":Za(c,o);break;case"textarea":nd(c,o);break;case"select":var f=c._wrapperState.wasMultiple;c._wrapperState.wasMultiple=!!o.multiple;var p=o.value;p!=null?as(c,!!o.multiple,p,!1):f!==!!o.multiple&&(o.defaultValue!=null?as(c,!!o.multiple,o.defaultValue,!0):as(c,!!o.multiple,o.multiple?[]:"",!1))}c[li]=o}catch(S){Rt(e,e.return,S)}}break;case 6:if(Cn(t,e),Mn(e),s&4){if(e.stateNode===null)throw Error(Me(162));c=e.stateNode,o=e.memoizedProps;try{c.nodeValue=o}catch(S){Rt(e,e.return,S)}}break;case 3:if(Cn(t,e),Mn(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{ri(t.containerInfo)}catch(S){Rt(e,e.return,S)}break;case 4:Cn(t,e),Mn(e);break;case 13:Cn(t,e),Mn(e),c=e.child,c.flags&8192&&(o=c.memoizedState!==null,c.stateNode.isHidden=o,!o||c.alternate!==null&&c.alternate.memoizedState!==null||(Lu=Ot())),s&4&&ah(e);break;case 22:if(l=n!==null&&n.memoizedState!==null,e.mode&1?(jt=(u=jt)||l,Cn(t,e),jt=u):Cn(t,e),Mn(e),s&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!l&&e.mode&1)for(ke=e,l=e.child;l!==null;){for(d=ke=l;ke!==null;){switch(f=ke,p=f.child,f.tag){case 0:case 11:case 14:case 15:Qs(4,f,f.return);break;case 1:is(f,f.return);var _=f.stateNode;if(typeof _.componentWillUnmount=="function"){s=f,n=f.return;try{t=s,_.props=t.memoizedProps,_.state=t.memoizedState,_.componentWillUnmount()}catch(S){Rt(s,n,S)}}break;case 5:is(f,f.return);break;case 22:if(f.memoizedState!==null){uh(d);continue}}p!==null?(p.return=f,ke=p):uh(d)}l=l.sibling}e:for(l=null,d=e;;){if(d.tag===5){if(l===null){l=d;try{c=d.stateNode,u?(o=c.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(r=d.stateNode,a=d.memoizedProps.style,h=a!=null&&a.hasOwnProperty("display")?a.display:null,r.style.display=id("display",h))}catch(S){Rt(e,e.return,S)}}}else if(d.tag===6){if(l===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(S){Rt(e,e.return,S)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;l===d&&(l=null),d=d.return}l===d&&(l=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Cn(t,e),Mn(e),s&4&&ah(e);break;case 21:break;default:Cn(t,e),Mn(e)}}function Mn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Dp(n)){var s=n;break e}n=n.return}throw Error(Me(160))}switch(s.tag){case 5:var c=s.stateNode;s.flags&32&&(Zs(c,""),s.flags&=-33);var o=oh(e);Ll(e,o,c);break;case 3:case 4:var h=s.stateNode.containerInfo,r=oh(e);bl(e,r,h);break;default:throw Error(Me(161))}}catch(a){Rt(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Hg(e,t,n){ke=e,Lp(e)}function Lp(e,t,n){for(var s=(e.mode&1)!==0;ke!==null;){var c=ke,o=c.child;if(c.tag===22&&s){var h=c.memoizedState!==null||ji;if(!h){var r=c.alternate,a=r!==null&&r.memoizedState!==null||jt;r=ji;var u=jt;if(ji=h,(jt=a)&&!u)for(ke=c;ke!==null;)h=ke,a=h.child,h.tag===22&&h.memoizedState!==null?ch(c):a!==null?(a.return=h,ke=a):ch(c);for(;o!==null;)ke=o,Lp(o),o=o.sibling;ke=c,ji=r,jt=u}lh(e)}else c.subtreeFlags&8772&&o!==null?(o.return=c,ke=o):lh(e)}}function lh(e){for(;ke!==null;){var t=ke;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:jt||Ko(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!jt)if(n===null)s.componentDidMount();else{var c=t.elementType===t.type?n.memoizedProps:Rn(t.type,n.memoizedProps);s.componentDidUpdate(c,n.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&Hc(t,o,s);break;case 3:var h=t.updateQueue;if(h!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Hc(t,h,n)}break;case 5:var r=t.stateNode;if(n===null&&t.flags&4){n=r;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var l=u.memoizedState;if(l!==null){var d=l.dehydrated;d!==null&&ri(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Me(163))}jt||t.flags&512&&Ml(t)}catch(f){Rt(t,t.return,f)}}if(t===e){ke=null;break}if(n=t.sibling,n!==null){n.return=t.return,ke=n;break}ke=t.return}}function uh(e){for(;ke!==null;){var t=ke;if(t===e){ke=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ke=n;break}ke=t.return}}function ch(e){for(;ke!==null;){var t=ke;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ko(4,t)}catch(a){Rt(t,n,a)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var c=t.return;try{s.componentDidMount()}catch(a){Rt(t,c,a)}}var o=t.return;try{Ml(t)}catch(a){Rt(t,o,a)}break;case 5:var h=t.return;try{Ml(t)}catch(a){Rt(t,h,a)}}}catch(a){Rt(t,t.return,a)}if(t===e){ke=null;break}var r=t.sibling;if(r!==null){r.return=t.return,ke=r;break}ke=t.return}}var Yg=Math.ceil,Mo=Kn.ReactCurrentDispatcher,Mu=Kn.ReactCurrentOwner,Sn=Kn.ReactCurrentBatchConfig,it=0,xt=null,Pt=null,kt=0,sn=0,os=Tr(0),Lt=0,fi=null,Ur=0,Xo=0,bu=0,Ks=null,Xt=null,Lu=0,Ss=1/0,Gn=null,bo=!1,Ul=null,dr=null,Hi=!1,ir=null,Lo=0,Xs=0,xl=null,io=-1,oo=0;function zt(){return it&6?Ot():io!==-1?io:io=Ot()}function pr(e){return e.mode&1?it&2&&kt!==0?kt&-kt:Pg.transition!==null?(oo===0&&(oo=Ed()),oo):(e=ut,e!==0||(e=window.event,e=e===void 0?16:vd(e.type)),e):1}function wn(e,t,n,s){if(50<Xs)throw Xs=0,xl=null,Error(Me(185));Ei(e,n,s),(!(it&2)||e!==xt)&&(e===xt&&(!(it&2)&&(Xo|=n),Lt===4&&rr(e,kt)),tn(e,s),n===1&&it===0&&!(t.mode&1)&&(Ss=Ot()+500,Yo&&yr()))}function tn(e,t){var n=e.callbackNode;P_(e,t);var s=mo(e,e===xt?kt:0);if(s===0)n!==null&&Sc(n),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(n!=null&&Sc(n),t===1)e.tag===0?wg(hh.bind(null,e)):Vd(hh.bind(null,e)),vg(function(){!(it&6)&&yr()}),n=null;else{switch(Sd(s)){case 1:n=ou;break;case 4:n=gd;break;case 16:n=go;break;case 536870912:n=md;break;default:n=go}n=Wp(n,Up.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Up(e,t){if(io=-1,oo=0,it&6)throw Error(Me(327));var n=e.callbackNode;if(ds()&&e.callbackNode!==n)return null;var s=mo(e,e===xt?kt:0);if(s===0)return null;if(s&30||s&e.expiredLanes||t)t=Uo(e,s);else{t=s;var c=it;it|=2;var o=Fp();(xt!==e||kt!==t)&&(Gn=null,Ss=Ot()+500,Pr(e,t));do try{Kg();break}catch(r){xp(e,r)}while(!0);Su(),Mo.current=o,it=c,Pt!==null?t=0:(xt=null,kt=0,t=Lt)}if(t!==0){if(t===2&&(c=ul(e),c!==0&&(s=c,t=Fl(e,c))),t===1)throw n=fi,Pr(e,0),rr(e,s),tn(e,Ot()),n;if(t===6)rr(e,s);else{if(c=e.current.alternate,!(s&30)&&!zg(c)&&(t=Uo(e,s),t===2&&(o=ul(e),o!==0&&(s=o,t=Fl(e,o))),t===1))throw n=fi,Pr(e,0),rr(e,s),tn(e,Ot()),n;switch(e.finishedWork=c,e.finishedLanes=s,t){case 0:case 1:throw Error(Me(345));case 2:Nr(e,Xt,Gn);break;case 3:if(rr(e,s),(s&130023424)===s&&(t=Lu+500-Ot(),10<t)){if(mo(e,0)!==0)break;if(c=e.suspendedLanes,(c&s)!==s){zt(),e.pingedLanes|=e.suspendedLanes&c;break}e.timeoutHandle=ml(Nr.bind(null,e,Xt,Gn),t);break}Nr(e,Xt,Gn);break;case 4:if(rr(e,s),(s&4194240)===s)break;for(t=e.eventTimes,c=-1;0<s;){var h=31-An(s);o=1<<h,h=t[h],h>c&&(c=h),s&=~o}if(s=c,s=Ot()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*Yg(s/1960))-s,10<s){e.timeoutHandle=ml(Nr.bind(null,e,Xt,Gn),s);break}Nr(e,Xt,Gn);break;case 5:Nr(e,Xt,Gn);break;default:throw Error(Me(329))}}}return tn(e,Ot()),e.callbackNode===n?Up.bind(null,e):null}function Fl(e,t){var n=Ks;return e.current.memoizedState.isDehydrated&&(Pr(e,t).flags|=256),e=Uo(e,t),e!==2&&(t=Xt,Xt=n,t!==null&&kl(t)),e}function kl(e){Xt===null?Xt=e:Xt.push.apply(Xt,e)}function zg(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var s=0;s<n.length;s++){var c=n[s],o=c.getSnapshot;c=c.value;try{if(!Pn(o(),c))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function rr(e,t){for(t&=~bu,t&=~Xo,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-An(t),s=1<<n;e[n]=-1,t&=~s}}function hh(e){if(it&6)throw Error(Me(327));ds();var t=mo(e,0);if(!(t&1))return tn(e,Ot()),null;var n=Uo(e,t);if(e.tag!==0&&n===2){var s=ul(e);s!==0&&(t=s,n=Fl(e,s))}if(n===1)throw n=fi,Pr(e,0),rr(e,t),tn(e,Ot()),n;if(n===6)throw Error(Me(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Nr(e,Xt,Gn),tn(e,Ot()),null}function Uu(e,t){var n=it;it|=1;try{return e(t)}finally{it=n,it===0&&(Ss=Ot()+500,Yo&&yr())}}function xr(e){ir!==null&&ir.tag===0&&!(it&6)&&ds();var t=it;it|=1;var n=Sn.transition,s=ut;try{if(Sn.transition=null,ut=1,e)return e()}finally{ut=s,Sn.transition=n,it=t,!(it&6)&&yr()}}function xu(){sn=os.current,ft(os)}function Pr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Rg(n)),Pt!==null)for(n=Pt.return;n!==null;){var s=n;switch(gu(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&Io();break;case 3:ms(),ft(Zt),ft(Ht),vu();break;case 5:Ru(s);break;case 4:ms();break;case 13:ft(mt);break;case 19:ft(mt);break;case 10:Tu(s.type._context);break;case 22:case 23:xu()}n=n.return}if(xt=e,Pt=e=fr(e.current,null),kt=sn=t,Lt=0,fi=null,bu=Xo=Ur=0,Xt=Ks=null,Ar!==null){for(t=0;t<Ar.length;t++)if(n=Ar[t],s=n.interleaved,s!==null){n.interleaved=null;var c=s.next,o=n.pending;if(o!==null){var h=o.next;o.next=c,s.next=h}n.pending=s}Ar=null}return e}function xp(e,t){do{var n=Pt;try{if(Su(),no.current=Do,Po){for(var s=Et.memoizedState;s!==null;){var c=s.queue;c!==null&&(c.pending=null),s=s.next}Po=!1}if(Lr=0,Ut=bt=Et=null,zs=!1,hi=0,Mu.current=null,n===null||n.return===null){Lt=1,fi=t,Pt=null;break}e:{var o=e,h=n.return,r=n,a=t;if(t=kt,r.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=a,l=r,d=l.tag;if(!(l.mode&1)&&(d===0||d===11||d===15)){var f=l.alternate;f?(l.updateQueue=f.updateQueue,l.memoizedState=f.memoizedState,l.lanes=f.lanes):(l.updateQueue=null,l.memoizedState=null)}var p=Jc(h);if(p!==null){p.flags&=-257,Zc(p,h,r,o,t),p.mode&1&&Xc(o,u,t),t=p,a=u;var _=t.updateQueue;if(_===null){var S=new Set;S.add(a),t.updateQueue=S}else _.add(a);break e}else{if(!(t&1)){Xc(o,u,t),Fu();break e}a=Error(Me(426))}}else if(gt&&r.mode&1){var C=Jc(h);if(C!==null){!(C.flags&65536)&&(C.flags|=256),Zc(C,h,r,o,t),mu(Es(a,r));break e}}o=a=Es(a,r),Lt!==4&&(Lt=2),Ks===null?Ks=[o]:Ks.push(o),o=h;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var g=Sp(o,a,t);jc(o,g);break e;case 1:r=a;var m=o.type,T=o.stateNode;if(!(o.flags&128)&&(typeof m.getDerivedStateFromError=="function"||T!==null&&typeof T.componentDidCatch=="function"&&(dr===null||!dr.has(T)))){o.flags|=65536,t&=-t,o.lanes|=t;var y=Tp(o,r,t);jc(o,y);break e}}o=o.return}while(o!==null)}Bp(n)}catch(E){t=E,Pt===n&&n!==null&&(Pt=n=n.return);continue}break}while(!0)}function Fp(){var e=Mo.current;return Mo.current=Do,e===null?Do:e}function Fu(){(Lt===0||Lt===3||Lt===2)&&(Lt=4),xt===null||!(Ur&268435455)&&!(Xo&268435455)||rr(xt,kt)}function Uo(e,t){var n=it;it|=2;var s=Fp();(xt!==e||kt!==t)&&(Gn=null,Pr(e,t));do try{Qg();break}catch(c){xp(e,c)}while(!0);if(Su(),it=n,Mo.current=s,Pt!==null)throw Error(Me(261));return xt=null,kt=0,Lt}function Qg(){for(;Pt!==null;)kp(Pt)}function Kg(){for(;Pt!==null&&!y_();)kp(Pt)}function kp(e){var t=$p(e.alternate,e,sn);e.memoizedProps=e.pendingProps,t===null?Bp(e):Pt=t,Mu.current=null}function Bp(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=qg(n,t),n!==null){n.flags&=32767,Pt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Lt=6,Pt=null;return}}else if(n=Wg(n,t,sn),n!==null){Pt=n;return}if(t=t.sibling,t!==null){Pt=t;return}Pt=t=e}while(t!==null);Lt===0&&(Lt=5)}function Nr(e,t,n){var s=ut,c=Sn.transition;try{Sn.transition=null,ut=1,Xg(e,t,n,s)}finally{Sn.transition=c,ut=s}return null}function Xg(e,t,n,s){do ds();while(ir!==null);if(it&6)throw Error(Me(327));n=e.finishedWork;var c=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(Me(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(D_(e,o),e===xt&&(Pt=xt=null,kt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Hi||(Hi=!0,Wp(go,function(){return ds(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=Sn.transition,Sn.transition=null;var h=ut;ut=1;var r=it;it|=4,Mu.current=null,jg(e,n),bp(n,e),mg(_l),Eo=!!fl,_l=fl=null,e.current=n,Hg(n),I_(),it=r,ut=h,Sn.transition=o}else e.current=n;if(Hi&&(Hi=!1,ir=e,Lo=c),o=e.pendingLanes,o===0&&(dr=null),v_(n.stateNode),tn(e,Ot()),t!==null)for(s=e.onRecoverableError,n=0;n<t.length;n++)c=t[n],s(c.value,{componentStack:c.stack,digest:c.digest});if(bo)throw bo=!1,e=Ul,Ul=null,e;return Lo&1&&e.tag!==0&&ds(),o=e.pendingLanes,o&1?e===xl?Xs++:(Xs=0,xl=e):Xs=0,yr(),null}function ds(){if(ir!==null){var e=Sd(Lo),t=Sn.transition,n=ut;try{if(Sn.transition=null,ut=16>e?16:e,ir===null)var s=!1;else{if(e=ir,ir=null,Lo=0,it&6)throw Error(Me(331));var c=it;for(it|=4,ke=e.current;ke!==null;){var o=ke,h=o.child;if(ke.flags&16){var r=o.deletions;if(r!==null){for(var a=0;a<r.length;a++){var u=r[a];for(ke=u;ke!==null;){var l=ke;switch(l.tag){case 0:case 11:case 15:Qs(8,l,o)}var d=l.child;if(d!==null)d.return=l,ke=d;else for(;ke!==null;){l=ke;var f=l.sibling,p=l.return;if(Pp(l),l===u){ke=null;break}if(f!==null){f.return=p,ke=f;break}ke=p}}}var _=o.alternate;if(_!==null){var S=_.child;if(S!==null){_.child=null;do{var C=S.sibling;S.sibling=null,S=C}while(S!==null)}}ke=o}}if(o.subtreeFlags&2064&&h!==null)h.return=o,ke=h;else e:for(;ke!==null;){if(o=ke,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Qs(9,o,o.return)}var g=o.sibling;if(g!==null){g.return=o.return,ke=g;break e}ke=o.return}}var m=e.current;for(ke=m;ke!==null;){h=ke;var T=h.child;if(h.subtreeFlags&2064&&T!==null)T.return=h,ke=T;else e:for(h=m;ke!==null;){if(r=ke,r.flags&2048)try{switch(r.tag){case 0:case 11:case 15:Ko(9,r)}}catch(E){Rt(r,r.return,E)}if(r===h){ke=null;break e}var y=r.sibling;if(y!==null){y.return=r.return,ke=y;break e}ke=r.return}}if(it=c,yr(),Un&&typeof Un.onPostCommitFiberRoot=="function")try{Un.onPostCommitFiberRoot(Wo,e)}catch{}s=!0}return s}finally{ut=n,Sn.transition=t}}return!1}function dh(e,t,n){t=Es(n,t),t=Sp(e,t,1),e=hr(e,t,1),t=zt(),e!==null&&(Ei(e,1,t),tn(e,t))}function Rt(e,t,n){if(e.tag===3)dh(e,e,n);else for(;t!==null;){if(t.tag===3){dh(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(dr===null||!dr.has(s))){e=Es(n,e),e=Tp(t,e,1),t=hr(t,e,1),e=zt(),t!==null&&(Ei(t,1,e),tn(t,e));break}}t=t.return}}function Jg(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),t=zt(),e.pingedLanes|=e.suspendedLanes&n,xt===e&&(kt&n)===n&&(Lt===4||Lt===3&&(kt&130023424)===kt&&500>Ot()-Lu?Pr(e,0):bu|=n),tn(e,t)}function Gp(e,t){t===0&&(e.mode&1?(t=xi,xi<<=1,!(xi&130023424)&&(xi=4194304)):t=1);var n=zt();e=Yn(e,t),e!==null&&(Ei(e,t,n),tn(e,n))}function Zg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Gp(e,n)}function em(e,t){var n=0;switch(e.tag){case 13:var s=e.stateNode,c=e.memoizedState;c!==null&&(n=c.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(Me(314))}s!==null&&s.delete(t),Gp(e,n)}var $p;$p=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Zt.current)Jt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Jt=!1,$g(e,t,n);Jt=!!(e.flags&131072)}else Jt=!1,gt&&t.flags&1048576&&jd(t,vo,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;so(e,t),e=t.pendingProps;var c=fs(t,Ht.current);hs(t,n),c=Ou(null,t,s,e,c,n);var o=Au();return t.flags|=1,typeof c=="object"&&c!==null&&typeof c.render=="function"&&c.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,en(s)?(o=!0,Co(t)):o=!1,t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,Iu(t),c.updater=Qo,t.stateNode=c,c._reactInternals=t,Rl(t,s,e,n),t=Ol(null,t,s,!0,o,n)):(t.tag=0,gt&&o&&_u(t),Yt(null,t,c,n),t=t.child),t;case 16:s=t.elementType;e:{switch(so(e,t),e=t.pendingProps,c=s._init,s=c(s._payload),t.type=s,c=t.tag=nm(s),e=Rn(s,e),c){case 0:t=Nl(null,t,s,e,n);break e;case 1:t=nh(null,t,s,e,n);break e;case 11:t=eh(null,t,s,e,n);break e;case 14:t=th(null,t,s,Rn(s.type,e),n);break e}throw Error(Me(306,s,""))}return t;case 0:return s=t.type,c=t.pendingProps,c=t.elementType===s?c:Rn(s,c),Nl(e,t,s,c,n);case 1:return s=t.type,c=t.pendingProps,c=t.elementType===s?c:Rn(s,c),nh(e,t,s,c,n);case 3:e:{if(Rp(t),e===null)throw Error(Me(387));s=t.pendingProps,o=t.memoizedState,c=o.element,Xd(e,t),Ao(t,s,null,n);var h=t.memoizedState;if(s=h.element,o.isDehydrated)if(o={element:s,isDehydrated:!1,cache:h.cache,pendingSuspenseBoundaries:h.pendingSuspenseBoundaries,transitions:h.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){c=Es(Error(Me(423)),t),t=rh(e,t,s,n,c);break e}else if(s!==c){c=Es(Error(Me(424)),t),t=rh(e,t,s,n,c);break e}else for(on=cr(t.stateNode.containerInfo.firstChild),an=t,gt=!0,On=null,n=Qd(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(_s(),s===c){t=zn(e,t,n);break e}Yt(e,t,s,n)}t=t.child}return t;case 5:return Jd(t),e===null&&yl(t),s=t.type,c=t.pendingProps,o=e!==null?e.memoizedProps:null,h=c.children,gl(s,c)?h=null:o!==null&&gl(s,o)&&(t.flags|=32),Cp(e,t),Yt(e,t,h,n),t.child;case 6:return e===null&&yl(t),null;case 13:return vp(e,t,n);case 4:return Cu(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=gs(t,null,s,n):Yt(e,t,s,n),t.child;case 11:return s=t.type,c=t.pendingProps,c=t.elementType===s?c:Rn(s,c),eh(e,t,s,c,n);case 7:return Yt(e,t,t.pendingProps,n),t.child;case 8:return Yt(e,t,t.pendingProps.children,n),t.child;case 12:return Yt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(s=t.type._context,c=t.pendingProps,o=t.memoizedProps,h=c.value,ht(No,s._currentValue),s._currentValue=h,o!==null)if(Pn(o.value,h)){if(o.children===c.children&&!Zt.current){t=zn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var r=o.dependencies;if(r!==null){h=o.child;for(var a=r.firstContext;a!==null;){if(a.context===s){if(o.tag===1){a=Vn(-1,n&-n),a.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var l=u.pending;l===null?a.next=a:(a.next=l.next,l.next=a),u.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Il(o.return,n,t),r.lanes|=n;break}a=a.next}}else if(o.tag===10)h=o.type===t.type?null:o.child;else if(o.tag===18){if(h=o.return,h===null)throw Error(Me(341));h.lanes|=n,r=h.alternate,r!==null&&(r.lanes|=n),Il(h,n,t),h=o.sibling}else h=o.child;if(h!==null)h.return=o;else for(h=o;h!==null;){if(h===t){h=null;break}if(o=h.sibling,o!==null){o.return=h.return,h=o;break}h=h.return}o=h}Yt(e,t,c.children,n),t=t.child}return t;case 9:return c=t.type,s=t.pendingProps.children,hs(t,n),c=Tn(c),s=s(c),t.flags|=1,Yt(e,t,s,n),t.child;case 14:return s=t.type,c=Rn(s,t.pendingProps),c=Rn(s.type,c),th(e,t,s,c,n);case 15:return yp(e,t,t.type,t.pendingProps,n);case 17:return s=t.type,c=t.pendingProps,c=t.elementType===s?c:Rn(s,c),so(e,t),t.tag=1,en(s)?(e=!0,Co(t)):e=!1,hs(t,n),Ep(t,s,c),Rl(t,s,c,n),Ol(null,t,s,!0,e,n);case 19:return Np(e,t,n);case 22:return Ip(e,t,n)}throw Error(Me(156,t.tag))};function Wp(e,t){return _d(e,t)}function tm(e,t,n,s){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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function En(e,t,n,s){return new tm(e,t,n,s)}function ku(e){return e=e.prototype,!(!e||!e.isReactComponent)}function nm(e){if(typeof e=="function")return ku(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ru)return 11;if(e===su)return 14}return 2}function fr(e,t){var n=e.alternate;return n===null?(n=En(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.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,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 ao(e,t,n,s,c,o){var h=2;if(s=e,typeof e=="function")ku(e)&&(h=1);else if(typeof e=="string")h=5;else e:switch(e){case Kr:return Dr(n.children,c,o,t);case nu:h=8,c|=8;break;case za:return e=En(12,n,t,c|2),e.elementType=za,e.lanes=o,e;case Qa:return e=En(13,n,t,c),e.elementType=Qa,e.lanes=o,e;case Ka:return e=En(19,n,t,c),e.elementType=Ka,e.lanes=o,e;case Jh:return Jo(n,c,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Kh:h=10;break e;case Xh:h=9;break e;case ru:h=11;break e;case su:h=14;break e;case er:h=16,s=null;break e}throw Error(Me(130,e==null?e:typeof e,""))}return t=En(h,n,t,c),t.elementType=e,t.type=s,t.lanes=o,t}function Dr(e,t,n,s){return e=En(7,e,s,t),e.lanes=n,e}function Jo(e,t,n,s){return e=En(22,e,s,t),e.elementType=Jh,e.lanes=n,e.stateNode={isHidden:!1},e}function Ba(e,t,n){return e=En(6,e,null,t),e.lanes=n,e}function Ga(e,t,n){return t=En(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function rm(e,t,n,s,c){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ta(0),this.expirationTimes=Ta(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ta(0),this.identifierPrefix=s,this.onRecoverableError=c,this.mutableSourceEagerHydrationData=null}function Bu(e,t,n,s,c,o,h,r,a){return e=new rm(e,t,n,r,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=En(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:s,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Iu(o),e}function sm(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Qr,key:s==null?null:""+s,children:e,containerInfo:t,implementation:n}}function qp(e){if(!e)return Er;e=e._reactInternals;e:{if(kr(e)!==e||e.tag!==1)throw Error(Me(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(en(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Me(171))}if(e.tag===1){var n=e.type;if(en(n))return qd(e,n,t)}return t}function Vp(e,t,n,s,c,o,h,r,a){return e=Bu(n,s,!0,e,c,o,h,r,a),e.context=qp(null),n=e.current,s=zt(),c=pr(n),o=Vn(s,c),o.callback=t??null,hr(n,o,c),e.current.lanes=c,Ei(e,c,s),tn(e,s),e}function Zo(e,t,n,s){var c=t.current,o=zt(),h=pr(c);return n=qp(n),t.context===null?t.context=n:t.pendingContext=n,t=Vn(o,h),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=hr(c,t,h),e!==null&&(wn(e,c,h,o),to(e,c,h)),h}function xo(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 ph(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Gu(e,t){ph(e,t),(e=e.alternate)&&ph(e,t)}function im(){return null}var jp=typeof reportError=="function"?reportError:function(e){console.error(e)};function $u(e){this._internalRoot=e}ea.prototype.render=$u.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Me(409));Zo(e,t,null,null)};ea.prototype.unmount=$u.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xr(function(){Zo(null,e,null,null)}),t[Hn]=null}};function ea(e){this._internalRoot=e}ea.prototype.unstable_scheduleHydration=function(e){if(e){var t=Id();e={blockedOn:null,target:e,priority:t};for(var n=0;n<nr.length&&t!==0&&t<nr[n].priority;n++);nr.splice(n,0,e),n===0&&Rd(e)}};function Wu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ta(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function fh(){}function om(e,t,n,s,c){if(c){if(typeof s=="function"){var o=s;s=function(){var u=xo(h);o.call(u)}}var h=Vp(t,s,e,0,null,!1,!1,"",fh);return e._reactRootContainer=h,e[Hn]=h.current,oi(e.nodeType===8?e.parentNode:e),xr(),h}for(;c=e.lastChild;)e.removeChild(c);if(typeof s=="function"){var r=s;s=function(){var u=xo(a);r.call(u)}}var a=Bu(e,0,!1,null,null,!1,!1,"",fh);return e._reactRootContainer=a,e[Hn]=a.current,oi(e.nodeType===8?e.parentNode:e),xr(function(){Zo(t,a,n,s)}),a}function na(e,t,n,s,c){var o=n._reactRootContainer;if(o){var h=o;if(typeof c=="function"){var r=c;c=function(){var a=xo(h);r.call(a)}}Zo(t,h,e,c)}else h=om(n,t,e,c,s);return xo(h)}Td=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Gs(t.pendingLanes);n!==0&&(au(t,n|1),tn(t,Ot()),!(it&6)&&(Ss=Ot()+500,yr()))}break;case 13:xr(function(){var s=Yn(e,1);if(s!==null){var c=zt();wn(s,e,1,c)}}),Gu(e,1)}};lu=function(e){if(e.tag===13){var t=Yn(e,134217728);if(t!==null){var n=zt();wn(t,e,134217728,n)}Gu(e,134217728)}};yd=function(e){if(e.tag===13){var t=pr(e),n=Yn(e,t);if(n!==null){var s=zt();wn(n,e,t,s)}Gu(e,t)}};Id=function(){return ut};Cd=function(e,t){var n=ut;try{return ut=e,t()}finally{ut=n}};ol=function(e,t,n){switch(t){case"input":if(Za(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 s=n[t];if(s!==e&&s.form===e.form){var c=Ho(s);if(!c)throw Error(Me(90));ed(s),Za(s,c)}}}break;case"textarea":nd(e,n);break;case"select":t=n.value,t!=null&&as(e,!!n.multiple,t,!1)}};ud=Uu;cd=xr;var am={usingClientEntryPoint:!1,Events:[Ti,es,Ho,ad,ld,Uu]},xs={findFiberByHostInstance:Or,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},lm={bundleType:xs.bundleType,version:xs.version,rendererPackageName:xs.rendererPackageName,rendererConfig:xs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Kn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=pd(e),e===null?null:e.stateNode},findFiberByHostInstance:xs.findFiberByHostInstance||im,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Yi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yi.isDisabled&&Yi.supportsFiber)try{Wo=Yi.inject(lm),Un=Yi}catch{}}un.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=am;un.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Wu(t))throw Error(Me(200));return sm(e,t,null,n)};un.createRoot=function(e,t){if(!Wu(e))throw Error(Me(299));var n=!1,s="",c=jp;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=Bu(e,1,!1,null,null,n,!1,s,c),e[Hn]=t.current,oi(e.nodeType===8?e.parentNode:e),new $u(t)};un.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(Me(188)):(e=Object.keys(e).join(","),Error(Me(268,e)));return e=pd(t),e=e===null?null:e.stateNode,e};un.flushSync=function(e){return xr(e)};un.hydrate=function(e,t,n){if(!ta(t))throw Error(Me(200));return na(null,e,t,!0,n)};un.hydrateRoot=function(e,t,n){if(!Wu(e))throw Error(Me(405));var s=n!=null&&n.hydratedSources||null,c=!1,o="",h=jp;if(n!=null&&(n.unstable_strictMode===!0&&(c=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(h=n.onRecoverableError)),t=Vp(t,null,e,1,n??null,c,!1,o,h),e[Hn]=t.current,oi(e),s)for(e=0;e<s.length;e++)n=s[e],c=n._getVersion,c=c(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,c]:t.mutableSourceEagerHydrationData.push(n,c);return new ea(t)};un.render=function(e,t,n){if(!ta(t))throw Error(Me(200));return na(null,e,t,!1,n)};un.unmountComponentAtNode=function(e){if(!ta(e))throw Error(Me(40));return e._reactRootContainer?(xr(function(){na(null,null,e,!1,function(){e._reactRootContainer=null,e[Hn]=null})}),!0):!1};un.unstable_batchedUpdates=Uu;un.unstable_renderSubtreeIntoContainer=function(e,t,n,s){if(!ta(n))throw Error(Me(200));if(e==null||e._reactInternals===void 0)throw Error(Me(38));return na(e,t,n,!1,s)};un.version="18.3.1-next-f1338f8080-20240426";function Hp(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Hp)}catch(e){console.error(e)}}Hp(),Hh.exports=un;var um=Hh.exports,_h=um;Ha.createRoot=_h.createRoot,Ha.hydrateRoot=_h.hydrateRoot;const cm=12e4,hm=3e4,Yp=Ae.createContext(null),dm=({children:e})=>{const[t,n]=Ae.useState({}),[s,c]=Ae.useState(""),o=Ae.useCallback(a=>{if(!(a!=null&&a.agent_name)){console.warn("Invalid registration message received:",a);return}const u=a.agent_name;a.actions&&(a.actions=a.actions.filter(l=>l)),n(l=>({...l,[u]:{...a,lastUpdate:Date.now()}}))},[]);Ae.useEffect(()=>{const a=u=>{o(u.detail)};return window.addEventListener("agentRegistration",a),()=>window.removeEventListener("agentRegistration",a)},[o]),Ae.useEffect(()=>{const a=setInterval(()=>{const u=Date.now();n(l=>{const d={...l};let f=!1;return Object.entries(d).forEach(([p,_])=>{u-_.lastUpdate>cm&&(delete d[p],f=!0)}),f?d:l})},hm);return()=>clearInterval(a)},[]);const h=Ae.useMemo(()=>{const a=s.toLowerCase();return Object.fromEntries(Object.entries(t).filter(([u,l])=>{var d,f;return u.toLowerCase().includes(a)||((d=l.description)==null?void 0:d.toLowerCase().includes(a))||((f=l.actions)==null?void 0:f.some(p=>{var C;const _=Object.keys(p)[0],S=p[_];return _.toLowerCase().includes(a)||((C=S==null?void 0:S.desc)==null?void 0:C.toLowerCase().includes(a))}))}))},[t,s]),r={agents:t,filteredAgents:h,handleRegistration:o,searchFilter:s,setSearchFilter:c};return le.jsx(Yp.Provider,{value:r,children:e})},pm=()=>{const e=Ae.useContext(Yp);if(!e)throw new Error("useAgentRegistrations must be used within an AgentRegistrationsProvider");return e};/**
|
|
40
|
+
`+o.stack}return{value:e,source:t,stack:c,digest:null}}function Fa(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function vl(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Wg=typeof WeakMap=="function"?WeakMap:Map;function Sp(e,t,n){n=Vn(-1,n),n.tag=3,n.payload={element:null};var s=t.value;return n.callback=function(){bo||(bo=!0,Ul=s),vl(e,t)},n}function Tp(e,t,n){n=Vn(-1,n),n.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var c=t.value;n.payload=function(){return s(c)},n.callback=function(){vl(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){vl(e,t),typeof s!="function"&&(dr===null?dr=new Set([this]):dr.add(this));var h=t.stack;this.componentDidCatch(t.value,{componentStack:h!==null?h:""})}),n}function Jc(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new Wg;var c=new Set;s.set(t,c)}else c=s.get(t),c===void 0&&(c=new Set,s.set(t,c));c.has(n)||(c.add(n),e=nm.bind(null,e,t,n),t.then(e,e))}function Zc(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function eh(e,t,n,s,c){return e.mode&1?(e.flags|=65536,e.lanes=c,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Vn(-1,1),t.tag=2,hr(n,t,1))),n.lanes|=1),e)}var qg=Kn.ReactCurrentOwner,Jt=!1;function Yt(e,t,n,s){t.child=e===null?Qd(t,null,n,s):gs(t,e.child,n,s)}function th(e,t,n,s,c){n=n.render;var o=t.ref;return hs(t,c),s=Au(e,t,n,s,o,c),n=wu(),e!==null&&!Jt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~c,zn(e,t,c)):(gt&&n&&gu(t),t.flags|=1,Yt(e,t,s,c),t.child)}function nh(e,t,n,s,c){if(e===null){var o=n.type;return typeof o=="function"&&!Bu(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,yp(e,t,o,s,c)):(e=ao(n.type,null,s,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&c)){var h=o.memoizedProps;if(n=n.compare,n=n!==null?n:ii,n(h,s)&&e.ref===t.ref)return zn(e,t,c)}return t.flags|=1,e=fr(o,s),e.ref=t.ref,e.return=t,t.child=e}function yp(e,t,n,s,c){if(e!==null){var o=e.memoizedProps;if(ii(o,s)&&e.ref===t.ref)if(Jt=!1,t.pendingProps=s=o,(e.lanes&c)!==0)e.flags&131072&&(Jt=!0);else return t.lanes=e.lanes,zn(e,t,c)}return Nl(e,t,n,s,c)}function Ip(e,t,n){var s=t.pendingProps,c=s.children,o=e!==null?e.memoizedState:null;if(s.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ht(os,sn),sn|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ht(os,sn),sn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=o!==null?o.baseLanes:n,ht(os,sn),sn|=s}else o!==null?(s=o.baseLanes|n,t.memoizedState=null):s=n,ht(os,sn),sn|=s;return Yt(e,t,c,n),t.child}function Cp(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Nl(e,t,n,s,c){var o=en(n)?Mr:Ht.current;return o=fs(t,o),hs(t,c),n=Au(e,t,n,s,o,c),s=wu(),e!==null&&!Jt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~c,zn(e,t,c)):(gt&&s&&gu(t),t.flags|=1,Yt(e,t,n,c),t.child)}function rh(e,t,n,s,c){if(en(n)){var o=!0;Co(t)}else o=!1;if(hs(t,c),t.stateNode===null)so(e,t),Ep(t,n,s),Rl(t,n,s,c),s=!0;else if(e===null){var h=t.stateNode,r=t.memoizedProps;h.props=r;var a=h.context,u=n.contextType;typeof u=="object"&&u!==null?u=Tn(u):(u=en(n)?Mr:Ht.current,u=fs(t,u));var l=n.getDerivedStateFromProps,d=typeof l=="function"||typeof h.getSnapshotBeforeUpdate=="function";d||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(r!==s||a!==u)&&Xc(t,h,s,u),tr=!1;var _=t.memoizedState;h.state=_,Ao(t,s,h,c),a=t.memoizedState,r!==s||_!==a||Zt.current||tr?(typeof l=="function"&&(Cl(t,n,l,s),a=t.memoizedState),(r=tr||Kc(t,n,r,s,_,a,u))?(d||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=a),h.props=s,h.state=a,h.context=u,s=r):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{h=t.stateNode,Xd(e,t),r=t.memoizedProps,u=t.type===t.elementType?r:Rn(t.type,r),h.props=u,d=t.pendingProps,_=h.context,a=n.contextType,typeof a=="object"&&a!==null?a=Tn(a):(a=en(n)?Mr:Ht.current,a=fs(t,a));var p=n.getDerivedStateFromProps;(l=typeof p=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(r!==d||_!==a)&&Xc(t,h,s,a),tr=!1,_=t.memoizedState,h.state=_,Ao(t,s,h,c);var f=t.memoizedState;r!==d||_!==f||Zt.current||tr?(typeof p=="function"&&(Cl(t,n,p,s),f=t.memoizedState),(u=tr||Kc(t,n,u,s,_,f,a)||!1)?(l||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(s,f,a),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(s,f,a)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||r===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||r===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=f),h.props=s,h.state=f,h.context=a,s=u):(typeof h.componentDidUpdate!="function"||r===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||r===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),s=!1)}return Ol(e,t,n,s,o,c)}function Ol(e,t,n,s,c,o){Cp(e,t);var h=(t.flags&128)!==0;if(!s&&!h)return c&&Wc(t,n,!1),zn(e,t,o);s=t.stateNode,qg.current=t;var r=h&&typeof n.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&h?(t.child=gs(t,e.child,null,o),t.child=gs(t,null,r,o)):Yt(e,t,r,o),t.memoizedState=s.state,c&&Wc(t,n,!0),t.child}function Rp(e){var t=e.stateNode;t.pendingContext?$c(e,t.pendingContext,t.pendingContext!==t.context):t.context&&$c(e,t.context,!1),Ru(e,t.containerInfo)}function sh(e,t,n,s,c){return _s(),Eu(c),t.flags|=256,Yt(e,t,n,s),t.child}var Al={dehydrated:null,treeContext:null,retryLane:0};function wl(e){return{baseLanes:e,cachePool:null,transitions:null}}function vp(e,t,n){var s=t.pendingProps,c=mt.current,o=!1,h=(t.flags&128)!==0,r;if((r=h)||(r=e!==null&&e.memoizedState===null?!1:(c&2)!==0),r?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(c|=1),ht(mt,c&1),e===null)return yl(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(h=s.children,e=s.fallback,o?(s=t.mode,o=t.child,h={mode:"hidden",children:h},!(s&1)&&o!==null?(o.childLanes=0,o.pendingProps=h):o=Jo(h,s,0,null),e=Dr(e,s,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=wl(n),t.memoizedState=Al,e):Mu(t,h));if(c=e.memoizedState,c!==null&&(r=c.dehydrated,r!==null))return Vg(e,t,h,s,r,c,n);if(o){o=s.fallback,h=t.mode,c=e.child,r=c.sibling;var a={mode:"hidden",children:s.children};return!(h&1)&&t.child!==c?(s=t.child,s.childLanes=0,s.pendingProps=a,t.deletions=null):(s=fr(c,a),s.subtreeFlags=c.subtreeFlags&14680064),r!==null?o=fr(r,o):(o=Dr(o,h,n,null),o.flags|=2),o.return=t,s.return=t,s.sibling=o,t.child=s,s=o,o=t.child,h=e.child.memoizedState,h=h===null?wl(n):{baseLanes:h.baseLanes|n,cachePool:null,transitions:h.transitions},o.memoizedState=h,o.childLanes=e.childLanes&~n,t.memoizedState=Al,s}return o=e.child,e=o.sibling,s=fr(o,{mode:"visible",children:s.children}),!(t.mode&1)&&(s.lanes=n),s.return=t,s.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=s,t.memoizedState=null,s}function Mu(e,t){return t=Jo({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Vi(e,t,n,s){return s!==null&&Eu(s),gs(t,e.child,null,n),e=Mu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Vg(e,t,n,s,c,o,h){if(n)return t.flags&256?(t.flags&=-257,s=Fa(Error(Me(422))),Vi(e,t,h,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=s.fallback,c=t.mode,s=Jo({mode:"visible",children:s.children},c,0,null),o=Dr(o,c,h,null),o.flags|=2,s.return=t,o.return=t,s.sibling=o,t.child=s,t.mode&1&&gs(t,e.child,null,h),t.child.memoizedState=wl(h),t.memoizedState=Al,o);if(!(t.mode&1))return Vi(e,t,h,null);if(c.data==="$!"){if(s=c.nextSibling&&c.nextSibling.dataset,s)var r=s.dgst;return s=r,o=Error(Me(419)),s=Fa(o,s,void 0),Vi(e,t,h,s)}if(r=(h&e.childLanes)!==0,Jt||r){if(s=xt,s!==null){switch(h&-h){case 4:c=2;break;case 16:c=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:c=32;break;case 536870912:c=268435456;break;default:c=0}c=c&(s.suspendedLanes|h)?0:c,c!==0&&c!==o.retryLane&&(o.retryLane=c,Yn(e,c),wn(s,e,c,-1))}return ku(),s=Fa(Error(Me(421))),Vi(e,t,h,s)}return c.data==="$?"?(t.flags|=128,t.child=e.child,t=rm.bind(null,e),c._reactRetry=t,null):(e=o.treeContext,on=cr(c.nextSibling),an=t,gt=!0,On=null,e!==null&&(_n[gn++]=Wn,_n[gn++]=qn,_n[gn++]=br,Wn=e.id,qn=e.overflow,br=t),t=Mu(t,s.children),t.flags|=4096,t)}function ih(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Il(e.return,t,n)}function ka(e,t,n,s,c){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:c}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=s,o.tail=n,o.tailMode=c)}function Np(e,t,n){var s=t.pendingProps,c=s.revealOrder,o=s.tail;if(Yt(e,t,s.children,n),s=mt.current,s&2)s=s&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ih(e,n,t);else if(e.tag===19)ih(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}s&=1}if(ht(mt,s),!(t.mode&1))t.memoizedState=null;else switch(c){case"forwards":for(n=t.child,c=null;n!==null;)e=n.alternate,e!==null&&wo(e)===null&&(c=n),n=n.sibling;n=c,n===null?(c=t.child,t.child=null):(c=n.sibling,n.sibling=null),ka(t,!1,c,n,o);break;case"backwards":for(n=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&wo(e)===null){t.child=c;break}e=c.sibling,c.sibling=n,n=c,c=e}ka(t,!0,n,null,o);break;case"together":ka(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function so(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function zn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ur|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Me(153));if(t.child!==null){for(e=t.child,n=fr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=fr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function jg(e,t,n){switch(t.tag){case 3:Rp(t),_s();break;case 5:Jd(t);break;case 1:en(t.type)&&Co(t);break;case 4:Ru(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,c=t.memoizedProps.value;ht(No,s._currentValue),s._currentValue=c;break;case 13:if(s=t.memoizedState,s!==null)return s.dehydrated!==null?(ht(mt,mt.current&1),t.flags|=128,null):n&t.child.childLanes?vp(e,t,n):(ht(mt,mt.current&1),e=zn(e,t,n),e!==null?e.sibling:null);ht(mt,mt.current&1);break;case 19:if(s=(n&t.childLanes)!==0,e.flags&128){if(s)return Np(e,t,n);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),ht(mt,mt.current),s)break;return null;case 22:case 23:return t.lanes=0,Ip(e,t,n)}return zn(e,t,n)}var Op,Pl,Ap,wp;Op=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&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.sibling.return=n.return,n=n.sibling}};Pl=function(){};Ap=function(e,t,n,s){var c=e.memoizedProps;if(c!==s){e=t.stateNode,wr(xn.current);var o=null;switch(n){case"input":c=Ja(e,c),s=Ja(e,s),o=[];break;case"select":c=St({},c,{value:void 0}),s=St({},s,{value:void 0}),o=[];break;case"textarea":c=tl(e,c),s=tl(e,s),o=[];break;default:typeof c.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=yo)}rl(n,s);var h;n=null;for(u in c)if(!s.hasOwnProperty(u)&&c.hasOwnProperty(u)&&c[u]!=null)if(u==="style"){var r=c[u];for(h in r)r.hasOwnProperty(h)&&(n||(n={}),n[h]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Js.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in s){var a=s[u];if(r=c!=null?c[u]:void 0,s.hasOwnProperty(u)&&a!==r&&(a!=null||r!=null))if(u==="style")if(r){for(h in r)!r.hasOwnProperty(h)||a&&a.hasOwnProperty(h)||(n||(n={}),n[h]="");for(h in a)a.hasOwnProperty(h)&&r[h]!==a[h]&&(n||(n={}),n[h]=a[h])}else n||(o||(o=[]),o.push(u,n)),n=a;else u==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,r=r?r.__html:void 0,a!=null&&r!==a&&(o=o||[]).push(u,a)):u==="children"?typeof a!="string"&&typeof a!="number"||(o=o||[]).push(u,""+a):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Js.hasOwnProperty(u)?(a!=null&&u==="onScroll"&&pt("scroll",e),o||r===a||(o=[])):(o=o||[]).push(u,a))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};wp=function(e,t,n,s){n!==s&&(t.flags|=4)};function Us(e,t){if(!gt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Vt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var c=e.child;c!==null;)n|=c.lanes|c.childLanes,s|=c.subtreeFlags&14680064,s|=c.flags&14680064,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)n|=c.lanes|c.childLanes,s|=c.subtreeFlags,s|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function Hg(e,t,n){var s=t.pendingProps;switch(mu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vt(t),null;case 1:return en(t.type)&&Io(),Vt(t),null;case 3:return s=t.stateNode,ms(),ft(Zt),ft(Ht),Nu(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Wi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,On!==null&&(kl(On),On=null))),Pl(e,t),Vt(t),null;case 5:vu(t);var c=wr(ci.current);if(n=t.type,e!==null&&t.stateNode!=null)Ap(e,t,n,s,c),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!s){if(t.stateNode===null)throw Error(Me(166));return Vt(t),null}if(e=wr(xn.current),Wi(t)){s=t.stateNode,n=t.type;var o=t.memoizedProps;switch(s[Ln]=t,s[li]=o,e=(t.mode&1)!==0,n){case"dialog":pt("cancel",s),pt("close",s);break;case"iframe":case"object":case"embed":pt("load",s);break;case"video":case"audio":for(c=0;c<$s.length;c++)pt($s[c],s);break;case"source":pt("error",s);break;case"img":case"image":case"link":pt("error",s),pt("load",s);break;case"details":pt("toggle",s);break;case"input":fc(s,o),pt("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!o.multiple},pt("invalid",s);break;case"textarea":gc(s,o),pt("invalid",s)}rl(n,o),c=null;for(var h in o)if(o.hasOwnProperty(h)){var r=o[h];h==="children"?typeof r=="string"?s.textContent!==r&&(o.suppressHydrationWarning!==!0&&$i(s.textContent,r,e),c=["children",r]):typeof r=="number"&&s.textContent!==""+r&&(o.suppressHydrationWarning!==!0&&$i(s.textContent,r,e),c=["children",""+r]):Js.hasOwnProperty(h)&&r!=null&&h==="onScroll"&&pt("scroll",s)}switch(n){case"input":bi(s),_c(s,o,!0);break;case"textarea":bi(s),mc(s);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(s.onclick=yo)}s=c,t.updateQueue=s,s!==null&&(t.flags|=4)}else{h=c.nodeType===9?c:c.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=rd(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=h.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=h.createElement(n,{is:s.is}):(e=h.createElement(n),n==="select"&&(h=e,s.multiple?h.multiple=!0:s.size&&(h.size=s.size))):e=h.createElementNS(e,n),e[Ln]=t,e[li]=s,Op(e,t,!1,!1),t.stateNode=e;e:{switch(h=sl(n,s),n){case"dialog":pt("cancel",e),pt("close",e),c=s;break;case"iframe":case"object":case"embed":pt("load",e),c=s;break;case"video":case"audio":for(c=0;c<$s.length;c++)pt($s[c],e);c=s;break;case"source":pt("error",e),c=s;break;case"img":case"image":case"link":pt("error",e),pt("load",e),c=s;break;case"details":pt("toggle",e),c=s;break;case"input":fc(e,s),c=Ja(e,s),pt("invalid",e);break;case"option":c=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},c=St({},s,{value:void 0}),pt("invalid",e);break;case"textarea":gc(e,s),c=tl(e,s),pt("invalid",e);break;default:c=s}rl(n,c),r=c;for(o in r)if(r.hasOwnProperty(o)){var a=r[o];o==="style"?od(e,a):o==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&sd(e,a)):o==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&Zs(e,a):typeof a=="number"&&Zs(e,""+a):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Js.hasOwnProperty(o)?a!=null&&o==="onScroll"&&pt("scroll",e):a!=null&&nu(e,o,a,h))}switch(n){case"input":bi(e),_c(e,s,!1);break;case"textarea":bi(e),mc(e);break;case"option":s.value!=null&&e.setAttribute("value",""+mr(s.value));break;case"select":e.multiple=!!s.multiple,o=s.value,o!=null?as(e,!!s.multiple,o,!1):s.defaultValue!=null&&as(e,!!s.multiple,s.defaultValue,!0);break;default:typeof c.onClick=="function"&&(e.onclick=yo)}switch(n){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Vt(t),null;case 6:if(e&&t.stateNode!=null)wp(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(Me(166));if(n=wr(ci.current),wr(xn.current),Wi(t)){if(s=t.stateNode,n=t.memoizedProps,s[Ln]=t,(o=s.nodeValue!==n)&&(e=an,e!==null))switch(e.tag){case 3:$i(s.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&$i(s.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else s=(n.nodeType===9?n:n.ownerDocument).createTextNode(s),s[Ln]=t,t.stateNode=s}return Vt(t),null;case 13:if(ft(mt),s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(gt&&on!==null&&t.mode&1&&!(t.flags&128))Yd(),_s(),t.flags|=98560,o=!1;else if(o=Wi(t),s!==null&&s.dehydrated!==null){if(e===null){if(!o)throw Error(Me(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(Me(317));o[Ln]=t}else _s(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Vt(t),o=!1}else On!==null&&(kl(On),On=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(s=s!==null,s!==(e!==null&&e.memoizedState!==null)&&s&&(t.child.flags|=8192,t.mode&1&&(e===null||mt.current&1?Lt===0&&(Lt=3):ku())),t.updateQueue!==null&&(t.flags|=4),Vt(t),null);case 4:return ms(),Pl(e,t),e===null&&oi(t.stateNode.containerInfo),Vt(t),null;case 10:return yu(t.type._context),Vt(t),null;case 17:return en(t.type)&&Io(),Vt(t),null;case 19:if(ft(mt),o=t.memoizedState,o===null)return Vt(t),null;if(s=(t.flags&128)!==0,h=o.rendering,h===null)if(s)Us(o,!1);else{if(Lt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(h=wo(e),h!==null){for(t.flags|=128,Us(o,!1),s=h.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=n,n=t.child;n!==null;)o=n,e=s,o.flags&=14680066,h=o.alternate,h===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=h.childLanes,o.lanes=h.lanes,o.child=h.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=h.memoizedProps,o.memoizedState=h.memoizedState,o.updateQueue=h.updateQueue,o.type=h.type,e=h.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ht(mt,mt.current&1|2),t.child}e=e.sibling}o.tail!==null&&Ot()>Ss&&(t.flags|=128,s=!0,Us(o,!1),t.lanes=4194304)}else{if(!s)if(e=wo(h),e!==null){if(t.flags|=128,s=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Us(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!gt)return Vt(t),null}else 2*Ot()-o.renderingStartTime>Ss&&n!==1073741824&&(t.flags|=128,s=!0,Us(o,!1),t.lanes=4194304);o.isBackwards?(h.sibling=t.child,t.child=h):(n=o.last,n!==null?n.sibling=h:t.child=h,o.last=h)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ot(),t.sibling=null,n=mt.current,ht(mt,s?n&1|2:n&1),t):(Vt(t),null);case 22:case 23:return Fu(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&t.mode&1?sn&1073741824&&(Vt(t),t.subtreeFlags&6&&(t.flags|=8192)):Vt(t),null;case 24:return null;case 25:return null}throw Error(Me(156,t.tag))}function Yg(e,t){switch(mu(t),t.tag){case 1:return en(t.type)&&Io(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ms(),ft(Zt),ft(Ht),Nu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return vu(t),null;case 13:if(ft(mt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Me(340));_s()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ft(mt),null;case 4:return ms(),null;case 10:return yu(t.type._context),null;case 22:case 23:return Fu(),null;case 24:return null;default:return null}}var ji=!1,jt=!1,zg=typeof WeakSet=="function"?WeakSet:Set,ke=null;function is(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){Rt(e,t,s)}else n.current=null}function Dl(e,t,n){try{n()}catch(s){Rt(e,t,s)}}var oh=!1;function Qg(e,t){if(fl=Eo,e=Ld(),_u(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var c=s.anchorOffset,o=s.focusNode;s=s.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var h=0,r=-1,a=-1,u=0,l=0,d=e,_=null;t:for(;;){for(var p;d!==n||c!==0&&d.nodeType!==3||(r=h+c),d!==o||s!==0&&d.nodeType!==3||(a=h+s),d.nodeType===3&&(h+=d.nodeValue.length),(p=d.firstChild)!==null;)_=d,d=p;for(;;){if(d===e)break t;if(_===n&&++u===c&&(r=h),_===o&&++l===s&&(a=h),(p=d.nextSibling)!==null)break;d=_,_=d.parentNode}d=p}n=r===-1||a===-1?null:{start:r,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(_l={focusedElem:e,selectionRange:n},Eo=!1,ke=t;ke!==null;)if(t=ke,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ke=e;else for(;ke!==null;){t=ke;try{var f=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(f!==null){var S=f.memoizedProps,C=f.memoizedState,g=t.stateNode,m=g.getSnapshotBeforeUpdate(t.elementType===t.type?S:Rn(t.type,S),C);g.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var T=t.stateNode.containerInfo;T.nodeType===1?T.textContent="":T.nodeType===9&&T.documentElement&&T.removeChild(T.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Me(163))}}catch(y){Rt(t,t.return,y)}if(e=t.sibling,e!==null){e.return=t.return,ke=e;break}ke=t.return}return f=oh,oh=!1,f}function Qs(e,t,n){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var c=s=s.next;do{if((c.tag&e)===e){var o=c.destroy;c.destroy=void 0,o!==void 0&&Dl(t,n,o)}c=c.next}while(c!==s)}}function Ko(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var s=n.create;n.destroy=s()}n=n.next}while(n!==t)}}function Ml(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Pp(e){var t=e.alternate;t!==null&&(e.alternate=null,Pp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ln],delete t[li],delete t[El],delete t[Dg],delete t[Mg])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Dp(e){return e.tag===5||e.tag===3||e.tag===4}function ah(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Dp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function bl(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,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=yo));else if(s!==4&&(e=e.child,e!==null))for(bl(e,t,n),e=e.sibling;e!==null;)bl(e,t,n),e=e.sibling}function Ll(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(Ll(e,t,n),e=e.sibling;e!==null;)Ll(e,t,n),e=e.sibling}var Ft=null,vn=!1;function Zn(e,t,n){for(n=n.child;n!==null;)Mp(e,t,n),n=n.sibling}function Mp(e,t,n){if(Un&&typeof Un.onCommitFiberUnmount=="function")try{Un.onCommitFiberUnmount(Wo,n)}catch{}switch(n.tag){case 5:jt||is(n,t);case 6:var s=Ft,c=vn;Ft=null,Zn(e,t,n),Ft=s,vn=c,Ft!==null&&(vn?(e=Ft,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ft.removeChild(n.stateNode));break;case 18:Ft!==null&&(vn?(e=Ft,n=n.stateNode,e.nodeType===8?Da(e.parentNode,n):e.nodeType===1&&Da(e,n),ri(e)):Da(Ft,n.stateNode));break;case 4:s=Ft,c=vn,Ft=n.stateNode.containerInfo,vn=!0,Zn(e,t,n),Ft=s,vn=c;break;case 0:case 11:case 14:case 15:if(!jt&&(s=n.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){c=s=s.next;do{var o=c,h=o.destroy;o=o.tag,h!==void 0&&(o&2||o&4)&&Dl(n,t,h),c=c.next}while(c!==s)}Zn(e,t,n);break;case 1:if(!jt&&(is(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=n.memoizedProps,s.state=n.memoizedState,s.componentWillUnmount()}catch(r){Rt(n,t,r)}Zn(e,t,n);break;case 21:Zn(e,t,n);break;case 22:n.mode&1?(jt=(s=jt)||n.memoizedState!==null,Zn(e,t,n),jt=s):Zn(e,t,n);break;default:Zn(e,t,n)}}function lh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new zg),t.forEach(function(s){var c=sm.bind(null,e,s);n.has(s)||(n.add(s),s.then(c,c))})}}function Cn(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var c=n[s];try{var o=e,h=t,r=h;e:for(;r!==null;){switch(r.tag){case 5:Ft=r.stateNode,vn=!1;break e;case 3:Ft=r.stateNode.containerInfo,vn=!0;break e;case 4:Ft=r.stateNode.containerInfo,vn=!0;break e}r=r.return}if(Ft===null)throw Error(Me(160));Mp(o,h,c),Ft=null,vn=!1;var a=c.alternate;a!==null&&(a.return=null),c.return=null}catch(u){Rt(c,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)bp(t,e),t=t.sibling}function bp(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Cn(t,e),Mn(e),s&4){try{Qs(3,e,e.return),Ko(3,e)}catch(S){Rt(e,e.return,S)}try{Qs(5,e,e.return)}catch(S){Rt(e,e.return,S)}}break;case 1:Cn(t,e),Mn(e),s&512&&n!==null&&is(n,n.return);break;case 5:if(Cn(t,e),Mn(e),s&512&&n!==null&&is(n,n.return),e.flags&32){var c=e.stateNode;try{Zs(c,"")}catch(S){Rt(e,e.return,S)}}if(s&4&&(c=e.stateNode,c!=null)){var o=e.memoizedProps,h=n!==null?n.memoizedProps:o,r=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{r==="input"&&o.type==="radio"&&o.name!=null&&td(c,o),sl(r,h);var u=sl(r,o);for(h=0;h<a.length;h+=2){var l=a[h],d=a[h+1];l==="style"?od(c,d):l==="dangerouslySetInnerHTML"?sd(c,d):l==="children"?Zs(c,d):nu(c,l,d,u)}switch(r){case"input":Za(c,o);break;case"textarea":nd(c,o);break;case"select":var _=c._wrapperState.wasMultiple;c._wrapperState.wasMultiple=!!o.multiple;var p=o.value;p!=null?as(c,!!o.multiple,p,!1):_!==!!o.multiple&&(o.defaultValue!=null?as(c,!!o.multiple,o.defaultValue,!0):as(c,!!o.multiple,o.multiple?[]:"",!1))}c[li]=o}catch(S){Rt(e,e.return,S)}}break;case 6:if(Cn(t,e),Mn(e),s&4){if(e.stateNode===null)throw Error(Me(162));c=e.stateNode,o=e.memoizedProps;try{c.nodeValue=o}catch(S){Rt(e,e.return,S)}}break;case 3:if(Cn(t,e),Mn(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{ri(t.containerInfo)}catch(S){Rt(e,e.return,S)}break;case 4:Cn(t,e),Mn(e);break;case 13:Cn(t,e),Mn(e),c=e.child,c.flags&8192&&(o=c.memoizedState!==null,c.stateNode.isHidden=o,!o||c.alternate!==null&&c.alternate.memoizedState!==null||(Uu=Ot())),s&4&&lh(e);break;case 22:if(l=n!==null&&n.memoizedState!==null,e.mode&1?(jt=(u=jt)||l,Cn(t,e),jt=u):Cn(t,e),Mn(e),s&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!l&&e.mode&1)for(ke=e,l=e.child;l!==null;){for(d=ke=l;ke!==null;){switch(_=ke,p=_.child,_.tag){case 0:case 11:case 14:case 15:Qs(4,_,_.return);break;case 1:is(_,_.return);var f=_.stateNode;if(typeof f.componentWillUnmount=="function"){s=_,n=_.return;try{t=s,f.props=t.memoizedProps,f.state=t.memoizedState,f.componentWillUnmount()}catch(S){Rt(s,n,S)}}break;case 5:is(_,_.return);break;case 22:if(_.memoizedState!==null){ch(d);continue}}p!==null?(p.return=_,ke=p):ch(d)}l=l.sibling}e:for(l=null,d=e;;){if(d.tag===5){if(l===null){l=d;try{c=d.stateNode,u?(o=c.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(r=d.stateNode,a=d.memoizedProps.style,h=a!=null&&a.hasOwnProperty("display")?a.display:null,r.style.display=id("display",h))}catch(S){Rt(e,e.return,S)}}}else if(d.tag===6){if(l===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(S){Rt(e,e.return,S)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;l===d&&(l=null),d=d.return}l===d&&(l=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Cn(t,e),Mn(e),s&4&&lh(e);break;case 21:break;default:Cn(t,e),Mn(e)}}function Mn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Dp(n)){var s=n;break e}n=n.return}throw Error(Me(160))}switch(s.tag){case 5:var c=s.stateNode;s.flags&32&&(Zs(c,""),s.flags&=-33);var o=ah(e);Ll(e,o,c);break;case 3:case 4:var h=s.stateNode.containerInfo,r=ah(e);bl(e,r,h);break;default:throw Error(Me(161))}}catch(a){Rt(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Kg(e,t,n){ke=e,Lp(e)}function Lp(e,t,n){for(var s=(e.mode&1)!==0;ke!==null;){var c=ke,o=c.child;if(c.tag===22&&s){var h=c.memoizedState!==null||ji;if(!h){var r=c.alternate,a=r!==null&&r.memoizedState!==null||jt;r=ji;var u=jt;if(ji=h,(jt=a)&&!u)for(ke=c;ke!==null;)h=ke,a=h.child,h.tag===22&&h.memoizedState!==null?hh(c):a!==null?(a.return=h,ke=a):hh(c);for(;o!==null;)ke=o,Lp(o),o=o.sibling;ke=c,ji=r,jt=u}uh(e)}else c.subtreeFlags&8772&&o!==null?(o.return=c,ke=o):uh(e)}}function uh(e){for(;ke!==null;){var t=ke;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:jt||Ko(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!jt)if(n===null)s.componentDidMount();else{var c=t.elementType===t.type?n.memoizedProps:Rn(t.type,n.memoizedProps);s.componentDidUpdate(c,n.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&Yc(t,o,s);break;case 3:var h=t.updateQueue;if(h!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Yc(t,h,n)}break;case 5:var r=t.stateNode;if(n===null&&t.flags&4){n=r;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var l=u.memoizedState;if(l!==null){var d=l.dehydrated;d!==null&&ri(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Me(163))}jt||t.flags&512&&Ml(t)}catch(_){Rt(t,t.return,_)}}if(t===e){ke=null;break}if(n=t.sibling,n!==null){n.return=t.return,ke=n;break}ke=t.return}}function ch(e){for(;ke!==null;){var t=ke;if(t===e){ke=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ke=n;break}ke=t.return}}function hh(e){for(;ke!==null;){var t=ke;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ko(4,t)}catch(a){Rt(t,n,a)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var c=t.return;try{s.componentDidMount()}catch(a){Rt(t,c,a)}}var o=t.return;try{Ml(t)}catch(a){Rt(t,o,a)}break;case 5:var h=t.return;try{Ml(t)}catch(a){Rt(t,h,a)}}}catch(a){Rt(t,t.return,a)}if(t===e){ke=null;break}var r=t.sibling;if(r!==null){r.return=t.return,ke=r;break}ke=t.return}}var Xg=Math.ceil,Mo=Kn.ReactCurrentDispatcher,bu=Kn.ReactCurrentOwner,Sn=Kn.ReactCurrentBatchConfig,it=0,xt=null,Pt=null,kt=0,sn=0,os=Tr(0),Lt=0,fi=null,Ur=0,Xo=0,Lu=0,Ks=null,Xt=null,Uu=0,Ss=1/0,Gn=null,bo=!1,Ul=null,dr=null,Hi=!1,ir=null,Lo=0,Xs=0,xl=null,io=-1,oo=0;function zt(){return it&6?Ot():io!==-1?io:io=Ot()}function pr(e){return e.mode&1?it&2&&kt!==0?kt&-kt:Lg.transition!==null?(oo===0&&(oo=Ed()),oo):(e=ut,e!==0||(e=window.event,e=e===void 0?16:vd(e.type)),e):1}function wn(e,t,n,s){if(50<Xs)throw Xs=0,xl=null,Error(Me(185));Ei(e,n,s),(!(it&2)||e!==xt)&&(e===xt&&(!(it&2)&&(Xo|=n),Lt===4&&rr(e,kt)),tn(e,s),n===1&&it===0&&!(t.mode&1)&&(Ss=Ot()+500,Yo&&yr()))}function tn(e,t){var n=e.callbackNode;L_(e,t);var s=mo(e,e===xt?kt:0);if(s===0)n!==null&&Tc(n),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(n!=null&&Tc(n),t===1)e.tag===0?bg(dh.bind(null,e)):Vd(dh.bind(null,e)),wg(function(){!(it&6)&&yr()}),n=null;else{switch(Sd(s)){case 1:n=au;break;case 4:n=gd;break;case 16:n=go;break;case 536870912:n=md;break;default:n=go}n=Wp(n,Up.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Up(e,t){if(io=-1,oo=0,it&6)throw Error(Me(327));var n=e.callbackNode;if(ds()&&e.callbackNode!==n)return null;var s=mo(e,e===xt?kt:0);if(s===0)return null;if(s&30||s&e.expiredLanes||t)t=Uo(e,s);else{t=s;var c=it;it|=2;var o=Fp();(xt!==e||kt!==t)&&(Gn=null,Ss=Ot()+500,Pr(e,t));do try{em();break}catch(r){xp(e,r)}while(!0);Tu(),Mo.current=o,it=c,Pt!==null?t=0:(xt=null,kt=0,t=Lt)}if(t!==0){if(t===2&&(c=ul(e),c!==0&&(s=c,t=Fl(e,c))),t===1)throw n=fi,Pr(e,0),rr(e,s),tn(e,Ot()),n;if(t===6)rr(e,s);else{if(c=e.current.alternate,!(s&30)&&!Jg(c)&&(t=Uo(e,s),t===2&&(o=ul(e),o!==0&&(s=o,t=Fl(e,o))),t===1))throw n=fi,Pr(e,0),rr(e,s),tn(e,Ot()),n;switch(e.finishedWork=c,e.finishedLanes=s,t){case 0:case 1:throw Error(Me(345));case 2:Nr(e,Xt,Gn);break;case 3:if(rr(e,s),(s&130023424)===s&&(t=Uu+500-Ot(),10<t)){if(mo(e,0)!==0)break;if(c=e.suspendedLanes,(c&s)!==s){zt(),e.pingedLanes|=e.suspendedLanes&c;break}e.timeoutHandle=ml(Nr.bind(null,e,Xt,Gn),t);break}Nr(e,Xt,Gn);break;case 4:if(rr(e,s),(s&4194240)===s)break;for(t=e.eventTimes,c=-1;0<s;){var h=31-An(s);o=1<<h,h=t[h],h>c&&(c=h),s&=~o}if(s=c,s=Ot()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*Xg(s/1960))-s,10<s){e.timeoutHandle=ml(Nr.bind(null,e,Xt,Gn),s);break}Nr(e,Xt,Gn);break;case 5:Nr(e,Xt,Gn);break;default:throw Error(Me(329))}}}return tn(e,Ot()),e.callbackNode===n?Up.bind(null,e):null}function Fl(e,t){var n=Ks;return e.current.memoizedState.isDehydrated&&(Pr(e,t).flags|=256),e=Uo(e,t),e!==2&&(t=Xt,Xt=n,t!==null&&kl(t)),e}function kl(e){Xt===null?Xt=e:Xt.push.apply(Xt,e)}function Jg(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var s=0;s<n.length;s++){var c=n[s],o=c.getSnapshot;c=c.value;try{if(!Pn(o(),c))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function rr(e,t){for(t&=~Lu,t&=~Xo,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-An(t),s=1<<n;e[n]=-1,t&=~s}}function dh(e){if(it&6)throw Error(Me(327));ds();var t=mo(e,0);if(!(t&1))return tn(e,Ot()),null;var n=Uo(e,t);if(e.tag!==0&&n===2){var s=ul(e);s!==0&&(t=s,n=Fl(e,s))}if(n===1)throw n=fi,Pr(e,0),rr(e,t),tn(e,Ot()),n;if(n===6)throw Error(Me(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Nr(e,Xt,Gn),tn(e,Ot()),null}function xu(e,t){var n=it;it|=1;try{return e(t)}finally{it=n,it===0&&(Ss=Ot()+500,Yo&&yr())}}function xr(e){ir!==null&&ir.tag===0&&!(it&6)&&ds();var t=it;it|=1;var n=Sn.transition,s=ut;try{if(Sn.transition=null,ut=1,e)return e()}finally{ut=s,Sn.transition=n,it=t,!(it&6)&&yr()}}function Fu(){sn=os.current,ft(os)}function Pr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Ag(n)),Pt!==null)for(n=Pt.return;n!==null;){var s=n;switch(mu(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&Io();break;case 3:ms(),ft(Zt),ft(Ht),Nu();break;case 5:vu(s);break;case 4:ms();break;case 13:ft(mt);break;case 19:ft(mt);break;case 10:yu(s.type._context);break;case 22:case 23:Fu()}n=n.return}if(xt=e,Pt=e=fr(e.current,null),kt=sn=t,Lt=0,fi=null,Lu=Xo=Ur=0,Xt=Ks=null,Ar!==null){for(t=0;t<Ar.length;t++)if(n=Ar[t],s=n.interleaved,s!==null){n.interleaved=null;var c=s.next,o=n.pending;if(o!==null){var h=o.next;o.next=c,s.next=h}n.pending=s}Ar=null}return e}function xp(e,t){do{var n=Pt;try{if(Tu(),no.current=Do,Po){for(var s=Et.memoizedState;s!==null;){var c=s.queue;c!==null&&(c.pending=null),s=s.next}Po=!1}if(Lr=0,Ut=bt=Et=null,zs=!1,hi=0,bu.current=null,n===null||n.return===null){Lt=1,fi=t,Pt=null;break}e:{var o=e,h=n.return,r=n,a=t;if(t=kt,r.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=a,l=r,d=l.tag;if(!(l.mode&1)&&(d===0||d===11||d===15)){var _=l.alternate;_?(l.updateQueue=_.updateQueue,l.memoizedState=_.memoizedState,l.lanes=_.lanes):(l.updateQueue=null,l.memoizedState=null)}var p=Zc(h);if(p!==null){p.flags&=-257,eh(p,h,r,o,t),p.mode&1&&Jc(o,u,t),t=p,a=u;var f=t.updateQueue;if(f===null){var S=new Set;S.add(a),t.updateQueue=S}else f.add(a);break e}else{if(!(t&1)){Jc(o,u,t),ku();break e}a=Error(Me(426))}}else if(gt&&r.mode&1){var C=Zc(h);if(C!==null){!(C.flags&65536)&&(C.flags|=256),eh(C,h,r,o,t),Eu(Es(a,r));break e}}o=a=Es(a,r),Lt!==4&&(Lt=2),Ks===null?Ks=[o]:Ks.push(o),o=h;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var g=Sp(o,a,t);Hc(o,g);break e;case 1:r=a;var m=o.type,T=o.stateNode;if(!(o.flags&128)&&(typeof m.getDerivedStateFromError=="function"||T!==null&&typeof T.componentDidCatch=="function"&&(dr===null||!dr.has(T)))){o.flags|=65536,t&=-t,o.lanes|=t;var y=Tp(o,r,t);Hc(o,y);break e}}o=o.return}while(o!==null)}Bp(n)}catch(E){t=E,Pt===n&&n!==null&&(Pt=n=n.return);continue}break}while(!0)}function Fp(){var e=Mo.current;return Mo.current=Do,e===null?Do:e}function ku(){(Lt===0||Lt===3||Lt===2)&&(Lt=4),xt===null||!(Ur&268435455)&&!(Xo&268435455)||rr(xt,kt)}function Uo(e,t){var n=it;it|=2;var s=Fp();(xt!==e||kt!==t)&&(Gn=null,Pr(e,t));do try{Zg();break}catch(c){xp(e,c)}while(!0);if(Tu(),it=n,Mo.current=s,Pt!==null)throw Error(Me(261));return xt=null,kt=0,Lt}function Zg(){for(;Pt!==null;)kp(Pt)}function em(){for(;Pt!==null&&!v_();)kp(Pt)}function kp(e){var t=$p(e.alternate,e,sn);e.memoizedProps=e.pendingProps,t===null?Bp(e):Pt=t,bu.current=null}function Bp(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Yg(n,t),n!==null){n.flags&=32767,Pt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Lt=6,Pt=null;return}}else if(n=Hg(n,t,sn),n!==null){Pt=n;return}if(t=t.sibling,t!==null){Pt=t;return}Pt=t=e}while(t!==null);Lt===0&&(Lt=5)}function Nr(e,t,n){var s=ut,c=Sn.transition;try{Sn.transition=null,ut=1,tm(e,t,n,s)}finally{Sn.transition=c,ut=s}return null}function tm(e,t,n,s){do ds();while(ir!==null);if(it&6)throw Error(Me(327));n=e.finishedWork;var c=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(Me(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(U_(e,o),e===xt&&(Pt=xt=null,kt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Hi||(Hi=!0,Wp(go,function(){return ds(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=Sn.transition,Sn.transition=null;var h=ut;ut=1;var r=it;it|=4,bu.current=null,Qg(e,n),bp(n,e),yg(_l),Eo=!!fl,_l=fl=null,e.current=n,Kg(n),N_(),it=r,ut=h,Sn.transition=o}else e.current=n;if(Hi&&(Hi=!1,ir=e,Lo=c),o=e.pendingLanes,o===0&&(dr=null),w_(n.stateNode),tn(e,Ot()),t!==null)for(s=e.onRecoverableError,n=0;n<t.length;n++)c=t[n],s(c.value,{componentStack:c.stack,digest:c.digest});if(bo)throw bo=!1,e=Ul,Ul=null,e;return Lo&1&&e.tag!==0&&ds(),o=e.pendingLanes,o&1?e===xl?Xs++:(Xs=0,xl=e):Xs=0,yr(),null}function ds(){if(ir!==null){var e=Sd(Lo),t=Sn.transition,n=ut;try{if(Sn.transition=null,ut=16>e?16:e,ir===null)var s=!1;else{if(e=ir,ir=null,Lo=0,it&6)throw Error(Me(331));var c=it;for(it|=4,ke=e.current;ke!==null;){var o=ke,h=o.child;if(ke.flags&16){var r=o.deletions;if(r!==null){for(var a=0;a<r.length;a++){var u=r[a];for(ke=u;ke!==null;){var l=ke;switch(l.tag){case 0:case 11:case 15:Qs(8,l,o)}var d=l.child;if(d!==null)d.return=l,ke=d;else for(;ke!==null;){l=ke;var _=l.sibling,p=l.return;if(Pp(l),l===u){ke=null;break}if(_!==null){_.return=p,ke=_;break}ke=p}}}var f=o.alternate;if(f!==null){var S=f.child;if(S!==null){f.child=null;do{var C=S.sibling;S.sibling=null,S=C}while(S!==null)}}ke=o}}if(o.subtreeFlags&2064&&h!==null)h.return=o,ke=h;else e:for(;ke!==null;){if(o=ke,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Qs(9,o,o.return)}var g=o.sibling;if(g!==null){g.return=o.return,ke=g;break e}ke=o.return}}var m=e.current;for(ke=m;ke!==null;){h=ke;var T=h.child;if(h.subtreeFlags&2064&&T!==null)T.return=h,ke=T;else e:for(h=m;ke!==null;){if(r=ke,r.flags&2048)try{switch(r.tag){case 0:case 11:case 15:Ko(9,r)}}catch(E){Rt(r,r.return,E)}if(r===h){ke=null;break e}var y=r.sibling;if(y!==null){y.return=r.return,ke=y;break e}ke=r.return}}if(it=c,yr(),Un&&typeof Un.onPostCommitFiberRoot=="function")try{Un.onPostCommitFiberRoot(Wo,e)}catch{}s=!0}return s}finally{ut=n,Sn.transition=t}}return!1}function ph(e,t,n){t=Es(n,t),t=Sp(e,t,1),e=hr(e,t,1),t=zt(),e!==null&&(Ei(e,1,t),tn(e,t))}function Rt(e,t,n){if(e.tag===3)ph(e,e,n);else for(;t!==null;){if(t.tag===3){ph(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(dr===null||!dr.has(s))){e=Es(n,e),e=Tp(t,e,1),t=hr(t,e,1),e=zt(),t!==null&&(Ei(t,1,e),tn(t,e));break}}t=t.return}}function nm(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),t=zt(),e.pingedLanes|=e.suspendedLanes&n,xt===e&&(kt&n)===n&&(Lt===4||Lt===3&&(kt&130023424)===kt&&500>Ot()-Uu?Pr(e,0):Lu|=n),tn(e,t)}function Gp(e,t){t===0&&(e.mode&1?(t=xi,xi<<=1,!(xi&130023424)&&(xi=4194304)):t=1);var n=zt();e=Yn(e,t),e!==null&&(Ei(e,t,n),tn(e,n))}function rm(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Gp(e,n)}function sm(e,t){var n=0;switch(e.tag){case 13:var s=e.stateNode,c=e.memoizedState;c!==null&&(n=c.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(Me(314))}s!==null&&s.delete(t),Gp(e,n)}var $p;$p=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Zt.current)Jt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Jt=!1,jg(e,t,n);Jt=!!(e.flags&131072)}else Jt=!1,gt&&t.flags&1048576&&jd(t,vo,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;so(e,t),e=t.pendingProps;var c=fs(t,Ht.current);hs(t,n),c=Au(null,t,s,e,c,n);var o=wu();return t.flags|=1,typeof c=="object"&&c!==null&&typeof c.render=="function"&&c.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,en(s)?(o=!0,Co(t)):o=!1,t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,Cu(t),c.updater=Qo,t.stateNode=c,c._reactInternals=t,Rl(t,s,e,n),t=Ol(null,t,s,!0,o,n)):(t.tag=0,gt&&o&&gu(t),Yt(null,t,c,n),t=t.child),t;case 16:s=t.elementType;e:{switch(so(e,t),e=t.pendingProps,c=s._init,s=c(s._payload),t.type=s,c=t.tag=om(s),e=Rn(s,e),c){case 0:t=Nl(null,t,s,e,n);break e;case 1:t=rh(null,t,s,e,n);break e;case 11:t=th(null,t,s,e,n);break e;case 14:t=nh(null,t,s,Rn(s.type,e),n);break e}throw Error(Me(306,s,""))}return t;case 0:return s=t.type,c=t.pendingProps,c=t.elementType===s?c:Rn(s,c),Nl(e,t,s,c,n);case 1:return s=t.type,c=t.pendingProps,c=t.elementType===s?c:Rn(s,c),rh(e,t,s,c,n);case 3:e:{if(Rp(t),e===null)throw Error(Me(387));s=t.pendingProps,o=t.memoizedState,c=o.element,Xd(e,t),Ao(t,s,null,n);var h=t.memoizedState;if(s=h.element,o.isDehydrated)if(o={element:s,isDehydrated:!1,cache:h.cache,pendingSuspenseBoundaries:h.pendingSuspenseBoundaries,transitions:h.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){c=Es(Error(Me(423)),t),t=sh(e,t,s,n,c);break e}else if(s!==c){c=Es(Error(Me(424)),t),t=sh(e,t,s,n,c);break e}else for(on=cr(t.stateNode.containerInfo.firstChild),an=t,gt=!0,On=null,n=Qd(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(_s(),s===c){t=zn(e,t,n);break e}Yt(e,t,s,n)}t=t.child}return t;case 5:return Jd(t),e===null&&yl(t),s=t.type,c=t.pendingProps,o=e!==null?e.memoizedProps:null,h=c.children,gl(s,c)?h=null:o!==null&&gl(s,o)&&(t.flags|=32),Cp(e,t),Yt(e,t,h,n),t.child;case 6:return e===null&&yl(t),null;case 13:return vp(e,t,n);case 4:return Ru(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=gs(t,null,s,n):Yt(e,t,s,n),t.child;case 11:return s=t.type,c=t.pendingProps,c=t.elementType===s?c:Rn(s,c),th(e,t,s,c,n);case 7:return Yt(e,t,t.pendingProps,n),t.child;case 8:return Yt(e,t,t.pendingProps.children,n),t.child;case 12:return Yt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(s=t.type._context,c=t.pendingProps,o=t.memoizedProps,h=c.value,ht(No,s._currentValue),s._currentValue=h,o!==null)if(Pn(o.value,h)){if(o.children===c.children&&!Zt.current){t=zn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var r=o.dependencies;if(r!==null){h=o.child;for(var a=r.firstContext;a!==null;){if(a.context===s){if(o.tag===1){a=Vn(-1,n&-n),a.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var l=u.pending;l===null?a.next=a:(a.next=l.next,l.next=a),u.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Il(o.return,n,t),r.lanes|=n;break}a=a.next}}else if(o.tag===10)h=o.type===t.type?null:o.child;else if(o.tag===18){if(h=o.return,h===null)throw Error(Me(341));h.lanes|=n,r=h.alternate,r!==null&&(r.lanes|=n),Il(h,n,t),h=o.sibling}else h=o.child;if(h!==null)h.return=o;else for(h=o;h!==null;){if(h===t){h=null;break}if(o=h.sibling,o!==null){o.return=h.return,h=o;break}h=h.return}o=h}Yt(e,t,c.children,n),t=t.child}return t;case 9:return c=t.type,s=t.pendingProps.children,hs(t,n),c=Tn(c),s=s(c),t.flags|=1,Yt(e,t,s,n),t.child;case 14:return s=t.type,c=Rn(s,t.pendingProps),c=Rn(s.type,c),nh(e,t,s,c,n);case 15:return yp(e,t,t.type,t.pendingProps,n);case 17:return s=t.type,c=t.pendingProps,c=t.elementType===s?c:Rn(s,c),so(e,t),t.tag=1,en(s)?(e=!0,Co(t)):e=!1,hs(t,n),Ep(t,s,c),Rl(t,s,c,n),Ol(null,t,s,!0,e,n);case 19:return Np(e,t,n);case 22:return Ip(e,t,n)}throw Error(Me(156,t.tag))};function Wp(e,t){return _d(e,t)}function im(e,t,n,s){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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function En(e,t,n,s){return new im(e,t,n,s)}function Bu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function om(e){if(typeof e=="function")return Bu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===su)return 11;if(e===iu)return 14}return 2}function fr(e,t){var n=e.alternate;return n===null?(n=En(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.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,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 ao(e,t,n,s,c,o){var h=2;if(s=e,typeof e=="function")Bu(e)&&(h=1);else if(typeof e=="string")h=5;else e:switch(e){case Kr:return Dr(n.children,c,o,t);case ru:h=8,c|=8;break;case za:return e=En(12,n,t,c|2),e.elementType=za,e.lanes=o,e;case Qa:return e=En(13,n,t,c),e.elementType=Qa,e.lanes=o,e;case Ka:return e=En(19,n,t,c),e.elementType=Ka,e.lanes=o,e;case Jh:return Jo(n,c,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Kh:h=10;break e;case Xh:h=9;break e;case su:h=11;break e;case iu:h=14;break e;case er:h=16,s=null;break e}throw Error(Me(130,e==null?e:typeof e,""))}return t=En(h,n,t,c),t.elementType=e,t.type=s,t.lanes=o,t}function Dr(e,t,n,s){return e=En(7,e,s,t),e.lanes=n,e}function Jo(e,t,n,s){return e=En(22,e,s,t),e.elementType=Jh,e.lanes=n,e.stateNode={isHidden:!1},e}function Ba(e,t,n){return e=En(6,e,null,t),e.lanes=n,e}function Ga(e,t,n){return t=En(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function am(e,t,n,s,c){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ta(0),this.expirationTimes=Ta(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ta(0),this.identifierPrefix=s,this.onRecoverableError=c,this.mutableSourceEagerHydrationData=null}function Gu(e,t,n,s,c,o,h,r,a){return e=new am(e,t,n,r,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=En(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:s,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Cu(o),e}function lm(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Qr,key:s==null?null:""+s,children:e,containerInfo:t,implementation:n}}function qp(e){if(!e)return Er;e=e._reactInternals;e:{if(kr(e)!==e||e.tag!==1)throw Error(Me(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(en(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Me(171))}if(e.tag===1){var n=e.type;if(en(n))return qd(e,n,t)}return t}function Vp(e,t,n,s,c,o,h,r,a){return e=Gu(n,s,!0,e,c,o,h,r,a),e.context=qp(null),n=e.current,s=zt(),c=pr(n),o=Vn(s,c),o.callback=t??null,hr(n,o,c),e.current.lanes=c,Ei(e,c,s),tn(e,s),e}function Zo(e,t,n,s){var c=t.current,o=zt(),h=pr(c);return n=qp(n),t.context===null?t.context=n:t.pendingContext=n,t=Vn(o,h),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=hr(c,t,h),e!==null&&(wn(e,c,h,o),to(e,c,h)),h}function xo(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 fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function $u(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function um(){return null}var jp=typeof reportError=="function"?reportError:function(e){console.error(e)};function Wu(e){this._internalRoot=e}ea.prototype.render=Wu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Me(409));Zo(e,t,null,null)};ea.prototype.unmount=Wu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xr(function(){Zo(null,e,null,null)}),t[Hn]=null}};function ea(e){this._internalRoot=e}ea.prototype.unstable_scheduleHydration=function(e){if(e){var t=Id();e={blockedOn:null,target:e,priority:t};for(var n=0;n<nr.length&&t!==0&&t<nr[n].priority;n++);nr.splice(n,0,e),n===0&&Rd(e)}};function qu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ta(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function _h(){}function cm(e,t,n,s,c){if(c){if(typeof s=="function"){var o=s;s=function(){var u=xo(h);o.call(u)}}var h=Vp(t,s,e,0,null,!1,!1,"",_h);return e._reactRootContainer=h,e[Hn]=h.current,oi(e.nodeType===8?e.parentNode:e),xr(),h}for(;c=e.lastChild;)e.removeChild(c);if(typeof s=="function"){var r=s;s=function(){var u=xo(a);r.call(u)}}var a=Gu(e,0,!1,null,null,!1,!1,"",_h);return e._reactRootContainer=a,e[Hn]=a.current,oi(e.nodeType===8?e.parentNode:e),xr(function(){Zo(t,a,n,s)}),a}function na(e,t,n,s,c){var o=n._reactRootContainer;if(o){var h=o;if(typeof c=="function"){var r=c;c=function(){var a=xo(h);r.call(a)}}Zo(t,h,e,c)}else h=cm(n,t,e,c,s);return xo(h)}Td=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Gs(t.pendingLanes);n!==0&&(lu(t,n|1),tn(t,Ot()),!(it&6)&&(Ss=Ot()+500,yr()))}break;case 13:xr(function(){var s=Yn(e,1);if(s!==null){var c=zt();wn(s,e,1,c)}}),$u(e,1)}};uu=function(e){if(e.tag===13){var t=Yn(e,134217728);if(t!==null){var n=zt();wn(t,e,134217728,n)}$u(e,134217728)}};yd=function(e){if(e.tag===13){var t=pr(e),n=Yn(e,t);if(n!==null){var s=zt();wn(n,e,t,s)}$u(e,t)}};Id=function(){return ut};Cd=function(e,t){var n=ut;try{return ut=e,t()}finally{ut=n}};ol=function(e,t,n){switch(t){case"input":if(Za(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 s=n[t];if(s!==e&&s.form===e.form){var c=Ho(s);if(!c)throw Error(Me(90));ed(s),Za(s,c)}}}break;case"textarea":nd(e,n);break;case"select":t=n.value,t!=null&&as(e,!!n.multiple,t,!1)}};ud=xu;cd=xr;var hm={usingClientEntryPoint:!1,Events:[Ti,es,Ho,ad,ld,xu]},xs={findFiberByHostInstance:Or,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},dm={bundleType:xs.bundleType,version:xs.version,rendererPackageName:xs.rendererPackageName,rendererConfig:xs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Kn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=pd(e),e===null?null:e.stateNode},findFiberByHostInstance:xs.findFiberByHostInstance||um,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Yi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yi.isDisabled&&Yi.supportsFiber)try{Wo=Yi.inject(dm),Un=Yi}catch{}}un.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=hm;un.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!qu(t))throw Error(Me(200));return lm(e,t,null,n)};un.createRoot=function(e,t){if(!qu(e))throw Error(Me(299));var n=!1,s="",c=jp;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=Gu(e,1,!1,null,null,n,!1,s,c),e[Hn]=t.current,oi(e.nodeType===8?e.parentNode:e),new Wu(t)};un.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(Me(188)):(e=Object.keys(e).join(","),Error(Me(268,e)));return e=pd(t),e=e===null?null:e.stateNode,e};un.flushSync=function(e){return xr(e)};un.hydrate=function(e,t,n){if(!ta(t))throw Error(Me(200));return na(null,e,t,!0,n)};un.hydrateRoot=function(e,t,n){if(!qu(e))throw Error(Me(405));var s=n!=null&&n.hydratedSources||null,c=!1,o="",h=jp;if(n!=null&&(n.unstable_strictMode===!0&&(c=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(h=n.onRecoverableError)),t=Vp(t,null,e,1,n??null,c,!1,o,h),e[Hn]=t.current,oi(e),s)for(e=0;e<s.length;e++)n=s[e],c=n._getVersion,c=c(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,c]:t.mutableSourceEagerHydrationData.push(n,c);return new ea(t)};un.render=function(e,t,n){if(!ta(t))throw Error(Me(200));return na(null,e,t,!1,n)};un.unmountComponentAtNode=function(e){if(!ta(e))throw Error(Me(40));return e._reactRootContainer?(xr(function(){na(null,null,e,!1,function(){e._reactRootContainer=null,e[Hn]=null})}),!0):!1};un.unstable_batchedUpdates=xu;un.unstable_renderSubtreeIntoContainer=function(e,t,n,s){if(!ta(n))throw Error(Me(200));if(e==null||e._reactInternals===void 0)throw Error(Me(38));return na(e,t,n,!1,s)};un.version="18.3.1-next-f1338f8080-20240426";function Hp(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Hp)}catch(e){console.error(e)}}Hp(),Hh.exports=un;var pm=Hh.exports,gh=pm;Ha.createRoot=gh.createRoot,Ha.hydrateRoot=gh.hydrateRoot;var Yp={exports:{}},fm="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",_m=fm,gm=_m;function zp(){}function Qp(){}Qp.resetWarningCache=zp;var mm=function(){function e(s,c,o,h,r,a){if(a!==gm){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Qp,resetWarningCache:zp};return n.PropTypes=n,n};Yp.exports=mm();var Em=Yp.exports;const Sm=Ql(Em),Tm=12e4,ym=3e4,Kp=Ae.createContext(null),Xp=({children:e})=>{const[t,n]=Ae.useState({}),[s,c]=Ae.useState(""),o=Ae.useCallback(a=>{if(!(a!=null&&a.agent_name)){console.warn("Invalid registration message received:",a);return}const u=a.agent_name;a.actions&&(a.actions=a.actions.filter(l=>l)),n(l=>({...l,[u]:{...a,lastUpdate:Date.now()}}))},[]);Ae.useEffect(()=>{const a=u=>{o(u.detail)};return window.addEventListener("agentRegistration",a),()=>window.removeEventListener("agentRegistration",a)},[o]),Ae.useEffect(()=>{const a=setInterval(()=>{const u=Date.now();n(l=>{const d={...l};let _=!1;return Object.entries(d).forEach(([p,f])=>{u-f.lastUpdate>Tm&&(delete d[p],_=!0)}),_?d:l})},ym);return()=>clearInterval(a)},[]);const h=Ae.useMemo(()=>{const a=s.toLowerCase();return Object.fromEntries(Object.entries(t).filter(([u,l])=>{var d;return u.toLowerCase().includes(a)||typeof l.description=="string"&&l.description.toLowerCase().includes(a)||((d=l.actions)==null?void 0:d.some(_=>{if(!_)return!1;const p=Object.keys(_)[0],f=_[p];return p.toLowerCase().includes(a)||typeof(f==null?void 0:f.desc)=="string"&&f.desc.toLowerCase().includes(a)}))}))},[t,s]),r={agents:t,filteredAgents:h,handleRegistration:o,searchFilter:s,setSearchFilter:c};return le.jsx(Kp.Provider,{value:r,children:e})};Xp.propTypes={children:Sm.node.isRequired};const Im=()=>{const e=Ae.useContext(Kp);if(!e)throw new Error("useAgentRegistrations must be used within an AgentRegistrationsProvider");return e};/**
|
|
41
41
|
* @remix-run/router v1.19.1
|
|
42
42
|
*
|
|
43
43
|
* Copyright (c) Remix Software Inc.
|
|
@@ -46,7 +46,7 @@ Error generating stack: `+o.message+`
|
|
|
46
46
|
* LICENSE.md file in the root directory of this source tree.
|
|
47
47
|
*
|
|
48
48
|
* @license MIT
|
|
49
|
-
*/function _i(){return _i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},_i.apply(this,arguments)}var or;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(or||(or={}));const
|
|
49
|
+
*/function _i(){return _i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},_i.apply(this,arguments)}var or;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(or||(or={}));const mh="popstate";function Cm(e){e===void 0&&(e={});function t(s,c){let{pathname:o,search:h,hash:r}=s.location;return Bl("",{pathname:o,search:h,hash:r},c.state&&c.state.usr||null,c.state&&c.state.key||"default")}function n(s,c){return typeof c=="string"?c:Fo(c)}return vm(t,n,null,e)}function vt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Jp(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Rm(){return Math.random().toString(36).substr(2,8)}function Eh(e,t){return{usr:e.state,key:e.key,idx:t}}function Bl(e,t,n,s){return n===void 0&&(n=null),_i({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Rs(t):t,{state:n,key:t&&t.key||s||Rm()})}function Fo(e){let{pathname:t="/",search:n="",hash:s=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),s&&s!=="#"&&(t+=s.charAt(0)==="#"?s:"#"+s),t}function Rs(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let s=e.indexOf("?");s>=0&&(t.search=e.substr(s),e=e.substr(0,s)),e&&(t.pathname=e)}return t}function vm(e,t,n,s){s===void 0&&(s={});let{window:c=document.defaultView,v5Compat:o=!1}=s,h=c.history,r=or.Pop,a=null,u=l();u==null&&(u=0,h.replaceState(_i({},h.state,{idx:u}),""));function l(){return(h.state||{idx:null}).idx}function d(){r=or.Pop;let C=l(),g=C==null?null:C-u;u=C,a&&a({action:r,location:S.location,delta:g})}function _(C,g){r=or.Push;let m=Bl(S.location,C,g);u=l()+1;let T=Eh(m,u),y=S.createHref(m);try{h.pushState(T,"",y)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;c.location.assign(y)}o&&a&&a({action:r,location:S.location,delta:1})}function p(C,g){r=or.Replace;let m=Bl(S.location,C,g);u=l();let T=Eh(m,u),y=S.createHref(m);h.replaceState(T,"",y),o&&a&&a({action:r,location:S.location,delta:0})}function f(C){let g=c.location.origin!=="null"?c.location.origin:c.location.href,m=typeof C=="string"?C:Fo(C);return m=m.replace(/ $/,"%20"),vt(g,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,g)}let S={get action(){return r},get location(){return e(c,h)},listen(C){if(a)throw new Error("A history only accepts one active listener");return c.addEventListener(mh,d),a=C,()=>{c.removeEventListener(mh,d),a=null}},createHref(C){return t(c,C)},createURL:f,encodeLocation(C){let g=f(C);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:_,replace:p,go(C){return h.go(C)}};return S}var Sh;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Sh||(Sh={}));function Nm(e,t,n){return n===void 0&&(n="/"),Om(e,t,n,!1)}function Om(e,t,n,s){let c=typeof t=="string"?Rs(t):t,o=Ts(c.pathname||"/",n);if(o==null)return null;let h=Zp(e);Am(h);let r=null;for(let a=0;r==null&&a<h.length;++a){let u=Bm(o);r=Fm(h[a],u,s)}return r}function Zp(e,t,n,s){t===void 0&&(t=[]),n===void 0&&(n=[]),s===void 0&&(s="");let c=(o,h,r)=>{let a={relativePath:r===void 0?o.path||"":r,caseSensitive:o.caseSensitive===!0,childrenIndex:h,route:o};a.relativePath.startsWith("/")&&(vt(a.relativePath.startsWith(s),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+s+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(s.length));let u=_r([s,a.relativePath]),l=n.concat(a);o.children&&o.children.length>0&&(vt(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Zp(o.children,t,l,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:Um(u,o.index),routesMeta:l})};return e.forEach((o,h)=>{var r;if(o.path===""||!((r=o.path)!=null&&r.includes("?")))c(o,h);else for(let a of ef(o.path))c(o,h,a)}),t}function ef(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,c=n.endsWith("?"),o=n.replace(/\?$/,"");if(s.length===0)return c?[o,""]:[o];let h=ef(s.join("/")),r=[];return r.push(...h.map(a=>a===""?o:[o,a].join("/"))),c&&r.push(...h),r.map(a=>e.startsWith("/")&&a===""?"/":a)}function Am(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:xm(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}const wm=/^:[\w-]+$/,Pm=3,Dm=2,Mm=1,bm=10,Lm=-2,Th=e=>e==="*";function Um(e,t){let n=e.split("/"),s=n.length;return n.some(Th)&&(s+=Lm),t&&(s+=Dm),n.filter(c=>!Th(c)).reduce((c,o)=>c+(wm.test(o)?Pm:o===""?Mm:bm),s)}function xm(e,t){return e.length===t.length&&e.slice(0,-1).every((s,c)=>s===t[c])?e[e.length-1]-t[t.length-1]:0}function Fm(e,t,n){let{routesMeta:s}=e,c={},o="/",h=[];for(let r=0;r<s.length;++r){let a=s[r],u=r===s.length-1,l=o==="/"?t:t.slice(o.length)||"/",d=ko({path:a.relativePath,caseSensitive:a.caseSensitive,end:u},l),_=a.route;if(!d&&u&&n&&!s[s.length-1].route.index&&(d=ko({path:a.relativePath,caseSensitive:a.caseSensitive,end:!1},l)),!d)return null;Object.assign(c,d.params),h.push({params:c,pathname:_r([o,d.pathname]),pathnameBase:qm(_r([o,d.pathnameBase])),route:_}),d.pathnameBase!=="/"&&(o=_r([o,d.pathnameBase]))}return h}function ko(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=km(e.path,e.caseSensitive,e.end),c=t.match(n);if(!c)return null;let o=c[0],h=o.replace(/(.)\/+$/,"$1"),r=c.slice(1);return{params:s.reduce((u,l,d)=>{let{paramName:_,isOptional:p}=l;if(_==="*"){let S=r[d]||"";h=o.slice(0,o.length-S.length).replace(/(.)\/+$/,"$1")}const f=r[d];return p&&!f?u[_]=void 0:u[_]=(f||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:h,pattern:e}}function km(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Jp(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let s=[],c="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,r,a)=>(s.push({paramName:r,isOptional:a!=null}),a?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(s.push({paramName:"*"}),c+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?c+="\\/*$":e!==""&&e!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,t?void 0:"i"),s]}function Bm(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Jp(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Ts(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}function Gm(e,t){t===void 0&&(t="/");let{pathname:n,search:s="",hash:c=""}=typeof e=="string"?Rs(e):e;return{pathname:n?n.startsWith("/")?n:$m(n,t):t,search:Vm(s),hash:jm(c)}}function $m(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(c=>{c===".."?n.length>1&&n.pop():c!=="."&&n.push(c)}),n.length>1?n.join("/"):"/"}function $a(e,t,n,s){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(s)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Wm(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function tf(e,t){let n=Wm(e);return t?n.map((s,c)=>c===n.length-1?s.pathname:s.pathnameBase):n.map(s=>s.pathnameBase)}function nf(e,t,n,s){s===void 0&&(s=!1);let c;typeof e=="string"?c=Rs(e):(c=_i({},e),vt(!c.pathname||!c.pathname.includes("?"),$a("?","pathname","search",c)),vt(!c.pathname||!c.pathname.includes("#"),$a("#","pathname","hash",c)),vt(!c.search||!c.search.includes("#"),$a("#","search","hash",c)));let o=e===""||c.pathname==="",h=o?"/":c.pathname,r;if(h==null)r=n;else{let d=t.length-1;if(!s&&h.startsWith("..")){let _=h.split("/");for(;_[0]==="..";)_.shift(),d-=1;c.pathname=_.join("/")}r=d>=0?t[d]:"/"}let a=Gm(c,r),u=h&&h!=="/"&&h.endsWith("/"),l=(o||h===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(u||l)&&(a.pathname+="/"),a}const _r=e=>e.join("/").replace(/\/\/+/g,"/"),qm=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Vm=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,jm=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Hm(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const rf=["post","put","patch","delete"];new Set(rf);const Ym=["get",...rf];new Set(Ym);/**
|
|
50
50
|
* React Router v6.26.1
|
|
51
51
|
*
|
|
52
52
|
* Copyright (c) Remix Software Inc.
|
|
@@ -55,7 +55,7 @@ Error generating stack: `+o.message+`
|
|
|
55
55
|
* LICENSE.md file in the root directory of this source tree.
|
|
56
56
|
*
|
|
57
57
|
* @license MIT
|
|
58
|
-
*/function gi(){return gi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},gi.apply(this,arguments)}const ra=Ae.createContext(null),
|
|
58
|
+
*/function gi(){return gi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},gi.apply(this,arguments)}const ra=Ae.createContext(null),sf=Ae.createContext(null),Ir=Ae.createContext(null),sa=Ae.createContext(null),Br=Ae.createContext({outlet:null,matches:[],isDataRoute:!1}),of=Ae.createContext(null);function zm(e,t){let{relative:n}=t===void 0?{}:t;Ii()||vt(!1);let{basename:s,navigator:c}=Ae.useContext(Ir),{hash:o,pathname:h,search:r}=ia(e,{relative:n}),a=h;return s!=="/"&&(a=h==="/"?s:_r([s,h])),c.createHref({pathname:a,search:r,hash:o})}function Ii(){return Ae.useContext(sa)!=null}function Ci(){return Ii()||vt(!1),Ae.useContext(sa).location}function af(e){Ae.useContext(Ir).static||Ae.useLayoutEffect(e)}function Qm(){let{isDataRoute:e}=Ae.useContext(Br);return e?lE():Km()}function Km(){Ii()||vt(!1);let e=Ae.useContext(ra),{basename:t,future:n,navigator:s}=Ae.useContext(Ir),{matches:c}=Ae.useContext(Br),{pathname:o}=Ci(),h=JSON.stringify(tf(c,n.v7_relativeSplatPath)),r=Ae.useRef(!1);return af(()=>{r.current=!0}),Ae.useCallback(function(u,l){if(l===void 0&&(l={}),!r.current)return;if(typeof u=="number"){s.go(u);return}let d=nf(u,JSON.parse(h),o,l.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:_r([t,d.pathname])),(l.replace?s.replace:s.push)(d,l.state,l)},[t,s,h,o,e])}function ia(e,t){let{relative:n}=t===void 0?{}:t,{future:s}=Ae.useContext(Ir),{matches:c}=Ae.useContext(Br),{pathname:o}=Ci(),h=JSON.stringify(tf(c,s.v7_relativeSplatPath));return Ae.useMemo(()=>nf(e,JSON.parse(h),o,n==="path"),[e,h,o,n])}function Xm(e,t){return Jm(e,t)}function Jm(e,t,n,s){Ii()||vt(!1);let{navigator:c}=Ae.useContext(Ir),{matches:o}=Ae.useContext(Br),h=o[o.length-1],r=h?h.params:{};h&&h.pathname;let a=h?h.pathnameBase:"/";h&&h.route;let u=Ci(),l;if(t){var d;let C=typeof t=="string"?Rs(t):t;a==="/"||(d=C.pathname)!=null&&d.startsWith(a)||vt(!1),l=C}else l=u;let _=l.pathname||"/",p=_;if(a!=="/"){let C=a.replace(/^\//,"").split("/");p="/"+_.replace(/^\//,"").split("/").slice(C.length).join("/")}let f=Nm(e,{pathname:p}),S=rE(f&&f.map(C=>Object.assign({},C,{params:Object.assign({},r,C.params),pathname:_r([a,c.encodeLocation?c.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?a:_r([a,c.encodeLocation?c.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),o,n,s);return t&&S?Ae.createElement(sa.Provider,{value:{location:gi({pathname:"/",search:"",hash:"",state:null,key:"default"},l),navigationType:or.Pop}},S):S}function Zm(){let e=aE(),t=Hm(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,c={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return Ae.createElement(Ae.Fragment,null,Ae.createElement("h2",null,"Unexpected Application Error!"),Ae.createElement("h3",{style:{fontStyle:"italic"}},t),n?Ae.createElement("pre",{style:c},n):null,null)}const eE=Ae.createElement(Zm,null);class tE extends Ae.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?Ae.createElement(Br.Provider,{value:this.props.routeContext},Ae.createElement(of.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function nE(e){let{routeContext:t,match:n,children:s}=e,c=Ae.useContext(ra);return c&&c.static&&c.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=n.route.id),Ae.createElement(Br.Provider,{value:t},s)}function rE(e,t,n,s){var c;if(t===void 0&&(t=[]),n===void 0&&(n=null),s===void 0&&(s=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=s)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let h=e,r=(c=n)==null?void 0:c.errors;if(r!=null){let l=h.findIndex(d=>d.route.id&&(r==null?void 0:r[d.route.id])!==void 0);l>=0||vt(!1),h=h.slice(0,Math.min(h.length,l+1))}let a=!1,u=-1;if(n&&s&&s.v7_partialHydration)for(let l=0;l<h.length;l++){let d=h[l];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=l),d.route.id){let{loaderData:_,errors:p}=n,f=d.route.loader&&_[d.route.id]===void 0&&(!p||p[d.route.id]===void 0);if(d.route.lazy||f){a=!0,u>=0?h=h.slice(0,u+1):h=[h[0]];break}}}return h.reduceRight((l,d,_)=>{let p,f=!1,S=null,C=null;n&&(p=r&&d.route.id?r[d.route.id]:void 0,S=d.route.errorElement||eE,a&&(u<0&&_===0?(f=!0,C=null):u===_&&(f=!0,C=d.route.hydrateFallbackElement||null)));let g=t.concat(h.slice(0,_+1)),m=()=>{let T;return p?T=S:f?T=C:d.route.Component?T=Ae.createElement(d.route.Component,null):d.route.element?T=d.route.element:T=l,Ae.createElement(nE,{match:d,routeContext:{outlet:l,matches:g,isDataRoute:n!=null},children:T})};return n&&(d.route.ErrorBoundary||d.route.errorElement||_===0)?Ae.createElement(tE,{location:n.location,revalidation:n.revalidation,component:S,error:p,children:m(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):m()},null)}var lf=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(lf||{}),Bo=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Bo||{});function sE(e){let t=Ae.useContext(ra);return t||vt(!1),t}function iE(e){let t=Ae.useContext(sf);return t||vt(!1),t}function oE(e){let t=Ae.useContext(Br);return t||vt(!1),t}function uf(e){let t=oE(),n=t.matches[t.matches.length-1];return n.route.id||vt(!1),n.route.id}function aE(){var e;let t=Ae.useContext(of),n=iE(Bo.UseRouteError),s=uf(Bo.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[s]}function lE(){let{router:e}=sE(lf.UseNavigateStable),t=uf(Bo.UseNavigateStable),n=Ae.useRef(!1);return af(()=>{n.current=!0}),Ae.useCallback(function(c,o){o===void 0&&(o={}),n.current&&(typeof c=="number"?e.navigate(c):e.navigate(c,gi({fromRouteId:t},o)))},[e,t])}function Gl(e){vt(!1)}function uE(e){let{basename:t="/",children:n=null,location:s,navigationType:c=or.Pop,navigator:o,static:h=!1,future:r}=e;Ii()&&vt(!1);let a=t.replace(/^\/*/,"/"),u=Ae.useMemo(()=>({basename:a,navigator:o,static:h,future:gi({v7_relativeSplatPath:!1},r)}),[a,r,o,h]);typeof s=="string"&&(s=Rs(s));let{pathname:l="/",search:d="",hash:_="",state:p=null,key:f="default"}=s,S=Ae.useMemo(()=>{let C=Ts(l,a);return C==null?null:{location:{pathname:C,search:d,hash:_,state:p,key:f},navigationType:c}},[a,l,d,_,p,f,c]);return S==null?null:Ae.createElement(Ir.Provider,{value:u},Ae.createElement(sa.Provider,{children:n,value:S}))}function cE(e){let{children:t,location:n}=e;return Xm($l(t),n)}new Promise(()=>{});function $l(e,t){t===void 0&&(t=[]);let n=[];return Ae.Children.forEach(e,(s,c)=>{if(!Ae.isValidElement(s))return;let o=[...t,c];if(s.type===Ae.Fragment){n.push.apply(n,$l(s.props.children,o));return}s.type!==Gl&&vt(!1),!s.props.index||!s.props.children||vt(!1);let h={id:s.props.id||o.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(h.children=$l(s.props.children,o)),n.push(h)}),n}/**
|
|
59
59
|
* React Router DOM v6.26.1
|
|
60
60
|
*
|
|
61
61
|
* Copyright (c) Remix Software Inc.
|
|
@@ -64,46 +64,46 @@ Error generating stack: `+o.message+`
|
|
|
64
64
|
* LICENSE.md file in the root directory of this source tree.
|
|
65
65
|
*
|
|
66
66
|
* @license MIT
|
|
67
|
-
*/function Go(){return Go=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Go.apply(this,arguments)}function of(e,t){if(e==null)return{};var n={},s=Object.keys(e),c,o;for(o=0;o<s.length;o++)c=s[o],!(t.indexOf(c)>=0)&&(n[c]=e[c]);return n}function nE(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function rE(e,t){return e.button===0&&(!t||t==="_self")&&!nE(e)}const sE=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],iE=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],oE="6";try{window.__reactRouterVersion=oE}catch{}const aE=Ae.createContext({isTransitioning:!1}),lE="startTransition",Th=Jf[lE];function uE(e){let{basename:t,children:n,future:s,window:c}=e,o=Ae.useRef();o.current==null&&(o.current=fm({window:c,v5Compat:!0}));let h=o.current,[r,a]=Ae.useState({action:h.action,location:h.location}),{v7_startTransition:u}=s||{},l=Ae.useCallback(d=>{u&&Th?Th(()=>a(d)):a(d)},[a,u]);return Ae.useLayoutEffect(()=>h.listen(l),[h,l]),Ae.createElement(eE,{basename:t,children:n,location:r.location,navigationType:r.action,navigator:h,future:s})}const cE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",hE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,dE=Ae.forwardRef(function(t,n){let{onClick:s,relative:c,reloadDocument:o,replace:h,state:r,target:a,to:u,preventScrollReset:l,unstable_viewTransition:d}=t,f=of(t,sE),{basename:p}=Ae.useContext(Ir),_,S=!1;if(typeof u=="string"&&hE.test(u)&&(_=u,cE))try{let T=new URL(window.location.href),y=u.startsWith("//")?new URL(T.protocol+u):new URL(u),E=Ts(y.pathname,p);y.origin===T.origin&&E!=null?u=E+y.search+y.hash:S=!0}catch{}let C=Bm(u,{relative:c}),g=fE(u,{replace:h,state:r,target:a,preventScrollReset:l,relative:c,unstable_viewTransition:d});function m(T){s&&s(T),T.defaultPrevented||g(T)}return Ae.createElement("a",Go({},f,{href:_||C,onClick:S||o?s:m,ref:n,target:a}))}),yh=Ae.forwardRef(function(t,n){let{"aria-current":s="page",caseSensitive:c=!1,className:o="",end:h=!1,style:r,to:a,unstable_viewTransition:u,children:l}=t,d=of(t,iE),f=ia(a,{relative:d.relative}),p=Ci(),_=Ae.useContext(ef),{navigator:S,basename:C}=Ae.useContext(Ir),g=_!=null&&_E(f)&&u===!0,m=S.encodeLocation?S.encodeLocation(f).pathname:f.pathname,T=p.pathname,y=_&&_.navigation&&_.navigation.location?_.navigation.location.pathname:null;c||(T=T.toLowerCase(),y=y?y.toLowerCase():null,m=m.toLowerCase()),y&&C&&(y=Ts(y,C)||y);const E=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let I=T===m||!h&&T.startsWith(m)&&T.charAt(E)==="/",N=y!=null&&(y===m||!h&&y.startsWith(m)&&y.charAt(m.length)==="/"),A={isActive:I,isPending:N,isTransitioning:g},L=I?s:void 0,D;typeof o=="function"?D=o(A):D=[o,I?"active":null,N?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let q=typeof r=="function"?r(A):r;return Ae.createElement(dE,Go({},d,{"aria-current":L,className:D,ref:n,style:q,to:a,unstable_viewTransition:u}),typeof l=="function"?l(A):l)});var Wl;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Wl||(Wl={}));var Ih;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ih||(Ih={}));function pE(e){let t=Ae.useContext(ra);return t||vt(!1),t}function fE(e,t){let{target:n,replace:s,state:c,preventScrollReset:o,relative:h,unstable_viewTransition:r}=t===void 0?{}:t,a=Gm(),u=Ci(),l=ia(e,{relative:h});return Ae.useCallback(d=>{if(rE(d,n)){d.preventDefault();let f=s!==void 0?s:Fo(u)===Fo(l);a(e,{replace:f,state:c,preventScrollReset:o,relative:h,unstable_viewTransition:r})}},[u,a,l,s,c,n,e,o,h,r])}function _E(e,t){t===void 0&&(t={});let n=Ae.useContext(aE);n==null&&vt(!1);let{basename:s}=pE(Wl.useViewTransitionState),c=ia(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=Ts(n.currentLocation.pathname,s)||n.currentLocation.pathname,h=Ts(n.nextLocation.pathname,s)||n.nextLocation.pathname;return ko(c.pathname,h)!=null||ko(c.pathname,o)!=null}const gE=({stimuli:e,selectedStimulusId:t,onSelectStimulus:n})=>{const s=(o,h)=>o?o.length<=h?o:o.slice(0,h)+"...":"No text content",c=o=>new Date(o).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0});return Object.keys(e).length===0?le.jsx("div",{className:"stimulus-list",children:le.jsx("div",{className:"placeholder-message",children:"No stimuli available. New stimuli will appear here."})}):le.jsx("div",{className:"stimulus-list",children:Object.entries(e).map(([o,h])=>le.jsxs("div",{className:`stimulus-item ${t===o?"selected":""}`,onClick:()=>n(o),children:[le.jsxs("div",{className:"stimulus-header",children:[le.jsx("span",{className:"user-email",children:h.content.identity||"No identity"}),le.jsx("span",{className:"timestamp",children:c(h.timestamp)})]}),le.jsx("pre",{className:"stimulus-text",children:s(h.content.text,200)})]},o))})},mE=({message:e,elapsedTime:t})=>{const[n,s]=Ae.useState(!1),c=e.content.text||"No text content",o=c.length>1e3,h=n?c:o?c.slice(0,1e3):c;return le.jsxs("div",{className:"message-box stimulus",children:[le.jsxs("div",{className:"message-header",children:[le.jsx("span",{className:"message-type",children:"Stimulus from originator"}),le.jsx("span",{className:"elapsed-time",children:t})]}),le.jsxs("div",{className:"message-content",children:[h,o&&le.jsx("button",{className:"more-button",onClick:()=>s(!n),children:n?"Less":"More..."})]})]})},Ch=({message:e,elapsedTime:t,isStreaming:n,isComplete:s})=>{const[c,o]=Ae.useState(!1),h=e.content.text||"No response text",r=h.length>1e3,a=c?h:r?h.slice(0,1e3):h;return le.jsxs("div",{className:`message-box response ${n?"streaming":""} ${s?"complete":""}`,children:[le.jsxs("div",{className:"message-header",children:[le.jsxs("span",{className:"message-type",children:[s?"Response Complete":n?"Streaming Response":"Response to originator",n&&!e.content.last_chunk&&" (In Progress)"]}),le.jsx("span",{className:"elapsed-time",children:t})]}),!s&&le.jsxs("div",{className:"message-content",children:[a,r&&le.jsx("button",{className:"more-button",onClick:()=>o(!c),children:c?"Less":"More..."})]}),e.content.files&&e.content.files.length>0&&le.jsxs("div",{className:"file-list",children:[le.jsx("h4",{children:"Files:"}),le.jsx("ul",{children:e.content.files.map((u,l)=>le.jsx("li",{children:u.name},l))})]})]})},EE=({message:e,elapsedTime:t,response:n})=>{const{agent_name:s,action_name:c,action_params:o}=e.content;return le.jsxs("div",{className:"message-box action-request",children:[le.jsxs("div",{className:"message-header",children:[le.jsxs("div",{className:"action-header",children:[le.jsx("span",{className:"action-request-label",children:"Action Request"}),le.jsx("span",{className:"agent-name",children:s}),le.jsx("span",{className:"action-name",children:c})]}),le.jsx("span",{className:"elapsed-time",children:t})]}),le.jsx("div",{className:"message-content",children:le.jsxs("div",{className:"action-params",children:[le.jsx("h4",{children:"Action Parameters:"}),le.jsx("ul",{children:Object.entries(o).map(([h,r])=>le.jsxs("li",{children:[le.jsxs("strong",{children:[h,":"]})," ",JSON.stringify(r)]},h))})]})}),n&&le.jsxs("div",{className:"action-response",children:[le.jsx("h4",{children:"Response:"}),le.jsx("p",{children:n.content.message})]})]})},SE=({message:e,elapsedTime:t})=>{const[n,s]=Ae.useState(!1),c=e.content.text||"No reinvoke content",o=c.length>1e3,h=n?c:o?c.slice(0,1e3):c;return le.jsxs("div",{className:"message-box orchestrator-reinvoke",children:[le.jsxs("div",{className:"message-header",children:[le.jsx("span",{className:"message-type",children:"Orchestrator Reinvoke"}),le.jsx("span",{className:"elapsed-time",children:t})]}),le.jsxs("div",{className:"message-content",children:[le.jsx("p",{children:h}),o&&le.jsx("button",{className:"more-button",onClick:()=>s(!n),children:n?"Less":"More..."})]})]})},af=({message:e,elapsedTime:t})=>{const[n,s]=Ae.useState(!1);return le.jsxs("div",{className:"message-box llm-service-response",children:[le.jsxs("div",{className:"message-header",children:[le.jsx("span",{className:"message-type",children:"LLM Service Response"}),le.jsx("span",{className:"elapsed-time",children:t})]}),le.jsxs("div",{className:"message-content",children:[n?le.jsx("pre",{children:JSON.stringify(e.content,null,2)}):le.jsxs("p",{children:[JSON.stringify(e.content).slice(0,100),"..."]}),le.jsx("button",{className:"more-button",onClick:()=>s(!n),children:n?"Show Less":"Show More"})]})]})},TE=({message:e,elapsedTime:t})=>{const[n,s]=Ae.useState(!1);return le.jsxs("div",{className:"message-box llm-service-request",children:[le.jsxs("div",{className:"message-header",children:[le.jsx("span",{className:"message-type",children:"LLM Service Request"}),le.jsx("span",{className:"elapsed-time",children:t})]}),le.jsxs("div",{className:"message-content",children:[n?le.jsx("pre",{children:JSON.stringify(e.content,null,2)}):le.jsxs("p",{children:[JSON.stringify(e.content).slice(0,100),"..."]}),le.jsx("button",{className:"more-button",onClick:()=>s(!n),children:n?"Show Less":"Show More"})]}),e.response&&le.jsx(af,{message:e.response,elapsedTime:e.response.elapsedTime})]})},yE=({selectedStimulus:e})=>{if(!e)return le.jsx("div",{className:"message-flow",children:le.jsx("div",{className:"placeholder-message",children:"Select a stimulus to view details"})});const t=(s,c,o)=>{const h=`${((new Date(s.timestamp)-new Date(c))/1e3).toFixed(2)}s`;switch(s.type){case"stimulus":return le.jsx(mE,{message:s,elapsedTime:h});case"response":case"streamingResponse":return le.jsx(Ch,{message:s,elapsedTime:h,isStreaming:s.type==="streamingResponse"});case"responseComplete":return le.jsx(Ch,{message:s,elapsedTime:h,isComplete:!0});case"actionRequest":{const r=o[`${s.content.action_list_id}-${s.content.action_idx}`];return le.jsx(EE,{message:s,elapsedTime:h,response:r})}case"orchestratorReinvoke":return le.jsx(SE,{message:s,elapsedTime:h});case"llmServiceRequest":return le.jsx(TE,{message:s,elapsedTime:h});case"llmServiceResponse":return le.jsx(af,{message:s,elapsedTime:h});default:return null}},n=e.responses.reduce((s,c)=>{if(c.type==="actionResponse"){const o=`${c.content.action_list_id}-${c.content.action_idx}`;s[o]=c}return s},{});return le.jsxs("div",{className:"message-flow",children:[t(e,e.timestamp,n),e.responses.filter(s=>s.type!=="actionResponse").map((s,c)=>t(s,e.timestamp,n))]})},Rh="AgenticAIDB",IE=1,Qn="stimuli",qu=()=>new Promise((e,t)=>{const n=indexedDB.open(Rh,IE);n.onerror=s=>t(s.target.error),n.onsuccess=s=>{const c=s.target.result;if(c.objectStoreNames.contains(Qn))e(c);else{c.close();const o=indexedDB.open(Rh,c.version+1);o.onupgradeneeded=vh,o.onsuccess=h=>e(h.target.result),o.onerror=h=>t(h.target.error)}},n.onupgradeneeded=vh}),vh=e=>{const t=e.target.result;t.objectStoreNames.contains(Qn)||t.createObjectStore(Qn,{keyPath:"stimulus_uuid"})},Nh=async e=>{const s=(await qu()).transaction([Qn],"readwrite").objectStore(Qn);return new Promise((c,o)=>{if(!e||!e.stimulus_uuid){console.warn("Invalid stimulus or missing stimulus_uuid",e),c();return}const h=typeof e.stimulus_uuid=="object"&&e.stimulus_uuid._value?e.stimulus_uuid._value:e.stimulus_uuid;if(!h){console.warn("Invalid key for stimulus",e),c();return}const r=s.get(h);r.onerror=()=>o(r.error),r.onsuccess=()=>{let a;if(r.result){const u={...r.result,...e,stimulus_uuid:h,responses:[...r.result.responses||[],...e.responses||[]]};a=s.put(u)}else a=s.put({...e,stimulus_uuid:h});a.onerror=u=>{console.error("Error updating stimulus in IndexedDB",u),o(a.error)},a.onsuccess=()=>{c()}}})},lf=async()=>{const n=(await qu()).transaction([Qn],"readonly").objectStore(Qn);return new Promise((s,c)=>{const o=n.getAll();o.onerror=()=>c(o.error),o.onsuccess=()=>{const h={};o.result.forEach(r=>{r.stimulus_uuid&&(h[r.stimulus_uuid]=r)}),s(h)}})},CE=async()=>{const n=(await qu()).transaction([Qn],"readwrite").objectStore(Qn);return new Promise((s,c)=>{const o=n.clear();o.onerror=()=>c(o.error),o.onsuccess=()=>s()})},RE=()=>{const[e,t]=Ae.useState({}),[n,s]=Ae.useState(!0),c=Ae.useCallback(r=>{t(a=>{let u={...a};const l=r.stimulus_uuid;if(r.type==="stimulus")u[l]||(u[l]={...r,responses:[]});else if(["OrchestratorReinvoke","response","streamingResponse","responseComplete","actionRequest","actionResponse","llmServiceRequest","llmServiceResponse"].includes(r.type)){if(!u[l])return a;if(r.type==="streamingResponse"){const{uuid:f,first_chunk:p,last_chunk:_,text:S}=r.content,C=u[l].responses.findIndex(g=>g.type==="streamingResponse"&&g.content.uuid===f);C!==-1?(u[l].responses[C].content.text=S,u[l].responses[C].content.last_chunk=_):p&&u[l].responses.push(r)}else if(r.type==="llmServiceResponse"){const f=u[l].responses.findIndex(p=>{var _,S,C;return p.type==="llmServiceRequest"&&r.broker_request_reply&&((_=r.broker_request_reply[0])==null?void 0:_.request_id)&&((S=p.broker_request_reply[0])==null?void 0:S.request_id)===((C=r.broker_request_reply[0])==null?void 0:C.request_id)});f!==-1?u[l].responses[f].response=r:u[l].responses.some(_=>_.timestamp===r.timestamp&&_.type===r.type)||u[l].responses.push(r)}else u[l].responses.some(p=>p.timestamp===r.timestamp&&p.type===r.type)||u[l].responses.push(r)}const d=Object.entries(u).sort((f,p)=>new Date(f[1].timestamp)-new Date(p[1].timestamp));return Object.fromEntries(d)})},[]),o=Ae.useCallback(async()=>{window.confirm("Are you sure you want to discard all stimuli?")&&(s(!0),await CE(),t({}),s(!1))},[]),h=Ae.useCallback(async()=>{s(!0);try{const r=await lf(),a=Object.fromEntries(Object.entries(r).sort((u,l)=>new Date(u[1].timestamp)-new Date(l[1].timestamp)));t(a)}catch(r){console.error("Error loading initial data:",r)}finally{s(!1)}},[]);return Ae.useEffect(()=>{h()},[h]),{stimuli:e,isLoading:n,handleNewMessage:c,handleDiscardStimuli:o,loadInitialData:h}},vE=()=>{const[e,t]=Ae.useState(null),{stimuli:n,isLoading:s,handleNewMessage:c,handleDiscardStimuli:o}=RE();Ae.useEffect(()=>{const r=u=>{c(u.detail)},a=document.querySelector(".stimuli-page");if(a)return a.addEventListener("newMessage",r),()=>{a.removeEventListener("newMessage",r)}},[c]);const h=e?n[e]:null;return le.jsxs("div",{className:"stimuli-page",children:[le.jsxs("div",{className:"page-header",children:[le.jsx("h2",{children:"Stimuli"}),le.jsx("button",{className:"button",onClick:o,disabled:s,children:"Discard All Stimuli"})]}),le.jsxs("div",{className:"stimuli-content",children:[le.jsx(gE,{stimuli:n,selectedStimulusId:e,onSelectStimulus:t}),le.jsx(yE,{selectedStimulus:h})]}),s&&le.jsx("div",{className:"loading-overlay",children:"Loading..."})]})},NE=()=>{const{agents:e,filteredAgents:t,searchFilter:n,setSearchFilter:s}=pm(),[c,o]=Ae.useState(null);Ae.useEffect(()=>{Object.keys(e).length>0&&!c&&o(e[Object.keys(e)[0]])},[e,c]);const h=r=>{o(e[r])};return le.jsxs("div",{className:"capabilities-page",children:[le.jsxs("div",{className:"page-header",children:[le.jsx("h2",{children:"Solace Agent Mesh Agents"}),le.jsx("input",{type:"text",placeholder:"Search agents...",value:n,onChange:r=>s(r.target.value),className:"search-input"})]}),le.jsxs("div",{className:"capabilities-content",children:[le.jsx("div",{className:"agent-grid",children:Object.entries(t).length===0?le.jsx("p",{className:"no-agents",children:"No agents registered yet. They will appear here as they register."}):Object.entries(t).map(([r,a])=>le.jsxs("div",{className:`agent-card ${(c==null?void 0:c.agent_name)===r?"selected":""}`,onClick:()=>h(r),children:[le.jsx("h3",{children:r}),le.jsx("p",{children:a.description||"No description available"}),le.jsxs("div",{className:"agent-card-footer",children:[le.jsx("div",{className:"actions-count",children:le.jsxs("span",{children:[(a.actions||[]).length," actions"]})}),le.jsx("div",{className:"actions-preview",children:(a.actions||[]).slice(0,300).map((u,l)=>u&&le.jsx("span",{className:"action-name-preview",children:Object.keys(u)[0]},l))})]})]},r))}),c&&le.jsxs("div",{className:"agent-details",children:[le.jsx("h2",{children:c.agent_name}),le.jsx("p",{className:"agent-description",children:c.description||"No description available"}),le.jsxs("div",{className:"actions-list",children:[le.jsx("h3",{children:"Actions"}),(c.actions||[]).map((r,a)=>{const u=Object.keys(r)[0],l=r[u];return le.jsxs("details",{className:"action-details",children:[le.jsx("summary",{children:u}),le.jsxs("div",{className:"action-content",children:[le.jsx("p",{children:l.desc}),le.jsx("h4",{children:"Parameters:"}),le.jsx("ul",{children:l.params.map((d,f)=>le.jsx("li",{children:d},f))}),l.examples.length>0&&le.jsxs(le.Fragment,{children:[le.jsx("h4",{children:"Examples:"}),le.jsx("ul",{children:l.examples.map((d,f)=>le.jsx("li",{children:d},f))})]}),le.jsx("h4",{children:"Required Scopes:"}),le.jsx("ul",{className:"scopes-list",children:l.required_scopes.map((d,f)=>le.jsx("li",{children:d},f))})]})]},a)})]})]})]})]})},Rr=({label:e,value:t,onChange:n,type:s="text",required:c=!1})=>le.jsxs("div",{children:[le.jsxs("label",{children:[e,c&&le.jsx("span",{style:{color:"red"},children:"*"})]}),le.jsx("input",{type:s,value:t,onChange:n,required:c})]}),OE=({open:e,config:t,setConfig:n,onClose:s,isNewConfig:c,savedConfigs:o})=>{if(!e)return null;const h=r=>{const a=r.target.value;n(u=>({...u,connectionType:a}))};return le.jsxs("div",{className:"config-dialog",children:[le.jsxs("div",{className:"config-dialog-content",children:[le.jsx(Rr,{label:"Configuration Name",value:t.name||"",onChange:r=>n(a=>({...a,name:r.target.value})),required:!0}),le.jsxs("div",{children:[le.jsx("label",{children:"Connection Type"}),le.jsxs("select",{value:t.connectionType||"solace",onChange:h,children:[le.jsx("option",{value:"solace",children:"Solace Broker"}),le.jsx("option",{value:"websocket",children:"WebSocket"})]})]}),(t.connectionType||"solace")==="solace"?le.jsxs(le.Fragment,{children:[le.jsx(Rr,{label:"Solace URL",value:t.url||"",onChange:r=>n(a=>({...a,url:r.target.value}))}),le.jsx(Rr,{label:"VPN Name",value:t.vpnName||"",onChange:r=>n(a=>({...a,vpnName:r.target.value}))}),le.jsx(Rr,{label:"Username",value:t.userName||"",onChange:r=>n(a=>({...a,userName:r.target.value}))}),le.jsx(Rr,{label:"Password",value:t.password||"",type:"password",onChange:r=>n(a=>({...a,password:r.target.value}))}),le.jsx(Rr,{label:"Namespace",value:t.namespace||"",onChange:r=>n(a=>({...a,namespace:r.target.value}))})]}):le.jsx(Rr,{label:"WebSocket URL",value:t.websocketUrl||"",onChange:r=>n(a=>({...a,websocketUrl:r.target.value}))})]}),le.jsxs("div",{className:"config-dialog-buttons",children:[le.jsx("button",{className:"button",onClick:()=>s(!1),children:"Cancel"}),le.jsx("button",{className:"button button-info",onClick:()=>{if(!t.name){alert("Configuration Name is required");return}if(c&&o.some(r=>r.name===t.name)){alert("Configuration Name must be unique");return}s(!0)},children:c?"Save and Connect":"Connect"})]})]})},AE=({onSelect:e,onCreateNew:t,onCancel:n,onEdit:s,onDelete:c})=>{const[o,h]=Ae.useState([]),[r,a]=Ae.useState("");Ae.useEffect(()=>{const f=JSON.parse(localStorage.getItem("saved-configs")||"[]");h(f)},[]);const u=()=>{const f=o.find(p=>p.name===r);f&&e(f,!0)},l=()=>{const f=o.find(p=>p.name===r);f&&s(f)},d=()=>{window.confirm("Are you sure you want to delete this connection?")&&c(r)};return le.jsxs("div",{className:"connection-selector",children:[le.jsx("h2",{children:"Select a Connection"}),le.jsx("label",{htmlFor:"connection-select",children:"Saved Connections:"}),le.jsxs("select",{id:"connection-select",value:r,onChange:f=>a(f.target.value),children:[le.jsx("option",{value:"",children:"Select a connection"}),o.map((f,p)=>le.jsx("option",{value:f.name,children:f.name},p))]}),le.jsxs("div",{className:"button-group",children:[le.jsx("button",{onClick:u,disabled:!r,children:"Connect"}),le.jsx("button",{onClick:l,disabled:!r,children:"Edit"}),le.jsx("button",{onClick:d,disabled:!r,children:"Delete"})]}),le.jsxs("div",{className:"button-group secondary",children:[le.jsx("button",{onClick:t,children:"Create New"}),le.jsx("button",{onClick:n,children:"Cancel"})]})]})};var uf={exports:{}};/*! For license information please see solclient.js.LICENSE.txt */(function(e,t){(function(n,s){e.exports=s()})(xf,()=>(()=>{var n={5237:(o,h,r)=>{o.exports=r(7847)},9783:(o,h,r)=>{const{Base64:a}=r(9692),{Bits:u}=r(9887),{Convert:l}=r(8076),{Hex:d}=r(8926),{Long:f}=r(7753);o.exports.Base64=a,o.exports.Bits=u,o.exports.Convert=l,o.exports.Hex=d,o.exports.Long=f},9692:(o,h,r)=>{var a=r(8287).hp;const u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,99,-1,-1,99,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,99,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];class d extends Error{}const f={base64_encode(m){let T="",y=0;do{const E=m.charCodeAt(y++),I=m.charCodeAt(y++),N=m.charCodeAt(y++),A=E>>2,L=(3&E)<<4|I>>4;let D=(15&I)<<2|N>>6,q=63&N;isNaN(I)?D=q=64:isNaN(N)&&(q=64),T+=u.charAt(A),T+=u.charAt(L),T+=u.charAt(D),T+=u.charAt(q)}while(y<m.length);return T},base64_decode(m){let T="",y=0;do{for(;l[m.charCodeAt(y)]>64;)y++;const E=l[m.charCodeAt(y++)],I=l[m.charCodeAt(y++)],N=l[m.charCodeAt(y++)],A=l[m.charCodeAt(y++)];if(E<0||I<0||N<0||A<0)throw new d("Invalid base64 character");const L=E<<2|I>>4,D=(15&I)<<4|N>>2,q=(3&N)<<6|A;T+=String.fromCharCode(L),N!==64&&(T+=String.fromCharCode(D)),A!==64&&(T+=String.fromCharCode(q))}while(y<m.length-3);return T}},p=typeof window>"u",_=typeof Blob<"u",S=a!==void 0&&(_||p)?{base64_encode:m=>a.from(m,"binary").toString("base64"),base64_decode:m=>a.from(m,"base64").toString("binary")}:{},C=typeof window<"u"?{base64_encode:window.btoa?m=>window.btoa(m):null,base64_decode:window.atob?m=>window.atob(m):null}:{},g={encode:C.base64_encode||S.base64_encode||f.base64_encode,decode:C.base64_decode||S.base64_decode||f.base64_decode};o.exports.Base64=g},9887:o=>{const h={get:(r,a,u)=>r>>>a&(1<<u)-1,set(r,a,u,l){const d=(1<<l)-1;return r&~(d<<u)|(a&d)<<u}};o.exports.Bits=h},8076:(o,h,r)=>{const a=r(5017),{ErrorSubcode:u,OperationError:l}=r(6706),d=r(8287).hp,f="\0\0",p="\0\0\0",_="\0\0\0\0",S=8192,C=32768;function g(E){const I=E.length,N=new ArrayBuffer(I),A=new Uint8Array(N,0,I);for(let L=0;L<I;L++)A[L]=E.charCodeAt(L);return A}function m(E){if(E===0)return _;if(E>0){if(E<256)return p+String.fromCharCode(E);if(E<65536)return f+String.fromCharCode(E>>8)+String.fromCharCode(255&E)}return String.fromCharCode(E>>24&255)+String.fromCharCode(E>>16&255)+String.fromCharCode(E>>8&255)+String.fromCharCode(255&E)}function T(E){return 16777216*E.charCodeAt(0)+(E.charCodeAt(1)<<16)+(E.charCodeAt(2)<<8)+E.charCodeAt(3)}const y={arrayBufferToString:function(E){if(!E)return"";const I=E.byteLength,N=new Uint8Array(E);if(I<C)return String.fromCharCode.apply(null,N);let A=0,L="";for(;A<I;)L+=String.fromCharCode.apply(null,N.subarray(A,A+C)),A+=C;return L},stringToArrayBuffer:function(E){return g(E).buffer},uint8ArrayToString:function(E,I=void 0){const N=E.byteLength,A=new Uint8Array(d.from(E));let L="";for(let D=0;D<N;D++)I&&I.toLowerCase()==="hex"?L+=A[D].toString(16).padStart(2,"0"):L+=String.fromCharCode(255&A[D]);return L},stringToUint8Array:g,hexStringToUint8Array:function(E){return E==null?new Uint8Array:Uint8Array.from(d.from(E,"hex"))},int8ToStr:function(E){return String.fromCharCode(255&E)},strToInt8:function(E){return 255&E.charCodeAt(0)},int16ToStr:function(E){return String.fromCharCode(E>>8&255)+String.fromCharCode(255&E)},strToInt16:function(E){return(E.charCodeAt(0)<<8)+E.charCodeAt(1)},int24ToStr:function(E){return String.fromCharCode(E>>16&255)+String.fromCharCode(E>>8&255)+String.fromCharCode(255&E)},strToInt24:function(E){return(E.charCodeAt(0)<<16)+(E.charCodeAt(1)<<8)+E.charCodeAt(2)},int32ToStr:m,strToInt32:function(E){return(E.charCodeAt(0)<<24)+(E.charCodeAt(1)<<16)+(E.charCodeAt(2)<<8)+E.charCodeAt(3)},strToUInt32:T,int64ToStr:function(E){if(typeof E!="number")return m(E.high)+m(E.low);if(E>=0){if(E<256)return _+p+String.fromCharCode(E);if(E<65536)return _+f+String.fromCharCode(E>>8)+String.fromCharCode(255&E);if(E<4294967296)return _+(String.fromCharCode(E>>24&255)+String.fromCharCode(E>>16&255)+String.fromCharCode(E>>8&255)+String.fromCharCode(255&E))}return String.fromCharCode(E>>56&255)+String.fromCharCode(E>>48&255)+String.fromCharCode(E>>40&255)+String.fromCharCode(E>>32&255)+String.fromCharCode(E>>24&255)+String.fromCharCode(E>>16&255)+String.fromCharCode(E>>8&255)+String.fromCharCode(255&E)},strToUInt64:function(E){return a.fromBits(T(E.substr(4,4)),T(E.substr(0,4)),!0)},byteArrayToStr:function(E){const I=E.length;if(I<S)return String.fromCharCode.apply(null,E);let N=0,A="";for(;N<I;)A+=String.fromCharCode.apply(null,E.slice(N,N+S)),N+=S;return A},strToByteArray:function(E){const I=[];let N;for(N=0;N<E.length;N++)I[N]=E.charCodeAt(N);return I},strToHexArray:function(E){return Array.prototype.map.call(E.split(""),function(I){return I.charCodeAt(0).toString(16)})},ucs2ToUtf8:function(E){return unescape(encodeURIComponent(E))},utf8ToUcs2:function(E){return decodeURIComponent(escape(E))},anythingToBuffer:function(E){if(d.isBuffer(E))return E;if(typeof E=="string")return d.from(E,"latin1");if(E instanceof ArrayBuffer)return d.from(E);if(E.buffer instanceof ArrayBuffer&&typeof E.byteLength=="number"&&typeof E.byteOffset=="number")return E.byteOffset===0&&E.byteLength===E.buffer.byteLength?d.from(E.buffer):d.from(E.buffer,E.byteOffset,E.byteLength);throw new l("Parameter value failed validation",u.PARAMETER_OUT_OF_RANGE,"Expecting Buffer/Uint8Array, also accepting string, ArrayBuffer, any TypedArray, or DataView.")}};o.exports.Convert=y},8926:o=>{function h(a){if(typeof a!="number")return"";const u=a.toString(16);return u.length<2?`0${u}`:u}const r={formatHexString:function(a){return typeof a=="number"?`0x${h(a)}`:typeof a=="object"&&Array.isArray(a)?a.map(h).join():typeof a=="string"?Array.prototype.map.call(a,(u,l)=>h(a.charCodeAt(l))).join(""):null}};o.exports.Hex=r},7753:(o,h,r)=>{o.exports.Long=r(5017)},1081:(o,h,r)=>{const a=r(9783),u=r(199),l=r(9620),d=r(6706),f=r(7444),p=r(4386),_=r(7414),S=r(2694),C=r(6247),g=r(2288),m=r(5898),T=r(769),y=r(5024),E=r(3450),I=r(2689),N=r(6663),A=r(8205),L=r(968),D=r(802);o.exports={Convert:a,Debug:u,Destination:l,Error:d,ESKit:f,Factory:p,FSM:_,Log:S,Message:C,MessageTracing:g,Publisher:m,SDT:T,Session:y,SMF:E,SolcacheSession:I,TestEnv:N,Transport:A,Util:L,Validate:D}},7847:(o,h,r)=>{const a=r(4386),{SolclientFactory:u,SolclientFactoryProfiles:l,SolclientFactoryProperties:d}=a,{Long:f}=r(9783),{Destination:p,DestinationType:_,Topic:S}=r(9620),{ErrorSubcode:C,NotImplementedError:g,OperationError:m,RequestError:T,RequestEventCode:y}=r(6706),{makeIterator:E}=r(7444),{ConsoleLogImpl:I,LogImpl:N,LogLevel:A}=r(2694),{Message:L,MessageCacheStatus:D,MessageDeliveryModeType:q,MessageDumpFlag:Y,MessageOutcome:Q,MessageType:W,MessageUserCosType:x,ReplicationGroupMessageId:k}=r(6247),{MessageConsumer:J,MessageConsumerAcknowledgeMode:F,MessageConsumerEventName:$,MessageConsumerProperties:R,QueueBrowser:B,QueueBrowserEventName:M,QueueBrowserProperties:re}=r(178),{ReplayStartLocation:se,ReplayStartLocationBeginning:fe}=r(9309),{MessagePublisherAcknowledgeMode:ce,MessagePublisherProperties:Te}=r(5898),{Baggage:Ee,TraceContext:he,TraceContextSetter:ge}=r(2288),{AbstractQueueDescriptor:X,QueueAccessType:ae,QueueDescriptor:ee,QueueDiscardBehavior:Re,QueuePermissions:me,QueueProperties:Pe,QueueType:H,EndpointNameComplaint:Z}=r(9631),{SDTField:te,SDTFieldType:ie,SDTMapContainer:j,SDTStreamContainer:Oe,SDTUnsupportedValueError:v,SDTValueErrorSubcode:P}=r(769),{AuthenticationScheme:O,CapabilityType:U,MessageRxCBInfo:V,MutableSessionProperty:z,Session:ne,SessionEvent:de,SessionEventCBInfo:_e,SessionEventCode:we,SessionProperties:oe,SessionState:Se,SslDowngrade:Ce}=r(5024),{CacheCBInfo:je,CacheLiveDataAction:Be,CacheRequestResult:ct,CacheReturnCode:Gt,CacheReturnSubcode:Ne,CacheSession:et,CacheSessionProperties:xe}=r(2689),{StatType:He}=r(5747),{TransportError:at,TransportProtocol:Ue}=r(8205),{Version:At}=r(968),qe={AbstractQueueDescriptor:X,AuthenticationScheme:O,Baggage:Ee,CacheCBInfo:je,CacheLiveDataAction:Be,CacheRequestResult:ct,CacheReturnCode:Gt,CacheReturnSubcode:Ne,CacheSession:et,CacheSessionProperties:xe,CapabilityType:U,ConsoleLogImpl:I,Destination:p,DestinationType:_,ErrorSubcode:C,LogImpl:N,LogLevel:A,Long:f,Message:L,MessageCacheStatus:D,MessageConsumer:J,MessageConsumerAcknowledgeMode:F,MessageConsumerEventName:$,MessageConsumerProperties:R,MessageDeliveryModeType:q,MessageDumpFlag:Y,MessageOutcome:Q,MessagePublisherAcknowledgeMode:ce,MessagePublisherProperties:Te,MessageRxCBInfo:V,MessageType:W,MessageUserCosType:x,MutableSessionProperty:z,NotImplementedError:g,OperationError:m,QueueAccessType:ae,QueueBrowser:B,QueueBrowserEventName:M,QueueBrowserProperties:re,QueueDescriptor:ee,QueueDiscardBehavior:Re,QueuePermissions:me,QueueProperties:Pe,QueueType:H,EndpointNameComplaint:Z,ReplayStartLocation:se,ReplayStartLocationBeginning:fe,ReplicationGroupMessageId:k,RequestError:T,RequestEventCode:y,SDTField:te,SDTFieldType:ie,SDTMapContainer:j,SDTStreamContainer:Oe,SDTUnsupportedValueError:v,SDTValueErrorSubcode:P,Session:ne,SessionEvent:de,SessionEventCBInfo:_e,SessionEventCode:we,SessionProperties:oe,SessionState:Se,SolclientFactory:u,SolclientFactoryProfiles:l,SolclientFactoryProperties:d,SslDowngrade:Ce,StatType:He,Topic:S,TraceContext:he,TraceContextSetter:ge,TransportError:at,TransportProtocol:Ue,Version:At,makeIterator:E,_internal:r(1081)};Object.assign(o.exports,qe)},199:(o,h,r)=>{const{Debug:a}=r(8348);o.exports.Debug=a},8348:(o,h,r)=>{const a=(()=>{const l=[];for(let d=0;d<256;++d)l[d]=d<33||d>126?".":String.fromCharCode(d);return l})(),u={formatDumpBytes:function(l,d,f){const{StringBuffer:p,StringUtils:_}=r(968),{isEmpty:S,padLeft:C,padRight:g}=_;if(S(l))return null;const m=new p,T=new p,y=new p;let E=0;for(let I=0,N=l.length;I<N;++I){const A=l.charCodeAt(I);y.append(C(A.toString(16),2,"0")," "),T.append(a[A]||"."),E++,E===8&&y.append(" "),E!==16&&I!==l.length-1||(f>0&&m.append(g("",f," ")),m.append(g(y.toString(),54," ")),d&&m.append(T),m.append(`
|
|
68
|
-
`),y.clear(),T.clear(),E=0)}return m.toString()},parseSMFStream:function(l){const{Codec:{Decode:{decodeCompoundMessage:d}}}=r(3450),{LOG_WARN:f,LOG_ERROR:p}=r(2694);if(l===null)return void p("data null in debugParseSmfStream");let _=0;for(f(`parseSMFStream(): Starting parse, length ${l.length}`);_<l.length;){const S=d(l,_),C=S?S.smfHeader:null;if(!S||!C)return f("parseSMFStream(): couldn't decode message."),void f(`Position: ${_} length: ${l.length}`);f(`>> Pos(${_}) Protocol ${C.smf_protocol}, Length: ${C.messageLength}`),_+=C.messageLength}}};o.exports.Debug=u},9620:(o,h,r)=>{const{Destination:a}=r(5136),{DestinationFromNetwork:u}=r(1618),{DestinationType:l}=r(8805),{DestinationUtil:d}=r(617),{Parameter:f}=r(802),{Queue:p}=r(1435),{SolclientFactory:_}=r(4386),{Topic:S}=r(8335);_.createTopicDestination=_.createFactory(C=>(f.isString("topicName",C),S.createFromName(C))),_.createTopic=_.createFactory(C=>new S(C)),_.createDurableQueueDestination=_.createFactory(C=>(f.isString("queueName",C),p.createFromLocalName(C))),o.exports.Destination=a,o.exports.DestinationFromNetwork=u,o.exports.DestinationType=l,o.exports.DestinationUtil=d,o.exports.Queue=p,o.exports.Topic=S},1618:(o,h,r)=>{const{DestinationType:a}=r(8805),{DestinationUtil:u}=r(617),{Queue:l}=r(1435),{Topic:d}=r(8335),f="#P2P/QUE/";function p(S,C=void 0){if(S===null||S.length===0)return null;const g={name:S,bytes:C||u.encodeBytes(S)};if(S[0]==="#"){if(S.startsWith(f))return g.name=S.substr(9),g.type=a.QUEUE,g.offset=9,new l(g);if(S.startsWith("#P2P/QTMP/"))return g.name=S,g.type=a.TEMPORARY_QUEUE,g.offset=0,new l(g)}return new d(g)}const _={createDestinationFromBytes:function(S){return S===null||S.length===0?null:p(u.decodeBytes(S),S)},createDestinationFromName:p};o.exports.DestinationFromNetwork=_},8805:(o,h,r)=>{const{Enum:a}=r(7444),u={TOPIC:"topic",QUEUE:"queue",TEMPORARY_QUEUE:"temporary_queue"};o.exports.DestinationType=a.new(u),o.exports.DestinationType._setCanonical({TOPIC:u.TOPIC,QUEUE:u.QUEUE,TEMPORARY_QUEUE:u.TEMPORARY_QUEUE})},617:(o,h,r)=>{const a=r(4386),{Convert:u}=r(9783),{DestinationType:l}=r(8805),{LOG_ERROR:d}=r(2694),{SubscriptionInfo:f}=r(5456),{UUID:p,StringUtils:_}=r(968),{ucs2ToUtf8:S,utf8ToUcs2:C}=u,{ProfileBinding:g}=a,{toSafeChars:m,stripNullTerminate:T}=_,{ErrorSubcode:y,OperationError:E}=r(6706),I={[l.QUEUE]:"#P2P/QUE/",[l.TEMPORARY_QUEUE]:"#P2P/QTMP/"};function N(Q){return I[Q]||""}function A(Q,W){return new E(`Invalid ${Q}: ${W}`,y.INVALID_TOPIC_SYNTAX)}function L(Q,W,x,k=A.bind(null,Q)){let J;const F=x.length;if(F<1)return J=k("Too short (must be >= 1 character)."),{error:J};const $=W.length;if($>251)return J=k(`Too long (encoding must be <= 250 bytes); name is ${$-1} bytes: '${x}'`),{error:J};let R=!1;x.charAt(F-1)===">"&&(R=!0);for(let B=0;B<F;++B)switch(x.charAt(B)){case"/":if(B===0||B===F-1||x.charAt(B-1)==="/")return J=k(`Empty level(s) in '${x}'@${B}.`),{error:J};break;case"*":if(B<F-1&&x.charAt(B+1)!=="/")return J=k(`Illegal wildcard(s) in '${x}'@${B}.`),{error:J};R=!0}return{isWildcarded:R}}function D(Q){return g.value.topicUtf8Encode?`${S(Q)}\0`:`${Q}\0`}function q(Q,W){const x=N(Q),k=x.length,J=x+W;return{bytes:D(J),offset:k,networkName:J}}const Y={createPrefix:N,createTemporaryName:function(Q,W,x){const k=x||p.generateUUID();switch(Q){case l.TOPIC:return`#P2P/TTMP/${W}/${k}`;case l.TEMPORARY_QUEUE:return`#P2P/QTMP/${W}/${k}`;default:d("Unknown/invalid destination type",l.describe(Q))}},decodeBytes:function(Q){return T(g.value.topicUtf8Encode?C(Q):Q)},encode:q,encodeBytes:D,legacyValidate:L,toSafeChars:m,validateAndEncode:function(Q,W,x=A.bind(null,Q)){const{bytes:k,offset:J}=q(Q,W),{error:F,isWildcarded:$}=L(Q,k,W,x);let R=F,B={};if(B.isWildcarded=$,R||Object.keys(I).some(M=>{const re=I[M];return!!W.startsWith(re)&&(R=x(`Reserved prefix '${re}' found at start of '${W}'`),!0)}),!R){const{error:M,subInfo:re}=f.parseFromName(W,Q);R=M,B=re}return{bytes:k,offset:J,error:R,isWildcarded:$,subscriptionInfo:B}}};o.exports.DestinationUtil=Y},5136:(o,h,r)=>{var a=r(2195);const{DestinationType:u}=r(8805),{DestinationUtil:l}=r(617);class d{constructor(p,_=u.TOPIC){if(typeof p=="object")this._name=p.name,this._type=p.type,this._bytes=p.bytes,this._offset=p.offset,p.isValidated?(this._isValidated=!0,this._isWildcarded=p.isWildcarded,this._subscriptionInfo=p.subscriptionInfo||{}):(this._isValidated=!1,this._subscriptionInfo={});else{this._name=p,this._type=_;const S=l.encode(_,p);this._bytes=S.bytes,this._offset=S.offset,this._isValidated=!1,this._subscriptionInfo={}}}getName(){return this._name}get name(){return this.getName()}getType(){return this._type}get type(){return this.getType()}getBytes(){return this._bytes}get bytes(){return this.getBytes()}getOffset(){return this._offset}get offset(){return this.getOffset()}validate(){if(this._isValidated){if(this._error)throw this._error;return}const{error:p,isWildcarded:_}=l.legacyValidate(this.type,this.bytes,this.name);if(this._isValidated=!0,p)throw this._error=p,p;this._isWildcarded=_}isWildcarded(){return this.validate(),this._isWildcarded}getSubscriptionInfo(){return this._subscriptionInfo||{}}toString(){return a(this)}equals(p){return p instanceof d&&this.toString().valueOf()===p.toString().valueOf()}}o.exports.Destination=d},1435:(o,h,r)=>{const a=r(617),{assert:u}=r(7444),{Destination:l}=r(5136),{DestinationType:d}=r(8805);class f extends l{constructor(_){u(_.name,"Queue name not supplied"),u(_.type===d.QUEUE||_.type===d.TEMPORARY_QUEUE,"Queue spec.type is invalid"),u(_.bytes,"Queue spec missing bytes"),u(_.offset!==void 0,"Queue spec missing offset"),super(_)}getOffset(){return this._offset}get offset(){return this.getOffset()}inspect(){return`[Queue ${this.getName()}]`}static createFromLocalName(_){const S=a.DestinationUtil.validateAndEncode(d.QUEUE,_);if(S.error)throw S.error;return new f({name:_,type:d.QUEUE,isValidated:!0,bytes:S.bytes,offset:S.offset,isWildcarded:S.isWildcarded,subscriptionInfo:S.subscriptionInfo})}}o.exports.Queue=f},5456:(o,h,r)=>{var a=r(2195);const{DestinationType:u}=r(8805),{ErrorSubcode:l,OperationError:d}=r(6706),f={[u.TOPIC]:{_layers:[function(S,C,g,m,T){let y=m;return C.length-y>10&&!T.isNoExport&&C.startsWith("#noexport/",y)?(y+=10,T.isNoExport=!0):T.isNoExport=!1,{error:void 0,index:y,result:T}},function(S,C,g,m,T,y){let E,I,N=m,A=-1;return C.length-N>7&&!T.isShare&&C.startsWith("#share/",m)&&C.length-(N+7)>2?(N+=7,A=N,N=C.indexOf("/",A),N>0?(I=C.substring(A,N),N+=1,T.isShare=!0,T.shareGroup=I,T.dispatchTopicIndex=N):(E=y(`Illegal share Group in '${C}'@${A}.`),T.isShare=!0)):T.isShare=!1,{error:E,index:N,result:T}}],parse:function(S,C,g,m,T){const{error:y,result:E}=function(I,N,A,L,D,q){const Y=I.length||0;let Q,W=0,x=D||{};for(let k=0;k<Y;++k){const{error:J,index:F,result:$}=I[k](N,A,L,W,x,q);if(W=F,x=$,Q=J,Q)break}return{error:Q,result:x}}(this._layers,S,C,g,m,T);return{error:y,result:E}}}};function p(S,C){return new d(`Invalid ${S}: ${C}`,l.INVALID_TOPIC_SYNTAX)}class _{constructor(C){this._name=C,this._isShare=!1,this._isNoExport=!1,this._dispatchTopicIndex=-1,this._shareGroup=null}getName(){return this._name}get name(){return this.getName()}get isShare(){return this._isShare}set isShare(C){this._isShare=C}get isNoExport(){return this._isNoExport}set isNoExport(C){this._isNoExport=C}get dispatchTopicIndex(){return this._dispatchTopicIndex<0?0:this._dispatchTopicIndex}set dispatchTopicIndex(C){this._dispatchTopicIndex=C<0?-1:C}get shareGroup(){return this.isShare?this._shareGroup:null}set shareGroup(C){this.isShare&&(this._shareGroup=C)}toString(){return a(this)}static parseFromName(C,g=u.TOPIC){let m=new _(C),T=null;const y=f[g];if(y){const{error:E,result:I}=y.parse(g,C,null,m,p.bind(null,g));m=I,T=E}return{error:T,subInfo:m}}}o.exports.SubscriptionInfo=_},8335:(o,h,r)=>{const a=r(617),{Destination:u}=r(5136),{DestinationType:l}=r(8805);class d extends u{constructor(p){typeof p=="object"?super({type:l.TOPIC,name:p.name,bytes:p.bytes,offset:p.offset,isValidated:p.isValidated,isWildcarded:p.isWildcarded,subscriptionInfo:p.subscriptionInfo}):super(p,l.TOPIC)}inspect(){return`[Topic ${this.getName()}]`}static createFromName(p){const _=a.DestinationUtil.validateAndEncode(l.TOPIC,p);if(_.error)throw _.error;return new d({name:p,isValidated:!0,bytes:_.bytes,offset:_.offset,isWildcarded:_.isWildcarded,subscriptionInfo:_.subscriptionInfo})}}o.exports.Topic=d},6663:(o,h,r)=>{function a(u){throw new Error("Test environment will not override build environment")}a.target=()=>a(),o.exports=a},6706:(o,h,r)=>{const{ErrorResponseSubcodeMapper:a}=r(5424),{ErrorSubcode:u}=r(5129),{NotImplementedError:l}=r(5749),{OperationError:d}=r(5192),{RequestError:f}=r(8916),{RequestEventCode:p}=r(8309),{SolaceError:_}=r(3922);o.exports.ErrorResponseSubcodeMapper=a,o.exports.ErrorSubcode=u,o.exports.NotImplementedError=l,o.exports.OperationError=d,o.exports.RequestError=f,o.exports.RequestEventCode=p,o.exports.SolaceError=_},5424:(o,h,r)=>{const{ErrorSubcode:a}=r(5129),{makeMap:u}=r(7444),l=a,d=u(400,u("client name parse error",l.CLIENT_NAME_INVALID,"document is too large",l.MESSAGE_TOO_LARGE,"inactivity timeout",l.INACTIVITY_TIMEOUT,"max num subscriptions exceeded",l.SUBSCRIPTION_TOO_MANY,"message too long",l.MESSAGE_TOO_LARGE,"nolocal discard",l.NOLOCAL_DISCARD,"not enough space",l.OUT_OF_RESOURCES,"subscription already exists",l.SUBSCRIPTION_ALREADY_PRESENT,"subscription attributes conflict with existing subscription",l.SUBSCRIPTION_ATTRIBUTES_CONFLICT,"subscription not found",l.SUBSCRIPTION_NOT_FOUND,"subscription parse error",l.SUBSCRIPTION_INVALID,"topic parse error",l.INVALID_TOPIC_SYNTAX,"unknown transport session identifier",l.UNKNOWN_TRANSPORT_SESSION_ID,"xml parse error",l.XML_PARSE_ERROR,"unsupported ssl downgrade value",l.LOGIN_FAILURE),401,u("",l.LOGIN_FAILURE),403,u("basic authentication is shutdown",l.BASIC_AUTHENTICATION_IS_SHUTDOWN,"client certificate authentication is shutdown",l.CLIENT_CERTIFICATE_AUTHENTICATION_IS_SHUTDOWN,"client name already in use",l.CLIENT_NAME_ALREADY_IN_USE,"client username is shutdown",l.CLIENT_USERNAME_IS_SHUTDOWN,"dynamic clients not allowed",l.DYNAMIC_CLIENTS_NOT_ALLOWED,"invalid virtual router address",l.INVALID_VIRTUAL_ADDRESS,"forbidden",l.CLIENT_ACL_DENIED,"message vpn not allowed",l.MESSAGE_VPN_NOT_ALLOWED,"publish acl denied",l.PUBLISH_ACL_DENIED,"replication is standby",l.REPLICATION_IS_STANDBY,"selector does not match",l.SELECTOR_DOES_NOT_MATCH,"subscription acl denied",l.SUBSCRIPTION_ACL_DENIED,"subscription does not match",l.SUBSCRIPTION_DOES_NOT_MATCH,"compression is shutdown",l.LOGIN_FAILURE,"shared subscriptions not supported on topic endpoints",l.SHARED_SUBSCRIPTIONS_ENDPOINT_NOT_ALLOWED,"shared subscriptions not supported on queues",l.SHARED_SUBSCRIPTIONS_ENDPOINT_NOT_ALLOWED,"shared subscription permission denied",l.SHARED_SUBSCRIPTIONS_NOT_ALLOWED),404,u("",l.LOGIN_FAILURE),503,u("low priority msg congestion",l.LOW_PRIORITY_MSG_CONGESTION,"message vpn unavailable",l.MESSAGE_VPN_UNAVAILABLE,"replication is standby",l.REPLICATION_IS_STANDBY,"service unavailable",l.GM_UNAVAILABLE,"spool over quota",l.SPOOL_OVER_QUOTA,"subscriber delete in progress",l.CLIENT_DELETE_IN_PROGRESS,"too many clients",l.TOO_MANY_CLIENTS,"too many connections for vpn",l.TOO_MANY_CLIENTS,"max message usage exceeded",l.MAX_MESSAGE_USAGE_EXCEEDED),507,u("ad not ready",l.GM_NOT_READY)),f=u("PARENT",d,400,u("already bound",l.ALREADY_BOUND,"endpoint already exists",l.ENDPOINT_ALREADY_EXISTS,"subscription already exists",l.SUBSCRIPTION_ALREADY_PRESENT,"already exists",l.ENDPOINT_ALREADY_EXISTS,"endpoint property mismatch",l.ENDPOINT_PROPERTY_MISMATCH,"invalid durable topic endpoint name",l.INVALID_DTE_NAME,"invalid selector",l.INVALID_SELECTOR,"invalid topic name",l.INVALID_TOPIC_NAME_FOR_TOPIC_ENDPOINT,"invalid queue or topic endpoint durability",l.INVALID_QUEUE_OR_TOPIC_ENDPOINT_DURABILITY,"queue not found",l.QUEUE_NOT_FOUND,"quota out of range",l.QUOTA_OUT_OF_RANGE,"unknown flow name",l.UNKNOWN_FLOW_NAME,"unsubscribe not allowed",l.UNSUBSCRIBE_NOT_ALLOWED_CLIENTS_BOUND,"invalid queue name",l.INVALID_QUEUE_NAME,"invalid topic endpoint name",l.INVALID_TE_NAME,"message size out of range",l.MESSAGE_SIZE_OUT_OF_RANGE,"unsupported permissions",l.UNSUPPORTED_PERMISSIONS),403,u("permission not allowed",l.PERMISSION_NOT_ALLOWED,"client initiated replay not allowed on non-exclusive topic endpoint",l.CLIENT_INITIATED_REPLAY_NON_EXCLUSIVE_NOT_ALLOWED,"client initiated replay not allowed on non-exclusive queue",l.CLIENT_INITIATED_REPLAY_NON_EXCLUSIVE_NOT_ALLOWED,"client initiated replay from inactive flow not allowed",l.CLIENT_INITIATED_REPLAY_INACTIVE_FLOW_NOT_ALLOWED,"client initiated replay from browser flow not allowed",l.CLIENT_INITIATED_REPLAY_BROWSER_FLOW_NOT_ALLOWED,"replay not supported on temporary queue",l.REPLAY_TEMPORARY_NOT_SUPPORTED,"replay not supported on anonymous queue",l.REPLAY_ANONYMOUS_QUEUE_NOT_SUPPORTED,"replay not supported on anonymous queue without subscriptions",l.REPLAY_ANONYMOUS_QUEUE_WITHOUT_SUBSCRIPTIONS_NOT_SUPPORTED,"unknown start location type",l.UNKNOWN_START_LOCATION_TYPE,"mismatched endpoint error id",l.MISMATCHED_ENDPOINT_ERROR_ID,"replay start message unavailable",l.REPLAY_START_MESSAGE_NOT_AVAILABLE,"browsing not supported on partitioned queue",l.PARTITIONED_QUEUE_BROWSING_NOT_SUPPORTED,"selectors not supported on partitioned queue",l.PARTITIONED_QUEUE_SELECTORS_NOT_SUPPORTED),503,u("durable topic endpoint shutdown",l.TOPIC_ENDPOINT_SHUTDOWN,"endpoint shutdown",l.TOPIC_ENDPOINT_SHUTDOWN,"max clients exceeded for durable topic endpoint",l.MAX_CLIENTS_FOR_TE,"max clients exceeded for topic endpoint",l.MAX_CLIENTS_FOR_TE,"max clients exceeded for queue",l.MAX_CLIENTS_FOR_QUEUE,"no more non-durable queue or topic endpoint",l.NO_MORE_NON_DURABLE_QUEUE_OR_TOPIC_ENDPOINT,"no subscription match",l.NO_SUBSCRIPTION_MATCH,"queue shutdown",l.QUEUE_SHUTDOWN,"te shutdown",l.TOPIC_ENDPOINT_SHUTDOWN,"unknown durable topic endpoint",l.UNKNOWN_TOPIC_ENDPOINT_NAME,"unknown queue",l.UNKNOWN_QUEUE_NAME,"replay disabled",l.REPLAY_DISABLED,"replay cancelled",l.REPLAY_CANCELLED,"replay message unavailable",l.REPLAY_MESSAGE_UNAVAILABLE,"replay started",l.REPLAY_STARTED,"replayed message rejected by topic endpoint",l.REPLAY_MESSAGE_REJECTED,'replayed message rejected by queue"',l.REPLAY_MESSAGE_REJECTED,"replay log modified",l.REPLAY_LOG_MODIFIED,"mismatched endpoint error id",l.MISMATCHED_ENDPOINT_ERROR_ID,"out of replay resources",l.OUT_OF_REPLAY_RESOURCES,"topic or selector modified on durable topic endpoint",l.TOPIC_OR_SELECTOR_MODIFIED_ON_DURABLE_TOPIC_ENDPOINT,"replay failed",l.REPLAY_FAILED,"replay start time not available",l.REPLAY_START_TIME_NOT_AVAILABLE,"replay start message unavailable",l.REPLAY_START_MESSAGE_NOT_AVAILABLE,"sync replication ineligible",l.SYNC_REPLICATION_INELIGIBLE,"max endpoints exceeded",l.MAX_ENDPOINTS_EXCEEDED,"copy-from queue template missing",l.COPY_FROM_QUEUE_TEMPLATE_MISSING,"copy-from topic-endpoint template missing",l.COPY_FROM_TE_TEMPLATE_MISSING),507,u("assured delivery not ready",l.ASSURED_DELIVERY_NOT_READY));function p(C,g,m){if(g===200)return 0;const T=C[g]||{},y=(m||"").toLowerCase(),E=Object.keys(T).find(I=>I===y||y.indexOf(I)>=0);return E?T[E]:T[""]?T[""]:C.PARENT?p(C.PARENT,g,m):void 0}function _(C,g,m){const T=p(C,g,m);return T===void 0?l.UNKNOWN_ERROR:T}const S={getErrorSubcode:(C,g)=>_(d,C,g),getADErrorSubcode:(C,g)=>_(f,C,g)};o.exports.ErrorResponseSubcodeMapper=S},5129:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.ErrorSubcode=a.new({UNKNOWN_ERROR:4294967295,NO_ERROR:0,SESSION_NOT_CONNECTED:2,INVALID_SESSION_OPERATION:3,INVALID_OPERATION:3,TIMEOUT:4,MESSAGE_VPN_NOT_ALLOWED:5,MESSAGE_VPN_UNAVAILABLE:6,CLIENT_USERNAME_IS_SHUTDOWN:7,DYNAMIC_CLIENTS_NOT_ALLOWED:8,CLIENT_NAME_ALREADY_IN_USE:9,CLIENT_NAME_INVALID:10,CLIENT_DELETE_IN_PROGRESS:11,TOO_MANY_CLIENTS:12,LOGIN_FAILURE:13,INVALID_VIRTUAL_ADDRESS:14,CLIENT_ACL_DENIED:15,SUBSCRIPTION_ACL_DENIED:16,PUBLISH_ACL_DENIED:17,PARAMETER_OUT_OF_RANGE:18,PARAMETER_CONFLICT:19,PARAMETER_INVALID_TYPE:20,INTERNAL_ERROR:21,INSUFFICIENT_SPACE:22,OUT_OF_RESOURCES:23,PROTOCOL_ERROR:24,COMMUNICATION_ERROR:25,KEEP_ALIVE_FAILURE:26,TOPIC_MISSING:28,INVALID_TOPIC_SYNTAX:31,MESSAGE_TOO_LARGE:32,XML_PARSE_ERROR:33,SUBSCRIPTION_ALREADY_PRESENT:34,SUBSCRIPTION_NOT_FOUND:35,SUBSCRIPTION_INVALID:36,SUBSCRIPTION_ERROR_OTHER:37,SUBSCRIPTION_TOO_MANY:38,SUBSCRIPTION_ATTRIBUTES_CONFLICT:39,NO_LOCAL_NOT_SUPPORTED:40,DATA_ERROR_OTHER:42,CREATE_XHR_FAILED:43,CONNECTION_ERROR:44,DATA_DECODE_ERROR:45,INACTIVITY_TIMEOUT:46,UNKNOWN_TRANSPORT_SESSION_ID:47,AD_MESSAGING_NOT_SUPPORTED:48,CREATE_WEBSOCKET_FAILED:49,REPLICATION_IS_STANDBY:50,BASIC_AUTHENTICATION_IS_SHUTDOWN:51,CLIENT_CERTIFICATE_AUTHENTICATION_IS_SHUTDOWN:52,GM_UNAVAILABLE:100,UNKNOWN_FLOW_NAME:111,ALREADY_BOUND:112,INVALID_TOPIC_NAME_FOR_TOPIC_ENDPOINT:113,UNKNOWN_QUEUE_NAME:114,UNKNOWN_TOPIC_ENDPOINT_NAME:115,MAX_CLIENTS_FOR_QUEUE:116,MAX_CLIENTS_FOR_TE:117,UNEXPECTED_UNBIND:118,QUEUE_NOT_FOUND:119,SPOOL_OVER_QUOTA:120,QUEUE_SHUTDOWN:121,TOPIC_ENDPOINT_SHUTDOWN:122,NO_MORE_NON_DURABLE_QUEUE_OR_TOPIC_ENDPOINT:123,ENDPOINT_ALREADY_EXISTS:124,PERMISSION_NOT_ALLOWED:125,INVALID_SELECTOR:126,MAX_MESSAGE_USAGE_EXCEEDED:127,ENDPOINT_PROPERTY_MISMATCH:128,NO_SUBSCRIPTION_MATCH:129,MESSAGE_DELIVERY_MODE_MISMATCH:130,MESSAGE_ALREADY_ACKNOWLEDGED:131,SUBSCRIPTION_DOES_NOT_MATCH:133,SELECTOR_DOES_NOT_MATCH:134,INVALID_DTE_NAME:135,UNSUBSCRIBE_NOT_ALLOWED_CLIENTS_BOUND:136,CALLBACK_ERROR:137,NOLOCAL_DISCARD:138,GM_NOT_READY:140,LOW_PRIORITY_MSG_CONGESTION:141,QUOTA_OUT_OF_RANGE:142,FAILED_LOADING_TRUSTSTORE:143,FAILED_LOADING_CERTIFICATE_AND_KEY:144,UNRESOLVED_HOSTS:145,REPLAY_NOT_SUPPORTED:146,REPLAY_DISABLED:147,CLIENT_INITIATED_REPLAY_NON_EXCLUSIVE_NOT_ALLOWED:148,CLIENT_INITIATED_REPLAY_INACTIVE_FLOW_NOT_ALLOWED:149,CLIENT_INITIATED_REPLAY_BROWSER_FLOW_NOT_ALLOWED:150,REPLAY_TEMPORARY_NOT_SUPPORTED:151,UNKNOWN_START_LOCATION_TYPE:152,REPLAY_CANCELLED:153,REPLAY_MESSAGE_UNAVAILABLE:154,REPLAY_START_TIME_NOT_AVAILABLE:155,REPLAY_MESSAGE_REJECTED:156,REPLAY_LOG_MODIFIED:157,MISMATCHED_ENDPOINT_ERROR_ID:158,OUT_OF_REPLAY_RESOURCES:159,TOPIC_OR_SELECTOR_MODIFIED_ON_DURABLE_TOPIC_ENDPOINT:160,REPLAY_FAILED:161,REPLAY_STARTED:162,COMPRESSED_TLS_NOT_SUPPORTED:163,SHARED_SUBSCRIPTIONS_NOT_SUPPORTED:164,SHARED_SUBSCRIPTIONS_NOT_ALLOWED:165,SHARED_SUBSCRIPTIONS_ENDPOINT_NOT_ALLOWED:166,REPLAY_START_MESSAGE_NOT_AVAILABLE:167,MESSAGE_ID_NOT_COMPARABLE:168,REPLAY_ANONYMOUS_QUEUE_NOT_SUPPORTED:169,PARTITIONED_QUEUE_BROWSING_NOT_SUPPORTED:170,PARTITIONED_QUEUE_SELECTORS_NOT_SUPPORTED:171,REPLAY_ANONYMOUS_QUEUE_WITHOUT_SUBSCRIPTIONS_NOT_SUPPORTED:172,SYNC_REPLICATION_INELIGIBLE:173,INVALID_QUEUE_OR_TOPIC_ENDPOINT_DURABILITY:174,INVALID_QUEUE_NAME:175,INVALID_TE_NAME:176,MESSAGE_SIZE_OUT_OF_RANGE:177,UNSUPPORTED_PERMISSIONS:178,MAX_ENDPOINTS_EXCEEDED:179,ASSURED_DELIVERY_NOT_READY:180,COPY_FROM_QUEUE_TEMPLATE_MISSING:181,COPY_FROM_TE_TEMPLATE_MISSING:182})},5749:(o,h,r)=>{const{SolaceError:a}=r(3922);class u extends a{constructor(d){super("NotImplementedError",d||"",u)}}o.exports.NotImplementedError=u},5192:(o,h,r)=>{const{SolaceError:a}=r(3922);class u extends a{constructor(d,f,p){super("OperationError",d,u),this.subcode=f,this.reason=p}}o.exports.OperationError=u},8916:(o,h,r)=>{var a=r(2195);const{ErrorSubcode:u}=r(5129),{OperationError:l}=r(5192),{RequestEventCode:d}=r(8309),f={[d.REQUEST_ABORTED]:u.SESSION_NOT_CONNECTED,[d.REQUEST_TIMEOUT]:u.TIMEOUT};o.exports.RequestError=class extends l{constructor(p,_,S,C){super(p,f[_],C),this.name="RequestError",this._eventCode=_,this._correlationKey=S}get requestEventCode(){return this._requestEventCode}get errorSubcode(){return super.subcode}inspect(){const p=super.inspect?super.inspect():{};return Object.assign(p,{requestEventCode:d.describe(this.requestEventCode),infoStr:this.infoStr,correlationKey:this.correlationKey})}toString(){return a(this)}}},8309:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.RequestEventCode=a.new({REQUEST_ABORTED:8,REQUEST_TIMEOUT:9})},3922:o=>{class h extends Error{constructor(a,u,l){super(u||""),this.message=u,this.name=a,Error.captureStackTrace?Error.captureStackTrace(this,l):this.stack=new Error().stack}}o.exports.SolaceError=h},7444:(o,h,r)=>{const{ArrayOperations:a}=r(6284),{assert:u}=r(5796),{BidiMap:l}=r(5447),{Enum:d}=r(8963),{Iterator:f}=r(112),{Lazy:p}=r(2128),{makeMap:_}=r(2515),{Mixin:S}=r(825),{Resolver:C}=r(4396),{SetOperations:g}=r(7999);o.exports.assert=u,o.exports.ArrayOperations=a,o.exports.BidiMap=l,o.exports.Enum=d,o.exports.Iterator=f,o.exports.Lazy=p,o.exports.makeIterator=f.makeIterator,o.exports.makeMap=_,o.exports.Mixin=S,o.exports.mixin=S.mixin,o.exports.Resolver=C,o.exports.resolve=C.resolve,o.exports.SetOperations=g},6284:o=>{function h(r,a){const u=String(r),l=String(a);return u>l?1:u<l?-1:0}o.exports={ArrayOperations:{defaultComparator:h,insertOrdered:function(r,a,u=h){const l=[...r];return this.inplaceInsertOrdered(l,a,u)},inplaceInsertOrdered:function(r,a,u=h){let l=0,d=0,f=r.length;if(f>0)if(u(a,r[f-1])>0)l=f;else for(l=d+f>>1;f>d;)u(a,r[l])<0?f=l:d=l+1,l=d+f>>1;r.splice(l,0,a)}}}},5796:o=>{let h;h=()=>{},o.exports.assert=h},5447:o=>{o.exports.BidiMap=class{constructor(...h){this.forward=new Map,this.reverse=new Map,h.forEach(r=>{this.setValues(r[0],r[1])})}setValues(h,r){this.forward.set(h,r),this.reverse.set(r,h)}}},8963:o=>{function h(a,u,l){const d=u.filter(f=>a[f]===l);return d.length?d[0]:null}class r{constructor(u){Object.defineProperties(this,{_canonical:{value:null,enumerable:!1,writable:!0,configurable:!0}}),this._setCanonical(u)}_setCanonical(u,l=!1){this._canonical=Object.assign({},u),Object.keys(this).forEach(d=>{const f=Object.getOwnPropertyDescriptor(this,d);f.value!==void 0&&Object.defineProperty(this,d,{enumerable:!1,writable:!0,configurable:!0,value:f.value})}),Object.keys(u).forEach(d=>{Object.defineProperty(this,d,{enumerable:!0,writable:!l,configurable:!l,value:u[d]})})}describe(u,l="<none>",d="<unknown>"){if(u==null)return l;const f=h(this._canonical,Object.keys(this._canonical||{}),u)||d;return f===u?f:`${f} (${u})`}nameOf(u){return h(this._canonical,Object.keys(this._canonical||{}),u)}get names(){return Object.keys(this._canonical||{})}get values(){return u=this._canonical,l=Object.keys(this._canonical||{}),Array.from(new Set(l.map(d=>u[d])));var u,l}get isEnum(){return!0}static nameOf(u,l){return u.nameOf(l)}static values(u){return u.values()}static new(u){return new r(u)}static ofStrings(u){const l={};return u.forEach(d=>{l[d]=d}),r.new(l)}static ofNumbers(u){const l={};return u.forEach((d,f)=>{l[d]=f}),r.new(l)}}o.exports.Enum=r},112:o=>{class h{constructor(a,u=0,l=a.length){this._arr=a,this._index=u,this._end=l}deref(){return this._arr[this._index]}incr(){return++this._index}end(){return this._index>=this._end}static makeIterator(a,u=0,l=a.length){return new h(a,u,l)}}o.exports.Iterator=h},2128:o=>{const h={enumerable:!0};function r(l,d,f,p=null){Object.defineProperty(l,d,Object.assign({value:f},h,p))}function a(l,d,f){return Object.defineProperty(l,d,Object.assign({configurable:!0,get:()=>{const p=f(l,d);return r(l,d,p),p},set:p=>{r(l,d,p)}},h)),l}const u={lazyProperties:function(l,d){return Object.keys(d).forEach(f=>{a(l,f,d[f])}),d},lazyProperty:a,lazyValue:function(l){return a({},"value",l)}};o.exports.Lazy=u},2515:o=>{o.exports.makeMap=function(...h){const r={};for(let a=0;a<h.length;a+=2)r[h[a]]=h[a+1];return r}},825:o=>{const h={mixin:function(r,a){const u=r.prototype,l=a.prototype;return Object.getOwnPropertyNames(l).forEach(d=>{d!=="constructor"&&Object.defineProperty(u,d,Object.getOwnPropertyDescriptor(l,d))}),r}};o.exports.Mixin=h},4396:(o,h,r)=>{const{Lazy:a}=r(2128),{lazyProperty:u}=a;class l{constructor(f,p){Object.keys(f).forEach(_=>{_.split(",").map(S=>S.trim()).forEach(S=>{const C=f[_],g=typeof C=="string"?C.split("."):C,m=(Array.isArray(g)?g:[g]).concat(S);u(this,S,()=>function(T,y,E){return E.reduce((I,N)=>typeof N=="string"?I[N]:N,y)}(0,this,m))})})}static resolve(f,p){return new l(f,p)}}o.exports.Resolver=l},7999:o=>{function h(r,a){return a.forEach(u=>{r.add(u)}),r}o.exports={SetOperations:{inplaceDifference:function(r,a){return a.forEach(u=>{r.delete(u)}),r},inplaceIntersection:function(r,a){return r.forEach(u=>{a.has(u)||r.delete(u)}),r},inplaceUnion:h,isSuperset:function(r,a){return Array.from(a).every(u=>r.has(u))},difference:function(r,a){return new Set(Array.from(r).filter(u=>!a.has(u)))},intersection:function(r,a){return new Set(Array.from(r).filter(u=>a.has(u)))},union:function(r,a){return h(new Set(r),a)}}}},3385:(o,h,r)=>{const{EventEmitter:a}=r(6018),{Timer:u}=r(3008);o.exports={EventEmitter:a,Timer:u}},6018:(o,h,r)=>{const a=r(7007).EventEmitter,{ArrayUtils:u}=r(968),{ErrorSubcode:l,OperationError:d}=r(6706),{LOG_WARN:f}=r(2694),{flatten:p,includes:_}=u,S=["error","newListener","removeListener"],C=["newListener","removeListener"],g={ignore(){},fail(){throw new Error("Emitter disabled")}};o.exports.EventEmitter=class extends a{constructor(m){super();const{direct:T,emits:y,unsafe:E,formatEventName:I}=m||{};this.formatEventName=I||(A=>A);const N=this.emit.bind(this);this._installDirectFilter(T,N),this._installErrorHandlers(E),this._installEmitVerifier(),this._listenerVerificationFilter=function(A){if(typeof A=="function")return q=>_(S,q)||A(q);if(!Array.isArray(A))return null;const L=new Set(p(A));S.forEach(q=>L.add(q));const D=Array.from(L);return q=>_(D,q)}(y),this._emits=y}_installDirectFilter(m,T){if(m){if(_(C,m))throw new d(`Cannot configure listener collection events [${C.join(", ")}] as direct`,l.INTERNAL_ERROR);this._defaultEmitDirect=(...y)=>T(m,...y),this.emitDirect=this._defaultEmitDirect,this._directEventName=m,this.on=(y,E)=>{this._verifyListenerEvent(y);const I=super.on(y,E);return this._setEmitDirect(y,!0,E),I},this.addListener=(y,E)=>this.on(y,E),this.once=(y,E)=>{this._verifyListenerEvent(y);const I=super.once(y,E);return this._setEmitDirect(y,!1),I},this.prependListener=(y,E)=>{this._verifyListenerEvent(y);const I=super.prependListener(y,E);return this._setEmitDirect(y,!0,E),I},this.prependOnceListener=(y,E)=>{this._verifyListenerEvent(y);const I=super.prependOnceListener(y,E);return this._setEmitDirect(y,!1),I},this.removeAllListeners=y=>{const E=super.removeAllListeners(y);return y!==this._directEventName&&y!==void 0||(this.emitDirect=this._defaultEmitDirect),E},this.removeListener=(y,E)=>{const I=super.removeListener(y,E);return y===this._directEventName&&this.listenerCount(y)===0&&(this.emitDirect=this._defaultEmitDirect),I},this.directListenerCount=()=>this.listenerCount(this._directEventName),this.setOnFirstDirectListener=y=>{this._onFirstDirectListener=y}}}_setEmitDirect(m,T,y){m===this._directEventName&&(T&&this.directListenerCount()===1?this.emitDirect=y:this.emitDirect=this._defaultEmitDirect,this.directListenerCount()===1&&this._onFirstDirectListener!==void 0&&this._onFirstDirectListener())}_verifyListenerEvent(m){this._listenerVerificationFilter&&(m==null&&this.throwInternal(new d(`Emitter rejects listener for no-name event: ${m}`,l.PARAMETER_OUT_OF_RANGE)),this._listenerVerificationFilter(m)||this.throwInternal(new d(`Emitter rejects listeners for ${m}, emits ${this._emits}`,l.PARAMETER_OUT_OF_RANGE)))}_installEmitVerifier(){}_installErrorHandlers(m){if(m)return void(this.throwInternal=y=>{throw y});const T=this.emit.bind(this);this.throwInternal=function(y){throw this._internalError=!0,y},this.emit=(y,...E)=>{try{T(y,...E)}catch(I){if(this._internalError)throw this._internalError=void 0,I;const N=this.formatErrorEvent(I,y,...E);try{f(`Listener for '${N.info.event.formattedName}' threw exception, dispatching to 'error'`),T("error",N)}catch(A){f("Listener for 'error' threw exception:",A,`
|
|
69
|
-
Original exception:`,I)}}}}get isDirect(){return this.emitDirect&&this.emitDirect!==this._defaultEmitDirect}formatErrorEvent(m,T,...y){const E=this.formatEventName(T);return Object.assign(new d(`Unhandled error in event handler for '${E}'`,l.CALLBACK_ERROR,`On event: ${[T,...y]} ${m}`),{stack:m.stack,info:{event:{name:T,formattedName:E,args:y},error:m}})}disableEmitter(){this._defaultEmitDirect=g.ignore,this.removeAllListeners(),this.emit=g.ignore,this.addListener("removeListener",g.fail),this.addListener("newListener",g.fail)}}},3008:o=>{class h{constructor(a){this.cancel=()=>{this.cancel=()=>{},a()}}static newInterval(a,u,...l){const d=setInterval(u,a,...l);return new h(()=>clearInterval(d))}static newTimeout(a,u,...l){const d=setTimeout(u,a,...l);return new h(()=>clearTimeout(d))}}o.exports.Timer=h},4386:(o,h,r)=>{const{FactoryProfile:a,SolclientFactoryProfiles:u}=r(755),{ProfileBinding:l}=r(4807),{SolclientFactory:d}=r(5656),{SolclientFactoryProperties:f}=r(852);o.exports.FactoryProfile=a,o.exports.ProfileBinding=l,o.exports.SolclientFactoryProfiles=u,o.exports.SolclientFactoryProperties=f,o.exports.SolclientFactory=d},4807:(o,h,r)=>{const{OperationError:a}=r(6706);let u=null;const l={get value(){if(u===null)throw new a("Profile binding not initialized. Call solace.SolclientFactory.init");return u},set value(d){u=d}};o.exports.ProfileBinding=l},755:(o,h,r)=>{var a=r(2195);class u{get guaranteedMessagingEnabled(){}get cometEnabled(){}get topicUtf8Encode(){}get byteArrayAsString(){}inspect(){return{guaranteedMessagingEnabled:this.guaranteedMessagingEnabled,cometEnabled:this.cometEnabled,topicUtf8Encode:this.topicUtf8Encode,byteArrayAsString:this.byteArrayAsString}}toString(){return a(this)}}const l=new class extends u{get guaranteedMessagingEnabled(){return!1}get cometEnabled(){return!0}get topicUtf8Encode(){return!1}get byteArrayAsString(){return!0}},d=new class extends u{get guaranteedMessagingEnabled(){return!0}get cometEnabled(){return!1}get topicUtf8Encode(){return!0}get byteArrayAsString(){return!0}},f=new class extends u{get guaranteedMessagingEnabled(){return!0}get cometEnabled(){return!1}get topicUtf8Encode(){return!0}get byteArrayAsString(){return!1}},p={_legacy:l,_v10:d,_forward:f,_default:l,version7:l,version10:d,version10_5:f,inspect(){return{version7:this.version7,version10:this.version10,version10_5:this.version10_5}},toString(){return a(this)}};o.exports.FactoryProfile=u,o.exports.SolclientFactoryProfiles=p},852:(o,h,r)=>{var a=r(2195);const{APIProperties:u}=r(968),{Check:l}=r(802);function d(){const{LogLevel:f}=r(2694);return f.INFO}o.exports.SolclientFactoryProperties=class extends u{constructor(f){super({logLevel:d(),logger:null},f)}get profile(){return this._profile}set profile(f){this._profile=f}get logLevel(){return l.number(this._logLevel)?this._logLevel:d()}set logLevel(f){this._logLevel=f}get logger(){return this._logger||null}set logger(f){this._logger=f}inspect(){const{LogLevel:f}=r(2694);return{logLevel:f.describe(this._logLevel),profile:this._profile}}toString(){return a(this)}}},5656:(o,h,r)=>{const{ErrorSubcode:a,OperationError:u}=r(6706),{FactoryProfile:l,SolclientFactoryProfiles:d}=r(755),{Parameter:f}=r(802),{ProfileBinding:p}=r(4807),{SolclientFactoryProperties:_}=r(852),S={initializeCount:0,initializers:[]},C={addInitializer(g){S.initializers.push(g)},createFactory:g=>function(...m){if(S.initializeCount===0)throw new u("SolclientFactory not initialized",a.INVALID_OPERATION);return g(...m)},init(g){if(S.initializeCount>0)return this;const m=new _(g),T=g&&g.profile||d.version7;return f.isInstanceOf("factoryProps.profile",T,l),p.value=T,S.initializers.forEach(y=>{y.call(this,m,S)}),++S.initializeCount,g!=null&&r(2694),this},reset(){S.initializeCount=0},_getInitializeCount:()=>S.initializeCount,get profiles(){return d}};o.exports.SolclientFactory=C},8860:(o,h,r)=>{const{Flow:a}=r(8770),{FlowOperation:u}=r(2326),{PrivateFlowEventName:l}=r(9747);o.exports.Flow=a,o.exports.FlowOperation=u,o.exports.PrivateFlowEventName=l},2326:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.FlowOperation=a.new({CONNECT:"FlowOperation_CONNECT",DISCONNECT:"FlowOperation_DISCONNECT",START:"FlowOperation_START",STOP:"FlowOperation_STOP",DISPOSE:"FlowOperation_DESTROY",GET_STATS:"FlowOperation_GET_STATS",RESET_STATS:"FlowOperation_RESET_STATS",GET_PROPERTIES:"FlowOperation_GET_PROPERTIES",GET_DESTINATION:"FlowOperation_GET_DESTINATION"})},8770:(o,h,r)=>{const{ErrorSubcode:a,NotImplementedError:u,OperationError:l}=r(6706),{EventEmitter:d}=r(3385),{FlowOperation:f}=r(2326),{LogFormatter:p}=r(2694),{PrivateFlowEventName:_}=r(9747),{Stats:S}=r(5747),C=[f.DISPOSE,f.GET_STATS,f.GET_PROPERTIES,f.RESET_STATS];o.exports.Flow=class extends d{constructor(g,m,T){const y=Object.assign({},T);y.emits=(y.emits||[]).concat(_.values),super(y);const E=m(this),I=this;this.logger=new p((...N)=>[`[session=${E.sessionIdHex}]`,`[flow=${I.flowIdDec}]`,...N]),this.log=this.logger.wrap(this.log,this),this._disposing=!1,this._disposed=!1,this._userDisconnected=!0,this._properties=g,this._sessionInterface=E,this._stats=new S(E),this._privateEventEmitter=new d(y)}_emit(g,...m){this._privateEventEmitter.emit(g,...m),this.emit(g,...m)}_on(g,m){this._privateEventEmitter.on(g,m)}_once(g,m){this._privateEventEmitter.once(g,m)}_removeListener(g,m){this._privateEventEmitter.removeListener(g,m)}clearStats(){this.logger,this._operationCheck(f.RESET_STATS),this._stats.resetStats()}connect(){this.logger,this.userDisconnected=!1,this._operationCheck(f.CONNECT)}dispose(){if(this.logger,this._disposed||this._disposing)return;this._operationCheck(f.DISPOSE),this._disposing=!0;const g=()=>{this._disposed=!0,this._properties=null,this._userDisconnected=!0,this._emit(this.getDisposedEvent()),this.disableEmitter(),this._privateEventEmitter.disableEmitter()};if(this._fsm._midDispatch){const m=()=>{this._fsm.terminateFsm(),g()};setTimeout(()=>m(),0)}else g()}disconnect(){this._operationCheck(f.DISCONNECT),this.logger,this.userDisconnected=!0}_disconnectSession(){this._operationCheck(f.DISCONNECT)}getDisposedEvent(){throw new u("Abstract method")}getProperties(){return this._operationCheck(f.GET_PROPERTIES),this._properties.clone()}getStat(g){return this._operationCheck(f.GET_STATS),this._stats.getStat(g)}handleUncorrelatedControlMessage(g){throw new u("Guaranteed Message Connection does not implement a control message handler",g)}incStat(g,m){this._stats.incStat(g,m)}processFSMEvent(g){this._fsm.processEvent(g)}inspect(){return{flowId:this.flowIdDec}}toString(){return this.inspect()}get canAck(){return!this.disposed}get disposed(){return this._disposed}get flowIdDec(){return this.flowId||"(N/A)"}get flowId(){return new u("Flow does not implement ID accessor")}get session(){return this._session}get userDisconnected(){return this._userDisconnected}set userDisconnected(g){this._userDisconnected=g}_operationCheck(g){if(this.logger,f.describe(g),this._disposed)throw new l("Operation is invalid for Message Consumer in disposed state",a.INVALID_OPERATION);if(C.some(m=>m===g))return!0;if(g===f.DISCONNECT&&this._isDisconnected())throw new l("Operation is invalid for Message Consumer in disconnected state",a.INVALID_OPERATION)}_isDisconnected(){throw new u("Flow#_isDisconnected not implemented")}}},9747:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.PrivateFlowEventName=a.new({BIND_WAITING:"PrivateFlowEventName_bindWaiting"})},7414:(o,h,r)=>{const{FsmEvent:a}=r(7818),{State:u}=r(7339),{StateMachine:l}=r(3671);o.exports.FsmEvent=a,o.exports.State=u,o.exports.StateMachine=l},5921:(o,h,r)=>{const a=r(7339),{FsmObject:u}=r(6031);o.exports.EntryPoint=class extends u{constructor(l){let d;super({name:l.entryPointName}),this.impl=this.impl||{},this.impl.outerState=new a.State({name:`${l.state.getName()} outerEntryPoint: ${l.entryPointName}`,parentContext:l.state.getParent()}).initial(()=>l.state.transitionTo(d)),d=new a.State({name:`${l.state.getName()} innerEntryPoint: ${l.entryPointName}`,parentContext:l.state}).initial(l.func)}getDestState(){return this.impl.outerState}}},7818:(o,h,r)=>{const{FsmObject:a}=r(6031);o.exports.FsmEvent=class extends a{}},5027:(o,h,r)=>{const a=r(7339),{FsmObject:u}=r(6031);o.exports.ExitPoint=class extends u{constructor(l){let d;super({name:l.exitPointName}),this.impl.innerState=new a.State({name:`${l.state.getName()} innerExitPoint: ${l.exitPointName}`,parentContext:l.state}).initial(()=>l.state.transitionTo(d)),d=new a.State({name:`${l.state.getName()} outerExitPoint: ${l.exitPointName}`,parentContext:l.state.getParent()}).initial(l.func)}getDestState(){return this.impl.innerState}}},6031:(o,h,r)=>{const{OperationError:a}=r(6706);o.exports.FsmObject=class{constructor(u){if(!u)throw new a("No spec provided");if(!u.name)throw new a("No name provided for spec");this.impl={name:u.name}}toString(){let u=this.getExtraStringInfo();return u.length>0&&(u=`; ${u}`),`{${this.constructor.name}: ${this.getName()}${u}}`}getExtraStringInfo(){return""}getName(){return this.impl.name}}},1493:(o,h,r)=>{const a=r(7339),{FsmObject:u}=r(6031),{Iterator:l}=r(7444);r(2694);const{makeIterator:d}=l;class f extends u{constructor(_){super(_),this.impl=this.impl||{},this.impl.logPadding=""}getStateMachine(){return this.impl.ancestorList[0]}initial(_){return this.impl.initialReaction&&this.log(`Replacing ${this} initialReaction ${this.impl.initialReaction} with ${_}`),this.impl.initialReaction=_.bind(this),this}transitionTo(_,S){return new f.ReactionResult({caller:this,destState:_,action:S})}terminate(_){return new f.ReactionResult({caller:this,destState:this.getStateMachine().getFinalState(),action:_})}getAncestorList(){return this.impl.ancestorList}log(..._){this.impl.logPadding}onInitial(_){let S;if(this.impl.initialReaction){if(this.log(`Initial: for ${this}`),S=this.impl.initialReaction(_),S.external)throw new Error(`Initial reaction for ${this} returned external transitions`);return S}if(!(this instanceof a.State))throw new Error(`Missing initial reaction for ${this}`);return this.transitionTo(this)}processReactionResult(_,S){let C=this;if(!_.destState)return this;const g=this.lowestCommonAncestor(_);for(;C!==g.deref();)C.onExit(),C=C.getParent();for(_.action&&_.action(C,S),C.log(`Action: transition to ${_.destState} in context ${C}`),g.incr();!g.end();g.incr())C=g.deref(),C.onEntry();const m=C.onInitial(S);return m.destState!==C?C.processReactionResult(m,S):C}lowestCommonAncestor(_){const S=this.impl.ancestorList,C=_.destState.getAncestorList();let g;if(S[0]!==C[0])throw new Error(`No common ancestor between (${this} in ${S[0]}) and (${_.destState} in ${C[0]})`);if(this===_.destState)g=S.length,_.external&&--g;else{for(g=1;g<S.length&&S[g]===C[g];++g);g!==S.length&&g!==C.length||_.external&&--g}return d(C,g-1)}setLogPadding(_){this.impl.logPadding=_}}f.ReactionResult=class{constructor(p){if(!(p&&p.caller&&p.caller instanceof f))throw new Error("spec.caller is required to be a StateContext");if(!p.caller.getStateMachine().isRunning())throw new Error("ReactionResult objects can only be created while processing events");if(p.destState){if(!(p.destState instanceof a.State))throw new Error("destState must be a State object");if(p.action&&typeof p.action!="function")throw new Error("action must be a function");this.destState=p.destState,this.action=p.action,this.external=p.external}}},o.exports.StateContext=f},3671:(o,h,r)=>{const{LOG_ERROR:a}=r(2694),{State:u}=r(7339),{StateContext:l}=r(1493);o.exports.StateMachine=class extends l{constructor(d){if(d.parentContext)throw new Error(`State machine cannot have parent state: ${d.parentContext}`);super(d),this.impl.ancestorList=[this],this.impl.eventQueue=[],this.impl.finalState=new u({name:"impl.final",parentContext:this}),this.impl.handleUncaughtException=(f,p)=>(a(`Uncaught exception in ${this} while processing ${f}: ${p.stack}`),this.terminate())}process(d){const{impl:f}=this,{eventQueue:p}=f;if(p.push(d),f.processingEvents)return!1;for(f.processingEvents=!0;p.length;)p.shift().apply(this);return f.processingEvents=!1,this._onEventCompletion(),!0}start(){if(this.getCurrentState())throw new Error(`Cannot start ${this.getName()}; it is already started.`);this.process(()=>{const d=this.onInitial();if(d.destState===void 0)throw new Error(`Missing destination state from initial transition for ${this}`);if(d.destState===this)throw new Error(`Destination state for initial transition for ${this} cannot be the FSM.`);const f=d.destState.getAncestorList();if(f[0]!==this)throw new Error(`Invalid destination state (${d.destState}) from initial transition for state machine (${this}); destState ancestor (${f[0]})`);this.impl.currentState=this.processReactionResult(d)})}isRunning(){return this.impl.processingEvents}processEvent(d){const{impl:f}=this;this.process(()=>{let p;if(this.log(`Processing event ${d}`),f.currentState)try{p=f.currentState.handleEvent(d),f.currentState=f.currentState.processReactionResult(p,d)}catch(_){this.log(`Caught exception ${_}, continuing`),p=f.handleUncaughtException.call(f.currentState,d,_),f.currentState=f.currentState.processReactionResult(p,d)}})||this.log(`Deferring event ${d}`)}terminateFsm(){const d=this.getCurrentState();if(d){if(this.impl.processingEvents)throw new Error("Cannot terminate state machine while FSM is processing events. To terminate the FSM from within a reaction, return State~terminate() from a reaction.");this.process(()=>{const f=d.terminate();this.impl.currentState=d.processReactionResult(f)})}}setPostEventAction(d){if(!this.impl.processingEvents)throw new Error("Cannot set post event hook unless FSM is processing events.");if(!d||typeof d!="function")throw new Error(`postEventAction must be a function; got (${d})`);this.impl.postEventAction=d.bind(this)}_onEventCompletion(){const d=this.impl.postEventAction;d&&(this.impl.postEventAction=void 0,this.log("Running post event action"),d.apply(this))}getCurrentState(){return this.impl.currentState}getActiveState(d){const f=this.impl.currentState.getAncestorList();for(let p=1;p<f.length;++p)if(f[p].getName()===d)return f[p]}isStateActive(d){return this.getActiveState(d)!==void 0}unhandledEventReaction(d){if(typeof d!="function")throw new Error(`In ${this}: unhandled event reaction must be a function; got ${d}`);return this.impl.handleUnhandledEvent=d.bind(this),this}uncaughtExceptionReaction(d){if(typeof d!="function")throw new Error(`In ${this}: Uncaught exception reaction must be a function; got ${d}`);return this.impl.handleUncaughtException=d,this}getFinalState(){return this.impl.finalState}}},7339:(o,h,r)=>{const{EntryPoint:a}=r(5921),{ExitPoint:u}=r(5027),{StateContext:l}=r(1493);o.exports.State=class extends l{constructor(d,f=null){super(d);const p=d.parentContext;Object.assign(this.impl,{parentContext:p,reactions:{},entryPoints:{},exitPoints:{},ancestorList:[...p.getAncestorList(),this],handleUnhandledEvent:_=>p.handleEvent?p.handleEvent(_):p.impl.handleUnhandledEvent(_)}),p&&(this.log=p.log.bind(this)),Object.keys(f||{}).forEach(_=>{const S=f[_];this[_]=typeof S=="function"?S.bind(this):S}),this.setLogPadding(" ".repeat(this.impl.ancestorList.length))}reaction(d,f){if(!d)throw new Error("No event name for reaction");if(!f)throw new Error(`No reaction function for reaction ${d}`);return this.log(`Adding reaction to ${this} for event ${d}`),this.impl.reactions[d]&&this.log(`Replacing reaction ${this.impl.reactions[d]} with ${f}`),this.impl.reactions[d]=f.bind(this),this}entryPoint(d,f){if(!d)throw new Error("No entry point name for entry point");if(!f)throw new Error(`No reaction function for entry point ${d}`);return this.log(`Adding entryPoint ${d} to ${this}`),this.impl.entryPoints[d]?(this.log(`EntryPoint ${d} already exists in ${this}`),this):(this.impl.entryPoints[d]=new a({state:this,entryPointName:d,func:f}),this)}exitPoint(d,f){if(!d)throw new Error("No exit point name for entry point");if(!f)throw new Error(`No reaction function for exit point ${d}`);return this.log(`Adding exitPoint ${d} to ${this}`),this.impl.exitPoints[d]?(this.log(`ExitPoint ${d} already exists in ${this}`),this):(this.impl.exitPoints[d]=new u({state:this,exitPointName:d,func:f}),this)}getEntryPointDestState(d){return this.impl.entryPoints[d]===void 0?(this.log(`${this}: EntryPoint ${d} does not exist.`),this):this.impl.entryPoints[d].getDestState()}getExitPointDestState(d){return this.impl.exitPoints[d]===void 0?(this.log(`${this}: ExitPoint ${d} does not exist.`),this):this.impl.exitPoints[d].getDestState()}entry(d){return this.impl.appEntryFunc&&this.log(`Replacing entry function ${this.impl.appEntryFunc} with ${d}`),this.impl.appEntryFunc=d.bind(this),this}exit(d){return this.impl.appExitFunc&&this.log(`Replacing exit function ${this.impl.appExitFunc} with ${d}`),this.impl.appExitFunc=d.bind(this),this}externalTransitionTo(d,f){return new l.ReactionResult({caller:this,destState:d,action:f,external:!0})}transitionToEntryPoint(d,f,p){return new l.ReactionResult({caller:this,destState:d.getEntryPointDestState(f),action:p})}transitionToExitPoint(d,f,p){return new l.ReactionResult({caller:this,destState:d.getExitPointDestState(f),action:p})}eventUnhandled(){return new l.ReactionResult({caller:this})}internalTransition(d){return new l.ReactionResult({caller:this,destState:this.getStateMachine().getCurrentState(),action:d})}terminate(d){return new l.ReactionResult({caller:this,destState:this.getStateMachine().getFinalState(),action:d})}getParent(){return this.impl.parentContext}onEntry(){this.log(`Entering: ${this}`),this.impl.appEntryFunc&&this.impl.appEntryFunc()}onExit(){this.log(`Exiting: ${this}`),this.impl.appExitFunc&&this.impl.appExitFunc()}handleEvent(d){this.log(`Process: ${d}`);const f=this.impl.reactions[d.getName()];if(f){const p=f(d);if(p||this.log(`Reaction returned undefined: ${d} in ${this}`),p.destState)return this.log(`Handled: ${d}`),p;this.log(`Unhandled: ${d} in ${this}`)}else this.log(`No reaction: ${d} in ${this}`);return this.impl.handleUnhandledEvent(d)}}},2694:(o,h,r)=>{const{ConsoleLogImpl:a}=r(9563),{GlobalBinding:u}=r(599),{LogImpl:l}=r(1719),{LogLevel:d}=r(1074),{Parameter:f}=r(802),{SolclientFactory:p}=r(4386),{isEnumMember:_,isFunction:S}=f,{getImpl:C,getLogLevel:g,setImpl:m,setLogLevel:T}=u,y={};function E(I,N){Object.keys(y).forEach(A=>{N[`LOG_${A.toUpperCase()}`]=I[A]})}Object.assign(y,{trace(...I){const N=C();N&&N.trace&&g()>=d.TRACE&&N.trace.apply(null,["solclientjs: ",...I])},debug(...I){const N=C();N&&N.debug&&g()>=d.DEBUG&&N.debug.apply(null,["solclientjs: ",...I])},info(...I){const N=C();N&&N.info&&g()>=d.INFO&&N.info.apply(null,["solclientjs: ",...I])},warn(...I){const N=C();N&&N.warn&&g()>=d.WARN&&N.warn.apply(null,["solclientjs: ",...I])},error(...I){const N=C();N&&N.error&&g()>=d.ERROR&&N.error.apply(null,["solclientjs: ",...I])},fatal(...I){const N=C();N&&N.fatal&&N.fatal.apply(null,["solclientjs: ",...I])}}),p.getLogLevel=()=>g(),p.setLogLevel=I=>{_("logLevel",I,d),T(I)},p.addInitializer(I=>{T(I.logLevel);const N=I.logger||C()||new a;Object.keys(new l).forEach(A=>S(`logger.${A}`,N[A])),m(N)}),E(y,o.exports),o.exports.LogImpl=l,o.exports.LogLevel=d,o.exports.Binding=u,o.exports.ConsoleLogImpl=a,u.setImpl(new a),o.exports.LogFormatter=class{constructor(I){this._formatter=typeof I=="function"?I:typeof I=="string"?function(...A){return[I,...A]}:I||function(...A){return[...A]};const N=this;Object.keys(y).forEach(A=>{this[A]=function(...L){return y[A].apply(null,N._formatter(...L))}}),E(this,this)}get formatter(){return this._formatter}set formatter(I){this._formatter=I}wrap(I,N){const A=this;return function(...L){return I.apply(N,A._formatter(...L))}}}},9563:(o,h,r)=>{const{LogImpl:a}=r(1719),u=()=>{};function l(d){const f=new Date,p=" ".repeat(6-d.length);let _=String(f.getFullYear()),S=String(f.getMonth()+1),C=String(f.getDate()),g=String(f.getHours()),m=String(f.getMinutes()),T=String(f.getSeconds()),y=String(f.getMilliseconds());return _="0".repeat(4-_.length)+_,S=S.length<2?`0${S}`:S,C=C.length<2?`0${C}`:C,g=g.length<2?`0${g}`:g,m=m.length<2?`0${m}`:m,T=T.length<2?`0${T}`:T,y=y.length<3?`0${y}`:y,y=y.length<3?`0${y}`:y,[`${_}-${S}-${C} ${g}:${m}:${T}.${y}`,`${d}${p}`]}o.exports.ConsoleLogImpl=class extends a{constructor(d){let f=u,p=u,_=u,S=u,C=u,g=u;const m=d||(typeof window>"u"?r.g:window).console;m&&(m.log||m.warn)&&(m.log&&m.log!==void 0?(f=Function.prototype.bind.call(m.log,m),p=Function.prototype.bind.call(m.log,m)):m.debug&&typeof m.debug=="function"&&(f=Function.prototype.bind.call(m.debug,m),p=Function.prototype.bind.call(m.debug,m)),_=m.info&&m.info!==void 0?Function.prototype.bind.call(m.info,m):Function.prototype.bind.call(m.log,m),S=m.warn&&m.warn!==void 0?Function.prototype.bind.call(m.warn,m):Function.prototype.bind.call(m.log,m),m.error&&m.error!==void 0?(C=Function.prototype.bind.call(m.error,m),g=Function.prototype.bind.call(m.error,m)):(C=Function.prototype.bind.call(m.log,m),g=Function.prototype.bind.call(m.log,m))),super((...T)=>{f(...l("TRACE"),...T)},(...T)=>{p(...l("DEBUG"),...T)},(...T)=>{_(...l("INFO"),...T)},(...T)=>{S(...l("WARN"),...T)},(...T)=>{C(...l("ERROR"),...T)},(...T)=>{g(...l("FATAL"),...T)})}}},599:(o,h,r)=>{const{LogLevel:a}=r(1074),u={impl:null,level:a.INFO},l={getImpl:function(){return u.impl},setImpl:function(d){u.impl=d},getLogLevel:function(){return u.level},setLogLevel:function(d){u.level=d}};o.exports.GlobalBinding=l},1719:o=>{o.exports.LogImpl=class{constructor(h,r,a,u,l,d){Object.assign(this,{trace:h,debug:r,info:a,warn:u,error:l,fatal:d})}trace(){}debug(){}info(){}warn(){}error(){}fatal(){}}},1074:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.LogLevel=a.new({FATAL:0,ERROR:1,WARN:2,INFO:3,DEBUG:4,TRACE:5})},178:(o,h,r)=>{const{ConsumerFlows:a}=r(8960),{ConsumerFSMEvent:u}=r(946),{ConsumerFSMEventNames:l}=r(1699),{MessageConsumer:d}=r(6598),{MessageConsumerAcknowledgeMode:f}=r(4590),{MessageConsumerEvent:p}=r(3247),{MessageConsumerEventName:_}=r(6934),{MessageConsumerProperties:S}=r(2558),{QueueBrowser:C}=r(2584),{QueueBrowserEventName:g}=r(8496),{QueueBrowserProperties:m}=r(4548);o.exports.ConsumerFlows=a,o.exports.ConsumerFSMEvent=u,o.exports.ConsumerFSMEventNames=l,o.exports.MessageConsumer=d,o.exports.MessageConsumerEvent=p,o.exports.MessageConsumerAcknowledgeMode=f,o.exports.MessageConsumerEventName=_,o.exports.MessageConsumerProperties=S,o.exports.QueueBrowser=C,o.exports.QueueBrowserEventName=g,o.exports.QueueBrowserProperties=m},7671:(o,h,r)=>{const{Enum:a,assert:u}=r(7444),{MessageOutcome:l}=r(6247),{LOG_DEBUG:d,LOG_ERROR:f}=r(2694),p=a.new({UNACKED:"UNACKED",ACKED_NOT_SENT:"ACKED_NOT_SENT",ACKED_SENT:"ACKED_SENT"});class _{constructor(C,g,m){C?(this.exists=!0,this.id=C,this.key=C.toString(),this.state=g||p.UNACKED,this.settlementOutcome=m||l.ACCEPTED):this.exists=!1}set(C,g,m=void 0){this.exists=!0,this.id=C,this.key=C.toString(),this.state=g||p.UNACKED,this.settlementOutcome=m!==void 0?m:null}clear(){this.exists=!1,this.id=null,this.key=null,this.state=null,this.settlementOutcome=null}}Object.assign(o.exports,{ApplicationAckState:p,ApplicationAck:_,ApplicationAckRingBuffer:class{constructor(S){u(S>=2),this._size=S,this._insertIndex=0,this._buffer=Array(S).fill(null).map(()=>new _),this._index=new Map}reset(){this._insertIndex=0,this._buffer.forEach(S=>{S.exists=!1}),this._index.clear()}insert(S,C){u(C),u(S);const g=this._size,m=this._buffer,T=this._index,y=this._insertIndex;u(!m[y].exists,"Invariant not enforced (before): insert index not empty");const E=m[y];E.set(S,p.UNACKED),T.has(E.key)&&f(`Duplicate ID: ${T.get(E.key)} insertIndex: ${y}`),T.set(E.key,y);const I=m[(y+1)%g];let N;try{N=C(I.exists?I:null)}finally{this._insertIndex=(y+1)%g,I.exists&&(T.delete(I.key),I.clear())}return u(!m[this._insertIndex].exists,"Invariant not enforced (after): insert index not empty"),N}get length(){return this._index.size}front(){if(this.length===0)return null;const S=this._buffer,C=this._insertIndex,g=this._size,m=(C+1)%g;if(S[m].exists)return S[m];for(let T=m,y=m+g-1;T<=y;++T){const E=S[T%g];if(E.exists)return E}return u(this._index.size===0,"#front() failed so buffer must be empty"),null}forEach(S){if(this.length===0)return;const C=this._buffer,g=this._size;let m=0;for(let T=this._insertIndex+1,y=this._insertIndex+g;T<=y;++T){const E=C[T%g];E.exists&&S(E,m++,this)}u(m>0,"Not empty but did not dispatch")}updateAckState(S,C,g=void 0){const m=S.toString();u(this._index.has(m),"Ack key not found");const T=this._buffer[this._index.get(m)];u(T,"Ack key has no entry"),T.state=C,g!=null?T.settlementOutcome=g:C===p.ACKED_NOT_SENT&&(T.settlementOutcome=l.ACCEPTED)}has(S){const C=S.toString();return this._index.has(C)}}})},8960:(o,h,r)=>{const{assert:a}=r(7444),{MessageConsumer:u}=r(6598),{MessageConsumerEventName:l}=r(6934);o.exports.ConsumerFlows=class{constructor(){this._allFlows=new Set,this._reconnectingFlows=new Set,this._flowsById={}}add(d){if(a(d instanceof u,"Flow was not a consumer"),this._allFlows.has(d))return d;const f=()=>{this._flowsById[d.flowId]=d},p=()=>{const S=d.flowId;this._allFlows.delete(d),this._reconnectingFlows.delete(d),this._flowsById[S]===d&&delete this._flowsById[S]},_=()=>{this._reconnectingFlows.delete(d)};return d._on(l.UP,f),d._on(l.RECONNECTED,()=>{f(),this._allFlows.add(d),this._reconnectingFlows.delete(d)}),d._on(l.DISPOSED,p),d._on(l.RECONNECTING,()=>{p(),this._reconnectingFlows.add(d)}),d._on(l.DOWN,_),d._on(l.DOWN_ERROR,_),this._allFlows.add(d),d}get flows(){return Array.from(this._allFlows)}get reconnectingFlows(){return Array.from(this._reconnectingFlows)}getFlowById(d){return this._flowsById[d]}disposeAll(){this._allFlows.forEach(d=>d.dispose())}}},1699:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.ConsumerFSMEventNames=a.new({SESSION_UP:"SESSION_UP",SESSION_UP_NO_AD:"SESSION_UP_NO_AD",SESSION_DOWN:"SESSION_DOWN",SESSION_DISCONNECT:"SESSION_DISCONNECT",FLOW_FAILED:"FLOW_FAILED",FLOW_UP:"FLOW_UP",FLOW_ACTIVE_IND:"FLOW_ACTIVE_IND",FLOW_CLOSE:"FLOW_CLOSE",FLOW_OPEN:"FLOW_OPEN",FLOW_UNBOUND:"FLOW_UNBOUND",ACK:"ACK",ACK_TIMEOUT:"ACK_TIMEOUT",BIND_TIMEOUT:"BIND_TIMEOUT",CREATE_TIMEOUT:"CREATE_TIMEOUT",UNBIND_TIMEOUT:"UNBIND_TIMEOUT",CAN_SEND:"CAN_SEND",TRANSPORT_ERROR:"TRANSPORT_ERROR",DISPOSE:"DISPOSE",VIRTUALROUTER_NAME_CHANGED:"VIRTUALROUTER_NAME_CHANGED",RECONNECT_INTERVAL_TIMEOUT:"RECONNECT_INTERVAL_TIMEOUT",BIND_RESPONSE:"BIND_RESPONSE",CREATE_FAILED:"CREATE_FAILED",CREATE_SUCCESS:"CREATE_SUCCESS"})},946:(o,h,r)=>{const{FsmEvent:a}=r(7414);o.exports.ConsumerFSMEvent=class extends a{constructor(u,l){super(u),this.details=l}}},9035:(o,h,r)=>{const a=r(3450),{ApplicationAck:u,ApplicationAckRingBuffer:l,ApplicationAckState:d}=r(7671),{assert:f}=r(7444),{CapabilityType:p}=r(5024),{ConsumerFSMEvent:_}=r(946),{ConsumerFSMEventNames:S}=r(1699),{ConsumerStateNames:C}=r(3561),{DestinationFromNetwork:g,DestinationType:m,Queue:T,Topic:y}=r(9620),{ErrorResponseSubcodeMapper:E,ErrorSubcode:I,OperationError:N}=r(6706),{LogFormatter:A}=r(2694),{Long:L}=r(9783),{MessageConsumerAcknowledgeMode:D}=r(4590),{MessageConsumerEventName:q}=r(6934),{MessageDispatcher:Y}=r(6811),{PrivateFlowEventName:Q}=r(8860),{QueueAccessType:W,QueueDescriptor:x,QueuePermissions:k,QueueProperties:J,QueueType:F}=r(9631),{MessageOutcome:$,RgmidFactory:R}=r(6247),{State:B,StateMachine:M}=r(7414),{Stats:re,StatType:se}=r(5747),{Timer:fe}=r(3385),{TransportAcks:ce,TransportAckResult:Te}=r(1382),Ee=new u(L.UZERO,d.ACKED_SENT,$.ACCEPTED);o.exports.ConsumerFSM=class extends M{constructor({name:he,consumer:ge,sessionInterface:X,properties:ae}={}){super({name:he});const ee=this,Re=this.logger=new A(function(...oe){return[`[session=${X.sessionIdHex}]`,`[message-consumer-fsm=${ge.flowIdDec}]`,...oe]}),{LOG_TRACE:me,LOG_DEBUG:Pe,LOG_INFO:H,LOG_WARN:Z,LOG_ERROR:te}=Re;this.log=Re.wrap(this.log,this);const ie=ae.acknowledgeMode===D.AUTO;this._consumer=ge,this._sessionInterface=X,this._acknowledgeTimeoutInMsecs=ae.acknowledgeTimeoutInMsecs,this._acknowledgeThreshold=ae.acknowledgeThreshold,this._localPreferredWindowSize=ae.windowSize,this._localMaxWindowSize=ae.windowSize,this._hasAutoAckSupport=ie,this._messageDispatch=new Y({emitter:ge,autoAck:ie,logger:Re}),this._stats=new re,this._resetRemoteConnectionState(),this._resetLocalConnectionState(),this._midDispatch=!1,this._replayStartLocation=ae.replayStartLocation,this._errorCausingReconnect=null;const j="EMIT",Oe="DISPATCH",v="NO_DISPATCH";let P=[];function O(oe){const Se={};P.forEach((Ce,je,Be)=>{function ct(Gt,Ne){if(Se[Gt]===void 0)return;const et=Se[Gt];Se[Gt]=void 0,Be[et]=null,Be[je]=null}if(!(je<oe)&&Ce)switch(Ce.type){case j:switch(Ce.data){case q.UP:case q.ACTIVE:case q.RECONNECTED:Se[Ce.data]=je;break;case q.DOWN:case q.DOWN_ERROR:ct(q.UP,Ce.data);break;case q.INACTIVE:ct(q.ACTIVE,Ce.data);break;default:te(`Unexpected event in post-event action: ${Ce.data}`)}break;case Oe:Se[Ce.type]=je;break;case v:ct(Oe,Ce.type)}})}function U(){let oe,Se=0;for(oe=0;oe<P.length;++oe){Se<P.length&&(O(oe),Se=P.length);const Ce=P[oe];if(Ce)switch(Ce.type){case j:Ce.error!==void 0?ge._emit(Ce.data,Ce.error):ge._emit(Ce.data);break;case v:break;case Oe:this.requestStartDispatchFSM();break;default:te(`Unhandled post event action type: ${Ce.type}`)}}P=[]}function V(oe,Se,Ce){let je;je=Se!==void 0?{type:oe,data:Se,error:Ce}:{type:oe},P.push(je),P.length,P.length===1&&ee.setPostEventAction(U)}function z(oe){f(oe instanceof N),ge._emit(q.CONNECT_FAILED_ERROR,oe)}function ne(oe){let Se=null;const Ce=oe;if(Ce&&Ce.length>0&&Ce.some(je=>je===$.FAILED||$.REJECTED)&&!ee._sessionInterface.isCapable(p.AD_APP_ACK_FAILED)){const je=`Session.capabilitySettlementOutcomeNotSupported: [ ${Ce.map(Be=>$.nameOf(Be)).join(", ")} ]`;Z(je),Se=new N(je,I.INVALID_OPERATION)}return Se}function de(oe){let Se=null;return ee._replayStartLocation===void 0||ee._sessionInterface.isCapable(p.MESSAGE_REPLAY)?ae.topicEndpointSubscription?Se=function(Ce){let je=null;if(Ce){const Be=Ce.getSubscriptionInfo();Be&&(Be.isShare||Be.isNoExport)&&!ee._sessionInterface.isCapable(p.SHARED_SUBSCRIPTIONS)&&(je=new N("Shared Subscriptions not Supported",I.SHARED_SUBSCRIPTIONS_NOT_SUPPORTED))}return je}(ae.topicEndpointSubscription):ae.requiredSettlementOutcomes&&(Se=ne(ae.requiredSettlementOutcomes)):Se=new N("Message Replay Not Supported",I.REPLAY_NOT_SUPPORTED),Se?oe.transitionTo(ee.Unbound,()=>z(Se)):ae.createIfMissing&&ae.queueDescriptor&&ae.queueDescriptor.durable?oe.transitionTo(ee.CreateSent):oe.transitionTo(ee.BindSent)}function _e(oe,Se=!1){let Ce=null;return ae.requiredSettlementOutcomes&&(Ce=ne(ae.requiredSettlementOutcomes)),Ce?oe.transitionTo(ee.Unbound,()=>z(Ce)):Se?oe.externalTransitionTo(ee.Reconnecting.RBindSent):oe.transitionTo(ee.Reconnecting.RBindSent)}this._addEventToEmit=(oe,Se)=>{(ae.activeIndicationEnabled||oe!==q.INACTIVE&&oe!==q.ACTIVE)&&V(j,oe,Se)},this._requestStartDispatch=()=>{V(Oe)},this._requestStopDispatch=()=>{this.requestStopDispatchFSM(),V(v)},this.unhandledEventReaction(function(oe){switch(oe.getName()){case S.VIRTUALROUTER_NAME_CHANGED:return H("VirtualRouter name change: clearing all acknowledgement state and partition group ID, if any"),ee._resetRemoteConnectionState(),this;case S.FLOW_UNBOUND:return H("Received unsolicited unbind. Flow may be manually reconnected."),this.transitionToUnbound(q.DOWN_ERROR,oe.details);case S.DISPOSE:return ee._dispose(),ee.getCurrentState().terminate();case S.BIND_RESPONSE:return function(Se){const Ce=X.getCorrelationTag(),je=a.AdProtocolMessage.getCloseMessageConsumer(Se.flowId,Ce);X.sendControl(je),X.enqueueRequest(Ce,()=>this.handleAccidentalBind(Se),ae.connectTimeoutInMsecs,null,null)}(oe.details),this;default:return oe.getName(),this.getCurrentState().getName(),this}}),this.initial(function(){return this.transitionTo(ee.Unbound,oe=>{H(`Starting ${oe.getStateMachine().getName()}`)})}),this.Unbound=new B({name:C.UNBOUND,parentContext:ee},{emitDisabledEvent(){ge._emit(q.GM_DISABLED)}}).reaction(S.FLOW_CLOSE,function(){return this.transitionTo(this)}).reaction(S.SESSION_DOWN,function(){return this.transitionTo(this)}).reaction(S.SESSION_DISCONNECT,function(){return this.transitionTo(this)}).reaction(S.FLOW_OPEN,function(){return this.transitionTo(ee.Unbound.AwaitSessionUp)}).reaction(S.SESSION_UP,function(){return ee._sessionInterface.isCapable(p.GUARANTEED_MESSAGE_CONSUME)?this.transitionTo(ee.Unbound.AwaitFlowOpen):(Z(`Consumer is not supported by router for this client on sessionId 0x${ee._sessionInterface.sessionIdHex}`),this.internalTransition(()=>this.emitDisabledEvent()))}).reaction(S.SESSION_UP_NO_AD,function(){return this.internalTransition(()=>this.emitDisabledEvent())}).exit(()=>{ee._connectAttempts=ae.connectAttempts}),this.Unbound.AwaitSessionUp=new B({name:C.UNBOUND_AWAIT_SESSION_UP,parentContext:this.Unbound},{emitBindWaiting(){ge._emit(Q.BIND_WAITING)}}).entry(function(){this.emitBindWaiting()}).reaction(S.SESSION_DOWN,function(){return this.internalTransition()}).reaction(S.SESSION_DISCONNECT,function(){return this.internalTransition()}).reaction(S.SESSION_UP,function(){return de(this)}),this.Unbound.AwaitFlowOpen=new B({name:C.UNBOUND_AWAIT_FLOWOPEN,parentContext:this.Unbound}).reaction(S.FLOW_OPEN,function(){return de(this)}),this.BindSentExtensions={sendBindRequest(){const oe=X.getCorrelationTag(),Se=ee._transportAcks;ee._endpointEnsure();const Ce=ee._endpoint,je=ee._subscription,Be=a.AdProtocolMessage.getOpenMessageConsumer(ae.queueDescriptor,ae.queueProperties,Ce,je,oe,ae.windowSize,ae.noLocal,ae.activeIndicationEnabled,Se.lastAcked,Se.lastReceived,ae.browser,ee._replayStartLocation,ge.endpointErrorId,ge.partitionGroupId,ae.requiredSettlementOutcomes&&ae.requiredSettlementOutcomes.length>0);X.sendControl(Be),X.enqueueRequest(oe,this.handleBindTimeout.bind(this),ae.connectTimeoutInMsecs,null,this.handleBindResponse.bind(this)),ae.queueDescriptor,ae.queueProperties,ae.windowSize,ae.noLocal,ae.activeIndicationEnabled,Se.lastAcked,Se.lastReceived,ae.browser,ee._replayStartLocation,ge.endpointErrorId,ge.partitionGroupId,ae.requiredSettlementOutcomes},cancelBindRequestTimer(){this.bindRequestTimer.cancel()},handleBindTimeout(){H("Bind timeout"),ee.processEvent(new _({name:S.BIND_TIMEOUT}))},handleExpectedBind(oe){let Se=oe.getPartitionGroupId();Se!=null&&Se!=null||(Se=void 0,ee._clearPartitionGroupId());const Ce={lastMsgIdAcked:oe.getLastMsgIdAcked(),flowId:oe.getFlowId(),accessType:(je=oe.getAccessType(),je===void 0?W.EXCLUSIVE:je),topicEndpointBytes:oe.getTopicEndpointBytes(),grantedPermissions:oe.getGrantedPermissions(),allOthersPermissions:oe.getAllOthersPermissions(),respectsTTL:oe.getRespectsTTL(),activeFlow:oe.getActiveFlow(),wantFlowChangeNotify:oe.getWantFlowChangeNotify(),discardBehavior:oe.getQueueDiscardBehavior(),deliveryCountSent:oe.getEndpointDeliveryCountSent(),endpointId:oe.getEndpointId(),maxUnackedMessages:oe.getMaxUnackedMessages(),endpointErrorId:oe.getEndpointErrorId(),spoolerUniqueId:oe.getSpoolerUniqueId(),quota:oe.getQuota(),maxMsgSize:oe.getMaxMsgSize(),maxRedelivery:oe.getMaxRedelivery(),partitionGroupId:Se};var je;if(Object.assign(ge,{accessType:Ce.accessType,queueDiscardBehavior:Ce.discardBehavior,deliveryCountSent:Ce.deliveryCountSent,endpointId:Ce.endpointId,respectsTTL:Ce.respectsTTL,flowId:Ce.flowId,permissions:Ce.grantedPermissions,wantFlowChangeNotify:Ce.wantFlowChangeNotify,endpointErrorId:Ce.endpointErrorId,spoolerUniqueId:Ce.spoolerUniqueId,partitionGroupId:Se}),ee._sessionInterface.isCapable(p.BR_REPLAY_ERRORID)&&(ge.endpointErrorId=Ce.endpointErrorId),Ce.topicEndpointBytes&&Ce.topicEndpointBytes.length){Ce.endpoint=g.createDestinationFromBytes(Ce.topicEndpointBytes),ee._endpoint,ee._endpoint=Ce.endpoint;const ct=ee._consumer._properties;ct.queueDescriptor=new x({name:Ce.endpoint.name,type:ct.queueDescriptor.type,durable:ct.queueDescriptor.durable})}const Be=ee._consumer._properties;Be.queueProperties=new J({respectsTTL:Ce.respectsTTL,permissions:Ce.allOthersPermissions,quotaMB:Ce.quota,maxMessageSize:Ce.maxMsgSize,discardBehavior:Ce.discardBehavior,maxMessageRedelivery:Ce.maxRedelivery,accessType:Ce.accessType}),Be.queueProperties.permissions||(Be.queueProperties.permissions=k.NONE),Object.assign(ee,{_active:Ce.activeFlow,_remoteWindowSize:Ce.maxUnackedMessages}),L.UZERO.eq(ee._transportAcks.lastAcked)?ee._transportAcks.lastAcked=Ce.lastMsgIdAcked||L.UZERO:ee._transportAcks},handleBindResponse(oe){if(oe.msgType!==a.SMFAdProtocolMessageType.BIND)return H(`Unexpected message type in bind response: ${a.SMFAdProtocolMessageType.describe(oe.msgType)}`),ee.processEvent(new _({name:S.FLOW_FAILED},new N(`Unexpected bind response: ${a.SMFAdProtocolMessageType.describe(oe.msgType)}`,I.PROTOTOCOL_ERROR)));const Se=oe.smfHeader,Ce=Se.pm_respcode;if(Ce===null)return this._consumer.incStat(se.RX_DISCARD_SMF_UNKNOWN_ELEMENT),void this._sessionInterface.sessionIdHex;if(Ce!==200){const Be=Se.pm_respstr,ct=E.getADErrorSubcode(Ce,Be);return H("Flow failed (bind):",Ce,Be,I.describe(ct)),ee.processEvent(new _({name:S.FLOW_FAILED},new N(Be,ct,{responseCode:Ce})))}const je={name:S.BIND_RESPONSE};return ee.processEvent(new _(je,oe))}},this.BindSent=new B({name:C.BIND_SENT,parentContext:ee},this.BindSentExtensions).entry(function(){ee._connectAttempts--,this.sendBindRequest(),this.bindRequestTimer=fe.newTimeout(ae.connectTimeoutInMsecs,this.handleBindTimeout)}).reaction(S.SESSION_DOWN,function(){return this.transitionTo(ee.Unbound.AwaitSessionUp)}).reaction(S.SESSION_DISCONNECT,function(){return this.transitionTo(ee.Unbound.AwaitSessionUp,()=>ee._addEventToEmit(q.DOWN))}).reaction(S.FLOW_CLOSE,function(){return this.transitionTo(ee.UnbindSent)}).reaction(S.BIND_TIMEOUT,function(){return ee._connectAttempts,ee._connectAttempts>0?this.externalTransitionTo(ee.BindSent):this.transitionTo(ee.Unbound.AwaitFlowOpen,()=>z(new N("Bind failed due to timeout",I.TIMEOUT)))}).reaction(S.FLOW_FAILED,function(oe){return this.transitionTo(ee.Unbound.AwaitFlowOpen,()=>z(oe.details))}).reaction(S.BIND_RESPONSE,function(oe){return this.handleExpectedBind(oe.details),this.transitionTo(ee.FlowUp)}).reaction(S.FLOW_UP,function(){return this.transitionTo(ee.FlowUp)}).exit(function(){this.cancelBindRequestTimer()}),this.Reconnecting=new B({name:C.RECONNECTING,parentContext:ee}).entry(function(){this._errorCausingReconnect,ee._errorCausingReconnect,ge._emit(q.RECONNECTING,ee._errorCausingReconnect),ee._connectAttempts=ae.connectAttempts,ee.reconnectAttempts=ae.reconnectAttempts}).initial(function(){return _e(this,!1)}).reaction(S.SESSION_DISCONNECT,function(){return this.transitionTo(ee.Reconnecting.RAwaitSessionUp)}).reaction(S.SESSION_DOWN,function(){return this.transitionTo(ee.Reconnecting.RAwaitSessionUp)}),this.Reconnecting.RAwaitSessionUp=new B({name:C.RECONNECTING_AWAIT_SESSION_UP,parentContext:this.Reconnecting}).reaction(S.SESSION_UP,function(){return ee._connectAttempts=ae.connectAttempts,_e(this,!1)}),this.Reconnecting.RBindSent=new B({name:C.RECONNECTING_BIND_SENT,parentContext:this.Reconnecting},this.BindSentExtensions).entry(function(){ee._connectAttempts--,this.sendBindRequest(),this.bindRequestTimer=fe.newTimeout(ae.connectTimeoutInMsecs,this.handleBindTimeout)}).reaction(S.FLOW_CLOSE,function(){return this.transitionTo(ee.UnbindSent)}).reaction(S.BIND_TIMEOUT,function(){return ee._connectAttempts,ee._connectAttempts>0?_e(this,!0):this.transitionTo(ee.Unbound.AwaitFlowOpen,()=>z(new N("Rebind failed due to timeout",I.TIMEOUT)))}).reaction(S.FLOW_FAILED,function(oe){if(ee.reconnectAttempts>0||ee.reconnectAttempts===-1){if(oe&&oe.details&&oe.details.subcode&&(oe.details.subcode===I.QUEUE_SHUTDOWN||oe.details.subcode===I.TOPIC_ENDPOINT_SHUTDOWN||oe.details.subcode===I.GM_UNAVAILABLE))return ee.reconnectAttempts,oe.details.subcode,this.transitionTo(ee.Reconnecting.RAwaitTimer)}else ee.reconnectAttempts;return this.transitionTo(ee.Unbound.AwaitFlowOpen,()=>{return Se=oe.details,f(Se instanceof N),void ge._emit(q.DOWN_ERROR,Se);var Se})}).reaction(S.BIND_RESPONSE,function(oe){return this.handleExpectedBind(oe.details),this.transitionTo(ee.FlowUp,()=>ee._addEventToEmit(q.RECONNECTED))}).reaction(S.FLOW_UP,function(){return this.transitionTo(ee.FlowUp,()=>ee._addEventToEmit(q.RECONNECTED))}).exit(function(){this.cancelBindRequestTimer()}),this.Reconnecting.RAwaitTimer=new B({name:C.RECONNECTING_AWAIT_TIMER,parentContext:this.Reconnecting},{handleReconnectIntervalTimeout(){ee.processEvent(new _({name:S.RECONNECT_INTERVAL_TIMEOUT}))},cancelReconnectIntervalTimer(){this.reconnectIntervalTimer.cancel()}}).entry(function(){ee.reconnectAttempts>0&&--ee.reconnectAttempts,ae.reconnectIntervalInMsecs,ee.reconnectAttempts,this.reconnectIntervalTimer=fe.newTimeout(ae.reconnectIntervalInMsecs,this.handleReconnectIntervalTimeout)}).exit(function(){this.cancelReconnectIntervalTimer()}).reaction(S.RECONNECT_INTERVAL_TIMEOUT,function(){return ee._connectAttempts=ae.connectAttempts,_e(this,!1)});const we=this.FlowUp=new B({name:C.FLOW_UP,parentContext:ee}).initial(function(){return this.transitionTo(ee._active===0?we.XferInactive:we.Xfer)}).entry(()=>{ee._replayStartLocation=void 0,ee._errorCausingReconnect?ee._errorCausingReconnect=null:ee._addEventToEmit(q.UP)}).reaction(S.SESSION_DOWN,function(){return this.transitionTo(ee.Unbound.AwaitSessionUp)}).reaction(S.SESSION_DISCONNECT,function(){return this.transitionTo(ee.Unbound.AwaitSessionUp,()=>ee._addEventToEmit(q.DOWN))}).reaction(S.FLOW_CLOSE,function(){return this.transitionTo(ee.UnbindSent)}).reaction(S.FLOW_UNBOUND,oe=>ee.transitionToUnboundFromUp(ae,q.DOWN_ERROR,oe.details));we.Xfer=new B({name:C.FLOW_UP_XFER,parentContext:we}).entry(()=>{ee._addEventToEmit(q.ACTIVE),ee._sendAcks(!0),ee._requestStartDispatch()}).exit(()=>{ee._addEventToEmit(q.INACTIVE),ee._requestStopDispatch()}).reaction(S.SESSION_DISCONNECT,function(){return ee._sendAcks(!0),this.eventUnhandled()}),we.XferInactive=new B({name:C.FLOW_UP_XFER_INACTIVE,parentContext:we}).reaction(S.FLOW_ACTIVE_IND,function(){return this.transitionTo(we.Xfer)}),this.UnbindSent=new B({name:C.UNBIND_SENT,parentContext:ee},{sendUnbindRequest(){ee._endpointClear();try{const oe=X.getCorrelationTag(),Se=a.AdProtocolMessage.getCloseMessageConsumer(ge.flowId,oe);X.sendControl(Se),X.enqueueRequest(oe,()=>this.handleUnbindTimeout(),ae.connectTimeoutInMsecs,null,Ce=>this.handleUnbindResponse(Ce)),H("Sent consumer unbind request with arguments",{flowId:ge.flowId,correlationTag:oe})}catch(oe){H(`Exception in sendUnbindRequest while trying to send unbind request: ${oe}`),X.getCurrentStateName(),ee.processEvent(new _({name:S.FLOW_UNBOUND}))}},handleUnbindTimeout:()=>(H("Unbind timeout"),ee.processEvent(new _({name:S.UNBIND_TIMEOUT}))),handleUnbindResponse(oe){oe.msgType!==a.SMFAdProtocolMessageType.UNBIND&&H(`Unexpected message type in bind response: ${a.SMFAdProtocolMessageType.describe(oe.msgType)}`);const Se=oe.smfHeader.pm_respcode,Ce=oe.smfHeader.pm_respstr,je=E.getADErrorSubcode(Se,Ce);return ge.endpointErrorId=oe.getEndpointErrorId(),H("Flow failed (unbind):",Se,Ce,I.describe(je)),ee.processEvent(new _({name:S.FLOW_UNBOUND},new N(Ce,je,Se)))}}).entry(function(){this.sendUnbindRequest()}).reaction(S.UNBIND_TIMEOUT,function(){return this.externalTransitionTo(ee.UnbindSent)}).reaction(S.FLOW_UNBOUND,()=>ee.transitionToUnbound(q.DOWN)),this.CreateSent=new B({name:C.CREATE_SENT,parentContext:ee},{sendCreateRequest(){const oe=X.getCorrelationTag(),Se=a.AdProtocolMessage.getCreate(ae.queueDescriptor,ae.queueProperties,oe);X.sendControl(Se),X.enqueueRequest(oe,this.handleCreateTimeout.bind(this),ae.connectTimeoutInMsecs,null,this.handleCreateResponse.bind(this))},handleCreateTimeout(){H("Create timeout"),ee.processEvent(new _({name:S.CREATE_TIMEOUT}))},handleCreateResponse(oe){if(oe.msgType!==a.SMFAdProtocolMessageType.CREATE)return H(`Unexpected message type in create response: ${a.SMFAdProtocolMessageType.describe(oe.msgType)}`),ee.processEvent(new _({name:S.CREATE_FAILED},new N(`Unexpected create response: ${a.SMFAdProtocolMessageType.describe(oe.msgType)}`,I.PROTOTOCOL_ERROR)));const Se=oe.smfHeader,Ce=Se.pm_respcode;if(Ce!==200){const Be=Se.pm_respstr,ct=E.getADErrorSubcode(Ce,Be);if(H("Endpoint create failed:",Ce,Be,I.describe(ct)),ct===I.ENDPOINT_ALREADY_EXISTS){const Gt={name:S.CREATE_SUCCESS};return ee.processEvent(new _(Gt,oe))}return ee.processEvent(new _({name:S.CREATE_FAILED},new N(Be,ct,{responseCode:Ce})))}const je={name:S.CREATE_SUCCESS};return ee.processEvent(new _(je,oe))}}).entry(function(){this.sendCreateRequest()}).reaction(S.CREATE_TIMEOUT,function(){return this.externalTransitionTo(ee.BindSent)}).reaction(S.CREATE_SUCCESS,function(){return this.externalTransitionTo(ee.BindSent)}).reaction(S.CREATE_FAILED,function(oe){return this.transitionTo(ee.Unbound.AwaitFlowOpen,()=>z(oe.details))})}acceptMessage(he){this.logger;const ge=he.getGuaranteedMessageId(),X=ge.toString(),ae=this._consumer;if(!this._fsmDispatch)return ae.incStat(se.RX_DISCARD_NO_MATCHING_CONSUMER),!1;ae.deliveryCountSent||he.setDeliveryCount(-1);const ee=he._getSpoolerUniqueId();R.INVALID_SUID.eq(ee)?he._setSpoolerUniqueId(ae.spoolerUniqueId):ae.spoolerUniqueId===void 0||R.INVALID_SUID.eq(ae.spoolerUniqueId)?ae.spoolerUniqueId!==void 0&&!R.INVALID_SUID.eq(ae.spoolerUniqueId)||R.INVALID_SUID.eq(ee)||he._setSpoolerUniqueId(R.INVALID_SUID):(ae.spoolerUniqueId.toString(),ee.toString(),ae.spoolerUniqueId=ee);const Re=this._transportAcks,me=Re.tryReceive(ge,he.getGuaranteedPreviousMessageId()),Pe=Re.acksPending>this.maxPendingAcks;switch(me){case Te.OK:break;case Te.DUPLICATE:if(ae.incStat(se.RX_DISCARD_DUPLICATE),this._applicationAcks.has(ge)||this._oldUnacked.has(X))Pe?this._sendAcks(Pe):this._setTransportAckTimer();else{const H=new Map;H.set($.ACCEPTED,[[ge,ge]]),this._sendAck(H)}return!1;case Te.OUT_OF_ORDER:return ae.incStat(se.RX_DISCARD_OUT_OF_ORDER),!1;default:return f(!1,"Unhandled transport ack result",me),!1}return this._applicationAcks.insert(ge,H=>{let Z=!1;if(H)switch(H.state){case d.UNACKED:this._oldUnacked.add(H.key);break;case d.ACKED_NOT_SENT:Z=!0;break;case d.ACKED_SENT:break;default:f(!1,"Unhandled application ack state",d.describe(H.state))}return this._midDispatch=!0,this._messageDispatch.push(he),this._midDispatch=!1,Pe||Z?this._sendAcks(Pe):this._setTransportAckTimer(),!0})}applicationAck(he,ge=!1){this.applicationSettle(he,$.ACCEPTED,ge)}applicationSettle(he,ge=$.ACCEPTED,X=!1){this.logger;const ae=he.toString();switch(ge){case $.FAILED:this._consumer.incStat(se.RX_SETTLE_FAILED);break;case $.REJECTED:this._consumer.incStat(se.RX_SETTLE_REJECTED);break;case $.ACCEPTED:X||this._consumer.incStat(se.RX_SETTLE_ACCEPTED),this._consumer.incStat(se.RX_ACKED)}if(this._oldUnacked.delete(ae)){const ee=new Map;return ee.set(ge,[[he,he]]),void this._sendAck(ee)}this._applicationAcks.updateAckState(he,d.ACKED_NOT_SENT,ge),ge!==$.ACCEPTED?this._sendAcks(!0):this._setTransportAckTimer()}getDestination(){return this._endpointEnsure(),this._destination}isDisconnected(){return!this.getCurrentState()||this.getActiveState(C.UNBOUND)||this.getActiveState(C.UNBOUND_AWAITING_FLOWOPEN)}requestStartDispatchUser(){this._userDispatch=!0,this.applyStartDispatch()}requestStartDispatchFSM(){this._fsmDispatch=!0,this.applyStartDispatch()}applyStartDispatch(){this._userDispatch&&this._fsmDispatch?(this.log(`Starting message dispatch (fsm ${this._fsmDispatch}, user ${this._userDispatch})`),this._messageDispatch.start(),this._localMaxWindowSize=this._localPreferredWindowSize,this._sendAcks(!0)):this.log(`Not starting message dispatch (fsm ${this._fsmDispatch}, user ${this._userDispatch})`)}transitionToUnbound(he,ge){const X=this._consumer;return this.logger,X.userDisconnected,this._clearPartitionGroupId(),this.transitionTo(this.Unbound.AwaitFlowOpen,()=>this._addEventToEmit(he,ge))}transitionToUnboundFromUp(he,ge,X){const ae=this._consumer;if(this.logger,X&&X instanceof N&&X.subcode&&X.subcode===I.REPLAY_STARTED&&(this._transportAcks.reset(),this._applicationAcks.reset()),this._clearPartitionGroupId(),ae.endpointErrorId&&this._sessionInterface.isCapable(p.MESSAGE_REPLAY)){ae.endpointErrorId;const ee=a.AdProtocolMessage.getUnbindAck(ae._flowId,ae.endpointErrorId,this._transportAcks.lastAcked);this._sessionInterface.sendControl(ee)}return(he.reconnectAttempts===-1||he.reconnectAttempts>0)&&X&&X instanceof N&&X.subcode&&(X.subcode===I.REPLAY_STARTED||X.subcode===I.GM_UNAVAILABLE)?(this._errorCausingReconnect=X,this.transitionTo(this.Reconnecting)):this.transitionTo(this.Unbound.AwaitFlowOpen,()=>this._addEventToEmit(ge,X))}requestStopDispatchUser(){this._userDispatch=!1,this.log(`Stop dispatch user (fsm ${this._fsmDispatch}, user ${this._userDispatch})`),this._messageDispatch.stop()}requestStopDispatchFSM(){this._fsmDispatch=!1,this.log(`Stop dispatch FSM (fsm ${this._fsmDispatch}, user ${this._userDispatch})`),this._sendAcks(!0)}_clearTransportAckTimer(){this._transportAckTimer&&(clearTimeout(this._transportAckTimer),this._transportAckTimer=null)}_dispose(){this._clearTransportAckTimer(),this._endpointClear(),this._destination=void 0,this._unacked=null,this._messageDispatch=null,this._transportAcks=null,this._consumer=null,this._sessionInterface=null}_endpointClear(){this._endpoint=void 0,this._subscription=void 0}_endpointEnsure(){if(this._endpoint)return;const he=this._sessionInterface,ge=this._consumer._properties,{queueDescriptor:X}=ge;let ae,ee,Re;X.type===F.QUEUE?(ae=he.createDestinationFromDescriptor(X),ee=new T({name:ae.name,type:m.QUEUE,offset:0,bytes:ae.bytes.substr(ae.offset)}),Re=void 0):(ee=X.name?he.createDestinationFromDescriptor(X):new y({name:"\0?",offset:0,bytes:"\0"}),Re=ge.topicEndpointSubscription||he.createTemporaryDestination(m.TOPIC),ae=Re),Object.assign(this,{_destination:ae,_endpoint:ee,_subscription:Re}),ge.queueDescriptor=new x({name:ee.name,type:X.type,durable:X.durable})}_resetLocalConnectionState(){Object.assign(this,{_remoteWindowSize:0,_active:void 0,_fsmDispatch:!1,_userDispatch:!0})}_clearPartitionGroupId(){this.logger,this._consumer.partitionGroupId=void 0}_resetRemoteConnectionState(){this.logger,this._transportAcks=new ce,this._applicationAcks=new l(512),this._oldUnacked=new Set,this._consumer.endpointErrorId=void 0,this._consumer.partitionGroupId=void 0}_sendAck(he){const ge=a.AdProtocolMessage.getAck(this._consumer.flowId,this._transportAcks.lastReceived,this.windowSize,he);this._sessionInterface.sendControl(ge)}_addAckToRanges(he,ge=null){const X=he.currentRange,ae=he.ackRanges,ee=$.values,Re=X.length;if(ge&&ge.state!==d.UNACKED){if(Re===0||Re>0&&X[Re-1].settlementOutcome===ge.settlementOutcome)return void X.push(ge);if(Re>0&&X[Re-1].settlementOutcome!==ge.settlementOutcome)return ae[X[Re-1].settlementOutcome].push(X),he.currentRange=[],void he.currentRange.push(ge)}Re&&ae[X[Re-1].settlementOutcome].push(X);let me=0;for(let Pe=0;Pe<ee.length;Pe++)me+=ae[ee[Pe]].length;if(ge===null||me===a.AdProtocolMessage.MAX_CLIENT_ACK_RANGES){const Pe=new Map;let H=!1;for(let Z=0;Z<ee.length;Z++)ae[ee[Z]].length>0&&(Pe.set(ee[Z],ae[ee[Z]].map(te=>[te[0].id,te[te.length-1].id])),H=!0);if(H||he.forceTransportAck){this.logger,this._sendAck(Pe);const Z=Pe.get($.FAILED),te=Pe.get($.REJECTED);this._transportAcks.lastReceived,Pe.has($.ACCEPTED)&&Pe.get($.ACCEPTED).map(ie=>`[${ie[0]}..${ie[1]}]`),Pe.has($.FAILED)&&(Z[0][0],Z[0][1]),Pe.has($.REJECTED)&&(te[0][0],te[0][1]),this._transportAcks.setAcked(),he.forceTransportAck=!1}for(let Z=0;Z<ee.length;Z++)ae[ee[Z]].forEach(te=>{te.forEach(ie=>{if(ie.state!==d.ACKED_SENT)try{this._applicationAcks.updateAckState(ie.id,d.ACKED_SENT)}catch(j){const{LOG_ERROR:Oe}=this.logger;Oe(`Marking ack ${ie.id} as sent failed: ${j}`)}})});he.ackRanges=[];for(let Z=0;Z<ee.length;Z++)he.ackRanges[ee[Z]]=[]}he.currentRange=[]}_sendAcks(he=!1){this._clearTransportAckTimer();const ge=this._applicationAcks,X=this._transportAcks,ae=$.values,ee={forceTransportAck:he||X.acksPending>0,ackRanges:[],currentRange:[]};for(let me=0;me<ae.length;me++)ee.ackRanges[ae[me]]=[];const Re=this._applicationAcks.front();this._oldUnacked.size===0&&Re&&Re.state!==d.UNACKED&&this._addAckToRanges(ee,Ee),ge.forEach(me=>this._addAckToRanges(ee,me)),this._addAckToRanges(ee),f(ee.forceTransportAck===!1),f(ee.currentRange.length===0);for(let me=0;me<ae.length;me++)f(ee.ackRanges[ae[me]].length===0)}_setTransportAckTimer(){this._transportAckTimer||this._consumer.disposed||(this._transportAckTimer=setTimeout(()=>this._sendAcks(!0),this._acknowledgeTimeoutInMsecs))}get maxWindowSize(){return Math.min(this._localMaxWindowSize,this._remoteWindowSize||Number.POSITIVE_INFINITY)}get windowSize(){return this.maxWindowSize-this._messageDispatch.length}get maxPendingAcks(){return this.windowSize*this._acknowledgeThreshold/100}get hasAutoAckSupport(){return this._hasAutoAckSupport}}},3561:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.ConsumerStateNames=a.new({UNBOUND:"UNBOUND",UNBOUND_AWAIT_SESSION_UP:"UNBOUND_AWAIT_SESSION_UP",UNBOUND_AWAIT_FLOWOPEN:"UNBOUND_AWAIT_FLOWOPEN",UNBOUND_AWAIT_ANY:"UNBOUND_AWAIT_ANY",BIND_SENT:"BIND_SENT",FLOW_UP:"FLOW_UP",FLOW_UP_XFER:"FLOW_UP_XFER",FLOW_UP_XFER_INACTIVE:"FLOW_UP_XFER_INACTIVE",UNBIND_SENT:"UNBIND_SENT",RECONNECTING:"RECONNECTING",RECONNECTING_BIND_SENT:"RECONNECTING_BIND_SENT",RECONNECTING_AWAIT_SESSION_UP:"RECONNECTING_AWAIT_SESSION_UP",RECONNECTING_AWAIT_TIMER:"RECONNECTING_AWAIT_TIMER",CREATE_SENT:"CREATE_SENT"})},4590:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.MessageConsumerAcknowledgeMode=a.new({AUTO:"AUTO",CLIENT:"CLIENT"})},6934:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.MessageConsumerEventName=a.new({UP:"MessageConsumerEventName_up",DOWN:"MessageConsumerEventName_down",ACTIVE:"MessageConsumerEventName_active",INACTIVE:"MessageConsumerEventName_inactive",DOWN_ERROR:"MessageConsumerEventName_downError",RECONNECTING:"MessageConsumerEventName_reconnecting",RECONNECTED:"MessageConsumerEventName_reconnected",CONNECT_FAILED_ERROR:"MessageConsumerEventName_connectFailedError",GM_DISABLED:"MessageConsumerEventName_GMDisabled",DISPOSED:"MessageConsumerEventName_disposed",MESSAGE:"MessageConsumerEventName_message",SUBSCRIPTION_OK:"MessageConsumerEventName_ok",SUBSCRIPTION_ERROR:"MessageConsumerEventName_error"})},3247:(o,h,r)=>{var a=r(2195);const{ErrorSubcode:u}=r(6706);o.exports.MessageConsumerEvent=class{constructor(l,d,f=void 0,p=0,_=void 0,S=void 0){this._messageConsumerEventName=l,this._infoStr=d,this._responseCode=f,this._errorSubcode=p,this._correlationKey=_,this._reason=S}get messageConsumerEventName(){return this._messageConsumerEventName}get name(){return this._messageConsumerEventName}get infoStr(){return this._infoStr}get responseCode(){return this._responseCode}get errorSubcode(){return this._errorSubcode}get subcode(){return this._errorSubcode}get correlationKey(){return this._correlationKey}get reason(){return this._reason}set reason(l){this._reason=l}get requestEventCode(){}inspect(){return{messageConsumerEventName:this.messageConsumerEventName,infoStr:this.infoStr,responseCode:this.responseCode,errorSubcode:u.describe(this.errorSubcode),correlationKey:this.correlationKey?this.correlationKey.toString():null,reason:this.reason?this.reason:null}}toString(){return a(this)}}},6681:(o,h,r)=>{const{AbstractQueueDescriptor:a,QueueDescriptor:u,QueueDescriptorValidator:l,QueueProperties:d,QueuePropertiesValidator:f,QueueType:p}=r(9631),{APIPropertiesValidators:_}=r(968),{Check:S}=r(802),{MessageConsumerAcknowledgeMode:C}=r(4590),{OperationError:g,ErrorSubcode:m}=r(6706),{ReplayStartLocation:T}=r(9309),{validateInstance:y,valBoolean:E,valInstance:I,valIsMember:N,valNumber:A,valRange:L,valTopicStringOrEmpty:D}=_;function q(Q,W){if(W.queueDescriptor.getType()===p.TOPIC_ENDPOINT){if(W.queueDescriptor.isDurable()&&!W.createIfMissing&&!W.topicEndpointSubscription)throw new g("topicEndpointSubscription must be set when queueDescriptor refers to a durable topic endpoint and not allowed to create.",m.PARAMETER_CONFLICT)}else if(W.topicEndpointSubscription)throw new g("topicEndpointSubscription is set, but queueDescriptor refers to a queue that is not of type QueueType.TOPIC_ENDPOINT",m.PARAMETER_CONFLICT)}const Y={validate(Q,W,x){if(Object.prototype.hasOwnProperty.call(x,"transportAcknowledgeTimeoutInMsecs")&&Object.prototype.hasOwnProperty.call(x,"acknowledgeTimeoutInMsecs"))throw new g(`${Q} validation: transportAcknowledgeTimeoutInMsecs and acknowledgeTimeoutInMsecs are mutually exclusive`,m.PARAMETER_CONFLICT);if(Object.prototype.hasOwnProperty.call(x,"transportAcknowledgeThresholdPercentage")&&Object.prototype.hasOwnProperty.call(x,"acknowledgeThreshold"))throw new g(`${Q} validation: transportAcknowledgeThresholdPercentage and acknowledgeThreshold are mutually exclusive`,m.PARAMETER_CONFLICT);const k=y.bind(null,Q,W);if(!(W.queueDescriptor instanceof a||W.queueDescriptor instanceof u))throw new g(`${Q} validation: queue descriptor must be an AbstractQueueDescriptor or a QueueDescriptor`,m.PARAMETER_INVALID_TYPE);if(l.validate(W.queueDescriptor),W.queueProperties){if(W.queueDescriptor.durable&&!W.createIfMissing)throw new g(`${Q} validation: queueProperties cannot be set unless queueDescriptor refers to a temporary queue, or createIfMissing is set.`,m.PARAMETER_CONFLICT);if(k("queueProperties",[I,d,"QueueProperties"]),f.validate(W.queueProperties),!W.queueDescriptor.durable&&S.something(W.queueProperties.accessType))throw new g(`${Q} validation: queueProperties cannot specify accessType in creation of a temporary queue`,m.PARAMETER_CONFLICT)}if(W.queueDescriptor.type===p.TOPIC_ENDPOINT){if(W.queueDescriptor.durable&&!W.createIfMissing&&!W.topicEndpointSubscription)throw new g(`${Q} validation: topicEndpointSubscription must be set for durable topic endpoints unless creation is allowed.`,m.PARAMETER_CONFLICT)}else if(W.topicEndpointSubscription)throw new g(`${Q} validation: topicEndpointSubscription cannot be set unless descriptor.type is TOPIC_ENDPOINT`,m.PARAMETER_CONFLICT);if(k("connectTimeoutInMsecs",[A],[L,50,Number.MAX_VALUE]),k("connectAttempts",[A],[L,1,Number.MAX_VALUE]),k("topicEndpointSubscription",[q],[D]),k("acknowledgeMode",[N,C,"MessageConsumerAcknowledgeMode"]),k("transportAcknowledgeTimeoutInMsecs",[A],[L,20,1500]),k("transportAcknowledgeThresholdPercentage",[A],[L,1,75]),k("activeIndicationEnabled",[E]),k("noLocal",[E]),k("windowSize",[A],[L,1,255]),k("reconnectIntervalInMsecs",[A],[L,50,Number.MAX_VALUE]),W.activeIndicationEnabled&&W.queueDescriptor.type!==p.QUEUE)throw new g(`${Q} validation: activeIndicationEnabled may only be true for QUEUE destinations`,m.PARAMETER_CONFLICT);if(W.replayStartLocation&&!(W.replayStartLocation instanceof T))throw new g(`${Q} validation: replayStartLocation must be an instance of ReplayStartLocation`,m.PARAMETER_INVALID_TYPE)}};o.exports.MessageConsumerPropertiesValidator=Y},2558:(o,h,r)=>{const a=r(9631),{APIProperties:u}=r(968),{Check:l}=r(802),{MessageConsumerAcknowledgeMode:d}=r(4590),{Topic:f}=r(9620),p={queueDescriptor:void 0,queueProperties:void 0,connectTimeoutInMsecs:1e4,connectAttempts:3,topicEndpointSubscription:void 0,acknowledgeMode:d.AUTO,requiredSettlementOutcomes:[],transportAcknowledgeTimeoutInMsecs:1e3,transportAcknowledgeThresholdPercentage:60,activeIndicationEnabled:!1,noLocal:!1,windowSize:255,_browser:!1,replayStartLocation:void 0,reconnectAttempts:-1,reconnectIntervalInMsecs:3e3,createIfMissing:!1};o.exports.MessageConsumerProperties=class extends u{constructor(_){super(p,_)}get queueDescriptor(){return l.something(this._queueDescriptor)?this._queueDescriptor:p.queueDescriptor}set queueDescriptor(_){_ instanceof a.AbstractQueueDescriptor?this._queueDescriptor=_:this._queueDescriptor=_&&(_.name?new a.QueueDescriptor(_):new a.AbstractQueueDescriptor(_))}get queueProperties(){return l.something(this._queueProperties)?this._queueProperties:p.queueProperties}set queueProperties(_){this._queueProperties=_&&new a.QueueProperties(_)}get connectTimeoutInMsecs(){return l.something(this._bindTimeoutInMsecs)?this._bindTimeoutInMsecs:p.connectTimeoutInMsecs}set connectTimeoutInMsecs(_){this._bindTimeoutInMsecs=_}get connectAttempts(){return l.something(this._connectAttempts)?this._connectAttempts:p.connectAttempts}set connectAttempts(_){this._connectAttempts=_}get topicEndpointSubscription(){return this._topicEndpointSubscription}set topicEndpointSubscription(_){this._topicEndpointSubscription=typeof _=="string"?f.createFromName(_):_}get acknowledgeMode(){return l.something(this._acknowledgeMode)?this._acknowledgeMode:p.acknowledgeMode}set acknowledgeMode(_){this._acknowledgeMode=_}get requiredSettlementOutcomes(){return l.something(this._requiredSettlementOutcomes)&&l.array(this._requiredSettlementOutcomes)?this._requiredSettlementOutcomes:p.requiredSettlementOutcomes}set requiredSettlementOutcomes(_){this._requiredSettlementOutcomes=_}get acknowledgeTimeoutInMsecs(){return l.something(this._transportAcknowledgeTimeoutInMsecs)?this._transportAcknowledgeTimeoutInMsecs:p.transportAcknowledgeTimeoutInMsecs}set acknowledgeTimeoutInMsecs(_){this._transportAcknowledgeTimeoutInMsecs=_}get acknowledgeThreshold(){return l.something(this._transportAcknowledgeThresholdPercentage)?this._transportAcknowledgeThresholdPercentage:p.transportAcknowledgeThresholdPercentage}set acknowledgeThreshold(_){this._transportAcknowledgeThresholdPercentage=_}get transportAcknowledgeTimeoutInMsecs(){return l.something(this._transportAcknowledgeTimeoutInMsecs)?this._transportAcknowledgeTimeoutInMsecs:p.transportAcknowledgeTimeoutInMsecs}set transportAcknowledgeTimeoutInMsecs(_){this._transportAcknowledgeTimeoutInMsecs=_}get transportAcknowledgeThresholdPercentage(){return l.something(this._transportAcknowledgeThresholdPercentage)?this._transportAcknowledgeThresholdPercentage:p.transportAcknowledgeThresholdPercentage}set transportAcknowledgeThresholdPercentage(_){this._transportAcknowledgeThresholdPercentage=_}get activeIndicationEnabled(){return l.something(this._activeIndicationEnabled)?this._activeIndicationEnabled:p.activeIndicationEnabled}set activeIndicationEnabled(_){this._activeIndicationEnabled=_}get noLocal(){return l.something(this._noLocal)?this._noLocal:p.noLocal}set noLocal(_){this._noLocal=_}get windowSize(){return l.something(this._windowSize)?this._windowSize:p.windowSize}set windowSize(_){this._windowSize=_}get browser(){return l.something(this._browser)?this._browser:p._browser}set browser(_){this._browser=_}get replayStartLocation(){return l.something(this._replayStartLocation)?this._replayStartLocation:p.replayStartLocation}set replayStartLocation(_){this._replayStartLocation=_}get reconnectAttempts(){return l.something(this._reconnectAttempts)?this._reconnectAttempts:p.reconnectAttempts}set reconnectAttempts(_){this._reconnectAttempts=_}get reconnectIntervalInMsecs(){return l.something(this._reconnectIntervalInMsecs)?this._reconnectIntervalInMsecs:p.reconnectIntervalInMsecs}set reconnectIntervalInMsecs(_){this._reconnectIntervalInMsecs=_}get createIfMissing(){return l.something(this._createIfMissing)?this._createIfMissing:p.createIfMissing}set createIfMissing(_){this._createIfMissing=_}}},6598:(o,h,r)=>{var a=r(2195);const u=r(3450),{CapabilityType:l}=r(5024),{ConsumerFSM:d}=r(9035),{ConsumerFSMEvent:f}=r(946),{ConsumerFSMEventNames:p}=r(1699),{ErrorResponseSubcodeMapper:_,ErrorSubcode:S,OperationError:C}=r(6706),{Flow:g,FlowOperation:m}=r(8860),{MessageConsumerEvent:T}=r(3247),{MessageOutcome:y}=r(6247),{MessageConsumerEventName:E}=r(6934),{MessageConsumerProperties:I}=r(2558),{MessageConsumerPropertiesValidator:N}=r(6681),{Queue:A,Topic:L}=r(9620),{QueueAccessType:D,QueuePermissions:q,QueueDiscardBehavior:Y}=r(9631);function Q(x){return`MessageConsumerEventName.${E.describe(x)}`}let W=0;o.exports.MessageConsumer=class extends g{constructor({properties:x,sessionInterfaceFactory:k}={}){const J=new I(x);N.validate(J.browser?"QueueBrowserProperties":"MessageConsumerProperties",J,x),super(J,k,{direct:E.MESSAGE,emits:E.values,formatEventName:Q});const F=this.logger.formatter;this.logger.formatter=(...$)=>F("[message-consumer]",...$),this._active=void 0,this._fsm=this._makeFSM(),this.endpointErrorId=void 0,this.partitionGroupId=void 0,this._on(E.ACTIVE,()=>this._onFlowActive(!0)),this._on(E.INACTIVE,()=>this._onFlowActive(!1)),this._on(E.DOWN_ERROR,this._onFlowDisconnected.bind(this)),this._on(E.UP,this._onFlowUp.bind(this)),this._fsm.start()}_makeFSM(){const x=this._properties,k="ConsumerFSM "+W++;return new d({name:k,consumer:this,sessionInterface:this._sessionInterface,properties:x})}start(){this._operationCheck(m.START),this._fsm.requestStartDispatchUser()}stop(){this._operationCheck(m.STOP),this._fsm.requestStopDispatchUser()}connect(){if(this._sessionInterface.getCapability(l.GUARANTEED_MESSAGE_CONSUME)!==null&&!this._sessionInterface.isCapable(l.GUARANTEED_MESSAGE_CONSUME))throw new C("Consumer is not supported by router for this client",S.INVALID_OPERATION,null);super.connect(),this.processFSMEvent(new f({name:p.FLOW_OPEN}))}disconnect(){super.disconnect(),this.processFSMEvent(new f({name:p.FLOW_CLOSE}))}getDestination(){const x=this._fsm.getDestination();return x instanceof A?new A(x):new L(x)}_disconnectSession(){super._disconnectSession(),this.processFSMEvent(new f({name:p.SESSION_DISCONNECT}))}_operationCheck(x){if(super._operationCheck(x),x===m.GET_DESTINATION&&this._isDisconnected())throw new C("Cannot get destination of a disconnected flow",S.INVALID_OPERATION)}applicationAck(x,k=!1){this.logger,this._fsm.applicationAck(x,k)}applicationSettle(x,k){this.logger,y.nameOf(k),this._fsm.applicationSettle(x,k)}getDisposedEvent(){return E.DISPOSED}handleDataMessage(x){this.logger,x.setMessageConsumer(this),this._fsm.acceptMessage(x)}handleUncorrelatedControlMessage(x){const{LOG_INFO:k,LOG_DEBUG:J,LOG_TRACE:F}=this.logger;k("Handling uncorrelated control message");const $=x.msgType,{SMFAdProtocolMessageType:R}=u;switch($){case R.UNBIND:{const B=x.smfHeader.pm_respcode,M=x.smfHeader.pm_respstr,re=_.getADErrorSubcode(B,M);x.getEndpointErrorId(),x.getEndpointErrorId()!==void 0&&(this.endpointErrorId=x.getEndpointErrorId()),this.processFSMEvent(new f({name:p.FLOW_UNBOUND},new C(M,re,B)))}break;case R.FLOWCHANGEUPDATE:this.processFSMEvent(new f({name:p.FLOW_ACTIVE_IND},{active:x.getActiveFlow()}));break;default:R.describe($)}}getProperties(){return super.getProperties()}onVRNChanged(){this.processFSMEvent(new f({name:p.VIRTUALROUTER_NAME_CHANGED}))}get accessType(){return this._accessType}set accessType(x){this._accessType=x}get active(){return this._active}set active(x){x!==this._active&&this._emit(x?E.ACTIVE:E.INACTIVE),this._active=x}get queueDiscardBehavior(){return this._queueDiscardBehavior}set queueDiscardBehavior(x){this._queueDiscardBehavior=x}get respectsTTL(){return this._respectsTTL}set respectsTTL(x){this._respectsTTL=x}get flowId(){return this._flowId}set flowId(x){this._flowId=x}get permissions(){return this._permissions||0}set permissions(x){this._permissions=x}_onFlowActive(x){this.logger,this._flowId,this._active=x}_onFlowDisconnected(x){const{LOG_INFO:k}=this.logger;k(`${this} disconnected: ${x}.message`)}_disposeFSM(){const{LOG_INFO:x}=this.logger;x("Disposing FSM"),this.processFSMEvent(new f({name:p.DISPOSE}))}_onFlowUp(){const{LOG_INFO:x}=this.logger;x(`Flow is up: flowId = ${this._flowId}`)}inspect(){return Object.assign(super.inspect(),{destination:this._destination,accessType:D.describe(this.accessType),permissions:q.describe(this.permissions),respectsTTL:this.respectsTTL,active:this.wantFlowChangeNotify?this.active:"(indications disabled)",wantFlowChangeNotify:this.wantFlowChangeNotify,queueDiscardBehavior:Y.describe(this.queueDiscardBehavior),maxWindowSize:this._fsm.maxWindowSize})}toString(){return a(this)}_isDisconnected(){return this._fsm.isDisconnected()}addSubscription(x,k,J){this._sessionInterface.updateQueueSubscription(x,this._fsm.getDestination(),!0,this,(F,$,R,B)=>{if(F){const M=new T(E.SUBSCRIPTION_OK,B,R,$,k,`Topic: ${x.getName()}`);this._emit(E.SUBSCRIPTION_OK,M)}else{const M=new T(E.SUBSCRIPTION_ERROR,B,R,$,k,`Topic: ${x.getName()}`);this._emit(E.SUBSCRIPTION_ERROR,M)}},J)}removeSubscription(x,k,J){this._sessionInterface.updateQueueSubscription(x,this._fsm.getDestination(),!1,this,(F,$,R,B)=>{if(F){const M=new T(E.SUBSCRIPTION_OK,B,R,$,k,`Topic: ${x.getName()}`);this._emit(E.SUBSCRIPTION_OK,M)}else{const M=new T(E.SUBSCRIPTION_ERROR,B,R,$,k,`Topic: ${x.getName()}`);this._emit(E.SUBSCRIPTION_ERROR,M)}},J)}}},6811:(o,h,r)=>{const{MessageConsumerEventName:a}=r(6934);function u(l){return`MessageConsumerEventName.${a.describe(l)}`}o.exports={MessageDispatcher:class{constructor({emitter:l,autoAck:d,logger:f}={}){Object.assign(this,{emitter:l,queue:[],dispatch:!0,formatEventName:u,logger:f}),this._dispatchOne=d?this._dispatchOneAutoAck:this._dispatchOneBare,this.emitter.setOnFirstDirectListener(this._onFirstMessageListener.bind(this)),this._availableListener=!0}start(){this.dispatch=!0,this._flush()}stop(){this.dispatch=!1}get length(){return this.queue.length}push(l){this.logger,this.queue.push(l),this.dispatch?this._flush():l.getGuaranteedMessageId()}_onFirstMessageListener(){this.logger,this._availableListener||(this.queue.length,this.dispatch,this._availableListener=!0),this._flush()}_flush(){for(this.logger;this.queue.length&&this.dispatch&&this.emitter.directListenerCount()>0;)this._dispatchOne(this.queue.shift());this.queue.length&&this.dispatch&&this.emitter.directListenerCount()===0&&this._availableListener&&(this._availableListener=!1)}_dispatchOneAutoAck(l){const{LOG_WARN:d}=this.logger;let f=null;if(f=this._dispatchOneBare(l),f)d(`Suppressing message acknowledgement for message ${l.getGuaranteedMessageId()} because client threw exception from listener`,f);else{if(l.isAcknowledged)return void d(`Consumer configured to auto-acknowledge messages, but message ${l.getGuaranteedMessageId()} was application acknowledged`);l._autoAcknowledge()}}_dispatchOneBare(l){const{LOG_WARN:d}=this.logger;let f;this.listenerCount===0&&d(`No listeners to dispatch message ${l.getGuaranteedMessageId()}`);try{this.emitter.emitDirect(l)}catch(p){f=this.emitter.formatErrorEvent(p,a.MESSAGE,l),this.emitter.emit("error",f)}return f}}}},8496:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.QueueBrowserEventName=a.new({UP:"QueueBrowserEventName_up",DOWN:"QueueBrowserEventName_down",DOWN_ERROR:"QueueBrowserEventName_downError",CONNECT_FAILED_ERROR:"QueueBrowserEventName_connectFailedError",GM_DISABLED:"QueueBrowserEventName_GMDisabled",DISPOSED:"QueueBrowserEventName_disposed",MESSAGE:"QueueBrowserEventName_message"})},4548:(o,h,r)=>{const a=r(9631),{APIProperties:u}=r(968),{Check:l}=r(802),d={queueDescriptor:void 0,connectTimeoutInMsecs:1e4,connectAttempts:3,windowSize:255,transportAcknowledgeTimeoutInMsecs:1e3,transportAcknowledgeThresholdPercentage:60};o.exports.QueueBrowserProperties=class extends u{constructor(f){super(d,f)}get queueDescriptor(){return l.something(this._queueDescriptor)?this._queueDescriptor:d.queueDescriptor}set queueDescriptor(f){this._queueDescriptor=f&&new a.QueueDescriptor(f)}get connectTimeoutInMsecs(){return l.something(this._bindTimeoutInMsecs)?this._bindTimeoutInMsecs:d.connectTimeoutInMsecs}set connectTimeoutInMsecs(f){this._bindTimeoutInMsecs=f}get connectAttempts(){return l.something(this._connectAttempts)?this._connectAttempts:d.connectAttempts}set connectAttempts(f){this._connectAttempts=f}get windowSize(){return l.something(this._windowSize)?this._windowSize:d.windowSize}set windowSize(f){this._windowSize=f}get transportAcknowledgeTimeoutInMsecs(){return l.something(this._transportAcknowledgeTimeoutInMsecs)?this._transportAcknowledgeTimeoutInMsecs:d.transportAcknowledgeTimeoutInMsecs}set transportAcknowledgeTimeoutInMsecs(f){this._transportAcknowledgeTimeoutInMsecs=f}get transportAcknowledgeThresholdPercentage(){return l.something(this._transportAcknowledgeThresholdPercentage)?this._transportAcknowledgeThresholdPercentage:d.transportAcknowledgeThresholdPercentage}set transportAcknowledgeThresholdPercentage(f){this._transportAcknowledgeThresholdPercentage=f}}},2584:(o,h,r)=>{const{EventEmitter:a}=r(3385),{LogFormatter:u}=r(2694),{MessageConsumerEventName:l}=r(6934),{QueueBrowserEventName:d}=r(8496);function f(p){return`QueueBrowserEventName.${d.describe(p)}`}o.exports.QueueBrowser=class extends a{constructor(p){super({direct:d.MESSAGE,emits:d.values,formatEventName:f}),this._messageConsumer=p,this.logger=new u((..._)=>["[queue-browser]",..._]),this._setupEventListers()}_setupEventListers(){this._messageConsumer.on(l.UP,this._onConsumerUp.bind(this)),this._messageConsumer.on(l.CONNECT_FAILED_ERROR,this._onConsumerConnectFailed.bind(this)),this._messageConsumer.on(l.DOWN,this._onConsumerDown.bind(this)),this._messageConsumer.on(l.DOWN_ERROR,this._onConsumerDownError.bind(this)),this._messageConsumer.on(l.MESSAGE,this._onConsumerMessage.bind(this)),this._messageConsumer.on(l.DISPOSED,this._onConsumerDisposed.bind(this)),this._messageConsumer.on(l.GM_DISABLED,this._onConsumerGMDisabled.bind(this))}_onConsumerMessage(p){this.emit(d.MESSAGE,p)}_onConsumerUp(p){this.emit(d.UP,p)}_onConsumerConnectFailed(p){this.emit(d.CONNECT_FAILED_ERROR,p)}_onConsumerDown(p){this.emit(d.DOWN,p)}_onConsumerDownError(p){this.emit(d.DOWN_ERROR,p)}_onConsumerDisposed(p){this.emit(d.DISPOSED,p)}_onConsumerGMDisabled(p){this.emit(d.GM_DISABLED,p)}connect(){const{LOG_DEBUG:p,LOG_ERROR:_}=this.logger;try{this._messageConsumer.connect()}catch(S){throw _(S.toString()),S}}disconnect(){const{LOG_DEBUG:p,LOG_ERROR:_}=this.logger;try{this._messageConsumer.disconnect()}catch(S){throw _(S.toString()),S}}start(){const{LOG_DEBUG:p,LOG_ERROR:_}=this.logger;try{this._messageConsumer.start()}catch(S){throw _(S.toString()),S}}stop(){const{LOG_DEBUG:p,LOG_ERROR:_}=this.logger;try{this._messageConsumer.stop()}catch(S){throw _(S.toString()),S}}removeMessageFromQueue(p){this._messageConsumer.applicationAck(p._guaranteedMsgId),p._acked=!0}}},1382:(o,h,r)=>{var a=r(2195);const{Enum:u}=r(7444);r(2694);const{Long:l}=r(9783),d=u.new({OK:0,DUPLICATE:1,OUT_OF_ORDER:2});o.exports={TransportAcks:class{constructor(f=0){const p=typeof f=="number"?l.fromNumber(f,!0):l.fromValue(f);this.lastAcked=p,this._acksPending=0}reset(){this._acksPending=0,this.lastAcked=l.ZERO}tryReceive(f,p){return this._lastReceived.lt(p)?(this._lastReceived,d.OUT_OF_ORDER):this._lastReceived.gte(f)?(this._lastReceived,this._acksPending++,d.DUPLICATE):(this._lastReceived=f,this._acksPending++,d.OK)}setAcked(){this._lastAcked=l.fromValue(this._lastReceived),this._acksPending=0}get acksPending(){return this._acksPending}get lastAcked(){return this._lastAcked}set lastAcked(f){f.toString(),Object.assign(this,{_lastAcked:l.fromValue(f),_lastReceived:l.fromValue(f)})}get lastReceived(){return this._lastReceived}toString(){return a(this)}},TransportAckResult:d}},5898:(o,h,r)=>{const{MessagePublisher:a}=r(56),{MessagePublisherAcknowledgeMode:u}=r(6e3),{MessagePublisherEventName:l}=r(3840),{MessagePublisherProperties:d}=r(996),{MessagePublisherPropertiesValidator:f}=r(475),{PublisherFSMEvent:p}=r(9728),{PublisherFSMEventNames:_}=r(3865);o.exports.MessagePublisherAcknowledgeMode=u,o.exports.MessagePublisher=a,o.exports.MessagePublisherProperties=d,o.exports.PublisherFSMEvent=p,o.exports.PublisherFSMEventNames=_,o.exports.MessagePublisherPropertiesValidator=f,o.exports.MessagePublisherEventName=l},1246:(o,h,r)=>{var a=r(2195);const{Long:u}=r(9783),l={_lastAcked:u.fromNumber(0,!0),_lastSent:u.fromNumber(0,!0),_next:u.fromNumber(1,!0)},d=f=>f.toString(10);o.exports.MessageIds=class{constructor(f){Object.assign(this,l,f)}get lastAcked(){return this._lastAcked}set lastAcked(f){this._lastAcked=u.fromValue(f)}get lastSent(){return this._lastSent}setLastSent(f){this._lastSent=u.fromValue(f),this._next=this._lastSent.add(1)}get next(){return this._next}inspect(){return{lastAcked:d(this.lastAcked),lastSent:d(this.lastSent),next:d(this.next)}}toString(){return a(this)}}},6e3:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.MessagePublisherAcknowledgeMode=a.new({PER_MESSAGE:"PER_MESSAGE",WINDOWED:"WINDOWED"})},3840:(o,h,r)=>{const{Enum:a}=r(7444),u=a.new({ACKNOWLEDGED_MESSAGE:"MessagePublisherEventName_acknowledgedMessage",CONNECT_FAILED_ERROR:"MessagePublisherEventName_connectFailedError",CAN_SEND:"MessagePublisherEventName_canSend",DISPOSED:"MessagePublisherEventName_disposed",DOWN:"MessagePublisherEventName_down",FLOW_NAME_CHANGED:"MessagePublisherEventName_flowNameChanged",GUARANTEED_MESSAGING_DOWN:"MessagePublisherEventName_guaranteedMessagingDown",REJECTED_MESSAGE:"MessagePublisherEventName_rejectedMessage",DISCONNECT_FAILED_ERROR:"MessagePublisherEventName_disconnectFailedError",UP:"MessagePublisherEventName_up",TRANSPORT_FULL:"MessagePublisherEventName_transportFull"});o.exports.MessagePublisherEventName=u},475:(o,h,r)=>{const{APIPropertiesValidators:a}=r(968),{MessagePublisherAcknowledgeMode:u}=r(6e3),{validateInstance:l,valBoolean:d,valIsMember:f,valNumber:p,valRange:_}=a,S={validate(C){const g=l.bind(null,"MessagePublisherProperties",C);g("enabled",[d]),g("windowSize",[p],[_,1,255]),g("acknowledgeTimeoutInMsecs",[p],[_,20,6e4]),g("acknowledgeMode",[f,u,"MessagePublisherAcknowledgeMode"]),g("connectRetryCount",[p],[_,0,Number.MAX_VALUE]),g("connectTimeoutInMsecs",[p],[_,50,Number.MAX_VALUE])}};o.exports.MessagePublisherPropertiesValidator=S},996:(o,h,r)=>{const a=r(4386),{APIProperties:u}=r(968),{Check:l}=r(802),{MessagePublisherAcknowledgeMode:d}=r(6e3),{TransportCapabilities:f}=r(8205);function p(){const{ProfileBinding:S}=a,C=S.value.guaranteedMessagingEnabled,g=f.web.webSocket();return C&&g}function _(){return{enabled:p(),windowSize:50,acknowledgeTimeoutInMsecs:2e3,acknowledgeMode:d.PER_MESSAGE,connectRetryCount:3,connectTimeoutInMsecs:5e3}}o.exports.MessagePublisherProperties=class extends u{constructor(S){super(_(),S||{})}get enabled(){return this._enabled}set enabled(S){this._enabled=S}get windowSize(){return l.defined(this._windowSize)?this._windowSize:_().windowSize}set windowSize(S){this._windowSize=S}get acknowledgeTimeoutInMsecs(){return l.defined(this._acknowledgeTimeoutInMsecs)?this._acknowledgeTimeoutInMsecs:_().acknowledgeTimeoutInMsecs}set acknowledgeTimeoutInMsecs(S){this._acknowledgeTimeoutInMsecs=S}get acknowledgeMode(){return this._acknowledgeMode||d.PER_MESSAGE}set acknowledgeMode(S){this._acknowledgeMode=S}get connectRetryCount(){return l.defined(this._connectRetryCount)?this._connectRetryCount:_().connectRetryCount}set connectRetryCount(S){this._connectRetryCount=S}get connectTimeoutInMsecs(){return l.defined(this._connectTimeoutInMsecs)?this._connectTimeoutInMsecs:_().connectTimeoutInMsecs}set connectTimeoutInMsecs(S){this._connectTimeoutInMsecs=S}inspect(){return{enabled:this.enabled,windowSize:this.windowSize,acknowledgeTimeoutInMsecs:this.acknowledgeTimeoutInMsecs,acknowledgeMode:d.describe(this.acknowledgeMode),connectRetryCount:this.connectRetryCount,connectTimeoutInMsecs:this.connectTimeoutInMsecs}}}},56:(o,h,r)=>{var a=r(2195);const u=r(3450),{Flow:l,PrivateFlowEventName:d}=r(8860),{LogFormatter:f}=r(2694),{MessagePublisherEventName:p}=r(3840),{MessagePublisherProperties:_}=r(996),{PublisherFSM:S}=r(2577),{PublisherFSMEvent:C}=r(9728),{PublisherFSMEventNames:g}=r(3865),{LOG_WARN:m}=new f;o.exports.MessagePublisher=class extends l{constructor({properties:T,sessionInterfaceFactory:y}={}){super(new _(T),y,{direct:p.ACKNOWLEDGED_MESSAGE,emits:p.values}),this._fsm=this._makeFSM();const E=new f;E.formatter=function(...I){return["[message-publisher]",...I]},this.log=E.wrap(this.log,this),this._bindWaiting=!0,this.on(d.BIND_WAITING,this._onBindWaiting.bind(this)),this.on(p.CONNECT_FAILED_ERROR,this._onBindFailed.bind(this)),this.on(p.DOWN,this._onDown.bind(this)),this.on(p.UP,this._onUp.bind(this))}_onBindFailed(){this._bindWaiting=!1}_onBindWaiting(){this._bindWaiting=!0}_onDown(){this._bindWaiting=!1}_onUp(){this._bindWaiting=!1}_makeFSM(){return new S({publisher:this,name:"PublisherFSM",sessionInterface:this._sessionInterface,properties:this._properties})}get flowId(){return this._flowId}set flowId(T){this._flowId=T}get name(){return this._flowName}set name(T){this._flowName=T}get publisherId(){return this._publisherId}set publisherId(T){this._publisherId=T}get properties(){return this._properties.clone()}connect(){super.connect(),this._fsm.getCurrentState()||this._fsm.start()}_disconnectSession(){super._disconnectSession(),this.processFSMEvent(new C({name:g.FLOW_CLOSE}))}getDisposedEvent(){return p.DISPOSED}handleAck(T){this.processFSMEvent(new C({name:g.ACK},{ack:T}))}handleNack(T,y){this.processFSMEvent(new C({name:g.ACK},{nack:T,ctrlMessage:y}))}handleUncorrelatedControlMessage(T){const y=T.msgType,{SMFAdProtocolMessageType:E}=u;switch(y){case E.CLIENTACK:{const I=T.getLastMsgIdAcked();T.smfHeader.pm_respcode>299?this.handleNack(I,T):this.handleAck(I);break}case E.CLIENTNACK:{const I=T.getLastMsgIdAcked();this.handleNack(I,T);break}case E.CLOSEPUBFLOW:this.processFSMEvent(new C({name:g.FLOW_UNBOUND}));break;default:m(`Dropping unhandled AD control message for ${this}`,E.describe(y))}}prepareAdMessageAndSend(T){return this._fsm.prepareAdMessageAndSend(T)}isBindWaiting(){return this._bindWaiting}inspect(){return Object.assign(super.inspect(),{name:this.name,publisherId:this.publisherId})}toString(){return a(this)}_disposeFSM(){this.processFSMEvent(new C({name:g.DISPOSE}))}_isDisconnected(){return this._fsm.isDisconnected()}}},3865:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.PublisherFSMEventNames=a.new({SESSION_UP:"PublisherSessionUp",SESSION_UP_NO_AD:"PublisherSessionUpNoAD",SESSION_DOWN:"PublisherSessionDown",FLOW_FAILED:"MessagePublisherFailed",FLOW_UP:"MessagePublisherUp",FLOW_CLOSE:"MessagePublisherClose",FLOW_UNBOUND:"MessagePublisherUnbound",TRANSPORT_FULL:"PublisherTransportFull",ACK:"PublisherAck",ACK_TIMEOUT:"PublisherAckTimeout",BIND_TIMEOUT:"PublisherBindTimeout",UNBIND_TIMEOUT:"PublisherUnbindTimeout",CAN_SEND:"PublisherCanSend",TRANSPORT_ERROR:"PublisherTransportError",RESEND_COMPLETE:"PublisherResendComplete",DISPOSE:"PublisherDispose"})},9728:(o,h,r)=>{const{FsmEvent:a}=r(7414);o.exports.PublisherFSMEvent=class extends a{constructor(u,l,d){super(u),Object.assign(this,l),Object.assign(this,d)}getEventText(){return this._eventText}}},2577:(o,h,r)=>{const a=r(3450),u=r(5024),{ErrorResponseSubcodeMapper:l,ErrorSubcode:d,OperationError:f}=r(6706),{LogFormatter:p}=r(2694),{Long:_}=r(9783),{MessageIds:S}=r(1246),{MessagePublisherAcknowledgeMode:C}=r(6e3),{MessagePublisherEventName:g}=r(3840),{PrivateFlowEventName:m}=r(8860),{PublisherFSMEvent:T}=r(9728),{PublisherFSMEventNames:y}=r(3865),{PublisherStateNames:E}=r(5403),{State:I,StateMachine:N}=r(7414),{StatType:A}=r(5747),{TransportReturnCode:L}=r(8205);o.exports.PublisherFSM=class extends N{constructor({publisher:D,name:q,sessionInterface:Y,properties:Q}={}){super({name:q});const W=this,x=()=>{const R=W.getCurrentState();return R?R.getName():"<not running>"};this.logger=new p((...R)=>[`[session=${Y.sessionIdHex}]`,`[message-publisher-fsm=${D.flowIdDec}]`,`[${x()}]`,...R]),this.log=this.logger.wrap(this.log,this);const{LOG_TRACE:k,LOG_DEBUG:J,LOG_INFO:F,LOG_WARN:$}=this.logger;Object.assign(this,{_publisher:D,_acknowledgeMode:Q.acknowledgeMode,_acknowledgeTimeoutInMsecs:Q.acknowledgeTimeoutInMsecs,_sessionInterface:Y,_windowSize:Q.windowSize,_stateEvents:[]}),this._guaranteedEnabled=Q.enabled,this._sendWindow=Q.windowSize,this._resetConnectedInfo(),this._notifiedWindowClosed=!1,this._transportFlowControlled=!0,this.initial(function(){return this.transitionTo(W.PublisherUnbound,R=>{R.getStateMachine().getName()})}),W.unhandledEventReaction(function(R){switch(R.getName()){case y.FLOW_UNBOUND:return this._guaranteedEnabled=!1,this._publisher.emit(g.GUARANTEED_MESSAGING_DOWN),this.transitionTo(W.PublisherUnbound,B=>{B.getStateMachine().getName()});case y.DISPOSE:case y.TRANSPORT_FULL:case y.CAN_SEND:break;default:R.getName()}return this}),W.PublisherUnbound=new I({name:E.UNBOUND,parentContext:W},{emitDownAndBindWaiting(){D.emit(g.DOWN),D.emit(m.BIND_WAITING)}}).entry(function(){this.emitDownAndBindWaiting(),W._connectRetryCount=Q.connectRetryCount}).reaction(y.FLOW_UNBOUND,function(){return this.internalTransition()}).reaction(y.SESSION_UP,function(){return this.transitionTo(W.PublisherOpenFlowSent)}),W.PublisherOpenFlowSent=new I({name:E.OPENFLOWSENT,parentContext:W},{emitOpenFlowFailedError(R){D.emit(g.CONNECT_FAILED_ERROR,R)},handleOpenFlowResponse(R){const B=R.smfHeader,M=B.pm_respcode;if(R.msgType!==a.SMFAdProtocolMessageType.OPENPUBFLOW)return W.processEvent(new T({name:y.FLOW_FAILED},{returnCode:M,description:`Unexpected response: ${a.SMFAdProtocolMessageType.describe(R.msgType)}`}));if(M===null)return D.incStat(A.RX_DISCARD_SMF_UNKNOWN_ELEMENT),Y.sessionIdHex,null;if(M!==200){const he=B.pm_respstr,ge=l.getADErrorSubcode(M,he);return W.processEvent(new T({name:y.FLOW_FAILED},{subcode:ge,returnCode:M,description:he}))}const re=R.getLastMsgIdAcked(),se=R.getWindow(),fe=R.getFlowId(),ce=R.getFlowName(),Te=R.getPublisherId();if(W._messageIds,se===void 0)return W.processEvent(new T({name:y.FLOW_FAILED},{description:"Window parameter not found"}));if(se>this._windowSize)return W.processEvent(new T({name:y.FLOW_FAILED},{description:"Invalid window negotiation"}));W._sendWindow=se-W._unackedList.length,W._sendWindow<0&&(W._sendWindow=0),Object.assign(W._publisher,{name:ce,flowId:fe,publisherId:Te}),W._guaranteedEnabled=!0,W._connectReason===0||W._connectReason===2?(W._messageIds.setLastSent(re),W._messageIds,W._connectReason,W._connectReason===2&&D.emit(g.FLOW_NAME_CHANGED,{messages:[...W._unackedList],count:W._unackedList.length}),W._connectReason=1,W._unackedList.forEach(he=>{he.getGuaranteedMessageId(),W._renumber(he),he.getGuaranteedMessageId(),W._messageIds.setLastSent(he.getGuaranteedMessageId())})):W._unackedList.forEach(he=>{he.setFlowId(fe),he.setPublisherId(D.publisherId),he.getGuaranteedMessageId()});const Ee=W._sessionInterface.getCapability(u.CapabilityType.MAX_GUARANTEED_MSG_SIZE).getValue();return W._unackedList.forEach(he=>{Ee<he._memoized_payload.length&&$(`Message size ${he._memoized_payload.length} above broker limit ${Ee}`)}),W._unackedList.length?(W._handleAck(re,!1,R,!0),W._firstUnackedToSend=W._unackedList[0]):W._messageIds.lastAcked=_.fromValue(re),W._messageIds,W.processEvent(new T({name:y.FLOW_UP}))},handleOpenFlowTimeout:()=>(F("Open publisher connection timeout"),W.processEvent(new T({name:y.BIND_TIMEOUT}))),handleUnknownFlowName(){return F("Flow name unknown, republish required"),W._resetConnectedInfo(!0),this.externalTransitionTo(W.PublisherOpenFlowSent)},sendOpenFlow(){const R=Y.getCorrelationTag(),B=a.AdProtocolMessage.getOpenMessagePublisher(W._messageIds.lastAcked,W._messageIds.lastSent,Q.windowSize,W._publisher._flowName,R);W._messageIds.lastAcked,W._messageIds.lastSent,Q.windowSize,W._publisher._flowName,Y.sendControl(B),Y.enqueueRequest(R,()=>this.handleOpenFlowTimeout(),Q.connectTimeoutInMsecs,null,M=>this.handleOpenFlowResponse(M))}}).entry(function(){try{this.sendOpenFlow()}catch(R){$(`Exception during bind attempt: ${R}`),W.processEvent(new T({name:y.SESSION_DOWN}))}}).reaction(y.FLOW_CLOSE,function(){return this.transitionTo(W.PublisherCloseFlowSent)}).reaction(y.FLOW_UP,function(){return this.transitionTo(W.PublisherUp)}).reaction(y.SESSION_DOWN,function(){return this.transitionTo(W.PublisherUnbound)}).reaction(y.BIND_TIMEOUT,function(){return W._connectRetryCount>0?(W._connectRetryCount--,this.externalTransitionTo(W.PublisherOpenFlowSent)):(this.emitOpenFlowFailedError({subcode:d.TIMEOUT,description:"Open publisher connection failed due to timeout"}),this.transitionTo(W.PublisherUnbound))}).reaction(y.FLOW_FAILED,function(R){const{subcode:B,returnCode:M,description:re}=R;return R.subcode===d.UNKNOWN_FLOW_NAME?this.handleUnknownFlowName():(this.emitOpenFlowFailedError({event:R,subcode:B,returnCode:M,description:re}),W._resetConnectedInfo(),this.transitionTo(W.PublisherUnbound))}),W.PublisherCloseFlowSent=new I({name:E.CLOSEFLOWSENT,parentContext:W},{handleCloseFlowResponse(R){const B=R.smfHeader,M=B.pm_respcode;return R.msgType!==a.SMFAdProtocolMessageType.CLOSEPUBFLOW?W.processEvent(new T({name:y.FLOW_FAILED},{returnCode:M,description:`Unexpected response: ${a.SMFAdProtocolMessageType.describe(R.msgType)}`})):M===null?(D.incStat(A.RX_DISCARD_SMF_UNKNOWN_ELEMENT),Y.sessionIdHex,null):(M!==200&&W.processEvent(new T({name:y.FLOW_FAILED},{returnCode:M,description:B.pm_respstr})),W.processEvent(new T({name:y.FLOW_UNBOUND})))},handleCloseFlowTimeout:()=>(F("Close publisher connection timeout."),W.processEvent(new T({name:y.UNBIND_TIMEOUT}))),sendCloseFlow(){const R=Y.getCorrelationTag(),B=a.AdProtocolMessage.getCloseMessagePublisher(W._publisher.flowId,R);Y.sendControl(B),Y.enqueueRequest(R,()=>this.handleCloseFlowTimeout(),Q.connectTimeoutInMsecs,null,M=>this.handleCloseFlowResponse(M))}}).entry(function(){return this.sendCloseFlow(),this}).reaction(y.ACK,function(R){return W._handleAckEvent(R),this.internalTransition()}).reaction(y.FLOW_UNBOUND,function(){return this.transitionTo(W.PublisherUnbound)}).reaction(y.FLOW_FAILED,function(){this.transitionTo(W.PublisherUnbound)}).reaction(y.UNBIND_TIMEOUT,function(){return this.transitionTo(W.PublisherCloseFlowSent)}),W.PublisherUp=new I({name:E.UP,parentContext:W},{emitFlowUp(){D.emit(g.UP)}}).initial(function(){return this.transitionTo(W._unackedList.length?W.PublisherRetransmitting:W.PublisherDataXfer)}).entry(function(){return W._scheduleStateEvents(W.PublisherUp,()=>this.emitFlowUp()),this}).reaction(y.ACK,function(R){return W._handleAckEvent(R),this.internalTransition()}).reaction(y.ACK_TIMEOUT,function(){return W._firstUnackedToSend=W._unackedList[0],this.transitionTo(W.PublisherRetransmitting)}).reaction(y.FLOW_CLOSE,function(){return this.transitionTo(W.PublisherCloseFlowSent)}).reaction(y.SESSION_DOWN,function(){return this.transitionTo(W.PublisherUnbound)}).reaction(y.TRANSPORT_FULL,function(){return this.internalTransition()}),W.PublisherDataXfer=new I({name:E.DATA_XFER,parentContext:W.PublisherUp}).entry(()=>{W._transportFlowControlled=!1,W._scheduleStateEvents(W.PublisherDataXfer,()=>W._maybeEmitCanSend())}).reaction(y.TRANSPORT_FULL,function(){return this.transitionTo(W.PublisherFlowControlled)}).exit(()=>{W._transportFlowControlled=!0}),W.PublisherFlowControlled=new I({name:E.FLOW_CONTROLLED,parentContext:W.PublisherUp}).reaction(y.TRANSPORT_FULL,function(){return F("Attempt to send while flow controlled"),this.internalTransition()}).reaction(y.CAN_SEND,function(){return this.transitionTo(W.PublisherRetransmitting)}),W.PublisherRetransmitting=new I({name:E.RETRANSMITTING,parentContext:W.PublisherUp},{retransmit(){try{W._resendFromUnacked()}catch(R){R instanceof f&&R.subcode===d.INSUFFICIENT_SPACE?W.processEvent(new T({name:y.TRANSPORT_FULL})):(F(`Publisher resendFromUnacked failed: ${R}`),W.processEvent(new T({name:y.FLOW_FAILED})))}}}).entry(function(){this.retransmit()}).reaction(y.RESEND_COMPLETE,function(){return this.transitionTo(W.PublisherDataXfer)}).reaction(y.TRANSPORT_FULL,function(){return W._unackedList.length,this.transitionTo(W.PublisherFlowControlled)})}isDisconnected(){return!this.getCurrentState()||!!this.getActiveState(E.UNBOUND)}prepareAdMessageAndSend(D){if(!this._guaranteedEnabled)throw new f("Session does not provide Guaranteed Message Publish capability",d.GM_UNAVAILABLE,"close flow received from message-router");if(this._sendWindow<=0)throw this._publisher.incStat(A.TX_WINDOW_CLOSED),this._notifiedWindowClosed=!0,new f("Guaranteed Message Window Closed",d.INSUFFICIENT_SPACE);const q=this._unackedList,{LOG_TRACE:Y,LOG_DEBUG:Q,LOG_INFO:W,LOG_WARN:x}=this.logger;D._payload_is_memoized&&(D._payload_is_memoized=!1,D._memoized_csumm=void 0,D._memoized_payload=void 0);const k=D.clone(),J=a.Codec.Encode.adaptMessageToSmf_payloadMemoize(k);var F=0;try{F=this._sessionInterface.getCapability(u.CapabilityType.MAX_GUARANTEED_MSG_SIZE).getValue()}catch(B){W("Can't pre-check payload size, broker not connected yet?"),B.stack}if(0<F&&J>F)throw new f(`Encoded payload size (${J}) exceeds broker size limit (MAX_GUARANTEED_MSG_SIZE, ${F})`,d.MESSAGE_TOO_LARGE);--this._sendWindow,this._renumber(k),this._cloneNumbers(k,D),q.push(k);const $=k.getGuaranteedMessageId();if(this._messageIds.setLastSent($),q.length,this._sendWindow,this._transportFlowControlled)return this._firstUnackedToSend===void 0&&(this._firstUnackedToSend=k),L.OK;let R;try{R=this._sessionInterface.sendToTransport(k),R!==L.OK?R===L.NO_SPACE&&(R=L.OK,this._firstUnackedToSend=k,this.processEvent(new T({name:y.TRANSPORT_FULL}))):k.setRedelivered(!0),this._startAckTimer()}catch(B){throw B instanceof f?(d.describe(B.subcode),B.message,q.pop(),this._messageIds.setLastSent(k.getGuaranteedPreviousMessageId()),++this._sendWindow,B):(B.message,B)}return L.OK}_handleAckEvent(D){this._publisher.incStat(A.TX_ACKS_RXED),this._handleAck(D.ack||D.nack,!!D.nack,D.ctrlMessage)}_handleAck(D,q,Y=void 0,Q=!1){const{_messageIds:W,_unackedList:x}=this,{LOG_DEBUG:k,LOG_INFO:J}=this.logger;if(W.lastAcked.gte(D))return void(Q?this._messageIds:J(`Dropping ack: remote ack for ${D}, local ids ${this._messageIds}`));const F=[];for(;x.length&&D.gte(x[0].getGuaranteedMessageId());)F.push(x.shift());x.indexOf(this._firstUnackedToSend)===-1&&(this._firstUnackedToSend=x[0]),this._sendWindow+=F.length,this._sendWindow,W.lastAcked=D;const $=q?F.pop():null,R=F.length;if(R)if(this._acknowledgeMode===C.PER_MESSAGE){x.length;for(let B=0;B<R;++B)this._publisher.emit(g.ACKNOWLEDGED_MESSAGE,F[B])}else{const B=F[R-1];B.getGuaranteedMessageId(),this._publisher.emit(g.ACKNOWLEDGED_MESSAGE,B)}$&&($.getGuaranteedMessageId(),this._publisher.emit(g.REJECTED_MESSAGE,$,Y)),x.length,x.length?this._resetAckTimer():this._clearAckTimer(),this._maybeEmitCanSend()}_maybeEmitCanSend(){this.logger,this._notifiedWindowClosed&&this._sendWindow!==0&&(this._notifiedWindowClosed=!1,this._publisher.emit(g.CAN_SEND))}_resendFromUnacked(){const{LOG_ERROR:D,LOG_INFO:q,LOG_DEBUG:Y}=this.logger,Q=this._unackedList;let W=Q.indexOf(this._firstUnackedToSend);if(W===-1)return this._firstUnackedToSend&&D(`Could not find first Unacked Messages in unacked message list: msgId = ${this._firstUnackedToSend.getGuaranteedMessageId}`),void(Q.length===0&&(this._messageIds.toString(),this.processEvent(new T({name:y.RESEND_COMPLETE}))));for(Q.length,Q.map(x=>x.getGuaranteedMessageId().toString());W<Q.length;){Q[W].getPublisherId()!==this._publisher.publisherId&&D(`Resending on invalid publisherId '${Q[W].getPublisherId()}'when it should be '${this._publisher.publisherId}'`);const x=this._sessionInterface.sendData(Q[W]);if(x===L.NO_SPACE)return this._firstUnackedToSend=Q[W],q("Publisher sendMessage blocked due to insufficient space, wait for CAN_SEND"),void this.processEvent(new T({name:y.TRANSPORT_FULL}));if(x!==L.OK)return;Q[W].setRedelivered(!0),W++,this._startAckTimer()}this._messageIds.toString(),this.processEvent(new T({name:y.RESEND_COMPLETE}))}_resetConnectedInfo(D=!1){this.logger,this._ackTimer&&this._clearAckTimer(),Object.assign(this,{_messageIds:new S}),Object.assign(this._publisher,{publisherId:void 0,flowId:void 0,flowName:null}),D?this._connectReason=2:(this._unackedList=[],this._connectReason=0)}_clearAckTimer(){this.logger,this._ackTimer&&this._ackTimer,this._ackTimer&&(clearTimeout(this._ackTimer),this._ackTimer=null)}_emitStateEvents(){for(this.logger;this._stateEvents.length;){const D=this._stateEvents.shift(),q=D[0],Y=D[1];this.getActiveState(q.getName())&&Y.apply(q)}}_handleAckTimeout(){this.logger,this._ackTimer=null,this._publisher.incStat(A.TX_ACK_TIMEOUT),this.processEvent(new T({name:y.ACK_TIMEOUT}))}_renumber(D){const q=this._messageIds,Y=q.next;D.setGuaranteedPreviousMessageId(q.lastSent),D.setGuaranteedMessageId(Y);const Q=this._publisher;D.setFlowId(Q.flowId),D.setPublisherId(Q.publisherId)}_cloneNumbers(D,q){q.setGuaranteedPreviousMessageId(D.getGuaranteedPreviousMessageId()),q.setGuaranteedMessageId(D.getGuaranteedMessageId()),q.setFlowId(D.getFlowId()),q.setPublisherId(D.getPublisherId())}_resetAckTimer(){this._clearAckTimer(),this._startAckTimer()}_scheduleStateEvents(D,q){this._stateEvents.push([D,q]),this._setPostEventAction(()=>this._emitStateEvents(),"Emit state events")}_setPostEventAction(D,q="No action"){const{LOG_DEBUG:Y,LOG_WARN:Q}=this.logger;this._postEventAction&&this._postEventAction.desc===q||(this._postEventAction&&this._postEventAction.desc&&Q(`Replacing post event action ${this._postEventAction.desc} with ${q}`),this._postEventAction={action:D||(()=>{}),desc:q},this.setPostEventAction(()=>{this._postEventAction.action(),this._postEventAction=null}))}_startAckTimer(){this._ackTimer||(this._ackTimer=setTimeout(()=>this._handleAckTimeout(),this._acknowledgeTimeoutInMsecs))}}},5403:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.PublisherStateNames=a.new({UNBOUND:"PublisherUnbound",OPENFLOWSENT:"PublisherOpenFlowSent",UP:"PublisherUp",FAILED:"PublisherFailed",CLOSEFLOWSENT:"PublisherCloseFlowSent",DATA_XFER:"PublisherDataXfer",FLOW_CONTROLLED:"MessagePublisherFlowControlled",RETRANSMITTING:"PublisherRetransmitting"})},2288:(o,h,r)=>{const{Baggage:a}=r(9486),{TraceContext:u}=r(5873),{TraceContextSetter:l}=r(7317),{MessageTracingSupport:d}=r(6986);o.exports.Baggage=a,o.exports.TraceContext=u,o.exports.TraceContextSetter=l,o.exports.MessageTracingSupport=d},9486:(o,h,r)=>{const{Parameter:{isStringOrNothing:a}}=r(802);o.exports.Baggage=class{getBaggage(){return this._baggage||null}setBaggage(u){this._setBaggage(a("baggage",u))}_setBaggage(u){this._baggage=u}}},7317:(o,h,r)=>{const{Parameter:a}=r(802),{Convert:u}=r(9783),l=r(8287).hp,{isNumber:d,isBoolean:f,isString:p,isStringOrNothing:_}=a,{uint8ArrayToString:S}=u;class C{constructor(){this._traceId=null,this._spanId=null,this._isSampled=!1,this._traceState=null,this._version=1}clone(){const m=new C;return m._setSpanId(this._spanId),m._setTraceId(this._traceId),m._setSampled(this._isSampled),m._setTraceState(this._traceState),m._setVersion(this._version),m}static get TRACE_ID_BYTES_LENGTH(){return 16}static get SPAN_ID_BYTES_LENGTH(){return 8}get version(){return this._version||1}setVersion(m){this._setVersion(d("version",m))}_setVersion(m){this._version=m}get traceId(){return this._traceId}setTraceId(m){this._setTraceId(p("traceId",m))}_setTraceId(m){this._traceId=m}get spanId(){return this._spanId}setSpanId(m){this._setSpanId(p("spanId",m))}_setSpanId(m){this._spanId=m}get isSampled(){return this._isSampled||!1}setSampled(m){this._setSampled(f("isSampled",m))}_setSampled(m){this._isSampled=m}get traceState(){return this._traceState}setTraceState(m){this._setTraceState(_("traceState",m))}_setTraceState(m){this._traceState=m}static fromTraceContext(m){if(m==null)return null;let T=null;if(l.isBuffer(m)?T=m:typeof m=="string"&&(T=l.from(m,"latin1")),!T||T.length<32)return null;try{const y=new Uint8Array(T).buffer;let E=0;const I=new C,N=y.slice(E,E+1);let A=new DataView(N,0,1).getUint8(E);const L=A>>4;I.setVersion(L);const D=(15&A)==4;I.setSampled(D),E++;const q=y.slice(E,E+16),Y=S(q,"hex");I.setTraceId(Y),E+=C.TRACE_ID_BYTES_LENGTH;const Q=y.slice(E,E+8),W=S(Q,"hex");I.setSpanId(W),E+=C.SPAN_ID_BYTES_LENGTH,E++,E+=4;const x=y.slice(E,E+2),k=new DataView(x,0,x.byteLength).getUint16(0,!1);if(E+=2,k>0){const J=y.slice(E,E+k),F=S(J);I.setTraceState(F)}return I}catch{return null}}}o.exports.TraceContextSetter=C},5873:(o,h,r)=>{const{Parameter:a}=r(802),{Convert:u}=r(9783),{TraceContextSetter:l}=r(7317),{isBoolean:d,isStringOrNothing:f}=a,{stringToUint8Array:p,hexStringToUint8Array:_}=u;class S{constructor(g){this._traceId=f("traceId",g.traceId),this._spanId=f("spanId",g.spanId),this._isSampled=d("isSampled",g.isSampled),this._traceState=g.traceState,this._version=g.version}static clone(g){const m=new l;return m._setSpanId(g.getSpanId()),m._setTraceId(g.getTraceId()),m._setSampled(g.getIsSampled()),m._setTraceState(g.getTraceState()),m._setVersion(g.getVersion()),new S(m)}get version(){return this._version||1}getVersion(){return this.version}get MAX_TRACE_STATE_LENGTH(){return 512}get traceId(){return this._traceId}getTraceId(){return this._traceId}get spanId(){return this._spanId}getSpanId(){return this._spanId}get isSampled(){return this._isSampled}getIsSampled(){return this._isSampled||!1}get traceState(){return this._traceState}getTraceState(){return this._traceState||null}getTruncatedTraceState(){return this._standardTraceStateTruncation(this.MAX_TRACE_STATE_LENGTH)}getEncodedTraceContext(){if(this.traceId==null||this.spanId==null)return null;const g=this.traceState==null?0:this.traceState.length,m=new ArrayBuffer(32+g);let T=0;const y=new DataView(m);let E=0;E|=this.version<<4,E|=this.isSampled?4:0,y.setUint8(T,E,!1),T++;const I=_(this.traceId);for(let A=0;A<16;A++)y.setUint8(T+A,I[A],!1);T+=16;const N=_(this.spanId);for(let A=0;A<8;A++)y.setUint8(T+A,N[A],!1);if(T+=8,y.setUint8(T,1,!1),T++,y.setUint16(T,0,!1),y.setUint16(T+2,0,!1),T+=4,this.traceState==null)y.setUint16(T,0,!1),T+=2;else{const A=this.getTruncatedTraceState();if(A!=null){const L=A.length,D=new Uint16Array([L]);y.setUint16(T,D,!1),T+=2;const q=p(A);for(let Y=0;Y<q.length;Y++)y.setUint8(T+Y,q[Y],!1);T+=q.length}}return new Uint8Array(m)}_standardTraceStateTruncation(g){if(!this._traceState||this._traceState==null)return null;if(this._traceState.length<g)return this._traceState;const m=new Array,T=new Array;let y=0;const E=this._traceState.split(",");for(let I=0;I<E.length;I++){let N=E[I];if(N!==""&&N!=null){let A=N.length;A>128?m.push(N):y+A+(y>0?1:0)<=g?(T.push(N),y+=A+(y>0?1:0)):m.push(N)}}for(let I=0;I<m.length;I++){let N=m[I],A=N.length;y+A+(y>0?1:0)<=g&&(T.push(N),y+=A+(y>0?1:0))}return T.join(",")}toString(){return"{traceId="+this.getTraceId()+", spanId="+this.getSpanId()+", sampled="+this.isSampled+", traceState="+(this.traceState==null?"}":"'"+this.traceState+"'}")}}o.exports.TraceContext=S},6986:(o,h,r)=>{r(2694),r(9486);const{TraceContext:a}=r(5873),{TraceContextSetter:u}=r(7317);o.exports.MessageTracingSupport=class{constructor(){}getTraceContextSetter(){return this._traceContextSetter!=null&&this._traceContextSetter!=null||(this._traceContextSetter=new u),this._traceContextSetter}getTransportContext(){return this._transportContext}_setTransportContext(l){l!=null&&(this._transportContext=new a(l))}getCreationContext(){return this._creationContext}_setCreationContext(l){l!=null&&(this._creationContext=new a(l))}getBaggage(){return this._baggage}_setBaggage(l){this._baggage=l}}},6247:(o,h,r)=>{const{ReplicationGroupMessageId:a,RgmidFactory:u}=r(6475),{Message:l}=r(1884),{MessageCacheStatus:d}=r(7366),{MessageDeliveryModeType:f}=r(177),{MessageDumpFlag:p}=r(3901),{MessageDumpStandardProvider:_}=r(3739),{MessageDumpUtil:S}=r(8892),{MessageType:C}=r(2868),{MessageOutcome:g}=r(568),{MessageUserCosType:m}=r(6676),{SolclientFactory:T}=r(4386);T.createMessage=T.createFactory(()=>new l),T.createReplicationGroupMessageId=T.createFactory(y=>u.fromString(y)),o.exports.Message=l,o.exports.MessageCacheStatus=d,o.exports.MessageDeliveryModeType=f,o.exports.MessageDumpFlag=p,o.exports.MessageDumpStandardProvider=_,o.exports.MessageDumpUtil=S,o.exports.MessageType=C,o.exports.MessageOutcome=g,o.exports.MessageUserCosType=m,o.exports.ReplicationGroupMessageId=a,o.exports.RgmidFactory=u},7366:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.MessageCacheStatus=a.new({LIVE:0,CACHED:1,SUSPECT:2})},177:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.MessageDeliveryModeType=a.new({DIRECT:0,PERSISTENT:1,NON_PERSISTENT:2})},3901:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.MessageDumpFlag=a.new({MSGDUMP_BRIEF:0,MSGDUMP_FULL:1})},3739:(o,h,r)=>{const a=r(199),u=r(8892),{Destination:l}=r(9620),{LOG_ERROR:d}=r(2694),{Long:f}=r(9783),{MessageCacheStatus:p}=r(7366),{MessageDeliveryModeType:_}=r(177),{MessageDumpFlag:S}=r(3901),{MessageUserCosType:C}=r(6676),{SDTMapContainer:g,SDTFieldType:m}=r(769),{StringUtils:T}=r(968),y={fpDestination(E){const I=E.getDestination();return I!==null&&I instanceof l?["Destination",!0,I.toString(),null]:["Destination",!1,"",null]},fpSenderId:E=>["SenderId",E.getSenderId()!==void 0&&E.getSenderId()!==null,E.getSenderId(),null],fpAppmsgType:E=>["AppMessageType",E.getApplicationMessageType()!==void 0&&E.getApplicationMessageType()!==null,E.getApplicationMessageType(),null],fpAppMsgId:E=>["AppMessageID",E.getApplicationMessageId()!==void 0&&E.getApplicationMessageId()!==null,E.getApplicationMessageId(),null],fpSequenceNumber(E){const I=E.getSequenceNumber();return typeof I=="number"?["SequenceNumber",!0,I,null]:["SequenceNumber",!1,"",null]},fpTopicSequenceNumber(E){const I=E.getTopicSequenceNumber();return f.isLong(I)?["TopicSequenceNumber",!0,I.toString(),null]:["TopicSequenceNumber",!1,"",null]},fpCorrelationId:E=>["CorrelationId",E.getCorrelationId()!==void 0&&E.getCorrelationId()!==null,E.getCorrelationId(),null],fpHttpContentType:E=>["HTTP Content Type",E.getHttpContentType()!==void 0&&E.getHttpContentType()!==null,E.getHttpContentType(),null],fpHttpContentEncoding:E=>["HTTP Content Encoding",E.getHttpContentEncoding()!==void 0&&E.getHttpContentEncoding()!==null,E.getHttpContentEncoding(),null],fpSendTimestamp(E){const I=E.getSenderTimestamp();return typeof I=="number"?["SendTimestamp",!0,`${I} (${u.MessageDumpUtil.formatDate(I)})`,null]:["SendTimestamp",!1,"",null]},fpRcvTimestamp(E){const I=E.getReceiverTimestamp();return typeof I=="number"?["RcvTimestamp",!0,`${I} (${u.MessageDumpUtil.formatDate(I)})`,null]:["RcvTimestamp",!1,"",null]},fpClassOfService:E=>typeof E.getUserCos()=="number"?["Class Of Service",!0,C.nameOf(E.getUserCos()),null]:["Class Of Service",!1,"",null],fpDeliveryMode:E=>typeof E.getDeliveryMode()=="number"?["DeliveryMode",!0,_.nameOf(E.getDeliveryMode()),null]:["DeliveryMode",!1,"",null],fpGuaranteedMsgId(E){const I=E.getGuaranteedMessageId();return f.isLong(I)?["Message Id",!0,I.toString(10),null]:["Message Id",!1,"",null]},fpReplicationGroupMessageId(E){const I=E.getReplicationGroupMessageId();return I===void 0?["Replication Group Message Id",!1,"",null]:["Replication Group Message Id",!0,I.toString(),null]},fpTimeToLive(E){const I=E.getTimeToLive();if(typeof I=="number"){const N=u.MessageDumpUtil,A=new Date;return["TimeToLive",!0,`${I} (${N.formatDate(A.getTime()+I)})`,null]}return["TimeToLive",!1,"",null]},fpExpiration(E){const I=E.getGMExpiration();return typeof I=="number"?["Expiration",!0,`${I} (${u.MessageDumpUtil.formatDate(I)})`,null]:["Expiration",!1,"",null]},fpMessageDMQEligible:E=>["DMQ Eligible",E.isDMQEligible(),"",null],fpMessageRedelivered:E=>["Message Re-delivered",E.isRedelivered(),"",null],fpMessageDeliveryCount(E){try{return["Message Delivery Count",!0,E.getDeliveryCount(),null]}catch{return["Message Delivery Count",!1,"",null]}},fpDiscardIndication:E=>["Discard Indication",E.isDiscardIndication(),"",null],fpAckImmediately:E=>["ACK Immediately",E.isAcknowledgeImmediately(),"",null],fpElidingEligible:E=>["Eliding Eligible",E.isElidingEligible(),"",null],fpReplyMessage:E=>["Reply Message",E.isReplyMessage(),"",null],fpReplyTo(E){const I=E.getReplyTo();return I!==null&&I instanceof l?["ReplyTo",!0,I.toString(),null]:["ReplyTo",!1,"",null]},fpDeliverToOne:E=>["Deliver To One",E.isDeliverToOne(),"",null],fpCacheMessage:E=>["Message from cache",E.getCacheStatus()!==p.LIVE,"",null],fpCacheRequestId(E){const I=E.getCacheRequestId();return typeof I=="number"?["Cache Request Id",!0,I,null]:["Cache Request Id",!1,"",null]},fpUserPropertyMap(E,I){const N=E.getUserPropertyMap();if(N!==null&&N instanceof g){const A=`${N.getKeys().length} entries`;let L=null;if(I===S.MSGDUMP_FULL)try{L=u.MessageDumpUtil.printMap(N,2)}catch(D){d(D.message,D.stack),L="Error"}return["User Property Map",!0,A,L]}return["User Property Map",!1,"",null]},fpCorrelationTag(E){const I=E.getCorrelationKey();return["Correlation Tag Pointer",I!=null,I,null]},fpUserData:E=>T.notEmpty(E.getUserData())?["User Data",!0,`len=${E.getUserData().length}`,a.Debug.formatDumpBytes(E.getUserData(),!0,2)]:["User Data",!1,"",null],fpXmlMetadata(E,I){const N=E.getXmlMetadata();if(T.notEmpty(N)){const A=`len=${N.length}`;let L=null;return I===S.MSGDUMP_FULL&&(L=a.Debug.formatDumpBytes(N,!0,2)),["XML Metadata",!0,A,L]}return["XML Metadata",!1,"",null]},fpTracingCreationContext(E,I){const N=E.getCreationContext(),A=N!=null&&N.getTraceId()!=null&&N.getSpanId()!=null;let L=null;return I&&I===S.MSGDUMP_FULL&&(L=N!=null?N.toString():null),["Tracing CreationContext",A,L,null]},fpTracingTransportContext(E,I){const N=E.getTransportContext(),A=N!=null&&N.getTraceId()!=null&&N.getSpanId()!=null;let L=null;return I&&I===S.MSGDUMP_FULL&&(L=N!=null?N.toString():null),["Trace Context SMF Parameter",A,L,null]},fpTracingBaggage(E,I){const N=E.getBaggage()!=null&&E.getBaggage().getBaggage()!=null;let A=null;if(I&&I===S.MSGDUMP_FULL){const L=E.getBaggage();A=L!=null?L.getBaggage():null}return["Tracing Baggage",N,A,null]},fpSdtStream(E,I){const N=E.getSdtContainer();if(N!==null&&N.getType()===m.STREAM){const A=u.MessageDumpUtil,L=`${A.countItems(N.getValue())} entries`;let D=null;if(I===S.MSGDUMP_FULL)try{D=A.printStream(N.getValue(),2)}catch(q){d(q.message,q.stack),D="Error"}return["SDT Stream",!0,L,D]}return["SDT Stream",!1,"",null]},fpSdtMap(E,I){const N=E.getSdtContainer();if(N!==null&&N.getType()===m.MAP){const A=`${N.getValue().getKeys().length} entries`;let L=null;if(I===S.MSGDUMP_FULL)try{L=u.MessageDumpUtil.printMap(N.getValue(),2)}catch(D){d(D.message,D.stack),L="Error"}return["SDT Map",!0,A,L]}return["SDT Map",!1,"",null]},fpBinaryAttachment(E,I){if(!E._binaryAttachment||E._binaryAttachment.length<1)return["Binary Attachment",!1,"",null];const N=E._binaryAttachment.toString("latin1"),A=`len=${N.length}`;let L=null;return I===S.MSGDUMP_FULL&&(L=a.Debug.formatDumpBytes(N,!0,2)),["Binary Attachment",!0,A,L]},fpXmlContent(E,I){const N=E.getXmlContent();if(T.notEmpty(N)){const A=`len=${N.length}`;let L=null;return I===S.MSGDUMP_FULL&&(L=a.Debug.formatDumpBytes(N,!0,2)),["XML",!0,A,L]}return["XML",!1,"",null]}};o.exports.MessageDumpStandardProvider=y},8892:(o,h,r)=>{const a=r(199),u=r(3739),{SDTFieldType:l,SDTMapContainer:d,SDTStreamContainer:f,SDTUnsupportedValueError:p,SDTValueErrorSubcode:_}=r(769),{Check:S}=r(802),{ErrorSubcode:C,OperationError:g}=r(6706),{MessageDumpFlag:m}=r(3901),{StringBuffer:T,StringUtils:y}=r(968),E={get dumpProviders(){const N=u.MessageDumpStandardProvider;return Object.keys(N).map(A=>N[A])}},I={getOutOfRangeValue:N=>typeof N=="string"?`<out of range>
|
|
67
|
+
*/function Go(){return Go=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Go.apply(this,arguments)}function cf(e,t){if(e==null)return{};var n={},s=Object.keys(e),c,o;for(o=0;o<s.length;o++)c=s[o],!(t.indexOf(c)>=0)&&(n[c]=e[c]);return n}function hE(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function dE(e,t){return e.button===0&&(!t||t==="_self")&&!hE(e)}const pE=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],fE=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],_E="6";try{window.__reactRouterVersion=_E}catch{}const gE=Ae.createContext({isTransitioning:!1}),mE="startTransition",yh=n_[mE];function EE(e){let{basename:t,children:n,future:s,window:c}=e,o=Ae.useRef();o.current==null&&(o.current=Cm({window:c,v5Compat:!0}));let h=o.current,[r,a]=Ae.useState({action:h.action,location:h.location}),{v7_startTransition:u}=s||{},l=Ae.useCallback(d=>{u&&yh?yh(()=>a(d)):a(d)},[a,u]);return Ae.useLayoutEffect(()=>h.listen(l),[h,l]),Ae.createElement(uE,{basename:t,children:n,location:r.location,navigationType:r.action,navigator:h,future:s})}const SE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",TE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yE=Ae.forwardRef(function(t,n){let{onClick:s,relative:c,reloadDocument:o,replace:h,state:r,target:a,to:u,preventScrollReset:l,unstable_viewTransition:d}=t,_=cf(t,pE),{basename:p}=Ae.useContext(Ir),f,S=!1;if(typeof u=="string"&&TE.test(u)&&(f=u,SE))try{let T=new URL(window.location.href),y=u.startsWith("//")?new URL(T.protocol+u):new URL(u),E=Ts(y.pathname,p);y.origin===T.origin&&E!=null?u=E+y.search+y.hash:S=!0}catch{}let C=zm(u,{relative:c}),g=CE(u,{replace:h,state:r,target:a,preventScrollReset:l,relative:c,unstable_viewTransition:d});function m(T){s&&s(T),T.defaultPrevented||g(T)}return Ae.createElement("a",Go({},_,{href:f||C,onClick:S||o?s:m,ref:n,target:a}))}),Ih=Ae.forwardRef(function(t,n){let{"aria-current":s="page",caseSensitive:c=!1,className:o="",end:h=!1,style:r,to:a,unstable_viewTransition:u,children:l}=t,d=cf(t,fE),_=ia(a,{relative:d.relative}),p=Ci(),f=Ae.useContext(sf),{navigator:S,basename:C}=Ae.useContext(Ir),g=f!=null&&RE(_)&&u===!0,m=S.encodeLocation?S.encodeLocation(_).pathname:_.pathname,T=p.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;c||(T=T.toLowerCase(),y=y?y.toLowerCase():null,m=m.toLowerCase()),y&&C&&(y=Ts(y,C)||y);const E=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let I=T===m||!h&&T.startsWith(m)&&T.charAt(E)==="/",N=y!=null&&(y===m||!h&&y.startsWith(m)&&y.charAt(m.length)==="/"),A={isActive:I,isPending:N,isTransitioning:g},L=I?s:void 0,D;typeof o=="function"?D=o(A):D=[o,I?"active":null,N?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let q=typeof r=="function"?r(A):r;return Ae.createElement(yE,Go({},d,{"aria-current":L,className:D,ref:n,style:q,to:a,unstable_viewTransition:u}),typeof l=="function"?l(A):l)});var Wl;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Wl||(Wl={}));var Ch;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ch||(Ch={}));function IE(e){let t=Ae.useContext(ra);return t||vt(!1),t}function CE(e,t){let{target:n,replace:s,state:c,preventScrollReset:o,relative:h,unstable_viewTransition:r}=t===void 0?{}:t,a=Qm(),u=Ci(),l=ia(e,{relative:h});return Ae.useCallback(d=>{if(dE(d,n)){d.preventDefault();let _=s!==void 0?s:Fo(u)===Fo(l);a(e,{replace:_,state:c,preventScrollReset:o,relative:h,unstable_viewTransition:r})}},[u,a,l,s,c,n,e,o,h,r])}function RE(e,t){t===void 0&&(t={});let n=Ae.useContext(gE);n==null&&vt(!1);let{basename:s}=IE(Wl.useViewTransitionState),c=ia(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=Ts(n.currentLocation.pathname,s)||n.currentLocation.pathname,h=Ts(n.nextLocation.pathname,s)||n.nextLocation.pathname;return ko(c.pathname,h)!=null||ko(c.pathname,o)!=null}const vE=({stimuli:e,selectedStimulusId:t,onSelectStimulus:n})=>{const s=(o,h)=>o?o.length<=h?o:o.slice(0,h)+"...":"No text content",c=o=>new Date(o).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0});return Object.keys(e).length===0?le.jsx("div",{className:"stimulus-list",children:le.jsx("div",{className:"placeholder-message",children:"No stimuli available. New stimuli will appear here."})}):le.jsx("div",{className:"stimulus-list",children:Object.entries(e).map(([o,h])=>le.jsxs("div",{className:`stimulus-item ${t===o?"selected":""}`,onClick:()=>n(o),children:[le.jsxs("div",{className:"stimulus-header",children:[le.jsx("span",{className:"user-email",children:h.content.identity||"No identity"}),le.jsx("span",{className:"timestamp",children:c(h.timestamp)})]}),le.jsx("pre",{className:"stimulus-text",children:s(h.content.text,200)})]},o))})},NE=({message:e,elapsedTime:t})=>{const[n,s]=Ae.useState(!1),c=e.content.text||"No text content",o=c.length>1e3,h=n?c:o?c.slice(0,1e3):c;return le.jsxs("div",{className:"message-box stimulus",children:[le.jsxs("div",{className:"message-header",children:[le.jsx("span",{className:"message-type",children:"Stimulus from originator"}),le.jsx("span",{className:"elapsed-time",children:t})]}),le.jsxs("div",{className:"message-content",children:[h,o&&le.jsx("button",{className:"more-button",onClick:()=>s(!n),children:n?"Less":"More..."})]})]})},Rh=({message:e,elapsedTime:t,isStreaming:n,isComplete:s})=>{const[c,o]=Ae.useState(!1),h=e.content.text||"No response text",r=h.length>1e3,a=c?h:r?h.slice(0,1e3):h;return le.jsxs("div",{className:`message-box response ${n?"streaming":""} ${s?"complete":""}`,children:[le.jsxs("div",{className:"message-header",children:[le.jsxs("span",{className:"message-type",children:[s?"Response Complete":n?"Streaming Response":"Response to originator",n&&!e.content.last_chunk&&" (In Progress)"]}),le.jsx("span",{className:"elapsed-time",children:t})]}),!s&&le.jsxs("div",{className:"message-content",children:[a,r&&le.jsx("button",{className:"more-button",onClick:()=>o(!c),children:c?"Less":"More..."})]}),e.content.files&&e.content.files.length>0&&le.jsxs("div",{className:"file-list",children:[le.jsx("h4",{children:"Files:"}),le.jsx("ul",{children:e.content.files.map((u,l)=>le.jsx("li",{children:u.name},l))})]})]})},OE=({message:e,elapsedTime:t,response:n})=>{const{agent_name:s,action_name:c,action_params:o}=e.content;return le.jsxs("div",{className:"message-box action-request",children:[le.jsxs("div",{className:"message-header",children:[le.jsxs("div",{className:"action-header",children:[le.jsx("span",{className:"action-request-label",children:"Action Request"}),le.jsx("span",{className:"agent-name",children:s}),le.jsx("span",{className:"action-name",children:c})]}),le.jsx("span",{className:"elapsed-time",children:t})]}),le.jsx("div",{className:"message-content",children:le.jsxs("div",{className:"action-params",children:[le.jsx("h4",{children:"Action Parameters:"}),le.jsx("ul",{children:Object.entries(o).map(([h,r])=>le.jsxs("li",{children:[le.jsxs("strong",{children:[h,":"]})," ",JSON.stringify(r)]},h))})]})}),n&&le.jsxs("div",{className:"action-response",children:[le.jsx("h4",{children:"Response:"}),le.jsx("p",{children:n.content.message})]})]})},AE=({message:e,elapsedTime:t})=>{const[n,s]=Ae.useState(!1),c=e.content.text||"No reinvoke content",o=c.length>1e3,h=n?c:o?c.slice(0,1e3):c;return le.jsxs("div",{className:"message-box orchestrator-reinvoke",children:[le.jsxs("div",{className:"message-header",children:[le.jsx("span",{className:"message-type",children:"Orchestrator Reinvoke"}),le.jsx("span",{className:"elapsed-time",children:t})]}),le.jsxs("div",{className:"message-content",children:[le.jsx("p",{children:h}),o&&le.jsx("button",{className:"more-button",onClick:()=>s(!n),children:n?"Less":"More..."})]})]})},hf=({message:e,elapsedTime:t})=>{const[n,s]=Ae.useState(!1);return le.jsxs("div",{className:"message-box llm-service-response",children:[le.jsxs("div",{className:"message-header",children:[le.jsx("span",{className:"message-type",children:"LLM Service Response"}),le.jsx("span",{className:"elapsed-time",children:t})]}),le.jsxs("div",{className:"message-content",children:[n?le.jsx("pre",{children:JSON.stringify(e.content,null,2)}):le.jsxs("p",{children:[JSON.stringify(e.content).slice(0,100),"..."]}),le.jsx("button",{className:"more-button",onClick:()=>s(!n),children:n?"Show Less":"Show More"})]})]})},wE=({message:e,elapsedTime:t})=>{const[n,s]=Ae.useState(!1);return le.jsxs("div",{className:"message-box llm-service-request",children:[le.jsxs("div",{className:"message-header",children:[le.jsx("span",{className:"message-type",children:"LLM Service Request"}),le.jsx("span",{className:"elapsed-time",children:t})]}),le.jsxs("div",{className:"message-content",children:[n?le.jsx("pre",{children:JSON.stringify(e.content,null,2)}):le.jsxs("p",{children:[JSON.stringify(e.content).slice(0,100),"..."]}),le.jsx("button",{className:"more-button",onClick:()=>s(!n),children:n?"Show Less":"Show More"})]}),e.response&&le.jsx(hf,{message:e.response,elapsedTime:e.response.elapsedTime})]})},PE=({selectedStimulus:e})=>{if(!e)return le.jsx("div",{className:"message-flow",children:le.jsx("div",{className:"placeholder-message",children:"Select a stimulus to view details"})});const t=(s,c,o)=>{const h=`${((new Date(s.timestamp)-new Date(c))/1e3).toFixed(2)}s`;switch(s.type){case"stimulus":return le.jsx(NE,{message:s,elapsedTime:h});case"response":case"streamingResponse":return le.jsx(Rh,{message:s,elapsedTime:h,isStreaming:s.type==="streamingResponse"});case"responseComplete":return le.jsx(Rh,{message:s,elapsedTime:h,isComplete:!0});case"actionRequest":{const r=o[`${s.content.action_list_id}-${s.content.action_idx}`];return le.jsx(OE,{message:s,elapsedTime:h,response:r})}case"orchestratorReinvoke":return le.jsx(AE,{message:s,elapsedTime:h});case"llmServiceRequest":return le.jsx(wE,{message:s,elapsedTime:h});case"llmServiceResponse":return le.jsx(hf,{message:s,elapsedTime:h});default:return null}},n=e.responses.reduce((s,c)=>{if(c.type==="actionResponse"){const o=`${c.content.action_list_id}-${c.content.action_idx}`;s[o]=c}return s},{});return le.jsxs("div",{className:"message-flow",children:[t(e,e.timestamp,n),e.responses.filter(s=>s.type!=="actionResponse").map((s,c)=>t(s,e.timestamp,n))]})},vh="AgenticAIDB",DE=1,Qn="stimuli",Vu=()=>new Promise((e,t)=>{const n=indexedDB.open(vh,DE);n.onerror=s=>t(s.target.error),n.onsuccess=s=>{const c=s.target.result;if(c.objectStoreNames.contains(Qn))e(c);else{c.close();const o=indexedDB.open(vh,c.version+1);o.onupgradeneeded=Nh,o.onsuccess=h=>e(h.target.result),o.onerror=h=>t(h.target.error)}},n.onupgradeneeded=Nh}),Nh=e=>{const t=e.target.result;t.objectStoreNames.contains(Qn)||t.createObjectStore(Qn,{keyPath:"stimulus_uuid"})},Oh=async e=>{const s=(await Vu()).transaction([Qn],"readwrite").objectStore(Qn);return new Promise((c,o)=>{if(!e||!e.stimulus_uuid){console.warn("Invalid stimulus or missing stimulus_uuid",e),c();return}const h=typeof e.stimulus_uuid=="object"&&e.stimulus_uuid._value?e.stimulus_uuid._value:e.stimulus_uuid;if(!h){console.warn("Invalid key for stimulus",e),c();return}const r=s.get(h);r.onerror=()=>o(r.error),r.onsuccess=()=>{let a;if(r.result){const u={...r.result,...e,stimulus_uuid:h,responses:[...r.result.responses||[],...e.responses||[]]};a=s.put(u)}else a=s.put({...e,stimulus_uuid:h});a.onerror=u=>{console.error("Error updating stimulus in IndexedDB",u),o(a.error)},a.onsuccess=()=>{c()}}})},df=async()=>{const n=(await Vu()).transaction([Qn],"readonly").objectStore(Qn);return new Promise((s,c)=>{const o=n.getAll();o.onerror=()=>c(o.error),o.onsuccess=()=>{const h={};o.result.forEach(r=>{r.stimulus_uuid&&(h[r.stimulus_uuid]=r)}),s(h)}})},ME=async()=>{const n=(await Vu()).transaction([Qn],"readwrite").objectStore(Qn);return new Promise((s,c)=>{const o=n.clear();o.onerror=()=>c(o.error),o.onsuccess=()=>s()})},bE=()=>{const[e,t]=Ae.useState({}),[n,s]=Ae.useState(!0),c=Ae.useCallback(r=>{t(a=>{let u={...a};const l=r.stimulus_uuid;if(r.type==="stimulus")u[l]||(u[l]={...r,responses:[]});else if(["OrchestratorReinvoke","response","streamingResponse","responseComplete","actionRequest","actionResponse","llmServiceRequest","llmServiceResponse"].includes(r.type)){if(!u[l])return a;if(r.type==="streamingResponse"){const{uuid:_,first_chunk:p,last_chunk:f,text:S}=r.content,C=u[l].responses.findIndex(g=>g.type==="streamingResponse"&&g.content.uuid===_);C!==-1?(u[l].responses[C].content.text=S,u[l].responses[C].content.last_chunk=f):p&&u[l].responses.push(r)}else if(r.type==="llmServiceResponse"){const _=u[l].responses.findIndex(p=>{var f,S,C;return p.type==="llmServiceRequest"&&r.broker_request_reply&&((f=r.broker_request_reply[0])==null?void 0:f.request_id)&&((S=p.broker_request_reply[0])==null?void 0:S.request_id)===((C=r.broker_request_reply[0])==null?void 0:C.request_id)});_!==-1?u[l].responses[_].response=r:u[l].responses.some(f=>f.timestamp===r.timestamp&&f.type===r.type)||u[l].responses.push(r)}else u[l].responses.some(p=>p.timestamp===r.timestamp&&p.type===r.type)||u[l].responses.push(r)}const d=Object.entries(u).sort((_,p)=>new Date(_[1].timestamp)-new Date(p[1].timestamp));return Object.fromEntries(d)})},[]),o=Ae.useCallback(async()=>{window.confirm("Are you sure you want to discard all stimuli?")&&(s(!0),await ME(),t({}),s(!1))},[]),h=Ae.useCallback(async()=>{s(!0);try{const r=await df(),a=Object.fromEntries(Object.entries(r).sort((u,l)=>new Date(u[1].timestamp)-new Date(l[1].timestamp)));t(a)}catch(r){console.error("Error loading initial data:",r)}finally{s(!1)}},[]);return Ae.useEffect(()=>{h()},[h]),{stimuli:e,isLoading:n,handleNewMessage:c,handleDiscardStimuli:o,loadInitialData:h}},LE=()=>{const[e,t]=Ae.useState(null),{stimuli:n,isLoading:s,handleNewMessage:c,handleDiscardStimuli:o}=bE();Ae.useEffect(()=>{const r=u=>{c(u.detail)},a=document.querySelector(".stimuli-page");if(a)return a.addEventListener("newMessage",r),()=>{a.removeEventListener("newMessage",r)}},[c]);const h=e?n[e]:null;return le.jsxs("div",{className:"stimuli-page",children:[le.jsxs("div",{className:"page-header",children:[le.jsx("h2",{children:"Stimuli"}),le.jsx("button",{className:"button",onClick:o,disabled:s,children:"Discard All Stimuli"})]}),le.jsxs("div",{className:"stimuli-content",children:[le.jsx(vE,{stimuli:n,selectedStimulusId:e,onSelectStimulus:t}),le.jsx(PE,{selectedStimulus:h})]}),s&&le.jsx("div",{className:"loading-overlay",children:"Loading..."})]})},UE=()=>{const{agents:e,filteredAgents:t,searchFilter:n,setSearchFilter:s}=Im(),[c,o]=Ae.useState(null);Ae.useEffect(()=>{Object.keys(e).length>0&&!c&&o(e[Object.keys(e)[0]])},[e,c]);const h=r=>{o(e[r])};return le.jsxs("div",{className:"capabilities-page",children:[le.jsxs("div",{className:"page-header",children:[le.jsx("h2",{children:"Solace Agent Mesh Agents"}),le.jsx("input",{type:"text",placeholder:"Search agents...",value:n,onChange:r=>s(r.target.value),className:"search-input"})]}),le.jsxs("div",{className:"capabilities-content",children:[le.jsx("div",{className:"agent-grid",children:Object.entries(t).length===0?le.jsx("p",{className:"no-agents",children:"No agents registered yet. They will appear here as they register."}):Object.entries(t).map(([r,a])=>le.jsxs("div",{className:`agent-card ${(c==null?void 0:c.agent_name)===r?"selected":""}`,onClick:()=>h(r),children:[le.jsx("h3",{children:r}),le.jsx("p",{children:a.description||"No description available"}),le.jsxs("div",{className:"agent-card-footer",children:[le.jsx("div",{className:"actions-count",children:le.jsxs("span",{children:[(a.actions||[]).length," actions"]})}),le.jsx("div",{className:"actions-preview",children:(a.actions||[]).slice(0,300).map((u,l)=>u&&le.jsx("span",{className:"action-name-preview",children:Object.keys(u)[0]},l))})]})]},r))}),c&&le.jsxs("div",{className:"agent-details",children:[le.jsx("h2",{children:c.agent_name}),le.jsx("p",{className:"agent-description",children:c.description||"No description available"}),le.jsxs("div",{className:"actions-list",children:[le.jsx("h3",{children:"Actions"}),(c.actions||[]).map(r=>{const a=Object.keys(r)[0],u=r[a];return le.jsxs("details",{className:"action-details",children:[le.jsx("summary",{children:a}),le.jsxs("div",{className:"action-content",children:[le.jsx("p",{children:u.desc}),le.jsx("h4",{children:"Parameters:"}),le.jsx("ul",{children:u.params.map((l,d)=>le.jsx("li",{children:typeof l=="object"?JSON.stringify(l):l},d))}),u.examples.length>0&&le.jsxs(le.Fragment,{children:[le.jsx("h4",{children:"Examples:"}),le.jsx("ul",{children:u.examples.map((l,d)=>le.jsx("li",{children:typeof l=="object"?JSON.stringify(l):l},d))})]}),le.jsx("h4",{children:"Required Scopes:"}),le.jsx("ul",{className:"scopes-list",children:u.required_scopes.map((l,d)=>le.jsx("li",{children:typeof l=="object"?JSON.stringify(l):l},d))})]})]},a)})]})]})]})]})},Rr=({label:e,value:t,onChange:n,type:s="text",required:c=!1})=>le.jsxs("div",{children:[le.jsxs("label",{children:[e,c&&le.jsx("span",{style:{color:"red"},children:"*"})]}),le.jsx("input",{type:s,value:t,onChange:n,required:c})]}),xE=({open:e,config:t,setConfig:n,onClose:s,isNewConfig:c,savedConfigs:o})=>{if(!e)return null;const h=r=>{const a=r.target.value;n(u=>({...u,connectionType:a}))};return le.jsxs("div",{className:"config-dialog",children:[le.jsxs("div",{className:"config-dialog-content",children:[le.jsx(Rr,{label:"Configuration Name",value:t.name||"",onChange:r=>n(a=>({...a,name:r.target.value})),required:!0}),le.jsxs("div",{children:[le.jsx("label",{children:"Connection Type"}),le.jsxs("select",{value:t.connectionType||"solace",onChange:h,children:[le.jsx("option",{value:"solace",children:"Solace Broker"}),le.jsx("option",{value:"websocket",children:"WebSocket"})]})]}),(t.connectionType||"solace")==="solace"?le.jsxs(le.Fragment,{children:[le.jsx(Rr,{label:"Solace URL",value:t.url||"",onChange:r=>n(a=>({...a,url:r.target.value}))}),le.jsx(Rr,{label:"VPN Name",value:t.vpnName||"",onChange:r=>n(a=>({...a,vpnName:r.target.value}))}),le.jsx(Rr,{label:"Username",value:t.userName||"",onChange:r=>n(a=>({...a,userName:r.target.value}))}),le.jsx(Rr,{label:"Password",value:t.password||"",type:"password",onChange:r=>n(a=>({...a,password:r.target.value}))}),le.jsx(Rr,{label:"Namespace",value:t.namespace||"",onChange:r=>n(a=>({...a,namespace:r.target.value}))})]}):le.jsx(Rr,{label:"WebSocket URL",value:t.websocketUrl||"",onChange:r=>n(a=>({...a,websocketUrl:r.target.value}))})]}),le.jsxs("div",{className:"config-dialog-buttons",children:[le.jsx("button",{className:"button",onClick:()=>s(!1),children:"Cancel"}),le.jsx("button",{className:"button button-info",onClick:()=>{if(!t.name){alert("Configuration Name is required");return}if(c&&o.some(r=>r.name===t.name)){alert("Configuration Name must be unique");return}s(!0)},children:c?"Save and Connect":"Connect"})]})]})},FE=({onSelect:e,onCreateNew:t,onCancel:n,onEdit:s,onDelete:c})=>{const[o,h]=Ae.useState([]),[r,a]=Ae.useState("");Ae.useEffect(()=>{const _=JSON.parse(localStorage.getItem("saved-configs")||"[]");h(_)},[]);const u=()=>{const _=o.find(p=>p.name===r);_&&e(_,!0)},l=()=>{const _=o.find(p=>p.name===r);_&&s(_)},d=()=>{window.confirm("Are you sure you want to delete this connection?")&&c(r)};return le.jsxs("div",{className:"connection-selector",children:[le.jsx("h2",{children:"Select a Connection"}),le.jsx("label",{htmlFor:"connection-select",children:"Saved Connections:"}),le.jsxs("select",{id:"connection-select",value:r,onChange:_=>a(_.target.value),children:[le.jsx("option",{value:"",children:"Select a connection"}),o.map((_,p)=>le.jsx("option",{value:_.name,children:_.name},p))]}),le.jsxs("div",{className:"button-group",children:[le.jsx("button",{onClick:u,disabled:!r,children:"Connect"}),le.jsx("button",{onClick:l,disabled:!r,children:"Edit"}),le.jsx("button",{onClick:d,disabled:!r,children:"Delete"})]}),le.jsxs("div",{className:"button-group secondary",children:[le.jsx("button",{onClick:t,children:"Create New"}),le.jsx("button",{onClick:n,children:"Cancel"})]})]})};var pf={exports:{}};/*! For license information please see solclient.js.LICENSE.txt */(function(e,t){(function(n,s){e.exports=s()})(Gf,()=>(()=>{var n={5237:(o,h,r)=>{o.exports=r(7847)},9783:(o,h,r)=>{const{Base64:a}=r(9692),{Bits:u}=r(9887),{Convert:l}=r(8076),{Hex:d}=r(8926),{Long:_}=r(7753);o.exports.Base64=a,o.exports.Bits=u,o.exports.Convert=l,o.exports.Hex=d,o.exports.Long=_},9692:(o,h,r)=>{var a=r(8287).hp;const u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,99,-1,-1,99,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,99,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];class d extends Error{}const _={base64_encode(m){let T="",y=0;do{const E=m.charCodeAt(y++),I=m.charCodeAt(y++),N=m.charCodeAt(y++),A=E>>2,L=(3&E)<<4|I>>4;let D=(15&I)<<2|N>>6,q=63&N;isNaN(I)?D=q=64:isNaN(N)&&(q=64),T+=u.charAt(A),T+=u.charAt(L),T+=u.charAt(D),T+=u.charAt(q)}while(y<m.length);return T},base64_decode(m){let T="",y=0;do{for(;l[m.charCodeAt(y)]>64;)y++;const E=l[m.charCodeAt(y++)],I=l[m.charCodeAt(y++)],N=l[m.charCodeAt(y++)],A=l[m.charCodeAt(y++)];if(E<0||I<0||N<0||A<0)throw new d("Invalid base64 character");const L=E<<2|I>>4,D=(15&I)<<4|N>>2,q=(3&N)<<6|A;T+=String.fromCharCode(L),N!==64&&(T+=String.fromCharCode(D)),A!==64&&(T+=String.fromCharCode(q))}while(y<m.length-3);return T}},p=typeof window>"u",f=typeof Blob<"u",S=a!==void 0&&(f||p)?{base64_encode:m=>a.from(m,"binary").toString("base64"),base64_decode:m=>a.from(m,"base64").toString("binary")}:{},C=typeof window<"u"?{base64_encode:window.btoa?m=>window.btoa(m):null,base64_decode:window.atob?m=>window.atob(m):null}:{},g={encode:C.base64_encode||S.base64_encode||_.base64_encode,decode:C.base64_decode||S.base64_decode||_.base64_decode};o.exports.Base64=g},9887:o=>{const h={get:(r,a,u)=>r>>>a&(1<<u)-1,set(r,a,u,l){const d=(1<<l)-1;return r&~(d<<u)|(a&d)<<u}};o.exports.Bits=h},8076:(o,h,r)=>{const a=r(5017),{ErrorSubcode:u,OperationError:l}=r(6706),d=r(8287).hp,_="\0\0",p="\0\0\0",f="\0\0\0\0",S=8192,C=32768;function g(E){const I=E.length,N=new ArrayBuffer(I),A=new Uint8Array(N,0,I);for(let L=0;L<I;L++)A[L]=E.charCodeAt(L);return A}function m(E){if(E===0)return f;if(E>0){if(E<256)return p+String.fromCharCode(E);if(E<65536)return _+String.fromCharCode(E>>8)+String.fromCharCode(255&E)}return String.fromCharCode(E>>24&255)+String.fromCharCode(E>>16&255)+String.fromCharCode(E>>8&255)+String.fromCharCode(255&E)}function T(E){return 16777216*E.charCodeAt(0)+(E.charCodeAt(1)<<16)+(E.charCodeAt(2)<<8)+E.charCodeAt(3)}const y={arrayBufferToString:function(E){if(!E)return"";const I=E.byteLength,N=new Uint8Array(E);if(I<C)return String.fromCharCode.apply(null,N);let A=0,L="";for(;A<I;)L+=String.fromCharCode.apply(null,N.subarray(A,A+C)),A+=C;return L},stringToArrayBuffer:function(E){return g(E).buffer},uint8ArrayToString:function(E,I=void 0){const N=E.byteLength,A=new Uint8Array(d.from(E));let L="";for(let D=0;D<N;D++)I&&I.toLowerCase()==="hex"?L+=A[D].toString(16).padStart(2,"0"):L+=String.fromCharCode(255&A[D]);return L},stringToUint8Array:g,hexStringToUint8Array:function(E){return E==null?new Uint8Array:Uint8Array.from(d.from(E,"hex"))},int8ToStr:function(E){return String.fromCharCode(255&E)},strToInt8:function(E){return 255&E.charCodeAt(0)},int16ToStr:function(E){return String.fromCharCode(E>>8&255)+String.fromCharCode(255&E)},strToInt16:function(E){return(E.charCodeAt(0)<<8)+E.charCodeAt(1)},int24ToStr:function(E){return String.fromCharCode(E>>16&255)+String.fromCharCode(E>>8&255)+String.fromCharCode(255&E)},strToInt24:function(E){return(E.charCodeAt(0)<<16)+(E.charCodeAt(1)<<8)+E.charCodeAt(2)},int32ToStr:m,strToInt32:function(E){return(E.charCodeAt(0)<<24)+(E.charCodeAt(1)<<16)+(E.charCodeAt(2)<<8)+E.charCodeAt(3)},strToUInt32:T,int64ToStr:function(E){if(typeof E!="number")return m(E.high)+m(E.low);if(E>=0){if(E<256)return f+p+String.fromCharCode(E);if(E<65536)return f+_+String.fromCharCode(E>>8)+String.fromCharCode(255&E);if(E<4294967296)return f+(String.fromCharCode(E>>24&255)+String.fromCharCode(E>>16&255)+String.fromCharCode(E>>8&255)+String.fromCharCode(255&E))}return String.fromCharCode(E>>56&255)+String.fromCharCode(E>>48&255)+String.fromCharCode(E>>40&255)+String.fromCharCode(E>>32&255)+String.fromCharCode(E>>24&255)+String.fromCharCode(E>>16&255)+String.fromCharCode(E>>8&255)+String.fromCharCode(255&E)},strToUInt64:function(E){return a.fromBits(T(E.substr(4,4)),T(E.substr(0,4)),!0)},byteArrayToStr:function(E){const I=E.length;if(I<S)return String.fromCharCode.apply(null,E);let N=0,A="";for(;N<I;)A+=String.fromCharCode.apply(null,E.slice(N,N+S)),N+=S;return A},strToByteArray:function(E){const I=[];let N;for(N=0;N<E.length;N++)I[N]=E.charCodeAt(N);return I},strToHexArray:function(E){return Array.prototype.map.call(E.split(""),function(I){return I.charCodeAt(0).toString(16)})},ucs2ToUtf8:function(E){return unescape(encodeURIComponent(E))},utf8ToUcs2:function(E){return decodeURIComponent(escape(E))},anythingToBuffer:function(E){if(d.isBuffer(E))return E;if(typeof E=="string")return d.from(E,"latin1");if(E instanceof ArrayBuffer)return d.from(E);if(E.buffer instanceof ArrayBuffer&&typeof E.byteLength=="number"&&typeof E.byteOffset=="number")return E.byteOffset===0&&E.byteLength===E.buffer.byteLength?d.from(E.buffer):d.from(E.buffer,E.byteOffset,E.byteLength);throw new l("Parameter value failed validation",u.PARAMETER_OUT_OF_RANGE,"Expecting Buffer/Uint8Array, also accepting string, ArrayBuffer, any TypedArray, or DataView.")}};o.exports.Convert=y},8926:o=>{function h(a){if(typeof a!="number")return"";const u=a.toString(16);return u.length<2?`0${u}`:u}const r={formatHexString:function(a){return typeof a=="number"?`0x${h(a)}`:typeof a=="object"&&Array.isArray(a)?a.map(h).join():typeof a=="string"?Array.prototype.map.call(a,(u,l)=>h(a.charCodeAt(l))).join(""):null}};o.exports.Hex=r},7753:(o,h,r)=>{o.exports.Long=r(5017)},1081:(o,h,r)=>{const a=r(9783),u=r(199),l=r(9620),d=r(6706),_=r(7444),p=r(4386),f=r(7414),S=r(2694),C=r(6247),g=r(2288),m=r(5898),T=r(769),y=r(5024),E=r(3450),I=r(2689),N=r(6663),A=r(8205),L=r(968),D=r(802);o.exports={Convert:a,Debug:u,Destination:l,Error:d,ESKit:_,Factory:p,FSM:f,Log:S,Message:C,MessageTracing:g,Publisher:m,SDT:T,Session:y,SMF:E,SolcacheSession:I,TestEnv:N,Transport:A,Util:L,Validate:D}},7847:(o,h,r)=>{const a=r(4386),{SolclientFactory:u,SolclientFactoryProfiles:l,SolclientFactoryProperties:d}=a,{Long:_}=r(9783),{Destination:p,DestinationType:f,Topic:S}=r(9620),{ErrorSubcode:C,NotImplementedError:g,OperationError:m,RequestError:T,RequestEventCode:y}=r(6706),{makeIterator:E}=r(7444),{ConsoleLogImpl:I,LogImpl:N,LogLevel:A}=r(2694),{Message:L,MessageCacheStatus:D,MessageDeliveryModeType:q,MessageDumpFlag:Y,MessageOutcome:Q,MessageType:W,MessageUserCosType:x,ReplicationGroupMessageId:k}=r(6247),{MessageConsumer:J,MessageConsumerAcknowledgeMode:F,MessageConsumerEventName:$,MessageConsumerProperties:R,QueueBrowser:B,QueueBrowserEventName:M,QueueBrowserProperties:re}=r(178),{ReplayStartLocation:se,ReplayStartLocationBeginning:fe}=r(9309),{MessagePublisherAcknowledgeMode:ce,MessagePublisherProperties:Te}=r(5898),{Baggage:Ee,TraceContext:he,TraceContextSetter:ge}=r(2288),{AbstractQueueDescriptor:X,QueueAccessType:ae,QueueDescriptor:ee,QueueDiscardBehavior:Re,QueuePermissions:me,QueueProperties:Pe,QueueType:H,EndpointNameComplaint:Z}=r(9631),{SDTField:te,SDTFieldType:ie,SDTMapContainer:j,SDTStreamContainer:Oe,SDTUnsupportedValueError:v,SDTValueErrorSubcode:P}=r(769),{AuthenticationScheme:O,CapabilityType:U,MessageRxCBInfo:V,MutableSessionProperty:z,Session:ne,SessionEvent:de,SessionEventCBInfo:_e,SessionEventCode:we,SessionProperties:oe,SessionState:Se,SslDowngrade:Ce}=r(5024),{CacheCBInfo:je,CacheLiveDataAction:Be,CacheRequestResult:ct,CacheReturnCode:Gt,CacheReturnSubcode:Ne,CacheSession:et,CacheSessionProperties:xe}=r(2689),{StatType:He}=r(5747),{TransportError:at,TransportProtocol:Ue}=r(8205),{Version:At}=r(968),qe={AbstractQueueDescriptor:X,AuthenticationScheme:O,Baggage:Ee,CacheCBInfo:je,CacheLiveDataAction:Be,CacheRequestResult:ct,CacheReturnCode:Gt,CacheReturnSubcode:Ne,CacheSession:et,CacheSessionProperties:xe,CapabilityType:U,ConsoleLogImpl:I,Destination:p,DestinationType:f,ErrorSubcode:C,LogImpl:N,LogLevel:A,Long:_,Message:L,MessageCacheStatus:D,MessageConsumer:J,MessageConsumerAcknowledgeMode:F,MessageConsumerEventName:$,MessageConsumerProperties:R,MessageDeliveryModeType:q,MessageDumpFlag:Y,MessageOutcome:Q,MessagePublisherAcknowledgeMode:ce,MessagePublisherProperties:Te,MessageRxCBInfo:V,MessageType:W,MessageUserCosType:x,MutableSessionProperty:z,NotImplementedError:g,OperationError:m,QueueAccessType:ae,QueueBrowser:B,QueueBrowserEventName:M,QueueBrowserProperties:re,QueueDescriptor:ee,QueueDiscardBehavior:Re,QueuePermissions:me,QueueProperties:Pe,QueueType:H,EndpointNameComplaint:Z,ReplayStartLocation:se,ReplayStartLocationBeginning:fe,ReplicationGroupMessageId:k,RequestError:T,RequestEventCode:y,SDTField:te,SDTFieldType:ie,SDTMapContainer:j,SDTStreamContainer:Oe,SDTUnsupportedValueError:v,SDTValueErrorSubcode:P,Session:ne,SessionEvent:de,SessionEventCBInfo:_e,SessionEventCode:we,SessionProperties:oe,SessionState:Se,SolclientFactory:u,SolclientFactoryProfiles:l,SolclientFactoryProperties:d,SslDowngrade:Ce,StatType:He,Topic:S,TraceContext:he,TraceContextSetter:ge,TransportError:at,TransportProtocol:Ue,Version:At,makeIterator:E,_internal:r(1081)};Object.assign(o.exports,qe)},199:(o,h,r)=>{const{Debug:a}=r(8348);o.exports.Debug=a},8348:(o,h,r)=>{const a=(()=>{const l=[];for(let d=0;d<256;++d)l[d]=d<33||d>126?".":String.fromCharCode(d);return l})(),u={formatDumpBytes:function(l,d,_){const{StringBuffer:p,StringUtils:f}=r(968),{isEmpty:S,padLeft:C,padRight:g}=f;if(S(l))return null;const m=new p,T=new p,y=new p;let E=0;for(let I=0,N=l.length;I<N;++I){const A=l.charCodeAt(I);y.append(C(A.toString(16),2,"0")," "),T.append(a[A]||"."),E++,E===8&&y.append(" "),E!==16&&I!==l.length-1||(_>0&&m.append(g("",_," ")),m.append(g(y.toString(),54," ")),d&&m.append(T),m.append(`
|
|
68
|
+
`),y.clear(),T.clear(),E=0)}return m.toString()},parseSMFStream:function(l){const{Codec:{Decode:{decodeCompoundMessage:d}}}=r(3450),{LOG_WARN:_,LOG_ERROR:p}=r(2694);if(l===null)return void p("data null in debugParseSmfStream");let f=0;for(_(`parseSMFStream(): Starting parse, length ${l.length}`);f<l.length;){const S=d(l,f),C=S?S.smfHeader:null;if(!S||!C)return _("parseSMFStream(): couldn't decode message."),void _(`Position: ${f} length: ${l.length}`);_(`>> Pos(${f}) Protocol ${C.smf_protocol}, Length: ${C.messageLength}`),f+=C.messageLength}}};o.exports.Debug=u},9620:(o,h,r)=>{const{Destination:a}=r(5136),{DestinationFromNetwork:u}=r(1618),{DestinationType:l}=r(8805),{DestinationUtil:d}=r(617),{Parameter:_}=r(802),{Queue:p}=r(1435),{SolclientFactory:f}=r(4386),{Topic:S}=r(8335);f.createTopicDestination=f.createFactory(C=>(_.isString("topicName",C),S.createFromName(C))),f.createTopic=f.createFactory(C=>new S(C)),f.createDurableQueueDestination=f.createFactory(C=>(_.isString("queueName",C),p.createFromLocalName(C))),o.exports.Destination=a,o.exports.DestinationFromNetwork=u,o.exports.DestinationType=l,o.exports.DestinationUtil=d,o.exports.Queue=p,o.exports.Topic=S},1618:(o,h,r)=>{const{DestinationType:a}=r(8805),{DestinationUtil:u}=r(617),{Queue:l}=r(1435),{Topic:d}=r(8335),_="#P2P/QUE/";function p(S,C=void 0){if(S===null||S.length===0)return null;const g={name:S,bytes:C||u.encodeBytes(S)};if(S[0]==="#"){if(S.startsWith(_))return g.name=S.substr(9),g.type=a.QUEUE,g.offset=9,new l(g);if(S.startsWith("#P2P/QTMP/"))return g.name=S,g.type=a.TEMPORARY_QUEUE,g.offset=0,new l(g)}return new d(g)}const f={createDestinationFromBytes:function(S){return S===null||S.length===0?null:p(u.decodeBytes(S),S)},createDestinationFromName:p};o.exports.DestinationFromNetwork=f},8805:(o,h,r)=>{const{Enum:a}=r(7444),u={TOPIC:"topic",QUEUE:"queue",TEMPORARY_QUEUE:"temporary_queue"};o.exports.DestinationType=a.new(u),o.exports.DestinationType._setCanonical({TOPIC:u.TOPIC,QUEUE:u.QUEUE,TEMPORARY_QUEUE:u.TEMPORARY_QUEUE})},617:(o,h,r)=>{const a=r(4386),{Convert:u}=r(9783),{DestinationType:l}=r(8805),{LOG_ERROR:d}=r(2694),{SubscriptionInfo:_}=r(5456),{UUID:p,StringUtils:f}=r(968),{ucs2ToUtf8:S,utf8ToUcs2:C}=u,{ProfileBinding:g}=a,{toSafeChars:m,stripNullTerminate:T}=f,{ErrorSubcode:y,OperationError:E}=r(6706),I={[l.QUEUE]:"#P2P/QUE/",[l.TEMPORARY_QUEUE]:"#P2P/QTMP/"};function N(Q){return I[Q]||""}function A(Q,W){return new E(`Invalid ${Q}: ${W}`,y.INVALID_TOPIC_SYNTAX)}function L(Q,W,x,k=A.bind(null,Q)){let J;const F=x.length;if(F<1)return J=k("Too short (must be >= 1 character)."),{error:J};const $=W.length;if($>251)return J=k(`Too long (encoding must be <= 250 bytes); name is ${$-1} bytes: '${x}'`),{error:J};let R=!1;x.charAt(F-1)===">"&&(R=!0);for(let B=0;B<F;++B)switch(x.charAt(B)){case"/":if(B===0||B===F-1||x.charAt(B-1)==="/")return J=k(`Empty level(s) in '${x}'@${B}.`),{error:J};break;case"*":if(B<F-1&&x.charAt(B+1)!=="/")return J=k(`Illegal wildcard(s) in '${x}'@${B}.`),{error:J};R=!0}return{isWildcarded:R}}function D(Q){return g.value.topicUtf8Encode?`${S(Q)}\0`:`${Q}\0`}function q(Q,W){const x=N(Q),k=x.length,J=x+W;return{bytes:D(J),offset:k,networkName:J}}const Y={createPrefix:N,createTemporaryName:function(Q,W,x){const k=x||p.generateUUID();switch(Q){case l.TOPIC:return`#P2P/TTMP/${W}/${k}`;case l.TEMPORARY_QUEUE:return`#P2P/QTMP/${W}/${k}`;default:d("Unknown/invalid destination type",l.describe(Q))}},decodeBytes:function(Q){return T(g.value.topicUtf8Encode?C(Q):Q)},encode:q,encodeBytes:D,legacyValidate:L,toSafeChars:m,validateAndEncode:function(Q,W,x=A.bind(null,Q)){const{bytes:k,offset:J}=q(Q,W),{error:F,isWildcarded:$}=L(Q,k,W,x);let R=F,B={};if(B.isWildcarded=$,R||Object.keys(I).some(M=>{const re=I[M];return!!W.startsWith(re)&&(R=x(`Reserved prefix '${re}' found at start of '${W}'`),!0)}),!R){const{error:M,subInfo:re}=_.parseFromName(W,Q);R=M,B=re}return{bytes:k,offset:J,error:R,isWildcarded:$,subscriptionInfo:B}}};o.exports.DestinationUtil=Y},5136:(o,h,r)=>{var a=r(2195);const{DestinationType:u}=r(8805),{DestinationUtil:l}=r(617);class d{constructor(p,f=u.TOPIC){if(typeof p=="object")this._name=p.name,this._type=p.type,this._bytes=p.bytes,this._offset=p.offset,p.isValidated?(this._isValidated=!0,this._isWildcarded=p.isWildcarded,this._subscriptionInfo=p.subscriptionInfo||{}):(this._isValidated=!1,this._subscriptionInfo={});else{this._name=p,this._type=f;const S=l.encode(f,p);this._bytes=S.bytes,this._offset=S.offset,this._isValidated=!1,this._subscriptionInfo={}}}getName(){return this._name}get name(){return this.getName()}getType(){return this._type}get type(){return this.getType()}getBytes(){return this._bytes}get bytes(){return this.getBytes()}getOffset(){return this._offset}get offset(){return this.getOffset()}validate(){if(this._isValidated){if(this._error)throw this._error;return}const{error:p,isWildcarded:f}=l.legacyValidate(this.type,this.bytes,this.name);if(this._isValidated=!0,p)throw this._error=p,p;this._isWildcarded=f}isWildcarded(){return this.validate(),this._isWildcarded}getSubscriptionInfo(){return this._subscriptionInfo||{}}toString(){return a(this)}equals(p){return p instanceof d&&this.toString().valueOf()===p.toString().valueOf()}}o.exports.Destination=d},1435:(o,h,r)=>{const a=r(617),{assert:u}=r(7444),{Destination:l}=r(5136),{DestinationType:d}=r(8805);class _ extends l{constructor(f){u(f.name,"Queue name not supplied"),u(f.type===d.QUEUE||f.type===d.TEMPORARY_QUEUE,"Queue spec.type is invalid"),u(f.bytes,"Queue spec missing bytes"),u(f.offset!==void 0,"Queue spec missing offset"),super(f)}getOffset(){return this._offset}get offset(){return this.getOffset()}inspect(){return`[Queue ${this.getName()}]`}static createFromLocalName(f){const S=a.DestinationUtil.validateAndEncode(d.QUEUE,f);if(S.error)throw S.error;return new _({name:f,type:d.QUEUE,isValidated:!0,bytes:S.bytes,offset:S.offset,isWildcarded:S.isWildcarded,subscriptionInfo:S.subscriptionInfo})}}o.exports.Queue=_},5456:(o,h,r)=>{var a=r(2195);const{DestinationType:u}=r(8805),{ErrorSubcode:l,OperationError:d}=r(6706),_={[u.TOPIC]:{_layers:[function(S,C,g,m,T){let y=m;return C.length-y>10&&!T.isNoExport&&C.startsWith("#noexport/",y)?(y+=10,T.isNoExport=!0):T.isNoExport=!1,{error:void 0,index:y,result:T}},function(S,C,g,m,T,y){let E,I,N=m,A=-1;return C.length-N>7&&!T.isShare&&C.startsWith("#share/",m)&&C.length-(N+7)>2?(N+=7,A=N,N=C.indexOf("/",A),N>0?(I=C.substring(A,N),N+=1,T.isShare=!0,T.shareGroup=I,T.dispatchTopicIndex=N):(E=y(`Illegal share Group in '${C}'@${A}.`),T.isShare=!0)):T.isShare=!1,{error:E,index:N,result:T}}],parse:function(S,C,g,m,T){const{error:y,result:E}=function(I,N,A,L,D,q){const Y=I.length||0;let Q,W=0,x=D||{};for(let k=0;k<Y;++k){const{error:J,index:F,result:$}=I[k](N,A,L,W,x,q);if(W=F,x=$,Q=J,Q)break}return{error:Q,result:x}}(this._layers,S,C,g,m,T);return{error:y,result:E}}}};function p(S,C){return new d(`Invalid ${S}: ${C}`,l.INVALID_TOPIC_SYNTAX)}class f{constructor(C){this._name=C,this._isShare=!1,this._isNoExport=!1,this._dispatchTopicIndex=-1,this._shareGroup=null}getName(){return this._name}get name(){return this.getName()}get isShare(){return this._isShare}set isShare(C){this._isShare=C}get isNoExport(){return this._isNoExport}set isNoExport(C){this._isNoExport=C}get dispatchTopicIndex(){return this._dispatchTopicIndex<0?0:this._dispatchTopicIndex}set dispatchTopicIndex(C){this._dispatchTopicIndex=C<0?-1:C}get shareGroup(){return this.isShare?this._shareGroup:null}set shareGroup(C){this.isShare&&(this._shareGroup=C)}toString(){return a(this)}static parseFromName(C,g=u.TOPIC){let m=new f(C),T=null;const y=_[g];if(y){const{error:E,result:I}=y.parse(g,C,null,m,p.bind(null,g));m=I,T=E}return{error:T,subInfo:m}}}o.exports.SubscriptionInfo=f},8335:(o,h,r)=>{const a=r(617),{Destination:u}=r(5136),{DestinationType:l}=r(8805);class d extends u{constructor(p){typeof p=="object"?super({type:l.TOPIC,name:p.name,bytes:p.bytes,offset:p.offset,isValidated:p.isValidated,isWildcarded:p.isWildcarded,subscriptionInfo:p.subscriptionInfo}):super(p,l.TOPIC)}inspect(){return`[Topic ${this.getName()}]`}static createFromName(p){const f=a.DestinationUtil.validateAndEncode(l.TOPIC,p);if(f.error)throw f.error;return new d({name:p,isValidated:!0,bytes:f.bytes,offset:f.offset,isWildcarded:f.isWildcarded,subscriptionInfo:f.subscriptionInfo})}}o.exports.Topic=d},6663:(o,h,r)=>{function a(u){throw new Error("Test environment will not override build environment")}a.target=()=>a(),o.exports=a},6706:(o,h,r)=>{const{ErrorResponseSubcodeMapper:a}=r(5424),{ErrorSubcode:u}=r(5129),{NotImplementedError:l}=r(5749),{OperationError:d}=r(5192),{RequestError:_}=r(8916),{RequestEventCode:p}=r(8309),{SolaceError:f}=r(3922);o.exports.ErrorResponseSubcodeMapper=a,o.exports.ErrorSubcode=u,o.exports.NotImplementedError=l,o.exports.OperationError=d,o.exports.RequestError=_,o.exports.RequestEventCode=p,o.exports.SolaceError=f},5424:(o,h,r)=>{const{ErrorSubcode:a}=r(5129),{makeMap:u}=r(7444),l=a,d=u(400,u("client name parse error",l.CLIENT_NAME_INVALID,"document is too large",l.MESSAGE_TOO_LARGE,"inactivity timeout",l.INACTIVITY_TIMEOUT,"max num subscriptions exceeded",l.SUBSCRIPTION_TOO_MANY,"message too long",l.MESSAGE_TOO_LARGE,"nolocal discard",l.NOLOCAL_DISCARD,"not enough space",l.OUT_OF_RESOURCES,"subscription already exists",l.SUBSCRIPTION_ALREADY_PRESENT,"subscription attributes conflict with existing subscription",l.SUBSCRIPTION_ATTRIBUTES_CONFLICT,"subscription not found",l.SUBSCRIPTION_NOT_FOUND,"subscription parse error",l.SUBSCRIPTION_INVALID,"topic parse error",l.INVALID_TOPIC_SYNTAX,"unknown transport session identifier",l.UNKNOWN_TRANSPORT_SESSION_ID,"xml parse error",l.XML_PARSE_ERROR,"unsupported ssl downgrade value",l.LOGIN_FAILURE),401,u("",l.LOGIN_FAILURE),403,u("basic authentication is shutdown",l.BASIC_AUTHENTICATION_IS_SHUTDOWN,"client certificate authentication is shutdown",l.CLIENT_CERTIFICATE_AUTHENTICATION_IS_SHUTDOWN,"client name already in use",l.CLIENT_NAME_ALREADY_IN_USE,"client username is shutdown",l.CLIENT_USERNAME_IS_SHUTDOWN,"dynamic clients not allowed",l.DYNAMIC_CLIENTS_NOT_ALLOWED,"invalid virtual router address",l.INVALID_VIRTUAL_ADDRESS,"forbidden",l.CLIENT_ACL_DENIED,"message vpn not allowed",l.MESSAGE_VPN_NOT_ALLOWED,"publish acl denied",l.PUBLISH_ACL_DENIED,"replication is standby",l.REPLICATION_IS_STANDBY,"selector does not match",l.SELECTOR_DOES_NOT_MATCH,"subscription acl denied",l.SUBSCRIPTION_ACL_DENIED,"subscription does not match",l.SUBSCRIPTION_DOES_NOT_MATCH,"compression is shutdown",l.LOGIN_FAILURE,"shared subscriptions not supported on topic endpoints",l.SHARED_SUBSCRIPTIONS_ENDPOINT_NOT_ALLOWED,"shared subscriptions not supported on queues",l.SHARED_SUBSCRIPTIONS_ENDPOINT_NOT_ALLOWED,"shared subscription permission denied",l.SHARED_SUBSCRIPTIONS_NOT_ALLOWED),404,u("",l.LOGIN_FAILURE),503,u("low priority msg congestion",l.LOW_PRIORITY_MSG_CONGESTION,"message vpn unavailable",l.MESSAGE_VPN_UNAVAILABLE,"replication is standby",l.REPLICATION_IS_STANDBY,"service unavailable",l.GM_UNAVAILABLE,"spool over quota",l.SPOOL_OVER_QUOTA,"subscriber delete in progress",l.CLIENT_DELETE_IN_PROGRESS,"too many clients",l.TOO_MANY_CLIENTS,"too many connections for vpn",l.TOO_MANY_CLIENTS,"max message usage exceeded",l.MAX_MESSAGE_USAGE_EXCEEDED),507,u("ad not ready",l.GM_NOT_READY)),_=u("PARENT",d,400,u("already bound",l.ALREADY_BOUND,"endpoint already exists",l.ENDPOINT_ALREADY_EXISTS,"subscription already exists",l.SUBSCRIPTION_ALREADY_PRESENT,"already exists",l.ENDPOINT_ALREADY_EXISTS,"endpoint property mismatch",l.ENDPOINT_PROPERTY_MISMATCH,"invalid durable topic endpoint name",l.INVALID_DTE_NAME,"invalid selector",l.INVALID_SELECTOR,"invalid topic name",l.INVALID_TOPIC_NAME_FOR_TOPIC_ENDPOINT,"invalid queue or topic endpoint durability",l.INVALID_QUEUE_OR_TOPIC_ENDPOINT_DURABILITY,"queue not found",l.QUEUE_NOT_FOUND,"quota out of range",l.QUOTA_OUT_OF_RANGE,"unknown flow name",l.UNKNOWN_FLOW_NAME,"unsubscribe not allowed",l.UNSUBSCRIBE_NOT_ALLOWED_CLIENTS_BOUND,"invalid queue name",l.INVALID_QUEUE_NAME,"invalid topic endpoint name",l.INVALID_TE_NAME,"message size out of range",l.MESSAGE_SIZE_OUT_OF_RANGE,"unsupported permissions",l.UNSUPPORTED_PERMISSIONS),403,u("permission not allowed",l.PERMISSION_NOT_ALLOWED,"client initiated replay not allowed on non-exclusive topic endpoint",l.CLIENT_INITIATED_REPLAY_NON_EXCLUSIVE_NOT_ALLOWED,"client initiated replay not allowed on non-exclusive queue",l.CLIENT_INITIATED_REPLAY_NON_EXCLUSIVE_NOT_ALLOWED,"client initiated replay from inactive flow not allowed",l.CLIENT_INITIATED_REPLAY_INACTIVE_FLOW_NOT_ALLOWED,"client initiated replay from browser flow not allowed",l.CLIENT_INITIATED_REPLAY_BROWSER_FLOW_NOT_ALLOWED,"replay not supported on temporary queue",l.REPLAY_TEMPORARY_NOT_SUPPORTED,"replay not supported on anonymous queue",l.REPLAY_ANONYMOUS_QUEUE_NOT_SUPPORTED,"replay not supported on anonymous queue without subscriptions",l.REPLAY_ANONYMOUS_QUEUE_WITHOUT_SUBSCRIPTIONS_NOT_SUPPORTED,"unknown start location type",l.UNKNOWN_START_LOCATION_TYPE,"mismatched endpoint error id",l.MISMATCHED_ENDPOINT_ERROR_ID,"replay start message unavailable",l.REPLAY_START_MESSAGE_NOT_AVAILABLE,"browsing not supported on partitioned queue",l.PARTITIONED_QUEUE_BROWSING_NOT_SUPPORTED,"selectors not supported on partitioned queue",l.PARTITIONED_QUEUE_SELECTORS_NOT_SUPPORTED),503,u("durable topic endpoint shutdown",l.TOPIC_ENDPOINT_SHUTDOWN,"endpoint shutdown",l.TOPIC_ENDPOINT_SHUTDOWN,"max clients exceeded for durable topic endpoint",l.MAX_CLIENTS_FOR_TE,"max clients exceeded for topic endpoint",l.MAX_CLIENTS_FOR_TE,"max clients exceeded for queue",l.MAX_CLIENTS_FOR_QUEUE,"no more non-durable queue or topic endpoint",l.NO_MORE_NON_DURABLE_QUEUE_OR_TOPIC_ENDPOINT,"no subscription match",l.NO_SUBSCRIPTION_MATCH,"queue shutdown",l.QUEUE_SHUTDOWN,"te shutdown",l.TOPIC_ENDPOINT_SHUTDOWN,"unknown durable topic endpoint",l.UNKNOWN_TOPIC_ENDPOINT_NAME,"unknown queue",l.UNKNOWN_QUEUE_NAME,"replay disabled",l.REPLAY_DISABLED,"replay cancelled",l.REPLAY_CANCELLED,"replay message unavailable",l.REPLAY_MESSAGE_UNAVAILABLE,"replay started",l.REPLAY_STARTED,"replayed message rejected by topic endpoint",l.REPLAY_MESSAGE_REJECTED,'replayed message rejected by queue"',l.REPLAY_MESSAGE_REJECTED,"replay log modified",l.REPLAY_LOG_MODIFIED,"mismatched endpoint error id",l.MISMATCHED_ENDPOINT_ERROR_ID,"out of replay resources",l.OUT_OF_REPLAY_RESOURCES,"topic or selector modified on durable topic endpoint",l.TOPIC_OR_SELECTOR_MODIFIED_ON_DURABLE_TOPIC_ENDPOINT,"replay failed",l.REPLAY_FAILED,"replay start time not available",l.REPLAY_START_TIME_NOT_AVAILABLE,"replay start message unavailable",l.REPLAY_START_MESSAGE_NOT_AVAILABLE,"sync replication ineligible",l.SYNC_REPLICATION_INELIGIBLE,"max endpoints exceeded",l.MAX_ENDPOINTS_EXCEEDED,"copy-from queue template missing",l.COPY_FROM_QUEUE_TEMPLATE_MISSING,"copy-from topic-endpoint template missing",l.COPY_FROM_TE_TEMPLATE_MISSING),507,u("assured delivery not ready",l.ASSURED_DELIVERY_NOT_READY));function p(C,g,m){if(g===200)return 0;const T=C[g]||{},y=(m||"").toLowerCase(),E=Object.keys(T).find(I=>I===y||y.indexOf(I)>=0);return E?T[E]:T[""]?T[""]:C.PARENT?p(C.PARENT,g,m):void 0}function f(C,g,m){const T=p(C,g,m);return T===void 0?l.UNKNOWN_ERROR:T}const S={getErrorSubcode:(C,g)=>f(d,C,g),getADErrorSubcode:(C,g)=>f(_,C,g)};o.exports.ErrorResponseSubcodeMapper=S},5129:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.ErrorSubcode=a.new({UNKNOWN_ERROR:4294967295,NO_ERROR:0,SESSION_NOT_CONNECTED:2,INVALID_SESSION_OPERATION:3,INVALID_OPERATION:3,TIMEOUT:4,MESSAGE_VPN_NOT_ALLOWED:5,MESSAGE_VPN_UNAVAILABLE:6,CLIENT_USERNAME_IS_SHUTDOWN:7,DYNAMIC_CLIENTS_NOT_ALLOWED:8,CLIENT_NAME_ALREADY_IN_USE:9,CLIENT_NAME_INVALID:10,CLIENT_DELETE_IN_PROGRESS:11,TOO_MANY_CLIENTS:12,LOGIN_FAILURE:13,INVALID_VIRTUAL_ADDRESS:14,CLIENT_ACL_DENIED:15,SUBSCRIPTION_ACL_DENIED:16,PUBLISH_ACL_DENIED:17,PARAMETER_OUT_OF_RANGE:18,PARAMETER_CONFLICT:19,PARAMETER_INVALID_TYPE:20,INTERNAL_ERROR:21,INSUFFICIENT_SPACE:22,OUT_OF_RESOURCES:23,PROTOCOL_ERROR:24,COMMUNICATION_ERROR:25,KEEP_ALIVE_FAILURE:26,TOPIC_MISSING:28,INVALID_TOPIC_SYNTAX:31,MESSAGE_TOO_LARGE:32,XML_PARSE_ERROR:33,SUBSCRIPTION_ALREADY_PRESENT:34,SUBSCRIPTION_NOT_FOUND:35,SUBSCRIPTION_INVALID:36,SUBSCRIPTION_ERROR_OTHER:37,SUBSCRIPTION_TOO_MANY:38,SUBSCRIPTION_ATTRIBUTES_CONFLICT:39,NO_LOCAL_NOT_SUPPORTED:40,DATA_ERROR_OTHER:42,CREATE_XHR_FAILED:43,CONNECTION_ERROR:44,DATA_DECODE_ERROR:45,INACTIVITY_TIMEOUT:46,UNKNOWN_TRANSPORT_SESSION_ID:47,AD_MESSAGING_NOT_SUPPORTED:48,CREATE_WEBSOCKET_FAILED:49,REPLICATION_IS_STANDBY:50,BASIC_AUTHENTICATION_IS_SHUTDOWN:51,CLIENT_CERTIFICATE_AUTHENTICATION_IS_SHUTDOWN:52,GM_UNAVAILABLE:100,UNKNOWN_FLOW_NAME:111,ALREADY_BOUND:112,INVALID_TOPIC_NAME_FOR_TOPIC_ENDPOINT:113,UNKNOWN_QUEUE_NAME:114,UNKNOWN_TOPIC_ENDPOINT_NAME:115,MAX_CLIENTS_FOR_QUEUE:116,MAX_CLIENTS_FOR_TE:117,UNEXPECTED_UNBIND:118,QUEUE_NOT_FOUND:119,SPOOL_OVER_QUOTA:120,QUEUE_SHUTDOWN:121,TOPIC_ENDPOINT_SHUTDOWN:122,NO_MORE_NON_DURABLE_QUEUE_OR_TOPIC_ENDPOINT:123,ENDPOINT_ALREADY_EXISTS:124,PERMISSION_NOT_ALLOWED:125,INVALID_SELECTOR:126,MAX_MESSAGE_USAGE_EXCEEDED:127,ENDPOINT_PROPERTY_MISMATCH:128,NO_SUBSCRIPTION_MATCH:129,MESSAGE_DELIVERY_MODE_MISMATCH:130,MESSAGE_ALREADY_ACKNOWLEDGED:131,SUBSCRIPTION_DOES_NOT_MATCH:133,SELECTOR_DOES_NOT_MATCH:134,INVALID_DTE_NAME:135,UNSUBSCRIBE_NOT_ALLOWED_CLIENTS_BOUND:136,CALLBACK_ERROR:137,NOLOCAL_DISCARD:138,GM_NOT_READY:140,LOW_PRIORITY_MSG_CONGESTION:141,QUOTA_OUT_OF_RANGE:142,FAILED_LOADING_TRUSTSTORE:143,FAILED_LOADING_CERTIFICATE_AND_KEY:144,UNRESOLVED_HOSTS:145,REPLAY_NOT_SUPPORTED:146,REPLAY_DISABLED:147,CLIENT_INITIATED_REPLAY_NON_EXCLUSIVE_NOT_ALLOWED:148,CLIENT_INITIATED_REPLAY_INACTIVE_FLOW_NOT_ALLOWED:149,CLIENT_INITIATED_REPLAY_BROWSER_FLOW_NOT_ALLOWED:150,REPLAY_TEMPORARY_NOT_SUPPORTED:151,UNKNOWN_START_LOCATION_TYPE:152,REPLAY_CANCELLED:153,REPLAY_MESSAGE_UNAVAILABLE:154,REPLAY_START_TIME_NOT_AVAILABLE:155,REPLAY_MESSAGE_REJECTED:156,REPLAY_LOG_MODIFIED:157,MISMATCHED_ENDPOINT_ERROR_ID:158,OUT_OF_REPLAY_RESOURCES:159,TOPIC_OR_SELECTOR_MODIFIED_ON_DURABLE_TOPIC_ENDPOINT:160,REPLAY_FAILED:161,REPLAY_STARTED:162,COMPRESSED_TLS_NOT_SUPPORTED:163,SHARED_SUBSCRIPTIONS_NOT_SUPPORTED:164,SHARED_SUBSCRIPTIONS_NOT_ALLOWED:165,SHARED_SUBSCRIPTIONS_ENDPOINT_NOT_ALLOWED:166,REPLAY_START_MESSAGE_NOT_AVAILABLE:167,MESSAGE_ID_NOT_COMPARABLE:168,REPLAY_ANONYMOUS_QUEUE_NOT_SUPPORTED:169,PARTITIONED_QUEUE_BROWSING_NOT_SUPPORTED:170,PARTITIONED_QUEUE_SELECTORS_NOT_SUPPORTED:171,REPLAY_ANONYMOUS_QUEUE_WITHOUT_SUBSCRIPTIONS_NOT_SUPPORTED:172,SYNC_REPLICATION_INELIGIBLE:173,INVALID_QUEUE_OR_TOPIC_ENDPOINT_DURABILITY:174,INVALID_QUEUE_NAME:175,INVALID_TE_NAME:176,MESSAGE_SIZE_OUT_OF_RANGE:177,UNSUPPORTED_PERMISSIONS:178,MAX_ENDPOINTS_EXCEEDED:179,ASSURED_DELIVERY_NOT_READY:180,COPY_FROM_QUEUE_TEMPLATE_MISSING:181,COPY_FROM_TE_TEMPLATE_MISSING:182})},5749:(o,h,r)=>{const{SolaceError:a}=r(3922);class u extends a{constructor(d){super("NotImplementedError",d||"",u)}}o.exports.NotImplementedError=u},5192:(o,h,r)=>{const{SolaceError:a}=r(3922);class u extends a{constructor(d,_,p){super("OperationError",d,u),this.subcode=_,this.reason=p}}o.exports.OperationError=u},8916:(o,h,r)=>{var a=r(2195);const{ErrorSubcode:u}=r(5129),{OperationError:l}=r(5192),{RequestEventCode:d}=r(8309),_={[d.REQUEST_ABORTED]:u.SESSION_NOT_CONNECTED,[d.REQUEST_TIMEOUT]:u.TIMEOUT};o.exports.RequestError=class extends l{constructor(p,f,S,C){super(p,_[f],C),this.name="RequestError",this._eventCode=f,this._correlationKey=S}get requestEventCode(){return this._requestEventCode}get errorSubcode(){return super.subcode}inspect(){const p=super.inspect?super.inspect():{};return Object.assign(p,{requestEventCode:d.describe(this.requestEventCode),infoStr:this.infoStr,correlationKey:this.correlationKey})}toString(){return a(this)}}},8309:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.RequestEventCode=a.new({REQUEST_ABORTED:8,REQUEST_TIMEOUT:9})},3922:o=>{class h extends Error{constructor(a,u,l){super(u||""),this.message=u,this.name=a,Error.captureStackTrace?Error.captureStackTrace(this,l):this.stack=new Error().stack}}o.exports.SolaceError=h},7444:(o,h,r)=>{const{ArrayOperations:a}=r(6284),{assert:u}=r(5796),{BidiMap:l}=r(5447),{Enum:d}=r(8963),{Iterator:_}=r(112),{Lazy:p}=r(2128),{makeMap:f}=r(2515),{Mixin:S}=r(825),{Resolver:C}=r(4396),{SetOperations:g}=r(7999);o.exports.assert=u,o.exports.ArrayOperations=a,o.exports.BidiMap=l,o.exports.Enum=d,o.exports.Iterator=_,o.exports.Lazy=p,o.exports.makeIterator=_.makeIterator,o.exports.makeMap=f,o.exports.Mixin=S,o.exports.mixin=S.mixin,o.exports.Resolver=C,o.exports.resolve=C.resolve,o.exports.SetOperations=g},6284:o=>{function h(r,a){const u=String(r),l=String(a);return u>l?1:u<l?-1:0}o.exports={ArrayOperations:{defaultComparator:h,insertOrdered:function(r,a,u=h){const l=[...r];return this.inplaceInsertOrdered(l,a,u)},inplaceInsertOrdered:function(r,a,u=h){let l=0,d=0,_=r.length;if(_>0)if(u(a,r[_-1])>0)l=_;else for(l=d+_>>1;_>d;)u(a,r[l])<0?_=l:d=l+1,l=d+_>>1;r.splice(l,0,a)}}}},5796:o=>{let h;h=()=>{},o.exports.assert=h},5447:o=>{o.exports.BidiMap=class{constructor(...h){this.forward=new Map,this.reverse=new Map,h.forEach(r=>{this.setValues(r[0],r[1])})}setValues(h,r){this.forward.set(h,r),this.reverse.set(r,h)}}},8963:o=>{function h(a,u,l){const d=u.filter(_=>a[_]===l);return d.length?d[0]:null}class r{constructor(u){Object.defineProperties(this,{_canonical:{value:null,enumerable:!1,writable:!0,configurable:!0}}),this._setCanonical(u)}_setCanonical(u,l=!1){this._canonical=Object.assign({},u),Object.keys(this).forEach(d=>{const _=Object.getOwnPropertyDescriptor(this,d);_.value!==void 0&&Object.defineProperty(this,d,{enumerable:!1,writable:!0,configurable:!0,value:_.value})}),Object.keys(u).forEach(d=>{Object.defineProperty(this,d,{enumerable:!0,writable:!l,configurable:!l,value:u[d]})})}describe(u,l="<none>",d="<unknown>"){if(u==null)return l;const _=h(this._canonical,Object.keys(this._canonical||{}),u)||d;return _===u?_:`${_} (${u})`}nameOf(u){return h(this._canonical,Object.keys(this._canonical||{}),u)}get names(){return Object.keys(this._canonical||{})}get values(){return u=this._canonical,l=Object.keys(this._canonical||{}),Array.from(new Set(l.map(d=>u[d])));var u,l}get isEnum(){return!0}static nameOf(u,l){return u.nameOf(l)}static values(u){return u.values()}static new(u){return new r(u)}static ofStrings(u){const l={};return u.forEach(d=>{l[d]=d}),r.new(l)}static ofNumbers(u){const l={};return u.forEach((d,_)=>{l[d]=_}),r.new(l)}}o.exports.Enum=r},112:o=>{class h{constructor(a,u=0,l=a.length){this._arr=a,this._index=u,this._end=l}deref(){return this._arr[this._index]}incr(){return++this._index}end(){return this._index>=this._end}static makeIterator(a,u=0,l=a.length){return new h(a,u,l)}}o.exports.Iterator=h},2128:o=>{const h={enumerable:!0};function r(l,d,_,p=null){Object.defineProperty(l,d,Object.assign({value:_},h,p))}function a(l,d,_){return Object.defineProperty(l,d,Object.assign({configurable:!0,get:()=>{const p=_(l,d);return r(l,d,p),p},set:p=>{r(l,d,p)}},h)),l}const u={lazyProperties:function(l,d){return Object.keys(d).forEach(_=>{a(l,_,d[_])}),d},lazyProperty:a,lazyValue:function(l){return a({},"value",l)}};o.exports.Lazy=u},2515:o=>{o.exports.makeMap=function(...h){const r={};for(let a=0;a<h.length;a+=2)r[h[a]]=h[a+1];return r}},825:o=>{const h={mixin:function(r,a){const u=r.prototype,l=a.prototype;return Object.getOwnPropertyNames(l).forEach(d=>{d!=="constructor"&&Object.defineProperty(u,d,Object.getOwnPropertyDescriptor(l,d))}),r}};o.exports.Mixin=h},4396:(o,h,r)=>{const{Lazy:a}=r(2128),{lazyProperty:u}=a;class l{constructor(_,p){Object.keys(_).forEach(f=>{f.split(",").map(S=>S.trim()).forEach(S=>{const C=_[f],g=typeof C=="string"?C.split("."):C,m=(Array.isArray(g)?g:[g]).concat(S);u(this,S,()=>function(T,y,E){return E.reduce((I,N)=>typeof N=="string"?I[N]:N,y)}(0,this,m))})})}static resolve(_,p){return new l(_,p)}}o.exports.Resolver=l},7999:o=>{function h(r,a){return a.forEach(u=>{r.add(u)}),r}o.exports={SetOperations:{inplaceDifference:function(r,a){return a.forEach(u=>{r.delete(u)}),r},inplaceIntersection:function(r,a){return r.forEach(u=>{a.has(u)||r.delete(u)}),r},inplaceUnion:h,isSuperset:function(r,a){return Array.from(a).every(u=>r.has(u))},difference:function(r,a){return new Set(Array.from(r).filter(u=>!a.has(u)))},intersection:function(r,a){return new Set(Array.from(r).filter(u=>a.has(u)))},union:function(r,a){return h(new Set(r),a)}}}},3385:(o,h,r)=>{const{EventEmitter:a}=r(6018),{Timer:u}=r(3008);o.exports={EventEmitter:a,Timer:u}},6018:(o,h,r)=>{const a=r(7007).EventEmitter,{ArrayUtils:u}=r(968),{ErrorSubcode:l,OperationError:d}=r(6706),{LOG_WARN:_}=r(2694),{flatten:p,includes:f}=u,S=["error","newListener","removeListener"],C=["newListener","removeListener"],g={ignore(){},fail(){throw new Error("Emitter disabled")}};o.exports.EventEmitter=class extends a{constructor(m){super();const{direct:T,emits:y,unsafe:E,formatEventName:I}=m||{};this.formatEventName=I||(A=>A);const N=this.emit.bind(this);this._installDirectFilter(T,N),this._installErrorHandlers(E),this._installEmitVerifier(),this._listenerVerificationFilter=function(A){if(typeof A=="function")return q=>f(S,q)||A(q);if(!Array.isArray(A))return null;const L=new Set(p(A));S.forEach(q=>L.add(q));const D=Array.from(L);return q=>f(D,q)}(y),this._emits=y}_installDirectFilter(m,T){if(m){if(f(C,m))throw new d(`Cannot configure listener collection events [${C.join(", ")}] as direct`,l.INTERNAL_ERROR);this._defaultEmitDirect=(...y)=>T(m,...y),this.emitDirect=this._defaultEmitDirect,this._directEventName=m,this.on=(y,E)=>{this._verifyListenerEvent(y);const I=super.on(y,E);return this._setEmitDirect(y,!0,E),I},this.addListener=(y,E)=>this.on(y,E),this.once=(y,E)=>{this._verifyListenerEvent(y);const I=super.once(y,E);return this._setEmitDirect(y,!1),I},this.prependListener=(y,E)=>{this._verifyListenerEvent(y);const I=super.prependListener(y,E);return this._setEmitDirect(y,!0,E),I},this.prependOnceListener=(y,E)=>{this._verifyListenerEvent(y);const I=super.prependOnceListener(y,E);return this._setEmitDirect(y,!1),I},this.removeAllListeners=y=>{const E=super.removeAllListeners(y);return y!==this._directEventName&&y!==void 0||(this.emitDirect=this._defaultEmitDirect),E},this.removeListener=(y,E)=>{const I=super.removeListener(y,E);return y===this._directEventName&&this.listenerCount(y)===0&&(this.emitDirect=this._defaultEmitDirect),I},this.directListenerCount=()=>this.listenerCount(this._directEventName),this.setOnFirstDirectListener=y=>{this._onFirstDirectListener=y}}}_setEmitDirect(m,T,y){m===this._directEventName&&(T&&this.directListenerCount()===1?this.emitDirect=y:this.emitDirect=this._defaultEmitDirect,this.directListenerCount()===1&&this._onFirstDirectListener!==void 0&&this._onFirstDirectListener())}_verifyListenerEvent(m){this._listenerVerificationFilter&&(m==null&&this.throwInternal(new d(`Emitter rejects listener for no-name event: ${m}`,l.PARAMETER_OUT_OF_RANGE)),this._listenerVerificationFilter(m)||this.throwInternal(new d(`Emitter rejects listeners for ${m}, emits ${this._emits}`,l.PARAMETER_OUT_OF_RANGE)))}_installEmitVerifier(){}_installErrorHandlers(m){if(m)return void(this.throwInternal=y=>{throw y});const T=this.emit.bind(this);this.throwInternal=function(y){throw this._internalError=!0,y},this.emit=(y,...E)=>{try{T(y,...E)}catch(I){if(this._internalError)throw this._internalError=void 0,I;const N=this.formatErrorEvent(I,y,...E);try{_(`Listener for '${N.info.event.formattedName}' threw exception, dispatching to 'error'`),T("error",N)}catch(A){_("Listener for 'error' threw exception:",A,`
|
|
69
|
+
Original exception:`,I)}}}}get isDirect(){return this.emitDirect&&this.emitDirect!==this._defaultEmitDirect}formatErrorEvent(m,T,...y){const E=this.formatEventName(T);return Object.assign(new d(`Unhandled error in event handler for '${E}'`,l.CALLBACK_ERROR,`On event: ${[T,...y]} ${m}`),{stack:m.stack,info:{event:{name:T,formattedName:E,args:y},error:m}})}disableEmitter(){this._defaultEmitDirect=g.ignore,this.removeAllListeners(),this.emit=g.ignore,this.addListener("removeListener",g.fail),this.addListener("newListener",g.fail)}}},3008:o=>{class h{constructor(a){this.cancel=()=>{this.cancel=()=>{},a()}}static newInterval(a,u,...l){const d=setInterval(u,a,...l);return new h(()=>clearInterval(d))}static newTimeout(a,u,...l){const d=setTimeout(u,a,...l);return new h(()=>clearTimeout(d))}}o.exports.Timer=h},4386:(o,h,r)=>{const{FactoryProfile:a,SolclientFactoryProfiles:u}=r(755),{ProfileBinding:l}=r(4807),{SolclientFactory:d}=r(5656),{SolclientFactoryProperties:_}=r(852);o.exports.FactoryProfile=a,o.exports.ProfileBinding=l,o.exports.SolclientFactoryProfiles=u,o.exports.SolclientFactoryProperties=_,o.exports.SolclientFactory=d},4807:(o,h,r)=>{const{OperationError:a}=r(6706);let u=null;const l={get value(){if(u===null)throw new a("Profile binding not initialized. Call solace.SolclientFactory.init");return u},set value(d){u=d}};o.exports.ProfileBinding=l},755:(o,h,r)=>{var a=r(2195);class u{get guaranteedMessagingEnabled(){}get cometEnabled(){}get topicUtf8Encode(){}get byteArrayAsString(){}inspect(){return{guaranteedMessagingEnabled:this.guaranteedMessagingEnabled,cometEnabled:this.cometEnabled,topicUtf8Encode:this.topicUtf8Encode,byteArrayAsString:this.byteArrayAsString}}toString(){return a(this)}}const l=new class extends u{get guaranteedMessagingEnabled(){return!1}get cometEnabled(){return!0}get topicUtf8Encode(){return!1}get byteArrayAsString(){return!0}},d=new class extends u{get guaranteedMessagingEnabled(){return!0}get cometEnabled(){return!1}get topicUtf8Encode(){return!0}get byteArrayAsString(){return!0}},_=new class extends u{get guaranteedMessagingEnabled(){return!0}get cometEnabled(){return!1}get topicUtf8Encode(){return!0}get byteArrayAsString(){return!1}},p={_legacy:l,_v10:d,_forward:_,_default:l,version7:l,version10:d,version10_5:_,inspect(){return{version7:this.version7,version10:this.version10,version10_5:this.version10_5}},toString(){return a(this)}};o.exports.FactoryProfile=u,o.exports.SolclientFactoryProfiles=p},852:(o,h,r)=>{var a=r(2195);const{APIProperties:u}=r(968),{Check:l}=r(802);function d(){const{LogLevel:_}=r(2694);return _.INFO}o.exports.SolclientFactoryProperties=class extends u{constructor(_){super({logLevel:d(),logger:null},_)}get profile(){return this._profile}set profile(_){this._profile=_}get logLevel(){return l.number(this._logLevel)?this._logLevel:d()}set logLevel(_){this._logLevel=_}get logger(){return this._logger||null}set logger(_){this._logger=_}inspect(){const{LogLevel:_}=r(2694);return{logLevel:_.describe(this._logLevel),profile:this._profile}}toString(){return a(this)}}},5656:(o,h,r)=>{const{ErrorSubcode:a,OperationError:u}=r(6706),{FactoryProfile:l,SolclientFactoryProfiles:d}=r(755),{Parameter:_}=r(802),{ProfileBinding:p}=r(4807),{SolclientFactoryProperties:f}=r(852),S={initializeCount:0,initializers:[]},C={addInitializer(g){S.initializers.push(g)},createFactory:g=>function(...m){if(S.initializeCount===0)throw new u("SolclientFactory not initialized",a.INVALID_OPERATION);return g(...m)},init(g){if(S.initializeCount>0)return this;const m=new f(g),T=g&&g.profile||d.version7;return _.isInstanceOf("factoryProps.profile",T,l),p.value=T,S.initializers.forEach(y=>{y.call(this,m,S)}),++S.initializeCount,g!=null&&r(2694),this},reset(){S.initializeCount=0},_getInitializeCount:()=>S.initializeCount,get profiles(){return d}};o.exports.SolclientFactory=C},8860:(o,h,r)=>{const{Flow:a}=r(8770),{FlowOperation:u}=r(2326),{PrivateFlowEventName:l}=r(9747);o.exports.Flow=a,o.exports.FlowOperation=u,o.exports.PrivateFlowEventName=l},2326:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.FlowOperation=a.new({CONNECT:"FlowOperation_CONNECT",DISCONNECT:"FlowOperation_DISCONNECT",START:"FlowOperation_START",STOP:"FlowOperation_STOP",DISPOSE:"FlowOperation_DESTROY",GET_STATS:"FlowOperation_GET_STATS",RESET_STATS:"FlowOperation_RESET_STATS",GET_PROPERTIES:"FlowOperation_GET_PROPERTIES",GET_DESTINATION:"FlowOperation_GET_DESTINATION"})},8770:(o,h,r)=>{const{ErrorSubcode:a,NotImplementedError:u,OperationError:l}=r(6706),{EventEmitter:d}=r(3385),{FlowOperation:_}=r(2326),{LogFormatter:p}=r(2694),{PrivateFlowEventName:f}=r(9747),{Stats:S}=r(5747),C=[_.DISPOSE,_.GET_STATS,_.GET_PROPERTIES,_.RESET_STATS];o.exports.Flow=class extends d{constructor(g,m,T){const y=Object.assign({},T);y.emits=(y.emits||[]).concat(f.values),super(y);const E=m(this),I=this;this.logger=new p((...N)=>[`[session=${E.sessionIdHex}]`,`[flow=${I.flowIdDec}]`,...N]),this.log=this.logger.wrap(this.log,this),this._disposing=!1,this._disposed=!1,this._userDisconnected=!0,this._properties=g,this._sessionInterface=E,this._stats=new S(E),this._privateEventEmitter=new d(y)}_emit(g,...m){this._privateEventEmitter.emit(g,...m),this.emit(g,...m)}_on(g,m){this._privateEventEmitter.on(g,m)}_once(g,m){this._privateEventEmitter.once(g,m)}_removeListener(g,m){this._privateEventEmitter.removeListener(g,m)}clearStats(){this.logger,this._operationCheck(_.RESET_STATS),this._stats.resetStats()}connect(){this.logger,this.userDisconnected=!1,this._operationCheck(_.CONNECT)}dispose(){if(this.logger,this._disposed||this._disposing)return;this._operationCheck(_.DISPOSE),this._disposing=!0;const g=()=>{this._disposed=!0,this._properties=null,this._userDisconnected=!0,this._emit(this.getDisposedEvent()),this.disableEmitter(),this._privateEventEmitter.disableEmitter()};if(this._fsm._midDispatch){const m=()=>{this._fsm.terminateFsm(),g()};setTimeout(()=>m(),0)}else g()}disconnect(){this._operationCheck(_.DISCONNECT),this.logger,this.userDisconnected=!0}_disconnectSession(){this._operationCheck(_.DISCONNECT)}getDisposedEvent(){throw new u("Abstract method")}getProperties(){return this._operationCheck(_.GET_PROPERTIES),this._properties.clone()}getStat(g){return this._operationCheck(_.GET_STATS),this._stats.getStat(g)}handleUncorrelatedControlMessage(g){throw new u("Guaranteed Message Connection does not implement a control message handler",g)}incStat(g,m){this._stats.incStat(g,m)}processFSMEvent(g){this._fsm.processEvent(g)}inspect(){return{flowId:this.flowIdDec}}toString(){return this.inspect()}get canAck(){return!this.disposed}get disposed(){return this._disposed}get flowIdDec(){return this.flowId||"(N/A)"}get flowId(){return new u("Flow does not implement ID accessor")}get session(){return this._session}get userDisconnected(){return this._userDisconnected}set userDisconnected(g){this._userDisconnected=g}_operationCheck(g){if(this.logger,_.describe(g),this._disposed)throw new l("Operation is invalid for Message Consumer in disposed state",a.INVALID_OPERATION);if(C.some(m=>m===g))return!0;if(g===_.DISCONNECT&&this._isDisconnected())throw new l("Operation is invalid for Message Consumer in disconnected state",a.INVALID_OPERATION)}_isDisconnected(){throw new u("Flow#_isDisconnected not implemented")}}},9747:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.PrivateFlowEventName=a.new({BIND_WAITING:"PrivateFlowEventName_bindWaiting"})},7414:(o,h,r)=>{const{FsmEvent:a}=r(7818),{State:u}=r(7339),{StateMachine:l}=r(3671);o.exports.FsmEvent=a,o.exports.State=u,o.exports.StateMachine=l},5921:(o,h,r)=>{const a=r(7339),{FsmObject:u}=r(6031);o.exports.EntryPoint=class extends u{constructor(l){let d;super({name:l.entryPointName}),this.impl=this.impl||{},this.impl.outerState=new a.State({name:`${l.state.getName()} outerEntryPoint: ${l.entryPointName}`,parentContext:l.state.getParent()}).initial(()=>l.state.transitionTo(d)),d=new a.State({name:`${l.state.getName()} innerEntryPoint: ${l.entryPointName}`,parentContext:l.state}).initial(l.func)}getDestState(){return this.impl.outerState}}},7818:(o,h,r)=>{const{FsmObject:a}=r(6031);o.exports.FsmEvent=class extends a{}},5027:(o,h,r)=>{const a=r(7339),{FsmObject:u}=r(6031);o.exports.ExitPoint=class extends u{constructor(l){let d;super({name:l.exitPointName}),this.impl.innerState=new a.State({name:`${l.state.getName()} innerExitPoint: ${l.exitPointName}`,parentContext:l.state}).initial(()=>l.state.transitionTo(d)),d=new a.State({name:`${l.state.getName()} outerExitPoint: ${l.exitPointName}`,parentContext:l.state.getParent()}).initial(l.func)}getDestState(){return this.impl.innerState}}},6031:(o,h,r)=>{const{OperationError:a}=r(6706);o.exports.FsmObject=class{constructor(u){if(!u)throw new a("No spec provided");if(!u.name)throw new a("No name provided for spec");this.impl={name:u.name}}toString(){let u=this.getExtraStringInfo();return u.length>0&&(u=`; ${u}`),`{${this.constructor.name}: ${this.getName()}${u}}`}getExtraStringInfo(){return""}getName(){return this.impl.name}}},1493:(o,h,r)=>{const a=r(7339),{FsmObject:u}=r(6031),{Iterator:l}=r(7444);r(2694);const{makeIterator:d}=l;class _ extends u{constructor(f){super(f),this.impl=this.impl||{},this.impl.logPadding=""}getStateMachine(){return this.impl.ancestorList[0]}initial(f){return this.impl.initialReaction&&this.log(`Replacing ${this} initialReaction ${this.impl.initialReaction} with ${f}`),this.impl.initialReaction=f.bind(this),this}transitionTo(f,S){return new _.ReactionResult({caller:this,destState:f,action:S})}terminate(f){return new _.ReactionResult({caller:this,destState:this.getStateMachine().getFinalState(),action:f})}getAncestorList(){return this.impl.ancestorList}log(...f){this.impl.logPadding}onInitial(f){let S;if(this.impl.initialReaction){if(this.log(`Initial: for ${this}`),S=this.impl.initialReaction(f),S.external)throw new Error(`Initial reaction for ${this} returned external transitions`);return S}if(!(this instanceof a.State))throw new Error(`Missing initial reaction for ${this}`);return this.transitionTo(this)}processReactionResult(f,S){let C=this;if(!f.destState)return this;const g=this.lowestCommonAncestor(f);for(;C!==g.deref();)C.onExit(),C=C.getParent();for(f.action&&f.action(C,S),C.log(`Action: transition to ${f.destState} in context ${C}`),g.incr();!g.end();g.incr())C=g.deref(),C.onEntry();const m=C.onInitial(S);return m.destState!==C?C.processReactionResult(m,S):C}lowestCommonAncestor(f){const S=this.impl.ancestorList,C=f.destState.getAncestorList();let g;if(S[0]!==C[0])throw new Error(`No common ancestor between (${this} in ${S[0]}) and (${f.destState} in ${C[0]})`);if(this===f.destState)g=S.length,f.external&&--g;else{for(g=1;g<S.length&&S[g]===C[g];++g);g!==S.length&&g!==C.length||f.external&&--g}return d(C,g-1)}setLogPadding(f){this.impl.logPadding=f}}_.ReactionResult=class{constructor(p){if(!(p&&p.caller&&p.caller instanceof _))throw new Error("spec.caller is required to be a StateContext");if(!p.caller.getStateMachine().isRunning())throw new Error("ReactionResult objects can only be created while processing events");if(p.destState){if(!(p.destState instanceof a.State))throw new Error("destState must be a State object");if(p.action&&typeof p.action!="function")throw new Error("action must be a function");this.destState=p.destState,this.action=p.action,this.external=p.external}}},o.exports.StateContext=_},3671:(o,h,r)=>{const{LOG_ERROR:a}=r(2694),{State:u}=r(7339),{StateContext:l}=r(1493);o.exports.StateMachine=class extends l{constructor(d){if(d.parentContext)throw new Error(`State machine cannot have parent state: ${d.parentContext}`);super(d),this.impl.ancestorList=[this],this.impl.eventQueue=[],this.impl.finalState=new u({name:"impl.final",parentContext:this}),this.impl.handleUncaughtException=(_,p)=>(a(`Uncaught exception in ${this} while processing ${_}: ${p.stack}`),this.terminate())}process(d){const{impl:_}=this,{eventQueue:p}=_;if(p.push(d),_.processingEvents)return!1;for(_.processingEvents=!0;p.length;)p.shift().apply(this);return _.processingEvents=!1,this._onEventCompletion(),!0}start(){if(this.getCurrentState())throw new Error(`Cannot start ${this.getName()}; it is already started.`);this.process(()=>{const d=this.onInitial();if(d.destState===void 0)throw new Error(`Missing destination state from initial transition for ${this}`);if(d.destState===this)throw new Error(`Destination state for initial transition for ${this} cannot be the FSM.`);const _=d.destState.getAncestorList();if(_[0]!==this)throw new Error(`Invalid destination state (${d.destState}) from initial transition for state machine (${this}); destState ancestor (${_[0]})`);this.impl.currentState=this.processReactionResult(d)})}isRunning(){return this.impl.processingEvents}processEvent(d){const{impl:_}=this;this.process(()=>{let p;if(this.log(`Processing event ${d}`),_.currentState)try{p=_.currentState.handleEvent(d),_.currentState=_.currentState.processReactionResult(p,d)}catch(f){this.log(`Caught exception ${f}, continuing`),p=_.handleUncaughtException.call(_.currentState,d,f),_.currentState=_.currentState.processReactionResult(p,d)}})||this.log(`Deferring event ${d}`)}terminateFsm(){const d=this.getCurrentState();if(d){if(this.impl.processingEvents)throw new Error("Cannot terminate state machine while FSM is processing events. To terminate the FSM from within a reaction, return State~terminate() from a reaction.");this.process(()=>{const _=d.terminate();this.impl.currentState=d.processReactionResult(_)})}}setPostEventAction(d){if(!this.impl.processingEvents)throw new Error("Cannot set post event hook unless FSM is processing events.");if(!d||typeof d!="function")throw new Error(`postEventAction must be a function; got (${d})`);this.impl.postEventAction=d.bind(this)}_onEventCompletion(){const d=this.impl.postEventAction;d&&(this.impl.postEventAction=void 0,this.log("Running post event action"),d.apply(this))}getCurrentState(){return this.impl.currentState}getActiveState(d){const _=this.impl.currentState.getAncestorList();for(let p=1;p<_.length;++p)if(_[p].getName()===d)return _[p]}isStateActive(d){return this.getActiveState(d)!==void 0}unhandledEventReaction(d){if(typeof d!="function")throw new Error(`In ${this}: unhandled event reaction must be a function; got ${d}`);return this.impl.handleUnhandledEvent=d.bind(this),this}uncaughtExceptionReaction(d){if(typeof d!="function")throw new Error(`In ${this}: Uncaught exception reaction must be a function; got ${d}`);return this.impl.handleUncaughtException=d,this}getFinalState(){return this.impl.finalState}}},7339:(o,h,r)=>{const{EntryPoint:a}=r(5921),{ExitPoint:u}=r(5027),{StateContext:l}=r(1493);o.exports.State=class extends l{constructor(d,_=null){super(d);const p=d.parentContext;Object.assign(this.impl,{parentContext:p,reactions:{},entryPoints:{},exitPoints:{},ancestorList:[...p.getAncestorList(),this],handleUnhandledEvent:f=>p.handleEvent?p.handleEvent(f):p.impl.handleUnhandledEvent(f)}),p&&(this.log=p.log.bind(this)),Object.keys(_||{}).forEach(f=>{const S=_[f];this[f]=typeof S=="function"?S.bind(this):S}),this.setLogPadding(" ".repeat(this.impl.ancestorList.length))}reaction(d,_){if(!d)throw new Error("No event name for reaction");if(!_)throw new Error(`No reaction function for reaction ${d}`);return this.log(`Adding reaction to ${this} for event ${d}`),this.impl.reactions[d]&&this.log(`Replacing reaction ${this.impl.reactions[d]} with ${_}`),this.impl.reactions[d]=_.bind(this),this}entryPoint(d,_){if(!d)throw new Error("No entry point name for entry point");if(!_)throw new Error(`No reaction function for entry point ${d}`);return this.log(`Adding entryPoint ${d} to ${this}`),this.impl.entryPoints[d]?(this.log(`EntryPoint ${d} already exists in ${this}`),this):(this.impl.entryPoints[d]=new a({state:this,entryPointName:d,func:_}),this)}exitPoint(d,_){if(!d)throw new Error("No exit point name for entry point");if(!_)throw new Error(`No reaction function for exit point ${d}`);return this.log(`Adding exitPoint ${d} to ${this}`),this.impl.exitPoints[d]?(this.log(`ExitPoint ${d} already exists in ${this}`),this):(this.impl.exitPoints[d]=new u({state:this,exitPointName:d,func:_}),this)}getEntryPointDestState(d){return this.impl.entryPoints[d]===void 0?(this.log(`${this}: EntryPoint ${d} does not exist.`),this):this.impl.entryPoints[d].getDestState()}getExitPointDestState(d){return this.impl.exitPoints[d]===void 0?(this.log(`${this}: ExitPoint ${d} does not exist.`),this):this.impl.exitPoints[d].getDestState()}entry(d){return this.impl.appEntryFunc&&this.log(`Replacing entry function ${this.impl.appEntryFunc} with ${d}`),this.impl.appEntryFunc=d.bind(this),this}exit(d){return this.impl.appExitFunc&&this.log(`Replacing exit function ${this.impl.appExitFunc} with ${d}`),this.impl.appExitFunc=d.bind(this),this}externalTransitionTo(d,_){return new l.ReactionResult({caller:this,destState:d,action:_,external:!0})}transitionToEntryPoint(d,_,p){return new l.ReactionResult({caller:this,destState:d.getEntryPointDestState(_),action:p})}transitionToExitPoint(d,_,p){return new l.ReactionResult({caller:this,destState:d.getExitPointDestState(_),action:p})}eventUnhandled(){return new l.ReactionResult({caller:this})}internalTransition(d){return new l.ReactionResult({caller:this,destState:this.getStateMachine().getCurrentState(),action:d})}terminate(d){return new l.ReactionResult({caller:this,destState:this.getStateMachine().getFinalState(),action:d})}getParent(){return this.impl.parentContext}onEntry(){this.log(`Entering: ${this}`),this.impl.appEntryFunc&&this.impl.appEntryFunc()}onExit(){this.log(`Exiting: ${this}`),this.impl.appExitFunc&&this.impl.appExitFunc()}handleEvent(d){this.log(`Process: ${d}`);const _=this.impl.reactions[d.getName()];if(_){const p=_(d);if(p||this.log(`Reaction returned undefined: ${d} in ${this}`),p.destState)return this.log(`Handled: ${d}`),p;this.log(`Unhandled: ${d} in ${this}`)}else this.log(`No reaction: ${d} in ${this}`);return this.impl.handleUnhandledEvent(d)}}},2694:(o,h,r)=>{const{ConsoleLogImpl:a}=r(9563),{GlobalBinding:u}=r(599),{LogImpl:l}=r(1719),{LogLevel:d}=r(1074),{Parameter:_}=r(802),{SolclientFactory:p}=r(4386),{isEnumMember:f,isFunction:S}=_,{getImpl:C,getLogLevel:g,setImpl:m,setLogLevel:T}=u,y={};function E(I,N){Object.keys(y).forEach(A=>{N[`LOG_${A.toUpperCase()}`]=I[A]})}Object.assign(y,{trace(...I){const N=C();N&&N.trace&&g()>=d.TRACE&&N.trace.apply(null,["solclientjs: ",...I])},debug(...I){const N=C();N&&N.debug&&g()>=d.DEBUG&&N.debug.apply(null,["solclientjs: ",...I])},info(...I){const N=C();N&&N.info&&g()>=d.INFO&&N.info.apply(null,["solclientjs: ",...I])},warn(...I){const N=C();N&&N.warn&&g()>=d.WARN&&N.warn.apply(null,["solclientjs: ",...I])},error(...I){const N=C();N&&N.error&&g()>=d.ERROR&&N.error.apply(null,["solclientjs: ",...I])},fatal(...I){const N=C();N&&N.fatal&&N.fatal.apply(null,["solclientjs: ",...I])}}),p.getLogLevel=()=>g(),p.setLogLevel=I=>{f("logLevel",I,d),T(I)},p.addInitializer(I=>{T(I.logLevel);const N=I.logger||C()||new a;Object.keys(new l).forEach(A=>S(`logger.${A}`,N[A])),m(N)}),E(y,o.exports),o.exports.LogImpl=l,o.exports.LogLevel=d,o.exports.Binding=u,o.exports.ConsoleLogImpl=a,u.setImpl(new a),o.exports.LogFormatter=class{constructor(I){this._formatter=typeof I=="function"?I:typeof I=="string"?function(...A){return[I,...A]}:I||function(...A){return[...A]};const N=this;Object.keys(y).forEach(A=>{this[A]=function(...L){return y[A].apply(null,N._formatter(...L))}}),E(this,this)}get formatter(){return this._formatter}set formatter(I){this._formatter=I}wrap(I,N){const A=this;return function(...L){return I.apply(N,A._formatter(...L))}}}},9563:(o,h,r)=>{const{LogImpl:a}=r(1719),u=()=>{};function l(d){const _=new Date,p=" ".repeat(6-d.length);let f=String(_.getFullYear()),S=String(_.getMonth()+1),C=String(_.getDate()),g=String(_.getHours()),m=String(_.getMinutes()),T=String(_.getSeconds()),y=String(_.getMilliseconds());return f="0".repeat(4-f.length)+f,S=S.length<2?`0${S}`:S,C=C.length<2?`0${C}`:C,g=g.length<2?`0${g}`:g,m=m.length<2?`0${m}`:m,T=T.length<2?`0${T}`:T,y=y.length<3?`0${y}`:y,y=y.length<3?`0${y}`:y,[`${f}-${S}-${C} ${g}:${m}:${T}.${y}`,`${d}${p}`]}o.exports.ConsoleLogImpl=class extends a{constructor(d){let _=u,p=u,f=u,S=u,C=u,g=u;const m=d||(typeof window>"u"?r.g:window).console;m&&(m.log||m.warn)&&(m.log&&m.log!==void 0?(_=Function.prototype.bind.call(m.log,m),p=Function.prototype.bind.call(m.log,m)):m.debug&&typeof m.debug=="function"&&(_=Function.prototype.bind.call(m.debug,m),p=Function.prototype.bind.call(m.debug,m)),f=m.info&&m.info!==void 0?Function.prototype.bind.call(m.info,m):Function.prototype.bind.call(m.log,m),S=m.warn&&m.warn!==void 0?Function.prototype.bind.call(m.warn,m):Function.prototype.bind.call(m.log,m),m.error&&m.error!==void 0?(C=Function.prototype.bind.call(m.error,m),g=Function.prototype.bind.call(m.error,m)):(C=Function.prototype.bind.call(m.log,m),g=Function.prototype.bind.call(m.log,m))),super((...T)=>{_(...l("TRACE"),...T)},(...T)=>{p(...l("DEBUG"),...T)},(...T)=>{f(...l("INFO"),...T)},(...T)=>{S(...l("WARN"),...T)},(...T)=>{C(...l("ERROR"),...T)},(...T)=>{g(...l("FATAL"),...T)})}}},599:(o,h,r)=>{const{LogLevel:a}=r(1074),u={impl:null,level:a.INFO},l={getImpl:function(){return u.impl},setImpl:function(d){u.impl=d},getLogLevel:function(){return u.level},setLogLevel:function(d){u.level=d}};o.exports.GlobalBinding=l},1719:o=>{o.exports.LogImpl=class{constructor(h,r,a,u,l,d){Object.assign(this,{trace:h,debug:r,info:a,warn:u,error:l,fatal:d})}trace(){}debug(){}info(){}warn(){}error(){}fatal(){}}},1074:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.LogLevel=a.new({FATAL:0,ERROR:1,WARN:2,INFO:3,DEBUG:4,TRACE:5})},178:(o,h,r)=>{const{ConsumerFlows:a}=r(8960),{ConsumerFSMEvent:u}=r(946),{ConsumerFSMEventNames:l}=r(1699),{MessageConsumer:d}=r(6598),{MessageConsumerAcknowledgeMode:_}=r(4590),{MessageConsumerEvent:p}=r(3247),{MessageConsumerEventName:f}=r(6934),{MessageConsumerProperties:S}=r(2558),{QueueBrowser:C}=r(2584),{QueueBrowserEventName:g}=r(8496),{QueueBrowserProperties:m}=r(4548);o.exports.ConsumerFlows=a,o.exports.ConsumerFSMEvent=u,o.exports.ConsumerFSMEventNames=l,o.exports.MessageConsumer=d,o.exports.MessageConsumerEvent=p,o.exports.MessageConsumerAcknowledgeMode=_,o.exports.MessageConsumerEventName=f,o.exports.MessageConsumerProperties=S,o.exports.QueueBrowser=C,o.exports.QueueBrowserEventName=g,o.exports.QueueBrowserProperties=m},7671:(o,h,r)=>{const{Enum:a,assert:u}=r(7444),{MessageOutcome:l}=r(6247),{LOG_DEBUG:d,LOG_ERROR:_}=r(2694),p=a.new({UNACKED:"UNACKED",ACKED_NOT_SENT:"ACKED_NOT_SENT",ACKED_SENT:"ACKED_SENT"});class f{constructor(C,g,m){C?(this.exists=!0,this.id=C,this.key=C.toString(),this.state=g||p.UNACKED,this.settlementOutcome=m||l.ACCEPTED):this.exists=!1}set(C,g,m=void 0){this.exists=!0,this.id=C,this.key=C.toString(),this.state=g||p.UNACKED,this.settlementOutcome=m!==void 0?m:null}clear(){this.exists=!1,this.id=null,this.key=null,this.state=null,this.settlementOutcome=null}}Object.assign(o.exports,{ApplicationAckState:p,ApplicationAck:f,ApplicationAckRingBuffer:class{constructor(S){u(S>=2),this._size=S,this._insertIndex=0,this._buffer=Array(S).fill(null).map(()=>new f),this._index=new Map}reset(){this._insertIndex=0,this._buffer.forEach(S=>{S.exists=!1}),this._index.clear()}insert(S,C){u(C),u(S);const g=this._size,m=this._buffer,T=this._index,y=this._insertIndex;u(!m[y].exists,"Invariant not enforced (before): insert index not empty");const E=m[y];E.set(S,p.UNACKED),T.has(E.key)&&_(`Duplicate ID: ${T.get(E.key)} insertIndex: ${y}`),T.set(E.key,y);const I=m[(y+1)%g];let N;try{N=C(I.exists?I:null)}finally{this._insertIndex=(y+1)%g,I.exists&&(T.delete(I.key),I.clear())}return u(!m[this._insertIndex].exists,"Invariant not enforced (after): insert index not empty"),N}get length(){return this._index.size}front(){if(this.length===0)return null;const S=this._buffer,C=this._insertIndex,g=this._size,m=(C+1)%g;if(S[m].exists)return S[m];for(let T=m,y=m+g-1;T<=y;++T){const E=S[T%g];if(E.exists)return E}return u(this._index.size===0,"#front() failed so buffer must be empty"),null}forEach(S){if(this.length===0)return;const C=this._buffer,g=this._size;let m=0;for(let T=this._insertIndex+1,y=this._insertIndex+g;T<=y;++T){const E=C[T%g];E.exists&&S(E,m++,this)}u(m>0,"Not empty but did not dispatch")}updateAckState(S,C,g=void 0){const m=S.toString();u(this._index.has(m),"Ack key not found");const T=this._buffer[this._index.get(m)];u(T,"Ack key has no entry"),T.state=C,g!=null?T.settlementOutcome=g:C===p.ACKED_NOT_SENT&&(T.settlementOutcome=l.ACCEPTED)}has(S){const C=S.toString();return this._index.has(C)}}})},8960:(o,h,r)=>{const{assert:a}=r(7444),{MessageConsumer:u}=r(6598),{MessageConsumerEventName:l}=r(6934);o.exports.ConsumerFlows=class{constructor(){this._allFlows=new Set,this._reconnectingFlows=new Set,this._flowsById={}}add(d){if(a(d instanceof u,"Flow was not a consumer"),this._allFlows.has(d))return d;const _=()=>{this._flowsById[d.flowId]=d},p=()=>{const S=d.flowId;this._allFlows.delete(d),this._reconnectingFlows.delete(d),this._flowsById[S]===d&&delete this._flowsById[S]},f=()=>{this._reconnectingFlows.delete(d)};return d._on(l.UP,_),d._on(l.RECONNECTED,()=>{_(),this._allFlows.add(d),this._reconnectingFlows.delete(d)}),d._on(l.DISPOSED,p),d._on(l.RECONNECTING,()=>{p(),this._reconnectingFlows.add(d)}),d._on(l.DOWN,f),d._on(l.DOWN_ERROR,f),this._allFlows.add(d),d}get flows(){return Array.from(this._allFlows)}get reconnectingFlows(){return Array.from(this._reconnectingFlows)}getFlowById(d){return this._flowsById[d]}disposeAll(){this._allFlows.forEach(d=>d.dispose())}}},1699:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.ConsumerFSMEventNames=a.new({SESSION_UP:"SESSION_UP",SESSION_UP_NO_AD:"SESSION_UP_NO_AD",SESSION_DOWN:"SESSION_DOWN",SESSION_DISCONNECT:"SESSION_DISCONNECT",FLOW_FAILED:"FLOW_FAILED",FLOW_UP:"FLOW_UP",FLOW_ACTIVE_IND:"FLOW_ACTIVE_IND",FLOW_CLOSE:"FLOW_CLOSE",FLOW_OPEN:"FLOW_OPEN",FLOW_UNBOUND:"FLOW_UNBOUND",ACK:"ACK",ACK_TIMEOUT:"ACK_TIMEOUT",BIND_TIMEOUT:"BIND_TIMEOUT",CREATE_TIMEOUT:"CREATE_TIMEOUT",UNBIND_TIMEOUT:"UNBIND_TIMEOUT",CAN_SEND:"CAN_SEND",TRANSPORT_ERROR:"TRANSPORT_ERROR",DISPOSE:"DISPOSE",VIRTUALROUTER_NAME_CHANGED:"VIRTUALROUTER_NAME_CHANGED",RECONNECT_INTERVAL_TIMEOUT:"RECONNECT_INTERVAL_TIMEOUT",BIND_RESPONSE:"BIND_RESPONSE",CREATE_FAILED:"CREATE_FAILED",CREATE_SUCCESS:"CREATE_SUCCESS"})},946:(o,h,r)=>{const{FsmEvent:a}=r(7414);o.exports.ConsumerFSMEvent=class extends a{constructor(u,l){super(u),this.details=l}}},9035:(o,h,r)=>{const a=r(3450),{ApplicationAck:u,ApplicationAckRingBuffer:l,ApplicationAckState:d}=r(7671),{assert:_}=r(7444),{CapabilityType:p}=r(5024),{ConsumerFSMEvent:f}=r(946),{ConsumerFSMEventNames:S}=r(1699),{ConsumerStateNames:C}=r(3561),{DestinationFromNetwork:g,DestinationType:m,Queue:T,Topic:y}=r(9620),{ErrorResponseSubcodeMapper:E,ErrorSubcode:I,OperationError:N}=r(6706),{LogFormatter:A}=r(2694),{Long:L}=r(9783),{MessageConsumerAcknowledgeMode:D}=r(4590),{MessageConsumerEventName:q}=r(6934),{MessageDispatcher:Y}=r(6811),{PrivateFlowEventName:Q}=r(8860),{QueueAccessType:W,QueueDescriptor:x,QueuePermissions:k,QueueProperties:J,QueueType:F}=r(9631),{MessageOutcome:$,RgmidFactory:R}=r(6247),{State:B,StateMachine:M}=r(7414),{Stats:re,StatType:se}=r(5747),{Timer:fe}=r(3385),{TransportAcks:ce,TransportAckResult:Te}=r(1382),Ee=new u(L.UZERO,d.ACKED_SENT,$.ACCEPTED);o.exports.ConsumerFSM=class extends M{constructor({name:he,consumer:ge,sessionInterface:X,properties:ae}={}){super({name:he});const ee=this,Re=this.logger=new A(function(...oe){return[`[session=${X.sessionIdHex}]`,`[message-consumer-fsm=${ge.flowIdDec}]`,...oe]}),{LOG_TRACE:me,LOG_DEBUG:Pe,LOG_INFO:H,LOG_WARN:Z,LOG_ERROR:te}=Re;this.log=Re.wrap(this.log,this);const ie=ae.acknowledgeMode===D.AUTO;this._consumer=ge,this._sessionInterface=X,this._acknowledgeTimeoutInMsecs=ae.acknowledgeTimeoutInMsecs,this._acknowledgeThreshold=ae.acknowledgeThreshold,this._localPreferredWindowSize=ae.windowSize,this._localMaxWindowSize=ae.windowSize,this._hasAutoAckSupport=ie,this._messageDispatch=new Y({emitter:ge,autoAck:ie,logger:Re}),this._stats=new re,this._resetRemoteConnectionState(),this._resetLocalConnectionState(),this._midDispatch=!1,this._replayStartLocation=ae.replayStartLocation,this._errorCausingReconnect=null;const j="EMIT",Oe="DISPATCH",v="NO_DISPATCH";let P=[];function O(oe){const Se={};P.forEach((Ce,je,Be)=>{function ct(Gt,Ne){if(Se[Gt]===void 0)return;const et=Se[Gt];Se[Gt]=void 0,Be[et]=null,Be[je]=null}if(!(je<oe)&&Ce)switch(Ce.type){case j:switch(Ce.data){case q.UP:case q.ACTIVE:case q.RECONNECTED:Se[Ce.data]=je;break;case q.DOWN:case q.DOWN_ERROR:ct(q.UP,Ce.data);break;case q.INACTIVE:ct(q.ACTIVE,Ce.data);break;default:te(`Unexpected event in post-event action: ${Ce.data}`)}break;case Oe:Se[Ce.type]=je;break;case v:ct(Oe,Ce.type)}})}function U(){let oe,Se=0;for(oe=0;oe<P.length;++oe){Se<P.length&&(O(oe),Se=P.length);const Ce=P[oe];if(Ce)switch(Ce.type){case j:Ce.error!==void 0?ge._emit(Ce.data,Ce.error):ge._emit(Ce.data);break;case v:break;case Oe:this.requestStartDispatchFSM();break;default:te(`Unhandled post event action type: ${Ce.type}`)}}P=[]}function V(oe,Se,Ce){let je;je=Se!==void 0?{type:oe,data:Se,error:Ce}:{type:oe},P.push(je),P.length,P.length===1&&ee.setPostEventAction(U)}function z(oe){_(oe instanceof N),ge._emit(q.CONNECT_FAILED_ERROR,oe)}function ne(oe){let Se=null;const Ce=oe;if(Ce&&Ce.length>0&&Ce.some(je=>je===$.FAILED||$.REJECTED)&&!ee._sessionInterface.isCapable(p.AD_APP_ACK_FAILED)){const je=`Session.capabilitySettlementOutcomeNotSupported: [ ${Ce.map(Be=>$.nameOf(Be)).join(", ")} ]`;Z(je),Se=new N(je,I.INVALID_OPERATION)}return Se}function de(oe){let Se=null;return ee._replayStartLocation===void 0||ee._sessionInterface.isCapable(p.MESSAGE_REPLAY)?ae.topicEndpointSubscription?Se=function(Ce){let je=null;if(Ce){const Be=Ce.getSubscriptionInfo();Be&&(Be.isShare||Be.isNoExport)&&!ee._sessionInterface.isCapable(p.SHARED_SUBSCRIPTIONS)&&(je=new N("Shared Subscriptions not Supported",I.SHARED_SUBSCRIPTIONS_NOT_SUPPORTED))}return je}(ae.topicEndpointSubscription):ae.requiredSettlementOutcomes&&(Se=ne(ae.requiredSettlementOutcomes)):Se=new N("Message Replay Not Supported",I.REPLAY_NOT_SUPPORTED),Se?oe.transitionTo(ee.Unbound,()=>z(Se)):ae.createIfMissing&&ae.queueDescriptor&&ae.queueDescriptor.durable?oe.transitionTo(ee.CreateSent):oe.transitionTo(ee.BindSent)}function _e(oe,Se=!1){let Ce=null;return ae.requiredSettlementOutcomes&&(Ce=ne(ae.requiredSettlementOutcomes)),Ce?oe.transitionTo(ee.Unbound,()=>z(Ce)):Se?oe.externalTransitionTo(ee.Reconnecting.RBindSent):oe.transitionTo(ee.Reconnecting.RBindSent)}this._addEventToEmit=(oe,Se)=>{(ae.activeIndicationEnabled||oe!==q.INACTIVE&&oe!==q.ACTIVE)&&V(j,oe,Se)},this._requestStartDispatch=()=>{V(Oe)},this._requestStopDispatch=()=>{this.requestStopDispatchFSM(),V(v)},this.unhandledEventReaction(function(oe){switch(oe.getName()){case S.VIRTUALROUTER_NAME_CHANGED:return H("VirtualRouter name change: clearing all acknowledgement state and partition group ID, if any"),ee._resetRemoteConnectionState(),this;case S.FLOW_UNBOUND:return H("Received unsolicited unbind. Flow may be manually reconnected."),this.transitionToUnbound(q.DOWN_ERROR,oe.details);case S.DISPOSE:return ee._dispose(),ee.getCurrentState().terminate();case S.BIND_RESPONSE:return function(Se){const Ce=X.getCorrelationTag(),je=a.AdProtocolMessage.getCloseMessageConsumer(Se.flowId,Ce);X.sendControl(je),X.enqueueRequest(Ce,()=>this.handleAccidentalBind(Se),ae.connectTimeoutInMsecs,null,null)}(oe.details),this;default:return oe.getName(),this.getCurrentState().getName(),this}}),this.initial(function(){return this.transitionTo(ee.Unbound,oe=>{H(`Starting ${oe.getStateMachine().getName()}`)})}),this.Unbound=new B({name:C.UNBOUND,parentContext:ee},{emitDisabledEvent(){ge._emit(q.GM_DISABLED)}}).reaction(S.FLOW_CLOSE,function(){return this.transitionTo(this)}).reaction(S.SESSION_DOWN,function(){return this.transitionTo(this)}).reaction(S.SESSION_DISCONNECT,function(){return this.transitionTo(this)}).reaction(S.FLOW_OPEN,function(){return this.transitionTo(ee.Unbound.AwaitSessionUp)}).reaction(S.SESSION_UP,function(){return ee._sessionInterface.isCapable(p.GUARANTEED_MESSAGE_CONSUME)?this.transitionTo(ee.Unbound.AwaitFlowOpen):(Z(`Consumer is not supported by router for this client on sessionId 0x${ee._sessionInterface.sessionIdHex}`),this.internalTransition(()=>this.emitDisabledEvent()))}).reaction(S.SESSION_UP_NO_AD,function(){return this.internalTransition(()=>this.emitDisabledEvent())}).exit(()=>{ee._connectAttempts=ae.connectAttempts}),this.Unbound.AwaitSessionUp=new B({name:C.UNBOUND_AWAIT_SESSION_UP,parentContext:this.Unbound},{emitBindWaiting(){ge._emit(Q.BIND_WAITING)}}).entry(function(){this.emitBindWaiting()}).reaction(S.SESSION_DOWN,function(){return this.internalTransition()}).reaction(S.SESSION_DISCONNECT,function(){return this.internalTransition()}).reaction(S.SESSION_UP,function(){return de(this)}),this.Unbound.AwaitFlowOpen=new B({name:C.UNBOUND_AWAIT_FLOWOPEN,parentContext:this.Unbound}).reaction(S.FLOW_OPEN,function(){return de(this)}),this.BindSentExtensions={sendBindRequest(){const oe=X.getCorrelationTag(),Se=ee._transportAcks;ee._endpointEnsure();const Ce=ee._endpoint,je=ee._subscription,Be=a.AdProtocolMessage.getOpenMessageConsumer(ae.queueDescriptor,ae.queueProperties,Ce,je,oe,ae.windowSize,ae.noLocal,ae.activeIndicationEnabled,Se.lastAcked,Se.lastReceived,ae.browser,ee._replayStartLocation,ge.endpointErrorId,ge.partitionGroupId,ae.requiredSettlementOutcomes&&ae.requiredSettlementOutcomes.length>0);X.sendControl(Be),X.enqueueRequest(oe,this.handleBindTimeout.bind(this),ae.connectTimeoutInMsecs,null,this.handleBindResponse.bind(this)),ae.queueDescriptor,ae.queueProperties,ae.windowSize,ae.noLocal,ae.activeIndicationEnabled,Se.lastAcked,Se.lastReceived,ae.browser,ee._replayStartLocation,ge.endpointErrorId,ge.partitionGroupId,ae.requiredSettlementOutcomes},cancelBindRequestTimer(){this.bindRequestTimer.cancel()},handleBindTimeout(){H("Bind timeout"),ee.processEvent(new f({name:S.BIND_TIMEOUT}))},handleExpectedBind(oe){let Se=oe.getPartitionGroupId();Se!=null&&Se!=null||(Se=void 0,ee._clearPartitionGroupId());const Ce={lastMsgIdAcked:oe.getLastMsgIdAcked(),flowId:oe.getFlowId(),accessType:(je=oe.getAccessType(),je===void 0?W.EXCLUSIVE:je),topicEndpointBytes:oe.getTopicEndpointBytes(),grantedPermissions:oe.getGrantedPermissions(),allOthersPermissions:oe.getAllOthersPermissions(),respectsTTL:oe.getRespectsTTL(),activeFlow:oe.getActiveFlow(),wantFlowChangeNotify:oe.getWantFlowChangeNotify(),discardBehavior:oe.getQueueDiscardBehavior(),deliveryCountSent:oe.getEndpointDeliveryCountSent(),endpointId:oe.getEndpointId(),maxUnackedMessages:oe.getMaxUnackedMessages(),endpointErrorId:oe.getEndpointErrorId(),spoolerUniqueId:oe.getSpoolerUniqueId(),quota:oe.getQuota(),maxMsgSize:oe.getMaxMsgSize(),maxRedelivery:oe.getMaxRedelivery(),partitionGroupId:Se};var je;if(Object.assign(ge,{accessType:Ce.accessType,queueDiscardBehavior:Ce.discardBehavior,deliveryCountSent:Ce.deliveryCountSent,endpointId:Ce.endpointId,respectsTTL:Ce.respectsTTL,flowId:Ce.flowId,permissions:Ce.grantedPermissions,wantFlowChangeNotify:Ce.wantFlowChangeNotify,endpointErrorId:Ce.endpointErrorId,spoolerUniqueId:Ce.spoolerUniqueId,partitionGroupId:Se}),ee._sessionInterface.isCapable(p.BR_REPLAY_ERRORID)&&(ge.endpointErrorId=Ce.endpointErrorId),Ce.topicEndpointBytes&&Ce.topicEndpointBytes.length){Ce.endpoint=g.createDestinationFromBytes(Ce.topicEndpointBytes),ee._endpoint,ee._endpoint=Ce.endpoint;const ct=ee._consumer._properties;ct.queueDescriptor=new x({name:Ce.endpoint.name,type:ct.queueDescriptor.type,durable:ct.queueDescriptor.durable})}const Be=ee._consumer._properties;Be.queueProperties=new J({respectsTTL:Ce.respectsTTL,permissions:Ce.allOthersPermissions,quotaMB:Ce.quota,maxMessageSize:Ce.maxMsgSize,discardBehavior:Ce.discardBehavior,maxMessageRedelivery:Ce.maxRedelivery,accessType:Ce.accessType}),Be.queueProperties.permissions||(Be.queueProperties.permissions=k.NONE),Object.assign(ee,{_active:Ce.activeFlow,_remoteWindowSize:Ce.maxUnackedMessages}),L.UZERO.eq(ee._transportAcks.lastAcked)?ee._transportAcks.lastAcked=Ce.lastMsgIdAcked||L.UZERO:ee._transportAcks},handleBindResponse(oe){if(oe.msgType!==a.SMFAdProtocolMessageType.BIND)return H(`Unexpected message type in bind response: ${a.SMFAdProtocolMessageType.describe(oe.msgType)}`),ee.processEvent(new f({name:S.FLOW_FAILED},new N(`Unexpected bind response: ${a.SMFAdProtocolMessageType.describe(oe.msgType)}`,I.PROTOTOCOL_ERROR)));const Se=oe.smfHeader,Ce=Se.pm_respcode;if(Ce===null)return this._consumer.incStat(se.RX_DISCARD_SMF_UNKNOWN_ELEMENT),void this._sessionInterface.sessionIdHex;if(Ce!==200){const Be=Se.pm_respstr,ct=E.getADErrorSubcode(Ce,Be);return H("Flow failed (bind):",Ce,Be,I.describe(ct)),ee.processEvent(new f({name:S.FLOW_FAILED},new N(Be,ct,{responseCode:Ce})))}const je={name:S.BIND_RESPONSE};return ee.processEvent(new f(je,oe))}},this.BindSent=new B({name:C.BIND_SENT,parentContext:ee},this.BindSentExtensions).entry(function(){ee._connectAttempts--,this.sendBindRequest(),this.bindRequestTimer=fe.newTimeout(ae.connectTimeoutInMsecs,this.handleBindTimeout)}).reaction(S.SESSION_DOWN,function(){return this.transitionTo(ee.Unbound.AwaitSessionUp)}).reaction(S.SESSION_DISCONNECT,function(){return this.transitionTo(ee.Unbound.AwaitSessionUp,()=>ee._addEventToEmit(q.DOWN))}).reaction(S.FLOW_CLOSE,function(){return this.transitionTo(ee.UnbindSent)}).reaction(S.BIND_TIMEOUT,function(){return ee._connectAttempts,ee._connectAttempts>0?this.externalTransitionTo(ee.BindSent):this.transitionTo(ee.Unbound.AwaitFlowOpen,()=>z(new N("Bind failed due to timeout",I.TIMEOUT)))}).reaction(S.FLOW_FAILED,function(oe){return this.transitionTo(ee.Unbound.AwaitFlowOpen,()=>z(oe.details))}).reaction(S.BIND_RESPONSE,function(oe){return this.handleExpectedBind(oe.details),this.transitionTo(ee.FlowUp)}).reaction(S.FLOW_UP,function(){return this.transitionTo(ee.FlowUp)}).exit(function(){this.cancelBindRequestTimer()}),this.Reconnecting=new B({name:C.RECONNECTING,parentContext:ee}).entry(function(){this._errorCausingReconnect,ee._errorCausingReconnect,ge._emit(q.RECONNECTING,ee._errorCausingReconnect),ee._connectAttempts=ae.connectAttempts,ee.reconnectAttempts=ae.reconnectAttempts}).initial(function(){return _e(this,!1)}).reaction(S.SESSION_DISCONNECT,function(){return this.transitionTo(ee.Reconnecting.RAwaitSessionUp)}).reaction(S.SESSION_DOWN,function(){return this.transitionTo(ee.Reconnecting.RAwaitSessionUp)}),this.Reconnecting.RAwaitSessionUp=new B({name:C.RECONNECTING_AWAIT_SESSION_UP,parentContext:this.Reconnecting}).reaction(S.SESSION_UP,function(){return ee._connectAttempts=ae.connectAttempts,_e(this,!1)}),this.Reconnecting.RBindSent=new B({name:C.RECONNECTING_BIND_SENT,parentContext:this.Reconnecting},this.BindSentExtensions).entry(function(){ee._connectAttempts--,this.sendBindRequest(),this.bindRequestTimer=fe.newTimeout(ae.connectTimeoutInMsecs,this.handleBindTimeout)}).reaction(S.FLOW_CLOSE,function(){return this.transitionTo(ee.UnbindSent)}).reaction(S.BIND_TIMEOUT,function(){return ee._connectAttempts,ee._connectAttempts>0?_e(this,!0):this.transitionTo(ee.Unbound.AwaitFlowOpen,()=>z(new N("Rebind failed due to timeout",I.TIMEOUT)))}).reaction(S.FLOW_FAILED,function(oe){if(ee.reconnectAttempts>0||ee.reconnectAttempts===-1){if(oe&&oe.details&&oe.details.subcode&&(oe.details.subcode===I.QUEUE_SHUTDOWN||oe.details.subcode===I.TOPIC_ENDPOINT_SHUTDOWN||oe.details.subcode===I.GM_UNAVAILABLE))return ee.reconnectAttempts,oe.details.subcode,this.transitionTo(ee.Reconnecting.RAwaitTimer)}else ee.reconnectAttempts;return this.transitionTo(ee.Unbound.AwaitFlowOpen,()=>{return Se=oe.details,_(Se instanceof N),void ge._emit(q.DOWN_ERROR,Se);var Se})}).reaction(S.BIND_RESPONSE,function(oe){return this.handleExpectedBind(oe.details),this.transitionTo(ee.FlowUp,()=>ee._addEventToEmit(q.RECONNECTED))}).reaction(S.FLOW_UP,function(){return this.transitionTo(ee.FlowUp,()=>ee._addEventToEmit(q.RECONNECTED))}).exit(function(){this.cancelBindRequestTimer()}),this.Reconnecting.RAwaitTimer=new B({name:C.RECONNECTING_AWAIT_TIMER,parentContext:this.Reconnecting},{handleReconnectIntervalTimeout(){ee.processEvent(new f({name:S.RECONNECT_INTERVAL_TIMEOUT}))},cancelReconnectIntervalTimer(){this.reconnectIntervalTimer.cancel()}}).entry(function(){ee.reconnectAttempts>0&&--ee.reconnectAttempts,ae.reconnectIntervalInMsecs,ee.reconnectAttempts,this.reconnectIntervalTimer=fe.newTimeout(ae.reconnectIntervalInMsecs,this.handleReconnectIntervalTimeout)}).exit(function(){this.cancelReconnectIntervalTimer()}).reaction(S.RECONNECT_INTERVAL_TIMEOUT,function(){return ee._connectAttempts=ae.connectAttempts,_e(this,!1)});const we=this.FlowUp=new B({name:C.FLOW_UP,parentContext:ee}).initial(function(){return this.transitionTo(ee._active===0?we.XferInactive:we.Xfer)}).entry(()=>{ee._replayStartLocation=void 0,ee._errorCausingReconnect?ee._errorCausingReconnect=null:ee._addEventToEmit(q.UP)}).reaction(S.SESSION_DOWN,function(){return this.transitionTo(ee.Unbound.AwaitSessionUp)}).reaction(S.SESSION_DISCONNECT,function(){return this.transitionTo(ee.Unbound.AwaitSessionUp,()=>ee._addEventToEmit(q.DOWN))}).reaction(S.FLOW_CLOSE,function(){return this.transitionTo(ee.UnbindSent)}).reaction(S.FLOW_UNBOUND,oe=>ee.transitionToUnboundFromUp(ae,q.DOWN_ERROR,oe.details));we.Xfer=new B({name:C.FLOW_UP_XFER,parentContext:we}).entry(()=>{ee._addEventToEmit(q.ACTIVE),ee._sendAcks(!0),ee._requestStartDispatch()}).exit(()=>{ee._addEventToEmit(q.INACTIVE),ee._requestStopDispatch()}).reaction(S.SESSION_DISCONNECT,function(){return ee._sendAcks(!0),this.eventUnhandled()}),we.XferInactive=new B({name:C.FLOW_UP_XFER_INACTIVE,parentContext:we}).reaction(S.FLOW_ACTIVE_IND,function(){return this.transitionTo(we.Xfer)}),this.UnbindSent=new B({name:C.UNBIND_SENT,parentContext:ee},{sendUnbindRequest(){ee._endpointClear();try{const oe=X.getCorrelationTag(),Se=a.AdProtocolMessage.getCloseMessageConsumer(ge.flowId,oe);X.sendControl(Se),X.enqueueRequest(oe,()=>this.handleUnbindTimeout(),ae.connectTimeoutInMsecs,null,Ce=>this.handleUnbindResponse(Ce)),H("Sent consumer unbind request with arguments",{flowId:ge.flowId,correlationTag:oe})}catch(oe){H(`Exception in sendUnbindRequest while trying to send unbind request: ${oe}`),X.getCurrentStateName(),ee.processEvent(new f({name:S.FLOW_UNBOUND}))}},handleUnbindTimeout:()=>(H("Unbind timeout"),ee.processEvent(new f({name:S.UNBIND_TIMEOUT}))),handleUnbindResponse(oe){oe.msgType!==a.SMFAdProtocolMessageType.UNBIND&&H(`Unexpected message type in bind response: ${a.SMFAdProtocolMessageType.describe(oe.msgType)}`);const Se=oe.smfHeader.pm_respcode,Ce=oe.smfHeader.pm_respstr,je=E.getADErrorSubcode(Se,Ce);return ge.endpointErrorId=oe.getEndpointErrorId(),H("Flow failed (unbind):",Se,Ce,I.describe(je)),ee.processEvent(new f({name:S.FLOW_UNBOUND},new N(Ce,je,Se)))}}).entry(function(){this.sendUnbindRequest()}).reaction(S.UNBIND_TIMEOUT,function(){return this.externalTransitionTo(ee.UnbindSent)}).reaction(S.FLOW_UNBOUND,()=>ee.transitionToUnbound(q.DOWN)),this.CreateSent=new B({name:C.CREATE_SENT,parentContext:ee},{sendCreateRequest(){const oe=X.getCorrelationTag(),Se=a.AdProtocolMessage.getCreate(ae.queueDescriptor,ae.queueProperties,oe);X.sendControl(Se),X.enqueueRequest(oe,this.handleCreateTimeout.bind(this),ae.connectTimeoutInMsecs,null,this.handleCreateResponse.bind(this))},handleCreateTimeout(){H("Create timeout"),ee.processEvent(new f({name:S.CREATE_TIMEOUT}))},handleCreateResponse(oe){if(oe.msgType!==a.SMFAdProtocolMessageType.CREATE)return H(`Unexpected message type in create response: ${a.SMFAdProtocolMessageType.describe(oe.msgType)}`),ee.processEvent(new f({name:S.CREATE_FAILED},new N(`Unexpected create response: ${a.SMFAdProtocolMessageType.describe(oe.msgType)}`,I.PROTOTOCOL_ERROR)));const Se=oe.smfHeader,Ce=Se.pm_respcode;if(Ce!==200){const Be=Se.pm_respstr,ct=E.getADErrorSubcode(Ce,Be);if(H("Endpoint create failed:",Ce,Be,I.describe(ct)),ct===I.ENDPOINT_ALREADY_EXISTS){const Gt={name:S.CREATE_SUCCESS};return ee.processEvent(new f(Gt,oe))}return ee.processEvent(new f({name:S.CREATE_FAILED},new N(Be,ct,{responseCode:Ce})))}const je={name:S.CREATE_SUCCESS};return ee.processEvent(new f(je,oe))}}).entry(function(){this.sendCreateRequest()}).reaction(S.CREATE_TIMEOUT,function(){return this.externalTransitionTo(ee.BindSent)}).reaction(S.CREATE_SUCCESS,function(){return this.externalTransitionTo(ee.BindSent)}).reaction(S.CREATE_FAILED,function(oe){return this.transitionTo(ee.Unbound.AwaitFlowOpen,()=>z(oe.details))})}acceptMessage(he){this.logger;const ge=he.getGuaranteedMessageId(),X=ge.toString(),ae=this._consumer;if(!this._fsmDispatch)return ae.incStat(se.RX_DISCARD_NO_MATCHING_CONSUMER),!1;ae.deliveryCountSent||he.setDeliveryCount(-1);const ee=he._getSpoolerUniqueId();R.INVALID_SUID.eq(ee)?he._setSpoolerUniqueId(ae.spoolerUniqueId):ae.spoolerUniqueId===void 0||R.INVALID_SUID.eq(ae.spoolerUniqueId)?ae.spoolerUniqueId!==void 0&&!R.INVALID_SUID.eq(ae.spoolerUniqueId)||R.INVALID_SUID.eq(ee)||he._setSpoolerUniqueId(R.INVALID_SUID):(ae.spoolerUniqueId.toString(),ee.toString(),ae.spoolerUniqueId=ee);const Re=this._transportAcks,me=Re.tryReceive(ge,he.getGuaranteedPreviousMessageId()),Pe=Re.acksPending>this.maxPendingAcks;switch(me){case Te.OK:break;case Te.DUPLICATE:if(ae.incStat(se.RX_DISCARD_DUPLICATE),this._applicationAcks.has(ge)||this._oldUnacked.has(X))Pe?this._sendAcks(Pe):this._setTransportAckTimer();else{const H=new Map;H.set($.ACCEPTED,[[ge,ge]]),this._sendAck(H)}return!1;case Te.OUT_OF_ORDER:return ae.incStat(se.RX_DISCARD_OUT_OF_ORDER),!1;default:return _(!1,"Unhandled transport ack result",me),!1}return this._applicationAcks.insert(ge,H=>{let Z=!1;if(H)switch(H.state){case d.UNACKED:this._oldUnacked.add(H.key);break;case d.ACKED_NOT_SENT:Z=!0;break;case d.ACKED_SENT:break;default:_(!1,"Unhandled application ack state",d.describe(H.state))}return this._midDispatch=!0,this._messageDispatch.push(he),this._midDispatch=!1,Pe||Z?this._sendAcks(Pe):this._setTransportAckTimer(),!0})}applicationAck(he,ge=!1){this.applicationSettle(he,$.ACCEPTED,ge)}applicationSettle(he,ge=$.ACCEPTED,X=!1){this.logger;const ae=he.toString();switch(ge){case $.FAILED:this._consumer.incStat(se.RX_SETTLE_FAILED);break;case $.REJECTED:this._consumer.incStat(se.RX_SETTLE_REJECTED);break;case $.ACCEPTED:X||this._consumer.incStat(se.RX_SETTLE_ACCEPTED),this._consumer.incStat(se.RX_ACKED)}if(this._oldUnacked.delete(ae)){const ee=new Map;return ee.set(ge,[[he,he]]),void this._sendAck(ee)}this._applicationAcks.updateAckState(he,d.ACKED_NOT_SENT,ge),ge!==$.ACCEPTED?this._sendAcks(!0):this._setTransportAckTimer()}getDestination(){return this._endpointEnsure(),this._destination}isDisconnected(){return!this.getCurrentState()||this.getActiveState(C.UNBOUND)||this.getActiveState(C.UNBOUND_AWAITING_FLOWOPEN)}requestStartDispatchUser(){this._userDispatch=!0,this.applyStartDispatch()}requestStartDispatchFSM(){this._fsmDispatch=!0,this.applyStartDispatch()}applyStartDispatch(){this._userDispatch&&this._fsmDispatch?(this.log(`Starting message dispatch (fsm ${this._fsmDispatch}, user ${this._userDispatch})`),this._messageDispatch.start(),this._localMaxWindowSize=this._localPreferredWindowSize,this._sendAcks(!0)):this.log(`Not starting message dispatch (fsm ${this._fsmDispatch}, user ${this._userDispatch})`)}transitionToUnbound(he,ge){const X=this._consumer;return this.logger,X.userDisconnected,this._clearPartitionGroupId(),this.transitionTo(this.Unbound.AwaitFlowOpen,()=>this._addEventToEmit(he,ge))}transitionToUnboundFromUp(he,ge,X){const ae=this._consumer;if(this.logger,X&&X instanceof N&&X.subcode&&X.subcode===I.REPLAY_STARTED&&(this._transportAcks.reset(),this._applicationAcks.reset()),this._clearPartitionGroupId(),ae.endpointErrorId&&this._sessionInterface.isCapable(p.MESSAGE_REPLAY)){ae.endpointErrorId;const ee=a.AdProtocolMessage.getUnbindAck(ae._flowId,ae.endpointErrorId,this._transportAcks.lastAcked);this._sessionInterface.sendControl(ee)}return(he.reconnectAttempts===-1||he.reconnectAttempts>0)&&X&&X instanceof N&&X.subcode&&(X.subcode===I.REPLAY_STARTED||X.subcode===I.GM_UNAVAILABLE)?(this._errorCausingReconnect=X,this.transitionTo(this.Reconnecting)):this.transitionTo(this.Unbound.AwaitFlowOpen,()=>this._addEventToEmit(ge,X))}requestStopDispatchUser(){this._userDispatch=!1,this.log(`Stop dispatch user (fsm ${this._fsmDispatch}, user ${this._userDispatch})`),this._messageDispatch.stop()}requestStopDispatchFSM(){this._fsmDispatch=!1,this.log(`Stop dispatch FSM (fsm ${this._fsmDispatch}, user ${this._userDispatch})`),this._sendAcks(!0)}_clearTransportAckTimer(){this._transportAckTimer&&(clearTimeout(this._transportAckTimer),this._transportAckTimer=null)}_dispose(){this._clearTransportAckTimer(),this._endpointClear(),this._destination=void 0,this._unacked=null,this._messageDispatch=null,this._transportAcks=null,this._consumer=null,this._sessionInterface=null}_endpointClear(){this._endpoint=void 0,this._subscription=void 0}_endpointEnsure(){if(this._endpoint)return;const he=this._sessionInterface,ge=this._consumer._properties,{queueDescriptor:X}=ge;let ae,ee,Re;X.type===F.QUEUE?(ae=he.createDestinationFromDescriptor(X),ee=new T({name:ae.name,type:m.QUEUE,offset:0,bytes:ae.bytes.substr(ae.offset)}),Re=void 0):(ee=X.name?he.createDestinationFromDescriptor(X):new y({name:"\0?",offset:0,bytes:"\0"}),Re=ge.topicEndpointSubscription||he.createTemporaryDestination(m.TOPIC),ae=Re),Object.assign(this,{_destination:ae,_endpoint:ee,_subscription:Re}),ge.queueDescriptor=new x({name:ee.name,type:X.type,durable:X.durable})}_resetLocalConnectionState(){Object.assign(this,{_remoteWindowSize:0,_active:void 0,_fsmDispatch:!1,_userDispatch:!0})}_clearPartitionGroupId(){this.logger,this._consumer.partitionGroupId=void 0}_resetRemoteConnectionState(){this.logger,this._transportAcks=new ce,this._applicationAcks=new l(512),this._oldUnacked=new Set,this._consumer.endpointErrorId=void 0,this._consumer.partitionGroupId=void 0}_sendAck(he){const ge=a.AdProtocolMessage.getAck(this._consumer.flowId,this._transportAcks.lastReceived,this.windowSize,he);this._sessionInterface.sendControl(ge)}_addAckToRanges(he,ge=null){const X=he.currentRange,ae=he.ackRanges,ee=$.values,Re=X.length;if(ge&&ge.state!==d.UNACKED){if(Re===0||Re>0&&X[Re-1].settlementOutcome===ge.settlementOutcome)return void X.push(ge);if(Re>0&&X[Re-1].settlementOutcome!==ge.settlementOutcome)return ae[X[Re-1].settlementOutcome].push(X),he.currentRange=[],void he.currentRange.push(ge)}Re&&ae[X[Re-1].settlementOutcome].push(X);let me=0;for(let Pe=0;Pe<ee.length;Pe++)me+=ae[ee[Pe]].length;if(ge===null||me===a.AdProtocolMessage.MAX_CLIENT_ACK_RANGES){const Pe=new Map;let H=!1;for(let Z=0;Z<ee.length;Z++)ae[ee[Z]].length>0&&(Pe.set(ee[Z],ae[ee[Z]].map(te=>[te[0].id,te[te.length-1].id])),H=!0);if(H||he.forceTransportAck){this.logger,this._sendAck(Pe);const Z=Pe.get($.FAILED),te=Pe.get($.REJECTED);this._transportAcks.lastReceived,Pe.has($.ACCEPTED)&&Pe.get($.ACCEPTED).map(ie=>`[${ie[0]}..${ie[1]}]`),Pe.has($.FAILED)&&(Z[0][0],Z[0][1]),Pe.has($.REJECTED)&&(te[0][0],te[0][1]),this._transportAcks.setAcked(),he.forceTransportAck=!1}for(let Z=0;Z<ee.length;Z++)ae[ee[Z]].forEach(te=>{te.forEach(ie=>{if(ie.state!==d.ACKED_SENT)try{this._applicationAcks.updateAckState(ie.id,d.ACKED_SENT)}catch(j){const{LOG_ERROR:Oe}=this.logger;Oe(`Marking ack ${ie.id} as sent failed: ${j}`)}})});he.ackRanges=[];for(let Z=0;Z<ee.length;Z++)he.ackRanges[ee[Z]]=[]}he.currentRange=[]}_sendAcks(he=!1){this._clearTransportAckTimer();const ge=this._applicationAcks,X=this._transportAcks,ae=$.values,ee={forceTransportAck:he||X.acksPending>0,ackRanges:[],currentRange:[]};for(let me=0;me<ae.length;me++)ee.ackRanges[ae[me]]=[];const Re=this._applicationAcks.front();this._oldUnacked.size===0&&Re&&Re.state!==d.UNACKED&&this._addAckToRanges(ee,Ee),ge.forEach(me=>this._addAckToRanges(ee,me)),this._addAckToRanges(ee),_(ee.forceTransportAck===!1),_(ee.currentRange.length===0);for(let me=0;me<ae.length;me++)_(ee.ackRanges[ae[me]].length===0)}_setTransportAckTimer(){this._transportAckTimer||this._consumer.disposed||(this._transportAckTimer=setTimeout(()=>this._sendAcks(!0),this._acknowledgeTimeoutInMsecs))}get maxWindowSize(){return Math.min(this._localMaxWindowSize,this._remoteWindowSize||Number.POSITIVE_INFINITY)}get windowSize(){return this.maxWindowSize-this._messageDispatch.length}get maxPendingAcks(){return this.windowSize*this._acknowledgeThreshold/100}get hasAutoAckSupport(){return this._hasAutoAckSupport}}},3561:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.ConsumerStateNames=a.new({UNBOUND:"UNBOUND",UNBOUND_AWAIT_SESSION_UP:"UNBOUND_AWAIT_SESSION_UP",UNBOUND_AWAIT_FLOWOPEN:"UNBOUND_AWAIT_FLOWOPEN",UNBOUND_AWAIT_ANY:"UNBOUND_AWAIT_ANY",BIND_SENT:"BIND_SENT",FLOW_UP:"FLOW_UP",FLOW_UP_XFER:"FLOW_UP_XFER",FLOW_UP_XFER_INACTIVE:"FLOW_UP_XFER_INACTIVE",UNBIND_SENT:"UNBIND_SENT",RECONNECTING:"RECONNECTING",RECONNECTING_BIND_SENT:"RECONNECTING_BIND_SENT",RECONNECTING_AWAIT_SESSION_UP:"RECONNECTING_AWAIT_SESSION_UP",RECONNECTING_AWAIT_TIMER:"RECONNECTING_AWAIT_TIMER",CREATE_SENT:"CREATE_SENT"})},4590:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.MessageConsumerAcknowledgeMode=a.new({AUTO:"AUTO",CLIENT:"CLIENT"})},6934:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.MessageConsumerEventName=a.new({UP:"MessageConsumerEventName_up",DOWN:"MessageConsumerEventName_down",ACTIVE:"MessageConsumerEventName_active",INACTIVE:"MessageConsumerEventName_inactive",DOWN_ERROR:"MessageConsumerEventName_downError",RECONNECTING:"MessageConsumerEventName_reconnecting",RECONNECTED:"MessageConsumerEventName_reconnected",CONNECT_FAILED_ERROR:"MessageConsumerEventName_connectFailedError",GM_DISABLED:"MessageConsumerEventName_GMDisabled",DISPOSED:"MessageConsumerEventName_disposed",MESSAGE:"MessageConsumerEventName_message",SUBSCRIPTION_OK:"MessageConsumerEventName_ok",SUBSCRIPTION_ERROR:"MessageConsumerEventName_error"})},3247:(o,h,r)=>{var a=r(2195);const{ErrorSubcode:u}=r(6706);o.exports.MessageConsumerEvent=class{constructor(l,d,_=void 0,p=0,f=void 0,S=void 0){this._messageConsumerEventName=l,this._infoStr=d,this._responseCode=_,this._errorSubcode=p,this._correlationKey=f,this._reason=S}get messageConsumerEventName(){return this._messageConsumerEventName}get name(){return this._messageConsumerEventName}get infoStr(){return this._infoStr}get responseCode(){return this._responseCode}get errorSubcode(){return this._errorSubcode}get subcode(){return this._errorSubcode}get correlationKey(){return this._correlationKey}get reason(){return this._reason}set reason(l){this._reason=l}get requestEventCode(){}inspect(){return{messageConsumerEventName:this.messageConsumerEventName,infoStr:this.infoStr,responseCode:this.responseCode,errorSubcode:u.describe(this.errorSubcode),correlationKey:this.correlationKey?this.correlationKey.toString():null,reason:this.reason?this.reason:null}}toString(){return a(this)}}},6681:(o,h,r)=>{const{AbstractQueueDescriptor:a,QueueDescriptor:u,QueueDescriptorValidator:l,QueueProperties:d,QueuePropertiesValidator:_,QueueType:p}=r(9631),{APIPropertiesValidators:f}=r(968),{Check:S}=r(802),{MessageConsumerAcknowledgeMode:C}=r(4590),{OperationError:g,ErrorSubcode:m}=r(6706),{ReplayStartLocation:T}=r(9309),{validateInstance:y,valBoolean:E,valInstance:I,valIsMember:N,valNumber:A,valRange:L,valTopicStringOrEmpty:D}=f;function q(Q,W){if(W.queueDescriptor.getType()===p.TOPIC_ENDPOINT){if(W.queueDescriptor.isDurable()&&!W.createIfMissing&&!W.topicEndpointSubscription)throw new g("topicEndpointSubscription must be set when queueDescriptor refers to a durable topic endpoint and not allowed to create.",m.PARAMETER_CONFLICT)}else if(W.topicEndpointSubscription)throw new g("topicEndpointSubscription is set, but queueDescriptor refers to a queue that is not of type QueueType.TOPIC_ENDPOINT",m.PARAMETER_CONFLICT)}const Y={validate(Q,W,x){if(Object.prototype.hasOwnProperty.call(x,"transportAcknowledgeTimeoutInMsecs")&&Object.prototype.hasOwnProperty.call(x,"acknowledgeTimeoutInMsecs"))throw new g(`${Q} validation: transportAcknowledgeTimeoutInMsecs and acknowledgeTimeoutInMsecs are mutually exclusive`,m.PARAMETER_CONFLICT);if(Object.prototype.hasOwnProperty.call(x,"transportAcknowledgeThresholdPercentage")&&Object.prototype.hasOwnProperty.call(x,"acknowledgeThreshold"))throw new g(`${Q} validation: transportAcknowledgeThresholdPercentage and acknowledgeThreshold are mutually exclusive`,m.PARAMETER_CONFLICT);const k=y.bind(null,Q,W);if(!(W.queueDescriptor instanceof a||W.queueDescriptor instanceof u))throw new g(`${Q} validation: queue descriptor must be an AbstractQueueDescriptor or a QueueDescriptor`,m.PARAMETER_INVALID_TYPE);if(l.validate(W.queueDescriptor),W.queueProperties){if(W.queueDescriptor.durable&&!W.createIfMissing)throw new g(`${Q} validation: queueProperties cannot be set unless queueDescriptor refers to a temporary queue, or createIfMissing is set.`,m.PARAMETER_CONFLICT);if(k("queueProperties",[I,d,"QueueProperties"]),_.validate(W.queueProperties),!W.queueDescriptor.durable&&S.something(W.queueProperties.accessType))throw new g(`${Q} validation: queueProperties cannot specify accessType in creation of a temporary queue`,m.PARAMETER_CONFLICT)}if(W.queueDescriptor.type===p.TOPIC_ENDPOINT){if(W.queueDescriptor.durable&&!W.createIfMissing&&!W.topicEndpointSubscription)throw new g(`${Q} validation: topicEndpointSubscription must be set for durable topic endpoints unless creation is allowed.`,m.PARAMETER_CONFLICT)}else if(W.topicEndpointSubscription)throw new g(`${Q} validation: topicEndpointSubscription cannot be set unless descriptor.type is TOPIC_ENDPOINT`,m.PARAMETER_CONFLICT);if(k("connectTimeoutInMsecs",[A],[L,50,Number.MAX_VALUE]),k("connectAttempts",[A],[L,1,Number.MAX_VALUE]),k("topicEndpointSubscription",[q],[D]),k("acknowledgeMode",[N,C,"MessageConsumerAcknowledgeMode"]),k("transportAcknowledgeTimeoutInMsecs",[A],[L,20,1500]),k("transportAcknowledgeThresholdPercentage",[A],[L,1,75]),k("activeIndicationEnabled",[E]),k("noLocal",[E]),k("windowSize",[A],[L,1,255]),k("reconnectIntervalInMsecs",[A],[L,50,Number.MAX_VALUE]),W.activeIndicationEnabled&&W.queueDescriptor.type!==p.QUEUE)throw new g(`${Q} validation: activeIndicationEnabled may only be true for QUEUE destinations`,m.PARAMETER_CONFLICT);if(W.replayStartLocation&&!(W.replayStartLocation instanceof T))throw new g(`${Q} validation: replayStartLocation must be an instance of ReplayStartLocation`,m.PARAMETER_INVALID_TYPE)}};o.exports.MessageConsumerPropertiesValidator=Y},2558:(o,h,r)=>{const a=r(9631),{APIProperties:u}=r(968),{Check:l}=r(802),{MessageConsumerAcknowledgeMode:d}=r(4590),{Topic:_}=r(9620),p={queueDescriptor:void 0,queueProperties:void 0,connectTimeoutInMsecs:1e4,connectAttempts:3,topicEndpointSubscription:void 0,acknowledgeMode:d.AUTO,requiredSettlementOutcomes:[],transportAcknowledgeTimeoutInMsecs:1e3,transportAcknowledgeThresholdPercentage:60,activeIndicationEnabled:!1,noLocal:!1,windowSize:255,_browser:!1,replayStartLocation:void 0,reconnectAttempts:-1,reconnectIntervalInMsecs:3e3,createIfMissing:!1};o.exports.MessageConsumerProperties=class extends u{constructor(f){super(p,f)}get queueDescriptor(){return l.something(this._queueDescriptor)?this._queueDescriptor:p.queueDescriptor}set queueDescriptor(f){f instanceof a.AbstractQueueDescriptor?this._queueDescriptor=f:this._queueDescriptor=f&&(f.name?new a.QueueDescriptor(f):new a.AbstractQueueDescriptor(f))}get queueProperties(){return l.something(this._queueProperties)?this._queueProperties:p.queueProperties}set queueProperties(f){this._queueProperties=f&&new a.QueueProperties(f)}get connectTimeoutInMsecs(){return l.something(this._bindTimeoutInMsecs)?this._bindTimeoutInMsecs:p.connectTimeoutInMsecs}set connectTimeoutInMsecs(f){this._bindTimeoutInMsecs=f}get connectAttempts(){return l.something(this._connectAttempts)?this._connectAttempts:p.connectAttempts}set connectAttempts(f){this._connectAttempts=f}get topicEndpointSubscription(){return this._topicEndpointSubscription}set topicEndpointSubscription(f){this._topicEndpointSubscription=typeof f=="string"?_.createFromName(f):f}get acknowledgeMode(){return l.something(this._acknowledgeMode)?this._acknowledgeMode:p.acknowledgeMode}set acknowledgeMode(f){this._acknowledgeMode=f}get requiredSettlementOutcomes(){return l.something(this._requiredSettlementOutcomes)&&l.array(this._requiredSettlementOutcomes)?this._requiredSettlementOutcomes:p.requiredSettlementOutcomes}set requiredSettlementOutcomes(f){this._requiredSettlementOutcomes=f}get acknowledgeTimeoutInMsecs(){return l.something(this._transportAcknowledgeTimeoutInMsecs)?this._transportAcknowledgeTimeoutInMsecs:p.transportAcknowledgeTimeoutInMsecs}set acknowledgeTimeoutInMsecs(f){this._transportAcknowledgeTimeoutInMsecs=f}get acknowledgeThreshold(){return l.something(this._transportAcknowledgeThresholdPercentage)?this._transportAcknowledgeThresholdPercentage:p.transportAcknowledgeThresholdPercentage}set acknowledgeThreshold(f){this._transportAcknowledgeThresholdPercentage=f}get transportAcknowledgeTimeoutInMsecs(){return l.something(this._transportAcknowledgeTimeoutInMsecs)?this._transportAcknowledgeTimeoutInMsecs:p.transportAcknowledgeTimeoutInMsecs}set transportAcknowledgeTimeoutInMsecs(f){this._transportAcknowledgeTimeoutInMsecs=f}get transportAcknowledgeThresholdPercentage(){return l.something(this._transportAcknowledgeThresholdPercentage)?this._transportAcknowledgeThresholdPercentage:p.transportAcknowledgeThresholdPercentage}set transportAcknowledgeThresholdPercentage(f){this._transportAcknowledgeThresholdPercentage=f}get activeIndicationEnabled(){return l.something(this._activeIndicationEnabled)?this._activeIndicationEnabled:p.activeIndicationEnabled}set activeIndicationEnabled(f){this._activeIndicationEnabled=f}get noLocal(){return l.something(this._noLocal)?this._noLocal:p.noLocal}set noLocal(f){this._noLocal=f}get windowSize(){return l.something(this._windowSize)?this._windowSize:p.windowSize}set windowSize(f){this._windowSize=f}get browser(){return l.something(this._browser)?this._browser:p._browser}set browser(f){this._browser=f}get replayStartLocation(){return l.something(this._replayStartLocation)?this._replayStartLocation:p.replayStartLocation}set replayStartLocation(f){this._replayStartLocation=f}get reconnectAttempts(){return l.something(this._reconnectAttempts)?this._reconnectAttempts:p.reconnectAttempts}set reconnectAttempts(f){this._reconnectAttempts=f}get reconnectIntervalInMsecs(){return l.something(this._reconnectIntervalInMsecs)?this._reconnectIntervalInMsecs:p.reconnectIntervalInMsecs}set reconnectIntervalInMsecs(f){this._reconnectIntervalInMsecs=f}get createIfMissing(){return l.something(this._createIfMissing)?this._createIfMissing:p.createIfMissing}set createIfMissing(f){this._createIfMissing=f}}},6598:(o,h,r)=>{var a=r(2195);const u=r(3450),{CapabilityType:l}=r(5024),{ConsumerFSM:d}=r(9035),{ConsumerFSMEvent:_}=r(946),{ConsumerFSMEventNames:p}=r(1699),{ErrorResponseSubcodeMapper:f,ErrorSubcode:S,OperationError:C}=r(6706),{Flow:g,FlowOperation:m}=r(8860),{MessageConsumerEvent:T}=r(3247),{MessageOutcome:y}=r(6247),{MessageConsumerEventName:E}=r(6934),{MessageConsumerProperties:I}=r(2558),{MessageConsumerPropertiesValidator:N}=r(6681),{Queue:A,Topic:L}=r(9620),{QueueAccessType:D,QueuePermissions:q,QueueDiscardBehavior:Y}=r(9631);function Q(x){return`MessageConsumerEventName.${E.describe(x)}`}let W=0;o.exports.MessageConsumer=class extends g{constructor({properties:x,sessionInterfaceFactory:k}={}){const J=new I(x);N.validate(J.browser?"QueueBrowserProperties":"MessageConsumerProperties",J,x),super(J,k,{direct:E.MESSAGE,emits:E.values,formatEventName:Q});const F=this.logger.formatter;this.logger.formatter=(...$)=>F("[message-consumer]",...$),this._active=void 0,this._fsm=this._makeFSM(),this.endpointErrorId=void 0,this.partitionGroupId=void 0,this._on(E.ACTIVE,()=>this._onFlowActive(!0)),this._on(E.INACTIVE,()=>this._onFlowActive(!1)),this._on(E.DOWN_ERROR,this._onFlowDisconnected.bind(this)),this._on(E.UP,this._onFlowUp.bind(this)),this._fsm.start()}_makeFSM(){const x=this._properties,k="ConsumerFSM "+W++;return new d({name:k,consumer:this,sessionInterface:this._sessionInterface,properties:x})}start(){this._operationCheck(m.START),this._fsm.requestStartDispatchUser()}stop(){this._operationCheck(m.STOP),this._fsm.requestStopDispatchUser()}connect(){if(this._sessionInterface.getCapability(l.GUARANTEED_MESSAGE_CONSUME)!==null&&!this._sessionInterface.isCapable(l.GUARANTEED_MESSAGE_CONSUME))throw new C("Consumer is not supported by router for this client",S.INVALID_OPERATION,null);super.connect(),this.processFSMEvent(new _({name:p.FLOW_OPEN}))}disconnect(){super.disconnect(),this.processFSMEvent(new _({name:p.FLOW_CLOSE}))}getDestination(){const x=this._fsm.getDestination();return x instanceof A?new A(x):new L(x)}_disconnectSession(){super._disconnectSession(),this.processFSMEvent(new _({name:p.SESSION_DISCONNECT}))}_operationCheck(x){if(super._operationCheck(x),x===m.GET_DESTINATION&&this._isDisconnected())throw new C("Cannot get destination of a disconnected flow",S.INVALID_OPERATION)}applicationAck(x,k=!1){this.logger,this._fsm.applicationAck(x,k)}applicationSettle(x,k){this.logger,y.nameOf(k),this._fsm.applicationSettle(x,k)}getDisposedEvent(){return E.DISPOSED}handleDataMessage(x){this.logger,x.setMessageConsumer(this),this._fsm.acceptMessage(x)}handleUncorrelatedControlMessage(x){const{LOG_INFO:k,LOG_DEBUG:J,LOG_TRACE:F}=this.logger;k("Handling uncorrelated control message");const $=x.msgType,{SMFAdProtocolMessageType:R}=u;switch($){case R.UNBIND:{const B=x.smfHeader.pm_respcode,M=x.smfHeader.pm_respstr,re=f.getADErrorSubcode(B,M);x.getEndpointErrorId(),x.getEndpointErrorId()!==void 0&&(this.endpointErrorId=x.getEndpointErrorId()),this.processFSMEvent(new _({name:p.FLOW_UNBOUND},new C(M,re,B)))}break;case R.FLOWCHANGEUPDATE:this.processFSMEvent(new _({name:p.FLOW_ACTIVE_IND},{active:x.getActiveFlow()}));break;default:R.describe($)}}getProperties(){return super.getProperties()}onVRNChanged(){this.processFSMEvent(new _({name:p.VIRTUALROUTER_NAME_CHANGED}))}get accessType(){return this._accessType}set accessType(x){this._accessType=x}get active(){return this._active}set active(x){x!==this._active&&this._emit(x?E.ACTIVE:E.INACTIVE),this._active=x}get queueDiscardBehavior(){return this._queueDiscardBehavior}set queueDiscardBehavior(x){this._queueDiscardBehavior=x}get respectsTTL(){return this._respectsTTL}set respectsTTL(x){this._respectsTTL=x}get flowId(){return this._flowId}set flowId(x){this._flowId=x}get permissions(){return this._permissions||0}set permissions(x){this._permissions=x}_onFlowActive(x){this.logger,this._flowId,this._active=x}_onFlowDisconnected(x){const{LOG_INFO:k}=this.logger;k(`${this} disconnected: ${x}.message`)}_disposeFSM(){const{LOG_INFO:x}=this.logger;x("Disposing FSM"),this.processFSMEvent(new _({name:p.DISPOSE}))}_onFlowUp(){const{LOG_INFO:x}=this.logger;x(`Flow is up: flowId = ${this._flowId}`)}inspect(){return Object.assign(super.inspect(),{destination:this._destination,accessType:D.describe(this.accessType),permissions:q.describe(this.permissions),respectsTTL:this.respectsTTL,active:this.wantFlowChangeNotify?this.active:"(indications disabled)",wantFlowChangeNotify:this.wantFlowChangeNotify,queueDiscardBehavior:Y.describe(this.queueDiscardBehavior),maxWindowSize:this._fsm.maxWindowSize})}toString(){return a(this)}_isDisconnected(){return this._fsm.isDisconnected()}addSubscription(x,k,J){this._sessionInterface.updateQueueSubscription(x,this._fsm.getDestination(),!0,this,(F,$,R,B)=>{if(F){const M=new T(E.SUBSCRIPTION_OK,B,R,$,k,`Topic: ${x.getName()}`);this._emit(E.SUBSCRIPTION_OK,M)}else{const M=new T(E.SUBSCRIPTION_ERROR,B,R,$,k,`Topic: ${x.getName()}`);this._emit(E.SUBSCRIPTION_ERROR,M)}},J)}removeSubscription(x,k,J){this._sessionInterface.updateQueueSubscription(x,this._fsm.getDestination(),!1,this,(F,$,R,B)=>{if(F){const M=new T(E.SUBSCRIPTION_OK,B,R,$,k,`Topic: ${x.getName()}`);this._emit(E.SUBSCRIPTION_OK,M)}else{const M=new T(E.SUBSCRIPTION_ERROR,B,R,$,k,`Topic: ${x.getName()}`);this._emit(E.SUBSCRIPTION_ERROR,M)}},J)}}},6811:(o,h,r)=>{const{MessageConsumerEventName:a}=r(6934);function u(l){return`MessageConsumerEventName.${a.describe(l)}`}o.exports={MessageDispatcher:class{constructor({emitter:l,autoAck:d,logger:_}={}){Object.assign(this,{emitter:l,queue:[],dispatch:!0,formatEventName:u,logger:_}),this._dispatchOne=d?this._dispatchOneAutoAck:this._dispatchOneBare,this.emitter.setOnFirstDirectListener(this._onFirstMessageListener.bind(this)),this._availableListener=!0}start(){this.dispatch=!0,this._flush()}stop(){this.dispatch=!1}get length(){return this.queue.length}push(l){this.logger,this.queue.push(l),this.dispatch?this._flush():l.getGuaranteedMessageId()}_onFirstMessageListener(){this.logger,this._availableListener||(this.queue.length,this.dispatch,this._availableListener=!0),this._flush()}_flush(){for(this.logger;this.queue.length&&this.dispatch&&this.emitter.directListenerCount()>0;)this._dispatchOne(this.queue.shift());this.queue.length&&this.dispatch&&this.emitter.directListenerCount()===0&&this._availableListener&&(this._availableListener=!1)}_dispatchOneAutoAck(l){const{LOG_WARN:d}=this.logger;let _=null;if(_=this._dispatchOneBare(l),_)d(`Suppressing message acknowledgement for message ${l.getGuaranteedMessageId()} because client threw exception from listener`,_);else{if(l.isAcknowledged)return void d(`Consumer configured to auto-acknowledge messages, but message ${l.getGuaranteedMessageId()} was application acknowledged`);l._autoAcknowledge()}}_dispatchOneBare(l){const{LOG_WARN:d}=this.logger;let _;this.listenerCount===0&&d(`No listeners to dispatch message ${l.getGuaranteedMessageId()}`);try{this.emitter.emitDirect(l)}catch(p){_=this.emitter.formatErrorEvent(p,a.MESSAGE,l),this.emitter.emit("error",_)}return _}}}},8496:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.QueueBrowserEventName=a.new({UP:"QueueBrowserEventName_up",DOWN:"QueueBrowserEventName_down",DOWN_ERROR:"QueueBrowserEventName_downError",CONNECT_FAILED_ERROR:"QueueBrowserEventName_connectFailedError",GM_DISABLED:"QueueBrowserEventName_GMDisabled",DISPOSED:"QueueBrowserEventName_disposed",MESSAGE:"QueueBrowserEventName_message"})},4548:(o,h,r)=>{const a=r(9631),{APIProperties:u}=r(968),{Check:l}=r(802),d={queueDescriptor:void 0,connectTimeoutInMsecs:1e4,connectAttempts:3,windowSize:255,transportAcknowledgeTimeoutInMsecs:1e3,transportAcknowledgeThresholdPercentage:60};o.exports.QueueBrowserProperties=class extends u{constructor(_){super(d,_)}get queueDescriptor(){return l.something(this._queueDescriptor)?this._queueDescriptor:d.queueDescriptor}set queueDescriptor(_){this._queueDescriptor=_&&new a.QueueDescriptor(_)}get connectTimeoutInMsecs(){return l.something(this._bindTimeoutInMsecs)?this._bindTimeoutInMsecs:d.connectTimeoutInMsecs}set connectTimeoutInMsecs(_){this._bindTimeoutInMsecs=_}get connectAttempts(){return l.something(this._connectAttempts)?this._connectAttempts:d.connectAttempts}set connectAttempts(_){this._connectAttempts=_}get windowSize(){return l.something(this._windowSize)?this._windowSize:d.windowSize}set windowSize(_){this._windowSize=_}get transportAcknowledgeTimeoutInMsecs(){return l.something(this._transportAcknowledgeTimeoutInMsecs)?this._transportAcknowledgeTimeoutInMsecs:d.transportAcknowledgeTimeoutInMsecs}set transportAcknowledgeTimeoutInMsecs(_){this._transportAcknowledgeTimeoutInMsecs=_}get transportAcknowledgeThresholdPercentage(){return l.something(this._transportAcknowledgeThresholdPercentage)?this._transportAcknowledgeThresholdPercentage:d.transportAcknowledgeThresholdPercentage}set transportAcknowledgeThresholdPercentage(_){this._transportAcknowledgeThresholdPercentage=_}}},2584:(o,h,r)=>{const{EventEmitter:a}=r(3385),{LogFormatter:u}=r(2694),{MessageConsumerEventName:l}=r(6934),{QueueBrowserEventName:d}=r(8496);function _(p){return`QueueBrowserEventName.${d.describe(p)}`}o.exports.QueueBrowser=class extends a{constructor(p){super({direct:d.MESSAGE,emits:d.values,formatEventName:_}),this._messageConsumer=p,this.logger=new u((...f)=>["[queue-browser]",...f]),this._setupEventListers()}_setupEventListers(){this._messageConsumer.on(l.UP,this._onConsumerUp.bind(this)),this._messageConsumer.on(l.CONNECT_FAILED_ERROR,this._onConsumerConnectFailed.bind(this)),this._messageConsumer.on(l.DOWN,this._onConsumerDown.bind(this)),this._messageConsumer.on(l.DOWN_ERROR,this._onConsumerDownError.bind(this)),this._messageConsumer.on(l.MESSAGE,this._onConsumerMessage.bind(this)),this._messageConsumer.on(l.DISPOSED,this._onConsumerDisposed.bind(this)),this._messageConsumer.on(l.GM_DISABLED,this._onConsumerGMDisabled.bind(this))}_onConsumerMessage(p){this.emit(d.MESSAGE,p)}_onConsumerUp(p){this.emit(d.UP,p)}_onConsumerConnectFailed(p){this.emit(d.CONNECT_FAILED_ERROR,p)}_onConsumerDown(p){this.emit(d.DOWN,p)}_onConsumerDownError(p){this.emit(d.DOWN_ERROR,p)}_onConsumerDisposed(p){this.emit(d.DISPOSED,p)}_onConsumerGMDisabled(p){this.emit(d.GM_DISABLED,p)}connect(){const{LOG_DEBUG:p,LOG_ERROR:f}=this.logger;try{this._messageConsumer.connect()}catch(S){throw f(S.toString()),S}}disconnect(){const{LOG_DEBUG:p,LOG_ERROR:f}=this.logger;try{this._messageConsumer.disconnect()}catch(S){throw f(S.toString()),S}}start(){const{LOG_DEBUG:p,LOG_ERROR:f}=this.logger;try{this._messageConsumer.start()}catch(S){throw f(S.toString()),S}}stop(){const{LOG_DEBUG:p,LOG_ERROR:f}=this.logger;try{this._messageConsumer.stop()}catch(S){throw f(S.toString()),S}}removeMessageFromQueue(p){this._messageConsumer.applicationAck(p._guaranteedMsgId),p._acked=!0}}},1382:(o,h,r)=>{var a=r(2195);const{Enum:u}=r(7444);r(2694);const{Long:l}=r(9783),d=u.new({OK:0,DUPLICATE:1,OUT_OF_ORDER:2});o.exports={TransportAcks:class{constructor(_=0){const p=typeof _=="number"?l.fromNumber(_,!0):l.fromValue(_);this.lastAcked=p,this._acksPending=0}reset(){this._acksPending=0,this.lastAcked=l.ZERO}tryReceive(_,p){return this._lastReceived.lt(p)?(this._lastReceived,d.OUT_OF_ORDER):this._lastReceived.gte(_)?(this._lastReceived,this._acksPending++,d.DUPLICATE):(this._lastReceived=_,this._acksPending++,d.OK)}setAcked(){this._lastAcked=l.fromValue(this._lastReceived),this._acksPending=0}get acksPending(){return this._acksPending}get lastAcked(){return this._lastAcked}set lastAcked(_){_.toString(),Object.assign(this,{_lastAcked:l.fromValue(_),_lastReceived:l.fromValue(_)})}get lastReceived(){return this._lastReceived}toString(){return a(this)}},TransportAckResult:d}},5898:(o,h,r)=>{const{MessagePublisher:a}=r(56),{MessagePublisherAcknowledgeMode:u}=r(6e3),{MessagePublisherEventName:l}=r(3840),{MessagePublisherProperties:d}=r(996),{MessagePublisherPropertiesValidator:_}=r(475),{PublisherFSMEvent:p}=r(9728),{PublisherFSMEventNames:f}=r(3865);o.exports.MessagePublisherAcknowledgeMode=u,o.exports.MessagePublisher=a,o.exports.MessagePublisherProperties=d,o.exports.PublisherFSMEvent=p,o.exports.PublisherFSMEventNames=f,o.exports.MessagePublisherPropertiesValidator=_,o.exports.MessagePublisherEventName=l},1246:(o,h,r)=>{var a=r(2195);const{Long:u}=r(9783),l={_lastAcked:u.fromNumber(0,!0),_lastSent:u.fromNumber(0,!0),_next:u.fromNumber(1,!0)},d=_=>_.toString(10);o.exports.MessageIds=class{constructor(_){Object.assign(this,l,_)}get lastAcked(){return this._lastAcked}set lastAcked(_){this._lastAcked=u.fromValue(_)}get lastSent(){return this._lastSent}setLastSent(_){this._lastSent=u.fromValue(_),this._next=this._lastSent.add(1)}get next(){return this._next}inspect(){return{lastAcked:d(this.lastAcked),lastSent:d(this.lastSent),next:d(this.next)}}toString(){return a(this)}}},6e3:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.MessagePublisherAcknowledgeMode=a.new({PER_MESSAGE:"PER_MESSAGE",WINDOWED:"WINDOWED"})},3840:(o,h,r)=>{const{Enum:a}=r(7444),u=a.new({ACKNOWLEDGED_MESSAGE:"MessagePublisherEventName_acknowledgedMessage",CONNECT_FAILED_ERROR:"MessagePublisherEventName_connectFailedError",CAN_SEND:"MessagePublisherEventName_canSend",DISPOSED:"MessagePublisherEventName_disposed",DOWN:"MessagePublisherEventName_down",FLOW_NAME_CHANGED:"MessagePublisherEventName_flowNameChanged",GUARANTEED_MESSAGING_DOWN:"MessagePublisherEventName_guaranteedMessagingDown",REJECTED_MESSAGE:"MessagePublisherEventName_rejectedMessage",DISCONNECT_FAILED_ERROR:"MessagePublisherEventName_disconnectFailedError",UP:"MessagePublisherEventName_up",TRANSPORT_FULL:"MessagePublisherEventName_transportFull"});o.exports.MessagePublisherEventName=u},475:(o,h,r)=>{const{APIPropertiesValidators:a}=r(968),{MessagePublisherAcknowledgeMode:u}=r(6e3),{validateInstance:l,valBoolean:d,valIsMember:_,valNumber:p,valRange:f}=a,S={validate(C){const g=l.bind(null,"MessagePublisherProperties",C);g("enabled",[d]),g("windowSize",[p],[f,1,255]),g("acknowledgeTimeoutInMsecs",[p],[f,20,6e4]),g("acknowledgeMode",[_,u,"MessagePublisherAcknowledgeMode"]),g("connectRetryCount",[p],[f,0,Number.MAX_VALUE]),g("connectTimeoutInMsecs",[p],[f,50,Number.MAX_VALUE])}};o.exports.MessagePublisherPropertiesValidator=S},996:(o,h,r)=>{const a=r(4386),{APIProperties:u}=r(968),{Check:l}=r(802),{MessagePublisherAcknowledgeMode:d}=r(6e3),{TransportCapabilities:_}=r(8205);function p(){const{ProfileBinding:S}=a,C=S.value.guaranteedMessagingEnabled,g=_.web.webSocket();return C&&g}function f(){return{enabled:p(),windowSize:50,acknowledgeTimeoutInMsecs:2e3,acknowledgeMode:d.PER_MESSAGE,connectRetryCount:3,connectTimeoutInMsecs:5e3}}o.exports.MessagePublisherProperties=class extends u{constructor(S){super(f(),S||{})}get enabled(){return this._enabled}set enabled(S){this._enabled=S}get windowSize(){return l.defined(this._windowSize)?this._windowSize:f().windowSize}set windowSize(S){this._windowSize=S}get acknowledgeTimeoutInMsecs(){return l.defined(this._acknowledgeTimeoutInMsecs)?this._acknowledgeTimeoutInMsecs:f().acknowledgeTimeoutInMsecs}set acknowledgeTimeoutInMsecs(S){this._acknowledgeTimeoutInMsecs=S}get acknowledgeMode(){return this._acknowledgeMode||d.PER_MESSAGE}set acknowledgeMode(S){this._acknowledgeMode=S}get connectRetryCount(){return l.defined(this._connectRetryCount)?this._connectRetryCount:f().connectRetryCount}set connectRetryCount(S){this._connectRetryCount=S}get connectTimeoutInMsecs(){return l.defined(this._connectTimeoutInMsecs)?this._connectTimeoutInMsecs:f().connectTimeoutInMsecs}set connectTimeoutInMsecs(S){this._connectTimeoutInMsecs=S}inspect(){return{enabled:this.enabled,windowSize:this.windowSize,acknowledgeTimeoutInMsecs:this.acknowledgeTimeoutInMsecs,acknowledgeMode:d.describe(this.acknowledgeMode),connectRetryCount:this.connectRetryCount,connectTimeoutInMsecs:this.connectTimeoutInMsecs}}}},56:(o,h,r)=>{var a=r(2195);const u=r(3450),{Flow:l,PrivateFlowEventName:d}=r(8860),{LogFormatter:_}=r(2694),{MessagePublisherEventName:p}=r(3840),{MessagePublisherProperties:f}=r(996),{PublisherFSM:S}=r(2577),{PublisherFSMEvent:C}=r(9728),{PublisherFSMEventNames:g}=r(3865),{LOG_WARN:m}=new _;o.exports.MessagePublisher=class extends l{constructor({properties:T,sessionInterfaceFactory:y}={}){super(new f(T),y,{direct:p.ACKNOWLEDGED_MESSAGE,emits:p.values}),this._fsm=this._makeFSM();const E=new _;E.formatter=function(...I){return["[message-publisher]",...I]},this.log=E.wrap(this.log,this),this._bindWaiting=!0,this.on(d.BIND_WAITING,this._onBindWaiting.bind(this)),this.on(p.CONNECT_FAILED_ERROR,this._onBindFailed.bind(this)),this.on(p.DOWN,this._onDown.bind(this)),this.on(p.UP,this._onUp.bind(this))}_onBindFailed(){this._bindWaiting=!1}_onBindWaiting(){this._bindWaiting=!0}_onDown(){this._bindWaiting=!1}_onUp(){this._bindWaiting=!1}_makeFSM(){return new S({publisher:this,name:"PublisherFSM",sessionInterface:this._sessionInterface,properties:this._properties})}get flowId(){return this._flowId}set flowId(T){this._flowId=T}get name(){return this._flowName}set name(T){this._flowName=T}get publisherId(){return this._publisherId}set publisherId(T){this._publisherId=T}get properties(){return this._properties.clone()}connect(){super.connect(),this._fsm.getCurrentState()||this._fsm.start()}_disconnectSession(){super._disconnectSession(),this.processFSMEvent(new C({name:g.FLOW_CLOSE}))}getDisposedEvent(){return p.DISPOSED}handleAck(T){this.processFSMEvent(new C({name:g.ACK},{ack:T}))}handleNack(T,y){this.processFSMEvent(new C({name:g.ACK},{nack:T,ctrlMessage:y}))}handleUncorrelatedControlMessage(T){const y=T.msgType,{SMFAdProtocolMessageType:E}=u;switch(y){case E.CLIENTACK:{const I=T.getLastMsgIdAcked();T.smfHeader.pm_respcode>299?this.handleNack(I,T):this.handleAck(I);break}case E.CLIENTNACK:{const I=T.getLastMsgIdAcked();this.handleNack(I,T);break}case E.CLOSEPUBFLOW:this.processFSMEvent(new C({name:g.FLOW_UNBOUND}));break;default:m(`Dropping unhandled AD control message for ${this}`,E.describe(y))}}prepareAdMessageAndSend(T){return this._fsm.prepareAdMessageAndSend(T)}isBindWaiting(){return this._bindWaiting}inspect(){return Object.assign(super.inspect(),{name:this.name,publisherId:this.publisherId})}toString(){return a(this)}_disposeFSM(){this.processFSMEvent(new C({name:g.DISPOSE}))}_isDisconnected(){return this._fsm.isDisconnected()}}},3865:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.PublisherFSMEventNames=a.new({SESSION_UP:"PublisherSessionUp",SESSION_UP_NO_AD:"PublisherSessionUpNoAD",SESSION_DOWN:"PublisherSessionDown",FLOW_FAILED:"MessagePublisherFailed",FLOW_UP:"MessagePublisherUp",FLOW_CLOSE:"MessagePublisherClose",FLOW_UNBOUND:"MessagePublisherUnbound",TRANSPORT_FULL:"PublisherTransportFull",ACK:"PublisherAck",ACK_TIMEOUT:"PublisherAckTimeout",BIND_TIMEOUT:"PublisherBindTimeout",UNBIND_TIMEOUT:"PublisherUnbindTimeout",CAN_SEND:"PublisherCanSend",TRANSPORT_ERROR:"PublisherTransportError",RESEND_COMPLETE:"PublisherResendComplete",DISPOSE:"PublisherDispose"})},9728:(o,h,r)=>{const{FsmEvent:a}=r(7414);o.exports.PublisherFSMEvent=class extends a{constructor(u,l,d){super(u),Object.assign(this,l),Object.assign(this,d)}getEventText(){return this._eventText}}},2577:(o,h,r)=>{const a=r(3450),u=r(5024),{ErrorResponseSubcodeMapper:l,ErrorSubcode:d,OperationError:_}=r(6706),{LogFormatter:p}=r(2694),{Long:f}=r(9783),{MessageIds:S}=r(1246),{MessagePublisherAcknowledgeMode:C}=r(6e3),{MessagePublisherEventName:g}=r(3840),{PrivateFlowEventName:m}=r(8860),{PublisherFSMEvent:T}=r(9728),{PublisherFSMEventNames:y}=r(3865),{PublisherStateNames:E}=r(5403),{State:I,StateMachine:N}=r(7414),{StatType:A}=r(5747),{TransportReturnCode:L}=r(8205);o.exports.PublisherFSM=class extends N{constructor({publisher:D,name:q,sessionInterface:Y,properties:Q}={}){super({name:q});const W=this,x=()=>{const R=W.getCurrentState();return R?R.getName():"<not running>"};this.logger=new p((...R)=>[`[session=${Y.sessionIdHex}]`,`[message-publisher-fsm=${D.flowIdDec}]`,`[${x()}]`,...R]),this.log=this.logger.wrap(this.log,this);const{LOG_TRACE:k,LOG_DEBUG:J,LOG_INFO:F,LOG_WARN:$}=this.logger;Object.assign(this,{_publisher:D,_acknowledgeMode:Q.acknowledgeMode,_acknowledgeTimeoutInMsecs:Q.acknowledgeTimeoutInMsecs,_sessionInterface:Y,_windowSize:Q.windowSize,_stateEvents:[]}),this._guaranteedEnabled=Q.enabled,this._sendWindow=Q.windowSize,this._resetConnectedInfo(),this._notifiedWindowClosed=!1,this._transportFlowControlled=!0,this.initial(function(){return this.transitionTo(W.PublisherUnbound,R=>{R.getStateMachine().getName()})}),W.unhandledEventReaction(function(R){switch(R.getName()){case y.FLOW_UNBOUND:return this._guaranteedEnabled=!1,this._publisher.emit(g.GUARANTEED_MESSAGING_DOWN),this.transitionTo(W.PublisherUnbound,B=>{B.getStateMachine().getName()});case y.DISPOSE:case y.TRANSPORT_FULL:case y.CAN_SEND:break;default:R.getName()}return this}),W.PublisherUnbound=new I({name:E.UNBOUND,parentContext:W},{emitDownAndBindWaiting(){D.emit(g.DOWN),D.emit(m.BIND_WAITING)}}).entry(function(){this.emitDownAndBindWaiting(),W._connectRetryCount=Q.connectRetryCount}).reaction(y.FLOW_UNBOUND,function(){return this.internalTransition()}).reaction(y.SESSION_UP,function(){return this.transitionTo(W.PublisherOpenFlowSent)}),W.PublisherOpenFlowSent=new I({name:E.OPENFLOWSENT,parentContext:W},{emitOpenFlowFailedError(R){D.emit(g.CONNECT_FAILED_ERROR,R)},handleOpenFlowResponse(R){const B=R.smfHeader,M=B.pm_respcode;if(R.msgType!==a.SMFAdProtocolMessageType.OPENPUBFLOW)return W.processEvent(new T({name:y.FLOW_FAILED},{returnCode:M,description:`Unexpected response: ${a.SMFAdProtocolMessageType.describe(R.msgType)}`}));if(M===null)return D.incStat(A.RX_DISCARD_SMF_UNKNOWN_ELEMENT),Y.sessionIdHex,null;if(M!==200){const he=B.pm_respstr,ge=l.getADErrorSubcode(M,he);return W.processEvent(new T({name:y.FLOW_FAILED},{subcode:ge,returnCode:M,description:he}))}const re=R.getLastMsgIdAcked(),se=R.getWindow(),fe=R.getFlowId(),ce=R.getFlowName(),Te=R.getPublisherId();if(W._messageIds,se===void 0)return W.processEvent(new T({name:y.FLOW_FAILED},{description:"Window parameter not found"}));if(se>this._windowSize)return W.processEvent(new T({name:y.FLOW_FAILED},{description:"Invalid window negotiation"}));W._sendWindow=se-W._unackedList.length,W._sendWindow<0&&(W._sendWindow=0),Object.assign(W._publisher,{name:ce,flowId:fe,publisherId:Te}),W._guaranteedEnabled=!0,W._connectReason===0||W._connectReason===2?(W._messageIds.setLastSent(re),W._messageIds,W._connectReason,W._connectReason===2&&D.emit(g.FLOW_NAME_CHANGED,{messages:[...W._unackedList],count:W._unackedList.length}),W._connectReason=1,W._unackedList.forEach(he=>{he.getGuaranteedMessageId(),W._renumber(he),he.getGuaranteedMessageId(),W._messageIds.setLastSent(he.getGuaranteedMessageId())})):W._unackedList.forEach(he=>{he.setFlowId(fe),he.setPublisherId(D.publisherId),he.getGuaranteedMessageId()});const Ee=W._sessionInterface.getCapability(u.CapabilityType.MAX_GUARANTEED_MSG_SIZE).getValue();return W._unackedList.forEach(he=>{Ee<he._memoized_payload.length&&$(`Message size ${he._memoized_payload.length} above broker limit ${Ee}`)}),W._unackedList.length?(W._handleAck(re,!1,R,!0),W._firstUnackedToSend=W._unackedList[0]):W._messageIds.lastAcked=f.fromValue(re),W._messageIds,W.processEvent(new T({name:y.FLOW_UP}))},handleOpenFlowTimeout:()=>(F("Open publisher connection timeout"),W.processEvent(new T({name:y.BIND_TIMEOUT}))),handleUnknownFlowName(){return F("Flow name unknown, republish required"),W._resetConnectedInfo(!0),this.externalTransitionTo(W.PublisherOpenFlowSent)},sendOpenFlow(){const R=Y.getCorrelationTag(),B=a.AdProtocolMessage.getOpenMessagePublisher(W._messageIds.lastAcked,W._messageIds.lastSent,Q.windowSize,W._publisher._flowName,R);W._messageIds.lastAcked,W._messageIds.lastSent,Q.windowSize,W._publisher._flowName,Y.sendControl(B),Y.enqueueRequest(R,()=>this.handleOpenFlowTimeout(),Q.connectTimeoutInMsecs,null,M=>this.handleOpenFlowResponse(M))}}).entry(function(){try{this.sendOpenFlow()}catch(R){$(`Exception during bind attempt: ${R}`),W.processEvent(new T({name:y.SESSION_DOWN}))}}).reaction(y.FLOW_CLOSE,function(){return this.transitionTo(W.PublisherCloseFlowSent)}).reaction(y.FLOW_UP,function(){return this.transitionTo(W.PublisherUp)}).reaction(y.SESSION_DOWN,function(){return this.transitionTo(W.PublisherUnbound)}).reaction(y.BIND_TIMEOUT,function(){return W._connectRetryCount>0?(W._connectRetryCount--,this.externalTransitionTo(W.PublisherOpenFlowSent)):(this.emitOpenFlowFailedError({subcode:d.TIMEOUT,description:"Open publisher connection failed due to timeout"}),this.transitionTo(W.PublisherUnbound))}).reaction(y.FLOW_FAILED,function(R){const{subcode:B,returnCode:M,description:re}=R;return R.subcode===d.UNKNOWN_FLOW_NAME?this.handleUnknownFlowName():(this.emitOpenFlowFailedError({event:R,subcode:B,returnCode:M,description:re}),W._resetConnectedInfo(),this.transitionTo(W.PublisherUnbound))}),W.PublisherCloseFlowSent=new I({name:E.CLOSEFLOWSENT,parentContext:W},{handleCloseFlowResponse(R){const B=R.smfHeader,M=B.pm_respcode;return R.msgType!==a.SMFAdProtocolMessageType.CLOSEPUBFLOW?W.processEvent(new T({name:y.FLOW_FAILED},{returnCode:M,description:`Unexpected response: ${a.SMFAdProtocolMessageType.describe(R.msgType)}`})):M===null?(D.incStat(A.RX_DISCARD_SMF_UNKNOWN_ELEMENT),Y.sessionIdHex,null):(M!==200&&W.processEvent(new T({name:y.FLOW_FAILED},{returnCode:M,description:B.pm_respstr})),W.processEvent(new T({name:y.FLOW_UNBOUND})))},handleCloseFlowTimeout:()=>(F("Close publisher connection timeout."),W.processEvent(new T({name:y.UNBIND_TIMEOUT}))),sendCloseFlow(){const R=Y.getCorrelationTag(),B=a.AdProtocolMessage.getCloseMessagePublisher(W._publisher.flowId,R);Y.sendControl(B),Y.enqueueRequest(R,()=>this.handleCloseFlowTimeout(),Q.connectTimeoutInMsecs,null,M=>this.handleCloseFlowResponse(M))}}).entry(function(){return this.sendCloseFlow(),this}).reaction(y.ACK,function(R){return W._handleAckEvent(R),this.internalTransition()}).reaction(y.FLOW_UNBOUND,function(){return this.transitionTo(W.PublisherUnbound)}).reaction(y.FLOW_FAILED,function(){this.transitionTo(W.PublisherUnbound)}).reaction(y.UNBIND_TIMEOUT,function(){return this.transitionTo(W.PublisherCloseFlowSent)}),W.PublisherUp=new I({name:E.UP,parentContext:W},{emitFlowUp(){D.emit(g.UP)}}).initial(function(){return this.transitionTo(W._unackedList.length?W.PublisherRetransmitting:W.PublisherDataXfer)}).entry(function(){return W._scheduleStateEvents(W.PublisherUp,()=>this.emitFlowUp()),this}).reaction(y.ACK,function(R){return W._handleAckEvent(R),this.internalTransition()}).reaction(y.ACK_TIMEOUT,function(){return W._firstUnackedToSend=W._unackedList[0],this.transitionTo(W.PublisherRetransmitting)}).reaction(y.FLOW_CLOSE,function(){return this.transitionTo(W.PublisherCloseFlowSent)}).reaction(y.SESSION_DOWN,function(){return this.transitionTo(W.PublisherUnbound)}).reaction(y.TRANSPORT_FULL,function(){return this.internalTransition()}),W.PublisherDataXfer=new I({name:E.DATA_XFER,parentContext:W.PublisherUp}).entry(()=>{W._transportFlowControlled=!1,W._scheduleStateEvents(W.PublisherDataXfer,()=>W._maybeEmitCanSend())}).reaction(y.TRANSPORT_FULL,function(){return this.transitionTo(W.PublisherFlowControlled)}).exit(()=>{W._transportFlowControlled=!0}),W.PublisherFlowControlled=new I({name:E.FLOW_CONTROLLED,parentContext:W.PublisherUp}).reaction(y.TRANSPORT_FULL,function(){return F("Attempt to send while flow controlled"),this.internalTransition()}).reaction(y.CAN_SEND,function(){return this.transitionTo(W.PublisherRetransmitting)}),W.PublisherRetransmitting=new I({name:E.RETRANSMITTING,parentContext:W.PublisherUp},{retransmit(){try{W._resendFromUnacked()}catch(R){R instanceof _&&R.subcode===d.INSUFFICIENT_SPACE?W.processEvent(new T({name:y.TRANSPORT_FULL})):(F(`Publisher resendFromUnacked failed: ${R}`),W.processEvent(new T({name:y.FLOW_FAILED})))}}}).entry(function(){this.retransmit()}).reaction(y.RESEND_COMPLETE,function(){return this.transitionTo(W.PublisherDataXfer)}).reaction(y.TRANSPORT_FULL,function(){return W._unackedList.length,this.transitionTo(W.PublisherFlowControlled)})}isDisconnected(){return!this.getCurrentState()||!!this.getActiveState(E.UNBOUND)}prepareAdMessageAndSend(D){if(!this._guaranteedEnabled)throw new _("Session does not provide Guaranteed Message Publish capability",d.GM_UNAVAILABLE,"close flow received from message-router");if(this._sendWindow<=0)throw this._publisher.incStat(A.TX_WINDOW_CLOSED),this._notifiedWindowClosed=!0,new _("Guaranteed Message Window Closed",d.INSUFFICIENT_SPACE);const q=this._unackedList,{LOG_TRACE:Y,LOG_DEBUG:Q,LOG_INFO:W,LOG_WARN:x}=this.logger;D._payload_is_memoized&&(D._payload_is_memoized=!1,D._memoized_csumm=void 0,D._memoized_payload=void 0);const k=D.clone(),J=a.Codec.Encode.adaptMessageToSmf_payloadMemoize(k);var F=0;try{F=this._sessionInterface.getCapability(u.CapabilityType.MAX_GUARANTEED_MSG_SIZE).getValue()}catch(B){W("Can't pre-check payload size, broker not connected yet?"),B.stack}if(0<F&&J>F)throw new _(`Encoded payload size (${J}) exceeds broker size limit (MAX_GUARANTEED_MSG_SIZE, ${F})`,d.MESSAGE_TOO_LARGE);--this._sendWindow,this._renumber(k),this._cloneNumbers(k,D),q.push(k);const $=k.getGuaranteedMessageId();if(this._messageIds.setLastSent($),q.length,this._sendWindow,this._transportFlowControlled)return this._firstUnackedToSend===void 0&&(this._firstUnackedToSend=k),L.OK;let R;try{R=this._sessionInterface.sendToTransport(k),R!==L.OK?R===L.NO_SPACE&&(R=L.OK,this._firstUnackedToSend=k,this.processEvent(new T({name:y.TRANSPORT_FULL}))):k.setRedelivered(!0),this._startAckTimer()}catch(B){throw B instanceof _?(d.describe(B.subcode),B.message,q.pop(),this._messageIds.setLastSent(k.getGuaranteedPreviousMessageId()),++this._sendWindow,B):(B.message,B)}return L.OK}_handleAckEvent(D){this._publisher.incStat(A.TX_ACKS_RXED),this._handleAck(D.ack||D.nack,!!D.nack,D.ctrlMessage)}_handleAck(D,q,Y=void 0,Q=!1){const{_messageIds:W,_unackedList:x}=this,{LOG_DEBUG:k,LOG_INFO:J}=this.logger;if(W.lastAcked.gte(D))return void(Q?this._messageIds:J(`Dropping ack: remote ack for ${D}, local ids ${this._messageIds}`));const F=[];for(;x.length&&D.gte(x[0].getGuaranteedMessageId());)F.push(x.shift());x.indexOf(this._firstUnackedToSend)===-1&&(this._firstUnackedToSend=x[0]),this._sendWindow+=F.length,this._sendWindow,W.lastAcked=D;const $=q?F.pop():null,R=F.length;if(R)if(this._acknowledgeMode===C.PER_MESSAGE){x.length;for(let B=0;B<R;++B)this._publisher.emit(g.ACKNOWLEDGED_MESSAGE,F[B])}else{const B=F[R-1];B.getGuaranteedMessageId(),this._publisher.emit(g.ACKNOWLEDGED_MESSAGE,B)}$&&($.getGuaranteedMessageId(),this._publisher.emit(g.REJECTED_MESSAGE,$,Y)),x.length,x.length?this._resetAckTimer():this._clearAckTimer(),this._maybeEmitCanSend()}_maybeEmitCanSend(){this.logger,this._notifiedWindowClosed&&this._sendWindow!==0&&(this._notifiedWindowClosed=!1,this._publisher.emit(g.CAN_SEND))}_resendFromUnacked(){const{LOG_ERROR:D,LOG_INFO:q,LOG_DEBUG:Y}=this.logger,Q=this._unackedList;let W=Q.indexOf(this._firstUnackedToSend);if(W===-1)return this._firstUnackedToSend&&D(`Could not find first Unacked Messages in unacked message list: msgId = ${this._firstUnackedToSend.getGuaranteedMessageId}`),void(Q.length===0&&(this._messageIds.toString(),this.processEvent(new T({name:y.RESEND_COMPLETE}))));for(Q.length,Q.map(x=>x.getGuaranteedMessageId().toString());W<Q.length;){Q[W].getPublisherId()!==this._publisher.publisherId&&D(`Resending on invalid publisherId '${Q[W].getPublisherId()}'when it should be '${this._publisher.publisherId}'`);const x=this._sessionInterface.sendData(Q[W]);if(x===L.NO_SPACE)return this._firstUnackedToSend=Q[W],q("Publisher sendMessage blocked due to insufficient space, wait for CAN_SEND"),void this.processEvent(new T({name:y.TRANSPORT_FULL}));if(x!==L.OK)return;Q[W].setRedelivered(!0),W++,this._startAckTimer()}this._messageIds.toString(),this.processEvent(new T({name:y.RESEND_COMPLETE}))}_resetConnectedInfo(D=!1){this.logger,this._ackTimer&&this._clearAckTimer(),Object.assign(this,{_messageIds:new S}),Object.assign(this._publisher,{publisherId:void 0,flowId:void 0,flowName:null}),D?this._connectReason=2:(this._unackedList=[],this._connectReason=0)}_clearAckTimer(){this.logger,this._ackTimer&&this._ackTimer,this._ackTimer&&(clearTimeout(this._ackTimer),this._ackTimer=null)}_emitStateEvents(){for(this.logger;this._stateEvents.length;){const D=this._stateEvents.shift(),q=D[0],Y=D[1];this.getActiveState(q.getName())&&Y.apply(q)}}_handleAckTimeout(){this.logger,this._ackTimer=null,this._publisher.incStat(A.TX_ACK_TIMEOUT),this.processEvent(new T({name:y.ACK_TIMEOUT}))}_renumber(D){const q=this._messageIds,Y=q.next;D.setGuaranteedPreviousMessageId(q.lastSent),D.setGuaranteedMessageId(Y);const Q=this._publisher;D.setFlowId(Q.flowId),D.setPublisherId(Q.publisherId)}_cloneNumbers(D,q){q.setGuaranteedPreviousMessageId(D.getGuaranteedPreviousMessageId()),q.setGuaranteedMessageId(D.getGuaranteedMessageId()),q.setFlowId(D.getFlowId()),q.setPublisherId(D.getPublisherId())}_resetAckTimer(){this._clearAckTimer(),this._startAckTimer()}_scheduleStateEvents(D,q){this._stateEvents.push([D,q]),this._setPostEventAction(()=>this._emitStateEvents(),"Emit state events")}_setPostEventAction(D,q="No action"){const{LOG_DEBUG:Y,LOG_WARN:Q}=this.logger;this._postEventAction&&this._postEventAction.desc===q||(this._postEventAction&&this._postEventAction.desc&&Q(`Replacing post event action ${this._postEventAction.desc} with ${q}`),this._postEventAction={action:D||(()=>{}),desc:q},this.setPostEventAction(()=>{this._postEventAction.action(),this._postEventAction=null}))}_startAckTimer(){this._ackTimer||(this._ackTimer=setTimeout(()=>this._handleAckTimeout(),this._acknowledgeTimeoutInMsecs))}}},5403:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.PublisherStateNames=a.new({UNBOUND:"PublisherUnbound",OPENFLOWSENT:"PublisherOpenFlowSent",UP:"PublisherUp",FAILED:"PublisherFailed",CLOSEFLOWSENT:"PublisherCloseFlowSent",DATA_XFER:"PublisherDataXfer",FLOW_CONTROLLED:"MessagePublisherFlowControlled",RETRANSMITTING:"PublisherRetransmitting"})},2288:(o,h,r)=>{const{Baggage:a}=r(9486),{TraceContext:u}=r(5873),{TraceContextSetter:l}=r(7317),{MessageTracingSupport:d}=r(6986);o.exports.Baggage=a,o.exports.TraceContext=u,o.exports.TraceContextSetter=l,o.exports.MessageTracingSupport=d},9486:(o,h,r)=>{const{Parameter:{isStringOrNothing:a}}=r(802);o.exports.Baggage=class{getBaggage(){return this._baggage||null}setBaggage(u){this._setBaggage(a("baggage",u))}_setBaggage(u){this._baggage=u}}},7317:(o,h,r)=>{const{Parameter:a}=r(802),{Convert:u}=r(9783),l=r(8287).hp,{isNumber:d,isBoolean:_,isString:p,isStringOrNothing:f}=a,{uint8ArrayToString:S}=u;class C{constructor(){this._traceId=null,this._spanId=null,this._isSampled=!1,this._traceState=null,this._version=1}clone(){const m=new C;return m._setSpanId(this._spanId),m._setTraceId(this._traceId),m._setSampled(this._isSampled),m._setTraceState(this._traceState),m._setVersion(this._version),m}static get TRACE_ID_BYTES_LENGTH(){return 16}static get SPAN_ID_BYTES_LENGTH(){return 8}get version(){return this._version||1}setVersion(m){this._setVersion(d("version",m))}_setVersion(m){this._version=m}get traceId(){return this._traceId}setTraceId(m){this._setTraceId(p("traceId",m))}_setTraceId(m){this._traceId=m}get spanId(){return this._spanId}setSpanId(m){this._setSpanId(p("spanId",m))}_setSpanId(m){this._spanId=m}get isSampled(){return this._isSampled||!1}setSampled(m){this._setSampled(_("isSampled",m))}_setSampled(m){this._isSampled=m}get traceState(){return this._traceState}setTraceState(m){this._setTraceState(f("traceState",m))}_setTraceState(m){this._traceState=m}static fromTraceContext(m){if(m==null)return null;let T=null;if(l.isBuffer(m)?T=m:typeof m=="string"&&(T=l.from(m,"latin1")),!T||T.length<32)return null;try{const y=new Uint8Array(T).buffer;let E=0;const I=new C,N=y.slice(E,E+1);let A=new DataView(N,0,1).getUint8(E);const L=A>>4;I.setVersion(L);const D=(15&A)==4;I.setSampled(D),E++;const q=y.slice(E,E+16),Y=S(q,"hex");I.setTraceId(Y),E+=C.TRACE_ID_BYTES_LENGTH;const Q=y.slice(E,E+8),W=S(Q,"hex");I.setSpanId(W),E+=C.SPAN_ID_BYTES_LENGTH,E++,E+=4;const x=y.slice(E,E+2),k=new DataView(x,0,x.byteLength).getUint16(0,!1);if(E+=2,k>0){const J=y.slice(E,E+k),F=S(J);I.setTraceState(F)}return I}catch{return null}}}o.exports.TraceContextSetter=C},5873:(o,h,r)=>{const{Parameter:a}=r(802),{Convert:u}=r(9783),{TraceContextSetter:l}=r(7317),{isBoolean:d,isStringOrNothing:_}=a,{stringToUint8Array:p,hexStringToUint8Array:f}=u;class S{constructor(g){this._traceId=_("traceId",g.traceId),this._spanId=_("spanId",g.spanId),this._isSampled=d("isSampled",g.isSampled),this._traceState=g.traceState,this._version=g.version}static clone(g){const m=new l;return m._setSpanId(g.getSpanId()),m._setTraceId(g.getTraceId()),m._setSampled(g.getIsSampled()),m._setTraceState(g.getTraceState()),m._setVersion(g.getVersion()),new S(m)}get version(){return this._version||1}getVersion(){return this.version}get MAX_TRACE_STATE_LENGTH(){return 512}get traceId(){return this._traceId}getTraceId(){return this._traceId}get spanId(){return this._spanId}getSpanId(){return this._spanId}get isSampled(){return this._isSampled}getIsSampled(){return this._isSampled||!1}get traceState(){return this._traceState}getTraceState(){return this._traceState||null}getTruncatedTraceState(){return this._standardTraceStateTruncation(this.MAX_TRACE_STATE_LENGTH)}getEncodedTraceContext(){if(this.traceId==null||this.spanId==null)return null;const g=this.traceState==null?0:this.traceState.length,m=new ArrayBuffer(32+g);let T=0;const y=new DataView(m);let E=0;E|=this.version<<4,E|=this.isSampled?4:0,y.setUint8(T,E,!1),T++;const I=f(this.traceId);for(let A=0;A<16;A++)y.setUint8(T+A,I[A],!1);T+=16;const N=f(this.spanId);for(let A=0;A<8;A++)y.setUint8(T+A,N[A],!1);if(T+=8,y.setUint8(T,1,!1),T++,y.setUint16(T,0,!1),y.setUint16(T+2,0,!1),T+=4,this.traceState==null)y.setUint16(T,0,!1),T+=2;else{const A=this.getTruncatedTraceState();if(A!=null){const L=A.length,D=new Uint16Array([L]);y.setUint16(T,D,!1),T+=2;const q=p(A);for(let Y=0;Y<q.length;Y++)y.setUint8(T+Y,q[Y],!1);T+=q.length}}return new Uint8Array(m)}_standardTraceStateTruncation(g){if(!this._traceState||this._traceState==null)return null;if(this._traceState.length<g)return this._traceState;const m=new Array,T=new Array;let y=0;const E=this._traceState.split(",");for(let I=0;I<E.length;I++){let N=E[I];if(N!==""&&N!=null){let A=N.length;A>128?m.push(N):y+A+(y>0?1:0)<=g?(T.push(N),y+=A+(y>0?1:0)):m.push(N)}}for(let I=0;I<m.length;I++){let N=m[I],A=N.length;y+A+(y>0?1:0)<=g&&(T.push(N),y+=A+(y>0?1:0))}return T.join(",")}toString(){return"{traceId="+this.getTraceId()+", spanId="+this.getSpanId()+", sampled="+this.isSampled+", traceState="+(this.traceState==null?"}":"'"+this.traceState+"'}")}}o.exports.TraceContext=S},6986:(o,h,r)=>{r(2694),r(9486);const{TraceContext:a}=r(5873),{TraceContextSetter:u}=r(7317);o.exports.MessageTracingSupport=class{constructor(){}getTraceContextSetter(){return this._traceContextSetter!=null&&this._traceContextSetter!=null||(this._traceContextSetter=new u),this._traceContextSetter}getTransportContext(){return this._transportContext}_setTransportContext(l){l!=null&&(this._transportContext=new a(l))}getCreationContext(){return this._creationContext}_setCreationContext(l){l!=null&&(this._creationContext=new a(l))}getBaggage(){return this._baggage}_setBaggage(l){this._baggage=l}}},6247:(o,h,r)=>{const{ReplicationGroupMessageId:a,RgmidFactory:u}=r(6475),{Message:l}=r(1884),{MessageCacheStatus:d}=r(7366),{MessageDeliveryModeType:_}=r(177),{MessageDumpFlag:p}=r(3901),{MessageDumpStandardProvider:f}=r(3739),{MessageDumpUtil:S}=r(8892),{MessageType:C}=r(2868),{MessageOutcome:g}=r(568),{MessageUserCosType:m}=r(6676),{SolclientFactory:T}=r(4386);T.createMessage=T.createFactory(()=>new l),T.createReplicationGroupMessageId=T.createFactory(y=>u.fromString(y)),o.exports.Message=l,o.exports.MessageCacheStatus=d,o.exports.MessageDeliveryModeType=_,o.exports.MessageDumpFlag=p,o.exports.MessageDumpStandardProvider=f,o.exports.MessageDumpUtil=S,o.exports.MessageType=C,o.exports.MessageOutcome=g,o.exports.MessageUserCosType=m,o.exports.ReplicationGroupMessageId=a,o.exports.RgmidFactory=u},7366:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.MessageCacheStatus=a.new({LIVE:0,CACHED:1,SUSPECT:2})},177:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.MessageDeliveryModeType=a.new({DIRECT:0,PERSISTENT:1,NON_PERSISTENT:2})},3901:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.MessageDumpFlag=a.new({MSGDUMP_BRIEF:0,MSGDUMP_FULL:1})},3739:(o,h,r)=>{const a=r(199),u=r(8892),{Destination:l}=r(9620),{LOG_ERROR:d}=r(2694),{Long:_}=r(9783),{MessageCacheStatus:p}=r(7366),{MessageDeliveryModeType:f}=r(177),{MessageDumpFlag:S}=r(3901),{MessageUserCosType:C}=r(6676),{SDTMapContainer:g,SDTFieldType:m}=r(769),{StringUtils:T}=r(968),y={fpDestination(E){const I=E.getDestination();return I!==null&&I instanceof l?["Destination",!0,I.toString(),null]:["Destination",!1,"",null]},fpSenderId:E=>["SenderId",E.getSenderId()!==void 0&&E.getSenderId()!==null,E.getSenderId(),null],fpAppmsgType:E=>["AppMessageType",E.getApplicationMessageType()!==void 0&&E.getApplicationMessageType()!==null,E.getApplicationMessageType(),null],fpAppMsgId:E=>["AppMessageID",E.getApplicationMessageId()!==void 0&&E.getApplicationMessageId()!==null,E.getApplicationMessageId(),null],fpSequenceNumber(E){const I=E.getSequenceNumber();return typeof I=="number"?["SequenceNumber",!0,I,null]:["SequenceNumber",!1,"",null]},fpTopicSequenceNumber(E){const I=E.getTopicSequenceNumber();return _.isLong(I)?["TopicSequenceNumber",!0,I.toString(),null]:["TopicSequenceNumber",!1,"",null]},fpCorrelationId:E=>["CorrelationId",E.getCorrelationId()!==void 0&&E.getCorrelationId()!==null,E.getCorrelationId(),null],fpHttpContentType:E=>["HTTP Content Type",E.getHttpContentType()!==void 0&&E.getHttpContentType()!==null,E.getHttpContentType(),null],fpHttpContentEncoding:E=>["HTTP Content Encoding",E.getHttpContentEncoding()!==void 0&&E.getHttpContentEncoding()!==null,E.getHttpContentEncoding(),null],fpSendTimestamp(E){const I=E.getSenderTimestamp();return typeof I=="number"?["SendTimestamp",!0,`${I} (${u.MessageDumpUtil.formatDate(I)})`,null]:["SendTimestamp",!1,"",null]},fpRcvTimestamp(E){const I=E.getReceiverTimestamp();return typeof I=="number"?["RcvTimestamp",!0,`${I} (${u.MessageDumpUtil.formatDate(I)})`,null]:["RcvTimestamp",!1,"",null]},fpClassOfService:E=>typeof E.getUserCos()=="number"?["Class Of Service",!0,C.nameOf(E.getUserCos()),null]:["Class Of Service",!1,"",null],fpDeliveryMode:E=>typeof E.getDeliveryMode()=="number"?["DeliveryMode",!0,f.nameOf(E.getDeliveryMode()),null]:["DeliveryMode",!1,"",null],fpGuaranteedMsgId(E){const I=E.getGuaranteedMessageId();return _.isLong(I)?["Message Id",!0,I.toString(10),null]:["Message Id",!1,"",null]},fpReplicationGroupMessageId(E){const I=E.getReplicationGroupMessageId();return I===void 0?["Replication Group Message Id",!1,"",null]:["Replication Group Message Id",!0,I.toString(),null]},fpTimeToLive(E){const I=E.getTimeToLive();if(typeof I=="number"){const N=u.MessageDumpUtil,A=new Date;return["TimeToLive",!0,`${I} (${N.formatDate(A.getTime()+I)})`,null]}return["TimeToLive",!1,"",null]},fpExpiration(E){const I=E.getGMExpiration();return typeof I=="number"?["Expiration",!0,`${I} (${u.MessageDumpUtil.formatDate(I)})`,null]:["Expiration",!1,"",null]},fpMessageDMQEligible:E=>["DMQ Eligible",E.isDMQEligible(),"",null],fpMessageRedelivered:E=>["Message Re-delivered",E.isRedelivered(),"",null],fpMessageDeliveryCount(E){try{return["Message Delivery Count",!0,E.getDeliveryCount(),null]}catch{return["Message Delivery Count",!1,"",null]}},fpDiscardIndication:E=>["Discard Indication",E.isDiscardIndication(),"",null],fpAckImmediately:E=>["ACK Immediately",E.isAcknowledgeImmediately(),"",null],fpElidingEligible:E=>["Eliding Eligible",E.isElidingEligible(),"",null],fpReplyMessage:E=>["Reply Message",E.isReplyMessage(),"",null],fpReplyTo(E){const I=E.getReplyTo();return I!==null&&I instanceof l?["ReplyTo",!0,I.toString(),null]:["ReplyTo",!1,"",null]},fpDeliverToOne:E=>["Deliver To One",E.isDeliverToOne(),"",null],fpCacheMessage:E=>["Message from cache",E.getCacheStatus()!==p.LIVE,"",null],fpCacheRequestId(E){const I=E.getCacheRequestId();return typeof I=="number"?["Cache Request Id",!0,I,null]:["Cache Request Id",!1,"",null]},fpUserPropertyMap(E,I){const N=E.getUserPropertyMap();if(N!==null&&N instanceof g){const A=`${N.getKeys().length} entries`;let L=null;if(I===S.MSGDUMP_FULL)try{L=u.MessageDumpUtil.printMap(N,2)}catch(D){d(D.message,D.stack),L="Error"}return["User Property Map",!0,A,L]}return["User Property Map",!1,"",null]},fpCorrelationTag(E){const I=E.getCorrelationKey();return["Correlation Tag Pointer",I!=null,I,null]},fpUserData:E=>T.notEmpty(E.getUserData())?["User Data",!0,`len=${E.getUserData().length}`,a.Debug.formatDumpBytes(E.getUserData(),!0,2)]:["User Data",!1,"",null],fpXmlMetadata(E,I){const N=E.getXmlMetadata();if(T.notEmpty(N)){const A=`len=${N.length}`;let L=null;return I===S.MSGDUMP_FULL&&(L=a.Debug.formatDumpBytes(N,!0,2)),["XML Metadata",!0,A,L]}return["XML Metadata",!1,"",null]},fpTracingCreationContext(E,I){const N=E.getCreationContext(),A=N!=null&&N.getTraceId()!=null&&N.getSpanId()!=null;let L=null;return I&&I===S.MSGDUMP_FULL&&(L=N!=null?N.toString():null),["Tracing CreationContext",A,L,null]},fpTracingTransportContext(E,I){const N=E.getTransportContext(),A=N!=null&&N.getTraceId()!=null&&N.getSpanId()!=null;let L=null;return I&&I===S.MSGDUMP_FULL&&(L=N!=null?N.toString():null),["Trace Context SMF Parameter",A,L,null]},fpTracingBaggage(E,I){const N=E.getBaggage()!=null&&E.getBaggage().getBaggage()!=null;let A=null;if(I&&I===S.MSGDUMP_FULL){const L=E.getBaggage();A=L!=null?L.getBaggage():null}return["Tracing Baggage",N,A,null]},fpSdtStream(E,I){const N=E.getSdtContainer();if(N!==null&&N.getType()===m.STREAM){const A=u.MessageDumpUtil,L=`${A.countItems(N.getValue())} entries`;let D=null;if(I===S.MSGDUMP_FULL)try{D=A.printStream(N.getValue(),2)}catch(q){d(q.message,q.stack),D="Error"}return["SDT Stream",!0,L,D]}return["SDT Stream",!1,"",null]},fpSdtMap(E,I){const N=E.getSdtContainer();if(N!==null&&N.getType()===m.MAP){const A=`${N.getValue().getKeys().length} entries`;let L=null;if(I===S.MSGDUMP_FULL)try{L=u.MessageDumpUtil.printMap(N.getValue(),2)}catch(D){d(D.message,D.stack),L="Error"}return["SDT Map",!0,A,L]}return["SDT Map",!1,"",null]},fpBinaryAttachment(E,I){if(!E._binaryAttachment||E._binaryAttachment.length<1)return["Binary Attachment",!1,"",null];const N=E._binaryAttachment.toString("latin1"),A=`len=${N.length}`;let L=null;return I===S.MSGDUMP_FULL&&(L=a.Debug.formatDumpBytes(N,!0,2)),["Binary Attachment",!0,A,L]},fpXmlContent(E,I){const N=E.getXmlContent();if(T.notEmpty(N)){const A=`len=${N.length}`;let L=null;return I===S.MSGDUMP_FULL&&(L=a.Debug.formatDumpBytes(N,!0,2)),["XML",!0,A,L]}return["XML",!1,"",null]}};o.exports.MessageDumpStandardProvider=y},8892:(o,h,r)=>{const a=r(199),u=r(3739),{SDTFieldType:l,SDTMapContainer:d,SDTStreamContainer:_,SDTUnsupportedValueError:p,SDTValueErrorSubcode:f}=r(769),{Check:S}=r(802),{ErrorSubcode:C,OperationError:g}=r(6706),{MessageDumpFlag:m}=r(3901),{StringBuffer:T,StringUtils:y}=r(968),E={get dumpProviders(){const N=u.MessageDumpStandardProvider;return Object.keys(N).map(A=>N[A])}},I={getOutOfRangeValue:N=>typeof N=="string"?`<out of range>
|
|
70
70
|
${a.Debug.formatDumpBytes(N)}`:`<out of range>
|
|
71
|
-
${a.Debug.formatDumpBytes(N.toString("latin1"))}`,getValue(N){let A=null;try{return A=N.getValue(),A}catch(L){if(L instanceof p){if(L.getSubcode()===
|
|
71
|
+
${a.Debug.formatDumpBytes(N.toString("latin1"))}`,getValue(N){let A=null;try{return A=N.getValue(),A}catch(L){if(L instanceof p){if(L.getSubcode()===f.VALUE_OUTSIDE_SUPPORTED_RANGE)return this.getOutOfRangeValue(L.getSourceData())}else if(L instanceof g&&L.subcode===C.PARAMETER_INVALID_TYPE)return"<invalid type>";throw L}},printMap(N,A){if(S.nothing(N)||!(N instanceof d))return null;const L=[],D=y.padRight("",A," ");return N.getKeys().sort().forEach(q=>{const Y=N.getField(q),Q=Y.getType(),W=this.getValue(Y);let x;switch(Q){case l.MAP:x=`
|
|
72
72
|
${this.printMap(W,A+2)}`;break;case l.STREAM:x=`
|
|
73
73
|
${this.printStream(W,A+2)}`;break;case l.BYTEARRAY:x=a.Debug.formatDumpBytes(W.toString("latin1"),!1,0),x!==null&&x.substr(-1)===`
|
|
74
74
|
`&&(x=x.substring(0,x.length-1));break;default:x=W!==null?W.toString():null}L.push(`${D}Key '${q}' (${l.nameOf(Q)}): ${x}`)}),L.join(`
|
|
75
|
-
`)},printStream(N,A){if(S.nothing(N)||!(N instanceof
|
|
75
|
+
`)},printStream(N,A){if(S.nothing(N)||!(N instanceof _))return null;N.rewind();const L=[],D=y.padRight("",A," ");for(;N.hasNext();){const q=N.getNext(),Y=q.getType(),Q=this.getValue(q);let W;switch(Y){case l.MAP:W=`
|
|
76
76
|
${this.printMap(Q,A+2)}`;break;case l.STREAM:W=`
|
|
77
77
|
${this.printStream(Q,A+2)}`;break;case l.BYTEARRAY:W=a.Debug.formatDumpBytes(Q.toString("latin1"),!1,0),W!==null&&W.substr(-1)===`
|
|
78
78
|
`&&(W=W.substring(0,W.length-1));break;case l.DESTINATION:W=Q.toString();break;default:W=Q!==null?Q.toString():null}L.push(`${D}(${l.nameOf(Y)}): ${W}`)}return N.rewind(),L.join(`
|
|
79
|
-
`)},countItems(N){if(S.nothing(N)||!(N instanceof
|
|
79
|
+
`)},countItems(N){if(S.nothing(N)||!(N instanceof _))return 0;N.rewind();let A=0;for(;N.hasNext();)N.getNext(),A++;return N.rewind(),A},formatDate:N=>new Date(N).toString(),dump(N,A,L,D){const q=new T;let Y=`
|
|
80
80
|
`,Q=!1,W=40;return L!=null&&typeof L=="string"&&(Y=L),D!=null&&typeof D=="number"&&(W=D),E.dumpProviders.forEach((x,k)=>{const[J,F,$,R]=x(N,A);F&&(Q&&q.append(Y),$===null||$.length===0?q.append(J):(q.append(y.padRight(`${J}:`,W," ")),q.append($)),R!==null&&A&m.MSGDUMP_FULL&&(q.append(`
|
|
81
81
|
`),R.indexOf(" ")!==0&&q.append(" "),q.append(R),R.substr(-1)!==`
|
|
82
82
|
`&&k<E.dumpProviders.length-1&&q.append(`
|
|
83
|
-
`)),Q=!0)}),q.toString()}};o.exports.MessageDumpUtil=I},568:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.MessageOutcome=a.new({ACCEPTED:0,FAILED:1,REJECTED:3})},2868:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.MessageType=a.new({BINARY:0,MAP:1,STREAM:2,TEXT:3})},6676:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.MessageUserCosType=a.new({COS1:0,COS2:1,COS3:2})},1884:(o,h,r)=>{const{clone:a}=r(968),u=r(4386),{Codec:l}=r(769),{Convert:d}=r(9783),{Destination:f}=r(9620),{ErrorSubcode:p,OperationError:_}=r(6706),{LOG_DEBUG:S,LOG_WARN:C}=r(2694),{MessageCacheStatus:g}=r(7366),{MessageDeliveryModeType:m}=r(177),{MessageDumpFlag:T}=r(3901),{MessageDumpUtil:y}=r(8892),{MessageType:E}=r(2868),{MessageOutcome:I}=r(568),{MessageUserCosType:N}=r(6676),{Parameter:A}=r(802),{RgmidFactory:L}=r(6475),{SDTField:D,SDTFieldType:q,SDTMapContainer:Y,SDTUnsupportedValueError:Q}=r(769),{Baggage:W,MessageTracingSupport:x,TraceContext:k,TraceContextSetter:J}=r(2288),{ProfileBinding:F}=u,{utf8ToUcs2:$,anythingToBuffer:R}=d,{isBoolean:B,isEnumMember:M,isInstanceOf:re,isInstanceOfOrNothing:se,isNumberOrNothing:fe,isStringOrNothing:ce}=A,Te={circular:!1,includeNonEnumerable:!1};function Ee(ge){ge._deliveryMode=m.DIRECT,ge._userCos=N.COS1,ge._cacheStatus=g.LIVE,ge._spoolerUniqueId=void 0,ge._priority=void 0,ge._deliveryCount=-1,ge._traceContextSetter=null,ge._creationContext=null,ge._transportContext=null,ge._baggage=new W}class he extends x{constructor(){super(),Ee(this)}getType(){return this._messageType||E.BINARY}setApplicationMessageId(X){this._applicationMessageId=ce("applicationMessageId",X)}getApplicationMessageId(){return this._applicationMessageId}setApplicationMessageType(X){this._applicationMessageType=ce("applicationMessageType",X)}getApplicationMessageType(){return this._applicationMessageType}getBinaryAttachment(){return this._binaryAttachment&&F.value.byteArrayAsString?this._binaryAttachment.toString("latin1"):this._binaryAttachment}setBinaryAttachment(X){X&&(this._messageType=E.BINARY),this._setBinaryAttachment(R(X))}_setBinaryAttachment(X){this._binaryAttachment=X}getCacheRequestId(){return this._cacheRequestId}_setCacheRequestID(X){this._cacheRequestId=X}getCorrelationId(){return this._correlationId}setCorrelationId(X){this._correlationId=ce("correlationId",X)}getCorrelationKey(){return this._correlationKey||null}setCorrelationKey(X){this._correlationKey=X}isDeliverToOne(){return this._deliverToOne||!1}setDeliverToOne(X){this._setDeliverToOne(this._deliverToOne=B("deliverToOne",X))}_setDeliverToOne(X){this._deliverToOne=X}getDeliveryMode(){return this._deliveryMode}setDeliveryMode(X){this._setDeliveryMode(M("deliveryMode",X,m))}_setDeliveryMode(X){this._deliveryMode=X}getDestination(){return this._destination}setDestination(X){this._setDestination(re("destination",X,f))}_setDestination(X){this._destination=X}isDiscardIndication(){return this._discardIndication||!1}setDiscardIndication(X){this._setDiscardIndication(B("discardIndication",X))}_setDiscardIndication(X){this._discardIndication=X}isElidingEligible(){return this._elidingEligible||!1}setElidingEligible(X){this._setElidingEligible(B("setElidingEligible",X))}_setElidingEligible(X){this._elidingEligible=X}getHttpContentEncoding(){return this._httpContentEncoding}setHttpContentEncoding(X){this._httpContentEncoding=ce("httpContentEncoding",X),this._httpContentEncoding===""&&delete this._httpContentEncoding}getHttpContentType(){return this._httpContentType}setHttpContentType(X){this._httpContentType=ce("httpContentType",X),this._httpContentType===""&&delete this._httpContentType}getPublisherId(){return this._publisherId}setPublisherId(X){this._publisherId=X}getPublisherMessageId(){return this._publisherMsgId}setPublisherMessageId(X){this._publisherMsgId=X}getTimeToLive(){return this._timeToLive}setTimeToLive(X){if(X!=null){if(typeof X!="number"||isNaN(X))throw new _("Invalid type for time to live",p.PARAMETER_INVALID_TYPE);if(X<0||X>31536e7)throw new _("Invalid time to live value",p.PARAMETER_OUT_OF_RANGE);this._timeToLive=X}else this._timeToLive=X}getGMExpiration(){return this._expiration}setGMExpiration(X){this._expiration=fe("GMExpiration",X)}isDMQEligible(){return this._dmqEligible||!1}setDMQEligible(X){this._setDMQEligible(B("DMQEligible",X))}_setDMQEligible(X){this._dmqEligible=X}getFlowId(){return this._flowId}setFlowId(X){this._flowId=X}getGuaranteedPreviousMessageId(){return this._guaranteedPrevMsgId}setGuaranteedPreviousMessageId(X){this._guaranteedPrevMsgId=X}_setSpoolerUniqueId(X){this._spoolerUniqueId=X}_getSpoolerUniqueId(){return this._spoolerUniqueId===void 0?L.INVALID_SUID:this._spoolerUniqueId}getMessageConsumer(){return this._consumer}setMessageConsumer(X){this._consumer=X}getGuaranteedMessageId(){return this._guaranteedMsgId}setGuaranteedMessageId(X){this._guaranteedMsgId=X}_setSpoolerMessageId(X){this._spoolerMessageId=X}getReplicationGroupMessageId(){if(this._spoolerUniqueId===void 0||L.INVALID_SUID.eq(this._spoolerUniqueId))return;const X=this._spoolerMessageId||this._guaranteedMsgId;return L.from({suid:this._spoolerUniqueId,msgid:X})}getTopicSequenceNumber(){return this._topicSequenceNumber}setTopicSequenceNumber(X){this._topicSequenceNumber=X}getDeliveryCount(){if(this._deliveryCount===-1)throw new _("Endpoint does not report delivery count.",p.INVALID_OPERATION);return this._deliveryCount}setDeliveryCount(X){this._deliveryCount=X}settle(X){if(this._acked)throw new _("Message can only be settled once",p.MESSAGE_ALREADY_ACKNOWLEDGED);if(this._deliveryMode===m.DIRECT)throw new _("Cannot settle a DIRECT message",p.MESSAGE_DELIVERY_MODE_MISMATCH);if(!this._consumer)throw new _("Cannot settle a locally-created message",p.MESSAGE_DELIVERY_MODE_MISMATCH);if(!this._consumer._sessionInterface.canAck)throw new _("Cannot settle using associated session",p.SESSION_NOT_CONNECTED);if(!this._consumer.canAck)throw new _("Cannot settle using associated Message Consumer",p.INVALID_OPERATION);if(this._consumer.getProperties().browser)throw new _("Messages delivered to a Queue Browser can only be deleted by calling QueueBrowser.removeMessageFromQueue()",p.INVALID_OPERATION);if(this._consumer._fsm.hasAutoAckSupport)return void C(`Consumer configured to auto-acknowledge messages, so message ${this._guaranteedMsgId} cannot be application settled`);const ae=X;if(I.values.indexOf(ae)===-1)throw new _("Settlement outcome for message must be valid",p.INVALID_OPERATION);const ee=this._consumer.getProperties().requiredSettlementOutcomes.some(Re=>Re===ae);if(ae!=I.ACCEPTED&&!ee)throw new _(`solace.MessageOutcome.${I.nameOf(ae)} not supported for this Message Consumer`,p.INVALID_OPERATION);this._consumer.applicationSettle(this._guaranteedMsgId,ae),this._acked=!0}get isSettled(){return this._acked||!1}_validateBeforeAcknowledge(){if(this._acked)throw new _("Message can only be acknowledged once",p.MESSAGE_ALREADY_ACKNOWLEDGED);if(this._deliveryMode===m.DIRECT)throw new _("Cannot acknowledge a DIRECT message",p.MESSAGE_DELIVERY_MODE_MISMATCH);if(!this._consumer)throw new _("Cannot acknowledge a locally-created message",p.MESSAGE_DELIVERY_MODE_MISMATCH);if(!this._consumer._sessionInterface.canAck)throw new _("Cannot acknowledge using associated session",p.SESSION_NOT_CONNECTED);if(!this._consumer.canAck)throw new _("Cannot acknowledge using associated Message Consumer",p.INVALID_OPERATION);if(this._consumer.getProperties().browser)throw new _("Messages delivered to a Queue Browser can only be deleted by calling QueueBrowser.removeMessageFromQueue()",p.INVALID_OPERATION)}acknowledge(){this._validateBeforeAcknowledge(),this._consumer._fsm.hasAutoAckSupport?C(`Consumer configured to auto-acknowledge messages, so message ${this._guaranteedMsgId} cannot be application acknowledge`):(this._consumer.applicationAck(this._guaranteedMsgId,!1),this._acked=!0)}_autoAcknowledge(){this._validateBeforeAcknowledge(),this._consumer.applicationAck(this._guaranteedMsgId,!0),this._acked=!0}get isAcknowledged(){return this._acked||!1}isAcknowledgeImmediately(){return this._ackImmediately||!1}setAcknowledgeImmediately(X){this._setAcknowledgeImmediately(B("acknowledgeImmediately",X))}_setAcknowledgeImmediately(X){this._ackImmediately=X}getCacheStatus(){return this._cacheStatus}_setCacheStatus(X){this._cacheStatus=X}isReplyMessage(){return this._replyMessage||!1}isRedelivered(){return this._redelivered||!1}setRedelivered(X){this._redelivered=X}setAsReplyMessage(X){this._replyMessage=B("asReplyMessage",X)}getReceiverTimestamp(){return this._receiverTimestamp}getReplyTo(){return this._replyTo}setReplyTo(X){this._replyTo=se("replyTo",X,f)}getSenderId(){return this._senderId}setSenderId(X){this._senderId=ce("senderId",X)}getSenderTimestamp(){return this._senderTimestamp}setSenderTimestamp(X){this._senderTimestamp=fe("senderTimestamp",X)}getSequenceNumber(){if(this._sequenceNumberError)throw this._sequenceNumberError;return this._sequenceNumber}setSequenceNumber(X){X instanceof Q?this._sequenceNumberError=X:(this._sequenceNumber=fe("sequenceNumber",X),this._sequenceNumberError=void 0,this._autoSequenceNumber=!1)}getUserCos(){return this._userCos}getPriority(){return this._priority}setUserCos(X){this._setUserCos(M("userCos",X,N))}_setUserCos(X){this._userCos=X}setPriority(X){if(X!=null){if(typeof X!="number"||isNaN(X))throw new _("Invalid type for message priority",p.PARAMETER_INVALID_TYPE);if(X<0||X>255)throw new _("Invalid priority value",p.PARAMETER_OUT_OF_RANGE);this._setPriority(X)}else this._setPriority(void 0)}_setPriority(X){this._priority=X}getUserData(){return this._userData}setUserData(X){this._setUserData(ce("userData",X))}_setUserData(X){this._userData=X}getXmlContent(){return this._xmlContent}getXmlContentDecoded(){return this._xmlContent?$(this._xmlContent):this._xmlContent}setXmlContent(X){const ae=ce("xmlContent",X);this._xmlContent=ae&&unescape(encodeURIComponent(ae))}_setXmlContentInternal(X){this._xmlContent=ce("xmlContentInternal",X)}setXmlMetadata(X){this._setXmlMetadata(ce("xmlMetadata",X))}_setXmlMetadata(X){this._xmlMetadata=X}getXmlMetadata(){return this._xmlMetadata}get binaryMetadataChunk(){return this._binaryMetaChunk||null}set binaryMetadataChunk(X){this._binaryMetaChunk=X}get smfHeader(){return this._smfHeader}set smfHeader(X){this._smfHeader=X}get hasAutoSequenceNumber(){return this._autoSequenceNumber||!1}set hasAutoSequenceNumber(X){this._autoSequenceNumber=X}get hasAutoSenderTimestamp(){return this._autoSenderTimestamp||!1}set hasAutoSenderTimestamp(X){this._autoSenderTimestamp=X}getUserPropertyMap(){return this._userPropertyMap}setUserPropertyMap(X){this._userPropertyMap=se("userPropertyMap",X,Y)}setSdtContainer(X){const ae=se("sdtContainer",X,D);if(ae==null)return this._structuredContainer=null,void this.setBinaryAttachment(null);switch(this._setBinaryAttachment(null),ae.getType()){case q.MAP:this._messageType=E.MAP;break;case q.STREAM:this._messageType=E.STREAM;break;case q.STRING:this._messageType=E.TEXT;break;default:throw new _("Invalid parameter: expected SDTField Type of MAP, STREAM, or STRING.",p.PARAMETER_INVALID_TYPE)}this._structuredContainer=ae}getSdtContainer(){const X=this.getType(),ae=this._binaryAttachment,ee=ae?ae.length:0;return X===E.BINARY?null:(this._structuredContainer!==void 0||(this._structuredContainer=ee===0?null:l.parseSingleElement(ae,0)),this._structuredContainer)}_getCompressedBinaryAttachment(){return this._compressedBinaryAttachment}_setCompressedBinaryAttachment(X){this._compressedBinaryAttachment=X}_getPayloadCompressed(){return this._payloadCompressed}_setPayloadCompressed(X){this._payloadCompressed=X}getSequenceNumber(){if(this._sequenceNumberError)throw this._sequenceNumberError;return this._sequenceNumber}getTraceContextSetter(){return super.getTraceContextSetter()}getCreationContext(){return super.getCreationContext()}getTransportContext(){return super.getTransportContext()}setTransportContext(X){super._setTransportContext(X)}getBaggage(){return super.getBaggage()}dump(X=T.MSGDUMP_FULL){const ae=M("flags",X,T);return y.dump(this,ae)}clone(){return a(this,Te)}reset(){var X;X=this,Object.keys(X).forEach(ae=>delete X[ae]),Ee(this)}clearExtendedVarLenParams(){this._transportContext=null}}he.SOLCLIENT_USER_PROP_QUEUE_PARTITION_KEY="JMSXGroupID",o.exports.Message=he},6475:(o,h,r)=>{const{ErrorSubcode:a,OperationError:u}=r(6706),{Long:l}=r(9783),{Parameter:d}=r(802),{ReplayStartLocation:f,ReplayStartType:p}=r(9309),_=r(8287).hp,S="rmid1:",C=/^[0-9a-fA-F]{32}$/g,g=l.UZERO,{isString:m,isValue:T,isInstanceOf:y}=d;class E extends f{constructor(L,D){super({_replayStartValue:{suid:L,messageId:D},_type:p.RGMID}),this._suid=L,this._messageId=D}compare(L){y("otherReplicationGroupMessageId",L,E);const D=L;if(!this._suid.equals(D._suid)){const q="Unable to compare Replication Group Message ID from different origins";throw new u(`Parameter otherReplicationGroupMessageId[${D.toString()}] failed validation`,a.MESSAGE_ID_NOT_COMPARABLE,q)}return this._messageId.gt(D._messageId)?1:this._messageId.lt(D._messageId)?-1:0}inspect(){return`[Replication Group Message Id: ${this.toString()}]`}toString(){const L=_.from(this._suid.toBytesBE().concat(this._messageId.toBytesBE())).toString("hex");return`${S}${L.substring(0,5)}-${L.substring(5,16)}-${L.substring(16,24)}-${L.substring(24,32)}`}}function I(A){return new E(A.suid,A.msgid)}const N={fromString:function(A){if(m("id",A),T("id",A.length,41,a.PARAMETER_OUT_OF_RANGE,`length expected: 41 but is ${A.length}`),!A.startsWith(S))throw new u("Parameter id has invalid Replication Group Message ID format",a.PARAMETER_OUT_OF_RANGE,`id: ${A}, does not start with ${S}`);const L=A.substring(6).split("-");if(L.length!==4||L[0].length!==5||L[1].length!==11||L[2].length!==8||L[3].length!==8)throw new u("Parameter id has invalid Replication Group Message ID format",a.PARAMETER_OUT_OF_RANGE,`id: ${A}, does not have valid separation of components`);const D=L.join("").trim();if(C.test(""),!C.test(D))throw new u("Parameter id has invalid Replication Group Message ID format",a.PARAMETER_OUT_OF_RANGE,`id: ${A}, invalid data string value`);let q;try{q=_.from(D,"hex")}catch(W){throw new u("Parameter id has invalid Replication Group Message ID format",a.PARAMETER_OUT_OF_RANGE,`id: ${A}, failed to read data, cause: ${W.message}`)}const Y=q?q.length:0;if(Y!==16)throw new u("Parameter id has invalid Replication Group Message ID format",a.PARAMETER_OUT_OF_RANGE,`id: ${A}, failed to read data from id expected length of 16 got ${Y}`);const Q=l.fromBits(q.readUInt32BE(4),q.readUInt32BE(0),!0);if(Q.eq(g))throw new u("Parameter id has invalid Replication Group Message ID format",a.PARAMETER_OUT_OF_RANGE,`id: ${A}, has invalid origin`);return I({suid:Q,msgid:l.fromBits(q.readUInt32BE(12),q.readUInt32BE(8),!0)})}};N.from=I,N.INVALID_SUID=g,o.exports.ReplicationGroupMessageId=E,o.exports.RgmidFactory=N},9631:(o,h,r)=>{const{AbstractQueueDescriptor:a}=r(8293),{QueueAccessType:u}=r(1851),{QueueDescriptor:l}=r(8976),{QueueDescriptorValidator:d}=r(6039),{QueueDiscardBehavior:f}=r(9449),{QueuePermissions:p}=r(9489),{QueueProperties:_}=r(9304),{QueuePropertiesValidator:S}=r(719),{QueueType:C}=r(6228),{EndpointNameComplaint:g,explainInvalidEndpointName:m}=r(2764);o.exports.AbstractQueueDescriptor=a,o.exports.QueueAccessType=u,o.exports.QueueDescriptor=l,o.exports.QueueDescriptorValidator=d,o.exports.QueueDiscardBehavior=f,o.exports.QueuePermissions=p,o.exports.QueueProperties=_,o.exports.QueuePropertiesValidator=S,o.exports.QueueType=C,o.exports.EndpointNameComplaint=g,o.exports.explainInvalidEndpointName=m},8293:(o,h,r)=>{const{APIProperties:a}=r(968),{DestinationType:u}=r(9620),{OperationError:l,ErrorSubcode:d}=r(6706),{QueueType:f}=r(6228),p={durable:!0,type:void 0},_={[f.QUEUE]:"queue",[f.TOPIC_ENDPOINT]:"topic endpoint"},S={[u.TOPIC]:null,[u.QUEUE]:f.QUEUE,[u.TEMPORARY_QUEUE]:f.QUEUE};o.exports.AbstractQueueDescriptor=class extends a{constructor(C){super(p,function(g){if(g&&g.name&&g.type&&u.values.includes(g.type)){if(!S[g.type])throw new l(`Cannot create a descriptor from a ${u.describe(g.type)} destination`,d.PARAMETER_CONFLICT);return{name:g.name,type:f.QUEUE,durable:g.type!==u.TEMPORARY_QUEUE}}return g}(C))}getType(){return this._type}get type(){return this.getType()}set type(C){this._type=C}isDurable(){return this._durable}get durable(){return this.isDurable()}set durable(C){this._durable=C}inspect(){return{type:this.type,durable:this.durable}}toString(){return(this.isDurable()?"":"non")+`-durable ${_[this.getType()]}`}}},2764:(o,h,r)=>{const{Enum:a}=r(7444),u=[["EMPTY_STRING",/^$/,"Zero length",!0],["LT",/</,"Less than sign (<)",!0],["GT",/>/,"Greater than sign (>)",!0],["ASTERISK",/\*/,"Asterisk (*)",!0],["QUESTION_MARK",/\?/,"Question mark (?)",!0],["AMPERSAND",/&/,"Ampersand (&)",!0],["SEMICOLON",/;/,"Semicolon (;)",!0],["LEADING_SLASH",/^\//,"Starts with a slash (/).",!1],["TRAILING_SLASH",/\/$/,"Ends with a slash (/).",!1],["DOUBLE_SLASH",/\/\//,"Empty level (//)",!1],["TOO_LONG",/.{200,}/,"Longer than 200 characters",!0]],l={EMPTY_STRING:"Zero length",LT:"Less than sign (<)",GT:"Greater than sign (>)",ASTERISK:"Asterisk (*)",QUESTION_MARK:"Question mark (?)",AMPERSAND:"Ampersand (&)",SEMICOLON:"Semicolon (;)",LEADING_SLASH:"Starts with a slash (/).",TRAILING_SLASH:"Ends with a slash (/).",DOUBLE_SLASH:"Empty level (//)",TOO_LONG:"Longer than 200 characters",NO_ISSUE:""};o.exports.EndpointNameComplaint=a.new(l),o.exports.explainInvalidEndpointName=function(d,f){for(i in u){const p=u[i];if((!f||p[3])&&d.match(p[1]))return p[2]}return l.NO_ISSUE}},1851:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.QueueAccessType=a.new({EXCLUSIVE:"EXCLUSIVE",NONEXCLUSIVE:"NONEXCLUSIVE"})},6039:(o,h,r)=>{const{APIPropertiesValidators:a}=r(968),{QueueDescriptor:u}=r(8976),{QueueType:l}=r(6228),{validateInstance:d,valBoolean:f,valIsMember:p,valTopicString:_}=a,S={validate(C){const g=d.bind(null,"QueueDescriptor",C);C instanceof u&&g("name",[_]),g("type",[p,l,"QueueType"]),g("durable",[f])}};o.exports.QueueDescriptorValidator=S},8976:(o,h,r)=>{const{AbstractQueueDescriptor:a}=r(8293),{Destination:u}=r(9620),l={name:void 0,durable:!0};class d extends a{constructor(p){super(p instanceof u?{name:p.name,type:p.type}:Object.assign({},l,p))}getName(){return this._name}get name(){return this.getName()}set name(p){this._name=p}inspect(){return{name:this.name,type:this.type,durable:this.durable}}toString(){return`${super.toString()} '${this.getName()||""}'`}static createFromSpec(p){return p.name?new d(p):a(p)}}o.exports.QueueDescriptor=d},9449:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.QueueDiscardBehavior=a.new({NOTIFY_SENDER_ON:"NOTIFY_SENDER_ON",NOTIFY_SENDER_OFF:"NOTIFY_SENDER_OFF"})},9489:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.QueuePermissions=a.new({NONE:"NONE",READ_ONLY:"READ_ONLY",CONSUME:"CONSUME",MODIFY_TOPIC:"MODIFY_TOPIC",DELETE:"DELETE"})},719:(o,h,r)=>{const{APIPropertiesValidators:a}=r(968),{QueueAccessType:u}=r(1851),{QueueDiscardBehavior:l}=r(9449),{QueuePermissions:d}=r(9489),{validateInstance:f,valBoolean:p,valIsMember:_,valNumber:S,valRange:C}=a,g={validate(m){const T=f.bind(null,"QueueProperties",m);m.permissions!==void 0&&m.permissions!==null&&T("permissions",[_,d,"QueuePermissions"]),m.accessType!==void 0&&m.accessType!==null&&T("accessType",[_,u,"QueueAccessType"]),m.quotaMB!==void 0&&m.quotaMB!==null&&T("quotaMB",[S],[C,0,2**32-1]),m.maxMessageSize!==void 0&&m.maxMessageSize!==null&&T("maxMessageSize",[S],[C,0,2**32-1]),m.respectsTTL!==void 0&&m.respectsTTL!==null&&T("respectsTTL",[p]),m.discardBehavior!==void 0&&m.discardBehavior!==null&&T("discardBehavior",[_,l,"QueueDiscardBehavior"]),m.maxMessageRedelivery!==void 0&&m.maxMessageRedelivery!==null&&T("maxMessageRedelivery",[S],[C,0,255])}};o.exports.QueuePropertiesValidator=g},9304:(o,h,r)=>{var a=r(2195);const{APIProperties:u}=r(968),{QueueAccessType:l}=r(1851),{QueueDiscardBehavior:d}=r(9449),{QueuePermissions:f}=r(9489),p={permissions:void 0,accessType:void 0,quotaMB:void 0,maxMessageSize:void 0,respectsTTL:void 0,discardBehavior:void 0,maxMessageRedelivery:void 0};o.exports.QueueProperties=class extends u{constructor(_){super(p,_)}get permissions(){return this._permissions}set permissions(_){this._permissions=_}get accessType(){return this._accessType||p.accessType}set accessType(_){this._accessType=_}get quotaMB(){return this._quotaMB}set quotaMB(_){this._quotaMB=_}get maxMessageSize(){return this._maxMessageSize}set maxMessageSize(_){this._maxMessageSize=_}get respectsTTL(){return this._respectsTTL}set respectsTTL(_){this._respectsTTL=_}get discardBehavior(){return this._discardBehavior}set discardBehavior(_){this._discardBehavior=_}get maxMessageRedelivery(){return this._maxMessageRedelivery}set maxMessageRedelivery(_){this._maxMessageRedelivery=_}inspect(){return{permissions:f.describe(this.permissions),accessType:l.describe(this.accessType),quotaMB:this.quotaMB,maxMessageSize:this.maxMessageSize,respectsTTL:this.respectsTTL,discardBehavior:this.discardBehavior?d.describe(this.discardBehavior):void 0,maxMessageRedelivery:this.maxMessageRedelivery}}toString(){return a(this)}}},6228:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.QueueType=a.new({QUEUE:"QUEUE",TOPIC_ENDPOINT:"TOPIC_ENDPOINT"})},9309:(o,h,r)=>{const{Parameter:a}=r(802),{ReplayStartLocation:u,ReplayStartType:l}=r(4115),{ReplayStartLocationBeginning:d}=r(608),{ReplayStartLocationDate:f}=r(5439),{SolclientFactory:p}=r(4386);o.exports.ReplayStartLocation=u,o.exports.ReplayStartLocationBeginning=d,o.exports.ReplayStartLocationDate=f,o.exports.ReplayStartType=l,p.createReplayStartLocationBeginning=p.createFactory(()=>new d),p.createReplayStartLocationDate=p.createFactory(_=>f.createReplayStartLocationDate(a.isInstanceOf("date",_,Date)))},4115:(o,h,r)=>{var a=r(2195);const{Enum:u}=r(7444),l=u.new({BEGINNING:0,DATE:1,RGMID:2});o.exports.ReplayStartLocation=class{constructor(d){Object.assign(this,d),this._type===void 0&&(this._type=l.BEGINNING)}toString(){return a(this)}},o.exports.ReplayStartType=l},608:(o,h,r)=>{const{ReplayStartLocation:a,ReplayStartType:u}=r(4115);o.exports.ReplayStartLocationBeginning=class extends a{constructor(){super({_type:u.BEGINNING})}static inspect(){return"BEGINNING"}}},5439:(o,h,r)=>{const{ReplayStartLocation:a,ReplayStartType:u}=r(4115);class l extends a{constructor(f){super({_replayStartValue:f.getTime(),_type:u.DATE})}inspect(){return`[Epoch Time: ${this._replayStartValue}]`}static createReplayStartLocationDate(f){return new l(f)}}o.exports.ReplayStartLocationDate=l},769:(o,h,r)=>{const{Codec:a}=r(6360),{SDTDestType:u}=r(3153),{SDTField:l}=r(7385),{SDTFieldType:d}=r(7849),{SDTMapContainer:f}=r(7449),{SDTStreamContainer:p}=r(5711),{SDTUnsupportedValueError:_}=r(2157),{SDTValueErrorSubcode:S}=r(3268);o.exports.Codec=a,o.exports.SDTDestType=u,o.exports.SDTField=l,o.exports.SDTFieldType=d,o.exports.SDTMapContainer=f,o.exports.SDTStreamContainer=p,o.exports.SDTUnsupportedValueError=_,o.exports.SDTValueErrorSubcode=S},6360:(o,h,r)=>{const{EncodeSingleElement:a}=r(3884),{IEEE754LIB:u}=r(4493),{ParseSingleElement:l,StringToBuffer:d}=r(2497),{encodeSingleElement:f}=a,{parseSingleElement:p}=l,{stringToBuffer:_}=d,S={encodeSingleElement:f,parseSingleElement:p,stringToBuffer:_,IEEE754LIB:u};o.exports.Codec=S},2224:(o,h,r)=>{const{Convert:a}=r(9783),{SDTDataTypes:u}=r(8605),l={encodeHeader:function(d,f){let p=d<<2&255,_=null;return d===u.Map||d===u.Stream?(_=a.int32ToStr(f+5),p|=3):f+2<=255?(_=a.int8ToStr(f+2),p|=0):f+3<=65535?(_=a.int16ToStr(f+3),p|=1):(_=a.int32ToStr(f+5),p|=3),a.int8ToStr(p)+_}};o.exports.EncodeHeader=l},7579:o=>{const h={int48ToStr:function(r){let a=r;const u=[];for(let l=0;l<6;l++){const d=a%256;a=Math.floor(a/256),u.push(String.fromCharCode(d))}return u.reverse(),u.join("")}};o.exports.EncodeInteger=h},299:(o,h,r)=>{const a=r(3884),u=r(968),{EncodeHeader:l}=r(2224),{SDTDataTypes:d}=r(8605),{SDTMapContainer:f}=r(7449),{encodeHeader:p}=l,_={encodeMap(S){const C=[];if(!(S instanceof f))return null;const g=S.getKeys();let m,T=null,y=null,E=null;for(m=0;m<g.length;m++)T=S.getField(g[m]),T&&(E=u.StringUtils.nullTerminate(g[m]),y=p(d.String,E.length),y+=E,C.push(y),a.EncodeSingleElement.encodeSingleElementToBuf(T,C));return C.join("")}};o.exports.EncodeMap=_},3884:(o,h,r)=>{const a=r(9620),{Convert:u}=r(9783),{EncodeHeader:l}=r(2224),{EncodeInteger:d}=r(7579),{EncodeMap:f}=r(299),{EncodeStream:p}=r(9549),{IEEE754LIB:_}=r(4493),{SDTDataTypes:S}=r(8605),{SDTDestType:C}=r(3153),{SDTField:g}=r(7385),{SDTFieldType:m}=r(7849),{StringUtils:T}=r(968),{encodeHeader:y}=l,{int48ToStr:E}=d,{encodeMap:I}=f,{encodeStream:N}=p,{nullTerminate:A}=T,L=Math.pow(2,48);function D(Y,Q){if(!(Y instanceof g))return!1;const W=Y.getValue();let x=null,k=0;switch(Y.getType()){case m.BOOL:k=S.Boolean,x=u.int8ToStr(W?1:0);break;case m.UINT8:k=S.UnsignedInteger,x=u.int8ToStr(W);break;case m.INT8:k=S.Integer,x=u.int8ToStr(W);break;case m.UINT16:k=S.UnsignedInteger,x=u.int16ToStr(W);break;case m.INT16:k=S.Integer,x=u.int16ToStr(W);break;case m.UINT32:k=S.UnsignedInteger,x=u.int32ToStr(W);break;case m.INT32:k=S.Integer,x=u.int32ToStr(W);break;case m.UINT64:k=S.UnsignedInteger,x="\0\0"+E(W);break;case m.INT64:k=S.Integer,x=W>=0?"\0\0"+E(W):"ÿÿ"+E(L+W);break;case m.WCHAR:k=S.Char,x=u.int16ToStr(W.charCodeAt(0));break;case m.STRING:k=S.String,x=A(unescape(encodeURIComponent(W)));break;case m.BYTEARRAY:k=S.ByteArray,x=W.toString("latin1");break;case m.FLOATTYPE:k=S.Float,x=_.toIEEE754Single(W);break;case m.DOUBLETYPE:k=S.Float,x=_.toIEEE754Double(W);break;case m.MAP:k=S.Map,x=I(W);break;case m.STREAM:k=S.Stream,x=N(W);break;case m.DESTINATION:k=S.Destination,W instanceof a.Destination&&(x=u.int8ToStr(C[W.getType()])+W.getBytes());break;case m.NULLTYPE:k=S.Null,x="";break;case m.UNKNOWN:x=null}if(x!==null){const J=y(k,x.length);return Q.push(J),Q.push(x),!0}return!1}const q={encodeSingleElement:function(Y){const Q=[];return D(Y,Q),Q.join("")},encodeSingleElementToBuf:D};o.exports.EncodeSingleElement=q},9549:(o,h,r)=>{const a=r(3884),{SDTStreamContainer:u}=r(5711),l={encodeStream:function(d){const f=[];if(!(d instanceof u))return null;let p=null;for(d.rewind();d.hasNext();)p=d.getNext(),p&&a.EncodeSingleElement.encodeSingleElementToBuf(p,f);return d.rewind(),f.join("")}};o.exports.EncodeStream=l},4493:o=>{const h={toIEEE754(r,a,u){let l=r;const d=(1<<a-1)-1;let f,p,_;if(isNaN(l))p=(1<<d)-1,_=1,f=0;else if(l===1/0||l===-1/0)p=(1<<d)-1,_=0,f=l<0?1:0;else if(l===0)p=0,_=0,f=1/l==-1/0?1:0;else if(f=l<0,l=Math.abs(l),l>=Math.pow(2,1-d)){const m=Math.min(Math.floor(Math.log(l)/Math.LN2),d);p=m+d,_=l*Math.pow(2,u-m)-Math.pow(2,u)}else p=0,_=l/Math.pow(2,1-d-u);const S=[];for(let m=u;m;m-=1)S.push(_%2?1:0),_=Math.floor(_/2);for(let m=a;m;m-=1)S.push(p%2?1:0),p=Math.floor(p/2);S.push(f?1:0),S.reverse();let C=S.join("");const g=[];for(;C.length;)g.push(parseInt(C.substring(0,8),2)),C=C.substring(8);return g},fromIEEE754(r,a,u){const l=[];for(let C=r.length;C;C-=1){let g=r[C-1];for(let m=8;m;m-=1)l.push(g%2?1:0),g>>=1}l.reverse();const d=l.join(""),f=(1<<a-1)-1,p=parseInt(d.substring(0,1),2)?-1:1,_=parseInt(d.substring(1,1+a),2),S=parseInt(d.substring(1+a),2);return _===(1<<a)-1?S!==0?NaN:p*(1/0):_>0?p*Math.pow(2,_-f)*(1+S/Math.pow(2,u)):S!==0?p*Math.pow(2,-(f-1))*(S/Math.pow(2,u)):0},strToByteArr(r){const a=[];for(let u=0;u<r.length;u++)a.push(255&r.charCodeAt(u));return a},byteArrToStr(r){const a=[];for(let u=0;u<r.length;u++)a.push(String.fromCharCode(255&r[u]));return a.join("")},fromIEEE754Double(r){return this.fromIEEE754(this.strToByteArr(r),11,52)},toIEEE754Double(r){return this.byteArrToStr(this.toIEEE754(r,11,52))},fromIEEE754Single(r){return this.fromIEEE754(this.strToByteArr(r),8,23)},toIEEE754Single(r){return this.byteArrToStr(this.toIEEE754(r,8,23))}};o.exports.IEEE754LIB=h},5686:(o,h,r)=>{const{DestinationFromNetwork:a,DestinationType:u,Queue:l}=r(9620),{LOG_DEBUG:d,LOG_INFO:f}=r(2694),{SDTDestType:p}=r(3153),{SDTField:_}=r(7385),{SDTFieldType:S}=r(7849),{Topic:C}=r(9620),g={parseDestination:function(m,T,y){const E=m.readUInt8(T),I=m.toString("latin1",T+1,T+y);let N=a.createDestinationFromBytes(I);if(p[N.type]!==E)if(p[u.QUEUE]===E)N=l.createFromLocalName(I);else{if(p[u.TOPIC]!==E)return f(`Drop SDT field with invalid destination type ${E} when decoding ${I} to ${N.type}`),null;N.type,N=new C(I)}return _.create(S.DESTINATION,N)}};o.exports.ParseDestination=g},8906:(o,h,r)=>{const{ParseInteger:a}=r(9148),{autoDecodeVarLengthNumber:u}=a,l={parseFieldHeader:function(d,f){let p=f;const _=d.readUInt8(p),S=(252&_)>>2,C=1+(3&_);p++;const g=u(d,p,C);return p+=C,[S,g,g-(1+C),p-f]}};o.exports.ParseFieldHeader=l},3384:(o,h,r)=>{const{SDTField:a}=r(7385),{SDTFieldType:u}=r(7849),l={parseFloatField:function(d,f,p){switch(p){case 4:return a.create(u.FLOATTYPE,d.readFloatBE(f));case 8:return a.create(u.DOUBLETYPE,d.readDoubleBE(f));default:return a.create(u.UNKNOWN,d.toString("latin1",f,f+p))}}};o.exports.ParseFloat=l},9148:(o,h,r)=>{const a=r(5017),{SDTField:u}=r(7385),{SDTFieldType:l}=r(7849),{SDTUnsupportedValueError:d}=r(2157),{SDTValueErrorSubcode:f}=r(3268),{create:p}=u,_={autoDecodeVarLengthNumber:function(S,C,g){return!![1,2,3,4].includes(g)&&S.readUIntBE(C,g)},parseIntegerField:function(S,C,g,m){let T=0;switch(m){case 1:return S?(T=C.readInt8(g),p(l.INT8,T)):(T=C.readUInt8(g),p(l.UINT8,T));case 2:return S?(T=C.readInt16BE(g),p(l.INT16,T)):(T=C.readUInt16BE(g),p(l.UINT16,T));case 4:return S?(T=C.readInt32BE(g),p(l.INT32,T)):(T=C.readUInt32BE(g),p(l.UINT32,T));case 8:{let y=null;const E=a.fromBits(C.readUInt32BE(g+4),C.readUInt32BE(g),!S);E.getNumBitsAbs()>48&&(y=new d("Value is not supported",f.VALUE_OUTSIDE_SUPPORTED_RANGE,C.toString("latin1",g,m))),T=E.toNumber();const I=p(S?l.INT64:l.UINT64,T);return y&&I.setError(y),I}default:return null}}};o.exports.ParseInteger=_},2076:(o,h,r)=>{const a=r(2497),{LOG_ERROR:u}=r(2694),{ParseFieldHeader:l}=r(8906),{SDTDataTypes:d}=r(8605),{SDTField:f}=r(7385),{SDTFieldType:p}=r(7849),{SDTMapContainer:_}=r(7449),S={parseMapAt:function(C,g,m){const T=new _;let y=g;for(;y<g+m;){const E=l.parseFieldHeader(C,y);if(y+=E[3],E[0]!==d.String)return u("Error parsing SDTMAP, expected to find a string field as map key, and didn't"),u(`Type of key: ${E[0]}`),f.create(p.MAP,null);const I=C.toString("latin1",y,y+E[2]-1);y+=E[2];const N=l.parseFieldHeader(C,y),A=a.ParseSingleElement.parseSingleElement(C,y);y+=N[1],A&&T.addField(I,A)}return f.create(p.MAP,T)}};o.exports.ParseMap=S},2497:(o,h,r)=>{const{Convert:a}=r(9783);r(2694);const{ParseDestination:u}=r(5686),{ParseFieldHeader:l}=r(8906),{ParseFloat:d}=r(3384),{ParseInteger:f}=r(9148),{ParseMap:p}=r(2076),{ParseStream:_}=r(2580),{SDTDataTypes:S}=r(8605),{SDTField:C}=r(7385),{SDTFieldType:g}=r(7849),{utf8ToUcs2:m}=a,{parseFieldHeader:T}=l,{parseFloatField:y}=d,{parseIntegerField:E}=f,{parseMapAt:I}=p,{parseStreamAt:N}=_,{parseDestination:A}=u,L={parseSingleElement(q,Y){const Q=T(q,Y);if(!Q)return null;const W=Y+Q[3],x=Q[2];switch(Q[0]){case S.Null:return C.create(g.NULLTYPE,null);case S.Boolean:return C.create(g.BOOL,q.readUInt8(W)!==0);case S.Integer:return E(!0,q,W,x);case S.UnsignedInteger:return E(!1,q,W,x);case S.Float:return y(q,W,x);case S.Char:return C.create(g.WCHAR,String.fromCharCode(q.readUInt16BE(W)));case S.ByteArray:return C.create(g.BYTEARRAY,q.slice(W,W+x));case S.String:return C.create(g.STRING,m(q.toString("latin1",W,W+x-1)));case S.Destination:return A(q,W,x);case S.SMFMessage:return C.create(g.SMF_MESSAGE,q.slice(W,W+x));case S.Map:return I(q,W,x);case S.Stream:return N(q,W,x);default:return C.create(g.UNKNOWN,q.toString("latin1",W,W+x))}}},D={stringToBuffer:q=>r(8287).hp.from(q,"latin1")};o.exports.ParseSingleElement=L,o.exports.StringToBuffer=D},2580:(o,h,r)=>{const a=r(2497),{ParseFieldHeader:u}=r(8906),{SDTField:l}=r(7385),{SDTFieldType:d}=r(7849),{SDTStreamContainer:f}=r(5711),p={parseStreamAt:function(_,S,C){const g=new f;let m=S;for(;m<S+C;){const T=u.parseFieldHeader(_,m),y=a.ParseSingleElement.parseSingleElement(_,m);m+=T[1],y&&g.addField(y)}return l.create(d.STREAM,g)}};o.exports.ParseStream=p},8605:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SDTDataTypes=a.new({Null:0,Boolean:1,Integer:2,UnsignedInteger:3,Float:4,Char:5,ByteArray:6,String:7,Destination:8,SMFMessage:9,Map:10,Stream:11})},3153:(o,h,r)=>{const{DestinationType:a}=r(9620),{Enum:u}=r(7444),l={[a.TOPIC]:0,[a.QUEUE]:1,[a.TEMPORARY_QUEUE]:1};o.exports.SDTDestType=u.new(l)},7849:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SDTFieldType=a.new({BOOL:0,UINT8:1,INT8:2,UINT16:3,INT16:4,UINT32:5,INT32:6,UINT64:7,INT64:8,WCHAR:9,STRING:10,BYTEARRAY:11,FLOATTYPE:12,DOUBLETYPE:13,MAP:14,STREAM:15,DESTINATION:16,NULLTYPE:17,UNKNOWN:18,SMF_MESSAGE:19})},7385:(o,h,r)=>{const a=r(4386),{Convert:u}=r(9783),{SDTFieldType:l}=r(7849),{validateSdtField:d}=r(530),{anythingToBuffer:f}=u,{ProfileBinding:p}=a;class _{constructor(C=l.NULLTYPE,g=null){const m=d(C,g);if(m!==null)throw m;this._type=C,C===l.BYTEARRAY?this._value=f(g):this._value=g,this._error=void 0}getType(){return this._type}getValue(){if(this._error!==void 0)throw this._error;return this.getValueNoThrow()}getValueNoThrow(){return this._error!==void 0?this._error:this._type===l.BYTEARRAY&&p.value.byteArrayAsString?this._value.toString("latin1"):this._value}setError(C){this._error=C}toString(){return`[SDTField type:${this._type} value:${this._value}]`}static create(C,g){return new _(C,g)}}o.exports.SDTField=_},7449:(o,h,r)=>{const{ErrorSubcode:a,OperationError:u}=r(6706),{SDTField:l}=r(7385);o.exports.SDTMapContainer=class{constructor(){this._map=[]}getKeys(){return Object.keys(this._map)}getField(d){return this._map[d]}deleteField(d){delete this._map[d]}addField(d,f,p=void 0){if(f instanceof l)this._map[d]=f;else{if(p===void 0)throw new u("Invalid parameters to addField: expected SDTField, or type and value",a.PARAMETER_CONFLICT);this._map[d]=l.create(f,p)}}}},5711:(o,h,r)=>{const a=r(7385),{ErrorSubcode:u,OperationError:l}=r(6706);o.exports.SDTStreamContainer=class{constructor(){this._stream=[],this._writable=!0,this._readPt=0}hasNext(){return this._stream.length>this._readPt}getNext(){return this._readPt<this._stream.length?this._stream[this._readPt++]:void 0}rewind(){this._readPt=0}addField(d,f=void 0){if(this._writable)if(d instanceof a.SDTField)this._stream.push(d);else{if(f===void 0)throw new l("Invalid parameters to addField: expected SDTField, or type and value",u.PARAMETER_CONFLICT);this._stream.push(a.SDTField.create(d,f))}}}},2157:(o,h,r)=>{const a=r(199),{SolaceError:u}=r(6706);o.exports.SDTUnsupportedValueError=class extends u{constructor(l,d,f){super("SDTUnsupportedValue",l),this.subcode=d,this.sourceData=f||""}inspect(){return super.inspect({subcode:null,sourceData:l=>a.Debug.formatDumpBytes(l,!1,0)})}getSubcode(){return this.subcode}getSourceData(){return this.sourceData}}},3268:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SDTValueErrorSubcode=a.new({VALUE_OUTSIDE_SUPPORTED_RANGE:1})},530:(o,h,r)=>{const a=r(9620),u=r(7449),l=r(5711),d=r(802),{ErrorSubcode:f,OperationError:p}=r(6706),{SDTFieldType:_}=r(7849),S=(()=>{const g=[];return g[_.BOOL]="boolean",g[_.UINT8]="number",g[_.INT8]="number",g[_.UINT16]="number",g[_.INT16]="number",g[_.UINT32]="number",g[_.INT32]="number",g[_.UINT64]="number",g[_.INT64]="number",g[_.WCHAR]="string",g[_.STRING]="string",g[_.BYTEARRAY]="object",g[_.FLOATTYPE]="number",g[_.DOUBLETYPE]="number",g})();function C(g){return new p(`Invalid SDT type:value combination, expected value type ${g}`,f.PARAMETER_INVALID_TYPE)}o.exports.validateSdtField=function(g,m){return S[g]&&(S[g]==="boolean"&&typeof m!="boolean"||S[g]==="number"&&typeof m!="number"||S[g]==="string"&&typeof m!="string")?C(S[g]):g!==_.MAP||d.Check.instanceOf(m,u.SDTMapContainer)?g!==_.STREAM||d.Check.instanceOf(m,l.SDTStreamContainer)?g!==_.DESTINATION||d.Check.instanceOf(m,a.Destination)?null:C("Destination"):C("SDTStreamContainer"):C("SDTMapContainer")}},5024:(o,h,r)=>{const{AuthenticationScheme:a}=r(3399),{CapabilityType:u,ClientCapabilityType:l}=r(2484),{MessageRxCBInfo:d}=r(2299),{MutableSessionProperty:f}=r(7113),{Session:p}=r(9564),{SessionEvent:_}=r(8229),{ProvisionEvent:S}=r(918),{SessionEventCBInfo:C}=r(5256),{SessionEventCode:g}=r(6334),{SessionEventName:m}=r(6324),{SessionProperties:T}=r(9656),{SessionState:y}=r(3183),{SolclientFactory:E}=r(4386),{SslDowngrade:I}=r(6415);E.createSession=E.createFactory((N,A,L)=>new p(N,A,L)),o.exports.AuthenticationScheme=a,o.exports.CapabilityType=u,o.exports.ClientCapabilityType=l,o.exports.MessageRxCBInfo=d,o.exports.MutableSessionProperty=f,o.exports.Session=p,o.exports.SessionEventCBInfo=C,o.exports.SessionEventCode=g,o.exports.SessionEvent=_,o.exports.ProvisionEvent=S,o.exports.SessionEventName=m,o.exports.SessionProperties=T,o.exports.SessionState=y,o.exports.SslDowngrade=I},3399:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.AuthenticationScheme=a.new({BASIC:"AuthenticationScheme_basic",CLIENT_CERTIFICATE:"AuthenticationScheme_clientCertificate",AUTHENTICATION_SCHEME_BASIC:"AuthenticationScheme_basic",AUTHENTICATION_SCHEME_CLIENT_CERTIFICATE:"AuthenticationScheme_clientCertificate",OAUTH2:"AuthenticationScheme_oauth2"})},2484:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.CapabilityType=a.new({PEER_SOFTWARE_VERSION:0,PEER_SOFTWARE_DATE:1,PEER_PLATFORM:2,PEER_PORT_SPEED:3,PEER_PORT_TYPE:4,MAX_DIRECT_MSG_SIZE:5,PEER_ROUTER_NAME:6,MESSAGE_ELIDING:7,NO_LOCAL:8,GUARANTEED_MESSAGE_CONSUME:9,TEMPORARY_ENDPOINT:10,GUARANTEED_MESSAGE_PUBLISH:11,GUARANTEED_MESSAGE_BROWSE:12,ENDPOINT_MGMT:13,SELECTOR:14,MAX_GUARANTEED_MSG_SIZE:15,ACTIVE_CONSUMER_INDICATION:16,COMPRESSION:17,CUT_THROUGH:18,ENDPOINT_DISCARD_BEHAVIOR:19,ENDPOINT_MESSAGE_TTL:20,JNDI:21,PER_TOPIC_SEQUENCE_NUMBERING:22,QUEUE_SUBSCRIPTIONS:23,SUBSCRIPTION_MANAGER:24,TRANSACTED_SESSION:25,MESSAGE_REPLAY:26,COMPRESSED_SSL:27,SHARED_SUBSCRIPTIONS:28,BR_REPLAY_ERRORID:29,AD_APP_ACK_FAILED:30,VAR_LEN_EXT_PARAM:31}),o.exports.ClientCapabilityType=a.new({UNBIND_ACK:0,BR_ERRORID:1,PQ:2})},8165:o=>{o.exports.CorrelatedRequest=class{constructor(h,r,a,u){this.correlationTag=h,this.timer=r,this.correlationKey=a,this.respRecvdCallback=u}}},6472:(o,h,r)=>{const{CapabilityType:a}=r(2484);o.exports.DefaultCapabilities={createDefaultCapabilities:u=>({[a.GUARANTEED_MESSAGE_CONSUME]:!0,[a.GUARANTEED_MESSAGE_PUBLISH]:!0,[a.SHARED_SUBSCRIPTIONS]:!0,[a.MAX_GUARANTEED_MSG_SIZE]:u.assumedMaxAdSize,[a.AD_APP_ACK_FAILED]:!0})}},343:(o,h,r)=>{const{Process:a}=r(968),u=Math.pow(2,32);function l(f,p){return p>f.length?"0".repeat(p-f.length)+f:f}const d={sessionCounter:0,idCounter:0,RandId:l((Math.random()*u).toFixed(0).toString(),10),NextSessionCounter(){return l((++this.sessionCounter).toString(),4)},NextId(){return++this.idCounter},GenerateClientName(){const{product:f,platform:p}=a;return`${f}/${p}/${this.RandId}/${this.NextSessionCounter()}`},GenerateUserIdentification(){const{product:f,platform:p}=a;return`${f}/${p}/${this.RandId}`},GenerateClientDescription:()=>`solclientjs/${a.description}`.substring(0,254)};o.exports.GlobalContext=d},4838:(o,h,r)=>{r(2694);const{parseURL:a}=r(968);let u;u=(l,d)=>setTimeout(()=>{try{const f=l.map(p=>{const _=a(p).host;return{url:p,host:_,address:_,resolved:!1}});return d(null,f)}catch(f){return d(f)}},0),o.exports.hostListDNSFilter=u},7405:(o,h,r)=>{const{assert:a}=r(7444),{hostListDNSFilter:u}=r(4838),{LogFormatter:l}=r(2694),{parseURL:d}=r(968);function f(_){return Array.isArray(_)?_.map(S=>d(S)):f(_.split(/[,;]/))}class p{constructor(S={url:null,waitTime:0}){Object.assign(this,S)}}o.exports.HostList=class{constructor({url:_,connectRetries:S,reconnectRetries:C,connectRetriesPerHost:g,reconnectRetryWaitInMsecs:m}={}){Object.assign(this,{hosts:f(_).map(T=>T.href),connectTryCount:S===-1?Number.POSITIVE_INFINITY:S+1,reconnectTryCount:C===-1?Number.POSITIVE_INFINITY:C,connectTryCountPerHost:g===-1?Number.POSITIVE_INFINITY:g+1,reconnectRetryWaitInMsecs:m,_mutableState:{},logger:new l("[host-list]")}),this.reset(),a(this.hosts.length>=1),a(this.connectTryCount>=1),a(this.reconnectTryCount>=0),a(this.connectTryCountPerHost>=1)}resolveHosts(_){const{LOG_TRACE:S,LOG_WARN:C}=this.logger;u(this.hosts,(g,m)=>{if(g)return _(g);a(m.length===this.hosts.length,"Resolve did not return a result for all hosts");let T=0;return m.forEach(y=>{y.address&&++T,y.resolved&&(y.address?(y.address,y.url):C("DNS resolve FAILED:",y.error.code,`${y.error.syscall}('${y.error.hostname}')`,"for",y.url))}),_(T===0?"All hosts failed DNS resolution":null)})}reset(_={wasConnected:!1,disconnected:!1}){Object.assign(this._mutableState,{wasConnected:_.wasConnected,disconnected:_.disconnected,hostPointer:0,hostTries:0,listTries:1,exhausted:!1,lastHostInfo:new p})}getNextHost(){this.logger;const _=this._mutableState,S=_.wasConnected,C=_.lastHostInfo;a(C,"Next host request with no prior host info -- did you call reset()?");try{if(_.disconnected)return null;a(!_.exhausted,"Next host request after host list exhausted");const g=Object.assign({hosts:this.hosts,hostTriesMax:this.connectTryCountPerHost,listTriesMax:S?this.reconnectTryCount:this.connectTryCount});if(++_.hostTries,_.hostTries>g.hostTriesMax?(_.hostTries,C.url,++_.hostPointer,_.hostPointer>=g.hosts.length?(++_.listTries,_.listTries>g.listTriesMax?(g.listTriesMax,_.exhausted=!0):(_.listTries,g.listTriesMax,_.hostPointer=0,_.hostTries=1)):_.hostTries=1):(_.hostTries,g.hostTriesMax),_.exhausted)return null;const m=g.hosts[_.hostPointer];a(m,`No host at the host pointer! ${g.hosts}[${_.hostPointer}]`);const T=C.url===null,y=C.url!==m,E=C.url!==m&&_.hostPointer===0,I=T||y&&!E?0:this.reconnectRetryWaitInMsecs,N=new p({url:m,waitTime:I});return _.lastHostInfo=N,N.url}finally{}}get connectWaitTimeInMsecs(){return a(this._mutableState.lastHostInfo.url,"Getting connectWaitTimeInMsecs having never called getNextHostInfo"),this._mutableState.lastHostInfo.waitTime}currentHostToString(){const _=this._mutableState,S=_.wasConnected,C=Object.assign({hosts:this.hosts,hostTriesMax:this.connectTryCountPerHost,listTriesMax:S?this.reconnectTryCount:this.connectTryCount}),g=_.hostPointer+1;return`host '${_.lastHostInfo.url}' (host ${g} of ${C.hosts.length})(host connection attempt ${_.hostTries} of ${C.hostTriesMax})(total ${S?"reconnection":"connection"} attempt ${_.listTries} of ${C.listTriesMax})`}}},2299:o=>{o.exports.MessageRxCBInfo=class{constructor(h,r){this.messageRxCBFunction=h,this.userObject=r}}},7113:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.MutableSessionProperty=a.new({CLIENT_NAME:1,CLIENT_DESCRIPTION:2})},7105:o=>{o.exports.OutstandingDataRequest=class{constructor(h,r,a,u,l){this.correlationId=h,this.timer=r,this.replyReceivedCBFunction=a,this.reqFailedCBFunction=u,this.userObject=l}}},7603:o=>{o.exports.P2PUtil={getP2PInboxTopic:h=>`${h}/_`,getP2PTopicSubscription:h=>`${h}/>`}},918:(o,h,r)=>{const{SessionEvent:a}=r(8229);o.exports.ProvisionEvent=class extends a{constructor(u,l,d=void 0,f=0,p=void 0,_=void 0,S=null,C=null){super([],u,l,d,f,p,_),this._queueDescriptor=S,this._queueProperties=C}get queueDescriptor(){return this._queueDescriptor}set queueDescriptor(u){this._queueDescriptor=u}get queueProperties(){return this._queueProperties}set queueProperties(u){this._queueProperties=u}inspect(){const u=super.inspect();return u.queueDescriptor=this._queueDescriptor,u.queueProperties=this._queueProperties,u}}},5256:o=>{o.exports.SessionEventCBInfo=class{constructor(h,r){this.userObject=r,this.sessionEventCBFunction=h}}},6334:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SessionEventCode=a.new({UP_NOTICE:0,DOWN_ERROR:1,CONNECT_FAILED_ERROR:2,REJECTED_MESSAGE_ERROR:4,SUBSCRIPTION_ERROR:5,SUBSCRIPTION_OK:6,VIRTUALROUTER_NAME_CHANGED:7,REQUEST_ABORTED:8,REQUEST_TIMEOUT:9,PROPERTY_UPDATE_OK:10,PROPERTY_UPDATE_ERROR:11,CAN_ACCEPT_DATA:13,DISCONNECTED:14,RECONNECTING_NOTICE:22,RECONNECTED_NOTICE:23,REPUBLISHING_UNACKED_MESSAGES:24,ACKNOWLEDGED_MESSAGE:25,UNSUBSCRIBE_TE_TOPIC_OK:26,UNSUBSCRIBE_TE_TOPIC_ERROR:27,MESSAGE:28,GUARANTEED_MESSAGE_PUBLISHER_DOWN:29,PROVISION_ERROR:30,PROVISION_OK:31})},6324:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SessionEventName=a.new({CONNECT:"SessionConnect",DISCONNECT:"SessionDisconnect",DISPOSE:"SessionDispose",CONNECT_TIMEOUT:"SessionConnectTimeout",CONNECT_WAIT_TIMEOUT:"SessionConnectWaitTimeout",DOWNGRADE_TIMEOUT:"SessionDowngradeTimeout",TRANSPORT_UP:"SessionTransportUp",TRANSPORT_DESTROYED:"SessionTransportDestroyed",TRANSPORT_CAN_ACCEPT_DATA:"SessionTransportCanAcceptData",TRANSPORT_PARSE_ERROR:"SessionTransportParseError",TRANSPORT_PROTOCOL_SMP:"SessionSMPMessage",TRANSPORT_PROTOCOL_CLIENTCTRL:"SessionClientCtrlMessage",EXCEPTION:"SessionException",SUBSCRIBE_TIMEOUT:"SessionSubscribeTimeout",CREATE_SUBSCRIBER:"SessionCreateSubscriber",FLOW_UP:"SessionFlowUp",FLOW_FAILED:"SessionFlowFailed",SEND_ERROR:"SessionSendError",FLOWS_DISCONNECTED:"SessionFlowsDisconnected",TRANSPORT_FLUSHED:"SessionTransportFlushed",DNS_RESOLUTION_COMPLETE:"SessionDNSResolutionComplete",TRANSPORT_CHANGE_DONE:"SessionTransportChangeDone"})},8229:(o,h,r)=>{var a=r(2195);const{ErrorSubcode:u,OperationError:l,RequestError:d,RequestEventCode:f}=r(6706),{SessionEventCode:p}=r(6334);function _(T){return class extends T{constructor(y,E,I,N=void 0,A=0,L=void 0,D=void 0){super(...y),this._sessionEventCode=E,this._infoStr=I,this._responseCode=N,this._errorSubcode=A,this._correlationKey=L,this._reason=D}get sessionEventCode(){return this._sessionEventCode}get infoStr(){return this._infoStr}get responseCode(){return this._responseCode}get errorSubcode(){return this.subcode||this._errorSubcode}get errorSubCode(){return this.errorSubcode}get correlationKey(){return this._correlationKey}get reason(){return this._reason}set reason(y){this._reason=y}inspect(){return Object.assign(super.inspect||{},{sessionEventCode:p.describe(this.sessionEventCode),infoStr:this.infoStr,responseCode:this.responseCode,errorSubcode:u.describe(this.errorSubcode),correlationKey:this.correlationKey?this.correlationKey.toString():null,reason:this.reason?this.reason:null})}toString(){return a(this)}}}const S={[p.CONNECT_FAILED_ERROR]:l,[p.DOWN_ERROR]:l,[p.GUARANTEED_MESSAGE_PUBLISHER_DOWN]:l,[p.PROPERTY_UPDATE_ERROR]:d,[p.REJECTED_MESSAGE_ERROR]:d,[p.SUBSCRIPTION_ERROR]:d,[p.UNSUBSCRIBE_TE_TOPIC_ERROR]:l,[f.REQUEST_ABORTED]:d,[f.REQUEST_TIMEOUT]:d},C=new Map().set(Object,()=>[]).set(l,(T,y,E,I,N,A)=>[y,I,A]).set(d,(T,y,E,I,N,A)=>[y,T,N,A]),g=new Map,m=_(Object);m.build=function(T,y,E=void 0,I=0,N=void 0,A=void 0){const L=S[T]||Object;return new((()=>{let D=g.get(L);return D||(D=_(L),g.set(L,D),D)})())((C.get(L)||(()=>[]))(T,y,E,I,N,A),T,y,E,I,N,A)},o.exports.SessionEvent=m},1122:(o,h,r)=>{var a=r(2195);const{ErrorSubcode:u}=r(6706),{FsmEvent:l}=r(7414),{Hex:d}=r(9783),{formatHexString:f}=d;o.exports.SessionFSMEvent=class extends l{constructor(p,_){super(p),this.eventText=null,this.errorSubcode=null,this.eventReason=null,this.smfMsg=null,this.sessionId=null,this.guaranteedFlowObject=null,Object.assign(this,_)}inspect(){return{eventText:this.eventText,eventReason:this.eventReason,errorSubcode:u.describe(this.errorSubcode),sessionId:this.sessionId&&f(this.sessionId)||"N/A"}}getExtraStringInfo(){return a(this)}}},43:(o,h,r)=>{const a=r(178),u=r(5898),l=r(3450),d=r(4386),f=r(8205),{assert:p}=r(7444),{CapabilityType:_}=r(2484),{Check:S}=r(802),{CorrelatedRequest:C}=r(8165),{Destination:g}=r(9620),{ErrorResponseSubcodeMapper:m,ErrorSubcode:T,OperationError:y}=r(6706),{FsmEvent:E,State:I,StateMachine:N}=r(7414),{Hex:A}=r(9783),{LogFormatter:L}=r(2694),{Message:D,MessageOutcome:q,MessageDeliveryModeType:Y}=r(6247),{P2PUtil:Q}=r(7603),{SessionEvent:W}=r(8229),{SessionEventCode:x}=r(6334),{SessionEventName:k}=r(6324),{SessionFSMEvent:J}=r(1122),{SessionRequestType:F}=r(168),{SessionStateName:$}=r(6057),{SslDowngrade:R}=r(6415),{StatType:B,StatsByMode:M}=r(5747),{StringUtils:re}=r(968),{SubscriptionUpdateTimeoutMessages:se}=r(4356),{Codec:fe}=r(769),{Convert:ce}=r(9783),{anythingToBuffer:Te}=ce,{formatHexString:Ee}=A,{stripNullTerminate:he}=re,{STAT_TX_BYMODE_BYTES:ge,STAT_TX_BYMODE_MSGS:X,STAT_RX_BYMODE_BYTES:ae,STAT_RX_BYMODE_MSGS:ee,STAT_TX_BYMODE_REDELIVERED:Re,STAT_TX_BYMODE_BYTES_REDELIVERED:me}=M,Pe=(r(97),r(595));o.exports.SessionFSM=class extends N{constructor(H,Z,te,ie){super({name:"SessionFSM"});const j=this,Oe=this.logger=new L(function(...U){return[`[session-fsm=${j.sessionIdHex||"(N/A)"}]`,`[${j.getCurrentStateName()}]`,...U]}),{LOG_TRACE:v,LOG_DEBUG:P,LOG_INFO:O}=Oe;this.log=Oe.wrap(this.log,this),this._sessionProperties=H,this._session=Z,this._sessionStatistics=te,this._hosts=ie,this._consumers=new a.ConsumerFlows,this._flowInterfaceFactory=U=>({getCorrelationTag:this.getCorrelationTag.bind(this),incStat:this.incStat.bind(this),sendData:V=>this.send(V,U,!1),sendToTransport:V=>this.sendToTransport(V,U,!1),sendControl:V=>this.send(V,U,!0),enqueueRequest:this.enqueueOutstandingCorrelatedReq.bind(this),createDestinationFromDescriptor:Z.createDestinationFromDescriptor.bind(Z),createTemporaryDestination:Z.createTemporaryDestination.bind(Z),isCapable:Z.isCapable.bind(Z),getCapability:Z.getCapability.bind(Z),getCurrentStateName:this.getCurrentStateName.bind(this),updateQueueSubscription:Z.updateQueueSubscription.bind(Z),get sessionIdHex(){return j.sessionIdHex},get canAck(){return Z.canAck}}),this._userBackpressured=!1,this.clearCurrentError(),this.initial(function(){return this.transitionTo(j.SessionDisconnected,U=>U.getStateMachine().reset())}),this.unhandledEventReaction(function(U){const V=j.getCurrentState();switch(U.getName()){case k.CREATE_SUBSCRIBER:return p(j._consumers,"collection has lifetime of FSM instance"),j._consumers.add(U.guaranteedFlowObject),this;case k.DISPOSE:return V.terminate(()=>j.disposeInternal());case k.FLOW_UP:return U.guaranteedFlowObject,this;default:return U.getName(),j.getCurrentStateName(),this}}),this.SessionConnecting=new I({name:$.CONNECTING,parentContext:j},{handleTransportDestroyed(){if(j.clearConnectTimer(),j._currentHost=j._hosts.getNextHost(),j._currentHost===null)return this.transitionToExitPoint(j.SessionConnecting,"ErrorExit");const{connectWaitTimeInMsecs:U}=j._hosts;return U>0&&!j._connectWaitTimer?(j._connectWaitTimer=setTimeout(()=>{j._connectWaitTimer=null,j.processEvent(new J({name:k.CONNECT_WAIT_TIMEOUT}))},U),this.transitionTo(j.WaitingForInterConnectTimeout)):this.transitionTo(j.WaitingForTransport)}}).entry(()=>{j.setConnectTimer()}).entryPoint("DisconnectTransport",function(){return j._hosts.reset({wasConnected:void 0,disconnected:!0}),j._connectFailEvent=x.DISCONNECTED,j._connectSuccessEvent=x.DISCONNECTED,this.transitionTo(j.DestroyingTransport)}).entryPoint("ReconnectTransport",function(){j._connectFailEvent=x.DOWN_ERROR,j._connectSuccessEvent=x.RECONNECTED_NOTICE;const U=j._sessionProperties._reconnectRetries===0;if(j._hosts.reset({wasConnected:!0,disconnected:U}),!U){const V=j._currentError||{},z=[V.eventText,V.responseCode,V.errorSubcode,void 0,V.eventReason];j.setPostEventAction(()=>{j.setConnectTimer(),j.emitSessionEvent(W.build(x.RECONNECTING_NOTICE,...z))})}return this.transitionTo(j.DestroyingTransport)}).initial(()=>(j.clearCurrentError(),j._connectFailEvent=x.CONNECT_FAILED_ERROR,j._connectSuccessEvent=x.UP_NOTICE,j._hosts.resolveHosts(U=>j._hosts?U?(j.setCurrentError({errorSubcode:T.UNRESOLVED_HOSTS,eventText:U}),j._hosts.reset({disconnected:!0}),this.processEvent(new J({name:k.EXCEPTION}))):(j._hosts.reset({wasConnected:!1}),j._currentHost=j._hosts.getNextHost(),this.processEvent(new J({name:k.DNS_RESOLUTION_COMPLETE}))):null),this.transitionTo(j.WaitingForDNS))).reaction(k.DNS_RESOLUTION_COMPLETE,function(){return this.transitionTo(j.WaitingForTransport)}).reaction(k.DISCONNECT,function(){return this.transitionToEntryPoint(j.SessionConnecting,"DisconnectTransport")}).reaction(k.CONNECT_TIMEOUT,function(){return j.setCurrentError({errorSubcode:T.TIMEOUT,eventText:"Connect timeout"}),this.transitionTo(j.DestroyingTransport)}).reaction(k.SEND_ERROR,function(U){return O(`SEND_ERROR reached SessionConnecting. ${U}`),j.setCurrentError(U),this.transitionTo(j.DestroyingTransport)}).reaction(k.EXCEPTION,function(U){return j.setCurrentError(U),this.transitionTo(j.DestroyingTransport)}).reaction(k.TRANSPORT_DESTROYED,function(U){return j.setCurrentError(U),O("TRANSPORT_DESTROYED event"),this.transitionTo(j.DestroyingTransport)}).exit(()=>{j.clearConnectTimer(),j._connectWaitTimer&&(clearTimeout(j._connectWaitTimer),j._connectWaitTimer=null)}).exitPoint("ConnectedExit",()=>(j.setPostEventAction(()=>{if(j.emitSessionEvent(W.build(j._connectSuccessEvent,`'${j._hosts.currentHostToString()}'`,200,0,null,null)),j._userBackpressured){const U=W.build(x.CAN_ACCEPT_DATA,"",null,0,null,"");j.emitSessionEvent(U),j._userBackpressured=!1}}),j.clearCurrentError(),this.transitionTo(j.SessionTransportUp))).exitPoint("ErrorExit",function(){return j.setPostEventAction(()=>{const U=j._currentError||{},V=[U.eventText,U.responseCode,U.errorSubcode,void 0,U.eventReason];j.emitSessionEvent(W.build(j._connectFailEvent,...V))}),this.transitionTo(j.SessionDisconnected)}),this.WaitingForDNS=new I({name:$.WAITING_FOR_DNS,parentContext:j.SessionConnecting}),this.DestroyingTransport=new I({name:$.DESTROYING_TRANSPORT,parentContext:j.SessionConnecting}).entry(()=>{O("Connecting, disposing transport"),j.clearConnectTimer(),j.destroyTransportSession("Disconnecting session",0)}).reaction(k.TRANSPORT_DESTROYED,function(U){return j.setCurrentError(U),j.SessionConnecting.handleTransportDestroyed.call(this)}),this.WaitingForInterConnectTimeout=new I({name:$.WAITING_FOR_INTERCONNECT_TIMEOUT,parentContext:j.SessionConnecting}).reaction(k.CONNECT_WAIT_TIMEOUT,function(){return this.transitionTo(j.WaitingForTransport)}),this.WaitingForTransport=new I({name:$.WAITING_FOR_TRANSPORT,parentContext:j.SessionConnecting}).initial(()=>{const U="Cannot establish transport session: creation failed";j.setConnectTimer(),j.clearCurrentError();try{j.initTransport()}catch(V){return this.setCurrentError({eventText:V.message===U?U:`${U}: ${V.message}`,errorSubcode:V.subcode||T.INTERNAL_ERROR,eventReason:V}),j.SessionConnecting.handleTransportDestroyed.call(this)}return this.transitionTo(j.WaitingForTransportUp)}),this.WaitingForTransportUp=new I({name:$.WAITING_FOR_TRANSPORT_UP,parentContext:this.WaitingForTransport}).entry(()=>{this._justEntered=!0}).initial(()=>{if(!this._justEntered)return this;this._justEntered=!1;const U="Cannot establish transport session: connection failed";try{const V=j._transport.connect();if(V!==f.TransportReturnCode.OK)throw new y(U,T.CONNECTION_ERROR,f.TransportReturnCode.describe(V));O(`Attempting to connect session '${j.sessionId}' to ${j._hosts.currentHostToString()}`)}catch(V){return this.setCurrentError({eventText:V.message===U?U:`${U}: ${V.message}`,errorSubcode:V.subcode||T.INTERNAL_ERROR,eventReason:V}),j.SessionConnecting.handleTransportDestroyed.call(this)}return this}).reaction(k.SEND_ERROR,function(U){return O(`SEND_ERROR while waiting for transport up, doing nothing. ${U}`),this.internalTransition(null)}).reaction(k.TRANSPORT_UP,function(U){if(j.sessionId=U.sessionId||"",j.sendClientCtrlLogin()===f.TransportReturnCode.OK)return this.transitionTo(j.WaitingForLogin);const V={eventText:"Failed to send Client Control Login",errorSubcode:T.LOGIN_FAILURE,responseCode:400};return j.setCurrentError(V),this.transitionTo(j.DestroyingTransport)}),this.WaitingForLogin=new I({name:$.WAITING_FOR_LOGIN,parentContext:j.SessionConnecting}).entry(()=>{j.setClientCtrlTimer()}).reaction(k.TRANSPORT_PROTOCOL_CLIENTCTRL,function(U){const V=U.smfMsg,z=V.getResponse(),ne=z.responseCode,de={responseCode:ne};if(j._responseCode=ne,ne===200)if(j.checkNoLocal(V)){if(j.checkCompressedSsl(V))return j.updateReadonlySessionProps(V),this.transitionTo(j.WaitForTransportChange);Object.assign(de,{eventText:"Compressed TLS is not supported by the Solace Message Router",errorSubcode:T.COMPRESSED_TLS_NOT_SUPPORTED})}else Object.assign(de,{eventText:"No Local is not supported by the Solace Message Router",errorSubcode:T.NO_LOCAL_NOT_SUPPORTED});else{const _e=m.getErrorSubcode(ne,z.responseString),we=_e===T.UNKNOWN_ERROR?T.LOGIN_FAILURE:_e;O(`Login failed. Subcode: ${we} respCode: ${ne} respString: ${z.responseString}`),Object.assign(de,{eventText:z.responseString,errorSubcode:we})}return j.setCurrentError(de),this.transitionTo(j.DestroyingTransport)}).reaction(k.DOWNGRADE_TIMEOUT,function(){return j._transport.requestDowngrade&&j._transport.requestDowngrade("ClientCtrl timeout",T.TIMEOUT)!==!1?this.transitionTo(j.WaitingForTransportUp):(j.setCurrentError({eventText:"ClientCtrl timeout",errorSubcode:T.TIMEOUT}),this.transitionTo(j.DestroyingTransport))}).exit(()=>{j.clearClientCtrlTimer()}),this.WaitForTransportChange=new I({name:$.WAITING_FOR_TRANSPORT_CHANGE,parentContext:j.SessionConnecting}).initial(function(){const U=j.updateTransportCompression((function(V){this._transport=V,this.processEvent(new J({name:k.TRANSPORT_CHANGE_DONE}))}).bind(j));return U===null?this:(j._transport=U,this.transitionTo(j.ReapplyingSubscriptions))}).reaction(k.TRANSPORT_CHANGE_DONE,function(){return this.transitionTo(j.ReapplyingSubscriptions)}),this.ReapplyingSubscriptions=new I({name:$.REAPPLYING_SUBSCRIPTIONS,parentContext:j.SessionConnecting}).entry(()=>{O("ReapplyingSubscriptions: entry"),j.copySubscriptionCacheKeys()}).initial(function(){return j.reapplySubscriptions()===!0?this.transitionTo(j.WaitForSubConfirm):this.transitionTo(j.WaitForCanAcceptData)}).reaction(k.SUBSCRIBE_TIMEOUT,function(){const U=T.TIMEOUT;return j.setCurrentError({eventText:"Subscription timeout while reapplying",errorSubcode:U}),this.transitionTo(j.DestroyingTransport)}).exit(function(){return j.clearSubscriptionCacheKeys(),this}),this.WaitForSubConfirm=new I({name:$.WAITING_FOR_SUBCONFIRM,parentContext:j.ReapplyingSubscriptions}).reaction(k.TRANSPORT_PROTOCOL_SMP,function(U){const V=U.smfMsg.smfHeader,z=he(U.smfMsg.encodedUtf8Subscription),ne=V.pm_respcode,de=V.pm_respstr;if(ne!==200){const _e=m.getErrorSubcode(ne,de);return O(`Waiting for subscription confirmation, got ${ne} (${_e}) '${de}' on subscription ${z}`),j.setCurrentError({eventText:de,responseCode:ne,errorSubcode:_e}),this.transitionTo(j.DestroyTransport)}return j._session.canConnectPublisher&&j._defaultPublisher&&j._defaultPublisher.isBindWaiting()?this.transitionTo(j.WaitingForMessagePublisher):this.transitionToExitPoint(j.SessionConnecting,"ConnectedExit")}),this.WaitForCanAcceptData=new I({name:$.WAITING_FOR_CAN_ACCEPT_DATA,parentContext:j.ReapplyingSubscriptions}).reaction(k.TRANSPORT_PROTOCOL_SMP,function(U){const V=U.smfMsg.smfHeader,z=he(U.smfMsg.encodedUtf8Subscription),ne=V.pm_respcode,de=V.pm_respstr;if(ne!==200){const _e=m.getErrorSubcode(ne,de);return j.setCurrentError({eventText:de,responseCode:ne,errorSubcode:_e}),this.transitionTo(j.DestroyingTransport)}return O(`Unexpected 200 OK response to subscription add for ${z}`),this.internalTransition(null)}).reaction(k.TRANSPORT_CAN_ACCEPT_DATA,function(){return j.reapplySubscriptions()===!0?this.transitionTo(j.WaitForSubConfirm):this.internalTransition(null)}),this.WaitingForMessagePublisher=new I({name:$.WAITING_FOR_PUBFLOW,parentContext:j.SessionConnecting}).entry(()=>{j._defaultPublisher.connect(),j.sendPublisherSessionUpEvent(j._defaultPublisher)}).reaction(k.FLOW_UP,function(){return j._defaultPublisher.isBindWaiting()?this.internalTransition(null):this.transitionToExitPoint(j.SessionConnecting,"ConnectedExit")}).reaction(k.FLOW_FAILED,function(U){return j.setCurrentError({eventText:`Guaranteed Message Publisher Failed: ${U.eventText}`,errorSubcode:T.LOGIN_FAILURE}),this.transitionTo(j.DestroyingTransport)}),this.SessionTransportUp=new I({name:$.TRANSPORT_UP,parentContext:j}).entry(function(){return j.clearConnectTimer(),this}).initial(function(){return j._session.canConnectConsumer&&(j._consumers.flows.forEach(U=>j.sendConsumerSessionUpEvent(U)),j._consumers.reconnectingFlows.forEach(U=>j.sendConsumerSessionUpEvent(U))),this.transitionTo(j.FullyConnected)}).reaction(k.DISCONNECT,function(){return this.transitionTo(j.SessionDisconnecting)}).reaction(k.EXCEPTION,function(U){return j.setCurrentError(U),j.cleanupSession(),this.transitionToEntryPoint(j.SessionConnecting,"ReconnectTransport")}).reaction(k.SEND_ERROR,function(U){return j.setCurrentError(U),j.cleanupSession(),this.transitionToEntryPoint(j.SessionConnecting,"ReconnectTransport")}).reaction(k.TRANSPORT_DESTROYED,function(U){return j.setCurrentError(U),O("Received unsolicited TRANSPORT_DESTROYED event while transport is up"),j.cleanupSession(),this.transitionToEntryPoint(j.SessionConnecting,"ReconnectTransport")}).reaction(k.TRANSPORT_PROTOCOL_SMP,function(U){const V=U.smfMsg.smfHeader,z=he(U.smfMsg.encodedUtf8Subscription),ne=V.pm_respcode,de=V.pm_respstr;return j.handleSubscriptionUpdateError(ne,de,z,void 0,!1),this.internalTransition(null)}).reaction(k.TRANSPORT_CAN_ACCEPT_DATA,function(U){const V=W.build(x.CAN_ACCEPT_DATA,"",null,0,null,U.toString());return j.emitSessionEvent(V),j._userBackpressured=!1,this.internalTransition(null)}).reaction(k.CREATE_SUBSCRIBER,function(U){const V=j._consumers.add(U.guaranteedFlowObject);return j.sendConsumerSessionUpEvent(V),this}).exit(function(){return j.clearKeepAlive(),this}),this.FullyConnected=new I({name:$.FULLY_CONNECTED,parentContext:j.SessionTransportUp}).entry(()=>{j._connectFailEvent=x.DOWN_ERROR,j.scheduleKeepAlive()}),this.SessionDisconnected=new I({name:$.DISCONNECTED,parentContext:j}).reaction(k.DISCONNECT,function(){return j.setPostEventAction(()=>{j.emitSessionEvent(W.build(x.DISCONNECTED))}),this.internalTransition(null)}).reaction(k.CONNECT,function(){return this.transitionTo(j.SessionConnecting)}).reaction(k.EXCEPTION,function(){return this.internalTransition(null)}),this.SessionDisconnecting=new I({name:$.DISCONNECTING,parentContext:j}).initial(()=>(O(`Disconnecting session ${j}`),this.transitionTo(j.DisconnectingFlows))).reaction(k.DISCONNECT,function(){return this.internalTransition(null)}).reaction(k.EXCEPTION,function(U){return j.setCurrentError({errEvent:U}),j.cleanupSession(),this.transitionToEntryPoint(j.SessionConnecting,"DisconnectTransport")}).reaction(k.TRANSPORT_DESTROYED,function(){return O("Received unsolicited TRANSPORT_DESTROYED while disconnecting transport"),j.cleanupSession(),this.transitionToEntryPoint(j.SessionConnecting,"DisconnectTransport")}),this.DisconnectingFlows=new I({name:$.DISCONNECTING_FLOWS,parentContext:j.SessionDisconnecting},{gatherPendingFlows(){const{MessageConsumerEventName:U}=a;p(!this.isGathering),this.isGathering=!0;const V=(z,ne,de)=>{if(p(z,"Trying to listen to undefined flow"),this.known.has(z))return;this.known.add(z),this.pending.add(z);const _e=()=>{de.forEach(we=>z._removeListener(we,_e)),this.pending.delete(z),this.isGathering||this.checkPendingFlows()};de.forEach(we=>ne.call(z,we,_e));try{z._disconnectSession()}catch{_e()}};j._consumers&&j._consumers.flows.forEach(z=>{V(z,z._once,[U.DOWN,U.DOWN_ERROR])}),this.isGathering=!1},checkPendingFlows(){this.pending,this.pending.size===0&&(this.gatherPendingFlows(),this.pending.size===0&&this.proceed())},proceed(){this.known=null,this.pending=null,O("All flows disconnected"),j.processEvent(new E({name:k.FLOWS_DISCONNECTED}))}}).entry(function(){this.known=new Set,this.pending=new Set,this.checkPendingFlows()}).reaction(k.FLOWS_DISCONNECTED,function(){return this.transitionTo(j.FlushingTransport)}),this.FlushingTransport=new I({name:$.FLUSHING_TRANSPORT,parentContext:j.SessionDisconnecting},{flushTransport(){j.cleanupSession(),j.flushTransportSession(()=>this.onTransportFlushed()),this.sessionId=null},onTransportFlushed(){j.processEvent(new E({name:k.TRANSPORT_FLUSHED}))}}).entry(function(){O("Flushing transport"),this.flushTransport()}).reaction(k.TRANSPORT_FLUSHED,function(){return O("Handle Transport Flushed"),this.transitionToEntryPoint(j.SessionConnecting,"DisconnectTransport")})}addToSubscriptionCache(H){if(S.nothing(H)||!this._subscriptionCache)return;this.logger;const Z=H.name;this._subscriptionCache[Z]===null||this._subscriptionCache[Z]===void 0?(this._subscriptionCache[Z]=H,this._subscriptionCacheCount++):this._subscriptionCache[Z]=H}cancelOutstandingCorrelatedReq(H){if(S.nothing(H)||!this._correlatedReqs)return null;const Z=this._correlatedReqs[H];if(Z==null)return null;const{LOG_DEBUG:te,LOG_ERROR:ie}=this.logger;Z.timer&&(clearTimeout(Z.timer),Z.timer=null);try{delete this._correlatedReqs[H]||ie(`Cannot delete ctrl request ${H}`)}catch(j){ie(`Cannot delete ctrl request ${H}`,j)}return Z}cleanupSession(){const{LOG_INFO:H}=this.logger;H("Clean up session");const{ConsumerFSMEvent:Z,ConsumerFSMEventNames:te}=a;this._correlatedReqs&&Object.keys(this._correlatedReqs).forEach(ie=>this.cancelOutstandingCorrelatedReq(ie)),this.clearConnectTimer(),this.clearClientCtrlTimer(),this.clearKeepAlive(),this._consumers.flows.forEach(ie=>{ie.processFSMEvent(new Z({name:te.SESSION_DOWN}))}),this._consumers.reconnectingFlows.forEach(ie=>{ie.processFSMEvent(new Z({name:te.SESSION_DOWN}))}),this._defaultPublisher&&this._defaultPublisher.processFSMEvent(new u.PublisherFSMEvent({name:u.PublisherFSMEventNames.SESSION_DOWN})),this._session.cleanupSession()}clearClientCtrlTimer(){this._clientCtrlTimer&&(clearTimeout(this._clientCtrlTimer),this._clientCtrlTimer=null)}clearConnectTimer(){this._connectTimer&&(clearTimeout(this._connectTimer),this._connectTimer=void 0)}clearKeepAlive(){const{LOG_INFO:H}=this.logger;this._keepAliveTimer&&(H("Cancel keepalive timer"),clearInterval(this._keepAliveTimer),this._keepAliveTimer=null),this.resetKeepAliveCounter()}checkNoLocal(H){let Z=!0;if(this._sessionProperties.noLocal===!0){const te=H.getRouterCapabilities();Z=!!te&&typeof te[_.NO_LOCAL]=="boolean"&&te[_.NO_LOCAL]}return Z}checkCompressedSsl(H){if(this.logger,this._compressedTLS){const Z=H.getRouterCapabilities();return!(!Z||typeof Z[_.COMPRESSED_SSL]!="boolean")&&Z[_.COMPRESSED_SSL]===!0}return!0}checkSessionDestinationCapability(H){let Z=null;return H&&H.getType()&&H.getSubscriptionInfo()&&(H.getSubscriptionInfo().isShare||H.getSubscriptionInfo().isNoExport)&&!this._session.isCapable(_.SHARED_SUBSCRIPTIONS)&&(Z=new y("Shared subscriptions are not allowed by router for this client",T.SHARED_SUBSCRIPTIONS_NOT_SUPPORTED,null)),Z}clearCurrentError(){this._currentError=null}clearSubscriptionCacheKeys(){this._subscriptionCacheKeys=null}copySubscriptionCacheKeys(){this.clearSubscriptionCacheKeys(),this._subscriptionCacheKeys=Object.keys(this._subscriptionCache||{});const H=Q.getP2PTopicSubscription(this._sessionProperties.p2pInboxBase);this._subscriptionCacheKeys.push(H)}createMessagePublisher(){if(this.logger,!this._sessionProperties.publisherProperties.enabled)return;const{MessagePublisher:H,MessagePublisherEventName:Z}=u,te=new H({properties:this._sessionProperties.publisherProperties,sessionInterfaceFactory:this._flowInterfaceFactory});te.on(Z.UP,()=>this.processEvent(new J({name:k.FLOW_UP},{guaranteedFlowObject:te}))),te.on(Z.CONNECT_FAILED_ERROR,ie=>this.processEvent(new J({name:k.FLOW_FAILED},{guaranteedFlowObject:te,event:ie,eventText:ie.description}))),te.on(Z.REJECTED_MESSAGE,(ie,j)=>{const Oe=j.smfHeader,v=Oe.pm_respcode,P=Oe.pm_respstr,O=m.getADErrorSubcode(v,P),U=W.build(x.REJECTED_MESSAGE_ERROR,P,v,O,ie.getCorrelationKey());U.message=ie,this.emitSessionEvent(U)}),te.on(Z.ACKNOWLEDGED_MESSAGE,ie=>{const j=W.build(x.ACKNOWLEDGED_MESSAGE,"Message(s) acknowledged",void 0,0,ie.getCorrelationKey());j.message=ie,this.emitSessionEvent(j)}),te.on(Z.FLOW_NAME_CHANGED,ie=>{const{messages:j,count:Oe}=ie;if(Oe>0){const v=W.build(x.REPUBLISHING_UNACKED_MESSAGES,`Republishing ${Oe} messages due to Guaranteed Message Publisher failed to reconnect`);v.messages=j,v.count=Oe,this.emitSessionEvent(v)}}),te.on(Z.CAN_SEND,()=>{this.emitSessionEvent(W.build(x.CAN_ACCEPT_DATA,`${te} window is now open and can send`))}),te.on(Z.GUARANTEED_MESSAGING_DOWN,()=>{this.emitSessionEvent(W.build(x.GUARANTEED_MESSAGE_PUBLISHER_DOWN,"Guaranteed Message Publishing shut down"))}),this._defaultPublisher=te}sendConsumerSessionUpEvent(H){const{ConsumerFSMEvent:Z,ConsumerFSMEventNames:te}=a,ie=new Z({name:this._session.canConnectConsumer?te.SESSION_UP:te.SESSION_UP_NO_AD});ie.guaranteedFlowObject=H,H.processFSMEvent(ie)}sendPublisherSessionUpEvent(H){const Z=this._session.canConnectPublisher,te=new u.PublisherFSMEvent({name:Z?u.PublisherFSMEventNames.SESSION_UP:u.PublisherFSMEventNames.SESSION_UP_NO_AD});te.guaranteedFlowObject=H,H.processFSMEvent(te)}createMessageConsumer(H){const{MessageConsumer:Z}=a,te=new Z({properties:H,sessionInterfaceFactory:this._flowInterfaceFactory}),ie=te.getProperties();if(ie.topicEndpointSubscription){const P=this.checkSessionDestinationCapability(ie.topicEndpointSubscription);if(P)throw P}const{LOG_WARN:j}=this.logger,Oe=ie.requiredSettlementOutcomes;if(Oe&&Oe.length>0&&Oe.some(P=>P===q.FAILED||q.REJECTED)&&!this._session.isCapable(_.AD_APP_ACK_FAILED)){const P=`Session.capabilitySettlementOutcomeNotSupported: [ ${Oe.map(O=>`solace.MessageOutcome.${q.nameOf(O)}`).join(", ")} ]`;throw j(P),new y(P,T.INVALID_OPERATION,null)}const v={guaranteedFlowObject:te};return this.processEvent(new J({name:k.CREATE_SUBSCRIBER},v)),te}createQueueBrowser(H){const{MessageConsumerAcknowledgeMode:Z,QueueBrowser:te}=a;this.logger;const ie={};return ie.queueDescriptor=H.queueDescriptor,ie.acknowledgeMode=Z.CLIENT,ie.browser=!0,Object.prototype.hasOwnProperty.call(H,"connectTimeoutInMsecs")&&(ie.connectTimeoutInMsecs=H.connectTimeoutInMsecs),Object.prototype.hasOwnProperty.call(H,"connectAttempts")&&(ie.connectAttempts=H.connectAttempts),Object.prototype.hasOwnProperty.call(H,"windowSize")&&(ie.windowSize=H.windowSize),Object.prototype.hasOwnProperty.call(H,"transportAcknowledgeTimeoutInMsecs")&&(ie.transportAcknowledgeTimeoutInMsecs=H.transportAcknowledgeTimeoutInMsecs),Object.prototype.hasOwnProperty.call(H,"transportAcknowledgeThresholdPercentage")&&(ie.transportAcknowledgeThresholdPercentage=H.transportAcknowledgeThresholdPercentage),new te(this.createMessageConsumer(ie))}destroyTransportSession(H,Z){if(S.nothing(this._transport))return void this.processEvent(new J({name:k.TRANSPORT_DESTROYED}));const{LOG_INFO:te,LOG_ERROR:ie}=this.logger;te("Destroy transport session");const j=this._transport.destroy(H,Z);this._smfClient=null,j!==f.TransportReturnCode.OK&&ie(`Failed to destroy transport session, return code: ${f.TransportReturnCode.describe(j)}`)}disposeInternal(){if(this._disposed)return;const H={transport:()=>{this.destroyTransportSession("Disposing",0),this._transport=null,this._smfClient=null},session:()=>{this.cleanupSession(),this._session=null,this._sessionProperties=null,this._correlatedReqs=null,this._flowInterfaceFactory=null},statistics:()=>{this._sessionStatistics&&(this._sessionStatistics.resetStats(),this._sessionStatistics=null),this._kaStats=null},"subscription cache":()=>{this._subscriptionCache&&(Object.keys(this._subscriptionCache).forEach(Z=>this.removeFromSubscriptionCache(Z)),this._subscriptionCache=null),this.clearSubscriptionCacheKeys(),this._subscriptionCacheCount=0},MessagePublishers:()=>{this._defaultPublisher&&(this._defaultPublisher.dispose(),this._defaultPublisher=null)},MessageConsumers:()=>{this._consumers.disposeAll(),this._consumers=null},"host list":()=>{this._currentHost=null,this._hosts=null}};Object.keys(H).forEach(Z=>{const{LOG_TRACE:te,LOG_INFO:ie}=this.logger,j=H[Z];try{j()}catch(Oe){ie(`Dispose: ${Z} failed:`,Oe,"...continuing")}}),this._disposed=!0}emitSessionEvent(H){this._session.sendEvent(H)}enqueueOutstandingCorrelatedReq(H,Z,te,ie,j){if(S.nothing(H))return;const{LOG_INFO:Oe}=this.logger;Oe(`Enqueue outstanding ctrl request correlationTag=${H}`);let v=null;Z&&(v=setTimeout(Z,te||this._sessionProperties.readTimeoutInMsecs));const P=new C(H,v,ie,j);this._correlatedReqs[H]=P}errorInFsm(H,Z,te=null){const{LOG_INFO:ie}=this.logger,j=new J({name:k.EXCEPTION});return ie(`Handling error in FSM: ${H} ${te&&te.stack}`),this.setCurrentError({eventText:H,errorSubcode:Z,eventReason:te}),this.processEvent(j)}flushTransportSession(H){this._transport?this._transport.flush(H):H()}getCorrelationTag(){return this._smfClient.nextCorrelationTag()}getCurrentStateName(){const H=this.getCurrentState();return H?H===this.getFinalState()?$.DISPOSED:this.getCurrentState().getName():null}getStat(H){if(this._sessionStatistics!==void 0)return H===B.TX_TOTAL_DATA_MSGS?this._sessionStatistics.getStat(B.TX_DIRECT_MSGS)+this._sessionStatistics.getStat(B.TX_PERSISTENT_MSGS)+this._sessionStatistics.getStat(B.TX_NONPERSISTENT_MSGS):H===B.TX_TOTAL_DATA_BYTES?this._sessionStatistics.getStat(B.TX_DIRECT_BYTES)+this._sessionStatistics.getStat(B.TX_PERSISTENT_BYTES)+this._sessionStatistics.getStat(B.TX_NONPERSISTENT_BYTES):this._sessionStatistics.getStat(H)}getTransportInfo(){return S.nothing(this._transport)?"Not connected.":this._transport.getInfoStr()}handleADCtrlMessage(H,Z){const te=H.getFlowId(),ie=Z.pm_respstr,j=Z.pm_corrtag,{LOG_INFO:Oe,LOG_DEBUG:v,LOG_WARN:P}=this.logger;if(j){this.updateRxStats(H),Oe(`Handle SMF response for correlationTag ${j}`);const de=this.cancelOutstandingCorrelatedReq(j);return S.nothing(de)?this.errorInFsm(`Cannot find matching request for response: ${ie}`,T.INTERNAL_ERROR):de.respRecvdCallback?(de.respRecvdCallback(H,de),this):(this.incStat(B.RX_REPLY_MSG_DISCARD),this)}let O;const U=H.msgType,{SMFAdProtocolMessageType:V}=l;switch(U){case V.CLIENTACK:case V.CLIENTNACK:case V.CLOSEPUBFLOW:this._defaultPublisher.flowId===te&&(O=this._defaultPublisher);break;default:O=this._consumers.getFlowById(te)}if(O&&!O.disposed)return this.updateRxStats(H,O),O.handleUncorrelatedControlMessage(H),this;const z=H.getResponse(),ne=z?`"${z.responseCode} ${z.responseString}" `:"";return P(`Dropping ADCTRL.${l.SMFAdProtocolMessageType.describe(H.msgType)} ${ne}for unknown flow ${te}`),this.incStat(B.RX_DISCARD_NO_MATCHING_CONSUMER),this}handleADTrMessage(H,Z){this.logger;const te=Z.pm_ad_flowid,ie=this._consumers.getFlowById(te);return!ie||ie.disposed?(this.updateRxStats(H,this._sessionStatistics),this.incStat(B.RX_DISCARD_NO_MATCHING_CONSUMER),null):(this.updateRxStats(H,ie),ie.handleDataMessage(H),ie)}handleApiSubscriptionTimeout(H,Z){if(this._correlatedReqs[H]===void 0||this._correlatedReqs[H]===null)return;const{LOG_INFO:te,LOG_ERROR:ie}=this.logger;te(`${Z||"Subscription timeout"} for correlationTag=${H}`);try{delete this._correlatedReqs[H]||ie(`Cannot delete ctrl request ${H}`)}catch(j){ie(`Cannot delete ctrl request ${H}, exception: ${j.message}`)}}handleClientCtrlMessage(H,Z){let te;const{LOG_INFO:ie}=this.logger;this.updateRxStats(H),H.msgType===l.SMFClientCtrlMessageType.LOGIN?(te=f.SMFClient.SMF_CLIENTCTRL_LOGIN_FAKE_CORRELATIONTAG,ie("Handle SMF response for ClientCTRL Login")):(te=Z.pm_corrtag,ie(`Handle SMF response for correlationTag ${te}`));const j=this.cancelOutstandingCorrelatedReq(te);if(S.nothing(j)){const Oe=Z.pm_respstr;return this.errorInFsm(`Cannot find matching request for response: ${Oe}`,T.INTERNAL_ERROR)}return j.respRecvdCallback?j.respRecvdCallback(H):(ie(`Dropping ClientCtrl message due to mismatched correlation tag ${te}`),this.incStat(B.RX_REPLY_MSG_DISCARD))}handleClientCtrlResponse(H){const Z=new J({name:k.TRANSPORT_PROTOCOL_CLIENTCTRL});Z.smfMsg=H,this.processEvent(Z)}handleClientCtrlTimeout(){const{LOG_INFO:H}=this.logger;H("ClientCtrl timeout for session");const Z=new J({name:k.DOWNGRADE_TIMEOUT});this.processEvent(Z)}handleConnectTimeout(){const{LOG_INFO:H}=this.logger;H("Connection timeout. Disconnecting");const Z=new J({name:k.CONNECT_TIMEOUT});this.processEvent(Z)}handleUpdatePropertyTimeout(H,Z){const{LOG_ERROR:te}=this.logger;try{delete this._correlatedReqs[H]||te(`Cannot delete ctrl request ${H}`)}catch(j){te(`Cannot delete ctrl request ${H}, exception: ${j.message}`)}const ie=W.build(x.PROPERTY_UPDATE_ERROR,Z,null,T.TIMEOUT,null,null);this.sendEvent(ie)}handleRejectedTrMessage(H){const Z=H.pm_respcode,te=H.pm_tr_topicname_bytes,ie=te?te.replace(/\0/g,""):"",j=H.pm_respstr,Oe=m.getErrorSubcode(Z,j);this.emitSessionEvent(W.build(x.REJECTED_MESSAGE_ERROR,j,Z,Oe,null,`Topic: ${ie}`))}handleSMFMessage(H){try{const Z=H.smfHeader;if(Z.discardMessage)return this._sessionStatistics&&this._sessionStatistics.incStat(B.RX_DISCARD_SMF_UNKNOWN_ELEMENT),null;switch(Z.smf_protocol){case l.SMFProtocol.TRMSG:return Z.smf_adf?this.handleADTrMessage(H,Z):(this.updateRxStats(H,this._sessionStatistics),Z.pm_respcode===0?this._session.handleDataMessage(H):this.handleRejectedTrMessage(Z));case l.SMFProtocol.ADCTRL:return this.handleADCtrlMessage(H,Z);case l.SMFProtocol.CLIENTCTRL:return this.handleClientCtrlMessage(H,Z);case l.SMFProtocol.SMP:return this.handleSMPMessage(H,Z);case l.SMFProtocol.KEEPALIVE:case l.SMFProtocol.KEEPALIVEV2:return null;default:return this.handleUnknownProtocolMessage(H,Z)}}catch(Z){const{LOG_ERROR:te}=this.logger;return te(`Exception in handleSMFMessage, exception: ${Z.stack}`),this.errorInFsm(`Exception in handleSMFMessage: ${Z.message}`,Z.subcode||T.INTERNAL_ERROR,Z)}}handleSMFParseError(H){return this.errorInFsm(H,T.PROTOCOL_ERROR)}handleSMPMessage(H,Z){this.updateRxStats(H);const te=this.cancelOutstandingCorrelatedReq(Z.pm_corrtag||"");if(S.nothing(te)||S.nothing(te.respRecvdCallback)){const ie=new J({name:k.TRANSPORT_PROTOCOL_SMP});return ie.smfMsg=H,this.processEvent(ie)}return te.respRecvdCallback(H,te)}handleSubscriptionUpdateError(H,Z,te,ie,j){const Oe=m.getErrorSubcode(H,Z);Oe!==T.SUBSCRIPTION_ALREADY_PRESENT&&Oe!==T.SUBSCRIPTION_NOT_FOUND&&this.removeFromSubscriptionCache(te),this._session.handleSubscriptionUpdateError(H,Z,te,ie,j)}handleSubscriptionTimeout(H){const{LOG_ERROR:Z}=this.logger;try{let ie=!1;this._correlatedReqs&&(ie=delete this._correlatedReqs[H]),ie||Z(`Cannot delete ctrl request ${H}`)}catch(ie){Z(`Cannot delete ctrl request ${H}`,ie)}const te=new J({name:k.SUBSCRIBE_TIMEOUT});this.processEvent(te)}handleTransportEvent(H){const{LOG_INFO:Z,LOG_WARN:te}=this.logger,ie=H.getInfoStr()||"";let j;switch(Z(`Receive transport event: ${H}`),H.getTransportEventCode()){case f.TransportSessionEventCode.UP_NOTICE:j=new J({name:k.TRANSPORT_UP}),j.sessionId=H.getSessionId(),this.processEvent(j);break;case f.TransportSessionEventCode.DESTROYED_NOTICE:j=new J({name:k.TRANSPORT_DESTROYED}),j.sessionId=H.getSessionId(),j.eventText=ie,j.errorSubcode=H.getSubcode(),j.eventReason=H,this._smfClient=null,this._transport=null,this.processEvent(j);break;case f.TransportSessionEventCode.CAN_ACCEPT_DATA:this.GuaranteedFlowControlledRelief(),j=new J({name:k.TRANSPORT_CAN_ACCEPT_DATA}),j.sessionId=H.getSessionId(),this.processEvent(j);break;case f.TransportSessionEventCode.SEND_ERROR:j=new J({name:k.SEND_ERROR}),j.sessionId=H.getSessionId(),j.eventText=H.getInfoStr(),j.errorSubcode=H.getSubcode(),j.eventReason=H,this.processEvent(j);break;case f.TransportSessionEventCode.DATA_DECODE_ERROR:case f.TransportSessionEventCode.PARSE_FAILURE:return this.errorInFsm(H.getInfoStr(),H.getSubcode());default:te("Received unknown transport session event",H)}return!0}handleUnknownProtocolMessage(H,Z){const{LOG_INFO:te,LOG_ERROR:ie}=this.logger;return this.updateRxStats(H),Z&&Z.smf_protocol===l.SMFProtocol.TSESSION?(ie(`Received transport session message instead of SMF message, protocol 0x${Ee(Z.smf_protocol)}`),ie(`Transport MessageType=${H.messageType}, target sessionId=${Ee(H.sessionId)}`),this.errorInFsm("Received message with unknown protocol",T.PARSE_FAILURE)):(this._sessionStatistics&&this._sessionStatistics.incStat(B.RX_DISCARD_SMF_UNKNOWN_ELEMENT),te(`Drop message with unknown protocol 0x${Ee(Z.smf_protocol)}`),null)}incStat(H,Z){return this._sessionStatistics?this._sessionStatistics.incStat(H,Z):void 0}initTransport(){const{LOG_INFO:H}=this.logger,Z=this._currentHost;H(`Creating transport session ${Z}`),this._kaStats={lastMsgWritten:0,lastBytesWritten:0},this._smfClient=new f.SMFClient(te=>this.handleSMFMessage(te),te=>this.handleSMFParseError(te),this),this._transport=f.TransportFactory.createTransport(Z,te=>this.handleTransportEvent(te),this._smfClient,this._sessionProperties.clone(),()=>this.sessionIdHex),this.injectTransportInterceptor(this._transportInterceptor)}injectTransportInterceptor(H){this._transportInterceptor=H,this._transport&&this._transport.setInterceptor(H)}keepAliveTimeout(){const{LOG_TRACE:H,LOG_DEBUG:Z,LOG_INFO:te}=this.logger;if(this._keepAliveCounter>=this._sessionProperties.keepAliveIntervalsLimit)return te(`Exceed maximum keep alive intervals limit ${this._sessionProperties.keepAliveIntervalsLimit}`),this._keepAliveTimer&&clearInterval(this._keepAliveTimer),this.errorInFsm("Exceed maximum keep alive intervals limit",T.KEEP_ALIVE_FAILURE);const ie=this._transport.getClientStats(),j=ie.msgWritten,Oe=ie.bytesWritten,v=new l.KeepAliveMessage;return this.send(v,null,!0)!==f.TransportReturnCode.OK?this.errorInFsm("Cannot send keep alive message",T.KEEP_ALIVE_FAILURE):(this._kaStats.lastMsgWritten===j&&this._kaStats.lastBytesWritten<Oe||(this._keepAliveCounter++,this._kaStats.lastMsgWritten,this._kaStats.lastBytesWritten),this._keepAliveCounter,this._kaStats.lastBytesWritten=ie.bytesWritten,this._kaStats.lastMsgWritten=ie.msgWritten,!0)}prepareAndSendMessage(H){const{LOG_WARN:Z,LOG_DEBUG:te}=this.logger;if(H instanceof D){let ie;if(this._sessionProperties.payloadCompressionLevel>0&&(S.anything(H._binaryAttachment)&&H._binaryAttachment.length>0||S.anything(H._structuredContainer))){let Oe,v=0;try{{const P={level:this._sessionProperties.payloadCompressionLevel,flush:Pe.Z_FINISH};if(S.anything(H.getSdtContainer())){const O=fe.encodeSingleElement(H.getSdtContainer()),U=Te(O);v=U.length,Oe=Pe.zlibSync(U,P)}else v=H._binaryAttachment.length,Oe=Pe.zlibSync(H._binaryAttachment,P);Oe=Te(Oe)}Oe.length+9<v?(H._setCompressedBinaryAttachment(Oe),S.nothing(H.getHttpContentEncoding())?H._compressedCE="deflate":H._compressedCE=H.getHttpContentEncoding()+", deflate"):Oe.length}catch(P){Z("Error occurred while compressing, message attachment was not compressed. Original attachment will be sent. ",P)}}const j=H.getDeliveryMode();switch(j){case Y.DIRECT:if(!this._transport)return;H._payload_is_memoized=!1,H._memoized_csumm=null,H._memoized_payload=null,ie=this.sendToTransport(H);break;case Y.PERSISTENT:case Y.NON_PERSISTENT:if(!this._defaultPublisher){const Oe=this._session.adLocallyDisabled?"locally disabled":"remotely unsupported";throw new y("Session does not provide Guaranteed Message Publish capability",T.GM_UNAVAILABLE,Oe)}this._gmSendDisallowed&&this._gmSendDisallowed(),ie=this._defaultPublisher.prepareAdMessageAndSend(H);break;default:{const{LOG_ERROR:Oe}=this.logger;Oe("Unhandled message delivery mode",Y.describe(j))}}if(S.anything(H._getCompressedBinaryAttachment())&&H._setCompressedBinaryAttachment(),delete H._compressedCE,ie!==f.TransportReturnCode.OK){if(ie===f.TransportReturnCode.NO_SPACE)throw this._userBackpressured=!0,new y("Cannot send message - no space in transport",T.INSUFFICIENT_SPACE,f.TransportReturnCode.describe(ie));this.setCurrentError(new y("Cannot send message",T.INVALID_OPERATION,f.TransportReturnCode.describe(ie))),this.processEvent(new J({name:k.EXCEPTION}))}}}GuaranteedFlowControlledRelief(){this._defaultPublisher&&this._defaultPublisher.processFSMEvent(new u.PublisherFSMEvent({name:u.PublisherFSMEventNames.CAN_SEND}))}reapplySubscriptions(){const{LOG_INFO:H,LOG_DEBUG:Z}=this.logger,{SolclientFactory:{createTopicDestination:te}}=d;if(H(`Reapplying subscriptions, count=${this._subscriptionCacheKeys.length}`),!this._subscriptionCacheKeys)return!0;try{for(;this._subscriptionCacheKeys.length;){const ie=this._subscriptionCacheKeys.shift(),j=this._subscriptionCacheKeys.length===0,Oe=te(ie),v=this.sendSubscribe(Oe,j,null,this._sessionProperties.readTimeoutInMsecs,null);v!==f.TransportReturnCode.OK&&this.errorInFsm(`Error occurred sending subscription: ${f.TransportReturnCode.describe(v)}`,T.INTERNAL_ERROR)}}catch(ie){if(ie instanceof y&&ie.subcode===T.INSUFFICIENT_SPACE)return!1;this.errorInFsm(`Unexpected expection occurred while reapplying subscriptions: ${ie}`,ie.subcode||T.INTERNAL_ERROR,ie)}return!0}removeFromSubscriptionCache(H){if(S.nothing(H)||!this._subscriptionCache)return null;const{LOG_DEBUG:Z,LOG_ERROR:te}=this.logger,ie=H instanceof g?H.name:H,j=this._subscriptionCache[ie];if(j==null)return null;try{delete this._subscriptionCache[ie]?this._subscriptionCacheCount--:te(`Cannot remove subscription ${ie}`)}catch(Oe){te(`Cannot remove subscription ${ie}`,Oe)}return j}reset(){this.resetStats(),this.sessionId=null,this._keepAliveTimer=null,this.resetKeepAliveCounter(),this._correlatedReqs={},this._disposed=!1,this._smfClient=null,this._kaStats={lastMsgWritten:0,lastBytesWritten:0},this._subscriptionCache=null,this._subscriptionCacheKeys=null,this._subscriptionCacheCount=0,this._sessionProperties.reapplySubscriptions&&(this._subscriptionCache={}),this._eventCode=null,this._responseCode=null,this.eventText=null,this.errorSubcode=null,this.eventReason=null}resetKeepAliveCounter(){this._keepAliveCounter=0}resetStats(){return this._sessionStatistics?this._sessionStatistics.resetStats():void 0}scheduleKeepAlive(){const{LOG_DEBUG:H,LOG_ERROR:Z}=this.logger,{keepAliveIntervalInMsecs:te}=this._sessionProperties;te!==0&&(this._keepAliveTimer&&clearInterval(this._keepAliveTimer),this._keepAliveTimer=setInterval(()=>{try{this.keepAliveTimeout()}catch(ie){Z("Error occurred in keepAliveTimeout",ie)}},te))}send(H,Z=this._sessionStatistics,te=!1){try{return this.sendToTransport(H,Z,te)}catch(ie){this.logger,ie.message,ie.stack,this.errorInFsm(`Send operation failed: ${ie.message}`,ie.subcode||T.CONNECTION_ERROR)}return f.TransportReturnCode.CONNECTION_ERROR}sendToTransport(H,Z=this._sessionStatistics,te=!1){let ie=f.TransportReturnCode.CONNECTION_ERROR;if(!this._transport)throw new y("Transport has been destroyed",T.INTERNAL_ERROR);const j=l.Codec.Encode.encodeCompoundMessage(H);switch(ie=this._transport.send(j,te),ie){case f.TransportReturnCode.OK:this.updateTxStats(H,Z);break;case f.TransportReturnCode.NO_SPACE:if(!te)break;default:throw new y(`Transport returned ${f.TransportReturnCode.describe(ie)}`,T.INTERNAL_ERROR)}return ie}sendClientCtrlLogin(){const{LOG_INFO:H,LOG_DEBUG:Z,LOG_TRACE:te}=this.logger;this._compressedTLS=this._sessionProperties.compressionLevel>0&&this._currentHost.match(/tcps:/i)!==null,this._plaintextTLS=this._currentHost.match(/tcps:/i)!==null&&this._sessionProperties.sslConnectionDowngradeTo===R.PLAINTEXT,this._plaintextTLS,this._compressedTLS;const ie=l.ClientCtrlMessage.getLogin(this._sessionProperties,this._compressedTLS,this._plaintextTLS),j=this.send(ie);if(j!==f.TransportReturnCode.OK)this._responseCode=null,this.eventReason=null,j===f.TransportReturnCode.NO_SPACE?(this.eventText="Cannot send client control - no space in transport",this.errorSubcode=T.INSUFFICIENT_SPACE):(H(`Cannot send client ctrl, return code
|
|
84
|
-
${f.TransportReturnCode.describe(j)}`),this.eventText="Cannot send client ctrl",this.errorSubcode=T.INVALID_OPERATION);else{const Oe=f.SMFClient.SMF_CLIENTCTRL_LOGIN_FAKE_CORRELATIONTAG;H(`Using internally correlationTag=${Oe} for tracking ClientCTRL Login`),this.enqueueOutstandingCorrelatedReq(Oe,null,null,null,v=>this.handleClientCtrlResponse(v))}return j}sendSubscribe(H,Z,te,ie,j){const{LOG_INFO:Oe,LOG_DEBUG:v}=this.logger;p(H instanceof g,"sendSubscribe requires a Destination, not a string");const P=this.getCorrelationTag(),O=l.SMPMessage.getSubscriptionMessage(P,H,!0,Z);p(O.encodedUtf8Subscription,"Encoded SMP message was invalid");const U=this.send(O);return U!==f.TransportReturnCode.OK?(Oe("Subscribe failed",f.TransportReturnCode.describe(U)),U):(Z&&this.enqueueOutstandingCorrelatedReq(P,()=>this.handleSubscriptionTimeout(P),ie||this._sessionProperties.readTimeoutInMsecs,te,j),U)}sendUpdateProperty(H,Z,te,ie,j){const Oe=this._smfClient.nextCorrelationTag(),v=l.ClientCtrlMessage.getUpdate(H,Z,Oe),P=this.send(v);return P!==f.TransportReturnCode.OK||this.enqueueOutstandingCorrelatedReq(Oe,()=>this.handleUpdatePropertyTimeout(Oe),ie||this._sessionProperties.readTimeoutInMsecs,te,j),P}provisionEndpoint(H,Z,te,ie){this.logger;const j=this._smfClient.nextCorrelationTag(),Oe=l.AdProtocolMessage.getCreate(H,Z,j),v=this.send(Oe);if(v!==f.TransportReturnCode.OK)return LOG_INFO("Provision failed",f.TransportReturnCode.describe(v)),v;this.enqueueOutstandingCorrelatedReq(j,null,0,te,ie)}deprovisionEndpoint(H,Z,te){this.logger;const ie=this._smfClient.nextCorrelationTag(),j=l.AdProtocolMessage.getDelete(H,ie),Oe=this.send(j);if(Oe!==f.TransportReturnCode.OK)return LOG_INFO("Deprovision failed",f.TransportReturnCode.describe(Oe)),Oe;this.enqueueOutstandingCorrelatedReq(ie,null,0,Z,te)}setClientCtrlTimer(){this.clearClientCtrlTimer(),this._clientCtrlTimer=setTimeout(()=>this.handleClientCtrlTimeout(),this._sessionProperties.transportDowngradeTimeoutInMsecs)}setConnectTimer(){this.clearConnectTimer(),this._connectTimer=setTimeout(()=>this.handleConnectTimeout(),this._sessionProperties.connectTimeoutInMsecs)}setCurrentError(H){const Z=this._currentError||{};this.logger,Object.keys(H).forEach(te=>H[te]!==null&&H[te]!==void 0&&(Z[te]!==null&&Z[te]!==void 0?(Z[te],H[te],!1):(Z[te]=H[te],!0))),this._currentError=Z}subscriptionUpdate(H,Z,te,ie,j,Oe,v){const P=this.checkSessionDestinationCapability(H);if(P)throw P;const O=se[j]||se.default,U=j!==F.REMOVE_DTE_SUBSCRIPTION,V=j===F.ADD_SUBSCRIPTION||j===F.ADD_P2PINBOX,z=this.getCorrelationTag(),ne=(U?l.SMPMessage.getSubscriptionMessage:l.AdProtocolMessage.getDTEUnsubscribeMessage)(z,H,V,Z),de=this.send(ne,void 0,Oe);return de!==f.TransportReturnCode.OK||(Z&&this.enqueueOutstandingCorrelatedReq(z,()=>this.handleApiSubscriptionTimeout(z,O),ie||this._sessionProperties.readTimeoutInMsecs,te,v),j===F.ADD_SUBSCRIPTION&&this._sessionProperties.reapplySubscriptions?this.addToSubscriptionCache(H):j===F.REMOVE_SUBSCRIPTION&&this._sessionProperties.reapplySubscriptions&&this.removeFromSubscriptionCache(H)),de}queueSubscriptionUpdate(H,Z,te,ie,j,Oe){const v=ie?se[F.ADD_SUBSCRIPTION]:se[F.REMOVE_SUBSCRIPTION],P=this.getCorrelationTag(),O=l.SMPMessage.getQueueSubscriptionMessage(P,H,Z,ie),U=this.send(O,void 0,j);return U!==f.TransportReturnCode.OK||this.enqueueOutstandingCorrelatedReq(P,()=>{const V=this._correlatedReqs[P];this.handleApiSubscriptionTimeout(P,v),Oe(null,V)},te||this._sessionProperties.readTimeoutInMsecs,null,Oe),U}updateRxStats(H,Z=this._sessionStatistics){if(!Z)return;const te=H.smfHeader;if(!te)return;const ie=te.pm_deliverymode||0,j=ee[ie],Oe=ae[ie],v=te.messageLength;switch(te.smf_protocol){case l.SMFProtocol.TRMSG:te.pm_respcode===0&&(Z.incStat(B.RX_TOTAL_DATA_MSGS),Z.incStat(j),Z.incStat(B.RX_TOTAL_DATA_BYTES,v),Z.incStat(Oe,v),te.smf_di&&Z.incStat(B.RX_DISCARD_MSG_INDICATION));break;case l.SMFProtocol.CLIENTCTRL:case l.SMFProtocol.SMP:case l.SMFProtocol.KEEPALIVE:case l.SMFProtocol.KEEPALIVEV2:case l.SMFProtocol.ADCTRL:Z.incStat(B.RX_CONTROL_MSGS),Z.incStat(B.RX_CONTROL_BYTES,v)}}updateTxStats(H,Z=this._sessionStatistics){if(!Z)return;H.getReplyTo!==void 0&&H.getReplyTo()&&Z.incStat(B.TX_REQUEST_SENT);const te=H.smfHeader;if(!te)return;const ie=te.pm_deliverymode||0;let j=X[ie],Oe=ge[ie];ie!==Y.DIRECT&&H.isRedelivered()&&(j=Re[ie],Oe=me[ie]);const v=te.messageLength;switch(te.smf_protocol){case l.SMFProtocol.TRMSG:Z.incStat(j),Z.incStat(Oe,v);break;case l.SMFProtocol.CLIENTCTRL:case l.SMFProtocol.SMP:case l.SMFProtocol.KEEPALIVE:case l.SMFProtocol.KEEPALIVEV2:case l.SMFProtocol.ADCTRL:Z.incStat(B.TX_CONTROL_MSGS),Z.incStat(B.TX_CONTROL_BYTES,v)}}updateReadonlySessionProps(H){const Z=this._sessionProperties;Z._setVpnNameInUse(H.getVpnNameInUseValue()||"");const te=Z.virtualRouterName,ie=H.getVridInUseValue()||"";Z._setVirtualRouterName(ie),te!==""&&te!==ie&&this.handleVirtualRouterNameChange(te,ie),Z._setP2pInboxBase(H.getP2PTopicValue()||""),Z._setP2pInboxInUse(Q.getP2PInboxTopic(Z.p2pInboxBase)),this._session.updateCapabilities(H.getRouterCapabilities());const j=this._session._getCapability(_.GUARANTEED_MESSAGE_PUBLISH);this._gmSendDisallowed=typeof j!="boolean"||j?null:()=>{throw new y("Sending guaranteed message is not allowed by router for this client",T.INVALID_OPERATION,null)}}handleVirtualRouterNameChange(H,Z){this._consumers&&(this._consumers.flows.forEach(te=>te.onVRNChanged()),this._consumers.reconnectingFlows.forEach(te=>te.onVRNChanged())),this.emitSessionEvent(W.build(x.VIRTUALROUTER_NAME_CHANGED,`Virtual router name is changed from ${H} to ${Z}`,null,0,null,null))}get sessionIdHex(){return this.sessionId&&Ee(this.sessionId)||"N/A"}updateTransportCompression(H){return this.logger,this._plaintextTLS,this._compressedTLS,this._plaintextTLS?(f.TransportFactory.severTls(this._transport,this._compressedTLS,H),null):this._compressedTLS?f.TransportFactory.startCompression(this._transport):this._transport}}},1663:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SessionOperation=a.new({CONNECT:"CONNECT",DISCONNECT:"DISCONNECT",CTRL:"CTRL",SEND:"SEND",QUERY_OPERATION:"QUERY_OPERATION"})},9727:(o,h,r)=>{const a=r(5898),u=(r(9656),r(3450)),{APIPropertiesValidators:l,parseURL:d}=r(968),{AuthenticationScheme:f}=r(3399),{Check:p}=r(802),{ErrorSubcode:_,OperationError:S}=r(6706),{LOG_WARN:C,LOG_INFO:g}=r(2694);r(6415);const{TransportProtocol:m}=r(8205),{validateInstance:T,valArrayIsMember:y,valArrayOfString:E,valBoolean:I,valLength:N,valNotEmpty:A,valNumber:L,valRange:D,valString:q,valStringOrArray:Y}=l,Q=["http:","https:","ws:","wss:","tcp:","tcps:"];function W($,R,B){const M=u.ClientCtrlMessage.validateClientName(R[B],re=>new S(`${$} validation: Property '${B}': ${re}`,_.PARAMETER_OUT_OF_RANGE));if(M)throw M}function x($,R,B,M,re,se){const fe=R[B];if(!(se&&fe===null||fe===void 0||M.values.some(ce=>ce===fe)))throw new S(`${$} validation: Property '${B}' must be a member of ${re}`,_.PARAMETER_INVALID_TYPE)}function k($,R,B){const M=R[B],re=typeof M=="string"?M.split(","):M;if(!p.array(re))throw new S(`${$} validation: Property '${B}' not an array or comma-delimited string`,_.PARAMETER_INVALID_TYPE);re.forEach(se=>{let fe=null;try{fe=d(se)}catch{throw new S(`${$} validation: Property '${B}' contained an invalid URL: ${se}`,_.PARAMETER_OUT_OF_RANGE)}if(!p.included(fe.protocol,Q))throw new S(`${$} validation: Property '${B}' contained a URL'${fe.href}' with an invalid protocol: '${fe.protocol}'`,_.PARAMETER_OUT_OF_RANGE)})}function J($,R,B){return function(M,re,se,fe){const ce=M[re];if(ce instanceof Array){const Te=ce.length;for(let Ee=0;Ee<Te;Ee++){const he=ce[Ee];if(!p.string(he)||!he.match(se))return!1}return!0}return p.string(ce)&&ce.match(se)}($,R,/^(https|wss|tcps):/i)}const F={validate($){const R=T.bind(null,"SessionProperties",$);if(R("url",[A],[Y],[k]),R("userName",[q],[N,189]),R("password",[q],[N,128]),R("clientName",[q],[N,160],[W]),R("applicationDescription",[q],[N,254]),R("vpnName",[q],[N,32]),R("connectTimeoutInMsecs",[L],[D,1,Number.MAX_VALUE]),R("connectRetriesPerHost",[L],[D,-1,Number.MAX_VALUE]),R("connectRetries",[L],[D,-1,Number.MAX_VALUE]),R("reconnectRetries",[L],[D,-1,Number.MAX_VALUE]),R("reconnectRetryWaitInMsecs",[L],[D,0,6e4]),R("readTimeoutInMsecs",[L],[D,1,Number.MAX_VALUE]),R("sendBufferMaxSize",[L],[D,1,Number.MAX_VALUE]),R("maxWebPayload",[L],[D,100,Number.MAX_VALUE]),R("bufferedAmountQueryIntervalInMsecs",[L],[D,4,Number.MAX_VALUE]),R("generateSendTimestamps",[I]),R("generateReceiveTimestamps",[I]),R("includeSenderId",[I]),R("keepAliveIntervalInMsecs",[L],[D,0,Number.MAX_VALUE]),R("keepAliveIntervalsLimit",[L],[D,3,Number.MAX_VALUE]),R("generateSequenceNumber",[I]),R("subscriberLocalPriority",[L],[D,1,4]),R("subscriberNetworkPriority",[L],[D,1,4]),R("ignoreDuplicateSubscriptionError",[I]),R("ignoreSubscriptionNotFoundError",[I]),R("reapplySubscriptions",[I]),R("noLocal",[I]),R("transportDowngradeTimeoutInMsecs",[L],[D,1,Number.MAX_VALUE]),R("idToken",[q]),R("accessToken",[q]),R("payloadCompressionLevel",[L],[D,0,9]),$.transportProtocol&&$.webTransportProtocolList)throw new S("SessionProperties validation: Property 'transportProtocol' and 'webTransportProtocolList' cannot be set at the same time",_.PARAMETER_OUT_OF_RANGE);if($.webTransportProtocolList!==null&&$.webTransportProtocolList!==void 0){if(!Array.isArray($.webTransportProtocolList))throw new S("Property 'webTransportProtocolList' must be an array if set",_.PARAMETER_INVALID_TYPE);if($.webTransportProtocolList.length===0)throw new S("Property 'webTransportProtocolList' must be non-empty if set",_.PARAMETER_OUT_OF_RANGE)}R("authenticationScheme",[x,f,"AuthenticationScheme",!1]);const B=$.authenticationScheme===f.CLIENT_CERTIFICATE;if(!J($,"url")&&B)throw new S("SessionProperties validation: Property 'authenticationScheme' cannot be set to client certificate for unsecured sessions",_.PARAMETER_OUT_OF_RANGE);if(p.equal($.authenticationScheme,f.OAUTH2)){if(!J($,"url"))throw new S(`SessionProperties validation: Property 'authenticationScheme' cannot be set to '${f.OAUTH2}' unless the session property 'url' is written to use a secure communication protocol like tcps or https.`,_.PARAMETER_CONFLICT);if(p.empty($.idToken)&&p.empty($.accessToken))throw new S(`SessionProperties validation: Property 'authenticationScheme' can be set to '${f.OAUTH2}' only if there is an accompanying token set as a session property. The token types that are supported for OAuth authentication are OAuth2.0 Access Tokens and OpenID Connect ID Tokens. To set an access token you can use the accessToken session property. To set an id you can use the idToken session property.`,_.PARAMETER_CONFLICT)}else p.empty($.idToken)&&p.empty($.accessToken)||g(`SessionProperties validation: Property 'authenticationScheme' must be set to '${f.OAUTH2}'in order to use either an OAUTH2 access token or an OpenID Connect ID token.`);R("transportProtocol",[x,m,"TransportProtocol",!0]),R("webTransportProtocolList",[y,m,"TransportProtocol",!0,!1,!1]),function(se,fe){if(fe.length>0&&function(ce){return ce&&(ce===m.HTTP_BINARY_STREAMING||ce===m.HTTP_BINARY||ce===m.HTTP_BASE64)}(se)){const ce=fe.length<=5?fe:fe.slice(0,5);throw new S(`SessionProperties validation: properties that are not supported by transport protocol ${se} have been set: ${ce}`,_.PARAMETER_OUT_OF_RANGE)}}($.transportProtocol,$.nonHTTPTransportPropsSet),$.publisherProperties&&a.MessagePublisherPropertiesValidator.validate($.publisherProperties);const M=$.defaultConnectTimeoutInMsecs,re=$.connectTimeoutInMsecs;($.webTransportProtocolList?$.webTransportProtocolList.length:1)>1&&re<M&&C(`Connect timeout of ${re} msecs is less than default and recommended minimum of ${M} msecs for current transport selection. Transport downgrades may not complete.`)}};o.exports.SessionPropertiesValidator=F},9656:(o,h,r)=>{r(5837);const a=r(5898),{APIProperties:u}=r(968),{AuthenticationScheme:l}=r(3399),{Check:d}=r(802),{LOG_WARN:f}=r(2694);r(6415);const p=class extends u{get transportProtocol(){return d.nothing(this._tpProtocol)?null:this._tpProtocol}set transportProtocol(_){this._tpProtocol=_}get transportDowngradeTimeoutInMsecs(){return d.nothing(this._tpDowngradeTimeout)?3e3:this._tpDowngradeTimeout}set transportDowngradeTimeoutInMsecs(_){this._tpDowngradeTimeout=_}get webTransportProtocolList(){return d.nothing(this._transportProtocolList)?null:this._transportProtocolList}set webTransportProtocolList(_){this._transportProtocolList=_}get bufferedAmountQueryIntervalInMsecs(){return d.nothing(this._bufferedAmountQueryInterval)?100:this._bufferedAmountQueryInterval}set bufferedAmountQueryIntervalInMsecs(_){this._bufferedAmountQueryInterval=_}get transportProtocolInUse(){return this._tpProtocolInUse||null}_setTransportProtocolInUse(_){this._tpProtocolInUse=_}get webTransportProtocolInUse(){return this._tpProtocolInUse||null}_setWebTransportProtocolInUse(_){this._tpProtocolInUse=_}get transportContentType(){return this._tpContentType||"text/plain"}set transportContentType(_){this._tpContentType=_}_lendsInspect(){return{bufferedAmountQueryIntervalInMsecs:this.bufferedAmountQueryIntervalInMsecs,transportContentType:this.transportContentType,transportDowngradeTimeoutInMsecs:this.transportDowngradeTimeoutInMsecs,transportProtocol:this.transportProtocol,transportProtocolInUse:this.transportProtocolInUse,webTransportProtocolList:this.webTransportProtocolList}}};o.exports.SessionProperties=class extends p{constructor(_){super(function(){const{MessagePublisherProperties:S}=a;return{_vpnNameInUse:"",_virtualRouterName:"",_p2pInboxInUse:"",_p2pInboxBase:"",_userIdentification:"",_tpProtocolInUse:null,_tpContentType:"text/plain",_publisherProperties:new S,_payloadCompressionLevel:0}}(),_)}get authenticationScheme(){return d.nothing(this._authScheme)?l.BASIC:this._authScheme}set authenticationScheme(_){this._authScheme=_}get accessToken(){return d.empty(this._accessToken)?"":this._accessToken}set accessToken(_){this._accessToken=_}get idToken(){return d.empty(this._idToken)?"":this._idToken}set idToken(_){this._idToken=_}get issuerIdentifier(){return d.empty(this._issuerIdentifier)?"":this._issuerIdentifier}set issuerIdentifier(_){d.type(_,"string")?d.empty(_)?f("Failed to set the issuer identifier because the passed string was empty or null. The passed issuer identifier must not be empty or null. Setting issuer identifier to default value empty string."):this._issuerIdentifier=_:(f("Failed to set issuer identifier because the pased value was not of type String. The passed issuer identifier must be of type String. Setting issuer identifier to default value empty string."),this._issuerIdentifier="")}get url(){return d.nothing(this._url)?"":this._url}set url(_){this._url=_}get password(){return d.nothing(this._password)?"":this._password}set password(_){this._password=_}get userName(){return d.nothing(this._userName)?"":this._userName}set userName(_){this._userName=_}get clientName(){return d.nothing(this._clientName)?"":this._clientName}set clientName(_){this._clientName=_}get applicationDescription(){return d.nothing(this._appDesc)?"":this._appDesc}set applicationDescription(_){this._appDesc=_}get vpnName(){return d.nothing(this._vpnName)?"":this._vpnName}set vpnName(_){this._vpnName=_}get vpnNameInUse(){return d.nothing(this._vpnNameInUse)?"":this._vpnNameInUse}_setVpnNameInUse(_){this._vpnNameInUse=_}get virtualRouterName(){return d.nothing(this._virtualRouterName)?"":this._virtualRouterName}_setVirtualRouterName(_){this._virtualRouterName=_}get connectTimeoutInMsecs(){return d.nothing(this._connectTimeout)?this.defaultConnectTimeoutInMsecs:this._connectTimeout}set connectTimeoutInMsecs(_){this._connectTimeout=_}get defaultConnectTimeoutInMsecs(){const{webTransportProtocolList:_,transportDowngradeTimeoutInMsecs:S}=this,C=_?_.length:1,g=C*S+(C>1?1e3:0);return Math.max(8e3,g)}get connectRetries(){return d.nothing(this._connectRetries)?20:this._connectRetries}set connectRetries(_){this._connectRetries=_}get connectRetriesPerHost(){return d.nothing(this._connectRetriesPerHost)?0:this._connectRetriesPerHost}set connectRetriesPerHost(_){this._connectRetriesPerHost=_}get reconnectRetryWaitInMsecs(){return d.nothing(this._reconnectRetryWaitInMsecs)?3e3:this._reconnectRetryWaitInMsecs}set reconnectRetryWaitInMsecs(_){this._reconnectRetryWaitInMsecs=_}get reconnectRetries(){return d.nothing(this._reconnectRetries)?20:this._reconnectRetries}set reconnectRetries(_){this._reconnectRetries=_}get generateSendTimestamps(){return!d.nothing(this._genSendTimestamps)&&this._genSendTimestamps}set generateSendTimestamps(_){this._genSendTimestamps=_}get generateReceiveTimestamps(){return!d.nothing(this._genReceiveTimestamps)&&this._genReceiveTimestamps}set generateReceiveTimestamps(_){this._genReceiveTimestamps=_}get includeSenderId(){return!d.nothing(this._includeSenderId)&&this._includeSenderId}set includeSenderId(_){this._includeSenderId=_}get generateSequenceNumber(){return!d.nothing(this._genSequenceNumber)&&this._genSequenceNumber}set generateSequenceNumber(_){this._genSequenceNumber=_}get keepAliveIntervalInMsecs(){return d.nothing(this._kaInterval)?3e3:this._kaInterval}set keepAliveIntervalInMsecs(_){this._kaInterval=_}get keepAliveIntervalsLimit(){return d.nothing(this._kaIntervalsLimit)?3:this._kaIntervalsLimit}set keepAliveIntervalsLimit(_){this._kaIntervalsLimit=_}get p2pInboxInUse(){return d.nothing(this._p2pInboxInUse)?"":this._p2pInboxInUse}_setP2pInboxInUse(_){this._p2pInboxInUse=_}get p2pInboxBase(){return d.nothing(this._p2pInboxBase)?"":this._p2pInboxBase}_setP2pInboxBase(_){this._p2pInboxBase=_}get userIdentification(){return d.nothing(this._userIdentification)?"":this._userIdentification}_setUserIdentification(_){this._userIdentification=_}get subscriberLocalPriority(){return d.nothing(this._subLocalPriority)?1:this._subLocalPriority}set subscriberLocalPriority(_){this._subLocalPriority=_}get subscriberNetworkPriority(){return d.nothing(this._subNetworkPriority)?1:this._subNetworkPriority}set subscriberNetworkPriority(_){this._subNetworkPriority=_}get ignoreDuplicateSubscriptionError(){return!!d.nothing(this._ignoreDupSubError)||this._ignoreDupSubError}set ignoreDuplicateSubscriptionError(_){this._ignoreDupSubError=_}get ignoreSubscriptionNotFoundError(){return!!d.nothing(this._ignoreSubNotFoundError)||this._ignoreSubNotFoundError}set ignoreSubscriptionNotFoundError(_){this._ignoreSubNotFoundError=_}get reapplySubscriptions(){return!d.nothing(this._reapplySubcriptions)&&this._reapplySubcriptions}set reapplySubscriptions(_){this._reapplySubcriptions=_}get publisherProperties(){return this._publisherProperties}set publisherProperties(_){const{MessagePublisherProperties:S}=a;this._publisherProperties=_ instanceof S?_:new S(_)}get noLocal(){return!d.nothing(this._noLocal)&&this._noLocal}set noLocal(_){this._noLocal=_}get readTimeoutInMsecs(){return d.nothing(this._readTimeout)?1e4:this._readTimeout}set readTimeoutInMsecs(_){this._readTimeout=_}get sendBufferMaxSize(){return d.nothing(this._sendBufferMaxSize)?65536:this._sendBufferMaxSize}set sendBufferMaxSize(_){this._sendBufferMaxSize=_}get assumedMaxAdSize(){return d.nothing(this._assumedMaxAdSize)?3e7:this._assumedMaxAdSize}set assumedMaxAdSize(_){this._assumedMaxAdSize=_}get maxWebPayload(){return d.nothing(this._maxWebPayload)?1048576:this._maxWebPayload}set maxWebPayload(_){this._maxWebPayload=_}get nonHTTPTransportPropsSet(){return[].filter(_=>d.something(this[_]))}get payloadCompressionLevel(){return d.nothing(this._payloadCompressionLevel)?0:this._payloadCompressionLevel}set payloadCompressionLevel(_){this._payloadCompressionLevel=_}inspect(){return Object.assign(this._lendsInspect(),{authenticationScheme:l.describe(this.authenticationScheme),accessToken:this.accessToken?"*****":"Not Set",idToken:this.idToken?"*****":"Not Set",issuerIdentifier:this.issuerIdentifier?"*****":"Not Set",url:this.url,password:this.password?"*****":this.password,userName:this.userName,clientName:this.clientName,applicationDescription:this.applicationDescription,vpnName:this.vpnName,vpnNameInUse:this.vpnNameInUse,virtualRouterName:this.virtualRouterName,connectTimeoutInMsecs:this.connectTimeoutInMsecs,connectRetries:this.connectRetries,connectRetriesPerHost:this.connectRetriesPerHost,reconnectRetryWaitInMsecs:this.reconnectRetryWaitInMsecs,reconnectRetries:this.reconnectRetries,generateSendTimestamps:this.generateSendTimestamps,generateReceiveTimestamps:this.generateReceiveTimestamps,includeSenderId:this.includeSenderId,generateSequenceNumber:this.generateSequenceNumber,keepAliveIntervalInMsecs:this.keepAliveIntervalInMsecs,keepAliveIntervalsLimit:this.keepAliveIntervalsLimit,p2pInboxInUse:this.p2pInboxInUse,p2pInboxBase:this.p2pInboxBase,userIdentification:this.userIdentification,subscriberLocalPriority:this.subscriberLocalPriority,subscriberNetworkPriority:this.subscriberNetworkPriority,ignoreDuplicateSubscriptionError:this.ignoreDuplicateSubscriptionError,reapplySubscriptions:this.reapplySubscriptions,publisherProperties:this.publisherProperties,noLocal:this.noLocal,readTimeoutInMsecs:this.readTimeoutInMsecs,sendBufferMaxSize:this.sendBufferMaxSize,maxWebPayload:this.maxWebPayload,payloadCompressionLevel:this.payloadCompressionLevel})}toString(){return super.toString()}}},168:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SessionRequestType=a.new({ADD_SUBSCRIPTION:0,REMOVE_SUBSCRIPTION:1,ADD_P2PINBOX:2,REMOVE_P2PINBOX:3,REMOVE_DTE_SUBSCRIPTION:100})},6057:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SessionStateName=a.new({DISCONNECTED:"SessionDisconnected",CONNECTING:"SessionConnecting",WAITING_FOR_TRANSPORT:"WaitingForTransport",WAITING_FOR_TRANSPORT_UP:"WaitingForTransportUp",WAITING_FOR_LOGIN:"WaitingForLogin",TRANSPORT_UP:"SessionTransportUp",FULLY_CONNECTED:"SessionFullyConnected",SESSION_ERROR:"SessionError",DISCONNECTING:"SessionDisconnecting",REAPPLYING_SUBSCRIPTIONS:"ReapplyingSubscriptions",WAITING_FOR_PUBFLOW:"WaitingForMessagePublisher",DISPOSED:"SessionDisposed",WAITING_FOR_SUBCONFIRM:"WaitForSubConfirm",WAITING_FOR_CAN_ACCEPT_DATA:"WaitForCanAcceptData",DISCONNECTING_FLOWS:"DisconnectingFlows",FLUSHING_TRANSPORT:"FlushingTransport",DESTROYING_TRANSPORT:"DestroyingTransport",RECONNECTING:"Reconnecting",TRANSPORT_FAIL:"TransportFail",WAITING_FOR_INTERCONNECT_TIMEOUT:"WaitingForInterconnectTimeout",WAITING_FOR_DNS:"WaitingForDNS",WAITING_FOR_TRANSPORT_CHANGE:"WaitingForTransportChange"})},3183:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SessionState=a.new({CONNECTING:1,CONNECTED:2,SESSION_ERROR:3,DISCONNECTING:4,DISCONNECTED:5})},9564:(o,h,r)=>{var a=r(2195);const u=r(9620),l=r(6247),d=r(4386),{assert:f}=r(7444),{CacheSession:p,CACHE_REQUEST_PREFIX:_}=r(2689),{CapabilityType:S}=r(2484),{Check:C,Parameter:g}=r(802),{DefaultCapabilities:m}=r(6472),{ErrorResponseSubcodeMapper:T,ErrorSubcode:y,OperationError:E,NotImplementedError:I,RequestEventCode:N}=r(6706),{EventEmitter:A}=r(3385),{GlobalContext:L}=r(343),{HostList:D}=r(7405),{LogFormatter:q}=r(2694),{MessageRxCBInfo:Y}=r(2299),{MutableSessionProperty:Q}=r(7113),{OutstandingDataRequest:W}=r(7105),{P2PUtil:x}=r(7603),{QueueDescriptor:k,QueueProperties:J,QueuePropertiesValidator:F,QueueType:$,explainInvalidEndpointName:R}=r(9631),{SDTField:B,SDTFieldType:M}=r(769),{SessionEvent:re}=r(8229),{ProvisionEvent:se}=r(918),{SessionEventCBInfo:fe}=r(5256),{SessionEventCode:ce}=r(6334),{SessionEventName:Te}=r(6324),{SessionFSM:Ee}=r(43),{SessionFSMEvent:he}=r(1122),{SessionOperation:ge}=r(1663),{SessionProperties:X}=r(9656),{SessionPropertiesValidator:ae}=r(9727),{SessionRequestType:ee}=r(168),{SessionState:Re}=r(3183),{SessionStateName:me}=r(6057),{Stats:Pe,StatType:H}=r(5747),{StringUtils:Z}=r(968),{TransportCapabilities:te,TransportProtocol:ie,TransportReturnCode:j}=r(8205);function Oe(O){return O&&O!==ie.HTTP_BINARY_STREAMING&&O!==ie.HTTP_BINARY&&O!==ie.HTTP_BASE64}function v(O){return`SessionEventCode.${ce.describe(O)}`}const P="#REQ";o.exports.Session=class extends A{constructor(O,U,V){super({emits:ce.values,direct:ce.MESSAGE,formatEventName:v});const z=this;this.logger=new q,this.logger.formatter=function(...de){return[`[session=${z._sessionFSM?z._sessionFSM.sessionIdHex:"(N/A)"}]`,...de]},this.logger,O!=null&&this.logger,this.on("error",de=>{const{LOG_ERROR:_e}=z.logger;_e(de.info.error)});const ne=new X(O);if(this.logger,this._messageCallbackInfo=this.wrapMessageCallback(U),this._eventCallbackInfo=this.wrapEventCallback(V),C.empty(ne.clientName)&&(ne.clientName=L.GenerateClientName()),ne._setUserIdentification(L.GenerateUserIdentification()),C.empty(ne.applicationDescription)&&(ne.applicationDescription=L.GenerateClientDescription()),ae.validate(ne),C.nothing(ne.webTransportProtocolList)){const de=ne.transportProtocol,_e=function(){const{ProfileBinding:Se}=d,Ce=[];return te.web.webSocket()&&Ce.push(ie.WS_BINARY),Se.value.cometEnabled&&(te.web.xhrBinary()&&(te.web.streaming()&&Ce.push(ie.HTTP_BINARY_STREAMING),Ce.push(ie.HTTP_BINARY)),Ce.push(ie.HTTP_BASE64)),Ce}(),we=de?_e.indexOf(de):0;if(we<0)throw new E(`Selected transport protocol ${ie.describe(de)} is disabled or invalid for this platform`,y.PARAMETER_CONFLICT);if(ne.webTransportProtocolList=_e.slice(we),ne.webTransportProtocolList.length===0)throw new E(`No usable transport protocol or fallback from ${ie.describe(de)}`,y.PARAMETER_CONFLICT);const oe=ne.webTransportProtocolList.filter(Se=>Oe(Se));if(oe.length===0&&(this._adDisabledReason=`Guaranteed messaging not compatible with any available transport protocol: ${ne.webTransportProtocolList.map(Se=>ie.describe(Se)).join(", ")}`),ne.publisherProperties.enabled){if(this._adDisabledReason)throw new E("Invalid transport protocol(s) for session with Guaranteed Messaging Publisher",y.PARAMETER_CONFLICT,this._adDisabledReason);ne.webTransportProtocolList=oe}}else{const de=ne.webTransportProtocolList;if(!de.every(Oe)){const _e=de.filter(we=>!Oe(we));if(this._adDisabledReason=`Guaranteed messaging incompatible with selected transport protocols: ${_e.map(we=>ie.describe(we)).join(", ")}`,ne.publisherProperties.enabled)throw new E("Invalid transport protocol(s) for session with Guaranteed Messaging Publisher",y.PARAMETER_CONFLICT,this._adDisabledReason)}}this._sessionProperties=ne,this._sessionStats=new Pe,this._hosts=new D(ne),this._sessionFSM=new Ee(this._sessionProperties,this,this._sessionStats,this._hosts),this._sessionFSM.start(),this._sessionFSM.createMessagePublisher(),this._outstandingDataReqs={},this._capabilities=m.createDefaultCapabilities(ne),this._seqNum=1}connect(){this.logger;const O=this.allowOperation(ge.CONNECT);if(O)throw new E(O,y.INVALID_OPERATION,null);const U=new he({name:Te.CONNECT});this._sessionFSM.processEvent(U)}get canAck(){return[me.CONNECTING,me.TRANSPORT_UP,me.DISCONNECTING].some(O=>!!this._sessionFSM.getActiveState(O))}disconnect(){this.logger;const O=this.allowOperation(ge.DISCONNECT);if(O)throw new E(O,y.INVALID_OPERATION,null);const U=new he({name:Te.DISCONNECT});this._sessionFSM.processEvent(U)}dispose(){this.logger,this._disposed||setTimeout(()=>{this._sessionFSM.processEvent(new he({name:Te.DISPOSE})),this._sessionFSM.terminateFsm(),this.disableEmitter(),this._disposed=!0},0)}subscribe(O,U,V,z){this.logger,O&&O.toString&&O.toString();const ne=this.allowOperation(ge.CTRL);if(ne)throw new E(ne,y.INVALID_OPERATION,null);if(g.isInstanceOf("topic",O,u.Destination),O.validate(),O.getType()!==u.DestinationType.TOPIC)throw new E(`Topic is required for subscribe; ${u.DestinationType.describe(O.getType())}`,y.INVALID_TOPIC_SYNTAX);g.isBooleanOrNothing("requestConfirmation",U),g.isNumberOrNothing("requestTimeout",z),g.isRangeCompareOrNothing("requestTimeout",z,">",0);const de=this._sessionFSM.subscriptionUpdate(O,!!U,V,z,ee.ADD_SUBSCRIPTION,!1,(we,oe)=>this.handleSubscriptionUpdateResponse(we,oe,U)),_e=r(8205);if(de===_e.TransportReturnCode.NO_SPACE)throw new E("Cannot send subscription request - no space in transport. Please try again later (on CAN_ACCEPT_DATA)",y.INSUFFICIENT_SPACE,_e.TransportReturnCode.describe(de));if(de!==_e.TransportReturnCode.OK)throw new E("Cannot send subscription request - transport error.",y.COMMUNICATION_ERROR,_e.TransportReturnCode.describe(de));return de}updateQueueSubscription(O,U,V,z,ne,de){this.logger,O&&O.toString&&O.toString(),U&&U.toString&&U.toString();const _e=this.allowOperation(ge.CTRL);if(_e)throw new E(_e,y.INVALID_OPERATION,null);if(g.isInstanceOf("topic",O,u.Destination),O.validate(),O.getType()!==u.DestinationType.TOPIC)throw new E(`Topic is required for queue subscribe; ${u.DestinationType.describe(O.getType())}`,y.INVALID_TOPIC_SYNTAX);if(g.isInstanceOf("queue",U,u.Destination),U.validate(),U.getType()!==u.DestinationType.QUEUE&&U.getType()!==u.DestinationType.TEMPORARY_QUEUE)throw new E(`Queue is required for queue subscribe; ${u.DestinationType.describe(U.getType())}`,y.PARAMETER_INVALID_TYPE);g.isNumberOrNothing("requestTimeout",de),g.isRangeCompareOrNothing("requestTimeout",de,">",0);const we=this._sessionFSM.queueSubscriptionUpdate(O,U,de,V,!1,(Se,Ce)=>this.handleQueueSubscriptionUpdateResponse(Se,Ce,ne)),oe=r(8205);if(we===oe.TransportReturnCode.NO_SPACE)throw new E("Cannot send subscription request - no space in transport. Please try again later (on CAN_ACCEPT_DATA)",y.INSUFFICIENT_SPACE,oe.TransportReturnCode.describe(we));if(we!==oe.TransportReturnCode.OK)throw new E("Cannot send subscription request - transport error.",y.COMMUNICATION_ERROR,oe.TransportReturnCode.describe(we));return we}unsubscribe(O,U,V,z){this.logger,O&&O.toString&&O.toString();const ne=this.allowOperation(ge.CTRL);if(ne)throw new E(ne,y.INVALID_OPERATION,null);if(g.isInstanceOf("topic",O,u.Destination),O.validate(),O.getType()!==u.DestinationType.TOPIC)throw new E(`Topic is required for unsubscribe; ${u.DestinationType.describe(O.getType())}`,y.INVALID_TOPIC_SYNTAX);g.isBooleanOrNothing("requestConfirmation",U),g.isNumberOrNothing("requestTimeout",z),g.isRangeCompareOrNothing("requestTimeout",z,">",0);const de=this._sessionFSM.subscriptionUpdate(O,!!U,V,z,ee.REMOVE_SUBSCRIPTION,!1,(we,oe)=>this.handleSubscriptionUpdateResponse(we,oe,U)),_e=r(8205);if(de===_e.TransportReturnCode.NO_SPACE)throw new E("Cannot send unsubscribe request - no space in transport. Please try again later (on CAN_ACCEPT_DATA)",y.INSUFFICIENT_SPACE,_e.TransportReturnCode.describe(de));if(de!==_e.TransportReturnCode.OK)throw new E("Cannot send unsubscribe request - transport error.",y.COMMUNICATION_ERROR,_e.TransportReturnCode.describe(de));return de}unsubscribeDurableTopicEndpoint(O){this.logger,O&&O.toString&&O.toString();const U=this.allowOperation(ge.CTRL);if(U)throw new E(U,y.INVALID_OPERATION,null);const V=this.createDestinationFromDescriptor(k.createFromSpec(O)),z=this._sessionFSM.subscriptionUpdate(V,!0,void 0,void 0,ee.REMOVE_DTE_SUBSCRIPTION,!1,(de,_e)=>this.handleDTEUnsubscribeResponse(de,_e)),ne=r(8205);if(z===ne.TransportReturnCode.NO_SPACE)throw new E("Cannot send subscription request - no space in transport. Please try again later (on CAN_ACCEPT_DATA)",y.INSUFFICIENT_SPACE,ne.TransportReturnCode.describe(z));if(z!==ne.TransportReturnCode.OK)throw new E("Cannot send subscription request - transport error.",y.COMMUNICATION_ERROR,ne.TransportReturnCode.describe(z));return z}updateProperty(O,U,V,z){this.logger;const ne=this.allowOperation(ge.CTRL);if(ne)throw new E(ne,y.INVALID_OPERATION,null);const{Topic:de}=u;let _e;g.isEnumMember("mutableSessionProperty",O,Q),g.isNumberOrNothing("requestTimeout",V),g.isRangeCompareOrNothing("requestTimeout",V,">",0);const we=this._sessionFSM.sendUpdateProperty(O,U,z,V,oe=>{const Se=oe.getResponse();if(Se.responseCode===200){if(O===Q.CLIENT_DESCRIPTION)this._sessionProperties.applicationDescription=U,_e=re.build(ce.PROPERTY_UPDATE_OK,Se.responseString,Se.responseCode,0,z,null),this.sendEvent(_e);else if(O===Q.CLIENT_NAME){const Ce=x.getP2PTopicSubscription(this._sessionProperties.p2pInboxBase),je=de.createFromName(Ce),Be=x.getP2PTopicSubscription(oe.getP2PTopicValue()),ct=de.createFromName(Be),Gt=et=>{const xe=et.getResponse();if(xe.responseCode===200)this._sessionProperties._setP2pInboxBase(oe.getP2PTopicValue()||""),this._sessionProperties._setP2pInboxInUse(x.getP2PInboxTopic(this._sessionProperties.p2pInboxBase)),this._sessionProperties.clientName=U,_e=re.build(ce.PROPERTY_UPDATE_OK,xe.responseString,xe.responseCode,0,z,null),this.sendEvent(_e);else{const He=T.getErrorSubcode(xe.responseCode,xe.responseString);He===y.SUBSCRIPTION_ALREADY_PRESENT&&this._sessionProperties.ignoreDuplicateSubscriptionError?(_e=re.build(ce.PROPERTY_UPDATE_OK,xe.responseString,xe.responseCode,0,z,null),this.sendEvent(_e)):He===y.SUBSCRIPTION_ALREADY_PRESENT||He===y.SUBSCRIPTION_ATTRIBUTES_CONFLICT||He===y.SUBSCRIPTION_INVALID||He===y.SUBSCRIPTION_ACL_DENIED||He===y.SUBSCRIPTION_TOO_MANY?(_e=re.build(ce.PROPERTY_UPDATE_ERROR,xe.responseString,xe.responseCode,He,z,null),this.sendEvent(_e)):(_e=re.build(ce.PROPERTY_UPDATE_ERROR,xe.responseString,xe.responseCode,y.SUBSCRIPTION_ERROR_OTHER,z,null),this.sendEvent(_e))}},Ne=et=>{const xe=et.getResponse();if(xe.responseCode===200)this._sessionFSM.subscriptionUpdate(ct,!0,z,this._sessionProperties.readTimeoutInMsecs,ee.ADD_P2PINBOX,!0,Gt);else{const He=T.getErrorSubcode(xe.responseCode,xe.responseString);He===y.SUBSCRIPTION_NOT_FOUND&&this._sessionProperties.ignoreSubscriptionNotFoundError?this._sessionFSM.subscriptionUpdate(ct,!0,z,this._sessionProperties.readTimeoutInMsecs,ee.ADD_P2PINBOX,!0,Gt):He===y.SUBSCRIPTION_ATTRIBUTES_CONFLICT||He===y.SUBSCRIPTION_INVALID||He===y.SUBSCRIPTION_NOT_FOUND||He===y.SUBSCRIPTION_ACL_DENIED?(_e=re.build(ce.PROPERTY_UPDATE_ERROR,xe.responseString,xe.responseCode,He,null,null),this.sendEvent(_e)):(_e=re.build(ce.PROPERTY_UPDATE_ERROR,xe.responseString,xe.responseCode,y.SUBSCRIPTION_ERROR_OTHER,null,null),this.sendEvent(_e))}};this._sessionFSM.subscriptionUpdate(je,!0,z,this._sessionProperties.readTimeoutInMsecs,ee.REMOVE_P2PINBOX,!0,Ne)}}else{const Ce=T.getErrorSubcode(Se.responseCode,Se.responseString);_e=re.build(ce.PROPERTY_UPDATE_ERROR,Se.responseString,Se.responseCode,Ce,z,null),this.sendEvent(_e)}});we!==j.OK&&(_e=we===j.NO_SPACE?re.build(ce.PROPERTY_UPDATE_ERROR,"Property update failed - no space in transport",null,y.INSUFFICIENT_SPACE,null,null):re.build(ce.PROPERTY_UPDATE_ERROR,"Property update failed",null,y.INVALID_OPERATION,null,null),this.sendEvent(_e))}updateAuthenticationOnReconnect(O){this.logger;const U=["accessToken","idToken"],V=this.allowOperation(ge.QUERY_OPERATION);if(V)throw new E(V,y.INVALID_OPERATION,null);if(!O||typeof O!="object")throw new E("updateAuthenticationOnReconnect parameter must be a non-empty object.",y.PARAMETER_INVALID_TYPE,null);var z;for(z in O)if(!U.includes(z))throw new E("Invalid property in updateAuthenticationOnReconnect parameter.",y.PARAMETER_CONFLICT,null);const ne=this.getSessionProperties();Object.assign(ne,O),ae.validate(ne),this._sessionProperties=ne,Object.assign(this._sessionFSM._sessionProperties,O)}send(O){this.logger;const U=this.allowOperation(ge.SEND,O);if(U)throw new E(U,y.INVALID_OPERATION,null);if(g.isInstanceOf("message",O,l.Message),!this.isCapable(S.VAR_LEN_EXT_PARAM)&&(O.clearExtendedVarLenParams(),this._failOnExtendedVariableLengthProperties(O)))throw new E("Broker does not support variable length SMF extended parameters",y.INVALID_OPERATION);this.validateAndSendMessage(O)}_failOnExtendedVariableLengthProperties(O){return!1}sendRequest(O,U=void 0,V=void 0,z=void 0,ne=void 0){this.logger;const de=this.allowOperation(ge.SEND,O);if(de)throw new E(de,y.INVALID_OPERATION,null);if(g.isInstanceOf("message",O,l.Message),g.isNumberOrNothing("timeout",U),g.isRangeCompareOrNothing("timeout",U,">=",100),g.isFunctionOrNothing("replyReceivedCBFunction",V),g.isFunctionOrNothing("requestFailedCBFunction",z),O.getCorrelationId()==null&&O.setCorrelationId(P+L.NextId()),O.getReplyTo()==null){const _e=u.Topic.createFromName(this._sessionProperties.p2pInboxInUse);O.setReplyTo(_e)}this.validateAndSendMessage(O),this.enqueueOutstandingDataReq(O.getCorrelationId(),z,U,V,ne)}sendReply(O,U){this.logger;const V=this.allowOperation(ge.SEND,U);if(V)throw new E(V,y.INVALID_OPERATION,null);if(g.isInstanceOfOrNothing("messageToReplyTo",O,l.Message),g.isInstanceOf("replyMessage",U,l.Message),U.setAsReplyMessage(!0),O){if(U.setCorrelationId(O.getCorrelationId()),O.getReplyTo()==null)throw new E("ReplyTo destination may not be null.",y.PARAMETER_OUT_OF_RANGE);U.setDestination(O.getReplyTo())}this.validateAndSendMessage(U)}getStat(O){this.logger;const U=this.allowOperation(ge.QUERY_OPERATION);if(U)throw new E(U,y.INVALID_OPERATION,null);return g.isEnumMember("statType",O,H),this._sessionFSM.getStat(O)}resetStats(){this.logger;const O=this.allowOperation(ge.QUERY_OPERATION);if(O)throw new E(O,y.INVALID_OPERATION,null);this._sessionFSM.resetStats()}getSessionProperties(){this.logger;const O=this.allowOperation(ge.QUERY_OPERATION);if(O)throw new E(O,y.INVALID_OPERATION,null);const U=this._sessionProperties.clone();return this.getSessionState()!==me.DISCONNECTED&&this._sessionFSM._transport&&U._setWebTransportProtocolInUse(this._sessionFSM._transport.getTransportProtocol()),U}isCapable(O){this.logger;const U=this.allowOperation(ge.QUERY_OPERATION);if(U)throw new E(U,y.INVALID_OPERATION,null);g.isNumber("capabilityType",O);const V=this._capabilities;return!!V&&typeof V[O]=="boolean"&&V[O]}getCapability(O){this.logger;const U=this.allowOperation(ge.QUERY_OPERATION);if(U)throw new E(U,y.INVALID_OPERATION,null);g.isNumber("capabilityType",O);const V=this._getCapability(O);return typeof V=="boolean"?B.create(M.BOOL,V):typeof V=="number"?B.create(M.INT64,V):typeof V=="string"?B.create(M.STRING,V):null}_getCapability(O){const U=this._capabilities;if(!U)return null;const V=U[O];return V===void 0?null:V}getSessionState(){this.logger;const O=this.allowOperation(ge.QUERY_OPERATION);if(O)throw new E(O,y.INVALID_OPERATION,null);const U=this.getFSMState();switch(U){case me.FULLY_CONNECTED:return Re.CONNECTED;case me.DISCONNECTING:return Re.DISCONNECTING;case me.DISCONNECTED:return Re.DISCONNECTED;case me.SESSION_ERROR:return Re.SESSION_ERROR;case me.CONNECTING:case me.WAITING_FOR_INTERCONNECT_TIMEOUT:case me.WAITING_FOR_DNS:case me.WAITING_FOR_TRANSPORT_UP:case me.WAITING_FOR_SESSION_UP:case me.WAITING_FOR_LOGIN:case me.WAITING_FOR_P2PINBOX_REG:case me.WAITING_FOR_PUBFLOW:case me.REAPPLYING_SUBSCRIPTIONS:return Re.CONNECTING;default:{const{LOG_INFO:V}=this.logger;return V(`Unmapped session state ${me.describe(U)}`),null}}}getFSMState(){return this._sessionFSM.getCurrentStateName()}createCacheSession(O){return this.logger,new p(O,this,{incStat:this._sessionFSM.incStat.bind(this._sessionFSM)})}createMessageConsumer(O){if(this.logger,this._adDisabledReason)throw new E("Session does not provide MessageConsumer capability",y.GM_UNAVAILABLE,this._adDisabledReason);return O!=null&&this.logger,this._sessionFSM.createMessageConsumer(O)}provisionEndpoint(O,U,V,z){g.isBooleanOrNothing("ignoreExists",V),g.isInstanceOf("queueDescriptor",O,Object,y.PARAMETER_INVALID_TYPE,"queueDescriptor must be supplied, can't be "+O),g.isString("queueDescriptor.name",O.name,y.PARAMETER_INVALID_TYPE,"provisionEndpoint only works on named endpoints");const ne=new k(O);if(!ne.durable)throw new I("provisionEndpoint() only works for durable endpoints.");U&&(g.isInstanceOfOrNothing("queueProperties",U,Object,y.PARAMETER_INVALID_TYPE,"queueProperties must be an object, ideally a solace.QueueProperties instance. Can't be "+U),F.validate(U));const de=this.handleProvisionResponse.bind(this,V,!0);return this._sessionFSM.provisionEndpoint(ne,U,z,de)}deprovisionEndpoint(O,U,V){if(g.isBooleanOrNothing("ignoreMissing",U),!(O instanceof Object))throw new E("queueDesscriptor object required",y.PARAMETER_INVALID_TYPE);g.isString("queueDescriptor.name",O.name,y.PARAMETER_INVALID_TYPE,"deprovisionEndpoint only works on named endpoints");const z=this.handleProvisionResponse.bind(this,U,!1);return this._sessionFSM.deprovisionEndpoint(O,V,z)}handleProvisionResponse(O,U,V,z){const{correlationKey:ne}=z,de=V._smfHeader.pm_respcode,_e=V._smfHeader.pm_respstr,we=T.getADErrorSubcode(de,_e),oe=new k;oe.durable=void 0;const Se=new J,{DestinationUtil:Ce}=u;V.getQueueNameBytes()&&V.getQueueNameBytes().length>0?(oe.name=Ce.decodeBytes(V.getQueueNameBytes()),oe.type=$.QUEUE):V.getTopicEndpointBytes()&&V.getTopicEndpointBytes().length>0?(oe.name=Ce.decodeBytes(V.getTopicEndpointBytes()),oe.type=$.TOPIC_ENDPOINT):(oe.name=void 0,oe.type=void 0),oe.durable=V.getDurability(),Se.accessType=V.getAccessType(),Se.discardBehavior=V.getQueueDiscardBehavior(),Se.maxMessageRedelivery=V.getMaxRedelivery(),Se.maxMessageSize=V.getMaxMsgSize(),Se.permissions=V.getAllOthersPermissions(),Se.quotaMB=V.getQuota(),Se.respectsTTL=V.getRespectsTTL();let je=null;de!==400||we!==y.INVALID_QUEUE_NAME&&we!==y.INVALID_TE_NAME||(je=R(oe.name));let Be=ce.PROVISION_ERROR;de===200||O&&U&&we==y.ENDPOINT_ALREADY_EXISTS?Be=ce.PROVISION_OK:!O||U||we!=y.UNKNOWN_QUEUE_NAME&&we!=y.UNKNOWN_TOPIC_ENDPOINT_NAME||(Be=ce.PROVISION_OK);const ct=new se(Be,_e,de,we,ne,je,oe,Se);this.sendEvent(ct)}createQueueBrowser(O){if(this.logger,this._adDisabledReason)throw new E("Session does not provide QueueBrowser capability",y.GM_UNAVAILABLE,this._adDisabledReason);return O!=null&&this.logger,this._sessionFSM.createQueueBrowser(O)}createDestinationFromDescriptor(O){const{DestinationType:U,Queue:V,Topic:z}=u;let ne=U.TOPIC;O.type===$.QUEUE&&(ne=O.durable?U.QUEUE:U.TEMPORARY_QUEUE);const de=O.name||null;return O.durable?(f(de,"Durable endpoint with generated name is not a valid configuration"),(O.getType()===$.QUEUE?V.createFromLocalName:z.createFromName)(de)):this.createTemporaryDestination(ne,de)}createTemporaryDestination(O,U){this.logger;const{DestinationFromNetwork:V,DestinationUtil:z}=u,ne=this.getSessionProperties().virtualRouterName;if(!this.isCapable(S.TEMPORARY_ENDPOINT)||ne==null||ne.length===0)throw new E("Attempt to generate temporary destination or endpoint without suitable session",y.INVALID_OPERATION);const de=U&&U.startsWith("#P2P")?U:z.createTemporaryName(O,ne,U);return V.createDestinationFromName(de)}sendEvent(O){O&&(this._disposed||(this.logger,this._eventCallbackInfo.sessionEventCBFunction(this,O,this._eventCallbackInfo.userObject)))}getTransportInfo(){return this.logger,this._sessionFSM.getTransportInfo()}injectTransportInterceptor(O){this._sessionFSM.injectTransportInterceptor(O)}allowOperation(O,U){if(!this._sessionFSM)return!1;let V=!0;const z=this._sessionFSM.getCurrentStateName();if(z===me.DISPOSED)V=!1;else if(C.anything(O))switch(O){case ge.CONNECT:z!==me.NEW&&z!==me.DISCONNECTED&&(V=!1);break;case ge.DISCONNECT:z===me.NEW&&(V=!1);break;case ge.SEND:case ge.CTRL:V=z===me.FULLY_CONNECTED||U&&U.getDeliveryMode()!==l.MessageDeliveryModeType.DIRECT;break;case ge.QUERY_OPERATION:V=!0;break;default:V=!1}else V=!1;return V?null:`Cannot perform operation ${O} while in state ${z}`}updateCapabilities(O){this._capabilities=O}validateAndSendMessage(O){const U=O.getDestination();if(C.nothing(U)||C.empty(U.getName()))throw new E("Message must have a valid Destination",y.TOPIC_MISSING);const V=O.getSenderTimestamp()==null;if(this._sessionProperties.generateSendTimestamps&&(V||O.hasAutoSenderTimestamp)){const de=new Date;O.setSenderTimestamp(de.getTime()),O.hasAutoSenderTimestamp=!0}const z=O.getSequenceNumber()==null;this._sessionProperties.generateSequenceNumber&&(z||O.hasAutoSequenceNumber)&&(O.setSequenceNumber(this._seqNum++),O.hasAutoSequenceNumber=!0);const ne=O.getSenderId()==null;this._sessionProperties.includeSenderId&&ne&&O.setSenderId(this._sessionProperties.clientName),this._sessionFSM.prepareAndSendMessage(O)}enqueueOutstandingDataReq(O,U,V,z,ne){if(C.none(O))return;const{LOG_TRACE:de,LOG_ERROR:_e}=this.logger,we=setTimeout(()=>{this._sessionFSM.incStat(H.TX_REQUEST_TIMEOUT);try{delete this._outstandingDataReqs[O]||_e(`Cannot delete data request ${O}`)}catch(Se){_e(`Cannot delete data request ${O}`,Se)}if(C.anything(U)){const Se=re.build(N.REQUEST_TIMEOUT,"Request timeout",O);U(this,Se,ne)}},V||this._sessionProperties.readTimeoutInMsecs),oe=new W(O,we,z,U,ne);this._outstandingDataReqs[O]=oe}cancelOutstandingDataReq(O){const{LOG_TRACE:U,LOG_ERROR:V}=this.logger;if(C.none(O)||!this._outstandingDataReqs)return null;const z=this._outstandingDataReqs[O];if(z==null)return null;z.timer&&(clearTimeout(z.timer),z.timer=null);try{delete this._outstandingDataReqs[O]||V(`Cannot delete data request ${O}`)}catch(ne){V(`Cannot delete data request ${O}`,ne)}return z}cleanupSession(){this.logger,this._outstandingDataReqs&&Object.keys(this._outstandingDataReqs).forEach(O=>{const U=this.cancelOutstandingDataReq(O);if(U&&U.reqFailedCBFunction){const V=re.build(N.REQUEST_ABORTED,"Request aborted",O);U.reqFailedCBFunction(this,V,U.userObject)}})}handleDataMessage(O){const{LOG_TRACE:U,LOG_INFO:V}=this.logger,z=O;if(this._sessionProperties.generateReceiveTimestamps){const ne=new Date;z._receiverTimestamp=ne.getTime()}if(z.isReplyMessage()){const ne=z.getCorrelationId();if(C.anything(ne)){const de=this.cancelOutstandingDataReq(ne);if(de!==null)return this._sessionFSM.incStat(H.RX_REPLY_MSG_RECVED),void de.replyReceivedCBFunction(this,z,de.userObject);if(ne.startsWith(P))return V("DROP: Discard reply message due to missing outstanding request"),void this._sessionFSM.incStat(H.RX_REPLY_MSG_DISCARD);if(ne.startsWith(_)&&!(p&&this._messageCallbackInfo.userObject instanceof p))return V("DROP: Discard cache reply due to no cache session active"),void this._sessionFSM.incStat(H.RX_REPLY_MSG_DISCARD)}}this._messageCallbackInfo.messageRxCBFunction(this,z,this._messageCallbackInfo.userObject)}handleSubscriptionUpdateResponse(O,U,V){const z=O.getResponse(),{responseCode:ne,responseString:de}=z,{correlationKey:_e}=U;if(ne===200){const we=re.build(ce.SUBSCRIPTION_OK,de,ne,0,_e,null);this.sendEvent(we)}else{const we=Z.stripNullTerminate(O.encodedUtf8Subscription);this._sessionFSM.handleSubscriptionUpdateError(ne,de,we,_e,V)}}handleQueueSubscriptionUpdateResponse(O,U,V){if(this.logger,!O)return void V(!1,y.TIMEOUT,0,"Timeout");const z=O.getResponse(),{responseCode:ne,responseString:de}=z,_e=T.getADErrorSubcode(ne,de);ne===200||_e===y.SUBSCRIPTION_ALREADY_PRESENT||_e===y.SUBSCRIPTION_NOT_FOUND?V(!0,0,ne,de):V(!1,_e,ne,de)}handleDTEUnsubscribeResponse(O,U){const V=O.getResponse(),{responseCode:z,responseString:ne}=V,{correlationKey:de}=U,_e=z===200?ce.UNSUBSCRIBE_TE_TOPIC_OK:ce.UNSUBSCRIBE_TE_TOPIC_ERROR,we=z===200?0:T.getADErrorSubcode(z,ne);this.sendEvent(re.build(_e,ne,z,we,de))}handleSubscriptionUpdateError(O,U,V,z,ne){const de=T.getErrorSubcode(O,U);if(de===y.SUBSCRIPTION_ALREADY_PRESENT&&this._sessionProperties.ignoreDuplicateSubscriptionError||de===y.SUBSCRIPTION_NOT_FOUND&&this._sessionProperties.ignoreSubscriptionNotFoundError){if(ne){const _e=re.build(ce.SUBSCRIPTION_OK,U,O,0,z,null);this.sendEvent(_e)}}else{const _e=re.build(ce.SUBSCRIPTION_ERROR,U,O,de,z,`Topic: ${V}`);this.sendEvent(_e)}}getEventCBInfo(){return this._eventCallbackInfo}setEventCBInfo(O){this._eventCallbackInfo=O}getMessageCBInfo(){return this._messageCallbackInfo}setMessageCBInfo(O){this._messageCallbackInfo=O}getCorrelationTag(){return this._sessionFSM.getCorrelationTag()}wrapEventCallback(O){const{LOG_WARN:U}=this.logger,V=O?O.sessionEventCBFunction?O:new fe(O):null;return new fe((z,ne,de,_e)=>{const{sessionEventCode:we}=ne;if(V)try{V.sessionEventCBFunction(z,ne,de,_e)}catch(oe){const Se=Object.assign(new E(`Unhandled error in SessionEventRxCBInfo callback on sessionEventCode ${ce.describe(we)}`,y.CALLBACK_ERROR,`On event: ${[we,ne,de,_e]} ${oe}`),{stack:oe.stack,info:{event:{name:we,formattedName:`SessionEventCode.${ce.describe(we)}`,args:[ne,de,_e]},error:oe}});U(Se.toString(),Se.info)}this.emit(we,ne)})}wrapMessageCallback(O){const{LOG_WARN:U}=this.logger,V=O?O.messageRxCBFunction?O:new Y(O):null,z=`SessionEventCode.${ce.describe(ce.MESSAGE)}`,ne=(de,_e,we)=>Object.assign(new E(`Unhandled error in MessageRxCBInfo callback/handler for ${z}`,y.CALLBACK_ERROR),{stack:de.stack,info:{event:{name:ce.MESSAGE,formattedName:z,args:[_e,we]},error:de}});return new Y((de,_e,we)=>{if(V)try{V.messageRxCBFunction(de,_e,we)}catch(oe){const Se=ne(oe,_e,we).toString();U(Se,Se.info,oe)}try{this.emitDirect(_e)}catch(oe){this.emit("error",ne(oe,_e,we))}})}get adLocallyDisabled(){return!!this._adDisabledReason}get canConnectConsumer(){return!this.adLocallyDisabled&&(this._capabilities?this.isCapable(S.GUARANTEED_MESSAGE_CONSUME):void 0)}get canConnectPublisher(){return!this.adLocallyDisabled&&(this._capabilities?this.isCapable(S.GUARANTEED_MESSAGE_PUBLISH):void 0)}get disposed(){return this._disposed}inspect(){return{sessionId:this._sessionFSM&&this._sessionFSM.sessionIdHex||"(N/A)",transport:this.getTransportInfo(),state:Re.describe(this.getSessionState())}}toString(){return a(this)}}},6415:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SslDowngrade=a.new({NONE:"NONE",PLAINTEXT:"PLAIN_TEXT"})},4356:(o,h,r)=>{const{SessionRequestType:a}=r(168);o.exports={SubscriptionUpdateTimeoutMessages:{[a.ADD_SUBSCRIPTION]:"Add subscription request timeout",[a.REMOVE_SUBSCRIPTION]:"Remove subscription request timeout",[a.ADD_P2PINBOX]:"Add P2P inbox subscription timeout",[a.REMOVE_P2PINBOX]:"Remove P2P inbox subscription timeout",[a.REMOVE_DTE_SUBSCRIPTION]:"Remove endpoint topic subscription",default:"Request timeout"}}},3450:(o,h,r)=>{const a=r(7623),{AdProtocolMessage:u,BinaryMetaBlock:l,ClientCtrlMessage:d,KeepAliveMessage:f,SMPMessage:p}=r(8247),{SMFAdProtocolMessageType:_}=r(7250),{SMFAdProtocolParam:S}=r(5099),{SMFClientCtrlMessageType:C}=r(9640),{SMFClientCtrlParam:g}=r(9685),{SMFParameterType:m,SMFExtendedParameterType:T}=r(7750),{SMFProtocol:y}=r(5052),{SMFSMPMessageType:E}=r(3647),{SMFSMPMessageTypeFlags:I}=r(1278),{SMFTransportSessionMessageType:N}=r(1643);o.exports.AdProtocolMessage=u,o.exports.BinaryMetaBlock=l,o.exports.ClientCtrlMessage=d,o.exports.Codec=a,o.exports.KeepAliveMessage=f,o.exports.SMFAdProtocolMessageType=_,o.exports.SMFAdProtocolParam=S,o.exports.SMFClientCtrlMessageType=C,o.exports.SMFClientCtrlParam=g,o.exports.SMFParameterType=m,o.exports.SMFProtocol=y,o.exports.SMFSMPMessageTypeFlags=I,o.exports.SMFSMPMessageType=E,o.exports.SMFTransportSessionMessageType=N,o.exports.SMPMessage=p,o.exports.SMFExtendedParameterType=T},1318:(o,h,r)=>{const a=r(3450),{AdProtocolMessage:u,SMFParameter:l}=r(8247),{Bits:d,Convert:f}=r(9783),{LOG_DEBUG:p,LOG_INFO:_,LOG_ERROR:S}=r(2694),{ReplayStartType:C}=r(9309),{get:g,set:m}=d,{int8ToStr:T,int16ToStr:y,int24ToStr:E,int32ToStr:I}=f;function N(k,J){const F=[];let $=0;return $=d.set($,k,6,2),$=d.set($,J,0,6),F.push(f.int8ToStr($)),F.push(f.int8ToStr(2)),F.join("")}function A(k,J,F){const $=[];let R=0;return R=d.set(R,k,6,2),R=d.set(R,J,0,6),$.push(f.int8ToStr(R)),$.push(f.int8ToStr(3)),$.push(f.int8ToStr(F)),$.join("")}function L(k,J,F){const $=[];let R=0;return R=d.set(R,k,6,2),R=d.set(R,J,0,6),$.push(f.int8ToStr(R)),$.push(f.int8ToStr(4)),$.push(f.int16ToStr(F)),$.join("")}function D(k,J,F){const $=[];let R=0;return R=d.set(R,k,6,2),R=d.set(R,J,0,6),$.push(f.int8ToStr(R)),$.push(f.int8ToStr(6)),$.push(f.int32ToStr(F)),$.join("")}function q(k,J,F){const $=[];let R=0;return R=d.set(R,k,6,2),R=d.set(R,J,0,6),$.push(f.int8ToStr(R)),$.push(f.int8ToStr(10)),$.push(f.int64ToStr(F)),$.join("")}const Y={};function Q(k,J,F){const $=[],R=F.type,B=F.value;let M=0;switch(M=d.set(M,k,6,2),M=d.set(M,J,0,6),$.push(f.int8ToStr(M)),$.push(f.int8ToStr(Y[R])),$.push(f.int8ToStr(R)),R){case C.DATE:$.push(f.int64ToStr(B));break;case C.RGMID:$.push(f.int64ToStr(B.suid)),$.push(f.int64ToStr(B.messageId));case C.BEGINNING:}return $.join("")}function W(k,J,F,$,R=void 0){const B=[];let M=0;M=d.set(M,k,6,2),M=d.set(M,J,0,6);const re=R==null||R===0?18:19;return B.push(f.int8ToStr(M)),B.push(f.int8ToStr(re)),B.push(f.int64ToStr(F)),B.push(f.int64ToStr($)),R!=null&&R>0&&B.push(f.int8ToStr(R)),B.join("")}function x(k,J,F){const $=[];let R=0;R=d.set(R,k,6,2),R=d.set(R,J,0,6),$.push(f.int8ToStr(R));let B=0;return F.length<=253?(B=F.length+2,$.push(f.int8ToStr(B))):(B=0,$.push(f.int8ToStr(B)),$.push(f.int32ToStr(F.length+5))),$.push(F),$.join("")}Y[C.BEGINNING]=3,Y[C.DATE]=11,Y[C.RGMID]=19,o.exports.parseAdpAt=function(k,J){if(J+3>k.length)return!1;let F=J,$=k.readUInt8(F);F++;const R=g($,0,6);let B,M;if(R<3){const se=k.readUInt16BE(F);F+=2,M=g(se,12,4),B=g(se,0,12),B<<=2}else{if(R!==3)return S("Found unsupported ADP Version",R),!1;$=k.readUInt8(F),F++,M=g($,0,8),B=k.readUInt32BE(F),F+=4}if(J+B>k.length)return S(`Invalid Asssured Control Protocol length=${B} exceeds remaining message buffer = ${k.length-J}`),!1;const re=new u(M,R);for(;F<J+B;){$=k.readUInt8(F),F++;const se=g($,6,2),fe=g($,0,6);if(fe===0)continue;if(F>=J+B)return S(`Invalid Asssured Control Protocol parameter=${fe} at position =${F}`),!1;let ce,Te=k.readUInt8(F);if(F++,Te===0){if(F+5>J+B)return S(`Invalid Asssured Control Protocol parameter=${fe} at position =${F}`),!1;Te=k.readUInt32BE(F),F+=4,ce=Te-5}else ce=Te-2;if(Te<=0)return!1;if(F+ce>J+B)return S(`Invalid Asssured Control Protocol parameter=${fe} length =${ce} invalid at position =${F}`),!1;const Ee=new l(se,fe,null,k,F,F+ce);re.addParameter(Ee),F+=ce}return re},o.exports.encAdp=function(k){const J=[],F=k.getParameterArray();let $;for($=0;$<F.length;$++){const M=F[$];if(M!==void 0)switch(M.getType()){case a.SMFAdProtocolParam.WINDOW:case a.SMFAdProtocolParam.EP_DURABLE:case a.SMFAdProtocolParam.ACCESSTYPE:case a.SMFAdProtocolParam.FLOWTYPE:case a.SMFAdProtocolParam.EP_RESPECTS_TTL:case a.SMFAdProtocolParam.TRANSACTION_CTRL_MESSAGE_TYPE:case a.SMFAdProtocolParam.TRANSACTED_SESSION_STATE:case a.SMFAdProtocolParam.ACTIVE_FLOW_INDICATION:case a.SMFAdProtocolParam.WANT_FLOW_CHANGE_NOTIFY:case a.SMFAdProtocolParam.MAX_REDELIVERY:J.push(A(M.getUh(),M.getType(),M.getValue()));break;case a.SMFAdProtocolParam.EP_BEHAVIOUR:case a.SMFAdProtocolParam.PARTITION_GROUP_ID:J.push(L(M.getUh(),M.getType(),M.getValue()));break;case a.SMFAdProtocolParam.FLOWID:case a.SMFAdProtocolParam.TRANSPORT_WINDOW:case a.SMFAdProtocolParam.EP_ALLOTHER_PERMISSION:case a.SMFAdProtocolParam.EP_QUOTA:case a.SMFAdProtocolParam.EP_MAX_MSGSIZE:case a.SMFAdProtocolParam.GRANTED_PERMISSION:case a.SMFAdProtocolParam.TRANSACTED_SESSION_ID:case a.SMFAdProtocolParam.PUBLISHER_ID:J.push(D(M.getUh(),M.getType(),M.getValue()));break;case a.SMFAdProtocolParam.LASTMSGIDSENT:case a.SMFAdProtocolParam.LASTMSGIDACKED:case a.SMFAdProtocolParam.LASTMSGIDRECEIVED:case a.SMFAdProtocolParam.TRANSACTION_ID:case a.SMFAdProtocolParam.ENDPOINT_ERROR_ID:J.push(q(M.getUh(),M.getType(),M.getValue()));break;case a.SMFAdProtocolParam.REPLAY_START_LOCATION:{const re=M.getValue();re.value===void 0?J.push(A(M.getUh(),M.getType(),re.type)):J.push(Q(M.getUh(),M.getType(),re));break}case a.SMFAdProtocolParam.APPLICATION_ACK:{const re=M.getValue(),se=M.getUh(),fe=M.getType();re.forEach((ce,Te)=>{for(let Ee=0;Ee<ce.length;++Ee){const he=ce[Ee];J.push(W(se,fe,he[0],he[1],Te))}});break}case a.SMFAdProtocolParam.QUEUENAME:case a.SMFAdProtocolParam.DTENAME:case a.SMFAdProtocolParam.TOPICNAME:case a.SMFAdProtocolParam.FLOWNAME:case a.SMFAdProtocolParam.SELECTOR:case a.SMFAdProtocolParam.TRANSACTED_SESSION_NAME:J.push(x(M.getUh(),M.getType(),M.getValue()));break;case a.SMFAdProtocolParam.TRANSACTION_FLOW_DESCRIPTOR_PUB_NOTIFY:case a.SMFAdProtocolParam.TRANSACTION_FLOW_DESCRIPTOR_PUB_ACK:case a.SMFAdProtocolParam.TRANSACTION_FLOW_DESCRIPTOR_SUB_ACK:break;case a.SMFAdProtocolParam.NOLOCAL:case a.SMFAdProtocolParam.CUT_THROUGH:J.push(N(M.getUh(),M.getType()));break;case a.SMFAdProtocolParam.APPLICATION_PUB_ACK:break;default:_("Unrecognized ADProtocol Parameter in Message")}}const R=J.join(""),B=[];if(k.version===2){let M=0;M=m(M,0,22,2),M=m(M,k.version,16,6),M=m(M,k.msgType,12,4);let re=4-(3+R.length&3);const se=3+R.length+re>>2;for(M=m(M,se,0,12),B.push(E(M)),B.push(R),re===4&&(re=0);re>0;)B.push(T(0)),re--}else if(k.version===3){let M=0;M=m(M,0,14,2),M=m(M,k.version,8,6),M=m(M,k.msgType,0,8),B.push(y(M)),B.push(I(6+R.length)),B.push(R)}else S(`Invalid Version ${k.version} found while encoding`);return B.join("")}},7623:(o,h,r)=>{const{ContentSummaryType:a}=r(8283),{Decode:u}=r(1261),{Encode:l}=r(4741),{ParamParse:d}=r(760),{ParseSMF:f}=r(8103),{Transport:p}=r(2318);o.exports.ContentSummaryType=a,o.exports.Encode=l,o.exports.Decode=u,o.exports.ParamParse=d,o.exports.ParseSMF=f,o.exports.Transport=p},1868:(o,h,r)=>{const{Bits:a,Convert:u}=r(9783),{ClientCtrlMessage:l,SMFParameter:d}=r(8247),{LOG_ERROR:f}=r(2694),{get:p,set:_}=a,{int8ToStr:S,int16ToStr:C,int32ToStr:g}=u;o.exports.parseCCAt=function(m,T,y){const E=new l;if(y<6||T+6>m.length)return E;let I=T;const N=m.readUInt16BE(I);I+=2;const A=p(N,8,3),L=p(N,0,8),D=m.readUInt32BE(I);if(I+=4,A!==1)return f(`Unsupported ClientCtrl version ${A}`),!1;if(D<=0||T+D>m.length)return!1;for(E.msgType=L,E.version=A;I<T+D;){const q=m.readUInt8(I);I++;const Y=p(q,7,1),Q=p(q,0,7),W=m.readUInt32BE(I);if(W<=0)return!1;I+=4;const x=W-5,k=new d(Y,Q,null,m,I,I+x);E.addParameter(k),I+=x}return E},o.exports.encCC=function(m){const T=[],y=m.getParameterArray();for(let A=0,L=y.length;A<L;++A){const D=y[A];if(D===void 0)continue;let q=0;q=_(q,D.getUh(),7,1),q=_(q,D.getType(),0,7),T.push(S(q)),T.push(g(D.getValue().length+5)),T.push(D.getValue())}const E=T.join("");let I=0;I=_(I,0,15,1),I=_(I,0,11,4),I=_(I,1,8,3),I=_(I,m.msgType,0,8);const N=[];return N.push(C(I)),N.push(g(6+E.length)),N.push(E),N.join("")}},4970:o=>{o.exports.ContentSummaryElement=class{constructor(h=null,r=0,a=0){this.type=h,this.position=r,this.length=a}}},8283:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.ContentSummaryType=a.new({XML_META:0,XML_PAYLOAD:1,BINARY_ATTACHMENT:2,CID_LIST:3,BINARY_METADATA:4})},1261:(o,h,r)=>{const a=r(199),u=r(9620),l=r(6247),{Baggage:d,TraceContextSetter:f}=r(2288),p=r(769),{BinaryMetaBlock:_,KeepAliveMessage:S}=r(8247),{ContentSummaryType:C}=r(8283),{Hex:g,Long:m,Convert:{stringToUint8Array:T,anythingToBuffer:y}}=r(9783),{Lazy:E}=r(7444),{LogFormatter:I}=r(2694),{parseAdpAt:N}=r(1318),{parseCCAt:A}=r(1868),{ParseSMF:L}=r(8103),{PriorityUserCosMap:D}=r(394),{SMFProtocol:q}=r(5052),{SMP:Y}=r(9963),{Transport:Q}=r(2318),W=(r(5594),r(595)),{Check:x}=r(802),{formatHexString:k}=g,{lazyValue:J}=E,{parseSMFAt:F}=L,{parseSMPAt:$}=Y,{parseTsSmfMsgAt:R}=Q,B=new I("[smf-decode]"),{LOG_DEBUG:M,LOG_ERROR:re,LOG_WARN:se}=B,fe=J(()=>new D().reverse),ce={10:l.MessageType.MAP,11:l.MessageType.STREAM,7:l.MessageType.TEXT};function Te(he,ge){const X=ge,ae=p.Codec.parseSingleElement(he.payload,0);if(!ae||ae.getType()!==p.SDTFieldType.STREAM)return;const ee=ae.getValue();let Re=ee.getNext();if(Re&&Re.getType()===p.SDTFieldType.BYTEARRAY&&Re._value&&Re._value.length>0){let me=Re._value.readUInt8(0);if(64&me&&X._setPayloadCompressed(me),128&me||(X._messageType=ce[15&me]||l.MessageType.BINARY),Re._value.length>1){const Pe=Re._value.readUInt8(1);X.setAsReplyMessage(!!(128&Pe))}}if(Re=ee.getNext(),Re&&Re.getType()===p.SDTFieldType.MAP){const me=Re.getValue(),Pe=me.getField("p"),H=me.getField("h");if(Pe&&X.setUserPropertyMap(Pe.getValue()),H){const Z=H.getValue(),te=Z.getField("ci"),ie=Z.getField("mi"),j=Z.getField("mt"),Oe=Z.getField("rt"),v=Z.getField("si"),P=Z.getField("sn"),O=Z.getField("ts"),U=Z.getField("ex"),V=Z.getField("ce"),z=Z.getField("ct"),ne=Z.getField("bag"),de=Z.getField("ctx");if(te&&X.setCorrelationId(te.getValue()),ie&&X.setApplicationMessageId(ie.getValue()),j&&X.setApplicationMessageType(j.getValue()),Oe&&X.setReplyTo(Oe.getValue()),v&&X.setSenderId(v.getValue()),P&&X.setSequenceNumber(P.getValueNoThrow()),O&&X.setSenderTimestamp(O.getValue()),U&&X.setGMExpiration(U.getValue()),V&&X.setHttpContentEncoding(V.getValue()),z&&X.setHttpContentType(z.getValue()),ne){const _e=new d;_e.setBaggage(ne.getValue()),X._setBaggage(_e)}if(de){const _e=f.fromTraceContext(de.getValue());X._setCreationContext(_e)}}}}const Ee={decodeCompoundMessage:function(he,ge){const X=F(he,ge);if(!X)return null;const ae=ge+X.headerLength,ee=X.payloadLength;let Re;switch(X.smf_protocol){case q.TSESSION:if(Re=R(he,ae,X),!Re)break;return Re.smfHeader=X,Re;case q.TRMSG:return Re=new l.Message,Re._smfHeader=X,function(me,Pe,H,Z){const te=Pe;if(te._setDeliverToOne(!!me.smf_dto),te._setDeliveryMode(me.pm_deliverymode||l.MessageDeliveryModeType.DIRECT),me.pm_tr_topicname_bytes!==null&&te._setDestination(u.DestinationFromNetwork.createDestinationFromBytes(me.pm_tr_topicname_bytes)),te._setDiscardIndication(!!me.smf_di),te._setElidingEligible(!!me.smf_elidingEligible),te._setDMQEligible(!!me.smf_deadMessageQueueEligible),te._setUserCos(fe.value.get(me.smf_priority)),te._setPriority(me.pm_msg_priority),me.pm_userdata&&te._setUserData(me.pm_userdata),te.setRedelivered(!!me.pm_ad_redelflag||!!me.pm_ad_flowredelflag),te.setFlowId(me.pm_ad_flowid),te.setGuaranteedMessageId(me.pm_ad_msgid),te.setGuaranteedPreviousMessageId(me.pm_ad_prevmsgid),te.setPublisherId(me.pm_ad_publisherid),te.setPublisherMessageId(me.pm_ad_publishermsgid),te.setTopicSequenceNumber(me.pm_ad_topicSequenceNumber),te.getDeliveryMode()===l.MessageDeliveryModeType.DIRECT?te.setDeliveryCount(-1):me.pm_ad_redeliveryCount?te.setDeliveryCount(me.pm_ad_redeliveryCount+1):te.setDeliveryCount(1),me.pm_ad_spooler_unique_id&&te._setSpoolerUniqueId(me.pm_ad_spooler_unique_id),me.pm_ad_replication_mate_ack_message_id?te._setSpoolerMessageId(me.pm_ad_replication_mate_ack_message_id):me.pm_ad_local_spooler_message_id&&te._setSpoolerMessageId(me.pm_ad_local_spooler_message_id),m.isLong(me.pm_ad_ttl)?te.setTimeToLive(me.pm_ad_ttl.toNumber()):te.setTimeToLive(me.pm_ad_ttl),me.pm_ts_transport_context){const Oe=f.fromTraceContext(me.pm_ts_transport_context);te._setTransportContext(Oe)}const ie=Z+me.headerLength,j=me.pm_content_summary;if(j&&j.length){for(let Oe=0,v=j.length;Oe<v;++Oe){const P=j[Oe],O=ie+P.position,U=ie+P.position+P.length;switch(P.type){case C.BINARY_ATTACHMENT:te._setBinaryAttachment(H.slice(O,U));break;case C.BINARY_METADATA:{const V=_.fromEncodedSmf(H,O);te.binaryMetadataChunk=V,V.type===0&&Te(V,te);break}case C.XML_META:te._setXmlMetadata(H.toString("latin1",O,U));break;case C.XML_PAYLOAD:te._setXmlContentInternal(H.toString("latin1",O,U));break;default:re(`Unhandled ContentSummaryType: ${C.describe(P.type)}`)}}if(te._getPayloadCompressed()&&x.anything(te.getHttpContentEncoding())&&te.getHttpContentEncoding().endsWith("deflate"))try{let Oe;if(Oe=W.unzlibSync(te._binaryAttachment),Oe=y(Oe),te._setBinaryAttachment(Oe),te._setPayloadCompressed(null),te.getHttpContentEncoding().trim()==="deflate")delete te._httpContentEncoding;else{let v=te.getHttpContentEncoding().slice(0,-7).trimRight();v.endsWith(",")?(v=v.slice(0,-1),te.setHttpContentEncoding(v)):delete te._httpContentEncoding}}catch(Oe){se("Message payload was not decompressed, there was an error. Leaving the message body compressed ",Oe),te._messageType=l.MessageType.BINARY}}else te._setBinaryAttachment(me.payloadLength>0?H.slice(ie,ie+me.payloadLength):void 0)}(X,Re,he,ge),Re;case q.ADCTRL:return Re=N(he,ae,ee),Re.smfHeader=X,Re;case q.CLIENTCTRL:if(Re=A(he,ae,ee),!Re)break;return Re.smfHeader=X,Re;case q.SMP:if(Re=$(he,ae),!Re)break;return Re.smfHeader=X,Re;case q.KEEPALIVE:case q.KEEPALIVEV2:return Re=new S,Re.smfHeader=X,Re;default:re(`Unknown protocol: 0x${k(X.smf_protocol)}, dump message content:
|
|
85
|
-
${a.Debug.formatDumpBytes(he.slice(ge,ge+X.messageLength).toString("latin1"),!0,0)}`)}return null}};o.exports.Decode=Ee},4741:(o,h,r)=>{const a=r(6247),{Base64:u,Bits:l,Convert:d}=r(9783),{BinaryMetaBlock:f,SMFHeader:p,SMPMessage:_}=r(8247),{Check:S}=r(802),{ClientCtrlMessage:C,KeepAliveMessage:g,AdProtocolMessage:m}=r(8247),{Codec:T}=r(769),{ContentSummaryElement:y}=r(4970),{ContentSummaryType:E}=r(8283),{DestinationType:I}=r(9620),{encAdp:N}=r(1318),{encCC:A}=r(1868),{ErrorSubcode:L,OperationError:D}=r(6706),{Lazy:q}=r(7444),{LOG_TRACE:Y,LOG_INFO:Q}=r(2694),{ParamParse:W}=r(760),{PriorityUserCosMap:x}=r(394),{SDTField:k,SDTFieldType:J,SDTMapContainer:F,SDTStreamContainer:$}=r(769),{SMFParameterType:R,SMFExtendedParameterType:B}=r(7750),{SMFProtocol:M}=r(5052),{SMP:re}=r(9963),{encode:se}=u,{set:fe}=l,{int8ToStr:ce,int16ToStr:Te,int24ToStr:Ee,int32ToStr:he,int64ToStr:ge,uint8ArrayToString:X}=d,{lazyValue:ae}=q,{encContentSummary:ee,encDeliveryMode:Re,encLightSMFParam:me,encodeSMFParam:Pe,encodeSMFExtendedParam:H,FORCED_LENGTH_MODE:Z}=W,{encodeSingleElement:te}=T,{encSmp:ie}=re,j=ae(()=>new x().forward);function Oe(Ne,et,xe,He){if(S.anything(xe)&&xe.length>0){const at=new y(He,NaN,xe.length);Ne.push(at),et.push(xe)}}function v(Ne,et,xe,He){S.anything(He)&&Ne.addField(et,k.create(xe,He))}function P(Ne){let et;(Ne.getCorrelationId()||Ne.getApplicationMessageId()||Ne.getApplicationMessageType()||Ne.getReplyTo()||Ne.getSenderId()||Ne.getSequenceNumber()||Ne.getSenderTimestamp()||Ne.getUserPropertyMap()||Ne.isReplyMessage()||Ne.getCreationContext()||Ne._compressedCE||Ne.getHttpContentEncoding()||Ne.getHttpContentType()||Ne.getBaggage()&&Ne.getBaggage().getBaggage()||Ne.getType()!==a.MessageType.BINARY)&&(et=function(Ue){let At;const qe=new F;v(qe,"ci",J.STRING,Ue.getCorrelationId()),v(qe,"mi",J.STRING,Ue.getApplicationMessageId()),v(qe,"mt",J.STRING,Ue.getApplicationMessageType()),v(qe,"rt",J.DESTINATION,Ue.getReplyTo()),v(qe,"si",J.STRING,Ue.getSenderId()),v(qe,"sn",J.INT64,Ue.getSequenceNumber()),v(qe,"ts",J.INT64,Ue.getSenderTimestamp()),v(qe,"ex",J.INT64,Ue.getGMExpiration()),v(qe,"ce",J.STRING,Ue._compressedCE?Ue._compressedCE:Ue.getHttpContentEncoding()),v(qe,"ct",J.STRING,Ue.getHttpContentType());const $t=Ue.getBaggage();v(qe,"bag",J.STRING,$t?$t.getBaggage():null);const Tt=Ue.getCreationContext();v(qe,"ctx",J.BYTEARRAY,Tt?Tt.getEncodedTraceContext():null);const nn=new F;Ue.getUserPropertyMap()&&nn.addField("p",k.create(J.MAP,Ue.getUserPropertyMap())),qe.getKeys().length>0&&nn.addField("h",k.create(J.MAP,qe));let hn=0;switch(S.anything(Ue._getCompressedBinaryAttachment())&&(hn|=64),Ue.getType()){case a.MessageType.BINARY:hn|=128;break;case a.MessageType.MAP:hn|=10,S.nothing(Ue._getCompressedBinaryAttachment())&&(At=te(Ue._structuredContainer));break;case a.MessageType.STREAM:hn|=11,S.nothing(Ue._getCompressedBinaryAttachment())&&(At=te(Ue._structuredContainer));break;case a.MessageType.TEXT:hn|=7,S.nothing(Ue._getCompressedBinaryAttachment())&&(At=te(Ue._structuredContainer));break;default:Q(`Unhandled messageType: ${Ue.getType()}`)}const In=Ue.isReplyMessage()?128:0,Gr=k.create(J.BYTEARRAY,String.fromCharCode(hn,In)),$r=new $;$r.addField(Gr),$r.addField(k.create(J.MAP,nn));const Wr=new f;return Wr.type=0,Wr.payload=te(k.create(J.STREAM,$r)),Ue.binaryMetadataChunk=Wr,At}(Ne));const xe=[],He=[];Oe(xe,He,Ne.getXmlMetadata(),E.XML_META),Oe(xe,He,Ne.getXmlContent(),E.XML_PAYLOAD),et?Oe(xe,He,et,E.BINARY_ATTACHMENT):S.anything(Ne._getCompressedBinaryAttachment())?Oe(xe,He,Ne._getCompressedBinaryAttachment().toString("latin1"),E.BINARY_ATTACHMENT):Oe(xe,He,Ne._binaryAttachment?Ne._binaryAttachment.toString("latin1"):"",E.BINARY_ATTACHMENT);const at=Ne.binaryMetadataChunk;if(at!==null){const Ue=at.asEncodedSmf(),At=16777215;if(Ue.length>At)throw Ue.length,new D(`binary-meta data (${Ue.length}) over the ${At} limit`,L.PARAMETER_OUT_OF_RANGE);Oe(xe,He,Ue,E.BINARY_METADATA)}return Ne._memoized_csumm=xe,Ne._memoized_payload=He.join(""),Ne._payload_is_memoized=!0,Ne._memoized_payload?Ne._memoized_payload.length:0}const O=(Ne,et)=>(xe=>Array.from(Array(Math.pow(2,xe))).map((He,at)=>at))(et).map(xe=>fe(0,xe,Ne,et)),U=O(31,1),V=O(30,1),z=O(29,1),ne=O(28,1),de=O(27,1),_e=O(24,3),we=O(22,2),oe=O(16,6),Se=O(12,4),Ce=O(0,8),je=O(8,8),Be=O(0,8);function ct(Ne){let et=0;et|=U[Ne.smf_di?1:0],et|=V[Ne.smf_elidingEligible?1:0],et|=z[Ne.smf_dto?1:0],et|=ne[Ne.smf_adf?1:0],et|=de[Ne.smf_deadMessageQueueEligible?1:0],et|=_e[Ne.smf_version||0],et|=we[Ne.smf_uh||0],et|=oe[Ne.smf_protocol||0],et|=Se[Ne.smf_priority||0],et|=Ce[Ne.smf_ttl||0];const xe=[];Ne.pm_tr_topicname_bytes&&xe.push(Pe(2,R.TR_TOPICNAME,`${Ne.pm_tr_topicname_bytes}`)),Ne.pm_queue_len&&xe.push(me(0,R.LIGHT_QUEUE_NAME_OFFSET,Te(je[Ne.pm_queue_offset]|Be[Ne.pm_queue_len]))),Ne.pm_topic_len&&xe.push(me(0,R.LIGHT_TOPIC_NAME_OFFSET,Te(je[Ne.pm_topic_offset]|je[Ne.pm_topic_len]))),Ne.pm_corrtag!==null&&Ne.pm_corrtag!==void 0&&xe.push(me(0,R.LIGHT_CORRELATION,Ee(Ne.pm_corrtag))),Ne.pm_ad_ackimm&&xe.push(me(0,R.LIGHT_ACK_IMMEDIATELY,"")),Ne.pm_msg_priority!==null&&xe.push(Pe(0,R.MESSAGEPRIORITY,ce(Ne.pm_msg_priority))),Ne.pm_userdata!==null&&Ne.pm_userdata!==""&&xe.push(Pe(0,R.USERDATA,Ne.pm_userdata)),Ne.pm_username&&xe.push(Pe(0,R.USERNAME,se(Ne.pm_username))),Ne.pm_password&&xe.push(Pe(0,R.PASSWORD,se(Ne.pm_password))),Ne.pm_respcode&&xe.push(Pe(0,R.RESPONSE,he(Ne.pm_respcode)+Ne.pm_respstr)),Ne.pm_deliverymode!==null&&xe.push(Pe(0,R.DELIVERY_MODE,Re(Ne.pm_deliverymode))),Ne.pm_ad_msgid!==void 0&&(xe.push(Pe(2,R.ASSURED_MESSAGE_ID,ge(Ne.pm_ad_msgid))),xe.push(Pe(2,R.ASSURED_PREVMESSAGE_ID,ge(Ne.pm_ad_prevmsgid)))),Ne.pm_ad_flowid&&xe.push(Pe(0,R.ASSURED_FLOWID,he(Ne.pm_ad_flowid))),Ne.pm_ad_redelflag&&xe.push(Pe(0,R.ASSURED_REDELIVERED_FLAG,void 0)),Ne.pm_ad_ttl!==void 0&&xe.push(Pe(0,R.AD_TIMETOLIVE,ge(Ne.pm_ad_ttl))),Ne.pm_ad_publisherid&&xe.push(Pe(0,R.PUBLISHER_ID,he(Ne.pm_ad_publisherid))),Ne.pm_ad_publisherMsgId&&xe.push(Pe(0,R.PUBLISHER_MSGID,ge(Ne.pm_ad_publisherMsgId))),Ne.pm_content_summary&&xe.push(Pe(2,R.MESSAGE_CONTENT_SUMMARY,ee(Ne.pm_content_summary)));let He="",at=0;Ne.pm_oauth2_access_token&&(He+=H(0,B.OAUTH2_ACCESS_TOKEN,Ne.pm_oauth2_access_token),at=at||0),Ne.pm_oidc_id_token&&(He+=H(0,B.OIDC_ID_TOKEN,Ne.pm_oidc_id_token),at=at||0),Ne.pm_oauth2_issuer_identifier&&(He+=H(0,B.OAUTH2_ISSUER_IDENTIFIER,Ne.pm_oauth2_issuer_identifier),at=at||0),Ne.pm_ts_transport_context&&(He+=H(0,B.TS_TRANSPORT_CONTEXT,X(Ne.pm_ts_transport_context),Z.SIX),at=at||0),He.length>0&&xe.push(Pe(at,R.EXTENDED_TYPE_STREAM,He));const Ue=xe.join(""),At=12+Ue.length,qe=At+Ne.payloadLength;return Ne.setMessageSizes(At,Ne.payloadLength),he(et)+he(At)+he(qe)+Ue}const Gt={encodeCompoundMessage:function(Ne){let et="";var xe,He;Ne instanceof a.Message?(Ne.smfHeader||(Ne.smfHeader=new p(M.TRMSG,255)),xe=Ne,He=Ne._smfHeader,function(Ue,At){const qe=At;Ue._payload_is_memoized||P(Ue);const $t=Ue._memoized_csumm,Tt=Ue._memoized_payload;$t.length===0||$t.length===1&&$t[0].type===E.BINARY_ATTACHMENT||(qe.pm_content_summary=$t),qe.payload=Tt}(xe,He),function(Ue,At){const qe=At,$t=Ue.getDeliveryMode();qe.smf_dto=Ue.isDeliverToOne(),qe.pm_deliverymode=$t,qe.smf_adf=$t===a.MessageDeliveryModeType.DIRECT?0:1,qe.smf_di=Ue.isDiscardIndication(),qe.smf_elidingEligible=Ue.isElidingEligible(),qe.smf_deadMessageQueueEligible=Ue.isDMQEligible(),qe.pm_ad_flowid=Ue.getFlowId(),qe.pm_ad_publisherid=Ue.getPublisherId(),qe.pm_ad_publishermsgId=Ue.getPublisherMessageId(),qe.pm_ad_msgid=Ue.getGuaranteedMessageId(),qe.pm_ad_prevmsgid=Ue.getGuaranteedPreviousMessageId(),qe.pm_ad_ttl=Ue.getTimeToLive(),qe.pm_ad_ackimm=Ue.isAcknowledgeImmediately(),qe.pm_ad_redelflag=Ue.isRedelivered();const Tt=Ue.getTransportContext();Tt!=null&&(qe.pm_ts_transport_context=Tt.getEncodedTraceContext());const nn=Ue.getDestination();if(nn&&(qe.pm_tr_topicname_bytes=nn.getBytes(),nn.type===I.QUEUE||nn.type===I.TEMPORARY_QUEUE)){const{offset:In}=nn;qe.pm_queue_len=qe.pm_tr_topicname_bytes.length-In,qe.pm_queue_offset=In}qe.smf_priority=j.value.get(Ue.getUserCos()),Ue.getPriority()!==void 0&&typeof Ue.getPriority()=="number"&&Ue.getPriority()<=255&&Ue.getPriority()>=0?qe.pm_msg_priority=Ue.getPriority():qe.pm_msg_priority=null;const hn=Ue.getUserData();qe.pm_userdata=hn==null?null:Ue.getUserData()}(xe,He),et=Ne._smfHeader.payload):Ne instanceof C?et=A(Ne):Ne instanceof _?et=ie(Ne):Ne instanceof g||Ne instanceof m&&(et=N(Ne));const at=Ne.smfHeader;return at.setPayloadSize(et.length),ct(at)+et},encodeSMF:ct,adaptMessageToSmf_payloadMemoize:P};o.exports.Encode=Gt},760:(o,h,r)=>{const a=r(6247),{BidiMap:u,Lazy:l}=r(7444),{Bits:d,Convert:f}=r(9783),{ContentSummaryElement:p}=r(4970),{ContentSummaryType:_}=r(8283),{ErrorSubcode:S,OperationError:C}=r(6706),{LOG_ERROR:g}=r(2694),{SMFUH:m}=r(8247),{lazyValue:T}=l,{int8ToStr:y,int16ToStr:E,int24ToStr:I,int32ToStr:N}=f,A=T(()=>{const k=[[0,a.MessageDeliveryModeType.NON_PERSISTENT],[1,a.MessageDeliveryModeType.PERSISTENT],[2,a.MessageDeliveryModeType.DIRECT]].map(J=>[J[0],J[1]]);return new u(...k)}),L=T(()=>A.value.forward),D=T(()=>A.value.reverse),q=(()=>{const k=[],J=Math.pow(2,5);return m.values.forEach(F=>{k[F]=[];for(let $=0;$<J;++$){let R=0;R=d.set(R,F,6,2),R=d.set(R,$,0,5),k[F][$]=y(R)}}),k})(),Y=new Array(256).fill(null).map((k,J)=>y(J)),Q=(()=>{const k=[],J=Math.pow(2,3),F=Math.pow(2,2);return m.values.forEach($=>{k[$]=[];for(let R=0;R<J;++R){k[$][R]=[];for(let B=0;B<F;++B){let M=0;M=d.set(M,$,6,2),M=d.set(M,1,5,1),M=d.set(M,R,2,3),M=d.set(M,B,0,2),k[$][R][B]=y(M)}}}),k})(),W=[_.XML_META,_.XML_PAYLOAD,_.BINARY_ATTACHMENT,_.CID_LIST,_.BINARY_METADATA],x={FORCED_LENGTH_MODE:{FIVE:5,SIX:6},parseTopicQueueOffsets:function(k,J){const F=[];return F[0]=k.readUInt8(J),F[1]=k.readUInt8(J+1),F},parseResponseParam:function(k,J,F){const $=[];return $[0]=k.readInt32BE(J),$[1]=F>4?k.toString("latin1",J+4,J+F):"",$},parseDeliveryMode:function(k,J){const F=k.readUInt8(J),$=L.value.get(F);return $!==void 0?$:a.MessageDeliveryModeType.DIRECT},encDeliveryMode:function(k){const J=D.value.get(k);return y(J!==void 0?J:a.MessageDeliveryModeType.DIRECT)},parseContentSummary:function(k,J,F){const $=[];let R=0,B=J;for(;B<J+F;){const M=k.readUInt8(B),re=d.get(M,4,4),se=d.get(M,0,4);let fe=0;switch(se){case 2:fe=k.readUInt8(B+1);break;case 3:fe=k.readUInt16BE(B+1);break;case 4:fe=k.readUIntBE(B+1,3);break;case 5:fe=k.readInt32BE(B+1)}if(se===0)return g("Invalid content summary parameter - pos not advancing"),null;B+=se;const ce=W[re];ce===void 0&&g(`Unhandled element type ${re}`);const Te=new p(ce,R,fe);$.push(Te),R+=fe}return $},encContentSummary:function(k){const J=[];for(let F=0,$=k.length;F<$;++F){const R=k[F];let B="",M=d.set(0,R.type,4,4);R.length<=255?(M=d.set(M,2,0,4),B=y(R.length)):R.length<=65535?(M=d.set(M,3,0,4),B=E(R.length)):R.length<=16777215?(M=d.set(M,4,0,4),B=I(R.length)):(M=d.set(M,5,0,4),B=N(R.length)),J.push(y(M)),J.push(B)}return J.join("")},encodeSMFParam:function(k,J,F){if(F===void 0)return q[k][J]+Y[2];const $=F.length;return $<=253?q[k][J]+Y[$+2]+F:q[k][J]+Y[0]+N($+6)+F},encodeSMFExtendedParam:function(k,J,F,$=-1){let R=0;R=d.set(R,k?1:0,7,1);const B=F==null?0:F.length,M={0:0,1:1,2:2,4:3,8:4};let re=0,se="";if($!==x.FORCED_LENGTH_MODE.FIVE&&$!==x.FORCED_LENGTH_MODE.SIX&&($=-1),Object.prototype.hasOwnProperty.call(M,B))re=M[B];else if(B<253&&$!==x.FORCED_LENGTH_MODE.SIX||$===x.FORCED_LENGTH_MODE.FIVE)re=5,se=y(B+3);else{if(!(B<65532&&$!==x.FORCED_LENGTH_MODE.FIVE||$===x.FORCED_LENGTH_MODE.SIX))throw g(`Extended parameter type ${J} is too long (${B} bytes) `),new C(`Extended parameter (${J}) over the 2^16 byte limit`,S.PARAMETER_OUT_OF_RANGE);re=6,se=E(B+4)}R=d.set(R,re,4,3),R=d.set(R,J>>8,0,4);const fe=255&J;return y(R)+y(fe)+se+F},encLightSMFParam:function(k,J,F){return Q[k][J][F.length]+F}};o.exports.ParamParse=x},8103:(o,h,r)=>{const a=r(5017),{LOG_DEBUG:u,LOG_ERROR:l,LOG_INFO:d,LOG_TRACE:f}=r(2694),{Base64:p,Bits:_}=r(9783),{ParamParse:S}=r(760),{SMFHeader:C}=r(8247),{SMFParameterType:g,SMFExtendedParameterType:m}=r(7750),{decode:T}=p,{get:y}=_;function E(L,D){return!(L.length-D<12)}function I(L,D){if(!E(L,D))return!1;const q=7&L.readUInt8(D);return q===3||(l(`Invalid smf version in smf header, version=${q}`),!1)}function N(L,D,q,Y){let Q=q;for(;Q<q+Y;){if(Q+2>q+Y){l("Extended parameter stream had padding inside.");break}const W=D.readUInt8(Q),x=D.readUInt8(Q+1),k=y(W,7,1),J=y(W,4,3),F=(y(W,0,4)<<8)+x;Q+=2;const $={0:0,1:1,2:2,3:4,4:8};let R=0;if(Object.prototype.hasOwnProperty.call($,J))R=$[J];else if(J===5)R=D.readUInt8(Q)-3,Q++;else{if(J!==6)return l(`Invalid length mode ${J} in Extended Parameter type ${F}`),!1;R=D.readUInt16BE(Q)-4,Q+=2}switch(F){case g.AD_REDELIVERY_COUNT:L.pm_ad_redeliveryCount=D.readUInt32BE(Q);break;case g.AD_SPOOLER_UNIQUE_ID:L.pm_ad_spooler_unique_id=a.fromBits(D.readUInt32BE(Q+4),D.readUInt32BE(Q),!0);break;case g.AD_ACK_MESSAGE_ID:L.pm_ad_local_spooler_message_id=a.fromBits(D.readUInt32BE(Q+4),D.readUInt32BE(Q),!0);break;case g.AD_REPL_MATE_ACK_MSGID:L.pm_ad_replication_mate_ack_message_id=a.fromBits(D.readUInt32BE(Q+4),D.readUInt32BE(Q),!0);break;case m.TS_TRANSPORT_CONTEXT:R>=32&&(L.pm_ts_transport_context=D.toString("latin1",Q,Q+R));break;default:k===0||(L.discardMessage=!0)}Q+=R}return Q>q+Y&&l(`Last extended parameter ran beyond extended stream length by ${Q-(q+Y)}.`),!0}const A={isSMFHeaderAvailable:E,isSMFHeaderValid:I,isSMFAvailable:function(L,D){if(!I(L,D))return!1;const q=L.length-D;return L.readUInt32BE(D+8)<=q},parseSMFAt:function(L,D,q=!1){if(!I(L,D))return null;let Y=D;const Q=L.readUInt32BE(Y),W=L.readUInt32BE(Y+4),x=L.readUInt32BE(Y+8),k=new C;k.smf_di=y(Q,31,1),k.smf_elidingEligible=y(Q,30,1),k.smf_dto=y(Q,29,1),k.smf_adf=y(Q,28,1),k.smf_deadMessageQueueEligible=y(Q,27,1),k.smf_version=y(Q,24,3),k.smf_uh=y(Q,22,2),k.smf_protocol=y(Q,16,6),k.smf_priority=y(Q,12,4),k.smf_ttl=y(Q,0,8);const J=x-W;if(J<0)return l("SMF parse error: lost framing"),null;if(k.setMessageSizes(W,J),q)return k;Y+=12;const F=D+W;for(;Y<F;){const $=L.readUInt8(Y);++Y;const R=y($,6,2);if(y($,5,1)!==0){const B=y($,2,3),M=y($,0,2)+1,re=M-1;if(M<=0)return l("Invalid lightweight parameter length"),null;switch(B){case g.LIGHT_CORRELATION:k.pm_corrtag=L.readUIntBE(Y,3);break;case g.LIGHT_TOPIC_NAME_OFFSET:{const se=S.parseTopicQueueOffsets(L,Y);k.pm_queue_offset=se[0],k.pm_queue_len=se[1];break}case g.LIGHT_QUEUE_NAME_OFFSET:{const se=S.parseTopicQueueOffsets(L,Y);k.pm_topic_offset=se[0],k.pm_topic_len=se[1];break}case g.LIGHT_ACK_IMMEDIATELY:k.pm_ad_ackimm=!!L.readUInt8(Y);break;default:R===0||(k.discardMessage=!0)}Y+=re}else{const B=Y,M=y($,0,5);if(M===0)break;let re,se=L.readUInt8(Y);if(Y++,se===0?(se=L.readUInt32BE(Y),Y+=4,re=se-6):re=se-2,se<=0)return l(`Invalid regular parameter length ${se}/${re} with suspect type ${g.describe(M)} at parameter at position ${B}`),null;switch(M){case g.PUBLISHER_ID:break;case g.PUBLISHER_MSGID:k.pm_ad_publishermsgid=a.fromBits(L.readUInt32BE(Y+4),L.readUInt32BE(Y),!0);break;case g.MESSAGEPRIORITY:k.pm_msg_priority=L.readUInt8(Y);break;case g.USERDATA:k.pm_userdata=L.toString("latin1",Y,Y+re);break;case g.USERNAME:k.pm_username=T(L.toString("latin1",Y,Y+re));break;case g.PASSWORD:k.pm_password=T(L.toString("latin1",Y,Y+re));break;case g.RESPONSE:{const fe=S.parseResponseParam(L,Y,re);k.pm_respcode=fe[0],k.pm_respstr=fe[1];break}case g.SUB_ID_LIST:case g.GENERIC_ATTACHMENT:case g.BINARY_ATTACHMENT:d("Skipping deprecated parameter type");break;case g.DELIVERY_MODE:k.smf_adf&&(k.pm_deliverymode=S.parseDeliveryMode(L,Y));break;case g.ASSURED_MESSAGE_ID:k.pm_ad_msgid=a.fromBits(L.readUInt32BE(Y+4),L.readUInt32BE(Y),!0);break;case g.ASSURED_PREVMESSAGE_ID:k.pm_ad_prevmsgid=a.fromBits(L.readUInt32BE(Y+4),L.readUInt32BE(Y),!0);break;case g.ASSURED_REDELIVERED_FLAG:k.pm_ad_redelflag=!0;break;case g.AD_TIMETOLIVE:k.pm_ad_ttl=a.fromBits(L.readUInt32BE(Y+4),L.readUInt32BE(Y),!0);break;case g.AD_TOPICSEQUENCE_NUMBER:k.pm_ad_topicSequenceNumber=a.fromBits(L.readUInt32BE(Y+4),L.readUInt32BE(Y),!0);break;case g.MESSAGE_CONTENT_SUMMARY:{const fe=S.parseContentSummary(L,Y,re);if(!fe)return l(`Invalid message content summary at ${Y}, len ${re}`),!1;k.pm_content_summary=fe;break}case g.ASSURED_FLOWID:k.pm_ad_flowid=L.readUInt32BE(Y);break;case g.TR_TOPICNAME:k.pm_tr_topicname_bytes=L.toString("latin1",Y,Y+re);break;case g.AD_FLOWREDELIVERED_FLAG:k.pm_ad_flowredelflag=!0;break;case g.EXTENDED_TYPE_STREAM:if(!N(k,L,Y,re))return null;break;default:R===0||(k.discardMessage=!0)}Y+=re}}return k}};o.exports.ParseSMF=A},394:(o,h,r)=>{const a=r(6247),{BidiMap:u}=r(7444);o.exports.PriorityUserCosMap=class extends u{constructor(){super([a.MessageUserCosType.COS1,0],[a.MessageUserCosType.COS2,1],[a.MessageUserCosType.COS3,2])}}},9963:(o,h,r)=>{const{Bits:a,Convert:u}=r(9783);r(2694);const{SMFSMPMessageType:l}=r(3647),{SMPMessage:d}=r(8247),{get:f,set:p}=a,{int8ToStr:_,int32ToStr:S}=u,C={parseSMPAt:function(g,m){if(m+6>g.length)return!1;let T=m;const y=g.readUInt8(T);T++;const E=f(y,0,7),I=new d;if(E!==l.ADDSUBSCRIPTION&&E!==l.REMSUBSCRIPTION&&E!==l.ADDQUEUESUBSCRIPTION&&E!==l.REMQUEUESUBSCRIPTION)return!1;g.toString("latin1");const N=g.readUInt32BE(T);if(T+=4,m+N>g.length)return!1;const A=g.readUInt8(T);if(T++,I.msgType=E,I.smpFlags=A,E===l.ADDSUBSCRIPTION||E===l.REMSUBSCRIPTION)I.encodedUtf8Subscription=g.toString("latin1",T,T+N-6);else{const L=g.readUInt8(T);T++,I.encodedUtf8QueueName=g.toString("latin1",T,T+L),T+=L;const D=g.readUInt8(T);T++,I.encodedUtf8Subscription=g.toString("latin1",T,T+D),T+=D}return I},encSmp:function(g){if(g.msgType!==l.ADDSUBSCRIPTION&&g.msgType!==l.REMSUBSCRIPTION&&g.msgType!==l.ADDQUEUESUBSCRIPTION&&g.msgType!==l.REMQUEUESUBSCRIPTION)return!1;const m=[];let T=0;T=p(T,1,7,1),T=p(T,g.msgType,0,7),m.push(_(T));let y=6+g.encodedUtf8Subscription.length;return g.msgType!==l.ADDQUEUESUBSCRIPTION&&g.msgType!==l.REMQUEUESUBSCRIPTION||(y+=2+g.encodedUtf8QueueName.length),m.push(S(y)),m.push(_(g.smpFlags)),(g.msgType===l.ADDQUEUESUBSCRIPTION||g.msgType===l.REMQUEUESUBSCRIPTION)&&(m.push(_(g.encodedUtf8QueueName.length)),m.push(g.encodedUtf8QueueName),m.push(_(g.encodedUtf8Subscription.length))),m.push(g.encodedUtf8Subscription),m.join("")}};o.exports.SMP=C},2318:(o,h,r)=>{const{Bits:a,Convert:u}=r(9783),{Lazy:l}=r(7444),{LOG_ERROR:d}=r(2694),{SMFTransportSessionMessageType:f}=r(1643),{TransportSMFMessage:p}=r(8247),{get:_}=a,{int16ToStr:S,int32ToStr:C}=u,{lazyValue:g}=l;function m(D,q){return D.length-q}function T(D,q,Y){let Q=q;if(m(D,Q)<10)return d("TsSmf parse failed: not enough data, expected at least 10B"),!1;const W=new p;W.smfHeader=Y;const x=D.readUInt16BE(Q);Q+=2,W.uh=_(x,15,1),W.messageType=_(x,8,7);const k=_(x,0,8);if(W.tsHeaderLength=k,W.sessionId=D.toString("latin1",Q,Q+8),Q+=8,W.messageType===f.CREATE_RESP){const J=D.readUInt8(Q);if(Q++,m(D,Q)<J)return d(`TsSmf parse failed: not enough data for RouterTag, expected ${J}B`),!1;W.routerTag=D.toString("latin1",Q,Q+J),Q+=J}return Q=q+k,Y.payloadLength===4294967295?W.payloadLength=Y.payloadLength:W.payloadLength=Y.payloadLength-k,W}const y=g(()=>C(51642369)+C(12)),E=g(()=>y.value+C(22)+S(33290)),I=g(()=>y.value+C(22)+S(32778)+C(0)+C(0)),N=g(()=>C(60030977)+C(12)+C(22)+S(34058)),A=g(()=>C(60030977)+C(12)+C(24)+S(34316)),L={genTsCreateHeader:function(){return I.value},genTsDestroyHeader:function(D){return E.value+D},genTsDataTokenMsg:function(D){return N.value+D},genTsDataStreamTokenMsg:function(D,q){return A.value+D+S(q&&q>0?q:0)},genTsDataMsgHeaderParts:function(D){return[C(60030977)+C(12),S(33802)+D]},parseTsSmfHdrAt:T,parseTsSmfMsgAt:function(D,q,Y){const Q=T(D,q,Y);if(!Q)return null;const W=q+Q.tsHeaderLength;return m(D,W)<Q.payloadLength?(d(`Couldn't read full encapsulated TsSmf payload, expected ${Q.payloadLength}B`),null):(Q.payload=D.slice(W,W+Q.payloadLength),Q)}};o.exports.Transport=L},9812:(o,h,r)=>{const{BaseMessage:a}=r(8668),{Convert:u,Long:l}=r(9783),{DestinationType:d}=r(9620),{LOG_TRACE:f,LOG_INFO:p}=r(2694),{OperationError:_}=r(6706),{QueueAccessType:S,QueueDiscardBehavior:C}=r(9631),{QueuePermissions:g,QueueType:m}=r(9631),{ReplayStartType:T}=r(9309),{MessageOutcome:y}=r(6247),{SMFAdProtocolMessageType:E}=r(7250),{SMFAdProtocolParam:I}=r(5099),{SMFHeader:N}=r(9731),{SMFParameter:A}=r(1123),{SMFProtocol:L}=r(5052),{SMFUH:D}=r(8379),{StringUtils:q}=r(968),Y=r(8287).hp,{strToInt8:Q,strToInt16:W,strToUInt32:x,strToUInt64:k}=u,J=Y.prototype.readUInt8,F=Y.prototype.readUInt16BE,$=Y.prototype.readUInt32BE,R=function(ae){return l.fromBits(this.readUInt32BE(ae+4),this.readUInt32BE(ae),!0)},{nullTerminate:B,stripNullTerminate:M}=q,re={[d.TOPIC]:I.DTENAME,[d.QUEUE]:I.QUEUENAME},se={[m.TOPIC_ENDPOINT]:I.DTENAME,[m.QUEUE]:I.QUEUENAME},fe={[g.NONE]:0,[g.READ_ONLY]:1,[g.CONSUME]:3,[g.MODIFY_TOPIC]:7,[g.DELETE]:15},ce={1:S.EXCLUSIVE,2:S.NONEXCLUSIVE},Te={[S.EXCLUSIVE]:1,[S.NONEXCLUSIVE]:2},Ee={1:!0,2:!1,3:!1},he={[C.NOTIFY_SENDER_OFF]:1,[C.NOTIFY_SENDER_ON]:2};function ge(ae,ee,Re=!1){if(!ee)return;const{accessType:me,discardBehavior:Pe,maxMessageRedelivery:H,maxMessageSize:Z,permissions:te,quotaMB:ie,respectsTTL:j}=ee;te&&fe[te]!==void 0&&ae.addParameter(new A(D.IGNORE,I.EP_ALLOTHER_PERMISSION,fe[te])),Re||me===void 0||Te[me]===void 0||ae.addParameter(new A(D.IGNORE,I.ACCESSTYPE,Te[me])),ie!=null&&ae.addParameter(new A(D.IGNORE,I.EP_QUOTA,ie)),Z!=null&&ae.addParameter(new A(D.IGNORE,I.EP_MAX_MSGSIZE,Z));let Oe=0;Pe!=null&&(Oe|=he[Pe]<<12),Oe&&ae.addParameter(new A(D.IGNORE,I.EP_BEHAVIOUR,Oe)),H!=null&&ae.addParameter(new A(D.IGNORE,I.MAX_REDELIVERY,H)),j!=null&&ae.addParameter(new A(D.IGNORE,I.EP_RESPECTS_TTL,j?1:0))}class X extends a{constructor(ee=0,Re=3){super(new N(L.ADCTRL,1)),this.msgType=ee,this.version=Re}_readParameter(ee,Re=null,me=null){const Pe=this.getParameter(ee);if(Pe===void 0)return;if(me&&Pe.getBuffer())return me.call(Pe.getBuffer(),Pe.getBegin());const H=Pe.getValue();return Re?Re(H):H}getAccessType(){const ee=this._readParameter(I.ACCESSTYPE,Q,J);return ce[ee]}getDurability(){const ee=this._readParameter(I.EP_DURABLE,Q,J);return ee===3&&p("Non durable reliable queue. This does not happen often."),Ee[ee]}getActiveFlow(){return this._readParameter(I.ACTIVE_FLOW_INDICATION,Q,J)}getQueueDiscardBehavior(){const ee=this._readParameter(I.EP_BEHAVIOUR,W,F);if(ee===void 0)return;const Re=(12288&ee)>>12;return Re===he[C.NOTIFY_SENDER_OFF]?C.NOTIFY_SENDER_OFF:Re===he[C.NOTIFY_SENDER_ON]?C.NOTIFY_SENDER_ON:void 0}getEndpointDeliveryCountSent(){switch((3072&this._readParameter(I.EP_BEHAVIOUR,W,F))>>10){case 0:default:return;case 1:return!1;case 2:return!0}}getEndpointId(){return this._readParameter(I.ENDPOINT_ID,x,$)}getRespectsTTL(){const ee=this._readParameter(I.EP_RESPECTS_TTL,Q,J);if(ee!==void 0)return!!ee}getFlowName(){return this._readParameter(I.FLOWNAME,M)}getFlowId(){return this._readParameter(I.FLOWID,x,$)}getQuota(){return this._readParameter(I.EP_QUOTA,x,$)}getMaxMsgSize(){return this._readParameter(I.EP_MAX_MSGSIZE,x,$)}getTopicEndpointBytes(){return this._readParameter(I.DTENAME)}getQueueNameBytes(){return this._readParameter(I.QUEUENAME)}getGrantedPermissions(){const ee=this._readParameter(I.GRANTED_PERMISSIONS,x,$);let Re;return Object.keys(fe).forEach(me=>{fe[me]===ee&&(Re=me)}),Re}getAllOthersPermissions(){const ee=this._readParameter(I.EP_ALLOTHER_PERMISSION,x,$);let Re;return Object.keys(fe).forEach(me=>{fe[me]===ee&&(Re=me)}),Re}getLastMsgIdAcked(){return this._readParameter(I.LASTMSGIDACKED,k,R)}getLastMsgIdReceived(){return this._readParameter(I.LASTMSGIDRECEIVED,k,R)}getPublisherId(){return this._readParameter(I.PUBLISHER_ID,x,$)}getWantFlowChangeNotify(){return!!this._readParameter(I.WANT_FLOW_CHANGE_NOTIFY,Q,J)}getWindow(){return this._readParameter(I.WINDOW,Q,J)}getMaxRedelivery(){return this._readParameter(I.MAX_REDELIVERY,Q,J)}getMaxUnackedMessages(){return this._readParameter(I.MAX_DELIVERED_UNACKED_MESSAGES_PER_FLOW,x,$)}getEndpointErrorId(){return this._readParameter(I.ENDPOINT_ERROR_ID,k,R)}getPartitionGroupId(){return this._readParameter(I.PARTITION_GROUP_ID,W,F)}getSpoolerUniqueId(){return this._readParameter(I.SPOOLER_UNIQUE_ID,k,R)}static getCloseMessagePublisher(ee,Re){const me=new X(E.CLOSEPUBFLOW);return me.smfHeader.pm_corrtag=Re,me.addParameter(new A(D.REJECT,I.FLOWID,ee)),me}static getCreate(ee,Re,me){const Pe=new X(E.CREATE);Pe.smfHeader.pm_corrtag=me;const H=se[ee.type];if(H===void 0)throw new _("Unknown destination type");return Pe.addParameter(new A(D.REJECT,H,B(ee.name))),Pe.addParameter(new A(D.IGNORE,I.EP_DURABLE,ee.durable?1:2)),ge(Pe,Re),Pe}static getDelete(ee,Re){const me=new X(E.DELETE);me.smfHeader.pm_corrtag=Re;const Pe=se[ee.type];if(Pe===void 0)throw new _("Unknown destination type");return me.addParameter(new A(D.REJECT,Pe,B(ee.name))),me}static getOpenMessagePublisher(ee,Re,me,Pe,H){const Z=new X(E.OPENPUBFLOW);return Z.smfHeader.pm_corrtag=H,ee!==void 0&&Z.addParameter(new A(D.REJECT,I.LASTMSGIDACKED,ee)),Re!==void 0&&Z.addParameter(new A(D.REJECT,I.LASTMSGIDSENT,Re)),Z.addParameter(new A(D.REJECT,I.WINDOW,me)),Z.addParameter(new A(D.IGNORE,I.FLOWNAME,Pe||"")),Z}static getOpenMessageConsumer(ee,Re,me,Pe,H,Z,te,ie,j=l.UZERO,Oe=l.UZERO,v=!1,P=void 0,O=void 0,U=void 0,V=!1){const z=ee.durable,ne=me.bytes,de=me.type,_e=new X(E.BIND);_e.smfHeader.pm_corrtag=H;const we=re[de];if(we===void 0)throw new _("Unknown destination type");if(_e.addParameter(new A(D.REJECT,we,ne)),Pe&&_e.addParameter(new A(D.REJECT,I.TOPICNAME,Pe.bytes)),de===d.QUEUE&&(_e.addParameter(new A(D.REJECT,I.LASTMSGIDACKED,j)),_e.addParameter(new A(D.IGNORE,I.LASTMSGIDRECEIVED,Oe))),_e.addParameter(new A(D.REJECT,I.WINDOW,Z)),_e.addParameter(new A(D.IGNORE,I.EP_DURABLE,z)),ge(_e,Re,!0),te&&_e.addParameter(new A(D.REJECT,I.NOLOCAL,1)),ie&&_e.addParameter(new A(D.IGNORE,I.WANT_FLOW_CHANGE_NOTIFY,1)),V?_e.addParameter(new A(D.REJECT,I.FLOWTYPE,3)):v&&_e.addParameter(new A(D.REJECT,I.FLOWTYPE,2)),P!==void 0){let oe=P._replayStartValue;P._type===T.DATE&&(oe=l.fromNumber(P._replayStartValue,!0).multiply(1e6)),_e.addParameter(new A(D.REJECT,I.REPLAY_START_LOCATION,{type:P._type,value:oe}))}return O!==void 0&&_e.addParameter(new A(D.IGNORE,I.ENDPOINT_ERROR_ID,O)),U!=null&&_e.addParameter(new A(D.IGNORE,I.PARTITION_GROUP_ID,U)),_e}static getCloseMessageConsumer(ee,Re){const me=new X(E.UNBIND);return me.smfHeader.pm_corrtag=Re,me.addParameter(new A(D.REJECT,I.FLOWID,ee)),me}static getDTEUnsubscribeMessage(ee,Re){const me=new X(E.UNSUBSCRIBE);return me.smfHeader.pm_corrtag=ee,me.addParameter(new A(D.REJECT,I.DTENAME,Re.getBytes())),me}static getAck(ee,Re=void 0,me=void 0,Pe=void 0){const H=new X(E.CLIENTACK);if(H.addParameter(new A(D.REJECT,I.FLOWID,ee)),Re&&H.addParameter(new A(D.REJECT,I.LASTMSGIDACKED,Re)),me!=null&&H.addParameter(new A(D.REJECT,me<=255?I.WINDOW:I.TRANSPORT_WINDOW,me)),Pe&&Pe.size>0){let Z=0;const te=y.values;for(let ie=0;ie<te.length;ie++)Z+=Pe.has(te[ie])?Pe.get(te[ie]).length:0;if(Z>X.MAX_CLIENT_ACK_RANGES)throw new _("Application ack range count exceeds limit of 64");H.addParameter(new A(D.REJECT,I.APPLICATION_ACK,Pe))}return H}static getUnbindAck(ee,Re=void 0,me=void 0){const Pe=new X(E.UNBIND);return Pe.addParameter(new A(D.REJECT,I.FLOWID,ee)),Re&&Pe.addParameter(new A(D.IGNORE,I.ENDPOINT_ERROR_ID,Re)),Pe}}X.MAX_CLIENT_ACK_RANGES=64,o.exports.AdProtocolMessage=X},8247:(o,h,r)=>{const{AdProtocolMessage:a}=r(9812),{BinaryMetaBlock:u}=r(818),{ClientCtrlMessage:l}=r(6670),{KeepAliveMessage:d}=r(3188),{SMFHeader:f}=r(9731),{SMFParameter:p}=r(1123),{SMFUH:_}=r(8379),{SMPMessage:S}=r(2989),{TransportSMFMessage:C}=r(4527);o.exports.AdProtocolMessage=a,o.exports.BinaryMetaBlock=u,o.exports.ClientCtrlMessage=l,o.exports.KeepAliveMessage=d,o.exports.SMFHeader=f,o.exports.SMFParameter=p,o.exports.SMFUH=_,o.exports.SMPMessage=S,o.exports.TransportSMFMessage=C},8668:o=>{o.exports.BaseMessage=class{constructor(h=null,r=[]){this._smfHeader=h,this._parameters=r}addParameter(h){this._parameters[h.getType()]=h}getParameter(h){return this._parameters[h]}getParameterArray(){return this._parameters}get smfHeader(){return this._smfHeader}set smfHeader(h){this._smfHeader=h}getResponse(){const h=this.smfHeader;return h&&h.pm_respcode&&h.pm_respstr?{responseCode:h.pm_respcode,responseString:h.pm_respstr}:null}}},818:(o,h,r)=>{const{Bits:a,Convert:u}=r(9783),{get:l}=a,{int8ToStr:d,int24ToStr:f}=u;class p{constructor(S,C){this.type=S,this.payload=C}asEncodedSmf(){const S=[];return S.push(d(1)),S.push(d(this.type)),S.push(f(this.payload.length)),S.push(this.payload.toString("latin1")),S.join("")}static fromEncodedSmf(S,C=0){if(S.length-C<6)return null;const g=S.readUInt8(C),m=S.readInt32BE(C+1),T=l(m,24,8),y=l(m,0,24),E=4*g+1,I=S.slice(C+E,C+E+y);return new p(T,I)}}o.exports.BinaryMetaBlock=p},6670:(o,h,r)=>{const{AuthenticationScheme:a,CapabilityType:u,ClientCapabilityType:l,MutableSessionProperty:d,SessionProperties:f}=r(5024),{BaseMessage:p}=r(8668),{Bits:_,Convert:S}=r(9783),{DestinationType:C,DestinationUtil:g}=r(9620),{ErrorSubcode:m,OperationError:T}=r(6706),{Process:y,StringUtils:E,Version:I}=r(968),{SMFClientCtrlMessageType:N}=r(9640),{SMFClientCtrlParam:A,SMFClientCtrlAuthType:L}=r(9685),{SMFHeader:D}=r(9731),{SMFParameter:q}=r(1123),{SMFProtocol:Y}=r(5052);r(2694);const{get:Q,set:W}=_,{int8ToStr:x,strToInt8:k,int16ToStr:J,int32ToStr:F,strToInt16:$,strToInt32:R}=S,{nullTerminate:B,stripNullTerminate:M}=E,{validateAndEncode:re}=g,se=[u.JNDI,u.COMPRESSION,u.GUARANTEED_MESSAGE_CONSUME,u.TEMPORARY_ENDPOINT,u.GUARANTEED_MESSAGE_PUBLISH,u.GUARANTEED_MESSAGE_BROWSE,u.ENDPOINT_MGMT,u.SELECTOR,u.ENDPOINT_MESSAGE_TTL,u.QUEUE_SUBSCRIPTIONS,null,u.SUBSCRIPTION_MANAGER,u.MESSAGE_ELIDING,u.TRANSACTED_SESSION,u.NO_LOCAL,u.ACTIVE_CONSUMER_INDICATION,u.PER_TOPIC_SEQUENCE_NUMBERING,u.ENDPOINT_DISCARD_BEHAVIOR,u.CUT_THROUGH,null,u.MESSAGE_REPLAY,u.COMPRESSED_SSL,null,u.SHARED_SUBSCRIPTIONS,u.BR_REPLAY_ERRORID,u.AD_APP_ACK_FAILED,u.VAR_LEN_EXT_PARAM],fe=new Map([[l.UNBIND_ACK,128],[l.BR_ERRORID,64],[l.PQ,32]]);class ce extends p{constructor(Ee=0){super(new D(Y.CLIENTCTRL,1)),this.msgType=Ee,this.version=1}getP2PTopicValue(){const Ee=this.getParameter(A.P2PTOPIC);return Ee?M(Ee.getValue()):null}getVpnNameInUseValue(){const Ee=this.getParameter(A.MSGVPNNAME);return Ee?M(Ee.getValue()):null}getVridInUseValue(){const Ee=this.getParameter(A.VRIDNAME);return Ee?M(Ee.getValue()):null}getUserIdValue(){const Ee=this.getParameter(A.USERID);return Ee?M(Ee.getValue()):null}getRouterCapabilities(){let Ee=[],he=this.getParameter(A.ROUTER_CAPABILITIES);return he&&(Ee=ce.prmParseCapabilitiesValue(he.getValue(),Ee)),he=this.getParameter(A.SOFTWAREVERSION),he&&(Ee[u.PEER_SOFTWARE_VERSION]=M(he.getValue())),he=this.getParameter(A.SOFTWAREDATE),he&&(Ee[u.PEER_SOFTWARE_DATE]=M(he.getValue())),he=this.getParameter(A.PLATFORM),he&&(Ee[u.PEER_PLATFORM]=M(he.getValue())),he=this.getParameter(A.PHYSICALROUTERNAME),he&&(Ee[u.PEER_ROUTER_NAME]=M(he.getValue())),Ee}static prmGetDtoPriorityValue(Ee){if(Ee.local===void 0||Ee.network===void 0)return!1;let he=0;return he=W(he,Ee.local,8,8),he=W(he,Ee.network,0,8),J(he)}static prmParseDtoPriorityValue(Ee){const he={},ge=$(Ee.substr(0,2));return he.local=Q(ge,8,8),he.network=Q(ge,0,8),he}static prmParseCapabilitiesValue(Ee,he){const ge=he;if(!Ee||!ge)return!1;const X=u;let ae=0;const ee=k(Ee[ae]);let Re;++ae;for(let me=0;me<ee;++me){const Pe=7&me;Pe===0&&(Re=k(Ee[ae]),++ae);const H=se[me];H&&(ge[H]=!!Q(Re,7-Pe,1))}for(let me=0;ae<Ee.length&&me<500;++me){const Pe=k(Ee[ae]);ae++;const H=R(Ee.substr(ae,4))-5;ae+=4;const Z=Ee.substr(ae,H);switch(ae+=H,Pe){case 0:ge[X.PEER_PORT_SPEED]=Z.length===4?R(Z):0;break;case 1:ge[X.PEER_PORT_TYPE]=Z.length===1?k(Z):0;break;case 2:ge[X.MAX_GUARANTEED_MSG_SIZE]=Z.length===4?R(Z):0;break;case 3:ge[X.MAX_DIRECT_MSG_SIZE]=Z.length===4?R(Z):0}}return ge}static getLogin(Ee,he,ge,X){if(!(Ee instanceof f))return!1;const ae=new ce(N.LOGIN),ee=ae._smfHeader,Re=Ee.authenticationScheme===a.CLIENT_CERTIFICATE;ee.pm_corrtag=X,Ee.password&&!Re&&(ee.pm_password=Ee.password),Ee.userName&&(ee.pm_username=Ee.userName),Ee.subscriberLocalPriority&&Ee.subscriberNetworkPriority&&ae.addParameter(new q(0,A.DELIVERTOONEPRIORITY,ce.prmGetDtoPriorityValue({local:Ee.subscriberLocalPriority,network:Ee.subscriberNetworkPriority}))),Ee.vpnName&&Ee.vpnName.length>0&&ae.addParameter(new q(1,A.MSGVPNNAME,B(Ee.vpnName))),Ee.applicationDescription&&Ee.applicationDescription.length>0&&ae.addParameter(new q(0,A.CLIENTDESC,B(Ee.applicationDescription))),Ee.userIdentification&&Ee.userIdentification.length>0&&ae.addParameter(new q(0,A.USERID,B(Ee.userIdentification))),Ee.authenticationScheme===a.OAUTH2&&(ae.addParameter(new q(1,A.AUTHENTICATION_SCHEME,L.OAUTH2)),Ee.idToken&&(ee.pm_oidc_id_token=B(Ee.idToken)),Ee.accessToken&&(ee.pm_oauth2_access_token=B(Ee.accessToken)),Ee.issuerIdentifier&&(ee.pm_oauth2_issuer_identifier=B(Ee.issuerIdentifier))),ae.addParameter(new q(0,A.CLIENTNAME,B(Ee.clientName))),ae.addParameter(new q(0,A.PLATFORM,B(`${y.platform} - JS API (${I.mode})`))),Ee.noLocal&&ae.addParameter(new q(0,A.NO_LOCAL,"")),Re&&ae.addParameter(new q(1,A.AUTHENTICATION_SCHEME,L.CLIENT_CERTIFICATE)),ae.addParameter(new q(0,A.SOFTWAREDATE,B(I.formattedDate))),ae.addParameter(new q(0,A.SOFTWAREVERSION,B(I.version))),he&&ge?ae.addParameter(new q(1,A.SSL_DOWNGRADE,"")):he?ae.addParameter(new q(1,A.SSL_DOWNGRADE,"")):ge&&ae.addParameter(new q(1,A.SSL_DOWNGRADE,"\0"));const me=function(H){const Z=Math.max.apply(null,H)+1;let te=0;return H.forEach(ie=>{te+=fe.get(ie)}),x(Z)+x(te)}([l.UNBIND_ACK,l.BR_ERRORID,l.PQ]);ae.addParameter(new q(0,A.CLIENT_CAPABILITIES,me));const Pe=F(Ee.keepAliveIntervalInMsecs/1e3);return ae.addParameter(new q(0,A.KEEP_ALIVE_INTERVAL,Pe)),ae}static getUpdate(Ee,he,ge){const X=new ce(N.UPDATE);if(X.smfHeader.pm_corrtag=ge,Ee===d.CLIENT_DESCRIPTION){const ae=(he||"").toString().substr(0,250);X.addParameter(new q(0,A.CLIENTDESC,B(ae)))}else if(Ee===d.CLIENT_NAME){const ae=ce.validateClientName(he,ee=>new T(`Invalid clientName: ${ee}`,m.PARAMETER_OUT_OF_RANGE));if(ae)throw ae;X.addParameter(new q(0,A.CLIENTNAME,B(he)))}return X}static validateClientName(Ee,he){const ge=re(C.TOPIC,Ee,he);return ge.error?ge.error:ge.bytes.length>161?he("Client Name too long (max length: 160)."):null}}o.exports.ClientCtrlMessage=ce},3188:(o,h,r)=>{const{BaseMessage:a}=r(8668),{SMFHeader:u}=r(9731),{SMFProtocol:l}=r(5052);o.exports.KeepAliveMessage=class extends a{constructor(){super(new u(l.KEEPALIVEV2,2)),this._smfHeader.smf_uh=2}}},9731:o=>{o.exports.SMFHeader=class{constructor(h=0,r=0){this._parameters=[],this.smf_version=3,this.smf_uh=0,this.smf_protocol=h,this.smf_priority=0,this.smf_ttl=r,this.smf_msgLen=0,this.smf_di=0,this.smf_tqd=0,this.smf_elidingEligible=0,this.smf_dto=0,this.smf_adf=0,this.smf_deadMessageQueueEligible=0,this.pm_userdata=null,this.pm_respcode=0,this.pm_respstr=null,this.pm_username=null,this.pm_password=null,this.pm_tr_topicname_bytes=null,this.pm_deliverymode=null,this.pm_ad_msgid=void 0,this.pm_ad_prevmsgid=void 0,this.pm_ad_redelflag=0,this.pm_ad_flowredelflag=0,this.pm_ad_ttl=void 0,this.pm_ad_ackimm=void 0,this.pm_ad_flowid=0,this.pm_ad_publisherid=0,this.pm_ad_publishermsgid=0,this.pm_content_summary=null,this.pm_corrtag=null,this.pm_topic_offset=0,this.pm_topic_len=0,this.pm_queue_offset=0,this.pm_queue_len=0,this.pm_msg_priority=null,this.pm_oauth2_access_token=null,this.pm_oidc_id_token=null,this.pm_oauth2_issuer_identifier=null,this.pm_ts_transport_context=null,this.unknownProtoFlag=!1,this.messageLength=0,this.payloadLength=0,this.headerLength=0,this.payload=null,this.discardMessage=!1}setMessageSizes(h,r){this.headerLength=h,this.payloadLength=r,this.messageLength=h+r}setPayloadSize(h){this.payloadLength=h}}},1123:o=>{o.exports.SMFParameter=class{constructor(h,r,a,u,l,d){this._type=r,this._value=a,this._uh=h,this._buffer=u,this._begin=l,this._end=d}getType(){return this._type}getValue(){return this._buffer&&!this._value?this._buffer.toString("latin1",this._begin,this._end):this._value}getUh(){return this._uh}getBuffer(){return this._buffer}getBegin(){return this._begin}getEnd(){return this._end}toString(){return`${this._uh}:0x${this._type.toString(16)} = ${this.getValue()}`}}},8379:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SMFUH=a.new({IGNORE:0,REJECT:2})},2989:(o,h,r)=>{const{assert:a}=r(7444),{BaseMessage:u}=r(8668),{Destination:l,DestinationUtil:d}=r(9620),{SMFHeader:f}=r(9731),{SMFProtocol:p}=r(5052),{SMFSMPMessageType:_}=r(3647),{SMFSMPMessageTypeFlags:S}=r(1278);class C extends u{constructor(){super(new f(p.SMP,1)),this.msgType=0,this.encodedUtf8Subscription=null,this.encodedUtf8QueueName=null,this.smpFlags=0|S.SMF_SMP_FLAG_TOPIC,this._encodedQueueName=null,this._encodedClientName=null}isFlag(m){return this.smpFlags&m}setFlag(m,T){T?this.smpFlags|=m:this.smpFlags&=~m}static getSubscriptionMessage(m,T,y,E){a(T instanceof l,"Topics are not UCS-2 strings. Pass a Topic object.");const I=new C;return I.msgType=y?_.ADDSUBSCRIPTION:_.REMSUBSCRIPTION,I.encodedUtf8Subscription=T.getBytes(),a(I.encodedUtf8Subscription,"Topic had no encoding"),I.setFlag(S.SMF_SMP_FLAG_TOPIC,!0),E&&I.setFlag(S.SMF_SMP_FLAG_RESPREQUIRED,!0),I._smfHeader.pm_corrtag=m,I}static getQueueSubscriptionMessage(m,T,y,E){a(T instanceof l,"Topics are not UCS-2 strings. Pass a Topic object.");const I=new C;return I.msgType=E?_.ADDQUEUESUBSCRIPTION:_.REMQUEUESUBSCRIPTION,I.encodedUtf8QueueName=d.encodeBytes(y.getName()),I.encodedUtf8Subscription=T.getBytes(),a(I.encodedUtf8Subscription,"Topic had no encoding"),a(I.encodedUtf8QueueName,"Queue had no encoding"),I.setFlag(S.SMF_SMP_FLAG_TOPIC,!0),I.setFlag(S.SMF_SMP_FLAG_RESPREQUIRED,!0),I.setFlag(S.SMF_SMP_FLAG_PERSIST,!0),I._smfHeader.pm_corrtag=m,I}}o.exports.SMPMessage=C},4527:(o,h,r)=>{const{BaseMessage:a}=r(8668);o.exports.TransportSMFMessage=class extends a{constructor(){super(null,null),this.uh=0,this.messageType=null,this.sessionId=null,this.routerTag=null,this.payload=null,this.payloadLength=0,this.tsHeaderLength=0}}},7250:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SMFAdProtocolMessageType=a.new({OPENPUBFLOW:0,CLIENTACK:3,BIND:4,UNBIND:5,UNSUBSCRIBE:6,CLOSEPUBFLOW:7,CREATE:8,DELETE:9,TRANSACTIONCTRL:11,FLOWCHANGEUPDATE:12,XACTRL:14,CLIENTNACK:15})},5099:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SMFAdProtocolParam=a.new({LASTMSGIDSENT:1,LASTMSGIDACKED:2,WINDOW:3,TRANSPORT_PRIORITY:4,APPLICATION_ACK:5,FLOWID:6,QUEUENAME:7,DTENAME:8,TOPICNAME:9,FLOWNAME:10,EP_DURABLE:11,ACCESSTYPE:12,SELECTOR:13,TRANSPORT_WINDOW:14,LINGER_OPTION:15,LASTMSGIDRECEIVED:16,EP_ALLOTHER_PERMISSION:17,FLOWTYPE:18,EP_QUOTA:19,EP_MAX_MSGSIZE:20,GRANTED_PERMISSIONS:21,EP_RESPECTS_TTL:22,TRANSACTION_CTRL_MESSAGE_TYPE:23,TRANSACTED_SESSION_ID:24,TRANSACTED_SESSION_NAME:25,TRANSACTION_ID:26,TRANSACTED_SESSION_STATE:27,TRANSACTION_FLOW_DESCRIPTOR_PUB_NOTIFY:28,TRANSACTION_FLOW_DESCRIPTOR_PUB_ACK:29,TRANSACTION_FLOW_DESCRIPTOR_SUB_ACK:30,NOLOCAL:31,ACTIVE_FLOW_INDICATION:32,WANT_FLOW_CHANGE_NOTIFY:33,EP_BEHAVIOUR:34,PUBLISHER_ID:35,APPLICATION_PUB_ACK:36,NUM_MESSAGES_SPOOLED:37,CUT_THROUGH:38,PUBLISHER_FLAGS:39,APP_MSG_ID_TYPE:40,QUEUE_ENDPOINT_HASH:41,MAX_REDELIVERY:42,PAYLOAD:43,ENDPOINT_ID:44,ACK_SEQUENCE_NUMBER:45,ACK_RECONCILE_REQUEST:46,START_OF_ACK_RECONCILE:47,TIMESTAMP:48,MAX_DELIVERED_UNACKED_MESSAGES_PER_FLOW:49,REPLAY_START_LOCATION:51,ENDPOINT_ERROR_ID:52,SPOOLER_UNIQUE_ID:54,PARTITION_GROUP_ID:56})},9640:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SMFClientCtrlMessageType=a.new({LOGIN:0,UPDATE:1})},9685:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SMFClientCtrlAuthType=a.new({CLIENT_CERTIFICATE:"",OAUTH2:`
|
|
86
|
-
`}),o.exports.SMFClientCtrlParam=a.new({SOFTWAREVERSION:0,SOFTWAREDATE:1,PLATFORM:2,USERID:3,CLIENTDESC:4,CLIENTNAME:5,MSGVPNNAME:6,DELIVERTOONEPRIORITY:7,P2PTOPIC:8,ROUTER_CAPABILITIES:9,VRIDNAME:10,PHYSICALROUTERNAME:12,BRIDGE_MSG_VPN_NAME:13,BRIDGE_ROUTER_NAME:14,NO_LOCAL:15,BRIDGE_VERSION:16,AUTHENTICATION_SCHEME:17,CONNECTION_TYPE:18,ROUTER_CAPABILITIES_EXTENDED:19,REQUIRES_RELEASE_7:20,SSL_DOWNGRADE:21,CLIENT_CAPABILITIES:23,KEEP_ALIVE_INTERVAL:24})},7750:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SMFParameterType=a.new({PADDING:0,PUBLISHER_ID:1,PUBLISHER_MSGID:2,MESSAGEPRIORITY:3,USERDATA:4,USERNAME:6,PASSWORD:7,RESPONSE:8,SUB_ID_LIST:10,GENERIC_ATTACHMENT:11,BINARY_ATTACHMENT:12,DELIVERY_MODE:16,ASSURED_MESSAGE_ID:17,ASSURED_PREVMESSAGE_ID:18,ASSURED_REDELIVERED_FLAG:19,MESSAGE_CONTENT_SUMMARY:22,ASSURED_FLOWID:23,TR_TOPICNAME:24,AD_FLOWREDELIVERED_FLAG:25,AD_TIMETOLIVE:28,AD_TOPICSEQUENCE_NUMBER:30,EXTENDED_TYPE_STREAM:31,AD_ACK_MESSAGE_ID:41,AD_SPOOLER_UNIQUE_ID:44,AD_REPL_MATE_ACK_MSGID:45,AD_REDELIVERY_COUNT:46,LIGHT_CORRELATION:0,LIGHT_TOPIC_NAME_OFFSET:1,LIGHT_QUEUE_NAME_OFFSET:2,LIGHT_ACK_IMMEDIATELY:3}),o.exports.SMFExtendedParameterType=a.new({OAUTH2_ISSUER_IDENTIFIER:47,OIDC_ID_TOKEN:48,OAUTH2_ACCESS_TOKEN:49,PARTITION_KEY_HASH:53,TS_TRANSPORT_CONTEXT:54})},5052:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SMFProtocol=a.new({CSPF:1,CSMP:2,PUBMSG:3,XMLLINK:4,WSE:5,SEMP:6,SUBCTRL:7,PUBCTRL:8,ADCTRL:9,KEEPALIVE:10,KEEPALIVEV2:11,CLIENTCTRL:12,TRMSG:13,JNDI:14,SMP:15,SMRP:16,SMF_IN_SMF:17,SMF_IN_RV:18,ADCTRL_PASSTHROUGH:19,TSESSION:20})},1278:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SMFSMPMessageTypeFlags=a.new({FLAG_FILTER:1,FLAG_PERSIST:2,SMF_SMP_FLAG_TOPIC:4,SMF_SMP_FLAG_RESPREQUIRED:8,SMF_SMP_FLAG_DELIVERALWAYS:16})},3647:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SMFSMPMessageType=a.new({ADDSUBSCRIPTION:0,REMSUBSCRIPTION:1,ADDQUEUESUBSCRIPTION:2,REMQUEUESUBSCRIPTION:3,ADDSUBSCRIPTIONFORCLIENTNAME:4,REMSUBSCRIPTIONFORCLIENTNAME:5})},1643:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SMFTransportSessionMessageType=a.new({CREATE:0,CREATE_RESP:1,DESTROY:2,DESTROY_RESP:3,DATA:4,DATA_TOKEN:5,DATA_STREAM_TOKEN:6})},2689:(o,h,r)=>{const{CacheCBInfo:a}=r(6686),{CacheContext:u}=r(2969),{CacheLiveDataAction:l}=r(4253),{CacheRequest:d}=r(8847),{CacheRequestResult:f}=r(185),{CacheReturnCode:p}=r(429),{CacheReturnSubcode:_}=r(7651),{CacheSession:S}=r(6682),{CacheSessionProperties:C}=r(7330);o.exports.CacheCBInfo=a,o.exports.CACHE_REQUEST_PREFIX=u.CACHE_REQUEST_PREFIX,o.exports.CacheLiveDataAction=l,o.exports.CacheRequestResult=f,o.exports.CacheReturnCode=p,o.exports.CacheReturnSubcode=_,o.exports.CacheRequest=d,o.exports.CacheSession=S,o.exports.CacheSessionProperties=C},6686:o=>{o.exports.CacheCBInfo=class{constructor(h,r){this.cacheCBFunction=h,this.userObject=r}getCallback(){return this.cacheCBFunction}getUserObject(){return this.userObject}}},2969:o=>{o.exports.CacheContext={CACHE_REQUEST_PREFIX:"#CRQ",cacheRequestCorrelationId:0}},7909:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.CacheGetResultCode=a.new({INVALID:0,OK:1})},4494:(o,h,r)=>{const{CacheGetResultCode:a}=r(7909),u={messageID:null,version:0,responseCode:a.INVALID,responseString:"",matchTopic:"",sessionID:null,isSuspect:null,hasMore:null,hasTimestamps:null,replyTo:null,messageStream:null,clusterNameStream:null};o.exports.CacheGetResult=class{constructor(l=u){Object.assign(this,l)}readFromStream(l){this.messageID=l.getNext().getValue(),this.version=l.getNext().getValue(),this.responseCode=l.getNext().getValue(),this.responseString=l.getNext().getValue(),this.matchTopic=l.getNext().getValue(),this.sessionID=l.getNext().getValue(),this.isSuspect=l.getNext().getValue(),this.hasMore=l.getNext().getValue(),this.hasTimestamps=l.getNext().getValue(),l.hasNext()&&(this.messageStream=l.getNext().getValue()),l.hasNext()&&(this.clusterNameStream=this.messageStream,this.messageStream=l.getNext().getValue())}}},4253:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.CacheLiveDataAction=a.new({FULFILL:1,QUEUE:2,FLOW_THRU:3})},185:o=>{o.exports.CacheRequestResult=class{constructor(h,r,a,u){this._returnCode=h,this._subcode=r,this._topic=a,this._error=u}getReturnCode(){return this._returnCode}getReturnSubcode(){return this._subcode}getTopic(){return this._topic}getError(){return this._error}}},5011:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.CacheRequestType=a.new({INVALID:0,BULK_MSG:1,REGISTER_REQUEST:2,REGISTER_RESPONSE:3,HEARTBEAT_REQUEST:4,HEARTBEAT_RESPONSE:5,EVENT_NOTIFY:6,EVENT_ACK:7,ACTION_REQUEST:8,ACTION_RESPONSE:9,GET_REQUEST:10,GET_RESPONSE:11,GET_NEXT_REQUEST:12,GET_NEXT_RESPONSE:13,SET_REQUEST:14,SET_RESPONSE:15,GET_MSG_REQUEST:16,GET_MSG_RESPONSE:17,GET_NEXT_MSG_REQUEST:18,GET_NEXT_MSG_RESPONSE:19,UNREGISTER_IND:20,BULK_SET_REQUEST:21,BULK_SET_RESPONSE:22,PURGE_MSG_SEQUENCE_REQUEST:23,PURGE_MSG_SEQUENCE_RESPONSE:24,GET_MSG_SEQUENCE_REQUEST:25,GET_NEXT_MSG_SEQUENCE_REQUEST:26,GET_TOPIC_INFO_REQUEST:27,GET_TOPIC_INFO_RESPONSE:28,READY_MARKER:29,GET_TOPIC_INFO_REQUEST_RANGE:30,SYNC_READY_MARKER:31,VACUUM_REQUEST:32,VACUUM_RESPONSE:33})},8847:(o,h,r)=>{const{CacheContext:a}=r(2969);r(2694);const{CACHE_REQUEST_PREFIX:u}=a;class l{constructor(f,p,_,S,C,g,m){this.cacheSession=f,this.cacheMessageType=p,this.requestID=_,this.cbInfo=S,this.liveDataAction=C,this.topic=g,this.cacheName=m,this.subscriptionWaiting=null,this.replyReceived=!1,this.dataReceived=!1,this.isSuspect=!1,this.correlationID=`${u}${a.cacheRequestCorrelationId++}`,this.childRequests=[],this.parentRequest=null,this.queuedLiveData=[],this.liveDataFulfilled=!1,this.timeoutHandle=null}getRootRequest(){return this.parentRequest?this.parentRequest.getRootRequest():this}addChild(f){if(!(f instanceof l))throw new Error(`Invalid child ${f}`);if(f===this)throw new Error("Constructing circular child reference");const p=f;p.parentRequest=this,this.childRequests.push(p)}removeChild(f){if(f===this)throw new Error("Attempting to deconstruct invalid circular child reference");const p=f,_=this.childRequests.indexOf(p);this.childRequests.splice(_,1),p.parentRequest=null}collapse(){const f=this.parentRequest;f.isSuspect=f.isSuspect||this.isSuspect,f.dataReceived=f.dataReceived||this.dataReceived,f.removeChild(this)}cancel(){for(this.parentRequest&&this.collapse();this.childRequests.length;){const f=this.childRequests.shift();f.childRequests&&f.cancel(),this.removeChild(f)}this.clearRequestTimeout()}getRequestID(){return this.requestID}getCBInfo(){return this.cbInfo}getTopic(){return this.topic}getLiveDataAction(){return this.liveDataAction}startRequestTimeout(f,p){this.timeoutHandle=setTimeout(()=>{f(this)},p)}clearRequestTimeout(){this.timeoutHandle!==null&&this.timeoutHandle!==void 0&&(clearTimeout(this.timeoutHandle),this.timeoutHandle=null)}toString(){return`CacheRequest[correlationID=${this.correlationID},requestID=${this.requestID},cacheName=${this.cacheName},topic=${this.topic.getName()}]`}}l.VERSION=1,l.DEFAULT_REPLY_SIZE_LIMIT=1e6,l.REPLY_SIZE_LIMIT=l.DEFAULT_REPLY_SIZE_LIMIT,o.exports.CacheRequest=l},429:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.CacheReturnCode=a.new({OK:1,FAIL:2,INCOMPLETE:3})},7651:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.CacheReturnSubcode=a.new({REQUEST_COMPLETE:0,LIVE_DATA_FULFILL:1,ERROR_RESPONSE:2,INVALID_SESSION:3,REQUEST_TIMEOUT:4,REQUEST_ALREADY_IN_PROGRESS:5,NO_DATA:6,SUSPECT_DATA:7,CACHE_SESSION_DISPOSED:8,SUBSCRIPTION_ERROR:9})},7330:o=>{o.exports.CacheSessionProperties=class{constructor(h,r,a,u){this.cacheName=h,this.maxAgeSec=r||0,this.maxMessages=a??1,this.timeoutMsec=u||1e4,this.includeOtherClusters=!0,this.cachePrefix="#P2P/CACHEINST/"}getCacheName(){return this.cacheName}setCacheName(h){this.cacheName=h}getMaxMessageAgeSec(){return this.maxAgeSec}setMaxMessageAgeSec(h){this.maxAgeSec=h}getMaxMessages(){return this.maxMessages}setMaxMessages(h){this.maxMessages=h}getTimeoutMsec(){return this.timeoutMsec}setTimeoutMsec(h){this.timeoutMsec=h}}},8460:o=>{o.exports.CacheSessionSubscribeInfo=class{constructor(h,r,a){Object.assign(this,{correlationID:h,topic:r,cacheSession:a})}}},6682:(o,h,r)=>{const a=r(6247),u=r(5024),l=r(3450),d=r(5747),{ErrorSubcode:f,OperationError:p}=r(6706),{LOG_TRACE:_,LOG_DEBUG:S,LOG_INFO:C,LOG_WARN:g}=r(2694),{SDTField:m,SDTFieldType:T,SDTStreamContainer:y}=r(769),{CacheCBInfo:E}=r(6686),{CacheContext:I}=r(2969),{CacheGetResult:N}=r(4494),{CacheLiveDataAction:A}=r(4253),{CacheRequest:L}=r(8847),{CacheRequestResult:D}=r(185),{CacheRequestType:q}=r(5011),{CacheReturnCode:Y}=r(429),{CacheReturnSubcode:Q}=r(7651),{CacheSessionProperties:W}=r(7330),{CacheSessionSubscribeInfo:x}=r(8460),{Destination:k,Topic:J}=r(9620),{CACHE_REQUEST_PREFIX:F}=I,$=()=>{};class R{constructor(M,re,se){R._validateProps(M);const fe=new W(M.cacheName,M.maxAgeSec,M.maxMessages,M.timeoutMsec);Object.assign(this,{_outstandingRequests:{},_outstandingIDs:{},_disposed:!1,_nextMessageCallbackInfo:null,_nextSessionEventCallbackInfo:null,_properties:fe,_session:re,_sessionIF:se}),this._connectToSession(re)}_connectToSession(M){this._nextSessionEventCallbackInfo=M.getEventCBInfo(),this._nextMessageCallbackInfo=M.getMessageCBInfo(),M.setMessageCBInfo(new u.MessageRxCBInfo((re,se)=>{this._handleMessage(se)},this)),M.setEventCBInfo(this._createCompoundEventCB(this._nextSessionEventCallbackInfo))}_createCompoundEventCB(M){return new u.SessionEventCBInfo((re,se,fe,ce)=>{this._handleSessionEvent(M,re,se,fe,ce)},null)}_handleSessionEvent(M,re,se){if(!this._processSessionEvent(re,se))return;const fe=M.userObject;fe?M.sessionEventCBFunction(re,se,fe):M.sessionEventCBFunction(re,se)}_sendToNextDelegate(M){const re=this._nextMessageCallbackInfo.userObject;re?this._nextMessageCallbackInfo.messageRxCBFunction(this._session,M,re):this._nextMessageCallbackInfo.messageRxCBFunction(this._session,M)}_processSessionEvent(M,re){switch(re.sessionEventCode){case u.SessionEventCode.SUBSCRIPTION_ERROR:case u.SessionEventCode.SUBSCRIPTION_OK:return this._checkSubscriptionStatus(re);case u.SessionEventCode.DOWN_ERROR:return this.dispose(),!0;default:return re.sessionEventCode,!0}}_checkSubscriptionStatus(M){if(M.correlationKey===null||M.correlationKey===void 0||!(M.correlationKey instanceof x)||M.correlationKey.cacheSession!==this)return!0;const re=this._getOutstandingRequest(M.correlationKey.correlationID);return re?M.sessionEventCode===u.SessionEventCode.SUBSCRIPTION_OK?(this._handleSubscriptionSuccess(re,M.correlationKey.topic),!1):(this._handleSubscriptionError(re,M),!1):(g(`No request found for subscription success on ${M.correlationKey.topic}`),!0)}_handleSubscriptionSuccess(M){const re=M;re.subscriptionWaiting=null,this._startCacheRequest(re)}_handleSubscriptionError(M){this._terminateRequest(M,Y.FAIL,Q.SUBSCRIPTION_ERROR)}_checkRequestCompletion(M){if(M.childRequests.length)return void M.childRequests.length;if(M.subscriptionWaiting||M.timeoutHandle!==null&&!M.replyReceived)return;if(M.parentRequest){const fe=M.parentRequest;return M.cancel(),this._unregisterRequest(M),void this._checkRequestCompletion(fe)}let re,se;if(M.isSuspect)re=Y.INCOMPLETE,se=Q.SUSPECT_DATA;else if(M.dataReceived)re=Y.OK,se=M.liveDataFulfilled?Q.LIVE_DATA_FULFILL:Q.REQUEST_COMPLETE;else{if(!M.replyReceived)throw new Error("Sanity: should never happen");re=Y.INCOMPLETE,se=Q.NO_DATA}this._terminateRequest(M,re,se)}_sendSeeOther(M,re){const se=re.clusterNameStream.getNext().getValue(),fe=new L(this,q.GET_MSG_REQUEST,M.requestID,new E($,null),M.liveDataAction,M.topic,se);M.addChild(fe),this._registerRequest(fe),fe.startRequestTimeout(R._handleCacheRequestTimeout,this._properties.timeoutMsec),this._startCacheRequest(fe,null,null,!0)}_sendGetNext(M,re){const se=new L(this,q.GET_NEXT_MSG_REQUEST,M.requestID,new E($,null),M.liveDataAction,M.topic,M.cacheName);M.addChild(se),this._registerRequest(se),se.startRequestTimeout(R._handleCacheRequestTimeout,this._properties.timeoutMsec),this._startCacheRequest(se,re.sessionID,re.replyTo)}_handleMessage(M){const re=M.getCorrelationId(),se=re==null?null:this._outstandingRequests[re];if(!se)return void(this._relevantLiveData(M)&&this._sendToNextDelegate(M));se.clearRequestTimeout();const fe=M.getSdtContainer(),ce=fe&&fe.getValue();if(ce||(C(`Invalid message format for cache response: no SDT container (${fe}) or stream (${ce})`),this._terminateRequest(se,Y.FAIL,Q.ERROR_RESPONSE)),this._incStat(d.RX_REPLY_MSG_RECVED),se.replyReceived=!0,se.getRootRequest().liveDataFulfilled)return this._incStat(d.CACHE_REQUEST_FULFILL_DISCARD_RESPONSE),void this._checkRequestCompletion(se);if(ce)try{const Te=new N;Te.readFromStream(ce),Te.replyTo=M.getReplyTo(),Te.responseString&&Te.responseString,Te.responseCode!==7&&Te.responseString!="Invalid Session"||(C(`Cluster response indicates invalid session: ${Te.responseString} code: ${Te.responseCode}`),this._terminateRequest(se,Y.FAIL,Q.INVALID_SESSION)),se.isSuspect=se.isSuspect||Te.isSuspect;const Ee=R._decodeMessageStream(se,Te);if(this._incStat(d.RX_CACHE_MSG,Ee.length),Te.hasMore&&this._sendGetNext(se,Te),Te.clusterNameStream)for(;Te.clusterNameStream.hasNext();)this._sendSeeOther(se,Te);Ee&&Ee.forEach(he=>{this._sendToNextDelegate(he)}),this._checkRequestCompletion(se)}catch(Te){C(`Invalid message format for cache response: ${Te.stack}`),this._terminateRequest(se,Y.FAIL,Q.ERROR_RESPONSE)}else C("Invalid cache response did not fulfill request. Skipping response processing")}_relevantLiveData(M){return!M.getCorrelationId()||!M.getCorrelationId().startsWith(F)||this._nextMessageCallbackInfo.userObject instanceof R?Object.keys(this._outstandingRequests).every(re=>this._performLiveDataAction(this._outstandingRequests[re],M)):(g("DROP: Dropping CRQ reply due to no remaining Cache Session processors on message callback chain"),this._incStat(d.RX_REPLY_MSG_DISCARD),!1)}_performLiveDataAction(M,re){const se=M;switch(se.dataReceived=!0,se.liveDataAction){case A.QUEUE:return se.queuedLiveData.push(re),!1;case A.FULFILL:return se.liveDataFulfilled||this._fulfillRequest(se),!0;default:return!0}}_fulfillRequest(M){const re=M;re.liveDataFulfilled=!0,this._trackCompletionStats(Y.OK,Q.LIVE_DATA_FULFILL),setTimeout(()=>{R._notifyCallback(re,Y.OK,Q.LIVE_DATA_FULFILL,re.getTopic(),null)},0)}dispose(){Object.keys(this._outstandingRequests).map(M=>this._outstandingRequests[M]).filter(M=>M instanceof L).forEach(M=>{this._terminateRequest(M,Y.INCOMPLETE,Q.CACHE_SESSION_DISPOSED)}),this._outstandingRequests=[],this._session.setEventCBInfo(this._nextSessionEventCallbackInfo),this._session.setMessageCBInfo(this._nextMessageCallbackInfo),this._disposed=!0}getProperties(){return this._properties}sendCacheRequest(M,re,se,fe,ce){if(arguments.length!==5)throw new p(`sendCacheRequest() invoked with an illegal argument count of ${arguments.length}`);if(typeof se!="boolean")throw new p("Invalid subscribe flag argument, should be a boolean but was "+typeof se);if(typeof M!="number"||Number.isNaN(M))throw new p("Invalid requestID",f.PARAMETER_INVALID_TYPE,null);if(this._outstandingIDs[M])throw new p("Request already in progress with this requestID");if(!(re instanceof k))throw new p("Invalid topic",f.PARAMETER_INVALID_TYPE,typeof re);if(re.validate(),fe!==A.FLOW_THRU&&fe!==A.FULFILL&&fe!==A.QUEUE)throw new p("Invalid live data action",f.PARAMETER_OUT_OF_RANGE);if(re.isWildcarded()&&fe!==A.FLOW_THRU)throw new p("Wildcarded topic not supported for this live data action",f.PARAMETER_CONFLICT);if(!(ce instanceof E))throw new p("Callback info was not an instance of CacheCBInfo");if(this._disposed)return void R._notifyCallbackError(ce,M,Y.FAIL,Q.CACHE_SESSION_DISPOSED,re,"Cache request failed: the cache session is disposed.");if(this._session._disposed)return void R._notifyCallbackError(ce,M,Y.FAIL,Q.INVALID_SESSION,re,"Cache request failed: the session is disposed.");const Te=new L(this,q.GET_MSG_REQUEST,M,ce,fe,re,this._properties.cacheName),Ee=Object.keys(this._outstandingRequests).filter(he=>this._outstandingRequests[he].topic.getName()===re.getName());if(Ee.length){const he=fe!==A.FLOW_THRU?Ee:Ee.filter(ge=>this._outstandingRequests[ge].liveDataAction!==A.FLOW_THRU);if(he.length){const ge=this._outstandingRequests[he[0]];return g(`Existing request ${ge} conflicts. Rejecting request ${Te}`),this._registerRequest(Te),void this._terminateRequest(Te,Y.FAIL,Q.REQUEST_ALREADY_IN_PROGRESS)}}if(this._registerRequest(Te),Te.startRequestTimeout(R._handleCacheRequestTimeout,this._properties.timeoutMsec),se){const he=new x(Te.correlationID,re,this);return Te._subscriptionWaiting=he,void this._session.subscribe(re,!0,he)}this._startCacheRequest(Te)}_handleCacheRequestFailed(M,re,se){this._terminateRequest(se.getRequestID(),Y.FAIL,Q.ERROR_RESPONSE)}_registerRequest(M){this._outstandingRequests[M.correlationID]=M,M.parentRequest||(this._outstandingIDs[M.requestID]=M)}_getOutstandingRequest(M){return this._outstandingRequests[M]}_startCacheRequest(M,re,se,fe){const ce=new a.Message;ce.setCorrelationId(M.correlationID),se?ce.setDestination(se):ce.setDestination(J.createFromName(this._properties.cachePrefix+M.cacheName)),ce.setReplyTo(J.createFromName(this._session.getSessionProperties().p2pInboxInUse)),ce.setDeliverToOne(M.cacheMessageType===q.GET_MSG_REQUEST);const Te=new y;Te.addField(T.UINT32,M.cacheMessageType),Te.addField(T.UINT32,L.VERSION),Te.addField(T.STRING,M.topic.getName()),Te.addField(T.UINT32,L.REPLY_SIZE_LIMIT),typeof re=="number"&&Te.addField(T.UINT32,re),Te.addField(T.UINT32,this._properties.maxMessages),Te.addField(T.UINT32,this._properties.maxAgeSec),M.cacheMessageType===q.GET_MSG_REQUEST&&Te.addField(T.BOOL,this._properties.includeOtherClusters&&!fe),Te.addField(T.BOOL,!1),M.cacheMessageType===q.GET_MSG_REQUEST&&Te.addField(T.UINT32,Math.round(this._properties.timeoutMsec/1e3)),ce.setSdtContainer(m.create(T.STREAM,Te));try{this._session.send(ce),M.parentRequest||this._incStat(d.CACHE_REQUEST_SENT)}catch(Ee){C(`Failed to send request: ${Ee.message}`),this._terminateRequest(M,Y.FAIL,Q.ERROR_RESPONSE,Ee)}}_incStat(M,re){this._session&&(this._sessionIF?this._sessionIF.incStat(M,re):C("Can't log stat: session statistics not available"))}_unregisterRequest(M){delete this._outstandingRequests[M.correlationID],delete this._outstandingIDs[M.requestID]}_trackCompletionStats(M,re){switch(M){case Y.OK:this._incStat(d.CACHE_REQUEST_OK_RESPONSE),re===Q.LIVE_DATA_FULFILL&&this._incStat(d.CACHE_REQUEST_LIVE_DATA_FULFILL);break;case Y.INCOMPLETE:this._incStat(d.CACHE_REQUEST_INCOMPLETE_RESPONSE);break;case Y.FAIL:this._incStat(d.CACHE_REQUEST_FAIL_RESPONSE);break;default:throw new Error("Sanity: no return code supplied")}}_terminateRequest(M,re,se,fe){const ce=M.getRootRequest();if(!this._outstandingRequests[ce.correlationID])return;const Te=ce.cbInfo;if(!Te)return void g(`No callback info provided for ${ce}. Cannot notify`);if(!Te.getCallback())return void g(`No callback provided for ${ce}. Cannot notify`);const Ee=ce.getTopic();Ee||g(`No topic provided for ${ce}`),ce.queuedLiveData.forEach(he=>this._sendToNextDelegate(he)),ce.cancel(),this._unregisterRequest(ce),ce.liveDataFulfilled||(this._trackCompletionStats(re,se),R._notifyCallback(ce,re,se,Ee,fe))}static _decodeMessageStream(M,re){if(!re.messageStream)return[];const se=[],fe=M;for(;re.messageStream.hasNext();){fe.dataReceived=!0;const ce=re.messageStream.getNext().getValue(),Te=l.Codec.Decode.decodeCompoundMessage(ce,0);if(!Te)continue;const Ee=re.isSuspect?a.MessageCacheStatus.SUSPECT:a.MessageCacheStatus.CACHED;Te._setCacheStatus(Ee),Te._setCacheRequestID(fe.requestID),se.push(Te)}return se.length,se}static _handleCacheRequestTimeout(M){const re=M.cacheSession;re._getOutstandingRequest(M.correlationID)?(C(`Request ${M} timed out`),re._terminateRequest(M.getRootRequest(),Y.INCOMPLETE,Q.REQUEST_TIMEOUT)):C(`Timeout for ${M} was not unregistered. Ignoring`)}static _notifyCallback(M,re,se,fe,ce){const Te=M.cbInfo;Te.getCallback()(M.requestID,new D(re,se,fe,ce),Te.getUserObject())}static _notifyCallbackError(M,re,se,fe,ce,Te){M.getCallback()(re,new D(se,fe,ce,Te),M.getUserObject())}static _validateProps(M){if(typeof M.cacheName!="string")throw new p("Invalid parameter type for cacheName",f.PARAMETER_INVALID_TYPE);if(J.createFromName(M.cacheName).isWildcarded())throw new p(`Invalid cacheName '${M.cacheName}'. The cacheName cannot be wildcarded`,f.PARAMETER_OUT_OF_RANGE);if(typeof M.maxAgeSec!="number")throw new p("Invalid parameter type for maxAgeSec",f.PARAMETER_INVALID_TYPE);if(M.maxAgeSec<0)throw new p("Invalid value for maxAgeSec; must be >= 0",f.PARAMETER_OUT_OF_RANGE);if(typeof M.maxMessages!="number")throw new p("Invalid parameter type for maxMessages",f.PARAMETER_INVALID_TYPE);if(M.maxMessages<0)throw new p("Invalid value for maxMessages; must be >= 0",f.PARAMETER_OUT_OF_RANGE);if(typeof M.timeoutMsec!="number")throw new p("Invalid parameter type for timeoutMsec",f.PARAMETER_INVALID_TYPE);if(M.timeoutMsec<3e3)throw new p("Invalid value for timeoutMsec; must be >= 3000",f.PARAMETER_OUT_OF_RANGE)}}o.exports.CacheSession=R},5747:(o,h,r)=>{const{Stats:a}=r(2652),{StatsByMode:u}=r(8352),{StatType:l}=r(1737);o.exports={Stats:a,StatType:l,StatsByMode:u}},8352:(o,h,r)=>{const{StatType:a}=r(1737);o.exports={StatsByMode:{STAT_TX_BYMODE_MSGS:[a.TX_DIRECT_MSGS,a.TX_PERSISTENT_MSGS,a.TX_NONPERSISTENT_MSGS],STAT_TX_BYMODE_BYTES:[a.TX_DIRECT_BYTES,a.TX_PERSISTENT_BYTES,a.TX_NONPERSISTENT_BYTES],STAT_TX_BYMODE_REDELIVERED:[a.TX_DIRECT_MSGS,a.TX_PERSISTENT_REDELIVERED,a.TX_NONPERSISTENT_REDELIVERED],STAT_TX_BYMODE_BYTES_REDELIVERED:[a.TX_DIRECT_BYTES,a.TX_PERSISTENT_BYTES_REDELIVERED,a.TX_NONPERSISTENT_BYTES_REDELIVERED],STAT_RX_BYMODE_MSGS:[a.RX_DIRECT_MSGS,a.RX_PERSISTENT_MSGS,a.RX_NONPERSISTENT_MSGS],STAT_RX_BYMODE_BYTES:[a.RX_DIRECT_BYTES,a.RX_PERSISTENT_BYTES,a.RX_NONPERSISTENT_BYTES]}}},1737:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.StatType=a.new({TX_TOTAL_DATA_BYTES:0,TX_TOTAL_DATA_MSGS:1,TX_DIRECT_BYTES:2,TX_DIRECT_MSGS:3,TX_CONTROL_BYTES:4,TX_CONTROL_MSGS:5,TX_REQUEST_SENT:6,TX_REQUEST_TIMEOUT:7,RX_TOTAL_DATA_BYTES:8,RX_TOTAL_DATA_MSGS:9,RX_DIRECT_BYTES:10,RX_DIRECT_MSGS:11,RX_CONTROL_BYTES:12,RX_CONTROL_MSGS:13,RX_DISCARD_MSG_INDICATION:14,RX_REPLY_MSG_RECVED:15,RX_REPLY_MSG_DISCARD:16,RX_DISCARD_SMF_UNKNOWN_ELEMENT:17,CACHE_REQUEST_SENT:18,CACHE_REQUEST_OK_RESPONSE:19,CACHE_REQUEST_FAIL_RESPONSE:20,CACHE_REQUEST_FULFILL_DISCARD_RESPONSE:21,RX_CACHE_MSG:22,CACHE_REQUEST_INCOMPLETE_RESPONSE:23,CACHE_REQUEST_LIVE_DATA_FULFILL:24,TX_PERSISTENT_BYTES:25,TX_PERSISTENT_MSGS:26,TX_NONPERSISTENT_BYTES:27,TX_NONPERSISTENT_MSGS:28,TX_PERSISTENT_BYTES_REDELIVERED:29,TX_PERSISTENT_REDELIVERED:30,TX_NONPERSISTENT_BYTES_REDELIVERED:31,TX_NONPERSISTENT_REDELIVERED:32,TX_ACKS_RXED:33,TX_WINDOW_CLOSE:34,TX_ACK_TIMEOUT:35,RX_PERSISTENT_BYTES:36,RX_PERSISTENT_MSGS:37,RX_NONPERSISTENT_BYTES:38,RX_NONPERSISTENT_MSGS:39,RX_ACKED:40,RX_DISCARD_DUPLICATE:41,RX_DISCARD_NO_MATCHING_CONSUMER:42,RX_DISCARD_OUT_OF_ORDER:43,RX_SETTLE_REJECTED:44,RX_SETTLE_FAILED:45,RX_SETTLE_ACCEPTED:46})},2652:(o,h,r)=>{const{EventEmitter:a}=r(3385),{StatType:u}=r(1737);o.exports.Stats=class extends a{constructor(l){super(),this._parent=l,this._statsMap=[],u.values.forEach(d=>{this._statsMap[d]=0})}resetStats(){this.emit("reset"),this._statsMap=this._statsMap.map(()=>0)}incStat(l,d=1){this._statsMap[l]+=d,this._parent&&this._parent.incStat(l,d)}getStat(l){return this._statsMap[l]}}},8205:(o,h,r)=>{const{SMFClient:a}=r(3175),{TransportCapabilities:u}=r(9984),{TransportError:l}=r(2680),{TransportFactory:d}=r(4723),{TransportProtocol:f}=r(9072),{TransportReturnCode:p}=r(9944),{TransportSessionEventCode:_}=r(3427),{TransportSessionStates:S}=r(3304);o.exports.SMFClient=a,o.exports.TransportCapabilities=u,o.exports.TransportError=l,o.exports.TransportFactory=d,o.exports.TransportProtocol=f,o.exports.TransportReturnCode=p,o.exports.TransportSessionEventCode=_,o.exports.TransportSessionStates=S},427:o=>{class h{constructor(a,u,l){this.reset(),this._rxSmfCB=a,this._rxMessageErrorCB=u,this._session=l}reset(){this._correlationCounter=0}nextCorrelationTag(){return++this._correlationCounter>=h.SMF_MAX_CORRELATION&&(this._correlationCounter=1),this._correlationCounter?this._correlationCounter:0}}h.SMF_MAX_CORRELATION=16777215,o.exports.BaseSMFClient=h},9097:(o,h,r)=>{const a=r(8287).hp;function u(f,p,_){const S=a.allocUnsafe(_);let C,g=0;const m=f[0];for(g+=m.copy(S,0,p,m.length),C=1;C<f.length&&g<_;C++){const T=f[C];g+=T.copy(S,g,0,T.length)}return S}function l(f,p,_){let S=p,C=_;const g=[];let m=0;for(m=0;m<4;m++){for(;f[S].length<=C;)if(C-=f[S].length,S++,S>=f.length)return null;g[m]=f[S].readUInt8(C),C++}return(g[0]<<24)+(g[1]<<16)+(g[2]<<8)+g[3]}class d{constructor(p){let _=[];const S=p;let C=0,g=0;this.peekView=function(m){const T=[];return _.length<1||m>C?null:(_[0].length>=m+g?(T[0]=_[0],T[1]=g):(T[0]=u(_,g,m),T[1]=0),T)},this.readUInt8=function(m){if(m>=C)return null;const T=m+g;if(T<_[0].length)return _[0].readUInt8(T);let y=_[0].length,E=1;for(;y+_[E].length<=T;)y+=_[E].length,E++;return _[E].readUInt8(T-y)},this.readUInt32BE=function(m){if(m+3>=C)return null;const T=m+g;if(T+3<_[0].length)return _[0].readUInt32BE(T);if(T<_[0].length)return l(_,0,T);let y=_[0].length,E=1;for(;y+_[E].length<=T;)y+=_[E].length,E++;return T-y+3<_[E].length?_[E].readUInt32BE(T-y):l(_,E,T-y)},this.put=function(m){const T=d.adaptData(m),y=T.length;return y===0||!(C+y>=S)&&(_.push(T),C+=y,!0)},this.advance=function(m){if(m<1)return;if(m>=C)return void this.reset();let T=0;for(;T<m;){if(!(_[0].length-g<=m-T)){g+=m-T,C-=m-T;break}{const y=_[0].length-g;_.shift(),T+=y,C-=y,g=0}}},this.reset=function(){_=[],C=0,g=0},this.remaining=function(){return C},this.isEmpty=function(){return C===0}}static adaptData(p){return p instanceof a?p:a.from(p)}}o.exports.BufferQueue=d,o.exports.concatFrom=u},5958:(o,h,r)=>{const a=r(199),u=r(3450),{BaseSMFClient:l}=r(427),{BufferQueue:d}=r(9097),{Convert:f,Hex:p}=r(9783),{LogFormatter:_}=r(2694),S=r(8287).hp,{stringToUint8Array:C}=f,{formatHexString:g}=p,{LOG_ERROR:m}=new _("[buffer-smf-client]");function T(y){const E=y.peekView(Math.min(y.remaining(),64));m(`First 64 bytes (or fewer) of incoming buffer:
|
|
87
|
-
${a.Debug.formatDumpBytes(E[0].toString("latin1",E[1]),!0,0)}`)}o.exports.a=class extends l{constructor(y,E,I){super(y,E,I),this._incomingBuffer=new d(8e7)}reset(){super.reset(),this._incomingBuffer&&this._incomingBuffer.reset()}rxDataString(y){this._rxDataCB(S.from(C(y)))}rxDataArrayBuffer(y){this._rxDataCB(S.from(y))}rxDataBuffer(y){this._rxDataCB(y)}_rxDataCB(y){this._session&&this._session.resetKeepAliveCounter();const E=this._incomingBuffer,I=E.put(y);let N=E.remaining();for(I||(T(E),this._rxMessageErrorCB(`Buffer overflow (length: ${N})`),this._incomingBuffer.reset());N>12;){const A=7&E.readUInt8(0);if(A!==3)return m(`Invalid smf version in smf header, version=${A}`),m("BufferSMFClient._rxDataCB(): couldn't decode message due to invalid smf header"),T(E),this._incomingBuffer.reset(),void this._rxMessageErrorCB("Error parsing incoming SMF - invalid SMF header detected");const L=E.readUInt32BE(8);if(L>E.remaining())break;const D=E.peekView(L),q=u.Codec.Decode.decodeCompoundMessage(D[0],D[1]);if(!q||!q.smfHeader){const Y=this._session?this._session._sessionId:null,Q=Y?g(Y):"N/A";return m(`BufferSMFClient._rxDataCB(): couldn't decode message (sessionId=${Q})`),T(E),this._incomingBuffer.reset(),void this._rxMessageErrorCB("Error parsing incoming SMF")}E.advance(q.smfHeader.messageLength),this._rxSmfCB(q),N=E.remaining()}N||this._incomingBuffer.reset()}}},3175:(o,h,r)=>{const{BaseSMFClient:a}=r(427),u=r(5958).a;u.SMF_CLIENTCTRL_LOGIN_FAKE_CORRELATIONTAG=a.SMF_MAX_CORRELATION,o.exports.SMFClient=u},383:(o,h,r)=>{const{ErrorSubcode:a,OperationError:u}=r(6706),{TransportReturnCode:l}=r(9944);class d{constructor(p,
|
|
88
|
-
`)}),D}}class A{constructor(D,q,Y,Q,W,x,k){this.Options={url:I(D),contentType:x,base64Enc:q,streamProgressEvents:Y,connectionClose:k},this._streamProgressBytes=0,this._xhr=null,this._rxDataCb=Q,this._connErrorCb=W,this._reqActive=!1,this._REQCOUNTER=0,this._REQBASE=Math.floor(1e3*Math.random()),this._xhr=y.create(),this._handleAbortedReq=!A.browserSupportsXhrBinary(),this.stats=new N}recStat(D){}send(D,q=0,Y=1){q>0&&(this._xhr.abort(),this._xhr=y.create()),this._xhr.open("POST",this.Options.url,!0),this._streamProgressBytes=0,this._xhr.onreadystatechange=()=>this.xhrStateChange(D,q,Y),this._reqActive=!0,this.Options.base64Enc?C(this._xhr,D,this.Options.contentType,this.Options.connectionClose):S(this._xhr,D,this.Options.contentType,this.Options.connectionClose),this.recStat("SendMsg")}xhrStateChange(D,q,Y){const Q=this._xhr.readyState,W=this._xhr.LOADING,x=this._xhr.DONE;if(!(this.Options.streamProgressEvents&&Q===W||Q===x)||!this._reqActive)return;let k=null;if(this._handleAbortedReq)try{k=this._xhr.status}catch(se){return void
|
|
89
|
-
`,M,`XHR errorCode=${this._xhr._error?this._xhr._error.code:""})`).toString()))}isUsingBase64(){return this.Options.base64Enc}abort(){this._reqActive=!1,this._xhr&&this._xhr.abort&&this._xhr.abort()}static browserSupportsXhrBinary(){return S!==C}static browserSupportsStreamingResponse(){const D=y.create(),q=D&&D.onprogress===null;return f(`http browserStreamingCheck - if XMLHTTPRequest supported and XMLHTTPRequest support onprogress: ${q}`),q}}o.exports.HTTPConnection=A},2712:(o,h,r)=>{const a=r(199),u=r(3450),{Check:l}=r(802),{Convert:d,Hex:f}=r(9783),{ErrorSubcode:p,OperationError:_}=r(6706),{HTTPConnection:S}=r(6350),{LogFormatter:C}=r(2694),{SMFClient:g}=r(3175),{TransportError:m}=r(2680),{TransportProtocol:T}=r(9072),{TransportReturnCode:y}=r(9944),{TransportSessionEvent:E}=r(7368),{TransportSessionEventCode:I}=r(3427),{TransportSessionState:N}=r(3304),{WebTransportSessionBase:A}=r(1517),{int32ToStr:L,strToByteArray:D,strToHexArray:q}=d,{formatHexString:Y}=f,{LOG_TRACE:Q,LOG_DEBUG:W,LOG_ERROR:x,LOG_INFO:k}=new C("[http-transport-session]"),J=r(8287).hp;o.exports.HTTPTransportSession=class extends A{constructor(F,$,R,B){if(super(F,$,R,B),this._haveToken=!0,this._confMaxWebPayload=B.maxWebPayload,this._maxPayloadBytes=0,this._destroyTimer=null,this._destroyTimeout=B.connectTimeoutInMsecs,this._createUrl=`http${F.match(/(ws|http)(s?:\/\/.+)/)[2]}`,this._routerUrl=this._createUrl,this._rxChannelClient=null,this._httpSendConn=null,this._httpReceiveConn=null,this._smfDataTokenTSHeader=null,this._routerTag="",this._sid=null,B.transportProtocol===null||B.transportProtocol===void 0)throw new _("transportProtocol is not set",p.PARAMETER_OUT_OF_RANGE);this._transportProtocol=B.transportProtocol,this._useBinaryTransport=!1,this._useStreamingTransport=!1,this._streamingTransportPadding=0,this._useBinaryTransport=B.transportProtocol!==T.HTTP_BASE64,this._useStreamingTransport=B.transportProtocol===T.HTTP_BINARY_STREAMING,this._incomingBuffer="",this._packetReadState=0;const M=navigator.userAgent||"";if((M.match(/trident/i)||M.match(/msie/i))&&(this._streamingTransportPadding=257),B.transportContentType===null||B.transportContentType===void 0)throw new _("transportContentType is not set",p.PARAMETER_OUT_OF_RANGE);this._contentType=B.transportContentType}connectTimerExpiry(){k("HTTP transport connect timeout"),this.destroyCleanup("HTTP transport connect timeout",p.TIMEOUT)}get sessionIdHex(){return this._sid?Y(this._sid):""}updateMaxWebPayload(){const F=this._confMaxWebPayload-22;this._maxPayloadBytes=this._useBinaryTransport?F:Math.floor(.75*F)}connect(){return this._state!==N.DOWN?y.INVALID_STATE_FOR_OPERATION:this.connectInternal()}connectInternal(){this._connError=null;try{this._createConn=new S(this._createUrl,!this._useBinaryTransport,!1,($,R)=>this.handleCreateResponse($,R),($,R)=>this.handleCreateConnFailure($,R),this._contentType)}catch($){return k(`Failed to create connection to router: ${$.message}`),this._connError=$,y.CONNECTION_ERROR}if(l.nothing(this._createConn))return k("Failed to create connection to router"),y.CONNECTION_ERROR;const F=u.Codec.Transport.genTsCreateHeader();this._state===N.WAITING_FOR_CREATE||(this.createConnectTimeout(),this._state=N.WAITING_FOR_CREATE);try{this._createConn.send(F)}catch($){return k(`Error connecting: ${$.message}`),$.stack,this._state=N.CONNECTION_FAILED,this.cancelConnectTimeout(),this._connError=$ instanceof m?$:new m(`Could not create HTTP transport session: ${$.message}`,$.subcode||p.CONNECTION_ERROR),y.CONNECTION_ERROR}return y.OK}destroy(F,$){if(this._state,this._state===N.WAITING_FOR_DESTROY||this._state===N.DOWN)return y.OK;if(this._state===N.CONNECTION_FAILED||this._state===N.WAITING_FOR_CREATE)return k("The connection is in unreliable state, close transport"),this.destroyCleanup(F,$,!0),y.OK;k("Destroy transport session immediately"),this._state=N.WAITING_FOR_DESTROY,this._httpSendConn!==null&&(k("Destroy transport session: abort sendConn"),this._httpSendConn.abort()),this._httpReceiveConn!==null&&(k("Destroy transport session: abort receiveConn"),this._httpReceiveConn.abort()),this._destroyTimer=setTimeout(()=>{this.destroyTimerExpiry()},this._destroyTimeout),this._httpSendConn=new S(this._routerUrl,!this._useBinaryTransport,!1,(B,M)=>this.handleRxDataToken(B,M),(B,M)=>this.handleSendFailure(B,M),this._contentType,!0);const R=u.Codec.Transport.genTsDestroyHeader(this._sid);return q(R),this._httpSendConn.send(R),y.OK}send(F,$=!1){let R=F;if(this._state!==N.SESSION_UP)return y.INVALID_STATE_FOR_OPERATION;if(this._queuedData.length>0||!this._haveToken)return this.enqueueData(R,$);let B=null;if(R.length>this._maxPayloadBytes&&(B=R.substr(this._maxPayloadBytes),R=R.substr(0,this._maxPayloadBytes),!this.allowEnqueue(B.length)))return this.enqueueFailNoSpace();this._haveToken=!1;const M=this._smfDataTSHeaderParts[0].length+4+this._smfDataTSHeaderParts[1].length+R.length;return this._httpSendConn.send(this._smfDataTSHeaderParts[0]+L(M)+this._smfDataTSHeaderParts[1]+R),this._clientstats.bytesWritten+=R.length,B?this.enqueueData(B,null):(this._clientstats.msgWritten++,y.OK)}enqueueData(F,$=!1){const R=F.length;return $||this.allowEnqueue(R)?(this._queuedDataSize+=R,this._queuedData.push(F),y.OK):this.enqueueFailNoSpace()}initPreformattedHeaders(F){this._smfDataTSHeaderParts=u.Codec.Transport.genTsDataMsgHeaderParts(F),this._useStreamingTransport?this._smfDataTokenTSHeader=u.Codec.Transport.genTsDataStreamTokenMsg(F,this._streamingTransportPadding):this._smfDataTokenTSHeader=u.Codec.Transport.genTsDataTokenMsg(F)}flush(F){this._queuedDataSize?this._flushCallback=F:F()}sendQueuedData(){if(this._queuedDataSize===0)return;this._haveToken=!1;const F=this.getQueuedDataToSend(),$=this._smfDataTSHeaderParts[0].length+4+this._smfDataTSHeaderParts[1].length+F.length;if(this._httpSendConn.send(this._smfDataTSHeaderParts[0]+L($)+this._smfDataTSHeaderParts[1]+F),this._clientstats.bytesWritten+=F.length,this._canSendNeeded&&(this._canSendNeeded=!1,this._eventCB(new E(I.CAN_ACCEPT_DATA,"",null,0,this._sid))),this._flushCallback){const R=this._flushCallback;this._flushCallback=null,R()}}handleCreateResponse(F,$){if(this._state===N.WAITING_FOR_DESTROY||this._state===N.DOWN)return;if(this.updateMaxWebPayload(),F!==y.OK)return k(`Received create response with return code ${y.describe(F)}`),void(F===y.DATA_DECODE_ERROR?this.destroyCleanup("Received data decode error on create session response",p.DATA_DECODE_ERROR):this.destroyCleanup("Failed to handle create session response",p.CONNECTION_ERROR));if($.length===0)return;const R=u.Codec.Decode.decodeCompoundMessage(J.from($,"latin1"),0);if(!R)return x("Could not parse create response as SMF. Destroying transport"),void this.destroyCleanup("Failed to parse create response message",p.CONNECTION_ERROR);const B=R.getResponse();if(B.responseCode!==200)return void this.destroyCleanup(`Transport create request failed (${B.responseCode}, ${B.responseString})`,p.CONNECTION_ERROR);this.cancelConnectTimeout(),this._createConn.abort(),this._createConn=null,this._state=N.SESSION_UP,this._sid=R.sessionId,this._routerTag=R.routerTag,this._routerUrl=this._createUrl.replace(/\?.*/,""),this._routerTag!==""&&(this._routerUrl=this._routerUrl+this._routerTag),this.initPreformattedHeaders(this._sid);const M=!this._useBinaryTransport,re=this._useStreamingTransport;this._httpSendConn=new S(this._routerUrl,M,!1,(se,fe)=>this.handleRxDataToken(se,fe),(se,fe)=>this.handleSendFailure(se,fe),this._contentType),this._useStreamingTransport?this._httpReceiveConn=new S(this._routerUrl,M,re,(se,fe)=>this.handleRxStreaming(se,fe),(se,fe)=>this.handleSendFailure(se,fe),this._contentType,!0):(this._rxChannelClient=new g(se=>this.handleSmfMessage(se),se=>this.handleSmfParseError(se),null),this._httpReceiveConn=new S(this._routerUrl,M,re,(se,fe)=>this.handleRxData(se,fe),(se,fe)=>this.handleSendFailure(se,fe),this._contentType)),this._httpReceiveConn.send(this._smfDataTokenTSHeader),this._eventCB(new E(I.UP_NOTICE,B.responseString,B.responseCode,0,R.sessionId))}handleDestroyResponse(F){this.cancelDestroyTimeout();const $=F.getResponse(),R=$?$.responseString:"";this.destroyCleanup(`${R} handled Destroy Response addressed to session ${Y(F.sessionId)}, on session ${Y(this._sid)}`,0)}handleSmfMessage(F){const $=F.smfHeader;if($.smf_protocol!==u.SMFProtocol.TSESSION)return void this.handleSmfParseError(`Unexpected Message Prototcol (${$.smf_protocol}) on ReceiveData connection`);const R=F.payload,B=F.payloadLength;switch(F.messageType){case u.SMFTransportSessionMessageType.DESTROY_RESP:return void this.handleDestroyResponse(F);case u.SMFTransportSessionMessageType.DATA:if(F.sessionId!==this._sid){const M=F.getResponse(),re=M?` (${M.responseCode} ${M.responseString})`:"",se=M?M.responseCode:null;return D(this._sid),D(F.sessionId),this._state=N.CONNECTION_FAILED,void this._eventCB(new E(I.PARSE_FAILURE,`Session ID mismatch in data message, expected: ${Y(this._sid)}, got: ${Y(F.sessionId)}, ${re}`,se,p.PROTOCOL_ERROR,this._sid))}B>0&&this._client.rxDataBuffer(R);break;default:this.handleSmfParseError(`Unexpected message type (${F.messageType}) on ReceiveData connection`)}}handleSmfParseError(){this._eventCB(new E(I.DATA_DECODE_ERROR,"Received data decode error",null,p.DATA_DECODE_ERROR,this._sid))}handleRxData(F,$){this._httpReceiveConn!==null&&this._rxChannelClient!==null?this._state!==N.WAITING_FOR_DESTROY?(this._httpReceiveConn.recStat("GotData"),F===y.OK?$.length===0?this._httpReceiveConn.send(this._smfDataTokenTSHeader):this._rxChannelClient.rxDataString($):this.handleRxError(F,$)):a.Debug.formatDumpBytes($.substring(0,64),!0,0):this._state===N.DOWN?k("Transport session is down, ignore data from receive connection"):x(`Transport session is not in working state, state: ${this._state}`)}handleRxStreaming(F,$){if(this._httpReceiveConn===null)return void(this._state===N.DOWN||x(`Transport session is not in working state, state: ${this._state}`));if(this._state===N.WAITING_FOR_DESTROY)return void a.Debug.formatDumpBytes($.substring(0,64),!0,0);if(this._httpReceiveConn.recStat("GotData"),F!==y.OK)return void this.handleRxError(F,$);if($.length===0)return this._packetReadState=0,void this._httpReceiveConn.send(this._smfDataTokenTSHeader);if(this._packetReadState===1)return void this._client.rxDataString($);this._incomingBuffer+=$;const R=u.Codec.ParseSMF.parseSMFAt(J.from(this._incomingBuffer,"latin1"),0,!0);if(R){const B=u.Codec.Transport.parseTsSmfHdrAt(J.from(this._incomingBuffer,"latin1"),R.headerLength,R);if(!B)return;switch(B.messageType){case u.SMFTransportSessionMessageType.DESTROY_RESP:return void this.handleDestroyResponse(B);case u.SMFTransportSessionMessageType.DATA:if(B.sessionId!==this._sid){const M=B.getResponse(),re=M?` (${M.responseCode} ${M.responseString})`:"",se=M?M.responseCode:null;return D(this._sid),D(B.sessionId),D($.substr(0,64)),this._state=N.CONNECTION_FAILED,void this._eventCB(new E(I.PARSE_FAILURE,`Session ID mismatch in data message, expected: ${Y(this._sid)}, got: ${Y(B.sessionId)}, ${re}`,se,p.PROTOCOL_ERROR,this._sid))}return this._packetReadState=1,this._incomingBuffer.length>R.headerLength+B.tsHeaderLength&&this._client.rxDataString(this._incomingBuffer.substr(R.headerLength+B.tsHeaderLength)),void(this._incomingBuffer="");default:throw new m(`Unexpected message type (${B.messageType}) on ReceiveData connection`,0)}}else if(u.Codec.ParseSMF.isSMFHeaderAvailable(J.from(this._incomingBuffer,"latin1"),0)&&!u.Codec.ParseSMF.isSMFHeaderValid(J.from(this._incomingBuffer,"latin1"),0)){x(`Couldn't decode message due to invalid smf header, dump first 64 bytes (or fewer) of buffer content:
|
|
90
|
-
${a.Debug.formatDumpBytes(this._incomingBuffer.substring(0,64),!0,0)}`);const B="Error parsing incoming message - invalid SMF header detected";this._state=N.CONNECTION_FAILED,this._eventCB(new E(I.PARSE_FAILURE,B,null,p.PROTOCOL_ERROR,null))}}handleRxDataToken(F,$){if(F!==y.OK)return void this.handleRxError(F,$);if($.length===0)return;const R=u.Codec.Decode.decodeCompoundMessage(J.from($,"latin1"),0);if(R)if(R.messageType!==u.SMFTransportSessionMessageType.DESTROY_RESP){if(R.sessionId!==this._sid){const B=R.getResponse(),M=B?` (${B.responseCode} ${B.responseString})`:"",re=B?B.responseCode:null;return D(this._sid),D(R.sessionId),D($.substr(0,64)),void(this._state!==N.WAITING_FOR_DESTROY?(this._state=N.CONNECTION_FAILED,this._eventCB(new E(I.PARSE_FAILURE,`Session ID mismatch in response message, expected: ${Y(this._sid)}, got: ${Y(R.sessionId)}, ${M}`,re,p.PROTOCOL_ERROR,this._sid))):this.destroyCleanup("Session ID mismatch in response message",p.PROTOCOL_ERROR))}if(R.messageType!==u.SMFTransportSessionMessageType.DATA_TOKEN&&R.messageType!==u.SMFTransportSessionMessageType.DATA_STREAM_TOKEN)throw new m(`Unexpected message type (${R.messageType}) on SendData connection`,0);this._haveToken=!0,this._httpSendConn.recStat("GotToken"),this.sendQueuedData()}else this.handleDestroyResponse(R);else this._state!==N.WAITING_FOR_DESTROY?(this._state=N.CONNECTION_FAILED,this._eventCB(new E(I.PARSE_FAILURE,"Failed to parse received data message",null,p.PROTOCOL_ERROR,this._sid))):this.destroyCleanup("Failed to parse received data message",p.PROTOCOL_ERROR)}handleRxError(F){k(`handleRxError, transport return code ${y.name(F)}`),this._state=N.CONNECTION_FAILED,F===y.DATA_DECODE_ERROR?this._eventCB(new E(I.DATA_DECODE_ERROR,"Received data decode error",null,p.DATA_DECODE_ERROR,this._sid)):this._eventCB(new E(I.SEND_ERROR,"Connection error",p.CONNECTION_ERROR,this._sid))}handleSendFailure(F,$){this._state===N.WAITING_FOR_DESTROY?(k(`Connection destroy failure (${$}) while in state ${this._state}`),this.destroyCleanup(`Connection destroy failure: ${$}`,p.CONNECTION_ERROR)):(k(`Connection failure (${$}) while in state ${this._state}`),this._eventCB(new E(I.SEND_ERROR,`Connection error: ${$}`,F,p.CONNECTION_ERROR,this._sid)))}handleCreateConnFailure(F,$){this._state!==N.DOWN&&(k(`Connection create failure (${$}) while in state ${this._state}`),this.destroyCleanup(`Connection create failure: ${$}`,p.CONNECTION_ERROR))}destroyTimerExpiry(){this.destroyCleanup("Destroy request timeout",p.CONNECTION_ERROR)}cancelDestroyTimeout(){this._destroyTimer&&(clearTimeout(this._destroyTimer),this._destroyTimer=null)}destroyCleanup(F,$,R){this._createConn&&this._createConn.abort(),this._httpSendConn&&this._httpSendConn.abort(),this._httpReceiveConn&&this._httpReceiveConn.abort(),this._createUrl=null,this._routerUrl=null,this._createConn=null,this._httpSendConn=null,this._httpReceiveConn=null,this._smfDataTokenTSHeader=null,this._rxChannelClient=null,this._routerTag="",this._queuedData=[],this._queuedDataSize=0,this._canSendNeeded=!1,this.cancelDestroyTimeout(),this.cancelConnectTimeout(),this._state=N.DOWN;const B=()=>{this._eventCB&&this._eventCB(new E(I.DESTROYED_NOTICE,F||"Session is destroyed",null,$||0,this._sid)),this._client=null,this._eventCB=null};R?setTimeout(B,0):B()}getInfoStr(){return`HTTPTransportSession; sid=${Y(this._sid)}; routerTag=${this._routerTag}`}}},7440:(o,h,r)=>{const{Base64:a,Convert:u}=r(9783),{XHRFactory:l}=r(3124),{encode:d}=a,{stringToUint8Array:f}=u;function p(g,m,T){g.responseType="arraybuffer",g.overrideMimeType(`${T}; charset=x-user-defined`),g.setRequestHeader("Content-Type",`${T}; charset=x-user-defined`),g.send(f(m))}function _(g,m,T){g.overrideMimeType(`${T}; charset=x-user-defined`),g.setRequestHeader("Content-Type",`${T}; charset=x-user-defined`),g.send(f(m).buffer)}function S(g,m,T,y){g.setRequestHeader("Content-Type",`${T}; charset=x-user-defined`),g.send(m==null?m:d(m),y)}const C=typeof window<"u"&&window.Uint8Array&&window.Blob?l.create(!0).responseType?p:_:S;o.exports.sendXhrBinary=C,o.exports.sendXhrText=S},3124:(o,h,r)=>{const{ErrorSubcode:a}=r(6706),{TransportError:u}=r(2680),l={create(d=!1){const f=typeof XMLHttpRequest<"u"?new XMLHttpRequest:null;if(!d&&!f)throw new u("Failed to create an XMLHTTPRequest",a.CREATE_XHR_FAILED);return f}};o.exports.XHRFactory=l},5113:(o,h,r)=>{const{TransportProtocol:a}=r(9072),{TSHState:u}=r(3718);o.exports.StateBase64=class extends u{constructor(l,d,f){super(l,a.HTTP_BASE64,d,f)}}},4207:(o,h,r)=>{const{TransportProtocol:a}=r(9072),{TSHState:u}=r(3718),{WebTransportCapabilities:l}=r(261);o.exports.StateBinary=class extends u{constructor(d,f,p){super(d,a.HTTP_BINARY,f,p)}validateLegal(){return l.xhrBinary()}}},9580:(o,h,r)=>{const{TransportProtocol:a}=r(9072),{TSHState:u}=r(3718),{WebTransportCapabilities:l}=r(261);o.exports.StateStreamingAndBinary=class extends u{constructor(d,f,p){super(d,a.HTTP_BINARY_STREAMING,f,p)}validateLegal(){return l.streaming()&&l.xhrBinary()}}},1529:(o,h,r)=>{const{TransportProtocol:a}=r(9072),{TSHState:u}=r(3718),{WebTransportCapabilities:l}=r(261);o.exports.StateWebSocketBinary=class extends u{constructor(d,f,p){super(d,a.WS_BINARY,f,p)}validateLegal(){return l.webSocket()}}},261:(o,h,r)=>{const a=r(9005),{WebSocketTransportSession:u}=r(9990),{HTTPConnection:l}=a,d={webSocket:()=>u.browserSupportsBinaryWebSockets(),xhrBinary:()=>l.browserSupportsXhrBinary(),streaming:()=>l.browserSupportsStreamingResponse()};o.exports.WebTransportCapabilities=d},3246:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.WebTransportEvent=a.new({CONNECT:"Connect",DESTROY:"Destroy",DOWNGRADE:"Downgrade",DESTROYED_NOTICE:"DestroyedNotice",CONNECT_TIMEOUT:"ConnectTimeout",UP_NOTICE:"UpNotice",SEND_ERROR:"SendError"})},6145:(o,h,r)=>{const{ErrorSubcode:a}=r(6706),{FsmEvent:u,State:l,StateMachine:d}=r(7414),{LogFormatter:f}=r(2694),{TransportReturnCode:p}=r(9944),{TransportSessionEvent:_}=r(7368),{TransportSessionEventCode:S}=r(3427),{WebTransportEvent:C}=r(3246),{WebTransportState:g}=r(73),{LOG_TRACE:m,LOG_INFO:T}=new f;o.exports.WebTransportFSM=class extends d{constructor(y,E){super({name:"WebTransportFSM"});const I=y,N=this,A=new f;A.formatter=function(...L){return[`[web-transport-fsm=${E()}]`,...L]},this.log=A.wrap(this.log,this),this.transport=I,this.initial(function(){return this.transitionTo(this.WebTransportDown,L=>{L.getStateMachine().getName()})}),this.unhandledEventReaction(function(L){return L.getName(),this.getCurrentState().getName(),this}),this.WebTransportDown=new l({name:g.DOWN,parentContext:this}).reaction(C.CONNECT,function(){return this.transitionTo(N.WebTransportConnecting)}).reaction(C.DESTROY,function(L){return I.destroyInternal(L._destroyMsg,L._subcode),this.transitionTo(N.WebTransportDestroying)}),this.WebTransportConnecting=new l({name:g.CONNECTING,parentContext:this}).entry(()=>{try{if(I.connectInternal()!==p.OK){const L=I.getConnError(),D=new u({name:C.DESTROY});return D._destroyMsg=L?L.message:"Error occurred while establishing transport",D._subcode=L?L.subcode:null,D._eventReason=L,this.processEvent(D)}}catch(L){T(`transport.connectInternal threw: ${L.message}`);const D=new u({name:C.DESTROY});return D._destroyMsg=L.message,D._subcode=L.subcode?L.subcode:a.CONNECTION_ERROR,D._eventReason=L,this.processEvent(D)}}).reaction(C.SEND_ERROR,L=>(I.notifyEvent(L._transportEvent),N.attemptDowngrade(L._transportEvent))).reaction(C.CONNECT_TIMEOUT,L=>N.attemptDowngrade(L._transportEvent)).reaction(C.DESTROYED_NOTICE,L=>(I.notifyEvent(L._transportEvent),this.transitionTo(N.WebTransportDown))).reaction(C.UP_NOTICE,function(L){return I.notifyEvent(L._transportEvent),this.transitionTo(N.WebTransportUp)}).reaction(C.DESTROY,function(L){return I.destroyInternal(L._destroyMsg,L._subcode),this.transitionTo(N.WebTransportDestroying)}),this.WebTransportDowngrading=new l({name:g.DOWNGRADING,parentContext:this}).reaction(C.DESTROYED_NOTICE,function(L){return T("Web transport: request downgrade"),I.completeDowngrade()?this.transitionTo(N.WebTransportConnecting):(T("Web transport: connection error, no downgrade"),I.notifyEvent(L._transportEvent),N.notifyDowngradeFailed(),this.transitionTo(N.WebTransportDown))}).reaction(C.DESTROY,function(L){return I.destroyInternal(L._destroyMsg,L._subcode),this.transitionTo(N.WebTransportDestroying)}),this.WebTransportUp=new l({name:g.UP,parentContext:this}).reaction(C.DOWNGRADE,L=>N.attemptDowngrade(new _(L._downgradeMsg,L._subcode))).reaction(C.DESTROYED_NOTICE,function(L){return I.notifyEvent(L._transportEvent),this.transitionTo(N.WebTransportDown)}).reaction(C.DESTROY,function(L){return I.destroyInternal(L._destroyMsg,L._subcode),this.transitionTo(N.WebTransportDestroying)}).reaction(C.SEND_ERROR,function(L){return I.notifyEvent(L._transportEvent),I.destroyInternal(L._destroyMsg,L._subcode),this.transitionTo(N.WebTransportDestroying)}),this.WebTransportDestroying=new l({name:g.DESTROYING,parentContext:this}).reaction(C.DESTROYED_NOTICE,function(L){return I.notifyEvent(L._transportEvent),this.transitionTo(N.WebTransportDown)})}attemptDowngrade(y){const{infoStr:E,errorSubcode:I}=y;return this.transport.beginDowngrade(E,I)?this.transitionTo(this.WebTransportDowngrading):(this.transport.destroyInternal(E,I),this.transport.notifyEvent(y),this.transitionTo(this.WebTransportDestroying))}notifyDowngradeFailed(){this.transport.notifyEvent(new _(S.DOWNGRADE_FAILED,"Downgrade failed"))}}},1517:(o,h,r)=>{r(2694);const{TransportBase:a}=r(383),{TransportClientStats:u}=r(8188),{TransportReturnCode:l}=r(9944),{TransportSessionState:d}=r(3304);o.exports.WebTransportSessionBase=class extends a{constructor(f,p,_,S){super(f,p,_,S),this._connectTimeout=S.transportDowngradeTimeoutInMsecs,this._connectTimer=null,this._clientstats=new u,this._sendBufferMaxSize=S.sendBufferMaxSize,this._maxPayloadBytes=S.maxWebPayload,this._queuedData=[],this._queuedDataSize=0,this._canSendNeeded=!1,this._state=d.DOWN,this._connError=null}getClientStats(){return this._clientstats}createConnectTimeout(){this._connectTimeout>0&&(this._connectTimer=setTimeout(()=>{this.connectTimerExpiry()},this._connectTimeout))}cancelConnectTimeout(){this._connectTimer&&(clearTimeout(this._connectTimer),this._connectTimer=null)}connectTimerExpiry(){}allowEnqueue(f){return this._queuedDataSize===0||f+this._queuedDataSize<=this._sendBufferMaxSize}enqueueFailNoSpace(){return this._canSendNeeded=!0,l.NO_SPACE}flush(f){f()}getQueuedDataToSend(){let f="",p=this._maxPayloadBytes;if(this.getBufferedAmount&&this.getBufferedAmount(),this.getBufferedAmount){if(p=this._maxPayloadBytes-this.getBufferedAmount(),p<=0)return this._maxPayloadBytes,this.getBufferedAmount(),this._bufferedAmountQueryIntervalInMsecs*this._bufferedAmountQueryIntervalDelayMultiplier<=4e3&&(this._bufferedAmountQueryIntervalDelayMultiplier*=2),f;this._bufferedAmountQueryIntervalDelayMultiplier=1}if(this._queuedDataSize>p){let _=p;for(;_&&this._queuedDataSize;){const S=this._queuedData[0],C=S.length;C>_?(f+=S.substr(0,_),this._queuedData[0]=S.substr(_),this._queuedDataSize-=_,_=0):(f+=this._queuedData.shift(),_-=C,this._queuedDataSize-=C,this._clientstats.msgWritten++)}}else f=this._queuedData.join(""),this._clientstats.msgWritten+=this._queuedData.length,this._queuedData=[],this._queuedDataSize=0;return f.length,f}}},73:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.WebTransportState=a.new({DOWN:"WebTransportDown",CONNECTING:"WebTransportConnecting",DOWNGRADING:"WebTransportDowngrading",DESTROYING:"WebTransportDestroying",UP:"WebTransportUp"})},1250:(o,h,r)=>{const{ErrorSubcode:a,OperationError:u}=r(6706),{HTTPTransportSession:l}=r(9005),{LOG_TRACE:d,LOG_INFO:f,LOG_ERROR:p}=r(2694),{FsmEvent:_}=r(7414),{TransportBase:S}=r(383),{TransportProtocol:C}=r(9072),{TransportProtocolHandler:g}=r(5208),{TransportReturnCode:m}=r(9944),{TransportSessionEventCode:T}=r(3427),{WebSocketTransportSession:y}=r(9990),{WebTransportEvent:E}=r(3246),{WebTransportFSM:I}=r(6145);o.exports.WebTransport=class extends S{constructor(N,A,L,D,q){super(N,A,L,D),D.webTransportProtocolList,this._transportHandler=new g(N,D.webTransportProtocolList),this._webTransportFsm=new I(this,q),this._webTransportFsm.start()}notifyEvent(N){this._eventCB(N)}handleDestroyed(){this._transportSession=null}handleTransportEvent(N){let A;switch(f(`Web transport receive transport event: ${N}`),N.getTransportEventCode()){case T.UP_NOTICE:A=new _({name:E.UP_NOTICE}),A._transportEvent=N,this._webTransportFsm.processEvent(A);break;case T.DESTROYED_NOTICE:this.handleDestroyed(),A=new _({name:E.DESTROYED_NOTICE}),A._transportEvent=N,this._webTransportFsm.processEvent(A);break;case T.SEND_ERROR:A=new _({name:E.SEND_ERROR}),A._transportEvent=N,this._webTransportFsm.processEvent(A);break;case T.CONNECT_TIMEOUT:A=new _({name:E.CONNECT_TIMEOUT}),A._transportEvent=N,this._webTransportFsm.processEvent(A);break;case T.DOWNGRADE_FAILED:this._lastDowngradeSucceeded=!1;break;case T.DOWNGRADE_SUCCEEDED:this._lastDowngradeSucceeded=!0;break;default:this._eventCB(N)}}connect(){const N=new _({name:E.CONNECT});return this._webTransportFsm.processEvent(N),m.OK}connectInternal(){this._transportSession=null;const N=this._transportHandler.getTransportProtocol();switch(this._props.transportProtocol=N,N){case C.HTTP_BASE64:case C.HTTP_BINARY:case C.HTTP_BINARY_STREAMING:this._transportSession=new l(this._url,A=>this.handleTransportEvent(A),this._client,this._props);break;case C.WS_BINARY:this._transportSession=new y(this._url,A=>this.handleTransportEvent(A),this._client,this._props);break;default:throw p(`Web transport unrecognized TransportProtocol: ${N}`),new u(`No transport session provider for scheme: ${N}`,a.CONNECTION_ERROR,N)}return f(`Connect Transport ${N}`),this._transportSession.connect()}destroy(N,A){const L=new _({name:E.DESTROY});return L._destroyMsg=N,L._subcode=A,this._webTransportFsm.processEvent(L),m.OK}forceFailure(N){const A=N??"";return this._transportSession&&this._transportSession._socket._sender._socket.destroy(new Error(A)),m.OK}beginDowngrade(N,A){return!!this._transportHandler.canCompleteDowngrade()&&(this.destroyInternal(N,A),!0)}completeDowngrade(){return!!this._transportHandler.canCompleteDowngrade()&&this._transportHandler.completeDowngrade()}destroyInternal(N,A){this._transportSession&&this._transportSession.destroy(N,A)}flush(N){return this._transportSession.flush(N)}getConnError(){return this._transportSession?this._transportSession._connError:null}getInfoStr(){return this._transportSession?this._transportSession.getInfoStr():"Not connected."}getTransportProtocol(){return this._transportHandler.getTransportProtocol()}getClientStats(){return this._transportSession?this._transportSession.getClientStats():null}requestDowngrade(N,A){this._lastDowngradeSucceeded=void 0;const L=new _({name:E.DOWNGRADE});return L._downgradeMsg=N,L._subcode=A,this._webTransportFsm.processEvent(L),this._lastDowngradeSucceeded}send(N,A){return this._transportSession.send(N,A)}}},5181:o=>{o.exports.WebSocketCloseCodes={0:{name:"Unknown code",description:"No status code was returned by the operation"},1e3:{name:"Normal Closure",description:"The connection closed normally"},1001:{name:"Going Away",description:"The endpoint is going away due to a server failure or client navigation"},1002:{name:"Protocol Error",description:"A WebSocket protocol error occurred"},1003:{name:"Unsupported Data",description:"The endpoint cannot handle the specified data type"},1004:{name:"Reserved",description:""},1005:{name:"No Status Recvd",description:"Expected a status code but none was provided"},1006:{name:"Abnormal Closure",description:"No close frame was received before remote hangup"},1007:{name:"Invalid Frame Payload Data",description:"A message contained data inconsistent with its encoding"},1008:{name:"Policy Violation",description:"A message violated endpoint policy"},1009:{name:"Message Too Big",description:"A data frame was too large"},1010:{name:"Missing Extension",description:"The endpoint did not negotiate an expected extension"},1011:{name:"Internal Error",description:"The server encountered an unexpected condition that prevented it from fulfilling the request"},1012:{name:"Service Restart",description:"The server is restarting"},1013:{name:"Try Again Later",description:"The server is terminating the connection due to a temporary condition"},1014:{name:"Bad Gateway",description:"A gateway or proxy received an invalid response from the upstream server"},1015:{name:"TLS Handshake",description:"The connection was closed due to a failure to perform a TLS handshake"}}},9990:(o,h,r)=>{const{LOG_TRACE:a,LOG_DEBUG:u,LOG_INFO:l,LOG_WARN:d,LOG_ERROR:f}=r(2694),{ArrayUtils:p}=r(968),{Convert:_,Hex:S}=r(9783),{ErrorSubcode:C}=r(6706),{mixin:g}=r(7444),{TransportError:m}=r(2680),{TransportReturnCode:T}=r(9944),{TransportSessionEvent:y}=r(7368),{TransportSessionEventCode:E}=r(3427),{TransportSessionState:I}=r(3304),{WebSocketCloseCodes:N}=r(5181),{WebTransportSessionBase:A}=r(1517),{stringToArrayBuffer:L}=(r(886),r(7625),_),{formatHexString:D}=S,{includes:q}=p;let Y=(typeof window>"u"?r.g:window).WebSocket;class Q extends A{constructor(x,k,J,F){super(x,k,J,F),this._url=function($){return`ws${$.match(/(ws|http)(s?:\/\/.+)/)[2]}`}(x),this._socket=null,this._sessionId=new Date().getTime(),this._bufferedAmountQueryIntervalInMsecs=F.bufferedAmountQueryIntervalInMsecs,this._bufferedAmountQueryTimer=null,this._bufferedAmountQueryIntervalDelayMultiplier=1}onOpen(){this.cancelConnectTimeout(),this._state=I.SESSION_UP,this._eventCB(new y(E.UP_NOTICE,"Connected",0,null,this._sessionId))}onClose(x,k){if(x!==this._socket||this._state===I.WAITING_FOR_DESTROY)return;const J=[],F=N[k.code]||N[0];J.push(`${k.code} ${F.name} (${F.description})`),k.wasClean!==void 0&&J.push(`clean closure: ${k.wasClean}`),k.reason&&J.push(`reason: ${k.reason}`);const $=J.join(", ");k.type,k.wasClean,k.code,k.reason,this._state=I.CONNECTION_FAILED,this.destroy(`Connection closed: ${$}`,C.COMMUNICATION_ERROR)}onDrain(){this.maybeEmitCanSend(),this.maybeEmitFlush()}onBufferedAmountPoll(){this.getBufferedAmount()===0?this.onDrain():this.scheduleQuery&&this.scheduleQuery()}onError(x,k){if(l(`Websocket Transport Session onError for socket ${x} while socket is ${this._socket}`),x!==this._socket)return void l("Websocket Transport Session stray onError for previous socket, ignoring.");if(this._state===I.WAITING_FOR_DESTROY)return void l("WebSocket transport is being destroyed, ignore error");const J=k.message?`: ${k.message}`:"";l(`WebSocket transport connection error ${J} while in state ${this._state}`),this._state===I.WAITING_FOR_CONNECT?(this.cancelConnectTimeout(),this._state=I.CONNECTION_FAILED,this.destroy(`Connection failed: ${J}`,C.CONNECTION_ERROR)):this._eventCB(new y(E.SEND_ERROR,`Connection error${J}`,null,C.CONNECTION_ERROR,null))}onMessage(x){this._client&&this._client.rxDataArrayBuffer(x.data)}connectTimerExpiry(){l("WebSocket transport connect timeout"),this.state=I.CONNECTION_FAILED,this._eventCB(new y(E.CONNECT_TIMEOUT,"Connection timed out",null,C.TIMEOUT))}connect(){if(this._state!==I.DOWN)return f(`Invalid state for operation: ${I.nameOf(this._state)}`),T.INVALID_STATE_FOR_OPERATION;if(!this._url)return d("Cannot connect to null URL"),T.CONNECTION_ERROR;this._socket&&this.onError("Socket already connected"),l("Establishing WebSocket transport session");try{this.createConnectTimeout(),this._state=I.WAITING_FOR_CREATE,l("Constructing socket"),this._socket=new Y(this._url,"smf.solacesystems.com"),this._socket.binaryType="arraybuffer",this._socket.onopen=this.onOpen.bind(this),this._socket.onmessage=this.onMessage.bind(this),this._socket.onclose=this.onClose.bind(this,this._socket),this._socket.onerror=this.onError.bind(this,this._socket)}catch(x){if(l(`Error connecting: ${x.message}`),x.stack,this._state=I.CONNECTION_FAILED,this.cancelConnectTimeout(),!(x instanceof m))throw new m(`Could not create WebSocket: ${x.message}`,x.subcode||C.CONNECTION_ERROR);return this._connError=x,T.CONNECTION_ERROR}return l("WebSocket is connecting"),T.OK}send(x,k=!1){if(this._state!==I.SESSION_UP)return T.INVALID_STATE_FOR_OPERATION;const J=x.length,F=this._sendBufferMaxSize-this.getBufferedAmount()>=0;if(!k&&!F)return this._canSendNeeded=!0,this.scheduleQuery&&this.scheduleQuery(),T.NO_SPACE;const $=this._maxPayloadBytes,R=L(x);if(J>$)for(let B=0;B<J;B+=$)this._socket.send(R.slice(B,B+$));else this._socket.send(R);return this._clientstats.bytesWritten+=J,++this._clientstats.msgWritten,T.OK}getBufferedAmount(){return this._socket?this._socket.bufferedAmount:0}flush(x){this._flushCallback=x,this.maybeEmitFlush()}maybeEmitCanSend(){this._canSendNeeded&&this.getBufferedAmount()<this._sendBufferMaxSize&&(this._canSendNeeded=!1,this._eventCB(new y(E.CAN_ACCEPT_DATA,"",null,0,this._sessionId)))}maybeEmitFlush(){if(!this._flushCallback)return;if(this.getBufferedAmount()>0)return void(this._bufferedAmountQueryTimer||this.scheduleQuery());const x=this._flushCallback;this._flushCallback=null,x()}destroy(x,k){return this._state!==I.DOWN&&(l(`Destroy WebSocket transport: ${x}`),this._state=I.WAITING_FOR_DESTROY,this._socket&&(this._socket.close(),this._socket.onopen=null,this._socket.onmessage=null,this._socket.onclose=null,this._socket.onerror=function(){},this._socket=null),this._connectTimer&&(clearTimeout(this._connectTimer),this._connectTimer=void 0),this.cancelQuery(),this._bufferedAmountQueryIntervalDelayMultiplier=1,this._canSendNeeded=!1,this._state=I.DOWN,this._client=null),this._eventCB&&(this._eventCB(new y(E.DESTROYED_NOTICE,x||"Session is destroyed",null,k||0,this._sessionId)),this._eventCB=null),T.OK}getInfoStr(){return`WebSocketTransportSession; sid=${D(this._sessionId)}`}static browserSupportsBinaryWebSockets(){const x=["function","object"];return q(x,typeof Y)&&q(x,typeof ArrayBuffer)&&q(x,typeof Uint8Array)?"binaryType"in Y.prototype?(l("websocket browserSupportBinaryCheck: true - WebSocket supports binaryType"),!0):(l("websocket browserSupportBinaryCheck: false - WebSocket does not support binaryType"),!1):(l("websocket browserSupportBinaryCheck: false - some required classes not supported"),!1)}}g(Q,class{scheduleQuery(){if(this.getBufferedAmount()>0&&this._bufferedAmountQueryIntervalInMsecs>0){this.cancelQuery(),this._bufferedAmountQueryIntervalDelayMultiplier>1&&(this._bufferedAmountQueryIntervalInMsecs,this._bufferedAmountQueryIntervalDelayMultiplier);const W=this._bufferedAmountQueryIntervalInMsecs*this._bufferedAmountQueryIntervalDelayMultiplier;this._bufferedAmountQueryTimer=setTimeout(()=>{this.cancelQuery();try{this.onBufferedAmountPoll()}catch(x){f(`Error occurred in onBufferedAmountPoll: ${x.message}`),x.stack}},W)}}cancelQuery(){this._bufferedAmountQueryTimer&&(clearTimeout(this._bufferedAmountQueryTimer),this._bufferedAmountQueryTimer=null)}}),o.exports.WebSocketTransportSession=Q},968:(o,h,r)=>{const{APIProperties:a}=r(9544),{APIPropertiesValidators:u}=r(5050),{ArrayUtils:l}=r(8821),{parseURL:d}=r(6321),{Process:f}=r(85),{StringBuffer:p}=r(9710),{StringUtils:_}=r(319),{TimingBucket:S}=r(4255),{UUID:C}=r(77),{Version:g}=r(9436),m=r(4205);o.exports={clone:m,parseURL:d,APIProperties:a,APIPropertiesValidators:u,ArrayUtils:l,Process:f,StringBuffer:p,StringUtils:_,TimingBucket:S,UUID:C,Version:g}},5050:(o,h,r)=>{const{Check:a}=r(802),{ErrorSubcode:u,OperationError:l}=r(6706),d={validateInstance(f,p,_,...S){S.forEach(C=>{C.shift()(f,p,_,...C)})},valInstance(f,p,_,S,C){if(!a.instanceOf(p[_],S))throw new l(`${f} validation: Property '${_}' must be instance of ${C}`)},valNotEmpty(f,p,_){if(a.none(p[_])||p[_]==="")throw new l(`${f} validation: Property '${_}' cannot be empty.`,u.PARAMETER_OUT_OF_RANGE)},valLength(f,p,_,S){if(a.string(p[_])&&p[_].length>S)throw new l(`${f} validation: Property '${_}' exceeded max length ${S}`,u.PARAMETER_OUT_OF_RANGE)},valRange(f,p,_,S,C){if(a.number(p[_])&&(p[_]<S||p[_]>C))throw new l(`${f} validation: Property '${_}' out of range [${S}; ${C}].`,u.PARAMETER_OUT_OF_RANGE)},valString(f,p,_){if(!a.string(p[_]))throw new l(`${f} validation: Property '${_}' must be type string; was ${typeof p[_]}`,u.PARAMETER_INVALID_TYPE)},valNumber(f,p,_){if(!a.number(p[_]))throw new l(`${f} validation: Property '${_}' must be type number; was ${typeof p[_]}`,u.PARAMETER_INVALID_TYPE)},valBoolean(f,p,_){const S=p[_];if(!a.boolean(S))throw new l(`${f} validation: Property '${_}' must be type boolean; was ${typeof S}`,u.PARAMETER_INVALID_TYPE)},valIsMember(f,p,_,S,C,g=!1){const m=p[_];if(!(g&&m==null||S.values.indexOf(m)>=0))throw new l(`${f} validation: Property '${_}'=${m} must be a member of ${C}`,u.PARAMETER_INVALID_TYPE)},valStringOrArray(f,p,_){const S=p[_];if(typeof S!="string"&&!Array.isArray(S))throw new l(`${f} validation: Property '${_}' must be a string or array`,u.PARAMETER_INVALID_TYPE)},valArrayIsMember(f,p,_,S,C,g,m,T){if(p[_]==null){if(g)return;throw new l(`${f} validation: Property '${_}' must be type Array`,u.PARAMETER_INVALID_TYPE)}if(!Array.isArray(p[_]))throw new l(`${f} validation: Property '${_}' must be type Array`,u.PARAMETER_INVALID_TYPE);if(!m&&p[_].length===0)throw new l(`${f} validation: Property '${_}' cannot be empty`,u.PARAMETER_INVALID_TYPE);p[_].forEach((y,E)=>{if(!S.values.includes(y))throw new l(`${f} validation: Property '${_}' must be an array of ${C}`,u.PARAMETER_INVALID_TYPE);if(!T&&p[_].indexOf(y,E+1)>=0)throw new l(`${f} validation: Property '${_}' cannot have duplicate element value`,u.PARAMETER_OUT_OF_RANGE)})},valArrayOfString(f,p,_){const S=p[_];if(a.something(S)){if(!Array.isArray(S))throw new l(`${f} validation: Property '${_}' must be type Array`,u.PARAMETER_INVALID_TYPE);S.forEach(C=>{if(typeof C!="string")throw new l(`${f} validation: Property '${_}' must be an array of string`,u.PARAMETER_INVALID_TYPE)})}},valTopicString(f,p,_){const{DestinationUtil:S,DestinationType:C}=r(9620);o.exports.APIPropertiesValidators.valString(f,p,_);const g=p[_],m=S.validateAndEncode(C.TOPIC,g);if(m.error)throw new l(`${f} validation: Property '${_}' must be a valid topic string: ${m.error}`,u.PARAMETER_OUT_OF_RANGE)},valTopicStringOrEmpty(f,p,_){const S=p[_];S&&S.length&&o.exports.APIPropertiesValidators.valTopicString(f,p,_)}};o.exports.APIPropertiesValidators=d},9544:(o,h,r)=>{var a=r(2195);const u=r(4205);o.exports.APIProperties=class{constructor(...l){Object.assign(this,...l)}toString(){return a(this)}clone(){return u(this,!1,1)}}},8821:o=>{o.exports.ArrayUtils={flatten:function h(r){return r.reduce((a,u)=>a.concat(Array.isArray(u)?h(u):u),[])},includes:function(h,r){return h.some(a=>a===r)}}},8858:o=>{o.exports=function(h){let r=!1;if(!h.forceJURL)try{const I=new URL("b","http://a");I.pathname="c%20d",r=I.href==="http://a/c%20d"}catch{}if(r)return;const a=Object.create(null);a.ftp=21,a.file=0,a.gopher=70,a.http=80,a.https=443,a.ws=80,a.wss=443;const u=Object.create(null);function l(){this._scheme="",this._schemeData="",this._username="",this._password=null,this._host="",this._port="",this._path=[],this._query="",this._fragment="",this._isInvalid=!1,this._isRelative=!1}function d(I){return a[I]!==void 0}function f(){l.call(this),this._isInvalid=!0}function p(I){return I===""&&f.call(this),I.toLowerCase()}function _(I){const N=I.charCodeAt(0);return N>32&&N<127&&[34,35,60,62,63,96].indexOf(N)===-1?I:encodeURIComponent(I)}function S(I){const N=I.charCodeAt(0);return N>32&&N<127&&[34,35,60,62,96].indexOf(N)===-1?I:encodeURIComponent(I)}let C;u["%2e"]=".",u[".%2e"]="..",u["%2e."]="..",u["%2e%2e"]="..";const g=/[a-zA-Z]/,m=/[a-zA-Z0-9+\-.]/;function T(I,N,A){function L(x){}let D=N||"scheme start",q=0,Y="",Q=!1,W=!1;e:for(;(I[q-1]!==C||q===0)&&!this._isInvalid;){const x=I[q];switch(D){case"scheme start":if(!x||!g.test(x)){if(N)break e;Y="",D="no scheme";continue}Y+=x.toLowerCase(),D="scheme";break;case"scheme":if(x&&m.test(x))Y+=x.toLowerCase();else{if(x!==":"){if(N){if(C===x)break e;break e}Y="",q=0,D="no scheme";continue}if(this._scheme=Y,Y="",N)break e;d(this._scheme)&&(this._isRelative=!0),D=this._scheme==="file"?"relative":this._isRelative&&A&&A._scheme===this._scheme?"relative or authority":this._isRelative?"authority first slash":"scheme data"}break;case"scheme data":x==="?"?(this._query="?",D="query"):x==="#"?(this._fragment="#",D="fragment"):C!==x&&x!==" "&&x!==`
|
|
91
|
-
`&&x!=="\r"&&(this._schemeData+=
|
|
92
|
-
`||J==="\r")continue;if(J===":"&&this._password===null){this._password="";continue}const F=
|
|
83
|
+
`)),Q=!0)}),q.toString()}};o.exports.MessageDumpUtil=I},568:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.MessageOutcome=a.new({ACCEPTED:0,FAILED:1,REJECTED:3})},2868:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.MessageType=a.new({BINARY:0,MAP:1,STREAM:2,TEXT:3})},6676:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.MessageUserCosType=a.new({COS1:0,COS2:1,COS3:2})},1884:(o,h,r)=>{const{clone:a}=r(968),u=r(4386),{Codec:l}=r(769),{Convert:d}=r(9783),{Destination:_}=r(9620),{ErrorSubcode:p,OperationError:f}=r(6706),{LOG_DEBUG:S,LOG_WARN:C}=r(2694),{MessageCacheStatus:g}=r(7366),{MessageDeliveryModeType:m}=r(177),{MessageDumpFlag:T}=r(3901),{MessageDumpUtil:y}=r(8892),{MessageType:E}=r(2868),{MessageOutcome:I}=r(568),{MessageUserCosType:N}=r(6676),{Parameter:A}=r(802),{RgmidFactory:L}=r(6475),{SDTField:D,SDTFieldType:q,SDTMapContainer:Y,SDTUnsupportedValueError:Q}=r(769),{Baggage:W,MessageTracingSupport:x,TraceContext:k,TraceContextSetter:J}=r(2288),{ProfileBinding:F}=u,{utf8ToUcs2:$,anythingToBuffer:R}=d,{isBoolean:B,isEnumMember:M,isInstanceOf:re,isInstanceOfOrNothing:se,isNumberOrNothing:fe,isStringOrNothing:ce}=A,Te={circular:!1,includeNonEnumerable:!1};function Ee(ge){ge._deliveryMode=m.DIRECT,ge._userCos=N.COS1,ge._cacheStatus=g.LIVE,ge._spoolerUniqueId=void 0,ge._priority=void 0,ge._deliveryCount=-1,ge._traceContextSetter=null,ge._creationContext=null,ge._transportContext=null,ge._baggage=new W}class he extends x{constructor(){super(),Ee(this)}getType(){return this._messageType||E.BINARY}setApplicationMessageId(X){this._applicationMessageId=ce("applicationMessageId",X)}getApplicationMessageId(){return this._applicationMessageId}setApplicationMessageType(X){this._applicationMessageType=ce("applicationMessageType",X)}getApplicationMessageType(){return this._applicationMessageType}getBinaryAttachment(){return this._binaryAttachment&&F.value.byteArrayAsString?this._binaryAttachment.toString("latin1"):this._binaryAttachment}setBinaryAttachment(X){X&&(this._messageType=E.BINARY),this._setBinaryAttachment(R(X))}_setBinaryAttachment(X){this._binaryAttachment=X}getCacheRequestId(){return this._cacheRequestId}_setCacheRequestID(X){this._cacheRequestId=X}getCorrelationId(){return this._correlationId}setCorrelationId(X){this._correlationId=ce("correlationId",X)}getCorrelationKey(){return this._correlationKey||null}setCorrelationKey(X){this._correlationKey=X}isDeliverToOne(){return this._deliverToOne||!1}setDeliverToOne(X){this._setDeliverToOne(this._deliverToOne=B("deliverToOne",X))}_setDeliverToOne(X){this._deliverToOne=X}getDeliveryMode(){return this._deliveryMode}setDeliveryMode(X){this._setDeliveryMode(M("deliveryMode",X,m))}_setDeliveryMode(X){this._deliveryMode=X}getDestination(){return this._destination}setDestination(X){this._setDestination(re("destination",X,_))}_setDestination(X){this._destination=X}isDiscardIndication(){return this._discardIndication||!1}setDiscardIndication(X){this._setDiscardIndication(B("discardIndication",X))}_setDiscardIndication(X){this._discardIndication=X}isElidingEligible(){return this._elidingEligible||!1}setElidingEligible(X){this._setElidingEligible(B("setElidingEligible",X))}_setElidingEligible(X){this._elidingEligible=X}getHttpContentEncoding(){return this._httpContentEncoding}setHttpContentEncoding(X){this._httpContentEncoding=ce("httpContentEncoding",X),this._httpContentEncoding===""&&delete this._httpContentEncoding}getHttpContentType(){return this._httpContentType}setHttpContentType(X){this._httpContentType=ce("httpContentType",X),this._httpContentType===""&&delete this._httpContentType}getPublisherId(){return this._publisherId}setPublisherId(X){this._publisherId=X}getPublisherMessageId(){return this._publisherMsgId}setPublisherMessageId(X){this._publisherMsgId=X}getTimeToLive(){return this._timeToLive}setTimeToLive(X){if(X!=null){if(typeof X!="number"||isNaN(X))throw new f("Invalid type for time to live",p.PARAMETER_INVALID_TYPE);if(X<0||X>31536e7)throw new f("Invalid time to live value",p.PARAMETER_OUT_OF_RANGE);this._timeToLive=X}else this._timeToLive=X}getGMExpiration(){return this._expiration}setGMExpiration(X){this._expiration=fe("GMExpiration",X)}isDMQEligible(){return this._dmqEligible||!1}setDMQEligible(X){this._setDMQEligible(B("DMQEligible",X))}_setDMQEligible(X){this._dmqEligible=X}getFlowId(){return this._flowId}setFlowId(X){this._flowId=X}getGuaranteedPreviousMessageId(){return this._guaranteedPrevMsgId}setGuaranteedPreviousMessageId(X){this._guaranteedPrevMsgId=X}_setSpoolerUniqueId(X){this._spoolerUniqueId=X}_getSpoolerUniqueId(){return this._spoolerUniqueId===void 0?L.INVALID_SUID:this._spoolerUniqueId}getMessageConsumer(){return this._consumer}setMessageConsumer(X){this._consumer=X}getGuaranteedMessageId(){return this._guaranteedMsgId}setGuaranteedMessageId(X){this._guaranteedMsgId=X}_setSpoolerMessageId(X){this._spoolerMessageId=X}getReplicationGroupMessageId(){if(this._spoolerUniqueId===void 0||L.INVALID_SUID.eq(this._spoolerUniqueId))return;const X=this._spoolerMessageId||this._guaranteedMsgId;return L.from({suid:this._spoolerUniqueId,msgid:X})}getTopicSequenceNumber(){return this._topicSequenceNumber}setTopicSequenceNumber(X){this._topicSequenceNumber=X}getDeliveryCount(){if(this._deliveryCount===-1)throw new f("Endpoint does not report delivery count.",p.INVALID_OPERATION);return this._deliveryCount}setDeliveryCount(X){this._deliveryCount=X}settle(X){if(this._acked)throw new f("Message can only be settled once",p.MESSAGE_ALREADY_ACKNOWLEDGED);if(this._deliveryMode===m.DIRECT)throw new f("Cannot settle a DIRECT message",p.MESSAGE_DELIVERY_MODE_MISMATCH);if(!this._consumer)throw new f("Cannot settle a locally-created message",p.MESSAGE_DELIVERY_MODE_MISMATCH);if(!this._consumer._sessionInterface.canAck)throw new f("Cannot settle using associated session",p.SESSION_NOT_CONNECTED);if(!this._consumer.canAck)throw new f("Cannot settle using associated Message Consumer",p.INVALID_OPERATION);if(this._consumer.getProperties().browser)throw new f("Messages delivered to a Queue Browser can only be deleted by calling QueueBrowser.removeMessageFromQueue()",p.INVALID_OPERATION);if(this._consumer._fsm.hasAutoAckSupport)return void C(`Consumer configured to auto-acknowledge messages, so message ${this._guaranteedMsgId} cannot be application settled`);const ae=X;if(I.values.indexOf(ae)===-1)throw new f("Settlement outcome for message must be valid",p.INVALID_OPERATION);const ee=this._consumer.getProperties().requiredSettlementOutcomes.some(Re=>Re===ae);if(ae!=I.ACCEPTED&&!ee)throw new f(`solace.MessageOutcome.${I.nameOf(ae)} not supported for this Message Consumer`,p.INVALID_OPERATION);this._consumer.applicationSettle(this._guaranteedMsgId,ae),this._acked=!0}get isSettled(){return this._acked||!1}_validateBeforeAcknowledge(){if(this._acked)throw new f("Message can only be acknowledged once",p.MESSAGE_ALREADY_ACKNOWLEDGED);if(this._deliveryMode===m.DIRECT)throw new f("Cannot acknowledge a DIRECT message",p.MESSAGE_DELIVERY_MODE_MISMATCH);if(!this._consumer)throw new f("Cannot acknowledge a locally-created message",p.MESSAGE_DELIVERY_MODE_MISMATCH);if(!this._consumer._sessionInterface.canAck)throw new f("Cannot acknowledge using associated session",p.SESSION_NOT_CONNECTED);if(!this._consumer.canAck)throw new f("Cannot acknowledge using associated Message Consumer",p.INVALID_OPERATION);if(this._consumer.getProperties().browser)throw new f("Messages delivered to a Queue Browser can only be deleted by calling QueueBrowser.removeMessageFromQueue()",p.INVALID_OPERATION)}acknowledge(){this._validateBeforeAcknowledge(),this._consumer._fsm.hasAutoAckSupport?C(`Consumer configured to auto-acknowledge messages, so message ${this._guaranteedMsgId} cannot be application acknowledge`):(this._consumer.applicationAck(this._guaranteedMsgId,!1),this._acked=!0)}_autoAcknowledge(){this._validateBeforeAcknowledge(),this._consumer.applicationAck(this._guaranteedMsgId,!0),this._acked=!0}get isAcknowledged(){return this._acked||!1}isAcknowledgeImmediately(){return this._ackImmediately||!1}setAcknowledgeImmediately(X){this._setAcknowledgeImmediately(B("acknowledgeImmediately",X))}_setAcknowledgeImmediately(X){this._ackImmediately=X}getCacheStatus(){return this._cacheStatus}_setCacheStatus(X){this._cacheStatus=X}isReplyMessage(){return this._replyMessage||!1}isRedelivered(){return this._redelivered||!1}setRedelivered(X){this._redelivered=X}setAsReplyMessage(X){this._replyMessage=B("asReplyMessage",X)}getReceiverTimestamp(){return this._receiverTimestamp}getReplyTo(){return this._replyTo}setReplyTo(X){this._replyTo=se("replyTo",X,_)}getSenderId(){return this._senderId}setSenderId(X){this._senderId=ce("senderId",X)}getSenderTimestamp(){return this._senderTimestamp}setSenderTimestamp(X){this._senderTimestamp=fe("senderTimestamp",X)}getSequenceNumber(){if(this._sequenceNumberError)throw this._sequenceNumberError;return this._sequenceNumber}setSequenceNumber(X){X instanceof Q?this._sequenceNumberError=X:(this._sequenceNumber=fe("sequenceNumber",X),this._sequenceNumberError=void 0,this._autoSequenceNumber=!1)}getUserCos(){return this._userCos}getPriority(){return this._priority}setUserCos(X){this._setUserCos(M("userCos",X,N))}_setUserCos(X){this._userCos=X}setPriority(X){if(X!=null){if(typeof X!="number"||isNaN(X))throw new f("Invalid type for message priority",p.PARAMETER_INVALID_TYPE);if(X<0||X>255)throw new f("Invalid priority value",p.PARAMETER_OUT_OF_RANGE);this._setPriority(X)}else this._setPriority(void 0)}_setPriority(X){this._priority=X}getUserData(){return this._userData}setUserData(X){this._setUserData(ce("userData",X))}_setUserData(X){this._userData=X}getXmlContent(){return this._xmlContent}getXmlContentDecoded(){return this._xmlContent?$(this._xmlContent):this._xmlContent}setXmlContent(X){const ae=ce("xmlContent",X);this._xmlContent=ae&&unescape(encodeURIComponent(ae))}_setXmlContentInternal(X){this._xmlContent=ce("xmlContentInternal",X)}setXmlMetadata(X){this._setXmlMetadata(ce("xmlMetadata",X))}_setXmlMetadata(X){this._xmlMetadata=X}getXmlMetadata(){return this._xmlMetadata}get binaryMetadataChunk(){return this._binaryMetaChunk||null}set binaryMetadataChunk(X){this._binaryMetaChunk=X}get smfHeader(){return this._smfHeader}set smfHeader(X){this._smfHeader=X}get hasAutoSequenceNumber(){return this._autoSequenceNumber||!1}set hasAutoSequenceNumber(X){this._autoSequenceNumber=X}get hasAutoSenderTimestamp(){return this._autoSenderTimestamp||!1}set hasAutoSenderTimestamp(X){this._autoSenderTimestamp=X}getUserPropertyMap(){return this._userPropertyMap}setUserPropertyMap(X){this._userPropertyMap=se("userPropertyMap",X,Y)}setSdtContainer(X){const ae=se("sdtContainer",X,D);if(ae==null)return this._structuredContainer=null,void this.setBinaryAttachment(null);switch(this._setBinaryAttachment(null),ae.getType()){case q.MAP:this._messageType=E.MAP;break;case q.STREAM:this._messageType=E.STREAM;break;case q.STRING:this._messageType=E.TEXT;break;default:throw new f("Invalid parameter: expected SDTField Type of MAP, STREAM, or STRING.",p.PARAMETER_INVALID_TYPE)}this._structuredContainer=ae}getSdtContainer(){const X=this.getType(),ae=this._binaryAttachment,ee=ae?ae.length:0;return X===E.BINARY?null:(this._structuredContainer!==void 0||(this._structuredContainer=ee===0?null:l.parseSingleElement(ae,0)),this._structuredContainer)}_getCompressedBinaryAttachment(){return this._compressedBinaryAttachment}_setCompressedBinaryAttachment(X){this._compressedBinaryAttachment=X}_getPayloadCompressed(){return this._payloadCompressed}_setPayloadCompressed(X){this._payloadCompressed=X}getSequenceNumber(){if(this._sequenceNumberError)throw this._sequenceNumberError;return this._sequenceNumber}getTraceContextSetter(){return super.getTraceContextSetter()}getCreationContext(){return super.getCreationContext()}getTransportContext(){return super.getTransportContext()}setTransportContext(X){super._setTransportContext(X)}getBaggage(){return super.getBaggage()}dump(X=T.MSGDUMP_FULL){const ae=M("flags",X,T);return y.dump(this,ae)}clone(){return a(this,Te)}reset(){var X;X=this,Object.keys(X).forEach(ae=>delete X[ae]),Ee(this)}clearExtendedVarLenParams(){this._transportContext=null}}he.SOLCLIENT_USER_PROP_QUEUE_PARTITION_KEY="JMSXGroupID",o.exports.Message=he},6475:(o,h,r)=>{const{ErrorSubcode:a,OperationError:u}=r(6706),{Long:l}=r(9783),{Parameter:d}=r(802),{ReplayStartLocation:_,ReplayStartType:p}=r(9309),f=r(8287).hp,S="rmid1:",C=/^[0-9a-fA-F]{32}$/g,g=l.UZERO,{isString:m,isValue:T,isInstanceOf:y}=d;class E extends _{constructor(L,D){super({_replayStartValue:{suid:L,messageId:D},_type:p.RGMID}),this._suid=L,this._messageId=D}compare(L){y("otherReplicationGroupMessageId",L,E);const D=L;if(!this._suid.equals(D._suid)){const q="Unable to compare Replication Group Message ID from different origins";throw new u(`Parameter otherReplicationGroupMessageId[${D.toString()}] failed validation`,a.MESSAGE_ID_NOT_COMPARABLE,q)}return this._messageId.gt(D._messageId)?1:this._messageId.lt(D._messageId)?-1:0}inspect(){return`[Replication Group Message Id: ${this.toString()}]`}toString(){const L=f.from(this._suid.toBytesBE().concat(this._messageId.toBytesBE())).toString("hex");return`${S}${L.substring(0,5)}-${L.substring(5,16)}-${L.substring(16,24)}-${L.substring(24,32)}`}}function I(A){return new E(A.suid,A.msgid)}const N={fromString:function(A){if(m("id",A),T("id",A.length,41,a.PARAMETER_OUT_OF_RANGE,`length expected: 41 but is ${A.length}`),!A.startsWith(S))throw new u("Parameter id has invalid Replication Group Message ID format",a.PARAMETER_OUT_OF_RANGE,`id: ${A}, does not start with ${S}`);const L=A.substring(6).split("-");if(L.length!==4||L[0].length!==5||L[1].length!==11||L[2].length!==8||L[3].length!==8)throw new u("Parameter id has invalid Replication Group Message ID format",a.PARAMETER_OUT_OF_RANGE,`id: ${A}, does not have valid separation of components`);const D=L.join("").trim();if(C.test(""),!C.test(D))throw new u("Parameter id has invalid Replication Group Message ID format",a.PARAMETER_OUT_OF_RANGE,`id: ${A}, invalid data string value`);let q;try{q=f.from(D,"hex")}catch(W){throw new u("Parameter id has invalid Replication Group Message ID format",a.PARAMETER_OUT_OF_RANGE,`id: ${A}, failed to read data, cause: ${W.message}`)}const Y=q?q.length:0;if(Y!==16)throw new u("Parameter id has invalid Replication Group Message ID format",a.PARAMETER_OUT_OF_RANGE,`id: ${A}, failed to read data from id expected length of 16 got ${Y}`);const Q=l.fromBits(q.readUInt32BE(4),q.readUInt32BE(0),!0);if(Q.eq(g))throw new u("Parameter id has invalid Replication Group Message ID format",a.PARAMETER_OUT_OF_RANGE,`id: ${A}, has invalid origin`);return I({suid:Q,msgid:l.fromBits(q.readUInt32BE(12),q.readUInt32BE(8),!0)})}};N.from=I,N.INVALID_SUID=g,o.exports.ReplicationGroupMessageId=E,o.exports.RgmidFactory=N},9631:(o,h,r)=>{const{AbstractQueueDescriptor:a}=r(8293),{QueueAccessType:u}=r(1851),{QueueDescriptor:l}=r(8976),{QueueDescriptorValidator:d}=r(6039),{QueueDiscardBehavior:_}=r(9449),{QueuePermissions:p}=r(9489),{QueueProperties:f}=r(9304),{QueuePropertiesValidator:S}=r(719),{QueueType:C}=r(6228),{EndpointNameComplaint:g,explainInvalidEndpointName:m}=r(2764);o.exports.AbstractQueueDescriptor=a,o.exports.QueueAccessType=u,o.exports.QueueDescriptor=l,o.exports.QueueDescriptorValidator=d,o.exports.QueueDiscardBehavior=_,o.exports.QueuePermissions=p,o.exports.QueueProperties=f,o.exports.QueuePropertiesValidator=S,o.exports.QueueType=C,o.exports.EndpointNameComplaint=g,o.exports.explainInvalidEndpointName=m},8293:(o,h,r)=>{const{APIProperties:a}=r(968),{DestinationType:u}=r(9620),{OperationError:l,ErrorSubcode:d}=r(6706),{QueueType:_}=r(6228),p={durable:!0,type:void 0},f={[_.QUEUE]:"queue",[_.TOPIC_ENDPOINT]:"topic endpoint"},S={[u.TOPIC]:null,[u.QUEUE]:_.QUEUE,[u.TEMPORARY_QUEUE]:_.QUEUE};o.exports.AbstractQueueDescriptor=class extends a{constructor(C){super(p,function(g){if(g&&g.name&&g.type&&u.values.includes(g.type)){if(!S[g.type])throw new l(`Cannot create a descriptor from a ${u.describe(g.type)} destination`,d.PARAMETER_CONFLICT);return{name:g.name,type:_.QUEUE,durable:g.type!==u.TEMPORARY_QUEUE}}return g}(C))}getType(){return this._type}get type(){return this.getType()}set type(C){this._type=C}isDurable(){return this._durable}get durable(){return this.isDurable()}set durable(C){this._durable=C}inspect(){return{type:this.type,durable:this.durable}}toString(){return(this.isDurable()?"":"non")+`-durable ${f[this.getType()]}`}}},2764:(o,h,r)=>{const{Enum:a}=r(7444),u=[["EMPTY_STRING",/^$/,"Zero length",!0],["LT",/</,"Less than sign (<)",!0],["GT",/>/,"Greater than sign (>)",!0],["ASTERISK",/\*/,"Asterisk (*)",!0],["QUESTION_MARK",/\?/,"Question mark (?)",!0],["AMPERSAND",/&/,"Ampersand (&)",!0],["SEMICOLON",/;/,"Semicolon (;)",!0],["LEADING_SLASH",/^\//,"Starts with a slash (/).",!1],["TRAILING_SLASH",/\/$/,"Ends with a slash (/).",!1],["DOUBLE_SLASH",/\/\//,"Empty level (//)",!1],["TOO_LONG",/.{200,}/,"Longer than 200 characters",!0]],l={EMPTY_STRING:"Zero length",LT:"Less than sign (<)",GT:"Greater than sign (>)",ASTERISK:"Asterisk (*)",QUESTION_MARK:"Question mark (?)",AMPERSAND:"Ampersand (&)",SEMICOLON:"Semicolon (;)",LEADING_SLASH:"Starts with a slash (/).",TRAILING_SLASH:"Ends with a slash (/).",DOUBLE_SLASH:"Empty level (//)",TOO_LONG:"Longer than 200 characters",NO_ISSUE:""};o.exports.EndpointNameComplaint=a.new(l),o.exports.explainInvalidEndpointName=function(d,_){for(i in u){const p=u[i];if((!_||p[3])&&d.match(p[1]))return p[2]}return l.NO_ISSUE}},1851:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.QueueAccessType=a.new({EXCLUSIVE:"EXCLUSIVE",NONEXCLUSIVE:"NONEXCLUSIVE"})},6039:(o,h,r)=>{const{APIPropertiesValidators:a}=r(968),{QueueDescriptor:u}=r(8976),{QueueType:l}=r(6228),{validateInstance:d,valBoolean:_,valIsMember:p,valTopicString:f}=a,S={validate(C){const g=d.bind(null,"QueueDescriptor",C);C instanceof u&&g("name",[f]),g("type",[p,l,"QueueType"]),g("durable",[_])}};o.exports.QueueDescriptorValidator=S},8976:(o,h,r)=>{const{AbstractQueueDescriptor:a}=r(8293),{Destination:u}=r(9620),l={name:void 0,durable:!0};class d extends a{constructor(p){super(p instanceof u?{name:p.name,type:p.type}:Object.assign({},l,p))}getName(){return this._name}get name(){return this.getName()}set name(p){this._name=p}inspect(){return{name:this.name,type:this.type,durable:this.durable}}toString(){return`${super.toString()} '${this.getName()||""}'`}static createFromSpec(p){return p.name?new d(p):a(p)}}o.exports.QueueDescriptor=d},9449:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.QueueDiscardBehavior=a.new({NOTIFY_SENDER_ON:"NOTIFY_SENDER_ON",NOTIFY_SENDER_OFF:"NOTIFY_SENDER_OFF"})},9489:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.QueuePermissions=a.new({NONE:"NONE",READ_ONLY:"READ_ONLY",CONSUME:"CONSUME",MODIFY_TOPIC:"MODIFY_TOPIC",DELETE:"DELETE"})},719:(o,h,r)=>{const{APIPropertiesValidators:a}=r(968),{QueueAccessType:u}=r(1851),{QueueDiscardBehavior:l}=r(9449),{QueuePermissions:d}=r(9489),{validateInstance:_,valBoolean:p,valIsMember:f,valNumber:S,valRange:C}=a,g={validate(m){const T=_.bind(null,"QueueProperties",m);m.permissions!==void 0&&m.permissions!==null&&T("permissions",[f,d,"QueuePermissions"]),m.accessType!==void 0&&m.accessType!==null&&T("accessType",[f,u,"QueueAccessType"]),m.quotaMB!==void 0&&m.quotaMB!==null&&T("quotaMB",[S],[C,0,2**32-1]),m.maxMessageSize!==void 0&&m.maxMessageSize!==null&&T("maxMessageSize",[S],[C,0,2**32-1]),m.respectsTTL!==void 0&&m.respectsTTL!==null&&T("respectsTTL",[p]),m.discardBehavior!==void 0&&m.discardBehavior!==null&&T("discardBehavior",[f,l,"QueueDiscardBehavior"]),m.maxMessageRedelivery!==void 0&&m.maxMessageRedelivery!==null&&T("maxMessageRedelivery",[S],[C,0,255])}};o.exports.QueuePropertiesValidator=g},9304:(o,h,r)=>{var a=r(2195);const{APIProperties:u}=r(968),{QueueAccessType:l}=r(1851),{QueueDiscardBehavior:d}=r(9449),{QueuePermissions:_}=r(9489),p={permissions:void 0,accessType:void 0,quotaMB:void 0,maxMessageSize:void 0,respectsTTL:void 0,discardBehavior:void 0,maxMessageRedelivery:void 0};o.exports.QueueProperties=class extends u{constructor(f){super(p,f)}get permissions(){return this._permissions}set permissions(f){this._permissions=f}get accessType(){return this._accessType||p.accessType}set accessType(f){this._accessType=f}get quotaMB(){return this._quotaMB}set quotaMB(f){this._quotaMB=f}get maxMessageSize(){return this._maxMessageSize}set maxMessageSize(f){this._maxMessageSize=f}get respectsTTL(){return this._respectsTTL}set respectsTTL(f){this._respectsTTL=f}get discardBehavior(){return this._discardBehavior}set discardBehavior(f){this._discardBehavior=f}get maxMessageRedelivery(){return this._maxMessageRedelivery}set maxMessageRedelivery(f){this._maxMessageRedelivery=f}inspect(){return{permissions:_.describe(this.permissions),accessType:l.describe(this.accessType),quotaMB:this.quotaMB,maxMessageSize:this.maxMessageSize,respectsTTL:this.respectsTTL,discardBehavior:this.discardBehavior?d.describe(this.discardBehavior):void 0,maxMessageRedelivery:this.maxMessageRedelivery}}toString(){return a(this)}}},6228:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.QueueType=a.new({QUEUE:"QUEUE",TOPIC_ENDPOINT:"TOPIC_ENDPOINT"})},9309:(o,h,r)=>{const{Parameter:a}=r(802),{ReplayStartLocation:u,ReplayStartType:l}=r(4115),{ReplayStartLocationBeginning:d}=r(608),{ReplayStartLocationDate:_}=r(5439),{SolclientFactory:p}=r(4386);o.exports.ReplayStartLocation=u,o.exports.ReplayStartLocationBeginning=d,o.exports.ReplayStartLocationDate=_,o.exports.ReplayStartType=l,p.createReplayStartLocationBeginning=p.createFactory(()=>new d),p.createReplayStartLocationDate=p.createFactory(f=>_.createReplayStartLocationDate(a.isInstanceOf("date",f,Date)))},4115:(o,h,r)=>{var a=r(2195);const{Enum:u}=r(7444),l=u.new({BEGINNING:0,DATE:1,RGMID:2});o.exports.ReplayStartLocation=class{constructor(d){Object.assign(this,d),this._type===void 0&&(this._type=l.BEGINNING)}toString(){return a(this)}},o.exports.ReplayStartType=l},608:(o,h,r)=>{const{ReplayStartLocation:a,ReplayStartType:u}=r(4115);o.exports.ReplayStartLocationBeginning=class extends a{constructor(){super({_type:u.BEGINNING})}static inspect(){return"BEGINNING"}}},5439:(o,h,r)=>{const{ReplayStartLocation:a,ReplayStartType:u}=r(4115);class l extends a{constructor(_){super({_replayStartValue:_.getTime(),_type:u.DATE})}inspect(){return`[Epoch Time: ${this._replayStartValue}]`}static createReplayStartLocationDate(_){return new l(_)}}o.exports.ReplayStartLocationDate=l},769:(o,h,r)=>{const{Codec:a}=r(6360),{SDTDestType:u}=r(3153),{SDTField:l}=r(7385),{SDTFieldType:d}=r(7849),{SDTMapContainer:_}=r(7449),{SDTStreamContainer:p}=r(5711),{SDTUnsupportedValueError:f}=r(2157),{SDTValueErrorSubcode:S}=r(3268);o.exports.Codec=a,o.exports.SDTDestType=u,o.exports.SDTField=l,o.exports.SDTFieldType=d,o.exports.SDTMapContainer=_,o.exports.SDTStreamContainer=p,o.exports.SDTUnsupportedValueError=f,o.exports.SDTValueErrorSubcode=S},6360:(o,h,r)=>{const{EncodeSingleElement:a}=r(3884),{IEEE754LIB:u}=r(4493),{ParseSingleElement:l,StringToBuffer:d}=r(2497),{encodeSingleElement:_}=a,{parseSingleElement:p}=l,{stringToBuffer:f}=d,S={encodeSingleElement:_,parseSingleElement:p,stringToBuffer:f,IEEE754LIB:u};o.exports.Codec=S},2224:(o,h,r)=>{const{Convert:a}=r(9783),{SDTDataTypes:u}=r(8605),l={encodeHeader:function(d,_){let p=d<<2&255,f=null;return d===u.Map||d===u.Stream?(f=a.int32ToStr(_+5),p|=3):_+2<=255?(f=a.int8ToStr(_+2),p|=0):_+3<=65535?(f=a.int16ToStr(_+3),p|=1):(f=a.int32ToStr(_+5),p|=3),a.int8ToStr(p)+f}};o.exports.EncodeHeader=l},7579:o=>{const h={int48ToStr:function(r){let a=r;const u=[];for(let l=0;l<6;l++){const d=a%256;a=Math.floor(a/256),u.push(String.fromCharCode(d))}return u.reverse(),u.join("")}};o.exports.EncodeInteger=h},299:(o,h,r)=>{const a=r(3884),u=r(968),{EncodeHeader:l}=r(2224),{SDTDataTypes:d}=r(8605),{SDTMapContainer:_}=r(7449),{encodeHeader:p}=l,f={encodeMap(S){const C=[];if(!(S instanceof _))return null;const g=S.getKeys();let m,T=null,y=null,E=null;for(m=0;m<g.length;m++)T=S.getField(g[m]),T&&(E=u.StringUtils.nullTerminate(g[m]),y=p(d.String,E.length),y+=E,C.push(y),a.EncodeSingleElement.encodeSingleElementToBuf(T,C));return C.join("")}};o.exports.EncodeMap=f},3884:(o,h,r)=>{const a=r(9620),{Convert:u}=r(9783),{EncodeHeader:l}=r(2224),{EncodeInteger:d}=r(7579),{EncodeMap:_}=r(299),{EncodeStream:p}=r(9549),{IEEE754LIB:f}=r(4493),{SDTDataTypes:S}=r(8605),{SDTDestType:C}=r(3153),{SDTField:g}=r(7385),{SDTFieldType:m}=r(7849),{StringUtils:T}=r(968),{encodeHeader:y}=l,{int48ToStr:E}=d,{encodeMap:I}=_,{encodeStream:N}=p,{nullTerminate:A}=T,L=Math.pow(2,48);function D(Y,Q){if(!(Y instanceof g))return!1;const W=Y.getValue();let x=null,k=0;switch(Y.getType()){case m.BOOL:k=S.Boolean,x=u.int8ToStr(W?1:0);break;case m.UINT8:k=S.UnsignedInteger,x=u.int8ToStr(W);break;case m.INT8:k=S.Integer,x=u.int8ToStr(W);break;case m.UINT16:k=S.UnsignedInteger,x=u.int16ToStr(W);break;case m.INT16:k=S.Integer,x=u.int16ToStr(W);break;case m.UINT32:k=S.UnsignedInteger,x=u.int32ToStr(W);break;case m.INT32:k=S.Integer,x=u.int32ToStr(W);break;case m.UINT64:k=S.UnsignedInteger,x="\0\0"+E(W);break;case m.INT64:k=S.Integer,x=W>=0?"\0\0"+E(W):"ÿÿ"+E(L+W);break;case m.WCHAR:k=S.Char,x=u.int16ToStr(W.charCodeAt(0));break;case m.STRING:k=S.String,x=A(unescape(encodeURIComponent(W)));break;case m.BYTEARRAY:k=S.ByteArray,x=W.toString("latin1");break;case m.FLOATTYPE:k=S.Float,x=f.toIEEE754Single(W);break;case m.DOUBLETYPE:k=S.Float,x=f.toIEEE754Double(W);break;case m.MAP:k=S.Map,x=I(W);break;case m.STREAM:k=S.Stream,x=N(W);break;case m.DESTINATION:k=S.Destination,W instanceof a.Destination&&(x=u.int8ToStr(C[W.getType()])+W.getBytes());break;case m.NULLTYPE:k=S.Null,x="";break;case m.UNKNOWN:x=null}if(x!==null){const J=y(k,x.length);return Q.push(J),Q.push(x),!0}return!1}const q={encodeSingleElement:function(Y){const Q=[];return D(Y,Q),Q.join("")},encodeSingleElementToBuf:D};o.exports.EncodeSingleElement=q},9549:(o,h,r)=>{const a=r(3884),{SDTStreamContainer:u}=r(5711),l={encodeStream:function(d){const _=[];if(!(d instanceof u))return null;let p=null;for(d.rewind();d.hasNext();)p=d.getNext(),p&&a.EncodeSingleElement.encodeSingleElementToBuf(p,_);return d.rewind(),_.join("")}};o.exports.EncodeStream=l},4493:o=>{const h={toIEEE754(r,a,u){let l=r;const d=(1<<a-1)-1;let _,p,f;if(isNaN(l))p=(1<<d)-1,f=1,_=0;else if(l===1/0||l===-1/0)p=(1<<d)-1,f=0,_=l<0?1:0;else if(l===0)p=0,f=0,_=1/l==-1/0?1:0;else if(_=l<0,l=Math.abs(l),l>=Math.pow(2,1-d)){const m=Math.min(Math.floor(Math.log(l)/Math.LN2),d);p=m+d,f=l*Math.pow(2,u-m)-Math.pow(2,u)}else p=0,f=l/Math.pow(2,1-d-u);const S=[];for(let m=u;m;m-=1)S.push(f%2?1:0),f=Math.floor(f/2);for(let m=a;m;m-=1)S.push(p%2?1:0),p=Math.floor(p/2);S.push(_?1:0),S.reverse();let C=S.join("");const g=[];for(;C.length;)g.push(parseInt(C.substring(0,8),2)),C=C.substring(8);return g},fromIEEE754(r,a,u){const l=[];for(let C=r.length;C;C-=1){let g=r[C-1];for(let m=8;m;m-=1)l.push(g%2?1:0),g>>=1}l.reverse();const d=l.join(""),_=(1<<a-1)-1,p=parseInt(d.substring(0,1),2)?-1:1,f=parseInt(d.substring(1,1+a),2),S=parseInt(d.substring(1+a),2);return f===(1<<a)-1?S!==0?NaN:p*(1/0):f>0?p*Math.pow(2,f-_)*(1+S/Math.pow(2,u)):S!==0?p*Math.pow(2,-(_-1))*(S/Math.pow(2,u)):0},strToByteArr(r){const a=[];for(let u=0;u<r.length;u++)a.push(255&r.charCodeAt(u));return a},byteArrToStr(r){const a=[];for(let u=0;u<r.length;u++)a.push(String.fromCharCode(255&r[u]));return a.join("")},fromIEEE754Double(r){return this.fromIEEE754(this.strToByteArr(r),11,52)},toIEEE754Double(r){return this.byteArrToStr(this.toIEEE754(r,11,52))},fromIEEE754Single(r){return this.fromIEEE754(this.strToByteArr(r),8,23)},toIEEE754Single(r){return this.byteArrToStr(this.toIEEE754(r,8,23))}};o.exports.IEEE754LIB=h},5686:(o,h,r)=>{const{DestinationFromNetwork:a,DestinationType:u,Queue:l}=r(9620),{LOG_DEBUG:d,LOG_INFO:_}=r(2694),{SDTDestType:p}=r(3153),{SDTField:f}=r(7385),{SDTFieldType:S}=r(7849),{Topic:C}=r(9620),g={parseDestination:function(m,T,y){const E=m.readUInt8(T),I=m.toString("latin1",T+1,T+y);let N=a.createDestinationFromBytes(I);if(p[N.type]!==E)if(p[u.QUEUE]===E)N=l.createFromLocalName(I);else{if(p[u.TOPIC]!==E)return _(`Drop SDT field with invalid destination type ${E} when decoding ${I} to ${N.type}`),null;N.type,N=new C(I)}return f.create(S.DESTINATION,N)}};o.exports.ParseDestination=g},8906:(o,h,r)=>{const{ParseInteger:a}=r(9148),{autoDecodeVarLengthNumber:u}=a,l={parseFieldHeader:function(d,_){let p=_;const f=d.readUInt8(p),S=(252&f)>>2,C=1+(3&f);p++;const g=u(d,p,C);return p+=C,[S,g,g-(1+C),p-_]}};o.exports.ParseFieldHeader=l},3384:(o,h,r)=>{const{SDTField:a}=r(7385),{SDTFieldType:u}=r(7849),l={parseFloatField:function(d,_,p){switch(p){case 4:return a.create(u.FLOATTYPE,d.readFloatBE(_));case 8:return a.create(u.DOUBLETYPE,d.readDoubleBE(_));default:return a.create(u.UNKNOWN,d.toString("latin1",_,_+p))}}};o.exports.ParseFloat=l},9148:(o,h,r)=>{const a=r(5017),{SDTField:u}=r(7385),{SDTFieldType:l}=r(7849),{SDTUnsupportedValueError:d}=r(2157),{SDTValueErrorSubcode:_}=r(3268),{create:p}=u,f={autoDecodeVarLengthNumber:function(S,C,g){return!![1,2,3,4].includes(g)&&S.readUIntBE(C,g)},parseIntegerField:function(S,C,g,m){let T=0;switch(m){case 1:return S?(T=C.readInt8(g),p(l.INT8,T)):(T=C.readUInt8(g),p(l.UINT8,T));case 2:return S?(T=C.readInt16BE(g),p(l.INT16,T)):(T=C.readUInt16BE(g),p(l.UINT16,T));case 4:return S?(T=C.readInt32BE(g),p(l.INT32,T)):(T=C.readUInt32BE(g),p(l.UINT32,T));case 8:{let y=null;const E=a.fromBits(C.readUInt32BE(g+4),C.readUInt32BE(g),!S);E.getNumBitsAbs()>48&&(y=new d("Value is not supported",_.VALUE_OUTSIDE_SUPPORTED_RANGE,C.toString("latin1",g,m))),T=E.toNumber();const I=p(S?l.INT64:l.UINT64,T);return y&&I.setError(y),I}default:return null}}};o.exports.ParseInteger=f},2076:(o,h,r)=>{const a=r(2497),{LOG_ERROR:u}=r(2694),{ParseFieldHeader:l}=r(8906),{SDTDataTypes:d}=r(8605),{SDTField:_}=r(7385),{SDTFieldType:p}=r(7849),{SDTMapContainer:f}=r(7449),S={parseMapAt:function(C,g,m){const T=new f;let y=g;for(;y<g+m;){const E=l.parseFieldHeader(C,y);if(y+=E[3],E[0]!==d.String)return u("Error parsing SDTMAP, expected to find a string field as map key, and didn't"),u(`Type of key: ${E[0]}`),_.create(p.MAP,null);const I=C.toString("latin1",y,y+E[2]-1);y+=E[2];const N=l.parseFieldHeader(C,y),A=a.ParseSingleElement.parseSingleElement(C,y);y+=N[1],A&&T.addField(I,A)}return _.create(p.MAP,T)}};o.exports.ParseMap=S},2497:(o,h,r)=>{const{Convert:a}=r(9783);r(2694);const{ParseDestination:u}=r(5686),{ParseFieldHeader:l}=r(8906),{ParseFloat:d}=r(3384),{ParseInteger:_}=r(9148),{ParseMap:p}=r(2076),{ParseStream:f}=r(2580),{SDTDataTypes:S}=r(8605),{SDTField:C}=r(7385),{SDTFieldType:g}=r(7849),{utf8ToUcs2:m}=a,{parseFieldHeader:T}=l,{parseFloatField:y}=d,{parseIntegerField:E}=_,{parseMapAt:I}=p,{parseStreamAt:N}=f,{parseDestination:A}=u,L={parseSingleElement(q,Y){const Q=T(q,Y);if(!Q)return null;const W=Y+Q[3],x=Q[2];switch(Q[0]){case S.Null:return C.create(g.NULLTYPE,null);case S.Boolean:return C.create(g.BOOL,q.readUInt8(W)!==0);case S.Integer:return E(!0,q,W,x);case S.UnsignedInteger:return E(!1,q,W,x);case S.Float:return y(q,W,x);case S.Char:return C.create(g.WCHAR,String.fromCharCode(q.readUInt16BE(W)));case S.ByteArray:return C.create(g.BYTEARRAY,q.slice(W,W+x));case S.String:return C.create(g.STRING,m(q.toString("latin1",W,W+x-1)));case S.Destination:return A(q,W,x);case S.SMFMessage:return C.create(g.SMF_MESSAGE,q.slice(W,W+x));case S.Map:return I(q,W,x);case S.Stream:return N(q,W,x);default:return C.create(g.UNKNOWN,q.toString("latin1",W,W+x))}}},D={stringToBuffer:q=>r(8287).hp.from(q,"latin1")};o.exports.ParseSingleElement=L,o.exports.StringToBuffer=D},2580:(o,h,r)=>{const a=r(2497),{ParseFieldHeader:u}=r(8906),{SDTField:l}=r(7385),{SDTFieldType:d}=r(7849),{SDTStreamContainer:_}=r(5711),p={parseStreamAt:function(f,S,C){const g=new _;let m=S;for(;m<S+C;){const T=u.parseFieldHeader(f,m),y=a.ParseSingleElement.parseSingleElement(f,m);m+=T[1],y&&g.addField(y)}return l.create(d.STREAM,g)}};o.exports.ParseStream=p},8605:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SDTDataTypes=a.new({Null:0,Boolean:1,Integer:2,UnsignedInteger:3,Float:4,Char:5,ByteArray:6,String:7,Destination:8,SMFMessage:9,Map:10,Stream:11})},3153:(o,h,r)=>{const{DestinationType:a}=r(9620),{Enum:u}=r(7444),l={[a.TOPIC]:0,[a.QUEUE]:1,[a.TEMPORARY_QUEUE]:1};o.exports.SDTDestType=u.new(l)},7849:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SDTFieldType=a.new({BOOL:0,UINT8:1,INT8:2,UINT16:3,INT16:4,UINT32:5,INT32:6,UINT64:7,INT64:8,WCHAR:9,STRING:10,BYTEARRAY:11,FLOATTYPE:12,DOUBLETYPE:13,MAP:14,STREAM:15,DESTINATION:16,NULLTYPE:17,UNKNOWN:18,SMF_MESSAGE:19})},7385:(o,h,r)=>{const a=r(4386),{Convert:u}=r(9783),{SDTFieldType:l}=r(7849),{validateSdtField:d}=r(530),{anythingToBuffer:_}=u,{ProfileBinding:p}=a;class f{constructor(C=l.NULLTYPE,g=null){const m=d(C,g);if(m!==null)throw m;this._type=C,C===l.BYTEARRAY?this._value=_(g):this._value=g,this._error=void 0}getType(){return this._type}getValue(){if(this._error!==void 0)throw this._error;return this.getValueNoThrow()}getValueNoThrow(){return this._error!==void 0?this._error:this._type===l.BYTEARRAY&&p.value.byteArrayAsString?this._value.toString("latin1"):this._value}setError(C){this._error=C}toString(){return`[SDTField type:${this._type} value:${this._value}]`}static create(C,g){return new f(C,g)}}o.exports.SDTField=f},7449:(o,h,r)=>{const{ErrorSubcode:a,OperationError:u}=r(6706),{SDTField:l}=r(7385);o.exports.SDTMapContainer=class{constructor(){this._map=[]}getKeys(){return Object.keys(this._map)}getField(d){return this._map[d]}deleteField(d){delete this._map[d]}addField(d,_,p=void 0){if(_ instanceof l)this._map[d]=_;else{if(p===void 0)throw new u("Invalid parameters to addField: expected SDTField, or type and value",a.PARAMETER_CONFLICT);this._map[d]=l.create(_,p)}}}},5711:(o,h,r)=>{const a=r(7385),{ErrorSubcode:u,OperationError:l}=r(6706);o.exports.SDTStreamContainer=class{constructor(){this._stream=[],this._writable=!0,this._readPt=0}hasNext(){return this._stream.length>this._readPt}getNext(){return this._readPt<this._stream.length?this._stream[this._readPt++]:void 0}rewind(){this._readPt=0}addField(d,_=void 0){if(this._writable)if(d instanceof a.SDTField)this._stream.push(d);else{if(_===void 0)throw new l("Invalid parameters to addField: expected SDTField, or type and value",u.PARAMETER_CONFLICT);this._stream.push(a.SDTField.create(d,_))}}}},2157:(o,h,r)=>{const a=r(199),{SolaceError:u}=r(6706);o.exports.SDTUnsupportedValueError=class extends u{constructor(l,d,_){super("SDTUnsupportedValue",l),this.subcode=d,this.sourceData=_||""}inspect(){return super.inspect({subcode:null,sourceData:l=>a.Debug.formatDumpBytes(l,!1,0)})}getSubcode(){return this.subcode}getSourceData(){return this.sourceData}}},3268:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SDTValueErrorSubcode=a.new({VALUE_OUTSIDE_SUPPORTED_RANGE:1})},530:(o,h,r)=>{const a=r(9620),u=r(7449),l=r(5711),d=r(802),{ErrorSubcode:_,OperationError:p}=r(6706),{SDTFieldType:f}=r(7849),S=(()=>{const g=[];return g[f.BOOL]="boolean",g[f.UINT8]="number",g[f.INT8]="number",g[f.UINT16]="number",g[f.INT16]="number",g[f.UINT32]="number",g[f.INT32]="number",g[f.UINT64]="number",g[f.INT64]="number",g[f.WCHAR]="string",g[f.STRING]="string",g[f.BYTEARRAY]="object",g[f.FLOATTYPE]="number",g[f.DOUBLETYPE]="number",g})();function C(g){return new p(`Invalid SDT type:value combination, expected value type ${g}`,_.PARAMETER_INVALID_TYPE)}o.exports.validateSdtField=function(g,m){return S[g]&&(S[g]==="boolean"&&typeof m!="boolean"||S[g]==="number"&&typeof m!="number"||S[g]==="string"&&typeof m!="string")?C(S[g]):g!==f.MAP||d.Check.instanceOf(m,u.SDTMapContainer)?g!==f.STREAM||d.Check.instanceOf(m,l.SDTStreamContainer)?g!==f.DESTINATION||d.Check.instanceOf(m,a.Destination)?null:C("Destination"):C("SDTStreamContainer"):C("SDTMapContainer")}},5024:(o,h,r)=>{const{AuthenticationScheme:a}=r(3399),{CapabilityType:u,ClientCapabilityType:l}=r(2484),{MessageRxCBInfo:d}=r(2299),{MutableSessionProperty:_}=r(7113),{Session:p}=r(9564),{SessionEvent:f}=r(8229),{ProvisionEvent:S}=r(918),{SessionEventCBInfo:C}=r(5256),{SessionEventCode:g}=r(6334),{SessionEventName:m}=r(6324),{SessionProperties:T}=r(9656),{SessionState:y}=r(3183),{SolclientFactory:E}=r(4386),{SslDowngrade:I}=r(6415);E.createSession=E.createFactory((N,A,L)=>new p(N,A,L)),o.exports.AuthenticationScheme=a,o.exports.CapabilityType=u,o.exports.ClientCapabilityType=l,o.exports.MessageRxCBInfo=d,o.exports.MutableSessionProperty=_,o.exports.Session=p,o.exports.SessionEventCBInfo=C,o.exports.SessionEventCode=g,o.exports.SessionEvent=f,o.exports.ProvisionEvent=S,o.exports.SessionEventName=m,o.exports.SessionProperties=T,o.exports.SessionState=y,o.exports.SslDowngrade=I},3399:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.AuthenticationScheme=a.new({BASIC:"AuthenticationScheme_basic",CLIENT_CERTIFICATE:"AuthenticationScheme_clientCertificate",AUTHENTICATION_SCHEME_BASIC:"AuthenticationScheme_basic",AUTHENTICATION_SCHEME_CLIENT_CERTIFICATE:"AuthenticationScheme_clientCertificate",OAUTH2:"AuthenticationScheme_oauth2"})},2484:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.CapabilityType=a.new({PEER_SOFTWARE_VERSION:0,PEER_SOFTWARE_DATE:1,PEER_PLATFORM:2,PEER_PORT_SPEED:3,PEER_PORT_TYPE:4,MAX_DIRECT_MSG_SIZE:5,PEER_ROUTER_NAME:6,MESSAGE_ELIDING:7,NO_LOCAL:8,GUARANTEED_MESSAGE_CONSUME:9,TEMPORARY_ENDPOINT:10,GUARANTEED_MESSAGE_PUBLISH:11,GUARANTEED_MESSAGE_BROWSE:12,ENDPOINT_MGMT:13,SELECTOR:14,MAX_GUARANTEED_MSG_SIZE:15,ACTIVE_CONSUMER_INDICATION:16,COMPRESSION:17,CUT_THROUGH:18,ENDPOINT_DISCARD_BEHAVIOR:19,ENDPOINT_MESSAGE_TTL:20,JNDI:21,PER_TOPIC_SEQUENCE_NUMBERING:22,QUEUE_SUBSCRIPTIONS:23,SUBSCRIPTION_MANAGER:24,TRANSACTED_SESSION:25,MESSAGE_REPLAY:26,COMPRESSED_SSL:27,SHARED_SUBSCRIPTIONS:28,BR_REPLAY_ERRORID:29,AD_APP_ACK_FAILED:30,VAR_LEN_EXT_PARAM:31}),o.exports.ClientCapabilityType=a.new({UNBIND_ACK:0,BR_ERRORID:1,PQ:2})},8165:o=>{o.exports.CorrelatedRequest=class{constructor(h,r,a,u){this.correlationTag=h,this.timer=r,this.correlationKey=a,this.respRecvdCallback=u}}},6472:(o,h,r)=>{const{CapabilityType:a}=r(2484);o.exports.DefaultCapabilities={createDefaultCapabilities:u=>({[a.GUARANTEED_MESSAGE_CONSUME]:!0,[a.GUARANTEED_MESSAGE_PUBLISH]:!0,[a.SHARED_SUBSCRIPTIONS]:!0,[a.MAX_GUARANTEED_MSG_SIZE]:u.assumedMaxAdSize,[a.AD_APP_ACK_FAILED]:!0})}},343:(o,h,r)=>{const{Process:a}=r(968),u=Math.pow(2,32);function l(_,p){return p>_.length?"0".repeat(p-_.length)+_:_}const d={sessionCounter:0,idCounter:0,RandId:l((Math.random()*u).toFixed(0).toString(),10),NextSessionCounter(){return l((++this.sessionCounter).toString(),4)},NextId(){return++this.idCounter},GenerateClientName(){const{product:_,platform:p}=a;return`${_}/${p}/${this.RandId}/${this.NextSessionCounter()}`},GenerateUserIdentification(){const{product:_,platform:p}=a;return`${_}/${p}/${this.RandId}`},GenerateClientDescription:()=>`solclientjs/${a.description}`.substring(0,254)};o.exports.GlobalContext=d},4838:(o,h,r)=>{r(2694);const{parseURL:a}=r(968);let u;u=(l,d)=>setTimeout(()=>{try{const _=l.map(p=>{const f=a(p).host;return{url:p,host:f,address:f,resolved:!1}});return d(null,_)}catch(_){return d(_)}},0),o.exports.hostListDNSFilter=u},7405:(o,h,r)=>{const{assert:a}=r(7444),{hostListDNSFilter:u}=r(4838),{LogFormatter:l}=r(2694),{parseURL:d}=r(968);function _(f){return Array.isArray(f)?f.map(S=>d(S)):_(f.split(/[,;]/))}class p{constructor(S={url:null,waitTime:0}){Object.assign(this,S)}}o.exports.HostList=class{constructor({url:f,connectRetries:S,reconnectRetries:C,connectRetriesPerHost:g,reconnectRetryWaitInMsecs:m}={}){Object.assign(this,{hosts:_(f).map(T=>T.href),connectTryCount:S===-1?Number.POSITIVE_INFINITY:S+1,reconnectTryCount:C===-1?Number.POSITIVE_INFINITY:C,connectTryCountPerHost:g===-1?Number.POSITIVE_INFINITY:g+1,reconnectRetryWaitInMsecs:m,_mutableState:{},logger:new l("[host-list]")}),this.reset(),a(this.hosts.length>=1),a(this.connectTryCount>=1),a(this.reconnectTryCount>=0),a(this.connectTryCountPerHost>=1)}resolveHosts(f){const{LOG_TRACE:S,LOG_WARN:C}=this.logger;u(this.hosts,(g,m)=>{if(g)return f(g);a(m.length===this.hosts.length,"Resolve did not return a result for all hosts");let T=0;return m.forEach(y=>{y.address&&++T,y.resolved&&(y.address?(y.address,y.url):C("DNS resolve FAILED:",y.error.code,`${y.error.syscall}('${y.error.hostname}')`,"for",y.url))}),f(T===0?"All hosts failed DNS resolution":null)})}reset(f={wasConnected:!1,disconnected:!1}){Object.assign(this._mutableState,{wasConnected:f.wasConnected,disconnected:f.disconnected,hostPointer:0,hostTries:0,listTries:1,exhausted:!1,lastHostInfo:new p})}getNextHost(){this.logger;const f=this._mutableState,S=f.wasConnected,C=f.lastHostInfo;a(C,"Next host request with no prior host info -- did you call reset()?");try{if(f.disconnected)return null;a(!f.exhausted,"Next host request after host list exhausted");const g=Object.assign({hosts:this.hosts,hostTriesMax:this.connectTryCountPerHost,listTriesMax:S?this.reconnectTryCount:this.connectTryCount});if(++f.hostTries,f.hostTries>g.hostTriesMax?(f.hostTries,C.url,++f.hostPointer,f.hostPointer>=g.hosts.length?(++f.listTries,f.listTries>g.listTriesMax?(g.listTriesMax,f.exhausted=!0):(f.listTries,g.listTriesMax,f.hostPointer=0,f.hostTries=1)):f.hostTries=1):(f.hostTries,g.hostTriesMax),f.exhausted)return null;const m=g.hosts[f.hostPointer];a(m,`No host at the host pointer! ${g.hosts}[${f.hostPointer}]`);const T=C.url===null,y=C.url!==m,E=C.url!==m&&f.hostPointer===0,I=T||y&&!E?0:this.reconnectRetryWaitInMsecs,N=new p({url:m,waitTime:I});return f.lastHostInfo=N,N.url}finally{}}get connectWaitTimeInMsecs(){return a(this._mutableState.lastHostInfo.url,"Getting connectWaitTimeInMsecs having never called getNextHostInfo"),this._mutableState.lastHostInfo.waitTime}currentHostToString(){const f=this._mutableState,S=f.wasConnected,C=Object.assign({hosts:this.hosts,hostTriesMax:this.connectTryCountPerHost,listTriesMax:S?this.reconnectTryCount:this.connectTryCount}),g=f.hostPointer+1;return`host '${f.lastHostInfo.url}' (host ${g} of ${C.hosts.length})(host connection attempt ${f.hostTries} of ${C.hostTriesMax})(total ${S?"reconnection":"connection"} attempt ${f.listTries} of ${C.listTriesMax})`}}},2299:o=>{o.exports.MessageRxCBInfo=class{constructor(h,r){this.messageRxCBFunction=h,this.userObject=r}}},7113:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.MutableSessionProperty=a.new({CLIENT_NAME:1,CLIENT_DESCRIPTION:2})},7105:o=>{o.exports.OutstandingDataRequest=class{constructor(h,r,a,u,l){this.correlationId=h,this.timer=r,this.replyReceivedCBFunction=a,this.reqFailedCBFunction=u,this.userObject=l}}},7603:o=>{o.exports.P2PUtil={getP2PInboxTopic:h=>`${h}/_`,getP2PTopicSubscription:h=>`${h}/>`}},918:(o,h,r)=>{const{SessionEvent:a}=r(8229);o.exports.ProvisionEvent=class extends a{constructor(u,l,d=void 0,_=0,p=void 0,f=void 0,S=null,C=null){super([],u,l,d,_,p,f),this._queueDescriptor=S,this._queueProperties=C}get queueDescriptor(){return this._queueDescriptor}set queueDescriptor(u){this._queueDescriptor=u}get queueProperties(){return this._queueProperties}set queueProperties(u){this._queueProperties=u}inspect(){const u=super.inspect();return u.queueDescriptor=this._queueDescriptor,u.queueProperties=this._queueProperties,u}}},5256:o=>{o.exports.SessionEventCBInfo=class{constructor(h,r){this.userObject=r,this.sessionEventCBFunction=h}}},6334:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SessionEventCode=a.new({UP_NOTICE:0,DOWN_ERROR:1,CONNECT_FAILED_ERROR:2,REJECTED_MESSAGE_ERROR:4,SUBSCRIPTION_ERROR:5,SUBSCRIPTION_OK:6,VIRTUALROUTER_NAME_CHANGED:7,REQUEST_ABORTED:8,REQUEST_TIMEOUT:9,PROPERTY_UPDATE_OK:10,PROPERTY_UPDATE_ERROR:11,CAN_ACCEPT_DATA:13,DISCONNECTED:14,RECONNECTING_NOTICE:22,RECONNECTED_NOTICE:23,REPUBLISHING_UNACKED_MESSAGES:24,ACKNOWLEDGED_MESSAGE:25,UNSUBSCRIBE_TE_TOPIC_OK:26,UNSUBSCRIBE_TE_TOPIC_ERROR:27,MESSAGE:28,GUARANTEED_MESSAGE_PUBLISHER_DOWN:29,PROVISION_ERROR:30,PROVISION_OK:31})},6324:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SessionEventName=a.new({CONNECT:"SessionConnect",DISCONNECT:"SessionDisconnect",DISPOSE:"SessionDispose",CONNECT_TIMEOUT:"SessionConnectTimeout",CONNECT_WAIT_TIMEOUT:"SessionConnectWaitTimeout",DOWNGRADE_TIMEOUT:"SessionDowngradeTimeout",TRANSPORT_UP:"SessionTransportUp",TRANSPORT_DESTROYED:"SessionTransportDestroyed",TRANSPORT_CAN_ACCEPT_DATA:"SessionTransportCanAcceptData",TRANSPORT_PARSE_ERROR:"SessionTransportParseError",TRANSPORT_PROTOCOL_SMP:"SessionSMPMessage",TRANSPORT_PROTOCOL_CLIENTCTRL:"SessionClientCtrlMessage",EXCEPTION:"SessionException",SUBSCRIBE_TIMEOUT:"SessionSubscribeTimeout",CREATE_SUBSCRIBER:"SessionCreateSubscriber",FLOW_UP:"SessionFlowUp",FLOW_FAILED:"SessionFlowFailed",SEND_ERROR:"SessionSendError",FLOWS_DISCONNECTED:"SessionFlowsDisconnected",TRANSPORT_FLUSHED:"SessionTransportFlushed",DNS_RESOLUTION_COMPLETE:"SessionDNSResolutionComplete",TRANSPORT_CHANGE_DONE:"SessionTransportChangeDone"})},8229:(o,h,r)=>{var a=r(2195);const{ErrorSubcode:u,OperationError:l,RequestError:d,RequestEventCode:_}=r(6706),{SessionEventCode:p}=r(6334);function f(T){return class extends T{constructor(y,E,I,N=void 0,A=0,L=void 0,D=void 0){super(...y),this._sessionEventCode=E,this._infoStr=I,this._responseCode=N,this._errorSubcode=A,this._correlationKey=L,this._reason=D}get sessionEventCode(){return this._sessionEventCode}get infoStr(){return this._infoStr}get responseCode(){return this._responseCode}get errorSubcode(){return this.subcode||this._errorSubcode}get errorSubCode(){return this.errorSubcode}get correlationKey(){return this._correlationKey}get reason(){return this._reason}set reason(y){this._reason=y}inspect(){return Object.assign(super.inspect||{},{sessionEventCode:p.describe(this.sessionEventCode),infoStr:this.infoStr,responseCode:this.responseCode,errorSubcode:u.describe(this.errorSubcode),correlationKey:this.correlationKey?this.correlationKey.toString():null,reason:this.reason?this.reason:null})}toString(){return a(this)}}}const S={[p.CONNECT_FAILED_ERROR]:l,[p.DOWN_ERROR]:l,[p.GUARANTEED_MESSAGE_PUBLISHER_DOWN]:l,[p.PROPERTY_UPDATE_ERROR]:d,[p.REJECTED_MESSAGE_ERROR]:d,[p.SUBSCRIPTION_ERROR]:d,[p.UNSUBSCRIBE_TE_TOPIC_ERROR]:l,[_.REQUEST_ABORTED]:d,[_.REQUEST_TIMEOUT]:d},C=new Map().set(Object,()=>[]).set(l,(T,y,E,I,N,A)=>[y,I,A]).set(d,(T,y,E,I,N,A)=>[y,T,N,A]),g=new Map,m=f(Object);m.build=function(T,y,E=void 0,I=0,N=void 0,A=void 0){const L=S[T]||Object;return new((()=>{let D=g.get(L);return D||(D=f(L),g.set(L,D),D)})())((C.get(L)||(()=>[]))(T,y,E,I,N,A),T,y,E,I,N,A)},o.exports.SessionEvent=m},1122:(o,h,r)=>{var a=r(2195);const{ErrorSubcode:u}=r(6706),{FsmEvent:l}=r(7414),{Hex:d}=r(9783),{formatHexString:_}=d;o.exports.SessionFSMEvent=class extends l{constructor(p,f){super(p),this.eventText=null,this.errorSubcode=null,this.eventReason=null,this.smfMsg=null,this.sessionId=null,this.guaranteedFlowObject=null,Object.assign(this,f)}inspect(){return{eventText:this.eventText,eventReason:this.eventReason,errorSubcode:u.describe(this.errorSubcode),sessionId:this.sessionId&&_(this.sessionId)||"N/A"}}getExtraStringInfo(){return a(this)}}},43:(o,h,r)=>{const a=r(178),u=r(5898),l=r(3450),d=r(4386),_=r(8205),{assert:p}=r(7444),{CapabilityType:f}=r(2484),{Check:S}=r(802),{CorrelatedRequest:C}=r(8165),{Destination:g}=r(9620),{ErrorResponseSubcodeMapper:m,ErrorSubcode:T,OperationError:y}=r(6706),{FsmEvent:E,State:I,StateMachine:N}=r(7414),{Hex:A}=r(9783),{LogFormatter:L}=r(2694),{Message:D,MessageOutcome:q,MessageDeliveryModeType:Y}=r(6247),{P2PUtil:Q}=r(7603),{SessionEvent:W}=r(8229),{SessionEventCode:x}=r(6334),{SessionEventName:k}=r(6324),{SessionFSMEvent:J}=r(1122),{SessionRequestType:F}=r(168),{SessionStateName:$}=r(6057),{SslDowngrade:R}=r(6415),{StatType:B,StatsByMode:M}=r(5747),{StringUtils:re}=r(968),{SubscriptionUpdateTimeoutMessages:se}=r(4356),{Codec:fe}=r(769),{Convert:ce}=r(9783),{anythingToBuffer:Te}=ce,{formatHexString:Ee}=A,{stripNullTerminate:he}=re,{STAT_TX_BYMODE_BYTES:ge,STAT_TX_BYMODE_MSGS:X,STAT_RX_BYMODE_BYTES:ae,STAT_RX_BYMODE_MSGS:ee,STAT_TX_BYMODE_REDELIVERED:Re,STAT_TX_BYMODE_BYTES_REDELIVERED:me}=M,Pe=(r(97),r(595));o.exports.SessionFSM=class extends N{constructor(H,Z,te,ie){super({name:"SessionFSM"});const j=this,Oe=this.logger=new L(function(...U){return[`[session-fsm=${j.sessionIdHex||"(N/A)"}]`,`[${j.getCurrentStateName()}]`,...U]}),{LOG_TRACE:v,LOG_DEBUG:P,LOG_INFO:O}=Oe;this.log=Oe.wrap(this.log,this),this._sessionProperties=H,this._session=Z,this._sessionStatistics=te,this._hosts=ie,this._consumers=new a.ConsumerFlows,this._flowInterfaceFactory=U=>({getCorrelationTag:this.getCorrelationTag.bind(this),incStat:this.incStat.bind(this),sendData:V=>this.send(V,U,!1),sendToTransport:V=>this.sendToTransport(V,U,!1),sendControl:V=>this.send(V,U,!0),enqueueRequest:this.enqueueOutstandingCorrelatedReq.bind(this),createDestinationFromDescriptor:Z.createDestinationFromDescriptor.bind(Z),createTemporaryDestination:Z.createTemporaryDestination.bind(Z),isCapable:Z.isCapable.bind(Z),getCapability:Z.getCapability.bind(Z),getCurrentStateName:this.getCurrentStateName.bind(this),updateQueueSubscription:Z.updateQueueSubscription.bind(Z),get sessionIdHex(){return j.sessionIdHex},get canAck(){return Z.canAck}}),this._userBackpressured=!1,this.clearCurrentError(),this.initial(function(){return this.transitionTo(j.SessionDisconnected,U=>U.getStateMachine().reset())}),this.unhandledEventReaction(function(U){const V=j.getCurrentState();switch(U.getName()){case k.CREATE_SUBSCRIBER:return p(j._consumers,"collection has lifetime of FSM instance"),j._consumers.add(U.guaranteedFlowObject),this;case k.DISPOSE:return V.terminate(()=>j.disposeInternal());case k.FLOW_UP:return U.guaranteedFlowObject,this;default:return U.getName(),j.getCurrentStateName(),this}}),this.SessionConnecting=new I({name:$.CONNECTING,parentContext:j},{handleTransportDestroyed(){if(j.clearConnectTimer(),j._currentHost=j._hosts.getNextHost(),j._currentHost===null)return this.transitionToExitPoint(j.SessionConnecting,"ErrorExit");const{connectWaitTimeInMsecs:U}=j._hosts;return U>0&&!j._connectWaitTimer?(j._connectWaitTimer=setTimeout(()=>{j._connectWaitTimer=null,j.processEvent(new J({name:k.CONNECT_WAIT_TIMEOUT}))},U),this.transitionTo(j.WaitingForInterConnectTimeout)):this.transitionTo(j.WaitingForTransport)}}).entry(()=>{j.setConnectTimer()}).entryPoint("DisconnectTransport",function(){return j._hosts.reset({wasConnected:void 0,disconnected:!0}),j._connectFailEvent=x.DISCONNECTED,j._connectSuccessEvent=x.DISCONNECTED,this.transitionTo(j.DestroyingTransport)}).entryPoint("ReconnectTransport",function(){j._connectFailEvent=x.DOWN_ERROR,j._connectSuccessEvent=x.RECONNECTED_NOTICE;const U=j._sessionProperties._reconnectRetries===0;if(j._hosts.reset({wasConnected:!0,disconnected:U}),!U){const V=j._currentError||{},z=[V.eventText,V.responseCode,V.errorSubcode,void 0,V.eventReason];j.setPostEventAction(()=>{j.setConnectTimer(),j.emitSessionEvent(W.build(x.RECONNECTING_NOTICE,...z))})}return this.transitionTo(j.DestroyingTransport)}).initial(()=>(j.clearCurrentError(),j._connectFailEvent=x.CONNECT_FAILED_ERROR,j._connectSuccessEvent=x.UP_NOTICE,j._hosts.resolveHosts(U=>j._hosts?U?(j.setCurrentError({errorSubcode:T.UNRESOLVED_HOSTS,eventText:U}),j._hosts.reset({disconnected:!0}),this.processEvent(new J({name:k.EXCEPTION}))):(j._hosts.reset({wasConnected:!1}),j._currentHost=j._hosts.getNextHost(),this.processEvent(new J({name:k.DNS_RESOLUTION_COMPLETE}))):null),this.transitionTo(j.WaitingForDNS))).reaction(k.DNS_RESOLUTION_COMPLETE,function(){return this.transitionTo(j.WaitingForTransport)}).reaction(k.DISCONNECT,function(){return this.transitionToEntryPoint(j.SessionConnecting,"DisconnectTransport")}).reaction(k.CONNECT_TIMEOUT,function(){return j.setCurrentError({errorSubcode:T.TIMEOUT,eventText:"Connect timeout"}),this.transitionTo(j.DestroyingTransport)}).reaction(k.SEND_ERROR,function(U){return O(`SEND_ERROR reached SessionConnecting. ${U}`),j.setCurrentError(U),this.transitionTo(j.DestroyingTransport)}).reaction(k.EXCEPTION,function(U){return j.setCurrentError(U),this.transitionTo(j.DestroyingTransport)}).reaction(k.TRANSPORT_DESTROYED,function(U){return j.setCurrentError(U),O("TRANSPORT_DESTROYED event"),this.transitionTo(j.DestroyingTransport)}).exit(()=>{j.clearConnectTimer(),j._connectWaitTimer&&(clearTimeout(j._connectWaitTimer),j._connectWaitTimer=null)}).exitPoint("ConnectedExit",()=>(j.setPostEventAction(()=>{if(j.emitSessionEvent(W.build(j._connectSuccessEvent,`'${j._hosts.currentHostToString()}'`,200,0,null,null)),j._userBackpressured){const U=W.build(x.CAN_ACCEPT_DATA,"",null,0,null,"");j.emitSessionEvent(U),j._userBackpressured=!1}}),j.clearCurrentError(),this.transitionTo(j.SessionTransportUp))).exitPoint("ErrorExit",function(){return j.setPostEventAction(()=>{const U=j._currentError||{},V=[U.eventText,U.responseCode,U.errorSubcode,void 0,U.eventReason];j.emitSessionEvent(W.build(j._connectFailEvent,...V))}),this.transitionTo(j.SessionDisconnected)}),this.WaitingForDNS=new I({name:$.WAITING_FOR_DNS,parentContext:j.SessionConnecting}),this.DestroyingTransport=new I({name:$.DESTROYING_TRANSPORT,parentContext:j.SessionConnecting}).entry(()=>{O("Connecting, disposing transport"),j.clearConnectTimer(),j.destroyTransportSession("Disconnecting session",0)}).reaction(k.TRANSPORT_DESTROYED,function(U){return j.setCurrentError(U),j.SessionConnecting.handleTransportDestroyed.call(this)}),this.WaitingForInterConnectTimeout=new I({name:$.WAITING_FOR_INTERCONNECT_TIMEOUT,parentContext:j.SessionConnecting}).reaction(k.CONNECT_WAIT_TIMEOUT,function(){return this.transitionTo(j.WaitingForTransport)}),this.WaitingForTransport=new I({name:$.WAITING_FOR_TRANSPORT,parentContext:j.SessionConnecting}).initial(()=>{const U="Cannot establish transport session: creation failed";j.setConnectTimer(),j.clearCurrentError();try{j.initTransport()}catch(V){return this.setCurrentError({eventText:V.message===U?U:`${U}: ${V.message}`,errorSubcode:V.subcode||T.INTERNAL_ERROR,eventReason:V}),j.SessionConnecting.handleTransportDestroyed.call(this)}return this.transitionTo(j.WaitingForTransportUp)}),this.WaitingForTransportUp=new I({name:$.WAITING_FOR_TRANSPORT_UP,parentContext:this.WaitingForTransport}).entry(()=>{this._justEntered=!0}).initial(()=>{if(!this._justEntered)return this;this._justEntered=!1;const U="Cannot establish transport session: connection failed";try{const V=j._transport.connect();if(V!==_.TransportReturnCode.OK)throw new y(U,T.CONNECTION_ERROR,_.TransportReturnCode.describe(V));O(`Attempting to connect session '${j.sessionId}' to ${j._hosts.currentHostToString()}`)}catch(V){return this.setCurrentError({eventText:V.message===U?U:`${U}: ${V.message}`,errorSubcode:V.subcode||T.INTERNAL_ERROR,eventReason:V}),j.SessionConnecting.handleTransportDestroyed.call(this)}return this}).reaction(k.SEND_ERROR,function(U){return O(`SEND_ERROR while waiting for transport up, doing nothing. ${U}`),this.internalTransition(null)}).reaction(k.TRANSPORT_UP,function(U){if(j.sessionId=U.sessionId||"",j.sendClientCtrlLogin()===_.TransportReturnCode.OK)return this.transitionTo(j.WaitingForLogin);const V={eventText:"Failed to send Client Control Login",errorSubcode:T.LOGIN_FAILURE,responseCode:400};return j.setCurrentError(V),this.transitionTo(j.DestroyingTransport)}),this.WaitingForLogin=new I({name:$.WAITING_FOR_LOGIN,parentContext:j.SessionConnecting}).entry(()=>{j.setClientCtrlTimer()}).reaction(k.TRANSPORT_PROTOCOL_CLIENTCTRL,function(U){const V=U.smfMsg,z=V.getResponse(),ne=z.responseCode,de={responseCode:ne};if(j._responseCode=ne,ne===200)if(j.checkNoLocal(V)){if(j.checkCompressedSsl(V))return j.updateReadonlySessionProps(V),this.transitionTo(j.WaitForTransportChange);Object.assign(de,{eventText:"Compressed TLS is not supported by the Solace Message Router",errorSubcode:T.COMPRESSED_TLS_NOT_SUPPORTED})}else Object.assign(de,{eventText:"No Local is not supported by the Solace Message Router",errorSubcode:T.NO_LOCAL_NOT_SUPPORTED});else{const _e=m.getErrorSubcode(ne,z.responseString),we=_e===T.UNKNOWN_ERROR?T.LOGIN_FAILURE:_e;O(`Login failed. Subcode: ${we} respCode: ${ne} respString: ${z.responseString}`),Object.assign(de,{eventText:z.responseString,errorSubcode:we})}return j.setCurrentError(de),this.transitionTo(j.DestroyingTransport)}).reaction(k.DOWNGRADE_TIMEOUT,function(){return j._transport.requestDowngrade&&j._transport.requestDowngrade("ClientCtrl timeout",T.TIMEOUT)!==!1?this.transitionTo(j.WaitingForTransportUp):(j.setCurrentError({eventText:"ClientCtrl timeout",errorSubcode:T.TIMEOUT}),this.transitionTo(j.DestroyingTransport))}).exit(()=>{j.clearClientCtrlTimer()}),this.WaitForTransportChange=new I({name:$.WAITING_FOR_TRANSPORT_CHANGE,parentContext:j.SessionConnecting}).initial(function(){const U=j.updateTransportCompression((function(V){this._transport=V,this.processEvent(new J({name:k.TRANSPORT_CHANGE_DONE}))}).bind(j));return U===null?this:(j._transport=U,this.transitionTo(j.ReapplyingSubscriptions))}).reaction(k.TRANSPORT_CHANGE_DONE,function(){return this.transitionTo(j.ReapplyingSubscriptions)}),this.ReapplyingSubscriptions=new I({name:$.REAPPLYING_SUBSCRIPTIONS,parentContext:j.SessionConnecting}).entry(()=>{O("ReapplyingSubscriptions: entry"),j.copySubscriptionCacheKeys()}).initial(function(){return j.reapplySubscriptions()===!0?this.transitionTo(j.WaitForSubConfirm):this.transitionTo(j.WaitForCanAcceptData)}).reaction(k.SUBSCRIBE_TIMEOUT,function(){const U=T.TIMEOUT;return j.setCurrentError({eventText:"Subscription timeout while reapplying",errorSubcode:U}),this.transitionTo(j.DestroyingTransport)}).exit(function(){return j.clearSubscriptionCacheKeys(),this}),this.WaitForSubConfirm=new I({name:$.WAITING_FOR_SUBCONFIRM,parentContext:j.ReapplyingSubscriptions}).reaction(k.TRANSPORT_PROTOCOL_SMP,function(U){const V=U.smfMsg.smfHeader,z=he(U.smfMsg.encodedUtf8Subscription),ne=V.pm_respcode,de=V.pm_respstr;if(ne!==200){const _e=m.getErrorSubcode(ne,de);return O(`Waiting for subscription confirmation, got ${ne} (${_e}) '${de}' on subscription ${z}`),j.setCurrentError({eventText:de,responseCode:ne,errorSubcode:_e}),this.transitionTo(j.DestroyTransport)}return j._session.canConnectPublisher&&j._defaultPublisher&&j._defaultPublisher.isBindWaiting()?this.transitionTo(j.WaitingForMessagePublisher):this.transitionToExitPoint(j.SessionConnecting,"ConnectedExit")}),this.WaitForCanAcceptData=new I({name:$.WAITING_FOR_CAN_ACCEPT_DATA,parentContext:j.ReapplyingSubscriptions}).reaction(k.TRANSPORT_PROTOCOL_SMP,function(U){const V=U.smfMsg.smfHeader,z=he(U.smfMsg.encodedUtf8Subscription),ne=V.pm_respcode,de=V.pm_respstr;if(ne!==200){const _e=m.getErrorSubcode(ne,de);return j.setCurrentError({eventText:de,responseCode:ne,errorSubcode:_e}),this.transitionTo(j.DestroyingTransport)}return O(`Unexpected 200 OK response to subscription add for ${z}`),this.internalTransition(null)}).reaction(k.TRANSPORT_CAN_ACCEPT_DATA,function(){return j.reapplySubscriptions()===!0?this.transitionTo(j.WaitForSubConfirm):this.internalTransition(null)}),this.WaitingForMessagePublisher=new I({name:$.WAITING_FOR_PUBFLOW,parentContext:j.SessionConnecting}).entry(()=>{j._defaultPublisher.connect(),j.sendPublisherSessionUpEvent(j._defaultPublisher)}).reaction(k.FLOW_UP,function(){return j._defaultPublisher.isBindWaiting()?this.internalTransition(null):this.transitionToExitPoint(j.SessionConnecting,"ConnectedExit")}).reaction(k.FLOW_FAILED,function(U){return j.setCurrentError({eventText:`Guaranteed Message Publisher Failed: ${U.eventText}`,errorSubcode:T.LOGIN_FAILURE}),this.transitionTo(j.DestroyingTransport)}),this.SessionTransportUp=new I({name:$.TRANSPORT_UP,parentContext:j}).entry(function(){return j.clearConnectTimer(),this}).initial(function(){return j._session.canConnectConsumer&&(j._consumers.flows.forEach(U=>j.sendConsumerSessionUpEvent(U)),j._consumers.reconnectingFlows.forEach(U=>j.sendConsumerSessionUpEvent(U))),this.transitionTo(j.FullyConnected)}).reaction(k.DISCONNECT,function(){return this.transitionTo(j.SessionDisconnecting)}).reaction(k.EXCEPTION,function(U){return j.setCurrentError(U),j.cleanupSession(),this.transitionToEntryPoint(j.SessionConnecting,"ReconnectTransport")}).reaction(k.SEND_ERROR,function(U){return j.setCurrentError(U),j.cleanupSession(),this.transitionToEntryPoint(j.SessionConnecting,"ReconnectTransport")}).reaction(k.TRANSPORT_DESTROYED,function(U){return j.setCurrentError(U),O("Received unsolicited TRANSPORT_DESTROYED event while transport is up"),j.cleanupSession(),this.transitionToEntryPoint(j.SessionConnecting,"ReconnectTransport")}).reaction(k.TRANSPORT_PROTOCOL_SMP,function(U){const V=U.smfMsg.smfHeader,z=he(U.smfMsg.encodedUtf8Subscription),ne=V.pm_respcode,de=V.pm_respstr;return j.handleSubscriptionUpdateError(ne,de,z,void 0,!1),this.internalTransition(null)}).reaction(k.TRANSPORT_CAN_ACCEPT_DATA,function(U){const V=W.build(x.CAN_ACCEPT_DATA,"",null,0,null,U.toString());return j.emitSessionEvent(V),j._userBackpressured=!1,this.internalTransition(null)}).reaction(k.CREATE_SUBSCRIBER,function(U){const V=j._consumers.add(U.guaranteedFlowObject);return j.sendConsumerSessionUpEvent(V),this}).exit(function(){return j.clearKeepAlive(),this}),this.FullyConnected=new I({name:$.FULLY_CONNECTED,parentContext:j.SessionTransportUp}).entry(()=>{j._connectFailEvent=x.DOWN_ERROR,j.scheduleKeepAlive()}),this.SessionDisconnected=new I({name:$.DISCONNECTED,parentContext:j}).reaction(k.DISCONNECT,function(){return j.setPostEventAction(()=>{j.emitSessionEvent(W.build(x.DISCONNECTED))}),this.internalTransition(null)}).reaction(k.CONNECT,function(){return this.transitionTo(j.SessionConnecting)}).reaction(k.EXCEPTION,function(){return this.internalTransition(null)}),this.SessionDisconnecting=new I({name:$.DISCONNECTING,parentContext:j}).initial(()=>(O(`Disconnecting session ${j}`),this.transitionTo(j.DisconnectingFlows))).reaction(k.DISCONNECT,function(){return this.internalTransition(null)}).reaction(k.EXCEPTION,function(U){return j.setCurrentError({errEvent:U}),j.cleanupSession(),this.transitionToEntryPoint(j.SessionConnecting,"DisconnectTransport")}).reaction(k.TRANSPORT_DESTROYED,function(){return O("Received unsolicited TRANSPORT_DESTROYED while disconnecting transport"),j.cleanupSession(),this.transitionToEntryPoint(j.SessionConnecting,"DisconnectTransport")}),this.DisconnectingFlows=new I({name:$.DISCONNECTING_FLOWS,parentContext:j.SessionDisconnecting},{gatherPendingFlows(){const{MessageConsumerEventName:U}=a;p(!this.isGathering),this.isGathering=!0;const V=(z,ne,de)=>{if(p(z,"Trying to listen to undefined flow"),this.known.has(z))return;this.known.add(z),this.pending.add(z);const _e=()=>{de.forEach(we=>z._removeListener(we,_e)),this.pending.delete(z),this.isGathering||this.checkPendingFlows()};de.forEach(we=>ne.call(z,we,_e));try{z._disconnectSession()}catch{_e()}};j._consumers&&j._consumers.flows.forEach(z=>{V(z,z._once,[U.DOWN,U.DOWN_ERROR])}),this.isGathering=!1},checkPendingFlows(){this.pending,this.pending.size===0&&(this.gatherPendingFlows(),this.pending.size===0&&this.proceed())},proceed(){this.known=null,this.pending=null,O("All flows disconnected"),j.processEvent(new E({name:k.FLOWS_DISCONNECTED}))}}).entry(function(){this.known=new Set,this.pending=new Set,this.checkPendingFlows()}).reaction(k.FLOWS_DISCONNECTED,function(){return this.transitionTo(j.FlushingTransport)}),this.FlushingTransport=new I({name:$.FLUSHING_TRANSPORT,parentContext:j.SessionDisconnecting},{flushTransport(){j.cleanupSession(),j.flushTransportSession(()=>this.onTransportFlushed()),this.sessionId=null},onTransportFlushed(){j.processEvent(new E({name:k.TRANSPORT_FLUSHED}))}}).entry(function(){O("Flushing transport"),this.flushTransport()}).reaction(k.TRANSPORT_FLUSHED,function(){return O("Handle Transport Flushed"),this.transitionToEntryPoint(j.SessionConnecting,"DisconnectTransport")})}addToSubscriptionCache(H){if(S.nothing(H)||!this._subscriptionCache)return;this.logger;const Z=H.name;this._subscriptionCache[Z]===null||this._subscriptionCache[Z]===void 0?(this._subscriptionCache[Z]=H,this._subscriptionCacheCount++):this._subscriptionCache[Z]=H}cancelOutstandingCorrelatedReq(H){if(S.nothing(H)||!this._correlatedReqs)return null;const Z=this._correlatedReqs[H];if(Z==null)return null;const{LOG_DEBUG:te,LOG_ERROR:ie}=this.logger;Z.timer&&(clearTimeout(Z.timer),Z.timer=null);try{delete this._correlatedReqs[H]||ie(`Cannot delete ctrl request ${H}`)}catch(j){ie(`Cannot delete ctrl request ${H}`,j)}return Z}cleanupSession(){const{LOG_INFO:H}=this.logger;H("Clean up session");const{ConsumerFSMEvent:Z,ConsumerFSMEventNames:te}=a;this._correlatedReqs&&Object.keys(this._correlatedReqs).forEach(ie=>this.cancelOutstandingCorrelatedReq(ie)),this.clearConnectTimer(),this.clearClientCtrlTimer(),this.clearKeepAlive(),this._consumers.flows.forEach(ie=>{ie.processFSMEvent(new Z({name:te.SESSION_DOWN}))}),this._consumers.reconnectingFlows.forEach(ie=>{ie.processFSMEvent(new Z({name:te.SESSION_DOWN}))}),this._defaultPublisher&&this._defaultPublisher.processFSMEvent(new u.PublisherFSMEvent({name:u.PublisherFSMEventNames.SESSION_DOWN})),this._session.cleanupSession()}clearClientCtrlTimer(){this._clientCtrlTimer&&(clearTimeout(this._clientCtrlTimer),this._clientCtrlTimer=null)}clearConnectTimer(){this._connectTimer&&(clearTimeout(this._connectTimer),this._connectTimer=void 0)}clearKeepAlive(){const{LOG_INFO:H}=this.logger;this._keepAliveTimer&&(H("Cancel keepalive timer"),clearInterval(this._keepAliveTimer),this._keepAliveTimer=null),this.resetKeepAliveCounter()}checkNoLocal(H){let Z=!0;if(this._sessionProperties.noLocal===!0){const te=H.getRouterCapabilities();Z=!!te&&typeof te[f.NO_LOCAL]=="boolean"&&te[f.NO_LOCAL]}return Z}checkCompressedSsl(H){if(this.logger,this._compressedTLS){const Z=H.getRouterCapabilities();return!(!Z||typeof Z[f.COMPRESSED_SSL]!="boolean")&&Z[f.COMPRESSED_SSL]===!0}return!0}checkSessionDestinationCapability(H){let Z=null;return H&&H.getType()&&H.getSubscriptionInfo()&&(H.getSubscriptionInfo().isShare||H.getSubscriptionInfo().isNoExport)&&!this._session.isCapable(f.SHARED_SUBSCRIPTIONS)&&(Z=new y("Shared subscriptions are not allowed by router for this client",T.SHARED_SUBSCRIPTIONS_NOT_SUPPORTED,null)),Z}clearCurrentError(){this._currentError=null}clearSubscriptionCacheKeys(){this._subscriptionCacheKeys=null}copySubscriptionCacheKeys(){this.clearSubscriptionCacheKeys(),this._subscriptionCacheKeys=Object.keys(this._subscriptionCache||{});const H=Q.getP2PTopicSubscription(this._sessionProperties.p2pInboxBase);this._subscriptionCacheKeys.push(H)}createMessagePublisher(){if(this.logger,!this._sessionProperties.publisherProperties.enabled)return;const{MessagePublisher:H,MessagePublisherEventName:Z}=u,te=new H({properties:this._sessionProperties.publisherProperties,sessionInterfaceFactory:this._flowInterfaceFactory});te.on(Z.UP,()=>this.processEvent(new J({name:k.FLOW_UP},{guaranteedFlowObject:te}))),te.on(Z.CONNECT_FAILED_ERROR,ie=>this.processEvent(new J({name:k.FLOW_FAILED},{guaranteedFlowObject:te,event:ie,eventText:ie.description}))),te.on(Z.REJECTED_MESSAGE,(ie,j)=>{const Oe=j.smfHeader,v=Oe.pm_respcode,P=Oe.pm_respstr,O=m.getADErrorSubcode(v,P),U=W.build(x.REJECTED_MESSAGE_ERROR,P,v,O,ie.getCorrelationKey());U.message=ie,this.emitSessionEvent(U)}),te.on(Z.ACKNOWLEDGED_MESSAGE,ie=>{const j=W.build(x.ACKNOWLEDGED_MESSAGE,"Message(s) acknowledged",void 0,0,ie.getCorrelationKey());j.message=ie,this.emitSessionEvent(j)}),te.on(Z.FLOW_NAME_CHANGED,ie=>{const{messages:j,count:Oe}=ie;if(Oe>0){const v=W.build(x.REPUBLISHING_UNACKED_MESSAGES,`Republishing ${Oe} messages due to Guaranteed Message Publisher failed to reconnect`);v.messages=j,v.count=Oe,this.emitSessionEvent(v)}}),te.on(Z.CAN_SEND,()=>{this.emitSessionEvent(W.build(x.CAN_ACCEPT_DATA,`${te} window is now open and can send`))}),te.on(Z.GUARANTEED_MESSAGING_DOWN,()=>{this.emitSessionEvent(W.build(x.GUARANTEED_MESSAGE_PUBLISHER_DOWN,"Guaranteed Message Publishing shut down"))}),this._defaultPublisher=te}sendConsumerSessionUpEvent(H){const{ConsumerFSMEvent:Z,ConsumerFSMEventNames:te}=a,ie=new Z({name:this._session.canConnectConsumer?te.SESSION_UP:te.SESSION_UP_NO_AD});ie.guaranteedFlowObject=H,H.processFSMEvent(ie)}sendPublisherSessionUpEvent(H){const Z=this._session.canConnectPublisher,te=new u.PublisherFSMEvent({name:Z?u.PublisherFSMEventNames.SESSION_UP:u.PublisherFSMEventNames.SESSION_UP_NO_AD});te.guaranteedFlowObject=H,H.processFSMEvent(te)}createMessageConsumer(H){const{MessageConsumer:Z}=a,te=new Z({properties:H,sessionInterfaceFactory:this._flowInterfaceFactory}),ie=te.getProperties();if(ie.topicEndpointSubscription){const P=this.checkSessionDestinationCapability(ie.topicEndpointSubscription);if(P)throw P}const{LOG_WARN:j}=this.logger,Oe=ie.requiredSettlementOutcomes;if(Oe&&Oe.length>0&&Oe.some(P=>P===q.FAILED||q.REJECTED)&&!this._session.isCapable(f.AD_APP_ACK_FAILED)){const P=`Session.capabilitySettlementOutcomeNotSupported: [ ${Oe.map(O=>`solace.MessageOutcome.${q.nameOf(O)}`).join(", ")} ]`;throw j(P),new y(P,T.INVALID_OPERATION,null)}const v={guaranteedFlowObject:te};return this.processEvent(new J({name:k.CREATE_SUBSCRIBER},v)),te}createQueueBrowser(H){const{MessageConsumerAcknowledgeMode:Z,QueueBrowser:te}=a;this.logger;const ie={};return ie.queueDescriptor=H.queueDescriptor,ie.acknowledgeMode=Z.CLIENT,ie.browser=!0,Object.prototype.hasOwnProperty.call(H,"connectTimeoutInMsecs")&&(ie.connectTimeoutInMsecs=H.connectTimeoutInMsecs),Object.prototype.hasOwnProperty.call(H,"connectAttempts")&&(ie.connectAttempts=H.connectAttempts),Object.prototype.hasOwnProperty.call(H,"windowSize")&&(ie.windowSize=H.windowSize),Object.prototype.hasOwnProperty.call(H,"transportAcknowledgeTimeoutInMsecs")&&(ie.transportAcknowledgeTimeoutInMsecs=H.transportAcknowledgeTimeoutInMsecs),Object.prototype.hasOwnProperty.call(H,"transportAcknowledgeThresholdPercentage")&&(ie.transportAcknowledgeThresholdPercentage=H.transportAcknowledgeThresholdPercentage),new te(this.createMessageConsumer(ie))}destroyTransportSession(H,Z){if(S.nothing(this._transport))return void this.processEvent(new J({name:k.TRANSPORT_DESTROYED}));const{LOG_INFO:te,LOG_ERROR:ie}=this.logger;te("Destroy transport session");const j=this._transport.destroy(H,Z);this._smfClient=null,j!==_.TransportReturnCode.OK&&ie(`Failed to destroy transport session, return code: ${_.TransportReturnCode.describe(j)}`)}disposeInternal(){if(this._disposed)return;const H={transport:()=>{this.destroyTransportSession("Disposing",0),this._transport=null,this._smfClient=null},session:()=>{this.cleanupSession(),this._session=null,this._sessionProperties=null,this._correlatedReqs=null,this._flowInterfaceFactory=null},statistics:()=>{this._sessionStatistics&&(this._sessionStatistics.resetStats(),this._sessionStatistics=null),this._kaStats=null},"subscription cache":()=>{this._subscriptionCache&&(Object.keys(this._subscriptionCache).forEach(Z=>this.removeFromSubscriptionCache(Z)),this._subscriptionCache=null),this.clearSubscriptionCacheKeys(),this._subscriptionCacheCount=0},MessagePublishers:()=>{this._defaultPublisher&&(this._defaultPublisher.dispose(),this._defaultPublisher=null)},MessageConsumers:()=>{this._consumers.disposeAll(),this._consumers=null},"host list":()=>{this._currentHost=null,this._hosts=null}};Object.keys(H).forEach(Z=>{const{LOG_TRACE:te,LOG_INFO:ie}=this.logger,j=H[Z];try{j()}catch(Oe){ie(`Dispose: ${Z} failed:`,Oe,"...continuing")}}),this._disposed=!0}emitSessionEvent(H){this._session.sendEvent(H)}enqueueOutstandingCorrelatedReq(H,Z,te,ie,j){if(S.nothing(H))return;const{LOG_INFO:Oe}=this.logger;Oe(`Enqueue outstanding ctrl request correlationTag=${H}`);let v=null;Z&&(v=setTimeout(Z,te||this._sessionProperties.readTimeoutInMsecs));const P=new C(H,v,ie,j);this._correlatedReqs[H]=P}errorInFsm(H,Z,te=null){const{LOG_INFO:ie}=this.logger,j=new J({name:k.EXCEPTION});return ie(`Handling error in FSM: ${H} ${te&&te.stack}`),this.setCurrentError({eventText:H,errorSubcode:Z,eventReason:te}),this.processEvent(j)}flushTransportSession(H){this._transport?this._transport.flush(H):H()}getCorrelationTag(){return this._smfClient.nextCorrelationTag()}getCurrentStateName(){const H=this.getCurrentState();return H?H===this.getFinalState()?$.DISPOSED:this.getCurrentState().getName():null}getStat(H){if(this._sessionStatistics!==void 0)return H===B.TX_TOTAL_DATA_MSGS?this._sessionStatistics.getStat(B.TX_DIRECT_MSGS)+this._sessionStatistics.getStat(B.TX_PERSISTENT_MSGS)+this._sessionStatistics.getStat(B.TX_NONPERSISTENT_MSGS):H===B.TX_TOTAL_DATA_BYTES?this._sessionStatistics.getStat(B.TX_DIRECT_BYTES)+this._sessionStatistics.getStat(B.TX_PERSISTENT_BYTES)+this._sessionStatistics.getStat(B.TX_NONPERSISTENT_BYTES):this._sessionStatistics.getStat(H)}getTransportInfo(){return S.nothing(this._transport)?"Not connected.":this._transport.getInfoStr()}handleADCtrlMessage(H,Z){const te=H.getFlowId(),ie=Z.pm_respstr,j=Z.pm_corrtag,{LOG_INFO:Oe,LOG_DEBUG:v,LOG_WARN:P}=this.logger;if(j){this.updateRxStats(H),Oe(`Handle SMF response for correlationTag ${j}`);const de=this.cancelOutstandingCorrelatedReq(j);return S.nothing(de)?this.errorInFsm(`Cannot find matching request for response: ${ie}`,T.INTERNAL_ERROR):de.respRecvdCallback?(de.respRecvdCallback(H,de),this):(this.incStat(B.RX_REPLY_MSG_DISCARD),this)}let O;const U=H.msgType,{SMFAdProtocolMessageType:V}=l;switch(U){case V.CLIENTACK:case V.CLIENTNACK:case V.CLOSEPUBFLOW:this._defaultPublisher.flowId===te&&(O=this._defaultPublisher);break;default:O=this._consumers.getFlowById(te)}if(O&&!O.disposed)return this.updateRxStats(H,O),O.handleUncorrelatedControlMessage(H),this;const z=H.getResponse(),ne=z?`"${z.responseCode} ${z.responseString}" `:"";return P(`Dropping ADCTRL.${l.SMFAdProtocolMessageType.describe(H.msgType)} ${ne}for unknown flow ${te}`),this.incStat(B.RX_DISCARD_NO_MATCHING_CONSUMER),this}handleADTrMessage(H,Z){this.logger;const te=Z.pm_ad_flowid,ie=this._consumers.getFlowById(te);return!ie||ie.disposed?(this.updateRxStats(H,this._sessionStatistics),this.incStat(B.RX_DISCARD_NO_MATCHING_CONSUMER),null):(this.updateRxStats(H,ie),ie.handleDataMessage(H),ie)}handleApiSubscriptionTimeout(H,Z){if(this._correlatedReqs[H]===void 0||this._correlatedReqs[H]===null)return;const{LOG_INFO:te,LOG_ERROR:ie}=this.logger;te(`${Z||"Subscription timeout"} for correlationTag=${H}`);try{delete this._correlatedReqs[H]||ie(`Cannot delete ctrl request ${H}`)}catch(j){ie(`Cannot delete ctrl request ${H}, exception: ${j.message}`)}}handleClientCtrlMessage(H,Z){let te;const{LOG_INFO:ie}=this.logger;this.updateRxStats(H),H.msgType===l.SMFClientCtrlMessageType.LOGIN?(te=_.SMFClient.SMF_CLIENTCTRL_LOGIN_FAKE_CORRELATIONTAG,ie("Handle SMF response for ClientCTRL Login")):(te=Z.pm_corrtag,ie(`Handle SMF response for correlationTag ${te}`));const j=this.cancelOutstandingCorrelatedReq(te);if(S.nothing(j)){const Oe=Z.pm_respstr;return this.errorInFsm(`Cannot find matching request for response: ${Oe}`,T.INTERNAL_ERROR)}return j.respRecvdCallback?j.respRecvdCallback(H):(ie(`Dropping ClientCtrl message due to mismatched correlation tag ${te}`),this.incStat(B.RX_REPLY_MSG_DISCARD))}handleClientCtrlResponse(H){const Z=new J({name:k.TRANSPORT_PROTOCOL_CLIENTCTRL});Z.smfMsg=H,this.processEvent(Z)}handleClientCtrlTimeout(){const{LOG_INFO:H}=this.logger;H("ClientCtrl timeout for session");const Z=new J({name:k.DOWNGRADE_TIMEOUT});this.processEvent(Z)}handleConnectTimeout(){const{LOG_INFO:H}=this.logger;H("Connection timeout. Disconnecting");const Z=new J({name:k.CONNECT_TIMEOUT});this.processEvent(Z)}handleUpdatePropertyTimeout(H,Z){const{LOG_ERROR:te}=this.logger;try{delete this._correlatedReqs[H]||te(`Cannot delete ctrl request ${H}`)}catch(j){te(`Cannot delete ctrl request ${H}, exception: ${j.message}`)}const ie=W.build(x.PROPERTY_UPDATE_ERROR,Z,null,T.TIMEOUT,null,null);this.sendEvent(ie)}handleRejectedTrMessage(H){const Z=H.pm_respcode,te=H.pm_tr_topicname_bytes,ie=te?te.replace(/\0/g,""):"",j=H.pm_respstr,Oe=m.getErrorSubcode(Z,j);this.emitSessionEvent(W.build(x.REJECTED_MESSAGE_ERROR,j,Z,Oe,null,`Topic: ${ie}`))}handleSMFMessage(H){try{const Z=H.smfHeader;if(Z.discardMessage)return this._sessionStatistics&&this._sessionStatistics.incStat(B.RX_DISCARD_SMF_UNKNOWN_ELEMENT),null;switch(Z.smf_protocol){case l.SMFProtocol.TRMSG:return Z.smf_adf?this.handleADTrMessage(H,Z):(this.updateRxStats(H,this._sessionStatistics),Z.pm_respcode===0?this._session.handleDataMessage(H):this.handleRejectedTrMessage(Z));case l.SMFProtocol.ADCTRL:return this.handleADCtrlMessage(H,Z);case l.SMFProtocol.CLIENTCTRL:return this.handleClientCtrlMessage(H,Z);case l.SMFProtocol.SMP:return this.handleSMPMessage(H,Z);case l.SMFProtocol.KEEPALIVE:case l.SMFProtocol.KEEPALIVEV2:return null;default:return this.handleUnknownProtocolMessage(H,Z)}}catch(Z){const{LOG_ERROR:te}=this.logger;return te(`Exception in handleSMFMessage, exception: ${Z.stack}`),this.errorInFsm(`Exception in handleSMFMessage: ${Z.message}`,Z.subcode||T.INTERNAL_ERROR,Z)}}handleSMFParseError(H){return this.errorInFsm(H,T.PROTOCOL_ERROR)}handleSMPMessage(H,Z){this.updateRxStats(H);const te=this.cancelOutstandingCorrelatedReq(Z.pm_corrtag||"");if(S.nothing(te)||S.nothing(te.respRecvdCallback)){const ie=new J({name:k.TRANSPORT_PROTOCOL_SMP});return ie.smfMsg=H,this.processEvent(ie)}return te.respRecvdCallback(H,te)}handleSubscriptionUpdateError(H,Z,te,ie,j){const Oe=m.getErrorSubcode(H,Z);Oe!==T.SUBSCRIPTION_ALREADY_PRESENT&&Oe!==T.SUBSCRIPTION_NOT_FOUND&&this.removeFromSubscriptionCache(te),this._session.handleSubscriptionUpdateError(H,Z,te,ie,j)}handleSubscriptionTimeout(H){const{LOG_ERROR:Z}=this.logger;try{let ie=!1;this._correlatedReqs&&(ie=delete this._correlatedReqs[H]),ie||Z(`Cannot delete ctrl request ${H}`)}catch(ie){Z(`Cannot delete ctrl request ${H}`,ie)}const te=new J({name:k.SUBSCRIBE_TIMEOUT});this.processEvent(te)}handleTransportEvent(H){const{LOG_INFO:Z,LOG_WARN:te}=this.logger,ie=H.getInfoStr()||"";let j;switch(Z(`Receive transport event: ${H}`),H.getTransportEventCode()){case _.TransportSessionEventCode.UP_NOTICE:j=new J({name:k.TRANSPORT_UP}),j.sessionId=H.getSessionId(),this.processEvent(j);break;case _.TransportSessionEventCode.DESTROYED_NOTICE:j=new J({name:k.TRANSPORT_DESTROYED}),j.sessionId=H.getSessionId(),j.eventText=ie,j.errorSubcode=H.getSubcode(),j.eventReason=H,this._smfClient=null,this._transport=null,this.processEvent(j);break;case _.TransportSessionEventCode.CAN_ACCEPT_DATA:this.GuaranteedFlowControlledRelief(),j=new J({name:k.TRANSPORT_CAN_ACCEPT_DATA}),j.sessionId=H.getSessionId(),this.processEvent(j);break;case _.TransportSessionEventCode.SEND_ERROR:j=new J({name:k.SEND_ERROR}),j.sessionId=H.getSessionId(),j.eventText=H.getInfoStr(),j.errorSubcode=H.getSubcode(),j.eventReason=H,this.processEvent(j);break;case _.TransportSessionEventCode.DATA_DECODE_ERROR:case _.TransportSessionEventCode.PARSE_FAILURE:return this.errorInFsm(H.getInfoStr(),H.getSubcode());default:te("Received unknown transport session event",H)}return!0}handleUnknownProtocolMessage(H,Z){const{LOG_INFO:te,LOG_ERROR:ie}=this.logger;return this.updateRxStats(H),Z&&Z.smf_protocol===l.SMFProtocol.TSESSION?(ie(`Received transport session message instead of SMF message, protocol 0x${Ee(Z.smf_protocol)}`),ie(`Transport MessageType=${H.messageType}, target sessionId=${Ee(H.sessionId)}`),this.errorInFsm("Received message with unknown protocol",T.PARSE_FAILURE)):(this._sessionStatistics&&this._sessionStatistics.incStat(B.RX_DISCARD_SMF_UNKNOWN_ELEMENT),te(`Drop message with unknown protocol 0x${Ee(Z.smf_protocol)}`),null)}incStat(H,Z){return this._sessionStatistics?this._sessionStatistics.incStat(H,Z):void 0}initTransport(){const{LOG_INFO:H}=this.logger,Z=this._currentHost;H(`Creating transport session ${Z}`),this._kaStats={lastMsgWritten:0,lastBytesWritten:0},this._smfClient=new _.SMFClient(te=>this.handleSMFMessage(te),te=>this.handleSMFParseError(te),this),this._transport=_.TransportFactory.createTransport(Z,te=>this.handleTransportEvent(te),this._smfClient,this._sessionProperties.clone(),()=>this.sessionIdHex),this.injectTransportInterceptor(this._transportInterceptor)}injectTransportInterceptor(H){this._transportInterceptor=H,this._transport&&this._transport.setInterceptor(H)}keepAliveTimeout(){const{LOG_TRACE:H,LOG_DEBUG:Z,LOG_INFO:te}=this.logger;if(this._keepAliveCounter>=this._sessionProperties.keepAliveIntervalsLimit)return te(`Exceed maximum keep alive intervals limit ${this._sessionProperties.keepAliveIntervalsLimit}`),this._keepAliveTimer&&clearInterval(this._keepAliveTimer),this.errorInFsm("Exceed maximum keep alive intervals limit",T.KEEP_ALIVE_FAILURE);const ie=this._transport.getClientStats(),j=ie.msgWritten,Oe=ie.bytesWritten,v=new l.KeepAliveMessage;return this.send(v,null,!0)!==_.TransportReturnCode.OK?this.errorInFsm("Cannot send keep alive message",T.KEEP_ALIVE_FAILURE):(this._kaStats.lastMsgWritten===j&&this._kaStats.lastBytesWritten<Oe||(this._keepAliveCounter++,this._kaStats.lastMsgWritten,this._kaStats.lastBytesWritten),this._keepAliveCounter,this._kaStats.lastBytesWritten=ie.bytesWritten,this._kaStats.lastMsgWritten=ie.msgWritten,!0)}prepareAndSendMessage(H){const{LOG_WARN:Z,LOG_DEBUG:te}=this.logger;if(H instanceof D){let ie;if(this._sessionProperties.payloadCompressionLevel>0&&(S.anything(H._binaryAttachment)&&H._binaryAttachment.length>0||S.anything(H._structuredContainer))){let Oe,v=0;try{{const P={level:this._sessionProperties.payloadCompressionLevel,flush:Pe.Z_FINISH};if(S.anything(H.getSdtContainer())){const O=fe.encodeSingleElement(H.getSdtContainer()),U=Te(O);v=U.length,Oe=Pe.zlibSync(U,P)}else v=H._binaryAttachment.length,Oe=Pe.zlibSync(H._binaryAttachment,P);Oe=Te(Oe)}Oe.length+9<v?(H._setCompressedBinaryAttachment(Oe),S.nothing(H.getHttpContentEncoding())?H._compressedCE="deflate":H._compressedCE=H.getHttpContentEncoding()+", deflate"):Oe.length}catch(P){Z("Error occurred while compressing, message attachment was not compressed. Original attachment will be sent. ",P)}}const j=H.getDeliveryMode();switch(j){case Y.DIRECT:if(!this._transport)return;H._payload_is_memoized=!1,H._memoized_csumm=null,H._memoized_payload=null,ie=this.sendToTransport(H);break;case Y.PERSISTENT:case Y.NON_PERSISTENT:if(!this._defaultPublisher){const Oe=this._session.adLocallyDisabled?"locally disabled":"remotely unsupported";throw new y("Session does not provide Guaranteed Message Publish capability",T.GM_UNAVAILABLE,Oe)}this._gmSendDisallowed&&this._gmSendDisallowed(),ie=this._defaultPublisher.prepareAdMessageAndSend(H);break;default:{const{LOG_ERROR:Oe}=this.logger;Oe("Unhandled message delivery mode",Y.describe(j))}}if(S.anything(H._getCompressedBinaryAttachment())&&H._setCompressedBinaryAttachment(),delete H._compressedCE,ie!==_.TransportReturnCode.OK){if(ie===_.TransportReturnCode.NO_SPACE)throw this._userBackpressured=!0,new y("Cannot send message - no space in transport",T.INSUFFICIENT_SPACE,_.TransportReturnCode.describe(ie));this.setCurrentError(new y("Cannot send message",T.INVALID_OPERATION,_.TransportReturnCode.describe(ie))),this.processEvent(new J({name:k.EXCEPTION}))}}}GuaranteedFlowControlledRelief(){this._defaultPublisher&&this._defaultPublisher.processFSMEvent(new u.PublisherFSMEvent({name:u.PublisherFSMEventNames.CAN_SEND}))}reapplySubscriptions(){const{LOG_INFO:H,LOG_DEBUG:Z}=this.logger,{SolclientFactory:{createTopicDestination:te}}=d;if(H(`Reapplying subscriptions, count=${this._subscriptionCacheKeys.length}`),!this._subscriptionCacheKeys)return!0;try{for(;this._subscriptionCacheKeys.length;){const ie=this._subscriptionCacheKeys.shift(),j=this._subscriptionCacheKeys.length===0,Oe=te(ie),v=this.sendSubscribe(Oe,j,null,this._sessionProperties.readTimeoutInMsecs,null);v!==_.TransportReturnCode.OK&&this.errorInFsm(`Error occurred sending subscription: ${_.TransportReturnCode.describe(v)}`,T.INTERNAL_ERROR)}}catch(ie){if(ie instanceof y&&ie.subcode===T.INSUFFICIENT_SPACE)return!1;this.errorInFsm(`Unexpected expection occurred while reapplying subscriptions: ${ie}`,ie.subcode||T.INTERNAL_ERROR,ie)}return!0}removeFromSubscriptionCache(H){if(S.nothing(H)||!this._subscriptionCache)return null;const{LOG_DEBUG:Z,LOG_ERROR:te}=this.logger,ie=H instanceof g?H.name:H,j=this._subscriptionCache[ie];if(j==null)return null;try{delete this._subscriptionCache[ie]?this._subscriptionCacheCount--:te(`Cannot remove subscription ${ie}`)}catch(Oe){te(`Cannot remove subscription ${ie}`,Oe)}return j}reset(){this.resetStats(),this.sessionId=null,this._keepAliveTimer=null,this.resetKeepAliveCounter(),this._correlatedReqs={},this._disposed=!1,this._smfClient=null,this._kaStats={lastMsgWritten:0,lastBytesWritten:0},this._subscriptionCache=null,this._subscriptionCacheKeys=null,this._subscriptionCacheCount=0,this._sessionProperties.reapplySubscriptions&&(this._subscriptionCache={}),this._eventCode=null,this._responseCode=null,this.eventText=null,this.errorSubcode=null,this.eventReason=null}resetKeepAliveCounter(){this._keepAliveCounter=0}resetStats(){return this._sessionStatistics?this._sessionStatistics.resetStats():void 0}scheduleKeepAlive(){const{LOG_DEBUG:H,LOG_ERROR:Z}=this.logger,{keepAliveIntervalInMsecs:te}=this._sessionProperties;te!==0&&(this._keepAliveTimer&&clearInterval(this._keepAliveTimer),this._keepAliveTimer=setInterval(()=>{try{this.keepAliveTimeout()}catch(ie){Z("Error occurred in keepAliveTimeout",ie)}},te))}send(H,Z=this._sessionStatistics,te=!1){try{return this.sendToTransport(H,Z,te)}catch(ie){this.logger,ie.message,ie.stack,this.errorInFsm(`Send operation failed: ${ie.message}`,ie.subcode||T.CONNECTION_ERROR)}return _.TransportReturnCode.CONNECTION_ERROR}sendToTransport(H,Z=this._sessionStatistics,te=!1){let ie=_.TransportReturnCode.CONNECTION_ERROR;if(!this._transport)throw new y("Transport has been destroyed",T.INTERNAL_ERROR);const j=l.Codec.Encode.encodeCompoundMessage(H);switch(ie=this._transport.send(j,te),ie){case _.TransportReturnCode.OK:this.updateTxStats(H,Z);break;case _.TransportReturnCode.NO_SPACE:if(!te)break;default:throw new y(`Transport returned ${_.TransportReturnCode.describe(ie)}`,T.INTERNAL_ERROR)}return ie}sendClientCtrlLogin(){const{LOG_INFO:H,LOG_DEBUG:Z,LOG_TRACE:te}=this.logger;this._compressedTLS=this._sessionProperties.compressionLevel>0&&this._currentHost.match(/tcps:/i)!==null,this._plaintextTLS=this._currentHost.match(/tcps:/i)!==null&&this._sessionProperties.sslConnectionDowngradeTo===R.PLAINTEXT,this._plaintextTLS,this._compressedTLS;const ie=l.ClientCtrlMessage.getLogin(this._sessionProperties,this._compressedTLS,this._plaintextTLS),j=this.send(ie);if(j!==_.TransportReturnCode.OK)this._responseCode=null,this.eventReason=null,j===_.TransportReturnCode.NO_SPACE?(this.eventText="Cannot send client control - no space in transport",this.errorSubcode=T.INSUFFICIENT_SPACE):(H(`Cannot send client ctrl, return code
|
|
84
|
+
${_.TransportReturnCode.describe(j)}`),this.eventText="Cannot send client ctrl",this.errorSubcode=T.INVALID_OPERATION);else{const Oe=_.SMFClient.SMF_CLIENTCTRL_LOGIN_FAKE_CORRELATIONTAG;H(`Using internally correlationTag=${Oe} for tracking ClientCTRL Login`),this.enqueueOutstandingCorrelatedReq(Oe,null,null,null,v=>this.handleClientCtrlResponse(v))}return j}sendSubscribe(H,Z,te,ie,j){const{LOG_INFO:Oe,LOG_DEBUG:v}=this.logger;p(H instanceof g,"sendSubscribe requires a Destination, not a string");const P=this.getCorrelationTag(),O=l.SMPMessage.getSubscriptionMessage(P,H,!0,Z);p(O.encodedUtf8Subscription,"Encoded SMP message was invalid");const U=this.send(O);return U!==_.TransportReturnCode.OK?(Oe("Subscribe failed",_.TransportReturnCode.describe(U)),U):(Z&&this.enqueueOutstandingCorrelatedReq(P,()=>this.handleSubscriptionTimeout(P),ie||this._sessionProperties.readTimeoutInMsecs,te,j),U)}sendUpdateProperty(H,Z,te,ie,j){const Oe=this._smfClient.nextCorrelationTag(),v=l.ClientCtrlMessage.getUpdate(H,Z,Oe),P=this.send(v);return P!==_.TransportReturnCode.OK||this.enqueueOutstandingCorrelatedReq(Oe,()=>this.handleUpdatePropertyTimeout(Oe),ie||this._sessionProperties.readTimeoutInMsecs,te,j),P}provisionEndpoint(H,Z,te,ie){this.logger;const j=this._smfClient.nextCorrelationTag(),Oe=l.AdProtocolMessage.getCreate(H,Z,j),v=this.send(Oe);if(v!==_.TransportReturnCode.OK)return LOG_INFO("Provision failed",_.TransportReturnCode.describe(v)),v;this.enqueueOutstandingCorrelatedReq(j,null,0,te,ie)}deprovisionEndpoint(H,Z,te){this.logger;const ie=this._smfClient.nextCorrelationTag(),j=l.AdProtocolMessage.getDelete(H,ie),Oe=this.send(j);if(Oe!==_.TransportReturnCode.OK)return LOG_INFO("Deprovision failed",_.TransportReturnCode.describe(Oe)),Oe;this.enqueueOutstandingCorrelatedReq(ie,null,0,Z,te)}setClientCtrlTimer(){this.clearClientCtrlTimer(),this._clientCtrlTimer=setTimeout(()=>this.handleClientCtrlTimeout(),this._sessionProperties.transportDowngradeTimeoutInMsecs)}setConnectTimer(){this.clearConnectTimer(),this._connectTimer=setTimeout(()=>this.handleConnectTimeout(),this._sessionProperties.connectTimeoutInMsecs)}setCurrentError(H){const Z=this._currentError||{};this.logger,Object.keys(H).forEach(te=>H[te]!==null&&H[te]!==void 0&&(Z[te]!==null&&Z[te]!==void 0?(Z[te],H[te],!1):(Z[te]=H[te],!0))),this._currentError=Z}subscriptionUpdate(H,Z,te,ie,j,Oe,v){const P=this.checkSessionDestinationCapability(H);if(P)throw P;const O=se[j]||se.default,U=j!==F.REMOVE_DTE_SUBSCRIPTION,V=j===F.ADD_SUBSCRIPTION||j===F.ADD_P2PINBOX,z=this.getCorrelationTag(),ne=(U?l.SMPMessage.getSubscriptionMessage:l.AdProtocolMessage.getDTEUnsubscribeMessage)(z,H,V,Z),de=this.send(ne,void 0,Oe);return de!==_.TransportReturnCode.OK||(Z&&this.enqueueOutstandingCorrelatedReq(z,()=>this.handleApiSubscriptionTimeout(z,O),ie||this._sessionProperties.readTimeoutInMsecs,te,v),j===F.ADD_SUBSCRIPTION&&this._sessionProperties.reapplySubscriptions?this.addToSubscriptionCache(H):j===F.REMOVE_SUBSCRIPTION&&this._sessionProperties.reapplySubscriptions&&this.removeFromSubscriptionCache(H)),de}queueSubscriptionUpdate(H,Z,te,ie,j,Oe){const v=ie?se[F.ADD_SUBSCRIPTION]:se[F.REMOVE_SUBSCRIPTION],P=this.getCorrelationTag(),O=l.SMPMessage.getQueueSubscriptionMessage(P,H,Z,ie),U=this.send(O,void 0,j);return U!==_.TransportReturnCode.OK||this.enqueueOutstandingCorrelatedReq(P,()=>{const V=this._correlatedReqs[P];this.handleApiSubscriptionTimeout(P,v),Oe(null,V)},te||this._sessionProperties.readTimeoutInMsecs,null,Oe),U}updateRxStats(H,Z=this._sessionStatistics){if(!Z)return;const te=H.smfHeader;if(!te)return;const ie=te.pm_deliverymode||0,j=ee[ie],Oe=ae[ie],v=te.messageLength;switch(te.smf_protocol){case l.SMFProtocol.TRMSG:te.pm_respcode===0&&(Z.incStat(B.RX_TOTAL_DATA_MSGS),Z.incStat(j),Z.incStat(B.RX_TOTAL_DATA_BYTES,v),Z.incStat(Oe,v),te.smf_di&&Z.incStat(B.RX_DISCARD_MSG_INDICATION));break;case l.SMFProtocol.CLIENTCTRL:case l.SMFProtocol.SMP:case l.SMFProtocol.KEEPALIVE:case l.SMFProtocol.KEEPALIVEV2:case l.SMFProtocol.ADCTRL:Z.incStat(B.RX_CONTROL_MSGS),Z.incStat(B.RX_CONTROL_BYTES,v)}}updateTxStats(H,Z=this._sessionStatistics){if(!Z)return;H.getReplyTo!==void 0&&H.getReplyTo()&&Z.incStat(B.TX_REQUEST_SENT);const te=H.smfHeader;if(!te)return;const ie=te.pm_deliverymode||0;let j=X[ie],Oe=ge[ie];ie!==Y.DIRECT&&H.isRedelivered()&&(j=Re[ie],Oe=me[ie]);const v=te.messageLength;switch(te.smf_protocol){case l.SMFProtocol.TRMSG:Z.incStat(j),Z.incStat(Oe,v);break;case l.SMFProtocol.CLIENTCTRL:case l.SMFProtocol.SMP:case l.SMFProtocol.KEEPALIVE:case l.SMFProtocol.KEEPALIVEV2:case l.SMFProtocol.ADCTRL:Z.incStat(B.TX_CONTROL_MSGS),Z.incStat(B.TX_CONTROL_BYTES,v)}}updateReadonlySessionProps(H){const Z=this._sessionProperties;Z._setVpnNameInUse(H.getVpnNameInUseValue()||"");const te=Z.virtualRouterName,ie=H.getVridInUseValue()||"";Z._setVirtualRouterName(ie),te!==""&&te!==ie&&this.handleVirtualRouterNameChange(te,ie),Z._setP2pInboxBase(H.getP2PTopicValue()||""),Z._setP2pInboxInUse(Q.getP2PInboxTopic(Z.p2pInboxBase)),this._session.updateCapabilities(H.getRouterCapabilities());const j=this._session._getCapability(f.GUARANTEED_MESSAGE_PUBLISH);this._gmSendDisallowed=typeof j!="boolean"||j?null:()=>{throw new y("Sending guaranteed message is not allowed by router for this client",T.INVALID_OPERATION,null)}}handleVirtualRouterNameChange(H,Z){this._consumers&&(this._consumers.flows.forEach(te=>te.onVRNChanged()),this._consumers.reconnectingFlows.forEach(te=>te.onVRNChanged())),this.emitSessionEvent(W.build(x.VIRTUALROUTER_NAME_CHANGED,`Virtual router name is changed from ${H} to ${Z}`,null,0,null,null))}get sessionIdHex(){return this.sessionId&&Ee(this.sessionId)||"N/A"}updateTransportCompression(H){return this.logger,this._plaintextTLS,this._compressedTLS,this._plaintextTLS?(_.TransportFactory.severTls(this._transport,this._compressedTLS,H),null):this._compressedTLS?_.TransportFactory.startCompression(this._transport):this._transport}}},1663:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SessionOperation=a.new({CONNECT:"CONNECT",DISCONNECT:"DISCONNECT",CTRL:"CTRL",SEND:"SEND",QUERY_OPERATION:"QUERY_OPERATION"})},9727:(o,h,r)=>{const a=r(5898),u=(r(9656),r(3450)),{APIPropertiesValidators:l,parseURL:d}=r(968),{AuthenticationScheme:_}=r(3399),{Check:p}=r(802),{ErrorSubcode:f,OperationError:S}=r(6706),{LOG_WARN:C,LOG_INFO:g}=r(2694);r(6415);const{TransportProtocol:m}=r(8205),{validateInstance:T,valArrayIsMember:y,valArrayOfString:E,valBoolean:I,valLength:N,valNotEmpty:A,valNumber:L,valRange:D,valString:q,valStringOrArray:Y}=l,Q=["http:","https:","ws:","wss:","tcp:","tcps:"];function W($,R,B){const M=u.ClientCtrlMessage.validateClientName(R[B],re=>new S(`${$} validation: Property '${B}': ${re}`,f.PARAMETER_OUT_OF_RANGE));if(M)throw M}function x($,R,B,M,re,se){const fe=R[B];if(!(se&&fe===null||fe===void 0||M.values.some(ce=>ce===fe)))throw new S(`${$} validation: Property '${B}' must be a member of ${re}`,f.PARAMETER_INVALID_TYPE)}function k($,R,B){const M=R[B],re=typeof M=="string"?M.split(","):M;if(!p.array(re))throw new S(`${$} validation: Property '${B}' not an array or comma-delimited string`,f.PARAMETER_INVALID_TYPE);re.forEach(se=>{let fe=null;try{fe=d(se)}catch{throw new S(`${$} validation: Property '${B}' contained an invalid URL: ${se}`,f.PARAMETER_OUT_OF_RANGE)}if(!p.included(fe.protocol,Q))throw new S(`${$} validation: Property '${B}' contained a URL'${fe.href}' with an invalid protocol: '${fe.protocol}'`,f.PARAMETER_OUT_OF_RANGE)})}function J($,R,B){return function(M,re,se,fe){const ce=M[re];if(ce instanceof Array){const Te=ce.length;for(let Ee=0;Ee<Te;Ee++){const he=ce[Ee];if(!p.string(he)||!he.match(se))return!1}return!0}return p.string(ce)&&ce.match(se)}($,R,/^(https|wss|tcps):/i)}const F={validate($){const R=T.bind(null,"SessionProperties",$);if(R("url",[A],[Y],[k]),R("userName",[q],[N,189]),R("password",[q],[N,128]),R("clientName",[q],[N,160],[W]),R("applicationDescription",[q],[N,254]),R("vpnName",[q],[N,32]),R("connectTimeoutInMsecs",[L],[D,1,Number.MAX_VALUE]),R("connectRetriesPerHost",[L],[D,-1,Number.MAX_VALUE]),R("connectRetries",[L],[D,-1,Number.MAX_VALUE]),R("reconnectRetries",[L],[D,-1,Number.MAX_VALUE]),R("reconnectRetryWaitInMsecs",[L],[D,0,6e4]),R("readTimeoutInMsecs",[L],[D,1,Number.MAX_VALUE]),R("sendBufferMaxSize",[L],[D,1,Number.MAX_VALUE]),R("maxWebPayload",[L],[D,100,Number.MAX_VALUE]),R("bufferedAmountQueryIntervalInMsecs",[L],[D,4,Number.MAX_VALUE]),R("generateSendTimestamps",[I]),R("generateReceiveTimestamps",[I]),R("includeSenderId",[I]),R("keepAliveIntervalInMsecs",[L],[D,0,Number.MAX_VALUE]),R("keepAliveIntervalsLimit",[L],[D,3,Number.MAX_VALUE]),R("generateSequenceNumber",[I]),R("subscriberLocalPriority",[L],[D,1,4]),R("subscriberNetworkPriority",[L],[D,1,4]),R("ignoreDuplicateSubscriptionError",[I]),R("ignoreSubscriptionNotFoundError",[I]),R("reapplySubscriptions",[I]),R("noLocal",[I]),R("transportDowngradeTimeoutInMsecs",[L],[D,1,Number.MAX_VALUE]),R("idToken",[q]),R("accessToken",[q]),R("payloadCompressionLevel",[L],[D,0,9]),$.transportProtocol&&$.webTransportProtocolList)throw new S("SessionProperties validation: Property 'transportProtocol' and 'webTransportProtocolList' cannot be set at the same time",f.PARAMETER_OUT_OF_RANGE);if($.webTransportProtocolList!==null&&$.webTransportProtocolList!==void 0){if(!Array.isArray($.webTransportProtocolList))throw new S("Property 'webTransportProtocolList' must be an array if set",f.PARAMETER_INVALID_TYPE);if($.webTransportProtocolList.length===0)throw new S("Property 'webTransportProtocolList' must be non-empty if set",f.PARAMETER_OUT_OF_RANGE)}R("authenticationScheme",[x,_,"AuthenticationScheme",!1]);const B=$.authenticationScheme===_.CLIENT_CERTIFICATE;if(!J($,"url")&&B)throw new S("SessionProperties validation: Property 'authenticationScheme' cannot be set to client certificate for unsecured sessions",f.PARAMETER_OUT_OF_RANGE);if(p.equal($.authenticationScheme,_.OAUTH2)){if(!J($,"url"))throw new S(`SessionProperties validation: Property 'authenticationScheme' cannot be set to '${_.OAUTH2}' unless the session property 'url' is written to use a secure communication protocol like tcps or https.`,f.PARAMETER_CONFLICT);if(p.empty($.idToken)&&p.empty($.accessToken))throw new S(`SessionProperties validation: Property 'authenticationScheme' can be set to '${_.OAUTH2}' only if there is an accompanying token set as a session property. The token types that are supported for OAuth authentication are OAuth2.0 Access Tokens and OpenID Connect ID Tokens. To set an access token you can use the accessToken session property. To set an id you can use the idToken session property.`,f.PARAMETER_CONFLICT)}else p.empty($.idToken)&&p.empty($.accessToken)||g(`SessionProperties validation: Property 'authenticationScheme' must be set to '${_.OAUTH2}'in order to use either an OAUTH2 access token or an OpenID Connect ID token.`);R("transportProtocol",[x,m,"TransportProtocol",!0]),R("webTransportProtocolList",[y,m,"TransportProtocol",!0,!1,!1]),function(se,fe){if(fe.length>0&&function(ce){return ce&&(ce===m.HTTP_BINARY_STREAMING||ce===m.HTTP_BINARY||ce===m.HTTP_BASE64)}(se)){const ce=fe.length<=5?fe:fe.slice(0,5);throw new S(`SessionProperties validation: properties that are not supported by transport protocol ${se} have been set: ${ce}`,f.PARAMETER_OUT_OF_RANGE)}}($.transportProtocol,$.nonHTTPTransportPropsSet),$.publisherProperties&&a.MessagePublisherPropertiesValidator.validate($.publisherProperties);const M=$.defaultConnectTimeoutInMsecs,re=$.connectTimeoutInMsecs;($.webTransportProtocolList?$.webTransportProtocolList.length:1)>1&&re<M&&C(`Connect timeout of ${re} msecs is less than default and recommended minimum of ${M} msecs for current transport selection. Transport downgrades may not complete.`)}};o.exports.SessionPropertiesValidator=F},9656:(o,h,r)=>{r(5837);const a=r(5898),{APIProperties:u}=r(968),{AuthenticationScheme:l}=r(3399),{Check:d}=r(802),{LOG_WARN:_}=r(2694);r(6415);const p=class extends u{get transportProtocol(){return d.nothing(this._tpProtocol)?null:this._tpProtocol}set transportProtocol(f){this._tpProtocol=f}get transportDowngradeTimeoutInMsecs(){return d.nothing(this._tpDowngradeTimeout)?3e3:this._tpDowngradeTimeout}set transportDowngradeTimeoutInMsecs(f){this._tpDowngradeTimeout=f}get webTransportProtocolList(){return d.nothing(this._transportProtocolList)?null:this._transportProtocolList}set webTransportProtocolList(f){this._transportProtocolList=f}get bufferedAmountQueryIntervalInMsecs(){return d.nothing(this._bufferedAmountQueryInterval)?100:this._bufferedAmountQueryInterval}set bufferedAmountQueryIntervalInMsecs(f){this._bufferedAmountQueryInterval=f}get transportProtocolInUse(){return this._tpProtocolInUse||null}_setTransportProtocolInUse(f){this._tpProtocolInUse=f}get webTransportProtocolInUse(){return this._tpProtocolInUse||null}_setWebTransportProtocolInUse(f){this._tpProtocolInUse=f}get transportContentType(){return this._tpContentType||"text/plain"}set transportContentType(f){this._tpContentType=f}_lendsInspect(){return{bufferedAmountQueryIntervalInMsecs:this.bufferedAmountQueryIntervalInMsecs,transportContentType:this.transportContentType,transportDowngradeTimeoutInMsecs:this.transportDowngradeTimeoutInMsecs,transportProtocol:this.transportProtocol,transportProtocolInUse:this.transportProtocolInUse,webTransportProtocolList:this.webTransportProtocolList}}};o.exports.SessionProperties=class extends p{constructor(f){super(function(){const{MessagePublisherProperties:S}=a;return{_vpnNameInUse:"",_virtualRouterName:"",_p2pInboxInUse:"",_p2pInboxBase:"",_userIdentification:"",_tpProtocolInUse:null,_tpContentType:"text/plain",_publisherProperties:new S,_payloadCompressionLevel:0}}(),f)}get authenticationScheme(){return d.nothing(this._authScheme)?l.BASIC:this._authScheme}set authenticationScheme(f){this._authScheme=f}get accessToken(){return d.empty(this._accessToken)?"":this._accessToken}set accessToken(f){this._accessToken=f}get idToken(){return d.empty(this._idToken)?"":this._idToken}set idToken(f){this._idToken=f}get issuerIdentifier(){return d.empty(this._issuerIdentifier)?"":this._issuerIdentifier}set issuerIdentifier(f){d.type(f,"string")?d.empty(f)?_("Failed to set the issuer identifier because the passed string was empty or null. The passed issuer identifier must not be empty or null. Setting issuer identifier to default value empty string."):this._issuerIdentifier=f:(_("Failed to set issuer identifier because the pased value was not of type String. The passed issuer identifier must be of type String. Setting issuer identifier to default value empty string."),this._issuerIdentifier="")}get url(){return d.nothing(this._url)?"":this._url}set url(f){this._url=f}get password(){return d.nothing(this._password)?"":this._password}set password(f){this._password=f}get userName(){return d.nothing(this._userName)?"":this._userName}set userName(f){this._userName=f}get clientName(){return d.nothing(this._clientName)?"":this._clientName}set clientName(f){this._clientName=f}get applicationDescription(){return d.nothing(this._appDesc)?"":this._appDesc}set applicationDescription(f){this._appDesc=f}get vpnName(){return d.nothing(this._vpnName)?"":this._vpnName}set vpnName(f){this._vpnName=f}get vpnNameInUse(){return d.nothing(this._vpnNameInUse)?"":this._vpnNameInUse}_setVpnNameInUse(f){this._vpnNameInUse=f}get virtualRouterName(){return d.nothing(this._virtualRouterName)?"":this._virtualRouterName}_setVirtualRouterName(f){this._virtualRouterName=f}get connectTimeoutInMsecs(){return d.nothing(this._connectTimeout)?this.defaultConnectTimeoutInMsecs:this._connectTimeout}set connectTimeoutInMsecs(f){this._connectTimeout=f}get defaultConnectTimeoutInMsecs(){const{webTransportProtocolList:f,transportDowngradeTimeoutInMsecs:S}=this,C=f?f.length:1,g=C*S+(C>1?1e3:0);return Math.max(8e3,g)}get connectRetries(){return d.nothing(this._connectRetries)?20:this._connectRetries}set connectRetries(f){this._connectRetries=f}get connectRetriesPerHost(){return d.nothing(this._connectRetriesPerHost)?0:this._connectRetriesPerHost}set connectRetriesPerHost(f){this._connectRetriesPerHost=f}get reconnectRetryWaitInMsecs(){return d.nothing(this._reconnectRetryWaitInMsecs)?3e3:this._reconnectRetryWaitInMsecs}set reconnectRetryWaitInMsecs(f){this._reconnectRetryWaitInMsecs=f}get reconnectRetries(){return d.nothing(this._reconnectRetries)?20:this._reconnectRetries}set reconnectRetries(f){this._reconnectRetries=f}get generateSendTimestamps(){return!d.nothing(this._genSendTimestamps)&&this._genSendTimestamps}set generateSendTimestamps(f){this._genSendTimestamps=f}get generateReceiveTimestamps(){return!d.nothing(this._genReceiveTimestamps)&&this._genReceiveTimestamps}set generateReceiveTimestamps(f){this._genReceiveTimestamps=f}get includeSenderId(){return!d.nothing(this._includeSenderId)&&this._includeSenderId}set includeSenderId(f){this._includeSenderId=f}get generateSequenceNumber(){return!d.nothing(this._genSequenceNumber)&&this._genSequenceNumber}set generateSequenceNumber(f){this._genSequenceNumber=f}get keepAliveIntervalInMsecs(){return d.nothing(this._kaInterval)?3e3:this._kaInterval}set keepAliveIntervalInMsecs(f){this._kaInterval=f}get keepAliveIntervalsLimit(){return d.nothing(this._kaIntervalsLimit)?3:this._kaIntervalsLimit}set keepAliveIntervalsLimit(f){this._kaIntervalsLimit=f}get p2pInboxInUse(){return d.nothing(this._p2pInboxInUse)?"":this._p2pInboxInUse}_setP2pInboxInUse(f){this._p2pInboxInUse=f}get p2pInboxBase(){return d.nothing(this._p2pInboxBase)?"":this._p2pInboxBase}_setP2pInboxBase(f){this._p2pInboxBase=f}get userIdentification(){return d.nothing(this._userIdentification)?"":this._userIdentification}_setUserIdentification(f){this._userIdentification=f}get subscriberLocalPriority(){return d.nothing(this._subLocalPriority)?1:this._subLocalPriority}set subscriberLocalPriority(f){this._subLocalPriority=f}get subscriberNetworkPriority(){return d.nothing(this._subNetworkPriority)?1:this._subNetworkPriority}set subscriberNetworkPriority(f){this._subNetworkPriority=f}get ignoreDuplicateSubscriptionError(){return!!d.nothing(this._ignoreDupSubError)||this._ignoreDupSubError}set ignoreDuplicateSubscriptionError(f){this._ignoreDupSubError=f}get ignoreSubscriptionNotFoundError(){return!!d.nothing(this._ignoreSubNotFoundError)||this._ignoreSubNotFoundError}set ignoreSubscriptionNotFoundError(f){this._ignoreSubNotFoundError=f}get reapplySubscriptions(){return!d.nothing(this._reapplySubcriptions)&&this._reapplySubcriptions}set reapplySubscriptions(f){this._reapplySubcriptions=f}get publisherProperties(){return this._publisherProperties}set publisherProperties(f){const{MessagePublisherProperties:S}=a;this._publisherProperties=f instanceof S?f:new S(f)}get noLocal(){return!d.nothing(this._noLocal)&&this._noLocal}set noLocal(f){this._noLocal=f}get readTimeoutInMsecs(){return d.nothing(this._readTimeout)?1e4:this._readTimeout}set readTimeoutInMsecs(f){this._readTimeout=f}get sendBufferMaxSize(){return d.nothing(this._sendBufferMaxSize)?65536:this._sendBufferMaxSize}set sendBufferMaxSize(f){this._sendBufferMaxSize=f}get assumedMaxAdSize(){return d.nothing(this._assumedMaxAdSize)?3e7:this._assumedMaxAdSize}set assumedMaxAdSize(f){this._assumedMaxAdSize=f}get maxWebPayload(){return d.nothing(this._maxWebPayload)?1048576:this._maxWebPayload}set maxWebPayload(f){this._maxWebPayload=f}get nonHTTPTransportPropsSet(){return[].filter(f=>d.something(this[f]))}get payloadCompressionLevel(){return d.nothing(this._payloadCompressionLevel)?0:this._payloadCompressionLevel}set payloadCompressionLevel(f){this._payloadCompressionLevel=f}inspect(){return Object.assign(this._lendsInspect(),{authenticationScheme:l.describe(this.authenticationScheme),accessToken:this.accessToken?"*****":"Not Set",idToken:this.idToken?"*****":"Not Set",issuerIdentifier:this.issuerIdentifier?"*****":"Not Set",url:this.url,password:this.password?"*****":this.password,userName:this.userName,clientName:this.clientName,applicationDescription:this.applicationDescription,vpnName:this.vpnName,vpnNameInUse:this.vpnNameInUse,virtualRouterName:this.virtualRouterName,connectTimeoutInMsecs:this.connectTimeoutInMsecs,connectRetries:this.connectRetries,connectRetriesPerHost:this.connectRetriesPerHost,reconnectRetryWaitInMsecs:this.reconnectRetryWaitInMsecs,reconnectRetries:this.reconnectRetries,generateSendTimestamps:this.generateSendTimestamps,generateReceiveTimestamps:this.generateReceiveTimestamps,includeSenderId:this.includeSenderId,generateSequenceNumber:this.generateSequenceNumber,keepAliveIntervalInMsecs:this.keepAliveIntervalInMsecs,keepAliveIntervalsLimit:this.keepAliveIntervalsLimit,p2pInboxInUse:this.p2pInboxInUse,p2pInboxBase:this.p2pInboxBase,userIdentification:this.userIdentification,subscriberLocalPriority:this.subscriberLocalPriority,subscriberNetworkPriority:this.subscriberNetworkPriority,ignoreDuplicateSubscriptionError:this.ignoreDuplicateSubscriptionError,reapplySubscriptions:this.reapplySubscriptions,publisherProperties:this.publisherProperties,noLocal:this.noLocal,readTimeoutInMsecs:this.readTimeoutInMsecs,sendBufferMaxSize:this.sendBufferMaxSize,maxWebPayload:this.maxWebPayload,payloadCompressionLevel:this.payloadCompressionLevel})}toString(){return super.toString()}}},168:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SessionRequestType=a.new({ADD_SUBSCRIPTION:0,REMOVE_SUBSCRIPTION:1,ADD_P2PINBOX:2,REMOVE_P2PINBOX:3,REMOVE_DTE_SUBSCRIPTION:100})},6057:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SessionStateName=a.new({DISCONNECTED:"SessionDisconnected",CONNECTING:"SessionConnecting",WAITING_FOR_TRANSPORT:"WaitingForTransport",WAITING_FOR_TRANSPORT_UP:"WaitingForTransportUp",WAITING_FOR_LOGIN:"WaitingForLogin",TRANSPORT_UP:"SessionTransportUp",FULLY_CONNECTED:"SessionFullyConnected",SESSION_ERROR:"SessionError",DISCONNECTING:"SessionDisconnecting",REAPPLYING_SUBSCRIPTIONS:"ReapplyingSubscriptions",WAITING_FOR_PUBFLOW:"WaitingForMessagePublisher",DISPOSED:"SessionDisposed",WAITING_FOR_SUBCONFIRM:"WaitForSubConfirm",WAITING_FOR_CAN_ACCEPT_DATA:"WaitForCanAcceptData",DISCONNECTING_FLOWS:"DisconnectingFlows",FLUSHING_TRANSPORT:"FlushingTransport",DESTROYING_TRANSPORT:"DestroyingTransport",RECONNECTING:"Reconnecting",TRANSPORT_FAIL:"TransportFail",WAITING_FOR_INTERCONNECT_TIMEOUT:"WaitingForInterconnectTimeout",WAITING_FOR_DNS:"WaitingForDNS",WAITING_FOR_TRANSPORT_CHANGE:"WaitingForTransportChange"})},3183:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SessionState=a.new({CONNECTING:1,CONNECTED:2,SESSION_ERROR:3,DISCONNECTING:4,DISCONNECTED:5})},9564:(o,h,r)=>{var a=r(2195);const u=r(9620),l=r(6247),d=r(4386),{assert:_}=r(7444),{CacheSession:p,CACHE_REQUEST_PREFIX:f}=r(2689),{CapabilityType:S}=r(2484),{Check:C,Parameter:g}=r(802),{DefaultCapabilities:m}=r(6472),{ErrorResponseSubcodeMapper:T,ErrorSubcode:y,OperationError:E,NotImplementedError:I,RequestEventCode:N}=r(6706),{EventEmitter:A}=r(3385),{GlobalContext:L}=r(343),{HostList:D}=r(7405),{LogFormatter:q}=r(2694),{MessageRxCBInfo:Y}=r(2299),{MutableSessionProperty:Q}=r(7113),{OutstandingDataRequest:W}=r(7105),{P2PUtil:x}=r(7603),{QueueDescriptor:k,QueueProperties:J,QueuePropertiesValidator:F,QueueType:$,explainInvalidEndpointName:R}=r(9631),{SDTField:B,SDTFieldType:M}=r(769),{SessionEvent:re}=r(8229),{ProvisionEvent:se}=r(918),{SessionEventCBInfo:fe}=r(5256),{SessionEventCode:ce}=r(6334),{SessionEventName:Te}=r(6324),{SessionFSM:Ee}=r(43),{SessionFSMEvent:he}=r(1122),{SessionOperation:ge}=r(1663),{SessionProperties:X}=r(9656),{SessionPropertiesValidator:ae}=r(9727),{SessionRequestType:ee}=r(168),{SessionState:Re}=r(3183),{SessionStateName:me}=r(6057),{Stats:Pe,StatType:H}=r(5747),{StringUtils:Z}=r(968),{TransportCapabilities:te,TransportProtocol:ie,TransportReturnCode:j}=r(8205);function Oe(O){return O&&O!==ie.HTTP_BINARY_STREAMING&&O!==ie.HTTP_BINARY&&O!==ie.HTTP_BASE64}function v(O){return`SessionEventCode.${ce.describe(O)}`}const P="#REQ";o.exports.Session=class extends A{constructor(O,U,V){super({emits:ce.values,direct:ce.MESSAGE,formatEventName:v});const z=this;this.logger=new q,this.logger.formatter=function(...de){return[`[session=${z._sessionFSM?z._sessionFSM.sessionIdHex:"(N/A)"}]`,...de]},this.logger,O!=null&&this.logger,this.on("error",de=>{const{LOG_ERROR:_e}=z.logger;_e(de.info.error)});const ne=new X(O);if(this.logger,this._messageCallbackInfo=this.wrapMessageCallback(U),this._eventCallbackInfo=this.wrapEventCallback(V),C.empty(ne.clientName)&&(ne.clientName=L.GenerateClientName()),ne._setUserIdentification(L.GenerateUserIdentification()),C.empty(ne.applicationDescription)&&(ne.applicationDescription=L.GenerateClientDescription()),ae.validate(ne),C.nothing(ne.webTransportProtocolList)){const de=ne.transportProtocol,_e=function(){const{ProfileBinding:Se}=d,Ce=[];return te.web.webSocket()&&Ce.push(ie.WS_BINARY),Se.value.cometEnabled&&(te.web.xhrBinary()&&(te.web.streaming()&&Ce.push(ie.HTTP_BINARY_STREAMING),Ce.push(ie.HTTP_BINARY)),Ce.push(ie.HTTP_BASE64)),Ce}(),we=de?_e.indexOf(de):0;if(we<0)throw new E(`Selected transport protocol ${ie.describe(de)} is disabled or invalid for this platform`,y.PARAMETER_CONFLICT);if(ne.webTransportProtocolList=_e.slice(we),ne.webTransportProtocolList.length===0)throw new E(`No usable transport protocol or fallback from ${ie.describe(de)}`,y.PARAMETER_CONFLICT);const oe=ne.webTransportProtocolList.filter(Se=>Oe(Se));if(oe.length===0&&(this._adDisabledReason=`Guaranteed messaging not compatible with any available transport protocol: ${ne.webTransportProtocolList.map(Se=>ie.describe(Se)).join(", ")}`),ne.publisherProperties.enabled){if(this._adDisabledReason)throw new E("Invalid transport protocol(s) for session with Guaranteed Messaging Publisher",y.PARAMETER_CONFLICT,this._adDisabledReason);ne.webTransportProtocolList=oe}}else{const de=ne.webTransportProtocolList;if(!de.every(Oe)){const _e=de.filter(we=>!Oe(we));if(this._adDisabledReason=`Guaranteed messaging incompatible with selected transport protocols: ${_e.map(we=>ie.describe(we)).join(", ")}`,ne.publisherProperties.enabled)throw new E("Invalid transport protocol(s) for session with Guaranteed Messaging Publisher",y.PARAMETER_CONFLICT,this._adDisabledReason)}}this._sessionProperties=ne,this._sessionStats=new Pe,this._hosts=new D(ne),this._sessionFSM=new Ee(this._sessionProperties,this,this._sessionStats,this._hosts),this._sessionFSM.start(),this._sessionFSM.createMessagePublisher(),this._outstandingDataReqs={},this._capabilities=m.createDefaultCapabilities(ne),this._seqNum=1}connect(){this.logger;const O=this.allowOperation(ge.CONNECT);if(O)throw new E(O,y.INVALID_OPERATION,null);const U=new he({name:Te.CONNECT});this._sessionFSM.processEvent(U)}get canAck(){return[me.CONNECTING,me.TRANSPORT_UP,me.DISCONNECTING].some(O=>!!this._sessionFSM.getActiveState(O))}disconnect(){this.logger;const O=this.allowOperation(ge.DISCONNECT);if(O)throw new E(O,y.INVALID_OPERATION,null);const U=new he({name:Te.DISCONNECT});this._sessionFSM.processEvent(U)}dispose(){this.logger,this._disposed||setTimeout(()=>{this._sessionFSM.processEvent(new he({name:Te.DISPOSE})),this._sessionFSM.terminateFsm(),this.disableEmitter(),this._disposed=!0},0)}subscribe(O,U,V,z){this.logger,O&&O.toString&&O.toString();const ne=this.allowOperation(ge.CTRL);if(ne)throw new E(ne,y.INVALID_OPERATION,null);if(g.isInstanceOf("topic",O,u.Destination),O.validate(),O.getType()!==u.DestinationType.TOPIC)throw new E(`Topic is required for subscribe; ${u.DestinationType.describe(O.getType())}`,y.INVALID_TOPIC_SYNTAX);g.isBooleanOrNothing("requestConfirmation",U),g.isNumberOrNothing("requestTimeout",z),g.isRangeCompareOrNothing("requestTimeout",z,">",0);const de=this._sessionFSM.subscriptionUpdate(O,!!U,V,z,ee.ADD_SUBSCRIPTION,!1,(we,oe)=>this.handleSubscriptionUpdateResponse(we,oe,U)),_e=r(8205);if(de===_e.TransportReturnCode.NO_SPACE)throw new E("Cannot send subscription request - no space in transport. Please try again later (on CAN_ACCEPT_DATA)",y.INSUFFICIENT_SPACE,_e.TransportReturnCode.describe(de));if(de!==_e.TransportReturnCode.OK)throw new E("Cannot send subscription request - transport error.",y.COMMUNICATION_ERROR,_e.TransportReturnCode.describe(de));return de}updateQueueSubscription(O,U,V,z,ne,de){this.logger,O&&O.toString&&O.toString(),U&&U.toString&&U.toString();const _e=this.allowOperation(ge.CTRL);if(_e)throw new E(_e,y.INVALID_OPERATION,null);if(g.isInstanceOf("topic",O,u.Destination),O.validate(),O.getType()!==u.DestinationType.TOPIC)throw new E(`Topic is required for queue subscribe; ${u.DestinationType.describe(O.getType())}`,y.INVALID_TOPIC_SYNTAX);if(g.isInstanceOf("queue",U,u.Destination),U.validate(),U.getType()!==u.DestinationType.QUEUE&&U.getType()!==u.DestinationType.TEMPORARY_QUEUE)throw new E(`Queue is required for queue subscribe; ${u.DestinationType.describe(U.getType())}`,y.PARAMETER_INVALID_TYPE);g.isNumberOrNothing("requestTimeout",de),g.isRangeCompareOrNothing("requestTimeout",de,">",0);const we=this._sessionFSM.queueSubscriptionUpdate(O,U,de,V,!1,(Se,Ce)=>this.handleQueueSubscriptionUpdateResponse(Se,Ce,ne)),oe=r(8205);if(we===oe.TransportReturnCode.NO_SPACE)throw new E("Cannot send subscription request - no space in transport. Please try again later (on CAN_ACCEPT_DATA)",y.INSUFFICIENT_SPACE,oe.TransportReturnCode.describe(we));if(we!==oe.TransportReturnCode.OK)throw new E("Cannot send subscription request - transport error.",y.COMMUNICATION_ERROR,oe.TransportReturnCode.describe(we));return we}unsubscribe(O,U,V,z){this.logger,O&&O.toString&&O.toString();const ne=this.allowOperation(ge.CTRL);if(ne)throw new E(ne,y.INVALID_OPERATION,null);if(g.isInstanceOf("topic",O,u.Destination),O.validate(),O.getType()!==u.DestinationType.TOPIC)throw new E(`Topic is required for unsubscribe; ${u.DestinationType.describe(O.getType())}`,y.INVALID_TOPIC_SYNTAX);g.isBooleanOrNothing("requestConfirmation",U),g.isNumberOrNothing("requestTimeout",z),g.isRangeCompareOrNothing("requestTimeout",z,">",0);const de=this._sessionFSM.subscriptionUpdate(O,!!U,V,z,ee.REMOVE_SUBSCRIPTION,!1,(we,oe)=>this.handleSubscriptionUpdateResponse(we,oe,U)),_e=r(8205);if(de===_e.TransportReturnCode.NO_SPACE)throw new E("Cannot send unsubscribe request - no space in transport. Please try again later (on CAN_ACCEPT_DATA)",y.INSUFFICIENT_SPACE,_e.TransportReturnCode.describe(de));if(de!==_e.TransportReturnCode.OK)throw new E("Cannot send unsubscribe request - transport error.",y.COMMUNICATION_ERROR,_e.TransportReturnCode.describe(de));return de}unsubscribeDurableTopicEndpoint(O){this.logger,O&&O.toString&&O.toString();const U=this.allowOperation(ge.CTRL);if(U)throw new E(U,y.INVALID_OPERATION,null);const V=this.createDestinationFromDescriptor(k.createFromSpec(O)),z=this._sessionFSM.subscriptionUpdate(V,!0,void 0,void 0,ee.REMOVE_DTE_SUBSCRIPTION,!1,(de,_e)=>this.handleDTEUnsubscribeResponse(de,_e)),ne=r(8205);if(z===ne.TransportReturnCode.NO_SPACE)throw new E("Cannot send subscription request - no space in transport. Please try again later (on CAN_ACCEPT_DATA)",y.INSUFFICIENT_SPACE,ne.TransportReturnCode.describe(z));if(z!==ne.TransportReturnCode.OK)throw new E("Cannot send subscription request - transport error.",y.COMMUNICATION_ERROR,ne.TransportReturnCode.describe(z));return z}updateProperty(O,U,V,z){this.logger;const ne=this.allowOperation(ge.CTRL);if(ne)throw new E(ne,y.INVALID_OPERATION,null);const{Topic:de}=u;let _e;g.isEnumMember("mutableSessionProperty",O,Q),g.isNumberOrNothing("requestTimeout",V),g.isRangeCompareOrNothing("requestTimeout",V,">",0);const we=this._sessionFSM.sendUpdateProperty(O,U,z,V,oe=>{const Se=oe.getResponse();if(Se.responseCode===200){if(O===Q.CLIENT_DESCRIPTION)this._sessionProperties.applicationDescription=U,_e=re.build(ce.PROPERTY_UPDATE_OK,Se.responseString,Se.responseCode,0,z,null),this.sendEvent(_e);else if(O===Q.CLIENT_NAME){const Ce=x.getP2PTopicSubscription(this._sessionProperties.p2pInboxBase),je=de.createFromName(Ce),Be=x.getP2PTopicSubscription(oe.getP2PTopicValue()),ct=de.createFromName(Be),Gt=et=>{const xe=et.getResponse();if(xe.responseCode===200)this._sessionProperties._setP2pInboxBase(oe.getP2PTopicValue()||""),this._sessionProperties._setP2pInboxInUse(x.getP2PInboxTopic(this._sessionProperties.p2pInboxBase)),this._sessionProperties.clientName=U,_e=re.build(ce.PROPERTY_UPDATE_OK,xe.responseString,xe.responseCode,0,z,null),this.sendEvent(_e);else{const He=T.getErrorSubcode(xe.responseCode,xe.responseString);He===y.SUBSCRIPTION_ALREADY_PRESENT&&this._sessionProperties.ignoreDuplicateSubscriptionError?(_e=re.build(ce.PROPERTY_UPDATE_OK,xe.responseString,xe.responseCode,0,z,null),this.sendEvent(_e)):He===y.SUBSCRIPTION_ALREADY_PRESENT||He===y.SUBSCRIPTION_ATTRIBUTES_CONFLICT||He===y.SUBSCRIPTION_INVALID||He===y.SUBSCRIPTION_ACL_DENIED||He===y.SUBSCRIPTION_TOO_MANY?(_e=re.build(ce.PROPERTY_UPDATE_ERROR,xe.responseString,xe.responseCode,He,z,null),this.sendEvent(_e)):(_e=re.build(ce.PROPERTY_UPDATE_ERROR,xe.responseString,xe.responseCode,y.SUBSCRIPTION_ERROR_OTHER,z,null),this.sendEvent(_e))}},Ne=et=>{const xe=et.getResponse();if(xe.responseCode===200)this._sessionFSM.subscriptionUpdate(ct,!0,z,this._sessionProperties.readTimeoutInMsecs,ee.ADD_P2PINBOX,!0,Gt);else{const He=T.getErrorSubcode(xe.responseCode,xe.responseString);He===y.SUBSCRIPTION_NOT_FOUND&&this._sessionProperties.ignoreSubscriptionNotFoundError?this._sessionFSM.subscriptionUpdate(ct,!0,z,this._sessionProperties.readTimeoutInMsecs,ee.ADD_P2PINBOX,!0,Gt):He===y.SUBSCRIPTION_ATTRIBUTES_CONFLICT||He===y.SUBSCRIPTION_INVALID||He===y.SUBSCRIPTION_NOT_FOUND||He===y.SUBSCRIPTION_ACL_DENIED?(_e=re.build(ce.PROPERTY_UPDATE_ERROR,xe.responseString,xe.responseCode,He,null,null),this.sendEvent(_e)):(_e=re.build(ce.PROPERTY_UPDATE_ERROR,xe.responseString,xe.responseCode,y.SUBSCRIPTION_ERROR_OTHER,null,null),this.sendEvent(_e))}};this._sessionFSM.subscriptionUpdate(je,!0,z,this._sessionProperties.readTimeoutInMsecs,ee.REMOVE_P2PINBOX,!0,Ne)}}else{const Ce=T.getErrorSubcode(Se.responseCode,Se.responseString);_e=re.build(ce.PROPERTY_UPDATE_ERROR,Se.responseString,Se.responseCode,Ce,z,null),this.sendEvent(_e)}});we!==j.OK&&(_e=we===j.NO_SPACE?re.build(ce.PROPERTY_UPDATE_ERROR,"Property update failed - no space in transport",null,y.INSUFFICIENT_SPACE,null,null):re.build(ce.PROPERTY_UPDATE_ERROR,"Property update failed",null,y.INVALID_OPERATION,null,null),this.sendEvent(_e))}updateAuthenticationOnReconnect(O){this.logger;const U=["accessToken","idToken"],V=this.allowOperation(ge.QUERY_OPERATION);if(V)throw new E(V,y.INVALID_OPERATION,null);if(!O||typeof O!="object")throw new E("updateAuthenticationOnReconnect parameter must be a non-empty object.",y.PARAMETER_INVALID_TYPE,null);var z;for(z in O)if(!U.includes(z))throw new E("Invalid property in updateAuthenticationOnReconnect parameter.",y.PARAMETER_CONFLICT,null);const ne=this.getSessionProperties();Object.assign(ne,O),ae.validate(ne),this._sessionProperties=ne,Object.assign(this._sessionFSM._sessionProperties,O)}send(O){this.logger;const U=this.allowOperation(ge.SEND,O);if(U)throw new E(U,y.INVALID_OPERATION,null);if(g.isInstanceOf("message",O,l.Message),!this.isCapable(S.VAR_LEN_EXT_PARAM)&&(O.clearExtendedVarLenParams(),this._failOnExtendedVariableLengthProperties(O)))throw new E("Broker does not support variable length SMF extended parameters",y.INVALID_OPERATION);this.validateAndSendMessage(O)}_failOnExtendedVariableLengthProperties(O){return!1}sendRequest(O,U=void 0,V=void 0,z=void 0,ne=void 0){this.logger;const de=this.allowOperation(ge.SEND,O);if(de)throw new E(de,y.INVALID_OPERATION,null);if(g.isInstanceOf("message",O,l.Message),g.isNumberOrNothing("timeout",U),g.isRangeCompareOrNothing("timeout",U,">=",100),g.isFunctionOrNothing("replyReceivedCBFunction",V),g.isFunctionOrNothing("requestFailedCBFunction",z),O.getCorrelationId()==null&&O.setCorrelationId(P+L.NextId()),O.getReplyTo()==null){const _e=u.Topic.createFromName(this._sessionProperties.p2pInboxInUse);O.setReplyTo(_e)}this.validateAndSendMessage(O),this.enqueueOutstandingDataReq(O.getCorrelationId(),z,U,V,ne)}sendReply(O,U){this.logger;const V=this.allowOperation(ge.SEND,U);if(V)throw new E(V,y.INVALID_OPERATION,null);if(g.isInstanceOfOrNothing("messageToReplyTo",O,l.Message),g.isInstanceOf("replyMessage",U,l.Message),U.setAsReplyMessage(!0),O){if(U.setCorrelationId(O.getCorrelationId()),O.getReplyTo()==null)throw new E("ReplyTo destination may not be null.",y.PARAMETER_OUT_OF_RANGE);U.setDestination(O.getReplyTo())}this.validateAndSendMessage(U)}getStat(O){this.logger;const U=this.allowOperation(ge.QUERY_OPERATION);if(U)throw new E(U,y.INVALID_OPERATION,null);return g.isEnumMember("statType",O,H),this._sessionFSM.getStat(O)}resetStats(){this.logger;const O=this.allowOperation(ge.QUERY_OPERATION);if(O)throw new E(O,y.INVALID_OPERATION,null);this._sessionFSM.resetStats()}getSessionProperties(){this.logger;const O=this.allowOperation(ge.QUERY_OPERATION);if(O)throw new E(O,y.INVALID_OPERATION,null);const U=this._sessionProperties.clone();return this.getSessionState()!==me.DISCONNECTED&&this._sessionFSM._transport&&U._setWebTransportProtocolInUse(this._sessionFSM._transport.getTransportProtocol()),U}isCapable(O){this.logger;const U=this.allowOperation(ge.QUERY_OPERATION);if(U)throw new E(U,y.INVALID_OPERATION,null);g.isNumber("capabilityType",O);const V=this._capabilities;return!!V&&typeof V[O]=="boolean"&&V[O]}getCapability(O){this.logger;const U=this.allowOperation(ge.QUERY_OPERATION);if(U)throw new E(U,y.INVALID_OPERATION,null);g.isNumber("capabilityType",O);const V=this._getCapability(O);return typeof V=="boolean"?B.create(M.BOOL,V):typeof V=="number"?B.create(M.INT64,V):typeof V=="string"?B.create(M.STRING,V):null}_getCapability(O){const U=this._capabilities;if(!U)return null;const V=U[O];return V===void 0?null:V}getSessionState(){this.logger;const O=this.allowOperation(ge.QUERY_OPERATION);if(O)throw new E(O,y.INVALID_OPERATION,null);const U=this.getFSMState();switch(U){case me.FULLY_CONNECTED:return Re.CONNECTED;case me.DISCONNECTING:return Re.DISCONNECTING;case me.DISCONNECTED:return Re.DISCONNECTED;case me.SESSION_ERROR:return Re.SESSION_ERROR;case me.CONNECTING:case me.WAITING_FOR_INTERCONNECT_TIMEOUT:case me.WAITING_FOR_DNS:case me.WAITING_FOR_TRANSPORT_UP:case me.WAITING_FOR_SESSION_UP:case me.WAITING_FOR_LOGIN:case me.WAITING_FOR_P2PINBOX_REG:case me.WAITING_FOR_PUBFLOW:case me.REAPPLYING_SUBSCRIPTIONS:return Re.CONNECTING;default:{const{LOG_INFO:V}=this.logger;return V(`Unmapped session state ${me.describe(U)}`),null}}}getFSMState(){return this._sessionFSM.getCurrentStateName()}createCacheSession(O){return this.logger,new p(O,this,{incStat:this._sessionFSM.incStat.bind(this._sessionFSM)})}createMessageConsumer(O){if(this.logger,this._adDisabledReason)throw new E("Session does not provide MessageConsumer capability",y.GM_UNAVAILABLE,this._adDisabledReason);return O!=null&&this.logger,this._sessionFSM.createMessageConsumer(O)}provisionEndpoint(O,U,V,z){g.isBooleanOrNothing("ignoreExists",V),g.isInstanceOf("queueDescriptor",O,Object,y.PARAMETER_INVALID_TYPE,"queueDescriptor must be supplied, can't be "+O),g.isString("queueDescriptor.name",O.name,y.PARAMETER_INVALID_TYPE,"provisionEndpoint only works on named endpoints");const ne=new k(O);if(!ne.durable)throw new I("provisionEndpoint() only works for durable endpoints.");U&&(g.isInstanceOfOrNothing("queueProperties",U,Object,y.PARAMETER_INVALID_TYPE,"queueProperties must be an object, ideally a solace.QueueProperties instance. Can't be "+U),F.validate(U));const de=this.handleProvisionResponse.bind(this,V,!0);return this._sessionFSM.provisionEndpoint(ne,U,z,de)}deprovisionEndpoint(O,U,V){if(g.isBooleanOrNothing("ignoreMissing",U),!(O instanceof Object))throw new E("queueDesscriptor object required",y.PARAMETER_INVALID_TYPE);g.isString("queueDescriptor.name",O.name,y.PARAMETER_INVALID_TYPE,"deprovisionEndpoint only works on named endpoints");const z=this.handleProvisionResponse.bind(this,U,!1);return this._sessionFSM.deprovisionEndpoint(O,V,z)}handleProvisionResponse(O,U,V,z){const{correlationKey:ne}=z,de=V._smfHeader.pm_respcode,_e=V._smfHeader.pm_respstr,we=T.getADErrorSubcode(de,_e),oe=new k;oe.durable=void 0;const Se=new J,{DestinationUtil:Ce}=u;V.getQueueNameBytes()&&V.getQueueNameBytes().length>0?(oe.name=Ce.decodeBytes(V.getQueueNameBytes()),oe.type=$.QUEUE):V.getTopicEndpointBytes()&&V.getTopicEndpointBytes().length>0?(oe.name=Ce.decodeBytes(V.getTopicEndpointBytes()),oe.type=$.TOPIC_ENDPOINT):(oe.name=void 0,oe.type=void 0),oe.durable=V.getDurability(),Se.accessType=V.getAccessType(),Se.discardBehavior=V.getQueueDiscardBehavior(),Se.maxMessageRedelivery=V.getMaxRedelivery(),Se.maxMessageSize=V.getMaxMsgSize(),Se.permissions=V.getAllOthersPermissions(),Se.quotaMB=V.getQuota(),Se.respectsTTL=V.getRespectsTTL();let je=null;de!==400||we!==y.INVALID_QUEUE_NAME&&we!==y.INVALID_TE_NAME||(je=R(oe.name));let Be=ce.PROVISION_ERROR;de===200||O&&U&&we==y.ENDPOINT_ALREADY_EXISTS?Be=ce.PROVISION_OK:!O||U||we!=y.UNKNOWN_QUEUE_NAME&&we!=y.UNKNOWN_TOPIC_ENDPOINT_NAME||(Be=ce.PROVISION_OK);const ct=new se(Be,_e,de,we,ne,je,oe,Se);this.sendEvent(ct)}createQueueBrowser(O){if(this.logger,this._adDisabledReason)throw new E("Session does not provide QueueBrowser capability",y.GM_UNAVAILABLE,this._adDisabledReason);return O!=null&&this.logger,this._sessionFSM.createQueueBrowser(O)}createDestinationFromDescriptor(O){const{DestinationType:U,Queue:V,Topic:z}=u;let ne=U.TOPIC;O.type===$.QUEUE&&(ne=O.durable?U.QUEUE:U.TEMPORARY_QUEUE);const de=O.name||null;return O.durable?(_(de,"Durable endpoint with generated name is not a valid configuration"),(O.getType()===$.QUEUE?V.createFromLocalName:z.createFromName)(de)):this.createTemporaryDestination(ne,de)}createTemporaryDestination(O,U){this.logger;const{DestinationFromNetwork:V,DestinationUtil:z}=u,ne=this.getSessionProperties().virtualRouterName;if(!this.isCapable(S.TEMPORARY_ENDPOINT)||ne==null||ne.length===0)throw new E("Attempt to generate temporary destination or endpoint without suitable session",y.INVALID_OPERATION);const de=U&&U.startsWith("#P2P")?U:z.createTemporaryName(O,ne,U);return V.createDestinationFromName(de)}sendEvent(O){O&&(this._disposed||(this.logger,this._eventCallbackInfo.sessionEventCBFunction(this,O,this._eventCallbackInfo.userObject)))}getTransportInfo(){return this.logger,this._sessionFSM.getTransportInfo()}injectTransportInterceptor(O){this._sessionFSM.injectTransportInterceptor(O)}allowOperation(O,U){if(!this._sessionFSM)return!1;let V=!0;const z=this._sessionFSM.getCurrentStateName();if(z===me.DISPOSED)V=!1;else if(C.anything(O))switch(O){case ge.CONNECT:z!==me.NEW&&z!==me.DISCONNECTED&&(V=!1);break;case ge.DISCONNECT:z===me.NEW&&(V=!1);break;case ge.SEND:case ge.CTRL:V=z===me.FULLY_CONNECTED||U&&U.getDeliveryMode()!==l.MessageDeliveryModeType.DIRECT;break;case ge.QUERY_OPERATION:V=!0;break;default:V=!1}else V=!1;return V?null:`Cannot perform operation ${O} while in state ${z}`}updateCapabilities(O){this._capabilities=O}validateAndSendMessage(O){const U=O.getDestination();if(C.nothing(U)||C.empty(U.getName()))throw new E("Message must have a valid Destination",y.TOPIC_MISSING);const V=O.getSenderTimestamp()==null;if(this._sessionProperties.generateSendTimestamps&&(V||O.hasAutoSenderTimestamp)){const de=new Date;O.setSenderTimestamp(de.getTime()),O.hasAutoSenderTimestamp=!0}const z=O.getSequenceNumber()==null;this._sessionProperties.generateSequenceNumber&&(z||O.hasAutoSequenceNumber)&&(O.setSequenceNumber(this._seqNum++),O.hasAutoSequenceNumber=!0);const ne=O.getSenderId()==null;this._sessionProperties.includeSenderId&&ne&&O.setSenderId(this._sessionProperties.clientName),this._sessionFSM.prepareAndSendMessage(O)}enqueueOutstandingDataReq(O,U,V,z,ne){if(C.none(O))return;const{LOG_TRACE:de,LOG_ERROR:_e}=this.logger,we=setTimeout(()=>{this._sessionFSM.incStat(H.TX_REQUEST_TIMEOUT);try{delete this._outstandingDataReqs[O]||_e(`Cannot delete data request ${O}`)}catch(Se){_e(`Cannot delete data request ${O}`,Se)}if(C.anything(U)){const Se=re.build(N.REQUEST_TIMEOUT,"Request timeout",O);U(this,Se,ne)}},V||this._sessionProperties.readTimeoutInMsecs),oe=new W(O,we,z,U,ne);this._outstandingDataReqs[O]=oe}cancelOutstandingDataReq(O){const{LOG_TRACE:U,LOG_ERROR:V}=this.logger;if(C.none(O)||!this._outstandingDataReqs)return null;const z=this._outstandingDataReqs[O];if(z==null)return null;z.timer&&(clearTimeout(z.timer),z.timer=null);try{delete this._outstandingDataReqs[O]||V(`Cannot delete data request ${O}`)}catch(ne){V(`Cannot delete data request ${O}`,ne)}return z}cleanupSession(){this.logger,this._outstandingDataReqs&&Object.keys(this._outstandingDataReqs).forEach(O=>{const U=this.cancelOutstandingDataReq(O);if(U&&U.reqFailedCBFunction){const V=re.build(N.REQUEST_ABORTED,"Request aborted",O);U.reqFailedCBFunction(this,V,U.userObject)}})}handleDataMessage(O){const{LOG_TRACE:U,LOG_INFO:V}=this.logger,z=O;if(this._sessionProperties.generateReceiveTimestamps){const ne=new Date;z._receiverTimestamp=ne.getTime()}if(z.isReplyMessage()){const ne=z.getCorrelationId();if(C.anything(ne)){const de=this.cancelOutstandingDataReq(ne);if(de!==null)return this._sessionFSM.incStat(H.RX_REPLY_MSG_RECVED),void de.replyReceivedCBFunction(this,z,de.userObject);if(ne.startsWith(P))return V("DROP: Discard reply message due to missing outstanding request"),void this._sessionFSM.incStat(H.RX_REPLY_MSG_DISCARD);if(ne.startsWith(f)&&!(p&&this._messageCallbackInfo.userObject instanceof p))return V("DROP: Discard cache reply due to no cache session active"),void this._sessionFSM.incStat(H.RX_REPLY_MSG_DISCARD)}}this._messageCallbackInfo.messageRxCBFunction(this,z,this._messageCallbackInfo.userObject)}handleSubscriptionUpdateResponse(O,U,V){const z=O.getResponse(),{responseCode:ne,responseString:de}=z,{correlationKey:_e}=U;if(ne===200){const we=re.build(ce.SUBSCRIPTION_OK,de,ne,0,_e,null);this.sendEvent(we)}else{const we=Z.stripNullTerminate(O.encodedUtf8Subscription);this._sessionFSM.handleSubscriptionUpdateError(ne,de,we,_e,V)}}handleQueueSubscriptionUpdateResponse(O,U,V){if(this.logger,!O)return void V(!1,y.TIMEOUT,0,"Timeout");const z=O.getResponse(),{responseCode:ne,responseString:de}=z,_e=T.getADErrorSubcode(ne,de);ne===200||_e===y.SUBSCRIPTION_ALREADY_PRESENT||_e===y.SUBSCRIPTION_NOT_FOUND?V(!0,0,ne,de):V(!1,_e,ne,de)}handleDTEUnsubscribeResponse(O,U){const V=O.getResponse(),{responseCode:z,responseString:ne}=V,{correlationKey:de}=U,_e=z===200?ce.UNSUBSCRIBE_TE_TOPIC_OK:ce.UNSUBSCRIBE_TE_TOPIC_ERROR,we=z===200?0:T.getADErrorSubcode(z,ne);this.sendEvent(re.build(_e,ne,z,we,de))}handleSubscriptionUpdateError(O,U,V,z,ne){const de=T.getErrorSubcode(O,U);if(de===y.SUBSCRIPTION_ALREADY_PRESENT&&this._sessionProperties.ignoreDuplicateSubscriptionError||de===y.SUBSCRIPTION_NOT_FOUND&&this._sessionProperties.ignoreSubscriptionNotFoundError){if(ne){const _e=re.build(ce.SUBSCRIPTION_OK,U,O,0,z,null);this.sendEvent(_e)}}else{const _e=re.build(ce.SUBSCRIPTION_ERROR,U,O,de,z,`Topic: ${V}`);this.sendEvent(_e)}}getEventCBInfo(){return this._eventCallbackInfo}setEventCBInfo(O){this._eventCallbackInfo=O}getMessageCBInfo(){return this._messageCallbackInfo}setMessageCBInfo(O){this._messageCallbackInfo=O}getCorrelationTag(){return this._sessionFSM.getCorrelationTag()}wrapEventCallback(O){const{LOG_WARN:U}=this.logger,V=O?O.sessionEventCBFunction?O:new fe(O):null;return new fe((z,ne,de,_e)=>{const{sessionEventCode:we}=ne;if(V)try{V.sessionEventCBFunction(z,ne,de,_e)}catch(oe){const Se=Object.assign(new E(`Unhandled error in SessionEventRxCBInfo callback on sessionEventCode ${ce.describe(we)}`,y.CALLBACK_ERROR,`On event: ${[we,ne,de,_e]} ${oe}`),{stack:oe.stack,info:{event:{name:we,formattedName:`SessionEventCode.${ce.describe(we)}`,args:[ne,de,_e]},error:oe}});U(Se.toString(),Se.info)}this.emit(we,ne)})}wrapMessageCallback(O){const{LOG_WARN:U}=this.logger,V=O?O.messageRxCBFunction?O:new Y(O):null,z=`SessionEventCode.${ce.describe(ce.MESSAGE)}`,ne=(de,_e,we)=>Object.assign(new E(`Unhandled error in MessageRxCBInfo callback/handler for ${z}`,y.CALLBACK_ERROR),{stack:de.stack,info:{event:{name:ce.MESSAGE,formattedName:z,args:[_e,we]},error:de}});return new Y((de,_e,we)=>{if(V)try{V.messageRxCBFunction(de,_e,we)}catch(oe){const Se=ne(oe,_e,we).toString();U(Se,Se.info,oe)}try{this.emitDirect(_e)}catch(oe){this.emit("error",ne(oe,_e,we))}})}get adLocallyDisabled(){return!!this._adDisabledReason}get canConnectConsumer(){return!this.adLocallyDisabled&&(this._capabilities?this.isCapable(S.GUARANTEED_MESSAGE_CONSUME):void 0)}get canConnectPublisher(){return!this.adLocallyDisabled&&(this._capabilities?this.isCapable(S.GUARANTEED_MESSAGE_PUBLISH):void 0)}get disposed(){return this._disposed}inspect(){return{sessionId:this._sessionFSM&&this._sessionFSM.sessionIdHex||"(N/A)",transport:this.getTransportInfo(),state:Re.describe(this.getSessionState())}}toString(){return a(this)}}},6415:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SslDowngrade=a.new({NONE:"NONE",PLAINTEXT:"PLAIN_TEXT"})},4356:(o,h,r)=>{const{SessionRequestType:a}=r(168);o.exports={SubscriptionUpdateTimeoutMessages:{[a.ADD_SUBSCRIPTION]:"Add subscription request timeout",[a.REMOVE_SUBSCRIPTION]:"Remove subscription request timeout",[a.ADD_P2PINBOX]:"Add P2P inbox subscription timeout",[a.REMOVE_P2PINBOX]:"Remove P2P inbox subscription timeout",[a.REMOVE_DTE_SUBSCRIPTION]:"Remove endpoint topic subscription",default:"Request timeout"}}},3450:(o,h,r)=>{const a=r(7623),{AdProtocolMessage:u,BinaryMetaBlock:l,ClientCtrlMessage:d,KeepAliveMessage:_,SMPMessage:p}=r(8247),{SMFAdProtocolMessageType:f}=r(7250),{SMFAdProtocolParam:S}=r(5099),{SMFClientCtrlMessageType:C}=r(9640),{SMFClientCtrlParam:g}=r(9685),{SMFParameterType:m,SMFExtendedParameterType:T}=r(7750),{SMFProtocol:y}=r(5052),{SMFSMPMessageType:E}=r(3647),{SMFSMPMessageTypeFlags:I}=r(1278),{SMFTransportSessionMessageType:N}=r(1643);o.exports.AdProtocolMessage=u,o.exports.BinaryMetaBlock=l,o.exports.ClientCtrlMessage=d,o.exports.Codec=a,o.exports.KeepAliveMessage=_,o.exports.SMFAdProtocolMessageType=f,o.exports.SMFAdProtocolParam=S,o.exports.SMFClientCtrlMessageType=C,o.exports.SMFClientCtrlParam=g,o.exports.SMFParameterType=m,o.exports.SMFProtocol=y,o.exports.SMFSMPMessageTypeFlags=I,o.exports.SMFSMPMessageType=E,o.exports.SMFTransportSessionMessageType=N,o.exports.SMPMessage=p,o.exports.SMFExtendedParameterType=T},1318:(o,h,r)=>{const a=r(3450),{AdProtocolMessage:u,SMFParameter:l}=r(8247),{Bits:d,Convert:_}=r(9783),{LOG_DEBUG:p,LOG_INFO:f,LOG_ERROR:S}=r(2694),{ReplayStartType:C}=r(9309),{get:g,set:m}=d,{int8ToStr:T,int16ToStr:y,int24ToStr:E,int32ToStr:I}=_;function N(k,J){const F=[];let $=0;return $=d.set($,k,6,2),$=d.set($,J,0,6),F.push(_.int8ToStr($)),F.push(_.int8ToStr(2)),F.join("")}function A(k,J,F){const $=[];let R=0;return R=d.set(R,k,6,2),R=d.set(R,J,0,6),$.push(_.int8ToStr(R)),$.push(_.int8ToStr(3)),$.push(_.int8ToStr(F)),$.join("")}function L(k,J,F){const $=[];let R=0;return R=d.set(R,k,6,2),R=d.set(R,J,0,6),$.push(_.int8ToStr(R)),$.push(_.int8ToStr(4)),$.push(_.int16ToStr(F)),$.join("")}function D(k,J,F){const $=[];let R=0;return R=d.set(R,k,6,2),R=d.set(R,J,0,6),$.push(_.int8ToStr(R)),$.push(_.int8ToStr(6)),$.push(_.int32ToStr(F)),$.join("")}function q(k,J,F){const $=[];let R=0;return R=d.set(R,k,6,2),R=d.set(R,J,0,6),$.push(_.int8ToStr(R)),$.push(_.int8ToStr(10)),$.push(_.int64ToStr(F)),$.join("")}const Y={};function Q(k,J,F){const $=[],R=F.type,B=F.value;let M=0;switch(M=d.set(M,k,6,2),M=d.set(M,J,0,6),$.push(_.int8ToStr(M)),$.push(_.int8ToStr(Y[R])),$.push(_.int8ToStr(R)),R){case C.DATE:$.push(_.int64ToStr(B));break;case C.RGMID:$.push(_.int64ToStr(B.suid)),$.push(_.int64ToStr(B.messageId));case C.BEGINNING:}return $.join("")}function W(k,J,F,$,R=void 0){const B=[];let M=0;M=d.set(M,k,6,2),M=d.set(M,J,0,6);const re=R==null||R===0?18:19;return B.push(_.int8ToStr(M)),B.push(_.int8ToStr(re)),B.push(_.int64ToStr(F)),B.push(_.int64ToStr($)),R!=null&&R>0&&B.push(_.int8ToStr(R)),B.join("")}function x(k,J,F){const $=[];let R=0;R=d.set(R,k,6,2),R=d.set(R,J,0,6),$.push(_.int8ToStr(R));let B=0;return F.length<=253?(B=F.length+2,$.push(_.int8ToStr(B))):(B=0,$.push(_.int8ToStr(B)),$.push(_.int32ToStr(F.length+5))),$.push(F),$.join("")}Y[C.BEGINNING]=3,Y[C.DATE]=11,Y[C.RGMID]=19,o.exports.parseAdpAt=function(k,J){if(J+3>k.length)return!1;let F=J,$=k.readUInt8(F);F++;const R=g($,0,6);let B,M;if(R<3){const se=k.readUInt16BE(F);F+=2,M=g(se,12,4),B=g(se,0,12),B<<=2}else{if(R!==3)return S("Found unsupported ADP Version",R),!1;$=k.readUInt8(F),F++,M=g($,0,8),B=k.readUInt32BE(F),F+=4}if(J+B>k.length)return S(`Invalid Asssured Control Protocol length=${B} exceeds remaining message buffer = ${k.length-J}`),!1;const re=new u(M,R);for(;F<J+B;){$=k.readUInt8(F),F++;const se=g($,6,2),fe=g($,0,6);if(fe===0)continue;if(F>=J+B)return S(`Invalid Asssured Control Protocol parameter=${fe} at position =${F}`),!1;let ce,Te=k.readUInt8(F);if(F++,Te===0){if(F+5>J+B)return S(`Invalid Asssured Control Protocol parameter=${fe} at position =${F}`),!1;Te=k.readUInt32BE(F),F+=4,ce=Te-5}else ce=Te-2;if(Te<=0)return!1;if(F+ce>J+B)return S(`Invalid Asssured Control Protocol parameter=${fe} length =${ce} invalid at position =${F}`),!1;const Ee=new l(se,fe,null,k,F,F+ce);re.addParameter(Ee),F+=ce}return re},o.exports.encAdp=function(k){const J=[],F=k.getParameterArray();let $;for($=0;$<F.length;$++){const M=F[$];if(M!==void 0)switch(M.getType()){case a.SMFAdProtocolParam.WINDOW:case a.SMFAdProtocolParam.EP_DURABLE:case a.SMFAdProtocolParam.ACCESSTYPE:case a.SMFAdProtocolParam.FLOWTYPE:case a.SMFAdProtocolParam.EP_RESPECTS_TTL:case a.SMFAdProtocolParam.TRANSACTION_CTRL_MESSAGE_TYPE:case a.SMFAdProtocolParam.TRANSACTED_SESSION_STATE:case a.SMFAdProtocolParam.ACTIVE_FLOW_INDICATION:case a.SMFAdProtocolParam.WANT_FLOW_CHANGE_NOTIFY:case a.SMFAdProtocolParam.MAX_REDELIVERY:J.push(A(M.getUh(),M.getType(),M.getValue()));break;case a.SMFAdProtocolParam.EP_BEHAVIOUR:case a.SMFAdProtocolParam.PARTITION_GROUP_ID:J.push(L(M.getUh(),M.getType(),M.getValue()));break;case a.SMFAdProtocolParam.FLOWID:case a.SMFAdProtocolParam.TRANSPORT_WINDOW:case a.SMFAdProtocolParam.EP_ALLOTHER_PERMISSION:case a.SMFAdProtocolParam.EP_QUOTA:case a.SMFAdProtocolParam.EP_MAX_MSGSIZE:case a.SMFAdProtocolParam.GRANTED_PERMISSION:case a.SMFAdProtocolParam.TRANSACTED_SESSION_ID:case a.SMFAdProtocolParam.PUBLISHER_ID:J.push(D(M.getUh(),M.getType(),M.getValue()));break;case a.SMFAdProtocolParam.LASTMSGIDSENT:case a.SMFAdProtocolParam.LASTMSGIDACKED:case a.SMFAdProtocolParam.LASTMSGIDRECEIVED:case a.SMFAdProtocolParam.TRANSACTION_ID:case a.SMFAdProtocolParam.ENDPOINT_ERROR_ID:J.push(q(M.getUh(),M.getType(),M.getValue()));break;case a.SMFAdProtocolParam.REPLAY_START_LOCATION:{const re=M.getValue();re.value===void 0?J.push(A(M.getUh(),M.getType(),re.type)):J.push(Q(M.getUh(),M.getType(),re));break}case a.SMFAdProtocolParam.APPLICATION_ACK:{const re=M.getValue(),se=M.getUh(),fe=M.getType();re.forEach((ce,Te)=>{for(let Ee=0;Ee<ce.length;++Ee){const he=ce[Ee];J.push(W(se,fe,he[0],he[1],Te))}});break}case a.SMFAdProtocolParam.QUEUENAME:case a.SMFAdProtocolParam.DTENAME:case a.SMFAdProtocolParam.TOPICNAME:case a.SMFAdProtocolParam.FLOWNAME:case a.SMFAdProtocolParam.SELECTOR:case a.SMFAdProtocolParam.TRANSACTED_SESSION_NAME:J.push(x(M.getUh(),M.getType(),M.getValue()));break;case a.SMFAdProtocolParam.TRANSACTION_FLOW_DESCRIPTOR_PUB_NOTIFY:case a.SMFAdProtocolParam.TRANSACTION_FLOW_DESCRIPTOR_PUB_ACK:case a.SMFAdProtocolParam.TRANSACTION_FLOW_DESCRIPTOR_SUB_ACK:break;case a.SMFAdProtocolParam.NOLOCAL:case a.SMFAdProtocolParam.CUT_THROUGH:J.push(N(M.getUh(),M.getType()));break;case a.SMFAdProtocolParam.APPLICATION_PUB_ACK:break;default:f("Unrecognized ADProtocol Parameter in Message")}}const R=J.join(""),B=[];if(k.version===2){let M=0;M=m(M,0,22,2),M=m(M,k.version,16,6),M=m(M,k.msgType,12,4);let re=4-(3+R.length&3);const se=3+R.length+re>>2;for(M=m(M,se,0,12),B.push(E(M)),B.push(R),re===4&&(re=0);re>0;)B.push(T(0)),re--}else if(k.version===3){let M=0;M=m(M,0,14,2),M=m(M,k.version,8,6),M=m(M,k.msgType,0,8),B.push(y(M)),B.push(I(6+R.length)),B.push(R)}else S(`Invalid Version ${k.version} found while encoding`);return B.join("")}},7623:(o,h,r)=>{const{ContentSummaryType:a}=r(8283),{Decode:u}=r(1261),{Encode:l}=r(4741),{ParamParse:d}=r(760),{ParseSMF:_}=r(8103),{Transport:p}=r(2318);o.exports.ContentSummaryType=a,o.exports.Encode=l,o.exports.Decode=u,o.exports.ParamParse=d,o.exports.ParseSMF=_,o.exports.Transport=p},1868:(o,h,r)=>{const{Bits:a,Convert:u}=r(9783),{ClientCtrlMessage:l,SMFParameter:d}=r(8247),{LOG_ERROR:_}=r(2694),{get:p,set:f}=a,{int8ToStr:S,int16ToStr:C,int32ToStr:g}=u;o.exports.parseCCAt=function(m,T,y){const E=new l;if(y<6||T+6>m.length)return E;let I=T;const N=m.readUInt16BE(I);I+=2;const A=p(N,8,3),L=p(N,0,8),D=m.readUInt32BE(I);if(I+=4,A!==1)return _(`Unsupported ClientCtrl version ${A}`),!1;if(D<=0||T+D>m.length)return!1;for(E.msgType=L,E.version=A;I<T+D;){const q=m.readUInt8(I);I++;const Y=p(q,7,1),Q=p(q,0,7),W=m.readUInt32BE(I);if(W<=0)return!1;I+=4;const x=W-5,k=new d(Y,Q,null,m,I,I+x);E.addParameter(k),I+=x}return E},o.exports.encCC=function(m){const T=[],y=m.getParameterArray();for(let A=0,L=y.length;A<L;++A){const D=y[A];if(D===void 0)continue;let q=0;q=f(q,D.getUh(),7,1),q=f(q,D.getType(),0,7),T.push(S(q)),T.push(g(D.getValue().length+5)),T.push(D.getValue())}const E=T.join("");let I=0;I=f(I,0,15,1),I=f(I,0,11,4),I=f(I,1,8,3),I=f(I,m.msgType,0,8);const N=[];return N.push(C(I)),N.push(g(6+E.length)),N.push(E),N.join("")}},4970:o=>{o.exports.ContentSummaryElement=class{constructor(h=null,r=0,a=0){this.type=h,this.position=r,this.length=a}}},8283:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.ContentSummaryType=a.new({XML_META:0,XML_PAYLOAD:1,BINARY_ATTACHMENT:2,CID_LIST:3,BINARY_METADATA:4})},1261:(o,h,r)=>{const a=r(199),u=r(9620),l=r(6247),{Baggage:d,TraceContextSetter:_}=r(2288),p=r(769),{BinaryMetaBlock:f,KeepAliveMessage:S}=r(8247),{ContentSummaryType:C}=r(8283),{Hex:g,Long:m,Convert:{stringToUint8Array:T,anythingToBuffer:y}}=r(9783),{Lazy:E}=r(7444),{LogFormatter:I}=r(2694),{parseAdpAt:N}=r(1318),{parseCCAt:A}=r(1868),{ParseSMF:L}=r(8103),{PriorityUserCosMap:D}=r(394),{SMFProtocol:q}=r(5052),{SMP:Y}=r(9963),{Transport:Q}=r(2318),W=(r(5594),r(595)),{Check:x}=r(802),{formatHexString:k}=g,{lazyValue:J}=E,{parseSMFAt:F}=L,{parseSMPAt:$}=Y,{parseTsSmfMsgAt:R}=Q,B=new I("[smf-decode]"),{LOG_DEBUG:M,LOG_ERROR:re,LOG_WARN:se}=B,fe=J(()=>new D().reverse),ce={10:l.MessageType.MAP,11:l.MessageType.STREAM,7:l.MessageType.TEXT};function Te(he,ge){const X=ge,ae=p.Codec.parseSingleElement(he.payload,0);if(!ae||ae.getType()!==p.SDTFieldType.STREAM)return;const ee=ae.getValue();let Re=ee.getNext();if(Re&&Re.getType()===p.SDTFieldType.BYTEARRAY&&Re._value&&Re._value.length>0){let me=Re._value.readUInt8(0);if(64&me&&X._setPayloadCompressed(me),128&me||(X._messageType=ce[15&me]||l.MessageType.BINARY),Re._value.length>1){const Pe=Re._value.readUInt8(1);X.setAsReplyMessage(!!(128&Pe))}}if(Re=ee.getNext(),Re&&Re.getType()===p.SDTFieldType.MAP){const me=Re.getValue(),Pe=me.getField("p"),H=me.getField("h");if(Pe&&X.setUserPropertyMap(Pe.getValue()),H){const Z=H.getValue(),te=Z.getField("ci"),ie=Z.getField("mi"),j=Z.getField("mt"),Oe=Z.getField("rt"),v=Z.getField("si"),P=Z.getField("sn"),O=Z.getField("ts"),U=Z.getField("ex"),V=Z.getField("ce"),z=Z.getField("ct"),ne=Z.getField("bag"),de=Z.getField("ctx");if(te&&X.setCorrelationId(te.getValue()),ie&&X.setApplicationMessageId(ie.getValue()),j&&X.setApplicationMessageType(j.getValue()),Oe&&X.setReplyTo(Oe.getValue()),v&&X.setSenderId(v.getValue()),P&&X.setSequenceNumber(P.getValueNoThrow()),O&&X.setSenderTimestamp(O.getValue()),U&&X.setGMExpiration(U.getValue()),V&&X.setHttpContentEncoding(V.getValue()),z&&X.setHttpContentType(z.getValue()),ne){const _e=new d;_e.setBaggage(ne.getValue()),X._setBaggage(_e)}if(de){const _e=_.fromTraceContext(de.getValue());X._setCreationContext(_e)}}}}const Ee={decodeCompoundMessage:function(he,ge){const X=F(he,ge);if(!X)return null;const ae=ge+X.headerLength,ee=X.payloadLength;let Re;switch(X.smf_protocol){case q.TSESSION:if(Re=R(he,ae,X),!Re)break;return Re.smfHeader=X,Re;case q.TRMSG:return Re=new l.Message,Re._smfHeader=X,function(me,Pe,H,Z){const te=Pe;if(te._setDeliverToOne(!!me.smf_dto),te._setDeliveryMode(me.pm_deliverymode||l.MessageDeliveryModeType.DIRECT),me.pm_tr_topicname_bytes!==null&&te._setDestination(u.DestinationFromNetwork.createDestinationFromBytes(me.pm_tr_topicname_bytes)),te._setDiscardIndication(!!me.smf_di),te._setElidingEligible(!!me.smf_elidingEligible),te._setDMQEligible(!!me.smf_deadMessageQueueEligible),te._setUserCos(fe.value.get(me.smf_priority)),te._setPriority(me.pm_msg_priority),me.pm_userdata&&te._setUserData(me.pm_userdata),te.setRedelivered(!!me.pm_ad_redelflag||!!me.pm_ad_flowredelflag),te.setFlowId(me.pm_ad_flowid),te.setGuaranteedMessageId(me.pm_ad_msgid),te.setGuaranteedPreviousMessageId(me.pm_ad_prevmsgid),te.setPublisherId(me.pm_ad_publisherid),te.setPublisherMessageId(me.pm_ad_publishermsgid),te.setTopicSequenceNumber(me.pm_ad_topicSequenceNumber),te.getDeliveryMode()===l.MessageDeliveryModeType.DIRECT?te.setDeliveryCount(-1):me.pm_ad_redeliveryCount?te.setDeliveryCount(me.pm_ad_redeliveryCount+1):te.setDeliveryCount(1),me.pm_ad_spooler_unique_id&&te._setSpoolerUniqueId(me.pm_ad_spooler_unique_id),me.pm_ad_replication_mate_ack_message_id?te._setSpoolerMessageId(me.pm_ad_replication_mate_ack_message_id):me.pm_ad_local_spooler_message_id&&te._setSpoolerMessageId(me.pm_ad_local_spooler_message_id),m.isLong(me.pm_ad_ttl)?te.setTimeToLive(me.pm_ad_ttl.toNumber()):te.setTimeToLive(me.pm_ad_ttl),me.pm_ts_transport_context){const Oe=_.fromTraceContext(me.pm_ts_transport_context);te._setTransportContext(Oe)}const ie=Z+me.headerLength,j=me.pm_content_summary;if(j&&j.length){for(let Oe=0,v=j.length;Oe<v;++Oe){const P=j[Oe],O=ie+P.position,U=ie+P.position+P.length;switch(P.type){case C.BINARY_ATTACHMENT:te._setBinaryAttachment(H.slice(O,U));break;case C.BINARY_METADATA:{const V=f.fromEncodedSmf(H,O);te.binaryMetadataChunk=V,V.type===0&&Te(V,te);break}case C.XML_META:te._setXmlMetadata(H.toString("latin1",O,U));break;case C.XML_PAYLOAD:te._setXmlContentInternal(H.toString("latin1",O,U));break;default:re(`Unhandled ContentSummaryType: ${C.describe(P.type)}`)}}if(te._getPayloadCompressed()&&x.anything(te.getHttpContentEncoding())&&te.getHttpContentEncoding().endsWith("deflate"))try{let Oe;if(Oe=W.unzlibSync(te._binaryAttachment),Oe=y(Oe),te._setBinaryAttachment(Oe),te._setPayloadCompressed(null),te.getHttpContentEncoding().trim()==="deflate")delete te._httpContentEncoding;else{let v=te.getHttpContentEncoding().slice(0,-7).trimRight();v.endsWith(",")?(v=v.slice(0,-1),te.setHttpContentEncoding(v)):delete te._httpContentEncoding}}catch(Oe){se("Message payload was not decompressed, there was an error. Leaving the message body compressed ",Oe),te._messageType=l.MessageType.BINARY}}else te._setBinaryAttachment(me.payloadLength>0?H.slice(ie,ie+me.payloadLength):void 0)}(X,Re,he,ge),Re;case q.ADCTRL:return Re=N(he,ae,ee),Re.smfHeader=X,Re;case q.CLIENTCTRL:if(Re=A(he,ae,ee),!Re)break;return Re.smfHeader=X,Re;case q.SMP:if(Re=$(he,ae),!Re)break;return Re.smfHeader=X,Re;case q.KEEPALIVE:case q.KEEPALIVEV2:return Re=new S,Re.smfHeader=X,Re;default:re(`Unknown protocol: 0x${k(X.smf_protocol)}, dump message content:
|
|
85
|
+
${a.Debug.formatDumpBytes(he.slice(ge,ge+X.messageLength).toString("latin1"),!0,0)}`)}return null}};o.exports.Decode=Ee},4741:(o,h,r)=>{const a=r(6247),{Base64:u,Bits:l,Convert:d}=r(9783),{BinaryMetaBlock:_,SMFHeader:p,SMPMessage:f}=r(8247),{Check:S}=r(802),{ClientCtrlMessage:C,KeepAliveMessage:g,AdProtocolMessage:m}=r(8247),{Codec:T}=r(769),{ContentSummaryElement:y}=r(4970),{ContentSummaryType:E}=r(8283),{DestinationType:I}=r(9620),{encAdp:N}=r(1318),{encCC:A}=r(1868),{ErrorSubcode:L,OperationError:D}=r(6706),{Lazy:q}=r(7444),{LOG_TRACE:Y,LOG_INFO:Q}=r(2694),{ParamParse:W}=r(760),{PriorityUserCosMap:x}=r(394),{SDTField:k,SDTFieldType:J,SDTMapContainer:F,SDTStreamContainer:$}=r(769),{SMFParameterType:R,SMFExtendedParameterType:B}=r(7750),{SMFProtocol:M}=r(5052),{SMP:re}=r(9963),{encode:se}=u,{set:fe}=l,{int8ToStr:ce,int16ToStr:Te,int24ToStr:Ee,int32ToStr:he,int64ToStr:ge,uint8ArrayToString:X}=d,{lazyValue:ae}=q,{encContentSummary:ee,encDeliveryMode:Re,encLightSMFParam:me,encodeSMFParam:Pe,encodeSMFExtendedParam:H,FORCED_LENGTH_MODE:Z}=W,{encodeSingleElement:te}=T,{encSmp:ie}=re,j=ae(()=>new x().forward);function Oe(Ne,et,xe,He){if(S.anything(xe)&&xe.length>0){const at=new y(He,NaN,xe.length);Ne.push(at),et.push(xe)}}function v(Ne,et,xe,He){S.anything(He)&&Ne.addField(et,k.create(xe,He))}function P(Ne){let et;(Ne.getCorrelationId()||Ne.getApplicationMessageId()||Ne.getApplicationMessageType()||Ne.getReplyTo()||Ne.getSenderId()||Ne.getSequenceNumber()||Ne.getSenderTimestamp()||Ne.getUserPropertyMap()||Ne.isReplyMessage()||Ne.getCreationContext()||Ne._compressedCE||Ne.getHttpContentEncoding()||Ne.getHttpContentType()||Ne.getBaggage()&&Ne.getBaggage().getBaggage()||Ne.getType()!==a.MessageType.BINARY)&&(et=function(Ue){let At;const qe=new F;v(qe,"ci",J.STRING,Ue.getCorrelationId()),v(qe,"mi",J.STRING,Ue.getApplicationMessageId()),v(qe,"mt",J.STRING,Ue.getApplicationMessageType()),v(qe,"rt",J.DESTINATION,Ue.getReplyTo()),v(qe,"si",J.STRING,Ue.getSenderId()),v(qe,"sn",J.INT64,Ue.getSequenceNumber()),v(qe,"ts",J.INT64,Ue.getSenderTimestamp()),v(qe,"ex",J.INT64,Ue.getGMExpiration()),v(qe,"ce",J.STRING,Ue._compressedCE?Ue._compressedCE:Ue.getHttpContentEncoding()),v(qe,"ct",J.STRING,Ue.getHttpContentType());const $t=Ue.getBaggage();v(qe,"bag",J.STRING,$t?$t.getBaggage():null);const Tt=Ue.getCreationContext();v(qe,"ctx",J.BYTEARRAY,Tt?Tt.getEncodedTraceContext():null);const nn=new F;Ue.getUserPropertyMap()&&nn.addField("p",k.create(J.MAP,Ue.getUserPropertyMap())),qe.getKeys().length>0&&nn.addField("h",k.create(J.MAP,qe));let hn=0;switch(S.anything(Ue._getCompressedBinaryAttachment())&&(hn|=64),Ue.getType()){case a.MessageType.BINARY:hn|=128;break;case a.MessageType.MAP:hn|=10,S.nothing(Ue._getCompressedBinaryAttachment())&&(At=te(Ue._structuredContainer));break;case a.MessageType.STREAM:hn|=11,S.nothing(Ue._getCompressedBinaryAttachment())&&(At=te(Ue._structuredContainer));break;case a.MessageType.TEXT:hn|=7,S.nothing(Ue._getCompressedBinaryAttachment())&&(At=te(Ue._structuredContainer));break;default:Q(`Unhandled messageType: ${Ue.getType()}`)}const In=Ue.isReplyMessage()?128:0,Gr=k.create(J.BYTEARRAY,String.fromCharCode(hn,In)),$r=new $;$r.addField(Gr),$r.addField(k.create(J.MAP,nn));const Wr=new _;return Wr.type=0,Wr.payload=te(k.create(J.STREAM,$r)),Ue.binaryMetadataChunk=Wr,At}(Ne));const xe=[],He=[];Oe(xe,He,Ne.getXmlMetadata(),E.XML_META),Oe(xe,He,Ne.getXmlContent(),E.XML_PAYLOAD),et?Oe(xe,He,et,E.BINARY_ATTACHMENT):S.anything(Ne._getCompressedBinaryAttachment())?Oe(xe,He,Ne._getCompressedBinaryAttachment().toString("latin1"),E.BINARY_ATTACHMENT):Oe(xe,He,Ne._binaryAttachment?Ne._binaryAttachment.toString("latin1"):"",E.BINARY_ATTACHMENT);const at=Ne.binaryMetadataChunk;if(at!==null){const Ue=at.asEncodedSmf(),At=16777215;if(Ue.length>At)throw Ue.length,new D(`binary-meta data (${Ue.length}) over the ${At} limit`,L.PARAMETER_OUT_OF_RANGE);Oe(xe,He,Ue,E.BINARY_METADATA)}return Ne._memoized_csumm=xe,Ne._memoized_payload=He.join(""),Ne._payload_is_memoized=!0,Ne._memoized_payload?Ne._memoized_payload.length:0}const O=(Ne,et)=>(xe=>Array.from(Array(Math.pow(2,xe))).map((He,at)=>at))(et).map(xe=>fe(0,xe,Ne,et)),U=O(31,1),V=O(30,1),z=O(29,1),ne=O(28,1),de=O(27,1),_e=O(24,3),we=O(22,2),oe=O(16,6),Se=O(12,4),Ce=O(0,8),je=O(8,8),Be=O(0,8);function ct(Ne){let et=0;et|=U[Ne.smf_di?1:0],et|=V[Ne.smf_elidingEligible?1:0],et|=z[Ne.smf_dto?1:0],et|=ne[Ne.smf_adf?1:0],et|=de[Ne.smf_deadMessageQueueEligible?1:0],et|=_e[Ne.smf_version||0],et|=we[Ne.smf_uh||0],et|=oe[Ne.smf_protocol||0],et|=Se[Ne.smf_priority||0],et|=Ce[Ne.smf_ttl||0];const xe=[];Ne.pm_tr_topicname_bytes&&xe.push(Pe(2,R.TR_TOPICNAME,`${Ne.pm_tr_topicname_bytes}`)),Ne.pm_queue_len&&xe.push(me(0,R.LIGHT_QUEUE_NAME_OFFSET,Te(je[Ne.pm_queue_offset]|Be[Ne.pm_queue_len]))),Ne.pm_topic_len&&xe.push(me(0,R.LIGHT_TOPIC_NAME_OFFSET,Te(je[Ne.pm_topic_offset]|je[Ne.pm_topic_len]))),Ne.pm_corrtag!==null&&Ne.pm_corrtag!==void 0&&xe.push(me(0,R.LIGHT_CORRELATION,Ee(Ne.pm_corrtag))),Ne.pm_ad_ackimm&&xe.push(me(0,R.LIGHT_ACK_IMMEDIATELY,"")),Ne.pm_msg_priority!==null&&xe.push(Pe(0,R.MESSAGEPRIORITY,ce(Ne.pm_msg_priority))),Ne.pm_userdata!==null&&Ne.pm_userdata!==""&&xe.push(Pe(0,R.USERDATA,Ne.pm_userdata)),Ne.pm_username&&xe.push(Pe(0,R.USERNAME,se(Ne.pm_username))),Ne.pm_password&&xe.push(Pe(0,R.PASSWORD,se(Ne.pm_password))),Ne.pm_respcode&&xe.push(Pe(0,R.RESPONSE,he(Ne.pm_respcode)+Ne.pm_respstr)),Ne.pm_deliverymode!==null&&xe.push(Pe(0,R.DELIVERY_MODE,Re(Ne.pm_deliverymode))),Ne.pm_ad_msgid!==void 0&&(xe.push(Pe(2,R.ASSURED_MESSAGE_ID,ge(Ne.pm_ad_msgid))),xe.push(Pe(2,R.ASSURED_PREVMESSAGE_ID,ge(Ne.pm_ad_prevmsgid)))),Ne.pm_ad_flowid&&xe.push(Pe(0,R.ASSURED_FLOWID,he(Ne.pm_ad_flowid))),Ne.pm_ad_redelflag&&xe.push(Pe(0,R.ASSURED_REDELIVERED_FLAG,void 0)),Ne.pm_ad_ttl!==void 0&&xe.push(Pe(0,R.AD_TIMETOLIVE,ge(Ne.pm_ad_ttl))),Ne.pm_ad_publisherid&&xe.push(Pe(0,R.PUBLISHER_ID,he(Ne.pm_ad_publisherid))),Ne.pm_ad_publisherMsgId&&xe.push(Pe(0,R.PUBLISHER_MSGID,ge(Ne.pm_ad_publisherMsgId))),Ne.pm_content_summary&&xe.push(Pe(2,R.MESSAGE_CONTENT_SUMMARY,ee(Ne.pm_content_summary)));let He="",at=0;Ne.pm_oauth2_access_token&&(He+=H(0,B.OAUTH2_ACCESS_TOKEN,Ne.pm_oauth2_access_token),at=at||0),Ne.pm_oidc_id_token&&(He+=H(0,B.OIDC_ID_TOKEN,Ne.pm_oidc_id_token),at=at||0),Ne.pm_oauth2_issuer_identifier&&(He+=H(0,B.OAUTH2_ISSUER_IDENTIFIER,Ne.pm_oauth2_issuer_identifier),at=at||0),Ne.pm_ts_transport_context&&(He+=H(0,B.TS_TRANSPORT_CONTEXT,X(Ne.pm_ts_transport_context),Z.SIX),at=at||0),He.length>0&&xe.push(Pe(at,R.EXTENDED_TYPE_STREAM,He));const Ue=xe.join(""),At=12+Ue.length,qe=At+Ne.payloadLength;return Ne.setMessageSizes(At,Ne.payloadLength),he(et)+he(At)+he(qe)+Ue}const Gt={encodeCompoundMessage:function(Ne){let et="";var xe,He;Ne instanceof a.Message?(Ne.smfHeader||(Ne.smfHeader=new p(M.TRMSG,255)),xe=Ne,He=Ne._smfHeader,function(Ue,At){const qe=At;Ue._payload_is_memoized||P(Ue);const $t=Ue._memoized_csumm,Tt=Ue._memoized_payload;$t.length===0||$t.length===1&&$t[0].type===E.BINARY_ATTACHMENT||(qe.pm_content_summary=$t),qe.payload=Tt}(xe,He),function(Ue,At){const qe=At,$t=Ue.getDeliveryMode();qe.smf_dto=Ue.isDeliverToOne(),qe.pm_deliverymode=$t,qe.smf_adf=$t===a.MessageDeliveryModeType.DIRECT?0:1,qe.smf_di=Ue.isDiscardIndication(),qe.smf_elidingEligible=Ue.isElidingEligible(),qe.smf_deadMessageQueueEligible=Ue.isDMQEligible(),qe.pm_ad_flowid=Ue.getFlowId(),qe.pm_ad_publisherid=Ue.getPublisherId(),qe.pm_ad_publishermsgId=Ue.getPublisherMessageId(),qe.pm_ad_msgid=Ue.getGuaranteedMessageId(),qe.pm_ad_prevmsgid=Ue.getGuaranteedPreviousMessageId(),qe.pm_ad_ttl=Ue.getTimeToLive(),qe.pm_ad_ackimm=Ue.isAcknowledgeImmediately(),qe.pm_ad_redelflag=Ue.isRedelivered();const Tt=Ue.getTransportContext();Tt!=null&&(qe.pm_ts_transport_context=Tt.getEncodedTraceContext());const nn=Ue.getDestination();if(nn&&(qe.pm_tr_topicname_bytes=nn.getBytes(),nn.type===I.QUEUE||nn.type===I.TEMPORARY_QUEUE)){const{offset:In}=nn;qe.pm_queue_len=qe.pm_tr_topicname_bytes.length-In,qe.pm_queue_offset=In}qe.smf_priority=j.value.get(Ue.getUserCos()),Ue.getPriority()!==void 0&&typeof Ue.getPriority()=="number"&&Ue.getPriority()<=255&&Ue.getPriority()>=0?qe.pm_msg_priority=Ue.getPriority():qe.pm_msg_priority=null;const hn=Ue.getUserData();qe.pm_userdata=hn==null?null:Ue.getUserData()}(xe,He),et=Ne._smfHeader.payload):Ne instanceof C?et=A(Ne):Ne instanceof f?et=ie(Ne):Ne instanceof g||Ne instanceof m&&(et=N(Ne));const at=Ne.smfHeader;return at.setPayloadSize(et.length),ct(at)+et},encodeSMF:ct,adaptMessageToSmf_payloadMemoize:P};o.exports.Encode=Gt},760:(o,h,r)=>{const a=r(6247),{BidiMap:u,Lazy:l}=r(7444),{Bits:d,Convert:_}=r(9783),{ContentSummaryElement:p}=r(4970),{ContentSummaryType:f}=r(8283),{ErrorSubcode:S,OperationError:C}=r(6706),{LOG_ERROR:g}=r(2694),{SMFUH:m}=r(8247),{lazyValue:T}=l,{int8ToStr:y,int16ToStr:E,int24ToStr:I,int32ToStr:N}=_,A=T(()=>{const k=[[0,a.MessageDeliveryModeType.NON_PERSISTENT],[1,a.MessageDeliveryModeType.PERSISTENT],[2,a.MessageDeliveryModeType.DIRECT]].map(J=>[J[0],J[1]]);return new u(...k)}),L=T(()=>A.value.forward),D=T(()=>A.value.reverse),q=(()=>{const k=[],J=Math.pow(2,5);return m.values.forEach(F=>{k[F]=[];for(let $=0;$<J;++$){let R=0;R=d.set(R,F,6,2),R=d.set(R,$,0,5),k[F][$]=y(R)}}),k})(),Y=new Array(256).fill(null).map((k,J)=>y(J)),Q=(()=>{const k=[],J=Math.pow(2,3),F=Math.pow(2,2);return m.values.forEach($=>{k[$]=[];for(let R=0;R<J;++R){k[$][R]=[];for(let B=0;B<F;++B){let M=0;M=d.set(M,$,6,2),M=d.set(M,1,5,1),M=d.set(M,R,2,3),M=d.set(M,B,0,2),k[$][R][B]=y(M)}}}),k})(),W=[f.XML_META,f.XML_PAYLOAD,f.BINARY_ATTACHMENT,f.CID_LIST,f.BINARY_METADATA],x={FORCED_LENGTH_MODE:{FIVE:5,SIX:6},parseTopicQueueOffsets:function(k,J){const F=[];return F[0]=k.readUInt8(J),F[1]=k.readUInt8(J+1),F},parseResponseParam:function(k,J,F){const $=[];return $[0]=k.readInt32BE(J),$[1]=F>4?k.toString("latin1",J+4,J+F):"",$},parseDeliveryMode:function(k,J){const F=k.readUInt8(J),$=L.value.get(F);return $!==void 0?$:a.MessageDeliveryModeType.DIRECT},encDeliveryMode:function(k){const J=D.value.get(k);return y(J!==void 0?J:a.MessageDeliveryModeType.DIRECT)},parseContentSummary:function(k,J,F){const $=[];let R=0,B=J;for(;B<J+F;){const M=k.readUInt8(B),re=d.get(M,4,4),se=d.get(M,0,4);let fe=0;switch(se){case 2:fe=k.readUInt8(B+1);break;case 3:fe=k.readUInt16BE(B+1);break;case 4:fe=k.readUIntBE(B+1,3);break;case 5:fe=k.readInt32BE(B+1)}if(se===0)return g("Invalid content summary parameter - pos not advancing"),null;B+=se;const ce=W[re];ce===void 0&&g(`Unhandled element type ${re}`);const Te=new p(ce,R,fe);$.push(Te),R+=fe}return $},encContentSummary:function(k){const J=[];for(let F=0,$=k.length;F<$;++F){const R=k[F];let B="",M=d.set(0,R.type,4,4);R.length<=255?(M=d.set(M,2,0,4),B=y(R.length)):R.length<=65535?(M=d.set(M,3,0,4),B=E(R.length)):R.length<=16777215?(M=d.set(M,4,0,4),B=I(R.length)):(M=d.set(M,5,0,4),B=N(R.length)),J.push(y(M)),J.push(B)}return J.join("")},encodeSMFParam:function(k,J,F){if(F===void 0)return q[k][J]+Y[2];const $=F.length;return $<=253?q[k][J]+Y[$+2]+F:q[k][J]+Y[0]+N($+6)+F},encodeSMFExtendedParam:function(k,J,F,$=-1){let R=0;R=d.set(R,k?1:0,7,1);const B=F==null?0:F.length,M={0:0,1:1,2:2,4:3,8:4};let re=0,se="";if($!==x.FORCED_LENGTH_MODE.FIVE&&$!==x.FORCED_LENGTH_MODE.SIX&&($=-1),Object.prototype.hasOwnProperty.call(M,B))re=M[B];else if(B<253&&$!==x.FORCED_LENGTH_MODE.SIX||$===x.FORCED_LENGTH_MODE.FIVE)re=5,se=y(B+3);else{if(!(B<65532&&$!==x.FORCED_LENGTH_MODE.FIVE||$===x.FORCED_LENGTH_MODE.SIX))throw g(`Extended parameter type ${J} is too long (${B} bytes) `),new C(`Extended parameter (${J}) over the 2^16 byte limit`,S.PARAMETER_OUT_OF_RANGE);re=6,se=E(B+4)}R=d.set(R,re,4,3),R=d.set(R,J>>8,0,4);const fe=255&J;return y(R)+y(fe)+se+F},encLightSMFParam:function(k,J,F){return Q[k][J][F.length]+F}};o.exports.ParamParse=x},8103:(o,h,r)=>{const a=r(5017),{LOG_DEBUG:u,LOG_ERROR:l,LOG_INFO:d,LOG_TRACE:_}=r(2694),{Base64:p,Bits:f}=r(9783),{ParamParse:S}=r(760),{SMFHeader:C}=r(8247),{SMFParameterType:g,SMFExtendedParameterType:m}=r(7750),{decode:T}=p,{get:y}=f;function E(L,D){return!(L.length-D<12)}function I(L,D){if(!E(L,D))return!1;const q=7&L.readUInt8(D);return q===3||(l(`Invalid smf version in smf header, version=${q}`),!1)}function N(L,D,q,Y){let Q=q;for(;Q<q+Y;){if(Q+2>q+Y){l("Extended parameter stream had padding inside.");break}const W=D.readUInt8(Q),x=D.readUInt8(Q+1),k=y(W,7,1),J=y(W,4,3),F=(y(W,0,4)<<8)+x;Q+=2;const $={0:0,1:1,2:2,3:4,4:8};let R=0;if(Object.prototype.hasOwnProperty.call($,J))R=$[J];else if(J===5)R=D.readUInt8(Q)-3,Q++;else{if(J!==6)return l(`Invalid length mode ${J} in Extended Parameter type ${F}`),!1;R=D.readUInt16BE(Q)-4,Q+=2}switch(F){case g.AD_REDELIVERY_COUNT:L.pm_ad_redeliveryCount=D.readUInt32BE(Q);break;case g.AD_SPOOLER_UNIQUE_ID:L.pm_ad_spooler_unique_id=a.fromBits(D.readUInt32BE(Q+4),D.readUInt32BE(Q),!0);break;case g.AD_ACK_MESSAGE_ID:L.pm_ad_local_spooler_message_id=a.fromBits(D.readUInt32BE(Q+4),D.readUInt32BE(Q),!0);break;case g.AD_REPL_MATE_ACK_MSGID:L.pm_ad_replication_mate_ack_message_id=a.fromBits(D.readUInt32BE(Q+4),D.readUInt32BE(Q),!0);break;case m.TS_TRANSPORT_CONTEXT:R>=32&&(L.pm_ts_transport_context=D.toString("latin1",Q,Q+R));break;default:k===0||(L.discardMessage=!0)}Q+=R}return Q>q+Y&&l(`Last extended parameter ran beyond extended stream length by ${Q-(q+Y)}.`),!0}const A={isSMFHeaderAvailable:E,isSMFHeaderValid:I,isSMFAvailable:function(L,D){if(!I(L,D))return!1;const q=L.length-D;return L.readUInt32BE(D+8)<=q},parseSMFAt:function(L,D,q=!1){if(!I(L,D))return null;let Y=D;const Q=L.readUInt32BE(Y),W=L.readUInt32BE(Y+4),x=L.readUInt32BE(Y+8),k=new C;k.smf_di=y(Q,31,1),k.smf_elidingEligible=y(Q,30,1),k.smf_dto=y(Q,29,1),k.smf_adf=y(Q,28,1),k.smf_deadMessageQueueEligible=y(Q,27,1),k.smf_version=y(Q,24,3),k.smf_uh=y(Q,22,2),k.smf_protocol=y(Q,16,6),k.smf_priority=y(Q,12,4),k.smf_ttl=y(Q,0,8);const J=x-W;if(J<0)return l("SMF parse error: lost framing"),null;if(k.setMessageSizes(W,J),q)return k;Y+=12;const F=D+W;for(;Y<F;){const $=L.readUInt8(Y);++Y;const R=y($,6,2);if(y($,5,1)!==0){const B=y($,2,3),M=y($,0,2)+1,re=M-1;if(M<=0)return l("Invalid lightweight parameter length"),null;switch(B){case g.LIGHT_CORRELATION:k.pm_corrtag=L.readUIntBE(Y,3);break;case g.LIGHT_TOPIC_NAME_OFFSET:{const se=S.parseTopicQueueOffsets(L,Y);k.pm_queue_offset=se[0],k.pm_queue_len=se[1];break}case g.LIGHT_QUEUE_NAME_OFFSET:{const se=S.parseTopicQueueOffsets(L,Y);k.pm_topic_offset=se[0],k.pm_topic_len=se[1];break}case g.LIGHT_ACK_IMMEDIATELY:k.pm_ad_ackimm=!!L.readUInt8(Y);break;default:R===0||(k.discardMessage=!0)}Y+=re}else{const B=Y,M=y($,0,5);if(M===0)break;let re,se=L.readUInt8(Y);if(Y++,se===0?(se=L.readUInt32BE(Y),Y+=4,re=se-6):re=se-2,se<=0)return l(`Invalid regular parameter length ${se}/${re} with suspect type ${g.describe(M)} at parameter at position ${B}`),null;switch(M){case g.PUBLISHER_ID:break;case g.PUBLISHER_MSGID:k.pm_ad_publishermsgid=a.fromBits(L.readUInt32BE(Y+4),L.readUInt32BE(Y),!0);break;case g.MESSAGEPRIORITY:k.pm_msg_priority=L.readUInt8(Y);break;case g.USERDATA:k.pm_userdata=L.toString("latin1",Y,Y+re);break;case g.USERNAME:k.pm_username=T(L.toString("latin1",Y,Y+re));break;case g.PASSWORD:k.pm_password=T(L.toString("latin1",Y,Y+re));break;case g.RESPONSE:{const fe=S.parseResponseParam(L,Y,re);k.pm_respcode=fe[0],k.pm_respstr=fe[1];break}case g.SUB_ID_LIST:case g.GENERIC_ATTACHMENT:case g.BINARY_ATTACHMENT:d("Skipping deprecated parameter type");break;case g.DELIVERY_MODE:k.smf_adf&&(k.pm_deliverymode=S.parseDeliveryMode(L,Y));break;case g.ASSURED_MESSAGE_ID:k.pm_ad_msgid=a.fromBits(L.readUInt32BE(Y+4),L.readUInt32BE(Y),!0);break;case g.ASSURED_PREVMESSAGE_ID:k.pm_ad_prevmsgid=a.fromBits(L.readUInt32BE(Y+4),L.readUInt32BE(Y),!0);break;case g.ASSURED_REDELIVERED_FLAG:k.pm_ad_redelflag=!0;break;case g.AD_TIMETOLIVE:k.pm_ad_ttl=a.fromBits(L.readUInt32BE(Y+4),L.readUInt32BE(Y),!0);break;case g.AD_TOPICSEQUENCE_NUMBER:k.pm_ad_topicSequenceNumber=a.fromBits(L.readUInt32BE(Y+4),L.readUInt32BE(Y),!0);break;case g.MESSAGE_CONTENT_SUMMARY:{const fe=S.parseContentSummary(L,Y,re);if(!fe)return l(`Invalid message content summary at ${Y}, len ${re}`),!1;k.pm_content_summary=fe;break}case g.ASSURED_FLOWID:k.pm_ad_flowid=L.readUInt32BE(Y);break;case g.TR_TOPICNAME:k.pm_tr_topicname_bytes=L.toString("latin1",Y,Y+re);break;case g.AD_FLOWREDELIVERED_FLAG:k.pm_ad_flowredelflag=!0;break;case g.EXTENDED_TYPE_STREAM:if(!N(k,L,Y,re))return null;break;default:R===0||(k.discardMessage=!0)}Y+=re}}return k}};o.exports.ParseSMF=A},394:(o,h,r)=>{const a=r(6247),{BidiMap:u}=r(7444);o.exports.PriorityUserCosMap=class extends u{constructor(){super([a.MessageUserCosType.COS1,0],[a.MessageUserCosType.COS2,1],[a.MessageUserCosType.COS3,2])}}},9963:(o,h,r)=>{const{Bits:a,Convert:u}=r(9783);r(2694);const{SMFSMPMessageType:l}=r(3647),{SMPMessage:d}=r(8247),{get:_,set:p}=a,{int8ToStr:f,int32ToStr:S}=u,C={parseSMPAt:function(g,m){if(m+6>g.length)return!1;let T=m;const y=g.readUInt8(T);T++;const E=_(y,0,7),I=new d;if(E!==l.ADDSUBSCRIPTION&&E!==l.REMSUBSCRIPTION&&E!==l.ADDQUEUESUBSCRIPTION&&E!==l.REMQUEUESUBSCRIPTION)return!1;g.toString("latin1");const N=g.readUInt32BE(T);if(T+=4,m+N>g.length)return!1;const A=g.readUInt8(T);if(T++,I.msgType=E,I.smpFlags=A,E===l.ADDSUBSCRIPTION||E===l.REMSUBSCRIPTION)I.encodedUtf8Subscription=g.toString("latin1",T,T+N-6);else{const L=g.readUInt8(T);T++,I.encodedUtf8QueueName=g.toString("latin1",T,T+L),T+=L;const D=g.readUInt8(T);T++,I.encodedUtf8Subscription=g.toString("latin1",T,T+D),T+=D}return I},encSmp:function(g){if(g.msgType!==l.ADDSUBSCRIPTION&&g.msgType!==l.REMSUBSCRIPTION&&g.msgType!==l.ADDQUEUESUBSCRIPTION&&g.msgType!==l.REMQUEUESUBSCRIPTION)return!1;const m=[];let T=0;T=p(T,1,7,1),T=p(T,g.msgType,0,7),m.push(f(T));let y=6+g.encodedUtf8Subscription.length;return g.msgType!==l.ADDQUEUESUBSCRIPTION&&g.msgType!==l.REMQUEUESUBSCRIPTION||(y+=2+g.encodedUtf8QueueName.length),m.push(S(y)),m.push(f(g.smpFlags)),(g.msgType===l.ADDQUEUESUBSCRIPTION||g.msgType===l.REMQUEUESUBSCRIPTION)&&(m.push(f(g.encodedUtf8QueueName.length)),m.push(g.encodedUtf8QueueName),m.push(f(g.encodedUtf8Subscription.length))),m.push(g.encodedUtf8Subscription),m.join("")}};o.exports.SMP=C},2318:(o,h,r)=>{const{Bits:a,Convert:u}=r(9783),{Lazy:l}=r(7444),{LOG_ERROR:d}=r(2694),{SMFTransportSessionMessageType:_}=r(1643),{TransportSMFMessage:p}=r(8247),{get:f}=a,{int16ToStr:S,int32ToStr:C}=u,{lazyValue:g}=l;function m(D,q){return D.length-q}function T(D,q,Y){let Q=q;if(m(D,Q)<10)return d("TsSmf parse failed: not enough data, expected at least 10B"),!1;const W=new p;W.smfHeader=Y;const x=D.readUInt16BE(Q);Q+=2,W.uh=f(x,15,1),W.messageType=f(x,8,7);const k=f(x,0,8);if(W.tsHeaderLength=k,W.sessionId=D.toString("latin1",Q,Q+8),Q+=8,W.messageType===_.CREATE_RESP){const J=D.readUInt8(Q);if(Q++,m(D,Q)<J)return d(`TsSmf parse failed: not enough data for RouterTag, expected ${J}B`),!1;W.routerTag=D.toString("latin1",Q,Q+J),Q+=J}return Q=q+k,Y.payloadLength===4294967295?W.payloadLength=Y.payloadLength:W.payloadLength=Y.payloadLength-k,W}const y=g(()=>C(51642369)+C(12)),E=g(()=>y.value+C(22)+S(33290)),I=g(()=>y.value+C(22)+S(32778)+C(0)+C(0)),N=g(()=>C(60030977)+C(12)+C(22)+S(34058)),A=g(()=>C(60030977)+C(12)+C(24)+S(34316)),L={genTsCreateHeader:function(){return I.value},genTsDestroyHeader:function(D){return E.value+D},genTsDataTokenMsg:function(D){return N.value+D},genTsDataStreamTokenMsg:function(D,q){return A.value+D+S(q&&q>0?q:0)},genTsDataMsgHeaderParts:function(D){return[C(60030977)+C(12),S(33802)+D]},parseTsSmfHdrAt:T,parseTsSmfMsgAt:function(D,q,Y){const Q=T(D,q,Y);if(!Q)return null;const W=q+Q.tsHeaderLength;return m(D,W)<Q.payloadLength?(d(`Couldn't read full encapsulated TsSmf payload, expected ${Q.payloadLength}B`),null):(Q.payload=D.slice(W,W+Q.payloadLength),Q)}};o.exports.Transport=L},9812:(o,h,r)=>{const{BaseMessage:a}=r(8668),{Convert:u,Long:l}=r(9783),{DestinationType:d}=r(9620),{LOG_TRACE:_,LOG_INFO:p}=r(2694),{OperationError:f}=r(6706),{QueueAccessType:S,QueueDiscardBehavior:C}=r(9631),{QueuePermissions:g,QueueType:m}=r(9631),{ReplayStartType:T}=r(9309),{MessageOutcome:y}=r(6247),{SMFAdProtocolMessageType:E}=r(7250),{SMFAdProtocolParam:I}=r(5099),{SMFHeader:N}=r(9731),{SMFParameter:A}=r(1123),{SMFProtocol:L}=r(5052),{SMFUH:D}=r(8379),{StringUtils:q}=r(968),Y=r(8287).hp,{strToInt8:Q,strToInt16:W,strToUInt32:x,strToUInt64:k}=u,J=Y.prototype.readUInt8,F=Y.prototype.readUInt16BE,$=Y.prototype.readUInt32BE,R=function(ae){return l.fromBits(this.readUInt32BE(ae+4),this.readUInt32BE(ae),!0)},{nullTerminate:B,stripNullTerminate:M}=q,re={[d.TOPIC]:I.DTENAME,[d.QUEUE]:I.QUEUENAME},se={[m.TOPIC_ENDPOINT]:I.DTENAME,[m.QUEUE]:I.QUEUENAME},fe={[g.NONE]:0,[g.READ_ONLY]:1,[g.CONSUME]:3,[g.MODIFY_TOPIC]:7,[g.DELETE]:15},ce={1:S.EXCLUSIVE,2:S.NONEXCLUSIVE},Te={[S.EXCLUSIVE]:1,[S.NONEXCLUSIVE]:2},Ee={1:!0,2:!1,3:!1},he={[C.NOTIFY_SENDER_OFF]:1,[C.NOTIFY_SENDER_ON]:2};function ge(ae,ee,Re=!1){if(!ee)return;const{accessType:me,discardBehavior:Pe,maxMessageRedelivery:H,maxMessageSize:Z,permissions:te,quotaMB:ie,respectsTTL:j}=ee;te&&fe[te]!==void 0&&ae.addParameter(new A(D.IGNORE,I.EP_ALLOTHER_PERMISSION,fe[te])),Re||me===void 0||Te[me]===void 0||ae.addParameter(new A(D.IGNORE,I.ACCESSTYPE,Te[me])),ie!=null&&ae.addParameter(new A(D.IGNORE,I.EP_QUOTA,ie)),Z!=null&&ae.addParameter(new A(D.IGNORE,I.EP_MAX_MSGSIZE,Z));let Oe=0;Pe!=null&&(Oe|=he[Pe]<<12),Oe&&ae.addParameter(new A(D.IGNORE,I.EP_BEHAVIOUR,Oe)),H!=null&&ae.addParameter(new A(D.IGNORE,I.MAX_REDELIVERY,H)),j!=null&&ae.addParameter(new A(D.IGNORE,I.EP_RESPECTS_TTL,j?1:0))}class X extends a{constructor(ee=0,Re=3){super(new N(L.ADCTRL,1)),this.msgType=ee,this.version=Re}_readParameter(ee,Re=null,me=null){const Pe=this.getParameter(ee);if(Pe===void 0)return;if(me&&Pe.getBuffer())return me.call(Pe.getBuffer(),Pe.getBegin());const H=Pe.getValue();return Re?Re(H):H}getAccessType(){const ee=this._readParameter(I.ACCESSTYPE,Q,J);return ce[ee]}getDurability(){const ee=this._readParameter(I.EP_DURABLE,Q,J);return ee===3&&p("Non durable reliable queue. This does not happen often."),Ee[ee]}getActiveFlow(){return this._readParameter(I.ACTIVE_FLOW_INDICATION,Q,J)}getQueueDiscardBehavior(){const ee=this._readParameter(I.EP_BEHAVIOUR,W,F);if(ee===void 0)return;const Re=(12288&ee)>>12;return Re===he[C.NOTIFY_SENDER_OFF]?C.NOTIFY_SENDER_OFF:Re===he[C.NOTIFY_SENDER_ON]?C.NOTIFY_SENDER_ON:void 0}getEndpointDeliveryCountSent(){switch((3072&this._readParameter(I.EP_BEHAVIOUR,W,F))>>10){case 0:default:return;case 1:return!1;case 2:return!0}}getEndpointId(){return this._readParameter(I.ENDPOINT_ID,x,$)}getRespectsTTL(){const ee=this._readParameter(I.EP_RESPECTS_TTL,Q,J);if(ee!==void 0)return!!ee}getFlowName(){return this._readParameter(I.FLOWNAME,M)}getFlowId(){return this._readParameter(I.FLOWID,x,$)}getQuota(){return this._readParameter(I.EP_QUOTA,x,$)}getMaxMsgSize(){return this._readParameter(I.EP_MAX_MSGSIZE,x,$)}getTopicEndpointBytes(){return this._readParameter(I.DTENAME)}getQueueNameBytes(){return this._readParameter(I.QUEUENAME)}getGrantedPermissions(){const ee=this._readParameter(I.GRANTED_PERMISSIONS,x,$);let Re;return Object.keys(fe).forEach(me=>{fe[me]===ee&&(Re=me)}),Re}getAllOthersPermissions(){const ee=this._readParameter(I.EP_ALLOTHER_PERMISSION,x,$);let Re;return Object.keys(fe).forEach(me=>{fe[me]===ee&&(Re=me)}),Re}getLastMsgIdAcked(){return this._readParameter(I.LASTMSGIDACKED,k,R)}getLastMsgIdReceived(){return this._readParameter(I.LASTMSGIDRECEIVED,k,R)}getPublisherId(){return this._readParameter(I.PUBLISHER_ID,x,$)}getWantFlowChangeNotify(){return!!this._readParameter(I.WANT_FLOW_CHANGE_NOTIFY,Q,J)}getWindow(){return this._readParameter(I.WINDOW,Q,J)}getMaxRedelivery(){return this._readParameter(I.MAX_REDELIVERY,Q,J)}getMaxUnackedMessages(){return this._readParameter(I.MAX_DELIVERED_UNACKED_MESSAGES_PER_FLOW,x,$)}getEndpointErrorId(){return this._readParameter(I.ENDPOINT_ERROR_ID,k,R)}getPartitionGroupId(){return this._readParameter(I.PARTITION_GROUP_ID,W,F)}getSpoolerUniqueId(){return this._readParameter(I.SPOOLER_UNIQUE_ID,k,R)}static getCloseMessagePublisher(ee,Re){const me=new X(E.CLOSEPUBFLOW);return me.smfHeader.pm_corrtag=Re,me.addParameter(new A(D.REJECT,I.FLOWID,ee)),me}static getCreate(ee,Re,me){const Pe=new X(E.CREATE);Pe.smfHeader.pm_corrtag=me;const H=se[ee.type];if(H===void 0)throw new f("Unknown destination type");return Pe.addParameter(new A(D.REJECT,H,B(ee.name))),Pe.addParameter(new A(D.IGNORE,I.EP_DURABLE,ee.durable?1:2)),ge(Pe,Re),Pe}static getDelete(ee,Re){const me=new X(E.DELETE);me.smfHeader.pm_corrtag=Re;const Pe=se[ee.type];if(Pe===void 0)throw new f("Unknown destination type");return me.addParameter(new A(D.REJECT,Pe,B(ee.name))),me}static getOpenMessagePublisher(ee,Re,me,Pe,H){const Z=new X(E.OPENPUBFLOW);return Z.smfHeader.pm_corrtag=H,ee!==void 0&&Z.addParameter(new A(D.REJECT,I.LASTMSGIDACKED,ee)),Re!==void 0&&Z.addParameter(new A(D.REJECT,I.LASTMSGIDSENT,Re)),Z.addParameter(new A(D.REJECT,I.WINDOW,me)),Z.addParameter(new A(D.IGNORE,I.FLOWNAME,Pe||"")),Z}static getOpenMessageConsumer(ee,Re,me,Pe,H,Z,te,ie,j=l.UZERO,Oe=l.UZERO,v=!1,P=void 0,O=void 0,U=void 0,V=!1){const z=ee.durable,ne=me.bytes,de=me.type,_e=new X(E.BIND);_e.smfHeader.pm_corrtag=H;const we=re[de];if(we===void 0)throw new f("Unknown destination type");if(_e.addParameter(new A(D.REJECT,we,ne)),Pe&&_e.addParameter(new A(D.REJECT,I.TOPICNAME,Pe.bytes)),de===d.QUEUE&&(_e.addParameter(new A(D.REJECT,I.LASTMSGIDACKED,j)),_e.addParameter(new A(D.IGNORE,I.LASTMSGIDRECEIVED,Oe))),_e.addParameter(new A(D.REJECT,I.WINDOW,Z)),_e.addParameter(new A(D.IGNORE,I.EP_DURABLE,z)),ge(_e,Re,!0),te&&_e.addParameter(new A(D.REJECT,I.NOLOCAL,1)),ie&&_e.addParameter(new A(D.IGNORE,I.WANT_FLOW_CHANGE_NOTIFY,1)),V?_e.addParameter(new A(D.REJECT,I.FLOWTYPE,3)):v&&_e.addParameter(new A(D.REJECT,I.FLOWTYPE,2)),P!==void 0){let oe=P._replayStartValue;P._type===T.DATE&&(oe=l.fromNumber(P._replayStartValue,!0).multiply(1e6)),_e.addParameter(new A(D.REJECT,I.REPLAY_START_LOCATION,{type:P._type,value:oe}))}return O!==void 0&&_e.addParameter(new A(D.IGNORE,I.ENDPOINT_ERROR_ID,O)),U!=null&&_e.addParameter(new A(D.IGNORE,I.PARTITION_GROUP_ID,U)),_e}static getCloseMessageConsumer(ee,Re){const me=new X(E.UNBIND);return me.smfHeader.pm_corrtag=Re,me.addParameter(new A(D.REJECT,I.FLOWID,ee)),me}static getDTEUnsubscribeMessage(ee,Re){const me=new X(E.UNSUBSCRIBE);return me.smfHeader.pm_corrtag=ee,me.addParameter(new A(D.REJECT,I.DTENAME,Re.getBytes())),me}static getAck(ee,Re=void 0,me=void 0,Pe=void 0){const H=new X(E.CLIENTACK);if(H.addParameter(new A(D.REJECT,I.FLOWID,ee)),Re&&H.addParameter(new A(D.REJECT,I.LASTMSGIDACKED,Re)),me!=null&&H.addParameter(new A(D.REJECT,me<=255?I.WINDOW:I.TRANSPORT_WINDOW,me)),Pe&&Pe.size>0){let Z=0;const te=y.values;for(let ie=0;ie<te.length;ie++)Z+=Pe.has(te[ie])?Pe.get(te[ie]).length:0;if(Z>X.MAX_CLIENT_ACK_RANGES)throw new f("Application ack range count exceeds limit of 64");H.addParameter(new A(D.REJECT,I.APPLICATION_ACK,Pe))}return H}static getUnbindAck(ee,Re=void 0,me=void 0){const Pe=new X(E.UNBIND);return Pe.addParameter(new A(D.REJECT,I.FLOWID,ee)),Re&&Pe.addParameter(new A(D.IGNORE,I.ENDPOINT_ERROR_ID,Re)),Pe}}X.MAX_CLIENT_ACK_RANGES=64,o.exports.AdProtocolMessage=X},8247:(o,h,r)=>{const{AdProtocolMessage:a}=r(9812),{BinaryMetaBlock:u}=r(818),{ClientCtrlMessage:l}=r(6670),{KeepAliveMessage:d}=r(3188),{SMFHeader:_}=r(9731),{SMFParameter:p}=r(1123),{SMFUH:f}=r(8379),{SMPMessage:S}=r(2989),{TransportSMFMessage:C}=r(4527);o.exports.AdProtocolMessage=a,o.exports.BinaryMetaBlock=u,o.exports.ClientCtrlMessage=l,o.exports.KeepAliveMessage=d,o.exports.SMFHeader=_,o.exports.SMFParameter=p,o.exports.SMFUH=f,o.exports.SMPMessage=S,o.exports.TransportSMFMessage=C},8668:o=>{o.exports.BaseMessage=class{constructor(h=null,r=[]){this._smfHeader=h,this._parameters=r}addParameter(h){this._parameters[h.getType()]=h}getParameter(h){return this._parameters[h]}getParameterArray(){return this._parameters}get smfHeader(){return this._smfHeader}set smfHeader(h){this._smfHeader=h}getResponse(){const h=this.smfHeader;return h&&h.pm_respcode&&h.pm_respstr?{responseCode:h.pm_respcode,responseString:h.pm_respstr}:null}}},818:(o,h,r)=>{const{Bits:a,Convert:u}=r(9783),{get:l}=a,{int8ToStr:d,int24ToStr:_}=u;class p{constructor(S,C){this.type=S,this.payload=C}asEncodedSmf(){const S=[];return S.push(d(1)),S.push(d(this.type)),S.push(_(this.payload.length)),S.push(this.payload.toString("latin1")),S.join("")}static fromEncodedSmf(S,C=0){if(S.length-C<6)return null;const g=S.readUInt8(C),m=S.readInt32BE(C+1),T=l(m,24,8),y=l(m,0,24),E=4*g+1,I=S.slice(C+E,C+E+y);return new p(T,I)}}o.exports.BinaryMetaBlock=p},6670:(o,h,r)=>{const{AuthenticationScheme:a,CapabilityType:u,ClientCapabilityType:l,MutableSessionProperty:d,SessionProperties:_}=r(5024),{BaseMessage:p}=r(8668),{Bits:f,Convert:S}=r(9783),{DestinationType:C,DestinationUtil:g}=r(9620),{ErrorSubcode:m,OperationError:T}=r(6706),{Process:y,StringUtils:E,Version:I}=r(968),{SMFClientCtrlMessageType:N}=r(9640),{SMFClientCtrlParam:A,SMFClientCtrlAuthType:L}=r(9685),{SMFHeader:D}=r(9731),{SMFParameter:q}=r(1123),{SMFProtocol:Y}=r(5052);r(2694);const{get:Q,set:W}=f,{int8ToStr:x,strToInt8:k,int16ToStr:J,int32ToStr:F,strToInt16:$,strToInt32:R}=S,{nullTerminate:B,stripNullTerminate:M}=E,{validateAndEncode:re}=g,se=[u.JNDI,u.COMPRESSION,u.GUARANTEED_MESSAGE_CONSUME,u.TEMPORARY_ENDPOINT,u.GUARANTEED_MESSAGE_PUBLISH,u.GUARANTEED_MESSAGE_BROWSE,u.ENDPOINT_MGMT,u.SELECTOR,u.ENDPOINT_MESSAGE_TTL,u.QUEUE_SUBSCRIPTIONS,null,u.SUBSCRIPTION_MANAGER,u.MESSAGE_ELIDING,u.TRANSACTED_SESSION,u.NO_LOCAL,u.ACTIVE_CONSUMER_INDICATION,u.PER_TOPIC_SEQUENCE_NUMBERING,u.ENDPOINT_DISCARD_BEHAVIOR,u.CUT_THROUGH,null,u.MESSAGE_REPLAY,u.COMPRESSED_SSL,null,u.SHARED_SUBSCRIPTIONS,u.BR_REPLAY_ERRORID,u.AD_APP_ACK_FAILED,u.VAR_LEN_EXT_PARAM],fe=new Map([[l.UNBIND_ACK,128],[l.BR_ERRORID,64],[l.PQ,32]]);class ce extends p{constructor(Ee=0){super(new D(Y.CLIENTCTRL,1)),this.msgType=Ee,this.version=1}getP2PTopicValue(){const Ee=this.getParameter(A.P2PTOPIC);return Ee?M(Ee.getValue()):null}getVpnNameInUseValue(){const Ee=this.getParameter(A.MSGVPNNAME);return Ee?M(Ee.getValue()):null}getVridInUseValue(){const Ee=this.getParameter(A.VRIDNAME);return Ee?M(Ee.getValue()):null}getUserIdValue(){const Ee=this.getParameter(A.USERID);return Ee?M(Ee.getValue()):null}getRouterCapabilities(){let Ee=[],he=this.getParameter(A.ROUTER_CAPABILITIES);return he&&(Ee=ce.prmParseCapabilitiesValue(he.getValue(),Ee)),he=this.getParameter(A.SOFTWAREVERSION),he&&(Ee[u.PEER_SOFTWARE_VERSION]=M(he.getValue())),he=this.getParameter(A.SOFTWAREDATE),he&&(Ee[u.PEER_SOFTWARE_DATE]=M(he.getValue())),he=this.getParameter(A.PLATFORM),he&&(Ee[u.PEER_PLATFORM]=M(he.getValue())),he=this.getParameter(A.PHYSICALROUTERNAME),he&&(Ee[u.PEER_ROUTER_NAME]=M(he.getValue())),Ee}static prmGetDtoPriorityValue(Ee){if(Ee.local===void 0||Ee.network===void 0)return!1;let he=0;return he=W(he,Ee.local,8,8),he=W(he,Ee.network,0,8),J(he)}static prmParseDtoPriorityValue(Ee){const he={},ge=$(Ee.substr(0,2));return he.local=Q(ge,8,8),he.network=Q(ge,0,8),he}static prmParseCapabilitiesValue(Ee,he){const ge=he;if(!Ee||!ge)return!1;const X=u;let ae=0;const ee=k(Ee[ae]);let Re;++ae;for(let me=0;me<ee;++me){const Pe=7&me;Pe===0&&(Re=k(Ee[ae]),++ae);const H=se[me];H&&(ge[H]=!!Q(Re,7-Pe,1))}for(let me=0;ae<Ee.length&&me<500;++me){const Pe=k(Ee[ae]);ae++;const H=R(Ee.substr(ae,4))-5;ae+=4;const Z=Ee.substr(ae,H);switch(ae+=H,Pe){case 0:ge[X.PEER_PORT_SPEED]=Z.length===4?R(Z):0;break;case 1:ge[X.PEER_PORT_TYPE]=Z.length===1?k(Z):0;break;case 2:ge[X.MAX_GUARANTEED_MSG_SIZE]=Z.length===4?R(Z):0;break;case 3:ge[X.MAX_DIRECT_MSG_SIZE]=Z.length===4?R(Z):0}}return ge}static getLogin(Ee,he,ge,X){if(!(Ee instanceof _))return!1;const ae=new ce(N.LOGIN),ee=ae._smfHeader,Re=Ee.authenticationScheme===a.CLIENT_CERTIFICATE;ee.pm_corrtag=X,Ee.password&&!Re&&(ee.pm_password=Ee.password),Ee.userName&&(ee.pm_username=Ee.userName),Ee.subscriberLocalPriority&&Ee.subscriberNetworkPriority&&ae.addParameter(new q(0,A.DELIVERTOONEPRIORITY,ce.prmGetDtoPriorityValue({local:Ee.subscriberLocalPriority,network:Ee.subscriberNetworkPriority}))),Ee.vpnName&&Ee.vpnName.length>0&&ae.addParameter(new q(1,A.MSGVPNNAME,B(Ee.vpnName))),Ee.applicationDescription&&Ee.applicationDescription.length>0&&ae.addParameter(new q(0,A.CLIENTDESC,B(Ee.applicationDescription))),Ee.userIdentification&&Ee.userIdentification.length>0&&ae.addParameter(new q(0,A.USERID,B(Ee.userIdentification))),Ee.authenticationScheme===a.OAUTH2&&(ae.addParameter(new q(1,A.AUTHENTICATION_SCHEME,L.OAUTH2)),Ee.idToken&&(ee.pm_oidc_id_token=B(Ee.idToken)),Ee.accessToken&&(ee.pm_oauth2_access_token=B(Ee.accessToken)),Ee.issuerIdentifier&&(ee.pm_oauth2_issuer_identifier=B(Ee.issuerIdentifier))),ae.addParameter(new q(0,A.CLIENTNAME,B(Ee.clientName))),ae.addParameter(new q(0,A.PLATFORM,B(`${y.platform} - JS API (${I.mode})`))),Ee.noLocal&&ae.addParameter(new q(0,A.NO_LOCAL,"")),Re&&ae.addParameter(new q(1,A.AUTHENTICATION_SCHEME,L.CLIENT_CERTIFICATE)),ae.addParameter(new q(0,A.SOFTWAREDATE,B(I.formattedDate))),ae.addParameter(new q(0,A.SOFTWAREVERSION,B(I.version))),he&&ge?ae.addParameter(new q(1,A.SSL_DOWNGRADE,"")):he?ae.addParameter(new q(1,A.SSL_DOWNGRADE,"")):ge&&ae.addParameter(new q(1,A.SSL_DOWNGRADE,"\0"));const me=function(H){const Z=Math.max.apply(null,H)+1;let te=0;return H.forEach(ie=>{te+=fe.get(ie)}),x(Z)+x(te)}([l.UNBIND_ACK,l.BR_ERRORID,l.PQ]);ae.addParameter(new q(0,A.CLIENT_CAPABILITIES,me));const Pe=F(Ee.keepAliveIntervalInMsecs/1e3);return ae.addParameter(new q(0,A.KEEP_ALIVE_INTERVAL,Pe)),ae}static getUpdate(Ee,he,ge){const X=new ce(N.UPDATE);if(X.smfHeader.pm_corrtag=ge,Ee===d.CLIENT_DESCRIPTION){const ae=(he||"").toString().substr(0,250);X.addParameter(new q(0,A.CLIENTDESC,B(ae)))}else if(Ee===d.CLIENT_NAME){const ae=ce.validateClientName(he,ee=>new T(`Invalid clientName: ${ee}`,m.PARAMETER_OUT_OF_RANGE));if(ae)throw ae;X.addParameter(new q(0,A.CLIENTNAME,B(he)))}return X}static validateClientName(Ee,he){const ge=re(C.TOPIC,Ee,he);return ge.error?ge.error:ge.bytes.length>161?he("Client Name too long (max length: 160)."):null}}o.exports.ClientCtrlMessage=ce},3188:(o,h,r)=>{const{BaseMessage:a}=r(8668),{SMFHeader:u}=r(9731),{SMFProtocol:l}=r(5052);o.exports.KeepAliveMessage=class extends a{constructor(){super(new u(l.KEEPALIVEV2,2)),this._smfHeader.smf_uh=2}}},9731:o=>{o.exports.SMFHeader=class{constructor(h=0,r=0){this._parameters=[],this.smf_version=3,this.smf_uh=0,this.smf_protocol=h,this.smf_priority=0,this.smf_ttl=r,this.smf_msgLen=0,this.smf_di=0,this.smf_tqd=0,this.smf_elidingEligible=0,this.smf_dto=0,this.smf_adf=0,this.smf_deadMessageQueueEligible=0,this.pm_userdata=null,this.pm_respcode=0,this.pm_respstr=null,this.pm_username=null,this.pm_password=null,this.pm_tr_topicname_bytes=null,this.pm_deliverymode=null,this.pm_ad_msgid=void 0,this.pm_ad_prevmsgid=void 0,this.pm_ad_redelflag=0,this.pm_ad_flowredelflag=0,this.pm_ad_ttl=void 0,this.pm_ad_ackimm=void 0,this.pm_ad_flowid=0,this.pm_ad_publisherid=0,this.pm_ad_publishermsgid=0,this.pm_content_summary=null,this.pm_corrtag=null,this.pm_topic_offset=0,this.pm_topic_len=0,this.pm_queue_offset=0,this.pm_queue_len=0,this.pm_msg_priority=null,this.pm_oauth2_access_token=null,this.pm_oidc_id_token=null,this.pm_oauth2_issuer_identifier=null,this.pm_ts_transport_context=null,this.unknownProtoFlag=!1,this.messageLength=0,this.payloadLength=0,this.headerLength=0,this.payload=null,this.discardMessage=!1}setMessageSizes(h,r){this.headerLength=h,this.payloadLength=r,this.messageLength=h+r}setPayloadSize(h){this.payloadLength=h}}},1123:o=>{o.exports.SMFParameter=class{constructor(h,r,a,u,l,d){this._type=r,this._value=a,this._uh=h,this._buffer=u,this._begin=l,this._end=d}getType(){return this._type}getValue(){return this._buffer&&!this._value?this._buffer.toString("latin1",this._begin,this._end):this._value}getUh(){return this._uh}getBuffer(){return this._buffer}getBegin(){return this._begin}getEnd(){return this._end}toString(){return`${this._uh}:0x${this._type.toString(16)} = ${this.getValue()}`}}},8379:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SMFUH=a.new({IGNORE:0,REJECT:2})},2989:(o,h,r)=>{const{assert:a}=r(7444),{BaseMessage:u}=r(8668),{Destination:l,DestinationUtil:d}=r(9620),{SMFHeader:_}=r(9731),{SMFProtocol:p}=r(5052),{SMFSMPMessageType:f}=r(3647),{SMFSMPMessageTypeFlags:S}=r(1278);class C extends u{constructor(){super(new _(p.SMP,1)),this.msgType=0,this.encodedUtf8Subscription=null,this.encodedUtf8QueueName=null,this.smpFlags=0|S.SMF_SMP_FLAG_TOPIC,this._encodedQueueName=null,this._encodedClientName=null}isFlag(m){return this.smpFlags&m}setFlag(m,T){T?this.smpFlags|=m:this.smpFlags&=~m}static getSubscriptionMessage(m,T,y,E){a(T instanceof l,"Topics are not UCS-2 strings. Pass a Topic object.");const I=new C;return I.msgType=y?f.ADDSUBSCRIPTION:f.REMSUBSCRIPTION,I.encodedUtf8Subscription=T.getBytes(),a(I.encodedUtf8Subscription,"Topic had no encoding"),I.setFlag(S.SMF_SMP_FLAG_TOPIC,!0),E&&I.setFlag(S.SMF_SMP_FLAG_RESPREQUIRED,!0),I._smfHeader.pm_corrtag=m,I}static getQueueSubscriptionMessage(m,T,y,E){a(T instanceof l,"Topics are not UCS-2 strings. Pass a Topic object.");const I=new C;return I.msgType=E?f.ADDQUEUESUBSCRIPTION:f.REMQUEUESUBSCRIPTION,I.encodedUtf8QueueName=d.encodeBytes(y.getName()),I.encodedUtf8Subscription=T.getBytes(),a(I.encodedUtf8Subscription,"Topic had no encoding"),a(I.encodedUtf8QueueName,"Queue had no encoding"),I.setFlag(S.SMF_SMP_FLAG_TOPIC,!0),I.setFlag(S.SMF_SMP_FLAG_RESPREQUIRED,!0),I.setFlag(S.SMF_SMP_FLAG_PERSIST,!0),I._smfHeader.pm_corrtag=m,I}}o.exports.SMPMessage=C},4527:(o,h,r)=>{const{BaseMessage:a}=r(8668);o.exports.TransportSMFMessage=class extends a{constructor(){super(null,null),this.uh=0,this.messageType=null,this.sessionId=null,this.routerTag=null,this.payload=null,this.payloadLength=0,this.tsHeaderLength=0}}},7250:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SMFAdProtocolMessageType=a.new({OPENPUBFLOW:0,CLIENTACK:3,BIND:4,UNBIND:5,UNSUBSCRIBE:6,CLOSEPUBFLOW:7,CREATE:8,DELETE:9,TRANSACTIONCTRL:11,FLOWCHANGEUPDATE:12,XACTRL:14,CLIENTNACK:15})},5099:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SMFAdProtocolParam=a.new({LASTMSGIDSENT:1,LASTMSGIDACKED:2,WINDOW:3,TRANSPORT_PRIORITY:4,APPLICATION_ACK:5,FLOWID:6,QUEUENAME:7,DTENAME:8,TOPICNAME:9,FLOWNAME:10,EP_DURABLE:11,ACCESSTYPE:12,SELECTOR:13,TRANSPORT_WINDOW:14,LINGER_OPTION:15,LASTMSGIDRECEIVED:16,EP_ALLOTHER_PERMISSION:17,FLOWTYPE:18,EP_QUOTA:19,EP_MAX_MSGSIZE:20,GRANTED_PERMISSIONS:21,EP_RESPECTS_TTL:22,TRANSACTION_CTRL_MESSAGE_TYPE:23,TRANSACTED_SESSION_ID:24,TRANSACTED_SESSION_NAME:25,TRANSACTION_ID:26,TRANSACTED_SESSION_STATE:27,TRANSACTION_FLOW_DESCRIPTOR_PUB_NOTIFY:28,TRANSACTION_FLOW_DESCRIPTOR_PUB_ACK:29,TRANSACTION_FLOW_DESCRIPTOR_SUB_ACK:30,NOLOCAL:31,ACTIVE_FLOW_INDICATION:32,WANT_FLOW_CHANGE_NOTIFY:33,EP_BEHAVIOUR:34,PUBLISHER_ID:35,APPLICATION_PUB_ACK:36,NUM_MESSAGES_SPOOLED:37,CUT_THROUGH:38,PUBLISHER_FLAGS:39,APP_MSG_ID_TYPE:40,QUEUE_ENDPOINT_HASH:41,MAX_REDELIVERY:42,PAYLOAD:43,ENDPOINT_ID:44,ACK_SEQUENCE_NUMBER:45,ACK_RECONCILE_REQUEST:46,START_OF_ACK_RECONCILE:47,TIMESTAMP:48,MAX_DELIVERED_UNACKED_MESSAGES_PER_FLOW:49,REPLAY_START_LOCATION:51,ENDPOINT_ERROR_ID:52,SPOOLER_UNIQUE_ID:54,PARTITION_GROUP_ID:56})},9640:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SMFClientCtrlMessageType=a.new({LOGIN:0,UPDATE:1})},9685:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SMFClientCtrlAuthType=a.new({CLIENT_CERTIFICATE:"",OAUTH2:`
|
|
86
|
+
`}),o.exports.SMFClientCtrlParam=a.new({SOFTWAREVERSION:0,SOFTWAREDATE:1,PLATFORM:2,USERID:3,CLIENTDESC:4,CLIENTNAME:5,MSGVPNNAME:6,DELIVERTOONEPRIORITY:7,P2PTOPIC:8,ROUTER_CAPABILITIES:9,VRIDNAME:10,PHYSICALROUTERNAME:12,BRIDGE_MSG_VPN_NAME:13,BRIDGE_ROUTER_NAME:14,NO_LOCAL:15,BRIDGE_VERSION:16,AUTHENTICATION_SCHEME:17,CONNECTION_TYPE:18,ROUTER_CAPABILITIES_EXTENDED:19,REQUIRES_RELEASE_7:20,SSL_DOWNGRADE:21,CLIENT_CAPABILITIES:23,KEEP_ALIVE_INTERVAL:24})},7750:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SMFParameterType=a.new({PADDING:0,PUBLISHER_ID:1,PUBLISHER_MSGID:2,MESSAGEPRIORITY:3,USERDATA:4,USERNAME:6,PASSWORD:7,RESPONSE:8,SUB_ID_LIST:10,GENERIC_ATTACHMENT:11,BINARY_ATTACHMENT:12,DELIVERY_MODE:16,ASSURED_MESSAGE_ID:17,ASSURED_PREVMESSAGE_ID:18,ASSURED_REDELIVERED_FLAG:19,MESSAGE_CONTENT_SUMMARY:22,ASSURED_FLOWID:23,TR_TOPICNAME:24,AD_FLOWREDELIVERED_FLAG:25,AD_TIMETOLIVE:28,AD_TOPICSEQUENCE_NUMBER:30,EXTENDED_TYPE_STREAM:31,AD_ACK_MESSAGE_ID:41,AD_SPOOLER_UNIQUE_ID:44,AD_REPL_MATE_ACK_MSGID:45,AD_REDELIVERY_COUNT:46,LIGHT_CORRELATION:0,LIGHT_TOPIC_NAME_OFFSET:1,LIGHT_QUEUE_NAME_OFFSET:2,LIGHT_ACK_IMMEDIATELY:3}),o.exports.SMFExtendedParameterType=a.new({OAUTH2_ISSUER_IDENTIFIER:47,OIDC_ID_TOKEN:48,OAUTH2_ACCESS_TOKEN:49,PARTITION_KEY_HASH:53,TS_TRANSPORT_CONTEXT:54})},5052:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SMFProtocol=a.new({CSPF:1,CSMP:2,PUBMSG:3,XMLLINK:4,WSE:5,SEMP:6,SUBCTRL:7,PUBCTRL:8,ADCTRL:9,KEEPALIVE:10,KEEPALIVEV2:11,CLIENTCTRL:12,TRMSG:13,JNDI:14,SMP:15,SMRP:16,SMF_IN_SMF:17,SMF_IN_RV:18,ADCTRL_PASSTHROUGH:19,TSESSION:20})},1278:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SMFSMPMessageTypeFlags=a.new({FLAG_FILTER:1,FLAG_PERSIST:2,SMF_SMP_FLAG_TOPIC:4,SMF_SMP_FLAG_RESPREQUIRED:8,SMF_SMP_FLAG_DELIVERALWAYS:16})},3647:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SMFSMPMessageType=a.new({ADDSUBSCRIPTION:0,REMSUBSCRIPTION:1,ADDQUEUESUBSCRIPTION:2,REMQUEUESUBSCRIPTION:3,ADDSUBSCRIPTIONFORCLIENTNAME:4,REMSUBSCRIPTIONFORCLIENTNAME:5})},1643:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.SMFTransportSessionMessageType=a.new({CREATE:0,CREATE_RESP:1,DESTROY:2,DESTROY_RESP:3,DATA:4,DATA_TOKEN:5,DATA_STREAM_TOKEN:6})},2689:(o,h,r)=>{const{CacheCBInfo:a}=r(6686),{CacheContext:u}=r(2969),{CacheLiveDataAction:l}=r(4253),{CacheRequest:d}=r(8847),{CacheRequestResult:_}=r(185),{CacheReturnCode:p}=r(429),{CacheReturnSubcode:f}=r(7651),{CacheSession:S}=r(6682),{CacheSessionProperties:C}=r(7330);o.exports.CacheCBInfo=a,o.exports.CACHE_REQUEST_PREFIX=u.CACHE_REQUEST_PREFIX,o.exports.CacheLiveDataAction=l,o.exports.CacheRequestResult=_,o.exports.CacheReturnCode=p,o.exports.CacheReturnSubcode=f,o.exports.CacheRequest=d,o.exports.CacheSession=S,o.exports.CacheSessionProperties=C},6686:o=>{o.exports.CacheCBInfo=class{constructor(h,r){this.cacheCBFunction=h,this.userObject=r}getCallback(){return this.cacheCBFunction}getUserObject(){return this.userObject}}},2969:o=>{o.exports.CacheContext={CACHE_REQUEST_PREFIX:"#CRQ",cacheRequestCorrelationId:0}},7909:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.CacheGetResultCode=a.new({INVALID:0,OK:1})},4494:(o,h,r)=>{const{CacheGetResultCode:a}=r(7909),u={messageID:null,version:0,responseCode:a.INVALID,responseString:"",matchTopic:"",sessionID:null,isSuspect:null,hasMore:null,hasTimestamps:null,replyTo:null,messageStream:null,clusterNameStream:null};o.exports.CacheGetResult=class{constructor(l=u){Object.assign(this,l)}readFromStream(l){this.messageID=l.getNext().getValue(),this.version=l.getNext().getValue(),this.responseCode=l.getNext().getValue(),this.responseString=l.getNext().getValue(),this.matchTopic=l.getNext().getValue(),this.sessionID=l.getNext().getValue(),this.isSuspect=l.getNext().getValue(),this.hasMore=l.getNext().getValue(),this.hasTimestamps=l.getNext().getValue(),l.hasNext()&&(this.messageStream=l.getNext().getValue()),l.hasNext()&&(this.clusterNameStream=this.messageStream,this.messageStream=l.getNext().getValue())}}},4253:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.CacheLiveDataAction=a.new({FULFILL:1,QUEUE:2,FLOW_THRU:3})},185:o=>{o.exports.CacheRequestResult=class{constructor(h,r,a,u){this._returnCode=h,this._subcode=r,this._topic=a,this._error=u}getReturnCode(){return this._returnCode}getReturnSubcode(){return this._subcode}getTopic(){return this._topic}getError(){return this._error}}},5011:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.CacheRequestType=a.new({INVALID:0,BULK_MSG:1,REGISTER_REQUEST:2,REGISTER_RESPONSE:3,HEARTBEAT_REQUEST:4,HEARTBEAT_RESPONSE:5,EVENT_NOTIFY:6,EVENT_ACK:7,ACTION_REQUEST:8,ACTION_RESPONSE:9,GET_REQUEST:10,GET_RESPONSE:11,GET_NEXT_REQUEST:12,GET_NEXT_RESPONSE:13,SET_REQUEST:14,SET_RESPONSE:15,GET_MSG_REQUEST:16,GET_MSG_RESPONSE:17,GET_NEXT_MSG_REQUEST:18,GET_NEXT_MSG_RESPONSE:19,UNREGISTER_IND:20,BULK_SET_REQUEST:21,BULK_SET_RESPONSE:22,PURGE_MSG_SEQUENCE_REQUEST:23,PURGE_MSG_SEQUENCE_RESPONSE:24,GET_MSG_SEQUENCE_REQUEST:25,GET_NEXT_MSG_SEQUENCE_REQUEST:26,GET_TOPIC_INFO_REQUEST:27,GET_TOPIC_INFO_RESPONSE:28,READY_MARKER:29,GET_TOPIC_INFO_REQUEST_RANGE:30,SYNC_READY_MARKER:31,VACUUM_REQUEST:32,VACUUM_RESPONSE:33})},8847:(o,h,r)=>{const{CacheContext:a}=r(2969);r(2694);const{CACHE_REQUEST_PREFIX:u}=a;class l{constructor(_,p,f,S,C,g,m){this.cacheSession=_,this.cacheMessageType=p,this.requestID=f,this.cbInfo=S,this.liveDataAction=C,this.topic=g,this.cacheName=m,this.subscriptionWaiting=null,this.replyReceived=!1,this.dataReceived=!1,this.isSuspect=!1,this.correlationID=`${u}${a.cacheRequestCorrelationId++}`,this.childRequests=[],this.parentRequest=null,this.queuedLiveData=[],this.liveDataFulfilled=!1,this.timeoutHandle=null}getRootRequest(){return this.parentRequest?this.parentRequest.getRootRequest():this}addChild(_){if(!(_ instanceof l))throw new Error(`Invalid child ${_}`);if(_===this)throw new Error("Constructing circular child reference");const p=_;p.parentRequest=this,this.childRequests.push(p)}removeChild(_){if(_===this)throw new Error("Attempting to deconstruct invalid circular child reference");const p=_,f=this.childRequests.indexOf(p);this.childRequests.splice(f,1),p.parentRequest=null}collapse(){const _=this.parentRequest;_.isSuspect=_.isSuspect||this.isSuspect,_.dataReceived=_.dataReceived||this.dataReceived,_.removeChild(this)}cancel(){for(this.parentRequest&&this.collapse();this.childRequests.length;){const _=this.childRequests.shift();_.childRequests&&_.cancel(),this.removeChild(_)}this.clearRequestTimeout()}getRequestID(){return this.requestID}getCBInfo(){return this.cbInfo}getTopic(){return this.topic}getLiveDataAction(){return this.liveDataAction}startRequestTimeout(_,p){this.timeoutHandle=setTimeout(()=>{_(this)},p)}clearRequestTimeout(){this.timeoutHandle!==null&&this.timeoutHandle!==void 0&&(clearTimeout(this.timeoutHandle),this.timeoutHandle=null)}toString(){return`CacheRequest[correlationID=${this.correlationID},requestID=${this.requestID},cacheName=${this.cacheName},topic=${this.topic.getName()}]`}}l.VERSION=1,l.DEFAULT_REPLY_SIZE_LIMIT=1e6,l.REPLY_SIZE_LIMIT=l.DEFAULT_REPLY_SIZE_LIMIT,o.exports.CacheRequest=l},429:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.CacheReturnCode=a.new({OK:1,FAIL:2,INCOMPLETE:3})},7651:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.CacheReturnSubcode=a.new({REQUEST_COMPLETE:0,LIVE_DATA_FULFILL:1,ERROR_RESPONSE:2,INVALID_SESSION:3,REQUEST_TIMEOUT:4,REQUEST_ALREADY_IN_PROGRESS:5,NO_DATA:6,SUSPECT_DATA:7,CACHE_SESSION_DISPOSED:8,SUBSCRIPTION_ERROR:9})},7330:o=>{o.exports.CacheSessionProperties=class{constructor(h,r,a,u){this.cacheName=h,this.maxAgeSec=r||0,this.maxMessages=a??1,this.timeoutMsec=u||1e4,this.includeOtherClusters=!0,this.cachePrefix="#P2P/CACHEINST/"}getCacheName(){return this.cacheName}setCacheName(h){this.cacheName=h}getMaxMessageAgeSec(){return this.maxAgeSec}setMaxMessageAgeSec(h){this.maxAgeSec=h}getMaxMessages(){return this.maxMessages}setMaxMessages(h){this.maxMessages=h}getTimeoutMsec(){return this.timeoutMsec}setTimeoutMsec(h){this.timeoutMsec=h}}},8460:o=>{o.exports.CacheSessionSubscribeInfo=class{constructor(h,r,a){Object.assign(this,{correlationID:h,topic:r,cacheSession:a})}}},6682:(o,h,r)=>{const a=r(6247),u=r(5024),l=r(3450),d=r(5747),{ErrorSubcode:_,OperationError:p}=r(6706),{LOG_TRACE:f,LOG_DEBUG:S,LOG_INFO:C,LOG_WARN:g}=r(2694),{SDTField:m,SDTFieldType:T,SDTStreamContainer:y}=r(769),{CacheCBInfo:E}=r(6686),{CacheContext:I}=r(2969),{CacheGetResult:N}=r(4494),{CacheLiveDataAction:A}=r(4253),{CacheRequest:L}=r(8847),{CacheRequestResult:D}=r(185),{CacheRequestType:q}=r(5011),{CacheReturnCode:Y}=r(429),{CacheReturnSubcode:Q}=r(7651),{CacheSessionProperties:W}=r(7330),{CacheSessionSubscribeInfo:x}=r(8460),{Destination:k,Topic:J}=r(9620),{CACHE_REQUEST_PREFIX:F}=I,$=()=>{};class R{constructor(M,re,se){R._validateProps(M);const fe=new W(M.cacheName,M.maxAgeSec,M.maxMessages,M.timeoutMsec);Object.assign(this,{_outstandingRequests:{},_outstandingIDs:{},_disposed:!1,_nextMessageCallbackInfo:null,_nextSessionEventCallbackInfo:null,_properties:fe,_session:re,_sessionIF:se}),this._connectToSession(re)}_connectToSession(M){this._nextSessionEventCallbackInfo=M.getEventCBInfo(),this._nextMessageCallbackInfo=M.getMessageCBInfo(),M.setMessageCBInfo(new u.MessageRxCBInfo((re,se)=>{this._handleMessage(se)},this)),M.setEventCBInfo(this._createCompoundEventCB(this._nextSessionEventCallbackInfo))}_createCompoundEventCB(M){return new u.SessionEventCBInfo((re,se,fe,ce)=>{this._handleSessionEvent(M,re,se,fe,ce)},null)}_handleSessionEvent(M,re,se){if(!this._processSessionEvent(re,se))return;const fe=M.userObject;fe?M.sessionEventCBFunction(re,se,fe):M.sessionEventCBFunction(re,se)}_sendToNextDelegate(M){const re=this._nextMessageCallbackInfo.userObject;re?this._nextMessageCallbackInfo.messageRxCBFunction(this._session,M,re):this._nextMessageCallbackInfo.messageRxCBFunction(this._session,M)}_processSessionEvent(M,re){switch(re.sessionEventCode){case u.SessionEventCode.SUBSCRIPTION_ERROR:case u.SessionEventCode.SUBSCRIPTION_OK:return this._checkSubscriptionStatus(re);case u.SessionEventCode.DOWN_ERROR:return this.dispose(),!0;default:return re.sessionEventCode,!0}}_checkSubscriptionStatus(M){if(M.correlationKey===null||M.correlationKey===void 0||!(M.correlationKey instanceof x)||M.correlationKey.cacheSession!==this)return!0;const re=this._getOutstandingRequest(M.correlationKey.correlationID);return re?M.sessionEventCode===u.SessionEventCode.SUBSCRIPTION_OK?(this._handleSubscriptionSuccess(re,M.correlationKey.topic),!1):(this._handleSubscriptionError(re,M),!1):(g(`No request found for subscription success on ${M.correlationKey.topic}`),!0)}_handleSubscriptionSuccess(M){const re=M;re.subscriptionWaiting=null,this._startCacheRequest(re)}_handleSubscriptionError(M){this._terminateRequest(M,Y.FAIL,Q.SUBSCRIPTION_ERROR)}_checkRequestCompletion(M){if(M.childRequests.length)return void M.childRequests.length;if(M.subscriptionWaiting||M.timeoutHandle!==null&&!M.replyReceived)return;if(M.parentRequest){const fe=M.parentRequest;return M.cancel(),this._unregisterRequest(M),void this._checkRequestCompletion(fe)}let re,se;if(M.isSuspect)re=Y.INCOMPLETE,se=Q.SUSPECT_DATA;else if(M.dataReceived)re=Y.OK,se=M.liveDataFulfilled?Q.LIVE_DATA_FULFILL:Q.REQUEST_COMPLETE;else{if(!M.replyReceived)throw new Error("Sanity: should never happen");re=Y.INCOMPLETE,se=Q.NO_DATA}this._terminateRequest(M,re,se)}_sendSeeOther(M,re){const se=re.clusterNameStream.getNext().getValue(),fe=new L(this,q.GET_MSG_REQUEST,M.requestID,new E($,null),M.liveDataAction,M.topic,se);M.addChild(fe),this._registerRequest(fe),fe.startRequestTimeout(R._handleCacheRequestTimeout,this._properties.timeoutMsec),this._startCacheRequest(fe,null,null,!0)}_sendGetNext(M,re){const se=new L(this,q.GET_NEXT_MSG_REQUEST,M.requestID,new E($,null),M.liveDataAction,M.topic,M.cacheName);M.addChild(se),this._registerRequest(se),se.startRequestTimeout(R._handleCacheRequestTimeout,this._properties.timeoutMsec),this._startCacheRequest(se,re.sessionID,re.replyTo)}_handleMessage(M){const re=M.getCorrelationId(),se=re==null?null:this._outstandingRequests[re];if(!se)return void(this._relevantLiveData(M)&&this._sendToNextDelegate(M));se.clearRequestTimeout();const fe=M.getSdtContainer(),ce=fe&&fe.getValue();if(ce||(C(`Invalid message format for cache response: no SDT container (${fe}) or stream (${ce})`),this._terminateRequest(se,Y.FAIL,Q.ERROR_RESPONSE)),this._incStat(d.RX_REPLY_MSG_RECVED),se.replyReceived=!0,se.getRootRequest().liveDataFulfilled)return this._incStat(d.CACHE_REQUEST_FULFILL_DISCARD_RESPONSE),void this._checkRequestCompletion(se);if(ce)try{const Te=new N;Te.readFromStream(ce),Te.replyTo=M.getReplyTo(),Te.responseString&&Te.responseString,Te.responseCode!==7&&Te.responseString!="Invalid Session"||(C(`Cluster response indicates invalid session: ${Te.responseString} code: ${Te.responseCode}`),this._terminateRequest(se,Y.FAIL,Q.INVALID_SESSION)),se.isSuspect=se.isSuspect||Te.isSuspect;const Ee=R._decodeMessageStream(se,Te);if(this._incStat(d.RX_CACHE_MSG,Ee.length),Te.hasMore&&this._sendGetNext(se,Te),Te.clusterNameStream)for(;Te.clusterNameStream.hasNext();)this._sendSeeOther(se,Te);Ee&&Ee.forEach(he=>{this._sendToNextDelegate(he)}),this._checkRequestCompletion(se)}catch(Te){C(`Invalid message format for cache response: ${Te.stack}`),this._terminateRequest(se,Y.FAIL,Q.ERROR_RESPONSE)}else C("Invalid cache response did not fulfill request. Skipping response processing")}_relevantLiveData(M){return!M.getCorrelationId()||!M.getCorrelationId().startsWith(F)||this._nextMessageCallbackInfo.userObject instanceof R?Object.keys(this._outstandingRequests).every(re=>this._performLiveDataAction(this._outstandingRequests[re],M)):(g("DROP: Dropping CRQ reply due to no remaining Cache Session processors on message callback chain"),this._incStat(d.RX_REPLY_MSG_DISCARD),!1)}_performLiveDataAction(M,re){const se=M;switch(se.dataReceived=!0,se.liveDataAction){case A.QUEUE:return se.queuedLiveData.push(re),!1;case A.FULFILL:return se.liveDataFulfilled||this._fulfillRequest(se),!0;default:return!0}}_fulfillRequest(M){const re=M;re.liveDataFulfilled=!0,this._trackCompletionStats(Y.OK,Q.LIVE_DATA_FULFILL),setTimeout(()=>{R._notifyCallback(re,Y.OK,Q.LIVE_DATA_FULFILL,re.getTopic(),null)},0)}dispose(){Object.keys(this._outstandingRequests).map(M=>this._outstandingRequests[M]).filter(M=>M instanceof L).forEach(M=>{this._terminateRequest(M,Y.INCOMPLETE,Q.CACHE_SESSION_DISPOSED)}),this._outstandingRequests=[],this._session.setEventCBInfo(this._nextSessionEventCallbackInfo),this._session.setMessageCBInfo(this._nextMessageCallbackInfo),this._disposed=!0}getProperties(){return this._properties}sendCacheRequest(M,re,se,fe,ce){if(arguments.length!==5)throw new p(`sendCacheRequest() invoked with an illegal argument count of ${arguments.length}`);if(typeof se!="boolean")throw new p("Invalid subscribe flag argument, should be a boolean but was "+typeof se);if(typeof M!="number"||Number.isNaN(M))throw new p("Invalid requestID",_.PARAMETER_INVALID_TYPE,null);if(this._outstandingIDs[M])throw new p("Request already in progress with this requestID");if(!(re instanceof k))throw new p("Invalid topic",_.PARAMETER_INVALID_TYPE,typeof re);if(re.validate(),fe!==A.FLOW_THRU&&fe!==A.FULFILL&&fe!==A.QUEUE)throw new p("Invalid live data action",_.PARAMETER_OUT_OF_RANGE);if(re.isWildcarded()&&fe!==A.FLOW_THRU)throw new p("Wildcarded topic not supported for this live data action",_.PARAMETER_CONFLICT);if(!(ce instanceof E))throw new p("Callback info was not an instance of CacheCBInfo");if(this._disposed)return void R._notifyCallbackError(ce,M,Y.FAIL,Q.CACHE_SESSION_DISPOSED,re,"Cache request failed: the cache session is disposed.");if(this._session._disposed)return void R._notifyCallbackError(ce,M,Y.FAIL,Q.INVALID_SESSION,re,"Cache request failed: the session is disposed.");const Te=new L(this,q.GET_MSG_REQUEST,M,ce,fe,re,this._properties.cacheName),Ee=Object.keys(this._outstandingRequests).filter(he=>this._outstandingRequests[he].topic.getName()===re.getName());if(Ee.length){const he=fe!==A.FLOW_THRU?Ee:Ee.filter(ge=>this._outstandingRequests[ge].liveDataAction!==A.FLOW_THRU);if(he.length){const ge=this._outstandingRequests[he[0]];return g(`Existing request ${ge} conflicts. Rejecting request ${Te}`),this._registerRequest(Te),void this._terminateRequest(Te,Y.FAIL,Q.REQUEST_ALREADY_IN_PROGRESS)}}if(this._registerRequest(Te),Te.startRequestTimeout(R._handleCacheRequestTimeout,this._properties.timeoutMsec),se){const he=new x(Te.correlationID,re,this);return Te._subscriptionWaiting=he,void this._session.subscribe(re,!0,he)}this._startCacheRequest(Te)}_handleCacheRequestFailed(M,re,se){this._terminateRequest(se.getRequestID(),Y.FAIL,Q.ERROR_RESPONSE)}_registerRequest(M){this._outstandingRequests[M.correlationID]=M,M.parentRequest||(this._outstandingIDs[M.requestID]=M)}_getOutstandingRequest(M){return this._outstandingRequests[M]}_startCacheRequest(M,re,se,fe){const ce=new a.Message;ce.setCorrelationId(M.correlationID),se?ce.setDestination(se):ce.setDestination(J.createFromName(this._properties.cachePrefix+M.cacheName)),ce.setReplyTo(J.createFromName(this._session.getSessionProperties().p2pInboxInUse)),ce.setDeliverToOne(M.cacheMessageType===q.GET_MSG_REQUEST);const Te=new y;Te.addField(T.UINT32,M.cacheMessageType),Te.addField(T.UINT32,L.VERSION),Te.addField(T.STRING,M.topic.getName()),Te.addField(T.UINT32,L.REPLY_SIZE_LIMIT),typeof re=="number"&&Te.addField(T.UINT32,re),Te.addField(T.UINT32,this._properties.maxMessages),Te.addField(T.UINT32,this._properties.maxAgeSec),M.cacheMessageType===q.GET_MSG_REQUEST&&Te.addField(T.BOOL,this._properties.includeOtherClusters&&!fe),Te.addField(T.BOOL,!1),M.cacheMessageType===q.GET_MSG_REQUEST&&Te.addField(T.UINT32,Math.round(this._properties.timeoutMsec/1e3)),ce.setSdtContainer(m.create(T.STREAM,Te));try{this._session.send(ce),M.parentRequest||this._incStat(d.CACHE_REQUEST_SENT)}catch(Ee){C(`Failed to send request: ${Ee.message}`),this._terminateRequest(M,Y.FAIL,Q.ERROR_RESPONSE,Ee)}}_incStat(M,re){this._session&&(this._sessionIF?this._sessionIF.incStat(M,re):C("Can't log stat: session statistics not available"))}_unregisterRequest(M){delete this._outstandingRequests[M.correlationID],delete this._outstandingIDs[M.requestID]}_trackCompletionStats(M,re){switch(M){case Y.OK:this._incStat(d.CACHE_REQUEST_OK_RESPONSE),re===Q.LIVE_DATA_FULFILL&&this._incStat(d.CACHE_REQUEST_LIVE_DATA_FULFILL);break;case Y.INCOMPLETE:this._incStat(d.CACHE_REQUEST_INCOMPLETE_RESPONSE);break;case Y.FAIL:this._incStat(d.CACHE_REQUEST_FAIL_RESPONSE);break;default:throw new Error("Sanity: no return code supplied")}}_terminateRequest(M,re,se,fe){const ce=M.getRootRequest();if(!this._outstandingRequests[ce.correlationID])return;const Te=ce.cbInfo;if(!Te)return void g(`No callback info provided for ${ce}. Cannot notify`);if(!Te.getCallback())return void g(`No callback provided for ${ce}. Cannot notify`);const Ee=ce.getTopic();Ee||g(`No topic provided for ${ce}`),ce.queuedLiveData.forEach(he=>this._sendToNextDelegate(he)),ce.cancel(),this._unregisterRequest(ce),ce.liveDataFulfilled||(this._trackCompletionStats(re,se),R._notifyCallback(ce,re,se,Ee,fe))}static _decodeMessageStream(M,re){if(!re.messageStream)return[];const se=[],fe=M;for(;re.messageStream.hasNext();){fe.dataReceived=!0;const ce=re.messageStream.getNext().getValue(),Te=l.Codec.Decode.decodeCompoundMessage(ce,0);if(!Te)continue;const Ee=re.isSuspect?a.MessageCacheStatus.SUSPECT:a.MessageCacheStatus.CACHED;Te._setCacheStatus(Ee),Te._setCacheRequestID(fe.requestID),se.push(Te)}return se.length,se}static _handleCacheRequestTimeout(M){const re=M.cacheSession;re._getOutstandingRequest(M.correlationID)?(C(`Request ${M} timed out`),re._terminateRequest(M.getRootRequest(),Y.INCOMPLETE,Q.REQUEST_TIMEOUT)):C(`Timeout for ${M} was not unregistered. Ignoring`)}static _notifyCallback(M,re,se,fe,ce){const Te=M.cbInfo;Te.getCallback()(M.requestID,new D(re,se,fe,ce),Te.getUserObject())}static _notifyCallbackError(M,re,se,fe,ce,Te){M.getCallback()(re,new D(se,fe,ce,Te),M.getUserObject())}static _validateProps(M){if(typeof M.cacheName!="string")throw new p("Invalid parameter type for cacheName",_.PARAMETER_INVALID_TYPE);if(J.createFromName(M.cacheName).isWildcarded())throw new p(`Invalid cacheName '${M.cacheName}'. The cacheName cannot be wildcarded`,_.PARAMETER_OUT_OF_RANGE);if(typeof M.maxAgeSec!="number")throw new p("Invalid parameter type for maxAgeSec",_.PARAMETER_INVALID_TYPE);if(M.maxAgeSec<0)throw new p("Invalid value for maxAgeSec; must be >= 0",_.PARAMETER_OUT_OF_RANGE);if(typeof M.maxMessages!="number")throw new p("Invalid parameter type for maxMessages",_.PARAMETER_INVALID_TYPE);if(M.maxMessages<0)throw new p("Invalid value for maxMessages; must be >= 0",_.PARAMETER_OUT_OF_RANGE);if(typeof M.timeoutMsec!="number")throw new p("Invalid parameter type for timeoutMsec",_.PARAMETER_INVALID_TYPE);if(M.timeoutMsec<3e3)throw new p("Invalid value for timeoutMsec; must be >= 3000",_.PARAMETER_OUT_OF_RANGE)}}o.exports.CacheSession=R},5747:(o,h,r)=>{const{Stats:a}=r(2652),{StatsByMode:u}=r(8352),{StatType:l}=r(1737);o.exports={Stats:a,StatType:l,StatsByMode:u}},8352:(o,h,r)=>{const{StatType:a}=r(1737);o.exports={StatsByMode:{STAT_TX_BYMODE_MSGS:[a.TX_DIRECT_MSGS,a.TX_PERSISTENT_MSGS,a.TX_NONPERSISTENT_MSGS],STAT_TX_BYMODE_BYTES:[a.TX_DIRECT_BYTES,a.TX_PERSISTENT_BYTES,a.TX_NONPERSISTENT_BYTES],STAT_TX_BYMODE_REDELIVERED:[a.TX_DIRECT_MSGS,a.TX_PERSISTENT_REDELIVERED,a.TX_NONPERSISTENT_REDELIVERED],STAT_TX_BYMODE_BYTES_REDELIVERED:[a.TX_DIRECT_BYTES,a.TX_PERSISTENT_BYTES_REDELIVERED,a.TX_NONPERSISTENT_BYTES_REDELIVERED],STAT_RX_BYMODE_MSGS:[a.RX_DIRECT_MSGS,a.RX_PERSISTENT_MSGS,a.RX_NONPERSISTENT_MSGS],STAT_RX_BYMODE_BYTES:[a.RX_DIRECT_BYTES,a.RX_PERSISTENT_BYTES,a.RX_NONPERSISTENT_BYTES]}}},1737:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.StatType=a.new({TX_TOTAL_DATA_BYTES:0,TX_TOTAL_DATA_MSGS:1,TX_DIRECT_BYTES:2,TX_DIRECT_MSGS:3,TX_CONTROL_BYTES:4,TX_CONTROL_MSGS:5,TX_REQUEST_SENT:6,TX_REQUEST_TIMEOUT:7,RX_TOTAL_DATA_BYTES:8,RX_TOTAL_DATA_MSGS:9,RX_DIRECT_BYTES:10,RX_DIRECT_MSGS:11,RX_CONTROL_BYTES:12,RX_CONTROL_MSGS:13,RX_DISCARD_MSG_INDICATION:14,RX_REPLY_MSG_RECVED:15,RX_REPLY_MSG_DISCARD:16,RX_DISCARD_SMF_UNKNOWN_ELEMENT:17,CACHE_REQUEST_SENT:18,CACHE_REQUEST_OK_RESPONSE:19,CACHE_REQUEST_FAIL_RESPONSE:20,CACHE_REQUEST_FULFILL_DISCARD_RESPONSE:21,RX_CACHE_MSG:22,CACHE_REQUEST_INCOMPLETE_RESPONSE:23,CACHE_REQUEST_LIVE_DATA_FULFILL:24,TX_PERSISTENT_BYTES:25,TX_PERSISTENT_MSGS:26,TX_NONPERSISTENT_BYTES:27,TX_NONPERSISTENT_MSGS:28,TX_PERSISTENT_BYTES_REDELIVERED:29,TX_PERSISTENT_REDELIVERED:30,TX_NONPERSISTENT_BYTES_REDELIVERED:31,TX_NONPERSISTENT_REDELIVERED:32,TX_ACKS_RXED:33,TX_WINDOW_CLOSE:34,TX_ACK_TIMEOUT:35,RX_PERSISTENT_BYTES:36,RX_PERSISTENT_MSGS:37,RX_NONPERSISTENT_BYTES:38,RX_NONPERSISTENT_MSGS:39,RX_ACKED:40,RX_DISCARD_DUPLICATE:41,RX_DISCARD_NO_MATCHING_CONSUMER:42,RX_DISCARD_OUT_OF_ORDER:43,RX_SETTLE_REJECTED:44,RX_SETTLE_FAILED:45,RX_SETTLE_ACCEPTED:46})},2652:(o,h,r)=>{const{EventEmitter:a}=r(3385),{StatType:u}=r(1737);o.exports.Stats=class extends a{constructor(l){super(),this._parent=l,this._statsMap=[],u.values.forEach(d=>{this._statsMap[d]=0})}resetStats(){this.emit("reset"),this._statsMap=this._statsMap.map(()=>0)}incStat(l,d=1){this._statsMap[l]+=d,this._parent&&this._parent.incStat(l,d)}getStat(l){return this._statsMap[l]}}},8205:(o,h,r)=>{const{SMFClient:a}=r(3175),{TransportCapabilities:u}=r(9984),{TransportError:l}=r(2680),{TransportFactory:d}=r(4723),{TransportProtocol:_}=r(9072),{TransportReturnCode:p}=r(9944),{TransportSessionEventCode:f}=r(3427),{TransportSessionStates:S}=r(3304);o.exports.SMFClient=a,o.exports.TransportCapabilities=u,o.exports.TransportError=l,o.exports.TransportFactory=d,o.exports.TransportProtocol=_,o.exports.TransportReturnCode=p,o.exports.TransportSessionEventCode=f,o.exports.TransportSessionStates=S},427:o=>{class h{constructor(a,u,l){this.reset(),this._rxSmfCB=a,this._rxMessageErrorCB=u,this._session=l}reset(){this._correlationCounter=0}nextCorrelationTag(){return++this._correlationCounter>=h.SMF_MAX_CORRELATION&&(this._correlationCounter=1),this._correlationCounter?this._correlationCounter:0}}h.SMF_MAX_CORRELATION=16777215,o.exports.BaseSMFClient=h},9097:(o,h,r)=>{const a=r(8287).hp;function u(_,p,f){const S=a.allocUnsafe(f);let C,g=0;const m=_[0];for(g+=m.copy(S,0,p,m.length),C=1;C<_.length&&g<f;C++){const T=_[C];g+=T.copy(S,g,0,T.length)}return S}function l(_,p,f){let S=p,C=f;const g=[];let m=0;for(m=0;m<4;m++){for(;_[S].length<=C;)if(C-=_[S].length,S++,S>=_.length)return null;g[m]=_[S].readUInt8(C),C++}return(g[0]<<24)+(g[1]<<16)+(g[2]<<8)+g[3]}class d{constructor(p){let f=[];const S=p;let C=0,g=0;this.peekView=function(m){const T=[];return f.length<1||m>C?null:(f[0].length>=m+g?(T[0]=f[0],T[1]=g):(T[0]=u(f,g,m),T[1]=0),T)},this.readUInt8=function(m){if(m>=C)return null;const T=m+g;if(T<f[0].length)return f[0].readUInt8(T);let y=f[0].length,E=1;for(;y+f[E].length<=T;)y+=f[E].length,E++;return f[E].readUInt8(T-y)},this.readUInt32BE=function(m){if(m+3>=C)return null;const T=m+g;if(T+3<f[0].length)return f[0].readUInt32BE(T);if(T<f[0].length)return l(f,0,T);let y=f[0].length,E=1;for(;y+f[E].length<=T;)y+=f[E].length,E++;return T-y+3<f[E].length?f[E].readUInt32BE(T-y):l(f,E,T-y)},this.put=function(m){const T=d.adaptData(m),y=T.length;return y===0||!(C+y>=S)&&(f.push(T),C+=y,!0)},this.advance=function(m){if(m<1)return;if(m>=C)return void this.reset();let T=0;for(;T<m;){if(!(f[0].length-g<=m-T)){g+=m-T,C-=m-T;break}{const y=f[0].length-g;f.shift(),T+=y,C-=y,g=0}}},this.reset=function(){f=[],C=0,g=0},this.remaining=function(){return C},this.isEmpty=function(){return C===0}}static adaptData(p){return p instanceof a?p:a.from(p)}}o.exports.BufferQueue=d,o.exports.concatFrom=u},5958:(o,h,r)=>{const a=r(199),u=r(3450),{BaseSMFClient:l}=r(427),{BufferQueue:d}=r(9097),{Convert:_,Hex:p}=r(9783),{LogFormatter:f}=r(2694),S=r(8287).hp,{stringToUint8Array:C}=_,{formatHexString:g}=p,{LOG_ERROR:m}=new f("[buffer-smf-client]");function T(y){const E=y.peekView(Math.min(y.remaining(),64));m(`First 64 bytes (or fewer) of incoming buffer:
|
|
87
|
+
${a.Debug.formatDumpBytes(E[0].toString("latin1",E[1]),!0,0)}`)}o.exports.a=class extends l{constructor(y,E,I){super(y,E,I),this._incomingBuffer=new d(8e7)}reset(){super.reset(),this._incomingBuffer&&this._incomingBuffer.reset()}rxDataString(y){this._rxDataCB(S.from(C(y)))}rxDataArrayBuffer(y){this._rxDataCB(S.from(y))}rxDataBuffer(y){this._rxDataCB(y)}_rxDataCB(y){this._session&&this._session.resetKeepAliveCounter();const E=this._incomingBuffer,I=E.put(y);let N=E.remaining();for(I||(T(E),this._rxMessageErrorCB(`Buffer overflow (length: ${N})`),this._incomingBuffer.reset());N>12;){const A=7&E.readUInt8(0);if(A!==3)return m(`Invalid smf version in smf header, version=${A}`),m("BufferSMFClient._rxDataCB(): couldn't decode message due to invalid smf header"),T(E),this._incomingBuffer.reset(),void this._rxMessageErrorCB("Error parsing incoming SMF - invalid SMF header detected");const L=E.readUInt32BE(8);if(L>E.remaining())break;const D=E.peekView(L),q=u.Codec.Decode.decodeCompoundMessage(D[0],D[1]);if(!q||!q.smfHeader){const Y=this._session?this._session._sessionId:null,Q=Y?g(Y):"N/A";return m(`BufferSMFClient._rxDataCB(): couldn't decode message (sessionId=${Q})`),T(E),this._incomingBuffer.reset(),void this._rxMessageErrorCB("Error parsing incoming SMF")}E.advance(q.smfHeader.messageLength),this._rxSmfCB(q),N=E.remaining()}N||this._incomingBuffer.reset()}}},3175:(o,h,r)=>{const{BaseSMFClient:a}=r(427),u=r(5958).a;u.SMF_CLIENTCTRL_LOGIN_FAKE_CORRELATIONTAG=a.SMF_MAX_CORRELATION,o.exports.SMFClient=u},383:(o,h,r)=>{const{ErrorSubcode:a,OperationError:u}=r(6706),{TransportReturnCode:l}=r(9944);class d{constructor(p,f,S,C,g=null){this._url=p,this._ssl=d.useSsl(p),this._client=S,this._eventCB=f,this._props=C,this.setInterceptor(g)}connect(){return l.OK}destroy(p,f,S){return l.OK}forceFailure(p){return l.OK}flush(p){return p(),l.OK}send(p,f=!1){return l.OK}getTransportProtocol(){return this._props.transportProtocol}getInfoStr(){return null}getClientStats(){return null}beginDowngrade(p,f){return!1}setInterceptor(p){this._interceptor&&this._interceptor.removed&&this._interceptor.removed(this),this._interceptor=p,p&&p.installed&&p.installed(this)}toString(){return`${this.getTransportProtocol()}${this._ssl?" (SSL)":""}`}static useSsl(p){const f=(p||"").split("://");if(f.length===0||d.validSchemes.indexOf(f[0])<0)throw new u(`Invalid url "${p}": Only [${d.validSchemes.join(", ")}] URL schemes are supported`,a.PARAMETER_OUT_OF_RANGE);return f[0]==="https"||f[0]==="wss"||f[0]==="tcps"}}d.validSchemes=["http","https","ws","wss","tcp","tcps"],o.exports.TransportBase=d},9984:(o,h,r)=>{const{WebTransportCapabilities:a}=r(9556),u={web:a};o.exports.TransportCapabilities=u},8188:o=>{o.exports.TransportClientStats=class{constructor(){this.bytesWritten=0,this.msgWritten=0}}},2680:(o,h,r)=>{const{SolaceError:a}=r(6706);o.exports.TransportError=class extends a{constructor(u,l){super("TransportError",u),this.subcode=l}toString(){return`${super.toString()}, subcode=${this.subcode}`}}},4723:(o,h,r)=>{r(2694);const{TcpRawTransport:a,CompressedTransport:u,TlsOnlyTransport:l,TcpTlsTransport:d}={},{WebTransport:_}=r(9556),p={createTransport(f,S,C,g,m){const T=f;if(Object.assign(g,{connectTimeoutInMsecs:1e5}),a&&T.trim().startsWith("tcp")){if(!T.trim().startsWith("tcps")){if(g.compressionLevel===0)return new a(T,S,C,g);const I=new u(S,C,g),N=new a(T,I.eventCB.bind(I),I,g);return I.setClientStats(N.getClientStats()),N.setClientStats(null),I.setUnderlyingTransport(N),I}if(g.sslConnectionDowngradeTo!=="PLAIN_TEXT")return new d(T,S,C,g);const y=new l(T,S,C,g),E=new a(T,y.eventCB.bind(y),y,g);return y.setClientStats(E.getClientStats()),E.setClientStats(null),y.setUnderlyingTransport(E),y}return new _(T,S,C,g,m)},startCompression(f){const S=f._eventCB,C=f._client,g=f._props,m=new u(S,C,g);return f.rehome(m.eventCB.bind(m),m),m.setClientStats(f.getClientStats()),f.setClientStats(null),m.setUnderlyingTransport(f),m.connect(),m},severTls(f,S,C){if(S){const g=m=>C(this.startCompression(m));f.tlsShutdown(g)}else f.tlsShutdown(C)}};o.exports.TransportFactory=p},5208:(o,h,r)=>{const a=r(9556),{Lazy:u}=r(7444);r(2694);const{TransportBase:l}=r(383),{TransportProtocol:d}=r(9072),{lazyValue:_}=u,p=_(()=>({[d.HTTP_BASE64]:a.StateBase64,[d.HTTP_BINARY]:a.StateBinary,[d.HTTP_BINARY_STREAMING]:a.StateStreamingAndBinary,[d.WS_BINARY]:a.StateWebSocketBinary}));o.exports.TransportProtocolHandler=class{constructor(f,S){const C=l.useSsl(f);let g=null,m=null;S.slice().reverse().forEach(T=>{const y=p.value[T];g=new y(C,this.switchState.bind(this),m),m=g}),this._transport=g,this._transport.onEnter()}getTransportProtocol(){return this._transport.getTransportProtocol()}completeDowngrade(f){return this._transport.completeDowngrade(f)}canCompleteDowngrade(){return this._transport.getNextState()!==null}toString(){return this._transport.toString()}switchState(f,S){this._transport,this._transport=f,f.onEnter()}}},9072:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.TransportProtocol=a.new({HTTP_BASE64:"HTTP_BASE64",HTTP_BINARY:"HTTP_BINARY",HTTP_BINARY_STREAMING:"HTTP_BINARY_STREAMING",WS_BINARY:"WS_BINARY"})},9944:(o,h,r)=>{const{Enum:a}=r(7444),u={OK:0,FAIL:1,NO_SPACE:2,DATA_DECODE_ERROR:3,INVALID_STATE_FOR_OPERATION:4,CONNECTION_ERROR:5};o.exports.TransportReturnCode=a.new(u),o.exports.TransportReturnCode._setCanonical({OK:u.OK,FAIL:u.FAIL,NO_SPACE:u.NO_SPACE,DATA_DECODE_ERROR:u.DATA_DECODE_ERROR,INVALID_STATE_FOR_OPERATION:u.INVALID_STATE_FOR_OPERATION,CONNECTION_ERROR:u.CONNECTION_ERROR})},3427:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.TransportSessionEventCode=a.new({UP_NOTICE:1,DESTROYED_NOTICE:2,CAN_ACCEPT_DATA:4,DATA_DECODE_ERROR:5,PARSE_FAILURE:6,CONNECT_TIMEOUT:7,SEND_ERROR:8,DOWNGRADE_FAILED:10,DOWNGRADE_SUCCEEDED:11})},7368:(o,h,r)=>{var a=r(2195);const{ErrorSubcode:u}=r(6706),{Hex:l}=r(9783),{TransportSessionEventCode:d}=r(3427),{formatHexString:_}=l;o.exports.TransportSessionEvent=class{constructor(p,f,S,C,g){this._transportEventCode=p,this._infoStr=f,this._responseCode=S,this._errorSubcode=C,this._sid=g}getTransportEventCode(){return this._transportEventCode}get transportEventCode(){return this._transportEventCode}getInfoStr(){return this.infoStr}get infoStr(){return this._infoStr}getResponseCode(){return this.responseCode}get responseCode(){return this._responseCode}getSubcode(){return this.errorSubcode}get errorSubcode(){return this._errorSubcode}getSessionId(){return this.sessionId}get sessionId(){return this._sid}inspect(){return{transportEventCode:d.describe(this.transportEventCode),infoStr:this.infoStr,responseCode:this.responseCode,errorSubcode:u.describe(this.errorSubcode),sid:this.sid&&_(this.sid)||"N/A"}}toString(){return a(this)}}},3304:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.TransportSessionState=a.new({DOWN:0,WAITING_FOR_CREATE:1,SESSION_UP:2,WAITING_FOR_DESTROY:4,CONNECTION_FAILED:5})},3718:(o,h,r)=>{const{LOG_INFO:a,LOG_WARN:u}=r(2694),{Process:l}=r(968);o.exports.TSHState=class{constructor(d,_,p,f){this._ssl=!!d,this._transportProtocol=_,this._exitCallback=p,this._nextState=f,this._unsupportedRuntimeMessage=`${this._transportProtocol} not supported by this runtime: ${l.userAgent}`}getNextState(){return this._nextState}setNextState(d){this._nextState=d}getTransportProtocol(){return this._transportProtocol}getUseSsl(){return this._ssl}validateLegal(){return!0}onEnter(){this.validateLegal()||(this._nextState&&this._exitCallback?this._exitCallback(this._nextState,this._unsupportedRuntimeMessage):u(`${this._unsupportedRuntimeMessage}, no next state.`))}completeDowngrade(d){return this._nextState&&this._exitCallback?(a(`Connect failed (${d}), try next state.`),this._exitCallback(this._nextState,"Connect failed"),!0):(u(`Connect failed (${d}), no next state.`),!1)}toString(){return this._transportProtocol+(this._ssl?" (SSL)":"")}}},9556:(o,h,r)=>{const a=r(9005),{StateBase64:u}=r(5113),{StateBinary:l}=r(4207),{StateStreamingAndBinary:d}=r(9580),{StateWebSocketBinary:_}=r(1529),{WebTransport:p}=r(1250),{WebTransportCapabilities:f}=r(261),{HTTPConnection:S,HTTPTransportSession:C}=a;o.exports.HTTPConnection=S,o.exports.HTTPTransportSession=C,o.exports.StateBase64=u,o.exports.StateBinary=l,o.exports.StateStreamingAndBinary=d,o.exports.StateWebSocketBinary=_,o.exports.WebTransport=p,o.exports.WebTransportCapabilities=f},9005:(o,h,r)=>{const{HTTPConnection:a}=r(6350),{HTTPTransportSession:u}=r(2712);o.exports.HTTPConnection=a,o.exports.HTTPTransportSession=u},6350:(o,h,r)=>{const a=r(199),{Convert:u,Base64:l}=r(9783),{LOG_DEBUG:d,LOG_INFO:_,LOG_WARN:p,LOG_ERROR:f}=r(2694),{sendXhrBinary:S,sendXhrText:C}=r(7440),{StringBuffer:g,TimingBucket:m}=r(968),{TransportReturnCode:T}=r(9944),{XHRFactory:y}=r(3124),{arrayBufferToString:E}=u;function I(L){return!L.match(/^(http|ws)(s?):/i)&&window.location&&window.location.origin?window.location.origin+(L.charAt(0)!=="/"?"/":"")+L:L}class N{constructor(){this.WaitedToken=new m("WaitedToken",100),this.HadToken=new m("HadToken",100),this.ReturnedToken=new m("ReturnedToken",100)}toString(){let D="";return[this.WaitedToken,this.HadToken,this.ReturnedToken].forEach(q=>{q&&q.bucketCount()>0&&(D+=`${q.name} >> ${q}
|
|
88
|
+
`)}),D}}class A{constructor(D,q,Y,Q,W,x,k){this.Options={url:I(D),contentType:x,base64Enc:q,streamProgressEvents:Y,connectionClose:k},this._streamProgressBytes=0,this._xhr=null,this._rxDataCb=Q,this._connErrorCb=W,this._reqActive=!1,this._REQCOUNTER=0,this._REQBASE=Math.floor(1e3*Math.random()),this._xhr=y.create(),this._handleAbortedReq=!A.browserSupportsXhrBinary(),this.stats=new N}recStat(D){}send(D,q=0,Y=1){q>0&&(this._xhr.abort(),this._xhr=y.create()),this._xhr.open("POST",this.Options.url,!0),this._streamProgressBytes=0,this._xhr.onreadystatechange=()=>this.xhrStateChange(D,q,Y),this._reqActive=!0,this.Options.base64Enc?C(this._xhr,D,this.Options.contentType,this.Options.connectionClose):S(this._xhr,D,this.Options.contentType,this.Options.connectionClose),this.recStat("SendMsg")}xhrStateChange(D,q,Y){const Q=this._xhr.readyState,W=this._xhr.LOADING,x=this._xhr.DONE;if(!(this.Options.streamProgressEvents&&Q===W||Q===x)||!this._reqActive)return;let k=null;if(this._handleAbortedReq)try{k=this._xhr.status}catch(se){return void _(`Error trying to access status in XHR due to request aborted: ${se.message}`)}else k=this._xhr.status;if(k===200||k===304){let se=null;if(se=this._xhr.responseType&&this._xhr.responseType==="arraybuffer"?E(this._xhr.response):this._xhr.responseText,se=se.substring(this._streamProgressBytes,se.length),this._streamProgressBytes+=se.length,se.length===0&&Q===W)return;if(this.Options.base64Enc)try{se=l.decode(se)}catch(fe){return f(`Data decode error on: ${se}`),f(`Data decode error is: ${fe.message}`),void this._rxDataCb(T.DATA_DECODE_ERROR,se)}else{const fe=[],ce=se.length;for(let Te=0;Te<ce;Te++)fe.push(String.fromCharCode(255&se.charCodeAt(Te)));se=fe.join("")}return Q===x&&(this._reqActive=!1),this._rxDataCb(T.OK,se),void(Q===x&&se.length>0&&this._rxDataCb(T.OK,""))}const J=this._xhr.statusText;let F="";F=this._xhr.responseType&&this._xhr.responseType==="arraybuffer"?E(this._xhr.response):this._xhr.responseText||"";const $=F.length,R=(this.Options.url,D?D.length:0),{formatDumpBytes:B}=a.Debug,M=B(F.substr(0,Math.min($,64)),!0,0);B((D||"").substr(0,Math.min(R,256)),!0,0);const re=Y;this._reqActive&&k!==400&&F.length===0&&(q===0||q<re)?(_(`XHR failed while request active, will retry send, retry=${q+1}`),this.send(D,q+1,re)):(this._reqActive=!1,this._connErrorCb(k,new g(`HTTP request failed(status=${k} statusText=${J}, `,`responseText length=${$}, responseText[0..64]=
|
|
89
|
+
`,M,`XHR errorCode=${this._xhr._error?this._xhr._error.code:""})`).toString()))}isUsingBase64(){return this.Options.base64Enc}abort(){this._reqActive=!1,this._xhr&&this._xhr.abort&&this._xhr.abort()}static browserSupportsXhrBinary(){return S!==C}static browserSupportsStreamingResponse(){const D=y.create(),q=D&&D.onprogress===null;return _(`http browserStreamingCheck - if XMLHTTPRequest supported and XMLHTTPRequest support onprogress: ${q}`),q}}o.exports.HTTPConnection=A},2712:(o,h,r)=>{const a=r(199),u=r(3450),{Check:l}=r(802),{Convert:d,Hex:_}=r(9783),{ErrorSubcode:p,OperationError:f}=r(6706),{HTTPConnection:S}=r(6350),{LogFormatter:C}=r(2694),{SMFClient:g}=r(3175),{TransportError:m}=r(2680),{TransportProtocol:T}=r(9072),{TransportReturnCode:y}=r(9944),{TransportSessionEvent:E}=r(7368),{TransportSessionEventCode:I}=r(3427),{TransportSessionState:N}=r(3304),{WebTransportSessionBase:A}=r(1517),{int32ToStr:L,strToByteArray:D,strToHexArray:q}=d,{formatHexString:Y}=_,{LOG_TRACE:Q,LOG_DEBUG:W,LOG_ERROR:x,LOG_INFO:k}=new C("[http-transport-session]"),J=r(8287).hp;o.exports.HTTPTransportSession=class extends A{constructor(F,$,R,B){if(super(F,$,R,B),this._haveToken=!0,this._confMaxWebPayload=B.maxWebPayload,this._maxPayloadBytes=0,this._destroyTimer=null,this._destroyTimeout=B.connectTimeoutInMsecs,this._createUrl=`http${F.match(/(ws|http)(s?:\/\/.+)/)[2]}`,this._routerUrl=this._createUrl,this._rxChannelClient=null,this._httpSendConn=null,this._httpReceiveConn=null,this._smfDataTokenTSHeader=null,this._routerTag="",this._sid=null,B.transportProtocol===null||B.transportProtocol===void 0)throw new f("transportProtocol is not set",p.PARAMETER_OUT_OF_RANGE);this._transportProtocol=B.transportProtocol,this._useBinaryTransport=!1,this._useStreamingTransport=!1,this._streamingTransportPadding=0,this._useBinaryTransport=B.transportProtocol!==T.HTTP_BASE64,this._useStreamingTransport=B.transportProtocol===T.HTTP_BINARY_STREAMING,this._incomingBuffer="",this._packetReadState=0;const M=navigator.userAgent||"";if((M.match(/trident/i)||M.match(/msie/i))&&(this._streamingTransportPadding=257),B.transportContentType===null||B.transportContentType===void 0)throw new f("transportContentType is not set",p.PARAMETER_OUT_OF_RANGE);this._contentType=B.transportContentType}connectTimerExpiry(){k("HTTP transport connect timeout"),this.destroyCleanup("HTTP transport connect timeout",p.TIMEOUT)}get sessionIdHex(){return this._sid?Y(this._sid):""}updateMaxWebPayload(){const F=this._confMaxWebPayload-22;this._maxPayloadBytes=this._useBinaryTransport?F:Math.floor(.75*F)}connect(){return this._state!==N.DOWN?y.INVALID_STATE_FOR_OPERATION:this.connectInternal()}connectInternal(){this._connError=null;try{this._createConn=new S(this._createUrl,!this._useBinaryTransport,!1,($,R)=>this.handleCreateResponse($,R),($,R)=>this.handleCreateConnFailure($,R),this._contentType)}catch($){return k(`Failed to create connection to router: ${$.message}`),this._connError=$,y.CONNECTION_ERROR}if(l.nothing(this._createConn))return k("Failed to create connection to router"),y.CONNECTION_ERROR;const F=u.Codec.Transport.genTsCreateHeader();this._state===N.WAITING_FOR_CREATE||(this.createConnectTimeout(),this._state=N.WAITING_FOR_CREATE);try{this._createConn.send(F)}catch($){return k(`Error connecting: ${$.message}`),$.stack,this._state=N.CONNECTION_FAILED,this.cancelConnectTimeout(),this._connError=$ instanceof m?$:new m(`Could not create HTTP transport session: ${$.message}`,$.subcode||p.CONNECTION_ERROR),y.CONNECTION_ERROR}return y.OK}destroy(F,$){if(this._state,this._state===N.WAITING_FOR_DESTROY||this._state===N.DOWN)return y.OK;if(this._state===N.CONNECTION_FAILED||this._state===N.WAITING_FOR_CREATE)return k("The connection is in unreliable state, close transport"),this.destroyCleanup(F,$,!0),y.OK;k("Destroy transport session immediately"),this._state=N.WAITING_FOR_DESTROY,this._httpSendConn!==null&&(k("Destroy transport session: abort sendConn"),this._httpSendConn.abort()),this._httpReceiveConn!==null&&(k("Destroy transport session: abort receiveConn"),this._httpReceiveConn.abort()),this._destroyTimer=setTimeout(()=>{this.destroyTimerExpiry()},this._destroyTimeout),this._httpSendConn=new S(this._routerUrl,!this._useBinaryTransport,!1,(B,M)=>this.handleRxDataToken(B,M),(B,M)=>this.handleSendFailure(B,M),this._contentType,!0);const R=u.Codec.Transport.genTsDestroyHeader(this._sid);return q(R),this._httpSendConn.send(R),y.OK}send(F,$=!1){let R=F;if(this._state!==N.SESSION_UP)return y.INVALID_STATE_FOR_OPERATION;if(this._queuedData.length>0||!this._haveToken)return this.enqueueData(R,$);let B=null;if(R.length>this._maxPayloadBytes&&(B=R.substr(this._maxPayloadBytes),R=R.substr(0,this._maxPayloadBytes),!this.allowEnqueue(B.length)))return this.enqueueFailNoSpace();this._haveToken=!1;const M=this._smfDataTSHeaderParts[0].length+4+this._smfDataTSHeaderParts[1].length+R.length;return this._httpSendConn.send(this._smfDataTSHeaderParts[0]+L(M)+this._smfDataTSHeaderParts[1]+R),this._clientstats.bytesWritten+=R.length,B?this.enqueueData(B,null):(this._clientstats.msgWritten++,y.OK)}enqueueData(F,$=!1){const R=F.length;return $||this.allowEnqueue(R)?(this._queuedDataSize+=R,this._queuedData.push(F),y.OK):this.enqueueFailNoSpace()}initPreformattedHeaders(F){this._smfDataTSHeaderParts=u.Codec.Transport.genTsDataMsgHeaderParts(F),this._useStreamingTransport?this._smfDataTokenTSHeader=u.Codec.Transport.genTsDataStreamTokenMsg(F,this._streamingTransportPadding):this._smfDataTokenTSHeader=u.Codec.Transport.genTsDataTokenMsg(F)}flush(F){this._queuedDataSize?this._flushCallback=F:F()}sendQueuedData(){if(this._queuedDataSize===0)return;this._haveToken=!1;const F=this.getQueuedDataToSend(),$=this._smfDataTSHeaderParts[0].length+4+this._smfDataTSHeaderParts[1].length+F.length;if(this._httpSendConn.send(this._smfDataTSHeaderParts[0]+L($)+this._smfDataTSHeaderParts[1]+F),this._clientstats.bytesWritten+=F.length,this._canSendNeeded&&(this._canSendNeeded=!1,this._eventCB(new E(I.CAN_ACCEPT_DATA,"",null,0,this._sid))),this._flushCallback){const R=this._flushCallback;this._flushCallback=null,R()}}handleCreateResponse(F,$){if(this._state===N.WAITING_FOR_DESTROY||this._state===N.DOWN)return;if(this.updateMaxWebPayload(),F!==y.OK)return k(`Received create response with return code ${y.describe(F)}`),void(F===y.DATA_DECODE_ERROR?this.destroyCleanup("Received data decode error on create session response",p.DATA_DECODE_ERROR):this.destroyCleanup("Failed to handle create session response",p.CONNECTION_ERROR));if($.length===0)return;const R=u.Codec.Decode.decodeCompoundMessage(J.from($,"latin1"),0);if(!R)return x("Could not parse create response as SMF. Destroying transport"),void this.destroyCleanup("Failed to parse create response message",p.CONNECTION_ERROR);const B=R.getResponse();if(B.responseCode!==200)return void this.destroyCleanup(`Transport create request failed (${B.responseCode}, ${B.responseString})`,p.CONNECTION_ERROR);this.cancelConnectTimeout(),this._createConn.abort(),this._createConn=null,this._state=N.SESSION_UP,this._sid=R.sessionId,this._routerTag=R.routerTag,this._routerUrl=this._createUrl.replace(/\?.*/,""),this._routerTag!==""&&(this._routerUrl=this._routerUrl+this._routerTag),this.initPreformattedHeaders(this._sid);const M=!this._useBinaryTransport,re=this._useStreamingTransport;this._httpSendConn=new S(this._routerUrl,M,!1,(se,fe)=>this.handleRxDataToken(se,fe),(se,fe)=>this.handleSendFailure(se,fe),this._contentType),this._useStreamingTransport?this._httpReceiveConn=new S(this._routerUrl,M,re,(se,fe)=>this.handleRxStreaming(se,fe),(se,fe)=>this.handleSendFailure(se,fe),this._contentType,!0):(this._rxChannelClient=new g(se=>this.handleSmfMessage(se),se=>this.handleSmfParseError(se),null),this._httpReceiveConn=new S(this._routerUrl,M,re,(se,fe)=>this.handleRxData(se,fe),(se,fe)=>this.handleSendFailure(se,fe),this._contentType)),this._httpReceiveConn.send(this._smfDataTokenTSHeader),this._eventCB(new E(I.UP_NOTICE,B.responseString,B.responseCode,0,R.sessionId))}handleDestroyResponse(F){this.cancelDestroyTimeout();const $=F.getResponse(),R=$?$.responseString:"";this.destroyCleanup(`${R} handled Destroy Response addressed to session ${Y(F.sessionId)}, on session ${Y(this._sid)}`,0)}handleSmfMessage(F){const $=F.smfHeader;if($.smf_protocol!==u.SMFProtocol.TSESSION)return void this.handleSmfParseError(`Unexpected Message Prototcol (${$.smf_protocol}) on ReceiveData connection`);const R=F.payload,B=F.payloadLength;switch(F.messageType){case u.SMFTransportSessionMessageType.DESTROY_RESP:return void this.handleDestroyResponse(F);case u.SMFTransportSessionMessageType.DATA:if(F.sessionId!==this._sid){const M=F.getResponse(),re=M?` (${M.responseCode} ${M.responseString})`:"",se=M?M.responseCode:null;return D(this._sid),D(F.sessionId),this._state=N.CONNECTION_FAILED,void this._eventCB(new E(I.PARSE_FAILURE,`Session ID mismatch in data message, expected: ${Y(this._sid)}, got: ${Y(F.sessionId)}, ${re}`,se,p.PROTOCOL_ERROR,this._sid))}B>0&&this._client.rxDataBuffer(R);break;default:this.handleSmfParseError(`Unexpected message type (${F.messageType}) on ReceiveData connection`)}}handleSmfParseError(){this._eventCB(new E(I.DATA_DECODE_ERROR,"Received data decode error",null,p.DATA_DECODE_ERROR,this._sid))}handleRxData(F,$){this._httpReceiveConn!==null&&this._rxChannelClient!==null?this._state!==N.WAITING_FOR_DESTROY?(this._httpReceiveConn.recStat("GotData"),F===y.OK?$.length===0?this._httpReceiveConn.send(this._smfDataTokenTSHeader):this._rxChannelClient.rxDataString($):this.handleRxError(F,$)):a.Debug.formatDumpBytes($.substring(0,64),!0,0):this._state===N.DOWN?k("Transport session is down, ignore data from receive connection"):x(`Transport session is not in working state, state: ${this._state}`)}handleRxStreaming(F,$){if(this._httpReceiveConn===null)return void(this._state===N.DOWN||x(`Transport session is not in working state, state: ${this._state}`));if(this._state===N.WAITING_FOR_DESTROY)return void a.Debug.formatDumpBytes($.substring(0,64),!0,0);if(this._httpReceiveConn.recStat("GotData"),F!==y.OK)return void this.handleRxError(F,$);if($.length===0)return this._packetReadState=0,void this._httpReceiveConn.send(this._smfDataTokenTSHeader);if(this._packetReadState===1)return void this._client.rxDataString($);this._incomingBuffer+=$;const R=u.Codec.ParseSMF.parseSMFAt(J.from(this._incomingBuffer,"latin1"),0,!0);if(R){const B=u.Codec.Transport.parseTsSmfHdrAt(J.from(this._incomingBuffer,"latin1"),R.headerLength,R);if(!B)return;switch(B.messageType){case u.SMFTransportSessionMessageType.DESTROY_RESP:return void this.handleDestroyResponse(B);case u.SMFTransportSessionMessageType.DATA:if(B.sessionId!==this._sid){const M=B.getResponse(),re=M?` (${M.responseCode} ${M.responseString})`:"",se=M?M.responseCode:null;return D(this._sid),D(B.sessionId),D($.substr(0,64)),this._state=N.CONNECTION_FAILED,void this._eventCB(new E(I.PARSE_FAILURE,`Session ID mismatch in data message, expected: ${Y(this._sid)}, got: ${Y(B.sessionId)}, ${re}`,se,p.PROTOCOL_ERROR,this._sid))}return this._packetReadState=1,this._incomingBuffer.length>R.headerLength+B.tsHeaderLength&&this._client.rxDataString(this._incomingBuffer.substr(R.headerLength+B.tsHeaderLength)),void(this._incomingBuffer="");default:throw new m(`Unexpected message type (${B.messageType}) on ReceiveData connection`,0)}}else if(u.Codec.ParseSMF.isSMFHeaderAvailable(J.from(this._incomingBuffer,"latin1"),0)&&!u.Codec.ParseSMF.isSMFHeaderValid(J.from(this._incomingBuffer,"latin1"),0)){x(`Couldn't decode message due to invalid smf header, dump first 64 bytes (or fewer) of buffer content:
|
|
90
|
+
${a.Debug.formatDumpBytes(this._incomingBuffer.substring(0,64),!0,0)}`);const B="Error parsing incoming message - invalid SMF header detected";this._state=N.CONNECTION_FAILED,this._eventCB(new E(I.PARSE_FAILURE,B,null,p.PROTOCOL_ERROR,null))}}handleRxDataToken(F,$){if(F!==y.OK)return void this.handleRxError(F,$);if($.length===0)return;const R=u.Codec.Decode.decodeCompoundMessage(J.from($,"latin1"),0);if(R)if(R.messageType!==u.SMFTransportSessionMessageType.DESTROY_RESP){if(R.sessionId!==this._sid){const B=R.getResponse(),M=B?` (${B.responseCode} ${B.responseString})`:"",re=B?B.responseCode:null;return D(this._sid),D(R.sessionId),D($.substr(0,64)),void(this._state!==N.WAITING_FOR_DESTROY?(this._state=N.CONNECTION_FAILED,this._eventCB(new E(I.PARSE_FAILURE,`Session ID mismatch in response message, expected: ${Y(this._sid)}, got: ${Y(R.sessionId)}, ${M}`,re,p.PROTOCOL_ERROR,this._sid))):this.destroyCleanup("Session ID mismatch in response message",p.PROTOCOL_ERROR))}if(R.messageType!==u.SMFTransportSessionMessageType.DATA_TOKEN&&R.messageType!==u.SMFTransportSessionMessageType.DATA_STREAM_TOKEN)throw new m(`Unexpected message type (${R.messageType}) on SendData connection`,0);this._haveToken=!0,this._httpSendConn.recStat("GotToken"),this.sendQueuedData()}else this.handleDestroyResponse(R);else this._state!==N.WAITING_FOR_DESTROY?(this._state=N.CONNECTION_FAILED,this._eventCB(new E(I.PARSE_FAILURE,"Failed to parse received data message",null,p.PROTOCOL_ERROR,this._sid))):this.destroyCleanup("Failed to parse received data message",p.PROTOCOL_ERROR)}handleRxError(F){k(`handleRxError, transport return code ${y.name(F)}`),this._state=N.CONNECTION_FAILED,F===y.DATA_DECODE_ERROR?this._eventCB(new E(I.DATA_DECODE_ERROR,"Received data decode error",null,p.DATA_DECODE_ERROR,this._sid)):this._eventCB(new E(I.SEND_ERROR,"Connection error",p.CONNECTION_ERROR,this._sid))}handleSendFailure(F,$){this._state===N.WAITING_FOR_DESTROY?(k(`Connection destroy failure (${$}) while in state ${this._state}`),this.destroyCleanup(`Connection destroy failure: ${$}`,p.CONNECTION_ERROR)):(k(`Connection failure (${$}) while in state ${this._state}`),this._eventCB(new E(I.SEND_ERROR,`Connection error: ${$}`,F,p.CONNECTION_ERROR,this._sid)))}handleCreateConnFailure(F,$){this._state!==N.DOWN&&(k(`Connection create failure (${$}) while in state ${this._state}`),this.destroyCleanup(`Connection create failure: ${$}`,p.CONNECTION_ERROR))}destroyTimerExpiry(){this.destroyCleanup("Destroy request timeout",p.CONNECTION_ERROR)}cancelDestroyTimeout(){this._destroyTimer&&(clearTimeout(this._destroyTimer),this._destroyTimer=null)}destroyCleanup(F,$,R){this._createConn&&this._createConn.abort(),this._httpSendConn&&this._httpSendConn.abort(),this._httpReceiveConn&&this._httpReceiveConn.abort(),this._createUrl=null,this._routerUrl=null,this._createConn=null,this._httpSendConn=null,this._httpReceiveConn=null,this._smfDataTokenTSHeader=null,this._rxChannelClient=null,this._routerTag="",this._queuedData=[],this._queuedDataSize=0,this._canSendNeeded=!1,this.cancelDestroyTimeout(),this.cancelConnectTimeout(),this._state=N.DOWN;const B=()=>{this._eventCB&&this._eventCB(new E(I.DESTROYED_NOTICE,F||"Session is destroyed",null,$||0,this._sid)),this._client=null,this._eventCB=null};R?setTimeout(B,0):B()}getInfoStr(){return`HTTPTransportSession; sid=${Y(this._sid)}; routerTag=${this._routerTag}`}}},7440:(o,h,r)=>{const{Base64:a,Convert:u}=r(9783),{XHRFactory:l}=r(3124),{encode:d}=a,{stringToUint8Array:_}=u;function p(g,m,T){g.responseType="arraybuffer",g.overrideMimeType(`${T}; charset=x-user-defined`),g.setRequestHeader("Content-Type",`${T}; charset=x-user-defined`),g.send(_(m))}function f(g,m,T){g.overrideMimeType(`${T}; charset=x-user-defined`),g.setRequestHeader("Content-Type",`${T}; charset=x-user-defined`),g.send(_(m).buffer)}function S(g,m,T,y){g.setRequestHeader("Content-Type",`${T}; charset=x-user-defined`),g.send(m==null?m:d(m),y)}const C=typeof window<"u"&&window.Uint8Array&&window.Blob?l.create(!0).responseType?p:f:S;o.exports.sendXhrBinary=C,o.exports.sendXhrText=S},3124:(o,h,r)=>{const{ErrorSubcode:a}=r(6706),{TransportError:u}=r(2680),l={create(d=!1){const _=typeof XMLHttpRequest<"u"?new XMLHttpRequest:null;if(!d&&!_)throw new u("Failed to create an XMLHTTPRequest",a.CREATE_XHR_FAILED);return _}};o.exports.XHRFactory=l},5113:(o,h,r)=>{const{TransportProtocol:a}=r(9072),{TSHState:u}=r(3718);o.exports.StateBase64=class extends u{constructor(l,d,_){super(l,a.HTTP_BASE64,d,_)}}},4207:(o,h,r)=>{const{TransportProtocol:a}=r(9072),{TSHState:u}=r(3718),{WebTransportCapabilities:l}=r(261);o.exports.StateBinary=class extends u{constructor(d,_,p){super(d,a.HTTP_BINARY,_,p)}validateLegal(){return l.xhrBinary()}}},9580:(o,h,r)=>{const{TransportProtocol:a}=r(9072),{TSHState:u}=r(3718),{WebTransportCapabilities:l}=r(261);o.exports.StateStreamingAndBinary=class extends u{constructor(d,_,p){super(d,a.HTTP_BINARY_STREAMING,_,p)}validateLegal(){return l.streaming()&&l.xhrBinary()}}},1529:(o,h,r)=>{const{TransportProtocol:a}=r(9072),{TSHState:u}=r(3718),{WebTransportCapabilities:l}=r(261);o.exports.StateWebSocketBinary=class extends u{constructor(d,_,p){super(d,a.WS_BINARY,_,p)}validateLegal(){return l.webSocket()}}},261:(o,h,r)=>{const a=r(9005),{WebSocketTransportSession:u}=r(9990),{HTTPConnection:l}=a,d={webSocket:()=>u.browserSupportsBinaryWebSockets(),xhrBinary:()=>l.browserSupportsXhrBinary(),streaming:()=>l.browserSupportsStreamingResponse()};o.exports.WebTransportCapabilities=d},3246:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.WebTransportEvent=a.new({CONNECT:"Connect",DESTROY:"Destroy",DOWNGRADE:"Downgrade",DESTROYED_NOTICE:"DestroyedNotice",CONNECT_TIMEOUT:"ConnectTimeout",UP_NOTICE:"UpNotice",SEND_ERROR:"SendError"})},6145:(o,h,r)=>{const{ErrorSubcode:a}=r(6706),{FsmEvent:u,State:l,StateMachine:d}=r(7414),{LogFormatter:_}=r(2694),{TransportReturnCode:p}=r(9944),{TransportSessionEvent:f}=r(7368),{TransportSessionEventCode:S}=r(3427),{WebTransportEvent:C}=r(3246),{WebTransportState:g}=r(73),{LOG_TRACE:m,LOG_INFO:T}=new _;o.exports.WebTransportFSM=class extends d{constructor(y,E){super({name:"WebTransportFSM"});const I=y,N=this,A=new _;A.formatter=function(...L){return[`[web-transport-fsm=${E()}]`,...L]},this.log=A.wrap(this.log,this),this.transport=I,this.initial(function(){return this.transitionTo(this.WebTransportDown,L=>{L.getStateMachine().getName()})}),this.unhandledEventReaction(function(L){return L.getName(),this.getCurrentState().getName(),this}),this.WebTransportDown=new l({name:g.DOWN,parentContext:this}).reaction(C.CONNECT,function(){return this.transitionTo(N.WebTransportConnecting)}).reaction(C.DESTROY,function(L){return I.destroyInternal(L._destroyMsg,L._subcode),this.transitionTo(N.WebTransportDestroying)}),this.WebTransportConnecting=new l({name:g.CONNECTING,parentContext:this}).entry(()=>{try{if(I.connectInternal()!==p.OK){const L=I.getConnError(),D=new u({name:C.DESTROY});return D._destroyMsg=L?L.message:"Error occurred while establishing transport",D._subcode=L?L.subcode:null,D._eventReason=L,this.processEvent(D)}}catch(L){T(`transport.connectInternal threw: ${L.message}`);const D=new u({name:C.DESTROY});return D._destroyMsg=L.message,D._subcode=L.subcode?L.subcode:a.CONNECTION_ERROR,D._eventReason=L,this.processEvent(D)}}).reaction(C.SEND_ERROR,L=>(I.notifyEvent(L._transportEvent),N.attemptDowngrade(L._transportEvent))).reaction(C.CONNECT_TIMEOUT,L=>N.attemptDowngrade(L._transportEvent)).reaction(C.DESTROYED_NOTICE,L=>(I.notifyEvent(L._transportEvent),this.transitionTo(N.WebTransportDown))).reaction(C.UP_NOTICE,function(L){return I.notifyEvent(L._transportEvent),this.transitionTo(N.WebTransportUp)}).reaction(C.DESTROY,function(L){return I.destroyInternal(L._destroyMsg,L._subcode),this.transitionTo(N.WebTransportDestroying)}),this.WebTransportDowngrading=new l({name:g.DOWNGRADING,parentContext:this}).reaction(C.DESTROYED_NOTICE,function(L){return T("Web transport: request downgrade"),I.completeDowngrade()?this.transitionTo(N.WebTransportConnecting):(T("Web transport: connection error, no downgrade"),I.notifyEvent(L._transportEvent),N.notifyDowngradeFailed(),this.transitionTo(N.WebTransportDown))}).reaction(C.DESTROY,function(L){return I.destroyInternal(L._destroyMsg,L._subcode),this.transitionTo(N.WebTransportDestroying)}),this.WebTransportUp=new l({name:g.UP,parentContext:this}).reaction(C.DOWNGRADE,L=>N.attemptDowngrade(new f(L._downgradeMsg,L._subcode))).reaction(C.DESTROYED_NOTICE,function(L){return I.notifyEvent(L._transportEvent),this.transitionTo(N.WebTransportDown)}).reaction(C.DESTROY,function(L){return I.destroyInternal(L._destroyMsg,L._subcode),this.transitionTo(N.WebTransportDestroying)}).reaction(C.SEND_ERROR,function(L){return I.notifyEvent(L._transportEvent),I.destroyInternal(L._destroyMsg,L._subcode),this.transitionTo(N.WebTransportDestroying)}),this.WebTransportDestroying=new l({name:g.DESTROYING,parentContext:this}).reaction(C.DESTROYED_NOTICE,function(L){return I.notifyEvent(L._transportEvent),this.transitionTo(N.WebTransportDown)})}attemptDowngrade(y){const{infoStr:E,errorSubcode:I}=y;return this.transport.beginDowngrade(E,I)?this.transitionTo(this.WebTransportDowngrading):(this.transport.destroyInternal(E,I),this.transport.notifyEvent(y),this.transitionTo(this.WebTransportDestroying))}notifyDowngradeFailed(){this.transport.notifyEvent(new f(S.DOWNGRADE_FAILED,"Downgrade failed"))}}},1517:(o,h,r)=>{r(2694);const{TransportBase:a}=r(383),{TransportClientStats:u}=r(8188),{TransportReturnCode:l}=r(9944),{TransportSessionState:d}=r(3304);o.exports.WebTransportSessionBase=class extends a{constructor(_,p,f,S){super(_,p,f,S),this._connectTimeout=S.transportDowngradeTimeoutInMsecs,this._connectTimer=null,this._clientstats=new u,this._sendBufferMaxSize=S.sendBufferMaxSize,this._maxPayloadBytes=S.maxWebPayload,this._queuedData=[],this._queuedDataSize=0,this._canSendNeeded=!1,this._state=d.DOWN,this._connError=null}getClientStats(){return this._clientstats}createConnectTimeout(){this._connectTimeout>0&&(this._connectTimer=setTimeout(()=>{this.connectTimerExpiry()},this._connectTimeout))}cancelConnectTimeout(){this._connectTimer&&(clearTimeout(this._connectTimer),this._connectTimer=null)}connectTimerExpiry(){}allowEnqueue(_){return this._queuedDataSize===0||_+this._queuedDataSize<=this._sendBufferMaxSize}enqueueFailNoSpace(){return this._canSendNeeded=!0,l.NO_SPACE}flush(_){_()}getQueuedDataToSend(){let _="",p=this._maxPayloadBytes;if(this.getBufferedAmount&&this.getBufferedAmount(),this.getBufferedAmount){if(p=this._maxPayloadBytes-this.getBufferedAmount(),p<=0)return this._maxPayloadBytes,this.getBufferedAmount(),this._bufferedAmountQueryIntervalInMsecs*this._bufferedAmountQueryIntervalDelayMultiplier<=4e3&&(this._bufferedAmountQueryIntervalDelayMultiplier*=2),_;this._bufferedAmountQueryIntervalDelayMultiplier=1}if(this._queuedDataSize>p){let f=p;for(;f&&this._queuedDataSize;){const S=this._queuedData[0],C=S.length;C>f?(_+=S.substr(0,f),this._queuedData[0]=S.substr(f),this._queuedDataSize-=f,f=0):(_+=this._queuedData.shift(),f-=C,this._queuedDataSize-=C,this._clientstats.msgWritten++)}}else _=this._queuedData.join(""),this._clientstats.msgWritten+=this._queuedData.length,this._queuedData=[],this._queuedDataSize=0;return _.length,_}}},73:(o,h,r)=>{const{Enum:a}=r(7444);o.exports.WebTransportState=a.new({DOWN:"WebTransportDown",CONNECTING:"WebTransportConnecting",DOWNGRADING:"WebTransportDowngrading",DESTROYING:"WebTransportDestroying",UP:"WebTransportUp"})},1250:(o,h,r)=>{const{ErrorSubcode:a,OperationError:u}=r(6706),{HTTPTransportSession:l}=r(9005),{LOG_TRACE:d,LOG_INFO:_,LOG_ERROR:p}=r(2694),{FsmEvent:f}=r(7414),{TransportBase:S}=r(383),{TransportProtocol:C}=r(9072),{TransportProtocolHandler:g}=r(5208),{TransportReturnCode:m}=r(9944),{TransportSessionEventCode:T}=r(3427),{WebSocketTransportSession:y}=r(9990),{WebTransportEvent:E}=r(3246),{WebTransportFSM:I}=r(6145);o.exports.WebTransport=class extends S{constructor(N,A,L,D,q){super(N,A,L,D),D.webTransportProtocolList,this._transportHandler=new g(N,D.webTransportProtocolList),this._webTransportFsm=new I(this,q),this._webTransportFsm.start()}notifyEvent(N){this._eventCB(N)}handleDestroyed(){this._transportSession=null}handleTransportEvent(N){let A;switch(_(`Web transport receive transport event: ${N}`),N.getTransportEventCode()){case T.UP_NOTICE:A=new f({name:E.UP_NOTICE}),A._transportEvent=N,this._webTransportFsm.processEvent(A);break;case T.DESTROYED_NOTICE:this.handleDestroyed(),A=new f({name:E.DESTROYED_NOTICE}),A._transportEvent=N,this._webTransportFsm.processEvent(A);break;case T.SEND_ERROR:A=new f({name:E.SEND_ERROR}),A._transportEvent=N,this._webTransportFsm.processEvent(A);break;case T.CONNECT_TIMEOUT:A=new f({name:E.CONNECT_TIMEOUT}),A._transportEvent=N,this._webTransportFsm.processEvent(A);break;case T.DOWNGRADE_FAILED:this._lastDowngradeSucceeded=!1;break;case T.DOWNGRADE_SUCCEEDED:this._lastDowngradeSucceeded=!0;break;default:this._eventCB(N)}}connect(){const N=new f({name:E.CONNECT});return this._webTransportFsm.processEvent(N),m.OK}connectInternal(){this._transportSession=null;const N=this._transportHandler.getTransportProtocol();switch(this._props.transportProtocol=N,N){case C.HTTP_BASE64:case C.HTTP_BINARY:case C.HTTP_BINARY_STREAMING:this._transportSession=new l(this._url,A=>this.handleTransportEvent(A),this._client,this._props);break;case C.WS_BINARY:this._transportSession=new y(this._url,A=>this.handleTransportEvent(A),this._client,this._props);break;default:throw p(`Web transport unrecognized TransportProtocol: ${N}`),new u(`No transport session provider for scheme: ${N}`,a.CONNECTION_ERROR,N)}return _(`Connect Transport ${N}`),this._transportSession.connect()}destroy(N,A){const L=new f({name:E.DESTROY});return L._destroyMsg=N,L._subcode=A,this._webTransportFsm.processEvent(L),m.OK}forceFailure(N){const A=N??"";return this._transportSession&&this._transportSession._socket._sender._socket.destroy(new Error(A)),m.OK}beginDowngrade(N,A){return!!this._transportHandler.canCompleteDowngrade()&&(this.destroyInternal(N,A),!0)}completeDowngrade(){return!!this._transportHandler.canCompleteDowngrade()&&this._transportHandler.completeDowngrade()}destroyInternal(N,A){this._transportSession&&this._transportSession.destroy(N,A)}flush(N){return this._transportSession.flush(N)}getConnError(){return this._transportSession?this._transportSession._connError:null}getInfoStr(){return this._transportSession?this._transportSession.getInfoStr():"Not connected."}getTransportProtocol(){return this._transportHandler.getTransportProtocol()}getClientStats(){return this._transportSession?this._transportSession.getClientStats():null}requestDowngrade(N,A){this._lastDowngradeSucceeded=void 0;const L=new f({name:E.DOWNGRADE});return L._downgradeMsg=N,L._subcode=A,this._webTransportFsm.processEvent(L),this._lastDowngradeSucceeded}send(N,A){return this._transportSession.send(N,A)}}},5181:o=>{o.exports.WebSocketCloseCodes={0:{name:"Unknown code",description:"No status code was returned by the operation"},1e3:{name:"Normal Closure",description:"The connection closed normally"},1001:{name:"Going Away",description:"The endpoint is going away due to a server failure or client navigation"},1002:{name:"Protocol Error",description:"A WebSocket protocol error occurred"},1003:{name:"Unsupported Data",description:"The endpoint cannot handle the specified data type"},1004:{name:"Reserved",description:""},1005:{name:"No Status Recvd",description:"Expected a status code but none was provided"},1006:{name:"Abnormal Closure",description:"No close frame was received before remote hangup"},1007:{name:"Invalid Frame Payload Data",description:"A message contained data inconsistent with its encoding"},1008:{name:"Policy Violation",description:"A message violated endpoint policy"},1009:{name:"Message Too Big",description:"A data frame was too large"},1010:{name:"Missing Extension",description:"The endpoint did not negotiate an expected extension"},1011:{name:"Internal Error",description:"The server encountered an unexpected condition that prevented it from fulfilling the request"},1012:{name:"Service Restart",description:"The server is restarting"},1013:{name:"Try Again Later",description:"The server is terminating the connection due to a temporary condition"},1014:{name:"Bad Gateway",description:"A gateway or proxy received an invalid response from the upstream server"},1015:{name:"TLS Handshake",description:"The connection was closed due to a failure to perform a TLS handshake"}}},9990:(o,h,r)=>{const{LOG_TRACE:a,LOG_DEBUG:u,LOG_INFO:l,LOG_WARN:d,LOG_ERROR:_}=r(2694),{ArrayUtils:p}=r(968),{Convert:f,Hex:S}=r(9783),{ErrorSubcode:C}=r(6706),{mixin:g}=r(7444),{TransportError:m}=r(2680),{TransportReturnCode:T}=r(9944),{TransportSessionEvent:y}=r(7368),{TransportSessionEventCode:E}=r(3427),{TransportSessionState:I}=r(3304),{WebSocketCloseCodes:N}=r(5181),{WebTransportSessionBase:A}=r(1517),{stringToArrayBuffer:L}=(r(886),r(7625),f),{formatHexString:D}=S,{includes:q}=p;let Y=(typeof window>"u"?r.g:window).WebSocket;class Q extends A{constructor(x,k,J,F){super(x,k,J,F),this._url=function($){return`ws${$.match(/(ws|http)(s?:\/\/.+)/)[2]}`}(x),this._socket=null,this._sessionId=new Date().getTime(),this._bufferedAmountQueryIntervalInMsecs=F.bufferedAmountQueryIntervalInMsecs,this._bufferedAmountQueryTimer=null,this._bufferedAmountQueryIntervalDelayMultiplier=1}onOpen(){this.cancelConnectTimeout(),this._state=I.SESSION_UP,this._eventCB(new y(E.UP_NOTICE,"Connected",0,null,this._sessionId))}onClose(x,k){if(x!==this._socket||this._state===I.WAITING_FOR_DESTROY)return;const J=[],F=N[k.code]||N[0];J.push(`${k.code} ${F.name} (${F.description})`),k.wasClean!==void 0&&J.push(`clean closure: ${k.wasClean}`),k.reason&&J.push(`reason: ${k.reason}`);const $=J.join(", ");k.type,k.wasClean,k.code,k.reason,this._state=I.CONNECTION_FAILED,this.destroy(`Connection closed: ${$}`,C.COMMUNICATION_ERROR)}onDrain(){this.maybeEmitCanSend(),this.maybeEmitFlush()}onBufferedAmountPoll(){this.getBufferedAmount()===0?this.onDrain():this.scheduleQuery&&this.scheduleQuery()}onError(x,k){if(l(`Websocket Transport Session onError for socket ${x} while socket is ${this._socket}`),x!==this._socket)return void l("Websocket Transport Session stray onError for previous socket, ignoring.");if(this._state===I.WAITING_FOR_DESTROY)return void l("WebSocket transport is being destroyed, ignore error");const J=k.message?`: ${k.message}`:"";l(`WebSocket transport connection error ${J} while in state ${this._state}`),this._state===I.WAITING_FOR_CONNECT?(this.cancelConnectTimeout(),this._state=I.CONNECTION_FAILED,this.destroy(`Connection failed: ${J}`,C.CONNECTION_ERROR)):this._eventCB(new y(E.SEND_ERROR,`Connection error${J}`,null,C.CONNECTION_ERROR,null))}onMessage(x){this._client&&this._client.rxDataArrayBuffer(x.data)}connectTimerExpiry(){l("WebSocket transport connect timeout"),this.state=I.CONNECTION_FAILED,this._eventCB(new y(E.CONNECT_TIMEOUT,"Connection timed out",null,C.TIMEOUT))}connect(){if(this._state!==I.DOWN)return _(`Invalid state for operation: ${I.nameOf(this._state)}`),T.INVALID_STATE_FOR_OPERATION;if(!this._url)return d("Cannot connect to null URL"),T.CONNECTION_ERROR;this._socket&&this.onError("Socket already connected"),l("Establishing WebSocket transport session");try{this.createConnectTimeout(),this._state=I.WAITING_FOR_CREATE,l("Constructing socket"),this._socket=new Y(this._url,"smf.solacesystems.com"),this._socket.binaryType="arraybuffer",this._socket.onopen=this.onOpen.bind(this),this._socket.onmessage=this.onMessage.bind(this),this._socket.onclose=this.onClose.bind(this,this._socket),this._socket.onerror=this.onError.bind(this,this._socket)}catch(x){if(l(`Error connecting: ${x.message}`),x.stack,this._state=I.CONNECTION_FAILED,this.cancelConnectTimeout(),!(x instanceof m))throw new m(`Could not create WebSocket: ${x.message}`,x.subcode||C.CONNECTION_ERROR);return this._connError=x,T.CONNECTION_ERROR}return l("WebSocket is connecting"),T.OK}send(x,k=!1){if(this._state!==I.SESSION_UP)return T.INVALID_STATE_FOR_OPERATION;const J=x.length,F=this._sendBufferMaxSize-this.getBufferedAmount()>=0;if(!k&&!F)return this._canSendNeeded=!0,this.scheduleQuery&&this.scheduleQuery(),T.NO_SPACE;const $=this._maxPayloadBytes,R=L(x);if(J>$)for(let B=0;B<J;B+=$)this._socket.send(R.slice(B,B+$));else this._socket.send(R);return this._clientstats.bytesWritten+=J,++this._clientstats.msgWritten,T.OK}getBufferedAmount(){return this._socket?this._socket.bufferedAmount:0}flush(x){this._flushCallback=x,this.maybeEmitFlush()}maybeEmitCanSend(){this._canSendNeeded&&this.getBufferedAmount()<this._sendBufferMaxSize&&(this._canSendNeeded=!1,this._eventCB(new y(E.CAN_ACCEPT_DATA,"",null,0,this._sessionId)))}maybeEmitFlush(){if(!this._flushCallback)return;if(this.getBufferedAmount()>0)return void(this._bufferedAmountQueryTimer||this.scheduleQuery());const x=this._flushCallback;this._flushCallback=null,x()}destroy(x,k){return this._state!==I.DOWN&&(l(`Destroy WebSocket transport: ${x}`),this._state=I.WAITING_FOR_DESTROY,this._socket&&(this._socket.close(),this._socket.onopen=null,this._socket.onmessage=null,this._socket.onclose=null,this._socket.onerror=function(){},this._socket=null),this._connectTimer&&(clearTimeout(this._connectTimer),this._connectTimer=void 0),this.cancelQuery(),this._bufferedAmountQueryIntervalDelayMultiplier=1,this._canSendNeeded=!1,this._state=I.DOWN,this._client=null),this._eventCB&&(this._eventCB(new y(E.DESTROYED_NOTICE,x||"Session is destroyed",null,k||0,this._sessionId)),this._eventCB=null),T.OK}getInfoStr(){return`WebSocketTransportSession; sid=${D(this._sessionId)}`}static browserSupportsBinaryWebSockets(){const x=["function","object"];return q(x,typeof Y)&&q(x,typeof ArrayBuffer)&&q(x,typeof Uint8Array)?"binaryType"in Y.prototype?(l("websocket browserSupportBinaryCheck: true - WebSocket supports binaryType"),!0):(l("websocket browserSupportBinaryCheck: false - WebSocket does not support binaryType"),!1):(l("websocket browserSupportBinaryCheck: false - some required classes not supported"),!1)}}g(Q,class{scheduleQuery(){if(this.getBufferedAmount()>0&&this._bufferedAmountQueryIntervalInMsecs>0){this.cancelQuery(),this._bufferedAmountQueryIntervalDelayMultiplier>1&&(this._bufferedAmountQueryIntervalInMsecs,this._bufferedAmountQueryIntervalDelayMultiplier);const W=this._bufferedAmountQueryIntervalInMsecs*this._bufferedAmountQueryIntervalDelayMultiplier;this._bufferedAmountQueryTimer=setTimeout(()=>{this.cancelQuery();try{this.onBufferedAmountPoll()}catch(x){_(`Error occurred in onBufferedAmountPoll: ${x.message}`),x.stack}},W)}}cancelQuery(){this._bufferedAmountQueryTimer&&(clearTimeout(this._bufferedAmountQueryTimer),this._bufferedAmountQueryTimer=null)}}),o.exports.WebSocketTransportSession=Q},968:(o,h,r)=>{const{APIProperties:a}=r(9544),{APIPropertiesValidators:u}=r(5050),{ArrayUtils:l}=r(8821),{parseURL:d}=r(6321),{Process:_}=r(85),{StringBuffer:p}=r(9710),{StringUtils:f}=r(319),{TimingBucket:S}=r(4255),{UUID:C}=r(77),{Version:g}=r(9436),m=r(4205);o.exports={clone:m,parseURL:d,APIProperties:a,APIPropertiesValidators:u,ArrayUtils:l,Process:_,StringBuffer:p,StringUtils:f,TimingBucket:S,UUID:C,Version:g}},5050:(o,h,r)=>{const{Check:a}=r(802),{ErrorSubcode:u,OperationError:l}=r(6706),d={validateInstance(_,p,f,...S){S.forEach(C=>{C.shift()(_,p,f,...C)})},valInstance(_,p,f,S,C){if(!a.instanceOf(p[f],S))throw new l(`${_} validation: Property '${f}' must be instance of ${C}`)},valNotEmpty(_,p,f){if(a.none(p[f])||p[f]==="")throw new l(`${_} validation: Property '${f}' cannot be empty.`,u.PARAMETER_OUT_OF_RANGE)},valLength(_,p,f,S){if(a.string(p[f])&&p[f].length>S)throw new l(`${_} validation: Property '${f}' exceeded max length ${S}`,u.PARAMETER_OUT_OF_RANGE)},valRange(_,p,f,S,C){if(a.number(p[f])&&(p[f]<S||p[f]>C))throw new l(`${_} validation: Property '${f}' out of range [${S}; ${C}].`,u.PARAMETER_OUT_OF_RANGE)},valString(_,p,f){if(!a.string(p[f]))throw new l(`${_} validation: Property '${f}' must be type string; was ${typeof p[f]}`,u.PARAMETER_INVALID_TYPE)},valNumber(_,p,f){if(!a.number(p[f]))throw new l(`${_} validation: Property '${f}' must be type number; was ${typeof p[f]}`,u.PARAMETER_INVALID_TYPE)},valBoolean(_,p,f){const S=p[f];if(!a.boolean(S))throw new l(`${_} validation: Property '${f}' must be type boolean; was ${typeof S}`,u.PARAMETER_INVALID_TYPE)},valIsMember(_,p,f,S,C,g=!1){const m=p[f];if(!(g&&m==null||S.values.indexOf(m)>=0))throw new l(`${_} validation: Property '${f}'=${m} must be a member of ${C}`,u.PARAMETER_INVALID_TYPE)},valStringOrArray(_,p,f){const S=p[f];if(typeof S!="string"&&!Array.isArray(S))throw new l(`${_} validation: Property '${f}' must be a string or array`,u.PARAMETER_INVALID_TYPE)},valArrayIsMember(_,p,f,S,C,g,m,T){if(p[f]==null){if(g)return;throw new l(`${_} validation: Property '${f}' must be type Array`,u.PARAMETER_INVALID_TYPE)}if(!Array.isArray(p[f]))throw new l(`${_} validation: Property '${f}' must be type Array`,u.PARAMETER_INVALID_TYPE);if(!m&&p[f].length===0)throw new l(`${_} validation: Property '${f}' cannot be empty`,u.PARAMETER_INVALID_TYPE);p[f].forEach((y,E)=>{if(!S.values.includes(y))throw new l(`${_} validation: Property '${f}' must be an array of ${C}`,u.PARAMETER_INVALID_TYPE);if(!T&&p[f].indexOf(y,E+1)>=0)throw new l(`${_} validation: Property '${f}' cannot have duplicate element value`,u.PARAMETER_OUT_OF_RANGE)})},valArrayOfString(_,p,f){const S=p[f];if(a.something(S)){if(!Array.isArray(S))throw new l(`${_} validation: Property '${f}' must be type Array`,u.PARAMETER_INVALID_TYPE);S.forEach(C=>{if(typeof C!="string")throw new l(`${_} validation: Property '${f}' must be an array of string`,u.PARAMETER_INVALID_TYPE)})}},valTopicString(_,p,f){const{DestinationUtil:S,DestinationType:C}=r(9620);o.exports.APIPropertiesValidators.valString(_,p,f);const g=p[f],m=S.validateAndEncode(C.TOPIC,g);if(m.error)throw new l(`${_} validation: Property '${f}' must be a valid topic string: ${m.error}`,u.PARAMETER_OUT_OF_RANGE)},valTopicStringOrEmpty(_,p,f){const S=p[f];S&&S.length&&o.exports.APIPropertiesValidators.valTopicString(_,p,f)}};o.exports.APIPropertiesValidators=d},9544:(o,h,r)=>{var a=r(2195);const u=r(4205);o.exports.APIProperties=class{constructor(...l){Object.assign(this,...l)}toString(){return a(this)}clone(){return u(this,!1,1)}}},8821:o=>{o.exports.ArrayUtils={flatten:function h(r){return r.reduce((a,u)=>a.concat(Array.isArray(u)?h(u):u),[])},includes:function(h,r){return h.some(a=>a===r)}}},8858:o=>{o.exports=function(h){let r=!1;if(!h.forceJURL)try{const I=new URL("b","http://a");I.pathname="c%20d",r=I.href==="http://a/c%20d"}catch{}if(r)return;const a=Object.create(null);a.ftp=21,a.file=0,a.gopher=70,a.http=80,a.https=443,a.ws=80,a.wss=443;const u=Object.create(null);function l(){this._scheme="",this._schemeData="",this._username="",this._password=null,this._host="",this._port="",this._path=[],this._query="",this._fragment="",this._isInvalid=!1,this._isRelative=!1}function d(I){return a[I]!==void 0}function _(){l.call(this),this._isInvalid=!0}function p(I){return I===""&&_.call(this),I.toLowerCase()}function f(I){const N=I.charCodeAt(0);return N>32&&N<127&&[34,35,60,62,63,96].indexOf(N)===-1?I:encodeURIComponent(I)}function S(I){const N=I.charCodeAt(0);return N>32&&N<127&&[34,35,60,62,96].indexOf(N)===-1?I:encodeURIComponent(I)}let C;u["%2e"]=".",u[".%2e"]="..",u["%2e."]="..",u["%2e%2e"]="..";const g=/[a-zA-Z]/,m=/[a-zA-Z0-9+\-.]/;function T(I,N,A){function L(x){}let D=N||"scheme start",q=0,Y="",Q=!1,W=!1;e:for(;(I[q-1]!==C||q===0)&&!this._isInvalid;){const x=I[q];switch(D){case"scheme start":if(!x||!g.test(x)){if(N)break e;Y="",D="no scheme";continue}Y+=x.toLowerCase(),D="scheme";break;case"scheme":if(x&&m.test(x))Y+=x.toLowerCase();else{if(x!==":"){if(N){if(C===x)break e;break e}Y="",q=0,D="no scheme";continue}if(this._scheme=Y,Y="",N)break e;d(this._scheme)&&(this._isRelative=!0),D=this._scheme==="file"?"relative":this._isRelative&&A&&A._scheme===this._scheme?"relative or authority":this._isRelative?"authority first slash":"scheme data"}break;case"scheme data":x==="?"?(this._query="?",D="query"):x==="#"?(this._fragment="#",D="fragment"):C!==x&&x!==" "&&x!==`
|
|
91
|
+
`&&x!=="\r"&&(this._schemeData+=f(x));break;case"no scheme":if(A&&d(A._scheme)){D="relative";continue}_.call(this);break;case"relative or authority":if(x!=="/"||I[q+1]!=="/"){D="relative";continue}D="authority ignore slashes";break;case"relative":if(this._isRelative=!0,this._scheme!=="file"&&(this._scheme=A._scheme),C===x){this._host=A._host,this._port=A._port,this._path=A._path.slice(),this._query=A._query,this._username=A._username,this._password=A._password;break e}if(x==="/"||x==="\\")D="relative slash";else if(x==="?")this._host=A._host,this._port=A._port,this._path=A._path.slice(),this._query="?",this._username=A._username,this._password=A._password,D="query";else{if(x!=="#"){const k=I[q+1],J=I[q+2];(this._scheme!=="file"||!g.test(x)||k!==":"&&k!=="|"||C!==J&&J!=="/"&&J!=="\\"&&J!=="?"&&J!=="#")&&(this._host=A._host,this._port=A._port,this._username=A._username,this._password=A._password,this._path=A._path.slice(),this._path.pop()),D="relative path";continue}this._host=A._host,this._port=A._port,this._path=A._path.slice(),this._query=A._query,this._fragment="#",this._username=A._username,this._password=A._password,D="fragment"}break;case"relative slash":if(x!=="/"&&x!=="\\"){this._scheme!=="file"&&(this._host=A._host,this._port=A._port,this._username=A._username,this._password=A._password),D="relative path";continue}D=this._scheme==="file"?"file host":"authority ignore slashes";break;case"authority first slash":if(x!=="/"){D="authority ignore slashes";continue}D="authority second slash";break;case"authority second slash":if(D="authority ignore slashes",x!=="/")continue;break;case"authority ignore slashes":if(x!=="/"&&x!=="\\"){D="authority";continue}break;case"authority":if(x==="@"){Q&&(Y+="%40"),Q=!0;for(let k=0;k<Y.length;k++){const J=Y[k];if(J===" "||J===`
|
|
92
|
+
`||J==="\r")continue;if(J===":"&&this._password===null){this._password="";continue}const F=f(J);this._password!==null?this._password+=F:this._username+=F}Y=""}else{if(C===x||x==="/"||x==="\\"||x==="?"||x==="#"){q-=Y.length,Y="",D="host";continue}Y+=x}break;case"file host":if(C===x||x==="/"||x==="\\"||x==="?"||x==="#"){Y.length!==2||!g.test(Y[0])||Y[1]!==":"&&Y[1]!=="|"?(Y.length===0||(this._host=p.call(this,Y),Y=""),D="relative path start"):D="relative path";continue}x===" "||x===`
|
|
93
93
|
`||x==="\r"?void 0:Y+=x;break;case"host":case"hostname":if(x!==":"||W){if(C===x||x==="/"||x==="\\"||x==="?"||x==="#"){if(this._host=p.call(this,Y),Y="",D="relative path start",N)break e;continue}x!==" "&&x!==`
|
|
94
94
|
`&&x!=="\r"?(x==="["?W=!0:x==="]"&&(W=!1),Y+=x):void 0}else if(this._host=p.call(this,Y),Y="",D="port",N==="hostname")break e;break;case"port":if(/[0-9]/.test(x))Y+=x;else{if(C===x||x==="/"||x==="\\"||x==="?"||x==="#"||N){if(Y!==""){const k=parseInt(Y,10);k!==a[this._scheme]&&(this._port=`${k}`),Y=""}if(N)break e;D="relative path start";continue}x===" "||x===`
|
|
95
|
-
`||x==="\r"?void 0:
|
|
96
|
-
`&&x!=="\r"&&(Y+=
|
|
95
|
+
`||x==="\r"?void 0:_.call(this)}break;case"relative path start":if(D="relative path",x!=="/"&&x!=="\\")continue;break;case"relative path":if(C!==x&&x!=="/"&&x!=="\\"&&(N||x!=="?"&&x!=="#"))x!==" "&&x!==`
|
|
96
|
+
`&&x!=="\r"&&(Y+=f(x));else{const k=u[Y.toLowerCase()];k&&(Y=k),Y===".."?(this._path.pop(),x!=="/"&&x!=="\\"&&this._path.push("")):Y==="."&&x!=="/"&&x!=="\\"?this._path.push(""):Y!=="."&&(this._scheme==="file"&&this._path.length===0&&Y.length===2&&g.test(Y[0])&&Y[1]==="|"&&(Y=`${Y[0]}:`),this._path.push(Y)),Y="",x==="?"?(this._query="?",D="query"):x==="#"&&(this._fragment="#",D="fragment")}break;case"query":N||x!=="#"?C!==x&&x!==" "&&x!==`
|
|
97
97
|
`&&x!=="\r"&&(this._query+=S(x)):(this._fragment="#",D="fragment");break;case"fragment":C!==x&&x!==" "&&x!==`
|
|
98
|
-
`&&x!=="\r"&&(this._fragment+=x)}q++}}function y(I,N){N===void 0||N instanceof y||(N=new y(String(N))),I=String(I),this._url=I,l.call(this);const A=I.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g,"");T.call(this,A,null,N)}y.prototype={toString(){return this.href},get href(){if(this._isInvalid)return this._url;let I="";return this._username===""&&this._password===null||(I=this._username+(this._password!==null?`:${this._password}`:"")+"@"),this.protocol+(this._isRelative?`//${I}${this.host}`:"")+this.pathname+this._query+this._fragment},set href(I){l.call(this),T.call(this,I)},get protocol(){return`${this._scheme}:`},set protocol(I){this._isInvalid||T.call(this,`${I}:`,"scheme start")},get host(){return this._isInvalid?"":this._port?`${this._host}:${this._port}`:this._host},set host(I){!this._isInvalid&&this._isRelative&&T.call(this,I,"host")},get hostname(){return this._host},set hostname(I){!this._isInvalid&&this._isRelative&&T.call(this,I,"hostname")},get port(){return this._port},set port(I){!this._isInvalid&&this._isRelative&&T.call(this,I,"port")},get pathname(){return this._isInvalid?"":this._isRelative?`/${this._path.join("/")}`:this._schemeData},set pathname(I){!this._isInvalid&&this._isRelative&&(this._path=[],T.call(this,I,"relative path start"))},get search(){return this._isInvalid||!this._query||this._query==="?"?"":this._query},set search(I){!this._isInvalid&&this._isRelative&&(this._query="?",I[0]==="?"&&(I=I.slice(1)),T.call(this,I,"query"))},get hash(){return this._isInvalid||!this._fragment||this._fragment==="#"?"":this._fragment},set hash(I){this._isInvalid||(this._fragment="#",I[0]==="#"&&(I=I.slice(1)),T.call(this,I,"fragment"))},get origin(){if(this._isInvalid||!this._scheme)return"";switch(this._scheme){case"data":case"file":case"javascript":case"mailto":return"null"}const I=this.host;return I?`${this._scheme}://${I}`:""}};const E=h.URL;E&&(y.createObjectURL=function(...I){return E.createObjectURL(...I)},y.revokeObjectURL=function(I){E.revokeObjectURL(I)}),h.URL=y}},4205:(o,h,r)=>{var a=r(8287).hp;const u=function(){function l(g,m){return m!=null&&g instanceof m}let d,
|
|
99
|
-
`),T=0,g.clear())}return C.toString()},
|
|
100
|
-
`)},o.exports.StringUtils=_},4255:o=>{o.exports.TimingBucket=class{constructor(h,r){this.name=h,this.interval=r,this.buckets=[]}get bucketCount(){let h=0;for(let r=0,a=this.buckets.length;r<a;++r)h+=this.buckets[r]||0;return h}log(h){if(h===void 0||isNaN(h))return;const r=Math.floor(h/this.interval)*this.interval;this.buckets[r]=this.buckets[r]||0,this.buckets[r]++}toString(){const h=[];return this.buckets.forEach(r=>{h.push(`${r}: ${this.buckets[r]}`)}),`{${h.join(", ")}}`}}},6321:function(o,h,r){let a;{const u=typeof window<"u"?window:this;r(8858)(u),a=function(...l){return new URL(...l)}}o.exports.parseURL=a},77:o=>{o.exports.UUID={generateUUID:function(){let h=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{const a=(h+16*Math.random())%16|0;return h=Math.floor(h/16),(r==="x"?a:3&a|8).toString(16)})}}},9436:o=>{const h=new Date(Date.parse("Tue Jul 09 2024 16:55:33 GMT-0400 (Eastern Daylight Time)")),r="RELEASE",a=(()=>{const d=p=>p<10?`0${p}`:p,f=h;return`${f.getFullYear()}/${d(f.getMonth()+1)}/${d(f.getDate())} ${d(f.getHours())}:${d(f.getMinutes())}`})(),u=["SolclientJS","10.17.0",r,a].join(", "),l={version:"10.17.0",date:h,formattedDate:a,target:{name:"browser",node:!1,browser:!0},mode:r,debug:!1,release:!0,summary:u,toString:()=>u};o.exports.Version=l},802:(o,h,r)=>{const{Check:a}=r(7434),{Parameter:u}=r(1537);o.exports.Check=a,o.exports.Parameter=u},2843:o=>{function h(a){return a.reduce((u,l)=>u.concat(Array.isArray(l)?h(l):l),[])}const r=(()=>{const a={nothing:u=>u==null,anything:u=>!r.nothing(u),undefined:u=>u===void 0,defined:u=>!r.undefined(u),array:u=>r.anything(u)&&Array.isArray(u),object:u=>!r.array(u)&&u!==null&&(typeof u=="object"||u instanceof Object),instanceOf:(u,l)=>r.object(u)&&u instanceof l,type:(u,l)=>typeof u===l,instanceOfAny:(u,...l)=>r.array(l)&&h(l).some(d=>r.instanceOf(u,d)),empty:u=>!!r.nothing(u)||!(!r.object(u)||Object.keys(u).length!==0)||u.length===0,truthy:(u,l)=>!!l(u),rangeGe:(u,l)=>u>=l,rangeGt:(u,l)=>u>l,rangeLe:(u,l)=>u<=l,rangeLt:(u,l)=>u<l,rangeCompare(u,l,d,...f){switch(l){case"=":case"==":case"===":return u===d;case"~=":case"=~":{const p=f[0]||1e6;return Math.abs(u-d)<p}case"<":return u<d;case"<=":return u<=d;case">":return u>d;case">=":return u>=d;default:throw new Error(`Illegal operator for rangeCompare: ${l}`)}},NaN:u=>Number.isNaN(u),included(u,l){if(r.nothing(l))return!1;if(l.includes)return l.includes(u);if(Array.isArray(l))return l.indexOf(u)>=0;if(r.object(l)){const d=Object.keys(l);return r.included(u,d)}return!1},equal:(u,l)=>u===l,member:(u,l)=>r.anything(l)&&(r.array(l)?r.included(u,l):Object.keys(l).some(d=>l[d]===u)),boolean:u=>r.type(u,"boolean"),number:u=>r.type(u,"number"),string:u=>r.type(u,"string"),function:u=>r.type(u,"function")};return a.none=a.nothing,a.something=a.anything,Object.keys(a).forEach(u=>{a[u].orNull=function(l,...d){return l===null||a[u](l,...d)},a[u].orUndefined=function(l,...d){return l===void 0||a[u](l,...d)},a[u].orNothing=function(l,...d){return a.nothing(l)||a[u](l,...d)}}),a})();o.exports.BaseChecks=r},7434:(o,h,r)=>{const{BaseChecks:a}=r(2843);function u(d){return{then:d?f=>f():(f,p)=>p()}}const l=(()=>{const d=Object.assign({},a);return d.when=f=>u(f),d.unless=f=>u(!f),d})();o.exports.Check=l},1537:(o,h,r)=>{const{Check:a}=r(7434),{ErrorSubcode:u,OperationError:l}=r(6706),d={};function f(C,g=null,m=d){const T=g?`; expected: ${g}`:"",y=m!==d?`; got: ${m}`:"";return C===u.PARAMETER_INVALID_TYPE?`Parameter type was invalid${T}${y}`:u.nameOf(C).toLowerCase().replace(/_/," ")+T}function p(C,g,m,T,y,...E){return T(y,...E)?y:function(I,N,A){throw new l(`Parameter ${I} failed validation`,N,A)}(C,g,m)}const _=C=>C&&C.constructor&&C.constructor.name||typeof C,S={isArray:function(C,g,m=u.PARAMETER_INVALID_TYPE,T=f(m,"array",g)){return p(C,m,T,a.isArray,g)},isBoolean:function(C,g,m=u.PARAMETER_INVALID_TYPE,T=f(m,"boolean",g)){return p(C,m,T,a.boolean,g)},isBooleanOrNothing:function(C,g,m=u.PARAMETER_INVALID_TYPE,T=f(m,"boolean or nothing",g)){return p(C,m,T,a.boolean.orNothing,g)},isEnumMember:function(C,g,m,T=u.PARAMETER_OUT_OF_RANGE,y=f(T,`one of [${m.names.join(", ")}]`,g)){return p(C,T,y,a.member,g,m)},isEnumMemberOrNothing:function(C,g,m,T=u.PARAMETER_OUT_OF_RANGE,y=f(T,`one of [${m.names.join(", ")}]`,g)){return p(C,T,y,a.member.orNothing,g,m)},isFunction:function(C,g,m=u.PARAMETER_INVALID_TYPE,T=f(m,"function",g)){return p(C,m,T,a.function,g)},isFunctionOrNothing:function(C,g,m=u.PARAMETER_INVALID_TYPE,T=f(m,"function or nothing",g)){return p(C,m,T,a.function.orNothing,g)},isInstanceOf:function(C,g,m,T=u.PARAMETER_INVALID_TYPE,y=f(T,m.name,_(g))){return p(C,T,y,a.instanceOf,g,m)},isInstanceOfOrNothing:function(C,g,m,T=u.PARAMETER_INVALID_TYPE,y=f(T,`${m.name} or nothing`,_(g))){return p(C,T,y,a.instanceOf.orNothing,g,m)},isInstanceOfOrNull:function(C,g,m,T=u.PARAMETER_INVALID_TYPE,y=f(T,`${m.name} or null`,_(g))){return p(C,T,y,a.instanceOf.orNull,g,m)},isInstanceOfOrUndefined:function(C,g,m,T=u.PARAMETER_INVALID_TYPE,y=f(T,`${m.name} or undefined`,_(g))){return p(C,T,y,a.instanceOf.orUndefined,g,m)},isMember:function(C,g,m,T=u.PARAMETER_OUT_OF_RANGE,y=f(T,`one of ${m.name}.[${function(E){return Object.keys(E).map(I=>E[I])}(m).join(", ")}]`,g)){return p(C,T,y,a.member,g,m)},isNumber:function(C,g,m=u.PARAMETER_INVALID_TYPE,T=f(m,"number",g)){return p(C,m,T,a.number,g)},isNumberOrNothing:function(C,g,m=u.PARAMETER_INVALID_TYPE,T=f(m,"number or nothing",g)){return p(C,m,T,a.number.orNothing,g)},isNumberOrNull:function(C,g,m=u.PARAMETER_INVALID_TYPE,T=f(m,"number or null",g)){return p(C,m,T,a.number.orNull,g)},isRangeCompare:function(C,g,m,T,y=u.PARAMETER_OUT_OF_RANGE,E=f(y,`${m} ${T}`,g)){return p(C,y,E,a.rangeCompare,g,m,T)},isRangeCompareOrNothing:function(C,g,m,T,y=u.PARAMETER_OUT_OF_RANGE,E=f(y,`${m} ${T} or nothing`,g)){return p(C,y,E,a.rangeCompare.orNothing,g,m,T)},isStringOrNull:function(C,g,m=u.PARAMETER_INVALID_TYPE,T=f(m,"string or null",g)){return p(C,m,T,a.string.orNull,g)},isString:function(C,g,m=u.PARAMETER_INVALID_TYPE,T=f(m,"string",g)){return p(C,m,T,a.string,g)},isStringOrNothing:function(C,g,m=u.PARAMETER_INVALID_TYPE,T=f(m,"string or nothing",g)){return p(C,m,T,a.string.orNothing,g)},isValue:function(C,g,m,T=u.PARAMETER_OUT_OF_RANGE,y=f(T,`must be ${g}`)){return p(C,T,y,a.equal,g,m)}};o.exports.Parameter=S},7526:(o,h)=>{h.byteLength=function(_){var S=f(_),C=S[0],g=S[1];return 3*(C+g)/4-g},h.toByteArray=function(_){var S,C,g=f(_),m=g[0],T=g[1],y=new u(function(N,A,L){return 3*(A+L)/4-L}(0,m,T)),E=0,I=T>0?m-4:m;for(C=0;C<I;C+=4)S=a[_.charCodeAt(C)]<<18|a[_.charCodeAt(C+1)]<<12|a[_.charCodeAt(C+2)]<<6|a[_.charCodeAt(C+3)],y[E++]=S>>16&255,y[E++]=S>>8&255,y[E++]=255&S;return T===2&&(S=a[_.charCodeAt(C)]<<2|a[_.charCodeAt(C+1)]>>4,y[E++]=255&S),T===1&&(S=a[_.charCodeAt(C)]<<10|a[_.charCodeAt(C+1)]<<4|a[_.charCodeAt(C+2)]>>2,y[E++]=S>>8&255,y[E++]=255&S),y},h.fromByteArray=function(_){for(var S,C=_.length,g=C%3,m=[],T=16383,y=0,E=C-g;y<E;y+=T)m.push(p(_,y,y+T>E?E:y+T));return g===1?(S=_[C-1],m.push(r[S>>2]+r[S<<4&63]+"==")):g===2&&(S=(_[C-2]<<8)+_[C-1],m.push(r[S>>10]+r[S>>4&63]+r[S<<2&63]+"=")),m.join("")};for(var r=[],a=[],u=typeof Uint8Array<"u"?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0;d<64;++d)r[d]=l[d],a[l.charCodeAt(d)]=d;function f(_){var S=_.length;if(S%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var C=_.indexOf("=");return C===-1&&(C=S),[C,C===S?0:4-C%4]}function p(_,S,C){for(var g,m,T=[],y=S;y<C;y+=3)g=(_[y]<<16&16711680)+(_[y+1]<<8&65280)+(255&_[y+2]),T.push(r[(m=g)>>18&63]+r[m>>12&63]+r[m>>6&63]+r[63&m]);return T.join("")}a[45]=62,a[95]=63},2195:o=>{function h(N,A){var L={seen:[],stylize:r};return arguments.length>=3&&(L.depth=arguments[2]),arguments.length>=4&&(L.colors=arguments[3]),a(A)?L.showHidden=A:A&&function(D,q){if(!q||!C(q))return D;for(var Y=Object.keys(q),Q=Y.length;Q--;)D[Y[Q]]=q[Y[Q]]}(L,A),u(L.showHidden)&&(L.showHidden=!1),u(L.depth)&&(L.depth=2),u(L.colors)&&(L.colors=!1),u(L.customInspect)&&(L.customInspect=!0),L.colors&&(L.stylize=l),E(L,N,L.depth)}function r(N,A){return N}function a(N){return typeof N=="boolean"}function u(N){return N===void 0}function l(N,A){var L=h.styles[A];return L?"\x1B["+h.colors[L][0]+"m"+N+"\x1B["+h.colors[L][1]+"m":N}function d(N){return typeof N=="function"}function f(N){return typeof N=="string"}function p(N){return N===null}function _(N,A){return Object.prototype.hasOwnProperty.call(N,A)}function S(N){return C(N)&&T(N)==="[object RegExp]"}function C(N){return typeof N=="object"&&N!==null}function g(N){return C(N)&&(T(N)==="[object Error]"||N instanceof Error)}function m(N){return C(N)&&T(N)==="[object Date]"}function T(N){return Object.prototype.toString.call(N)}function y(N){return"["+Error.prototype.toString.call(N)+"]"}function E(N,A,L){if(N.customInspect&&A&&d(A.inspect)&&A.inspect!==h&&(!A.constructor||A.constructor.prototype!==A)){var D=A.inspect(L,N);return f(D)||(D=E(N,D,L)),D}var q=function($,R){if(u(R))return $.stylize("undefined","undefined");if(f(R)){var B="'"+JSON.stringify(R).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return $.stylize(B,"string")}return typeof R=="number"?$.stylize(""+R,"number"):a(R)?$.stylize(""+R,"boolean"):p(R)?$.stylize("null","null"):void 0}(N,A);if(q)return q;var Y=Object.keys(A),Q=function($){var R={};return $.forEach(function(B,M){R[B]=!0}),R}(Y);try{N.showHidden&&Object.getOwnPropertyNames&&(Y=Object.getOwnPropertyNames(A))}catch{}if(g(A)&&(Y.indexOf("message")>=0||Y.indexOf("description")>=0))return y(A);if(Y.length===0){if(d(A)){var W=A.name?": "+A.name:"";return N.stylize("[Function"+W+"]","special")}if(S(A))return N.stylize(RegExp.prototype.toString.call(A),"regexp");if(m(A))return N.stylize(Date.prototype.toString.call(A),"date");if(g(A))return y(A)}var x,k="",J=!1,F=["{","}"];return Array.isArray(A)&&(J=!0,F=["[","]"]),d(A)&&(k=" [Function"+(A.name?": "+A.name:"")+"]"),S(A)&&(k=" "+RegExp.prototype.toString.call(A)),m(A)&&(k=" "+Date.prototype.toUTCString.call(A)),g(A)&&(k=" "+y(A)),Y.length!==0||J&&A.length!=0?L<0?S(A)?N.stylize(RegExp.prototype.toString.call(A),"regexp"):N.stylize("[Object]","special"):(N.seen.push(A),x=J?function($,R,B,M,re){for(var se=[],fe=0,ce=R.length;fe<ce;++fe)_(R,String(fe))?se.push(I($,R,B,M,String(fe),!0)):se.push("");return re.forEach(function(Te){Te.match(/^\d+$/)||se.push(I($,R,B,M,Te,!0))}),se}(N,A,L,Q,Y):Y.map(function($){return I(N,A,L,Q,$,J)}),N.seen.pop(),function($,R,B){return $.reduce(function(M,re){return re.indexOf(`
|
|
98
|
+
`&&x!=="\r"&&(this._fragment+=x)}q++}}function y(I,N){N===void 0||N instanceof y||(N=new y(String(N))),I=String(I),this._url=I,l.call(this);const A=I.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g,"");T.call(this,A,null,N)}y.prototype={toString(){return this.href},get href(){if(this._isInvalid)return this._url;let I="";return this._username===""&&this._password===null||(I=this._username+(this._password!==null?`:${this._password}`:"")+"@"),this.protocol+(this._isRelative?`//${I}${this.host}`:"")+this.pathname+this._query+this._fragment},set href(I){l.call(this),T.call(this,I)},get protocol(){return`${this._scheme}:`},set protocol(I){this._isInvalid||T.call(this,`${I}:`,"scheme start")},get host(){return this._isInvalid?"":this._port?`${this._host}:${this._port}`:this._host},set host(I){!this._isInvalid&&this._isRelative&&T.call(this,I,"host")},get hostname(){return this._host},set hostname(I){!this._isInvalid&&this._isRelative&&T.call(this,I,"hostname")},get port(){return this._port},set port(I){!this._isInvalid&&this._isRelative&&T.call(this,I,"port")},get pathname(){return this._isInvalid?"":this._isRelative?`/${this._path.join("/")}`:this._schemeData},set pathname(I){!this._isInvalid&&this._isRelative&&(this._path=[],T.call(this,I,"relative path start"))},get search(){return this._isInvalid||!this._query||this._query==="?"?"":this._query},set search(I){!this._isInvalid&&this._isRelative&&(this._query="?",I[0]==="?"&&(I=I.slice(1)),T.call(this,I,"query"))},get hash(){return this._isInvalid||!this._fragment||this._fragment==="#"?"":this._fragment},set hash(I){this._isInvalid||(this._fragment="#",I[0]==="#"&&(I=I.slice(1)),T.call(this,I,"fragment"))},get origin(){if(this._isInvalid||!this._scheme)return"";switch(this._scheme){case"data":case"file":case"javascript":case"mailto":return"null"}const I=this.host;return I?`${this._scheme}://${I}`:""}};const E=h.URL;E&&(y.createObjectURL=function(...I){return E.createObjectURL(...I)},y.revokeObjectURL=function(I){E.revokeObjectURL(I)}),h.URL=y}},4205:(o,h,r)=>{var a=r(8287).hp;const u=function(){function l(g,m){return m!=null&&g instanceof m}let d,_,p;try{d=Map}catch{d=function(){}}try{_=Set}catch{_=function(){}}try{p=Promise}catch{p=function(){}}function f(g,m,T,y,E){typeof m=="object"&&(T=m.depth,y=m.prototype,E=m.includeNonEnumerable,m=m.circular);const I=[],N=[],A=a!==void 0;return m===void 0&&(m=!0),T===void 0&&(T=1/0),function L(D,q){if(D===null)return null;if(q===0)return D;let Y,Q;if(typeof D!="object")return D;if(l(D,d))Y=new d;else if(l(D,_))Y=new _;else if(l(D,p))Y=new p(function(W,x){D.then(function(k){W(L(k,q-1))},function(k){x(L(k,q-1))})});else if(f.__isArray(D))Y=[];else if(f.__isRegExp(D))Y=new RegExp(D.source,C(D)),D.lastIndex&&(Y.lastIndex=D.lastIndex);else if(f.__isDate(D))Y=new Date(D.getTime());else{if(A&&a.isBuffer(D))return Y=a.allocUnsafe?a.allocUnsafe(D.length):new a(D.length),D.copy(Y),Y;l(D,Error)?Y=Object.create(D):y===void 0?(Q=Object.getPrototypeOf(D),Y=Object.create(Q)):(Y=Object.create(y),Q=y)}if(m){const W=I.indexOf(D);if(W!=-1)return N[W];I.push(D),N.push(Y)}if(l(D,d)){let W,x;D.forEach(function(k,J){W=L(J,q-1),x=L(k,q-1),Y.set(W,x)})}if(l(D,_)){let W;D.forEach(function(x){W=L(x,q-1),Y.add(W)})}for(let W in D){let x;Q&&(x=Object.getOwnPropertyDescriptor(Q,W)),x&&x.set==null||(Y[W]=L(D[W],q-1))}if(Object.getOwnPropertySymbols){const W=Object.getOwnPropertySymbols(D);for(let x=0;x<W.length;x++){let k=W[x],J=Object.getOwnPropertyDescriptor(D,k);(!J||J.enumerable||E)&&(Y[k]=L(D[k],q-1),J.enumerable||Object.defineProperty(Y,k,{enumerable:!1}))}}if(E){const W=Object.getOwnPropertyNames(D);for(let x=0;x<W.length;x++){let k=W[x],J=Object.getOwnPropertyDescriptor(D,k);J&&J.enumerable||(Y[k]=L(D[k],q-1),Object.defineProperty(Y,k,{enumerable:!1}))}}return Y}(g,T)}function S(g){return Object.prototype.toString.call(g)}function C(g){let m="";return g.global&&(m+="g"),g.ignoreCase&&(m+="i"),g.multiline&&(m+="m"),m}return f.clonePrototype=function(g){if(g===null)return null;let m=function(){};return m.prototype=g,new m},f.__objToStr=S,f.__isDate=function(g){return typeof g=="object"&&S(g)==="[object Date]"},f.__isArray=function(g){return typeof g=="object"&&S(g)==="[object Array]"},f.__isRegExp=function(g){return typeof g=="object"&&S(g)==="[object RegExp]"},f.__getRegExpFlags=C,f}();o.exports=u},85:(o,h,r)=>{const a={6.4:"10.0",6.3:"8.1",6.2:"8",6.1:"7","6.0":"Vista",5.2:"Server 2003",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"4.0"},u=typeof window<"u"?window:r.g,l=(u.process,{product:"solclientjs",platform:"unknown",agent:"Gecko"});try{if(u.navigator){const _=f=>f.replace(/[^a-zA-Z0-9_/.]/g,"-");Object.assign(l,{platform:u.navigator.platform,agent:u.navigator.product,description:_(u.navigator.userAgent),navigator:u.navigator});const p=function(){if(typeof navigator>"u"||!navigator)return null;const f=navigator.userAgent,S={browser:{name:"unknown",version:"0.0.0"},platform:{os:"unknown",arch:"unknown",version:"unknown"}},C=(...y)=>y.some(E=>f.indexOf(E)>=0),g=(...y)=>y.filter(Boolean).shift();Object.assign(S,[["edge",/Edge\/([0-9._]+)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9.]+)(?:\s|$)/],["opera",/Opera\/([0-9.]+)(?:\s|$)/],["opera",/OPR\/([0-9.]+)(:?\s|$)$/],["ie",/Trident\/7\.0.*rv:([0-9.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9.]+);.*Trident\/[4-8].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9.]+)/],["android",/Android\s([0-9.]+)/],["ios",/Version\/([0-9._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9._]+).*Safari/]].map(([y,E])=>{if(!E.test(f))return!1;const I=E.exec(f),N=(I&&I[1].split(/[._]/).slice(0,3)).map(A=>parseInt(A,10));for(;N.length<3;)N.push(0);return{browser:{name:y,version:N.join(".")}}}).filter(Boolean).shift());const m=g(C("Windows Phone")&&"WindowsPhone",C("Windows")&&"Windows",C("Linux")&&"Linux",C("like Mac OS X")&&"iOS",C("OS X")&&"OSX",C("Android","Adr")&&"Android",C("BB10","RIM Tablet OS","BlackBerry")&&"BlackBerry"),T={Windows:()=>g(C("Win16")&&"3.1.1",C("Windows CE")&&"CE",C("Windows 95")&&"4.00.950",C("Windows 98; Win 9x 4.90")&&"4.90",C("Windows 98")&&"4.10",(()=>{const y=f.match(/\(.+?\)/)[0];return!!y&&g(...Object.keys(a).map(E=>{return I=E,y.indexOf(I)>=0&&a[E];var I}))})()),OSX:()=>f.match(/OS X ((\d+[._])+\d+)\b/)[1],Linux:()=>"",iOS:()=>f.match(/OS ((\d+[._])+\d+) like Mac OS X/)[1],Android:()=>f.match(/(?:Android|Adr) ((\d+[._])+\d_)/)[1],BlackBerry:()=>f.match(/(?:Version\/|RIM Tablet OS )((\d+\.)+\d+)/)[1]}[m];return S.platform.os=m||"Unknown",S.platform.version=(T&&T()||"0.0.0").replace(/_/g,"."),S}();p&&(l.agent=_(`${p.browser.name}-${p.browser.version}`),l.platform=`${l.agent}-${_(`${p.platform.os}-${p.platform.version}`)}`)}}catch{}const d=Object.assign({},{},l,{});o.exports.Process=d},9710:o=>{o.exports.StringBuffer=class{constructor(...h){this.clear(),this.append(...h)}append(...h){return[...h].forEach(r=>{this.buffer[this.index++]=String(r)}),this}clear(){this.buffer=[],this.index=0}toString(){return this.buffer.join("")}}},319:(o,h,r)=>{const{StringBuffer:a}=r(9710),u=(()=>{const S=[];for(let C=0;C<256;++C)S[C]=C<33||C>126?".":String.fromCharCode(C);return S})();function l(S,C,g,m=" "){if(typeof S!="string"||S.length>=C)return S;const T=new a;for(let y=0;y<C-S.length;y++)T.append(m.charAt(0));switch(g){case 0:return`${T}${S}`;case 1:return`${S}${T}`;default:return S}}function d(S,C){if(!C.length)return S;const g=C.match(/^\s*/)[0].length;return g<S?g:S}function _(S){return`${S.charAt(0).toUpperCase()}${S.substr(1)}`}function p(S){return S==null||S.length===0}const f={capitalize:function(S){return S&&S.length?S.split(" ").map(_).join(" "):S}};f.isEmpty=p,f.notEmpty=function(S){return!p(S)},f.toSafeChars=function(S){return S.replace(/[^a-zA-Z0-9_/.]/g,"")},f.padLeft=function(S,C,g){return l(S,C,0,g)},f.padRight=function(S,C,g){return l(S,C,1,g)},f.nullTerminate=function(S){if(S==null)throw new Error("non str in nullTerminate");return S.charCodeAt(S.length-1)===0?S:S+"\0"},f.stripNullTerminate=function(S){if(S==null)throw new Error("null str in stripNullTerminate");return S.charCodeAt(S.length-1)===0?S.substr(0,S.length-1):S},f.hexdump=function(S){const C=new a,g=new a,m=y=>y===8||y===16?" ":" ";let T=0;for(let y=0,E=S.length;y<E;y++){const I=S.charCodeAt(y);if(C.append(l(I.toString(16),2,0)),g.append(u[I]||"."),C.append(m(++T)),y===S.length-1)for(;T<16;)C.append(` ${m(++T)}`);T===16&&(C.append(g.join("")),C.append(`
|
|
99
|
+
`),T=0,g.clear())}return C.toString()},f.heredoc=function(S,...C){const g=[...C,""],m=S.map(y=>y+g.shift()).join("").split(/\r?\n/),T=m.length===1?0:m.reduce(d,1/0);for(;m[0]==="";)m.shift();return m.map(y=>y.substring(T)).join(`
|
|
100
|
+
`)},o.exports.StringUtils=f},4255:o=>{o.exports.TimingBucket=class{constructor(h,r){this.name=h,this.interval=r,this.buckets=[]}get bucketCount(){let h=0;for(let r=0,a=this.buckets.length;r<a;++r)h+=this.buckets[r]||0;return h}log(h){if(h===void 0||isNaN(h))return;const r=Math.floor(h/this.interval)*this.interval;this.buckets[r]=this.buckets[r]||0,this.buckets[r]++}toString(){const h=[];return this.buckets.forEach(r=>{h.push(`${r}: ${this.buckets[r]}`)}),`{${h.join(", ")}}`}}},6321:function(o,h,r){let a;{const u=typeof window<"u"?window:this;r(8858)(u),a=function(...l){return new URL(...l)}}o.exports.parseURL=a},77:o=>{o.exports.UUID={generateUUID:function(){let h=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{const a=(h+16*Math.random())%16|0;return h=Math.floor(h/16),(r==="x"?a:3&a|8).toString(16)})}}},9436:o=>{const h=new Date(Date.parse("Tue Jul 09 2024 16:55:33 GMT-0400 (Eastern Daylight Time)")),r="RELEASE",a=(()=>{const d=p=>p<10?`0${p}`:p,_=h;return`${_.getFullYear()}/${d(_.getMonth()+1)}/${d(_.getDate())} ${d(_.getHours())}:${d(_.getMinutes())}`})(),u=["SolclientJS","10.17.0",r,a].join(", "),l={version:"10.17.0",date:h,formattedDate:a,target:{name:"browser",node:!1,browser:!0},mode:r,debug:!1,release:!0,summary:u,toString:()=>u};o.exports.Version=l},802:(o,h,r)=>{const{Check:a}=r(7434),{Parameter:u}=r(1537);o.exports.Check=a,o.exports.Parameter=u},2843:o=>{function h(a){return a.reduce((u,l)=>u.concat(Array.isArray(l)?h(l):l),[])}const r=(()=>{const a={nothing:u=>u==null,anything:u=>!r.nothing(u),undefined:u=>u===void 0,defined:u=>!r.undefined(u),array:u=>r.anything(u)&&Array.isArray(u),object:u=>!r.array(u)&&u!==null&&(typeof u=="object"||u instanceof Object),instanceOf:(u,l)=>r.object(u)&&u instanceof l,type:(u,l)=>typeof u===l,instanceOfAny:(u,...l)=>r.array(l)&&h(l).some(d=>r.instanceOf(u,d)),empty:u=>!!r.nothing(u)||!(!r.object(u)||Object.keys(u).length!==0)||u.length===0,truthy:(u,l)=>!!l(u),rangeGe:(u,l)=>u>=l,rangeGt:(u,l)=>u>l,rangeLe:(u,l)=>u<=l,rangeLt:(u,l)=>u<l,rangeCompare(u,l,d,..._){switch(l){case"=":case"==":case"===":return u===d;case"~=":case"=~":{const p=_[0]||1e6;return Math.abs(u-d)<p}case"<":return u<d;case"<=":return u<=d;case">":return u>d;case">=":return u>=d;default:throw new Error(`Illegal operator for rangeCompare: ${l}`)}},NaN:u=>Number.isNaN(u),included(u,l){if(r.nothing(l))return!1;if(l.includes)return l.includes(u);if(Array.isArray(l))return l.indexOf(u)>=0;if(r.object(l)){const d=Object.keys(l);return r.included(u,d)}return!1},equal:(u,l)=>u===l,member:(u,l)=>r.anything(l)&&(r.array(l)?r.included(u,l):Object.keys(l).some(d=>l[d]===u)),boolean:u=>r.type(u,"boolean"),number:u=>r.type(u,"number"),string:u=>r.type(u,"string"),function:u=>r.type(u,"function")};return a.none=a.nothing,a.something=a.anything,Object.keys(a).forEach(u=>{a[u].orNull=function(l,...d){return l===null||a[u](l,...d)},a[u].orUndefined=function(l,...d){return l===void 0||a[u](l,...d)},a[u].orNothing=function(l,...d){return a.nothing(l)||a[u](l,...d)}}),a})();o.exports.BaseChecks=r},7434:(o,h,r)=>{const{BaseChecks:a}=r(2843);function u(d){return{then:d?_=>_():(_,p)=>p()}}const l=(()=>{const d=Object.assign({},a);return d.when=_=>u(_),d.unless=_=>u(!_),d})();o.exports.Check=l},1537:(o,h,r)=>{const{Check:a}=r(7434),{ErrorSubcode:u,OperationError:l}=r(6706),d={};function _(C,g=null,m=d){const T=g?`; expected: ${g}`:"",y=m!==d?`; got: ${m}`:"";return C===u.PARAMETER_INVALID_TYPE?`Parameter type was invalid${T}${y}`:u.nameOf(C).toLowerCase().replace(/_/," ")+T}function p(C,g,m,T,y,...E){return T(y,...E)?y:function(I,N,A){throw new l(`Parameter ${I} failed validation`,N,A)}(C,g,m)}const f=C=>C&&C.constructor&&C.constructor.name||typeof C,S={isArray:function(C,g,m=u.PARAMETER_INVALID_TYPE,T=_(m,"array",g)){return p(C,m,T,a.isArray,g)},isBoolean:function(C,g,m=u.PARAMETER_INVALID_TYPE,T=_(m,"boolean",g)){return p(C,m,T,a.boolean,g)},isBooleanOrNothing:function(C,g,m=u.PARAMETER_INVALID_TYPE,T=_(m,"boolean or nothing",g)){return p(C,m,T,a.boolean.orNothing,g)},isEnumMember:function(C,g,m,T=u.PARAMETER_OUT_OF_RANGE,y=_(T,`one of [${m.names.join(", ")}]`,g)){return p(C,T,y,a.member,g,m)},isEnumMemberOrNothing:function(C,g,m,T=u.PARAMETER_OUT_OF_RANGE,y=_(T,`one of [${m.names.join(", ")}]`,g)){return p(C,T,y,a.member.orNothing,g,m)},isFunction:function(C,g,m=u.PARAMETER_INVALID_TYPE,T=_(m,"function",g)){return p(C,m,T,a.function,g)},isFunctionOrNothing:function(C,g,m=u.PARAMETER_INVALID_TYPE,T=_(m,"function or nothing",g)){return p(C,m,T,a.function.orNothing,g)},isInstanceOf:function(C,g,m,T=u.PARAMETER_INVALID_TYPE,y=_(T,m.name,f(g))){return p(C,T,y,a.instanceOf,g,m)},isInstanceOfOrNothing:function(C,g,m,T=u.PARAMETER_INVALID_TYPE,y=_(T,`${m.name} or nothing`,f(g))){return p(C,T,y,a.instanceOf.orNothing,g,m)},isInstanceOfOrNull:function(C,g,m,T=u.PARAMETER_INVALID_TYPE,y=_(T,`${m.name} or null`,f(g))){return p(C,T,y,a.instanceOf.orNull,g,m)},isInstanceOfOrUndefined:function(C,g,m,T=u.PARAMETER_INVALID_TYPE,y=_(T,`${m.name} or undefined`,f(g))){return p(C,T,y,a.instanceOf.orUndefined,g,m)},isMember:function(C,g,m,T=u.PARAMETER_OUT_OF_RANGE,y=_(T,`one of ${m.name}.[${function(E){return Object.keys(E).map(I=>E[I])}(m).join(", ")}]`,g)){return p(C,T,y,a.member,g,m)},isNumber:function(C,g,m=u.PARAMETER_INVALID_TYPE,T=_(m,"number",g)){return p(C,m,T,a.number,g)},isNumberOrNothing:function(C,g,m=u.PARAMETER_INVALID_TYPE,T=_(m,"number or nothing",g)){return p(C,m,T,a.number.orNothing,g)},isNumberOrNull:function(C,g,m=u.PARAMETER_INVALID_TYPE,T=_(m,"number or null",g)){return p(C,m,T,a.number.orNull,g)},isRangeCompare:function(C,g,m,T,y=u.PARAMETER_OUT_OF_RANGE,E=_(y,`${m} ${T}`,g)){return p(C,y,E,a.rangeCompare,g,m,T)},isRangeCompareOrNothing:function(C,g,m,T,y=u.PARAMETER_OUT_OF_RANGE,E=_(y,`${m} ${T} or nothing`,g)){return p(C,y,E,a.rangeCompare.orNothing,g,m,T)},isStringOrNull:function(C,g,m=u.PARAMETER_INVALID_TYPE,T=_(m,"string or null",g)){return p(C,m,T,a.string.orNull,g)},isString:function(C,g,m=u.PARAMETER_INVALID_TYPE,T=_(m,"string",g)){return p(C,m,T,a.string,g)},isStringOrNothing:function(C,g,m=u.PARAMETER_INVALID_TYPE,T=_(m,"string or nothing",g)){return p(C,m,T,a.string.orNothing,g)},isValue:function(C,g,m,T=u.PARAMETER_OUT_OF_RANGE,y=_(T,`must be ${g}`)){return p(C,T,y,a.equal,g,m)}};o.exports.Parameter=S},7526:(o,h)=>{h.byteLength=function(f){var S=_(f),C=S[0],g=S[1];return 3*(C+g)/4-g},h.toByteArray=function(f){var S,C,g=_(f),m=g[0],T=g[1],y=new u(function(N,A,L){return 3*(A+L)/4-L}(0,m,T)),E=0,I=T>0?m-4:m;for(C=0;C<I;C+=4)S=a[f.charCodeAt(C)]<<18|a[f.charCodeAt(C+1)]<<12|a[f.charCodeAt(C+2)]<<6|a[f.charCodeAt(C+3)],y[E++]=S>>16&255,y[E++]=S>>8&255,y[E++]=255&S;return T===2&&(S=a[f.charCodeAt(C)]<<2|a[f.charCodeAt(C+1)]>>4,y[E++]=255&S),T===1&&(S=a[f.charCodeAt(C)]<<10|a[f.charCodeAt(C+1)]<<4|a[f.charCodeAt(C+2)]>>2,y[E++]=S>>8&255,y[E++]=255&S),y},h.fromByteArray=function(f){for(var S,C=f.length,g=C%3,m=[],T=16383,y=0,E=C-g;y<E;y+=T)m.push(p(f,y,y+T>E?E:y+T));return g===1?(S=f[C-1],m.push(r[S>>2]+r[S<<4&63]+"==")):g===2&&(S=(f[C-2]<<8)+f[C-1],m.push(r[S>>10]+r[S>>4&63]+r[S<<2&63]+"=")),m.join("")};for(var r=[],a=[],u=typeof Uint8Array<"u"?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0;d<64;++d)r[d]=l[d],a[l.charCodeAt(d)]=d;function _(f){var S=f.length;if(S%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var C=f.indexOf("=");return C===-1&&(C=S),[C,C===S?0:4-C%4]}function p(f,S,C){for(var g,m,T=[],y=S;y<C;y+=3)g=(f[y]<<16&16711680)+(f[y+1]<<8&65280)+(255&f[y+2]),T.push(r[(m=g)>>18&63]+r[m>>12&63]+r[m>>6&63]+r[63&m]);return T.join("")}a[45]=62,a[95]=63},2195:o=>{function h(N,A){var L={seen:[],stylize:r};return arguments.length>=3&&(L.depth=arguments[2]),arguments.length>=4&&(L.colors=arguments[3]),a(A)?L.showHidden=A:A&&function(D,q){if(!q||!C(q))return D;for(var Y=Object.keys(q),Q=Y.length;Q--;)D[Y[Q]]=q[Y[Q]]}(L,A),u(L.showHidden)&&(L.showHidden=!1),u(L.depth)&&(L.depth=2),u(L.colors)&&(L.colors=!1),u(L.customInspect)&&(L.customInspect=!0),L.colors&&(L.stylize=l),E(L,N,L.depth)}function r(N,A){return N}function a(N){return typeof N=="boolean"}function u(N){return N===void 0}function l(N,A){var L=h.styles[A];return L?"\x1B["+h.colors[L][0]+"m"+N+"\x1B["+h.colors[L][1]+"m":N}function d(N){return typeof N=="function"}function _(N){return typeof N=="string"}function p(N){return N===null}function f(N,A){return Object.prototype.hasOwnProperty.call(N,A)}function S(N){return C(N)&&T(N)==="[object RegExp]"}function C(N){return typeof N=="object"&&N!==null}function g(N){return C(N)&&(T(N)==="[object Error]"||N instanceof Error)}function m(N){return C(N)&&T(N)==="[object Date]"}function T(N){return Object.prototype.toString.call(N)}function y(N){return"["+Error.prototype.toString.call(N)+"]"}function E(N,A,L){if(N.customInspect&&A&&d(A.inspect)&&A.inspect!==h&&(!A.constructor||A.constructor.prototype!==A)){var D=A.inspect(L,N);return _(D)||(D=E(N,D,L)),D}var q=function($,R){if(u(R))return $.stylize("undefined","undefined");if(_(R)){var B="'"+JSON.stringify(R).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return $.stylize(B,"string")}return typeof R=="number"?$.stylize(""+R,"number"):a(R)?$.stylize(""+R,"boolean"):p(R)?$.stylize("null","null"):void 0}(N,A);if(q)return q;var Y=Object.keys(A),Q=function($){var R={};return $.forEach(function(B,M){R[B]=!0}),R}(Y);try{N.showHidden&&Object.getOwnPropertyNames&&(Y=Object.getOwnPropertyNames(A))}catch{}if(g(A)&&(Y.indexOf("message")>=0||Y.indexOf("description")>=0))return y(A);if(Y.length===0){if(d(A)){var W=A.name?": "+A.name:"";return N.stylize("[Function"+W+"]","special")}if(S(A))return N.stylize(RegExp.prototype.toString.call(A),"regexp");if(m(A))return N.stylize(Date.prototype.toString.call(A),"date");if(g(A))return y(A)}var x,k="",J=!1,F=["{","}"];return Array.isArray(A)&&(J=!0,F=["[","]"]),d(A)&&(k=" [Function"+(A.name?": "+A.name:"")+"]"),S(A)&&(k=" "+RegExp.prototype.toString.call(A)),m(A)&&(k=" "+Date.prototype.toUTCString.call(A)),g(A)&&(k=" "+y(A)),Y.length!==0||J&&A.length!=0?L<0?S(A)?N.stylize(RegExp.prototype.toString.call(A),"regexp"):N.stylize("[Object]","special"):(N.seen.push(A),x=J?function($,R,B,M,re){for(var se=[],fe=0,ce=R.length;fe<ce;++fe)f(R,String(fe))?se.push(I($,R,B,M,String(fe),!0)):se.push("");return re.forEach(function(Te){Te.match(/^\d+$/)||se.push(I($,R,B,M,Te,!0))}),se}(N,A,L,Q,Y):Y.map(function($){return I(N,A,L,Q,$,J)}),N.seen.pop(),function($,R,B){return $.reduce(function(M,re){return re.indexOf(`
|
|
101
101
|
`),M+re.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?B[0]+(R===""?"":R+`
|
|
102
102
|
`)+" "+$.join(`,
|
|
103
|
-
`)+" "+B[1]:B[0]+R+" "+$.join(", ")+" "+B[1]}(x,k,F)):F[0]+k+F[1]}function I(N,A,L,D,q,Y){var Q,W,x;x={value:void 0};try{x.value=A[q]}catch{}try{Object.getOwnPropertyDescriptor&&(x=Object.getOwnPropertyDescriptor(A,q)||x)}catch{}if(x.get?W=x.set?N.stylize("[Getter/Setter]","special"):N.stylize("[Getter]","special"):x.set&&(W=N.stylize("[Setter]","special")),
|
|
103
|
+
`)+" "+B[1]:B[0]+R+" "+$.join(", ")+" "+B[1]}(x,k,F)):F[0]+k+F[1]}function I(N,A,L,D,q,Y){var Q,W,x;x={value:void 0};try{x.value=A[q]}catch{}try{Object.getOwnPropertyDescriptor&&(x=Object.getOwnPropertyDescriptor(A,q)||x)}catch{}if(x.get?W=x.set?N.stylize("[Getter/Setter]","special"):N.stylize("[Getter]","special"):x.set&&(W=N.stylize("[Setter]","special")),f(D,q)||(Q="["+q+"]"),W||(N.seen.indexOf(x.value)<0?(W=p(L)?E(N,x.value,null):E(N,x.value,L-1)).indexOf(`
|
|
104
104
|
`)>-1&&(W=Y?W.split(`
|
|
105
105
|
`).map(function(k){return" "+k}).join(`
|
|
106
106
|
`).substr(2):`
|
|
107
107
|
`+W.split(`
|
|
108
108
|
`).map(function(k){return" "+k}).join(`
|
|
109
|
-
`)):W=N.stylize("[Circular]","special")),u(Q)){if(Y&&q.match(/^\d+$/))return W;(Q=JSON.stringify(""+q)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(Q=Q.substr(1,Q.length-2),Q=N.stylize(Q,"name")):(Q=Q.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Q=N.stylize(Q,"string"))}return Q+": "+W}o.exports=h,h.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},h.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"}},8287:(o,h,r)=>{const a=r(7526),u=r(251),l=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;h.hp=p,h.IS=50;const d=2147483647;function f(v){if(v>d)throw new RangeError('The value "'+v+'" is invalid for option "size"');const P=new Uint8Array(v);return Object.setPrototypeOf(P,p.prototype),P}function p(v,P,O){if(typeof v=="number"){if(typeof P=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return C(v)}return _(v,P,O)}function _(v,P,O){if(typeof v=="string")return function(z,ne){if(typeof ne=="string"&&ne!==""||(ne="utf8"),!p.isEncoding(ne))throw new TypeError("Unknown encoding: "+ne);const de=0|y(z,ne);let _e=f(de);const we=_e.write(z,ne);return we!==de&&(_e=_e.slice(0,we)),_e}(v,P);if(ArrayBuffer.isView(v))return function(z){if(Z(z,Uint8Array)){const ne=new Uint8Array(z);return m(ne.buffer,ne.byteOffset,ne.byteLength)}return g(z)}(v);if(v==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof v);if(Z(v,ArrayBuffer)||v&&Z(v.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Z(v,SharedArrayBuffer)||v&&Z(v.buffer,SharedArrayBuffer)))return m(v,P,O);if(typeof v=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const U=v.valueOf&&v.valueOf();if(U!=null&&U!==v)return p.from(U,P,O);const V=function(z){if(p.isBuffer(z)){const ne=0|T(z.length),de=f(ne);return de.length===0||z.copy(de,0,0,ne),de}return z.length!==void 0?typeof z.length!="number"||te(z.length)?f(0):g(z):z.type==="Buffer"&&Array.isArray(z.data)?g(z.data):void 0}(v);if(V)return V;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof v[Symbol.toPrimitive]=="function")return p.from(v[Symbol.toPrimitive]("string"),P,O);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof v)}function S(v){if(typeof v!="number")throw new TypeError('"size" argument must be of type number');if(v<0)throw new RangeError('The value "'+v+'" is invalid for option "size"')}function C(v){return S(v),f(v<0?0:0|T(v))}function g(v){const P=v.length<0?0:0|T(v.length),O=f(P);for(let U=0;U<P;U+=1)O[U]=255&v[U];return O}function m(v,P,O){if(P<0||v.byteLength<P)throw new RangeError('"offset" is outside of buffer bounds');if(v.byteLength<P+(O||0))throw new RangeError('"length" is outside of buffer bounds');let U;return U=P===void 0&&O===void 0?new Uint8Array(v):O===void 0?new Uint8Array(v,P):new Uint8Array(v,P,O),Object.setPrototypeOf(U,p.prototype),U}function T(v){if(v>=d)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+d.toString(16)+" bytes");return 0|v}function y(v,P){if(p.isBuffer(v))return v.length;if(ArrayBuffer.isView(v)||Z(v,ArrayBuffer))return v.byteLength;if(typeof v!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof v);const O=v.length,U=arguments.length>2&&arguments[2]===!0;if(!U&&O===0)return 0;let V=!1;for(;;)switch(P){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":return me(v).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*O;case"hex":return O>>>1;case"base64":return Pe(v).length;default:if(V)return U?-1:me(v).length;P=(""+P).toLowerCase(),V=!0}}function E(v,P,O){let U=!1;if((P===void 0||P<0)&&(P=0),P>this.length||((O===void 0||O>this.length)&&(O=this.length),O<=0)||(O>>>=0)<=(P>>>=0))return"";for(v||(v="utf8");;)switch(v){case"hex":return $(this,P,O);case"utf8":case"utf-8":return x(this,P,O);case"ascii":return J(this,P,O);case"latin1":case"binary":return F(this,P,O);case"base64":return W(this,P,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,P,O);default:if(U)throw new TypeError("Unknown encoding: "+v);v=(v+"").toLowerCase(),U=!0}}function I(v,P,O){const U=v[P];v[P]=v[O],v[O]=U}function N(v,P,O,U,V){if(v.length===0)return-1;if(typeof O=="string"?(U=O,O=0):O>2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),te(O=+O)&&(O=V?0:v.length-1),O<0&&(O=v.length+O),O>=v.length){if(V)return-1;O=v.length-1}else if(O<0){if(!V)return-1;O=0}if(typeof P=="string"&&(P=p.from(P,U)),p.isBuffer(P))return P.length===0?-1:A(v,P,O,U,V);if(typeof P=="number")return P&=255,typeof Uint8Array.prototype.indexOf=="function"?V?Uint8Array.prototype.indexOf.call(v,P,O):Uint8Array.prototype.lastIndexOf.call(v,P,O):A(v,[P],O,U,V);throw new TypeError("val must be string, number or Buffer")}function A(v,P,O,U,V){let z,ne=1,de=v.length,_e=P.length;if(U!==void 0&&((U=String(U).toLowerCase())==="ucs2"||U==="ucs-2"||U==="utf16le"||U==="utf-16le")){if(v.length<2||P.length<2)return-1;ne=2,de/=2,_e/=2,O/=2}function we(oe,Se){return ne===1?oe[Se]:oe.readUInt16BE(Se*ne)}if(V){let oe=-1;for(z=O;z<de;z++)if(we(v,z)===we(P,oe===-1?0:z-oe)){if(oe===-1&&(oe=z),z-oe+1===_e)return oe*ne}else oe!==-1&&(z-=z-oe),oe=-1}else for(O+_e>de&&(O=de-_e),z=O;z>=0;z--){let oe=!0;for(let Se=0;Se<_e;Se++)if(we(v,z+Se)!==we(P,Se)){oe=!1;break}if(oe)return z}return-1}function L(v,P,O,U){O=Number(O)||0;const V=v.length-O;U?(U=Number(U))>V&&(U=V):U=V;const z=P.length;let ne;for(U>z/2&&(U=z/2),ne=0;ne<U;++ne){const de=parseInt(P.substr(2*ne,2),16);if(te(de))return ne;v[O+ne]=de}return ne}function D(v,P,O,U){return H(me(P,v.length-O),v,O,U)}function q(v,P,O,U){return H(function(V){const z=[];for(let ne=0;ne<V.length;++ne)z.push(255&V.charCodeAt(ne));return z}(P),v,O,U)}function Y(v,P,O,U){return H(Pe(P),v,O,U)}function Q(v,P,O,U){return H(function(V,z){let ne,de,_e;const we=[];for(let oe=0;oe<V.length&&!((z-=2)<0);++oe)ne=V.charCodeAt(oe),de=ne>>8,_e=ne%256,we.push(_e),we.push(de);return we}(P,v.length-O),v,O,U)}function W(v,P,O){return P===0&&O===v.length?a.fromByteArray(v):a.fromByteArray(v.slice(P,O))}function x(v,P,O){O=Math.min(v.length,O);const U=[];let V=P;for(;V<O;){const z=v[V];let ne=null,de=z>239?4:z>223?3:z>191?2:1;if(V+de<=O){let _e,we,oe,Se;switch(de){case 1:z<128&&(ne=z);break;case 2:_e=v[V+1],(192&_e)==128&&(Se=(31&z)<<6|63&_e,Se>127&&(ne=Se));break;case 3:_e=v[V+1],we=v[V+2],(192&_e)==128&&(192&we)==128&&(Se=(15&z)<<12|(63&_e)<<6|63&we,Se>2047&&(Se<55296||Se>57343)&&(ne=Se));break;case 4:_e=v[V+1],we=v[V+2],oe=v[V+3],(192&_e)==128&&(192&we)==128&&(192&oe)==128&&(Se=(15&z)<<18|(63&_e)<<12|(63&we)<<6|63&oe,Se>65535&&Se<1114112&&(ne=Se))}}ne===null?(ne=65533,de=1):ne>65535&&(ne-=65536,U.push(ne>>>10&1023|55296),ne=56320|1023&ne),U.push(ne),V+=de}return function(z){const ne=z.length;if(ne<=k)return String.fromCharCode.apply(String,z);let de="",_e=0;for(;_e<ne;)de+=String.fromCharCode.apply(String,z.slice(_e,_e+=k));return de}(U)}p.TYPED_ARRAY_SUPPORT=function(){try{const v=new Uint8Array(1),P={foo:function(){return 42}};return Object.setPrototypeOf(P,Uint8Array.prototype),Object.setPrototypeOf(v,P),v.foo()===42}catch{return!1}}(),p.TYPED_ARRAY_SUPPORT||typeof console>"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}}),Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}}),p.poolSize=8192,p.from=function(v,P,O){return _(v,P,O)},Object.setPrototypeOf(p.prototype,Uint8Array.prototype),Object.setPrototypeOf(p,Uint8Array),p.alloc=function(v,P,O){return function(U,V,z){return S(U),U<=0?f(U):V!==void 0?typeof z=="string"?f(U).fill(V,z):f(U).fill(V):f(U)}(v,P,O)},p.allocUnsafe=function(v){return C(v)},p.allocUnsafeSlow=function(v){return C(v)},p.isBuffer=function(v){return v!=null&&v._isBuffer===!0&&v!==p.prototype},p.compare=function(v,P){if(Z(v,Uint8Array)&&(v=p.from(v,v.offset,v.byteLength)),Z(P,Uint8Array)&&(P=p.from(P,P.offset,P.byteLength)),!p.isBuffer(v)||!p.isBuffer(P))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(v===P)return 0;let O=v.length,U=P.length;for(let V=0,z=Math.min(O,U);V<z;++V)if(v[V]!==P[V]){O=v[V],U=P[V];break}return O<U?-1:U<O?1:0},p.isEncoding=function(v){switch(String(v).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},p.concat=function(v,P){if(!Array.isArray(v))throw new TypeError('"list" argument must be an Array of Buffers');if(v.length===0)return p.alloc(0);let O;if(P===void 0)for(P=0,O=0;O<v.length;++O)P+=v[O].length;const U=p.allocUnsafe(P);let V=0;for(O=0;O<v.length;++O){let z=v[O];if(Z(z,Uint8Array))V+z.length>U.length?(p.isBuffer(z)||(z=p.from(z)),z.copy(U,V)):Uint8Array.prototype.set.call(U,z,V);else{if(!p.isBuffer(z))throw new TypeError('"list" argument must be an Array of Buffers');z.copy(U,V)}V+=z.length}return U},p.byteLength=y,p.prototype._isBuffer=!0,p.prototype.swap16=function(){const v=this.length;if(v%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let P=0;P<v;P+=2)I(this,P,P+1);return this},p.prototype.swap32=function(){const v=this.length;if(v%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let P=0;P<v;P+=4)I(this,P,P+3),I(this,P+1,P+2);return this},p.prototype.swap64=function(){const v=this.length;if(v%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let P=0;P<v;P+=8)I(this,P,P+7),I(this,P+1,P+6),I(this,P+2,P+5),I(this,P+3,P+4);return this},p.prototype.toString=function(){const v=this.length;return v===0?"":arguments.length===0?x(this,0,v):E.apply(this,arguments)},p.prototype.toLocaleString=p.prototype.toString,p.prototype.equals=function(v){if(!p.isBuffer(v))throw new TypeError("Argument must be a Buffer");return this===v||p.compare(this,v)===0},p.prototype.inspect=function(){let v="";const P=h.IS;return v=this.toString("hex",0,P).replace(/(.{2})/g,"$1 ").trim(),this.length>P&&(v+=" ... "),"<Buffer "+v+">"},l&&(p.prototype[l]=p.prototype.inspect),p.prototype.compare=function(v,P,O,U,V){if(Z(v,Uint8Array)&&(v=p.from(v,v.offset,v.byteLength)),!p.isBuffer(v))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof v);if(P===void 0&&(P=0),O===void 0&&(O=v?v.length:0),U===void 0&&(U=0),V===void 0&&(V=this.length),P<0||O>v.length||U<0||V>this.length)throw new RangeError("out of range index");if(U>=V&&P>=O)return 0;if(U>=V)return-1;if(P>=O)return 1;if(this===v)return 0;let z=(V>>>=0)-(U>>>=0),ne=(O>>>=0)-(P>>>=0);const de=Math.min(z,ne),_e=this.slice(U,V),we=v.slice(P,O);for(let oe=0;oe<de;++oe)if(_e[oe]!==we[oe]){z=_e[oe],ne=we[oe];break}return z<ne?-1:ne<z?1:0},p.prototype.includes=function(v,P,O){return this.indexOf(v,P,O)!==-1},p.prototype.indexOf=function(v,P,O){return N(this,v,P,O,!0)},p.prototype.lastIndexOf=function(v,P,O){return N(this,v,P,O,!1)},p.prototype.write=function(v,P,O,U){if(P===void 0)U="utf8",O=this.length,P=0;else if(O===void 0&&typeof P=="string")U=P,O=this.length,P=0;else{if(!isFinite(P))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");P>>>=0,isFinite(O)?(O>>>=0,U===void 0&&(U="utf8")):(U=O,O=void 0)}const V=this.length-P;if((O===void 0||O>V)&&(O=V),v.length>0&&(O<0||P<0)||P>this.length)throw new RangeError("Attempt to write outside buffer bounds");U||(U="utf8");let z=!1;for(;;)switch(U){case"hex":return L(this,v,P,O);case"utf8":case"utf-8":return D(this,v,P,O);case"ascii":case"latin1":case"binary":return q(this,v,P,O);case"base64":return Y(this,v,P,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Q(this,v,P,O);default:if(z)throw new TypeError("Unknown encoding: "+U);U=(""+U).toLowerCase(),z=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const k=4096;function J(v,P,O){let U="";O=Math.min(v.length,O);for(let V=P;V<O;++V)U+=String.fromCharCode(127&v[V]);return U}function F(v,P,O){let U="";O=Math.min(v.length,O);for(let V=P;V<O;++V)U+=String.fromCharCode(v[V]);return U}function $(v,P,O){const U=v.length;(!P||P<0)&&(P=0),(!O||O<0||O>U)&&(O=U);let V="";for(let z=P;z<O;++z)V+=ie[v[z]];return V}function R(v,P,O){const U=v.slice(P,O);let V="";for(let z=0;z<U.length-1;z+=2)V+=String.fromCharCode(U[z]+256*U[z+1]);return V}function B(v,P,O){if(v%1!=0||v<0)throw new RangeError("offset is not uint");if(v+P>O)throw new RangeError("Trying to access beyond buffer length")}function M(v,P,O,U,V,z){if(!p.isBuffer(v))throw new TypeError('"buffer" argument must be a Buffer instance');if(P>V||P<z)throw new RangeError('"value" argument is out of bounds');if(O+U>v.length)throw new RangeError("Index out of range")}function re(v,P,O,U,V){X(P,U,V,v,O,7);let z=Number(P&BigInt(4294967295));v[O++]=z,z>>=8,v[O++]=z,z>>=8,v[O++]=z,z>>=8,v[O++]=z;let ne=Number(P>>BigInt(32)&BigInt(4294967295));return v[O++]=ne,ne>>=8,v[O++]=ne,ne>>=8,v[O++]=ne,ne>>=8,v[O++]=ne,O}function se(v,P,O,U,V){X(P,U,V,v,O,7);let z=Number(P&BigInt(4294967295));v[O+7]=z,z>>=8,v[O+6]=z,z>>=8,v[O+5]=z,z>>=8,v[O+4]=z;let ne=Number(P>>BigInt(32)&BigInt(4294967295));return v[O+3]=ne,ne>>=8,v[O+2]=ne,ne>>=8,v[O+1]=ne,ne>>=8,v[O]=ne,O+8}function fe(v,P,O,U,V,z){if(O+U>v.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function ce(v,P,O,U,V){return P=+P,O>>>=0,V||fe(v,0,O,4),u.write(v,P,O,U,23,4),O+4}function Te(v,P,O,U,V){return P=+P,O>>>=0,V||fe(v,0,O,8),u.write(v,P,O,U,52,8),O+8}p.prototype.slice=function(v,P){const O=this.length;(v=~~v)<0?(v+=O)<0&&(v=0):v>O&&(v=O),(P=P===void 0?O:~~P)<0?(P+=O)<0&&(P=0):P>O&&(P=O),P<v&&(P=v);const U=this.subarray(v,P);return Object.setPrototypeOf(U,p.prototype),U},p.prototype.readUintLE=p.prototype.readUIntLE=function(v,P,O){v>>>=0,P>>>=0,O||B(v,P,this.length);let U=this[v],V=1,z=0;for(;++z<P&&(V*=256);)U+=this[v+z]*V;return U},p.prototype.readUintBE=p.prototype.readUIntBE=function(v,P,O){v>>>=0,P>>>=0,O||B(v,P,this.length);let U=this[v+--P],V=1;for(;P>0&&(V*=256);)U+=this[v+--P]*V;return U},p.prototype.readUint8=p.prototype.readUInt8=function(v,P){return v>>>=0,P||B(v,1,this.length),this[v]},p.prototype.readUint16LE=p.prototype.readUInt16LE=function(v,P){return v>>>=0,P||B(v,2,this.length),this[v]|this[v+1]<<8},p.prototype.readUint16BE=p.prototype.readUInt16BE=function(v,P){return v>>>=0,P||B(v,2,this.length),this[v]<<8|this[v+1]},p.prototype.readUint32LE=p.prototype.readUInt32LE=function(v,P){return v>>>=0,P||B(v,4,this.length),(this[v]|this[v+1]<<8|this[v+2]<<16)+16777216*this[v+3]},p.prototype.readUint32BE=p.prototype.readUInt32BE=function(v,P){return v>>>=0,P||B(v,4,this.length),16777216*this[v]+(this[v+1]<<16|this[v+2]<<8|this[v+3])},p.prototype.readBigUInt64LE=j(function(v){ae(v>>>=0,"offset");const P=this[v],O=this[v+7];P!==void 0&&O!==void 0||ee(v,this.length-8);const U=P+256*this[++v]+65536*this[++v]+this[++v]*2**24,V=this[++v]+256*this[++v]+65536*this[++v]+O*2**24;return BigInt(U)+(BigInt(V)<<BigInt(32))}),p.prototype.readBigUInt64BE=j(function(v){ae(v>>>=0,"offset");const P=this[v],O=this[v+7];P!==void 0&&O!==void 0||ee(v,this.length-8);const U=P*2**24+65536*this[++v]+256*this[++v]+this[++v],V=this[++v]*2**24+65536*this[++v]+256*this[++v]+O;return(BigInt(U)<<BigInt(32))+BigInt(V)}),p.prototype.readIntLE=function(v,P,O){v>>>=0,P>>>=0,O||B(v,P,this.length);let U=this[v],V=1,z=0;for(;++z<P&&(V*=256);)U+=this[v+z]*V;return V*=128,U>=V&&(U-=Math.pow(2,8*P)),U},p.prototype.readIntBE=function(v,P,O){v>>>=0,P>>>=0,O||B(v,P,this.length);let U=P,V=1,z=this[v+--U];for(;U>0&&(V*=256);)z+=this[v+--U]*V;return V*=128,z>=V&&(z-=Math.pow(2,8*P)),z},p.prototype.readInt8=function(v,P){return v>>>=0,P||B(v,1,this.length),128&this[v]?-1*(255-this[v]+1):this[v]},p.prototype.readInt16LE=function(v,P){v>>>=0,P||B(v,2,this.length);const O=this[v]|this[v+1]<<8;return 32768&O?4294901760|O:O},p.prototype.readInt16BE=function(v,P){v>>>=0,P||B(v,2,this.length);const O=this[v+1]|this[v]<<8;return 32768&O?4294901760|O:O},p.prototype.readInt32LE=function(v,P){return v>>>=0,P||B(v,4,this.length),this[v]|this[v+1]<<8|this[v+2]<<16|this[v+3]<<24},p.prototype.readInt32BE=function(v,P){return v>>>=0,P||B(v,4,this.length),this[v]<<24|this[v+1]<<16|this[v+2]<<8|this[v+3]},p.prototype.readBigInt64LE=j(function(v){ae(v>>>=0,"offset");const P=this[v],O=this[v+7];P!==void 0&&O!==void 0||ee(v,this.length-8);const U=this[v+4]+256*this[v+5]+65536*this[v+6]+(O<<24);return(BigInt(U)<<BigInt(32))+BigInt(P+256*this[++v]+65536*this[++v]+this[++v]*16777216)}),p.prototype.readBigInt64BE=j(function(v){ae(v>>>=0,"offset");const P=this[v],O=this[v+7];P!==void 0&&O!==void 0||ee(v,this.length-8);const U=(P<<24)+65536*this[++v]+256*this[++v]+this[++v];return(BigInt(U)<<BigInt(32))+BigInt(this[++v]*16777216+65536*this[++v]+256*this[++v]+O)}),p.prototype.readFloatLE=function(v,P){return v>>>=0,P||B(v,4,this.length),u.read(this,v,!0,23,4)},p.prototype.readFloatBE=function(v,P){return v>>>=0,P||B(v,4,this.length),u.read(this,v,!1,23,4)},p.prototype.readDoubleLE=function(v,P){return v>>>=0,P||B(v,8,this.length),u.read(this,v,!0,52,8)},p.prototype.readDoubleBE=function(v,P){return v>>>=0,P||B(v,8,this.length),u.read(this,v,!1,52,8)},p.prototype.writeUintLE=p.prototype.writeUIntLE=function(v,P,O,U){v=+v,P>>>=0,O>>>=0,U||M(this,v,P,O,Math.pow(2,8*O)-1,0);let V=1,z=0;for(this[P]=255&v;++z<O&&(V*=256);)this[P+z]=v/V&255;return P+O},p.prototype.writeUintBE=p.prototype.writeUIntBE=function(v,P,O,U){v=+v,P>>>=0,O>>>=0,U||M(this,v,P,O,Math.pow(2,8*O)-1,0);let V=O-1,z=1;for(this[P+V]=255&v;--V>=0&&(z*=256);)this[P+V]=v/z&255;return P+O},p.prototype.writeUint8=p.prototype.writeUInt8=function(v,P,O){return v=+v,P>>>=0,O||M(this,v,P,1,255,0),this[P]=255&v,P+1},p.prototype.writeUint16LE=p.prototype.writeUInt16LE=function(v,P,O){return v=+v,P>>>=0,O||M(this,v,P,2,65535,0),this[P]=255&v,this[P+1]=v>>>8,P+2},p.prototype.writeUint16BE=p.prototype.writeUInt16BE=function(v,P,O){return v=+v,P>>>=0,O||M(this,v,P,2,65535,0),this[P]=v>>>8,this[P+1]=255&v,P+2},p.prototype.writeUint32LE=p.prototype.writeUInt32LE=function(v,P,O){return v=+v,P>>>=0,O||M(this,v,P,4,4294967295,0),this[P+3]=v>>>24,this[P+2]=v>>>16,this[P+1]=v>>>8,this[P]=255&v,P+4},p.prototype.writeUint32BE=p.prototype.writeUInt32BE=function(v,P,O){return v=+v,P>>>=0,O||M(this,v,P,4,4294967295,0),this[P]=v>>>24,this[P+1]=v>>>16,this[P+2]=v>>>8,this[P+3]=255&v,P+4},p.prototype.writeBigUInt64LE=j(function(v,P=0){return re(this,v,P,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeBigUInt64BE=j(function(v,P=0){return se(this,v,P,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeIntLE=function(v,P,O,U){if(v=+v,P>>>=0,!U){const de=Math.pow(2,8*O-1);M(this,v,P,O,de-1,-de)}let V=0,z=1,ne=0;for(this[P]=255&v;++V<O&&(z*=256);)v<0&&ne===0&&this[P+V-1]!==0&&(ne=1),this[P+V]=(v/z|0)-ne&255;return P+O},p.prototype.writeIntBE=function(v,P,O,U){if(v=+v,P>>>=0,!U){const de=Math.pow(2,8*O-1);M(this,v,P,O,de-1,-de)}let V=O-1,z=1,ne=0;for(this[P+V]=255&v;--V>=0&&(z*=256);)v<0&&ne===0&&this[P+V+1]!==0&&(ne=1),this[P+V]=(v/z|0)-ne&255;return P+O},p.prototype.writeInt8=function(v,P,O){return v=+v,P>>>=0,O||M(this,v,P,1,127,-128),v<0&&(v=255+v+1),this[P]=255&v,P+1},p.prototype.writeInt16LE=function(v,P,O){return v=+v,P>>>=0,O||M(this,v,P,2,32767,-32768),this[P]=255&v,this[P+1]=v>>>8,P+2},p.prototype.writeInt16BE=function(v,P,O){return v=+v,P>>>=0,O||M(this,v,P,2,32767,-32768),this[P]=v>>>8,this[P+1]=255&v,P+2},p.prototype.writeInt32LE=function(v,P,O){return v=+v,P>>>=0,O||M(this,v,P,4,2147483647,-2147483648),this[P]=255&v,this[P+1]=v>>>8,this[P+2]=v>>>16,this[P+3]=v>>>24,P+4},p.prototype.writeInt32BE=function(v,P,O){return v=+v,P>>>=0,O||M(this,v,P,4,2147483647,-2147483648),v<0&&(v=4294967295+v+1),this[P]=v>>>24,this[P+1]=v>>>16,this[P+2]=v>>>8,this[P+3]=255&v,P+4},p.prototype.writeBigInt64LE=j(function(v,P=0){return re(this,v,P,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),p.prototype.writeBigInt64BE=j(function(v,P=0){return se(this,v,P,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),p.prototype.writeFloatLE=function(v,P,O){return ce(this,v,P,!0,O)},p.prototype.writeFloatBE=function(v,P,O){return ce(this,v,P,!1,O)},p.prototype.writeDoubleLE=function(v,P,O){return Te(this,v,P,!0,O)},p.prototype.writeDoubleBE=function(v,P,O){return Te(this,v,P,!1,O)},p.prototype.copy=function(v,P,O,U){if(!p.isBuffer(v))throw new TypeError("argument should be a Buffer");if(O||(O=0),U||U===0||(U=this.length),P>=v.length&&(P=v.length),P||(P=0),U>0&&U<O&&(U=O),U===O||v.length===0||this.length===0)return 0;if(P<0)throw new RangeError("targetStart out of bounds");if(O<0||O>=this.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("sourceEnd out of bounds");U>this.length&&(U=this.length),v.length-P<U-O&&(U=v.length-P+O);const V=U-O;return this===v&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(P,O,U):Uint8Array.prototype.set.call(v,this.subarray(O,U),P),V},p.prototype.fill=function(v,P,O,U){if(typeof v=="string"){if(typeof P=="string"?(U=P,P=0,O=this.length):typeof O=="string"&&(U=O,O=this.length),U!==void 0&&typeof U!="string")throw new TypeError("encoding must be a string");if(typeof U=="string"&&!p.isEncoding(U))throw new TypeError("Unknown encoding: "+U);if(v.length===1){const z=v.charCodeAt(0);(U==="utf8"&&z<128||U==="latin1")&&(v=z)}}else typeof v=="number"?v&=255:typeof v=="boolean"&&(v=Number(v));if(P<0||this.length<P||this.length<O)throw new RangeError("Out of range index");if(O<=P)return this;let V;if(P>>>=0,O=O===void 0?this.length:O>>>0,v||(v=0),typeof v=="number")for(V=P;V<O;++V)this[V]=v;else{const z=p.isBuffer(v)?v:p.from(v,U),ne=z.length;if(ne===0)throw new TypeError('The value "'+v+'" is invalid for argument "value"');for(V=0;V<O-P;++V)this[V+P]=z[V%ne]}return this};const Ee={};function he(v,P,O){Ee[v]=class extends O{constructor(){super(),Object.defineProperty(this,"message",{value:P.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${v}]`,this.stack,delete this.name}get code(){return v}set code(U){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:U,writable:!0})}toString(){return`${this.name} [${v}]: ${this.message}`}}}function ge(v){let P="",O=v.length;const U=v[0]==="-"?1:0;for(;O>=U+4;O-=3)P=`_${v.slice(O-3,O)}${P}`;return`${v.slice(0,O)}${P}`}function X(v,P,O,U,V,z){if(v>O||v<P){const ne=typeof P=="bigint"?"n":"";let de;throw de=P===0||P===BigInt(0)?`>= 0${ne} and < 2${ne} ** ${8*(z+1)}${ne}`:`>= -(2${ne} ** ${8*(z+1)-1}${ne}) and < 2 ** ${8*(z+1)-1}${ne}`,new Ee.ERR_OUT_OF_RANGE("value",de,v)}(function(ne,de,_e){ae(de,"offset"),ne[de]!==void 0&&ne[de+_e]!==void 0||ee(de,ne.length-(_e+1))})(U,V,z)}function ae(v,P){if(typeof v!="number")throw new Ee.ERR_INVALID_ARG_TYPE(P,"number",v)}function ee(v,P,O){throw Math.floor(v)!==v?(ae(v,O),new Ee.ERR_OUT_OF_RANGE("offset","an integer",v)):P<0?new Ee.ERR_BUFFER_OUT_OF_BOUNDS:new Ee.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${P}`,v)}he("ERR_BUFFER_OUT_OF_BOUNDS",function(v){return v?`${v} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),he("ERR_INVALID_ARG_TYPE",function(v,P){return`The "${v}" argument must be of type number. Received type ${typeof P}`},TypeError),he("ERR_OUT_OF_RANGE",function(v,P,O){let U=`The value of "${v}" is out of range.`,V=O;return Number.isInteger(O)&&Math.abs(O)>4294967296?V=ge(String(O)):typeof O=="bigint"&&(V=String(O),(O>BigInt(2)**BigInt(32)||O<-(BigInt(2)**BigInt(32)))&&(V=ge(V)),V+="n"),U+=` It must be ${P}. Received ${V}`,U},RangeError);const Re=/[^+/0-9A-Za-z-_]/g;function me(v,P){let O;P=P||1/0;const U=v.length;let V=null;const z=[];for(let ne=0;ne<U;++ne){if(O=v.charCodeAt(ne),O>55295&&O<57344){if(!V){if(O>56319){(P-=3)>-1&&z.push(239,191,189);continue}if(ne+1===U){(P-=3)>-1&&z.push(239,191,189);continue}V=O;continue}if(O<56320){(P-=3)>-1&&z.push(239,191,189),V=O;continue}O=65536+(V-55296<<10|O-56320)}else V&&(P-=3)>-1&&z.push(239,191,189);if(V=null,O<128){if((P-=1)<0)break;z.push(O)}else if(O<2048){if((P-=2)<0)break;z.push(O>>6|192,63&O|128)}else if(O<65536){if((P-=3)<0)break;z.push(O>>12|224,O>>6&63|128,63&O|128)}else{if(!(O<1114112))throw new Error("Invalid code point");if((P-=4)<0)break;z.push(O>>18|240,O>>12&63|128,O>>6&63|128,63&O|128)}}return z}function Pe(v){return a.toByteArray(function(P){if((P=(P=P.split("=")[0]).trim().replace(Re,"")).length<2)return"";for(;P.length%4!=0;)P+="=";return P}(v))}function H(v,P,O,U){let V;for(V=0;V<U&&!(V+O>=P.length||V>=v.length);++V)P[V+O]=v[V];return V}function Z(v,P){return v instanceof P||v!=null&&v.constructor!=null&&v.constructor.name!=null&&v.constructor.name===P.name}function te(v){return v!=v}const ie=function(){const v="0123456789abcdef",P=new Array(256);for(let O=0;O<16;++O){const U=16*O;for(let V=0;V<16;++V)P[U+V]=v[O]+v[V]}return P}();function j(v){return typeof BigInt>"u"?Oe:v}function Oe(){throw new Error("BigInt not supported")}},7007:o=>{var h,r=typeof Reflect=="object"?Reflect:null,a=r&&typeof r.apply=="function"?r.apply:function(E,I,N){return Function.prototype.apply.call(E,I,N)};h=r&&typeof r.ownKeys=="function"?r.ownKeys:Object.getOwnPropertySymbols?function(E){return Object.getOwnPropertyNames(E).concat(Object.getOwnPropertySymbols(E))}:function(E){return Object.getOwnPropertyNames(E)};var u=Number.isNaN||function(E){return E!=E};function l(){l.init.call(this)}o.exports=l,o.exports.once=function(E,I){return new Promise(function(N,A){function L(q){E.removeListener(I,D),A(q)}function D(){typeof E.removeListener=="function"&&E.removeListener("error",L),N([].slice.call(arguments))}y(E,I,D,{once:!0}),I!=="error"&&function(q,Y,Q){typeof q.on=="function"&&y(q,"error",Y,{once:!0})}(E,L)})},l.EventEmitter=l,l.prototype._events=void 0,l.prototype._eventsCount=0,l.prototype._maxListeners=void 0;var d=10;function f(E){if(typeof E!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof E)}function p(E){return E._maxListeners===void 0?l.defaultMaxListeners:E._maxListeners}function _(E,I,N,A){var L,D,q,Y;if(f(N),(D=E._events)===void 0?(D=E._events=Object.create(null),E._eventsCount=0):(D.newListener!==void 0&&(E.emit("newListener",I,N.listener?N.listener:N),D=E._events),q=D[I]),q===void 0)q=D[I]=N,++E._eventsCount;else if(typeof q=="function"?q=D[I]=A?[N,q]:[q,N]:A?q.unshift(N):q.push(N),(L=p(E))>0&&q.length>L&&!q.warned){q.warned=!0;var Q=new Error("Possible EventEmitter memory leak detected. "+q.length+" "+String(I)+" listeners added. Use emitter.setMaxListeners() to increase limit");Q.name="MaxListenersExceededWarning",Q.emitter=E,Q.type=I,Q.count=q.length,Y=Q,console&&console.warn&&console.warn(Y)}return E}function S(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function C(E,I,N){var A={fired:!1,wrapFn:void 0,target:E,type:I,listener:N},L=S.bind(A);return L.listener=N,A.wrapFn=L,L}function g(E,I,N){var A=E._events;if(A===void 0)return[];var L=A[I];return L===void 0?[]:typeof L=="function"?N?[L.listener||L]:[L]:N?function(D){for(var q=new Array(D.length),Y=0;Y<q.length;++Y)q[Y]=D[Y].listener||D[Y];return q}(L):T(L,L.length)}function m(E){var I=this._events;if(I!==void 0){var N=I[E];if(typeof N=="function")return 1;if(N!==void 0)return N.length}return 0}function T(E,I){for(var N=new Array(I),A=0;A<I;++A)N[A]=E[A];return N}function y(E,I,N,A){if(typeof E.on=="function")A.once?E.once(I,N):E.on(I,N);else{if(typeof E.addEventListener!="function")throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof E);E.addEventListener(I,function L(D){A.once&&E.removeEventListener(I,L),N(D)})}}Object.defineProperty(l,"defaultMaxListeners",{enumerable:!0,get:function(){return d},set:function(E){if(typeof E!="number"||E<0||u(E))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+E+".");d=E}}),l.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},l.prototype.setMaxListeners=function(E){if(typeof E!="number"||E<0||u(E))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+E+".");return this._maxListeners=E,this},l.prototype.getMaxListeners=function(){return p(this)},l.prototype.emit=function(E){for(var I=[],N=1;N<arguments.length;N++)I.push(arguments[N]);var A=E==="error",L=this._events;if(L!==void 0)A=A&&L.error===void 0;else if(!A)return!1;if(A){var D;if(I.length>0&&(D=I[0]),D instanceof Error)throw D;var q=new Error("Unhandled error."+(D?" ("+D.message+")":""));throw q.context=D,q}var Y=L[E];if(Y===void 0)return!1;if(typeof Y=="function")a(Y,this,I);else{var Q=Y.length,W=T(Y,Q);for(N=0;N<Q;++N)a(W[N],this,I)}return!0},l.prototype.addListener=function(E,I){return _(this,E,I,!1)},l.prototype.on=l.prototype.addListener,l.prototype.prependListener=function(E,I){return _(this,E,I,!0)},l.prototype.once=function(E,I){return f(I),this.on(E,C(this,E,I)),this},l.prototype.prependOnceListener=function(E,I){return f(I),this.prependListener(E,C(this,E,I)),this},l.prototype.removeListener=function(E,I){var N,A,L,D,q;if(f(I),(A=this._events)===void 0)return this;if((N=A[E])===void 0)return this;if(N===I||N.listener===I)--this._eventsCount==0?this._events=Object.create(null):(delete A[E],A.removeListener&&this.emit("removeListener",E,N.listener||I));else if(typeof N!="function"){for(L=-1,D=N.length-1;D>=0;D--)if(N[D]===I||N[D].listener===I){q=N[D].listener,L=D;break}if(L<0)return this;L===0?N.shift():function(Y,Q){for(;Q+1<Y.length;Q++)Y[Q]=Y[Q+1];Y.pop()}(N,L),N.length===1&&(A[E]=N[0]),A.removeListener!==void 0&&this.emit("removeListener",E,q||I)}return this},l.prototype.off=l.prototype.removeListener,l.prototype.removeAllListeners=function(E){var I,N,A;if((N=this._events)===void 0)return this;if(N.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):N[E]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete N[E]),this;if(arguments.length===0){var L,D=Object.keys(N);for(A=0;A<D.length;++A)(L=D[A])!=="removeListener"&&this.removeAllListeners(L);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(I=N[E])=="function")this.removeListener(E,I);else if(I!==void 0)for(A=I.length-1;A>=0;A--)this.removeListener(E,I[A]);return this},l.prototype.listeners=function(E){return g(this,E,!0)},l.prototype.rawListeners=function(E){return g(this,E,!1)},l.listenerCount=function(E,I){return typeof E.listenerCount=="function"?E.listenerCount(I):m.call(E,I)},l.prototype.listenerCount=m,l.prototype.eventNames=function(){return this._eventsCount>0?h(this._events):[]}},251:(o,h)=>{h.read=function(r,a,u,l,d){var f,p,_=8*d-l-1,S=(1<<_)-1,C=S>>1,g=-7,m=u?d-1:0,T=u?-1:1,y=r[a+m];for(m+=T,f=y&(1<<-g)-1,y>>=-g,g+=_;g>0;f=256*f+r[a+m],m+=T,g-=8);for(p=f&(1<<-g)-1,f>>=-g,g+=l;g>0;p=256*p+r[a+m],m+=T,g-=8);if(f===0)f=1-C;else{if(f===S)return p?NaN:1/0*(y?-1:1);p+=Math.pow(2,l),f-=C}return(y?-1:1)*p*Math.pow(2,f-l)},h.write=function(r,a,u,l,d,f){var p,_,S,C=8*f-d-1,g=(1<<C)-1,m=g>>1,T=d===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=l?0:f-1,E=l?1:-1,I=a<0||a===0&&1/a<0?1:0;for(a=Math.abs(a),isNaN(a)||a===1/0?(_=isNaN(a)?1:0,p=g):(p=Math.floor(Math.log(a)/Math.LN2),a*(S=Math.pow(2,-p))<1&&(p--,S*=2),(a+=p+m>=1?T/S:T*Math.pow(2,1-m))*S>=2&&(p++,S/=2),p+m>=g?(_=0,p=g):p+m>=1?(_=(a*S-1)*Math.pow(2,d),p+=m):(_=a*Math.pow(2,m-1)*Math.pow(2,d),p=0));d>=8;r[u+y]=255&_,y+=E,_/=256,d-=8);for(p=p<<d|_,C+=d;C>0;r[u+y]=255&p,y+=E,p/=256,C-=8);r[u+y-E]|=128*I}},5837:()=>{},97:()=>{},5594:()=>{},886:()=>{},7625:()=>{},595:(o,h)=>{Object.defineProperty(h,"__esModule",{value:!0});var r={},a=function(b,w,G,K,ue){var pe=new Worker(r[w]||(r[w]=URL.createObjectURL(new Blob([b+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return pe.onmessage=function(ve){var ye=ve.data,Le=ye.$e$;if(Le){var Ie=new Error(Le[0]);Ie.code=Le[1],Ie.stack=Le[2],ue(Ie,null)}else ue(null,ye)},pe.postMessage(G,K),pe},u=Uint8Array,l=Uint16Array,d=Int32Array,f=new u([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),p=new u([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),_=new u([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),S=function(b,w){for(var G=new l(31),K=0;K<31;++K)G[K]=w+=1<<b[K-1];var ue=new d(G[30]);for(K=1;K<30;++K)for(var pe=G[K];pe<G[K+1];++pe)ue[pe]=pe-G[K]<<5|K;return{b:G,r:ue}},C=S(f,2),g=C.b,m=C.r;g[28]=258,m[258]=28;for(var T=S(p,0),y=T.b,E=T.r,I=new l(32768),N=0;N<32768;++N){var A=(43690&N)>>1|(21845&N)<<1;A=(61680&(A=(52428&A)>>2|(13107&A)<<2))>>4|(3855&A)<<4,I[N]=((65280&A)>>8|(255&A)<<8)>>1}var L=function(b,w,G){for(var K=b.length,ue=0,pe=new l(w);ue<K;++ue)b[ue]&&++pe[b[ue]-1];var ve,ye=new l(w);for(ue=1;ue<w;++ue)ye[ue]=ye[ue-1]+pe[ue-1]<<1;if(G){ve=new l(1<<w);var Le=15-w;for(ue=0;ue<K;++ue)if(b[ue])for(var Ie=ue<<4|b[ue],De=w-b[ue],be=ye[b[ue]-1]++<<De,Fe=be|(1<<De)-1;be<=Fe;++be)ve[I[be]>>Le]=Ie}else for(ve=new l(K),ue=0;ue<K;++ue)b[ue]&&(ve[ue]=I[ye[b[ue]-1]++]>>15-b[ue]);return ve},D=new u(288);for(N=0;N<144;++N)D[N]=8;for(N=144;N<256;++N)D[N]=9;for(N=256;N<280;++N)D[N]=7;for(N=280;N<288;++N)D[N]=8;var q=new u(32);for(N=0;N<32;++N)q[N]=5;var Y=L(D,9,0),Q=L(D,9,1),W=L(q,5,0),x=L(q,5,1),k=function(b){for(var w=b[0],G=1;G<b.length;++G)b[G]>w&&(w=b[G]);return w},J=function(b,w,G){var K=w/8|0;return(b[K]|b[K+1]<<8)>>(7&w)&G},F=function(b,w){var G=w/8|0;return(b[G]|b[G+1]<<8|b[G+2]<<16)>>(7&w)},$=function(b){return(b+7)/8|0},R=function(b,w,G){return(w==null||w<0)&&(w=0),(G==null||G>b.length)&&(G=b.length),new u(b.subarray(w,G))};h.FlateErrorCode={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14};var B=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],M=function(b,w,G){var K=new Error(w||B[b]);if(K.code=b,Error.captureStackTrace&&Error.captureStackTrace(K,M),!G)throw K;return K},re=function(b,w,G,K){var ue=b.length,pe=K?K.length:0;if(!ue||w.f&&!w.l)return G||new u(0);var ve=!G,ye=ve||w.i!=2,Le=w.i;ve&&(G=new u(3*ue));var Ie=function(As){var Hr=G.length;if(As>Hr){var Yr=new u(Math.max(2*Hr,As));Yr.set(G),G=Yr}},De=w.f||0,be=w.p||0,Fe=w.b||0,Ye=w.l,ze=w.d,Qe=w.m,Ge=w.n,Ve=8*ue;do{if(!Ye){De=J(b,be,1);var rt=J(b,be+1,3);if(be+=3,!rt){var Ze=b[(ot=$(be)+4)-4]|b[ot-3]<<8,Xe=ot+Ze;if(Xe>ue){Le&&M(0);break}ye&&Ie(Fe+Ze),G.set(b.subarray(ot,Xe),Fe),w.b=Fe+=Ze,w.p=be=8*Xe,w.f=De;continue}if(rt==1)Ye=Q,ze=x,Qe=9,Ge=5;else if(rt==2){var st=J(b,be,31)+257,lt=J(b,be+10,15)+4,Ke=st+J(b,be+5,31)+1;be+=14;for(var We=new u(Ke),$e=new u(19),Je=0;Je<lt;++Je)$e[_[Je]]=J(b,be+3*Je,7);be+=3*lt;var Nt=k($e),dt=(1<<Nt)-1,yt=L($e,Nt,1);for(Je=0;Je<Ke;){var ot,It=yt[J(b,be,dt)];if(be+=15&It,(ot=It>>4)<16)We[Je++]=ot;else{var wt=0,_t=0;for(ot==16?(_t=3+J(b,be,3),be+=2,wt=We[Je-1]):ot==17?(_t=3+J(b,be,7),be+=3):ot==18&&(_t=11+J(b,be,127),be+=7);_t--;)We[Je++]=wt}}var Wt=We.subarray(0,st),Mt=We.subarray(st);Qe=k(Wt),Ge=k(Mt),Ye=L(Wt,Qe,1),ze=L(Mt,Ge,1)}else M(1);if(be>Ve){Le&&M(0);break}}ye&&Ie(Fe+131072);for(var Cr=(1<<Qe)-1,dn=(1<<Ge)-1,Bn=be;;Bn=be){var rn=(wt=Ye[F(b,be)&Cr])>>4;if((be+=15&wt)>Ve){Le&&M(0);break}if(wt||M(2),rn<256)G[Fe++]=rn;else{if(rn==256){Bn=be,Ye=null;break}var pn=rn-254;if(rn>264){var Ct=f[Je=rn-257];pn=J(b,be,(1<<Ct)-1)+g[Je],be+=Ct}var Dn=ze[F(b,be)&dn],Vr=Dn>>4;if(Dn||M(3),be+=15&Dn,Mt=y[Vr],Vr>3&&(Ct=p[Vr],Mt+=F(b,be)&(1<<Ct)-1,be+=Ct),be>Ve){Le&&M(0);break}ye&&Ie(Fe+131072);var jr=Fe+pn;if(Fe<Mt){var Os=pe-Mt,Pi=Math.min(Mt,jr);for(Os+Fe<0&&M(3);Fe<Pi;++Fe)G[Fe]=K[Os+Fe]}for(;Fe<jr;++Fe)G[Fe]=G[Fe-Mt]}}w.l=Ye,w.p=Bn,w.b=Fe,w.f=De,Ye&&(De=1,w.m=Qe,w.d=ze,w.n=Ge)}while(!De);return Fe!=G.length&&ve?R(G,0,Fe):G.subarray(0,Fe)},se=function(b,w,G){G<<=7&w;var K=w/8|0;b[K]|=G,b[K+1]|=G>>8},fe=function(b,w,G){G<<=7&w;var K=w/8|0;b[K]|=G,b[K+1]|=G>>8,b[K+2]|=G>>16},ce=function(b,w){for(var G=[],K=0;K<b.length;++K)b[K]&&G.push({s:K,f:b[K]});var ue=G.length,pe=G.slice();if(!ue)return{t:ee,l:0};if(ue==1){var ve=new u(G[0].s+1);return ve[G[0].s]=1,{t:ve,l:1}}G.sort(function(st,lt){return st.f-lt.f}),G.push({s:-1,f:25001});var ye=G[0],Le=G[1],Ie=0,De=1,be=2;for(G[0]={s:-1,f:ye.f+Le.f,l:ye,r:Le};De!=ue-1;)ye=G[G[Ie].f<G[be].f?Ie++:be++],Le=G[Ie!=De&&G[Ie].f<G[be].f?Ie++:be++],G[De++]={s:-1,f:ye.f+Le.f,l:ye,r:Le};var Fe=pe[0].s;for(K=1;K<ue;++K)pe[K].s>Fe&&(Fe=pe[K].s);var Ye=new l(Fe+1),ze=Te(G[De-1],Ye,0);if(ze>w){K=0;var Qe=0,Ge=ze-w,Ve=1<<Ge;for(pe.sort(function(st,lt){return Ye[lt.s]-Ye[st.s]||st.f-lt.f});K<ue;++K){var rt=pe[K].s;if(!(Ye[rt]>w))break;Qe+=Ve-(1<<ze-Ye[rt]),Ye[rt]=w}for(Qe>>=Ge;Qe>0;){var Ze=pe[K].s;Ye[Ze]<w?Qe-=1<<w-Ye[Ze]++-1:++K}for(;K>=0&&Qe;--K){var Xe=pe[K].s;Ye[Xe]==w&&(--Ye[Xe],++Qe)}ze=w}return{t:new u(Ye),l:ze}},Te=function(b,w,G){return b.s==-1?Math.max(Te(b.l,w,G+1),Te(b.r,w,G+1)):w[b.s]=G},Ee=function(b){for(var w=b.length;w&&!b[--w];);for(var G=new l(++w),K=0,ue=b[0],pe=1,ve=function(Le){G[K++]=Le},ye=1;ye<=w;++ye)if(b[ye]==ue&&ye!=w)++pe;else{if(!ue&&pe>2){for(;pe>138;pe-=138)ve(32754);pe>2&&(ve(pe>10?pe-11<<5|28690:pe-3<<5|12305),pe=0)}else if(pe>3){for(ve(ue),--pe;pe>6;pe-=6)ve(8304);pe>2&&(ve(pe-3<<5|8208),pe=0)}for(;pe--;)ve(ue);pe=1,ue=b[ye]}return{c:G.subarray(0,K),n:w}},he=function(b,w){for(var G=0,K=0;K<w.length;++K)G+=b[K]*w[K];return G},ge=function(b,w,G){var K=G.length,ue=$(w+2);b[ue]=255&K,b[ue+1]=K>>8,b[ue+2]=255^b[ue],b[ue+3]=255^b[ue+1];for(var pe=0;pe<K;++pe)b[ue+pe+4]=G[pe];return 8*(ue+4+K)},X=function(b,w,G,K,ue,pe,ve,ye,Le,Ie,De){se(w,De++,G),++ue[256];for(var be=ce(ue,15),Fe=be.t,Ye=be.l,ze=ce(pe,15),Qe=ze.t,Ge=ze.l,Ve=Ee(Fe),rt=Ve.c,Ze=Ve.n,Xe=Ee(Qe),st=Xe.c,lt=Xe.n,Ke=new l(19),We=0;We<rt.length;++We)++Ke[31&rt[We]];for(We=0;We<st.length;++We)++Ke[31&st[We]];for(var $e=ce(Ke,7),Je=$e.t,Nt=$e.l,dt=19;dt>4&&!Je[_[dt-1]];--dt);var yt,ot,It,wt,_t=Ie+5<<3,Wt=he(ue,D)+he(pe,q)+ve,Mt=he(ue,Fe)+he(pe,Qe)+ve+14+3*dt+he(Ke,Je)+2*Ke[16]+3*Ke[17]+7*Ke[18];if(Le>=0&&_t<=Wt&&_t<=Mt)return ge(w,De,b.subarray(Le,Le+Ie));if(se(w,De,1+(Mt<Wt)),De+=2,Mt<Wt){yt=L(Fe,Ye,0),ot=Fe,It=L(Qe,Ge,0),wt=Qe;var Cr=L(Je,Nt,0);for(se(w,De,Ze-257),se(w,De+5,lt-1),se(w,De+10,dt-4),De+=14,We=0;We<dt;++We)se(w,De+3*We,Je[_[We]]);De+=3*dt;for(var dn=[rt,st],Bn=0;Bn<2;++Bn){var rn=dn[Bn];for(We=0;We<rn.length;++We){var pn=31&rn[We];se(w,De,Cr[pn]),De+=Je[pn],pn>15&&(se(w,De,rn[We]>>5&127),De+=rn[We]>>12)}}}else yt=Y,ot=D,It=W,wt=q;for(We=0;We<ye;++We){var Ct=K[We];if(Ct>255){fe(w,De,yt[257+(pn=Ct>>18&31)]),De+=ot[pn+257],pn>7&&(se(w,De,Ct>>23&31),De+=f[pn]);var Dn=31&Ct;fe(w,De,It[Dn]),De+=wt[Dn],Dn>3&&(fe(w,De,Ct>>5&8191),De+=p[Dn])}else fe(w,De,yt[Ct]),De+=ot[Ct]}return fe(w,De,yt[256]),De+ot[256]},ae=new d([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ee=new u(0),Re=function(b,w,G,K,ue,pe){var ve=pe.z||b.length,ye=new u(K+ve+5*(1+Math.ceil(ve/7e3))+ue),Le=ye.subarray(K,ye.length-ue),Ie=pe.l,De=7&(pe.r||0);if(w){De&&(Le[0]=pe.r>>3);for(var be=ae[w-1],Fe=be>>13,Ye=8191&be,ze=(1<<G)-1,Qe=pe.p||new l(32768),Ge=pe.h||new l(ze+1),Ve=Math.ceil(G/3),rt=2*Ve,Ze=function(Yr){return(b[Yr]^b[Yr+1]<<Ve^b[Yr+2]<<rt)&ze},Xe=new d(25e3),st=new l(288),lt=new l(32),Ke=0,We=0,$e=pe.i||0,Je=0,Nt=pe.w||0,dt=0;$e+2<ve;++$e){var yt=Ze($e),ot=32767&$e,It=Ge[yt];if(Qe[ot]=It,Ge[yt]=ot,Nt<=$e){var wt=ve-$e;if((Ke>7e3||Je>24576)&&(wt>423||!Ie)){De=X(b,Le,0,Xe,st,lt,We,Je,dt,$e-dt,De),Je=Ke=We=0,dt=$e;for(var _t=0;_t<286;++_t)st[_t]=0;for(_t=0;_t<30;++_t)lt[_t]=0}var Wt=2,Mt=0,Cr=Ye,dn=ot-It&32767;if(wt>2&&yt==Ze($e-dn))for(var Bn=Math.min(Fe,wt)-1,rn=Math.min(32767,$e),pn=Math.min(258,wt);dn<=rn&&--Cr&&ot!=It;){if(b[$e+Wt]==b[$e+Wt-dn]){for(var Ct=0;Ct<pn&&b[$e+Ct]==b[$e+Ct-dn];++Ct);if(Ct>Wt){if(Wt=Ct,Mt=dn,Ct>Bn)break;var Dn=Math.min(dn,Ct-2),Vr=0;for(_t=0;_t<Dn;++_t){var jr=$e-dn+_t&32767,Os=jr-Qe[jr]&32767;Os>Vr&&(Vr=Os,It=jr)}}}dn+=(ot=It)-(It=Qe[ot])&32767}if(Mt){Xe[Je++]=268435456|m[Wt]<<18|E[Mt];var Pi=31&m[Wt],As=31&E[Mt];We+=f[Pi]+p[As],++st[257+Pi],++lt[As],Nt=$e+Wt,++Ke}else Xe[Je++]=b[$e],++st[b[$e]]}}for($e=Math.max($e,Nt);$e<ve;++$e)Xe[Je++]=b[$e],++st[b[$e]];De=X(b,Le,Ie,Xe,st,lt,We,Je,dt,$e-dt,De),Ie||(pe.r=7&De|Le[De/8|0]<<3,De-=7,pe.h=Ge,pe.p=Qe,pe.i=$e,pe.w=Nt)}else{for($e=pe.w||0;$e<ve+Ie;$e+=65535){var Hr=$e+65535;Hr>=ve&&(Le[De/8|0]=Ie,Hr=ve),De=ge(Le,De+1,b.subarray($e,Hr))}pe.i=ve}return R(ye,0,K+$(De)+ue)},me=function(){for(var b=new Int32Array(256),w=0;w<256;++w){for(var G=w,K=9;--K;)G=(1&G&&-306674912)^G>>>1;b[w]=G}return b}(),Pe=function(){var b=-1;return{p:function(w){for(var G=b,K=0;K<w.length;++K)G=me[255&G^w[K]]^G>>>8;b=G},d:function(){return~b}}},H=function(){var b=1,w=0;return{p:function(G){for(var K=b,ue=w,pe=0|G.length,ve=0;ve!=pe;){for(var ye=Math.min(ve+2655,pe);ve<ye;++ve)ue+=K+=G[ve];K=(65535&K)+15*(K>>16),ue=(65535&ue)+15*(ue>>16)}b=K,w=ue},d:function(){return(255&(b%=65521))<<24|(65280&b)<<8|(255&(w%=65521))<<8|w>>8}}},Z=function(b,w,G,K,ue){if(!ue&&(ue={l:1},w.dictionary)){var pe=w.dictionary.subarray(-32768),ve=new u(pe.length+b.length);ve.set(pe),ve.set(b,pe.length),b=ve,ue.w=pe.length}return Re(b,w.level==null?6:w.level,w.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(b.length)))):12+w.mem,G,K,ue)},te=function(b,w){var G={};for(var K in b)G[K]=b[K];for(var K in w)G[K]=w[K];return G},ie=function(b,w,G){for(var K=b(),ue=b.toString(),pe=ue.slice(ue.indexOf("[")+1,ue.lastIndexOf("]")).replace(/\s+/g,"").split(","),ve=0;ve<K.length;++ve){var ye=K[ve],Le=pe[ve];if(typeof ye=="function"){w+=";"+Le+"=";var Ie=ye.toString();if(ye.prototype)if(Ie.indexOf("[native code]")!=-1){var De=Ie.indexOf(" ",8)+1;w+=Ie.slice(De,Ie.indexOf("(",De))}else for(var be in w+=Ie,ye.prototype)w+=";"+Le+".prototype."+be+"="+ye.prototype[be].toString();else w+=Ie}else G[Le]=ye}return w},j=[],Oe=function(b,w,G,K){if(!j[G]){for(var ue="",pe={},ve=b.length-1,ye=0;ye<ve;++ye)ue=ie(b[ye],ue,pe);j[G]={c:ie(b[ve],ue,pe),e:pe}}var Le=te({},j[G].e);return a(j[G].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+w.toString()+"}",G,Le,function(Ie){var De=[];for(var be in Ie)Ie[be].buffer&&De.push((Ie[be]=new Ie[be].constructor(Ie[be])).buffer);return De}(Le),K)},v=function(){return[u,l,d,f,p,_,g,y,Q,x,I,B,L,k,J,F,$,R,M,re,In,ne,de]},P=function(){return[u,l,d,f,p,_,m,E,Y,D,W,q,I,ae,ee,L,se,fe,ce,Te,Ee,he,ge,X,$,R,Re,Z,$t,ne]},O=function(){return[ct,et,Be,Pe,me]},U=function(){return[Gt,Ne]},V=function(){return[xe,Be,H]},z=function(){return[He]},ne=function(b){return postMessage(b,[b.buffer])},de=function(b){return b&&{out:b.size&&new u(b.size),dictionary:b.dictionary}},_e=function(b,w,G,K,ue,pe){var ve=Oe(G,K,ue,function(ye,Le){ve.terminate(),pe(ye,Le)});return ve.postMessage([b,w],w.consume?[b.buffer]:[]),function(){ve.terminate()}},we=function(b){return b.ondata=function(w,G){return postMessage([w,G],[w.buffer])},function(w){return b.push(w.data[0],w.data[1])}},oe=function(b,w,G,K,ue,pe){var ve,ye=Oe(b,K,ue,function(Le,Ie){Le?(ye.terminate(),w.ondata.call(w,Le)):Array.isArray(Ie)?(Ie[1]&&ye.terminate(),w.ondata.call(w,Le,Ie[0],Ie[1])):pe(Ie)});ye.postMessage(G),w.push=function(Le,Ie){w.ondata||M(5),ve&&w.ondata(M(4,0,1),null,!!Ie),ye.postMessage([Le,ve=Ie],[Le.buffer])},w.terminate=function(){ye.terminate()}},Se=function(b,w){return b[w]|b[w+1]<<8},Ce=function(b,w){return(b[w]|b[w+1]<<8|b[w+2]<<16|b[w+3]<<24)>>>0},je=function(b,w){return Ce(b,w)+4294967296*Ce(b,w+4)},Be=function(b,w,G){for(;G;++w)b[w]=G,G>>>=8},ct=function(b,w){var G=w.filename;if(b[0]=31,b[1]=139,b[2]=8,b[8]=w.level<2?4:w.level==9?2:0,b[9]=3,w.mtime!=0&&Be(b,4,Math.floor(new Date(w.mtime||Date.now())/1e3)),G){b[3]=8;for(var K=0;K<=G.length;++K)b[K+10]=G.charCodeAt(K)}},Gt=function(b){b[0]==31&&b[1]==139&&b[2]==8||M(6,"invalid gzip data");var w=b[3],G=10;4&w&&(G+=2+(b[10]|b[11]<<8));for(var K=(w>>3&1)+(w>>4&1);K>0;K-=!b[G++]);return G+(2&w)},Ne=function(b){var w=b.length;return(b[w-4]|b[w-3]<<8|b[w-2]<<16|b[w-1]<<24)>>>0},et=function(b){return 10+(b.filename?b.filename.length+1:0)},xe=function(b,w){var G=w.level,K=G==0?0:G<6?1:G==9?3:2;if(b[0]=120,b[1]=K<<6|(w.dictionary&&32),b[1]|=31-(b[0]<<8|b[1])%31,w.dictionary){var ue=H();ue.p(w.dictionary),Be(b,2,ue.d())}},He=function(b,w){return((15&b[0])!=8||b[0]>>4>7||(b[0]<<8|b[1])%31)&&M(6,"invalid zlib data"),(b[1]>>5&1)==+!w&&M(6,"invalid zlib data: "+(32&b[1]?"need":"unexpected")+" dictionary"),2+(b[1]>>3&4)};function at(b,w){return typeof b=="function"&&(w=b,b={}),this.ondata=w,b}var Ue=function(){function b(w,G){if(typeof w=="function"&&(G=w,w={}),this.ondata=G,this.o=w||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new u(98304),this.o.dictionary){var K=this.o.dictionary.subarray(-32768);this.b.set(K,32768-K.length),this.s.i=32768-K.length}}return b.prototype.p=function(w,G){this.ondata(Z(w,this.o,0,0,this.s),G)},b.prototype.push=function(w,G){this.ondata||M(5),this.s.l&&M(4);var K=w.length+this.s.z;if(K>this.b.length){if(K>2*this.b.length-32768){var ue=new u(-32768&K);ue.set(this.b.subarray(0,this.s.z)),this.b=ue}var pe=this.b.length-this.s.z;pe&&(this.b.set(w.subarray(0,pe),this.s.z),this.s.z=this.b.length,this.p(this.b,!1)),this.b.set(this.b.subarray(-32768)),this.b.set(w.subarray(pe),32768),this.s.z=w.length-pe+32768,this.s.i=32766,this.s.w=32768}else this.b.set(w,this.s.z),this.s.z+=w.length;this.s.l=1&G,(this.s.z>this.s.w+8191||G)&&(this.p(this.b,G||!1),this.s.w=this.s.i,this.s.i-=2)},b}();h.Deflate=Ue;var At=function(){return function(b,w){oe([P,function(){return[we,Ue]}],this,at.call(this,b,w),function(G){var K=new Ue(G.data);onmessage=we(K)},6)}}();function qe(b,w,G){return G||(G=w,w={}),typeof G!="function"&&M(7),_e(b,w,[P],function(K){return ne($t(K.data[0],K.data[1]))},0,G)}function $t(b,w){return Z(b,w||{},0,0)}h.AsyncDeflate=At,h.deflate=qe,h.deflateSync=$t;var Tt=function(){function b(w,G){typeof w=="function"&&(G=w,w={}),this.ondata=G;var K=w&&w.dictionary&&w.dictionary.subarray(-32768);this.s={i:0,b:K?K.length:0},this.o=new u(32768),this.p=new u(0),K&&this.o.set(K)}return b.prototype.e=function(w){if(this.ondata||M(5),this.d&&M(4),this.p.length){if(w.length){var G=new u(this.p.length+w.length);G.set(this.p),G.set(w,this.p.length),this.p=G}}else this.p=w},b.prototype.c=function(w){this.s.i=+(this.d=w||!1);var G=this.s.b,K=re(this.p,this.s,this.o);this.ondata(R(K,G,this.s.b),this.d),this.o=R(K,this.s.b-32768),this.s.b=this.o.length,this.p=R(this.p,this.s.p/8|0),this.s.p&=7},b.prototype.push=function(w,G){this.e(w),this.c(G)},b}();h.Inflate=Tt;var nn=function(){return function(b,w){oe([v,function(){return[we,Tt]}],this,at.call(this,b,w),function(G){var K=new Tt(G.data);onmessage=we(K)},7)}}();function hn(b,w,G){return G||(G=w,w={}),typeof G!="function"&&M(7),_e(b,w,[v],function(K){return ne(In(K.data[0],de(K.data[1])))},1,G)}function In(b,w){return re(b,{i:2},w&&w.out,w&&w.dictionary)}h.AsyncInflate=nn,h.inflate=hn,h.inflateSync=In;var Gr=function(){function b(w,G){this.c=Pe(),this.l=0,this.v=1,Ue.call(this,w,G)}return b.prototype.push=function(w,G){this.c.p(w),this.l+=w.length,Ue.prototype.push.call(this,w,G)},b.prototype.p=function(w,G){var K=Z(w,this.o,this.v&&et(this.o),G&&8,this.s);this.v&&(ct(K,this.o),this.v=0),G&&(Be(K,K.length-8,this.c.d()),Be(K,K.length-4,this.l)),this.ondata(K,G)},b}();h.Gzip=Gr,h.Compress=Gr;var $r=function(){return function(b,w){oe([P,O,function(){return[we,Ue,Gr]}],this,at.call(this,b,w),function(G){var K=new Gr(G.data);onmessage=we(K)},8)}}();function Wr(b,w,G){return G||(G=w,w={}),typeof G!="function"&&M(7),_e(b,w,[P,O,function(){return[Ri]}],function(K){return ne(Ri(K.data[0],K.data[1]))},2,G)}function Ri(b,w){w||(w={});var G=Pe(),K=b.length;G.p(b);var ue=Z(b,w,et(w),8),pe=ue.length;return ct(ue,w),Be(ue,pe-8,G.d()),Be(ue,pe-4,K),ue}h.AsyncGzip=$r,h.AsyncCompress=$r,h.gzip=Wr,h.compress=Wr,h.gzipSync=Ri,h.compressSync=Ri;var vi=function(){function b(w,G){this.v=1,this.r=0,Tt.call(this,w,G)}return b.prototype.push=function(w,G){if(Tt.prototype.e.call(this,w),this.r+=w.length,this.v){var K=this.p.subarray(this.v-1),ue=K.length>3?Gt(K):4;if(ue>K.length){if(!G)return}else this.v>1&&this.onmember&&this.onmember(this.r-K.length);this.p=K.subarray(ue),this.v=0}Tt.prototype.c.call(this,G),this.s.f&&!this.s.l&&(this.v=$(this.s.p)+9,this.s={i:0},this.o=new u(0),this.p.length&&this.push(new u(0),G))},b}();h.Gunzip=vi;var Qu=function(){return function(b,w){var G=this;oe([v,U,function(){return[we,Tt,vi]}],this,at.call(this,b,w),function(K){var ue=new vi(K.data);ue.onmember=function(pe){return postMessage(pe)},onmessage=we(ue)},9,function(K){return G.onmember&&G.onmember(K)})}}();function Ku(b,w,G){return G||(G=w,w={}),typeof G!="function"&&M(7),_e(b,w,[v,U,function(){return[Ni]}],function(K){return ne(Ni(K.data[0],K.data[1]))},3,G)}function Ni(b,w){var G=Gt(b);return G+8>b.length&&M(6,"invalid gzip data"),re(b.subarray(G,-8),{i:2},w&&w.out||new u(Ne(b)),w&&w.dictionary)}h.AsyncGunzip=Qu,h.gunzip=Ku,h.gunzipSync=Ni;var la=function(){function b(w,G){this.c=H(),this.v=1,Ue.call(this,w,G)}return b.prototype.push=function(w,G){this.c.p(w),Ue.prototype.push.call(this,w,G)},b.prototype.p=function(w,G){var K=Z(w,this.o,this.v&&(this.o.dictionary?6:2),G&&4,this.s);this.v&&(xe(K,this.o),this.v=0),G&&Be(K,K.length-4,this.c.d()),this.ondata(K,G)},b}();h.Zlib=la;var vf=function(){return function(b,w){oe([P,V,function(){return[we,Ue,la]}],this,at.call(this,b,w),function(G){var K=new la(G.data);onmessage=we(K)},10)}}();function ua(b,w){w||(w={});var G=H();G.p(b);var K=Z(b,w,w.dictionary?6:2,4);return xe(K,w),Be(K,K.length-4,G.d()),K}h.AsyncZlib=vf,h.zlib=function(b,w,G){return G||(G=w,w={}),typeof G!="function"&&M(7),_e(b,w,[P,V,function(){return[ua]}],function(K){return ne(ua(K.data[0],K.data[1]))},4,G)},h.zlibSync=ua;var Oi=function(){function b(w,G){Tt.call(this,w,G),this.v=w&&w.dictionary?2:1}return b.prototype.push=function(w,G){if(Tt.prototype.e.call(this,w),this.v){if(this.p.length<6&&!G)return;this.p=this.p.subarray(He(this.p,this.v-1)),this.v=0}G&&(this.p.length<4&&M(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),Tt.prototype.c.call(this,G)},b}();h.Unzlib=Oi;var Xu=function(){return function(b,w){oe([v,z,function(){return[we,Tt,Oi]}],this,at.call(this,b,w),function(G){var K=new Oi(G.data);onmessage=we(K)},11)}}();function Ju(b,w,G){return G||(G=w,w={}),typeof G!="function"&&M(7),_e(b,w,[v,z,function(){return[Ai]}],function(K){return ne(Ai(K.data[0],de(K.data[1])))},5,G)}function Ai(b,w){return re(b.subarray(He(b,w&&w.dictionary),-4),{i:2},w&&w.out,w&&w.dictionary)}h.AsyncUnzlib=Xu,h.unzlib=Ju,h.unzlibSync=Ai;var ca=function(){function b(w,G){this.G=vi,this.I=Tt,this.Z=Oi,this.o=at.call(this,w,G)||{}}return b.prototype.push=function(w,G){if(this.ondata||M(5),this.s)this.s.push(w,G);else{if(this.p&&this.p.length){var K=new u(this.p.length+w.length);K.set(this.p),K.set(w,this.p.length)}else this.p=w;if(this.p.length>2){var ue=this,pe=function(){ue.ondata.apply(ue,arguments)};this.s=this.p[0]==31&&this.p[1]==139&&this.p[2]==8?new this.G(this.o,pe):(15&this.p[0])!=8||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(this.o,pe):new this.Z(this.o,pe),this.s.push(this.p,G),this.p=null}}},b}();h.Decompress=ca;var Nf=function(){function b(w,G){this.G=Qu,this.I=nn,this.Z=Xu,ca.call(this,w,G)}return b.prototype.push=function(w,G){ca.prototype.push.call(this,w,G)},b}();h.AsyncDecompress=Nf,h.decompress=function(b,w,G){return G||(G=w,w={}),typeof G!="function"&&M(7),b[0]==31&&b[1]==139&&b[2]==8?Ku(b,w,G):(15&b[0])!=8||b[0]>>4>7||(b[0]<<8|b[1])%31?hn(b,w,G):Ju(b,w,G)},h.decompressSync=function(b,w){return b[0]==31&&b[1]==139&&b[2]==8?Ni(b,w):(15&b[0])!=8||b[0]>>4>7||(b[0]<<8|b[1])%31?In(b,w):Ai(b,w)};var ha=function(b,w,G,K){for(var ue in b){var pe=b[ue],ve=w+ue,ye=K;Array.isArray(pe)&&(ye=te(K,pe[1]),pe=pe[0]),pe instanceof u?G[ve]=[pe,ye]:(G[ve+="/"]=[new u(0),ye],ha(pe,ve,G,K))}},Zu=typeof TextEncoder<"u"&&new TextEncoder,da=typeof TextDecoder<"u"&&new TextDecoder,ec=0;try{da.decode(ee,{stream:!0}),ec=1}catch{}var tc=function(b){for(var w="",G=0;;){var K=b[G++],ue=(K>127)+(K>223)+(K>239);if(G+ue>b.length)return{s:w,r:R(b,G-1)};ue?ue==3?(K=((15&K)<<18|(63&b[G++])<<12|(63&b[G++])<<6|63&b[G++])-65536,w+=String.fromCharCode(55296|K>>10,56320|1023&K)):w+=1&ue?String.fromCharCode((31&K)<<6|63&b[G++]):String.fromCharCode((15&K)<<12|(63&b[G++])<<6|63&b[G++]):w+=String.fromCharCode(K)}},Of=function(){function b(w){this.ondata=w,ec?this.t=new TextDecoder:this.p=ee}return b.prototype.push=function(w,G){if(this.ondata||M(5),G=!!G,this.t)return this.ondata(this.t.decode(w,{stream:!0}),G),void(G&&(this.t.decode().length&&M(8),this.t=null));this.p||M(4);var K=new u(this.p.length+w.length);K.set(this.p),K.set(w,this.p.length);var ue=tc(K),pe=ue.s,ve=ue.r;G?(ve.length&&M(8),this.p=null):this.p=ve,this.ondata(pe,G)},b}();h.DecodeUTF8=Of;var Af=function(){function b(w){this.ondata=w}return b.prototype.push=function(w,G){this.ondata||M(5),this.d&&M(4),this.ondata(Xn(w),this.d=G||!1)},b}();function Xn(b,w){if(w){for(var G=new u(b.length),K=0;K<b.length;++K)G[K]=b.charCodeAt(K);return G}if(Zu)return Zu.encode(b);var ue=b.length,pe=new u(b.length+(b.length>>1)),ve=0,ye=function(De){pe[ve++]=De};for(K=0;K<ue;++K){if(ve+5>pe.length){var Le=new u(ve+8+(ue-K<<1));Le.set(pe),pe=Le}var Ie=b.charCodeAt(K);Ie<128||w?ye(Ie):Ie<2048?(ye(192|Ie>>6),ye(128|63&Ie)):Ie>55295&&Ie<57344?(ye(240|(Ie=65536+(1047552&Ie)|1023&b.charCodeAt(++K))>>18),ye(128|Ie>>12&63),ye(128|Ie>>6&63),ye(128|63&Ie)):(ye(224|Ie>>12),ye(128|Ie>>6&63),ye(128|63&Ie))}return R(pe,0,ve)}function pa(b,w){if(w){for(var G="",K=0;K<b.length;K+=16384)G+=String.fromCharCode.apply(null,b.subarray(K,K+16384));return G}if(da)return da.decode(b);var ue=tc(b),pe=ue.s;return(G=ue.r).length&&M(8),pe}h.EncodeUTF8=Af,h.strToU8=Xn,h.strFromU8=pa;var nc=function(b){return b==1?3:b<6?2:b==9?1:0},rc=function(b,w){return w+30+Se(b,w+26)+Se(b,w+28)},sc=function(b,w,G){var K=Se(b,w+28),ue=pa(b.subarray(w+46,w+46+K),!(2048&Se(b,w+8))),pe=w+46+K,ve=Ce(b,w+20),ye=G&&ve==4294967295?ic(b,pe):[ve,Ce(b,w+24),Ce(b,w+42)],Le=ye[0],Ie=ye[1],De=ye[2];return[Se(b,w+10),Le,Ie,ue,pe+Se(b,w+30)+Se(b,w+32),De]},ic=function(b,w){for(;Se(b,w)!=1;w+=4+Se(b,w+2));return[je(b,w+12),je(b,w+4),je(b,w+20)]},Jn=function(b){var w=0;if(b)for(var G in b){var K=b[G].length;K>65535&&M(9),w+=K+4}return w},qr=function(b,w,G,K,ue,pe,ve,ye){var Le=K.length,Ie=G.extra,De=ye&&ye.length,be=Jn(Ie);Be(b,w,ve!=null?33639248:67324752),w+=4,ve!=null&&(b[w++]=20,b[w++]=G.os),b[w]=20,w+=2,b[w++]=G.flag<<1|(pe<0&&8),b[w++]=ue&&8,b[w++]=255&G.compression,b[w++]=G.compression>>8;var Fe=new Date(G.mtime==null?Date.now():G.mtime),Ye=Fe.getFullYear()-1980;if((Ye<0||Ye>119)&&M(10),Be(b,w,Ye<<25|Fe.getMonth()+1<<21|Fe.getDate()<<16|Fe.getHours()<<11|Fe.getMinutes()<<5|Fe.getSeconds()>>1),w+=4,pe!=-1&&(Be(b,w,G.crc),Be(b,w+4,pe<0?-pe-2:pe),Be(b,w+8,G.size)),Be(b,w+12,Le),Be(b,w+14,be),w+=16,ve!=null&&(Be(b,w,De),Be(b,w+6,G.attrs),Be(b,w+10,ve),w+=14),b.set(K,w),w+=Le,be)for(var ze in Ie){var Qe=Ie[ze],Ge=Qe.length;Be(b,w,+ze),Be(b,w+2,Ge),b.set(Qe,w+4),w+=4+Ge}return De&&(b.set(ye,w),w+=De),w},fa=function(b,w,G,K,ue){Be(b,w,101010256),Be(b,w+8,G),Be(b,w+10,G),Be(b,w+12,K),Be(b,w+16,ue)},Ns=function(){function b(w){this.filename=w,this.c=Pe(),this.size=0,this.compression=0}return b.prototype.process=function(w,G){this.ondata(null,w,G)},b.prototype.push=function(w,G){this.ondata||M(5),this.c.p(w),this.size+=w.length,G&&(this.crc=this.c.d()),this.process(w,G||!1)},b}();h.ZipPassThrough=Ns;var wf=function(){function b(w,G){var K=this;G||(G={}),Ns.call(this,w),this.d=new Ue(G,function(ue,pe){K.ondata(null,ue,pe)}),this.compression=8,this.flag=nc(G.level)}return b.prototype.process=function(w,G){try{this.d.push(w,G)}catch(K){this.ondata(K,null,G)}},b.prototype.push=function(w,G){Ns.prototype.push.call(this,w,G)},b}();h.ZipDeflate=wf;var Pf=function(){function b(w,G){var K=this;G||(G={}),Ns.call(this,w),this.d=new At(G,function(ue,pe,ve){K.ondata(ue,pe,ve)}),this.compression=8,this.flag=nc(G.level),this.terminate=this.d.terminate}return b.prototype.process=function(w,G){this.d.push(w,G)},b.prototype.push=function(w,G){Ns.prototype.push.call(this,w,G)},b}();h.AsyncZipDeflate=Pf;var Df=function(){function b(w){this.ondata=w,this.u=[],this.d=1}return b.prototype.add=function(w){var G=this;if(this.ondata||M(5),2&this.d)this.ondata(M(4+8*(1&this.d),0,1),null,!1);else{var K=Xn(w.filename),ue=K.length,pe=w.comment,ve=pe&&Xn(pe),ye=ue!=w.filename.length||ve&&pe.length!=ve.length,Le=ue+Jn(w.extra)+30;ue>65535&&this.ondata(M(11,0,1),null,!1);var Ie=new u(Le);qr(Ie,0,w,K,ye,-1);var De=[Ie],be=function(){for(var Ge=0,Ve=De;Ge<Ve.length;Ge++){var rt=Ve[Ge];G.ondata(null,rt,!1)}De=[]},Fe=this.d;this.d=0;var Ye=this.u.length,ze=te(w,{f:K,u:ye,o:ve,t:function(){w.terminate&&w.terminate()},r:function(){if(be(),Fe){var Ge=G.u[Ye+1];Ge?Ge.r():G.d=1}Fe=1}}),Qe=0;w.ondata=function(Ge,Ve,rt){if(Ge)G.ondata(Ge,Ve,rt),G.terminate();else if(Qe+=Ve.length,De.push(Ve),rt){var Ze=new u(16);Be(Ze,0,134695760),Be(Ze,4,w.crc),Be(Ze,8,Qe),Be(Ze,12,w.size),De.push(Ze),ze.c=Qe,ze.b=Le+Qe+16,ze.crc=w.crc,ze.size=w.size,Fe&&ze.r(),Fe=1}else Fe&&be()},this.u.push(ze)}},b.prototype.end=function(){var w=this;2&this.d?this.ondata(M(4+8*(1&this.d),0,1),null,!0):(this.d?this.e():this.u.push({r:function(){1&w.d&&(w.u.splice(-1,1),w.e())},t:function(){}}),this.d=3)},b.prototype.e=function(){for(var w=0,G=0,K=0,ue=0,pe=this.u;ue<pe.length;ue++)K+=46+(Ie=pe[ue]).f.length+Jn(Ie.extra)+(Ie.o?Ie.o.length:0);for(var ve=new u(K+22),ye=0,Le=this.u;ye<Le.length;ye++){var Ie=Le[ye];qr(ve,w,Ie,Ie.f,Ie.u,-Ie.c-2,G,Ie.o),w+=46+Ie.f.length+Jn(Ie.extra)+(Ie.o?Ie.o.length:0),G+=Ie.b}fa(ve,w,this.u.length,K,G),this.ondata(null,ve,!0),this.d=2},b.prototype.terminate=function(){for(var w=0,G=this.u;w<G.length;w++)G[w].t();this.d=2},b}();h.Zip=Df,h.zip=function(b,w,G){G||(G=w,w={}),typeof G!="function"&&M(7);var K={};ha(b,"",K,w);var ue=Object.keys(K),pe=ue.length,ve=0,ye=0,Le=pe,Ie=new Array(pe),De=[],be=function(){for(var Ge=0;Ge<De.length;++Ge)De[Ge]()},Fe=function(Ge,Ve){wi(function(){G(Ge,Ve)})};wi(function(){Fe=G});var Ye=function(){var Ge=new u(ye+22),Ve=ve,rt=ye-ve;ye=0;for(var Ze=0;Ze<Le;++Ze){var Xe=Ie[Ze];try{var st=Xe.c.length;qr(Ge,ye,Xe,Xe.f,Xe.u,st);var lt=30+Xe.f.length+Jn(Xe.extra),Ke=ye+lt;Ge.set(Xe.c,Ke),qr(Ge,ve,Xe,Xe.f,Xe.u,st,ye,Xe.m),ve+=16+lt+(Xe.m?Xe.m.length:0),ye=Ke+st}catch(We){return Fe(We,null)}}fa(Ge,ve,Ie.length,rt,Ve),Fe(null,Ge)};pe||Ye();for(var ze=function(Ge){var Ve=ue[Ge],rt=K[Ve],Ze=rt[0],Xe=rt[1],st=Pe(),lt=Ze.length;st.p(Ze);var Ke=Xn(Ve),We=Ke.length,$e=Xe.comment,Je=$e&&Xn($e),Nt=Je&&Je.length,dt=Jn(Xe.extra),yt=Xe.level==0?0:8,ot=function(It,wt){if(It)be(),Fe(It,null);else{var _t=wt.length;Ie[Ge]=te(Xe,{size:lt,crc:st.d(),c:wt,f:Ke,m:Je,u:We!=Ve.length||Je&&$e.length!=Nt,compression:yt}),ve+=30+We+dt+_t,ye+=76+2*(We+dt)+(Nt||0)+_t,--pe||Ye()}};if(We>65535&&ot(M(11,0,1),null),yt)if(lt<16e4)try{ot(null,$t(Ze,Xe))}catch(It){ot(It,null)}else De.push(qe(Ze,Xe,ot));else ot(null,Ze)},Qe=0;Qe<Le;++Qe)ze(Qe);return be},h.zipSync=function(b,w){w||(w={});var G={},K=[];ha(b,"",G,w);var ue=0,pe=0;for(var ve in G){var ye=G[ve],Le=ye[0],Ie=ye[1],De=Ie.level==0?0:8,be=(Ke=Xn(ve)).length,Fe=Ie.comment,Ye=Fe&&Xn(Fe),ze=Ye&&Ye.length,Qe=Jn(Ie.extra);be>65535&&M(11);var Ge=De?$t(Le,Ie):Le,Ve=Ge.length,rt=Pe();rt.p(Le),K.push(te(Ie,{size:Le.length,crc:rt.d(),c:Ge,f:Ke,m:Ye,u:be!=ve.length||Ye&&Fe.length!=ze,o:ue,compression:De})),ue+=30+be+Qe+Ve,pe+=76+2*(be+Qe)+(ze||0)+Ve}for(var Ze=new u(pe+22),Xe=ue,st=pe-ue,lt=0;lt<K.length;++lt){var Ke=K[lt];qr(Ze,Ke.o,Ke,Ke.f,Ke.u,Ke.c.length);var We=30+Ke.f.length+Jn(Ke.extra);Ze.set(Ke.c,Ke.o+We),qr(Ze,ue,Ke,Ke.f,Ke.u,Ke.c.length,Ke.o,Ke.m),ue+=16+We+(Ke.m?Ke.m.length:0)}return fa(Ze,ue,K.length,st,Xe),Ze};var oc=function(){function b(){}return b.prototype.push=function(w,G){this.ondata(null,w,G)},b.compression=0,b}();h.UnzipPassThrough=oc;var Mf=function(){function b(){var w=this;this.i=new Tt(function(G,K){w.ondata(null,G,K)})}return b.prototype.push=function(w,G){try{this.i.push(w,G)}catch(K){this.ondata(K,null,G)}},b.compression=8,b}();h.UnzipInflate=Mf;var bf=function(){function b(w,G){var K=this;G<32e4?this.i=new Tt(function(ue,pe){K.ondata(null,ue,pe)}):(this.i=new nn(function(ue,pe,ve){K.ondata(ue,pe,ve)}),this.terminate=this.i.terminate)}return b.prototype.push=function(w,G){this.i.terminate&&(w=R(w,0)),this.i.push(w,G)},b.compression=8,b}();h.AsyncUnzipInflate=bf;var Lf=function(){function b(w){this.onfile=w,this.k=[],this.o={0:oc},this.p=ee}return b.prototype.push=function(w,G){var K=this;if(this.onfile||M(5),this.p||M(4),this.c>0){var ue=Math.min(this.c,w.length),pe=w.subarray(0,ue);if(this.c-=ue,this.d?this.d.push(pe,!this.c):this.k[0].push(pe),(w=w.subarray(ue)).length)return this.push(w,G)}else{var ve=0,ye=0,Le=void 0,Ie=void 0;this.p.length?w.length?((Ie=new u(this.p.length+w.length)).set(this.p),Ie.set(w,this.p.length)):Ie=this.p:Ie=w;for(var De=Ie.length,be=this.c,Fe=be&&this.d,Ye=function(){var Ge,Ve=Ce(Ie,ye);if(Ve==67324752){ve=1,Le=ye,ze.d=null,ze.c=0;var rt=Se(Ie,ye+6),Ze=Se(Ie,ye+8),Xe=2048&rt,st=8&rt,lt=Se(Ie,ye+26),Ke=Se(Ie,ye+28);if(De>ye+30+lt+Ke){var We=[];ze.k.unshift(We),ve=2;var $e,Je=Ce(Ie,ye+18),Nt=Ce(Ie,ye+22),dt=pa(Ie.subarray(ye+30,ye+=30+lt),!Xe);Je==4294967295?(Ge=st?[-2]:ic(Ie,ye),Je=Ge[0],Nt=Ge[1]):st&&(Je=-1),ye+=Ke,ze.c=Je;var yt={name:dt,compression:Ze,start:function(){if(yt.ondata||M(5),Je){var ot=K.o[Ze];ot||yt.ondata(M(14,"unknown compression type "+Ze,1),null,!1),($e=Je<0?new ot(dt):new ot(dt,Je,Nt)).ondata=function(Wt,Mt,Cr){yt.ondata(Wt,Mt,Cr)};for(var It=0,wt=We;It<wt.length;It++){var _t=wt[It];$e.push(_t,!1)}K.k[0]==We&&K.c?K.d=$e:$e.push(ee,!0)}else yt.ondata(null,ee,!0)},terminate:function(){$e&&$e.terminate&&$e.terminate()}};Je>=0&&(yt.size=Je,yt.originalSize=Nt),ze.onfile(yt)}return"break"}if(be){if(Ve==134695760)return Le=ye+=12+(be==-2&&8),ve=3,ze.c=0,"break";if(Ve==33639248)return Le=ye-=4,ve=3,ze.c=0,"break"}},ze=this;ye<De-4&&Ye()!=="break";++ye);if(this.p=ee,be<0){var Qe=ve?Ie.subarray(0,Le-12-(be==-2&&8)-(Ce(Ie,Le-16)==134695760&&4)):Ie.subarray(0,ye);Fe?Fe.push(Qe,!!ve):this.k[+(ve==2)].push(Qe)}if(2&ve)return this.push(Ie.subarray(ye),G);this.p=Ie.subarray(ye)}G&&(this.c&&M(13),this.p=null)},b.prototype.register=function(w){this.o[w.compression]=w},b}();h.Unzip=Lf;var wi=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(b){b()};h.unzip=function(b,w,G){G||(G=w,w={}),typeof G!="function"&&M(7);var K=[],ue=function(){for(var Ge=0;Ge<K.length;++Ge)K[Ge]()},pe={},ve=function(Ge,Ve){wi(function(){G(Ge,Ve)})};wi(function(){ve=G});for(var ye=b.length-22;Ce(b,ye)!=101010256;--ye)if(!ye||b.length-ye>65558)return ve(M(13,0,1),null),ue;var Le=Se(b,ye+8);if(Le){var Ie=Le,De=Ce(b,ye+16),be=De==4294967295||Ie==65535;if(be){var Fe=Ce(b,ye-12);(be=Ce(b,Fe)==101075792)&&(Ie=Le=Ce(b,Fe+32),De=Ce(b,Fe+48))}for(var Ye=w&&w.filter,ze=function(Ge){var Ve=sc(b,De,be),rt=Ve[0],Ze=Ve[1],Xe=Ve[2],st=Ve[3],lt=Ve[4],Ke=Ve[5],We=rc(b,Ke);De=lt;var $e=function(Nt,dt){Nt?(ue(),ve(Nt,null)):(dt&&(pe[st]=dt),--Le||ve(null,pe))};if(!Ye||Ye({name:st,size:Ze,originalSize:Xe,compression:rt}))if(rt)if(rt==8){var Je=b.subarray(We,We+Ze);if(Ze<32e4)try{$e(null,In(Je,{out:new u(Xe)}))}catch(Nt){$e(Nt,null)}else K.push(hn(Je,{size:Xe},$e))}else $e(M(14,"unknown compression type "+rt,1),null);else $e(null,R(b,We,We+Ze));else $e(null,null)},Qe=0;Qe<Ie;++Qe)ze()}else ve(null,{});return ue},h.unzipSync=function(b,w){for(var G={},K=b.length-22;Ce(b,K)!=101010256;--K)(!K||b.length-K>65558)&&M(13);var ue=Se(b,K+8);if(!ue)return{};var pe=Ce(b,K+16),ve=pe==4294967295||ue==65535;if(ve){var ye=Ce(b,K-12);(ve=Ce(b,ye)==101075792)&&(ue=Ce(b,ye+32),pe=Ce(b,ye+48))}for(var Le=w&&w.filter,Ie=0;Ie<ue;++Ie){var De=sc(b,pe,ve),be=De[0],Fe=De[1],Ye=De[2],ze=De[3],Qe=De[4],Ge=De[5],Ve=rc(b,Ge);pe=Qe,Le&&!Le({name:ze,size:Fe,originalSize:Ye,compression:be})||(be?be==8?G[ze]=In(b.subarray(Ve,Ve+Fe),{out:new u(Ye)}):M(14,"unknown compression type "+be):G[ze]=R(b,Ve,Ve+Fe))}return G}},5017:(o,h)=>{var r,a=function(u){Object.defineProperty(u,"__esModule",{value:!0}),u.default=void 0;var l=null;try{l=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function d(R,B,M){this.low=0|R,this.high=0|B,this.unsigned=!!M}function f(R){return(R&&R.__isLong__)===!0}function p(R){var B=Math.clz32(R&-R);return R?31-B:B}d.prototype.__isLong__,Object.defineProperty(d.prototype,"__isLong__",{value:!0}),d.isLong=f;var _={},S={};function C(R,B){var M,re,se;return B?(se=0<=(R>>>=0)&&R<256)&&(re=S[R])?re:(M=m(R,0,!0),se&&(S[R]=M),M):(se=-128<=(R|=0)&&R<128)&&(re=_[R])?re:(M=m(R,R<0?-1:0,!1),se&&(_[R]=M),M)}function g(R,B){if(isNaN(R))return B?q:D;if(B){if(R<0)return q;if(R>=N)return k}else{if(R<=-A)return J;if(R+1>=A)return x}return R<0?g(-R,B).neg():m(R%I|0,R/I|0,B)}function m(R,B,M){return new d(R,B,M)}d.fromInt=C,d.fromNumber=g,d.fromBits=m;var T=Math.pow;function y(R,B,M){if(R.length===0)throw Error("empty string");if(typeof B=="number"?(M=B,B=!1):B=!!B,R==="NaN"||R==="Infinity"||R==="+Infinity"||R==="-Infinity")return B?q:D;if((M=M||10)<2||36<M)throw RangeError("radix");var re;if((re=R.indexOf("-"))>0)throw Error("interior hyphen");if(re===0)return y(R.substring(1),B,M).neg();for(var se=g(T(M,8)),fe=D,ce=0;ce<R.length;ce+=8){var Te=Math.min(8,R.length-ce),Ee=parseInt(R.substring(ce,ce+Te),M);if(Te<8){var he=g(T(M,Te));fe=fe.mul(he).add(g(Ee))}else fe=(fe=fe.mul(se)).add(g(Ee))}return fe.unsigned=B,fe}function E(R,B){return typeof R=="number"?g(R,B):typeof R=="string"?y(R,B):m(R.low,R.high,typeof B=="boolean"?B:R.unsigned)}d.fromString=y,d.fromValue=E;var I=4294967296,N=I*I,A=N/2,L=C(1<<24),D=C(0);d.ZERO=D;var q=C(0,!0);d.UZERO=q;var Y=C(1);d.ONE=Y;var Q=C(1,!0);d.UONE=Q;var W=C(-1);d.NEG_ONE=W;var x=m(-1,2147483647,!1);d.MAX_VALUE=x;var k=m(-1,-1,!0);d.MAX_UNSIGNED_VALUE=k;var J=m(0,-2147483648,!1);d.MIN_VALUE=J;var F=d.prototype;F.toInt=function(){return this.unsigned?this.low>>>0:this.low},F.toNumber=function(){return this.unsigned?(this.high>>>0)*I+(this.low>>>0):this.high*I+(this.low>>>0)},F.toString=function(R){if((R=R||10)<2||36<R)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(J)){var B=g(R),M=this.div(B),re=M.mul(B).sub(this);return M.toString(R)+re.toInt().toString(R)}return"-"+this.neg().toString(R)}for(var se=g(T(R,6),this.unsigned),fe=this,ce="";;){var Te=fe.div(se),Ee=(fe.sub(Te.mul(se)).toInt()>>>0).toString(R);if((fe=Te).isZero())return Ee+ce;for(;Ee.length<6;)Ee="0"+Ee;ce=""+Ee+ce}},F.getHighBits=function(){return this.high},F.getHighBitsUnsigned=function(){return this.high>>>0},F.getLowBits=function(){return this.low},F.getLowBitsUnsigned=function(){return this.low>>>0},F.getNumBitsAbs=function(){if(this.isNegative())return this.eq(J)?64:this.neg().getNumBitsAbs();for(var R=this.high!=0?this.high:this.low,B=31;B>0&&!(R&1<<B);B--);return this.high!=0?B+33:B+1},F.isZero=function(){return this.high===0&&this.low===0},F.eqz=F.isZero,F.isNegative=function(){return!this.unsigned&&this.high<0},F.isPositive=function(){return this.unsigned||this.high>=0},F.isOdd=function(){return!(1&~this.low)},F.isEven=function(){return!(1&this.low)},F.equals=function(R){return f(R)||(R=E(R)),(this.unsigned===R.unsigned||this.high>>>31!=1||R.high>>>31!=1)&&this.high===R.high&&this.low===R.low},F.eq=F.equals,F.notEquals=function(R){return!this.eq(R)},F.neq=F.notEquals,F.ne=F.notEquals,F.lessThan=function(R){return this.comp(R)<0},F.lt=F.lessThan,F.lessThanOrEqual=function(R){return this.comp(R)<=0},F.lte=F.lessThanOrEqual,F.le=F.lessThanOrEqual,F.greaterThan=function(R){return this.comp(R)>0},F.gt=F.greaterThan,F.greaterThanOrEqual=function(R){return this.comp(R)>=0},F.gte=F.greaterThanOrEqual,F.ge=F.greaterThanOrEqual,F.compare=function(R){if(f(R)||(R=E(R)),this.eq(R))return 0;var B=this.isNegative(),M=R.isNegative();return B&&!M?-1:!B&&M?1:this.unsigned?R.high>>>0>this.high>>>0||R.high===this.high&&R.low>>>0>this.low>>>0?-1:1:this.sub(R).isNegative()?-1:1},F.comp=F.compare,F.negate=function(){return!this.unsigned&&this.eq(J)?J:this.not().add(Y)},F.neg=F.negate,F.add=function(R){f(R)||(R=E(R));var B=this.high>>>16,M=65535&this.high,re=this.low>>>16,se=65535&this.low,fe=R.high>>>16,ce=65535&R.high,Te=R.low>>>16,Ee=0,he=0,ge=0,X=0;return ge+=(X+=se+(65535&R.low))>>>16,he+=(ge+=re+Te)>>>16,Ee+=(he+=M+ce)>>>16,Ee+=B+fe,m((ge&=65535)<<16|(X&=65535),(Ee&=65535)<<16|(he&=65535),this.unsigned)},F.subtract=function(R){return f(R)||(R=E(R)),this.add(R.neg())},F.sub=F.subtract,F.multiply=function(R){if(this.isZero())return this;if(f(R)||(R=E(R)),l)return m(l.mul(this.low,this.high,R.low,R.high),l.get_high(),this.unsigned);if(R.isZero())return this.unsigned?q:D;if(this.eq(J))return R.isOdd()?J:D;if(R.eq(J))return this.isOdd()?J:D;if(this.isNegative())return R.isNegative()?this.neg().mul(R.neg()):this.neg().mul(R).neg();if(R.isNegative())return this.mul(R.neg()).neg();if(this.lt(L)&&R.lt(L))return g(this.toNumber()*R.toNumber(),this.unsigned);var B=this.high>>>16,M=65535&this.high,re=this.low>>>16,se=65535&this.low,fe=R.high>>>16,ce=65535&R.high,Te=R.low>>>16,Ee=65535&R.low,he=0,ge=0,X=0,ae=0;return X+=(ae+=se*Ee)>>>16,ge+=(X+=re*Ee)>>>16,X&=65535,ge+=(X+=se*Te)>>>16,he+=(ge+=M*Ee)>>>16,ge&=65535,he+=(ge+=re*Te)>>>16,ge&=65535,he+=(ge+=se*ce)>>>16,he+=B*Ee+M*Te+re*ce+se*fe,m((X&=65535)<<16|(ae&=65535),(he&=65535)<<16|(ge&=65535),this.unsigned)},F.mul=F.multiply,F.divide=function(R){if(f(R)||(R=E(R)),R.isZero())throw Error("division by zero");var B,M,re;if(l)return this.unsigned||this.high!==-2147483648||R.low!==-1||R.high!==-1?m((this.unsigned?l.div_u:l.div_s)(this.low,this.high,R.low,R.high),l.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?q:D;if(this.unsigned){if(R.unsigned||(R=R.toUnsigned()),R.gt(this))return q;if(R.gt(this.shru(1)))return Q;re=q}else{if(this.eq(J))return R.eq(Y)||R.eq(W)?J:R.eq(J)?Y:(B=this.shr(1).div(R).shl(1)).eq(D)?R.isNegative()?Y:W:(M=this.sub(R.mul(B)),re=B.add(M.div(R)));if(R.eq(J))return this.unsigned?q:D;if(this.isNegative())return R.isNegative()?this.neg().div(R.neg()):this.neg().div(R).neg();if(R.isNegative())return this.div(R.neg()).neg();re=D}for(M=this;M.gte(R);){B=Math.max(1,Math.floor(M.toNumber()/R.toNumber()));for(var se=Math.ceil(Math.log(B)/Math.LN2),fe=se<=48?1:T(2,se-48),ce=g(B),Te=ce.mul(R);Te.isNegative()||Te.gt(M);)Te=(ce=g(B-=fe,this.unsigned)).mul(R);ce.isZero()&&(ce=Y),re=re.add(ce),M=M.sub(Te)}return re},F.div=F.divide,F.modulo=function(R){return f(R)||(R=E(R)),l?m((this.unsigned?l.rem_u:l.rem_s)(this.low,this.high,R.low,R.high),l.get_high(),this.unsigned):this.sub(this.div(R).mul(R))},F.mod=F.modulo,F.rem=F.modulo,F.not=function(){return m(~this.low,~this.high,this.unsigned)},F.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},F.clz=F.countLeadingZeros,F.countTrailingZeros=function(){return this.low?p(this.low):p(this.high)+32},F.ctz=F.countTrailingZeros,F.and=function(R){return f(R)||(R=E(R)),m(this.low&R.low,this.high&R.high,this.unsigned)},F.or=function(R){return f(R)||(R=E(R)),m(this.low|R.low,this.high|R.high,this.unsigned)},F.xor=function(R){return f(R)||(R=E(R)),m(this.low^R.low,this.high^R.high,this.unsigned)},F.shiftLeft=function(R){return f(R)&&(R=R.toInt()),(R&=63)==0?this:R<32?m(this.low<<R,this.high<<R|this.low>>>32-R,this.unsigned):m(0,this.low<<R-32,this.unsigned)},F.shl=F.shiftLeft,F.shiftRight=function(R){return f(R)&&(R=R.toInt()),(R&=63)==0?this:R<32?m(this.low>>>R|this.high<<32-R,this.high>>R,this.unsigned):m(this.high>>R-32,this.high>=0?0:-1,this.unsigned)},F.shr=F.shiftRight,F.shiftRightUnsigned=function(R){return f(R)&&(R=R.toInt()),(R&=63)==0?this:R<32?m(this.low>>>R|this.high<<32-R,this.high>>>R,this.unsigned):m(R===32?this.high:this.high>>>R-32,0,this.unsigned)},F.shru=F.shiftRightUnsigned,F.shr_u=F.shiftRightUnsigned,F.rotateLeft=function(R){var B;return f(R)&&(R=R.toInt()),(R&=63)==0?this:R===32?m(this.high,this.low,this.unsigned):R<32?(B=32-R,m(this.low<<R|this.high>>>B,this.high<<R|this.low>>>B,this.unsigned)):(B=32-(R-=32),m(this.high<<R|this.low>>>B,this.low<<R|this.high>>>B,this.unsigned))},F.rotl=F.rotateLeft,F.rotateRight=function(R){var B;return f(R)&&(R=R.toInt()),(R&=63)==0?this:R===32?m(this.high,this.low,this.unsigned):R<32?(B=32-R,m(this.high<<B|this.low>>>R,this.low<<B|this.high>>>R,this.unsigned)):(B=32-(R-=32),m(this.low<<B|this.high>>>R,this.high<<B|this.low>>>R,this.unsigned))},F.rotr=F.rotateRight,F.toSigned=function(){return this.unsigned?m(this.low,this.high,!1):this},F.toUnsigned=function(){return this.unsigned?this:m(this.low,this.high,!0)},F.toBytes=function(R){return R?this.toBytesLE():this.toBytesBE()},F.toBytesLE=function(){var R=this.high,B=this.low;return[255&B,B>>>8&255,B>>>16&255,B>>>24,255&R,R>>>8&255,R>>>16&255,R>>>24]},F.toBytesBE=function(){var R=this.high,B=this.low;return[R>>>24,R>>>16&255,R>>>8&255,255&R,B>>>24,B>>>16&255,B>>>8&255,255&B]},d.fromBytes=function(R,B,M){return M?d.fromBytesLE(R,B):d.fromBytesBE(R,B)},d.fromBytesLE=function(R,B){return new d(R[0]|R[1]<<8|R[2]<<16|R[3]<<24,R[4]|R[5]<<8|R[6]<<16|R[7]<<24,B)},d.fromBytesBE=function(R,B){return new d(R[4]<<24|R[5]<<16|R[6]<<8|R[7],R[0]<<24|R[1]<<16|R[2]<<8|R[3],B)};var $=d;return u.default=$,"default"in u?u.default:u}({});(r=(function(){return a}).apply(h,[]))===void 0||(o.exports=r)}},s={};function c(o){var h=s[o];if(h!==void 0)return h.exports;var r=s[o]={exports:{}};return n[o].call(r.exports,r,r.exports,c),r.exports}return c.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),c(5237)})())})(uf);var wE=uf.exports;const fn=bh(wE);function cf(e,t,n){console.log("EDE Processing message:",e,t,n);let s;if(e.includes("orchestrator/reinvokeModel"))s="orchestratorReinvoke";else if(e.includes("solace-agent-mesh/v1/stimulus/"))s="stimulus";else if(e.includes("solace-agent-mesh/v1/response/"))s="response";else if(e.includes("solace-agent-mesh/v1/streamingResponse/"))s="streamingResponse";else if(e.includes("solace-agent-mesh/v1/responseComplete/"))s="responseComplete";else if(e.includes("solace-agent-mesh/v1/actionRequest/"))s="actionRequest";else if(e.includes("solace-agent-mesh/v1/actionResponse/"))s="actionResponse";else if(e.includes("solace-agent-mesh/v1/register/agent/"))s="registration";else if(e.includes("solace-agent-mesh/v1/llm-service/request/"))s="llmServiceRequest";else if(e.includes("solace-agent-mesh/v1/llm-service/response/"))s="llmServiceResponse";else return console.warn("Unknown message type for topic:",e),null;const c=n.stimulus_uuid;let o=null;if(n.__solace_ai_connector_broker_request_reply_metadata__)try{o=JSON.parse(n.__solace_ai_connector_broker_request_reply_metadata__._value||n.__solace_ai_connector_broker_request_reply_metadata__)}catch(h){console.warn("Failed to parse broker request reply metadata:",h)}return{type:s,content:t,userProperties:n,stimulus_uuid:c,timestamp:new Date().toISOString(),broker_request_reply:o}}function PE(e){return{type:"capability",content:e,timestamp:new Date().toISOString()}}const hf=new fn.SolclientFactoryProperties;hf.profile=fn.SolclientFactoryProfiles.version10_5;fn.SolclientFactory.init(hf);fn.SolclientFactory.setLogLevel(fn.LogLevel.DEBUG);class DE{constructor(){this.session=null,this.messageCallback=null,this.capabilityCallback=null,this.registrationCallback=null}async connect(t){try{fn.SolclientFactory.init();const n=new fn.SessionProperties({url:t.url,vpnName:t.vpnName,userName:t.userName,password:t.password});this.session=fn.SolclientFactory.createSession(n),this.session.on(fn.SessionEventCode.UP_NOTICE,()=>{let s=t.namespace||"";s=s.endsWith("/")?s:`${s}/`,[`${s}solace-agent-mesh/v1/register/>`,`${s}solace-agent-mesh/v1/stimulus/>`,`${s}solace-agent-mesh/v1/response/>`,`${s}solace-agent-mesh/v1/streamingResponse/>`,`${s}solace-agent-mesh/v1/responseComplete/>`,`${s}solace-agent-mesh/v1/actionRequest/>`,`${s}solace-agent-mesh/v1/actionResponse/>`,`${s}solace-agent-mesh/v1/orchestrator/reinvoke/>`,`${s}solace-agent-mesh/v1/llm-service/request/>`,`${s}solace-agent-mesh/v1/llm-service/response/>`].forEach(o=>{try{this.session.subscribe(fn.SolclientFactory.createTopicDestination(o),!0,o,1e4)}catch(h){console.error("Error subscribing to topic:",o,h)}})}),this.session.on(fn.SessionEventCode.CONNECT_FAILED_ERROR,s=>{console.error("Solace connection failed:",s.infoStr)}),this.session.connect()}catch(n){throw console.error("Error creating Solace session:",n),n}this.session.on(fn.SessionEventCode.MESSAGE,n=>{const s=n.getDestination().getName(),c=JSON.parse(n.getBinaryAttachment()),o={},h=n.getUserPropertyMap();if(h&&h.getKeys().forEach(r=>{o[r]=h.getField(r)}),console.log("EDE Processing message:",s,c,o),this.messageCallback){const r=cf(s,c,o);r&&this.messageCallback(r)}})}setMessageCallback(t){this.messageCallback=t}subscribeToCapabilities(t){this.capabilityCallback=t}unsubscribeFromCapabilities(){this.capabilityCallback=null}disconnect(){this.session&&(this.session.disconnect(),this.session=null)}}const kn=Object.create(null);kn.open="0";kn.close="1";kn.ping="2";kn.pong="3";kn.message="4";kn.upgrade="5";kn.noop="6";const lo=Object.create(null);Object.keys(kn).forEach(e=>{lo[kn[e]]=e});const ql={type:"error",data:"parser error"},df=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",pf=typeof ArrayBuffer=="function",ff=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Vu=({type:e,data:t},n,s)=>df&&t instanceof Blob?n?s(t):Oh(t,s):pf&&(t instanceof ArrayBuffer||ff(t))?n?s(t):Oh(new Blob([t]),s):s(kn[e]+(t||"")),Oh=(e,t)=>{const n=new FileReader;return n.onload=function(){const s=n.result.split(",")[1];t("b"+(s||""))},n.readAsDataURL(e)};function Ah(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Wa;function ME(e,t){if(df&&e.data instanceof Blob)return e.data.arrayBuffer().then(Ah).then(t);if(pf&&(e.data instanceof ArrayBuffer||ff(e.data)))return t(Ah(e.data));Vu(e,!1,n=>{Wa||(Wa=new TextEncoder),t(Wa.encode(n))})}const wh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ws=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<wh.length;e++)Ws[wh.charCodeAt(e)]=e;const bE=e=>{let t=e.length*.75,n=e.length,s,c=0,o,h,r,a;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),l=new Uint8Array(u);for(s=0;s<n;s+=4)o=Ws[e.charCodeAt(s)],h=Ws[e.charCodeAt(s+1)],r=Ws[e.charCodeAt(s+2)],a=Ws[e.charCodeAt(s+3)],l[c++]=o<<2|h>>4,l[c++]=(h&15)<<4|r>>2,l[c++]=(r&3)<<6|a&63;return u},LE=typeof ArrayBuffer=="function",ju=(e,t)=>{if(typeof e!="string")return{type:"message",data:_f(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:UE(e.substring(1),t)}:lo[n]?e.length>1?{type:lo[n],data:e.substring(1)}:{type:lo[n]}:ql},UE=(e,t)=>{if(LE){const n=bE(e);return _f(n,t)}else return{base64:!0,data:e}},_f=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},gf="",xE=(e,t)=>{const n=e.length,s=new Array(n);let c=0;e.forEach((o,h)=>{Vu(o,!1,r=>{s[h]=r,++c===n&&t(s.join(gf))})})},FE=(e,t)=>{const n=e.split(gf),s=[];for(let c=0;c<n.length;c++){const o=ju(n[c],t);if(s.push(o),o.type==="error")break}return s};function kE(){return new TransformStream({transform(e,t){ME(e,n=>{const s=n.length;let c;if(s<126)c=new Uint8Array(1),new DataView(c.buffer).setUint8(0,s);else if(s<65536){c=new Uint8Array(3);const o=new DataView(c.buffer);o.setUint8(0,126),o.setUint16(1,s)}else{c=new Uint8Array(9);const o=new DataView(c.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(s))}e.data&&typeof e.data!="string"&&(c[0]|=128),t.enqueue(c),t.enqueue(n)})}})}let qa;function zi(e){return e.reduce((t,n)=>t+n.length,0)}function Qi(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let s=0;for(let c=0;c<t;c++)n[c]=e[0][s++],s===e[0].length&&(e.shift(),s=0);return e.length&&s<e[0].length&&(e[0]=e[0].slice(s)),n}function BE(e,t){qa||(qa=new TextDecoder);const n=[];let s=0,c=-1,o=!1;return new TransformStream({transform(h,r){for(n.push(h);;){if(s===0){if(zi(n)<1)break;const a=Qi(n,1);o=(a[0]&128)===128,c=a[0]&127,c<126?s=3:c===126?s=1:s=2}else if(s===1){if(zi(n)<2)break;const a=Qi(n,2);c=new DataView(a.buffer,a.byteOffset,a.length).getUint16(0),s=3}else if(s===2){if(zi(n)<8)break;const a=Qi(n,8),u=new DataView(a.buffer,a.byteOffset,a.length),l=u.getUint32(0);if(l>Math.pow(2,21)-1){r.enqueue(ql);break}c=l*Math.pow(2,32)+u.getUint32(4),s=3}else{if(zi(n)<c)break;const a=Qi(n,c);r.enqueue(ju(o?a:qa.decode(a),t)),s=0}if(c===0||c>e){r.enqueue(ql);break}}}})}const mf=4;function Dt(e){if(e)return GE(e)}function GE(e){for(var t in Dt.prototype)e[t]=Dt.prototype[t];return e}Dt.prototype.on=Dt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Dt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Dt.prototype.off=Dt.prototype.removeListener=Dt.prototype.removeAllListeners=Dt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var s,c=0;c<n.length;c++)if(s=n[c],s===t||s.fn===t){n.splice(c,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Dt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],s=1;s<arguments.length;s++)t[s-1]=arguments[s];if(n){n=n.slice(0);for(var s=0,c=n.length;s<c;++s)n[s].apply(this,t)}return this};Dt.prototype.emitReserved=Dt.prototype.emit;Dt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Dt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const oa=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),mn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),$E="arraybuffer";function Ef(e,...t){return t.reduce((n,s)=>(e.hasOwnProperty(s)&&(n[s]=e[s]),n),{})}const WE=mn.setTimeout,qE=mn.clearTimeout;function aa(e,t){t.useNativeTimers?(e.setTimeoutFn=WE.bind(mn),e.clearTimeoutFn=qE.bind(mn)):(e.setTimeoutFn=mn.setTimeout.bind(mn),e.clearTimeoutFn=mn.clearTimeout.bind(mn))}const VE=1.33;function jE(e){return typeof e=="string"?HE(e):Math.ceil((e.byteLength||e.size)*VE)}function HE(e){let t=0,n=0;for(let s=0,c=e.length;s<c;s++)t=e.charCodeAt(s),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(s++,n+=4);return n}function Sf(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function YE(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function zE(e){let t={},n=e.split("&");for(let s=0,c=n.length;s<c;s++){let o=n[s].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class QE extends Error{constructor(t,n,s){super(t),this.description=n,this.context=s,this.type="TransportError"}}class Hu extends Dt{constructor(t){super(),this.writable=!1,aa(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,s){return super.emitReserved("error",new QE(t,n,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=ju(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=YE(t);return n.length?"?"+n:""}}class KE extends Hu{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||n()})),this.writable||(s++,this.once("drain",function(){--s||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};FE(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,xE(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Sf()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let Tf=!1;try{Tf=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const XE=Tf;function JE(){}class ZE extends KE{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let s=location.port;s||(s=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||s!==t.port}}doWrite(t,n){const s=this.request({method:"POST",data:t});s.on("success",n),s.on("error",(c,o)=>{this.onError("xhr post error",c,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,s)=>{this.onError("xhr poll error",n,s)}),this.pollXhr=t}}class Fn extends Dt{constructor(t,n,s){super(),this.createRequest=t,aa(this,s),this._opts=s,this._method=s.method||"GET",this._uri=n,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var t;const n=Ef(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(n);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let c in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(c)&&s.setRequestHeader(c,this._opts.extraHeaders[c])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var c;s.readyState===3&&((c=this._opts.cookieJar)===null||c===void 0||c.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(c){this.setTimeoutFn(()=>{this._onError(c)},0);return}typeof document<"u"&&(this._index=Fn.requestsCount++,Fn.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=JE,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Fn.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Fn.requestsCount=0;Fn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Ph);else if(typeof addEventListener=="function"){const e="onpagehide"in mn?"pagehide":"unload";addEventListener(e,Ph,!1)}}function Ph(){for(let e in Fn.requests)Fn.requests.hasOwnProperty(e)&&Fn.requests[e].abort()}const eS=function(){const e=yf({xdomain:!1});return e&&e.responseType!==null}();class tS extends ZE{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=eS&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Fn(yf,this.uri(),t)}}function yf(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||XE))return new XMLHttpRequest}catch{}if(!t)try{return new mn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const If=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class nS extends Hu{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,s=If?{}:Ef(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,s)}catch(c){return this.emitReserved("error",c)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const s=t[n],c=n===t.length-1;Vu(s,this.supportsBinary,o=>{try{this.doWrite(s,o)}catch{}c&&oa(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Sf()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Va=mn.WebSocket||mn.MozWebSocket;class rS extends nS{createSocket(t,n,s){return If?new Va(t,n,s):n?new Va(t,n):new Va(t)}doWrite(t,n){this.ws.send(n)}}class sS extends Hu{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=BE(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=t.readable.pipeThrough(n).getReader(),c=kE();c.readable.pipeTo(t.writable),this._writer=c.writable.getWriter();const o=()=>{s.read().then(({done:r,value:a})=>{r||(this.onPacket(a),o())}).catch(r=>{})};o();const h={type:"open"};this.query.sid&&(h.data=`{"sid":"${this.query.sid}"}`),this._writer.write(h).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const s=t[n],c=n===t.length-1;this._writer.write(s).then(()=>{c&&oa(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const iS={websocket:rS,webtransport:sS,polling:tS},oS=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,aS=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Vl(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),s=e.indexOf("]");n!=-1&&s!=-1&&(e=e.substring(0,n)+e.substring(n,s).replace(/:/g,";")+e.substring(s,e.length));let c=oS.exec(e||""),o={},h=14;for(;h--;)o[aS[h]]=c[h]||"";return n!=-1&&s!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=lS(o,o.path),o.queryKey=uS(o,o.query),o}function lS(e,t){const n=/\/{2,9}/g,s=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&s.splice(0,1),t.slice(-1)=="/"&&s.splice(s.length-1,1),s}function uS(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,c,o){c&&(n[c]=o)}),n}const jl=typeof addEventListener=="function"&&typeof removeEventListener=="function",uo=[];jl&&addEventListener("offline",()=>{uo.forEach(e=>e())},!1);class gr extends Dt{constructor(t,n){if(super(),this.binaryType=$E,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const s=Vl(t);n.hostname=s.host,n.secure=s.protocol==="https"||s.protocol==="wss",n.port=s.port,s.query&&(n.query=s.query)}else n.host&&(n.hostname=Vl(n.host).host);aa(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(s=>{const c=s.prototype.name;this.transports.push(c),this._transportsByName[c]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=zE(this.opts.query)),jl&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},uo.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=mf,n.transport=t,this.id&&(n.sid=this.id);const s=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&gr.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",gr.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let s=0;s<this.writeBuffer.length;s++){const c=this.writeBuffer[s].data;if(c&&(n+=jE(c)),s>0&&n>this._maxPayload)return this.writeBuffer.slice(0,s);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,oa(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,s){return this._sendPacket("message",t,n,s),this}send(t,n,s){return this._sendPacket("message",t,n,s),this}_sendPacket(t,n,s,c){if(typeof n=="function"&&(c=n,n=void 0),typeof s=="function"&&(c=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const o={type:t,data:n,options:s};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),c&&this.once("flush",c),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},s=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():t()}):this.upgrading?s():t()),this}_onError(t){if(gr.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),jl&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=uo.indexOf(this._offlineEventListener);s!==-1&&uo.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}gr.protocol=mf;class cS extends gr{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),s=!1;gr.priorWebsocketSuccess=!1;const c=()=>{s||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!s)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;gr.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(l(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function o(){s||(s=!0,l(),n.close(),n=null)}const h=d=>{const f=new Error("probe error: "+d);f.transport=n.name,o(),this.emitReserved("upgradeError",f)};function r(){h("transport closed")}function a(){h("socket closed")}function u(d){n&&d.name!==n.name&&o()}const l=()=>{n.removeListener("open",c),n.removeListener("error",h),n.removeListener("close",r),this.off("close",a),this.off("upgrading",u)};n.once("open",c),n.once("error",h),n.once("close",r),this.once("close",a),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{s||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let s=0;s<t.length;s++)~this.transports.indexOf(t[s])&&n.push(t[s]);return n}}let hS=class extends cS{constructor(t,n={}){const s=typeof t=="object"?t:n;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(c=>iS[c]).filter(c=>!!c)),super(t,s)}};function dS(e,t="",n){let s=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),s=Vl(e)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const o=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+o+":"+s.port+t,s.href=s.protocol+"://"+o+(n&&n.port===s.port?"":":"+s.port),s}const pS=typeof ArrayBuffer=="function",fS=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Cf=Object.prototype.toString,_S=typeof Blob=="function"||typeof Blob<"u"&&Cf.call(Blob)==="[object BlobConstructor]",gS=typeof File=="function"||typeof File<"u"&&Cf.call(File)==="[object FileConstructor]";function Yu(e){return pS&&(e instanceof ArrayBuffer||fS(e))||_S&&e instanceof Blob||gS&&e instanceof File}function co(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,s=e.length;n<s;n++)if(co(e[n]))return!0;return!1}if(Yu(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return co(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&co(e[n]))return!0;return!1}function mS(e){const t=[],n=e.data,s=e;return s.data=Hl(n,t),s.attachments=t.length,{packet:s,buffers:t}}function Hl(e,t){if(!e)return e;if(Yu(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let s=0;s<e.length;s++)n[s]=Hl(e[s],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=Hl(e[s],t));return n}return e}function ES(e,t){return e.data=Yl(e.data,t),delete e.attachments,e}function Yl(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Yl(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Yl(e[n],t));return e}const SS=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],TS=5;var nt;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(nt||(nt={}));class yS{constructor(t){this.replacer=t}encode(t){return(t.type===nt.EVENT||t.type===nt.ACK)&&co(t)?this.encodeAsBinary({type:t.type===nt.EVENT?nt.BINARY_EVENT:nt.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===nt.BINARY_EVENT||t.type===nt.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=mS(t),s=this.encodeAsString(n.packet),c=n.buffers;return c.unshift(s),c}}function Dh(e){return Object.prototype.toString.call(e)==="[object Object]"}class zu extends Dt{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const s=n.type===nt.BINARY_EVENT;s||n.type===nt.BINARY_ACK?(n.type=s?nt.EVENT:nt.ACK,this.reconstructor=new IS(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Yu(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const s={type:Number(t.charAt(0))};if(nt[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===nt.BINARY_EVENT||s.type===nt.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const h=t.substring(o,n);if(h!=Number(h)||t.charAt(n)!=="-")throw new Error("Illegal attachments");s.attachments=Number(h)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););s.nsp=t.substring(o,n)}else s.nsp="/";const c=t.charAt(n+1);if(c!==""&&Number(c)==c){const o=n+1;for(;++n;){const h=t.charAt(n);if(h==null||Number(h)!=h){--n;break}if(n===t.length)break}s.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(zu.isPayloadValid(s.type,o))s.data=o;else throw new Error("invalid payload")}return s}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case nt.CONNECT:return Dh(n);case nt.DISCONNECT:return n===void 0;case nt.CONNECT_ERROR:return typeof n=="string"||Dh(n);case nt.EVENT:case nt.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&SS.indexOf(n[0])===-1);case nt.ACK:case nt.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class IS{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=ES(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const CS=Object.freeze(Object.defineProperty({__proto__:null,Decoder:zu,Encoder:yS,get PacketType(){return nt},protocol:TS},Symbol.toStringTag,{value:"Module"}));function Nn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const RS=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Rf extends Dt{constructor(t,n,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Nn(t,"open",this.onopen.bind(this)),Nn(t,"packet",this.onpacket.bind(this)),Nn(t,"error",this.onerror.bind(this)),Nn(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var s,c,o;if(RS.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const h={type:nt.EVENT,data:n};if(h.options={},h.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const l=this.ids++,d=n.pop();this._registerAckCallback(l,d),h.id=l}const r=(c=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||c===void 0?void 0:c.writable,a=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!r||(a?(this.notifyOutgoingListeners(h),this.packet(h)):this.sendBuffer.push(h)),this.flags={},this}_registerAckCallback(t,n){var s;const c=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(c===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let r=0;r<this.sendBuffer.length;r++)this.sendBuffer[r].id===t&&this.sendBuffer.splice(r,1);n.call(this,new Error("operation has timed out"))},c),h=(...r)=>{this.io.clearTimeoutFn(o),n.apply(this,r)};h.withError=!0,this.acks[t]=h}emitWithAck(t,...n){return new Promise((s,c)=>{const o=(h,r)=>h?c(h):s(r);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((c,...o)=>s!==this._queue[0]?void 0:(c!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(c)):(this._queue.shift(),n&&n(null,...o)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:nt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(s=>String(s.id)===t)){const s=this.acks[t];delete this.acks[t],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case nt.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case nt.EVENT:case nt.BINARY_EVENT:this.onevent(t);break;case nt.ACK:case nt.BINARY_ACK:this.onack(t);break;case nt.DISCONNECT:this.ondisconnect();break;case nt.CONNECT_ERROR:this.destroy();const s=new Error(t.data.message);s.data=t.data.data,this.emitReserved("connect_error",s);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const s of n)s.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let s=!1;return function(...c){s||(s=!0,n.packet({type:nt.ACK,id:t,data:c}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:nt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let s=0;s<n.length;s++)if(t===n[s])return n.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let s=0;s<n.length;s++)if(t===n[s])return n.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const s of n)s.apply(this,t.data)}}}function vs(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}vs.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};vs.prototype.reset=function(){this.attempts=0};vs.prototype.setMin=function(e){this.ms=e};vs.prototype.setMax=function(e){this.max=e};vs.prototype.setJitter=function(e){this.jitter=e};class zl extends Dt{constructor(t,n){var s;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,aa(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((s=n.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new vs({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const c=n.parser||CS;this.encoder=new c.Encoder,this.decoder=new c.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new hS(this.uri,this.opts);const n=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const c=Nn(n,"open",function(){s.onopen(),t&&t()}),o=r=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",r),t?t(r):this.maybeReconnectOnOpen()},h=Nn(n,"error",o);if(this._timeout!==!1){const r=this._timeout,a=this.setTimeoutFn(()=>{c(),o(new Error("timeout")),n.close()},r);this.opts.autoUnref&&a.unref(),this.subs.push(()=>{this.clearTimeoutFn(a)})}return this.subs.push(c),this.subs.push(h),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Nn(t,"ping",this.onping.bind(this)),Nn(t,"data",this.ondata.bind(this)),Nn(t,"error",this.onerror.bind(this)),Nn(t,"close",this.onclose.bind(this)),Nn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){oa(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let s=this.nsps[t];return s?this._autoConnect&&!s.active&&s.connect():(s=new Rf(this,t,n),this.nsps[t]=s),s}_destroy(t){const n=Object.keys(this.nsps);for(const s of n)if(this.nsps[s].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let s=0;s<n.length;s++)this.engine.write(n[s],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(c=>{c?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",c)):t.onreconnect()}))},n);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Fs={};function ho(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=dS(e,t.path||"/socket.io"),s=n.source,c=n.id,o=n.path,h=Fs[c]&&o in Fs[c].nsps,r=t.forceNew||t["force new connection"]||t.multiplex===!1||h;let a;return r?a=new zl(s,t):(Fs[c]||(Fs[c]=new zl(s,t)),a=Fs[c]),n.query&&!t.query&&(t.query=n.queryKey),a.socket(n.path,t)}Object.assign(ho,{Manager:zl,Socket:Rf,io:ho,connect:ho});const vS=e=>{const[t]=Ae.useState(new DE),[n,s]=Ae.useState(!1),[c,o]=Ae.useState(null),[h,r]=Ae.useState(!1),a=Ae.useCallback(async l=>{if(!l||h){console.info("No configuration provided or already connecting");return}const d=l.connectionType||"solace";r(!0);try{if(s(!1),d==="solace")t.disconnect(),await t.connect(l),t.setMessageCallback(e),s(!0);else{c&&c.disconnect();const f=ho(l.websocketUrl,{transports:["websocket"],reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3});f.on("connect",()=>{o(f),s(!0)}),f.on("message",p=>{try{p=JSON.parse(p)}catch(m){console.error("Error parsing JSON data in websocket received message:",m,p);return}const{payload:_,topic:S,user_properties:C}=p,g=cf(S,_,C);g&&e(g)}),f.on("capability",p=>{const _=PE(p);t.capabilityCallback&&t.capabilityCallback(_)}),f.on("connect_error",p=>{console.error("Socket.IO connection error:",p),s(!1)}),f.on("disconnect",p=>{console.log("Socket.IO connection closed:",p),s(!1)}),o(f)}}catch(f){throw console.error("Error connecting:",f),s(!1),f}finally{r(!1)}},[e,c,t,h]),u=Ae.useCallback(()=>{t&&t.disconnect(),c&&c.disconnect(),s(!1),o(null)},[t,c]);return Ae.useEffect(()=>u,[u]),[a,u,n,s]},Mh="web-visualizer-config",ja="saved-configs",NS=()=>{const[e,t]=Ae.useState(!1),[n,s]=Ae.useState(!1),[c,o]=Ae.useState(!1),[h,r]=Ae.useState([]),[a,u]=Ae.useState(()=>{var y,E,I,N,A,L,D,q,Y,Q;try{const W=JSON.parse(localStorage.getItem(Mh)||"{}");return!W||!W.connectionType||!W.url||!W.vpnName||!W.userName?{connectionType:"solace",url:((y=window.config)==null?void 0:y.url)??"ws://localhost:8008",vpnName:((E=window.config)==null?void 0:E.vpn)??"default",userName:((I=window.config)==null?void 0:I.username)??"default",password:((N=window.config)==null?void 0:N.password)??"default",namespace:((A=window.config)==null?void 0:A.namespace)??""}:W}catch(W){return console.error("Error getting config from local storage:",W.message),{connectionType:"solace",url:((L=window.config)==null?void 0:L.url)??"ws://localhost:8008",vpnName:((D=window.config)==null?void 0:D.vpn)??"default",userName:((q=window.config)==null?void 0:q.username)??"default",password:((Y=window.config)==null?void 0:Y.password)??"default",namespace:((Q=window.config)==null?void 0:Q.namespace)??""}}}),[l,d,f,p]=vS(y=>{if(y.type==="registration"){const I=new CustomEvent("agentRegistration",{detail:y.content});window.dispatchEvent(I);return}if(y.type==="stimulus")Nh({...y,responses:[]});else if(["response","streamingResponse","responseComplete","actionRequest","actionResponse","orchestratorReinvoke","llmServiceRequest","llmServiceResponse"].includes(y.type)){if(y.type==="orchestratorReinvoke"||(console.log("EDE Processing message:",y),y.type==="llmServiceResponse"&&!y.content.last_chunk))return;(y.type!=="streamingResponse"||y.content.last_chunk)&&lf().then(I=>{var L;const N=((L=y.stimulus_uuid)==null?void 0:L._value)||y.stimulus_uuid,A=I[N];if(A)Nh({...A,responses:[y]});else return})}const E=document.querySelector(".stimuli-page");if(E){const I=new CustomEvent("newMessage",{detail:y});E.dispatchEvent(I)}});Ae.useEffect(()=>{try{localStorage.setItem(Mh,JSON.stringify(a))}catch(y){console.error("Error saving config to local storage:",y.message)}},[a]),Ae.useEffect(()=>{const y=JSON.parse(localStorage.getItem(ja)||"[]");r(y)},[]);const _=y=>{y&&l(a).then(()=>{if(p(!0),a.name){const E=h.findIndex(N=>N.name===a.name);let I;E!==-1?(I=[...h],I[E]=a):I=[...h,a],r(I),localStorage.setItem(ja,JSON.stringify(I))}}).catch(E=>{console.error("Connection failed:",E),p(!1)}),t(!1),o(!1)},S=()=>{d(),p(!1)},C=(y,E=!1)=>{u(y),s(!1),E?l(y).then(()=>{p(!0)}).catch(I=>{console.error("Connection failed:",I),p(!1)}):(t(!0),o(!1))},g=()=>{var y,E,I,N,A;u({name:"",connectionType:"solace",url:((y=window.config)==null?void 0:y.url)??"ws://localhost:8008",vpnName:((E=window.config)==null?void 0:E.vpn)??"default",userName:((I=window.config)==null?void 0:I.username)??"default",password:((N=window.config)==null?void 0:N.password)??"default",namespace:((A=window.config)==null?void 0:A.namespace)??""}),s(!1),t(!0),o(!0)},m=y=>{u(y),s(!1),t(!0),o(!1)},T=y=>{const E=h.filter(I=>I.name!==y);r(E),localStorage.setItem(ja,JSON.stringify(E)),s(!1)};return le.jsx(uE,{children:le.jsx(dm,{children:le.jsx("div",{className:"app-wrapper",children:le.jsxs("div",{className:"app-container",children:[le.jsx("header",{className:"header",children:le.jsxs("nav",{className:"top-menu",children:[le.jsx("h1",{className:"app-title",children:"Solace Agent Mesh Visualizer"}),le.jsxs("ul",{className:"nav-links",children:[le.jsx("li",{children:le.jsx(yh,{to:"/",end:!0,children:"Stimuli"})}),le.jsx("li",{children:le.jsx(yh,{to:"/capabilities",children:"Agents"})})]}),le.jsxs("div",{className:"connection-controls",children:[n&&le.jsx(AE,{onSelect:C,onCreateNew:g,onCancel:()=>s(!1),onEdit:m,onDelete:T}),le.jsx(OE,{open:!f&&e,config:a,setConfig:u,onClose:_,isNewConfig:c,savedConfigs:h}),le.jsx("button",{className:"button button-info",onClick:f?S:()=>s(!0),children:f?"Disconnect":"Connect"})]})]})}),le.jsxs(tE,{children:[le.jsx(Gl,{path:"/",element:le.jsx(vE,{})}),le.jsx(Gl,{path:"/capabilities",element:le.jsx(NE,{})})]})]})})})})};fetch("config.json").then(e=>e.json()).then(e=>{window.config=e}).catch(e=>{console.log("Could not load config",e.message)}).finally(()=>{Ha.createRoot(document.getElementById("root")).render(le.jsx(Vh.StrictMode,{children:le.jsx(NS,{})}))});
|
|
109
|
+
`)):W=N.stylize("[Circular]","special")),u(Q)){if(Y&&q.match(/^\d+$/))return W;(Q=JSON.stringify(""+q)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(Q=Q.substr(1,Q.length-2),Q=N.stylize(Q,"name")):(Q=Q.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Q=N.stylize(Q,"string"))}return Q+": "+W}o.exports=h,h.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},h.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"}},8287:(o,h,r)=>{const a=r(7526),u=r(251),l=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;h.hp=p,h.IS=50;const d=2147483647;function _(v){if(v>d)throw new RangeError('The value "'+v+'" is invalid for option "size"');const P=new Uint8Array(v);return Object.setPrototypeOf(P,p.prototype),P}function p(v,P,O){if(typeof v=="number"){if(typeof P=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return C(v)}return f(v,P,O)}function f(v,P,O){if(typeof v=="string")return function(z,ne){if(typeof ne=="string"&&ne!==""||(ne="utf8"),!p.isEncoding(ne))throw new TypeError("Unknown encoding: "+ne);const de=0|y(z,ne);let _e=_(de);const we=_e.write(z,ne);return we!==de&&(_e=_e.slice(0,we)),_e}(v,P);if(ArrayBuffer.isView(v))return function(z){if(Z(z,Uint8Array)){const ne=new Uint8Array(z);return m(ne.buffer,ne.byteOffset,ne.byteLength)}return g(z)}(v);if(v==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof v);if(Z(v,ArrayBuffer)||v&&Z(v.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Z(v,SharedArrayBuffer)||v&&Z(v.buffer,SharedArrayBuffer)))return m(v,P,O);if(typeof v=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const U=v.valueOf&&v.valueOf();if(U!=null&&U!==v)return p.from(U,P,O);const V=function(z){if(p.isBuffer(z)){const ne=0|T(z.length),de=_(ne);return de.length===0||z.copy(de,0,0,ne),de}return z.length!==void 0?typeof z.length!="number"||te(z.length)?_(0):g(z):z.type==="Buffer"&&Array.isArray(z.data)?g(z.data):void 0}(v);if(V)return V;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof v[Symbol.toPrimitive]=="function")return p.from(v[Symbol.toPrimitive]("string"),P,O);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof v)}function S(v){if(typeof v!="number")throw new TypeError('"size" argument must be of type number');if(v<0)throw new RangeError('The value "'+v+'" is invalid for option "size"')}function C(v){return S(v),_(v<0?0:0|T(v))}function g(v){const P=v.length<0?0:0|T(v.length),O=_(P);for(let U=0;U<P;U+=1)O[U]=255&v[U];return O}function m(v,P,O){if(P<0||v.byteLength<P)throw new RangeError('"offset" is outside of buffer bounds');if(v.byteLength<P+(O||0))throw new RangeError('"length" is outside of buffer bounds');let U;return U=P===void 0&&O===void 0?new Uint8Array(v):O===void 0?new Uint8Array(v,P):new Uint8Array(v,P,O),Object.setPrototypeOf(U,p.prototype),U}function T(v){if(v>=d)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+d.toString(16)+" bytes");return 0|v}function y(v,P){if(p.isBuffer(v))return v.length;if(ArrayBuffer.isView(v)||Z(v,ArrayBuffer))return v.byteLength;if(typeof v!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof v);const O=v.length,U=arguments.length>2&&arguments[2]===!0;if(!U&&O===0)return 0;let V=!1;for(;;)switch(P){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":return me(v).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*O;case"hex":return O>>>1;case"base64":return Pe(v).length;default:if(V)return U?-1:me(v).length;P=(""+P).toLowerCase(),V=!0}}function E(v,P,O){let U=!1;if((P===void 0||P<0)&&(P=0),P>this.length||((O===void 0||O>this.length)&&(O=this.length),O<=0)||(O>>>=0)<=(P>>>=0))return"";for(v||(v="utf8");;)switch(v){case"hex":return $(this,P,O);case"utf8":case"utf-8":return x(this,P,O);case"ascii":return J(this,P,O);case"latin1":case"binary":return F(this,P,O);case"base64":return W(this,P,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,P,O);default:if(U)throw new TypeError("Unknown encoding: "+v);v=(v+"").toLowerCase(),U=!0}}function I(v,P,O){const U=v[P];v[P]=v[O],v[O]=U}function N(v,P,O,U,V){if(v.length===0)return-1;if(typeof O=="string"?(U=O,O=0):O>2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),te(O=+O)&&(O=V?0:v.length-1),O<0&&(O=v.length+O),O>=v.length){if(V)return-1;O=v.length-1}else if(O<0){if(!V)return-1;O=0}if(typeof P=="string"&&(P=p.from(P,U)),p.isBuffer(P))return P.length===0?-1:A(v,P,O,U,V);if(typeof P=="number")return P&=255,typeof Uint8Array.prototype.indexOf=="function"?V?Uint8Array.prototype.indexOf.call(v,P,O):Uint8Array.prototype.lastIndexOf.call(v,P,O):A(v,[P],O,U,V);throw new TypeError("val must be string, number or Buffer")}function A(v,P,O,U,V){let z,ne=1,de=v.length,_e=P.length;if(U!==void 0&&((U=String(U).toLowerCase())==="ucs2"||U==="ucs-2"||U==="utf16le"||U==="utf-16le")){if(v.length<2||P.length<2)return-1;ne=2,de/=2,_e/=2,O/=2}function we(oe,Se){return ne===1?oe[Se]:oe.readUInt16BE(Se*ne)}if(V){let oe=-1;for(z=O;z<de;z++)if(we(v,z)===we(P,oe===-1?0:z-oe)){if(oe===-1&&(oe=z),z-oe+1===_e)return oe*ne}else oe!==-1&&(z-=z-oe),oe=-1}else for(O+_e>de&&(O=de-_e),z=O;z>=0;z--){let oe=!0;for(let Se=0;Se<_e;Se++)if(we(v,z+Se)!==we(P,Se)){oe=!1;break}if(oe)return z}return-1}function L(v,P,O,U){O=Number(O)||0;const V=v.length-O;U?(U=Number(U))>V&&(U=V):U=V;const z=P.length;let ne;for(U>z/2&&(U=z/2),ne=0;ne<U;++ne){const de=parseInt(P.substr(2*ne,2),16);if(te(de))return ne;v[O+ne]=de}return ne}function D(v,P,O,U){return H(me(P,v.length-O),v,O,U)}function q(v,P,O,U){return H(function(V){const z=[];for(let ne=0;ne<V.length;++ne)z.push(255&V.charCodeAt(ne));return z}(P),v,O,U)}function Y(v,P,O,U){return H(Pe(P),v,O,U)}function Q(v,P,O,U){return H(function(V,z){let ne,de,_e;const we=[];for(let oe=0;oe<V.length&&!((z-=2)<0);++oe)ne=V.charCodeAt(oe),de=ne>>8,_e=ne%256,we.push(_e),we.push(de);return we}(P,v.length-O),v,O,U)}function W(v,P,O){return P===0&&O===v.length?a.fromByteArray(v):a.fromByteArray(v.slice(P,O))}function x(v,P,O){O=Math.min(v.length,O);const U=[];let V=P;for(;V<O;){const z=v[V];let ne=null,de=z>239?4:z>223?3:z>191?2:1;if(V+de<=O){let _e,we,oe,Se;switch(de){case 1:z<128&&(ne=z);break;case 2:_e=v[V+1],(192&_e)==128&&(Se=(31&z)<<6|63&_e,Se>127&&(ne=Se));break;case 3:_e=v[V+1],we=v[V+2],(192&_e)==128&&(192&we)==128&&(Se=(15&z)<<12|(63&_e)<<6|63&we,Se>2047&&(Se<55296||Se>57343)&&(ne=Se));break;case 4:_e=v[V+1],we=v[V+2],oe=v[V+3],(192&_e)==128&&(192&we)==128&&(192&oe)==128&&(Se=(15&z)<<18|(63&_e)<<12|(63&we)<<6|63&oe,Se>65535&&Se<1114112&&(ne=Se))}}ne===null?(ne=65533,de=1):ne>65535&&(ne-=65536,U.push(ne>>>10&1023|55296),ne=56320|1023&ne),U.push(ne),V+=de}return function(z){const ne=z.length;if(ne<=k)return String.fromCharCode.apply(String,z);let de="",_e=0;for(;_e<ne;)de+=String.fromCharCode.apply(String,z.slice(_e,_e+=k));return de}(U)}p.TYPED_ARRAY_SUPPORT=function(){try{const v=new Uint8Array(1),P={foo:function(){return 42}};return Object.setPrototypeOf(P,Uint8Array.prototype),Object.setPrototypeOf(v,P),v.foo()===42}catch{return!1}}(),p.TYPED_ARRAY_SUPPORT||typeof console>"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}}),Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}}),p.poolSize=8192,p.from=function(v,P,O){return f(v,P,O)},Object.setPrototypeOf(p.prototype,Uint8Array.prototype),Object.setPrototypeOf(p,Uint8Array),p.alloc=function(v,P,O){return function(U,V,z){return S(U),U<=0?_(U):V!==void 0?typeof z=="string"?_(U).fill(V,z):_(U).fill(V):_(U)}(v,P,O)},p.allocUnsafe=function(v){return C(v)},p.allocUnsafeSlow=function(v){return C(v)},p.isBuffer=function(v){return v!=null&&v._isBuffer===!0&&v!==p.prototype},p.compare=function(v,P){if(Z(v,Uint8Array)&&(v=p.from(v,v.offset,v.byteLength)),Z(P,Uint8Array)&&(P=p.from(P,P.offset,P.byteLength)),!p.isBuffer(v)||!p.isBuffer(P))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(v===P)return 0;let O=v.length,U=P.length;for(let V=0,z=Math.min(O,U);V<z;++V)if(v[V]!==P[V]){O=v[V],U=P[V];break}return O<U?-1:U<O?1:0},p.isEncoding=function(v){switch(String(v).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},p.concat=function(v,P){if(!Array.isArray(v))throw new TypeError('"list" argument must be an Array of Buffers');if(v.length===0)return p.alloc(0);let O;if(P===void 0)for(P=0,O=0;O<v.length;++O)P+=v[O].length;const U=p.allocUnsafe(P);let V=0;for(O=0;O<v.length;++O){let z=v[O];if(Z(z,Uint8Array))V+z.length>U.length?(p.isBuffer(z)||(z=p.from(z)),z.copy(U,V)):Uint8Array.prototype.set.call(U,z,V);else{if(!p.isBuffer(z))throw new TypeError('"list" argument must be an Array of Buffers');z.copy(U,V)}V+=z.length}return U},p.byteLength=y,p.prototype._isBuffer=!0,p.prototype.swap16=function(){const v=this.length;if(v%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let P=0;P<v;P+=2)I(this,P,P+1);return this},p.prototype.swap32=function(){const v=this.length;if(v%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let P=0;P<v;P+=4)I(this,P,P+3),I(this,P+1,P+2);return this},p.prototype.swap64=function(){const v=this.length;if(v%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let P=0;P<v;P+=8)I(this,P,P+7),I(this,P+1,P+6),I(this,P+2,P+5),I(this,P+3,P+4);return this},p.prototype.toString=function(){const v=this.length;return v===0?"":arguments.length===0?x(this,0,v):E.apply(this,arguments)},p.prototype.toLocaleString=p.prototype.toString,p.prototype.equals=function(v){if(!p.isBuffer(v))throw new TypeError("Argument must be a Buffer");return this===v||p.compare(this,v)===0},p.prototype.inspect=function(){let v="";const P=h.IS;return v=this.toString("hex",0,P).replace(/(.{2})/g,"$1 ").trim(),this.length>P&&(v+=" ... "),"<Buffer "+v+">"},l&&(p.prototype[l]=p.prototype.inspect),p.prototype.compare=function(v,P,O,U,V){if(Z(v,Uint8Array)&&(v=p.from(v,v.offset,v.byteLength)),!p.isBuffer(v))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof v);if(P===void 0&&(P=0),O===void 0&&(O=v?v.length:0),U===void 0&&(U=0),V===void 0&&(V=this.length),P<0||O>v.length||U<0||V>this.length)throw new RangeError("out of range index");if(U>=V&&P>=O)return 0;if(U>=V)return-1;if(P>=O)return 1;if(this===v)return 0;let z=(V>>>=0)-(U>>>=0),ne=(O>>>=0)-(P>>>=0);const de=Math.min(z,ne),_e=this.slice(U,V),we=v.slice(P,O);for(let oe=0;oe<de;++oe)if(_e[oe]!==we[oe]){z=_e[oe],ne=we[oe];break}return z<ne?-1:ne<z?1:0},p.prototype.includes=function(v,P,O){return this.indexOf(v,P,O)!==-1},p.prototype.indexOf=function(v,P,O){return N(this,v,P,O,!0)},p.prototype.lastIndexOf=function(v,P,O){return N(this,v,P,O,!1)},p.prototype.write=function(v,P,O,U){if(P===void 0)U="utf8",O=this.length,P=0;else if(O===void 0&&typeof P=="string")U=P,O=this.length,P=0;else{if(!isFinite(P))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");P>>>=0,isFinite(O)?(O>>>=0,U===void 0&&(U="utf8")):(U=O,O=void 0)}const V=this.length-P;if((O===void 0||O>V)&&(O=V),v.length>0&&(O<0||P<0)||P>this.length)throw new RangeError("Attempt to write outside buffer bounds");U||(U="utf8");let z=!1;for(;;)switch(U){case"hex":return L(this,v,P,O);case"utf8":case"utf-8":return D(this,v,P,O);case"ascii":case"latin1":case"binary":return q(this,v,P,O);case"base64":return Y(this,v,P,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Q(this,v,P,O);default:if(z)throw new TypeError("Unknown encoding: "+U);U=(""+U).toLowerCase(),z=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const k=4096;function J(v,P,O){let U="";O=Math.min(v.length,O);for(let V=P;V<O;++V)U+=String.fromCharCode(127&v[V]);return U}function F(v,P,O){let U="";O=Math.min(v.length,O);for(let V=P;V<O;++V)U+=String.fromCharCode(v[V]);return U}function $(v,P,O){const U=v.length;(!P||P<0)&&(P=0),(!O||O<0||O>U)&&(O=U);let V="";for(let z=P;z<O;++z)V+=ie[v[z]];return V}function R(v,P,O){const U=v.slice(P,O);let V="";for(let z=0;z<U.length-1;z+=2)V+=String.fromCharCode(U[z]+256*U[z+1]);return V}function B(v,P,O){if(v%1!=0||v<0)throw new RangeError("offset is not uint");if(v+P>O)throw new RangeError("Trying to access beyond buffer length")}function M(v,P,O,U,V,z){if(!p.isBuffer(v))throw new TypeError('"buffer" argument must be a Buffer instance');if(P>V||P<z)throw new RangeError('"value" argument is out of bounds');if(O+U>v.length)throw new RangeError("Index out of range")}function re(v,P,O,U,V){X(P,U,V,v,O,7);let z=Number(P&BigInt(4294967295));v[O++]=z,z>>=8,v[O++]=z,z>>=8,v[O++]=z,z>>=8,v[O++]=z;let ne=Number(P>>BigInt(32)&BigInt(4294967295));return v[O++]=ne,ne>>=8,v[O++]=ne,ne>>=8,v[O++]=ne,ne>>=8,v[O++]=ne,O}function se(v,P,O,U,V){X(P,U,V,v,O,7);let z=Number(P&BigInt(4294967295));v[O+7]=z,z>>=8,v[O+6]=z,z>>=8,v[O+5]=z,z>>=8,v[O+4]=z;let ne=Number(P>>BigInt(32)&BigInt(4294967295));return v[O+3]=ne,ne>>=8,v[O+2]=ne,ne>>=8,v[O+1]=ne,ne>>=8,v[O]=ne,O+8}function fe(v,P,O,U,V,z){if(O+U>v.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function ce(v,P,O,U,V){return P=+P,O>>>=0,V||fe(v,0,O,4),u.write(v,P,O,U,23,4),O+4}function Te(v,P,O,U,V){return P=+P,O>>>=0,V||fe(v,0,O,8),u.write(v,P,O,U,52,8),O+8}p.prototype.slice=function(v,P){const O=this.length;(v=~~v)<0?(v+=O)<0&&(v=0):v>O&&(v=O),(P=P===void 0?O:~~P)<0?(P+=O)<0&&(P=0):P>O&&(P=O),P<v&&(P=v);const U=this.subarray(v,P);return Object.setPrototypeOf(U,p.prototype),U},p.prototype.readUintLE=p.prototype.readUIntLE=function(v,P,O){v>>>=0,P>>>=0,O||B(v,P,this.length);let U=this[v],V=1,z=0;for(;++z<P&&(V*=256);)U+=this[v+z]*V;return U},p.prototype.readUintBE=p.prototype.readUIntBE=function(v,P,O){v>>>=0,P>>>=0,O||B(v,P,this.length);let U=this[v+--P],V=1;for(;P>0&&(V*=256);)U+=this[v+--P]*V;return U},p.prototype.readUint8=p.prototype.readUInt8=function(v,P){return v>>>=0,P||B(v,1,this.length),this[v]},p.prototype.readUint16LE=p.prototype.readUInt16LE=function(v,P){return v>>>=0,P||B(v,2,this.length),this[v]|this[v+1]<<8},p.prototype.readUint16BE=p.prototype.readUInt16BE=function(v,P){return v>>>=0,P||B(v,2,this.length),this[v]<<8|this[v+1]},p.prototype.readUint32LE=p.prototype.readUInt32LE=function(v,P){return v>>>=0,P||B(v,4,this.length),(this[v]|this[v+1]<<8|this[v+2]<<16)+16777216*this[v+3]},p.prototype.readUint32BE=p.prototype.readUInt32BE=function(v,P){return v>>>=0,P||B(v,4,this.length),16777216*this[v]+(this[v+1]<<16|this[v+2]<<8|this[v+3])},p.prototype.readBigUInt64LE=j(function(v){ae(v>>>=0,"offset");const P=this[v],O=this[v+7];P!==void 0&&O!==void 0||ee(v,this.length-8);const U=P+256*this[++v]+65536*this[++v]+this[++v]*2**24,V=this[++v]+256*this[++v]+65536*this[++v]+O*2**24;return BigInt(U)+(BigInt(V)<<BigInt(32))}),p.prototype.readBigUInt64BE=j(function(v){ae(v>>>=0,"offset");const P=this[v],O=this[v+7];P!==void 0&&O!==void 0||ee(v,this.length-8);const U=P*2**24+65536*this[++v]+256*this[++v]+this[++v],V=this[++v]*2**24+65536*this[++v]+256*this[++v]+O;return(BigInt(U)<<BigInt(32))+BigInt(V)}),p.prototype.readIntLE=function(v,P,O){v>>>=0,P>>>=0,O||B(v,P,this.length);let U=this[v],V=1,z=0;for(;++z<P&&(V*=256);)U+=this[v+z]*V;return V*=128,U>=V&&(U-=Math.pow(2,8*P)),U},p.prototype.readIntBE=function(v,P,O){v>>>=0,P>>>=0,O||B(v,P,this.length);let U=P,V=1,z=this[v+--U];for(;U>0&&(V*=256);)z+=this[v+--U]*V;return V*=128,z>=V&&(z-=Math.pow(2,8*P)),z},p.prototype.readInt8=function(v,P){return v>>>=0,P||B(v,1,this.length),128&this[v]?-1*(255-this[v]+1):this[v]},p.prototype.readInt16LE=function(v,P){v>>>=0,P||B(v,2,this.length);const O=this[v]|this[v+1]<<8;return 32768&O?4294901760|O:O},p.prototype.readInt16BE=function(v,P){v>>>=0,P||B(v,2,this.length);const O=this[v+1]|this[v]<<8;return 32768&O?4294901760|O:O},p.prototype.readInt32LE=function(v,P){return v>>>=0,P||B(v,4,this.length),this[v]|this[v+1]<<8|this[v+2]<<16|this[v+3]<<24},p.prototype.readInt32BE=function(v,P){return v>>>=0,P||B(v,4,this.length),this[v]<<24|this[v+1]<<16|this[v+2]<<8|this[v+3]},p.prototype.readBigInt64LE=j(function(v){ae(v>>>=0,"offset");const P=this[v],O=this[v+7];P!==void 0&&O!==void 0||ee(v,this.length-8);const U=this[v+4]+256*this[v+5]+65536*this[v+6]+(O<<24);return(BigInt(U)<<BigInt(32))+BigInt(P+256*this[++v]+65536*this[++v]+this[++v]*16777216)}),p.prototype.readBigInt64BE=j(function(v){ae(v>>>=0,"offset");const P=this[v],O=this[v+7];P!==void 0&&O!==void 0||ee(v,this.length-8);const U=(P<<24)+65536*this[++v]+256*this[++v]+this[++v];return(BigInt(U)<<BigInt(32))+BigInt(this[++v]*16777216+65536*this[++v]+256*this[++v]+O)}),p.prototype.readFloatLE=function(v,P){return v>>>=0,P||B(v,4,this.length),u.read(this,v,!0,23,4)},p.prototype.readFloatBE=function(v,P){return v>>>=0,P||B(v,4,this.length),u.read(this,v,!1,23,4)},p.prototype.readDoubleLE=function(v,P){return v>>>=0,P||B(v,8,this.length),u.read(this,v,!0,52,8)},p.prototype.readDoubleBE=function(v,P){return v>>>=0,P||B(v,8,this.length),u.read(this,v,!1,52,8)},p.prototype.writeUintLE=p.prototype.writeUIntLE=function(v,P,O,U){v=+v,P>>>=0,O>>>=0,U||M(this,v,P,O,Math.pow(2,8*O)-1,0);let V=1,z=0;for(this[P]=255&v;++z<O&&(V*=256);)this[P+z]=v/V&255;return P+O},p.prototype.writeUintBE=p.prototype.writeUIntBE=function(v,P,O,U){v=+v,P>>>=0,O>>>=0,U||M(this,v,P,O,Math.pow(2,8*O)-1,0);let V=O-1,z=1;for(this[P+V]=255&v;--V>=0&&(z*=256);)this[P+V]=v/z&255;return P+O},p.prototype.writeUint8=p.prototype.writeUInt8=function(v,P,O){return v=+v,P>>>=0,O||M(this,v,P,1,255,0),this[P]=255&v,P+1},p.prototype.writeUint16LE=p.prototype.writeUInt16LE=function(v,P,O){return v=+v,P>>>=0,O||M(this,v,P,2,65535,0),this[P]=255&v,this[P+1]=v>>>8,P+2},p.prototype.writeUint16BE=p.prototype.writeUInt16BE=function(v,P,O){return v=+v,P>>>=0,O||M(this,v,P,2,65535,0),this[P]=v>>>8,this[P+1]=255&v,P+2},p.prototype.writeUint32LE=p.prototype.writeUInt32LE=function(v,P,O){return v=+v,P>>>=0,O||M(this,v,P,4,4294967295,0),this[P+3]=v>>>24,this[P+2]=v>>>16,this[P+1]=v>>>8,this[P]=255&v,P+4},p.prototype.writeUint32BE=p.prototype.writeUInt32BE=function(v,P,O){return v=+v,P>>>=0,O||M(this,v,P,4,4294967295,0),this[P]=v>>>24,this[P+1]=v>>>16,this[P+2]=v>>>8,this[P+3]=255&v,P+4},p.prototype.writeBigUInt64LE=j(function(v,P=0){return re(this,v,P,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeBigUInt64BE=j(function(v,P=0){return se(this,v,P,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeIntLE=function(v,P,O,U){if(v=+v,P>>>=0,!U){const de=Math.pow(2,8*O-1);M(this,v,P,O,de-1,-de)}let V=0,z=1,ne=0;for(this[P]=255&v;++V<O&&(z*=256);)v<0&&ne===0&&this[P+V-1]!==0&&(ne=1),this[P+V]=(v/z|0)-ne&255;return P+O},p.prototype.writeIntBE=function(v,P,O,U){if(v=+v,P>>>=0,!U){const de=Math.pow(2,8*O-1);M(this,v,P,O,de-1,-de)}let V=O-1,z=1,ne=0;for(this[P+V]=255&v;--V>=0&&(z*=256);)v<0&&ne===0&&this[P+V+1]!==0&&(ne=1),this[P+V]=(v/z|0)-ne&255;return P+O},p.prototype.writeInt8=function(v,P,O){return v=+v,P>>>=0,O||M(this,v,P,1,127,-128),v<0&&(v=255+v+1),this[P]=255&v,P+1},p.prototype.writeInt16LE=function(v,P,O){return v=+v,P>>>=0,O||M(this,v,P,2,32767,-32768),this[P]=255&v,this[P+1]=v>>>8,P+2},p.prototype.writeInt16BE=function(v,P,O){return v=+v,P>>>=0,O||M(this,v,P,2,32767,-32768),this[P]=v>>>8,this[P+1]=255&v,P+2},p.prototype.writeInt32LE=function(v,P,O){return v=+v,P>>>=0,O||M(this,v,P,4,2147483647,-2147483648),this[P]=255&v,this[P+1]=v>>>8,this[P+2]=v>>>16,this[P+3]=v>>>24,P+4},p.prototype.writeInt32BE=function(v,P,O){return v=+v,P>>>=0,O||M(this,v,P,4,2147483647,-2147483648),v<0&&(v=4294967295+v+1),this[P]=v>>>24,this[P+1]=v>>>16,this[P+2]=v>>>8,this[P+3]=255&v,P+4},p.prototype.writeBigInt64LE=j(function(v,P=0){return re(this,v,P,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),p.prototype.writeBigInt64BE=j(function(v,P=0){return se(this,v,P,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),p.prototype.writeFloatLE=function(v,P,O){return ce(this,v,P,!0,O)},p.prototype.writeFloatBE=function(v,P,O){return ce(this,v,P,!1,O)},p.prototype.writeDoubleLE=function(v,P,O){return Te(this,v,P,!0,O)},p.prototype.writeDoubleBE=function(v,P,O){return Te(this,v,P,!1,O)},p.prototype.copy=function(v,P,O,U){if(!p.isBuffer(v))throw new TypeError("argument should be a Buffer");if(O||(O=0),U||U===0||(U=this.length),P>=v.length&&(P=v.length),P||(P=0),U>0&&U<O&&(U=O),U===O||v.length===0||this.length===0)return 0;if(P<0)throw new RangeError("targetStart out of bounds");if(O<0||O>=this.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("sourceEnd out of bounds");U>this.length&&(U=this.length),v.length-P<U-O&&(U=v.length-P+O);const V=U-O;return this===v&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(P,O,U):Uint8Array.prototype.set.call(v,this.subarray(O,U),P),V},p.prototype.fill=function(v,P,O,U){if(typeof v=="string"){if(typeof P=="string"?(U=P,P=0,O=this.length):typeof O=="string"&&(U=O,O=this.length),U!==void 0&&typeof U!="string")throw new TypeError("encoding must be a string");if(typeof U=="string"&&!p.isEncoding(U))throw new TypeError("Unknown encoding: "+U);if(v.length===1){const z=v.charCodeAt(0);(U==="utf8"&&z<128||U==="latin1")&&(v=z)}}else typeof v=="number"?v&=255:typeof v=="boolean"&&(v=Number(v));if(P<0||this.length<P||this.length<O)throw new RangeError("Out of range index");if(O<=P)return this;let V;if(P>>>=0,O=O===void 0?this.length:O>>>0,v||(v=0),typeof v=="number")for(V=P;V<O;++V)this[V]=v;else{const z=p.isBuffer(v)?v:p.from(v,U),ne=z.length;if(ne===0)throw new TypeError('The value "'+v+'" is invalid for argument "value"');for(V=0;V<O-P;++V)this[V+P]=z[V%ne]}return this};const Ee={};function he(v,P,O){Ee[v]=class extends O{constructor(){super(),Object.defineProperty(this,"message",{value:P.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${v}]`,this.stack,delete this.name}get code(){return v}set code(U){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:U,writable:!0})}toString(){return`${this.name} [${v}]: ${this.message}`}}}function ge(v){let P="",O=v.length;const U=v[0]==="-"?1:0;for(;O>=U+4;O-=3)P=`_${v.slice(O-3,O)}${P}`;return`${v.slice(0,O)}${P}`}function X(v,P,O,U,V,z){if(v>O||v<P){const ne=typeof P=="bigint"?"n":"";let de;throw de=P===0||P===BigInt(0)?`>= 0${ne} and < 2${ne} ** ${8*(z+1)}${ne}`:`>= -(2${ne} ** ${8*(z+1)-1}${ne}) and < 2 ** ${8*(z+1)-1}${ne}`,new Ee.ERR_OUT_OF_RANGE("value",de,v)}(function(ne,de,_e){ae(de,"offset"),ne[de]!==void 0&&ne[de+_e]!==void 0||ee(de,ne.length-(_e+1))})(U,V,z)}function ae(v,P){if(typeof v!="number")throw new Ee.ERR_INVALID_ARG_TYPE(P,"number",v)}function ee(v,P,O){throw Math.floor(v)!==v?(ae(v,O),new Ee.ERR_OUT_OF_RANGE("offset","an integer",v)):P<0?new Ee.ERR_BUFFER_OUT_OF_BOUNDS:new Ee.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${P}`,v)}he("ERR_BUFFER_OUT_OF_BOUNDS",function(v){return v?`${v} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),he("ERR_INVALID_ARG_TYPE",function(v,P){return`The "${v}" argument must be of type number. Received type ${typeof P}`},TypeError),he("ERR_OUT_OF_RANGE",function(v,P,O){let U=`The value of "${v}" is out of range.`,V=O;return Number.isInteger(O)&&Math.abs(O)>4294967296?V=ge(String(O)):typeof O=="bigint"&&(V=String(O),(O>BigInt(2)**BigInt(32)||O<-(BigInt(2)**BigInt(32)))&&(V=ge(V)),V+="n"),U+=` It must be ${P}. Received ${V}`,U},RangeError);const Re=/[^+/0-9A-Za-z-_]/g;function me(v,P){let O;P=P||1/0;const U=v.length;let V=null;const z=[];for(let ne=0;ne<U;++ne){if(O=v.charCodeAt(ne),O>55295&&O<57344){if(!V){if(O>56319){(P-=3)>-1&&z.push(239,191,189);continue}if(ne+1===U){(P-=3)>-1&&z.push(239,191,189);continue}V=O;continue}if(O<56320){(P-=3)>-1&&z.push(239,191,189),V=O;continue}O=65536+(V-55296<<10|O-56320)}else V&&(P-=3)>-1&&z.push(239,191,189);if(V=null,O<128){if((P-=1)<0)break;z.push(O)}else if(O<2048){if((P-=2)<0)break;z.push(O>>6|192,63&O|128)}else if(O<65536){if((P-=3)<0)break;z.push(O>>12|224,O>>6&63|128,63&O|128)}else{if(!(O<1114112))throw new Error("Invalid code point");if((P-=4)<0)break;z.push(O>>18|240,O>>12&63|128,O>>6&63|128,63&O|128)}}return z}function Pe(v){return a.toByteArray(function(P){if((P=(P=P.split("=")[0]).trim().replace(Re,"")).length<2)return"";for(;P.length%4!=0;)P+="=";return P}(v))}function H(v,P,O,U){let V;for(V=0;V<U&&!(V+O>=P.length||V>=v.length);++V)P[V+O]=v[V];return V}function Z(v,P){return v instanceof P||v!=null&&v.constructor!=null&&v.constructor.name!=null&&v.constructor.name===P.name}function te(v){return v!=v}const ie=function(){const v="0123456789abcdef",P=new Array(256);for(let O=0;O<16;++O){const U=16*O;for(let V=0;V<16;++V)P[U+V]=v[O]+v[V]}return P}();function j(v){return typeof BigInt>"u"?Oe:v}function Oe(){throw new Error("BigInt not supported")}},7007:o=>{var h,r=typeof Reflect=="object"?Reflect:null,a=r&&typeof r.apply=="function"?r.apply:function(E,I,N){return Function.prototype.apply.call(E,I,N)};h=r&&typeof r.ownKeys=="function"?r.ownKeys:Object.getOwnPropertySymbols?function(E){return Object.getOwnPropertyNames(E).concat(Object.getOwnPropertySymbols(E))}:function(E){return Object.getOwnPropertyNames(E)};var u=Number.isNaN||function(E){return E!=E};function l(){l.init.call(this)}o.exports=l,o.exports.once=function(E,I){return new Promise(function(N,A){function L(q){E.removeListener(I,D),A(q)}function D(){typeof E.removeListener=="function"&&E.removeListener("error",L),N([].slice.call(arguments))}y(E,I,D,{once:!0}),I!=="error"&&function(q,Y,Q){typeof q.on=="function"&&y(q,"error",Y,{once:!0})}(E,L)})},l.EventEmitter=l,l.prototype._events=void 0,l.prototype._eventsCount=0,l.prototype._maxListeners=void 0;var d=10;function _(E){if(typeof E!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof E)}function p(E){return E._maxListeners===void 0?l.defaultMaxListeners:E._maxListeners}function f(E,I,N,A){var L,D,q,Y;if(_(N),(D=E._events)===void 0?(D=E._events=Object.create(null),E._eventsCount=0):(D.newListener!==void 0&&(E.emit("newListener",I,N.listener?N.listener:N),D=E._events),q=D[I]),q===void 0)q=D[I]=N,++E._eventsCount;else if(typeof q=="function"?q=D[I]=A?[N,q]:[q,N]:A?q.unshift(N):q.push(N),(L=p(E))>0&&q.length>L&&!q.warned){q.warned=!0;var Q=new Error("Possible EventEmitter memory leak detected. "+q.length+" "+String(I)+" listeners added. Use emitter.setMaxListeners() to increase limit");Q.name="MaxListenersExceededWarning",Q.emitter=E,Q.type=I,Q.count=q.length,Y=Q,console&&console.warn&&console.warn(Y)}return E}function S(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function C(E,I,N){var A={fired:!1,wrapFn:void 0,target:E,type:I,listener:N},L=S.bind(A);return L.listener=N,A.wrapFn=L,L}function g(E,I,N){var A=E._events;if(A===void 0)return[];var L=A[I];return L===void 0?[]:typeof L=="function"?N?[L.listener||L]:[L]:N?function(D){for(var q=new Array(D.length),Y=0;Y<q.length;++Y)q[Y]=D[Y].listener||D[Y];return q}(L):T(L,L.length)}function m(E){var I=this._events;if(I!==void 0){var N=I[E];if(typeof N=="function")return 1;if(N!==void 0)return N.length}return 0}function T(E,I){for(var N=new Array(I),A=0;A<I;++A)N[A]=E[A];return N}function y(E,I,N,A){if(typeof E.on=="function")A.once?E.once(I,N):E.on(I,N);else{if(typeof E.addEventListener!="function")throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof E);E.addEventListener(I,function L(D){A.once&&E.removeEventListener(I,L),N(D)})}}Object.defineProperty(l,"defaultMaxListeners",{enumerable:!0,get:function(){return d},set:function(E){if(typeof E!="number"||E<0||u(E))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+E+".");d=E}}),l.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},l.prototype.setMaxListeners=function(E){if(typeof E!="number"||E<0||u(E))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+E+".");return this._maxListeners=E,this},l.prototype.getMaxListeners=function(){return p(this)},l.prototype.emit=function(E){for(var I=[],N=1;N<arguments.length;N++)I.push(arguments[N]);var A=E==="error",L=this._events;if(L!==void 0)A=A&&L.error===void 0;else if(!A)return!1;if(A){var D;if(I.length>0&&(D=I[0]),D instanceof Error)throw D;var q=new Error("Unhandled error."+(D?" ("+D.message+")":""));throw q.context=D,q}var Y=L[E];if(Y===void 0)return!1;if(typeof Y=="function")a(Y,this,I);else{var Q=Y.length,W=T(Y,Q);for(N=0;N<Q;++N)a(W[N],this,I)}return!0},l.prototype.addListener=function(E,I){return f(this,E,I,!1)},l.prototype.on=l.prototype.addListener,l.prototype.prependListener=function(E,I){return f(this,E,I,!0)},l.prototype.once=function(E,I){return _(I),this.on(E,C(this,E,I)),this},l.prototype.prependOnceListener=function(E,I){return _(I),this.prependListener(E,C(this,E,I)),this},l.prototype.removeListener=function(E,I){var N,A,L,D,q;if(_(I),(A=this._events)===void 0)return this;if((N=A[E])===void 0)return this;if(N===I||N.listener===I)--this._eventsCount==0?this._events=Object.create(null):(delete A[E],A.removeListener&&this.emit("removeListener",E,N.listener||I));else if(typeof N!="function"){for(L=-1,D=N.length-1;D>=0;D--)if(N[D]===I||N[D].listener===I){q=N[D].listener,L=D;break}if(L<0)return this;L===0?N.shift():function(Y,Q){for(;Q+1<Y.length;Q++)Y[Q]=Y[Q+1];Y.pop()}(N,L),N.length===1&&(A[E]=N[0]),A.removeListener!==void 0&&this.emit("removeListener",E,q||I)}return this},l.prototype.off=l.prototype.removeListener,l.prototype.removeAllListeners=function(E){var I,N,A;if((N=this._events)===void 0)return this;if(N.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):N[E]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete N[E]),this;if(arguments.length===0){var L,D=Object.keys(N);for(A=0;A<D.length;++A)(L=D[A])!=="removeListener"&&this.removeAllListeners(L);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(I=N[E])=="function")this.removeListener(E,I);else if(I!==void 0)for(A=I.length-1;A>=0;A--)this.removeListener(E,I[A]);return this},l.prototype.listeners=function(E){return g(this,E,!0)},l.prototype.rawListeners=function(E){return g(this,E,!1)},l.listenerCount=function(E,I){return typeof E.listenerCount=="function"?E.listenerCount(I):m.call(E,I)},l.prototype.listenerCount=m,l.prototype.eventNames=function(){return this._eventsCount>0?h(this._events):[]}},251:(o,h)=>{h.read=function(r,a,u,l,d){var _,p,f=8*d-l-1,S=(1<<f)-1,C=S>>1,g=-7,m=u?d-1:0,T=u?-1:1,y=r[a+m];for(m+=T,_=y&(1<<-g)-1,y>>=-g,g+=f;g>0;_=256*_+r[a+m],m+=T,g-=8);for(p=_&(1<<-g)-1,_>>=-g,g+=l;g>0;p=256*p+r[a+m],m+=T,g-=8);if(_===0)_=1-C;else{if(_===S)return p?NaN:1/0*(y?-1:1);p+=Math.pow(2,l),_-=C}return(y?-1:1)*p*Math.pow(2,_-l)},h.write=function(r,a,u,l,d,_){var p,f,S,C=8*_-d-1,g=(1<<C)-1,m=g>>1,T=d===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=l?0:_-1,E=l?1:-1,I=a<0||a===0&&1/a<0?1:0;for(a=Math.abs(a),isNaN(a)||a===1/0?(f=isNaN(a)?1:0,p=g):(p=Math.floor(Math.log(a)/Math.LN2),a*(S=Math.pow(2,-p))<1&&(p--,S*=2),(a+=p+m>=1?T/S:T*Math.pow(2,1-m))*S>=2&&(p++,S/=2),p+m>=g?(f=0,p=g):p+m>=1?(f=(a*S-1)*Math.pow(2,d),p+=m):(f=a*Math.pow(2,m-1)*Math.pow(2,d),p=0));d>=8;r[u+y]=255&f,y+=E,f/=256,d-=8);for(p=p<<d|f,C+=d;C>0;r[u+y]=255&p,y+=E,p/=256,C-=8);r[u+y-E]|=128*I}},5837:()=>{},97:()=>{},5594:()=>{},886:()=>{},7625:()=>{},595:(o,h)=>{Object.defineProperty(h,"__esModule",{value:!0});var r={},a=function(b,w,G,K,ue){var pe=new Worker(r[w]||(r[w]=URL.createObjectURL(new Blob([b+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return pe.onmessage=function(ve){var ye=ve.data,Le=ye.$e$;if(Le){var Ie=new Error(Le[0]);Ie.code=Le[1],Ie.stack=Le[2],ue(Ie,null)}else ue(null,ye)},pe.postMessage(G,K),pe},u=Uint8Array,l=Uint16Array,d=Int32Array,_=new u([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),p=new u([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),f=new u([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),S=function(b,w){for(var G=new l(31),K=0;K<31;++K)G[K]=w+=1<<b[K-1];var ue=new d(G[30]);for(K=1;K<30;++K)for(var pe=G[K];pe<G[K+1];++pe)ue[pe]=pe-G[K]<<5|K;return{b:G,r:ue}},C=S(_,2),g=C.b,m=C.r;g[28]=258,m[258]=28;for(var T=S(p,0),y=T.b,E=T.r,I=new l(32768),N=0;N<32768;++N){var A=(43690&N)>>1|(21845&N)<<1;A=(61680&(A=(52428&A)>>2|(13107&A)<<2))>>4|(3855&A)<<4,I[N]=((65280&A)>>8|(255&A)<<8)>>1}var L=function(b,w,G){for(var K=b.length,ue=0,pe=new l(w);ue<K;++ue)b[ue]&&++pe[b[ue]-1];var ve,ye=new l(w);for(ue=1;ue<w;++ue)ye[ue]=ye[ue-1]+pe[ue-1]<<1;if(G){ve=new l(1<<w);var Le=15-w;for(ue=0;ue<K;++ue)if(b[ue])for(var Ie=ue<<4|b[ue],De=w-b[ue],be=ye[b[ue]-1]++<<De,Fe=be|(1<<De)-1;be<=Fe;++be)ve[I[be]>>Le]=Ie}else for(ve=new l(K),ue=0;ue<K;++ue)b[ue]&&(ve[ue]=I[ye[b[ue]-1]++]>>15-b[ue]);return ve},D=new u(288);for(N=0;N<144;++N)D[N]=8;for(N=144;N<256;++N)D[N]=9;for(N=256;N<280;++N)D[N]=7;for(N=280;N<288;++N)D[N]=8;var q=new u(32);for(N=0;N<32;++N)q[N]=5;var Y=L(D,9,0),Q=L(D,9,1),W=L(q,5,0),x=L(q,5,1),k=function(b){for(var w=b[0],G=1;G<b.length;++G)b[G]>w&&(w=b[G]);return w},J=function(b,w,G){var K=w/8|0;return(b[K]|b[K+1]<<8)>>(7&w)&G},F=function(b,w){var G=w/8|0;return(b[G]|b[G+1]<<8|b[G+2]<<16)>>(7&w)},$=function(b){return(b+7)/8|0},R=function(b,w,G){return(w==null||w<0)&&(w=0),(G==null||G>b.length)&&(G=b.length),new u(b.subarray(w,G))};h.FlateErrorCode={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14};var B=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],M=function(b,w,G){var K=new Error(w||B[b]);if(K.code=b,Error.captureStackTrace&&Error.captureStackTrace(K,M),!G)throw K;return K},re=function(b,w,G,K){var ue=b.length,pe=K?K.length:0;if(!ue||w.f&&!w.l)return G||new u(0);var ve=!G,ye=ve||w.i!=2,Le=w.i;ve&&(G=new u(3*ue));var Ie=function(As){var Hr=G.length;if(As>Hr){var Yr=new u(Math.max(2*Hr,As));Yr.set(G),G=Yr}},De=w.f||0,be=w.p||0,Fe=w.b||0,Ye=w.l,ze=w.d,Qe=w.m,Ge=w.n,Ve=8*ue;do{if(!Ye){De=J(b,be,1);var rt=J(b,be+1,3);if(be+=3,!rt){var Ze=b[(ot=$(be)+4)-4]|b[ot-3]<<8,Xe=ot+Ze;if(Xe>ue){Le&&M(0);break}ye&&Ie(Fe+Ze),G.set(b.subarray(ot,Xe),Fe),w.b=Fe+=Ze,w.p=be=8*Xe,w.f=De;continue}if(rt==1)Ye=Q,ze=x,Qe=9,Ge=5;else if(rt==2){var st=J(b,be,31)+257,lt=J(b,be+10,15)+4,Ke=st+J(b,be+5,31)+1;be+=14;for(var We=new u(Ke),$e=new u(19),Je=0;Je<lt;++Je)$e[f[Je]]=J(b,be+3*Je,7);be+=3*lt;var Nt=k($e),dt=(1<<Nt)-1,yt=L($e,Nt,1);for(Je=0;Je<Ke;){var ot,It=yt[J(b,be,dt)];if(be+=15&It,(ot=It>>4)<16)We[Je++]=ot;else{var wt=0,_t=0;for(ot==16?(_t=3+J(b,be,3),be+=2,wt=We[Je-1]):ot==17?(_t=3+J(b,be,7),be+=3):ot==18&&(_t=11+J(b,be,127),be+=7);_t--;)We[Je++]=wt}}var Wt=We.subarray(0,st),Mt=We.subarray(st);Qe=k(Wt),Ge=k(Mt),Ye=L(Wt,Qe,1),ze=L(Mt,Ge,1)}else M(1);if(be>Ve){Le&&M(0);break}}ye&&Ie(Fe+131072);for(var Cr=(1<<Qe)-1,dn=(1<<Ge)-1,Bn=be;;Bn=be){var rn=(wt=Ye[F(b,be)&Cr])>>4;if((be+=15&wt)>Ve){Le&&M(0);break}if(wt||M(2),rn<256)G[Fe++]=rn;else{if(rn==256){Bn=be,Ye=null;break}var pn=rn-254;if(rn>264){var Ct=_[Je=rn-257];pn=J(b,be,(1<<Ct)-1)+g[Je],be+=Ct}var Dn=ze[F(b,be)&dn],Vr=Dn>>4;if(Dn||M(3),be+=15&Dn,Mt=y[Vr],Vr>3&&(Ct=p[Vr],Mt+=F(b,be)&(1<<Ct)-1,be+=Ct),be>Ve){Le&&M(0);break}ye&&Ie(Fe+131072);var jr=Fe+pn;if(Fe<Mt){var Os=pe-Mt,Pi=Math.min(Mt,jr);for(Os+Fe<0&&M(3);Fe<Pi;++Fe)G[Fe]=K[Os+Fe]}for(;Fe<jr;++Fe)G[Fe]=G[Fe-Mt]}}w.l=Ye,w.p=Bn,w.b=Fe,w.f=De,Ye&&(De=1,w.m=Qe,w.d=ze,w.n=Ge)}while(!De);return Fe!=G.length&&ve?R(G,0,Fe):G.subarray(0,Fe)},se=function(b,w,G){G<<=7&w;var K=w/8|0;b[K]|=G,b[K+1]|=G>>8},fe=function(b,w,G){G<<=7&w;var K=w/8|0;b[K]|=G,b[K+1]|=G>>8,b[K+2]|=G>>16},ce=function(b,w){for(var G=[],K=0;K<b.length;++K)b[K]&&G.push({s:K,f:b[K]});var ue=G.length,pe=G.slice();if(!ue)return{t:ee,l:0};if(ue==1){var ve=new u(G[0].s+1);return ve[G[0].s]=1,{t:ve,l:1}}G.sort(function(st,lt){return st.f-lt.f}),G.push({s:-1,f:25001});var ye=G[0],Le=G[1],Ie=0,De=1,be=2;for(G[0]={s:-1,f:ye.f+Le.f,l:ye,r:Le};De!=ue-1;)ye=G[G[Ie].f<G[be].f?Ie++:be++],Le=G[Ie!=De&&G[Ie].f<G[be].f?Ie++:be++],G[De++]={s:-1,f:ye.f+Le.f,l:ye,r:Le};var Fe=pe[0].s;for(K=1;K<ue;++K)pe[K].s>Fe&&(Fe=pe[K].s);var Ye=new l(Fe+1),ze=Te(G[De-1],Ye,0);if(ze>w){K=0;var Qe=0,Ge=ze-w,Ve=1<<Ge;for(pe.sort(function(st,lt){return Ye[lt.s]-Ye[st.s]||st.f-lt.f});K<ue;++K){var rt=pe[K].s;if(!(Ye[rt]>w))break;Qe+=Ve-(1<<ze-Ye[rt]),Ye[rt]=w}for(Qe>>=Ge;Qe>0;){var Ze=pe[K].s;Ye[Ze]<w?Qe-=1<<w-Ye[Ze]++-1:++K}for(;K>=0&&Qe;--K){var Xe=pe[K].s;Ye[Xe]==w&&(--Ye[Xe],++Qe)}ze=w}return{t:new u(Ye),l:ze}},Te=function(b,w,G){return b.s==-1?Math.max(Te(b.l,w,G+1),Te(b.r,w,G+1)):w[b.s]=G},Ee=function(b){for(var w=b.length;w&&!b[--w];);for(var G=new l(++w),K=0,ue=b[0],pe=1,ve=function(Le){G[K++]=Le},ye=1;ye<=w;++ye)if(b[ye]==ue&&ye!=w)++pe;else{if(!ue&&pe>2){for(;pe>138;pe-=138)ve(32754);pe>2&&(ve(pe>10?pe-11<<5|28690:pe-3<<5|12305),pe=0)}else if(pe>3){for(ve(ue),--pe;pe>6;pe-=6)ve(8304);pe>2&&(ve(pe-3<<5|8208),pe=0)}for(;pe--;)ve(ue);pe=1,ue=b[ye]}return{c:G.subarray(0,K),n:w}},he=function(b,w){for(var G=0,K=0;K<w.length;++K)G+=b[K]*w[K];return G},ge=function(b,w,G){var K=G.length,ue=$(w+2);b[ue]=255&K,b[ue+1]=K>>8,b[ue+2]=255^b[ue],b[ue+3]=255^b[ue+1];for(var pe=0;pe<K;++pe)b[ue+pe+4]=G[pe];return 8*(ue+4+K)},X=function(b,w,G,K,ue,pe,ve,ye,Le,Ie,De){se(w,De++,G),++ue[256];for(var be=ce(ue,15),Fe=be.t,Ye=be.l,ze=ce(pe,15),Qe=ze.t,Ge=ze.l,Ve=Ee(Fe),rt=Ve.c,Ze=Ve.n,Xe=Ee(Qe),st=Xe.c,lt=Xe.n,Ke=new l(19),We=0;We<rt.length;++We)++Ke[31&rt[We]];for(We=0;We<st.length;++We)++Ke[31&st[We]];for(var $e=ce(Ke,7),Je=$e.t,Nt=$e.l,dt=19;dt>4&&!Je[f[dt-1]];--dt);var yt,ot,It,wt,_t=Ie+5<<3,Wt=he(ue,D)+he(pe,q)+ve,Mt=he(ue,Fe)+he(pe,Qe)+ve+14+3*dt+he(Ke,Je)+2*Ke[16]+3*Ke[17]+7*Ke[18];if(Le>=0&&_t<=Wt&&_t<=Mt)return ge(w,De,b.subarray(Le,Le+Ie));if(se(w,De,1+(Mt<Wt)),De+=2,Mt<Wt){yt=L(Fe,Ye,0),ot=Fe,It=L(Qe,Ge,0),wt=Qe;var Cr=L(Je,Nt,0);for(se(w,De,Ze-257),se(w,De+5,lt-1),se(w,De+10,dt-4),De+=14,We=0;We<dt;++We)se(w,De+3*We,Je[f[We]]);De+=3*dt;for(var dn=[rt,st],Bn=0;Bn<2;++Bn){var rn=dn[Bn];for(We=0;We<rn.length;++We){var pn=31&rn[We];se(w,De,Cr[pn]),De+=Je[pn],pn>15&&(se(w,De,rn[We]>>5&127),De+=rn[We]>>12)}}}else yt=Y,ot=D,It=W,wt=q;for(We=0;We<ye;++We){var Ct=K[We];if(Ct>255){fe(w,De,yt[257+(pn=Ct>>18&31)]),De+=ot[pn+257],pn>7&&(se(w,De,Ct>>23&31),De+=_[pn]);var Dn=31&Ct;fe(w,De,It[Dn]),De+=wt[Dn],Dn>3&&(fe(w,De,Ct>>5&8191),De+=p[Dn])}else fe(w,De,yt[Ct]),De+=ot[Ct]}return fe(w,De,yt[256]),De+ot[256]},ae=new d([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ee=new u(0),Re=function(b,w,G,K,ue,pe){var ve=pe.z||b.length,ye=new u(K+ve+5*(1+Math.ceil(ve/7e3))+ue),Le=ye.subarray(K,ye.length-ue),Ie=pe.l,De=7&(pe.r||0);if(w){De&&(Le[0]=pe.r>>3);for(var be=ae[w-1],Fe=be>>13,Ye=8191&be,ze=(1<<G)-1,Qe=pe.p||new l(32768),Ge=pe.h||new l(ze+1),Ve=Math.ceil(G/3),rt=2*Ve,Ze=function(Yr){return(b[Yr]^b[Yr+1]<<Ve^b[Yr+2]<<rt)&ze},Xe=new d(25e3),st=new l(288),lt=new l(32),Ke=0,We=0,$e=pe.i||0,Je=0,Nt=pe.w||0,dt=0;$e+2<ve;++$e){var yt=Ze($e),ot=32767&$e,It=Ge[yt];if(Qe[ot]=It,Ge[yt]=ot,Nt<=$e){var wt=ve-$e;if((Ke>7e3||Je>24576)&&(wt>423||!Ie)){De=X(b,Le,0,Xe,st,lt,We,Je,dt,$e-dt,De),Je=Ke=We=0,dt=$e;for(var _t=0;_t<286;++_t)st[_t]=0;for(_t=0;_t<30;++_t)lt[_t]=0}var Wt=2,Mt=0,Cr=Ye,dn=ot-It&32767;if(wt>2&&yt==Ze($e-dn))for(var Bn=Math.min(Fe,wt)-1,rn=Math.min(32767,$e),pn=Math.min(258,wt);dn<=rn&&--Cr&&ot!=It;){if(b[$e+Wt]==b[$e+Wt-dn]){for(var Ct=0;Ct<pn&&b[$e+Ct]==b[$e+Ct-dn];++Ct);if(Ct>Wt){if(Wt=Ct,Mt=dn,Ct>Bn)break;var Dn=Math.min(dn,Ct-2),Vr=0;for(_t=0;_t<Dn;++_t){var jr=$e-dn+_t&32767,Os=jr-Qe[jr]&32767;Os>Vr&&(Vr=Os,It=jr)}}}dn+=(ot=It)-(It=Qe[ot])&32767}if(Mt){Xe[Je++]=268435456|m[Wt]<<18|E[Mt];var Pi=31&m[Wt],As=31&E[Mt];We+=_[Pi]+p[As],++st[257+Pi],++lt[As],Nt=$e+Wt,++Ke}else Xe[Je++]=b[$e],++st[b[$e]]}}for($e=Math.max($e,Nt);$e<ve;++$e)Xe[Je++]=b[$e],++st[b[$e]];De=X(b,Le,Ie,Xe,st,lt,We,Je,dt,$e-dt,De),Ie||(pe.r=7&De|Le[De/8|0]<<3,De-=7,pe.h=Ge,pe.p=Qe,pe.i=$e,pe.w=Nt)}else{for($e=pe.w||0;$e<ve+Ie;$e+=65535){var Hr=$e+65535;Hr>=ve&&(Le[De/8|0]=Ie,Hr=ve),De=ge(Le,De+1,b.subarray($e,Hr))}pe.i=ve}return R(ye,0,K+$(De)+ue)},me=function(){for(var b=new Int32Array(256),w=0;w<256;++w){for(var G=w,K=9;--K;)G=(1&G&&-306674912)^G>>>1;b[w]=G}return b}(),Pe=function(){var b=-1;return{p:function(w){for(var G=b,K=0;K<w.length;++K)G=me[255&G^w[K]]^G>>>8;b=G},d:function(){return~b}}},H=function(){var b=1,w=0;return{p:function(G){for(var K=b,ue=w,pe=0|G.length,ve=0;ve!=pe;){for(var ye=Math.min(ve+2655,pe);ve<ye;++ve)ue+=K+=G[ve];K=(65535&K)+15*(K>>16),ue=(65535&ue)+15*(ue>>16)}b=K,w=ue},d:function(){return(255&(b%=65521))<<24|(65280&b)<<8|(255&(w%=65521))<<8|w>>8}}},Z=function(b,w,G,K,ue){if(!ue&&(ue={l:1},w.dictionary)){var pe=w.dictionary.subarray(-32768),ve=new u(pe.length+b.length);ve.set(pe),ve.set(b,pe.length),b=ve,ue.w=pe.length}return Re(b,w.level==null?6:w.level,w.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(b.length)))):12+w.mem,G,K,ue)},te=function(b,w){var G={};for(var K in b)G[K]=b[K];for(var K in w)G[K]=w[K];return G},ie=function(b,w,G){for(var K=b(),ue=b.toString(),pe=ue.slice(ue.indexOf("[")+1,ue.lastIndexOf("]")).replace(/\s+/g,"").split(","),ve=0;ve<K.length;++ve){var ye=K[ve],Le=pe[ve];if(typeof ye=="function"){w+=";"+Le+"=";var Ie=ye.toString();if(ye.prototype)if(Ie.indexOf("[native code]")!=-1){var De=Ie.indexOf(" ",8)+1;w+=Ie.slice(De,Ie.indexOf("(",De))}else for(var be in w+=Ie,ye.prototype)w+=";"+Le+".prototype."+be+"="+ye.prototype[be].toString();else w+=Ie}else G[Le]=ye}return w},j=[],Oe=function(b,w,G,K){if(!j[G]){for(var ue="",pe={},ve=b.length-1,ye=0;ye<ve;++ye)ue=ie(b[ye],ue,pe);j[G]={c:ie(b[ve],ue,pe),e:pe}}var Le=te({},j[G].e);return a(j[G].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+w.toString()+"}",G,Le,function(Ie){var De=[];for(var be in Ie)Ie[be].buffer&&De.push((Ie[be]=new Ie[be].constructor(Ie[be])).buffer);return De}(Le),K)},v=function(){return[u,l,d,_,p,f,g,y,Q,x,I,B,L,k,J,F,$,R,M,re,In,ne,de]},P=function(){return[u,l,d,_,p,f,m,E,Y,D,W,q,I,ae,ee,L,se,fe,ce,Te,Ee,he,ge,X,$,R,Re,Z,$t,ne]},O=function(){return[ct,et,Be,Pe,me]},U=function(){return[Gt,Ne]},V=function(){return[xe,Be,H]},z=function(){return[He]},ne=function(b){return postMessage(b,[b.buffer])},de=function(b){return b&&{out:b.size&&new u(b.size),dictionary:b.dictionary}},_e=function(b,w,G,K,ue,pe){var ve=Oe(G,K,ue,function(ye,Le){ve.terminate(),pe(ye,Le)});return ve.postMessage([b,w],w.consume?[b.buffer]:[]),function(){ve.terminate()}},we=function(b){return b.ondata=function(w,G){return postMessage([w,G],[w.buffer])},function(w){return b.push(w.data[0],w.data[1])}},oe=function(b,w,G,K,ue,pe){var ve,ye=Oe(b,K,ue,function(Le,Ie){Le?(ye.terminate(),w.ondata.call(w,Le)):Array.isArray(Ie)?(Ie[1]&&ye.terminate(),w.ondata.call(w,Le,Ie[0],Ie[1])):pe(Ie)});ye.postMessage(G),w.push=function(Le,Ie){w.ondata||M(5),ve&&w.ondata(M(4,0,1),null,!!Ie),ye.postMessage([Le,ve=Ie],[Le.buffer])},w.terminate=function(){ye.terminate()}},Se=function(b,w){return b[w]|b[w+1]<<8},Ce=function(b,w){return(b[w]|b[w+1]<<8|b[w+2]<<16|b[w+3]<<24)>>>0},je=function(b,w){return Ce(b,w)+4294967296*Ce(b,w+4)},Be=function(b,w,G){for(;G;++w)b[w]=G,G>>>=8},ct=function(b,w){var G=w.filename;if(b[0]=31,b[1]=139,b[2]=8,b[8]=w.level<2?4:w.level==9?2:0,b[9]=3,w.mtime!=0&&Be(b,4,Math.floor(new Date(w.mtime||Date.now())/1e3)),G){b[3]=8;for(var K=0;K<=G.length;++K)b[K+10]=G.charCodeAt(K)}},Gt=function(b){b[0]==31&&b[1]==139&&b[2]==8||M(6,"invalid gzip data");var w=b[3],G=10;4&w&&(G+=2+(b[10]|b[11]<<8));for(var K=(w>>3&1)+(w>>4&1);K>0;K-=!b[G++]);return G+(2&w)},Ne=function(b){var w=b.length;return(b[w-4]|b[w-3]<<8|b[w-2]<<16|b[w-1]<<24)>>>0},et=function(b){return 10+(b.filename?b.filename.length+1:0)},xe=function(b,w){var G=w.level,K=G==0?0:G<6?1:G==9?3:2;if(b[0]=120,b[1]=K<<6|(w.dictionary&&32),b[1]|=31-(b[0]<<8|b[1])%31,w.dictionary){var ue=H();ue.p(w.dictionary),Be(b,2,ue.d())}},He=function(b,w){return((15&b[0])!=8||b[0]>>4>7||(b[0]<<8|b[1])%31)&&M(6,"invalid zlib data"),(b[1]>>5&1)==+!w&&M(6,"invalid zlib data: "+(32&b[1]?"need":"unexpected")+" dictionary"),2+(b[1]>>3&4)};function at(b,w){return typeof b=="function"&&(w=b,b={}),this.ondata=w,b}var Ue=function(){function b(w,G){if(typeof w=="function"&&(G=w,w={}),this.ondata=G,this.o=w||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new u(98304),this.o.dictionary){var K=this.o.dictionary.subarray(-32768);this.b.set(K,32768-K.length),this.s.i=32768-K.length}}return b.prototype.p=function(w,G){this.ondata(Z(w,this.o,0,0,this.s),G)},b.prototype.push=function(w,G){this.ondata||M(5),this.s.l&&M(4);var K=w.length+this.s.z;if(K>this.b.length){if(K>2*this.b.length-32768){var ue=new u(-32768&K);ue.set(this.b.subarray(0,this.s.z)),this.b=ue}var pe=this.b.length-this.s.z;pe&&(this.b.set(w.subarray(0,pe),this.s.z),this.s.z=this.b.length,this.p(this.b,!1)),this.b.set(this.b.subarray(-32768)),this.b.set(w.subarray(pe),32768),this.s.z=w.length-pe+32768,this.s.i=32766,this.s.w=32768}else this.b.set(w,this.s.z),this.s.z+=w.length;this.s.l=1&G,(this.s.z>this.s.w+8191||G)&&(this.p(this.b,G||!1),this.s.w=this.s.i,this.s.i-=2)},b}();h.Deflate=Ue;var At=function(){return function(b,w){oe([P,function(){return[we,Ue]}],this,at.call(this,b,w),function(G){var K=new Ue(G.data);onmessage=we(K)},6)}}();function qe(b,w,G){return G||(G=w,w={}),typeof G!="function"&&M(7),_e(b,w,[P],function(K){return ne($t(K.data[0],K.data[1]))},0,G)}function $t(b,w){return Z(b,w||{},0,0)}h.AsyncDeflate=At,h.deflate=qe,h.deflateSync=$t;var Tt=function(){function b(w,G){typeof w=="function"&&(G=w,w={}),this.ondata=G;var K=w&&w.dictionary&&w.dictionary.subarray(-32768);this.s={i:0,b:K?K.length:0},this.o=new u(32768),this.p=new u(0),K&&this.o.set(K)}return b.prototype.e=function(w){if(this.ondata||M(5),this.d&&M(4),this.p.length){if(w.length){var G=new u(this.p.length+w.length);G.set(this.p),G.set(w,this.p.length),this.p=G}}else this.p=w},b.prototype.c=function(w){this.s.i=+(this.d=w||!1);var G=this.s.b,K=re(this.p,this.s,this.o);this.ondata(R(K,G,this.s.b),this.d),this.o=R(K,this.s.b-32768),this.s.b=this.o.length,this.p=R(this.p,this.s.p/8|0),this.s.p&=7},b.prototype.push=function(w,G){this.e(w),this.c(G)},b}();h.Inflate=Tt;var nn=function(){return function(b,w){oe([v,function(){return[we,Tt]}],this,at.call(this,b,w),function(G){var K=new Tt(G.data);onmessage=we(K)},7)}}();function hn(b,w,G){return G||(G=w,w={}),typeof G!="function"&&M(7),_e(b,w,[v],function(K){return ne(In(K.data[0],de(K.data[1])))},1,G)}function In(b,w){return re(b,{i:2},w&&w.out,w&&w.dictionary)}h.AsyncInflate=nn,h.inflate=hn,h.inflateSync=In;var Gr=function(){function b(w,G){this.c=Pe(),this.l=0,this.v=1,Ue.call(this,w,G)}return b.prototype.push=function(w,G){this.c.p(w),this.l+=w.length,Ue.prototype.push.call(this,w,G)},b.prototype.p=function(w,G){var K=Z(w,this.o,this.v&&et(this.o),G&&8,this.s);this.v&&(ct(K,this.o),this.v=0),G&&(Be(K,K.length-8,this.c.d()),Be(K,K.length-4,this.l)),this.ondata(K,G)},b}();h.Gzip=Gr,h.Compress=Gr;var $r=function(){return function(b,w){oe([P,O,function(){return[we,Ue,Gr]}],this,at.call(this,b,w),function(G){var K=new Gr(G.data);onmessage=we(K)},8)}}();function Wr(b,w,G){return G||(G=w,w={}),typeof G!="function"&&M(7),_e(b,w,[P,O,function(){return[Ri]}],function(K){return ne(Ri(K.data[0],K.data[1]))},2,G)}function Ri(b,w){w||(w={});var G=Pe(),K=b.length;G.p(b);var ue=Z(b,w,et(w),8),pe=ue.length;return ct(ue,w),Be(ue,pe-8,G.d()),Be(ue,pe-4,K),ue}h.AsyncGzip=$r,h.AsyncCompress=$r,h.gzip=Wr,h.compress=Wr,h.gzipSync=Ri,h.compressSync=Ri;var vi=function(){function b(w,G){this.v=1,this.r=0,Tt.call(this,w,G)}return b.prototype.push=function(w,G){if(Tt.prototype.e.call(this,w),this.r+=w.length,this.v){var K=this.p.subarray(this.v-1),ue=K.length>3?Gt(K):4;if(ue>K.length){if(!G)return}else this.v>1&&this.onmember&&this.onmember(this.r-K.length);this.p=K.subarray(ue),this.v=0}Tt.prototype.c.call(this,G),this.s.f&&!this.s.l&&(this.v=$(this.s.p)+9,this.s={i:0},this.o=new u(0),this.p.length&&this.push(new u(0),G))},b}();h.Gunzip=vi;var Ku=function(){return function(b,w){var G=this;oe([v,U,function(){return[we,Tt,vi]}],this,at.call(this,b,w),function(K){var ue=new vi(K.data);ue.onmember=function(pe){return postMessage(pe)},onmessage=we(ue)},9,function(K){return G.onmember&&G.onmember(K)})}}();function Xu(b,w,G){return G||(G=w,w={}),typeof G!="function"&&M(7),_e(b,w,[v,U,function(){return[Ni]}],function(K){return ne(Ni(K.data[0],K.data[1]))},3,G)}function Ni(b,w){var G=Gt(b);return G+8>b.length&&M(6,"invalid gzip data"),re(b.subarray(G,-8),{i:2},w&&w.out||new u(Ne(b)),w&&w.dictionary)}h.AsyncGunzip=Ku,h.gunzip=Xu,h.gunzipSync=Ni;var la=function(){function b(w,G){this.c=H(),this.v=1,Ue.call(this,w,G)}return b.prototype.push=function(w,G){this.c.p(w),Ue.prototype.push.call(this,w,G)},b.prototype.p=function(w,G){var K=Z(w,this.o,this.v&&(this.o.dictionary?6:2),G&&4,this.s);this.v&&(xe(K,this.o),this.v=0),G&&Be(K,K.length-4,this.c.d()),this.ondata(K,G)},b}();h.Zlib=la;var wf=function(){return function(b,w){oe([P,V,function(){return[we,Ue,la]}],this,at.call(this,b,w),function(G){var K=new la(G.data);onmessage=we(K)},10)}}();function ua(b,w){w||(w={});var G=H();G.p(b);var K=Z(b,w,w.dictionary?6:2,4);return xe(K,w),Be(K,K.length-4,G.d()),K}h.AsyncZlib=wf,h.zlib=function(b,w,G){return G||(G=w,w={}),typeof G!="function"&&M(7),_e(b,w,[P,V,function(){return[ua]}],function(K){return ne(ua(K.data[0],K.data[1]))},4,G)},h.zlibSync=ua;var Oi=function(){function b(w,G){Tt.call(this,w,G),this.v=w&&w.dictionary?2:1}return b.prototype.push=function(w,G){if(Tt.prototype.e.call(this,w),this.v){if(this.p.length<6&&!G)return;this.p=this.p.subarray(He(this.p,this.v-1)),this.v=0}G&&(this.p.length<4&&M(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),Tt.prototype.c.call(this,G)},b}();h.Unzlib=Oi;var Ju=function(){return function(b,w){oe([v,z,function(){return[we,Tt,Oi]}],this,at.call(this,b,w),function(G){var K=new Oi(G.data);onmessage=we(K)},11)}}();function Zu(b,w,G){return G||(G=w,w={}),typeof G!="function"&&M(7),_e(b,w,[v,z,function(){return[Ai]}],function(K){return ne(Ai(K.data[0],de(K.data[1])))},5,G)}function Ai(b,w){return re(b.subarray(He(b,w&&w.dictionary),-4),{i:2},w&&w.out,w&&w.dictionary)}h.AsyncUnzlib=Ju,h.unzlib=Zu,h.unzlibSync=Ai;var ca=function(){function b(w,G){this.G=vi,this.I=Tt,this.Z=Oi,this.o=at.call(this,w,G)||{}}return b.prototype.push=function(w,G){if(this.ondata||M(5),this.s)this.s.push(w,G);else{if(this.p&&this.p.length){var K=new u(this.p.length+w.length);K.set(this.p),K.set(w,this.p.length)}else this.p=w;if(this.p.length>2){var ue=this,pe=function(){ue.ondata.apply(ue,arguments)};this.s=this.p[0]==31&&this.p[1]==139&&this.p[2]==8?new this.G(this.o,pe):(15&this.p[0])!=8||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(this.o,pe):new this.Z(this.o,pe),this.s.push(this.p,G),this.p=null}}},b}();h.Decompress=ca;var Pf=function(){function b(w,G){this.G=Ku,this.I=nn,this.Z=Ju,ca.call(this,w,G)}return b.prototype.push=function(w,G){ca.prototype.push.call(this,w,G)},b}();h.AsyncDecompress=Pf,h.decompress=function(b,w,G){return G||(G=w,w={}),typeof G!="function"&&M(7),b[0]==31&&b[1]==139&&b[2]==8?Xu(b,w,G):(15&b[0])!=8||b[0]>>4>7||(b[0]<<8|b[1])%31?hn(b,w,G):Zu(b,w,G)},h.decompressSync=function(b,w){return b[0]==31&&b[1]==139&&b[2]==8?Ni(b,w):(15&b[0])!=8||b[0]>>4>7||(b[0]<<8|b[1])%31?In(b,w):Ai(b,w)};var ha=function(b,w,G,K){for(var ue in b){var pe=b[ue],ve=w+ue,ye=K;Array.isArray(pe)&&(ye=te(K,pe[1]),pe=pe[0]),pe instanceof u?G[ve]=[pe,ye]:(G[ve+="/"]=[new u(0),ye],ha(pe,ve,G,K))}},ec=typeof TextEncoder<"u"&&new TextEncoder,da=typeof TextDecoder<"u"&&new TextDecoder,tc=0;try{da.decode(ee,{stream:!0}),tc=1}catch{}var nc=function(b){for(var w="",G=0;;){var K=b[G++],ue=(K>127)+(K>223)+(K>239);if(G+ue>b.length)return{s:w,r:R(b,G-1)};ue?ue==3?(K=((15&K)<<18|(63&b[G++])<<12|(63&b[G++])<<6|63&b[G++])-65536,w+=String.fromCharCode(55296|K>>10,56320|1023&K)):w+=1&ue?String.fromCharCode((31&K)<<6|63&b[G++]):String.fromCharCode((15&K)<<12|(63&b[G++])<<6|63&b[G++]):w+=String.fromCharCode(K)}},Df=function(){function b(w){this.ondata=w,tc?this.t=new TextDecoder:this.p=ee}return b.prototype.push=function(w,G){if(this.ondata||M(5),G=!!G,this.t)return this.ondata(this.t.decode(w,{stream:!0}),G),void(G&&(this.t.decode().length&&M(8),this.t=null));this.p||M(4);var K=new u(this.p.length+w.length);K.set(this.p),K.set(w,this.p.length);var ue=nc(K),pe=ue.s,ve=ue.r;G?(ve.length&&M(8),this.p=null):this.p=ve,this.ondata(pe,G)},b}();h.DecodeUTF8=Df;var Mf=function(){function b(w){this.ondata=w}return b.prototype.push=function(w,G){this.ondata||M(5),this.d&&M(4),this.ondata(Xn(w),this.d=G||!1)},b}();function Xn(b,w){if(w){for(var G=new u(b.length),K=0;K<b.length;++K)G[K]=b.charCodeAt(K);return G}if(ec)return ec.encode(b);var ue=b.length,pe=new u(b.length+(b.length>>1)),ve=0,ye=function(De){pe[ve++]=De};for(K=0;K<ue;++K){if(ve+5>pe.length){var Le=new u(ve+8+(ue-K<<1));Le.set(pe),pe=Le}var Ie=b.charCodeAt(K);Ie<128||w?ye(Ie):Ie<2048?(ye(192|Ie>>6),ye(128|63&Ie)):Ie>55295&&Ie<57344?(ye(240|(Ie=65536+(1047552&Ie)|1023&b.charCodeAt(++K))>>18),ye(128|Ie>>12&63),ye(128|Ie>>6&63),ye(128|63&Ie)):(ye(224|Ie>>12),ye(128|Ie>>6&63),ye(128|63&Ie))}return R(pe,0,ve)}function pa(b,w){if(w){for(var G="",K=0;K<b.length;K+=16384)G+=String.fromCharCode.apply(null,b.subarray(K,K+16384));return G}if(da)return da.decode(b);var ue=nc(b),pe=ue.s;return(G=ue.r).length&&M(8),pe}h.EncodeUTF8=Mf,h.strToU8=Xn,h.strFromU8=pa;var rc=function(b){return b==1?3:b<6?2:b==9?1:0},sc=function(b,w){return w+30+Se(b,w+26)+Se(b,w+28)},ic=function(b,w,G){var K=Se(b,w+28),ue=pa(b.subarray(w+46,w+46+K),!(2048&Se(b,w+8))),pe=w+46+K,ve=Ce(b,w+20),ye=G&&ve==4294967295?oc(b,pe):[ve,Ce(b,w+24),Ce(b,w+42)],Le=ye[0],Ie=ye[1],De=ye[2];return[Se(b,w+10),Le,Ie,ue,pe+Se(b,w+30)+Se(b,w+32),De]},oc=function(b,w){for(;Se(b,w)!=1;w+=4+Se(b,w+2));return[je(b,w+12),je(b,w+4),je(b,w+20)]},Jn=function(b){var w=0;if(b)for(var G in b){var K=b[G].length;K>65535&&M(9),w+=K+4}return w},qr=function(b,w,G,K,ue,pe,ve,ye){var Le=K.length,Ie=G.extra,De=ye&&ye.length,be=Jn(Ie);Be(b,w,ve!=null?33639248:67324752),w+=4,ve!=null&&(b[w++]=20,b[w++]=G.os),b[w]=20,w+=2,b[w++]=G.flag<<1|(pe<0&&8),b[w++]=ue&&8,b[w++]=255&G.compression,b[w++]=G.compression>>8;var Fe=new Date(G.mtime==null?Date.now():G.mtime),Ye=Fe.getFullYear()-1980;if((Ye<0||Ye>119)&&M(10),Be(b,w,Ye<<25|Fe.getMonth()+1<<21|Fe.getDate()<<16|Fe.getHours()<<11|Fe.getMinutes()<<5|Fe.getSeconds()>>1),w+=4,pe!=-1&&(Be(b,w,G.crc),Be(b,w+4,pe<0?-pe-2:pe),Be(b,w+8,G.size)),Be(b,w+12,Le),Be(b,w+14,be),w+=16,ve!=null&&(Be(b,w,De),Be(b,w+6,G.attrs),Be(b,w+10,ve),w+=14),b.set(K,w),w+=Le,be)for(var ze in Ie){var Qe=Ie[ze],Ge=Qe.length;Be(b,w,+ze),Be(b,w+2,Ge),b.set(Qe,w+4),w+=4+Ge}return De&&(b.set(ye,w),w+=De),w},fa=function(b,w,G,K,ue){Be(b,w,101010256),Be(b,w+8,G),Be(b,w+10,G),Be(b,w+12,K),Be(b,w+16,ue)},Ns=function(){function b(w){this.filename=w,this.c=Pe(),this.size=0,this.compression=0}return b.prototype.process=function(w,G){this.ondata(null,w,G)},b.prototype.push=function(w,G){this.ondata||M(5),this.c.p(w),this.size+=w.length,G&&(this.crc=this.c.d()),this.process(w,G||!1)},b}();h.ZipPassThrough=Ns;var bf=function(){function b(w,G){var K=this;G||(G={}),Ns.call(this,w),this.d=new Ue(G,function(ue,pe){K.ondata(null,ue,pe)}),this.compression=8,this.flag=rc(G.level)}return b.prototype.process=function(w,G){try{this.d.push(w,G)}catch(K){this.ondata(K,null,G)}},b.prototype.push=function(w,G){Ns.prototype.push.call(this,w,G)},b}();h.ZipDeflate=bf;var Lf=function(){function b(w,G){var K=this;G||(G={}),Ns.call(this,w),this.d=new At(G,function(ue,pe,ve){K.ondata(ue,pe,ve)}),this.compression=8,this.flag=rc(G.level),this.terminate=this.d.terminate}return b.prototype.process=function(w,G){this.d.push(w,G)},b.prototype.push=function(w,G){Ns.prototype.push.call(this,w,G)},b}();h.AsyncZipDeflate=Lf;var Uf=function(){function b(w){this.ondata=w,this.u=[],this.d=1}return b.prototype.add=function(w){var G=this;if(this.ondata||M(5),2&this.d)this.ondata(M(4+8*(1&this.d),0,1),null,!1);else{var K=Xn(w.filename),ue=K.length,pe=w.comment,ve=pe&&Xn(pe),ye=ue!=w.filename.length||ve&&pe.length!=ve.length,Le=ue+Jn(w.extra)+30;ue>65535&&this.ondata(M(11,0,1),null,!1);var Ie=new u(Le);qr(Ie,0,w,K,ye,-1);var De=[Ie],be=function(){for(var Ge=0,Ve=De;Ge<Ve.length;Ge++){var rt=Ve[Ge];G.ondata(null,rt,!1)}De=[]},Fe=this.d;this.d=0;var Ye=this.u.length,ze=te(w,{f:K,u:ye,o:ve,t:function(){w.terminate&&w.terminate()},r:function(){if(be(),Fe){var Ge=G.u[Ye+1];Ge?Ge.r():G.d=1}Fe=1}}),Qe=0;w.ondata=function(Ge,Ve,rt){if(Ge)G.ondata(Ge,Ve,rt),G.terminate();else if(Qe+=Ve.length,De.push(Ve),rt){var Ze=new u(16);Be(Ze,0,134695760),Be(Ze,4,w.crc),Be(Ze,8,Qe),Be(Ze,12,w.size),De.push(Ze),ze.c=Qe,ze.b=Le+Qe+16,ze.crc=w.crc,ze.size=w.size,Fe&&ze.r(),Fe=1}else Fe&&be()},this.u.push(ze)}},b.prototype.end=function(){var w=this;2&this.d?this.ondata(M(4+8*(1&this.d),0,1),null,!0):(this.d?this.e():this.u.push({r:function(){1&w.d&&(w.u.splice(-1,1),w.e())},t:function(){}}),this.d=3)},b.prototype.e=function(){for(var w=0,G=0,K=0,ue=0,pe=this.u;ue<pe.length;ue++)K+=46+(Ie=pe[ue]).f.length+Jn(Ie.extra)+(Ie.o?Ie.o.length:0);for(var ve=new u(K+22),ye=0,Le=this.u;ye<Le.length;ye++){var Ie=Le[ye];qr(ve,w,Ie,Ie.f,Ie.u,-Ie.c-2,G,Ie.o),w+=46+Ie.f.length+Jn(Ie.extra)+(Ie.o?Ie.o.length:0),G+=Ie.b}fa(ve,w,this.u.length,K,G),this.ondata(null,ve,!0),this.d=2},b.prototype.terminate=function(){for(var w=0,G=this.u;w<G.length;w++)G[w].t();this.d=2},b}();h.Zip=Uf,h.zip=function(b,w,G){G||(G=w,w={}),typeof G!="function"&&M(7);var K={};ha(b,"",K,w);var ue=Object.keys(K),pe=ue.length,ve=0,ye=0,Le=pe,Ie=new Array(pe),De=[],be=function(){for(var Ge=0;Ge<De.length;++Ge)De[Ge]()},Fe=function(Ge,Ve){wi(function(){G(Ge,Ve)})};wi(function(){Fe=G});var Ye=function(){var Ge=new u(ye+22),Ve=ve,rt=ye-ve;ye=0;for(var Ze=0;Ze<Le;++Ze){var Xe=Ie[Ze];try{var st=Xe.c.length;qr(Ge,ye,Xe,Xe.f,Xe.u,st);var lt=30+Xe.f.length+Jn(Xe.extra),Ke=ye+lt;Ge.set(Xe.c,Ke),qr(Ge,ve,Xe,Xe.f,Xe.u,st,ye,Xe.m),ve+=16+lt+(Xe.m?Xe.m.length:0),ye=Ke+st}catch(We){return Fe(We,null)}}fa(Ge,ve,Ie.length,rt,Ve),Fe(null,Ge)};pe||Ye();for(var ze=function(Ge){var Ve=ue[Ge],rt=K[Ve],Ze=rt[0],Xe=rt[1],st=Pe(),lt=Ze.length;st.p(Ze);var Ke=Xn(Ve),We=Ke.length,$e=Xe.comment,Je=$e&&Xn($e),Nt=Je&&Je.length,dt=Jn(Xe.extra),yt=Xe.level==0?0:8,ot=function(It,wt){if(It)be(),Fe(It,null);else{var _t=wt.length;Ie[Ge]=te(Xe,{size:lt,crc:st.d(),c:wt,f:Ke,m:Je,u:We!=Ve.length||Je&&$e.length!=Nt,compression:yt}),ve+=30+We+dt+_t,ye+=76+2*(We+dt)+(Nt||0)+_t,--pe||Ye()}};if(We>65535&&ot(M(11,0,1),null),yt)if(lt<16e4)try{ot(null,$t(Ze,Xe))}catch(It){ot(It,null)}else De.push(qe(Ze,Xe,ot));else ot(null,Ze)},Qe=0;Qe<Le;++Qe)ze(Qe);return be},h.zipSync=function(b,w){w||(w={});var G={},K=[];ha(b,"",G,w);var ue=0,pe=0;for(var ve in G){var ye=G[ve],Le=ye[0],Ie=ye[1],De=Ie.level==0?0:8,be=(Ke=Xn(ve)).length,Fe=Ie.comment,Ye=Fe&&Xn(Fe),ze=Ye&&Ye.length,Qe=Jn(Ie.extra);be>65535&&M(11);var Ge=De?$t(Le,Ie):Le,Ve=Ge.length,rt=Pe();rt.p(Le),K.push(te(Ie,{size:Le.length,crc:rt.d(),c:Ge,f:Ke,m:Ye,u:be!=ve.length||Ye&&Fe.length!=ze,o:ue,compression:De})),ue+=30+be+Qe+Ve,pe+=76+2*(be+Qe)+(ze||0)+Ve}for(var Ze=new u(pe+22),Xe=ue,st=pe-ue,lt=0;lt<K.length;++lt){var Ke=K[lt];qr(Ze,Ke.o,Ke,Ke.f,Ke.u,Ke.c.length);var We=30+Ke.f.length+Jn(Ke.extra);Ze.set(Ke.c,Ke.o+We),qr(Ze,ue,Ke,Ke.f,Ke.u,Ke.c.length,Ke.o,Ke.m),ue+=16+We+(Ke.m?Ke.m.length:0)}return fa(Ze,ue,K.length,st,Xe),Ze};var ac=function(){function b(){}return b.prototype.push=function(w,G){this.ondata(null,w,G)},b.compression=0,b}();h.UnzipPassThrough=ac;var xf=function(){function b(){var w=this;this.i=new Tt(function(G,K){w.ondata(null,G,K)})}return b.prototype.push=function(w,G){try{this.i.push(w,G)}catch(K){this.ondata(K,null,G)}},b.compression=8,b}();h.UnzipInflate=xf;var Ff=function(){function b(w,G){var K=this;G<32e4?this.i=new Tt(function(ue,pe){K.ondata(null,ue,pe)}):(this.i=new nn(function(ue,pe,ve){K.ondata(ue,pe,ve)}),this.terminate=this.i.terminate)}return b.prototype.push=function(w,G){this.i.terminate&&(w=R(w,0)),this.i.push(w,G)},b.compression=8,b}();h.AsyncUnzipInflate=Ff;var kf=function(){function b(w){this.onfile=w,this.k=[],this.o={0:ac},this.p=ee}return b.prototype.push=function(w,G){var K=this;if(this.onfile||M(5),this.p||M(4),this.c>0){var ue=Math.min(this.c,w.length),pe=w.subarray(0,ue);if(this.c-=ue,this.d?this.d.push(pe,!this.c):this.k[0].push(pe),(w=w.subarray(ue)).length)return this.push(w,G)}else{var ve=0,ye=0,Le=void 0,Ie=void 0;this.p.length?w.length?((Ie=new u(this.p.length+w.length)).set(this.p),Ie.set(w,this.p.length)):Ie=this.p:Ie=w;for(var De=Ie.length,be=this.c,Fe=be&&this.d,Ye=function(){var Ge,Ve=Ce(Ie,ye);if(Ve==67324752){ve=1,Le=ye,ze.d=null,ze.c=0;var rt=Se(Ie,ye+6),Ze=Se(Ie,ye+8),Xe=2048&rt,st=8&rt,lt=Se(Ie,ye+26),Ke=Se(Ie,ye+28);if(De>ye+30+lt+Ke){var We=[];ze.k.unshift(We),ve=2;var $e,Je=Ce(Ie,ye+18),Nt=Ce(Ie,ye+22),dt=pa(Ie.subarray(ye+30,ye+=30+lt),!Xe);Je==4294967295?(Ge=st?[-2]:oc(Ie,ye),Je=Ge[0],Nt=Ge[1]):st&&(Je=-1),ye+=Ke,ze.c=Je;var yt={name:dt,compression:Ze,start:function(){if(yt.ondata||M(5),Je){var ot=K.o[Ze];ot||yt.ondata(M(14,"unknown compression type "+Ze,1),null,!1),($e=Je<0?new ot(dt):new ot(dt,Je,Nt)).ondata=function(Wt,Mt,Cr){yt.ondata(Wt,Mt,Cr)};for(var It=0,wt=We;It<wt.length;It++){var _t=wt[It];$e.push(_t,!1)}K.k[0]==We&&K.c?K.d=$e:$e.push(ee,!0)}else yt.ondata(null,ee,!0)},terminate:function(){$e&&$e.terminate&&$e.terminate()}};Je>=0&&(yt.size=Je,yt.originalSize=Nt),ze.onfile(yt)}return"break"}if(be){if(Ve==134695760)return Le=ye+=12+(be==-2&&8),ve=3,ze.c=0,"break";if(Ve==33639248)return Le=ye-=4,ve=3,ze.c=0,"break"}},ze=this;ye<De-4&&Ye()!=="break";++ye);if(this.p=ee,be<0){var Qe=ve?Ie.subarray(0,Le-12-(be==-2&&8)-(Ce(Ie,Le-16)==134695760&&4)):Ie.subarray(0,ye);Fe?Fe.push(Qe,!!ve):this.k[+(ve==2)].push(Qe)}if(2&ve)return this.push(Ie.subarray(ye),G);this.p=Ie.subarray(ye)}G&&(this.c&&M(13),this.p=null)},b.prototype.register=function(w){this.o[w.compression]=w},b}();h.Unzip=kf;var wi=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(b){b()};h.unzip=function(b,w,G){G||(G=w,w={}),typeof G!="function"&&M(7);var K=[],ue=function(){for(var Ge=0;Ge<K.length;++Ge)K[Ge]()},pe={},ve=function(Ge,Ve){wi(function(){G(Ge,Ve)})};wi(function(){ve=G});for(var ye=b.length-22;Ce(b,ye)!=101010256;--ye)if(!ye||b.length-ye>65558)return ve(M(13,0,1),null),ue;var Le=Se(b,ye+8);if(Le){var Ie=Le,De=Ce(b,ye+16),be=De==4294967295||Ie==65535;if(be){var Fe=Ce(b,ye-12);(be=Ce(b,Fe)==101075792)&&(Ie=Le=Ce(b,Fe+32),De=Ce(b,Fe+48))}for(var Ye=w&&w.filter,ze=function(Ge){var Ve=ic(b,De,be),rt=Ve[0],Ze=Ve[1],Xe=Ve[2],st=Ve[3],lt=Ve[4],Ke=Ve[5],We=sc(b,Ke);De=lt;var $e=function(Nt,dt){Nt?(ue(),ve(Nt,null)):(dt&&(pe[st]=dt),--Le||ve(null,pe))};if(!Ye||Ye({name:st,size:Ze,originalSize:Xe,compression:rt}))if(rt)if(rt==8){var Je=b.subarray(We,We+Ze);if(Ze<32e4)try{$e(null,In(Je,{out:new u(Xe)}))}catch(Nt){$e(Nt,null)}else K.push(hn(Je,{size:Xe},$e))}else $e(M(14,"unknown compression type "+rt,1),null);else $e(null,R(b,We,We+Ze));else $e(null,null)},Qe=0;Qe<Ie;++Qe)ze()}else ve(null,{});return ue},h.unzipSync=function(b,w){for(var G={},K=b.length-22;Ce(b,K)!=101010256;--K)(!K||b.length-K>65558)&&M(13);var ue=Se(b,K+8);if(!ue)return{};var pe=Ce(b,K+16),ve=pe==4294967295||ue==65535;if(ve){var ye=Ce(b,K-12);(ve=Ce(b,ye)==101075792)&&(ue=Ce(b,ye+32),pe=Ce(b,ye+48))}for(var Le=w&&w.filter,Ie=0;Ie<ue;++Ie){var De=ic(b,pe,ve),be=De[0],Fe=De[1],Ye=De[2],ze=De[3],Qe=De[4],Ge=De[5],Ve=sc(b,Ge);pe=Qe,Le&&!Le({name:ze,size:Fe,originalSize:Ye,compression:be})||(be?be==8?G[ze]=In(b.subarray(Ve,Ve+Fe),{out:new u(Ye)}):M(14,"unknown compression type "+be):G[ze]=R(b,Ve,Ve+Fe))}return G}},5017:(o,h)=>{var r,a=function(u){Object.defineProperty(u,"__esModule",{value:!0}),u.default=void 0;var l=null;try{l=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function d(R,B,M){this.low=0|R,this.high=0|B,this.unsigned=!!M}function _(R){return(R&&R.__isLong__)===!0}function p(R){var B=Math.clz32(R&-R);return R?31-B:B}d.prototype.__isLong__,Object.defineProperty(d.prototype,"__isLong__",{value:!0}),d.isLong=_;var f={},S={};function C(R,B){var M,re,se;return B?(se=0<=(R>>>=0)&&R<256)&&(re=S[R])?re:(M=m(R,0,!0),se&&(S[R]=M),M):(se=-128<=(R|=0)&&R<128)&&(re=f[R])?re:(M=m(R,R<0?-1:0,!1),se&&(f[R]=M),M)}function g(R,B){if(isNaN(R))return B?q:D;if(B){if(R<0)return q;if(R>=N)return k}else{if(R<=-A)return J;if(R+1>=A)return x}return R<0?g(-R,B).neg():m(R%I|0,R/I|0,B)}function m(R,B,M){return new d(R,B,M)}d.fromInt=C,d.fromNumber=g,d.fromBits=m;var T=Math.pow;function y(R,B,M){if(R.length===0)throw Error("empty string");if(typeof B=="number"?(M=B,B=!1):B=!!B,R==="NaN"||R==="Infinity"||R==="+Infinity"||R==="-Infinity")return B?q:D;if((M=M||10)<2||36<M)throw RangeError("radix");var re;if((re=R.indexOf("-"))>0)throw Error("interior hyphen");if(re===0)return y(R.substring(1),B,M).neg();for(var se=g(T(M,8)),fe=D,ce=0;ce<R.length;ce+=8){var Te=Math.min(8,R.length-ce),Ee=parseInt(R.substring(ce,ce+Te),M);if(Te<8){var he=g(T(M,Te));fe=fe.mul(he).add(g(Ee))}else fe=(fe=fe.mul(se)).add(g(Ee))}return fe.unsigned=B,fe}function E(R,B){return typeof R=="number"?g(R,B):typeof R=="string"?y(R,B):m(R.low,R.high,typeof B=="boolean"?B:R.unsigned)}d.fromString=y,d.fromValue=E;var I=4294967296,N=I*I,A=N/2,L=C(1<<24),D=C(0);d.ZERO=D;var q=C(0,!0);d.UZERO=q;var Y=C(1);d.ONE=Y;var Q=C(1,!0);d.UONE=Q;var W=C(-1);d.NEG_ONE=W;var x=m(-1,2147483647,!1);d.MAX_VALUE=x;var k=m(-1,-1,!0);d.MAX_UNSIGNED_VALUE=k;var J=m(0,-2147483648,!1);d.MIN_VALUE=J;var F=d.prototype;F.toInt=function(){return this.unsigned?this.low>>>0:this.low},F.toNumber=function(){return this.unsigned?(this.high>>>0)*I+(this.low>>>0):this.high*I+(this.low>>>0)},F.toString=function(R){if((R=R||10)<2||36<R)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(J)){var B=g(R),M=this.div(B),re=M.mul(B).sub(this);return M.toString(R)+re.toInt().toString(R)}return"-"+this.neg().toString(R)}for(var se=g(T(R,6),this.unsigned),fe=this,ce="";;){var Te=fe.div(se),Ee=(fe.sub(Te.mul(se)).toInt()>>>0).toString(R);if((fe=Te).isZero())return Ee+ce;for(;Ee.length<6;)Ee="0"+Ee;ce=""+Ee+ce}},F.getHighBits=function(){return this.high},F.getHighBitsUnsigned=function(){return this.high>>>0},F.getLowBits=function(){return this.low},F.getLowBitsUnsigned=function(){return this.low>>>0},F.getNumBitsAbs=function(){if(this.isNegative())return this.eq(J)?64:this.neg().getNumBitsAbs();for(var R=this.high!=0?this.high:this.low,B=31;B>0&&!(R&1<<B);B--);return this.high!=0?B+33:B+1},F.isZero=function(){return this.high===0&&this.low===0},F.eqz=F.isZero,F.isNegative=function(){return!this.unsigned&&this.high<0},F.isPositive=function(){return this.unsigned||this.high>=0},F.isOdd=function(){return!(1&~this.low)},F.isEven=function(){return!(1&this.low)},F.equals=function(R){return _(R)||(R=E(R)),(this.unsigned===R.unsigned||this.high>>>31!=1||R.high>>>31!=1)&&this.high===R.high&&this.low===R.low},F.eq=F.equals,F.notEquals=function(R){return!this.eq(R)},F.neq=F.notEquals,F.ne=F.notEquals,F.lessThan=function(R){return this.comp(R)<0},F.lt=F.lessThan,F.lessThanOrEqual=function(R){return this.comp(R)<=0},F.lte=F.lessThanOrEqual,F.le=F.lessThanOrEqual,F.greaterThan=function(R){return this.comp(R)>0},F.gt=F.greaterThan,F.greaterThanOrEqual=function(R){return this.comp(R)>=0},F.gte=F.greaterThanOrEqual,F.ge=F.greaterThanOrEqual,F.compare=function(R){if(_(R)||(R=E(R)),this.eq(R))return 0;var B=this.isNegative(),M=R.isNegative();return B&&!M?-1:!B&&M?1:this.unsigned?R.high>>>0>this.high>>>0||R.high===this.high&&R.low>>>0>this.low>>>0?-1:1:this.sub(R).isNegative()?-1:1},F.comp=F.compare,F.negate=function(){return!this.unsigned&&this.eq(J)?J:this.not().add(Y)},F.neg=F.negate,F.add=function(R){_(R)||(R=E(R));var B=this.high>>>16,M=65535&this.high,re=this.low>>>16,se=65535&this.low,fe=R.high>>>16,ce=65535&R.high,Te=R.low>>>16,Ee=0,he=0,ge=0,X=0;return ge+=(X+=se+(65535&R.low))>>>16,he+=(ge+=re+Te)>>>16,Ee+=(he+=M+ce)>>>16,Ee+=B+fe,m((ge&=65535)<<16|(X&=65535),(Ee&=65535)<<16|(he&=65535),this.unsigned)},F.subtract=function(R){return _(R)||(R=E(R)),this.add(R.neg())},F.sub=F.subtract,F.multiply=function(R){if(this.isZero())return this;if(_(R)||(R=E(R)),l)return m(l.mul(this.low,this.high,R.low,R.high),l.get_high(),this.unsigned);if(R.isZero())return this.unsigned?q:D;if(this.eq(J))return R.isOdd()?J:D;if(R.eq(J))return this.isOdd()?J:D;if(this.isNegative())return R.isNegative()?this.neg().mul(R.neg()):this.neg().mul(R).neg();if(R.isNegative())return this.mul(R.neg()).neg();if(this.lt(L)&&R.lt(L))return g(this.toNumber()*R.toNumber(),this.unsigned);var B=this.high>>>16,M=65535&this.high,re=this.low>>>16,se=65535&this.low,fe=R.high>>>16,ce=65535&R.high,Te=R.low>>>16,Ee=65535&R.low,he=0,ge=0,X=0,ae=0;return X+=(ae+=se*Ee)>>>16,ge+=(X+=re*Ee)>>>16,X&=65535,ge+=(X+=se*Te)>>>16,he+=(ge+=M*Ee)>>>16,ge&=65535,he+=(ge+=re*Te)>>>16,ge&=65535,he+=(ge+=se*ce)>>>16,he+=B*Ee+M*Te+re*ce+se*fe,m((X&=65535)<<16|(ae&=65535),(he&=65535)<<16|(ge&=65535),this.unsigned)},F.mul=F.multiply,F.divide=function(R){if(_(R)||(R=E(R)),R.isZero())throw Error("division by zero");var B,M,re;if(l)return this.unsigned||this.high!==-2147483648||R.low!==-1||R.high!==-1?m((this.unsigned?l.div_u:l.div_s)(this.low,this.high,R.low,R.high),l.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?q:D;if(this.unsigned){if(R.unsigned||(R=R.toUnsigned()),R.gt(this))return q;if(R.gt(this.shru(1)))return Q;re=q}else{if(this.eq(J))return R.eq(Y)||R.eq(W)?J:R.eq(J)?Y:(B=this.shr(1).div(R).shl(1)).eq(D)?R.isNegative()?Y:W:(M=this.sub(R.mul(B)),re=B.add(M.div(R)));if(R.eq(J))return this.unsigned?q:D;if(this.isNegative())return R.isNegative()?this.neg().div(R.neg()):this.neg().div(R).neg();if(R.isNegative())return this.div(R.neg()).neg();re=D}for(M=this;M.gte(R);){B=Math.max(1,Math.floor(M.toNumber()/R.toNumber()));for(var se=Math.ceil(Math.log(B)/Math.LN2),fe=se<=48?1:T(2,se-48),ce=g(B),Te=ce.mul(R);Te.isNegative()||Te.gt(M);)Te=(ce=g(B-=fe,this.unsigned)).mul(R);ce.isZero()&&(ce=Y),re=re.add(ce),M=M.sub(Te)}return re},F.div=F.divide,F.modulo=function(R){return _(R)||(R=E(R)),l?m((this.unsigned?l.rem_u:l.rem_s)(this.low,this.high,R.low,R.high),l.get_high(),this.unsigned):this.sub(this.div(R).mul(R))},F.mod=F.modulo,F.rem=F.modulo,F.not=function(){return m(~this.low,~this.high,this.unsigned)},F.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},F.clz=F.countLeadingZeros,F.countTrailingZeros=function(){return this.low?p(this.low):p(this.high)+32},F.ctz=F.countTrailingZeros,F.and=function(R){return _(R)||(R=E(R)),m(this.low&R.low,this.high&R.high,this.unsigned)},F.or=function(R){return _(R)||(R=E(R)),m(this.low|R.low,this.high|R.high,this.unsigned)},F.xor=function(R){return _(R)||(R=E(R)),m(this.low^R.low,this.high^R.high,this.unsigned)},F.shiftLeft=function(R){return _(R)&&(R=R.toInt()),(R&=63)==0?this:R<32?m(this.low<<R,this.high<<R|this.low>>>32-R,this.unsigned):m(0,this.low<<R-32,this.unsigned)},F.shl=F.shiftLeft,F.shiftRight=function(R){return _(R)&&(R=R.toInt()),(R&=63)==0?this:R<32?m(this.low>>>R|this.high<<32-R,this.high>>R,this.unsigned):m(this.high>>R-32,this.high>=0?0:-1,this.unsigned)},F.shr=F.shiftRight,F.shiftRightUnsigned=function(R){return _(R)&&(R=R.toInt()),(R&=63)==0?this:R<32?m(this.low>>>R|this.high<<32-R,this.high>>>R,this.unsigned):m(R===32?this.high:this.high>>>R-32,0,this.unsigned)},F.shru=F.shiftRightUnsigned,F.shr_u=F.shiftRightUnsigned,F.rotateLeft=function(R){var B;return _(R)&&(R=R.toInt()),(R&=63)==0?this:R===32?m(this.high,this.low,this.unsigned):R<32?(B=32-R,m(this.low<<R|this.high>>>B,this.high<<R|this.low>>>B,this.unsigned)):(B=32-(R-=32),m(this.high<<R|this.low>>>B,this.low<<R|this.high>>>B,this.unsigned))},F.rotl=F.rotateLeft,F.rotateRight=function(R){var B;return _(R)&&(R=R.toInt()),(R&=63)==0?this:R===32?m(this.high,this.low,this.unsigned):R<32?(B=32-R,m(this.high<<B|this.low>>>R,this.low<<B|this.high>>>R,this.unsigned)):(B=32-(R-=32),m(this.low<<B|this.high>>>R,this.high<<B|this.low>>>R,this.unsigned))},F.rotr=F.rotateRight,F.toSigned=function(){return this.unsigned?m(this.low,this.high,!1):this},F.toUnsigned=function(){return this.unsigned?this:m(this.low,this.high,!0)},F.toBytes=function(R){return R?this.toBytesLE():this.toBytesBE()},F.toBytesLE=function(){var R=this.high,B=this.low;return[255&B,B>>>8&255,B>>>16&255,B>>>24,255&R,R>>>8&255,R>>>16&255,R>>>24]},F.toBytesBE=function(){var R=this.high,B=this.low;return[R>>>24,R>>>16&255,R>>>8&255,255&R,B>>>24,B>>>16&255,B>>>8&255,255&B]},d.fromBytes=function(R,B,M){return M?d.fromBytesLE(R,B):d.fromBytesBE(R,B)},d.fromBytesLE=function(R,B){return new d(R[0]|R[1]<<8|R[2]<<16|R[3]<<24,R[4]|R[5]<<8|R[6]<<16|R[7]<<24,B)},d.fromBytesBE=function(R,B){return new d(R[4]<<24|R[5]<<16|R[6]<<8|R[7],R[0]<<24|R[1]<<16|R[2]<<8|R[3],B)};var $=d;return u.default=$,"default"in u?u.default:u}({});(r=(function(){return a}).apply(h,[]))===void 0||(o.exports=r)}},s={};function c(o){var h=s[o];if(h!==void 0)return h.exports;var r=s[o]={exports:{}};return n[o].call(r.exports,r,r.exports,c),r.exports}return c.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),c(5237)})())})(pf);var kE=pf.exports;const fn=Ql(kE);function ff(e,t,n){console.log("EDE Processing message:",e,t,n);let s;if(e.includes("orchestrator/reinvokeModel"))s="orchestratorReinvoke";else if(e.includes("solace-agent-mesh/v1/stimulus/"))s="stimulus";else if(e.includes("solace-agent-mesh/v1/response/"))s="response";else if(e.includes("solace-agent-mesh/v1/streamingResponse/"))s="streamingResponse";else if(e.includes("solace-agent-mesh/v1/responseComplete/"))s="responseComplete";else if(e.includes("solace-agent-mesh/v1/actionRequest/"))s="actionRequest";else if(e.includes("solace-agent-mesh/v1/actionResponse/"))s="actionResponse";else if(e.includes("solace-agent-mesh/v1/register/agent/"))s="registration";else if(e.includes("solace-agent-mesh/v1/llm-service/request/"))s="llmServiceRequest";else if(e.includes("solace-agent-mesh/v1/llm-service/response/"))s="llmServiceResponse";else return console.warn("Unknown message type for topic:",e),null;const c=n.stimulus_uuid;let o=null;if(n.__solace_ai_connector_broker_request_reply_metadata__)try{o=JSON.parse(n.__solace_ai_connector_broker_request_reply_metadata__._value||n.__solace_ai_connector_broker_request_reply_metadata__)}catch(h){console.warn("Failed to parse broker request reply metadata:",h)}return{type:s,content:t,userProperties:n,stimulus_uuid:c,timestamp:new Date().toISOString(),broker_request_reply:o}}function BE(e){return{type:"capability",content:e,timestamp:new Date().toISOString()}}const _f=new fn.SolclientFactoryProperties;_f.profile=fn.SolclientFactoryProfiles.version10_5;fn.SolclientFactory.init(_f);fn.SolclientFactory.setLogLevel(fn.LogLevel.DEBUG);class GE{constructor(){this.session=null,this.messageCallback=null,this.capabilityCallback=null,this.registrationCallback=null}async connect(t){try{fn.SolclientFactory.init();const n=new fn.SessionProperties({url:t.url,vpnName:t.vpnName,userName:t.userName,password:t.password});this.session=fn.SolclientFactory.createSession(n),this.session.on(fn.SessionEventCode.UP_NOTICE,()=>{let s=t.namespace||"";s=s.endsWith("/")?s:`${s}/`,[`${s}solace-agent-mesh/v1/register/>`,`${s}solace-agent-mesh/v1/stimulus/>`,`${s}solace-agent-mesh/v1/response/>`,`${s}solace-agent-mesh/v1/streamingResponse/>`,`${s}solace-agent-mesh/v1/responseComplete/>`,`${s}solace-agent-mesh/v1/actionRequest/>`,`${s}solace-agent-mesh/v1/actionResponse/>`,`${s}solace-agent-mesh/v1/orchestrator/reinvoke/>`,`${s}solace-agent-mesh/v1/llm-service/request/>`,`${s}solace-agent-mesh/v1/llm-service/response/>`].forEach(o=>{try{this.session.subscribe(fn.SolclientFactory.createTopicDestination(o),!0,o,1e4)}catch(h){console.error("Error subscribing to topic:",o,h)}})}),this.session.on(fn.SessionEventCode.CONNECT_FAILED_ERROR,s=>{console.error("Solace connection failed:",s.infoStr)}),this.session.connect()}catch(n){throw console.error("Error creating Solace session:",n),n}this.session.on(fn.SessionEventCode.MESSAGE,n=>{const s=n.getDestination().getName(),c=JSON.parse(n.getBinaryAttachment()),o={},h=n.getUserPropertyMap();if(h&&h.getKeys().forEach(r=>{o[r]=h.getField(r)}),console.log("EDE Processing message:",s,c,o),this.messageCallback){const r=ff(s,c,o);r&&this.messageCallback(r)}})}setMessageCallback(t){this.messageCallback=t}subscribeToCapabilities(t){this.capabilityCallback=t}unsubscribeFromCapabilities(){this.capabilityCallback=null}disconnect(){this.session&&(this.session.disconnect(),this.session=null)}}const kn=Object.create(null);kn.open="0";kn.close="1";kn.ping="2";kn.pong="3";kn.message="4";kn.upgrade="5";kn.noop="6";const lo=Object.create(null);Object.keys(kn).forEach(e=>{lo[kn[e]]=e});const ql={type:"error",data:"parser error"},gf=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",mf=typeof ArrayBuffer=="function",Ef=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,ju=({type:e,data:t},n,s)=>gf&&t instanceof Blob?n?s(t):Ah(t,s):mf&&(t instanceof ArrayBuffer||Ef(t))?n?s(t):Ah(new Blob([t]),s):s(kn[e]+(t||"")),Ah=(e,t)=>{const n=new FileReader;return n.onload=function(){const s=n.result.split(",")[1];t("b"+(s||""))},n.readAsDataURL(e)};function wh(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Wa;function $E(e,t){if(gf&&e.data instanceof Blob)return e.data.arrayBuffer().then(wh).then(t);if(mf&&(e.data instanceof ArrayBuffer||Ef(e.data)))return t(wh(e.data));ju(e,!1,n=>{Wa||(Wa=new TextEncoder),t(Wa.encode(n))})}const Ph="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ws=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Ph.length;e++)Ws[Ph.charCodeAt(e)]=e;const WE=e=>{let t=e.length*.75,n=e.length,s,c=0,o,h,r,a;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),l=new Uint8Array(u);for(s=0;s<n;s+=4)o=Ws[e.charCodeAt(s)],h=Ws[e.charCodeAt(s+1)],r=Ws[e.charCodeAt(s+2)],a=Ws[e.charCodeAt(s+3)],l[c++]=o<<2|h>>4,l[c++]=(h&15)<<4|r>>2,l[c++]=(r&3)<<6|a&63;return u},qE=typeof ArrayBuffer=="function",Hu=(e,t)=>{if(typeof e!="string")return{type:"message",data:Sf(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:VE(e.substring(1),t)}:lo[n]?e.length>1?{type:lo[n],data:e.substring(1)}:{type:lo[n]}:ql},VE=(e,t)=>{if(qE){const n=WE(e);return Sf(n,t)}else return{base64:!0,data:e}},Sf=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Tf="",jE=(e,t)=>{const n=e.length,s=new Array(n);let c=0;e.forEach((o,h)=>{ju(o,!1,r=>{s[h]=r,++c===n&&t(s.join(Tf))})})},HE=(e,t)=>{const n=e.split(Tf),s=[];for(let c=0;c<n.length;c++){const o=Hu(n[c],t);if(s.push(o),o.type==="error")break}return s};function YE(){return new TransformStream({transform(e,t){$E(e,n=>{const s=n.length;let c;if(s<126)c=new Uint8Array(1),new DataView(c.buffer).setUint8(0,s);else if(s<65536){c=new Uint8Array(3);const o=new DataView(c.buffer);o.setUint8(0,126),o.setUint16(1,s)}else{c=new Uint8Array(9);const o=new DataView(c.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(s))}e.data&&typeof e.data!="string"&&(c[0]|=128),t.enqueue(c),t.enqueue(n)})}})}let qa;function zi(e){return e.reduce((t,n)=>t+n.length,0)}function Qi(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let s=0;for(let c=0;c<t;c++)n[c]=e[0][s++],s===e[0].length&&(e.shift(),s=0);return e.length&&s<e[0].length&&(e[0]=e[0].slice(s)),n}function zE(e,t){qa||(qa=new TextDecoder);const n=[];let s=0,c=-1,o=!1;return new TransformStream({transform(h,r){for(n.push(h);;){if(s===0){if(zi(n)<1)break;const a=Qi(n,1);o=(a[0]&128)===128,c=a[0]&127,c<126?s=3:c===126?s=1:s=2}else if(s===1){if(zi(n)<2)break;const a=Qi(n,2);c=new DataView(a.buffer,a.byteOffset,a.length).getUint16(0),s=3}else if(s===2){if(zi(n)<8)break;const a=Qi(n,8),u=new DataView(a.buffer,a.byteOffset,a.length),l=u.getUint32(0);if(l>Math.pow(2,21)-1){r.enqueue(ql);break}c=l*Math.pow(2,32)+u.getUint32(4),s=3}else{if(zi(n)<c)break;const a=Qi(n,c);r.enqueue(Hu(o?a:qa.decode(a),t)),s=0}if(c===0||c>e){r.enqueue(ql);break}}}})}const yf=4;function Dt(e){if(e)return QE(e)}function QE(e){for(var t in Dt.prototype)e[t]=Dt.prototype[t];return e}Dt.prototype.on=Dt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Dt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Dt.prototype.off=Dt.prototype.removeListener=Dt.prototype.removeAllListeners=Dt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var s,c=0;c<n.length;c++)if(s=n[c],s===t||s.fn===t){n.splice(c,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Dt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],s=1;s<arguments.length;s++)t[s-1]=arguments[s];if(n){n=n.slice(0);for(var s=0,c=n.length;s<c;++s)n[s].apply(this,t)}return this};Dt.prototype.emitReserved=Dt.prototype.emit;Dt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Dt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const oa=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),mn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),KE="arraybuffer";function If(e,...t){return t.reduce((n,s)=>(e.hasOwnProperty(s)&&(n[s]=e[s]),n),{})}const XE=mn.setTimeout,JE=mn.clearTimeout;function aa(e,t){t.useNativeTimers?(e.setTimeoutFn=XE.bind(mn),e.clearTimeoutFn=JE.bind(mn)):(e.setTimeoutFn=mn.setTimeout.bind(mn),e.clearTimeoutFn=mn.clearTimeout.bind(mn))}const ZE=1.33;function eS(e){return typeof e=="string"?tS(e):Math.ceil((e.byteLength||e.size)*ZE)}function tS(e){let t=0,n=0;for(let s=0,c=e.length;s<c;s++)t=e.charCodeAt(s),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(s++,n+=4);return n}function Cf(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function nS(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function rS(e){let t={},n=e.split("&");for(let s=0,c=n.length;s<c;s++){let o=n[s].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class sS extends Error{constructor(t,n,s){super(t),this.description=n,this.context=s,this.type="TransportError"}}class Yu extends Dt{constructor(t){super(),this.writable=!1,aa(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,s){return super.emitReserved("error",new sS(t,n,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Hu(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=nS(t);return n.length?"?"+n:""}}class iS extends Yu{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||n()})),this.writable||(s++,this.once("drain",function(){--s||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};HE(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,jE(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Cf()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let Rf=!1;try{Rf=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const oS=Rf;function aS(){}class lS extends iS{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let s=location.port;s||(s=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||s!==t.port}}doWrite(t,n){const s=this.request({method:"POST",data:t});s.on("success",n),s.on("error",(c,o)=>{this.onError("xhr post error",c,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,s)=>{this.onError("xhr poll error",n,s)}),this.pollXhr=t}}class Fn extends Dt{constructor(t,n,s){super(),this.createRequest=t,aa(this,s),this._opts=s,this._method=s.method||"GET",this._uri=n,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var t;const n=If(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(n);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let c in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(c)&&s.setRequestHeader(c,this._opts.extraHeaders[c])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var c;s.readyState===3&&((c=this._opts.cookieJar)===null||c===void 0||c.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(c){this.setTimeoutFn(()=>{this._onError(c)},0);return}typeof document<"u"&&(this._index=Fn.requestsCount++,Fn.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=aS,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Fn.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Fn.requestsCount=0;Fn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Dh);else if(typeof addEventListener=="function"){const e="onpagehide"in mn?"pagehide":"unload";addEventListener(e,Dh,!1)}}function Dh(){for(let e in Fn.requests)Fn.requests.hasOwnProperty(e)&&Fn.requests[e].abort()}const uS=function(){const e=vf({xdomain:!1});return e&&e.responseType!==null}();class cS extends lS{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=uS&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Fn(vf,this.uri(),t)}}function vf(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||oS))return new XMLHttpRequest}catch{}if(!t)try{return new mn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Nf=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class hS extends Yu{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,s=Nf?{}:If(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,s)}catch(c){return this.emitReserved("error",c)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const s=t[n],c=n===t.length-1;ju(s,this.supportsBinary,o=>{try{this.doWrite(s,o)}catch{}c&&oa(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Cf()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Va=mn.WebSocket||mn.MozWebSocket;class dS extends hS{createSocket(t,n,s){return Nf?new Va(t,n,s):n?new Va(t,n):new Va(t)}doWrite(t,n){this.ws.send(n)}}class pS extends Yu{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=zE(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=t.readable.pipeThrough(n).getReader(),c=YE();c.readable.pipeTo(t.writable),this._writer=c.writable.getWriter();const o=()=>{s.read().then(({done:r,value:a})=>{r||(this.onPacket(a),o())}).catch(r=>{})};o();const h={type:"open"};this.query.sid&&(h.data=`{"sid":"${this.query.sid}"}`),this._writer.write(h).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const s=t[n],c=n===t.length-1;this._writer.write(s).then(()=>{c&&oa(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const fS={websocket:dS,webtransport:pS,polling:cS},_S=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,gS=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Vl(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),s=e.indexOf("]");n!=-1&&s!=-1&&(e=e.substring(0,n)+e.substring(n,s).replace(/:/g,";")+e.substring(s,e.length));let c=_S.exec(e||""),o={},h=14;for(;h--;)o[gS[h]]=c[h]||"";return n!=-1&&s!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=mS(o,o.path),o.queryKey=ES(o,o.query),o}function mS(e,t){const n=/\/{2,9}/g,s=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&s.splice(0,1),t.slice(-1)=="/"&&s.splice(s.length-1,1),s}function ES(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,c,o){c&&(n[c]=o)}),n}const jl=typeof addEventListener=="function"&&typeof removeEventListener=="function",uo=[];jl&&addEventListener("offline",()=>{uo.forEach(e=>e())},!1);class gr extends Dt{constructor(t,n){if(super(),this.binaryType=KE,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const s=Vl(t);n.hostname=s.host,n.secure=s.protocol==="https"||s.protocol==="wss",n.port=s.port,s.query&&(n.query=s.query)}else n.host&&(n.hostname=Vl(n.host).host);aa(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(s=>{const c=s.prototype.name;this.transports.push(c),this._transportsByName[c]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=rS(this.opts.query)),jl&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},uo.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=yf,n.transport=t,this.id&&(n.sid=this.id);const s=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&gr.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",gr.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let s=0;s<this.writeBuffer.length;s++){const c=this.writeBuffer[s].data;if(c&&(n+=eS(c)),s>0&&n>this._maxPayload)return this.writeBuffer.slice(0,s);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,oa(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,s){return this._sendPacket("message",t,n,s),this}send(t,n,s){return this._sendPacket("message",t,n,s),this}_sendPacket(t,n,s,c){if(typeof n=="function"&&(c=n,n=void 0),typeof s=="function"&&(c=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const o={type:t,data:n,options:s};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),c&&this.once("flush",c),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},s=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():t()}):this.upgrading?s():t()),this}_onError(t){if(gr.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),jl&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=uo.indexOf(this._offlineEventListener);s!==-1&&uo.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}gr.protocol=yf;class SS extends gr{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),s=!1;gr.priorWebsocketSuccess=!1;const c=()=>{s||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!s)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;gr.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(l(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const _=new Error("probe error");_.transport=n.name,this.emitReserved("upgradeError",_)}}))};function o(){s||(s=!0,l(),n.close(),n=null)}const h=d=>{const _=new Error("probe error: "+d);_.transport=n.name,o(),this.emitReserved("upgradeError",_)};function r(){h("transport closed")}function a(){h("socket closed")}function u(d){n&&d.name!==n.name&&o()}const l=()=>{n.removeListener("open",c),n.removeListener("error",h),n.removeListener("close",r),this.off("close",a),this.off("upgrading",u)};n.once("open",c),n.once("error",h),n.once("close",r),this.once("close",a),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{s||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let s=0;s<t.length;s++)~this.transports.indexOf(t[s])&&n.push(t[s]);return n}}let TS=class extends SS{constructor(t,n={}){const s=typeof t=="object"?t:n;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(c=>fS[c]).filter(c=>!!c)),super(t,s)}};function yS(e,t="",n){let s=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),s=Vl(e)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const o=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+o+":"+s.port+t,s.href=s.protocol+"://"+o+(n&&n.port===s.port?"":":"+s.port),s}const IS=typeof ArrayBuffer=="function",CS=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Of=Object.prototype.toString,RS=typeof Blob=="function"||typeof Blob<"u"&&Of.call(Blob)==="[object BlobConstructor]",vS=typeof File=="function"||typeof File<"u"&&Of.call(File)==="[object FileConstructor]";function zu(e){return IS&&(e instanceof ArrayBuffer||CS(e))||RS&&e instanceof Blob||vS&&e instanceof File}function co(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,s=e.length;n<s;n++)if(co(e[n]))return!0;return!1}if(zu(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return co(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&co(e[n]))return!0;return!1}function NS(e){const t=[],n=e.data,s=e;return s.data=Hl(n,t),s.attachments=t.length,{packet:s,buffers:t}}function Hl(e,t){if(!e)return e;if(zu(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let s=0;s<e.length;s++)n[s]=Hl(e[s],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=Hl(e[s],t));return n}return e}function OS(e,t){return e.data=Yl(e.data,t),delete e.attachments,e}function Yl(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Yl(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Yl(e[n],t));return e}const AS=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],wS=5;var nt;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(nt||(nt={}));class PS{constructor(t){this.replacer=t}encode(t){return(t.type===nt.EVENT||t.type===nt.ACK)&&co(t)?this.encodeAsBinary({type:t.type===nt.EVENT?nt.BINARY_EVENT:nt.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===nt.BINARY_EVENT||t.type===nt.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=NS(t),s=this.encodeAsString(n.packet),c=n.buffers;return c.unshift(s),c}}function Mh(e){return Object.prototype.toString.call(e)==="[object Object]"}class Qu extends Dt{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const s=n.type===nt.BINARY_EVENT;s||n.type===nt.BINARY_ACK?(n.type=s?nt.EVENT:nt.ACK,this.reconstructor=new DS(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(zu(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const s={type:Number(t.charAt(0))};if(nt[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===nt.BINARY_EVENT||s.type===nt.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const h=t.substring(o,n);if(h!=Number(h)||t.charAt(n)!=="-")throw new Error("Illegal attachments");s.attachments=Number(h)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););s.nsp=t.substring(o,n)}else s.nsp="/";const c=t.charAt(n+1);if(c!==""&&Number(c)==c){const o=n+1;for(;++n;){const h=t.charAt(n);if(h==null||Number(h)!=h){--n;break}if(n===t.length)break}s.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(Qu.isPayloadValid(s.type,o))s.data=o;else throw new Error("invalid payload")}return s}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case nt.CONNECT:return Mh(n);case nt.DISCONNECT:return n===void 0;case nt.CONNECT_ERROR:return typeof n=="string"||Mh(n);case nt.EVENT:case nt.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&AS.indexOf(n[0])===-1);case nt.ACK:case nt.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class DS{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=OS(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const MS=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Qu,Encoder:PS,get PacketType(){return nt},protocol:wS},Symbol.toStringTag,{value:"Module"}));function Nn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const bS=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Af extends Dt{constructor(t,n,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Nn(t,"open",this.onopen.bind(this)),Nn(t,"packet",this.onpacket.bind(this)),Nn(t,"error",this.onerror.bind(this)),Nn(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var s,c,o;if(bS.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const h={type:nt.EVENT,data:n};if(h.options={},h.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const l=this.ids++,d=n.pop();this._registerAckCallback(l,d),h.id=l}const r=(c=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||c===void 0?void 0:c.writable,a=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!r||(a?(this.notifyOutgoingListeners(h),this.packet(h)):this.sendBuffer.push(h)),this.flags={},this}_registerAckCallback(t,n){var s;const c=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(c===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let r=0;r<this.sendBuffer.length;r++)this.sendBuffer[r].id===t&&this.sendBuffer.splice(r,1);n.call(this,new Error("operation has timed out"))},c),h=(...r)=>{this.io.clearTimeoutFn(o),n.apply(this,r)};h.withError=!0,this.acks[t]=h}emitWithAck(t,...n){return new Promise((s,c)=>{const o=(h,r)=>h?c(h):s(r);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((c,...o)=>s!==this._queue[0]?void 0:(c!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(c)):(this._queue.shift(),n&&n(null,...o)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:nt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(s=>String(s.id)===t)){const s=this.acks[t];delete this.acks[t],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case nt.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case nt.EVENT:case nt.BINARY_EVENT:this.onevent(t);break;case nt.ACK:case nt.BINARY_ACK:this.onack(t);break;case nt.DISCONNECT:this.ondisconnect();break;case nt.CONNECT_ERROR:this.destroy();const s=new Error(t.data.message);s.data=t.data.data,this.emitReserved("connect_error",s);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const s of n)s.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let s=!1;return function(...c){s||(s=!0,n.packet({type:nt.ACK,id:t,data:c}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:nt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let s=0;s<n.length;s++)if(t===n[s])return n.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let s=0;s<n.length;s++)if(t===n[s])return n.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const s of n)s.apply(this,t.data)}}}function vs(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}vs.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};vs.prototype.reset=function(){this.attempts=0};vs.prototype.setMin=function(e){this.ms=e};vs.prototype.setMax=function(e){this.max=e};vs.prototype.setJitter=function(e){this.jitter=e};class zl extends Dt{constructor(t,n){var s;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,aa(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((s=n.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new vs({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const c=n.parser||MS;this.encoder=new c.Encoder,this.decoder=new c.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new TS(this.uri,this.opts);const n=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const c=Nn(n,"open",function(){s.onopen(),t&&t()}),o=r=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",r),t?t(r):this.maybeReconnectOnOpen()},h=Nn(n,"error",o);if(this._timeout!==!1){const r=this._timeout,a=this.setTimeoutFn(()=>{c(),o(new Error("timeout")),n.close()},r);this.opts.autoUnref&&a.unref(),this.subs.push(()=>{this.clearTimeoutFn(a)})}return this.subs.push(c),this.subs.push(h),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Nn(t,"ping",this.onping.bind(this)),Nn(t,"data",this.ondata.bind(this)),Nn(t,"error",this.onerror.bind(this)),Nn(t,"close",this.onclose.bind(this)),Nn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){oa(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let s=this.nsps[t];return s?this._autoConnect&&!s.active&&s.connect():(s=new Af(this,t,n),this.nsps[t]=s),s}_destroy(t){const n=Object.keys(this.nsps);for(const s of n)if(this.nsps[s].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let s=0;s<n.length;s++)this.engine.write(n[s],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(c=>{c?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",c)):t.onreconnect()}))},n);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Fs={};function ho(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=yS(e,t.path||"/socket.io"),s=n.source,c=n.id,o=n.path,h=Fs[c]&&o in Fs[c].nsps,r=t.forceNew||t["force new connection"]||t.multiplex===!1||h;let a;return r?a=new zl(s,t):(Fs[c]||(Fs[c]=new zl(s,t)),a=Fs[c]),n.query&&!t.query&&(t.query=n.queryKey),a.socket(n.path,t)}Object.assign(ho,{Manager:zl,Socket:Af,io:ho,connect:ho});const LS=e=>{const[t]=Ae.useState(new GE),[n,s]=Ae.useState(!1),[c,o]=Ae.useState(null),[h,r]=Ae.useState(!1),a=Ae.useCallback(async l=>{if(!l||h){console.info("No configuration provided or already connecting");return}const d=l.connectionType||"solace";r(!0);try{if(s(!1),d==="solace")t.disconnect(),await t.connect(l),t.setMessageCallback(e),s(!0);else{c&&c.disconnect();const _=ho(l.websocketUrl,{transports:["websocket"],reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3});_.on("connect",()=>{o(_),s(!0)}),_.on("message",p=>{try{p=JSON.parse(p)}catch(m){console.error("Error parsing JSON data in websocket received message:",m,p);return}const{payload:f,topic:S,user_properties:C}=p,g=ff(S,f,C);g&&e(g)}),_.on("capability",p=>{const f=BE(p);t.capabilityCallback&&t.capabilityCallback(f)}),_.on("connect_error",p=>{console.error("Socket.IO connection error:",p),s(!1)}),_.on("disconnect",p=>{console.log("Socket.IO connection closed:",p),s(!1)}),o(_)}}catch(_){throw console.error("Error connecting:",_),s(!1),_}finally{r(!1)}},[e,c,t,h]),u=Ae.useCallback(()=>{t&&t.disconnect(),c&&c.disconnect(),s(!1),o(null)},[t,c]);return Ae.useEffect(()=>u,[u]),[a,u,n,s]},bh="web-visualizer-config",ja="saved-configs",US=()=>{const[e,t]=Ae.useState(!1),[n,s]=Ae.useState(!1),[c,o]=Ae.useState(!1),[h,r]=Ae.useState([]),[a,u]=Ae.useState(()=>{var y,E,I,N,A,L,D,q,Y,Q;try{const W=JSON.parse(localStorage.getItem(bh)||"{}");return!W||!W.connectionType||!W.url||!W.vpnName||!W.userName?{connectionType:"solace",url:((y=window.config)==null?void 0:y.url)??"ws://localhost:8008",vpnName:((E=window.config)==null?void 0:E.vpn)??"default",userName:((I=window.config)==null?void 0:I.username)??"default",password:((N=window.config)==null?void 0:N.password)??"default",namespace:((A=window.config)==null?void 0:A.namespace)??""}:W}catch(W){return console.error("Error getting config from local storage:",W.message),{connectionType:"solace",url:((L=window.config)==null?void 0:L.url)??"ws://localhost:8008",vpnName:((D=window.config)==null?void 0:D.vpn)??"default",userName:((q=window.config)==null?void 0:q.username)??"default",password:((Y=window.config)==null?void 0:Y.password)??"default",namespace:((Q=window.config)==null?void 0:Q.namespace)??""}}}),[l,d,_,p]=LS(y=>{if(y.type==="registration"){const I=new CustomEvent("agentRegistration",{detail:y.content});window.dispatchEvent(I);return}if(y.type==="stimulus")Oh({...y,responses:[]});else if(["response","streamingResponse","responseComplete","actionRequest","actionResponse","orchestratorReinvoke","llmServiceRequest","llmServiceResponse"].includes(y.type)){if(y.type==="orchestratorReinvoke"||(console.log("EDE Processing message:",y),y.type==="llmServiceResponse"&&!y.content.last_chunk))return;(y.type!=="streamingResponse"||y.content.last_chunk)&&df().then(I=>{var L;const N=((L=y.stimulus_uuid)==null?void 0:L._value)||y.stimulus_uuid,A=I[N];if(A)Oh({...A,responses:[y]});else return})}const E=document.querySelector(".stimuli-page");if(E){const I=new CustomEvent("newMessage",{detail:y});E.dispatchEvent(I)}});Ae.useEffect(()=>{try{localStorage.setItem(bh,JSON.stringify(a))}catch(y){console.error("Error saving config to local storage:",y.message)}},[a]),Ae.useEffect(()=>{const y=JSON.parse(localStorage.getItem(ja)||"[]");r(y)},[]);const f=y=>{y&&l(a).then(()=>{if(p(!0),a.name){const E=h.findIndex(N=>N.name===a.name);let I;E!==-1?(I=[...h],I[E]=a):I=[...h,a],r(I),localStorage.setItem(ja,JSON.stringify(I))}}).catch(E=>{console.error("Connection failed:",E),p(!1)}),t(!1),o(!1)},S=()=>{d(),p(!1)},C=(y,E=!1)=>{u(y),s(!1),E?l(y).then(()=>{p(!0)}).catch(I=>{console.error("Connection failed:",I),p(!1)}):(t(!0),o(!1))},g=()=>{var y,E,I,N,A;u({name:"",connectionType:"solace",url:((y=window.config)==null?void 0:y.url)??"ws://localhost:8008",vpnName:((E=window.config)==null?void 0:E.vpn)??"default",userName:((I=window.config)==null?void 0:I.username)??"default",password:((N=window.config)==null?void 0:N.password)??"default",namespace:((A=window.config)==null?void 0:A.namespace)??""}),s(!1),t(!0),o(!0)},m=y=>{u(y),s(!1),t(!0),o(!1)},T=y=>{const E=h.filter(I=>I.name!==y);r(E),localStorage.setItem(ja,JSON.stringify(E)),s(!1)};return le.jsx(EE,{children:le.jsx(Xp,{children:le.jsx("div",{className:"app-wrapper",children:le.jsxs("div",{className:"app-container",children:[le.jsx("header",{className:"header",children:le.jsxs("nav",{className:"top-menu",children:[le.jsx("h1",{className:"app-title",children:"Solace Agent Mesh Visualizer"}),le.jsxs("ul",{className:"nav-links",children:[le.jsx("li",{children:le.jsx(Ih,{to:"/",end:!0,children:"Stimuli"})}),le.jsx("li",{children:le.jsx(Ih,{to:"/capabilities",children:"Agents"})})]}),le.jsxs("div",{className:"connection-controls",children:[n&&le.jsx(FE,{onSelect:C,onCreateNew:g,onCancel:()=>s(!1),onEdit:m,onDelete:T}),le.jsx(xE,{open:!_&&e,config:a,setConfig:u,onClose:f,isNewConfig:c,savedConfigs:h}),le.jsx("button",{className:"button button-info",onClick:_?S:()=>s(!0),children:_?"Disconnect":"Connect"})]})]})}),le.jsxs(cE,{children:[le.jsx(Gl,{path:"/",element:le.jsx(LE,{})}),le.jsx(Gl,{path:"/capabilities",element:le.jsx(UE,{})})]})]})})})})};fetch("config.json").then(e=>e.json()).then(e=>{window.config=e}).catch(e=>{console.log("Could not load config",e.message)}).finally(()=>{Ha.createRoot(document.getElementById("root")).render(le.jsx(Vh.StrictMode,{children:le.jsx(US,{})}))});
|