lightman-agent 1.0.0

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.
Files changed (54) hide show
  1. package/agent.config.template.json +30 -0
  2. package/bin/cms-agent.js +233 -0
  3. package/nssm/nssm.exe +0 -0
  4. package/package.json +52 -0
  5. package/public/assets/index-CcBNCz6h.css +1 -0
  6. package/public/assets/index-H-8HDl46.js +1 -0
  7. package/public/index.html +19 -0
  8. package/scripts/guardian.ps1 +75 -0
  9. package/scripts/install-linux.sh +134 -0
  10. package/scripts/install-rpi.sh +117 -0
  11. package/scripts/install-windows.ps1 +529 -0
  12. package/scripts/launch-kiosk.vbs +101 -0
  13. package/scripts/lightman-agent.logrotate +12 -0
  14. package/scripts/lightman-agent.service +38 -0
  15. package/scripts/lightman-shell.bat +128 -0
  16. package/scripts/reinstall-windows.ps1 +26 -0
  17. package/scripts/restore-desktop.ps1 +32 -0
  18. package/scripts/setup.ps1 +116 -0
  19. package/scripts/setup.sh +115 -0
  20. package/scripts/uninstall-linux.sh +50 -0
  21. package/scripts/uninstall-windows.ps1 +54 -0
  22. package/src/commands/display.ts +177 -0
  23. package/src/commands/kiosk.ts +113 -0
  24. package/src/commands/maintenance.ts +106 -0
  25. package/src/commands/network.ts +129 -0
  26. package/src/commands/power.ts +163 -0
  27. package/src/commands/rpi.ts +45 -0
  28. package/src/commands/screenshot.ts +166 -0
  29. package/src/commands/serial.ts +17 -0
  30. package/src/commands/update.ts +124 -0
  31. package/src/index.ts +652 -0
  32. package/src/lib/config.ts +69 -0
  33. package/src/lib/identity.ts +40 -0
  34. package/src/lib/logger.ts +137 -0
  35. package/src/lib/platform.ts +10 -0
  36. package/src/lib/rpi.ts +180 -0
  37. package/src/lib/screens.ts +128 -0
  38. package/src/lib/types.ts +176 -0
  39. package/src/services/commands.ts +107 -0
  40. package/src/services/health.ts +161 -0
  41. package/src/services/kiosk.ts +395 -0
  42. package/src/services/localEvents.ts +60 -0
  43. package/src/services/logForwarder.ts +72 -0
  44. package/src/services/multiScreenKiosk.ts +324 -0
  45. package/src/services/oscBridge.ts +186 -0
  46. package/src/services/powerScheduler.ts +260 -0
  47. package/src/services/provisioning.ts +120 -0
  48. package/src/services/serialBridge.ts +230 -0
  49. package/src/services/serviceLauncher.ts +183 -0
  50. package/src/services/staticServer.ts +226 -0
  51. package/src/services/updater.ts +249 -0
  52. package/src/services/watchdog.ts +310 -0
  53. package/src/services/websocket.ts +152 -0
  54. package/tsconfig.json +28 -0
@@ -0,0 +1 @@
1
+ var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,a=Math.pow,s=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,l=(e,t)=>{for(var n in t||(t={}))o.call(t,n)&&s(e,n,t[n]);if(r)for(var n of r(t))i.call(t,n)&&s(e,n,t[n]);return e},u=(e,r)=>t(e,n(r)),c=(e,t,n)=>s(e,"symbol"!=typeof t?t+"":t,n),f=(e,t,n)=>new Promise((r,o)=>{var i=e=>{try{s(n.next(e))}catch(t){o(t)}},a=e=>{try{s(n.throw(e))}catch(t){o(t)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(i,a);s((n=n.apply(e,t)).next())});!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver(e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)}).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();var p=Array.prototype,h=String.prototype,d=Object,y=Promise;if("function"!=typeof p.flat&&(p.flat=function(e){var t="number"==typeof e?e:1;if(t<1)return this.slice();for(var n=[],r=0;r<this.length;r++){var o=this[r];if(Array.isArray(o)&&t>0)for(var i=p.flat.call(o,t-1),a=0;a<i.length;a++)n.push(i[a]);else n.push(o)}return n}),"function"!=typeof p.flatMap&&(p.flatMap=function(e,t){var n=this.map(e,t);return p.flat.call(n,1)}),"function"!=typeof d.entries&&(d.entries=function(e){for(var t=Object.keys(e),n=[],r=0;r<t.length;r++)n.push([t[r],e[t[r]]]);return n}),"function"!=typeof d.fromEntries&&(d.fromEntries=function(e){for(var t={},n=e[Symbol.iterator](),r=n.next();!r.done;){var o=r.value;t[o[0]]=o[1],r=n.next()}return t}),"function"!=typeof h.replaceAll&&(h.replaceAll=function(e,t){if(e instanceof RegExp){if(!e.global)throw new TypeError("String.prototype.replaceAll called with a non-global RegExp argument");return this.replace(e,t)}var n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(n,"g");return this.replace(r,t)}),"function"!=typeof h.padStart&&(h.padStart=function(e,t){var n=String(this),r="string"==typeof t?t:" ";if((e=Math.floor(e)||0)<=n.length)return n;for(;n.length<e;)n=r+n;return n.slice(-e)}),"function"!=typeof h.padEnd&&(h.padEnd=function(e,t){var n=String(this),r="string"==typeof t?t:" ";if((e=Math.floor(e)||0)<=n.length)return n;for(;n.length<e;)n+=r;return n.slice(0,e)}),"function"!=typeof y.allSettled&&(y.allSettled=function(e){var t=Array.from(e).map(function(e){return Promise.resolve(e).then(function(e){return{status:"fulfilled",value:e}},function(e){return{status:"rejected",reason:e}})});return Promise.all(t)}),"undefined"==typeof globalThis&&("undefined"!=typeof self?self.globalThis=self:"undefined"!=typeof window&&(window.globalThis=window)),"function"!=typeof queueMicrotask&&(window.queueMicrotask=function(e){Promise.resolve().then(e)}),"undefined"==typeof AbortController){var g=function(){function e(){this.aborted=!1,this.reason=void 0,this._listeners=[]}return e.prototype.addEventListener=function(e,t){"abort"===e&&this._listeners.push(t)},e.prototype.removeEventListener=function(e,t){if("abort"===e){var n=this._listeners.indexOf(t);-1!==n&&this._listeners.splice(n,1)}},e.prototype._dispatch=function(){for(var e=0;e<this._listeners.length;e++)try{this._listeners[e]()}catch(t){}},e}();window.AbortController=function(){function e(){this.signal=new g}return e.prototype.abort=function(e){this.signal.aborted||(this.signal.aborted=!0,this.signal.reason=void 0!==e?e:new DOMException("The operation was aborted.","AbortError"),this.signal._dispatch())},e}()}var m="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function v(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function b(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var n=function e(){var n=!1;try{n=this instanceof e}catch(r){}return n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var w={exports:{}};function S(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var k,x,E={exports:{}},_=E.exports={};function C(){throw new Error("setTimeout has not been defined")}function I(){throw new Error("clearTimeout has not been defined")}function T(e){if(k===setTimeout)return setTimeout(e,0);if((k===C||!k)&&setTimeout)return k=setTimeout,setTimeout(e,0);try{return k(e,0)}catch(t){try{return k.call(null,e,0)}catch(n){return k.call(this,e,0)}}}!function(){try{k="function"==typeof setTimeout?setTimeout:C}catch(e){k=C}try{x="function"==typeof clearTimeout?clearTimeout:I}catch(e){x=I}}();var A,P=[],j=!1,O=-1;function R(){j&&A&&(j=!1,A.length?P=A.concat(P):O=-1,P.length&&M())}function M(){if(!j){var e=T(R);j=!0;for(var t=P.length;t;){for(A=P,P=[];++O<t;)A&&A[O].run();O=-1,t=P.length}A=null,j=!1,function(e){if(x===clearTimeout)return clearTimeout(e);if((x===I||!x)&&clearTimeout)return x=clearTimeout,clearTimeout(e);try{return x(e)}catch(t){try{return x.call(null,e)}catch(n){return x.call(this,e)}}}(e)}}function L(e,t){this.fun=e,this.array=t}function B(){}_.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];P.push(new L(e,t)),1!==P.length||j||T(M)},L.prototype.run=function(){this.fun.apply(null,this.array)},_.title="browser",_.browser=!0,_.env={},_.argv=[],_.version="",_.versions={},_.on=B,_.addListener=B,_.once=B,_.off=B,_.removeListener=B,_.removeAllListeners=B,_.emit=B,_.prependListener=B,_.prependOnceListener=B,_.listeners=function(e){return[]},_.binding=function(e){throw new Error("process.binding is not supported")},_.cwd=function(){return"/"},_.chdir=function(e){throw new Error("process.chdir is not supported")},_.umask=function(){return 0};const N=S(E.exports);var U,D,z={};function F(){if(U)return z;U=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),p=Symbol.iterator;var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},d=Object.assign,y={};function g(e,t,n){this.props=e,this.context=t,this.refs=y,this.updater=n||h}function m(){}function v(e,t,n){this.props=e,this.context=t,this.refs=y,this.updater=n||h}g.prototype.isReactComponent={},g.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("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")},g.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},m.prototype=g.prototype;var b=v.prototype=new m;b.constructor=v,d(b,g.prototype),b.isPureReactComponent=!0;var w=Array.isArray;function S(){}var k={H:null,A:null,T:null,S:null},x=Object.prototype.hasOwnProperty;function E(t,n,r){var o=r.ref;return{$$typeof:e,type:t,key:n,ref:void 0!==o?o:null,props:r}}function _(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var C=/\/+/g;function I(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(n=""+e.key,r={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var n,r}function T(n,r,o,i,a){var s=typeof n;"undefined"!==s&&"boolean"!==s||(n=null);var l,u,f=!1;if(null===n)f=!0;else switch(s){case"bigint":case"string":case"number":f=!0;break;case"object":switch(n.$$typeof){case e:case t:f=!0;break;case c:return T((f=n._init)(n._payload),r,o,i,a)}}if(f)return a=a(n),f=""===i?"."+I(n,0):i,w(a)?(o="",null!=f&&(o=f.replace(C,"$&/")+"/"),T(a,r,o,"",function(e){return e})):null!=a&&(_(a)&&(l=a,u=o+(null==a.key||n&&n.key===a.key?"":(""+a.key).replace(C,"$&/")+"/")+f,a=E(l.type,u,l.props)),r.push(a)),1;f=0;var h,d=""===i?".":i+":";if(w(n))for(var y=0;y<n.length;y++)f+=T(i=n[y],r,o,s=d+I(i,y),a);else if("function"==typeof(y=null===(h=n)||"object"!=typeof h?null:"function"==typeof(h=p&&h[p]||h["@@iterator"])?h:null))for(n=y.call(n),y=0;!(i=n.next()).done;)f+=T(i=i.value,r,o,s=d+I(i,y++),a);else if("object"===s){if("function"==typeof n.then)return T(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(S,S):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(n),r,o,i,a);throw r=String(n),Error("Objects are not valid as a React child (found: "+("[object Object]"===r?"object with keys {"+Object.keys(n).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.")}return f}function A(e,t,n){if(null==e)return e;var r=[],o=0;return T(e,r,"","",function(e){return t.call(n,e,o++)}),r}function P(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var j="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof N&&"function"==typeof N.emit)return void N.emit("uncaughtException",e);console.error(e)},O={map:A,forEach:function(e,t,n){A(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return A(e,function(){t++}),t},toArray:function(e){return A(e,function(e){return e})||[]},only:function(e){if(!_(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};return z.Activity=f,z.Children=O,z.Component=g,z.Fragment=n,z.Profiler=o,z.PureComponent=v,z.StrictMode=r,z.Suspense=l,z.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k,z.__COMPILER_RUNTIME={__proto__:null,c:function(e){return k.H.useMemoCache(e)}},z.cache=function(e){return function(){return e.apply(null,arguments)}},z.cacheSignal=function(){return null},z.cloneElement=function(e,t,n){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var r=d({},e.props),o=e.key;if(null!=t)for(i in void 0!==t.key&&(o=""+t.key),t)!x.call(t,i)||"key"===i||"__self"===i||"__source"===i||"ref"===i&&void 0===t.ref||(r[i]=t[i]);var i=arguments.length-2;if(1===i)r.children=n;else if(1<i){for(var a=Array(i),s=0;s<i;s++)a[s]=arguments[s+2];r.children=a}return E(e.type,o,r)},z.createContext=function(e){return(e={$$typeof:a,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:i,_context:e},e},z.createElement=function(e,t,n){var r,o={},i=null;if(null!=t)for(r in void 0!==t.key&&(i=""+t.key),t)x.call(t,r)&&"key"!==r&&"__self"!==r&&"__source"!==r&&(o[r]=t[r]);var a=arguments.length-2;if(1===a)o.children=n;else if(1<a){for(var s=Array(a),l=0;l<a;l++)s[l]=arguments[l+2];o.children=s}if(e&&e.defaultProps)for(r in a=e.defaultProps)void 0===o[r]&&(o[r]=a[r]);return E(e,i,o)},z.createRef=function(){return{current:null}},z.forwardRef=function(e){return{$$typeof:s,render:e}},z.isValidElement=_,z.lazy=function(e){return{$$typeof:c,_payload:{_status:-1,_result:e},_init:P}},z.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},z.startTransition=function(e){var t=k.T,n={};k.T=n;try{var r=e(),o=k.S;null!==o&&o(n,r),"object"==typeof r&&null!==r&&"function"==typeof r.then&&r.then(S,j)}catch(i){j(i)}finally{null!==t&&null!==n.types&&(t.types=n.types),k.T=t}},z.unstable_useCacheRefresh=function(){return k.H.useCacheRefresh()},z.use=function(e){return k.H.use(e)},z.useActionState=function(e,t,n){return k.H.useActionState(e,t,n)},z.useCallback=function(e,t){return k.H.useCallback(e,t)},z.useContext=function(e){return k.H.useContext(e)},z.useDebugValue=function(){},z.useDeferredValue=function(e,t){return k.H.useDeferredValue(e,t)},z.useEffect=function(e,t){return k.H.useEffect(e,t)},z.useEffectEvent=function(e){return k.H.useEffectEvent(e)},z.useId=function(){return k.H.useId()},z.useImperativeHandle=function(e,t,n){return k.H.useImperativeHandle(e,t,n)},z.useInsertionEffect=function(e,t){return k.H.useInsertionEffect(e,t)},z.useLayoutEffect=function(e,t){return k.H.useLayoutEffect(e,t)},z.useMemo=function(e,t){return k.H.useMemo(e,t)},z.useOptimistic=function(e,t){return k.H.useOptimistic(e,t)},z.useReducer=function(e,t,n){return k.H.useReducer(e,t,n)},z.useRef=function(e){return k.H.useRef(e)},z.useState=function(e){return k.H.useState(e)},z.useSyncExternalStore=function(e,t,n){return k.H.useSyncExternalStore(e,t,n)},z.useTransition=function(){return k.H.useTransition()},z.version="19.2.3",z}function H(){return D||(D=1,w.exports=F()),w.exports}var W=H();const q=v(W);var V,K,$={exports:{}},Q={},G={exports:{}},Y={};function X(){return K||(K=1,G.exports=(V||(V=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,i=e[r];if(!(0<o(i,t)))break e;e[r]=t,e[n]=i,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length,a=i>>>1;r<a;){var s=2*(r+1)-1,l=e[s],u=s+1,c=e[u];if(0>o(l,n))u<i&&0>o(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[s]=n,r=s);else{if(!(u<i&&0>o(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(e.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,f=null,p=3,h=!1,d=!1,y=!1,g=!1,m="function"==typeof setTimeout?setTimeout:null,v="function"==typeof clearTimeout?clearTimeout:null,b="undefined"!=typeof setImmediate?setImmediate:null;function w(e){for(var o=n(u);null!==o;){if(null===o.callback)r(u);else{if(!(o.startTime<=e))break;r(u),o.sortIndex=o.expirationTime,t(l,o)}o=n(u)}}function S(e){if(y=!1,w(e),!d)if(null!==n(l))d=!0,x||(x=!0,k());else{var t=n(u);null!==t&&j(S,t.startTime-e)}}var k,x=!1,E=-1,_=5,C=-1;function I(){return!(!g&&e.unstable_now()-C<_)}function T(){if(g=!1,x){var t=e.unstable_now();C=t;var o=!0;try{e:{d=!1,y&&(y=!1,v(E),E=-1),h=!0;var i=p;try{t:{for(w(t),f=n(l);null!==f&&!(f.expirationTime>t&&I());){var a=f.callback;if("function"==typeof a){f.callback=null,p=f.priorityLevel;var s=a(f.expirationTime<=t);if(t=e.unstable_now(),"function"==typeof s){f.callback=s,w(t),o=!0;break t}f===n(l)&&r(l),w(t)}else r(l);f=n(l)}if(null!==f)o=!0;else{var c=n(u);null!==c&&j(S,c.startTime-t),o=!1}}break e}finally{f=null,p=i,h=!1}o=void 0}}finally{o?k():x=!1}}}if("function"==typeof b)k=function(){b(T)};else if("undefined"!=typeof MessageChannel){var A=new MessageChannel,P=A.port2;A.port1.onmessage=T,k=function(){P.postMessage(null)}}else k=function(){m(T,0)};function j(t,n){E=m(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var n=p;p=t;try{return e()}finally{p=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=p;p=e;try{return t()}finally{p=n}},e.unstable_scheduleCallback=function(r,o,i){var a=e.unstable_now();switch(i="object"==typeof i&&null!==i&&"number"==typeof(i=i.delay)&&0<i?a+i:a,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return r={id:c++,callback:o,priorityLevel:r,startTime:i,expirationTime:s=i+s,sortIndex:-1},i>a?(r.sortIndex=i,t(u,r),null===n(l)&&r===n(u)&&(y?(v(E),E=-1):y=!0,j(S,i-a))):(r.sortIndex=s,t(l,r),d||h||(d=!0,x||(x=!0,k()))),r},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}}(Y)),Y)),G.exports}var Z,J,ee,te,ne={exports:{}},re={};function oe(){if(Z)return re;Z=1;var e=H();function t(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;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."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");var i=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(e,t){return"font"===e?"":"string"==typeof t?"use-credentials"===t?t:"":void 0}return re.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,re.createPortal=function(e,n){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!n||1!==n.nodeType&&9!==n.nodeType&&11!==n.nodeType)throw Error(t(299));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:o,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,n,null,r)},re.flushSync=function(e){var t=i.T,n=r.p;try{if(i.T=null,r.p=2,e)return e()}finally{i.T=t,r.p=n,r.d.f()}},re.preconnect=function(e,t){"string"==typeof e&&(t?t="string"==typeof(t=t.crossOrigin)?"use-credentials"===t?t:"":void 0:t=null,r.d.C(e,t))},re.prefetchDNS=function(e){"string"==typeof e&&r.d.D(e)},re.preinit=function(e,t){if("string"==typeof e&&t&&"string"==typeof t.as){var n=t.as,o=a(n,t.crossOrigin),i="string"==typeof t.integrity?t.integrity:void 0,s="string"==typeof t.fetchPriority?t.fetchPriority:void 0;"style"===n?r.d.S(e,"string"==typeof t.precedence?t.precedence:void 0,{crossOrigin:o,integrity:i,fetchPriority:s}):"script"===n&&r.d.X(e,{crossOrigin:o,integrity:i,fetchPriority:s,nonce:"string"==typeof t.nonce?t.nonce:void 0})}},re.preinitModule=function(e,t){if("string"==typeof e)if("object"==typeof t&&null!==t){if(null==t.as||"script"===t.as){var n=a(t.as,t.crossOrigin);r.d.M(e,{crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0})}}else null==t&&r.d.M(e)},re.preload=function(e,t){if("string"==typeof e&&"object"==typeof t&&null!==t&&"string"==typeof t.as){var n=t.as,o=a(n,t.crossOrigin);r.d.L(e,n,{crossOrigin:o,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0,type:"string"==typeof t.type?t.type:void 0,fetchPriority:"string"==typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"string"==typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"==typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"==typeof t.imageSizes?t.imageSizes:void 0,media:"string"==typeof t.media?t.media:void 0})}},re.preloadModule=function(e,t){if("string"==typeof e)if(t){var n=a(t.as,t.crossOrigin);r.d.m(e,{as:"string"==typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0})}else r.d.m(e)},re.requestFormReset=function(e){r.d.r(e)},re.unstable_batchedUpdates=function(e,t){return e(t)},re.useFormState=function(e,t,n){return i.H.useFormState(e,t,n)},re.useFormStatus=function(){return i.H.useHostTransitionStatus()},re.version="19.2.3",re}function ie(){if(ee)return Q;ee=1;var e=X(),t=H(),n=(J||(J=1,function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),ne.exports=oe()),ne.exports);function r(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;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."}function o(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function i(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function a(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function s(e){if(31===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function l(e){if(i(e)!==e)throw Error(r(188))}function u(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e;for(e=e.child;null!==e;){if(null!==(t=u(e)))return t;e=e.sibling}return null}var c=Object.assign,f=Symbol.for("react.element"),p=Symbol.for("react.transitional.element"),h=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),v=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),S=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),_=Symbol.for("react.memo_cache_sentinel"),C=Symbol.iterator;function I(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=C&&e[C]||e["@@iterator"])?e:null}var T=Symbol.for("react.client.reference");function A(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===T?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case d:return"Fragment";case g:return"Profiler";case y:return"StrictMode";case w:return"Suspense";case S:return"SuspenseList";case E:return"Activity"}if("object"==typeof e)switch(e.$$typeof){case h:return"Portal";case v:return e.displayName||"Context";case m:return(e._context.displayName||"Context")+".Consumer";case b:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case k:return null!==(t=e.displayName||null)?t:A(e.type)||"Memo";case x:t=e._payload,e=e._init;try{return A(e(t))}catch(n){}}return null}var P=Array.isArray,j=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,O=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R={pending:!1,data:null,method:null,action:null},M=[],L=-1;function B(e){return{current:e}}function U(e){0>L||(e.current=M[L],M[L]=null,L--)}function D(e,t){L++,M[L]=e.current,e.current=t}var z,F,W=B(null),q=B(null),V=B(null),K=B(null);function $(e,t){switch(D(V,t),D(q,e),D(W,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?xf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=Ef(t=xf(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(W),D(W,e)}function G(){U(W),U(q),U(V)}function Y(e){null!==e.memoizedState&&D(K,e);var t=W.current,n=Ef(t,e.type);t!==n&&(D(q,e),D(W,n))}function Z(e){q.current===e&&(U(W),U(q)),K.current===e&&(U(K),gp._currentValue=R)}function te(e){if(void 0===z)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);z=t&&t[1]||"",F=-1<n.stack.indexOf("\n at")?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+z+e+F}var re=!1;function ie(e,t){if(!e||re)return"";re=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(n,[])}catch(o){var r=o}Reflect.construct(e,[],n)}else{try{n.call()}catch(i){r=i}e.call(n.prototype)}}else{try{throw Error()}catch(a){r=a}(n=e())&&"function"==typeof n.catch&&n.catch(function(){})}}catch(s){if(s&&r&&"string"==typeof s.stack)return[s.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=r.DetermineComponentFrameRoot(),a=i[0],s=i[1];if(a&&s){var l=a.split("\n"),u=s.split("\n");for(o=r=0;r<l.length&&!l[r].includes("DetermineComponentFrameRoot");)r++;for(;o<u.length&&!u[o].includes("DetermineComponentFrameRoot");)o++;if(r===l.length||o===u.length)for(r=l.length-1,o=u.length-1;1<=r&&0<=o&&l[r]!==u[o];)o--;for(;1<=r&&0<=o;r--,o--)if(l[r]!==u[o]){if(1!==r||1!==o)do{if(r--,0>--o||l[r]!==u[o]){var c="\n"+l[r].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}}while(1<=r&&0<=o);break}}}finally{re=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?te(n):""}function ae(e,t){switch(e.tag){case 26:case 27:case 5:return te(e.type);case 16:return te("Lazy");case 13:return e.child!==t&&null!==t?te("Suspense Fallback"):te("Suspense");case 19:return te("SuspenseList");case 0:case 15:return ie(e.type,!1);case 11:return ie(e.type.render,!1);case 1:return ie(e.type,!0);case 31:return te("Activity");default:return""}}function se(e){try{var t="",n=null;do{t+=ae(e,n),n=e,e=e.return}while(e);return t}catch(r){return"\nError generating stack: "+r.message+"\n"+r.stack}}var le=Object.prototype.hasOwnProperty,ue=e.unstable_scheduleCallback,ce=e.unstable_cancelCallback,fe=e.unstable_shouldYield,pe=e.unstable_requestPaint,he=e.unstable_now,de=e.unstable_getCurrentPriorityLevel,ye=e.unstable_ImmediatePriority,ge=e.unstable_UserBlockingPriority,me=e.unstable_NormalPriority,ve=e.unstable_LowPriority,be=e.unstable_IdlePriority,we=e.log,Se=e.unstable_setDisableYieldValue,ke=null,xe=null;function Ee(e){if("function"==typeof we&&Se(e),xe&&"function"==typeof xe.setStrictMode)try{xe.setStrictMode(ke,e)}catch(t){}}var _e=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-(Ce(e)/Ie|0)|0},Ce=Math.log,Ie=Math.LN2;var Te=256,Ae=262144,Pe=4194304;function je(e){var t=42&e;if(0!==t)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Oe(e,t,n){var r=e.pendingLanes;if(0===r)return 0;var o=0,i=e.suspendedLanes,a=e.pingedLanes;e=e.warmLanes;var s=134217727&r;return 0!==s?0!==(r=s&~i)?o=je(r):0!==(a&=s)?o=je(a):n||0!==(n=s&~e)&&(o=je(n)):0!==(s=r&~i)?o=je(s):0!==a?o=je(a):n||0!==(n=r&~e)&&(o=je(n)),0===o?0:0!==t&&t!==o&&0===(t&i)&&((i=o&-o)>=(n=t&-t)||32===i&&4194048&n)?t:o}function Re(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function Me(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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;default:return-1}}function Le(){var e=Pe;return!(62914560&(Pe<<=1))&&(Pe=4194304),e}function Be(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ne(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ue(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-_e(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|261930&n}function De(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-_e(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}function ze(e,t){var n=t&-t;return 0!==((n=42&n?1:Fe(n))&(e.suspendedLanes|t))?0:n}function Fe(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function He(e){return 2<(e&=-e)?8<e?134217727&e?32:268435456:8:2}function We(){var e=O.p;return 0!==e?e:void 0===(e=window.event)?32:Op(e.type)}function qe(e,t){var n=O.p;try{return O.p=e,t()}finally{O.p=n}}var Ve=Math.random().toString(36).slice(2),Ke="__reactFiber$"+Ve,$e="__reactProps$"+Ve,Qe="__reactContainer$"+Ve,Ge="__reactEvents$"+Ve,Ye="__reactListeners$"+Ve,Xe="__reactHandles$"+Ve,Ze="__reactResources$"+Ve,Je="__reactMarker$"+Ve;function et(e){delete e[Ke],delete e[$e],delete e[Ge],delete e[Ye],delete e[Xe]}function tt(e){var t=e[Ke];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Qe]||n[Ke]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Hf(e);null!==e;){if(n=e[Ke])return n;e=Hf(e)}return t}n=(e=n).parentNode}return null}function nt(e){if(e=e[Ke]||e[Qe]){var t=e.tag;if(5===t||6===t||13===t||31===t||26===t||27===t||3===t)return e}return null}function rt(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e.stateNode;throw Error(r(33))}function ot(e){var t=e[Ze];return t||(t=e[Ze]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function it(e){e[Je]=!0}var at=new Set,st={};function lt(e,t){ut(e,t),ut(e+"Capture",t)}function ut(e,t){for(st[e]=t,e=0;e<t.length;e++)at.add(t[e])}var ct=RegExp("^[: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]*$"),ft={},pt={};function ht(e,t,n){if(o=t,le.call(pt,o)||!le.call(ft,o)&&(ct.test(o)?pt[o]=!0:(ft[o]=!0,0)))if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":return void e.removeAttribute(t);case"boolean":var r=t.toLowerCase().slice(0,5);if("data-"!==r&&"aria-"!==r)return void e.removeAttribute(t)}e.setAttribute(t,""+n)}var o}function dt(e,t,n){if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(t)}e.setAttribute(t,""+n)}}function yt(e,t,n,r){if(null===r)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(n)}e.setAttributeNS(t,n,""+r)}}function gt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function mt(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function vt(e){if(!e._valueTracker){var t=mt(e)?"checked":"value";e._valueTracker=function(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&void 0!==r&&"function"==typeof r.get&&"function"==typeof r.set){var o=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){n=""+e,i.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e,t,""+e[t])}}function bt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=mt(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function wt(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}var St=/[\n"\\]/g;function kt(e){return e.replace(St,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function xt(e,t,n,r,o,i,a,s){e.name="",null!=a&&"function"!=typeof a&&"symbol"!=typeof a&&"boolean"!=typeof a?e.type=a:e.removeAttribute("type"),null!=t?"number"===a?(0===t&&""===e.value||e.value!=t)&&(e.value=""+gt(t)):e.value!==""+gt(t)&&(e.value=""+gt(t)):"submit"!==a&&"reset"!==a||e.removeAttribute("value"),null!=t?_t(e,a,gt(t)):null!=n?_t(e,a,gt(n)):null!=r&&e.removeAttribute("value"),null==o&&null!=i&&(e.defaultChecked=!!i),null!=o&&(e.checked=o&&"function"!=typeof o&&"symbol"!=typeof o),null!=s&&"function"!=typeof s&&"symbol"!=typeof s&&"boolean"!=typeof s?e.name=""+gt(s):e.removeAttribute("name")}function Et(e,t,n,r,o,i,a,s){if(null!=i&&"function"!=typeof i&&"symbol"!=typeof i&&"boolean"!=typeof i&&(e.type=i),null!=t||null!=n){if(("submit"===i||"reset"===i)&&null==t)return void vt(e);n=null!=n?""+gt(n):"",t=null!=t?""+gt(t):n,s||t===e.value||(e.value=t),e.defaultValue=t}r="function"!=typeof(r=null!=r?r:o)&&"symbol"!=typeof r&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,null!=a&&"function"!=typeof a&&"symbol"!=typeof a&&"boolean"!=typeof a&&(e.name=a),vt(e)}function _t(e,t,n){"number"===t&&wt(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Ct(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+gt(n),t=null,o=0;o<e.length;o++){if(e[o].value===n)return e[o].selected=!0,void(r&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function It(e,t,n){null==t||((t=""+gt(t))!==e.value&&(e.value=t),null!=n)?e.defaultValue=null!=n?""+gt(n):"":e.defaultValue!==t&&(e.defaultValue=t)}function Tt(e,t,n,o){if(null==t){if(null!=o){if(null!=n)throw Error(r(92));if(P(o)){if(1<o.length)throw Error(r(93));o=o[0]}n=o}null==n&&(n=""),t=n}n=gt(t),e.defaultValue=n,(o=e.textContent)===n&&""!==o&&null!==o&&(e.value=o),vt(e)}function At(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var Pt=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function jt(e,t,n){var r=0===t.indexOf("--");null==n||"boolean"==typeof n||""===n?r?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":r?e.setProperty(t,n):"number"!=typeof n||0===n||Pt.has(t)?"float"===t?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Ot(e,t,n){if(null!=t&&"object"!=typeof t)throw Error(r(62));if(e=e.style,null!=n){for(var o in n)!n.hasOwnProperty(o)||null!=t&&t.hasOwnProperty(o)||(0===o.indexOf("--")?e.setProperty(o,""):"float"===o?e.cssFloat="":e[o]="");for(var i in t)o=t[i],t.hasOwnProperty(i)&&n[i]!==o&&jt(e,i,o)}else for(var a in t)t.hasOwnProperty(a)&&jt(e,a,t[a])}function Rt(e){if(-1===e.indexOf("-"))return!1;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 Mt=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Lt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Bt(e){return Lt.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Nt(){}var Ut=null;function Dt(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var zt=null,Ft=null;function Ht(e){var t=nt(e);if(t&&(e=t.stateNode)){var n=e[$e]||null;e:switch(e=t.stateNode,t.type){case"input":if(xt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+kt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var o=n[t];if(o!==e&&o.form===e.form){var i=o[$e]||null;if(!i)throw Error(r(90));xt(o,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)(o=n[t]).form===e.form&&bt(o)}break e;case"textarea":It(e,n.value,n.defaultValue);break e;case"select":null!=(t=n.value)&&Ct(e,!!n.multiple,t,!1)}}}var Wt=!1;function qt(e,t,n){if(Wt)return e(t,n);Wt=!0;try{return e(t)}finally{if(Wt=!1,(null!==zt||null!==Ft)&&(oc(),zt&&(t=zt,e=Ft,Ft=zt=null,Ht(t),e)))for(t=0;t<e.length;t++)Ht(e[t])}}function Vt(e,t){var n=e.stateNode;if(null===n)return null;var o=n[$e]||null;if(null===o)return null;n=o[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":(o=!o.disabled)||(o=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!o;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(r(231,t,typeof n));return n}var Kt=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),$t=!1;if(Kt)try{var Qt={};Object.defineProperty(Qt,"passive",{get:function(){$t=!0}}),window.addEventListener("test",Qt,Qt),window.removeEventListener("test",Qt,Qt)}catch(rh){$t=!1}var Gt=null,Yt=null,Xt=null;function Zt(){if(Xt)return Xt;var e,t,n=Yt,r=n.length,o="value"in Gt?Gt.value:Gt.textContent,i=o.length;for(e=0;e<r&&n[e]===o[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===o[i-t];t++);return Xt=o.slice(e,1<t?1-t:void 0)}function Jt(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function en(){return!0}function tn(){return!1}function nn(e){function t(t,n,r,o,i){for(var a in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=o,this.target=i,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(o):o[a]);return this.isDefaultPrevented=(null!=o.defaultPrevented?o.defaultPrevented:!1===o.returnValue)?en:tn,this.isPropagationStopped=tn,this}return c(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=en)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=en)},persist:function(){},isPersistent:en}),t}var rn,on,an,sn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ln=nn(sn),un=c({},sn,{view:0,detail:0}),cn=nn(un),fn=c({},un,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==an&&(an&&"mousemove"===e.type?(rn=e.screenX-an.screenX,on=e.screenY-an.screenY):on=rn=0,an=e),rn)},movementY:function(e){return"movementY"in e?e.movementY:on}}),pn=nn(fn),hn=nn(c({},fn,{dataTransfer:0})),dn=nn(c({},un,{relatedTarget:0})),yn=nn(c({},sn,{animationName:0,elapsedTime:0,pseudoElement:0})),gn=nn(c({},sn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),mn=nn(c({},sn,{data:0})),vn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bn={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"},wn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Sn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=wn[e])&&!!t[e]}function kn(){return Sn}var xn=nn(c({},un,{key:function(e){if(e.key){var t=vn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Jt(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?bn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kn,charCode:function(e){return"keypress"===e.type?Jt(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Jt(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),En=nn(c({},fn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),_n=nn(c({},un,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kn})),Cn=nn(c({},sn,{propertyName:0,elapsedTime:0,pseudoElement:0})),In=nn(c({},fn,{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})),Tn=nn(c({},sn,{newState:0,oldState:0})),An=[9,13,27,32],Pn=Kt&&"CompositionEvent"in window,jn=null;Kt&&"documentMode"in document&&(jn=document.documentMode);var On=Kt&&"TextEvent"in window&&!jn,Rn=Kt&&(!Pn||jn&&8<jn&&11>=jn),Mn=String.fromCharCode(32),Ln=!1;function Bn(e,t){switch(e){case"keyup":return-1!==An.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Un=!1;var Dn={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 zn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Dn[e.type]:"textarea"===t}function Fn(e,t,n,r){zt?Ft?Ft.push(r):Ft=[r]:zt=r,0<(t=uf(t,"onChange")).length&&(n=new ln("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Hn=null,Wn=null;function qn(e){ef(e,0)}function Vn(e){if(bt(rt(e)))return e}function Kn(e,t){if("change"===e)return t}var $n=!1;if(Kt){var Qn;if(Kt){var Gn="oninput"in document;if(!Gn){var Yn=document.createElement("div");Yn.setAttribute("oninput","return;"),Gn="function"==typeof Yn.oninput}Qn=Gn}else Qn=!1;$n=Qn&&(!document.documentMode||9<document.documentMode)}function Xn(){Hn&&(Hn.detachEvent("onpropertychange",Zn),Wn=Hn=null)}function Zn(e){if("value"===e.propertyName&&Vn(Wn)){var t=[];Fn(t,Wn,e,Dt(e)),qt(qn,t)}}function Jn(e,t,n){"focusin"===e?(Xn(),Wn=n,(Hn=t).attachEvent("onpropertychange",Zn)):"focusout"===e&&Xn()}function er(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Vn(Wn)}function tr(e,t){if("click"===e)return Vn(t)}function nr(e,t){if("input"===e||"change"===e)return Vn(t)}var rr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function or(e,t){if(rr(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!le.call(t,o)||!rr(e[o],t[o]))return!1}return!0}function ir(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ar(e,t){var n,r=ir(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=ir(r)}}function sr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?sr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function lr(e){for(var t=wt((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=wt((e=t.contentWindow).document)}return t}function ur(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var cr=Kt&&"documentMode"in document&&11>=document.documentMode,fr=null,pr=null,hr=null,dr=!1;function yr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;dr||null==fr||fr!==wt(r)||("selectionStart"in(r=fr)&&ur(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},hr&&or(hr,r)||(hr=r,0<(r=uf(pr,"onSelect")).length&&(t=new ln("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=fr)))}function gr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var mr={animationend:gr("Animation","AnimationEnd"),animationiteration:gr("Animation","AnimationIteration"),animationstart:gr("Animation","AnimationStart"),transitionrun:gr("Transition","TransitionRun"),transitionstart:gr("Transition","TransitionStart"),transitioncancel:gr("Transition","TransitionCancel"),transitionend:gr("Transition","TransitionEnd")},vr={},br={};function wr(e){if(vr[e])return vr[e];if(!mr[e])return e;var t,n=mr[e];for(t in n)if(n.hasOwnProperty(t)&&t in br)return vr[e]=n[t];return e}Kt&&(br=document.createElement("div").style,"AnimationEvent"in window||(delete mr.animationend.animation,delete mr.animationiteration.animation,delete mr.animationstart.animation),"TransitionEvent"in window||delete mr.transitionend.transition);var Sr=wr("animationend"),kr=wr("animationiteration"),xr=wr("animationstart"),Er=wr("transitionrun"),_r=wr("transitionstart"),Cr=wr("transitioncancel"),Ir=wr("transitionend"),Tr=new Map,Ar="abort auxClick beforeToggle 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 Pr(e,t){Tr.set(e,t),lt(t,[e])}Ar.push("scrollEnd");var jr="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof N&&"function"==typeof N.emit)return void N.emit("uncaughtException",e);console.error(e)},Or=[],Rr=0,Mr=0;function Lr(){for(var e=Rr,t=Mr=Rr=0;t<e;){var n=Or[t];Or[t++]=null;var r=Or[t];Or[t++]=null;var o=Or[t];Or[t++]=null;var i=Or[t];if(Or[t++]=null,null!==r&&null!==o){var a=r.pending;null===a?o.next=o:(o.next=a.next,a.next=o),r.pending=o}0!==i&&Dr(n,o,i)}}function Br(e,t,n,r){Or[Rr++]=e,Or[Rr++]=t,Or[Rr++]=n,Or[Rr++]=r,Mr|=r,e.lanes|=r,null!==(e=e.alternate)&&(e.lanes|=r)}function Nr(e,t,n,r){return Br(e,t,n,r),zr(e)}function Ur(e,t){return Br(e,null,null,t),zr(e)}function Dr(e,t,n){e.lanes|=n;var r=e.alternate;null!==r&&(r.lanes|=n);for(var o=!1,i=e.return;null!==i;)i.childLanes|=n,null!==(r=i.alternate)&&(r.childLanes|=n),22===i.tag&&(null===(e=i.stateNode)||1&e._visibility||(o=!0)),e=i,i=i.return;return 3===e.tag?(i=e.stateNode,o&&null!==t&&(o=31-_e(n),null===(r=(e=i.hiddenUpdates)[o])?e[o]=[t]:r.push(t),t.lane=536870912|n),i):null}function zr(e){if(50<Gu)throw Gu=0,Yu=null,Error(r(185));for(var t=e.return;null!==t;)t=(e=t).return;return 3===e.tag?e.stateNode:null}var Fr={};function Hr(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wr(e,t,n,r){return new Hr(e,t,n,r)}function qr(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Vr(e,t){var n=e.alternate;return null===n?((n=Wr(e.tag,t,e.key,e.mode)).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=65011712&e.flags,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=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Kr(e,t){e.flags&=65011714;var n=e.alternate;return null===n?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function $r(e,t,n,o,i,a){var s=0;if(o=e,"function"==typeof e)qr(e)&&(s=1);else if("string"==typeof e)s=function(e,t,n){if(1===n||null!=t.itemProp)return!1;switch(e){case"meta":case"title":return!0;case"style":if("string"!=typeof t.precedence||"string"!=typeof t.href||""===t.href)break;return!0;case"link":if("string"!=typeof t.rel||"string"!=typeof t.href||""===t.href||t.onLoad||t.onError)break;return"stylesheet"!==t.rel||(e=t.disabled,"string"==typeof t.precedence&&null==e);case"script":if(t.async&&"function"!=typeof t.async&&"symbol"!=typeof t.async&&!t.onLoad&&!t.onError&&t.src&&"string"==typeof t.src)return!0}return!1}(e,n,W.current)?26:"html"===e||"head"===e||"body"===e?27:5;else e:switch(e){case E:return(e=Wr(31,n,t,i)).elementType=E,e.lanes=a,e;case d:return Qr(n.children,i,a,t);case y:s=8,i|=24;break;case g:return(e=Wr(12,n,t,2|i)).elementType=g,e.lanes=a,e;case w:return(e=Wr(13,n,t,i)).elementType=w,e.lanes=a,e;case S:return(e=Wr(19,n,t,i)).elementType=S,e.lanes=a,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case v:s=10;break e;case m:s=9;break e;case b:s=11;break e;case k:s=14;break e;case x:s=16,o=null;break e}s=29,n=Error(r(130,null===e?"null":typeof e,"")),o=null}return(t=Wr(s,n,t,i)).elementType=e,t.type=o,t.lanes=a,t}function Qr(e,t,n,r){return(e=Wr(7,e,r,t)).lanes=n,e}function Gr(e,t,n){return(e=Wr(6,e,null,t)).lanes=n,e}function Yr(e){var t=Wr(18,null,null,0);return t.stateNode=e,t}function Xr(e,t,n){return(t=Wr(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Zr=new WeakMap;function Jr(e,t){if("object"==typeof e&&null!==e){var n=Zr.get(e);return void 0!==n?n:(t={value:e,source:t,stack:se(t)},Zr.set(e,t),t)}return{value:e,source:t,stack:se(t)}}var eo=[],to=0,no=null,ro=0,oo=[],io=0,ao=null,so=1,lo="";function uo(e,t){eo[to++]=ro,eo[to++]=no,no=e,ro=t}function co(e,t,n){oo[io++]=so,oo[io++]=lo,oo[io++]=ao,ao=e;var r=so;e=lo;var o=32-_e(r)-1;r&=~(1<<o),n+=1;var i=32-_e(t)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,so=1<<32-_e(t)+o|n<<o|r,lo=i+e}else so=1<<i|n<<o|r,lo=e}function fo(e){null!==e.return&&(uo(e,1),co(e,1,0))}function po(e){for(;e===no;)no=eo[--to],eo[to]=null,ro=eo[--to],eo[to]=null;for(;e===ao;)ao=oo[--io],oo[io]=null,lo=oo[--io],oo[io]=null,so=oo[--io],oo[io]=null}function ho(e,t){oo[io++]=so,oo[io++]=lo,oo[io++]=ao,so=t.id,lo=t.overflow,ao=e}var yo=null,go=null,mo=!1,vo=null,bo=!1,wo=Error(r(519));function So(e){throw Io(Jr(Error(r(418,1<arguments.length&&void 0!==arguments[1]&&arguments[1]?"text":"HTML","")),e)),wo}function ko(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Ke]=e,t[$e]=r,n){case"dialog":tf("cancel",t),tf("close",t);break;case"iframe":case"object":case"embed":tf("load",t);break;case"video":case"audio":for(n=0;n<Zc.length;n++)tf(Zc[n],t);break;case"source":tf("error",t);break;case"img":case"image":case"link":tf("error",t),tf("load",t);break;case"details":tf("toggle",t);break;case"input":tf("invalid",t),Et(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":tf("invalid",t);break;case"textarea":tf("invalid",t),Tt(t,r.value,r.defaultValue,r.children)}"string"!=typeof(n=r.children)&&"number"!=typeof n&&"bigint"!=typeof n||t.textContent===""+n||!0===r.suppressHydrationWarning||yf(t.textContent,n)?(null!=r.popover&&(tf("beforetoggle",t),tf("toggle",t)),null!=r.onScroll&&tf("scroll",t),null!=r.onScrollEnd&&tf("scrollend",t),null!=r.onClick&&(t.onclick=Nt),t=!0):t=!1,t||So(e,!0)}function xo(e){for(yo=e.return;yo;)switch(yo.tag){case 5:case 31:case 13:return void(bo=!1);case 27:case 3:return void(bo=!0);default:yo=yo.return}}function Eo(e){if(e!==yo)return!1;if(!mo)return xo(e),mo=!0,!1;var t,n=e.tag;if((t=3!==n&&27!==n)&&((t=5===n)&&(t=!("form"!==(t=e.type)&&"button"!==t)||_f(e.type,e.memoizedProps)),t=!t),t&&go&&So(e),xo(e),13===n){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(r(317));go=Ff(e)}else if(31===n){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(r(317));go=Ff(e)}else 27===n?(n=go,Of(e.type)?(e=zf,zf=null,go=e):go=n):go=yo?Df(e.stateNode.nextSibling):null;return!0}function _o(){go=yo=null,mo=!1}function Co(){var e=vo;return null!==e&&(null===Lu?Lu=e:Lu.push.apply(Lu,e),vo=null),e}function Io(e){null===vo?vo=[e]:vo.push(e)}var To=B(null),Ao=null,Po=null;function jo(e,t,n){D(To,t._currentValue),t._currentValue=n}function Oo(e){e._currentValue=To.current,U(To)}function Ro(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Mo(e,t,n,o){var i=e.child;for(null!==i&&(i.return=e);null!==i;){var a=i.dependencies;if(null!==a){var s=i.child;a=a.firstContext;e:for(;null!==a;){var l=a;a=i;for(var u=0;u<t.length;u++)if(l.context===t[u]){a.lanes|=n,null!==(l=a.alternate)&&(l.lanes|=n),Ro(a.return,n,e),o||(s=null);break e}a=l.next}}else if(18===i.tag){if(null===(s=i.return))throw Error(r(341));s.lanes|=n,null!==(a=s.alternate)&&(a.lanes|=n),Ro(s,n,e),s=null}else s=i.child;if(null!==s)s.return=i;else for(s=i;null!==s;){if(s===e){s=null;break}if(null!==(i=s.sibling)){i.return=s.return,s=i;break}s=s.return}i=s}}function Lo(e,t,n,o){e=null;for(var i=t,a=!1;null!==i;){if(!a)if(524288&i.flags)a=!0;else if(262144&i.flags)break;if(10===i.tag){var s=i.alternate;if(null===s)throw Error(r(387));if(null!==(s=s.memoizedProps)){var l=i.type;rr(i.pendingProps.value,s.value)||(null!==e?e.push(l):e=[l])}}else if(i===K.current){if(null===(s=i.alternate))throw Error(r(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(null!==e?e.push(gp):e=[gp])}i=i.return}null!==e&&Mo(t,e,n,o),t.flags|=262144}function Bo(e){for(e=e.firstContext;null!==e;){if(!rr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function No(e){Ao=e,Po=null,null!==(e=e.dependencies)&&(e.firstContext=null)}function Uo(e){return zo(Ao,e)}function Do(e,t){return null===Ao&&No(e),zo(e,t)}function zo(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},null===Po){if(null===e)throw Error(r(308));Po=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Po=Po.next=t;return n}var Fo="undefined"!=typeof AbortController?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Ho=e.unstable_scheduleCallback,Wo=e.unstable_NormalPriority,qo={$$typeof:v,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Vo(){return{controller:new Fo,data:new Map,refCount:0}}function Ko(e){e.refCount--,0===e.refCount&&Ho(Wo,function(){e.controller.abort()})}var $o=null,Qo=0,Go=0,Yo=null;function Xo(){if(0===--Qo&&null!==$o){null!==Yo&&(Yo.status="fulfilled");var e=$o;$o=null,Go=0,Yo=null;for(var t=0;t<e.length;t++)(0,e[t])()}}var Zo=j.S;j.S=function(e,t){Uu=he(),"object"==typeof t&&null!==t&&"function"==typeof t.then&&function(e,t){if(null===$o){var n=$o=[];Qo=0,Go=$c(),Yo={status:"pending",value:void 0,then:function(e){n.push(e)}}}Qo++,t.then(Xo,Xo)}(0,t),null!==Zo&&Zo(e,t)};var Jo=B(null);function ei(){var e=Jo.current;return null!==e?e:bu.pooledCache}function ti(e,t){D(Jo,null===t?Jo.current:t.pool)}function ni(){var e=ei();return null===e?null:{parent:qo._currentValue,pool:e}}var ri=Error(r(460)),oi=Error(r(474)),ii=Error(r(542)),ai={then:function(){}};function si(e){return"fulfilled"===(e=e.status)||"rejected"===e}function li(e,t,n){switch(void 0===(n=e[n])?e.push(t):n!==t&&(t.then(Nt,Nt),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw pi(e=t.reason),e;default:if("string"==typeof t.status)t.then(Nt,Nt);else{if(null!==(e=bu)&&100<e.shellSuspendCounter)throw Error(r(482));(e=t).status="pending",e.then(function(e){if("pending"===t.status){var n=t;n.status="fulfilled",n.value=e}},function(e){if("pending"===t.status){var n=t;n.status="rejected",n.reason=e}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw pi(e=t.reason),e}throw ci=t,ri}}function ui(e){try{return(0,e._init)(e._payload)}catch(t){if(null!==t&&"object"==typeof t&&"function"==typeof t.then)throw ci=t,ri;throw t}}var ci=null;function fi(){if(null===ci)throw Error(r(459));var e=ci;return ci=null,e}function pi(e){if(e===ri||e===ii)throw Error(r(483))}var hi=null,di=0;function yi(e){var t=di;return di+=1,null===hi&&(hi=[]),li(hi,e,t)}function gi(e,t){t=t.props.ref,e.ref=void 0!==t?t:null}function mi(e,t){if(t.$$typeof===f)throw Error(r(525));throw e=Object.prototype.toString.call(t),Error(r(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function vi(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function o(e){for(var t=new Map;null!==e;)null!==e.key?t.set(e.key,e):t.set(e.index,e),e=e.sibling;return t}function i(e,t){return(e=Vr(e,t)).index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=67108866,n):r:(t.flags|=67108866,n):(t.flags|=1048576,n)}function s(t){return e&&null===t.alternate&&(t.flags|=67108866),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Gr(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function u(e,t,n,r){var o=n.type;return o===d?f(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===o||"object"==typeof o&&null!==o&&o.$$typeof===x&&ui(o)===t.type)?(gi(t=i(t,n.props),n),t.return=e,t):(gi(t=$r(n.type,n.key,n.props,null,e.mode,r),n),t.return=e,t)}function c(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Xr(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function f(e,t,n,r,o){return null===t||7!==t.tag?((t=Qr(n,e.mode,r,o)).return=e,t):((t=i(t,n)).return=e,t)}function y(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t||"bigint"==typeof t)return(t=Gr(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case p:return gi(n=$r(t.type,t.key,t.props,null,e.mode,n),t),n.return=e,n;case h:return(t=Xr(t,e.mode,n)).return=e,t;case x:return y(e,t=ui(t),n)}if(P(t)||I(t))return(t=Qr(t,e.mode,n,null)).return=e,t;if("function"==typeof t.then)return y(e,yi(t),n);if(t.$$typeof===v)return y(e,Do(e,t),n);mi(e,t)}return null}function g(e,t,n,r){var o=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n||"bigint"==typeof n)return null!==o?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case p:return n.key===o?u(e,t,n,r):null;case h:return n.key===o?c(e,t,n,r):null;case x:return g(e,t,n=ui(n),r)}if(P(n)||I(n))return null!==o?null:f(e,t,n,r,null);if("function"==typeof n.then)return g(e,t,yi(n),r);if(n.$$typeof===v)return g(e,t,Do(e,n),r);mi(e,n)}return null}function m(e,t,n,r,o){if("string"==typeof r&&""!==r||"number"==typeof r||"bigint"==typeof r)return l(t,e=e.get(n)||null,""+r,o);if("object"==typeof r&&null!==r){switch(r.$$typeof){case p:return u(t,e=e.get(null===r.key?n:r.key)||null,r,o);case h:return c(t,e=e.get(null===r.key?n:r.key)||null,r,o);case x:return m(e,t,n,r=ui(r),o)}if(P(r)||I(r))return f(t,e=e.get(n)||null,r,o,null);if("function"==typeof r.then)return m(e,t,n,yi(r),o);if(r.$$typeof===v)return m(e,t,n,Do(t,r),o);mi(t,r)}return null}function b(l,u,c,f){if("object"==typeof c&&null!==c&&c.type===d&&null===c.key&&(c=c.props.children),"object"==typeof c&&null!==c){switch(c.$$typeof){case p:e:{for(var w=c.key;null!==u;){if(u.key===w){if((w=c.type)===d){if(7===u.tag){n(l,u.sibling),(f=i(u,c.props.children)).return=l,l=f;break e}}else if(u.elementType===w||"object"==typeof w&&null!==w&&w.$$typeof===x&&ui(w)===u.type){n(l,u.sibling),gi(f=i(u,c.props),c),f.return=l,l=f;break e}n(l,u);break}t(l,u),u=u.sibling}c.type===d?((f=Qr(c.props.children,l.mode,f,c.key)).return=l,l=f):(gi(f=$r(c.type,c.key,c.props,null,l.mode,f),c),f.return=l,l=f)}return s(l);case h:e:{for(w=c.key;null!==u;){if(u.key===w){if(4===u.tag&&u.stateNode.containerInfo===c.containerInfo&&u.stateNode.implementation===c.implementation){n(l,u.sibling),(f=i(u,c.children||[])).return=l,l=f;break e}n(l,u);break}t(l,u),u=u.sibling}(f=Xr(c,l.mode,f)).return=l,l=f}return s(l);case x:return b(l,u,c=ui(c),f)}if(P(c))return function(r,i,s,l){for(var u=null,c=null,f=i,p=i=0,h=null;null!==f&&p<s.length;p++){f.index>p?(h=f,f=null):h=f.sibling;var d=g(r,f,s[p],l);if(null===d){null===f&&(f=h);break}e&&f&&null===d.alternate&&t(r,f),i=a(d,i,p),null===c?u=d:c.sibling=d,c=d,f=h}if(p===s.length)return n(r,f),mo&&uo(r,p),u;if(null===f){for(;p<s.length;p++)null!==(f=y(r,s[p],l))&&(i=a(f,i,p),null===c?u=f:c.sibling=f,c=f);return mo&&uo(r,p),u}for(f=o(f);p<s.length;p++)null!==(h=m(f,r,p,s[p],l))&&(e&&null!==h.alternate&&f.delete(null===h.key?p:h.key),i=a(h,i,p),null===c?u=h:c.sibling=h,c=h);return e&&f.forEach(function(e){return t(r,e)}),mo&&uo(r,p),u}(l,u,c,f);if(I(c)){if("function"!=typeof(w=I(c)))throw Error(r(150));return function(i,s,l,u){if(null==l)throw Error(r(151));for(var c=null,f=null,p=s,h=s=0,d=null,v=l.next();null!==p&&!v.done;h++,v=l.next()){p.index>h?(d=p,p=null):d=p.sibling;var b=g(i,p,v.value,u);if(null===b){null===p&&(p=d);break}e&&p&&null===b.alternate&&t(i,p),s=a(b,s,h),null===f?c=b:f.sibling=b,f=b,p=d}if(v.done)return n(i,p),mo&&uo(i,h),c;if(null===p){for(;!v.done;h++,v=l.next())null!==(v=y(i,v.value,u))&&(s=a(v,s,h),null===f?c=v:f.sibling=v,f=v);return mo&&uo(i,h),c}for(p=o(p);!v.done;h++,v=l.next())null!==(v=m(p,i,h,v.value,u))&&(e&&null!==v.alternate&&p.delete(null===v.key?h:v.key),s=a(v,s,h),null===f?c=v:f.sibling=v,f=v);return e&&p.forEach(function(e){return t(i,e)}),mo&&uo(i,h),c}(l,u,c=w.call(c),f)}if("function"==typeof c.then)return b(l,u,yi(c),f);if(c.$$typeof===v)return b(l,u,Do(l,c),f);mi(l,c)}return"string"==typeof c&&""!==c||"number"==typeof c||"bigint"==typeof c?(c=""+c,null!==u&&6===u.tag?(n(l,u.sibling),(f=i(u,c)).return=l,l=f):(n(l,u),(f=Gr(c,l.mode,f)).return=l,l=f),s(l)):n(l,u)}return function(e,t,n,r){try{di=0;var o=b(e,t,n,r);return hi=null,o}catch(a){if(a===ri||a===ii)throw a;var i=Wr(29,a,null,e.mode);return i.lanes=r,i.return=e,i}}}var bi=vi(!0),wi=vi(!1),Si=!1;function ki(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function xi(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ei(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function _i(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&vu){var o=r.pending;return null===o?t.next=t:(t.next=o.next,o.next=t),r.pending=t,t=zr(e),Dr(e,null,n),t}return Br(e,r,t,n),zr(e)}function Ci(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194048&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,De(e,n)}}function Ii(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var o=null,i=null;if(null!==(n=n.firstBaseUpdate)){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===i?o=i=a:i=i.next=a,n=n.next}while(null!==n);null===i?o=i=t:i=i.next=t}else o=i=t;return n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,callbacks:r.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ti=!1;function Ai(){if(Ti){if(null!==Yo)throw Yo}}function Pi(e,t,n,r){Ti=!1;var o=e.updateQueue;Si=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,s=o.shared.pending;if(null!==s){o.shared.pending=null;var l=s,u=l.next;l.next=null,null===a?i=u:a.next=u,a=l;var f=e.alternate;null!==f&&((s=(f=f.updateQueue).lastBaseUpdate)!==a&&(null===s?f.firstBaseUpdate=u:s.next=u,f.lastBaseUpdate=l))}if(null!==i){var p=o.baseState;for(a=0,f=u=l=null,s=i;;){var h=-536870913&s.lane,d=h!==s.lane;if(d?(Su&h)===h:(r&h)===h){0!==h&&h===Go&&(Ti=!0),null!==f&&(f=f.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var y=e,g=s;h=t;var m=n;switch(g.tag){case 1:if("function"==typeof(y=g.payload)){p=y.call(m,p,h);break e}p=y;break e;case 3:y.flags=-65537&y.flags|128;case 0:if(null==(h="function"==typeof(y=g.payload)?y.call(m,p,h):y))break e;p=c({},p,h);break e;case 2:Si=!0}}null!==(h=s.callback)&&(e.flags|=64,d&&(e.flags|=8192),null===(d=o.callbacks)?o.callbacks=[h]:d.push(h))}else d={lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===f?(u=f=d,l=p):f=f.next=d,a|=h;if(null===(s=s.next)){if(null===(s=o.shared.pending))break;s=(d=s).next,d.next=null,o.lastBaseUpdate=d,o.shared.pending=null}}null===f&&(l=p),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=f,null===i&&(o.shared.lanes=0),Au|=a,e.lanes=a,e.memoizedState=p}}function ji(e,t){if("function"!=typeof e)throw Error(r(191,e));e.call(t)}function Oi(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;e<n.length;e++)ji(n[e],t)}var Ri=B(null),Mi=B(0);function Li(e,t){D(Mi,e=Iu),D(Ri,t),Iu=e|t.baseLanes}function Bi(){D(Mi,Iu),D(Ri,Ri.current)}function Ni(){Iu=Mi.current,U(Ri),U(Mi)}var Ui=B(null),Di=null;function zi(e){var t=e.alternate;D(Vi,1&Vi.current),D(Ui,e),null===Di&&(null===t||null!==Ri.current||null!==t.memoizedState)&&(Di=e)}function Fi(e){D(Vi,Vi.current),D(Ui,e),null===Di&&(Di=e)}function Hi(e){22===e.tag?(D(Vi,Vi.current),D(Ui,e),null===Di&&(Di=e)):Wi()}function Wi(){D(Vi,Vi.current),D(Ui,Ui.current)}function qi(e){U(Ui),Di===e&&(Di=null),U(Vi)}var Vi=B(0);function Ki(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||Nf(n)||Uf(n)))return t}else if(19!==t.tag||"forwards"!==t.memoizedProps.revealOrder&&"backwards"!==t.memoizedProps.revealOrder&&"unstable_legacy-backwards"!==t.memoizedProps.revealOrder&&"together"!==t.memoizedProps.revealOrder){if(null!==t.child){t.child.return=t,t=t.child;continue}}else if(128&t.flags)return t;if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var $i=0,Qi=null,Gi=null,Yi=null,Xi=!1,Zi=!1,Ji=!1,ea=0,ta=0,na=null,ra=0;function oa(){throw Error(r(321))}function ia(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!rr(e[n],t[n]))return!1;return!0}function aa(e,t,n,r,o,i){return $i=i,Qi=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,j.H=null===e||null===e.memoizedState?Ss:ks,Ji=!1,i=n(r,o),Ji=!1,Zi&&(i=la(t,n,r,o)),sa(e),i}function sa(e){j.H=ws;var t=null!==Gi&&null!==Gi.next;if($i=0,Yi=Gi=Qi=null,Xi=!1,ta=0,na=null,t)throw Error(r(300));null===e||Us||null!==(e=e.dependencies)&&Bo(e)&&(Us=!0)}function la(e,t,n,o){Qi=e;var i=0;do{if(Zi&&(na=null),ta=0,Zi=!1,25<=i)throw Error(r(301));if(i+=1,Yi=Gi=null,null!=e.updateQueue){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,null!=a.memoCache&&(a.memoCache.index=0)}j.H=xs,a=t(n,o)}while(Zi);return a}function ua(){var e=j.H,t=e.useState()[0];return t="function"==typeof t.then?ya(t):t,e=e.useState()[0],(null!==Gi?Gi.memoizedState:null)!==e&&(Qi.flags|=1024),t}function ca(){var e=0!==ea;return ea=0,e}function fa(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function pa(e){if(Xi){for(e=e.memoizedState;null!==e;){var t=e.queue;null!==t&&(t.pending=null),e=e.next}Xi=!1}$i=0,Yi=Gi=Qi=null,Zi=!1,ta=ea=0,na=null}function ha(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Yi?Qi.memoizedState=Yi=e:Yi=Yi.next=e,Yi}function da(){if(null===Gi){var e=Qi.alternate;e=null!==e?e.memoizedState:null}else e=Gi.next;var t=null===Yi?Qi.memoizedState:Yi.next;if(null!==t)Yi=t,Gi=e;else{if(null===e){if(null===Qi.alternate)throw Error(r(467));throw Error(r(310))}e={memoizedState:(Gi=e).memoizedState,baseState:Gi.baseState,baseQueue:Gi.baseQueue,queue:Gi.queue,next:null},null===Yi?Qi.memoizedState=Yi=e:Yi=Yi.next=e}return Yi}function ya(e){var t=ta;return ta+=1,null===na&&(na=[]),e=li(na,e,t),t=Qi,null===(null===Yi?t.memoizedState:Yi.next)&&(t=t.alternate,j.H=null===t||null===t.memoizedState?Ss:ks),e}function ga(e){if(null!==e&&"object"==typeof e){if("function"==typeof e.then)return ya(e);if(e.$$typeof===v)return Uo(e)}throw Error(r(438,String(e)))}function ma(e){var t=null,n=Qi.updateQueue;if(null!==n&&(t=n.memoCache),null==t){var r=Qi.alternate;null!==r&&(null!==(r=r.updateQueue)&&(null!=(r=r.memoCache)&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(null==t&&(t={data:[],index:0}),null===n&&(n={lastEffect:null,events:null,stores:null,memoCache:null},Qi.updateQueue=n),n.memoCache=t,void 0===(n=t.data[t.index]))for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=_;return t.index++,n}function va(e,t){return"function"==typeof t?t(e):t}function ba(e){return wa(da(),Gi,e)}function wa(e,t,n){var o=e.queue;if(null===o)throw Error(r(311));o.lastRenderedReducer=n;var i=e.baseQueue,a=o.pending;if(null!==a){if(null!==i){var s=i.next;i.next=a.next,a.next=s}t.baseQueue=i=a,o.pending=null}if(a=e.baseState,null===i)e.memoizedState=a;else{var l=s=null,u=null,c=t=i.next,f=!1;do{var p=-536870913&c.lane;if(p!==c.lane?(Su&p)===p:($i&p)===p){var h=c.revertLane;if(0===h)null!==u&&(u=u.next={lane:0,revertLane:0,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),p===Go&&(f=!0);else{if(($i&h)===h){c=c.next,h===Go&&(f=!0);continue}p={lane:0,revertLane:c.revertLane,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},null===u?(l=u=p,s=a):u=u.next=p,Qi.lanes|=h,Au|=h}p=c.action,Ji&&n(a,p),a=c.hasEagerState?c.eagerState:n(a,p)}else h={lane:p,revertLane:c.revertLane,gesture:c.gesture,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},null===u?(l=u=h,s=a):u=u.next=h,Qi.lanes|=p,Au|=p;c=c.next}while(null!==c&&c!==t);if(null===u?s=a:u.next=l,!rr(a,e.memoizedState)&&(Us=!0,f&&null!==(n=Yo)))throw n;e.memoizedState=a,e.baseState=s,e.baseQueue=u,o.lastRenderedState=a}return null===i&&(o.lanes=0),[e.memoizedState,o.dispatch]}function Sa(e){var t=da(),n=t.queue;if(null===n)throw Error(r(311));n.lastRenderedReducer=e;var o=n.dispatch,i=n.pending,a=t.memoizedState;if(null!==i){n.pending=null;var s=i=i.next;do{a=e(a,s.action),s=s.next}while(s!==i);rr(a,t.memoizedState)||(Us=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),n.lastRenderedState=a}return[a,o]}function ka(e,t,n){var o=Qi,i=da(),a=mo;if(a){if(void 0===n)throw Error(r(407));n=n()}else n=t();var s=!rr((Gi||i).memoizedState,n);if(s&&(i.memoizedState=n,Us=!0),i=i.queue,$a(_a.bind(null,o,i,e),[e]),i.getSnapshot!==t||s||null!==Yi&&1&Yi.memoizedState.tag){if(o.flags|=2048,Ha(9,{destroy:void 0},Ea.bind(null,o,i,n,t),null),null===bu)throw Error(r(349));a||127&$i||xa(o,t,n)}return n}function xa(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=Qi.updateQueue)?(t={lastEffect:null,events:null,stores:null,memoCache:null},Qi.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Ea(e,t,n,r){t.value=n,t.getSnapshot=r,Ca(t)&&Ia(e)}function _a(e,t,n){return n(function(){Ca(t)&&Ia(e)})}function Ca(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!rr(e,n)}catch(r){return!0}}function Ia(e){var t=Ur(e,2);null!==t&&Ju(t,e,2)}function Ta(e){var t=ha();if("function"==typeof e){var n=e;if(e=n(),Ji){Ee(!0);try{n()}finally{Ee(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:va,lastRenderedState:e},t}function Aa(e,t,n,r){return e.baseState=n,wa(e,Gi,"function"==typeof r?r:va)}function Pa(e,t,n,o,i){if(ms(e))throw Error(r(485));if(null!==(e=t.action)){var a={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(e){a.listeners.push(e)}};null!==j.T?n(!0):a.isTransition=!1,o(a),null===(n=t.pending)?(a.next=t.pending=a,ja(t,a)):(a.next=n.next,t.pending=n.next=a)}}function ja(e,t){var n=t.action,r=t.payload,o=e.state;if(t.isTransition){var i=j.T,a={};j.T=a;try{var s=n(o,r),l=j.S;null!==l&&l(a,s),Oa(e,t,s)}catch(u){Ma(e,t,u)}finally{null!==i&&null!==a.types&&(i.types=a.types),j.T=i}}else try{Oa(e,t,i=n(o,r))}catch(c){Ma(e,t,c)}}function Oa(e,t,n){null!==n&&"object"==typeof n&&"function"==typeof n.then?n.then(function(n){Ra(e,t,n)},function(n){return Ma(e,t,n)}):Ra(e,t,n)}function Ra(e,t,n){t.status="fulfilled",t.value=n,La(t),e.state=n,null!==(t=e.pending)&&((n=t.next)===t?e.pending=null:(n=n.next,t.next=n,ja(e,n)))}function Ma(e,t,n){var r=e.pending;if(e.pending=null,null!==r){r=r.next;do{t.status="rejected",t.reason=n,La(t),t=t.next}while(t!==r)}e.action=null}function La(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ba(e,t){return t}function Na(e,t){if(mo){var n=bu.formState;if(null!==n){e:{var r=Qi;if(mo){if(go){t:{for(var o=go,i=bo;8!==o.nodeType;){if(!i){o=null;break t}if(null===(o=Df(o.nextSibling))){o=null;break t}}o="F!"===(i=o.data)||"F"===i?o:null}if(o){go=Df(o.nextSibling),r="F!"===o.data;break e}}So(r)}r=!1}r&&(t=n[0])}}return(n=ha()).memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ba,lastRenderedState:t},n.queue=r,n=ds.bind(null,Qi,r),r.dispatch=n,r=Ta(!1),i=gs.bind(null,Qi,!1,r.queue),o={state:t,dispatch:null,action:e,pending:null},(r=ha()).queue=o,n=Pa.bind(null,Qi,o,i,n),o.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ua(e){return Da(da(),Gi,e)}function Da(e,t,n){if(t=wa(e,t,Ba)[0],e=ba(va)[0],"object"==typeof t&&null!==t&&"function"==typeof t.then)try{var r=ya(t)}catch(a){if(a===ri)throw ii;throw a}else r=t;var o=(t=da()).queue,i=o.dispatch;return n!==t.memoizedState&&(Qi.flags|=2048,Ha(9,{destroy:void 0},za.bind(null,o,n),null)),[r,i,e]}function za(e,t){e.action=t}function Fa(e){var t=da(),n=Gi;if(null!==n)return Da(t,n,e);da(),t=t.memoizedState;var r=(n=da()).queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ha(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},null===(t=Qi.updateQueue)&&(t={lastEffect:null,events:null,stores:null,memoCache:null},Qi.updateQueue=t),null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Wa(){return da().memoizedState}function qa(e,t,n,r){var o=ha();Qi.flags|=e,o.memoizedState=Ha(1|t,{destroy:void 0},n,void 0===r?null:r)}function Va(e,t,n,r){var o=da();r=void 0===r?null:r;var i=o.memoizedState.inst;null!==Gi&&null!==r&&ia(r,Gi.memoizedState.deps)?o.memoizedState=Ha(t,i,n,r):(Qi.flags|=e,o.memoizedState=Ha(1|t,i,n,r))}function Ka(e,t){qa(8390656,8,e,t)}function $a(e,t){Va(2048,8,e,t)}function Qa(e){var t=da().memoizedState;return function(e){Qi.flags|=4;var t=Qi.updateQueue;if(null===t)t={lastEffect:null,events:null,stores:null,memoCache:null},Qi.updateQueue=t,t.events=[e];else{var n=t.events;null===n?t.events=[e]:n.push(e)}}({ref:t,nextImpl:e}),function(){if(2&vu)throw Error(r(440));return t.impl.apply(void 0,arguments)}}function Ga(e,t){return Va(4,2,e,t)}function Ya(e,t){return Va(4,4,e,t)}function Xa(e,t){if("function"==typeof t){e=e();var n=t(e);return function(){"function"==typeof n?n():t(null)}}if(null!=t)return e=e(),t.current=e,function(){t.current=null}}function Za(e,t,n){n=null!=n?n.concat([e]):null,Va(4,4,Xa.bind(null,t,e),n)}function Ja(){}function es(e,t){var n=da();t=void 0===t?null:t;var r=n.memoizedState;return null!==t&&ia(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ts(e,t){var n=da();t=void 0===t?null:t;var r=n.memoizedState;if(null!==t&&ia(t,r[1]))return r[0];if(r=e(),Ji){Ee(!0);try{e()}finally{Ee(!1)}}return n.memoizedState=[r,t],r}function ns(e,t,n){return void 0===n||1073741824&$i&&!(261930&Su)?e.memoizedState=t:(e.memoizedState=n,e=Zu(),Qi.lanes|=e,Au|=e,n)}function rs(e,t,n,r){return rr(n,t)?n:null!==Ri.current?(e=ns(e,n,r),rr(e,t)||(Us=!0),e):42&$i&&(!(1073741824&$i)||261930&Su)?(e=Zu(),Qi.lanes|=e,Au|=e,t):(Us=!0,e.memoizedState=n)}function os(e,t,n,r,o){var i=O.p;O.p=0!==i&&8>i?i:8;var a,s,l,u=j.T,c={};j.T=c,gs(e,!1,t,n);try{var f=o(),p=j.S;if(null!==p&&p(c,f),null!==f&&"object"==typeof f&&"function"==typeof f.then){var h=(a=r,s=[],l={status:"pending",value:null,reason:null,then:function(e){s.push(e)}},f.then(function(){l.status="fulfilled",l.value=a;for(var e=0;e<s.length;e++)(0,s[e])(a)},function(e){for(l.status="rejected",l.reason=e,e=0;e<s.length;e++)(0,s[e])(void 0)}),l);ys(e,t,h,Xu())}else ys(e,t,r,Xu())}catch(d){ys(e,t,{then:function(){},status:"rejected",reason:d},Xu())}finally{O.p=i,null!==u&&null!==c.types&&(u.types=c.types),j.T=u}}function is(){}function as(e,t,n,o){if(5!==e.tag)throw Error(r(476));var i=ss(e).queue;os(e,i,t,R,null===n?is:function(){return ls(e),n(o)})}function ss(e){var t=e.memoizedState;if(null!==t)return t;var n={};return(t={memoizedState:R,baseState:R,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:va,lastRenderedState:R},next:null}).next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:va,lastRenderedState:n},next:null},e.memoizedState=t,null!==(e=e.alternate)&&(e.memoizedState=t),t}function ls(e){var t=ss(e);null===t.next&&(t=e.alternate.memoizedState),ys(e,t.next.queue,{},Xu())}function us(){return Uo(gp)}function cs(){return da().memoizedState}function fs(){return da().memoizedState}function ps(e){for(var t=e.return;null!==t;){switch(t.tag){case 24:case 3:var n=Xu(),r=_i(t,e=Ei(n),n);return null!==r&&(Ju(r,t,n),Ci(r,t,n)),t={cache:Vo()},void(e.payload=t)}t=t.return}}function hs(e,t,n){var r=Xu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ms(e)?vs(t,n):null!==(n=Nr(e,t,n,r))&&(Ju(n,e,r),bs(n,t,r))}function ds(e,t,n){ys(e,t,n,Xu())}function ys(e,t,n,r){var o={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ms(e))vs(t,o);else{var i=e.alternate;if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,rr(s,a))return Br(e,t,o,0),null===bu&&Lr(),!1}catch(l){}if(null!==(n=Nr(e,t,o,r)))return Ju(n,e,r),bs(n,t,r),!0}return!1}function gs(e,t,n,o){if(o={lane:2,revertLane:$c(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},ms(e)){if(t)throw Error(r(479))}else null!==(t=Nr(e,n,o,2))&&Ju(t,e,2)}function ms(e){var t=e.alternate;return e===Qi||null!==t&&t===Qi}function vs(e,t){Zi=Xi=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function bs(e,t,n){if(4194048&n){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,De(e,n)}}var ws={readContext:Uo,use:ga,useCallback:oa,useContext:oa,useEffect:oa,useImperativeHandle:oa,useLayoutEffect:oa,useInsertionEffect:oa,useMemo:oa,useReducer:oa,useRef:oa,useState:oa,useDebugValue:oa,useDeferredValue:oa,useTransition:oa,useSyncExternalStore:oa,useId:oa,useHostTransitionStatus:oa,useFormState:oa,useActionState:oa,useOptimistic:oa,useMemoCache:oa,useCacheRefresh:oa};ws.useEffectEvent=oa;var Ss={readContext:Uo,use:ga,useCallback:function(e,t){return ha().memoizedState=[e,void 0===t?null:t],e},useContext:Uo,useEffect:Ka,useImperativeHandle:function(e,t,n){n=null!=n?n.concat([e]):null,qa(4194308,4,Xa.bind(null,t,e),n)},useLayoutEffect:function(e,t){return qa(4194308,4,e,t)},useInsertionEffect:function(e,t){qa(4,2,e,t)},useMemo:function(e,t){var n=ha();t=void 0===t?null:t;var r=e();if(Ji){Ee(!0);try{e()}finally{Ee(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ha();if(void 0!==n){var o=n(t);if(Ji){Ee(!0);try{n(t)}finally{Ee(!1)}}}else o=t;return r.memoizedState=r.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},r.queue=e,e=e.dispatch=hs.bind(null,Qi,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},ha().memoizedState=e},useState:function(e){var t=(e=Ta(e)).queue,n=ds.bind(null,Qi,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ja,useDeferredValue:function(e,t){return ns(ha(),e,t)},useTransition:function(){var e=Ta(!1);return e=os.bind(null,Qi,e.queue,!0,!1),ha().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var o=Qi,i=ha();if(mo){if(void 0===n)throw Error(r(407));n=n()}else{if(n=t(),null===bu)throw Error(r(349));127&Su||xa(o,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,Ka(_a.bind(null,o,a,e),[e]),o.flags|=2048,Ha(9,{destroy:void 0},Ea.bind(null,o,a,n,t),null),n},useId:function(){var e=ha(),t=bu.identifierPrefix;if(mo){var n=lo;t="_"+t+"R_"+(n=(so&~(1<<32-_e(so)-1)).toString(32)+n),0<(n=ea++)&&(t+="H"+n.toString(32)),t+="_"}else t="_"+t+"r_"+(n=ra++).toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:us,useFormState:Na,useActionState:Na,useOptimistic:function(e){var t=ha();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=gs.bind(null,Qi,!0,n),n.dispatch=t,[e,t]},useMemoCache:ma,useCacheRefresh:function(){return ha().memoizedState=ps.bind(null,Qi)},useEffectEvent:function(e){var t=ha(),n={impl:e};return t.memoizedState=n,function(){if(2&vu)throw Error(r(440));return n.impl.apply(void 0,arguments)}}},ks={readContext:Uo,use:ga,useCallback:es,useContext:Uo,useEffect:$a,useImperativeHandle:Za,useInsertionEffect:Ga,useLayoutEffect:Ya,useMemo:ts,useReducer:ba,useRef:Wa,useState:function(){return ba(va)},useDebugValue:Ja,useDeferredValue:function(e,t){return rs(da(),Gi.memoizedState,e,t)},useTransition:function(){var e=ba(va)[0],t=da().memoizedState;return["boolean"==typeof e?e:ya(e),t]},useSyncExternalStore:ka,useId:cs,useHostTransitionStatus:us,useFormState:Ua,useActionState:Ua,useOptimistic:function(e,t){return Aa(da(),0,e,t)},useMemoCache:ma,useCacheRefresh:fs};ks.useEffectEvent=Qa;var xs={readContext:Uo,use:ga,useCallback:es,useContext:Uo,useEffect:$a,useImperativeHandle:Za,useInsertionEffect:Ga,useLayoutEffect:Ya,useMemo:ts,useReducer:Sa,useRef:Wa,useState:function(){return Sa(va)},useDebugValue:Ja,useDeferredValue:function(e,t){var n=da();return null===Gi?ns(n,e,t):rs(n,Gi.memoizedState,e,t)},useTransition:function(){var e=Sa(va)[0],t=da().memoizedState;return["boolean"==typeof e?e:ya(e),t]},useSyncExternalStore:ka,useId:cs,useHostTransitionStatus:us,useFormState:Fa,useActionState:Fa,useOptimistic:function(e,t){var n=da();return null!==Gi?Aa(n,0,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:ma,useCacheRefresh:fs};function Es(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:c({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}xs.useEffectEvent=Qa;var _s={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Xu(),o=Ei(r);o.payload=t,null!=n&&(o.callback=n),null!==(t=_i(e,o,r))&&(Ju(t,e,r),Ci(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Xu(),o=Ei(r);o.tag=1,o.payload=t,null!=n&&(o.callback=n),null!==(t=_i(e,o,r))&&(Ju(t,e,r),Ci(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Xu(),r=Ei(n);r.tag=2,null!=t&&(r.callback=t),null!==(t=_i(e,r,n))&&(Ju(t,e,n),Ci(t,e,n))}};function Cs(e,t,n,r,o,i,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,i,a):!t.prototype||!t.prototype.isPureReactComponent||(!or(n,r)||!or(o,i))}function Is(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&_s.enqueueReplaceState(t,t.state,null)}function Ts(e,t){var n=t;if("ref"in t)for(var r in n={},t)"ref"!==r&&(n[r]=t[r]);if(e=e.defaultProps)for(var o in n===t&&(n=c({},n)),e)void 0===n[o]&&(n[o]=e[o]);return n}function As(e){jr(e)}function Ps(e){console.error(e)}function js(e){jr(e)}function Os(e,t){try{(0,e.onUncaughtError)(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Rs(e,t,n){try{(0,e.onCaughtError)(n.value,{componentStack:n.stack,errorBoundary:1===t.tag?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Ms(e,t,n){return(n=Ei(n)).tag=3,n.payload={element:null},n.callback=function(){Os(e,t)},n}function Ls(e){return(e=Ei(e)).tag=3,e}function Bs(e,t,n,r){var o=n.type.getDerivedStateFromError;if("function"==typeof o){var i=r.value;e.payload=function(){return o(i)},e.callback=function(){Rs(t,n,r)}}var a=n.stateNode;null!==a&&"function"==typeof a.componentDidCatch&&(e.callback=function(){Rs(t,n,r),"function"!=typeof o&&(null===Fu?Fu=new Set([this]):Fu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:null!==e?e:""})})}var Ns=Error(r(461)),Us=!1;function Ds(e,t,n,r){t.child=null===e?wi(t,null,n,r):bi(t,e.child,n,r)}function zs(e,t,n,r,o){n=n.render;var i=t.ref;if("ref"in r){var a={};for(var s in r)"ref"!==s&&(a[s]=r[s])}else a=r;return No(t),r=aa(e,t,n,a,i,o),s=ca(),null===e||Us?(mo&&s&&fo(t),t.flags|=1,Ds(e,t,r,o),t.child):(fa(e,t,o),ul(e,t,o))}function Fs(e,t,n,r,o){if(null===e){var i=n.type;return"function"!=typeof i||qr(i)||void 0!==i.defaultProps||null!==n.compare?((e=$r(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,Hs(e,t,i,r,o))}if(i=e.child,!cl(e,o)){var a=i.memoizedProps;if((n=null!==(n=n.compare)?n:or)(a,r)&&e.ref===t.ref)return ul(e,t,o)}return t.flags|=1,(e=Vr(i,r)).ref=t.ref,e.return=t,t.child=e}function Hs(e,t,n,r,o){if(null!==e){var i=e.memoizedProps;if(or(i,r)&&e.ref===t.ref){if(Us=!1,t.pendingProps=r=i,!cl(e,o))return t.lanes=e.lanes,ul(e,t,o);131072&e.flags&&(Us=!0)}}return Gs(e,t,n,r,o)}function Ws(e,t,n,r){var o=r.children,i=null!==e?e.memoizedState:null;if(null===e&&null===t.stateNode&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),"hidden"===r.mode){if(128&t.flags){if(i=null!==i?i.baseLanes|n:n,null!==e){for(r=t.child=e.child,o=0;null!==r;)o=o|r.lanes|r.childLanes,r=r.sibling;r=o&~i}else r=0,t.child=null;return Vs(e,t,i,n,r)}if(!(536870912&n))return r=t.lanes=536870912,Vs(e,t,null!==i?i.baseLanes|n:n,n,r);t.memoizedState={baseLanes:0,cachePool:null},null!==e&&ti(0,null!==i?i.cachePool:null),null!==i?Li(t,i):Bi(),Hi(t)}else null!==i?(ti(0,i.cachePool),Li(t,i),Wi(),t.memoizedState=null):(null!==e&&ti(0,null),Bi(),Wi());return Ds(e,t,o,n),t.child}function qs(e,t){return null!==e&&22===e.tag||null!==t.stateNode||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Vs(e,t,n,r,o){var i=ei();return i=null===i?null:{parent:qo._currentValue,pool:i},t.memoizedState={baseLanes:n,cachePool:i},null!==e&&ti(0,null),Bi(),Hi(t),null!==e&&Lo(e,t,r,!0),t.childLanes=o,null}function Ks(e,t){return(t=ol({mode:t.mode,children:t.children},e.mode)).ref=e.ref,e.child=t,t.return=e,t}function $s(e,t,n){return bi(t,e.child,null,n),(e=Ks(t,t.pendingProps)).flags|=2,qi(t),t.memoizedState=null,e}function Qs(e,t){var n=t.ref;if(null===n)null!==e&&null!==e.ref&&(t.flags|=4194816);else{if("function"!=typeof n&&"object"!=typeof n)throw Error(r(284));null!==e&&e.ref===n||(t.flags|=4194816)}}function Gs(e,t,n,r,o){return No(t),n=aa(e,t,n,r,void 0,o),r=ca(),null===e||Us?(mo&&r&&fo(t),t.flags|=1,Ds(e,t,n,o),t.child):(fa(e,t,o),ul(e,t,o))}function Ys(e,t,n,r,o,i){return No(t),t.updateQueue=null,n=la(t,r,n,o),sa(e),r=ca(),null===e||Us?(mo&&r&&fo(t),t.flags|=1,Ds(e,t,n,i),t.child):(fa(e,t,i),ul(e,t,i))}function Xs(e,t,n,r,o){if(No(t),null===t.stateNode){var i=Fr,a=n.contextType;"object"==typeof a&&null!==a&&(i=Uo(a)),i=new n(r,i),t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,i.updater=_s,t.stateNode=i,i._reactInternals=t,(i=t.stateNode).props=r,i.state=t.memoizedState,i.refs={},ki(t),a=n.contextType,i.context="object"==typeof a&&null!==a?Uo(a):Fr,i.state=t.memoizedState,"function"==typeof(a=n.getDerivedStateFromProps)&&(Es(t,n,a,r),i.state=t.memoizedState),"function"==typeof n.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(a=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),a!==i.state&&_s.enqueueReplaceState(i,i.state,null),Pi(t,r,i,o),Ai(),i.state=t.memoizedState),"function"==typeof i.componentDidMount&&(t.flags|=4194308),r=!0}else if(null===e){i=t.stateNode;var s=t.memoizedProps,l=Ts(n,s);i.props=l;var u=i.context,c=n.contextType;a=Fr,"object"==typeof c&&null!==c&&(a=Uo(c));var f=n.getDerivedStateFromProps;c="function"==typeof f||"function"==typeof i.getSnapshotBeforeUpdate,s=t.pendingProps!==s,c||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(s||u!==a)&&Is(t,i,r,a),Si=!1;var p=t.memoizedState;i.state=p,Pi(t,r,i,o),Ai(),u=t.memoizedState,s||p!==u||Si?("function"==typeof f&&(Es(t,n,f,r),u=t.memoizedState),(l=Si||Cs(t,n,l,r,p,u,a))?(c||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||("function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount()),"function"==typeof i.componentDidMount&&(t.flags|=4194308)):("function"==typeof i.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),i.props=r,i.state=u,i.context=a,r=l):("function"==typeof i.componentDidMount&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,xi(e,t),c=Ts(n,a=t.memoizedProps),i.props=c,f=t.pendingProps,p=i.context,u=n.contextType,l=Fr,"object"==typeof u&&null!==u&&(l=Uo(u)),(u="function"==typeof(s=n.getDerivedStateFromProps)||"function"==typeof i.getSnapshotBeforeUpdate)||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(a!==f||p!==l)&&Is(t,i,r,l),Si=!1,p=t.memoizedState,i.state=p,Pi(t,r,i,o),Ai();var h=t.memoizedState;a!==f||p!==h||Si||null!==e&&null!==e.dependencies&&Bo(e.dependencies)?("function"==typeof s&&(Es(t,n,s,r),h=t.memoizedState),(c=Si||Cs(t,n,c,r,p,h,l)||null!==e&&null!==e.dependencies&&Bo(e.dependencies))?(u||"function"!=typeof i.UNSAFE_componentWillUpdate&&"function"!=typeof i.componentWillUpdate||("function"==typeof i.componentWillUpdate&&i.componentWillUpdate(r,h,l),"function"==typeof i.UNSAFE_componentWillUpdate&&i.UNSAFE_componentWillUpdate(r,h,l)),"function"==typeof i.componentDidUpdate&&(t.flags|=4),"function"==typeof i.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof i.componentDidUpdate||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),"function"!=typeof i.getSnapshotBeforeUpdate||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),i.props=r,i.state=h,i.context=l,r=c):("function"!=typeof i.componentDidUpdate||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),"function"!=typeof i.getSnapshotBeforeUpdate||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return i=r,Qs(e,t),r=!!(128&t.flags),i||r?(i=t.stateNode,n=r&&"function"!=typeof n.getDerivedStateFromError?null:i.render(),t.flags|=1,null!==e&&r?(t.child=bi(t,e.child,null,o),t.child=bi(t,null,n,o)):Ds(e,t,n,o),t.memoizedState=i.state,e=t.child):e=ul(e,t,o),e}function Zs(e,t,n,r){return _o(),t.flags|=256,Ds(e,t,n,r),t.child}var Js={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function el(e){return{baseLanes:e,cachePool:ni()}}function tl(e,t,n){return e=null!==e?e.childLanes&~n:0,t&&(e|=Ou),e}function nl(e,t,n){var o,i=t.pendingProps,a=!1,s=!!(128&t.flags);if((o=s)||(o=(null===e||null!==e.memoizedState)&&!!(2&Vi.current)),o&&(a=!0,t.flags&=-129),o=!!(32&t.flags),t.flags&=-33,null===e){if(mo){if(a?zi(t):Wi(),(e=go)?null!==(e=null!==(e=Bf(e,bo))&&"&"!==e.data?e:null)&&(t.memoizedState={dehydrated:e,treeContext:null!==ao?{id:so,overflow:lo}:null,retryLane:536870912,hydrationErrors:null},(n=Yr(e)).return=t,t.child=n,yo=t,go=null):e=null,null===e)throw So(t);return Uf(e)?t.lanes=32:t.lanes=536870912,null}var l=i.children;return i=i.fallback,a?(Wi(),l=ol({mode:"hidden",children:l},a=t.mode),i=Qr(i,a,n,null),l.return=t,i.return=t,l.sibling=i,t.child=l,(i=t.child).memoizedState=el(n),i.childLanes=tl(e,o,n),t.memoizedState=Js,qs(null,i)):(zi(t),rl(t,l))}var u=e.memoizedState;if(null!==u&&null!==(l=u.dehydrated)){if(s)256&t.flags?(zi(t),t.flags&=-257,t=il(e,t,n)):null!==t.memoizedState?(Wi(),t.child=e.child,t.flags|=128,t=null):(Wi(),l=i.fallback,a=t.mode,i=ol({mode:"visible",children:i.children},a),(l=Qr(l,a,n,null)).flags|=2,i.return=t,l.return=t,i.sibling=l,t.child=i,bi(t,e.child,null,n),(i=t.child).memoizedState=el(n),i.childLanes=tl(e,o,n),t.memoizedState=Js,t=qs(null,i));else if(zi(t),Uf(l)){if(o=l.nextSibling&&l.nextSibling.dataset)var c=o.dgst;o=c,(i=Error(r(419))).stack="",i.digest=o,Io({value:i,source:null,stack:null}),t=il(e,t,n)}else if(Us||Lo(e,t,n,!1),o=0!==(n&e.childLanes),Us||o){if(null!==(o=bu)&&(0!==(i=ze(o,n))&&i!==u.retryLane))throw u.retryLane=i,Ur(e,i),Ju(o,e,i),Ns;Nf(l)||fc(),t=il(e,t,n)}else Nf(l)?(t.flags|=192,t.child=e.child,t=null):(e=u.treeContext,go=Df(l.nextSibling),yo=t,mo=!0,vo=null,bo=!1,null!==e&&ho(t,e),(t=rl(t,i.children)).flags|=4096);return t}return a?(Wi(),l=i.fallback,a=t.mode,c=(u=e.child).sibling,(i=Vr(u,{mode:"hidden",children:i.children})).subtreeFlags=65011712&u.subtreeFlags,null!==c?l=Vr(c,l):(l=Qr(l,a,n,null)).flags|=2,l.return=t,i.return=t,i.sibling=l,t.child=i,qs(null,i),i=t.child,null===(l=e.child.memoizedState)?l=el(n):(null!==(a=l.cachePool)?(u=qo._currentValue,a=a.parent!==u?{parent:u,pool:u}:a):a=ni(),l={baseLanes:l.baseLanes|n,cachePool:a}),i.memoizedState=l,i.childLanes=tl(e,o,n),t.memoizedState=Js,qs(e.child,i)):(zi(t),e=(n=e.child).sibling,(n=Vr(n,{mode:"visible",children:i.children})).return=t,n.sibling=null,null!==e&&(null===(o=t.deletions)?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function rl(e,t){return(t=ol({mode:"visible",children:t},e.mode)).return=e,e.child=t}function ol(e,t){return(e=Wr(22,e,null,t)).lanes=0,e}function il(e,t,n){return bi(t,e.child,null,n),(e=rl(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function al(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),Ro(e.return,t,n)}function sl(e,t,n,r,o,i){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o,treeForkCount:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=o,a.treeForkCount=i)}function ll(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;r=r.children;var a=Vi.current,s=!!(2&a);if(s?(a=1&a|2,t.flags|=128):a&=1,D(Vi,a),Ds(e,t,r,n),r=mo?ro:0,!s&&null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&al(e,n,t);else if(19===e.tag)al(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===Ki(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),sl(t,!1,o,n,i,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===Ki(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}sl(t,!0,n,null,i,r);break;case"together":sl(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function ul(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Au|=t.lanes,0===(n&t.childLanes)){if(null===e)return null;if(Lo(e,t,n,!1),0===(n&t.childLanes))return null}if(null!==e&&t.child!==e.child)throw Error(r(153));if(null!==t.child){for(n=Vr(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Vr(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function cl(e,t){return 0!==(e.lanes&t)||!(null===(e=e.dependencies)||!Bo(e))}function fl(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps)Us=!0;else{if(!(cl(e,n)||128&t.flags))return Us=!1,function(e,t,n){switch(t.tag){case 3:$(t,t.stateNode.containerInfo),jo(0,qo,e.memoizedState.cache),_o();break;case 27:case 5:Y(t);break;case 4:$(t,t.stateNode.containerInfo);break;case 10:jo(0,t.type,t.memoizedProps.value);break;case 31:if(null!==t.memoizedState)return t.flags|=128,Fi(t),null;break;case 13:var r=t.memoizedState;if(null!==r)return null!==r.dehydrated?(zi(t),t.flags|=128,null):0!==(n&t.child.childLanes)?nl(e,t,n):(zi(t),null!==(e=ul(e,t,n))?e.sibling:null);zi(t);break;case 19:var o=!!(128&e.flags);if((r=0!==(n&t.childLanes))||(Lo(e,t,n,!1),r=0!==(n&t.childLanes)),o){if(r)return ll(e,t,n);t.flags|=128}if(null!==(o=t.memoizedState)&&(o.rendering=null,o.tail=null,o.lastEffect=null),D(Vi,Vi.current),r)break;return null;case 22:return t.lanes=0,Ws(e,t,n,t.pendingProps);case 24:jo(0,qo,e.memoizedState.cache)}return ul(e,t,n)}(e,t,n);Us=!!(131072&e.flags)}else Us=!1,mo&&1048576&t.flags&&co(t,ro,t.index);switch(t.lanes=0,t.tag){case 16:e:{var o=t.pendingProps;if(e=ui(t.elementType),t.type=e,"function"!=typeof e){if(null!=e){var i=e.$$typeof;if(i===b){t.tag=11,t=zs(null,t,e,o,n);break e}if(i===k){t.tag=14,t=Fs(null,t,e,o,n);break e}}throw t=A(e)||e,Error(r(306,t,""))}qr(e)?(o=Ts(e,o),t.tag=1,t=Xs(null,t,e,o,n)):(t.tag=0,t=Gs(null,t,e,o,n))}return t;case 0:return Gs(e,t,t.type,t.pendingProps,n);case 1:return Xs(e,t,o=t.type,i=Ts(o,t.pendingProps),n);case 3:e:{if($(t,t.stateNode.containerInfo),null===e)throw Error(r(387));o=t.pendingProps;var a=t.memoizedState;i=a.element,xi(e,t),Pi(t,o,null,n);var s=t.memoizedState;if(o=s.cache,jo(0,qo,o),o!==a.cache&&Mo(t,[qo],n,!0),Ai(),o=s.element,a.isDehydrated){if(a={element:o,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=a,t.memoizedState=a,256&t.flags){t=Zs(e,t,o,n);break e}if(o!==i){Io(i=Jr(Error(r(424)),t)),t=Zs(e,t,o,n);break e}if(9===(e=t.stateNode.containerInfo).nodeType)e=e.body;else e="HTML"===e.nodeName?e.ownerDocument.body:e;for(go=Df(e.firstChild),yo=t,mo=!0,vo=null,bo=!0,n=wi(t,null,o,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(_o(),o===i){t=ul(e,t,n);break e}Ds(e,t,o,n)}t=t.child}return t;case 26:return Qs(e,t),null===e?(n=Xf(t.type,null,t.pendingProps,null))?t.memoizedState=n:mo||(n=t.type,e=t.pendingProps,(o=kf(V.current).createElement(n))[Ke]=t,o[$e]=e,vf(o,n,e),it(o),t.stateNode=o):t.memoizedState=Xf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Y(t),null===e&&mo&&(o=t.stateNode=Wf(t.type,t.pendingProps,V.current),yo=t,bo=!0,i=go,Of(t.type)?(zf=i,go=Df(o.firstChild)):go=i),Ds(e,t,t.pendingProps.children,n),Qs(e,t),null===e&&(t.flags|=4194304),t.child;case 5:return null===e&&mo&&((i=o=go)&&(null!==(o=function(e,t,n,r){for(;1===e.nodeType;){var o=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&("INPUT"!==e.nodeName||"hidden"!==e.type))break}else if(r){if(!e[Je])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if("stylesheet"===(i=e.getAttribute("rel"))&&e.hasAttribute("data-precedence"))break;if(i!==o.rel||e.getAttribute("href")!==(null==o.href||""===o.href?null:o.href)||e.getAttribute("crossorigin")!==(null==o.crossOrigin?null:o.crossOrigin)||e.getAttribute("title")!==(null==o.title?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(((i=e.getAttribute("src"))!==(null==o.src?null:o.src)||e.getAttribute("type")!==(null==o.type?null:o.type)||e.getAttribute("crossorigin")!==(null==o.crossOrigin?null:o.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else{if("input"!==t||"hidden"!==e.type)return e;var i=null==o.name?null:""+o.name;if("hidden"===o.type&&e.getAttribute("name")===i)return e}if(null===(e=Df(e.nextSibling)))break}return null}(o,t.type,t.pendingProps,bo))?(t.stateNode=o,yo=t,go=Df(o.firstChild),bo=!1,i=!0):i=!1),i||So(t)),Y(t),i=t.type,a=t.pendingProps,s=null!==e?e.memoizedProps:null,o=a.children,_f(i,a)?o=null:null!==s&&_f(i,s)&&(t.flags|=32),null!==t.memoizedState&&(i=aa(e,t,ua,null,null,n),gp._currentValue=i),Qs(e,t),Ds(e,t,o,n),t.child;case 6:return null===e&&mo&&((e=n=go)&&(null!==(n=function(e,t,n){if(""===t)return null;for(;3!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!n)return null;if(null===(e=Df(e.nextSibling)))return null}return e}(n,t.pendingProps,bo))?(t.stateNode=n,yo=t,go=null,e=!0):e=!1),e||So(t)),null;case 13:return nl(e,t,n);case 4:return $(t,t.stateNode.containerInfo),o=t.pendingProps,null===e?t.child=bi(t,null,o,n):Ds(e,t,o,n),t.child;case 11:return zs(e,t,t.type,t.pendingProps,n);case 7:return Ds(e,t,t.pendingProps,n),t.child;case 8:case 12:return Ds(e,t,t.pendingProps.children,n),t.child;case 10:return o=t.pendingProps,jo(0,t.type,o.value),Ds(e,t,o.children,n),t.child;case 9:return i=t.type._context,o=t.pendingProps.children,No(t),o=o(i=Uo(i)),t.flags|=1,Ds(e,t,o,n),t.child;case 14:return Fs(e,t,t.type,t.pendingProps,n);case 15:return Hs(e,t,t.type,t.pendingProps,n);case 19:return ll(e,t,n);case 31:return function(e,t,n){var o=t.pendingProps,i=!!(128&t.flags);if(t.flags&=-129,null===e){if(mo){if("hidden"===o.mode)return e=Ks(t,o),t.lanes=536870912,qs(null,e);if(Fi(t),(e=go)?null!==(e=null!==(e=Bf(e,bo))&&"&"===e.data?e:null)&&(t.memoizedState={dehydrated:e,treeContext:null!==ao?{id:so,overflow:lo}:null,retryLane:536870912,hydrationErrors:null},(n=Yr(e)).return=t,t.child=n,yo=t,go=null):e=null,null===e)throw So(t);return t.lanes=536870912,null}return Ks(t,o)}var a=e.memoizedState;if(null!==a){var s=a.dehydrated;if(Fi(t),i)if(256&t.flags)t.flags&=-257,t=$s(e,t,n);else{if(null===t.memoizedState)throw Error(r(558));t.child=e.child,t.flags|=128,t=null}else if(Us||Lo(e,t,n,!1),i=0!==(n&e.childLanes),Us||i){if(null!==(o=bu)&&0!==(s=ze(o,n))&&s!==a.retryLane)throw a.retryLane=s,Ur(e,s),Ju(o,e,s),Ns;fc(),t=$s(e,t,n)}else e=a.treeContext,go=Df(s.nextSibling),yo=t,mo=!0,vo=null,bo=!1,null!==e&&ho(t,e),(t=Ks(t,o)).flags|=4096;return t}return(e=Vr(e.child,{mode:o.mode,children:o.children})).ref=t.ref,t.child=e,e.return=t,e}(e,t,n);case 22:return Ws(e,t,n,t.pendingProps);case 24:return No(t),o=Uo(qo),null===e?(null===(i=ei())&&(i=bu,a=Vo(),i.pooledCache=a,a.refCount++,null!==a&&(i.pooledCacheLanes|=n),i=a),t.memoizedState={parent:o,cache:i},ki(t),jo(0,qo,i)):(0!==(e.lanes&n)&&(xi(e,t),Pi(t,null,null,n),Ai()),i=e.memoizedState,a=t.memoizedState,i.parent!==o?(i={parent:o,cache:o},t.memoizedState=i,0===t.lanes&&(t.memoizedState=t.updateQueue.baseState=i),jo(0,qo,o)):(o=a.cache,jo(0,qo,o),o!==i.cache&&Mo(t,[qo],n,!0))),Ds(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(r(156,t.tag))}function pl(e){e.flags|=4}function hl(e,t,n,r,o){if((t=!!(32&e.mode))&&(t=!1),t){if(e.flags|=16777216,(335544128&o)===o)if(e.stateNode.complete)e.flags|=8192;else{if(!lc())throw ci=ai,oi;e.flags|=8192}}else e.flags&=-16777217}function dl(e,t){if("stylesheet"!==t.type||4&t.state.loading)e.flags&=-16777217;else if(e.flags|=16777216,!cp(t)){if(!lc())throw ci=ai,oi;e.flags|=8192}}function yl(e,t){null!==t&&(e.flags|=4),16384&e.flags&&(t=22!==e.tag?Le():536870912,e.lanes|=t,Ru|=t)}function gl(e,t){if(!mo)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ml(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=65011712&o.subtreeFlags,r|=65011712&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function vl(e,t,n){var o=t.pendingProps;switch(po(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 1:return ml(t),null;case 3:return n=t.stateNode,o=null,null!==e&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),Oo(qo),G(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(Eo(t)?pl(t):null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,Co())),ml(t),null;case 26:var i=t.type,a=t.memoizedState;return null===e?(pl(t),null!==a?(ml(t),dl(t,a)):(ml(t),hl(t,i,0,0,n))):a?a!==e.memoizedState?(pl(t),ml(t),dl(t,a)):(ml(t),t.flags&=-16777217):((e=e.memoizedProps)!==o&&pl(t),ml(t),hl(t,i,0,0,n)),null;case 27:if(Z(t),n=V.current,i=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==o&&pl(t);else{if(!o){if(null===t.stateNode)throw Error(r(166));return ml(t),null}e=W.current,Eo(t)?ko(t):(e=Wf(i,o,n),t.stateNode=e,pl(t))}return ml(t),null;case 5:if(Z(t),i=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==o&&pl(t);else{if(!o){if(null===t.stateNode)throw Error(r(166));return ml(t),null}if(a=W.current,Eo(t))ko(t);else{var s=kf(V.current);switch(a){case 1:a=s.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:a=s.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":a=s.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":a=s.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":(a=s.createElement("div")).innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case"select":a="string"==typeof o.is?s.createElement("select",{is:o.is}):s.createElement("select"),o.multiple?a.multiple=!0:o.size&&(a.size=o.size);break;default:a="string"==typeof o.is?s.createElement(i,{is:o.is}):s.createElement(i)}}a[Ke]=t,a[$e]=o;e:for(s=t.child;null!==s;){if(5===s.tag||6===s.tag)a.appendChild(s.stateNode);else if(4!==s.tag&&27!==s.tag&&null!==s.child){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;null===s.sibling;){if(null===s.return||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=a;e:switch(vf(a,i,o),i){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&pl(t)}}return ml(t),hl(t,t.type,null===e||e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==o&&pl(t);else{if("string"!=typeof o&&null===t.stateNode)throw Error(r(166));if(e=V.current,Eo(t)){if(e=t.stateNode,n=t.memoizedProps,o=null,null!==(i=yo))switch(i.tag){case 27:case 5:o=i.memoizedProps}e[Ke]=t,(e=!!(e.nodeValue===n||null!==o&&!0===o.suppressHydrationWarning||yf(e.nodeValue,n)))||So(t,!0)}else(e=kf(e).createTextNode(o))[Ke]=t,t.stateNode=e}return ml(t),null;case 31:if(n=t.memoizedState,null===e||null!==e.memoizedState){if(o=Eo(t),null!==n){if(null===e){if(!o)throw Error(r(318));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(r(557));e[Ke]=t}else _o(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;ml(t),e=!1}else n=Co(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return 256&t.flags?(qi(t),t):(qi(t),null);if(128&t.flags)throw Error(r(558))}return ml(t),null;case 13:if(o=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(i=Eo(t),null!==o&&null!==o.dehydrated){if(null===e){if(!i)throw Error(r(318));if(!(i=null!==(i=t.memoizedState)?i.dehydrated:null))throw Error(r(317));i[Ke]=t}else _o(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;ml(t),i=!1}else i=Co(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return 256&t.flags?(qi(t),t):(qi(t),null)}return qi(t),128&t.flags?(t.lanes=n,t):(n=null!==o,e=null!==e&&null!==e.memoizedState,n&&(i=null,null!==(o=t.child).alternate&&null!==o.alternate.memoizedState&&null!==o.alternate.memoizedState.cachePool&&(i=o.alternate.memoizedState.cachePool.pool),a=null,null!==o.memoizedState&&null!==o.memoizedState.cachePool&&(a=o.memoizedState.cachePool.pool),a!==i&&(o.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),yl(t,t.updateQueue),ml(t),null);case 4:return G(),null===e&&of(t.stateNode.containerInfo),ml(t),null;case 10:return Oo(t.type),ml(t),null;case 19:if(U(Vi),null===(o=t.memoizedState))return ml(t),null;if(i=!!(128&t.flags),null===(a=o.rendering))if(i)gl(o,!1);else{if(0!==Tu||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(a=Ki(e))){for(t.flags|=128,gl(o,!1),e=a.updateQueue,t.updateQueue=e,yl(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)Kr(n,e),n=n.sibling;return D(Vi,1&Vi.current|2),mo&&uo(t,o.treeForkCount),t.child}e=e.sibling}null!==o.tail&&he()>Du&&(t.flags|=128,i=!0,gl(o,!1),t.lanes=4194304)}else{if(!i)if(null!==(e=Ki(a))){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,yl(t,e),gl(o,!0),null===o.tail&&"hidden"===o.tailMode&&!a.alternate&&!mo)return ml(t),null}else 2*he()-o.renderingStartTime>Du&&536870912!==n&&(t.flags|=128,i=!0,gl(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(null!==(e=o.last)?e.sibling=a:t.child=a,o.last=a)}return null!==o.tail?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=he(),e.sibling=null,n=Vi.current,D(Vi,i?1&n|2:1&n),mo&&uo(t,o.treeForkCount),e):(ml(t),null);case 22:case 23:return qi(t),Ni(),o=null!==t.memoizedState,null!==e?null!==e.memoizedState!==o&&(t.flags|=8192):o&&(t.flags|=8192),o?!!(536870912&n)&&!(128&t.flags)&&(ml(t),6&t.subtreeFlags&&(t.flags|=8192)):ml(t),null!==(n=t.updateQueue)&&yl(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),o=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(o=t.memoizedState.cachePool.pool),o!==n&&(t.flags|=2048),null!==e&&U(Jo),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Oo(qo),ml(t),null;case 25:case 30:return null}throw Error(r(156,t.tag))}function bl(e,t){switch(po(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Oo(qo),G(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return Z(t),null;case 31:if(null!==t.memoizedState){if(qi(t),null===t.alternate)throw Error(r(340));_o()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(qi(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(r(340));_o()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return U(Vi),null;case 4:return G(),null;case 10:return Oo(t.type),null;case 22:case 23:return qi(t),Ni(),null!==e&&U(Jo),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return Oo(qo),null;default:return null}}function wl(e,t){switch(po(t),t.tag){case 3:Oo(qo),G();break;case 26:case 27:case 5:Z(t);break;case 4:G();break;case 31:null!==t.memoizedState&&qi(t);break;case 13:qi(t);break;case 19:U(Vi);break;case 10:Oo(t.type);break;case 22:case 23:qi(t),Ni(),null!==e&&U(Jo);break;case 24:Oo(qo)}}function Sl(e,t){try{var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var o=r.next;n=o;do{if((n.tag&e)===e){r=void 0;var i=n.create,a=n.inst;r=i(),a.destroy=r}n=n.next}while(n!==o)}}catch(s){Tc(t,t.return,s)}}function kl(e,t,n){try{var r=t.updateQueue,o=null!==r?r.lastEffect:null;if(null!==o){var i=o.next;r=i;do{if((r.tag&e)===e){var a=r.inst,s=a.destroy;if(void 0!==s){a.destroy=void 0,o=t;var l=n,u=s;try{u()}catch(c){Tc(o,l,c)}}}r=r.next}while(r!==i)}}catch(c){Tc(t,t.return,c)}}function xl(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{Oi(t,n)}catch(r){Tc(e,e.return,r)}}}function El(e,t,n){n.props=Ts(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){Tc(e,t,r)}}function _l(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;default:r=e.stateNode}"function"==typeof n?e.refCleanup=n(r):n.current=r}}catch(o){Tc(e,t,o)}}function Cl(e,t){var n=e.ref,r=e.refCleanup;if(null!==n)if("function"==typeof r)try{r()}catch(o){Tc(e,t,o)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(i){Tc(e,t,i)}else n.current=null}function Il(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(o){Tc(e,e.return,o)}}function Tl(e,t,n){try{var o=e.stateNode;!function(e,t,n,o){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,a=null,s=null,l=null,u=null,c=null,f=null;for(d in n){var p=n[d];if(n.hasOwnProperty(d)&&null!=p)switch(d){case"checked":case"value":break;case"defaultValue":u=p;default:o.hasOwnProperty(d)||gf(e,t,d,null,o,p)}}for(var h in o){var d=o[h];if(p=n[h],o.hasOwnProperty(h)&&(null!=d||null!=p))switch(h){case"type":a=d;break;case"name":i=d;break;case"checked":c=d;break;case"defaultChecked":f=d;break;case"value":s=d;break;case"defaultValue":l=d;break;case"children":case"dangerouslySetInnerHTML":if(null!=d)throw Error(r(137,t));break;default:d!==p&&gf(e,t,h,d,o,p)}}return void xt(e,s,l,u,c,f,a,i);case"select":for(a in d=s=l=h=null,n)if(u=n[a],n.hasOwnProperty(a)&&null!=u)switch(a){case"value":break;case"multiple":d=u;default:o.hasOwnProperty(a)||gf(e,t,a,null,o,u)}for(i in o)if(a=o[i],u=n[i],o.hasOwnProperty(i)&&(null!=a||null!=u))switch(i){case"value":h=a;break;case"defaultValue":l=a;break;case"multiple":s=a;default:a!==u&&gf(e,t,i,a,o,u)}return t=l,n=s,o=d,void(null!=h?Ct(e,!!n,h,!1):!!o!=!!n&&(null!=t?Ct(e,!!n,t,!0):Ct(e,!!n,n?[]:"",!1)));case"textarea":for(l in d=h=null,n)if(i=n[l],n.hasOwnProperty(l)&&null!=i&&!o.hasOwnProperty(l))switch(l){case"value":case"children":break;default:gf(e,t,l,null,o,i)}for(s in o)if(i=o[s],a=n[s],o.hasOwnProperty(s)&&(null!=i||null!=a))switch(s){case"value":h=i;break;case"defaultValue":d=i;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=i)throw Error(r(91));break;default:i!==a&&gf(e,t,s,i,o,a)}return void It(e,h,d);case"option":for(var y in n)if(h=n[y],n.hasOwnProperty(y)&&null!=h&&!o.hasOwnProperty(y))if("selected"===y)e.selected=!1;else gf(e,t,y,null,o,h);for(u in o)if(h=o[u],d=n[u],o.hasOwnProperty(u)&&h!==d&&(null!=h||null!=d))if("selected"===u)e.selected=h&&"function"!=typeof h&&"symbol"!=typeof h;else gf(e,t,u,h,o,d);return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)h=n[g],n.hasOwnProperty(g)&&null!=h&&!o.hasOwnProperty(g)&&gf(e,t,g,null,o,h);for(c in o)if(h=o[c],d=n[c],o.hasOwnProperty(c)&&h!==d&&(null!=h||null!=d))switch(c){case"children":case"dangerouslySetInnerHTML":if(null!=h)throw Error(r(137,t));break;default:gf(e,t,c,h,o,d)}return;default:if(Rt(t)){for(var m in n)h=n[m],n.hasOwnProperty(m)&&void 0!==h&&!o.hasOwnProperty(m)&&mf(e,t,m,void 0,o,h);for(f in o)h=o[f],d=n[f],!o.hasOwnProperty(f)||h===d||void 0===h&&void 0===d||mf(e,t,f,h,o,d);return}}for(var v in n)h=n[v],n.hasOwnProperty(v)&&null!=h&&!o.hasOwnProperty(v)&&gf(e,t,v,null,o,h);for(p in o)h=o[p],d=n[p],!o.hasOwnProperty(p)||h===d||null==h&&null==d||gf(e,t,p,h,o,d)}(o,e.type,n,t),o[$e]=t}catch(i){Tc(e,e.return,i)}}function Al(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&Of(e.type)||4===e.tag}function Pl(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||Al(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&Of(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function jl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?(9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).insertBefore(e,t):((t=9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Nt));else if(4!==r&&(27===r&&Of(e.type)&&(n=e.stateNode,t=null),null!==(e=e.child)))for(jl(e,t,n),e=e.sibling;null!==e;)jl(e,t,n),e=e.sibling}function Ol(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&(27===r&&Of(e.type)&&(n=e.stateNode),null!==(e=e.child)))for(Ol(e,t,n),e=e.sibling;null!==e;)Ol(e,t,n),e=e.sibling}function Rl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);vf(t,r,n),t[Ke]=e,t[$e]=n}catch(i){Tc(e,e.return,i)}}var Ml=!1,Ll=!1,Bl=!1,Nl="function"==typeof WeakSet?WeakSet:Set,Ul=null;function Dl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Jl(e,n),4&r&&Sl(5,n);break;case 1:if(Jl(e,n),4&r)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(a){Tc(n,n.return,a)}else{var o=Ts(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(s){Tc(n,n.return,s)}}64&r&&xl(n),512&r&&_l(n,n.return);break;case 3:if(Jl(e,n),64&r&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{Oi(e,t)}catch(a){Tc(n,n.return,a)}}break;case 27:null===t&&4&r&&Rl(n);case 26:case 5:Jl(e,n),null===t&&4&r&&Il(n),512&r&&_l(n,n.return);break;case 12:Jl(e,n);break;case 31:Jl(e,n),4&r&&Vl(e,n);break;case 13:Jl(e,n),4&r&&Kl(e,n),64&r&&(null!==(e=n.memoizedState)&&(null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$~"===e.data)e._reactRetry=t;else if("$?"!==e.data||"loading"!==n.readyState)t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}(e,n=Oc.bind(null,n))));break;case 22:if(!(r=null!==n.memoizedState||Ml)){t=null!==t&&null!==t.memoizedState||Ll,o=Ml;var i=Ll;Ml=r,(Ll=t)&&!i?tu(e,n,!!(8772&n.subtreeFlags)):Jl(e,n),Ml=o,Ll=i}break;case 30:break;default:Jl(e,n)}}function zl(e){var t=e.alternate;null!==t&&(e.alternate=null,zl(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&et(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Fl=null,Hl=!1;function Wl(e,t,n){for(n=n.child;null!==n;)ql(e,t,n),n=n.sibling}function ql(e,t,n){if(xe&&"function"==typeof xe.onCommitFiberUnmount)try{xe.onCommitFiberUnmount(ke,n)}catch(i){}switch(n.tag){case 26:Ll||Cl(n,t),Wl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:Ll||Cl(n,t);var r=Fl,o=Hl;Of(n.type)&&(Fl=n.stateNode,Hl=!1),Wl(e,t,n),qf(n.stateNode),Fl=r,Hl=o;break;case 5:Ll||Cl(n,t);case 6:if(r=Fl,o=Hl,Fl=null,Wl(e,t,n),Hl=o,null!==(Fl=r))if(Hl)try{(9===Fl.nodeType?Fl.body:"HTML"===Fl.nodeName?Fl.ownerDocument.body:Fl).removeChild(n.stateNode)}catch(a){Tc(n,t,a)}else try{Fl.removeChild(n.stateNode)}catch(a){Tc(n,t,a)}break;case 18:null!==Fl&&(Hl?(Rf(9===(e=Fl).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),Yp(e)):Rf(Fl,n.stateNode));break;case 4:r=Fl,o=Hl,Fl=n.stateNode.containerInfo,Hl=!0,Wl(e,t,n),Fl=r,Hl=o;break;case 0:case 11:case 14:case 15:kl(2,n,t),Ll||kl(4,n,t),Wl(e,t,n);break;case 1:Ll||(Cl(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount&&El(n,t,r)),Wl(e,t,n);break;case 21:Wl(e,t,n);break;case 22:Ll=(r=Ll)||null!==n.memoizedState,Wl(e,t,n),Ll=r;break;default:Wl(e,t,n)}}function Vl(e,t){if(null===t.memoizedState&&(null!==(e=t.alternate)&&null!==(e=e.memoizedState))){e=e.dehydrated;try{Yp(e)}catch(n){Tc(t,t.return,n)}}}function Kl(e,t){if(null===t.memoizedState&&(null!==(e=t.alternate)&&(null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))))try{Yp(e)}catch(n){Tc(t,t.return,n)}}function $l(e,t){var n=function(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new Nl),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new Nl),t;default:throw Error(r(435,e.tag))}}(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Rc.bind(null,e,t);t.then(r,r)}})}function Ql(e,t){var n=t.deletions;if(null!==n)for(var o=0;o<n.length;o++){var i=n[o],a=e,s=t,l=s;e:for(;null!==l;){switch(l.tag){case 27:if(Of(l.type)){Fl=l.stateNode,Hl=!1;break e}break;case 5:Fl=l.stateNode,Hl=!1;break e;case 3:case 4:Fl=l.stateNode.containerInfo,Hl=!0;break e}l=l.return}if(null===Fl)throw Error(r(160));ql(a,s,i),Fl=null,Hl=!1,null!==(a=i.alternate)&&(a.return=null),i.return=null}if(13886&t.subtreeFlags)for(t=t.child;null!==t;)Yl(t,e),t=t.sibling}var Gl=null;function Yl(e,t){var n=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ql(t,e),Xl(e),4&o&&(kl(3,e,e.return),Sl(3,e),kl(5,e,e.return));break;case 1:Ql(t,e),Xl(e),512&o&&(Ll||null===n||Cl(n,n.return)),64&o&&Ml&&(null!==(e=e.updateQueue)&&(null!==(o=e.callbacks)&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=null===n?o:n.concat(o))));break;case 26:var i=Gl;if(Ql(t,e),Xl(e),512&o&&(Ll||null===n||Cl(n,n.return)),4&o){var a=null!==n?n.memoizedState:null;if(o=e.memoizedState,null===n)if(null===o)if(null===e.stateNode){e:{o=e.type,n=e.memoizedProps,i=i.ownerDocument||i;t:switch(o){case"title":(!(a=i.getElementsByTagName("title")[0])||a[Je]||a[Ke]||"http://www.w3.org/2000/svg"===a.namespaceURI||a.hasAttribute("itemprop"))&&(a=i.createElement(o),i.head.insertBefore(a,i.querySelector("head > title"))),vf(a,o,n),a[Ke]=e,it(a),o=a;break e;case"link":var s=lp("link","href",i).get(o+(n.href||""));if(s)for(var l=0;l<s.length;l++)if((a=s[l]).getAttribute("href")===(null==n.href||""===n.href?null:n.href)&&a.getAttribute("rel")===(null==n.rel?null:n.rel)&&a.getAttribute("title")===(null==n.title?null:n.title)&&a.getAttribute("crossorigin")===(null==n.crossOrigin?null:n.crossOrigin)){s.splice(l,1);break t}vf(a=i.createElement(o),o,n),i.head.appendChild(a);break;case"meta":if(s=lp("meta","content",i).get(o+(n.content||"")))for(l=0;l<s.length;l++)if((a=s[l]).getAttribute("content")===(null==n.content?null:""+n.content)&&a.getAttribute("name")===(null==n.name?null:n.name)&&a.getAttribute("property")===(null==n.property?null:n.property)&&a.getAttribute("http-equiv")===(null==n.httpEquiv?null:n.httpEquiv)&&a.getAttribute("charset")===(null==n.charSet?null:n.charSet)){s.splice(l,1);break t}vf(a=i.createElement(o),o,n),i.head.appendChild(a);break;default:throw Error(r(468,o))}a[Ke]=e,it(a),o=a}e.stateNode=o}else up(i,e.type,e.stateNode);else e.stateNode=rp(i,o,e.memoizedProps);else a!==o?(null===a?null!==n.stateNode&&(n=n.stateNode).parentNode.removeChild(n):a.count--,null===o?up(i,e.type,e.stateNode):rp(i,o,e.memoizedProps)):null===o&&null!==e.stateNode&&Tl(e,e.memoizedProps,n.memoizedProps)}break;case 27:Ql(t,e),Xl(e),512&o&&(Ll||null===n||Cl(n,n.return)),null!==n&&4&o&&Tl(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Ql(t,e),Xl(e),512&o&&(Ll||null===n||Cl(n,n.return)),32&e.flags){i=e.stateNode;try{At(i,"")}catch(y){Tc(e,e.return,y)}}4&o&&null!=e.stateNode&&Tl(e,i=e.memoizedProps,null!==n?n.memoizedProps:i),1024&o&&(Bl=!0);break;case 6:if(Ql(t,e),Xl(e),4&o){if(null===e.stateNode)throw Error(r(162));o=e.memoizedProps,n=e.stateNode;try{n.nodeValue=o}catch(y){Tc(e,e.return,y)}}break;case 3:if(sp=null,i=Gl,Gl=$f(t.containerInfo),Ql(t,e),Gl=i,Xl(e),4&o&&null!==n&&n.memoizedState.isDehydrated)try{Yp(t.containerInfo)}catch(y){Tc(e,e.return,y)}Bl&&(Bl=!1,Zl(e));break;case 4:o=Gl,Gl=$f(e.stateNode.containerInfo),Ql(t,e),Xl(e),Gl=o;break;case 12:default:Ql(t,e),Xl(e);break;case 31:case 19:Ql(t,e),Xl(e),4&o&&(null!==(o=e.updateQueue)&&(e.updateQueue=null,$l(e,o)));break;case 13:Ql(t,e),Xl(e),8192&e.child.flags&&null!==e.memoizedState!=(null!==n&&null!==n.memoizedState)&&(Nu=he()),4&o&&(null!==(o=e.updateQueue)&&(e.updateQueue=null,$l(e,o)));break;case 22:i=null!==e.memoizedState;var u=null!==n&&null!==n.memoizedState,c=Ml,f=Ll;if(Ml=c||i,Ll=f||u,Ql(t,e),Ll=f,Ml=c,Xl(e),8192&o)e:for(t=e.stateNode,t._visibility=i?-2&t._visibility:1|t._visibility,i&&(null===n||u||Ml||Ll||eu(e)),n=null,t=e;;){if(5===t.tag||26===t.tag){if(null===n){u=n=t;try{if(a=u.stateNode,i)"function"==typeof(s=a.style).setProperty?s.setProperty("display","none","important"):s.display="none";else{l=u.stateNode;var p=u.memoizedProps.style,h=null!=p&&p.hasOwnProperty("display")?p.display:null;l.style.display=null==h||"boolean"==typeof h?"":(""+h).trim()}}catch(y){Tc(u,u.return,y)}}}else if(6===t.tag){if(null===n){u=t;try{u.stateNode.nodeValue=i?"":u.memoizedProps}catch(y){Tc(u,u.return,y)}}}else if(18===t.tag){if(null===n){u=t;try{var d=u.stateNode;i?Mf(d,!0):Mf(u.stateNode,!1)}catch(y){Tc(u,u.return,y)}}}else if((22!==t.tag&&23!==t.tag||null===t.memoizedState||t===e)&&null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;null===t.sibling;){if(null===t.return||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}4&o&&(null!==(o=e.updateQueue)&&(null!==(n=o.retryQueue)&&(o.retryQueue=null,$l(e,n))));case 30:case 21:}}function Xl(e){var t=e.flags;if(2&t){try{for(var n,o=e.return;null!==o;){if(Al(o)){n=o;break}o=o.return}if(null==n)throw Error(r(160));switch(n.tag){case 27:var i=n.stateNode;Ol(e,Pl(e),i);break;case 5:var a=n.stateNode;32&n.flags&&(At(a,""),n.flags&=-33),Ol(e,Pl(e),a);break;case 3:case 4:var s=n.stateNode.containerInfo;jl(e,Pl(e),s);break;default:throw Error(r(161))}}catch(l){Tc(e,e.return,l)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function Zl(e){if(1024&e.subtreeFlags)for(e=e.child;null!==e;){var t=e;Zl(t),5===t.tag&&1024&t.flags&&t.stateNode.reset(),e=e.sibling}}function Jl(e,t){if(8772&t.subtreeFlags)for(t=t.child;null!==t;)Dl(e,t.alternate,t),t=t.sibling}function eu(e){for(e=e.child;null!==e;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:kl(4,t,t.return),eu(t);break;case 1:Cl(t,t.return);var n=t.stateNode;"function"==typeof n.componentWillUnmount&&El(t,t.return,n),eu(t);break;case 27:qf(t.stateNode);case 26:case 5:Cl(t,t.return),eu(t);break;case 22:null===t.memoizedState&&eu(t);break;default:eu(t)}e=e.sibling}}function tu(e,t,n){for(n=n&&!!(8772&t.subtreeFlags),t=t.child;null!==t;){var r=t.alternate,o=e,i=t,a=i.flags;switch(i.tag){case 0:case 11:case 15:tu(o,i,n),Sl(4,i);break;case 1:if(tu(o,i,n),"function"==typeof(o=(r=i).stateNode).componentDidMount)try{o.componentDidMount()}catch(u){Tc(r,r.return,u)}if(null!==(o=(r=i).updateQueue)){var s=r.stateNode;try{var l=o.shared.hiddenCallbacks;if(null!==l)for(o.shared.hiddenCallbacks=null,o=0;o<l.length;o++)ji(l[o],s)}catch(u){Tc(r,r.return,u)}}n&&64&a&&xl(i),_l(i,i.return);break;case 27:Rl(i);case 26:case 5:tu(o,i,n),n&&null===r&&4&a&&Il(i),_l(i,i.return);break;case 12:tu(o,i,n);break;case 31:tu(o,i,n),n&&4&a&&Vl(o,i);break;case 13:tu(o,i,n),n&&4&a&&Kl(o,i);break;case 22:null===i.memoizedState&&tu(o,i,n),_l(i,i.return);break;case 30:break;default:tu(o,i,n)}t=t.sibling}}function nu(e,t){var n=null;null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),e=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(e=t.memoizedState.cachePool.pool),e!==n&&(null!=e&&e.refCount++,null!=n&&Ko(n))}function ru(e,t){e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&Ko(e))}function ou(e,t,n,r){if(10256&t.subtreeFlags)for(t=t.child;null!==t;)iu(e,t,n,r),t=t.sibling}function iu(e,t,n,r){var o=t.flags;switch(t.tag){case 0:case 11:case 15:ou(e,t,n,r),2048&o&&Sl(9,t);break;case 1:case 31:case 13:default:ou(e,t,n,r);break;case 3:ou(e,t,n,r),2048&o&&(e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&Ko(e)));break;case 12:if(2048&o){ou(e,t,n,r),e=t.stateNode;try{var i=t.memoizedProps,a=i.id,s=i.onPostCommit;"function"==typeof s&&s(a,null===t.alternate?"mount":"update",e.passiveEffectDuration,-0)}catch(l){Tc(t,t.return,l)}}else ou(e,t,n,r);break;case 23:break;case 22:i=t.stateNode,a=t.alternate,null!==t.memoizedState?2&i._visibility?ou(e,t,n,r):su(e,t):2&i._visibility?ou(e,t,n,r):(i._visibility|=2,au(e,t,n,r,!!(10256&t.subtreeFlags)||!1)),2048&o&&nu(a,t);break;case 24:ou(e,t,n,r),2048&o&&ru(t.alternate,t)}}function au(e,t,n,r,o){for(o=o&&(!!(10256&t.subtreeFlags)||!1),t=t.child;null!==t;){var i=e,a=t,s=n,l=r,u=a.flags;switch(a.tag){case 0:case 11:case 15:au(i,a,s,l,o),Sl(8,a);break;case 23:break;case 22:var c=a.stateNode;null!==a.memoizedState?2&c._visibility?au(i,a,s,l,o):su(i,a):(c._visibility|=2,au(i,a,s,l,o)),o&&2048&u&&nu(a.alternate,a);break;case 24:au(i,a,s,l,o),o&&2048&u&&ru(a.alternate,a);break;default:au(i,a,s,l,o)}t=t.sibling}}function su(e,t){if(10256&t.subtreeFlags)for(t=t.child;null!==t;){var n=e,r=t,o=r.flags;switch(r.tag){case 22:su(n,r),2048&o&&nu(r.alternate,r);break;case 24:su(n,r),2048&o&&ru(r.alternate,r);break;default:su(n,r)}t=t.sibling}}var lu=8192;function uu(e,t,n){if(e.subtreeFlags&lu)for(e=e.child;null!==e;)cu(e,t,n),e=e.sibling}function cu(e,t,n){switch(e.tag){case 26:uu(e,t,n),e.flags&lu&&null!==e.memoizedState&&function(e,t,n,r){if(!("stylesheet"!==n.type||"string"==typeof r.media&&!1===matchMedia(r.media).matches||4&n.state.loading)){if(null===n.instance){var o=Zf(r.href),i=t.querySelector(Jf(o));if(i)return null!==(t=i._p)&&"object"==typeof t&&"function"==typeof t.then&&(e.count++,e=pp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=i,void it(i);i=t.ownerDocument||t,r=ep(r),(o=Vf.get(o))&&ip(r,o),it(i=i.createElement("link"));var a=i;a._p=new Promise(function(e,t){a.onload=e,a.onerror=t}),vf(i,"link",r),n.instance=i}null===e.stylesheets&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(3&n.state.loading)&&(e.count++,n=pp.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}(n,Gl,e.memoizedState,e.memoizedProps);break;case 5:default:uu(e,t,n);break;case 3:case 4:var r=Gl;Gl=$f(e.stateNode.containerInfo),uu(e,t,n),Gl=r;break;case 22:null===e.memoizedState&&(null!==(r=e.alternate)&&null!==r.memoizedState?(r=lu,lu=16777216,uu(e,t,n),lu=r):uu(e,t,n))}}function fu(e){var t=e.alternate;if(null!==t&&null!==(e=t.child)){t.child=null;do{t=e.sibling,e.sibling=null,e=t}while(null!==e)}}function pu(e){var t=e.deletions;if(16&e.flags){if(null!==t)for(var n=0;n<t.length;n++){var r=t[n];Ul=r,yu(r,e)}fu(e)}if(10256&e.subtreeFlags)for(e=e.child;null!==e;)hu(e),e=e.sibling}function hu(e){switch(e.tag){case 0:case 11:case 15:pu(e),2048&e.flags&&kl(9,e,e.return);break;case 3:case 12:default:pu(e);break;case 22:var t=e.stateNode;null!==e.memoizedState&&2&t._visibility&&(null===e.return||13!==e.return.tag)?(t._visibility&=-3,du(e)):pu(e)}}function du(e){var t=e.deletions;if(16&e.flags){if(null!==t)for(var n=0;n<t.length;n++){var r=t[n];Ul=r,yu(r,e)}fu(e)}for(e=e.child;null!==e;){switch((t=e).tag){case 0:case 11:case 15:kl(8,t,t.return),du(t);break;case 22:2&(n=t.stateNode)._visibility&&(n._visibility&=-3,du(t));break;default:du(t)}e=e.sibling}}function yu(e,t){for(;null!==Ul;){var n=Ul;switch(n.tag){case 0:case 11:case 15:kl(8,n,t);break;case 23:case 22:if(null!==n.memoizedState&&null!==n.memoizedState.cachePool){var r=n.memoizedState.cachePool.pool;null!=r&&r.refCount++}break;case 24:Ko(n.memoizedState.cache)}if(null!==(r=n.child))r.return=n,Ul=r;else e:for(n=e;null!==Ul;){var o=(r=Ul).sibling,i=r.return;if(zl(r),r===n){Ul=null;break e}if(null!==o){o.return=i,Ul=o;break e}Ul=i}}}var gu={getCacheForType:function(e){var t=Uo(qo),n=t.data.get(e);return void 0===n&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Uo(qo).controller.signal}},mu="function"==typeof WeakMap?WeakMap:Map,vu=0,bu=null,wu=null,Su=0,ku=0,xu=null,Eu=!1,_u=!1,Cu=!1,Iu=0,Tu=0,Au=0,Pu=0,ju=0,Ou=0,Ru=0,Mu=null,Lu=null,Bu=!1,Nu=0,Uu=0,Du=1/0,zu=null,Fu=null,Hu=0,Wu=null,qu=null,Vu=0,Ku=0,$u=null,Qu=null,Gu=0,Yu=null;function Xu(){return 2&vu&&0!==Su?Su&-Su:null!==j.T?$c():We()}function Zu(){if(0===Ou)if(536870912&Su&&!mo)Ou=536870912;else{var e=Ae;!(3932160&(Ae<<=1))&&(Ae=262144),Ou=e}return null!==(e=Ui.current)&&(e.flags|=32),Ou}function Ju(e,t,n){(e!==bu||2!==ku&&9!==ku)&&null===e.cancelPendingCommit||(ac(e,0),rc(e,Su,Ou,!1)),Ne(e,n),2&vu&&e===bu||(e===bu&&(!(2&vu)&&(Pu|=n),4===Tu&&rc(e,Su,Ou,!1)),zc(e))}function ec(e,t,n){if(6&vu)throw Error(r(327));for(var o=!n&&!(127&t)&&0===(t&e.expiredLanes)||Re(e,t),i=o?function(e,t){var n=vu;vu|=2;var o=uc(),i=cc();bu!==e||Su!==t?(zu=null,Du=he()+500,ac(e,t)):_u=Re(e,t);e:for(;;)try{if(0!==ku&&null!==wu){t=wu;var a=xu;t:switch(ku){case 1:ku=0,xu=null,mc(e,t,a,1);break;case 2:case 9:if(si(a)){ku=0,xu=null,gc(t);break}t=function(){2!==ku&&9!==ku||bu!==e||(ku=7),zc(e)},a.then(t,t);break e;case 3:ku=7;break e;case 4:ku=5;break e;case 7:si(a)?(ku=0,xu=null,gc(t)):(ku=0,xu=null,mc(e,t,a,7));break;case 5:var s=null;switch(wu.tag){case 26:s=wu.memoizedState;case 5:case 27:var l=wu;if(s?cp(s):l.stateNode.complete){ku=0,xu=null;var u=l.sibling;if(null!==u)wu=u;else{var c=l.return;null!==c?(wu=c,vc(c)):wu=null}break t}}ku=0,xu=null,mc(e,t,a,5);break;case 6:ku=0,xu=null,mc(e,t,a,6);break;case 8:ic(),Tu=6;break e;default:throw Error(r(462))}}dc();break}catch(f){sc(e,f)}return Po=Ao=null,j.H=o,j.A=i,vu=n,null!==wu?0:(bu=null,Su=0,Lr(),Tu)}(e,t):pc(e,t,!0),a=o;;){if(0===i){_u&&!o&&rc(e,t,0,!1);break}if(n=e.current.alternate,!a||nc(n)){if(2===i){if(a=t,e.errorRecoveryDisabledLanes&a)var s=0;else s=0!==(s=-536870913&e.pendingLanes)?s:536870912&s?536870912:0;if(0!==s){t=s;e:{var l=e;i=Mu;var u=l.current.memoizedState.isDehydrated;if(u&&(ac(l,s).flags|=256),2!==(s=pc(l,s,!1))){if(Cu&&!u){l.errorRecoveryDisabledLanes|=a,Pu|=a,i=4;break e}a=Lu,Lu=i,null!==a&&(null===Lu?Lu=a:Lu.push.apply(Lu,a))}i=s}if(a=!1,2!==i)continue}}if(1===i){ac(e,0),rc(e,t,0,!0);break}e:{switch(o=e,a=i){case 0:case 1:throw Error(r(345));case 4:if((4194048&t)!==t)break;case 6:rc(o,t,Ou,!Eu);break e;case 2:Lu=null;break;case 3:case 5:break;default:throw Error(r(329))}if((62914560&t)===t&&10<(i=Nu+300-he())){if(rc(o,t,Ou,!Eu),0!==Oe(o,0,!0))break e;Vu=t,o.timeoutHandle=If(tc.bind(null,o,n,Lu,zu,Bu,t,Ou,Pu,Ru,Eu,a,"Throttled",-0,0),i)}else tc(o,n,Lu,zu,Bu,t,Ou,Pu,Ru,Eu,a,null,-0,0)}break}i=pc(e,t,!1),a=!1}zc(e)}function tc(e,t,n,r,o,i,a,s,l,u,c,f,p,h){if(e.timeoutHandle=-1,8192&(f=t.subtreeFlags)||!(16785408&~f)){cu(t,i,f={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Nt});var d=(62914560&i)===i?Nu-he():(4194048&i)===i?Uu-he():0;if(d=function(e,t){return e.stylesheets&&0===e.count&&dp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&dp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&0===fp&&(fp=62500*function(){if("function"==typeof performance.getEntriesByType){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var o=n[r],i=o.transferSize,a=o.initiatorType,s=o.duration;if(i&&s&&bf(a)){for(a=0,s=o.responseEnd,r+=1;r<n.length;r++){var l=n[r],u=l.startTime;if(u>s)break;var c=l.transferSize,f=l.initiatorType;c&&bf(f)&&(a+=c*((l=l.responseEnd)<s?1:(s-u)/(l-u)))}if(--r,t+=8*(i+a)/(o.duration/1e3),10<++e)break}}if(0<e)return t/e/1e6}return navigator.connection&&"number"==typeof(e=navigator.connection.downlink)?e:5}());var o=setTimeout(function(){if(e.waitingForImages=!1,0===e.count&&(e.stylesheets&&dp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>fp?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(o)}}:null}(f,d),null!==d)return Vu=i,e.cancelPendingCommit=d(wc.bind(null,e,t,i,n,r,o,a,s,l,c,f,null,p,h)),void rc(e,i,a,!u)}wc(e,t,i,n,r,o,a,s,l)}function nc(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&(null!==(n=t.updateQueue)&&null!==(n=n.stores)))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!rr(i(),o))return!1}catch(a){return!1}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function rc(e,t,n,r){t&=~ju,t&=~Pu,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var o=t;0<o;){var i=31-_e(o),a=1<<i;r[i]=-1,o&=~a}0!==n&&Ue(e,n,t)}function oc(){return!!(6&vu)||(Fc(0),!1)}function ic(){if(null!==wu){if(0===ku)var e=wu.return;else Po=Ao=null,pa(e=wu),hi=null,di=0,e=wu;for(;null!==e;)wl(e.alternate,e),e=e.return;wu=null}}function ac(e,t){var n=e.timeoutHandle;-1!==n&&(e.timeoutHandle=-1,Tf(n)),null!==(n=e.cancelPendingCommit)&&(e.cancelPendingCommit=null,n()),Vu=0,ic(),bu=e,wu=n=Vr(e.current,null),Su=t,ku=0,xu=null,Eu=!1,_u=Re(e,t),Cu=!1,Ru=Ou=ju=Pu=Au=Tu=0,Lu=Mu=null,Bu=!1,8&t&&(t|=32&t);var r=e.entangledLanes;if(0!==r)for(e=e.entanglements,r&=t;0<r;){var o=31-_e(r),i=1<<o;t|=e[o],r&=~i}return Iu=t,Lr(),n}function sc(e,t){Qi=null,j.H=ws,t===ri||t===ii?(t=fi(),ku=3):t===oi?(t=fi(),ku=4):ku=t===Ns?8:null!==t&&"object"==typeof t&&"function"==typeof t.then?6:1,xu=t,null===wu&&(Tu=1,Os(e,Jr(t,e.current)))}function lc(){var e=Ui.current;return null===e||((4194048&Su)===Su?null===Di:!!((62914560&Su)===Su||536870912&Su)&&e===Di)}function uc(){var e=j.H;return j.H=ws,null===e?ws:e}function cc(){var e=j.A;return j.A=gu,e}function fc(){Tu=4,Eu||(4194048&Su)!==Su&&null!==Ui.current||(_u=!0),!(134217727&Au)&&!(134217727&Pu)||null===bu||rc(bu,Su,Ou,!1)}function pc(e,t,n){var r=vu;vu|=2;var o=uc(),i=cc();bu===e&&Su===t||(zu=null,ac(e,t)),t=!1;var a=Tu;e:for(;;)try{if(0!==ku&&null!==wu){var s=wu,l=xu;switch(ku){case 8:ic(),a=6;break e;case 3:case 2:case 9:case 6:null===Ui.current&&(t=!0);var u=ku;if(ku=0,xu=null,mc(e,s,l,u),n&&_u){a=0;break e}break;default:u=ku,ku=0,xu=null,mc(e,s,l,u)}}hc(),a=Tu;break}catch(c){sc(e,c)}return t&&e.shellSuspendCounter++,Po=Ao=null,vu=r,j.H=o,j.A=i,null===wu&&(bu=null,Su=0,Lr()),a}function hc(){for(;null!==wu;)yc(wu)}function dc(){for(;null!==wu&&!fe();)yc(wu)}function yc(e){var t=fl(e.alternate,e,Iu);e.memoizedProps=e.pendingProps,null===t?vc(e):wu=t}function gc(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Ys(n,t,t.pendingProps,t.type,void 0,Su);break;case 11:t=Ys(n,t,t.pendingProps,t.type.render,t.ref,Su);break;case 5:pa(t);default:wl(n,t),t=fl(n,t=wu=Kr(t,Iu),Iu)}e.memoizedProps=e.pendingProps,null===t?vc(e):wu=t}function mc(e,t,n,o){Po=Ao=null,pa(t),hi=null,di=0;var i=t.return;try{if(function(e,t,n,o,i){if(n.flags|=32768,null!==o&&"object"==typeof o&&"function"==typeof o.then){if(null!==(t=n.alternate)&&Lo(t,n,i,!0),null!==(n=Ui.current)){switch(n.tag){case 31:case 13:return null===Di?fc():null===n.alternate&&0===Tu&&(Tu=3),n.flags&=-257,n.flags|=65536,n.lanes=i,o===ai?n.flags|=16384:(null===(t=n.updateQueue)?n.updateQueue=new Set([o]):t.add(o),Ac(e,o,i)),!1;case 22:return n.flags|=65536,o===ai?n.flags|=16384:(null===(t=n.updateQueue)?(t={transitions:null,markerInstances:null,retryQueue:new Set([o])},n.updateQueue=t):null===(n=t.retryQueue)?t.retryQueue=new Set([o]):n.add(o),Ac(e,o,i)),!1}throw Error(r(435,n.tag))}return Ac(e,o,i),fc(),!1}if(mo)return null!==(t=Ui.current)?(!(65536&t.flags)&&(t.flags|=256),t.flags|=65536,t.lanes=i,o!==wo&&Io(Jr(e=Error(r(422),{cause:o}),n))):(o!==wo&&Io(Jr(t=Error(r(423),{cause:o}),n)),(e=e.current.alternate).flags|=65536,i&=-i,e.lanes|=i,o=Jr(o,n),Ii(e,i=Ms(e.stateNode,o,i)),4!==Tu&&(Tu=2)),!1;var a=Error(r(520),{cause:o});if(a=Jr(a,n),null===Mu?Mu=[a]:Mu.push(a),4!==Tu&&(Tu=2),null===t)return!0;o=Jr(o,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,Ii(n,e=Ms(n.stateNode,o,e)),!1;case 1:if(t=n.type,a=n.stateNode,!(128&n.flags||"function"!=typeof t.getDerivedStateFromError&&(null===a||"function"!=typeof a.componentDidCatch||null!==Fu&&Fu.has(a))))return n.flags|=65536,i&=-i,n.lanes|=i,Bs(i=Ls(i),e,n,o),Ii(n,i),!1}n=n.return}while(null!==n);return!1}(e,i,t,n,Su))return Tu=1,Os(e,Jr(n,e.current)),void(wu=null)}catch(a){if(null!==i)throw wu=i,a;return Tu=1,Os(e,Jr(n,e.current)),void(wu=null)}32768&t.flags?(mo||1===o?e=!0:_u||536870912&Su?e=!1:(Eu=e=!0,(2===o||9===o||3===o||6===o)&&(null!==(o=Ui.current)&&13===o.tag&&(o.flags|=16384))),bc(t,e)):vc(t)}function vc(e){var t=e;do{if(32768&t.flags)return void bc(t,Eu);e=t.return;var n=vl(t.alternate,t,Iu);if(null!==n)return void(wu=n);if(null!==(t=t.sibling))return void(wu=t);wu=t=e}while(null!==t);0===Tu&&(Tu=5)}function bc(e,t){do{var n=bl(e.alternate,e);if(null!==n)return n.flags&=32767,void(wu=n);if(null!==(n=e.return)&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&null!==(e=e.sibling))return void(wu=e);wu=e=n}while(null!==e);Tu=6,wu=null}function wc(e,t,n,o,i,a,s,l,u){e.cancelPendingCommit=null;do{_c()}while(0!==Hu);if(6&vu)throw Error(r(327));if(null!==t){if(t===e.current)throw Error(r(177));if(a=t.lanes|t.childLanes,function(e,t,n,r,o,i){var a=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,l=e.expirationTimes,u=e.hiddenUpdates;for(n=a&~n;0<n;){var c=31-_e(n),f=1<<c;s[c]=0,l[c]=-1;var p=u[c];if(null!==p)for(u[c]=null,c=0;c<p.length;c++){var h=p[c];null!==h&&(h.lane&=-536870913)}n&=~f}0!==r&&Ue(e,r,0),0!==i&&0===o&&0!==e.tag&&(e.suspendedLanes|=i&~(a&~t))}(e,n,a|=Mr,s,l,u),e===bu&&(wu=bu=null,Su=0),qu=t,Wu=e,Vu=n,Ku=a,$u=i,Qu=o,10256&t.subtreeFlags||10256&t.flags?(e.callbackNode=null,e.callbackPriority=0,ue(me,function(){return Cc(),null})):(e.callbackNode=null,e.callbackPriority=0),o=!!(13878&t.flags),13878&t.subtreeFlags||o){o=j.T,j.T=null,i=O.p,O.p=2,s=vu,vu|=4;try{!function(e,t){if(e=e.containerInfo,wf=_p,ur(e=lr(e))){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var o=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(o&&0!==o.rangeCount){n=o.anchorNode;var i=o.anchorOffset,a=o.focusNode;o=o.focusOffset;try{n.nodeType,a.nodeType}catch(g){n=null;break e}var s=0,l=-1,u=-1,c=0,f=0,p=e,h=null;t:for(;;){for(var d;p!==n||0!==i&&3!==p.nodeType||(l=s+i),p!==a||0!==o&&3!==p.nodeType||(u=s+o),3===p.nodeType&&(s+=p.nodeValue.length),null!==(d=p.firstChild);)h=p,p=d;for(;;){if(p===e)break t;if(h===n&&++c===i&&(l=s),h===a&&++f===o&&(u=s),null!==(d=p.nextSibling))break;h=(p=h).parentNode}p=d}n=-1===l||-1===u?null:{start:l,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Sf={focusedElem:e,selectionRange:n},_p=!1,Ul=t;null!==Ul;)if(e=(t=Ul).child,1028&t.subtreeFlags&&null!==e)e.return=t,Ul=e;else for(;null!==Ul;){switch(a=(t=Ul).alternate,e=t.flags,t.tag){case 0:if(4&e&&null!==(e=null!==(e=t.updateQueue)?e.events:null))for(n=0;n<e.length;n++)(i=e[n]).ref.impl=i.nextImpl;break;case 11:case 15:case 5:case 26:case 27:case 6:case 4:case 17:break;case 1:if(1024&e&&null!==a){e=void 0,n=t,i=a.memoizedProps,a=a.memoizedState,o=n.stateNode;try{var y=Ts(n.type,i);e=o.getSnapshotBeforeUpdate(y,a),o.__reactInternalSnapshotBeforeUpdate=e}catch(m){Tc(n,n.return,m)}}break;case 3:if(1024&e)if(9===(n=(e=t.stateNode.containerInfo).nodeType))Lf(e);else if(1===n)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Lf(e);break;default:e.textContent=""}break;default:if(1024&e)throw Error(r(163))}if(null!==(e=t.sibling)){e.return=t.return,Ul=e;break}Ul=t.return}}(e,t)}finally{vu=s,O.p=i,j.T=o}}Hu=1,Sc(),kc(),xc()}}function Sc(){if(1===Hu){Hu=0;var e=Wu,t=qu,n=!!(13878&t.flags);if(13878&t.subtreeFlags||n){n=j.T,j.T=null;var r=O.p;O.p=2;var o=vu;vu|=4;try{Yl(t,e);var i=Sf,a=lr(e.containerInfo),s=i.focusedElem,l=i.selectionRange;if(a!==s&&s&&s.ownerDocument&&sr(s.ownerDocument.documentElement,s)){if(null!==l&&ur(s)){var u=l.start,c=l.end;if(void 0===c&&(c=u),"selectionStart"in s)s.selectionStart=u,s.selectionEnd=Math.min(c,s.value.length);else{var f=s.ownerDocument||document,p=f&&f.defaultView||window;if(p.getSelection){var h=p.getSelection(),d=s.textContent.length,y=Math.min(l.start,d),g=void 0===l.end?y:Math.min(l.end,d);!h.extend&&y>g&&(a=g,g=y,y=a);var m=ar(s,y),v=ar(s,g);if(m&&v&&(1!==h.rangeCount||h.anchorNode!==m.node||h.anchorOffset!==m.offset||h.focusNode!==v.node||h.focusOffset!==v.offset)){var b=f.createRange();b.setStart(m.node,m.offset),h.removeAllRanges(),y>g?(h.addRange(b),h.extend(v.node,v.offset)):(b.setEnd(v.node,v.offset),h.addRange(b))}}}}for(f=[],h=s;h=h.parentNode;)1===h.nodeType&&f.push({element:h,left:h.scrollLeft,top:h.scrollTop});for("function"==typeof s.focus&&s.focus(),s=0;s<f.length;s++){var w=f[s];w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}_p=!!wf,Sf=wf=null}finally{vu=o,O.p=r,j.T=n}}e.current=t,Hu=2}}function kc(){if(2===Hu){Hu=0;var e=Wu,t=qu,n=!!(8772&t.flags);if(8772&t.subtreeFlags||n){n=j.T,j.T=null;var r=O.p;O.p=2;var o=vu;vu|=4;try{Dl(e,t.alternate,t)}finally{vu=o,O.p=r,j.T=n}}Hu=3}}function xc(){if(4===Hu||3===Hu){Hu=0,pe();var e=Wu,t=qu,n=Vu,r=Qu;10256&t.subtreeFlags||10256&t.flags?Hu=5:(Hu=0,qu=Wu=null,Ec(e,e.pendingLanes));var o=e.pendingLanes;if(0===o&&(Fu=null),He(n),t=t.stateNode,xe&&"function"==typeof xe.onCommitFiberRoot)try{xe.onCommitFiberRoot(ke,t,void 0,!(128&~t.current.flags))}catch(l){}if(null!==r){t=j.T,o=O.p,O.p=2,j.T=null;try{for(var i=e.onRecoverableError,a=0;a<r.length;a++){var s=r[a];i(s.value,{componentStack:s.stack})}}finally{j.T=t,O.p=o}}3&Vu&&_c(),zc(e),o=e.pendingLanes,261930&n&&42&o?e===Yu?Gu++:(Gu=0,Yu=e):Gu=0,Fc(0)}}function Ec(e,t){0===(e.pooledCacheLanes&=t)&&(null!=(t=e.pooledCache)&&(e.pooledCache=null,Ko(t)))}function _c(){return Sc(),kc(),xc(),Cc()}function Cc(){if(5!==Hu)return!1;var e=Wu,t=Ku;Ku=0;var n=He(Vu),o=j.T,i=O.p;try{O.p=32>n?32:n,j.T=null,n=$u,$u=null;var a=Wu,s=Vu;if(Hu=0,qu=Wu=null,Vu=0,6&vu)throw Error(r(331));var l=vu;if(vu|=4,hu(a.current),iu(a,a.current,s,n),vu=l,Fc(0,!1),xe&&"function"==typeof xe.onPostCommitFiberRoot)try{xe.onPostCommitFiberRoot(ke,a)}catch(u){}return!0}finally{O.p=i,j.T=o,Ec(e,t)}}function Ic(e,t,n){t=Jr(n,t),null!==(e=_i(e,t=Ms(e.stateNode,t,2),2))&&(Ne(e,2),zc(e))}function Tc(e,t,n){if(3===e.tag)Ic(e,e,n);else for(;null!==t;){if(3===t.tag){Ic(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Fu||!Fu.has(r))){e=Jr(n,e),null!==(r=_i(t,n=Ls(2),2))&&(Bs(n,r,t,e),Ne(r,2),zc(r));break}}t=t.return}}function Ac(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new mu;var o=new Set;r.set(t,o)}else void 0===(o=r.get(t))&&(o=new Set,r.set(t,o));o.has(n)||(Cu=!0,o.add(n),e=Pc.bind(null,e,t,n),t.then(e,e))}function Pc(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,bu===e&&(Su&n)===n&&(4===Tu||3===Tu&&(62914560&Su)===Su&&300>he()-Nu?!(2&vu)&&ac(e,0):ju|=n,Ru===Su&&(Ru=0)),zc(e)}function jc(e,t){0===t&&(t=Le()),null!==(e=Ur(e,t))&&(Ne(e,t),zc(e))}function Oc(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),jc(e,n)}function Rc(e,t){var n=0;switch(e.tag){case 31:case 13:var o=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(r(314))}null!==o&&o.delete(t),jc(e,n)}var Mc=null,Lc=null,Bc=!1,Nc=!1,Uc=!1,Dc=0;function zc(e){e!==Lc&&null===e.next&&(null===Lc?Mc=Lc=e:Lc=Lc.next=e),Nc=!0,Bc||(Bc=!0,Pf(function(){6&vu?ue(ye,Hc):Wc()}))}function Fc(e,t){if(!Uc&&Nc){Uc=!0;do{for(var n=!1,r=Mc;null!==r;){if(0!==e){var o=r.pendingLanes;if(0===o)var i=0;else{var a=r.suspendedLanes,s=r.pingedLanes;i=(1<<31-_e(42|e)+1)-1,i=201326741&(i&=o&~(a&~s))?201326741&i|1:i?2|i:0}0!==i&&(n=!0,Kc(r,i))}else i=Su,!(3&(i=Oe(r,r===bu?i:0,null!==r.cancelPendingCommit||-1!==r.timeoutHandle)))||Re(r,i)||(n=!0,Kc(r,i));r=r.next}}while(n);Uc=!1}}function Hc(){Wc()}function Wc(){Nc=Bc=!1;var e=0;0!==Dc&&function(){var e=window.event;if(e&&"popstate"===e.type)return e!==Cf&&(Cf=e,!0);return Cf=null,!1}()&&(e=Dc);for(var t=he(),n=null,r=Mc;null!==r;){var o=r.next,i=qc(r,t);0===i?(r.next=null,null===n?Mc=o:n.next=o,null===o&&(Lc=n)):(n=r,(0!==e||3&i)&&(Nc=!0)),r=o}0!==Hu&&5!==Hu||Fc(e),0!==Dc&&(Dc=0)}function qc(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=-62914561&e.pendingLanes;0<i;){var a=31-_e(i),s=1<<a,l=o[a];-1===l?0!==(s&n)&&0===(s&r)||(o[a]=Me(s,t)):l<=t&&(e.expiredLanes|=s),i&=~s}if(n=Su,n=Oe(e,e===(t=bu)?n:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle),r=e.callbackNode,0===n||e===t&&(2===ku||9===ku)||null!==e.cancelPendingCommit)return null!==r&&null!==r&&ce(r),e.callbackNode=null,e.callbackPriority=0;if(!(3&n)||Re(e,n)){if((t=n&-n)===e.callbackPriority)return t;switch(null!==r&&ce(r),He(n)){case 2:case 8:n=ge;break;case 32:default:n=me;break;case 268435456:n=be}return r=Vc.bind(null,e),n=ue(n,r),e.callbackPriority=t,e.callbackNode=n,t}return null!==r&&null!==r&&ce(r),e.callbackPriority=2,e.callbackNode=null,2}function Vc(e,t){if(0!==Hu&&5!==Hu)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(_c()&&e.callbackNode!==n)return null;var r=Su;return 0===(r=Oe(e,e===bu?r:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle))?null:(ec(e,r,t),qc(e,he()),null!=e.callbackNode&&e.callbackNode===n?Vc.bind(null,e):null)}function Kc(e,t){if(_c())return null;ec(e,t,!0)}function $c(){if(0===Dc){var e=Go;0===e&&(e=Te,!(261888&(Te<<=1))&&(Te=256)),Dc=e}return Dc}function Qc(e){return null==e||"symbol"==typeof e||"boolean"==typeof e?null:"function"==typeof e?e:Bt(""+e)}function Gc(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}for(var Yc=0;Yc<Ar.length;Yc++){var Xc=Ar[Yc];Pr(Xc.toLowerCase(),"on"+(Xc[0].toUpperCase()+Xc.slice(1)))}Pr(Sr,"onAnimationEnd"),Pr(kr,"onAnimationIteration"),Pr(xr,"onAnimationStart"),Pr("dblclick","onDoubleClick"),Pr("focusin","onFocus"),Pr("focusout","onBlur"),Pr(Er,"onTransitionRun"),Pr(_r,"onTransitionStart"),Pr(Cr,"onTransitionCancel"),Pr(Ir,"onTransitionEnd"),ut("onMouseEnter",["mouseout","mouseover"]),ut("onMouseLeave",["mouseout","mouseover"]),ut("onPointerEnter",["pointerout","pointerover"]),ut("onPointerLeave",["pointerout","pointerover"]),lt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),lt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),lt("onBeforeInput",["compositionend","keypress","textInput","paste"]),lt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),lt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),lt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zc="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(" "),Jc=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Zc));function ef(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==i&&o.isPropagationStopped())break e;i=s,o.currentTarget=u;try{i(o)}catch(c){jr(c)}o.currentTarget=null,i=l}else for(a=0;a<r.length;a++){if(l=(s=r[a]).instance,u=s.currentTarget,s=s.listener,l!==i&&o.isPropagationStopped())break e;i=s,o.currentTarget=u;try{i(o)}catch(c){jr(c)}o.currentTarget=null,i=l}}}}function tf(e,t){var n=t[Ge];void 0===n&&(n=t[Ge]=new Set);var r=e+"__bubble";n.has(r)||(af(t,e,2,!1),n.add(r))}function nf(e,t,n){var r=0;t&&(r|=4),af(n,e,r,t)}var rf="_reactListening"+Math.random().toString(36).slice(2);function of(e){if(!e[rf]){e[rf]=!0,at.forEach(function(t){"selectionchange"!==t&&(Jc.has(t)||nf(t,!1,e),nf(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[rf]||(t[rf]=!0,nf("selectionchange",!1,t))}}function af(e,t,n,r){switch(Op(t)){case 2:var o=Cp;break;case 8:o=Ip;break;default:o=Tp}n=o.bind(null,t,n,e),o=void 0,!$t||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(o=!0),r?void 0!==o?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):void 0!==o?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function sf(e,t,n,r,o){var a=r;if(!(1&t||2&t||null===r))e:for(;;){if(null===r)return;var s=r.tag;if(3===s||4===s){var l=r.stateNode.containerInfo;if(l===o)break;if(4===s)for(s=r.return;null!==s;){var u=s.tag;if((3===u||4===u)&&s.stateNode.containerInfo===o)return;s=s.return}for(;null!==l;){if(null===(s=tt(l)))return;if(5===(u=s.tag)||6===u||26===u||27===u){r=a=s;continue e}l=l.parentNode}}r=r.return}qt(function(){var r=a,o=Dt(n),s=[];e:{var l=Tr.get(e);if(void 0!==l){var u=ln,c=e;switch(e){case"keypress":if(0===Jt(n))break e;case"keydown":case"keyup":u=xn;break;case"focusin":c="focus",u=dn;break;case"focusout":c="blur",u=dn;break;case"beforeblur":case"afterblur":u=dn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":u=pn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":u=hn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":u=_n;break;case Sr:case kr:case xr:u=yn;break;case Ir:u=Cn;break;case"scroll":case"scrollend":u=cn;break;case"wheel":u=In;break;case"copy":case"cut":case"paste":u=gn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":u=En;break;case"toggle":case"beforetoggle":u=Tn}var f=!!(4&t),p=!f&&("scroll"===e||"scrollend"===e),h=f?null!==l?l+"Capture":null:l;f=[];for(var d,y=r;null!==y;){var g=y;if(d=g.stateNode,5!==(g=g.tag)&&26!==g&&27!==g||null===d||null===h||null!=(g=Vt(y,h))&&f.push(lf(y,g,d)),p)break;y=y.return}0<f.length&&(l=new u(l,c,null,n,o),s.push({event:l,listeners:f}))}}if(!(7&t)){if(u="mouseout"===e||"pointerout"===e,(!(l="mouseover"===e||"pointerover"===e)||n===Ut||!(c=n.relatedTarget||n.fromElement)||!tt(c)&&!c[Qe])&&(u||l)&&(l=o.window===o?o:(l=o.ownerDocument)?l.defaultView||l.parentWindow:window,u?(u=r,null!==(c=(c=n.relatedTarget||n.toElement)?tt(c):null)&&(p=i(c),f=c.tag,c!==p||5!==f&&27!==f&&6!==f)&&(c=null)):(u=null,c=r),u!==c)){if(f=pn,g="onMouseLeave",h="onMouseEnter",y="mouse","pointerout"!==e&&"pointerover"!==e||(f=En,g="onPointerLeave",h="onPointerEnter",y="pointer"),p=null==u?l:rt(u),d=null==c?l:rt(c),(l=new f(g,y+"leave",u,n,o)).target=p,l.relatedTarget=d,g=null,tt(o)===r&&((f=new f(h,y+"enter",c,n,o)).target=d,f.relatedTarget=p,g=f),p=g,u&&c)e:{for(f=cf,y=c,d=0,g=h=u;g;g=f(g))d++;g=0;for(var m=y;m;m=f(m))g++;for(;0<d-g;)h=f(h),d--;for(;0<g-d;)y=f(y),g--;for(;d--;){if(h===y||null!==y&&h===y.alternate){f=h;break e}h=f(h),y=f(y)}f=null}else f=null;null!==u&&ff(s,l,u,f,!1),null!==c&&null!==p&&ff(s,p,c,f,!0)}if("select"===(u=(l=r?rt(r):window).nodeName&&l.nodeName.toLowerCase())||"input"===u&&"file"===l.type)var v=Kn;else if(zn(l))if($n)v=nr;else{v=er;var b=Jn}else!(u=l.nodeName)||"input"!==u.toLowerCase()||"checkbox"!==l.type&&"radio"!==l.type?r&&Rt(r.elementType)&&(v=Kn):v=tr;switch(v&&(v=v(e,r))?Fn(s,v,n,o):(b&&b(e,l,r),"focusout"===e&&r&&"number"===l.type&&null!=r.memoizedProps.value&&_t(l,"number",l.value)),b=r?rt(r):window,e){case"focusin":(zn(b)||"true"===b.contentEditable)&&(fr=b,pr=r,hr=null);break;case"focusout":hr=pr=fr=null;break;case"mousedown":dr=!0;break;case"contextmenu":case"mouseup":case"dragend":dr=!1,yr(s,n,o);break;case"selectionchange":if(cr)break;case"keydown":case"keyup":yr(s,n,o)}var w;if(Pn)e:{switch(e){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else Un?Bn(e,n)&&(S="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(S="onCompositionStart");S&&(Rn&&"ko"!==n.locale&&(Un||"onCompositionStart"!==S?"onCompositionEnd"===S&&Un&&(w=Zt()):(Yt="value"in(Gt=o)?Gt.value:Gt.textContent,Un=!0)),0<(b=uf(r,S)).length&&(S=new mn(S,e,null,n,o),s.push({event:S,listeners:b}),w?S.data=w:null!==(w=Nn(n))&&(S.data=w))),(w=On?function(e,t){switch(e){case"compositionend":return Nn(t);case"keypress":return 32!==t.which?null:(Ln=!0,Mn);case"textInput":return(e=t.data)===Mn&&Ln?null:e;default:return null}}(e,n):function(e,t){if(Un)return"compositionend"===e||!Pn&&Bn(e,t)?(e=Zt(),Xt=Yt=Gt=null,Un=!1,e):null;switch(e){case"paste":default: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 Rn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(S=uf(r,"onBeforeInput")).length&&(b=new mn("onBeforeInput","beforeinput",null,n,o),s.push({event:b,listeners:S}),b.data=w)),function(e,t,n,r,o){if("submit"===t&&n&&n.stateNode===o){var i=Qc((o[$e]||null).action),a=r.submitter;a&&null!==(t=(t=a[$e]||null)?Qc(t.formAction):a.getAttribute("formAction"))&&(i=t,a=null);var s=new ln("action","action",null,r,o);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(0!==Dc){var e=a?Gc(o,a):new FormData(o);as(n,{pending:!0,data:e,method:o.method,action:i},null,e)}}else"function"==typeof i&&(s.preventDefault(),e=a?Gc(o,a):new FormData(o),as(n,{pending:!0,data:e,method:o.method,action:i},i,e))},currentTarget:o}]})}}(s,e,r,n,o)}ef(s,t)})}function lf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function uf(e,t){for(var n=t+"Capture",r=[];null!==e;){var o=e,i=o.stateNode;if(5!==(o=o.tag)&&26!==o&&27!==o||null===i||(null!=(o=Vt(e,n))&&r.unshift(lf(e,o,i)),null!=(o=Vt(e,t))&&r.push(lf(e,o,i))),3===e.tag)return r;e=e.return}return[]}function cf(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag&&27!==e.tag);return e||null}function ff(e,t,n,r,o){for(var i=t._reactName,a=[];null!==n&&n!==r;){var s=n,l=s.alternate,u=s.stateNode;if(s=s.tag,null!==l&&l===r)break;5!==s&&26!==s&&27!==s||null===u||(l=u,o?null!=(u=Vt(n,i))&&a.unshift(lf(n,u,l)):o||null!=(u=Vt(n,i))&&a.push(lf(n,u,l))),n=n.return}0!==a.length&&e.push({event:t,listeners:a})}var pf=/\r\n?/g,hf=/\u0000|\uFFFD/g;function df(e){return("string"==typeof e?e:""+e).replace(pf,"\n").replace(hf,"")}function yf(e,t){return t=df(t),df(e)===t}function gf(e,t,n,o,i,a){switch(n){case"children":"string"==typeof o?"body"===t||"textarea"===t&&""===o||At(e,o):("number"==typeof o||"bigint"==typeof o)&&"body"!==t&&At(e,""+o);break;case"className":dt(e,"class",o);break;case"tabIndex":dt(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":dt(e,n,o);break;case"style":Ot(e,o,a);break;case"data":if("object"!==t){dt(e,"data",o);break}case"src":case"href":if(""===o&&("a"!==t||"href"!==n)){e.removeAttribute(n);break}if(null==o||"function"==typeof o||"symbol"==typeof o||"boolean"==typeof o){e.removeAttribute(n);break}o=Bt(""+o),e.setAttribute(n,o);break;case"action":case"formAction":if("function"==typeof o){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}if("function"==typeof a&&("formAction"===n?("input"!==t&&gf(e,t,"name",i.name,i,null),gf(e,t,"formEncType",i.formEncType,i,null),gf(e,t,"formMethod",i.formMethod,i,null),gf(e,t,"formTarget",i.formTarget,i,null)):(gf(e,t,"encType",i.encType,i,null),gf(e,t,"method",i.method,i,null),gf(e,t,"target",i.target,i,null))),null==o||"symbol"==typeof o||"boolean"==typeof o){e.removeAttribute(n);break}o=Bt(""+o),e.setAttribute(n,o);break;case"onClick":null!=o&&(e.onclick=Nt);break;case"onScroll":null!=o&&tf("scroll",e);break;case"onScrollEnd":null!=o&&tf("scrollend",e);break;case"dangerouslySetInnerHTML":if(null!=o){if("object"!=typeof o||!("__html"in o))throw Error(r(61));if(null!=(n=o.__html)){if(null!=i.children)throw Error(r(60));e.innerHTML=n}}break;case"multiple":e.multiple=o&&"function"!=typeof o&&"symbol"!=typeof o;break;case"muted":e.muted=o&&"function"!=typeof o&&"symbol"!=typeof o;break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":case"autoFocus":break;case"xlinkHref":if(null==o||"function"==typeof o||"boolean"==typeof o||"symbol"==typeof o){e.removeAttribute("xlink:href");break}n=Bt(""+o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":null!=o&&"function"!=typeof o&&"symbol"!=typeof o?e.setAttribute(n,""+o):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&"function"!=typeof o&&"symbol"!=typeof o?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":!0===o?e.setAttribute(n,""):!1!==o&&null!=o&&"function"!=typeof o&&"symbol"!=typeof o?e.setAttribute(n,o):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&!isNaN(o)&&1<=o?e.setAttribute(n,o):e.removeAttribute(n);break;case"rowSpan":case"start":null==o||"function"==typeof o||"symbol"==typeof o||isNaN(o)?e.removeAttribute(n):e.setAttribute(n,o);break;case"popover":tf("beforetoggle",e),tf("toggle",e),ht(e,"popover",o);break;case"xlinkActuate":yt(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":yt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":yt(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":yt(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":yt(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":yt(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":yt(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":yt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":yt(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":ht(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<n.length)||"o"!==n[0]&&"O"!==n[0]||"n"!==n[1]&&"N"!==n[1])&&ht(e,n=Mt.get(n)||n,o)}}function mf(e,t,n,o,i,a){switch(n){case"style":Ot(e,o,a);break;case"dangerouslySetInnerHTML":if(null!=o){if("object"!=typeof o||!("__html"in o))throw Error(r(61));if(null!=(n=o.__html)){if(null!=i.children)throw Error(r(60));e.innerHTML=n}}break;case"children":"string"==typeof o?At(e,o):("number"==typeof o||"bigint"==typeof o)&&At(e,""+o);break;case"onScroll":null!=o&&tf("scroll",e);break;case"onScrollEnd":null!=o&&tf("scrollend",e);break;case"onClick":null!=o&&(e.onclick=Nt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":case"innerText":case"textContent":break;default:st.hasOwnProperty(n)||("o"!==n[0]||"n"!==n[1]||(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),"function"==typeof(a=null!=(a=e[$e]||null)?a[n]:null)&&e.removeEventListener(t,a,i),"function"!=typeof o)?n in e?e[n]=o:!0===o?e.setAttribute(n,""):ht(e,n,o):("function"!=typeof a&&null!==a&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,o,i)))}}function vf(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":tf("error",e),tf("load",e);var o,i=!1,a=!1;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(null!=s)switch(o){case"src":i=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:gf(e,t,o,s,n,null)}}return a&&gf(e,t,"srcSet",n.srcSet,n,null),void(i&&gf(e,t,"src",n.src,n,null));case"input":tf("invalid",e);var l=o=s=a=null,u=null,c=null;for(i in n)if(n.hasOwnProperty(i)){var f=n[i];if(null!=f)switch(i){case"name":a=f;break;case"type":s=f;break;case"checked":u=f;break;case"defaultChecked":c=f;break;case"value":o=f;break;case"defaultValue":l=f;break;case"children":case"dangerouslySetInnerHTML":if(null!=f)throw Error(r(137,t));break;default:gf(e,t,i,f,n,null)}}return void Et(e,o,l,u,c,s,a,!1);case"select":for(a in tf("invalid",e),i=s=o=null,n)if(n.hasOwnProperty(a)&&null!=(l=n[a]))switch(a){case"value":o=l;break;case"defaultValue":s=l;break;case"multiple":i=l;default:gf(e,t,a,l,n,null)}return t=o,n=s,e.multiple=!!i,void(null!=t?Ct(e,!!i,t,!1):null!=n&&Ct(e,!!i,n,!0));case"textarea":for(s in tf("invalid",e),o=a=i=null,n)if(n.hasOwnProperty(s)&&null!=(l=n[s]))switch(s){case"value":i=l;break;case"defaultValue":a=l;break;case"children":o=l;break;case"dangerouslySetInnerHTML":if(null!=l)throw Error(r(91));break;default:gf(e,t,s,l,n,null)}return void Tt(e,i,a,o);case"option":for(u in n)if(n.hasOwnProperty(u)&&null!=(i=n[u]))if("selected"===u)e.selected=i&&"function"!=typeof i&&"symbol"!=typeof i;else gf(e,t,u,i,n,null);return;case"dialog":tf("beforetoggle",e),tf("toggle",e),tf("cancel",e),tf("close",e);break;case"iframe":case"object":tf("load",e);break;case"video":case"audio":for(i=0;i<Zc.length;i++)tf(Zc[i],e);break;case"image":tf("error",e),tf("load",e);break;case"details":tf("toggle",e);break;case"embed":case"source":case"link":tf("error",e),tf("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&null!=(i=n[c]))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:gf(e,t,c,i,n,null)}return;default:if(Rt(t)){for(f in n)n.hasOwnProperty(f)&&(void 0!==(i=n[f])&&mf(e,t,f,i,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(null!=(i=n[l])&&gf(e,t,l,i,n,null))}function bf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}var wf=null,Sf=null;function kf(e){return 9===e.nodeType?e:e.ownerDocument}function xf(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ef(e,t){if(0===e)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return 1===e&&"foreignObject"===t?0:e}function _f(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"bigint"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Cf=null;var If="function"==typeof setTimeout?setTimeout:void 0,Tf="function"==typeof clearTimeout?clearTimeout:void 0,Af="function"==typeof Promise?Promise:void 0,Pf="function"==typeof queueMicrotask?queueMicrotask:void 0!==Af?function(e){return Af.resolve(null).then(e).catch(jf)}:If;function jf(e){setTimeout(function(){throw e})}function Of(e){return"head"===e}function Rf(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&8===o.nodeType)if("/$"===(n=o.data)||"/&"===n){if(0===r)return e.removeChild(o),void Yp(t);r--}else if("$"===n||"$?"===n||"$~"===n||"$!"===n||"&"===n)r++;else if("html"===n)qf(e.ownerDocument.documentElement);else if("head"===n){qf(n=e.ownerDocument.head);for(var i=n.firstChild;i;){var a=i.nextSibling,s=i.nodeName;i[Je]||"SCRIPT"===s||"STYLE"===s||"LINK"===s&&"stylesheet"===i.rel.toLowerCase()||n.removeChild(i),i=a}}else"body"===n&&qf(e.ownerDocument.body);n=o}while(n);Yp(t)}function Mf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(1===n.nodeType?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",""===n.getAttribute("style")&&n.removeAttribute("style")):3===n.nodeType&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&8===r.nodeType)if("/$"===(n=r.data)){if(0===e)break;e--}else"$"!==n&&"$?"!==n&&"$~"!==n&&"$!"!==n||e++;n=r}while(n)}function Lf(e){var t=e.firstChild;for(t&&10===t.nodeType&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Lf(n),et(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if("stylesheet"===n.rel.toLowerCase())continue}e.removeChild(n)}}function Bf(e,t){for(;8!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!t)return null;if(null===(e=Df(e.nextSibling)))return null}return e}function Nf(e){return"$?"===e.data||"$~"===e.data}function Uf(e){return"$!"===e.data||"$?"===e.data&&"loading"!==e.ownerDocument.readyState}function Df(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t||"$~"===t||"&"===t||"F!"===t||"F"===t)break;if("/$"===t||"/&"===t)return null}}return e}var zf=null;function Ff(e){e=e.nextSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n||"/&"===n){if(0===t)return Df(e.nextSibling);t--}else"$"!==n&&"$!"!==n&&"$?"!==n&&"$~"!==n&&"&"!==n||t++}e=e.nextSibling}return null}function Hf(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n||"$~"===n||"&"===n){if(0===t)return e;t--}else"/$"!==n&&"/&"!==n||t++}e=e.previousSibling}return null}function Wf(e,t,n){switch(t=kf(n),e){case"html":if(!(e=t.documentElement))throw Error(r(452));return e;case"head":if(!(e=t.head))throw Error(r(453));return e;case"body":if(!(e=t.body))throw Error(r(454));return e;default:throw Error(r(451))}}function qf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);et(e)}var Vf=new Map,Kf=new Set;function $f(e){return"function"==typeof e.getRootNode?e.getRootNode():9===e.nodeType?e:e.ownerDocument}var Qf=O.d;O.d={f:function(){var e=Qf.f(),t=oc();return e||t},r:function(e){var t=nt(e);null!==t&&5===t.tag&&"form"===t.type?ls(t):Qf.r(e)},D:function(e){Qf.D(e),Yf("dns-prefetch",e,null)},C:function(e,t){Qf.C(e,t),Yf("preconnect",e,t)},L:function(e,t,n){Qf.L(e,t,n);var r=Gf;if(r&&e&&t){var o='link[rel="preload"][as="'+kt(t)+'"]';"image"===t&&n&&n.imageSrcSet?(o+='[imagesrcset="'+kt(n.imageSrcSet)+'"]',"string"==typeof n.imageSizes&&(o+='[imagesizes="'+kt(n.imageSizes)+'"]')):o+='[href="'+kt(e)+'"]';var i=o;switch(t){case"style":i=Zf(e);break;case"script":i=tp(e)}Vf.has(i)||(e=c({rel:"preload",href:"image"===t&&n&&n.imageSrcSet?void 0:e,as:t},n),Vf.set(i,e),null!==r.querySelector(o)||"style"===t&&r.querySelector(Jf(i))||"script"===t&&r.querySelector(np(i))||(vf(t=r.createElement("link"),"link",e),it(t),r.head.appendChild(t)))}},m:function(e,t){Qf.m(e,t);var n=Gf;if(n&&e){var r=t&&"string"==typeof t.as?t.as:"script",o='link[rel="modulepreload"][as="'+kt(r)+'"][href="'+kt(e)+'"]',i=o;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=tp(e)}if(!Vf.has(i)&&(e=c({rel:"modulepreload",href:e},t),Vf.set(i,e),null===n.querySelector(o))){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(np(i)))return}vf(r=n.createElement("link"),"link",e),it(r),n.head.appendChild(r)}}},X:function(e,t){Qf.X(e,t);var n=Gf;if(n&&e){var r=ot(n).hoistableScripts,o=tp(e),i=r.get(o);i||((i=n.querySelector(np(o)))||(e=c({src:e,async:!0},t),(t=Vf.get(o))&&ap(e,t),it(i=n.createElement("script")),vf(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(o,i))}},S:function(e,t,n){Qf.S(e,t,n);var r=Gf;if(r&&e){var o=ot(r).hoistableStyles,i=Zf(e);t=t||"default";var a=o.get(i);if(!a){var s={loading:0,preload:null};if(a=r.querySelector(Jf(i)))s.loading=5;else{e=c({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Vf.get(i))&&ip(e,n);var l=a=r.createElement("link");it(l),vf(l,"link",e),l._p=new Promise(function(e,t){l.onload=e,l.onerror=t}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,op(a,t,r)}a={type:"stylesheet",instance:a,count:1,state:s},o.set(i,a)}}},M:function(e,t){Qf.M(e,t);var n=Gf;if(n&&e){var r=ot(n).hoistableScripts,o=tp(e),i=r.get(o);i||((i=n.querySelector(np(o)))||(e=c({src:e,async:!0,type:"module"},t),(t=Vf.get(o))&&ap(e,t),it(i=n.createElement("script")),vf(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(o,i))}}};var Gf="undefined"==typeof document?null:document;function Yf(e,t,n){var r=Gf;if(r&&"string"==typeof t&&t){var o=kt(t);o='link[rel="'+e+'"][href="'+o+'"]',"string"==typeof n&&(o+='[crossorigin="'+n+'"]'),Kf.has(o)||(Kf.add(o),e={rel:e,crossOrigin:n,href:t},null===r.querySelector(o)&&(vf(t=r.createElement("link"),"link",e),it(t),r.head.appendChild(t)))}}function Xf(e,t,n,o){var i,a,s,l,u=(u=V.current)?$f(u):null;if(!u)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return"string"==typeof n.precedence&&"string"==typeof n.href?(t=Zf(n.href),(o=(n=ot(u).hoistableStyles).get(t))||(o={type:"style",instance:null,count:0,state:null},n.set(t,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if("stylesheet"===n.rel&&"string"==typeof n.href&&"string"==typeof n.precedence){e=Zf(n.href);var c=ot(u).hoistableStyles,f=c.get(e);if(f||(u=u.ownerDocument||u,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,f),(c=u.querySelector(Jf(e)))&&!c._p&&(f.instance=c,f.state.loading=5),Vf.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Vf.set(e,n),c||(i=u,a=e,s=n,l=f.state,i.querySelector('link[rel="preload"][as="style"]['+a+"]")?l.loading=1:(a=i.createElement("link"),l.preload=a,a.addEventListener("load",function(){return l.loading|=1}),a.addEventListener("error",function(){return l.loading|=2}),vf(a,"link",s),it(a),i.head.appendChild(a))))),t&&null===o)throw Error(r(528,""));return f}if(t&&null!==o)throw Error(r(529,""));return null;case"script":return t=n.async,"string"==typeof(n=n.src)&&t&&"function"!=typeof t&&"symbol"!=typeof t?(t=tp(n),(o=(n=ot(u).hoistableScripts).get(t))||(o={type:"script",instance:null,count:0,state:null},n.set(t,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function Zf(e){return'href="'+kt(e)+'"'}function Jf(e){return'link[rel="stylesheet"]['+e+"]"}function ep(e){return c({},e,{"data-precedence":e.precedence,precedence:null})}function tp(e){return'[src="'+kt(e)+'"]'}function np(e){return"script[async]"+e}function rp(e,t,n){if(t.count++,null===t.instance)switch(t.type){case"style":var o=e.querySelector('style[data-href~="'+kt(n.href)+'"]');if(o)return t.instance=o,it(o),o;var i=c({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return it(o=(e.ownerDocument||e).createElement("style")),vf(o,"style",i),op(o,n.precedence,e),t.instance=o;case"stylesheet":i=Zf(n.href);var a=e.querySelector(Jf(i));if(a)return t.state.loading|=4,t.instance=a,it(a),a;o=ep(n),(i=Vf.get(i))&&ip(o,i),it(a=(e.ownerDocument||e).createElement("link"));var s=a;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),vf(a,"link",o),t.state.loading|=4,op(a,n.precedence,e),t.instance=a;case"script":return a=tp(n.src),(i=e.querySelector(np(a)))?(t.instance=i,it(i),i):(o=n,(i=Vf.get(a))&&ap(o=c({},n),i),it(i=(e=e.ownerDocument||e).createElement("script")),vf(i,"link",o),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(r(443,t.type))}else"stylesheet"===t.type&&!(4&t.state.loading)&&(o=t.instance,t.state.loading|=4,op(o,n.precedence,e));return t.instance}function op(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=r.length?r[r.length-1]:null,i=o,a=0;a<r.length;a++){var s=r[a];if(s.dataset.precedence===t)i=s;else if(i!==o)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=9===n.nodeType?n.head:n).insertBefore(e,t.firstChild)}function ip(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.title&&(e.title=t.title)}function ap(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.integrity&&(e.integrity=t.integrity)}var sp=null;function lp(e,t,n){if(null===sp){var r=new Map,o=sp=new Map;o.set(n,r)}else(r=(o=sp).get(n))||(r=new Map,o.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),o=0;o<n.length;o++){var i=n[o];if(!(i[Je]||i[Ke]||"link"===e&&"stylesheet"===i.getAttribute("rel"))&&"http://www.w3.org/2000/svg"!==i.namespaceURI){var a=i.getAttribute(t)||"";a=e+a;var s=r.get(a);s?s.push(i):r.set(a,[i])}}return r}function up(e,t,n){(e=e.ownerDocument||e).head.insertBefore(n,"title"===t?e.querySelector("head > title"):null)}function cp(e){return!!("stylesheet"!==e.type||3&e.state.loading)}var fp=0;function pp(){if(this.count--,0===this.count&&(0===this.imgCount||!this.waitingForImages))if(this.stylesheets)dp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var hp=null;function dp(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,hp=new Map,t.forEach(yp,e),hp=null,pp.call(e))}function yp(e,t){if(!(4&t.state.loading)){var n=hp.get(e);if(n)var r=n.get(null);else{n=new Map,hp.set(e,n);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<o.length;i++){var a=o[i];"LINK"!==a.nodeName&&"not all"===a.getAttribute("media")||(n.set(a.dataset.precedence,a),r=a)}r&&n.set(null,r)}a=(o=t.instance).getAttribute("data-precedence"),(i=n.get(a)||r)===r&&n.set(null,o),n.set(a,o),this.count++,r=pp.bind(this),o.addEventListener("load",r),o.addEventListener("error",r),i?i.parentNode.insertBefore(o,i.nextSibling):(e=9===e.nodeType?e.head:e).insertBefore(o,e.firstChild),t.state.loading|=4}}var gp={$$typeof:v,Provider:null,Consumer:null,_currentValue:R,_currentValue2:R,_threadCount:0};function mp(e,t,n,r,o,i,a,s,l){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Be(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Be(0),this.hiddenUpdates=Be(null),this.identifierPrefix=r,this.onUncaughtError=o,this.onCaughtError=i,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function vp(e,t,n,r,o,i,a,s,l,u,c,f){return e=new mp(e,t,n,a,l,u,c,f,s),t=1,!0===i&&(t|=24),i=Wr(3,null,null,t),e.current=i,i.stateNode=e,(t=Vo()).refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:r,isDehydrated:n,cache:t},ki(i),e}function bp(e){return e?e=Fr:Fr}function wp(e,t,n,r,o,i){o=bp(o),null===r.context?r.context=o:r.pendingContext=o,(r=Ei(t)).payload={element:n},null!==(i=void 0===i?null:i)&&(r.callback=i),null!==(n=_i(e,r,t))&&(Ju(n,0,t),Ci(n,e,t))}function Sp(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function kp(e,t){Sp(e,t),(e=e.alternate)&&Sp(e,t)}function xp(e){if(13===e.tag||31===e.tag){var t=Ur(e,67108864);null!==t&&Ju(t,0,67108864),kp(e,67108864)}}function Ep(e){if(13===e.tag||31===e.tag){var t=Xu(),n=Ur(e,t=Fe(t));null!==n&&Ju(n,0,t),kp(e,t)}}var _p=!0;function Cp(e,t,n,r){var o=j.T;j.T=null;var i=O.p;try{O.p=2,Tp(e,t,n,r)}finally{O.p=i,j.T=o}}function Ip(e,t,n,r){var o=j.T;j.T=null;var i=O.p;try{O.p=8,Tp(e,t,n,r)}finally{O.p=i,j.T=o}}function Tp(e,t,n,r){if(_p){var o=Ap(r);if(null===o)sf(e,t,r,Pp,n),Fp(e,r);else if(function(e,t,n,r,o){switch(t){case"focusin":return Mp=Hp(Mp,e,t,n,r,o),!0;case"dragenter":return Lp=Hp(Lp,e,t,n,r,o),!0;case"mouseover":return Bp=Hp(Bp,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Np.set(i,Hp(Np.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Up.set(i,Hp(Up.get(i)||null,e,t,n,r,o)),!0}return!1}(o,e,t,n,r))r.stopPropagation();else if(Fp(e,r),4&t&&-1<zp.indexOf(e)){for(;null!==o;){var i=nt(o);if(null!==i)switch(i.tag){case 3:if((i=i.stateNode).current.memoizedState.isDehydrated){var a=je(i.pendingLanes);if(0!==a){var s=i;for(s.pendingLanes|=2,s.entangledLanes|=2;a;){var l=1<<31-_e(a);s.entanglements[1]|=l,a&=~l}zc(i),!(6&vu)&&(Du=he()+500,Fc(0))}}break;case 31:case 13:null!==(s=Ur(i,2))&&Ju(s,0,2),oc(),kp(i,2)}if(null===(i=Ap(r))&&sf(e,t,r,Pp,n),i===o)break;o=i}null!==o&&r.stopPropagation()}else sf(e,t,r,null,n)}}function Ap(e){return jp(e=Dt(e))}var Pp=null;function jp(e){if(Pp=null,null!==(e=tt(e))){var t=i(e);if(null===t)e=null;else{var n=t.tag;if(13===n){if(null!==(e=a(t)))return e;e=null}else if(31===n){if(null!==(e=s(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Pp=e,null}function Op(e){switch(e){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(de()){case ye:return 2;case ge:return 8;case me:case ve:return 32;case be:return 268435456;default:return 32}default:return 32}}var Rp=!1,Mp=null,Lp=null,Bp=null,Np=new Map,Up=new Map,Dp=[],zp="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".split(" ");function Fp(e,t){switch(e){case"focusin":case"focusout":Mp=null;break;case"dragenter":case"dragleave":Lp=null;break;case"mouseover":case"mouseout":Bp=null;break;case"pointerover":case"pointerout":Np.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Up.delete(t.pointerId)}}function Hp(e,t,n,r,o,i){return null===e||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},null!==t&&(null!==(t=nt(t))&&xp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==o&&-1===t.indexOf(o)&&t.push(o),e)}function Wp(e){var t=tt(e.target);if(null!==t){var n=i(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=a(n)))return e.blockedOn=t,void qe(e.priority,function(){Ep(n)})}else if(31===t){if(null!==(t=s(n)))return e.blockedOn=t,void qe(e.priority,function(){Ep(n)})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function qp(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ap(e.nativeEvent);if(null!==n)return null!==(t=nt(n))&&xp(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);Ut=r,n.target.dispatchEvent(r),Ut=null,t.shift()}return!0}function Vp(e,t,n){qp(e)&&n.delete(t)}function Kp(){Rp=!1,null!==Mp&&qp(Mp)&&(Mp=null),null!==Lp&&qp(Lp)&&(Lp=null),null!==Bp&&qp(Bp)&&(Bp=null),Np.forEach(Vp),Up.forEach(Vp)}function $p(t,n){t.blockedOn===n&&(t.blockedOn=null,Rp||(Rp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Kp)))}var Qp=null;function Gp(t){Qp!==t&&(Qp=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Qp===t&&(Qp=null);for(var e=0;e<t.length;e+=3){var n=t[e],r=t[e+1],o=t[e+2];if("function"!=typeof r){if(null===jp(r||n))continue;break}var i=nt(n);null!==i&&(t.splice(e,3),e-=3,as(i,{pending:!0,data:o,method:n.method,action:r},r,o))}}))}function Yp(e){function t(t){return $p(t,e)}null!==Mp&&$p(Mp,e),null!==Lp&&$p(Lp,e),null!==Bp&&$p(Bp,e),Np.forEach(t),Up.forEach(t);for(var n=0;n<Dp.length;n++){var r=Dp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Dp.length&&null===(n=Dp[0]).blockedOn;)Wp(n),null===n.blockedOn&&Dp.shift();if(null!=(n=(e.ownerDocument||e).$$reactFormReplay))for(r=0;r<n.length;r+=3){var o=n[r],i=n[r+1],a=o[$e]||null;if("function"==typeof i)a||Gp(n);else if(a){var s=null;if(i&&i.hasAttribute("formAction")){if(o=i,a=i[$e]||null)s=a.formAction;else if(null!==jp(o))continue}else s=a.action;"function"==typeof s?n[r+1]=s:(n.splice(r,3),r-=3),Gp(n)}}}function Xp(){function e(e){e.canIntercept&&"react-transition"===e.info&&e.intercept({handler:function(){return new Promise(function(e){return o=e})},focusReset:"manual",scroll:"manual"})}function t(){null!==o&&(o(),o=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&null!=e.url&&navigation.navigate(e.url,{state:e.getState(),info:"react-transition",history:"replace"})}}if("object"==typeof navigation){var r=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),null!==o&&(o(),o=null)}}}function Zp(e){this._internalRoot=e}function Jp(e){this._internalRoot=e}Jp.prototype.render=Zp.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(r(409));wp(t.current,Xu(),e,t,null,null)},Jp.prototype.unmount=Zp.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;wp(e.current,2,null,e,null,null),oc(),t[Qe]=null}},Jp.prototype.unstable_scheduleHydration=function(e){if(e){var t=We();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Dp.length&&0!==t&&t<Dp[n].priority;n++);Dp.splice(n,0,e),0===n&&Wp(e)}};var eh=t.version;if("19.2.3"!==eh)throw Error(r(527,eh,"19.2.3"));O.findDOMNode=function(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(r(188));throw e=Object.keys(e).join(","),Error(r(268,e))}return e=function(e){var t=e.alternate;if(!t){if(null===(t=i(e)))throw Error(r(188));return t!==e?null:e}for(var n=e,o=t;;){var a=n.return;if(null===a)break;var s=a.alternate;if(null===s){if(null!==(o=a.return)){n=o;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===o)return l(a),t;s=s.sibling}throw Error(r(188))}if(n.return!==o.return)n=a,o=s;else{for(var u=!1,c=a.child;c;){if(c===n){u=!0,n=a,o=s;break}if(c===o){u=!0,o=a,n=s;break}c=c.sibling}if(!u){for(c=s.child;c;){if(c===n){u=!0,n=s,o=a;break}if(c===o){u=!0,o=s,n=a;break}c=c.sibling}if(!u)throw Error(r(189))}}if(n.alternate!==o)throw Error(r(190))}if(3!==n.tag)throw Error(r(188));return n.stateNode.current===n?e:t}(t),e=null===(e=null!==e?u(e):null)?null:e.stateNode};var th={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.3"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var nh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nh.isDisabled&&nh.supportsFiber)try{ke=nh.inject(th),xe=nh}catch(oh){}}return Q.createRoot=function(e,t){if(!o(e))throw Error(r(299));var n=!1,i="",a=As,s=Ps,l=js;return null!=t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(i=t.identifierPrefix),void 0!==t.onUncaughtError&&(a=t.onUncaughtError),void 0!==t.onCaughtError&&(s=t.onCaughtError),void 0!==t.onRecoverableError&&(l=t.onRecoverableError)),t=vp(e,1,!1,null,0,n,i,null,a,s,l,Xp),e[Qe]=t.current,of(e),new Zp(t)},Q.hydrateRoot=function(e,t,n){if(!o(e))throw Error(r(299));var i=!1,a="",s=As,l=Ps,u=js,c=null;return null!=n&&(!0===n.unstable_strictMode&&(i=!0),void 0!==n.identifierPrefix&&(a=n.identifierPrefix),void 0!==n.onUncaughtError&&(s=n.onUncaughtError),void 0!==n.onCaughtError&&(l=n.onCaughtError),void 0!==n.onRecoverableError&&(u=n.onRecoverableError),void 0!==n.formState&&(c=n.formState)),(t=vp(e,1,!0,t,0,i,a,c,s,l,u,Xp)).context=bp(null),n=t.current,(a=Ei(i=Fe(i=Xu()))).callback=null,_i(n,a,i),n=i,t.current.lanes=n,Ne(t,n),zc(t),e[Qe]=t.current,of(e),new Jp(t)},Q.version="19.2.3",Q}const ae=v((te||(te=1,function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),$.exports=ie()),$.exports));var se="lightman_device_id",le="lightman_api_key";function ue(e){var t=function(){if("undefined"==typeof window)return"";var e=window.location.pathname,t="/display/";if(0===e.indexOf(t)){var n=e.substring(9);return"/"===n.charAt(n.length-1)&&(n=n.substring(0,n.length-1)),n}return""}();return t?e+"__"+t:e}function ce(){var e="undefined"!=typeof window?window.location.origin:"http://localhost:3001",t=e.replace(/^http/,"ws");return{apiUrl:e+"/api",wsUrl:t+"/ws",mqttUrl:t.replace(/:\d+$/,"")+":1884",deviceId:he()||"",deviceApiKey:de()||"",idleTimeout:3e5,heartbeatInterval:3e4,reconnectMaxDelay:3e4}}var fe=null;function pe(){return fe||(fe=ce()),fe}function he(){try{return localStorage.getItem(ue(se))}catch(e){return null}}function de(){try{return localStorage.getItem(ue(le))}catch(e){return null}}function ye(e,t){try{localStorage.setItem(ue(se),e),localStorage.setItem(ue(le),t),fe=null}catch(n){console.error("[Config] Failed to store credentials:",n)}}class ge extends Error{constructor(e,t,n){super(e),c(this,"status"),c(this,"endpoint"),this.name="ApiError",this.status=t,this.endpoint=n}}function me(){return{"Content-Type":"application/json",Authorization:"Bearer "+pe().deviceApiKey}}function ve(){return pe().apiUrl}function be(e){return new Promise(function(t){setTimeout(t,e)})}function we(e,t,n){return new Promise(function(r,o){var i=!1,a=setTimeout(function(){i||(i=!0,o(new ge("Request timed out after "+n+"ms",0,e)))},n);fetch(e,t).then(function(e){i||(i=!0,clearTimeout(a),r(e))},function(e){i||(i=!0,clearTimeout(a),o(e))})})}function Se(e,t){return f(this,arguments,function*(e,t,n=3,r=1e4){for(var o=new Error("Request failed"),i=0;i<n;i++){try{var a=yield we(e,t,r);if(a.ok){var s;try{s=yield a.json()}catch(p){throw new ge("Failed to parse JSON response",a.status,e)}var l=s;if(l&&"object"==typeof l&&"success"in l&&"data"in l){if(!l.success)throw new ge(l.error||"API returned unsuccessful response",a.status,e);return l.data}return s}var u="";try{u=yield a.text()}catch(h){}var c=new ge("API request failed: "+a.status+" "+(u||a.statusText),a.status,e);if(a.status>=400&&a.status<500&&408!==a.status&&429!==a.status)throw c;o=c}catch(d){if(d instanceof ge&&d.status>=400&&d.status<500&&408!==d.status&&429!==d.status)throw d;if(d instanceof ge&&"Failed to parse JSON response"===d.message)throw d;if(d instanceof ge&&d.status>=200&&d.status<300)throw d;o=d instanceof Error?d:new Error(String(d))}if(i<n-1){var f=1e3*Math.pow(2,i);yield be(f)}}throw o})}const ke=new class{constructor(){c(this,"buffer",[]),c(this,"options",null),c(this,"flushTimer",null),c(this,"isFlushing",!1),c(this,"onWindowError",e=>{this.error("Unhandled error: "+e.message,{filename:e.filename,lineno:e.lineno,colno:e.colno})}),c(this,"onUnhandledRejection",e=>{var t=e.reason,n="Unhandled promise rejection";t instanceof Error?n=n+": "+t.message:"string"==typeof t&&(n=n+": "+t),this.error(n)})}init(e){this.options=e,this.startFlushTimer(),this.setupGlobalHandlers()}destroy(){this.stopFlushTimer(),this.removeGlobalHandlers(),this.flush()}error(e,t){this.log("error",e,t)}warn(e,t){this.log("warn",e,t)}info(e,t){this.log("info",e,t)}debug(e,t){this.log("debug",e,t)}log(e,t,n){var r={level:e,message:t,context:u(l({},n),{deviceId:this.options?this.options.deviceId:"unknown",templateType:this.options?this.options.templateType:void 0,instanceId:this.options?this.options.instanceId:void 0}),timestamp:Date.now()};"error"===e&&("error"===e?console.error:"warn"===e?console.warn:"debug"===e?console.debug:console.log)("[LIGHTMAN "+e.toUpperCase()+"]",t,n||"");this.buffer.push(r);var o=this.options&&this.options.maxBufferSize||50;this.buffer.length>=o&&this.flush()}flush(){return f(this,null,function*(){if(!this.isFlushing&&0!==this.buffer.length&&this.options){this.isFlushing=!0;var e=this.buffer.splice(0,this.buffer.length);try{var t=pe();(yield fetch(t.apiUrl+"/devices/"+this.options.deviceId+"/logs",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+t.deviceApiKey},body:JSON.stringify({entries:e})})).ok||(this.buffer=e.concat(this.buffer))}catch(n){this.buffer=e.concat(this.buffer),this.buffer.length>200&&(this.buffer=this.buffer.slice(-200))}finally{this.isFlushing=!1}}})}startFlushTimer(){var e=this.options&&this.options.flushInterval||1e4;this.flushTimer=setInterval(()=>{this.flush()},e)}stopFlushTimer(){this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null)}setupGlobalHandlers(){"undefined"!=typeof window&&(window.addEventListener("error",this.onWindowError),window.addEventListener("unhandledrejection",this.onUnhandledRejection))}removeGlobalHandlers(){"undefined"!=typeof window&&(window.removeEventListener("error",this.onWindowError),window.removeEventListener("unhandledrejection",this.onUnhandledRejection))}};const xe=new class{constructor(){c(this,"ws",null),c(this,"listeners",new Map),c(this,"state","disconnected"),c(this,"stateListeners",new Set),c(this,"reconnectAttempts",0),c(this,"reconnectTimer",null),c(this,"heartbeatTimer",null),c(this,"messageQueue",[]),c(this,"deviceId",""),c(this,"instanceId",""),c(this,"templateType","")}connect(e,t,n){this.deviceId=e,this.instanceId=t,this.templateType=n,this.doConnect()}doConnect(){if(this.ws){try{this.ws.onopen=null,this.ws.onmessage=null,this.ws.onclose=null,this.ws.onerror=null,this.ws.close()}catch(i){}this.ws=null}var e=this.reconnectAttempts>0?"reconnecting":"connecting";this.setState(e);var t,n=pe(),r=n.wsUrl+"?apiKey="+encodeURIComponent(n.deviceApiKey);try{t=new WebSocket(r)}catch(a){return console.error("[WS] Failed to create WebSocket:",a),void this.scheduleReconnect()}this.ws=t;var o=this;t.onopen=function(){console.info("[WS] Connected to",r),o.setState("connected"),o.reconnectAttempts=0,o.register(),o.startHeartbeat(),o.flushQueue()},t.onmessage=function(e){try{var t=JSON.parse(e.data);o.dispatch(t)}catch(a){console.error("[WS] Failed to parse message:",a)}},t.onclose=function(e){console.info("[WS] Connection closed. Code:",e.code,"Reason:",e.reason),o.stopHeartbeat(),o.ws=null,"disconnected"!==o.state&&o.scheduleReconnect()},t.onerror=function(e){console.error("[WS] WebSocket error:",e)}}disconnect(){if(this.setState("disconnected"),null!==this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.stopHeartbeat(),this.ws){try{this.ws.onopen=null,this.ws.onmessage=null,this.ws.onclose=null,this.ws.onerror=null,this.ws.close()}catch(e){}this.ws=null}this.reconnectAttempts=0}on(e,t){var n=this.listeners.get(e);n||(n=new Set,this.listeners.set(e,n)),n.add(t)}off(e,t){var n=this.listeners.get(e);n&&(n.delete(t),0===n.size&&this.listeners.delete(e))}onStateChange(e){this.stateListeners.add(e)}offStateChange(e){this.stateListeners.delete(e)}send(e,t){var n=JSON.stringify({type:e,payload:t,timestamp:Date.now()});this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(n):(this.messageQueue.push(n),this.messageQueue.length>100&&this.messageQueue.shift())}getState(){return this.state}setState(e){this.state=e,this.stateListeners.forEach(function(t){t(e)})}dispatch(e){var t=this.listeners.get(e.type);t&&t.forEach(function(t){try{t(e)}catch(n){console.error("[WS] Error in event listener for",e.type,":",n)}});var n=this.listeners.get("*");n&&n.forEach(function(t){try{t(e)}catch(n){console.error("[WS] Error in wildcard listener:",n)}})}scheduleReconnect(){var e=this;if("disconnected"!==this.state){this.setState("reconnecting");var t=pe().reconnectMaxDelay,n=Math.min(1e3*Math.pow(2,this.reconnectAttempts),t);console.info("[WS] Reconnecting in",n,"ms (attempt",this.reconnectAttempts+1,")"),this.reconnectAttempts=this.reconnectAttempts+1,this.reconnectTimer=setTimeout(function(){e.reconnectTimer=null,e.doConnect()},n)}}startHeartbeat(){this.stopHeartbeat();var e=this,t=pe().heartbeatInterval;this.heartbeatTimer=setInterval(function(){e.send("heartbeat",{status:"connected"})},t)}stopHeartbeat(){null!==this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}flushQueue(){for(;this.messageQueue.length>0;){var e=this.messageQueue.shift();e&&this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(e)}}register(){this.send("register",{deviceId:this.deviceId,instanceId:this.instanceId,templateType:this.templateType})}};var Ee="[Watchdog]";function _e(){try{var e=performance;if(e&&e.memory&&"number"==typeof e.memory.usedJSHeapSize)return Math.round(e.memory.usedJSHeapSize/1048576)}catch(t){}return 0}var Ce,Ie,Te={exports:{}},Ae={};var Pe=(Ie||(Ie=1,Te.exports=function(){if(Ce)return Ae;Ce=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(t,n,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==n.key&&(o=""+n.key),"key"in n)for(var i in r={},n)"key"!==i&&(r[i]=n[i]);else r=n;return n=r.ref,{$$typeof:e,type:t,key:o,ref:void 0!==n?n:null,props:r}}return Ae.Fragment=t,Ae.jsx=n,Ae.jsxs=n,Ae}()),Te.exports);function je(e){var t=e.message,n=["@keyframes lm-spin {"," 0% { transform: rotate(0deg); }"," 100% { transform: rotate(360deg); }","}","@keyframes lm-pulse {"," 0%, 100% { opacity: 0.3; }"," 50% { opacity: 0.8; }","}"].join("\n");return Pe.jsxs("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:"#0a0a0a",color:"#e0e0e0",fontFamily:"'DM Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif",zIndex:9999,overflow:"hidden"},children:[Pe.jsx("style",{dangerouslySetInnerHTML:{__html:n}}),Pe.jsx("div",{style:{fontSize:"14px",fontWeight:600,letterSpacing:"6px",textTransform:"uppercase",color:"#555",marginBottom:"48px"},children:"LIGHTMAN"}),Pe.jsxs("div",{style:{position:"relative",width:"48px",height:"48px",marginBottom:"32px"},children:[Pe.jsx("div",{style:{width:"48px",height:"48px",border:"2px solid #1a1a1a",borderTopColor:"#888",borderRadius:"50%",animation:"lm-spin 1s linear infinite",boxSizing:"border-box"}}),Pe.jsx("div",{style:{position:"absolute",top:"50%",left:"50%",width:"6px",height:"6px",marginTop:"-3px",marginLeft:"-3px",borderRadius:"50%",backgroundColor:"#888",animation:"lm-pulse 1.5s ease-in-out infinite"}})]}),t?Pe.jsx("div",{style:{fontSize:"13px",color:"#666",letterSpacing:"0.5px",textAlign:"center",maxWidth:"300px",lineHeight:"1.5"},children:t}):null]})}function Oe(e){var t=e.message,n=e.retryIn,r=e.onRetry,o=W.useState(n||0),i=o[0],a=o[1],s=W.useRef(null);W.useEffect(function(){if(n&&!(n<=0))return a(n),s.current=setInterval(function(){a(function(e){return e<=1?(null!==s.current&&(clearInterval(s.current),s.current=null),r&&setTimeout(r,0),0):e-1})},1e3),function(){null!==s.current&&(clearInterval(s.current),s.current=null)}},[n,r]);var l=["@keyframes lm-error-fade-in {"," 0% { opacity: 0; transform: translateY(8px); }"," 100% { opacity: 1; transform: translateY(0); }","}"].join("\n");return Pe.jsxs("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:"#0a0a0a",color:"#e0e0e0",fontFamily:"'DM Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif",zIndex:9999,overflow:"hidden"},children:[Pe.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),Pe.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",animation:"lm-error-fade-in 0.4s ease-out"},children:[Pe.jsx("div",{style:{fontSize:"14px",fontWeight:600,letterSpacing:"6px",textTransform:"uppercase",color:"#555",marginBottom:"48px"},children:"LIGHTMAN"}),Pe.jsx("div",{style:{width:"56px",height:"56px",borderRadius:"50%",border:"2px solid #331a1a",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"28px"},children:Pe.jsx("span",{style:{fontSize:"24px",color:"#cc4444",fontWeight:300,lineHeight:1},children:"!"})}),Pe.jsx("div",{style:{fontSize:"14px",color:"#999",letterSpacing:"0.3px",textAlign:"center",maxWidth:"400px",lineHeight:"1.6",marginBottom:"32px",padding:"0 24px"},children:t}),n&&n>0&&i>0?Pe.jsx("div",{style:{fontSize:"12px",color:"#555",letterSpacing:"0.5px",marginBottom:"20px"},children:"Retrying in "+i+"s"}):null,r?Pe.jsx("button",{style:{background:"none",border:"1px solid #333",color:"#999",fontSize:"12px",letterSpacing:"2px",textTransform:"uppercase",padding:"10px 28px",cursor:"pointer",transition:"border-color 0.2s, color 0.2s",fontFamily:"inherit"},onClick:r,onMouseOver:function(e){var t=e.currentTarget;t.style.borderColor="#666",t.style.color="#ccc"},onMouseOut:function(e){var t=e.currentTarget;t.style.borderColor="#333",t.style.color="#999"},children:"Retry Now"}):null]})]})}var Re=W.createContext(null);function Me(){var e=W.useContext(Re);if(!e)throw new Error("useAppShell must be used within AppShell");return e}class Le extends q.Component{constructor(e){super(e),c(this,"retryTimer"),c(this,"countdownTimer"),c(this,"scheduleRetry",()=>{null!==this.retryTimer&&clearTimeout(this.retryTimer),null!==this.countdownTimer&&clearInterval(this.countdownTimer),this.setState({countdown:10});var e=this;this.countdownTimer=setInterval(function(){e.setState(function(t){var n=t.countdown-1;return n<=0?(null!==e.countdownTimer&&(clearInterval(e.countdownTimer),e.countdownTimer=null),{countdown:0}):{countdown:n}})},1e3),this.retryTimer=setTimeout(function(){e.retryTimer=null,null!==e.countdownTimer&&(clearInterval(e.countdownTimer),e.countdownTimer=null),e.handleRetry()},1e4)}),c(this,"handleRetry",()=>{this.setState(function(e){return{hasError:!1,error:null,retryCount:e.retryCount+1,countdown:0}})}),this.state={hasError:!1,error:null,retryCount:0,errorCount:0,lastErrorTime:0,countdown:0},this.retryTimer=null,this.countdownTimer=null}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error("[ErrorBoundary] Caught error:",e,t),this.props.onError&&this.props.onError(e);var n=Date.now(),r=n-this.state.lastErrorTime,o=this.state.errorCount;r<6e4?o+=1:o=1;var i=this;this.setState({errorCount:o,lastErrorTime:n},function(){if(o>=3){console.warn("[ErrorBoundary] Rapid errors detected ("+o+" in 60000ms), reloading page");try{window.location.reload()}catch(e){}}else i.state.retryCount<3&&i.scheduleRetry()})}componentWillUnmount(){null!==this.retryTimer&&(clearTimeout(this.retryTimer),this.retryTimer=null),null!==this.countdownTimer&&(clearInterval(this.countdownTimer),this.countdownTimer=null)}render(){if(this.state.hasError){var e=this.state.error?this.state.error.message:"An unexpected error occurred",t=this.state.retryCount>=3,n="";try{n=pe().deviceId}catch(i){n="unknown"}var r=[];r.push(e),n&&r.push("Device: "+n),r.push("Retry "+(this.state.retryCount+1)+"/3");var o=r.join("\n");return t?q.createElement(Oe,{message:"A persistent error has occurred. Please contact support.\n\n"+e+"\n\nDevice: "+n,onRetry:this.handleRetry}):q.createElement(Oe,{message:o,retryIn:this.state.countdown>0?this.state.countdown:10,onRetry:this.handleRetry})}return this.props.children}}function Be(e){var t=e.children,n=pe(),r=W.useState(null),o=r[0],i=r[1],a=W.useState(""),s=a[0],l=a[1],u=W.useState(""),c=u[0],p=u[1],h=W.useState(!0),d=h[0],y=h[1],g=W.useState(null),m=g[0],v=g[1],b=W.useState(!1),w=b[0],S=b[1],k=W.useRef(!0),x=W.useRef(0),E=W.useRef(null);!function(e={}){const{enabled:t=!0,preventKeyboard:n=!0,keepAwake:r=!0}=e,o=W.useCallback(()=>{const e=document.documentElement;e.requestFullscreen?e.requestFullscreen().catch(()=>{}):e.webkitRequestFullscreen&&e.webkitRequestFullscreen()},[]);W.useEffect(()=>{if(!t)return;o();const e=e=>{},i=()=>{window.history.pushState(null,"",window.location.href)},a=e=>{n&&(-1===["F5","F11","F12"].indexOf(e.key)?(e.ctrlKey&&-1!==["r","w","l","n","t"].indexOf(e.key.toLowerCase())||e.altKey&&"F4"===e.key)&&e.preventDefault():e.preventDefault())},s=e=>{e.preventDefault()};let l=0;const u=e=>{const t=Date.now();t-l<=300&&e.preventDefault(),l=t};window.history.pushState(null,"",window.location.href),document.addEventListener("contextmenu",e),window.addEventListener("popstate",i),document.addEventListener("keydown",a),document.addEventListener("dragstart",s),document.addEventListener("touchend",u,{passive:!1});let c=null;r&&"wakeLock"in navigator&&navigator.wakeLock.request("screen").then(e=>{c=e}).catch(()=>{});const f=()=>{"visible"===document.visibilityState&&r&&"wakeLock"in navigator&&(c&&(c.release().catch(()=>{}),c=null),navigator.wakeLock.request("screen").then(e=>{c=e}).catch(()=>{}))};return document.addEventListener("visibilitychange",f),()=>{document.removeEventListener("contextmenu",e),window.removeEventListener("popstate",i),document.removeEventListener("keydown",a),document.removeEventListener("dragstart",s),document.removeEventListener("touchend",u),document.removeEventListener("visibilitychange",f),c&&c.release().catch(()=>{})}},[t,n,r,o])}({enabled:!0});var _,C=(_={deviceId:n.deviceId,templateType:s||"unknown"},W.useEffect(function(){return ke.init({deviceId:_.deviceId,templateType:_.templateType,instanceId:_.instanceId}),ke.info("App initialized",{templateType:_.templateType,instanceId:_.instanceId}),function(){ke.info("App unmounting"),ke.destroy()}},[_.deviceId,_.templateType,_.instanceId]),ke),I=function(e){var t=void 0===e.enabled||e.enabled,n=e.deviceId,r=e.instanceId,o=e.templateType,i=W.useState("disconnected"),a=i[0],s=i[1];return W.useEffect(function(){if(t){xe.connect(n,r,o);var e=function(e){s(e)};return xe.onStateChange(e),function(){xe.offStateChange(e),xe.disconnect()}}},[n,r,o,t]),{connectionState:a,isConnected:"connected"===a,send:W.useCallback(function(e,t){xe.send(e,t)},[]),onEvent:W.useCallback(function(e,t){xe.on(e,t)},[]),offEvent:W.useCallback(function(e,t){xe.off(e,t)},[])}}({deviceId:n.deviceId,instanceId:c||"pending",templateType:s||"unknown",enabled:Boolean(n.deviceId)});!function(e){var t=e||{},n=void 0===t.enabled||t.enabled,r=void 0!==t.maxConsoleErrors?t.maxConsoleErrors:50,o=void 0!==t.memoryLimitMB?t.memoryLimitMB:180,i=void 0!==t.healthCheckIntervalMs?t.healthCheckIntervalMs:3e4,a=void 0===t.autoReloadOnCrash||t.autoReloadOnCrash,s=W.useState(0),l=s[0],u=s[1],c=W.useState(function(){return _e()}),f=c[0],p=c[1],h=W.useState(!0),d=h[0],y=h[1],g=W.useRef(0),m=W.useRef(!0),v=W.useCallback(function(e){if(a){console.warn(Ee,"Reloading page:",e);try{window.location.reload()}catch(t){}}else console.warn(Ee,"Auto-reload disabled. Would reload due to:",e)},[a]);W.useEffect(function(){if(n){m.current=!0,console.info(Ee,"Started monitoring (maxErrors="+r+", memoryLimitMB="+o+")"),window.addEventListener("error",t),window.addEventListener("unhandledrejection",a);var e=setInterval(function(){if(m.current){var e=_e();p(e);var t=g.current<r;e>0&&e>=o&&(t=!1),y(t),e>0?console.info(Ee,"Health check: memory="+e+"MB, errors="+g.current+", healthy="+t):console.info(Ee,"Health check: errors="+g.current+", healthy="+t),e>0&&e>=o&&v("Memory limit exceeded ("+e+"MB / "+o+"MB)")}},i);return function(){m.current=!1,window.removeEventListener("error",t),window.removeEventListener("unhandledrejection",a),clearInterval(e),console.info(Ee,"Stopped monitoring")}}function t(e){g.current=g.current+1;var t=g.current;console.warn(Ee,"Error captured ("+t+"/"+r+")"),m.current&&u(t),t>=r&&v("Error count exceeded threshold ("+t+"/"+r+")")}function a(e){g.current=g.current+1;var t=g.current;console.warn(Ee,"Unhandled rejection captured ("+t+"/"+r+")"),m.current&&u(t),t>=r&&v("Error count exceeded threshold after unhandled rejection ("+t+"/"+r+")")}},[n,r,o,i,v])}({enabled:!0});var T=W.useCallback(function(){if(!n.deviceId)return v("No device credentials found"),void y(!1);y(!0),v(null),function(e){return f(this,null,function*(){return Se(ve()+"/devices/"+encodeURIComponent(e)+"/config",{method:"GET",headers:me()})})}(n.deviceId).then(function(e){if(k.current){var t=e.assignedApp;if(!t)return v("No app assigned to this device"),y(!1),void C.warn("No app assigned to device",{deviceId:n.deviceId});var r=t.config;try{var o=new URLSearchParams(window.location.search).get("screenIndex");null!==o&&(r=Object.assign({},r,{screenIndex:parseInt(o,10)}))}catch(a){}i(r),l(t.templateType),p(t.instanceId),y(!1),v(null),x.current=0,C.info("Config loaded successfully",{instanceId:t.instanceId,templateType:t.templateType})}},function(e){if(k.current){var t=e instanceof Error?e.message:String(e);C.error("Failed to fetch config",{error:t}),x.current<3?(x.current=x.current+1,C.info("Retrying config fetch",{attempt:x.current,maxRetries:3}),E.current=setTimeout(function(){E.current=null,k.current&&T()},5e3)):(v("Failed to load configuration: "+t),y(!1))}})},[n.deviceId]);if(W.useEffect(function(){return k.current=!0,T(),function(){k.current=!1,null!==E.current&&(clearTimeout(E.current),E.current=null)}},[T]),W.useEffect(function(){function e(){C.info("Received reload command"),window.location.reload()}function t(){C.info("Received navigate command, re-fetching config"),x.current=0,T()}function n(){C.info("Received restart command"),x.current=0,i(null),l(""),p(""),y(!0),v(null),S(!1),T()}function r(){C.info("Received idle command"),S(!0)}function o(){C.info("Received activate command"),S(!1)}function a(e){var t=e.payload;t&&t.config&&(C.info("Received config update",{templateType:t.config.templateType}),i(t.config),l(t.config.templateType),t.config.instanceId&&p(t.config.instanceId))}return I.onEvent("command:reload",e),I.onEvent("command:navigate",t),I.onEvent("command:restart",n),I.onEvent("command:idle",r),I.onEvent("command:activate",o),I.onEvent("config:updated",a),function(){I.offEvent("command:reload",e),I.offEvent("command:navigate",t),I.offEvent("command:restart",n),I.offEvent("command:idle",r),I.offEvent("command:activate",o),I.offEvent("config:updated",a)}},[T]),d)return q.createElement(je,{message:"Loading configuration..."});if(m)return q.createElement(Oe,{message:m,retryIn:10,onRetry:function(){x.current=0,T()}});if(!o||!s||!c)return q.createElement(je,{message:"Waiting for app assignment..."});var A={instanceId:c,templateType:s,config:o,isIdle:w,connectionState:I.connectionState,send:I.send};return q.createElement(Re.Provider,{value:A},q.createElement("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",overflow:"hidden",backgroundColor:"#000"},"data-appshell":"true","data-idle":w?"true":"false"},t(o,s,c)))}function Ne(e){return q.createElement(Le,null,q.createElement(Be,e))}var Ue=3e3,De=window.location.origin+"/api";function ze(e){var t=e.slug,n=e.onProvisioned,r=W.useState("checking"),o=r[0],i=r[1],a=W.useState(""),s=a[0],l=a[1],u=W.useState(""),c=u[0],f=u[1],p=W.useRef(!0),h=W.useRef(null);W.useEffect(function(){return p.current=!0,function(){p.current=!1,null!==h.current&&(clearTimeout(h.current),h.current=null)}},[]);var d=W.useCallback(function(){i("checking"),fetch(De+"/devices/provision/"+encodeURIComponent(t)).then(function(e){return e.json()}).then(function(e){if(p.current){if("deviceId"in e&&"apiKey"in e){var r=e;return ye(r.deviceId,r.apiKey),void n()}var o=e;o.requiresPairing&&o.code?(l(o.code),i("pairing"),y(o.code)):(f("Device not found: "+t),i("error"))}}).catch(function(e){p.current&&(f(e instanceof Error?e.message:String(e)),i("error"))})},[t,n]),y=W.useCallback(function(e){h.current=setTimeout(function r(){p.current&&fetch(De+"/devices/provision/"+encodeURIComponent(t)+"/status?code="+encodeURIComponent(e)).then(function(e){return e.json()}).then(function(e){if(p.current){if("deviceId"in e&&"apiKey"in e){var t=e;return ye(t.deviceId,t.apiKey),void n()}h.current=setTimeout(r,Ue)}}).catch(function(){p.current&&(h.current=setTimeout(r,Ue))})},Ue)},[t,n]);W.useEffect(function(){d()},[d]);var g={position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"#0a0a0a",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",fontFamily:"system-ui, -apple-system, sans-serif",color:"#fff"},m={fontSize:"32px",fontWeight:700,letterSpacing:"6px",textTransform:"uppercase",marginBottom:"48px",opacity:.9},v={width:"64px",height:"80px",backgroundColor:"rgba(255, 255, 255, 0.1)",borderRadius:"12px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"36px",fontWeight:700,fontFamily:"monospace",border:"1px solid rgba(255, 255, 255, 0.2)"},b={fontSize:"16px",opacity:.6,marginTop:"8px"},w={fontSize:"14px",opacity:.4,marginTop:"24px",fontFamily:"monospace"};if("checking"===o)return q.createElement("div",{style:g},q.createElement("div",{style:m},"LIGHTMAN"),q.createElement("div",{style:b},"Connecting to server..."),q.createElement("div",{style:w},t));if("error"===o)return q.createElement("div",{style:g},q.createElement("div",{style:m},"LIGHTMAN"),q.createElement("div",{style:{color:"#ef4444",fontSize:"16px",marginBottom:"24px",textAlign:"center",maxWidth:"400px"}},c),q.createElement("button",{style:{padding:"12px 32px",backgroundColor:"rgba(255, 255, 255, 0.1)",border:"1px solid rgba(255, 255, 255, 0.2)",borderRadius:"8px",color:"#fff",fontSize:"14px",cursor:"pointer"},onClick:d},"Retry"),q.createElement("div",{style:w},t));var S=s.split("").map(function(e,t){return q.createElement("div",{key:t,style:v},e)});return q.createElement("div",{style:g},q.createElement("div",{style:m},"LIGHTMAN"),q.createElement("div",{style:{fontSize:"18px",marginBottom:"24px",opacity:.8}},"Enter this code in the admin panel"),q.createElement("div",{style:{display:"flex",gap:"12px",marginBottom:"32px"}},S),q.createElement("div",{style:b},"Waiting for admin to pair this device..."),q.createElement("div",{style:w},t))}function Fe(e){return 1e3*Math.pow(2,e)}function He({src:e,muted:t=!1,volume:n=100,fit:r="cover",backgroundColor:o="#000",loop:i=!0,autoPlay:a=!0,onError:s,onEnded:c,className:f}){const p=W.useRef(null),h=W.useRef(null),[d,y]=W.useState("a"),[,g]=W.useState(!1),[m,v]=W.useState(1),[b,w]=W.useState(0),S=W.useRef(e),k=W.useRef(0),x=W.useRef(null),E=W.useRef(!1),_=W.useRef(!0),C=W.useCallback(()=>"a"===d?p.current:h.current,[d]),I=W.useCallback(()=>"a"===d?h.current:p.current,[d]),T=W.useCallback(()=>{null!==x.current&&(clearTimeout(x.current),x.current=null)},[]),A=W.useCallback(e=>{e.muted=t,t||(e.volume=Math.max(0,Math.min(1,n/100)))},[t,n]),P=W.useCallback(e=>{if(e){var t;A(e);try{t=e.play()}catch(n){return}t&&"function"==typeof t.then&&t.then(function(){}).catch(function(){if(!e.muted){var t;e.muted=!0;try{t=e.play()}catch(n){return}t&&"function"==typeof t.then&&t.then(function(){A(e)}).catch(function(){})}})}},[A]),j=W.useCallback((e,t,n)=>{if(_.current){T();var r=null,o=null,i=function(){r&&e.removeEventListener("canplaythrough",r),o&&e.removeEventListener("error",o)};r=function(){i(),_.current&&(k.current=0,a&&P(e))},o=function(){if(i(),_.current)if(n<3){var r=Fe(n);x.current=setTimeout(function(){_.current&&j(e,t,n+1)},r)}else s&&s(new Error("Video failed to load after 3 attempts: "+t))},e.addEventListener("canplaythrough",r,{once:!0}),e.addEventListener("error",o,{once:!0}),e.preload="auto",e.src=t,e.load()}},[a,T,s,P]),O=W.useCallback(e=>{if(!E.current){E.current=!0,g(!0);var t=I();if(!t)return E.current=!1,void g(!1);var n=null,r=null,o=function(){n&&t.removeEventListener("canplaythrough",n),r&&t.removeEventListener("error",r)},i=function(a){_.current&&t&&(o(),n=function(){if(o(),_.current&&t){P(t);var n="a"===d?"b":"a";"a"===n?(v(1),w(0)):(v(0),w(1)),setTimeout(function(){if(_.current){var t=C();t&&(t.pause(),t.removeAttribute("src"),t.load()),y(n),S.current=e,E.current=!1,g(!1)}},550)}},r=function(){if(o(),_.current)if(a<3){var t=Fe(a);x.current=setTimeout(function(){_.current&&i(a+1)},t)}else E.current=!1,g(!1),s&&s(new Error("Video crossfade failed after 3 attempts: "+e))},t.addEventListener("canplaythrough",n,{once:!0}),t.addEventListener("error",r,{once:!0}),t.preload="auto",t.src=e,t.load())};i(0)}},[d,C,I,s,P]);W.useEffect(function(){_.current=!0;var t=p.current;return t&&e&&(j(t,e,0),S.current=e),function(){_.current=!1}},[]),W.useEffect(function(){e!==S.current&&e&&O(e)},[e]),W.useEffect(function(){var e=C();e&&(e.muted=t,t||(e.volume=Math.max(0,Math.min(1,n/100))))},[t,n,d,C]),W.useEffect(function(){var e=p.current,t=h.current,n=function(){_.current&&(i?e&&(e.currentTime=0,P(e)):c&&c())},r=function(){_.current&&(i?t&&(t.currentTime=0,P(t)):c&&c())};return e&&e.addEventListener("ended",n),t&&t.addEventListener("ended",r),function(){e&&e.removeEventListener("ended",n),t&&t.removeEventListener("ended",r)}},[i,c,P]),W.useEffect(function(){return function(){_.current=!1,T();var e=p.current,t=h.current;e&&(e.pause(),e.removeAttribute("src"),e.load()),t&&(t.pause(),t.removeAttribute("src"),t.load())}},[]);var R={position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:r,display:"block",transform:"translateZ(0)",transition:"opacity 500ms ease-in-out"},M=u(l({},R),{opacity:m,zIndex:"a"===d?1:0}),L=u(l({},R),{opacity:b,zIndex:"b"===d?1:0}),B={position:"relative",width:"100%",height:"100%",backgroundColor:o,overflow:"hidden"};return Pe.jsxs("div",{style:B,className:f,children:[Pe.jsx("video",{ref:p,style:M,muted:t,loop:i,playsInline:!0,preload:"auto"}),Pe.jsx("video",{ref:h,style:L,muted:t,loop:i,playsInline:!0,preload:"auto"})]})}function We({isIdle:e,idle:t,className:n}){var r=W.useState(!1),o=r[0],i=r[1],a=W.useState(!1),s=a[0],l=a[1],u=W.useRef(null),c=t&&t.transitionDuration?t.transitionDuration:1e3;if(W.useEffect(function(){if(e)return l(!0),u.current=requestAnimationFrame(function(){u.current=requestAnimationFrame(function(){u.current=null,i(!0)})}),function(){null!==u.current&&(cancelAnimationFrame(u.current),u.current=null)};i(!1);var t=setTimeout(function(){l(!1)},c);return function(){clearTimeout(t)}},[e,c]),!t||!s)return null;var f={position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:50,opacity:o?1:0,pointerEvents:o?"auto":"none",transition:"opacity "+c+"ms ease-in-out",transform:"translateZ(0)"},p={position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundImage:"url("+t.url+")",backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"};return Pe.jsxs("div",{style:f,className:n,children:[Pe.jsx("style",{children:"@keyframes idle-pulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }"}),"video"===t.type?Pe.jsx(He,{src:t.url,muted:!1,fit:"cover",loop:!0,autoPlay:!0}):Pe.jsx("div",{style:p}),Pe.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:"linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0.7) 100%)",zIndex:1}}),Pe.jsxs("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",zIndex:2},children:[Pe.jsx("div",{style:{fontSize:"48px",fontWeight:700,color:"#fff",letterSpacing:"-0.02em",marginBottom:"16px",textShadow:"0 2px 20px rgba(0,0,0,0.5)"},children:"LIGHTMAN"}),Pe.jsx("div",{style:{fontSize:"20px",fontWeight:400,color:"rgba(255,255,255,0.8)",letterSpacing:"0.15em",textTransform:"uppercase"},children:"Museum Experience"})]}),Pe.jsx("div",{style:{position:"absolute",bottom:"60px",left:0,width:"100%",textAlign:"center",fontSize:"16px",color:"rgba(255,255,255,0.6)",letterSpacing:"0.2em",textTransform:"uppercase",animation:"idle-pulse 2s ease-in-out infinite"},children:"Touch to explore"})]})}var qe,Ve,Ke,$e={exports:{}},Qe={exports:{}};function Ge(){if(qe)return Qe.exports;qe=1;var e,t="object"==typeof Reflect?Reflect:null,n=t&&"function"==typeof t.apply?t.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};e=t&&"function"==typeof t.ownKeys?t.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}Qe.exports=o,Qe.exports.once=function(e,t){return new Promise(function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}d(e,t,i,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&d(e,"error",t,n)}(e,o,{once:!0})})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var i=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function s(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var o,i,l,u;if(a(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),l=i[t]),void 0===l)l=i[t]=n,++e._eventsCount;else if("function"==typeof l?l=i[t]=r?[n,l]:[l,n]:r?l.unshift(n):l.push(n),(o=s(e))>0&&l.length>o&&!l.warned){l.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=l.length,u=c,console&&console.warn&&console.warn(u)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=u.bind(r);return o.listener=n,r.wrapFn=o,o}function f(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):h(o,o.length)}function p(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function h(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function d(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function o(i){r.once&&e.removeEventListener(t,o),n(i)})}}return Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");i=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||r(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},o.prototype.getMaxListeners=function(){return s(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=i[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var u=l.length,c=h(l,u);for(r=0;r<u;++r)n(c[r],this,t)}return!0},o.prototype.addListener=function(e,t){return l(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return l(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,c(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,c(this,e,t)),this},o.prototype.removeListener=function(e,t){var n,r,o,i,s;if(a(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){s=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return f(this,e,!0)},o.prototype.rawListeners=function(e){return f(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]},Qe.exports}function Ye(){if(Ke)return Ve;Ke=1,Ve=function(){for(var t={},n=0;n<arguments.length;n++){var r=arguments[n];for(var o in r)e.call(r,o)&&(t[o]=r[o])}return t};var e=Object.prototype.hasOwnProperty;return Ve}var Xe,Ze,Je={exports:{}};function et(){return Ze?Xe:(Ze=1,Xe=Ge().EventEmitter)}var tt,nt={};function rt(){return tt||(tt=1,function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});for(var t={},n={byteLength:function(e){var t=u(e),n=t[0],r=t[1];return 3*(n+r)/4-r},toByteArray:function(e){var t,n,r=u(e),a=r[0],s=r[1],l=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),c=0,f=s>0?a-4:a;for(n=0;n<f;n+=4)t=o[e.charCodeAt(n)]<<18|o[e.charCodeAt(n+1)]<<12|o[e.charCodeAt(n+2)]<<6|o[e.charCodeAt(n+3)],l[c++]=t>>16&255,l[c++]=t>>8&255,l[c++]=255&t;2===s&&(t=o[e.charCodeAt(n)]<<2|o[e.charCodeAt(n+1)]>>4,l[c++]=255&t);1===s&&(t=o[e.charCodeAt(n)]<<10|o[e.charCodeAt(n+1)]<<4|o[e.charCodeAt(n+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t);return l},fromByteArray:function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,s=0,l=n-o;s<l;s+=a)i.push(f(e,s,s+a>l?l:s+a));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")}},r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0;l<64;++l)r[l]=s[l],o[s.charCodeAt(l)]=l;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function f(e,t,n){for(var r,o=[],i=t;i<n;i+=3)r=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(c(r));return o.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63;var p={read:function(e,t,n,r,o){var i,a,s=8*o-r-1,l=(1<<s)-1,u=l>>1,c=-7,f=n?o-1:0,p=n?-1:1,h=e[t+f];for(f+=p,i=h&(1<<-c)-1,h>>=-c,c+=s;c>0;i=256*i+e[t+f],f+=p,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=r;c>0;a=256*a+e[t+f],f+=p,c-=8);if(0===i)i=1-u;else{if(i===l)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=u}return(h?-1:1)*a*Math.pow(2,i-r)},write:function(e,t,n,r,o,i){var a,s,l,u=8*i-o-1,c=(1<<u)-1,f=c>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,d=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+f>=1?p/l:p*Math.pow(2,1-f))*l>=2&&(a++,l/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(t*l-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&s,h+=d,s/=256,o-=8);for(a=a<<o|s,u+=o;u>0;e[n+h]=255&a,h+=d,a/=256,u-=8);e[n+h-d]|=128*y}};!function(e){const t=n,r=p,o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=f,e.SlowBuffer=function(e){+e!=e&&(e=0);return f.alloc(+e)},e.INSPECT_MAX_BYTES=50;const i=2147483647;e.kMaxLength=i;const{Uint8Array:s,ArrayBuffer:l,SharedArrayBuffer:u}=globalThis;function c(e){if(e>i)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new s(e);return Object.setPrototypeOf(t,f.prototype),t}function f(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return y(e)}return h(e,t,n)}function h(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!f.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|b(e,t);let r=c(n);const o=r.write(e,t);o!==n&&(r=r.slice(0,o));return r}(e,t);if(l.isView(e))return function(e){if(J(e,s)){const t=new s(e);return m(t.buffer,t.byteOffset,t.byteLength)}return g(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(J(e,l)||e&&J(e.buffer,l))return m(e,t,n);if(void 0!==u&&(J(e,u)||e&&J(e.buffer,u)))return m(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return f.from(r,t,n);const o=function(e){if(f.isBuffer(e)){const t=0|v(e.length),n=c(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||ee(e.length)?c(0):g(e);if("Buffer"===e.type&&Array.isArray(e.data))return g(e.data)}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return f.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function d(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function y(e){return d(e),c(e<0?0:0|v(e))}function g(e){const t=e.length<0?0:0|v(e.length),n=c(t);for(let r=0;r<t;r+=1)n[r]=255&e[r];return n}function m(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===t&&void 0===n?new s(e):void 0===n?new s(e,t):new s(e,t,n),Object.setPrototypeOf(r,f.prototype),r}function v(e){if(e>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function b(e,t){if(f.isBuffer(e))return e.length;if(l.isView(e)||J(e,l))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return X(e).length;default:if(o)return r?-1:Y(e).length;t=(""+t).toLowerCase(),o=!0}}function w(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return M(this,t,n);case"utf8":case"utf-8":return P(this,t,n);case"ascii":return O(this,t,n);case"latin1":case"binary":return R(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function S(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function k(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),ee(n=+n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=f.from(t,r)),f.isBuffer(t))return 0===t.length?-1:x(e,t,n,r,o);if("number"==typeof t)return t&=255,"function"==typeof s.prototype.indexOf?o?s.prototype.indexOf.call(e,t,n):s.prototype.lastIndexOf.call(e,t,n):x(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function x(e,t,n,r,o){let i,a=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let r=-1;for(i=n;i<s;i++)if(u(e,i)===u(t,-1===r?0:i-r)){if(-1===r&&(r=i),i-r+1===l)return r*a}else-1!==r&&(i-=i-r),r=-1}else for(n+l>s&&(n=s-l),i=n;i>=0;i--){let n=!0;for(let r=0;r<l;r++)if(u(e,i+r)!==u(t,r)){n=!1;break}if(n)return i}return-1}function E(e,t,n,r){n=Number(n)||0;const o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;const i=t.length;let a;for(r>i/2&&(r=i/2),a=0;a<r;++a){const r=parseInt(t.substr(2*a,2),16);if(ee(r))return a;e[n+a]=r}return a}function _(e,t,n,r){return Z(Y(t,e.length-n),e,n,r)}function C(e,t,n,r){return Z(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function I(e,t,n,r){return Z(X(t),e,n,r)}function T(e,t,n,r){return Z(function(e,t){let n,r,o;const i=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function A(e,n,r){return 0===n&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function P(e,t,n){n=Math.min(e.length,n);const r=[];let o=t;for(;o<n;){const t=e[o];let i=null,a=t>239?4:t>223?3:t>191?2:1;if(o+a<=n){let n,r,s,l;switch(a){case 1:t<128&&(i=t);break;case 2:n=e[o+1],128==(192&n)&&(l=(31&t)<<6|63&n,l>127&&(i=l));break;case 3:n=e[o+1],r=e[o+2],128==(192&n)&&128==(192&r)&&(l=(15&t)<<12|(63&n)<<6|63&r,l>2047&&(l<55296||l>57343)&&(i=l));break;case 4:n=e[o+1],r=e[o+2],s=e[o+3],128==(192&n)&&128==(192&r)&&128==(192&s)&&(l=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&s,l>65535&&l<1114112&&(i=l))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,r.push(i>>>10&1023|55296),i=56320|1023&i),r.push(i),o+=a}return function(e){const t=e.length;if(t<=j)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=j));return n}(r)}f.TYPED_ARRAY_SUPPORT=function(){try{const e=new s(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,s.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),f.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||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(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}}),f.poolSize=8192,f.from=function(e,t,n){return h(e,t,n)},Object.setPrototypeOf(f.prototype,s.prototype),Object.setPrototypeOf(f,s),f.alloc=function(e,t,n){return function(e,t,n){return d(e),e<=0?c(e):void 0!==t?"string"==typeof n?c(e).fill(t,n):c(e).fill(t):c(e)}(e,t,n)},f.allocUnsafe=function(e){return y(e)},f.allocUnsafeSlow=function(e){return y(e)},f.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==f.prototype},f.compare=function(e,t){if(J(e,s)&&(e=f.from(e,e.offset,e.byteLength)),J(t,s)&&(t=f.from(t,t.offset,t.byteLength)),!f.isBuffer(e)||!f.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,r=t.length;for(let o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},f.isEncoding=function(e){switch(String(e).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}},f.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return f.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const r=f.allocUnsafe(t);let o=0;for(n=0;n<e.length;++n){let t=e[n];if(J(t,s))o+t.length>r.length?(f.isBuffer(t)||(t=f.from(t)),t.copy(r,o)):s.prototype.set.call(r,t,o);else{if(!f.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,o)}o+=t.length}return r},f.byteLength=b,f.prototype._isBuffer=!0,f.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)S(this,t,t+1);return this},f.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)S(this,t,t+3),S(this,t+1,t+2);return this},f.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)S(this,t,t+7),S(this,t+1,t+6),S(this,t+2,t+5),S(this,t+3,t+4);return this},f.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?P(this,0,e):w.apply(this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===f.compare(this,e)},f.prototype.inspect=function(){let t="";const n=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"},o&&(f.prototype[o]=f.prototype.inspect),f.prototype.compare=function(e,t,n,r,o){if(J(e,s)&&(e=f.from(e,e.offset,e.byteLength)),!f.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;let i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0);const l=Math.min(i,a),u=this.slice(r,o),c=e.slice(t,n);for(let s=0;s<l;++s)if(u[s]!==c[s]){i=u[s],a=c[s];break}return i<a?-1:a<i?1:0},f.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},f.prototype.indexOf=function(e,t,n){return k(this,e,t,n,!0)},f.prototype.lastIndexOf=function(e,t,n){return k(this,e,t,n,!1)},f.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let i=!1;for(;;)switch(r){case"hex":return E(this,e,t,n);case"utf8":case"utf-8":return _(this,e,t,n);case"ascii":case"latin1":case"binary":return C(this,e,t,n);case"base64":return I(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const j=4096;function O(e,t,n){let r="";n=Math.min(e.length,n);for(let o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function R(e,t,n){let r="";n=Math.min(e.length,n);for(let o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function M(e,t,n){const r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let o="";for(let i=t;i<n;++i)o+=te[e[i]];return o}function L(e,t,n){const r=e.slice(t,n);let o="";for(let i=0;i<r.length-1;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function B(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,n,r,o,i){if(!f.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function U(e,t,n,r,o){K(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,n}function D(e,t,n,r,o){K(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n+7]=i,i>>=8,e[n+6]=i,i>>=8,e[n+5]=i,i>>=8,e[n+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function z(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function F(e,t,n,o,i){return t=+t,n>>>=0,i||z(e,0,n,4),r.write(e,t,n,o,23,4),n+4}function H(e,t,n,o,i){return t=+t,n>>>=0,i||z(e,0,n,8),r.write(e,t,n,o,52,8),n+8}f.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const r=this.subarray(e,t);return Object.setPrototypeOf(r,f.prototype),r},f.prototype.readUintLE=f.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||B(e,t,this.length);let r=this[e],o=1,i=0;for(;++i<t&&(o*=256);)r+=this[e+i]*o;return r},f.prototype.readUintBE=f.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||B(e,t,this.length);let r=this[e+--t],o=1;for(;t>0&&(o*=256);)r+=this[e+--t]*o;return r},f.prototype.readUint8=f.prototype.readUInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),this[e]},f.prototype.readUint16LE=f.prototype.readUInt16LE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]|this[e+1]<<8},f.prototype.readUint16BE=f.prototype.readUInt16BE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]<<8|this[e+1]},f.prototype.readUint32LE=f.prototype.readUInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},f.prototype.readUint32BE=f.prototype.readUInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},f.prototype.readBigUInt64LE=ne(function(e){$(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Q(e,this.length-8);const r=t+this[++e]*a(2,8)+this[++e]*a(2,16)+this[++e]*a(2,24),o=this[++e]+this[++e]*a(2,8)+this[++e]*a(2,16)+n*a(2,24);return BigInt(r)+(BigInt(o)<<BigInt(32))}),f.prototype.readBigUInt64BE=ne(function(e){$(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Q(e,this.length-8);const r=t*a(2,24)+this[++e]*a(2,16)+this[++e]*a(2,8)+this[++e],o=this[++e]*a(2,24)+this[++e]*a(2,16)+this[++e]*a(2,8)+n;return(BigInt(r)<<BigInt(32))+BigInt(o)}),f.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||B(e,t,this.length);let r=this[e],o=1,i=0;for(;++i<t&&(o*=256);)r+=this[e+i]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*t)),r},f.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||B(e,t,this.length);let r=t,o=1,i=this[e+--r];for(;r>0&&(o*=256);)i+=this[e+--r]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},f.prototype.readInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},f.prototype.readInt16LE=function(e,t){e>>>=0,t||B(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},f.prototype.readInt16BE=function(e,t){e>>>=0,t||B(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},f.prototype.readInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},f.prototype.readInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},f.prototype.readBigInt64LE=ne(function(e){$(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Q(e,this.length-8);const r=this[e+4]+this[e+5]*a(2,8)+this[e+6]*a(2,16)+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+this[++e]*a(2,8)+this[++e]*a(2,16)+this[++e]*a(2,24))}),f.prototype.readBigInt64BE=ne(function(e){$(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Q(e,this.length-8);const r=(t<<24)+this[++e]*a(2,16)+this[++e]*a(2,8)+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*a(2,24)+this[++e]*a(2,16)+this[++e]*a(2,8)+n)}),f.prototype.readFloatLE=function(e,t){return e>>>=0,t||B(e,4,this.length),r.read(this,e,!0,23,4)},f.prototype.readFloatBE=function(e,t){return e>>>=0,t||B(e,4,this.length),r.read(this,e,!1,23,4)},f.prototype.readDoubleLE=function(e,t){return e>>>=0,t||B(e,8,this.length),r.read(this,e,!0,52,8)},f.prototype.readDoubleBE=function(e,t){return e>>>=0,t||B(e,8,this.length),r.read(this,e,!1,52,8)},f.prototype.writeUintLE=f.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){N(this,e,t,n,Math.pow(2,8*n)-1,0)}let o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},f.prototype.writeUintBE=f.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){N(this,e,t,n,Math.pow(2,8*n)-1,0)}let o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},f.prototype.writeUint8=f.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,1,255,0),this[t]=255&e,t+1},f.prototype.writeUint16LE=f.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},f.prototype.writeUint16BE=f.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},f.prototype.writeUint32LE=f.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},f.prototype.writeUint32BE=f.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},f.prototype.writeBigUInt64LE=ne(function(e,t=0){return U(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeBigUInt64BE=ne(function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);N(this,e,t,n,r-1,-r)}let o=0,i=1,a=0;for(this[t]=255&e;++o<n&&(i*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+n},f.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);N(this,e,t,n,r-1,-r)}let o=n-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+n},f.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},f.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},f.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},f.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},f.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},f.prototype.writeBigInt64LE=ne(function(e,t=0){return U(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),f.prototype.writeBigInt64BE=ne(function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),f.prototype.writeFloatLE=function(e,t,n){return F(this,e,t,!0,n)},f.prototype.writeFloatBE=function(e,t,n){return F(this,e,t,!1,n)},f.prototype.writeDoubleLE=function(e,t,n){return H(this,e,t,!0,n)},f.prototype.writeDoubleBE=function(e,t,n){return H(this,e,t,!1,n)},f.prototype.copy=function(e,t,n,r){if(!f.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);const o=r-n;return this===e&&"function"==typeof s.prototype.copyWithin?this.copyWithin(t,n,r):s.prototype.set.call(e,this.subarray(n,r),t),o},f.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!f.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){const t=e.charCodeAt(0);("utf8"===r&&t<128||"latin1"===r)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;let o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{const i=f.isBuffer(e)?e:f.from(e,r),a=i.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-t;++o)this[o+t]=i[o%a]}return this};const W={};function q(e,t,n){W[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function V(e){let t="",n=e.length;const r="-"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function K(e,t,n,r,o,i){if(e>n||e<t){const n="bigint"==typeof t?"n":"";let r;throw r=0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`,new W.ERR_OUT_OF_RANGE("value",r,e)}!function(e,t,n){$(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||Q(t,e.length-(n+1))}(r,o,i)}function $(e,t){if("number"!=typeof e)throw new W.ERR_INVALID_ARG_TYPE(t,"number",e)}function Q(e,t,n){if(Math.floor(e)!==e)throw $(e,n),new W.ERR_OUT_OF_RANGE("offset","an integer",e);if(t<0)throw new W.ERR_BUFFER_OUT_OF_BOUNDS;throw new W.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${t}`,e)}q("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),q("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),q("ERR_OUT_OF_RANGE",function(e,t,n){let r=`The value of "${e}" is out of range.`,o=n;return Number.isInteger(n)&&Math.abs(n)>a(2,32)?o=V(String(n)):"bigint"==typeof n&&(o=String(n),(n>a(BigInt(2),BigInt(32))||n<-a(BigInt(2),BigInt(32)))&&(o=V(o)),o+="n"),r+=` It must be ${t}. Received ${o}`,r},RangeError);const G=/[^+/0-9A-Za-z-_]/g;function Y(e,t){let n;t=t||1/0;const r=e.length;let o=null;const i=[];for(let a=0;a<r;++a){if(n=e.charCodeAt(a),n>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function X(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Z(e,t,n,r){let o;for(o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function J(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function ee(e){return e!=e}const te=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let o=0;o<16;++o)t[r+o]=e[n]+e[o]}return t}();function ne(e){return"undefined"==typeof BigInt?re:e}function re(){throw new Error("BigInt not supported")}}(t);const h=t.Buffer;e.Blob=t.Blob,e.BlobOptions=t.BlobOptions,e.Buffer=t.Buffer,e.File=t.File,e.FileOptions=t.FileOptions,e.INSPECT_MAX_BYTES=t.INSPECT_MAX_BYTES,e.SlowBuffer=t.SlowBuffer,e.TranscodeEncoding=t.TranscodeEncoding,e.atob=t.atob,e.btoa=t.btoa,e.constants=t.constants,e.default=h,e.isAscii=t.isAscii,e.isUtf8=t.isUtf8,e.kMaxLength=t.kMaxLength,e.kStringMaxLength=t.kStringMaxLength,e.resolveObjectURL=t.resolveObjectURL,e.transcode=t.transcode}(nt)),nt}var ot,it,at,st,lt,ut,ct,ft,pt,ht,dt,yt,gt,mt,vt,bt,wt,St,kt,xt,Et,_t,Ct,It,Tt,At,Pt,jt,Ot,Rt,Mt,Lt,Bt,Nt,Ut,Dt,zt,Ft,Ht,Wt,qt,Vt,Kt,$t,Qt,Gt,Yt,Xt,Zt,Jt,en,tn,nn,rn,on,an,sn,ln,un,cn,fn,pn,hn,dn,yn,gn,mn,vn,bn,wn,Sn,kn,xn,En,_n,Cn,In,Tn,An,Pn,jn,On,Rn,Mn,Ln,Bn,Nn,Un,Dn,zn,Fn={},Hn={};function Wn(){return it?ot:(it=1,ot=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(var r in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0})}function qn(){if(st)return at;st=1;var e=Wn();return at=function(){return e()&&!!Symbol.toStringTag}}function Vn(){return ut?lt:(ut=1,lt=Object)}function Kn(){return ft?ct:(ft=1,ct=Error)}function $n(){return ht?pt:(ht=1,pt=EvalError)}function Qn(){return yt?dt:(yt=1,dt=RangeError)}function Gn(){return mt?gt:(mt=1,gt=ReferenceError)}function Yn(){return bt?vt:(bt=1,vt=SyntaxError)}function Xn(){return St?wt:(St=1,wt=TypeError)}function Zn(){return xt?kt:(xt=1,kt=URIError)}function Jn(){return _t?Et:(_t=1,Et=Math.abs)}function er(){return It?Ct:(It=1,Ct=Math.floor)}function tr(){return At?Tt:(At=1,Tt=Math.max)}function nr(){return jt?Pt:(jt=1,Pt=Math.min)}function rr(){return Rt?Ot:(Rt=1,Ot=Math.pow)}function or(){return Lt?Mt:(Lt=1,Mt=Math.round)}function ir(){return Nt?Bt:(Nt=1,Bt=Number.isNaN||function(e){return e!=e})}function ar(){if(Dt)return Ut;Dt=1;var e=ir();return Ut=function(t){return e(t)||0===t?t:t<0?-1:1}}function sr(){return Ft?zt:(Ft=1,zt=Object.getOwnPropertyDescriptor)}function lr(){if(Wt)return Ht;Wt=1;var e=sr();if(e)try{e([],"length")}catch(t){e=null}return Ht=e}function ur(){if(Vt)return qt;Vt=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch(t){e=!1}return qt=e}function cr(){return Gt?Qt:(Gt=1,Qt="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null)}function fr(){return Xt?Yt:(Xt=1,Yt=Vn().getPrototypeOf||null)}function pr(){if(tn)return en;tn=1;var e=function(){if(Jt)return Zt;Jt=1;var e=Object.prototype.toString,t=Math.max,n=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var o=0;o<t.length;o+=1)n[o+e.length]=t[o];return n};return Zt=function(r){var o=this;if("function"!=typeof o||"[object Function]"!==e.apply(o))throw new TypeError("Function.prototype.bind called on incompatible "+o);for(var i,a=function(e){for(var t=[],n=1,r=0;n<e.length;n+=1,r+=1)t[r]=e[n];return t}(arguments),s=t(0,o.length-a.length),l=[],u=0;u<s;u++)l[u]="$"+u;if(i=Function("binder","return function ("+function(e,t){for(var n="",r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n}(l,",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof i){var e=o.apply(this,n(a,arguments));return Object(e)===e?e:this}return o.apply(r,n(a,arguments))}),o.prototype){var c=function(){};c.prototype=o.prototype,i.prototype=new c,c.prototype=null}return i},Zt}();return en=Function.prototype.bind||e}function hr(){return rn?nn:(rn=1,nn=Function.prototype.call)}function dr(){return an?on:(an=1,on=Function.prototype.apply)}function yr(){if(cn)return un;cn=1;var e=pr(),t=dr(),n=hr(),r=ln?sn:(ln=1,sn="undefined"!=typeof Reflect&&Reflect&&Reflect.apply);return un=r||e.call(n,t)}function gr(){if(pn)return fn;pn=1;var e=pr(),t=Xn(),n=hr(),r=yr();return fn=function(o){if(o.length<1||"function"!=typeof o[0])throw new t("a function is required");return r(e,n,o)}}function mr(){if(dn)return hn;dn=1;var e,t=gr(),n=lr();try{e=[].__proto__===Array.prototype}catch(a){if(!a||"object"!=typeof a||!("code"in a)||"ERR_PROTO_ACCESS"!==a.code)throw a}var r=!!e&&n&&n(Object.prototype,"__proto__"),o=Object,i=o.getPrototypeOf;return hn=r&&"function"==typeof r.get?t([r.get]):"function"==typeof i&&function(e){return i(null==e?e:o(e))}}function vr(){if(gn)return yn;gn=1;var e=cr(),t=fr(),n=mr();return yn=e?function(t){return e(t)}:t?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return t(e)}:n?function(e){return n(e)}:null}function br(){if(vn)return mn;vn=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,n=pr();return mn=n.call(e,t)}function wr(){if(wn)return bn;var e;wn=1;var t=Vn(),n=Kn(),r=$n(),o=Qn(),i=Gn(),a=Yn(),s=Xn(),l=Zn(),u=Jn(),c=er(),f=tr(),p=nr(),h=rr(),d=or(),y=ar(),g=Function,m=function(e){try{return g('"use strict"; return ('+e+").constructor;")()}catch(t){}},v=lr(),b=ur(),w=function(){throw new s},S=v?function(){try{return w}catch(e){try{return v(arguments,"callee").get}catch(t){return w}}}():w,k=function(){if($t)return Kt;$t=1;var e="undefined"!=typeof Symbol&&Symbol,t=Wn();return Kt=function(){return"function"==typeof e&&"function"==typeof Symbol&&"symbol"==typeof e("foo")&&"symbol"==typeof Symbol("bar")&&t()}}()(),x=vr(),E=fr(),_=cr(),C=dr(),I=hr(),T={},A="undefined"!=typeof Uint8Array&&x?x(Uint8Array):e,P={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?e:ArrayBuffer,"%ArrayIteratorPrototype%":k&&x?x([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":T,"%AsyncGenerator%":T,"%AsyncGeneratorFunction%":T,"%AsyncIteratorPrototype%":T,"%Atomics%":"undefined"==typeof Atomics?e:Atomics,"%BigInt%":"undefined"==typeof BigInt?e:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?e:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":r,"%Float16Array%":"undefined"==typeof Float16Array?e:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?e:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?e:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?e:FinalizationRegistry,"%Function%":g,"%GeneratorFunction%":T,"%Int8Array%":"undefined"==typeof Int8Array?e:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?e:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":k&&x?x(x([][Symbol.iterator]())):e,"%JSON%":"object"==typeof JSON?JSON:e,"%Map%":"undefined"==typeof Map?e:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&k&&x?x((new Map)[Symbol.iterator]()):e,"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":v,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?e:Promise,"%Proxy%":"undefined"==typeof Proxy?e:Proxy,"%RangeError%":o,"%ReferenceError%":i,"%Reflect%":"undefined"==typeof Reflect?e:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?e:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&k&&x?x((new Set)[Symbol.iterator]()):e,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":k&&x?x(""[Symbol.iterator]()):e,"%Symbol%":k?Symbol:e,"%SyntaxError%":a,"%ThrowTypeError%":S,"%TypedArray%":A,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?e:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?e:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?e:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?e:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?e:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?e:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?e:WeakSet,"%Function.prototype.call%":I,"%Function.prototype.apply%":C,"%Object.defineProperty%":b,"%Object.getPrototypeOf%":E,"%Math.abs%":u,"%Math.floor%":c,"%Math.max%":f,"%Math.min%":p,"%Math.pow%":h,"%Math.round%":d,"%Math.sign%":y,"%Reflect.getPrototypeOf%":_};if(x)try{null.error}catch(q){var j=x(x(q));P["%Error.prototype%"]=j}var O=function e(t){var n;if("%AsyncFunction%"===t)n=m("async function () {}");else if("%GeneratorFunction%"===t)n=m("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=m("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&x&&(n=x(o.prototype))}return P[t]=n,n},R={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},M=pr(),L=br(),B=M.call(I,Array.prototype.concat),N=M.call(C,Array.prototype.splice),U=M.call(I,String.prototype.replace),D=M.call(I,String.prototype.slice),z=M.call(I,RegExp.prototype.exec),F=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,H=/\\(\\)?/g,W=function(e,t){var n,r=e;if(L(R,r)&&(r="%"+(n=R[r])[0]+"%"),L(P,r)){var o=P[r];if(o===T&&(o=O(r)),void 0===o&&!t)throw new s("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:o}}throw new a("intrinsic "+e+" does not exist!")};return bn=function(e,t){if("string"!=typeof e||0===e.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new s('"allowMissing" argument must be a boolean');if(null===z(/^%?[^%]*%?$/,e))throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(e){var t=D(e,0,1),n=D(e,-1);if("%"===t&&"%"!==n)throw new a("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new a("invalid intrinsic syntax, expected opening `%`");var r=[];return U(e,F,function(e,t,n,o){r[r.length]=n?U(o,H,"$1"):t||e}),r}(e),r=n.length>0?n[0]:"",o=W("%"+r+"%",t),i=o.name,l=o.value,u=!1,c=o.alias;c&&(r=c[0],N(n,B([0,1],c)));for(var f=1,p=!0;f<n.length;f+=1){var h=n[f],d=D(h,0,1),y=D(h,-1);if(('"'===d||"'"===d||"`"===d||'"'===y||"'"===y||"`"===y)&&d!==y)throw new a("property names with quotes must have matching quotes");if("constructor"!==h&&p||(u=!0),L(P,i="%"+(r+="."+h)+"%"))l=P[i];else if(null!=l){if(!(h in l)){if(!t)throw new s("base intrinsic for "+e+" exists, but the property is not available.");return}if(v&&f+1>=n.length){var g=v(l,h);l=(p=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:l[h]}else p=L(l,h),l=l[h];p&&!u&&(P[i]=l)}}return l},bn}function Sr(){if(kn)return Sn;kn=1;var e=wr(),t=gr(),n=t([e("%String.prototype.indexOf%")]);return Sn=function(r,o){var i=e(r,!!o);return"function"==typeof i&&n(r,".prototype.")>-1?t([i]):i}}function kr(){if(En)return xn;En=1;var e=qn()(),t=Sr()("Object.prototype.toString"),n=function(n){return!(e&&n&&"object"==typeof n&&Symbol.toStringTag in n)&&"[object Arguments]"===t(n)},r=function(e){return!!n(e)||null!==e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==t(e)&&"callee"in e&&"[object Function]"===t(e.callee)},o=function(){return n(arguments)}();return n.isLegacyArguments=r,xn=o?n:r}function xr(){if(Tn)return In;Tn=1;var e=Sr(),t=function(){if(Cn)return _n;Cn=1;var e,t=Sr(),n=qn()(),r=br(),o=lr();if(n){var i=t("RegExp.prototype.exec"),a={},s=function(){throw a},l={toString:s,valueOf:s};"symbol"==typeof Symbol.toPrimitive&&(l[Symbol.toPrimitive]=s),e=function(e){if(!e||"object"!=typeof e)return!1;var t=o(e,"lastIndex");if(!t||!r(t,"value"))return!1;try{i(e,l)}catch(n){return n===a}}}else{var u=t("Object.prototype.toString");e=function(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"[object RegExp]"===u(e)}}return _n=e}(),n=e("RegExp.prototype.exec"),r=Xn();return In=function(e){if(!t(e))throw new r("`regex` must be a RegExp");return function(t){return null!==n(e,t)}}}function Er(){if(Pn)return An;Pn=1;const e=function*(){}.constructor;return An=()=>e}function _r(){if(Bn)return Ln;Bn=1;var e=function(){if(Mn)return Rn;Mn=1;var e,t,n=Function.prototype.toString,r="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof r&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw t}}),t={},r(function(){throw 42},null,e)}catch(p){p!==t&&(r=null)}else r=null;var o=/^\s*class\b/,i=function(e){try{var t=n.call(e);return o.test(t)}catch(r){return!1}},a=function(e){try{return!i(e)&&(n.call(e),!0)}catch(t){return!1}},s=Object.prototype.toString,l="function"==typeof Symbol&&!!Symbol.toStringTag,u=!(0 in[,]),c=function(){return!1};if("object"==typeof document){var f=document.all;s.call(f)===s.call(document.all)&&(c=function(e){if((u||!e)&&(void 0===e||"object"==typeof e))try{var t=s.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(n){}return!1})}return Rn=r?function(n){if(c(n))return!0;if(!n)return!1;if("function"!=typeof n&&"object"!=typeof n)return!1;try{r(n,null,e)}catch(o){if(o!==t)return!1}return!i(n)&&a(n)}:function(e){if(c(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(l)return a(e);if(i(e))return!1;var t=s.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&a(e)}}(),t=Object.prototype.toString,n=Object.prototype.hasOwnProperty;return Ln=function(r,o,i){if(!e(o))throw new TypeError("iterator must be a function");var a,s;arguments.length>=3&&(a=i),s=r,"[object Array]"===t.call(s)?function(e,t,r){for(var o=0,i=e.length;o<i;o++)n.call(e,o)&&(null==r?t(e[o],o,e):t.call(r,e[o],o,e))}(r,o,a):"string"==typeof r?function(e,t,n){for(var r=0,o=e.length;r<o;r++)null==n?t(e.charAt(r),r,e):t.call(n,e.charAt(r),r,e)}(r,o,a):function(e,t,r){for(var o in e)n.call(e,o)&&(null==r?t(e[o],o,e):t.call(r,e[o],o,e))}(r,o,a)},Ln}function Cr(){return Un?Nn:(Un=1,Nn=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"])}function Ir(){if(zn)return Dn;zn=1;var e=Cr(),t="undefined"==typeof globalThis?m:globalThis;return Dn=function(){for(var n=[],r=0;r<e.length;r++)"function"==typeof t[e[r]]&&(n[n.length]=e[r]);return n},Dn}var Tr,Ar,Pr,jr,Or,Rr,Mr,Lr,Br,Nr,Ur,Dr,zr,Fr,Hr,Wr,qr={exports:{}};function Vr(){if(Ar)return Tr;Ar=1;var e=ur(),t=Yn(),n=Xn(),r=lr();return Tr=function(o,i,a){if(!o||"object"!=typeof o&&"function"!=typeof o)throw new n("`obj` must be an object or a function`");if("string"!=typeof i&&"symbol"!=typeof i)throw new n("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new n("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],f=!!r&&r(o,i);if(e)e(o,i,{configurable:null===u&&f?f.configurable:!u,enumerable:null===s&&f?f.enumerable:!s,value:a,writable:null===l&&f?f.writable:!l});else{if(!c&&(s||l||u))throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");o[i]=a}},Tr}function Kr(){if(jr)return Pr;jr=1;var e=ur(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return 1!==e([],"length",{value:1}).length}catch(t){return!0}},Pr=t}function $r(){if(Rr)return Or;Rr=1;var e=wr(),t=Vr(),n=Kr()(),r=lr(),o=Xn(),i=e("%Math.floor%");return Or=function(e,a){if("function"!=typeof e)throw new o("`fn` is not a function");if("number"!=typeof a||a<0||a>4294967295||i(a)!==a)throw new o("`length` must be a positive 32-bit integer");var s=arguments.length>2&&!!arguments[2],l=!0,u=!0;if("length"in e&&r){var c=r(e,"length");c&&!c.configurable&&(l=!1),c&&!c.writable&&(u=!1)}return(l||u||!s)&&(n?t(e,"length",a,!0,!0):t(e,"length",a)),e},Or}function Qr(){return Br||(Br=1,e=qr,t=$r(),n=ur(),r=gr(),o=function(){if(Lr)return Mr;Lr=1;var e=pr(),t=dr(),n=yr();return Mr=function(){return n(e,t,arguments)},Mr}(),e.exports=function(e){var n=r(arguments),o=e.length-(arguments.length-1);return t(n,1+(o>0?o:0),!0)},n?n(e.exports,"apply",{value:o}):e.exports.apply=o),qr.exports;var e,t,n,r,o}function Gr(){if(Ur)return Nr;Ur=1;var e=_r(),t=Ir(),n=Qr(),r=Sr(),o=lr(),i=vr(),a=r("Object.prototype.toString"),s=qn()(),l="undefined"==typeof globalThis?m:globalThis,u=t(),c=r("String.prototype.slice"),f=r("Array.prototype.indexOf",!0)||function(e,t){for(var n=0;n<e.length;n+=1)if(e[n]===t)return n;return-1},p={__proto__:null};e(u,s&&o&&i?function(e){var t=new l[e];if(Symbol.toStringTag in t&&i){var r=i(t),a=o(r,Symbol.toStringTag);if(!a&&r){var s=i(r);a=o(s,Symbol.toStringTag)}if(a&&a.get){var u=n(a.get);p["$"+e]=u}}}:function(e){var t=new l[e],r=t.slice||t.set;if(r){var o=n(r);p["$"+e]=o}});return Nr=function(t){if(!t||"object"!=typeof t)return!1;if(!s){var n=c(a(t),8,-1);return f(u,n)>-1?n:"Object"===n&&function(t){var n=!1;return e(p,function(e,r){if(!n)try{e(t),n=c(r,1)}catch(o){}}),n}(t)}return o?function(t){var n=!1;return e(p,function(e,r){if(!n)try{"$"+e(t)===r&&(n=c(r,1))}catch(o){}}),n}(t):null}}function Yr(){if(zr)return Dr;zr=1;var e=Gr();return Dr=function(t){return!!e(t)}}function Xr(){return Fr||(Fr=1,function(e){var t=kr(),n=function(){if(On)return jn;On=1;var e=Sr(),t=xr()(/^\s*(?:function)?\*/),n=qn()(),r=vr(),o=e("Object.prototype.toString"),i=e("Function.prototype.toString"),a=Er();return jn=function(e){if("function"!=typeof e)return!1;if(t(i(e)))return!0;if(!n)return"[object GeneratorFunction]"===o(e);if(!r)return!1;var s=a();return s&&r(e)===s.prototype}}(),r=Gr(),o=Yr();function i(e){return e.call.bind(e)}var a="undefined"!=typeof BigInt,s="undefined"!=typeof Symbol,l=i(Object.prototype.toString),u=i(Number.prototype.valueOf),c=i(String.prototype.valueOf),f=i(Boolean.prototype.valueOf);if(a)var p=i(BigInt.prototype.valueOf);if(s)var h=i(Symbol.prototype.valueOf);function d(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(n){return!1}}function y(e){return"[object Map]"===l(e)}function g(e){return"[object Set]"===l(e)}function m(e){return"[object WeakMap]"===l(e)}function v(e){return"[object WeakSet]"===l(e)}function b(e){return"[object ArrayBuffer]"===l(e)}function w(e){return"undefined"!=typeof ArrayBuffer&&(b.working?b(e):e instanceof ArrayBuffer)}function S(e){return"[object DataView]"===l(e)}function k(e){return"undefined"!=typeof DataView&&(S.working?S(e):e instanceof DataView)}e.isArgumentsObject=t,e.isGeneratorFunction=n,e.isTypedArray=o,e.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},e.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):o(e)||k(e)},e.isUint8Array=function(e){return"Uint8Array"===r(e)},e.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===r(e)},e.isUint16Array=function(e){return"Uint16Array"===r(e)},e.isUint32Array=function(e){return"Uint32Array"===r(e)},e.isInt8Array=function(e){return"Int8Array"===r(e)},e.isInt16Array=function(e){return"Int16Array"===r(e)},e.isInt32Array=function(e){return"Int32Array"===r(e)},e.isFloat32Array=function(e){return"Float32Array"===r(e)},e.isFloat64Array=function(e){return"Float64Array"===r(e)},e.isBigInt64Array=function(e){return"BigInt64Array"===r(e)},e.isBigUint64Array=function(e){return"BigUint64Array"===r(e)},y.working="undefined"!=typeof Map&&y(new Map),e.isMap=function(e){return"undefined"!=typeof Map&&(y.working?y(e):e instanceof Map)},g.working="undefined"!=typeof Set&&g(new Set),e.isSet=function(e){return"undefined"!=typeof Set&&(g.working?g(e):e instanceof Set)},m.working="undefined"!=typeof WeakMap&&m(new WeakMap),e.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(m.working?m(e):e instanceof WeakMap)},v.working="undefined"!=typeof WeakSet&&v(new WeakSet),e.isWeakSet=function(e){return v(e)},b.working="undefined"!=typeof ArrayBuffer&&b(new ArrayBuffer),e.isArrayBuffer=w,S.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&S(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=k;var x="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function E(e){return"[object SharedArrayBuffer]"===l(e)}function _(e){return void 0!==x&&(void 0===E.working&&(E.working=E(new x)),E.working?E(e):e instanceof x)}function C(e){return d(e,u)}function I(e){return d(e,c)}function T(e){return d(e,f)}function A(e){return a&&d(e,p)}function P(e){return s&&d(e,h)}e.isSharedArrayBuffer=_,e.isAsyncFunction=function(e){return"[object AsyncFunction]"===l(e)},e.isMapIterator=function(e){return"[object Map Iterator]"===l(e)},e.isSetIterator=function(e){return"[object Set Iterator]"===l(e)},e.isGeneratorObject=function(e){return"[object Generator]"===l(e)},e.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===l(e)},e.isNumberObject=C,e.isStringObject=I,e.isBooleanObject=T,e.isBigIntObject=A,e.isSymbolObject=P,e.isBoxedPrimitive=function(e){return C(e)||I(e)||T(e)||A(e)||P(e)},e.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(w(e)||_(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})})}(Hn)),Hn}var Zr,Jr,eo,to,no,ro,oo={exports:{}};function io(){return Zr||(Zr=1,"function"==typeof Object.create?oo.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:oo.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),oo.exports}function ao(){return Jr||(Jr=1,function(e){var t={},n=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},r=/%[sdj%]/g;e.format=function(e){if(!m(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(s(arguments[n]));return t.join(" ")}n=1;for(var o=arguments,i=o.length,a=String(e).replace(r,function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return String(o[n++]);case"%d":return Number(o[n++]);case"%j":try{return JSON.stringify(o[n++])}catch(t){return"[Circular]"}default:return e}}),l=o[n];n<i;l=o[++n])y(l)||!w(l)?a+=" "+l:a+=" "+s(l);return a},e.deprecate=function(t,n){if(void 0!==N&&!0===N.noDeprecation)return t;if(void 0===N)return function(){return e.deprecate(t,n).apply(this,arguments)};var r=!1;return function(){if(!r){if(N.throwDeprecation)throw new Error(n);N.traceDeprecation?console.trace(n):console.error(n),r=!0}return t.apply(this,arguments)}};var o={},i=/^$/;if(t.NODE_DEBUG){var a=t.NODE_DEBUG;a=a.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),i=new RegExp("^"+a+"$","i")}function s(t,n){var r={seen:[],stylize:u};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),d(n)?r.showHidden=n:n&&e._extend(r,n),v(r.showHidden)&&(r.showHidden=!1),v(r.depth)&&(r.depth=2),v(r.colors)&&(r.colors=!1),v(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=l),c(r,t,r.depth)}function l(e,t){var n=s.styles[t];return n?"["+s.colors[n][0]+"m"+e+"["+s.colors[n][1]+"m":e}function u(e,t){return e}function c(t,n,r){if(t.customInspect&&n&&x(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var o=n.inspect(r,t);return m(o)||(o=c(t,o,r)),o}var i=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(m(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(g(t))return e.stylize(""+t,"number");if(d(t))return e.stylize(""+t,"boolean");if(y(t))return e.stylize("null","null")}(t,n);if(i)return i;var a=Object.keys(n),s=function(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(n)),k(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return f(n);if(0===a.length){if(x(n)){var l=n.name?": "+n.name:"";return t.stylize("[Function"+l+"]","special")}if(b(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(S(n))return t.stylize(Date.prototype.toString.call(n),"date");if(k(n))return f(n)}var u,w="",E=!1,_=["{","}"];(h(n)&&(E=!0,_=["[","]"]),x(n))&&(w=" [Function"+(n.name?": "+n.name:"")+"]");return b(n)&&(w=" "+RegExp.prototype.toString.call(n)),S(n)&&(w=" "+Date.prototype.toUTCString.call(n)),k(n)&&(w=" "+f(n)),0!==a.length||E&&0!=n.length?r<0?b(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special"):(t.seen.push(n),u=E?function(e,t,n,r,o){for(var i=[],a=0,s=t.length;a<s;++a)I(t,String(a))?i.push(p(e,t,n,r,String(a),!0)):i.push("");return o.forEach(function(o){o.match(/^\d+$/)||i.push(p(e,t,n,r,o,!0))}),i}(t,n,r,s,a):a.map(function(e){return p(t,n,r,s,e,E)}),t.seen.pop(),function(e,t,n){var r=e.reduce(function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(r>60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(u,w,_)):_[0]+w+_[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,n,r,o,i){var a,s,l;if((l=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),I(r,o)||(a="["+o+"]"),s||(e.seen.indexOf(l.value)<0?(s=y(n)?c(e,l.value,null):c(e,l.value,n-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map(function(e){return" "+e}).join("\n").slice(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),v(a)){if(i&&o.match(/^\d+$/))return s;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function h(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function y(e){return null===e}function g(e){return"number"==typeof e}function m(e){return"string"==typeof e}function v(e){return void 0===e}function b(e){return w(e)&&"[object RegExp]"===E(e)}function w(e){return"object"==typeof e&&null!==e}function S(e){return w(e)&&"[object Date]"===E(e)}function k(e){return w(e)&&("[object Error]"===E(e)||e instanceof Error)}function x(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function _(e){return e<10?"0"+e.toString(10):e.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!o[t])if(i.test(t)){var n=N.pid;o[t]=function(){var r=e.format.apply(e,arguments);console.error("%s %d: %s",t,n,r)}}else o[t]=function(){};return o[t]},e.inspect=s,s.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]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=Xr(),e.isArray=h,e.isBoolean=d,e.isNull=y,e.isNullOrUndefined=function(e){return null==e},e.isNumber=g,e.isString=m,e.isSymbol=function(e){return"symbol"==typeof e},e.isUndefined=v,e.isRegExp=b,e.types.isRegExp=b,e.isObject=w,e.isDate=S,e.types.isDate=S,e.isError=k,e.types.isNativeError=k,e.isFunction=x,e.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},e.isBuffer=Wr?Hr:(Wr=1,Hr=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8});var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.log=function(){var t,n;console.log("%s - %s",(n=[_((t=new Date).getHours()),_(t.getMinutes()),_(t.getSeconds())].join(":"),[t.getDate(),C[t.getMonth()],n].join(" ")),e.format.apply(e,arguments))},e.inherits=io(),e._extend=function(e,t){if(!t||!w(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};var T="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function A(e,t){if(!e){var n=new Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}e.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(T&&e[T]){var t;if("function"!=typeof(t=e[T]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,T,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,r=new Promise(function(e,r){t=e,n=r}),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push(function(e,r){e?n(e):t(r)});try{e.apply(this,o)}catch(a){n(a)}return r}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),T&&Object.defineProperty(t,T,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,n(e))},e.promisify.custom=T,e.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],n=0;n<arguments.length;n++)t.push(arguments[n]);var r=t.pop();if("function"!=typeof r)throw new TypeError("The last argument must be of type Function");var o=this,i=function(){return r.apply(o,arguments)};e.apply(this,t).then(function(e){N.nextTick(i.bind(null,null,e))},function(e){N.nextTick(A.bind(null,e,i))})}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,n(e)),t}}(Fn)),Fn}function so(){if(to)return eo;function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function t(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?e(Object(o),!0).forEach(function(e){n(t,e,o[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))})}return t}function n(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,o(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function o(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:String(t)}to=1;var i=rt().Buffer,a=ao().inspect,s=a&&a.custom||"inspect";function l(e,t,n){i.prototype.copy.call(e,t,n)}return eo=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return r(e,[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return i.alloc(0);for(var t=i.allocUnsafe(e>>>0),n=this.head,r=0;n;)l(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:"consume",value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var o=t.data,i=e>o.length?o.length:e;if(i===o.length?r+=o:r+=o.slice(0,e),0===(e-=i)){i===o.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=o.slice(i));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=i.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,a),0===(e-=a)){a===o.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(a));break}++r}return this.length-=r,t}},{key:s,value:function(e,n){return a(this,t(t({},n),{},{depth:0,customInspect:!1}))}}]),e}(),eo}function lo(){if(ro)return no;function e(e,r){n(e,r),t(e)}function t(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function n(e,t){e.emit("error",t)}return ro=1,no={destroy:function(r,o){var i=this,a=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return a||s?(o?o(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,N.nextTick(n,this,r)):N.nextTick(n,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,function(n){!o&&n?i._writableState?i._writableState.errorEmitted?N.nextTick(t,i):(i._writableState.errorEmitted=!0,N.nextTick(e,i,n)):N.nextTick(e,i,n):o?(N.nextTick(t,i),o(n)):N.nextTick(t,i)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}}}var uo,co,fo,po,ho,yo,go,mo,vo,bo={};function wo(){if(uo)return bo;uo=1;var e={};function t(t,n,r){r||(r=Error);var o=function(e){var t,r;function o(t,r,o){return e.call(this,function(e,t,r){return"string"==typeof n?n:n(e,t,r)}(t,r,o))||this}return r=e,(t=o).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,o}(r);o.prototype.name=r.name,o.prototype.code=t,e[t]=o}function n(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map(function(e){return String(e)}),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}return t("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),t("ERR_INVALID_ARG_TYPE",function(e,t,r){var o,i,a;if("string"==typeof t&&(i="not ",t.substr(0,i.length)===i)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))a="The ".concat(e," ").concat(o," ").concat(n(t,"type"));else{var s=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}(e,".")?"property":"argument";a='The "'.concat(e,'" ').concat(s," ").concat(o," ").concat(n(t,"type"))}return a+=". Received type ".concat(typeof r)},TypeError),t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),t("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),t("ERR_STREAM_PREMATURE_CLOSE","Premature close"),t("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),t("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),t("ERR_STREAM_WRITE_AFTER_END","write after end"),t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),t("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),bo.codes=e,bo}function So(){if(fo)return co;fo=1;var e=wo().codes.ERR_INVALID_OPT_VALUE;return co={getHighWaterMark:function(t,n,r,o){var i=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(n,o,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new e(o?r:"highWaterMark",i);return Math.floor(i)}return t.objectMode?16:16384}}}function ko(){if(ho)return po;function e(e){try{if(!m.localStorage)return!1}catch(n){return!1}var t=m.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}return ho=1,po=function(t,n){if(e("noDeprecation"))return t;var r=!1;return function(){if(!r){if(e("throwDeprecation"))throw new Error(n);e("traceDeprecation")?console.trace(n):console.warn(n),r=!0}return t.apply(this,arguments)}},po}function xo(){if(go)return yo;function e(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var o=r.callback;t.pendingcb--,o(n),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}var t;go=1,yo=k,k.WritableState=S;var n={deprecate:ko()},r=et(),o=rt().Buffer,i=(void 0!==m?m:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var a,s=lo(),l=So().getHighWaterMark,u=wo().codes,c=u.ERR_INVALID_ARG_TYPE,f=u.ERR_METHOD_NOT_IMPLEMENTED,p=u.ERR_MULTIPLE_CALLBACK,h=u.ERR_STREAM_CANNOT_PIPE,d=u.ERR_STREAM_DESTROYED,y=u.ERR_STREAM_NULL_VALUES,g=u.ERR_STREAM_WRITE_AFTER_END,v=u.ERR_UNKNOWN_ENCODING,b=s.errorOrDestroy;function w(){}function S(n,r,o){t=t||Eo(),n=n||{},"boolean"!=typeof o&&(o=r instanceof t),this.objectMode=!!n.objectMode,o&&(this.objectMode=this.objectMode||!!n.writableObjectMode),this.highWaterMark=l(this,n,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=!1===n.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=n.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,o=n.writecb;if("function"!=typeof o)throw new p;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,o){--t.pendingcb,n?(N.nextTick(o,r),N.nextTick(T,e,t),e._writableState.errorEmitted=!0,b(e,r)):(o(r),e._writableState.errorEmitted=!0,b(e,r),T(e,t))}(e,n,r,t,o);else{var i=C(n)||e.destroyed;i||n.corked||n.bufferProcessing||!n.bufferedRequest||_(e,n),r?N.nextTick(E,e,n,i,o):E(e,n,i,o)}}(r,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==n.emitClose,this.autoDestroy=!!n.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}function k(e){var n=this instanceof(t=t||Eo());if(!n&&!a.call(k,this))return new k(e);this._writableState=new S(e,this,n),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),r.call(this)}function x(e,t,n,r,o,i,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new d("write")):n?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function E(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),T(e,t)}function _(t,n){n.bufferProcessing=!0;var r=n.bufferedRequest;if(t._writev&&r&&r.next){var o=n.bufferedRequestCount,i=new Array(o),a=n.corkedRequestsFree;a.entry=r;for(var s=0,l=!0;r;)i[s]=r,r.isBuf||(l=!1),r=r.next,s+=1;i.allBuffers=l,x(t,n,!0,n.length,i,"",a.finish),n.pendingcb++,n.lastBufferedRequest=null,a.next?(n.corkedRequestsFree=a.next,a.next=null):n.corkedRequestsFree=new e(n),n.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,f=r.callback;if(x(t,n,!1,n.objectMode?1:u.length,u,c,f),r=r.next,n.bufferedRequestCount--,n.writing)break}null===r&&(n.lastBufferedRequest=null)}n.bufferedRequest=r,n.bufferProcessing=!1}function C(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function I(e,t){e._final(function(n){t.pendingcb--,n&&b(e,n),t.prefinished=!0,e.emit("prefinish"),T(e,t)})}function T(e,t){var n=C(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,N.nextTick(I,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}return io()(k,r),S.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(S.prototype,"buffer",{get:n.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:function(e){return!!a.call(this,e)||this===k&&(e&&e._writableState instanceof S)}})):a=function(e){return e instanceof this},k.prototype.pipe=function(){b(this,new h)},k.prototype.write=function(e,t,n){var r,a=this._writableState,s=!1,l=!a.objectMode&&(r=e,o.isBuffer(r)||r instanceof i);return l&&!o.isBuffer(e)&&(e=function(e){return o.from(e)}(e)),"function"==typeof t&&(n=t,t=null),l?t="buffer":t||(t=a.defaultEncoding),"function"!=typeof n&&(n=w),a.ending?function(e,t){var n=new g;b(e,n),N.nextTick(t,n)}(this,n):(l||function(e,t,n,r){var o;return null===n?o=new y:"string"==typeof n||t.objectMode||(o=new c("chunk",["string","Buffer"],n)),!o||(b(e,o),N.nextTick(r,o),!1)}(this,a,e,n))&&(a.pendingcb++,s=function(e,t,n,r,i,a){if(!n){var s=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=o.from(t,n));return t}(t,r,i);r!==s&&(n=!0,i="buffer",r=s)}var l=t.objectMode?1:r.length;t.length+=l;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:a,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else x(e,t,!1,l,r,i,a);return u}(this,a,l,e,t,n)),s},k.prototype.cork=function(){this._writableState.corked++},k.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||_(this,e))},k.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new v(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(e,t,n){n(new f("_write()"))},k.prototype._writev=null,k.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,n){t.ending=!0,T(e,t),n&&(t.finished?N.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),k.prototype.destroy=s.destroy,k.prototype._undestroy=s.undestroy,k.prototype._destroy=function(e,t){t(e)},yo}function Eo(){if(vo)return mo;vo=1;var e=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};mo=a;var t=ri(),n=xo();io()(a,t);for(var r=e(n.prototype),o=0;o<r.length;o++){var i=r[o];a.prototype[i]||(a.prototype[i]=n.prototype[i])}function a(e){if(!(this instanceof a))return new a(e);t.call(this,e),n.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",s)))}function s(){this._writableState.ended||N.nextTick(l,this)}function l(e){e.end()}return Object.defineProperty(a.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(a.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(a.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(a.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),mo}var _o,Co,Io,To,Ao,Po,jo,Oo,Ro,Mo,Lo,Bo,No,Uo,Do,zo,Fo,Ho,Wo,qo,Vo,Ko,$o,Qo,Go,Yo,Xo,Zo={},Jo={exports:{}};function ei(){if(Co)return Zo;Co=1;var e=(_o||(_o=1,function(e,t){var n=rt(),r=n.Buffer;function o(e,t){for(var n in e)t[n]=e[n]}function i(e,t,n){return r(e,t,n)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=i),i.prototype=Object.create(r.prototype),o(r,i),i.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return r(e,t,n)},i.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var o=r(e);return void 0!==t?"string"==typeof n?o.fill(t,n):o.fill(t):o.fill(0),o},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}}(Jo,Jo.exports)),Jo.exports).Buffer,t=e.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(n){var r;switch(this.encoding=function(n){var r=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(n);if("string"!=typeof r&&(e.isEncoding===t||!t(n)))throw new Error("Unknown encoding: "+n);return r||n}(n),this.encoding){case"utf16le":this.text=i,this.end=a,r=4;break;case"utf8":this.fillLast=o,r=4;break;case"base64":this.text=s,this.end=l,r=3;break;default:return this.write=u,void(this.end=c)}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(r)}function r(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,n=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function i(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function a(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function s(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function u(e){return e.toString(this.encoding)}function c(e){return e&&e.length?this.write(e):""}return Zo.StringDecoder=n,n.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},n.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},n.prototype.text=function(e,t){var n=function(e,t,n){var o=t.length-1;if(o<n)return 0;var i=r(t[o]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--o<n||-2===i)return 0;if(i=r(t[o]),i>=0)return i>0&&(e.lastNeed=i-2),i;if(--o<n||-2===i)return 0;if(i=r(t[o]),i>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var o=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,o),e.toString("utf8",t,o)},n.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length},Zo}function ti(){if(To)return Io;To=1;var e=wo().codes.ERR_STREAM_PREMATURE_CLOSE;function t(){}return Io=function n(r,o,i){if("function"==typeof o)return n(r,null,o);o||(o={}),i=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];e.apply(this,r)}}}(i||t);var a=o.readable||!1!==o.readable&&r.readable,s=o.writable||!1!==o.writable&&r.writable,l=function(){r.writable||c()},u=r._writableState&&r._writableState.finished,c=function(){s=!1,u=!0,a||i.call(r)},f=r._readableState&&r._readableState.endEmitted,p=function(){a=!1,f=!0,s||i.call(r)},h=function(e){i.call(r,e)},d=function(){var t;return a&&!f?(r._readableState&&r._readableState.ended||(t=new e),i.call(r,t)):s&&!u?(r._writableState&&r._writableState.ended||(t=new e),i.call(r,t)):void 0},y=function(){r.req.on("finish",c)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(r)?s&&!r._writableState&&(r.on("end",l),r.on("close",l)):(r.on("complete",c),r.on("abort",d),r.req?y():r.on("request",y)),r.on("end",p),r.on("finish",c),!1!==o.error&&r.on("error",h),r.on("close",d),function(){r.removeListener("complete",c),r.removeListener("abort",d),r.removeListener("request",y),r.req&&r.req.removeListener("finish",c),r.removeListener("end",l),r.removeListener("close",l),r.removeListener("finish",c),r.removeListener("end",p),r.removeListener("error",h),r.removeListener("close",d)}},Io}function ni(){if(Po)return Ao;var e;function t(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Po=1;var n=ti(),r=Symbol("lastResolve"),o=Symbol("lastReject"),i=Symbol("error"),a=Symbol("ended"),s=Symbol("lastPromise"),l=Symbol("handlePromise"),u=Symbol("stream");function c(e,t){return{value:e,done:t}}function f(e){var t=e[r];if(null!==t){var n=e[u].read();null!==n&&(e[s]=null,e[r]=null,e[o]=null,t(c(n,!1)))}}function p(e){N.nextTick(f,e)}var h=Object.getPrototypeOf(function(){}),d=Object.setPrototypeOf((t(e={get stream(){return this[u]},next:function(){var e=this,t=this[i];if(null!==t)return Promise.reject(t);if(this[a])return Promise.resolve(c(void 0,!0));if(this[u].destroyed)return new Promise(function(t,n){N.nextTick(function(){e[i]?n(e[i]):t(c(void 0,!0))})});var n,r=this[s];if(r)n=new Promise(function(e,t){return function(n,r){e.then(function(){t[a]?n(c(void 0,!0)):t[l](n,r)},r)}}(r,this));else{var o=this[u].read();if(null!==o)return Promise.resolve(c(o,!1));n=new Promise(this[l])}return this[s]=n,n}},Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var e=this;return new Promise(function(t,n){e[u].destroy(null,function(e){e?n(e):t(c(void 0,!0))})})}),e),h);return Ao=function(e){var f,h=Object.create(d,(t(f={},u,{value:e,writable:!0}),t(f,r,{value:null,writable:!0}),t(f,o,{value:null,writable:!0}),t(f,i,{value:null,writable:!0}),t(f,a,{value:e._readableState.endEmitted,writable:!0}),t(f,l,{value:function(e,t){var n=h[u].read();n?(h[s]=null,h[r]=null,h[o]=null,e(c(n,!1))):(h[r]=e,h[o]=t)},writable:!0}),f));return h[s]=null,n(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=h[o];return null!==t&&(h[s]=null,h[r]=null,h[o]=null,t(e)),void(h[i]=e)}var n=h[r];null!==n&&(h[s]=null,h[r]=null,h[o]=null,n(c(void 0,!0))),h[a]=!0}),e.on("readable",p.bind(null,h)),h}}function ri(){if(Mo)return Ro;var e;Mo=1,Ro=k,k.ReadableState=S,Ge().EventEmitter;var t=function(e,t){return e.listeners(t).length},n=et(),r=rt().Buffer,o=(void 0!==m?m:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var i,a=ao();i=a&&a.debuglog?a.debuglog("stream"):function(){};var s,l,u,c=so(),f=lo(),p=So().getHighWaterMark,h=wo().codes,d=h.ERR_INVALID_ARG_TYPE,y=h.ERR_STREAM_PUSH_AFTER_EOF,g=h.ERR_METHOD_NOT_IMPLEMENTED,v=h.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;io()(k,n);var b=f.errorOrDestroy,w=["error","close","destroy","pause","resume"];function S(t,n,r){e=e||Eo(),t=t||{},"boolean"!=typeof r&&(r=n instanceof e),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=p(this,t,"readableHighWaterMark",r),this.buffer=new c,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(s||(s=ei().StringDecoder),this.decoder=new s(t.encoding),this.encoding=t.encoding)}function k(t){if(e=e||Eo(),!(this instanceof k))return new k(t);var r=this instanceof e;this._readableState=new S(t,this,r),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),n.call(this)}function x(e,t,n,a,s){i("readableAddChunk",t);var l,u=e._readableState;if(null===t)u.reading=!1,function(e,t){if(i("onEofChunk"),t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?I(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,T(e)))}(e,u);else if(s||(l=function(e,t){var n;i=t,r.isBuffer(i)||i instanceof o||"string"==typeof t||void 0===t||e.objectMode||(n=new d("chunk",["string","Buffer","Uint8Array"],t));var i;return n}(u,t)),l)b(e,l);else if(u.objectMode||t&&t.length>0)if("string"==typeof t||u.objectMode||Object.getPrototypeOf(t)===r.prototype||(t=function(e){return r.from(e)}(t)),a)u.endEmitted?b(e,new v):E(e,u,t,!0);else if(u.ended)b(e,new y);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!n?(t=u.decoder.write(t),u.objectMode||0!==t.length?E(e,u,t,!1):A(e,u)):E(e,u,t,!1)}else a||(u.reading=!1,A(e,u));return!u.ended&&(u.length<u.highWaterMark||0===u.length)}function E(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&I(e)),A(e,t)}Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),k.prototype.destroy=f.destroy,k.prototype._undestroy=f.undestroy,k.prototype._destroy=function(e,t){t(e)},k.prototype.push=function(e,t){var n,o=this._readableState;return o.objectMode?n=!0:"string"==typeof e&&((t=t||o.defaultEncoding)!==o.encoding&&(e=r.from(e,t),t=""),n=!0),x(this,e,t,!1,n)},k.prototype.unshift=function(e){return x(this,e,null,!0,!1)},k.prototype.isPaused=function(){return!1===this._readableState.flowing},k.prototype.setEncoding=function(e){s||(s=ei().StringDecoder);var t=new s(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,r="";null!==n;)r+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==r&&this._readableState.buffer.push(r),this._readableState.length=r.length,this};var _=1073741824;function C(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=_?e=_:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function I(e){var t=e._readableState;i("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(i("emitReadable",t.flowing),t.emittedReadable=!0,N.nextTick(T,e))}function T(e){var t=e._readableState;i("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,M(e)}function A(e,t){t.readingMore||(t.readingMore=!0,N.nextTick(P,e,t))}function P(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var n=t.length;if(i("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function j(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function O(e){i("readable nexttick read 0"),e.read(0)}function R(e,t){i("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),M(e),t.flowing&&!t.reading&&e.read(0)}function M(e){var t=e._readableState;for(i("flow",t.flowing);t.flowing&&null!==e.read(););}function L(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function B(e){var t=e._readableState;i("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,N.nextTick(U,t,e))}function U(e,t){if(i("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function D(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}return k.prototype.read=function(e){i("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return i("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?B(this):I(this),null;if(0===(e=C(e,t))&&t.ended)return 0===t.length&&B(this),null;var r,o=t.needReadable;return i("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&i("length less than watermark",o=!0),t.ended||t.reading?i("reading or ended",o=!1):o&&(i("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=C(n,t))),null===(r=e>0?L(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&B(this)),null!==r&&this.emit("data",r),r},k.prototype._read=function(e){b(this,new g("_read()"))},k.prototype.pipe=function(e,n){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,i("pipe count=%d opts=%j",o.pipesCount,n);var a=(!n||!1!==n.end)&&e!==N.stdout&&e!==N.stderr?l:y;function s(t,n){i("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,i("cleanup"),e.removeListener("close",h),e.removeListener("finish",d),e.removeListener("drain",u),e.removeListener("error",p),e.removeListener("unpipe",s),r.removeListener("end",l),r.removeListener("end",y),r.removeListener("data",f),c=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}function l(){i("onend"),e.end()}o.endEmitted?N.nextTick(a):r.once("end",a),e.on("unpipe",s);var u=function(e){return function(){var n=e._readableState;i("pipeOnDrain",n.awaitDrain),n.awaitDrain&&n.awaitDrain--,0===n.awaitDrain&&t(e,"data")&&(n.flowing=!0,M(e))}}(r);e.on("drain",u);var c=!1;function f(t){i("ondata");var n=e.write(t);i("dest.write",n),!1===n&&((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==D(o.pipes,e))&&!c&&(i("false write response, pause",o.awaitDrain),o.awaitDrain++),r.pause())}function p(n){i("onerror",n),y(),e.removeListener("error",p),0===t(e,"error")&&b(e,n)}function h(){e.removeListener("finish",d),y()}function d(){i("onfinish"),e.removeListener("close",h),y()}function y(){i("unpipe"),r.unpipe(e)}return r.on("data",f),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",p),e.once("close",h),e.once("finish",d),e.emit("pipe",r),o.flowing||(i("pipe resume"),r.resume()),e},k.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<o;i++)r[i].emit("unpipe",this,{hasUnpiped:!1});return this}var a=D(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},k.prototype.on=function(e,t){var r=n.prototype.on.call(this,e,t),o=this._readableState;return"data"===e?(o.readableListening=this.listenerCount("readable")>0,!1!==o.flowing&&this.resume()):"readable"===e&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,i("on readable",o.length,o.reading),o.length?I(this):o.reading||N.nextTick(O,this))),r},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(e,t){var r=n.prototype.removeListener.call(this,e,t);return"readable"===e&&N.nextTick(j,this),r},k.prototype.removeAllListeners=function(e){var t=n.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||N.nextTick(j,this),t},k.prototype.resume=function(){var e=this._readableState;return e.flowing||(i("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,N.nextTick(R,e,t))}(this,e)),e.paused=!1,this},k.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var o in e.on("end",function(){if(i("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(o){(i("wrapped data"),n.decoder&&(o=n.decoder.write(o)),n.objectMode&&null==o)||(n.objectMode||o&&o.length)&&(t.push(o)||(r=!0,e.pause()))}),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var a=0;a<w.length;a++)e.on(w[a],this.emit.bind(this,w[a]));return this._read=function(t){i("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(k.prototype[Symbol.asyncIterator]=function(){return void 0===l&&(l=ni()),l(this)}),Object.defineProperty(k.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(k.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(k.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),k._fromList=L,Object.defineProperty(k.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(k.from=function(e,t){return void 0===u&&(u=Oo?jo:(Oo=1,jo=function(){throw new Error("Readable.from is not available in the browser")})),u(k,e,t)}),Ro}function oi(){if(Bo)return Lo;Bo=1,Lo=s;var e=wo().codes,t=e.ERR_METHOD_NOT_IMPLEMENTED,n=e.ERR_MULTIPLE_CALLBACK,r=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=e.ERR_TRANSFORM_WITH_LENGTH_0,i=Eo();function a(e,t){var r=this._transformState;r.transforming=!1;var o=r.writecb;if(null===o)return this.emit("error",new n);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),o(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function s(e){if(!(this instanceof s))return new s(e);i.call(this,e),this._transformState={afterTransform:a.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",l)}function l(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?u(this,null,null):this._flush(function(t,n){u(e,t,n)})}function u(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new o;if(e._transformState.transforming)throw new r;return e.push(null)}return io()(s,i),s.prototype.push=function(e,t){return this._transformState.needTransform=!1,i.prototype.push.call(this,e,t)},s.prototype._transform=function(e,n,r){r(new t("_transform()"))},s.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var o=this._readableState;(r.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},s.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},s.prototype._destroy=function(e,t){i.prototype._destroy.call(this,e,function(e){t(e)})},Lo}function ii(){if(zo)return Do;var e;zo=1;var t=wo().codes,n=t.ERR_MISSING_ARGS,r=t.ERR_STREAM_DESTROYED;function o(e){if(e)throw e}function i(e){e()}function a(e,t){return e.pipe(t)}return Do=function(){for(var t=arguments.length,s=new Array(t),l=0;l<t;l++)s[l]=arguments[l];var u,c=function(e){return e.length?"function"!=typeof e[e.length-1]?o:e.pop():o}(s);if(Array.isArray(s[0])&&(s=s[0]),s.length<2)throw new n("streams");var f=s.map(function(t,n){var o=n<s.length-1;return function(t,n,o,i){i=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(i);var a=!1;t.on("close",function(){a=!0}),void 0===e&&(e=ti()),e(t,{readable:n,writable:o},function(e){if(e)return i(e);a=!0,i()});var s=!1;return function(e){if(!a&&!s)return s=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void i(e||new r("pipe"))}}(t,o,n>0,function(e){u||(u=e),e&&f.forEach(i),o||(f.forEach(i),c(u))})});return s.reduce(a)},Do}function ai(){return Fo||(Fo=1,e=Je.exports,(e=Je.exports=ri()).Stream=e,e.Readable=e,e.Writable=xo(),e.Duplex=Eo(),e.Transform=oi(),e.PassThrough=function(){if(Uo)return No;Uo=1,No=t;var e=oi();function t(n){if(!(this instanceof t))return new t(n);e.call(this,n)}return io()(t,e),t.prototype._transform=function(e,t,n){n(null,e)},No}(),e.finished=ti(),e.pipeline=ii()),Je.exports;var e}function si(){if(Wo)return Ho;Wo=1;const e=Ye(),t=ai().Readable,n={objectMode:!0},r={clean:!0};function o(t){if(!(this instanceof o))return new o(t);this.options=t||{},this.options=e(r,t),this._inflights=new Map}return o.prototype.put=function(e,t){return this._inflights.set(e.messageId,e),t&&t(),this},o.prototype.createStream=function(){const e=new t(n),r=[];let o=!1,i=0;return this._inflights.forEach(function(e,t){r.push(e)}),e._read=function(){!o&&i<r.length?this.push(r[i++]):this.push(null)},e.destroy=function(){if(o)return;const e=this;o=!0,setTimeout(function(){e.emit("close")},0)},e},o.prototype.del=function(e,t){return(e=this._inflights.get(e.messageId))?(this._inflights.delete(e.messageId),t(null,e)):t&&t(new Error("missing packet")),this},o.prototype.get=function(e,t){return(e=this._inflights.get(e.messageId))?t(null,e):t&&t(new Error("missing packet")),this},o.prototype.close=function(e){this.options.clean&&(this._inflights=null),e&&e()},Ho=o}function li(){if(Go)return Qo;function e(t){var n=this;if(n instanceof e||(n=new e),n.tail=null,n.head=null,n.length=0,t&&"function"==typeof t.forEach)t.forEach(function(e){n.push(e)});else if(arguments.length>0)for(var r=0,o=arguments.length;r<o;r++)n.push(arguments[r]);return n}function t(e,t,n){var r=t===e.head?new o(n,null,t,e):new o(n,t,t.next,e);return null===r.next&&(e.tail=r),null===r.prev&&(e.head=r),e.length++,r}function n(e,t){e.tail=new o(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function r(e,t){e.head=new o(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function o(e,t,n,r){if(!(this instanceof o))return new o(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}Go=1,Qo=e,e.Node=o,e.create=e,e.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t},e.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},e.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},e.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)n(this,arguments[e]);return this.length},e.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)r(this,arguments[e]);return this.length},e.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},e.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},e.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;null!==n;r++)e.call(t,n.value,r,this),n=n.next},e.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;null!==n;r--)e.call(t,n.value,r,this),n=n.prev},e.prototype.get=function(e){for(var t=0,n=this.head;null!==n&&t<e;t++)n=n.next;if(t===e&&null!==n)return n.value},e.prototype.getReverse=function(e){for(var t=0,n=this.tail;null!==n&&t<e;t++)n=n.prev;if(t===e&&null!==n)return n.value},e.prototype.map=function(t,n){n=n||this;for(var r=new e,o=this.head;null!==o;)r.push(t.call(n,o.value,this)),o=o.next;return r},e.prototype.mapReverse=function(t,n){n=n||this;for(var r=new e,o=this.tail;null!==o;)r.push(t.call(n,o.value,this)),o=o.prev;return r},e.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var o=0;null!==r;o++)n=e(n,r.value,o),r=r.next;return n},e.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var o=this.length-1;null!==r;o--)n=e(n,r.value,o),r=r.prev;return n},e.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},e.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},e.prototype.slice=function(t,n){(n=n||this.length)<0&&(n+=this.length),(t=t||0)<0&&(t+=this.length);var r=new e;if(n<t||n<0)return r;t<0&&(t=0),n>this.length&&(n=this.length);for(var o=0,i=this.head;null!==i&&o<t;o++)i=i.next;for(;null!==i&&o<n;o++,i=i.next)r.push(i.value);return r},e.prototype.sliceReverse=function(t,n){(n=n||this.length)<0&&(n+=this.length),(t=t||0)<0&&(t+=this.length);var r=new e;if(n<t||n<0)return r;t<0&&(t=0),n>this.length&&(n=this.length);for(var o=this.length,i=this.tail;null!==i&&o>n;o--)i=i.prev;for(;null!==i&&o>t;o--,i=i.prev)r.push(i.value);return r},e.prototype.splice=function(e,n,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var o=0,i=this.head;null!==i&&o<e;o++)i=i.next;var a=[];for(o=0;i&&o<n;o++)a.push(i.value),i=this.removeNode(i);null===i&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(o=0;o<r.length;o++)i=t(this,i,r[o]);return a},e.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;null!==n;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};try{($o?Ko:($o=1,Ko=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}))(e)}catch(i){}return Qo}var ui={},ci=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),fi=function(){function e(e){void 0===e&&(e=0),this.iteratorType=e}return e.prototype.equals=function(e){return this.o===e.o},e}(),pi=function(){function e(){this.M=0}return Object.defineProperty(e.prototype,"length",{get:function(){return this.M},enumerable:!1,configurable:!0}),e.prototype.size=function(){return this.M},e.prototype.empty=function(){return 0===this.M},e}(),hi=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ci(t,e),t}(pi),di=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yi=function(e){function t(t){void 0===t&&(t=[]);var n=e.call(this)||this;n.nt=[];var r=n;return t.forEach(function(e){r.push(e)}),n}return di(t,e),t.prototype.clear=function(){this.M=0,this.nt=[]},t.prototype.push=function(e){return this.nt.push(e),this.M+=1,this.M},t.prototype.pop=function(){if(0!==this.M)return this.M-=1,this.nt.pop()},t.prototype.top=function(){return this.nt[this.M-1]},t}(pi),gi=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),mi=function(e){function t(t){void 0===t&&(t=[]);var n=e.call(this)||this;n.A=0,n.tt=[];var r=n;return t.forEach(function(e){r.push(e)}),n}return gi(t,e),t.prototype.clear=function(){this.tt=[],this.M=this.A=0},t.prototype.push=function(e){var t=this.tt.length;if(this.A/t>.5&&this.A+this.M>=t&&t>4096){for(var n=this.M,r=0;r<n;++r)this.tt[r]=this.tt[this.A+r];this.A=0,this.tt[this.M]=e}else this.tt[this.A+this.M]=e;return++this.M},t.prototype.pop=function(){if(0!==this.M){var e=this.tt[this.A++];return this.M-=1,e}},t.prototype.front=function(){if(0!==this.M)return this.tt[this.A]},t}(pi),vi=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),bi=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},wi=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},Si=function(e){function t(t,n,r){void 0===t&&(t=[]),void 0===n&&(n=function(e,t){return e>t?-1:e<t?1:0}),void 0===r&&(r=!0);var o=e.call(this)||this;if(o.$=n,Array.isArray(t))o.ii=r?wi([],bi(t),!1):t;else{o.ii=[];var i=o;t.forEach(function(e){i.ii.push(e)})}o.M=o.ii.length;for(var a=o.M>>1,s=o.M-1>>1;s>=0;--s)o.ri(s,a);return o}return vi(t,e),t.prototype.ti=function(e){for(var t=this.ii[e];e>0;){var n=e-1>>1,r=this.ii[n];if(this.$(r,t)<=0)break;this.ii[e]=r,e=n}this.ii[e]=t},t.prototype.ri=function(e,t){for(var n=this.ii[e];e<t;){var r=e<<1|1,o=r+1,i=this.ii[r];if(o<this.M&&this.$(i,this.ii[o])>0&&(r=o,i=this.ii[o]),this.$(i,n)>=0)break;this.ii[e]=i,e=r}this.ii[e]=n},t.prototype.clear=function(){this.M=0,this.ii.length=0},t.prototype.push=function(e){this.ii.push(e),this.ti(this.M),this.M+=1},t.prototype.pop=function(){if(0!==this.M){var e=this.ii[0],t=this.ii.pop();return this.M-=1,this.M&&(this.ii[0]=t,this.ri(0,this.M>>1)),e}},t.prototype.top=function(){return this.ii[0]},t.prototype.find=function(e){return this.ii.indexOf(e)>=0},t.prototype.remove=function(e){var t=this.ii.indexOf(e);return!(t<0)&&(0===t?this.pop():t===this.M-1?(this.ii.pop(),this.M-=1):(this.ii.splice(t,1,this.ii.pop()),this.M-=1,this.ti(t),this.ri(t,this.M>>1)),!0)},t.prototype.updateItem=function(e){var t=this.ii.indexOf(e);return!(t<0)&&(this.ti(t),this.ri(t,this.M>>1),!0)},t.prototype.toArray=function(){return wi([],bi(this.ii),!1)},t}(pi),ki=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xi=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ki(t,e),t}(hi);function Ei(){throw new RangeError("Iterator access denied!")}var _i=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ci=function(e){function t(t,n){var r=e.call(this,n)||this;return r.o=t,0===r.iteratorType?(r.pre=function(){return 0===this.o&&Ei(),this.o-=1,this},r.next=function(){return this.o===this.container.size()&&Ei(),this.o+=1,this}):(r.pre=function(){return this.o===this.container.size()-1&&Ei(),this.o+=1,this},r.next=function(){return-1===this.o&&Ei(),this.o-=1,this}),r}return _i(t,e),Object.defineProperty(t.prototype,"pointer",{get:function(){return this.container.getElementByPos(this.o)},set:function(e){this.container.setElementByPos(this.o,e)},enumerable:!1,configurable:!0}),t}(fi),Ii=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ti=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(i){s=[6,i],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([i,s])}}},Ai=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Pi=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},ji=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Oi=function(e){function t(t,n,r){var o=e.call(this,t,r)||this;return o.container=n,o}return Ii(t,e),t.prototype.copy=function(){return new t(this.o,this.container,this.iteratorType)},t}(Ci),Ri=function(e){function t(t,n){void 0===t&&(t=[]),void 0===n&&(n=!0);var r=e.call(this)||this;if(Array.isArray(t))r.J=n?Pi([],Ai(t),!1):t,r.M=t.length;else{r.J=[];var o=r;t.forEach(function(e){o.pushBack(e)})}return r}return Ii(t,e),t.prototype.clear=function(){this.M=0,this.J.length=0},t.prototype.begin=function(){return new Oi(0,this)},t.prototype.end=function(){return new Oi(this.M,this)},t.prototype.rBegin=function(){return new Oi(this.M-1,this,1)},t.prototype.rEnd=function(){return new Oi(-1,this,1)},t.prototype.front=function(){return this.J[0]},t.prototype.back=function(){return this.J[this.M-1]},t.prototype.getElementByPos=function(e){if(e<0||e>this.M-1)throw new RangeError;return this.J[e]},t.prototype.eraseElementByPos=function(e){if(e<0||e>this.M-1)throw new RangeError;return this.J.splice(e,1),this.M-=1,this.M},t.prototype.eraseElementByValue=function(e){for(var t=0,n=0;n<this.M;++n)this.J[n]!==e&&(this.J[t++]=this.J[n]);return this.M=this.J.length=t,this.M},t.prototype.eraseElementByIterator=function(e){var t=e.o;return e=e.next(),this.eraseElementByPos(t),e},t.prototype.pushBack=function(e){return this.J.push(e),this.M+=1,this.M},t.prototype.popBack=function(){if(0!==this.M)return this.M-=1,this.J.pop()},t.prototype.setElementByPos=function(e,t){if(e<0||e>this.M-1)throw new RangeError;this.J[e]=t},t.prototype.insert=function(e,t,n){var r;if(void 0===n&&(n=1),e<0||e>this.M)throw new RangeError;return(r=this.J).splice.apply(r,Pi([e,0],Ai(new Array(n).fill(t)),!1)),this.M+=n,this.M},t.prototype.find=function(e){for(var t=0;t<this.M;++t)if(this.J[t]===e)return new Oi(t,this);return this.end()},t.prototype.reverse=function(){this.J.reverse()},t.prototype.unique=function(){for(var e=1,t=1;t<this.M;++t)this.J[t]!==this.J[t-1]&&(this.J[e++]=this.J[t]);return this.M=this.J.length=e,this.M},t.prototype.sort=function(e){this.J.sort(e)},t.prototype.forEach=function(e){for(var t=0;t<this.M;++t)e(this.J[t],t,this)},t.prototype[Symbol.iterator]=function(){return function(){return Ti(this,function(e){switch(e.label){case 0:return[5,ji(this.J)];case 1:return e.sent(),[2]}})}.bind(this)()},t}(xi),Mi=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Li=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(i){s=[6,i],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([i,s])}}},Bi=function(e){function t(t,n,r,o){var i=e.call(this,o)||this;return i.o=t,i.h=n,i.container=r,0===i.iteratorType?(i.pre=function(){return this.o.L===this.h&&Ei(),this.o=this.o.L,this},i.next=function(){return this.o===this.h&&Ei(),this.o=this.o.m,this}):(i.pre=function(){return this.o.m===this.h&&Ei(),this.o=this.o.m,this},i.next=function(){return this.o===this.h&&Ei(),this.o=this.o.L,this}),i}return Mi(t,e),Object.defineProperty(t.prototype,"pointer",{get:function(){return this.o===this.h&&Ei(),this.o.p},set:function(e){this.o===this.h&&Ei(),this.o.p=e},enumerable:!1,configurable:!0}),t.prototype.copy=function(){return new t(this.o,this.h,this.container,this.iteratorType)},t}(fi),Ni=function(e){function t(t){void 0===t&&(t=[]);var n=e.call(this)||this;n.h={},n.H=n.l=n.h.L=n.h.m=n.h;var r=n;return t.forEach(function(e){r.pushBack(e)}),n}return Mi(t,e),t.prototype.G=function(e){var t=e.L,n=e.m;t.m=n,n.L=t,e===this.H&&(this.H=n),e===this.l&&(this.l=t),this.M-=1},t.prototype.F=function(e,t){var n=t.m,r={p:e,L:t,m:n};t.m=r,n.L=r,t===this.h&&(this.H=r),n===this.h&&(this.l=r),this.M+=1},t.prototype.clear=function(){this.M=0,this.H=this.l=this.h.L=this.h.m=this.h},t.prototype.begin=function(){return new Bi(this.H,this.h,this)},t.prototype.end=function(){return new Bi(this.h,this.h,this)},t.prototype.rBegin=function(){return new Bi(this.l,this.h,this,1)},t.prototype.rEnd=function(){return new Bi(this.h,this.h,this,1)},t.prototype.front=function(){return this.H.p},t.prototype.back=function(){return this.l.p},t.prototype.getElementByPos=function(e){if(e<0||e>this.M-1)throw new RangeError;for(var t=this.H;e--;)t=t.m;return t.p},t.prototype.eraseElementByPos=function(e){if(e<0||e>this.M-1)throw new RangeError;for(var t=this.H;e--;)t=t.m;return this.G(t),this.M},t.prototype.eraseElementByValue=function(e){for(var t=this.H;t!==this.h;)t.p===e&&this.G(t),t=t.m;return this.M},t.prototype.eraseElementByIterator=function(e){var t=e.o;return t===this.h&&Ei(),e=e.next(),this.G(t),e},t.prototype.pushBack=function(e){return this.F(e,this.l),this.M},t.prototype.popBack=function(){if(0!==this.M){var e=this.l.p;return this.G(this.l),e}},t.prototype.pushFront=function(e){return this.F(e,this.h),this.M},t.prototype.popFront=function(){if(0!==this.M){var e=this.H.p;return this.G(this.H),e}},t.prototype.setElementByPos=function(e,t){if(e<0||e>this.M-1)throw new RangeError;for(var n=this.H;e--;)n=n.m;n.p=t},t.prototype.insert=function(e,t,n){if(void 0===n&&(n=1),e<0||e>this.M)throw new RangeError;if(n<=0)return this.M;if(0===e)for(;n--;)this.pushFront(t);else if(e===this.M)for(;n--;)this.pushBack(t);else{for(var r=this.H,o=1;o<e;++o)r=r.m;var i=r.m;for(this.M+=n;n--;)r.m={p:t,L:r},r.m.L=r,r=r.m;r.m=i,i.L=r}return this.M},t.prototype.find=function(e){for(var t=this.H;t!==this.h;){if(t.p===e)return new Bi(t,this.h,this);t=t.m}return this.end()},t.prototype.reverse=function(){if(!(this.M<=1))for(var e=this.H,t=this.l,n=0;n<<1<this.M;){var r=e.p;e.p=t.p,t.p=r,e=e.m,t=t.L,n+=1}},t.prototype.unique=function(){if(this.M<=1)return this.M;for(var e=this.H;e!==this.h;){for(var t=e;t.m!==this.h&&t.p===t.m.p;)t=t.m,this.M-=1;e.m=t.m,e.m.L=e,e=e.m}return this.M},t.prototype.sort=function(e){if(!(this.M<=1)){var t=[];this.forEach(function(e){t.push(e)}),t.sort(e);var n=this.H;t.forEach(function(e){n.p=e,n=n.m})}},t.prototype.merge=function(e){var t=this;if(0===this.M)e.forEach(function(e){t.pushBack(e)});else{var n=this.H;e.forEach(function(e){for(;n!==t.h&&n.p<=e;)n=n.m;t.F(e,n.L)})}return this.M},t.prototype.forEach=function(e){for(var t=this.H,n=0;t!==this.h;)e(t.p,n++,this),t=t.m},t.prototype[Symbol.iterator]=function(){return function(){var e;return Li(this,function(t){switch(t.label){case 0:if(0===this.M)return[2];e=this.H,t.label=1;case 1:return e===this.h?[3,3]:[4,e.p];case 2:return t.sent(),e=e.m,[3,1];case 3:return[2]}})}.bind(this)()},t}(xi),Ui=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Di=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(i){s=[6,i],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([i,s])}}},zi=function(e){function t(t,n,r){var o=e.call(this,t,r)||this;return o.container=n,o}return Ui(t,e),t.prototype.copy=function(){return new t(this.o,this.container,this.iteratorType)},t}(Ci),Fi=function(e){function t(t,n){void 0===t&&(t=[]),void 0===n&&(n=4096);var r=e.call(this)||this;r.A=0,r.S=0,r.R=0,r.k=0,r.C=0,r.j=[];var o=function(){if("number"==typeof t.length)return t.length;if("number"==typeof t.size)return t.size;if("function"==typeof t.size)return t.size();throw new TypeError("Cannot get the length or size of the container")}();r.B=n,r.C=Math.max(Math.ceil(o/r.B),1);for(var i=0;i<r.C;++i)r.j.push(new Array(r.B));var a=Math.ceil(o/r.B);r.A=r.R=(r.C>>1)-(a>>1),r.S=r.k=r.B-o%r.B>>1;var s=r;return t.forEach(function(e){s.pushBack(e)}),r}return Ui(t,e),t.prototype.O=function(){for(var e=[],t=Math.max(this.C>>1,1),n=0;n<t;++n)e[n]=new Array(this.B);for(n=this.A;n<this.C;++n)e[e.length]=this.j[n];for(n=0;n<this.R;++n)e[e.length]=this.j[n];e[e.length]=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([],function(t,n){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var o,i,a=r.call(t),s=[];try{for(;(void 0===n||n-- >0)&&!(o=a.next()).done;)s.push(o.value)}catch(e){i={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return s}(this.j[this.R]),!1),this.A=t,this.R=e.length-1;for(n=0;n<t;++n)e[e.length]=new Array(this.B);this.j=e,this.C=e.length},t.prototype.T=function(e){var t=this.S+e+1,n=t%this.B,r=n-1,o=this.A+(t-n)/this.B;return 0===n&&(o-=1),o%=this.C,r<0&&(r+=this.B),{curNodeBucketIndex:o,curNodePointerIndex:r}},t.prototype.clear=function(){this.j=[new Array(this.B)],this.C=1,this.A=this.R=this.M=0,this.S=this.k=this.B>>1},t.prototype.begin=function(){return new zi(0,this)},t.prototype.end=function(){return new zi(this.M,this)},t.prototype.rBegin=function(){return new zi(this.M-1,this,1)},t.prototype.rEnd=function(){return new zi(-1,this,1)},t.prototype.front=function(){if(0!==this.M)return this.j[this.A][this.S]},t.prototype.back=function(){if(0!==this.M)return this.j[this.R][this.k]},t.prototype.pushBack=function(e){return this.M&&(this.k<this.B-1?this.k+=1:this.R<this.C-1?(this.R+=1,this.k=0):(this.R=0,this.k=0),this.R===this.A&&this.k===this.S&&this.O()),this.M+=1,this.j[this.R][this.k]=e,this.M},t.prototype.popBack=function(){if(0!==this.M){var e=this.j[this.R][this.k];return 1!==this.M&&(this.k>0?this.k-=1:this.R>0?(this.R-=1,this.k=this.B-1):(this.R=this.C-1,this.k=this.B-1)),this.M-=1,e}},t.prototype.pushFront=function(e){return this.M&&(this.S>0?this.S-=1:this.A>0?(this.A-=1,this.S=this.B-1):(this.A=this.C-1,this.S=this.B-1),this.A===this.R&&this.S===this.k&&this.O()),this.M+=1,this.j[this.A][this.S]=e,this.M},t.prototype.popFront=function(){if(0!==this.M){var e=this.j[this.A][this.S];return 1!==this.M&&(this.S<this.B-1?this.S+=1:this.A<this.C-1?(this.A+=1,this.S=0):(this.A=0,this.S=0)),this.M-=1,e}},t.prototype.getElementByPos=function(e){if(e<0||e>this.M-1)throw new RangeError;var t=this.T(e),n=t.curNodeBucketIndex,r=t.curNodePointerIndex;return this.j[n][r]},t.prototype.setElementByPos=function(e,t){if(e<0||e>this.M-1)throw new RangeError;var n=this.T(e),r=n.curNodeBucketIndex,o=n.curNodePointerIndex;this.j[r][o]=t},t.prototype.insert=function(e,t,n){if(void 0===n&&(n=1),e<0||e>this.M)throw new RangeError;if(0===e)for(;n--;)this.pushFront(t);else if(e===this.M)for(;n--;)this.pushBack(t);else{for(var r=[],o=e;o<this.M;++o)r.push(this.getElementByPos(o));this.cut(e-1);for(o=0;o<n;++o)this.pushBack(t);for(o=0;o<r.length;++o)this.pushBack(r[o])}return this.M},t.prototype.cut=function(e){if(e<0)return this.clear(),0;var t=this.T(e),n=t.curNodeBucketIndex,r=t.curNodePointerIndex;return this.R=n,this.k=r,this.M=e+1,this.M},t.prototype.eraseElementByPos=function(e){if(e<0||e>this.M-1)throw new RangeError;if(0===e)this.popFront();else if(e===this.M-1)this.popBack();else{for(var t=[],n=e+1;n<this.M;++n)t.push(this.getElementByPos(n));this.cut(e),this.popBack();var r=this;t.forEach(function(e){r.pushBack(e)})}return this.M},t.prototype.eraseElementByValue=function(e){if(0===this.M)return 0;for(var t=[],n=0;n<this.M;++n){var r=this.getElementByPos(n);r!==e&&t.push(r)}var o=t.length;for(n=0;n<o;++n)this.setElementByPos(n,t[n]);return this.cut(o-1)},t.prototype.eraseElementByIterator=function(e){var t=e.o;return this.eraseElementByPos(t),e=e.next()},t.prototype.find=function(e){for(var t=0;t<this.M;++t)if(this.getElementByPos(t)===e)return new zi(t,this);return this.end()},t.prototype.reverse=function(){for(var e=0,t=this.M-1;e<t;){var n=this.getElementByPos(e);this.setElementByPos(e,this.getElementByPos(t)),this.setElementByPos(t,n),e+=1,t-=1}},t.prototype.unique=function(){if(this.M<=1)return this.M;for(var e=1,t=this.getElementByPos(0),n=1;n<this.M;++n){var r=this.getElementByPos(n);r!==t&&(t=r,this.setElementByPos(e++,r))}for(;this.M>e;)this.popBack();return this.M},t.prototype.sort=function(e){for(var t=[],n=0;n<this.M;++n)t.push(this.getElementByPos(n));t.sort(e);for(n=0;n<this.M;++n)this.setElementByPos(n,t[n])},t.prototype.shrinkToFit=function(){if(0!==this.M){var e=[];this.forEach(function(t){e.push(t)}),this.C=Math.max(Math.ceil(this.M/this.B),1),this.M=this.A=this.R=this.S=this.k=0,this.j=[];for(var t=0;t<this.C;++t)this.j.push(new Array(this.B));for(t=0;t<e.length;++t)this.pushBack(e[t])}},t.prototype.forEach=function(e){for(var t=0;t<this.M;++t)e(this.getElementByPos(t),t,this)},t.prototype[Symbol.iterator]=function(){return function(){var e;return Di(this,function(t){switch(t.label){case 0:e=0,t.label=1;case 1:return e<this.M?[4,this.getElementByPos(e)]:[3,4];case 2:t.sent(),t.label=3;case 3:return++e,[3,1];case 4:return[2]}})}.bind(this)()},t}(xi),Hi=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Wi=function(){function e(e,t){this.ee=1,this.u=void 0,this.p=void 0,this.K=void 0,this.N=void 0,this.rr=void 0,this.u=e,this.p=t}return e.prototype.L=function(){var e=this;if(1===e.ee&&e.rr.rr===e)e=e.N;else if(e.K)for(e=e.K;e.N;)e=e.N;else{for(var t=e.rr;t.K===e;)t=(e=t).rr;e=t}return e},e.prototype.m=function(){var e=this;if(e.N){for(e=e.N;e.K;)e=e.K;return e}for(var t=e.rr;t.N===e;)t=(e=t).rr;return e.N!==t?t:e},e.prototype.ne=function(){var e=this.rr,t=this.N,n=t.K;return e.rr===this?e.rr=t:e.K===this?e.K=t:e.N=t,t.rr=e,t.K=this,this.rr=t,this.N=n,n&&(n.rr=this),t},e.prototype.te=function(){var e=this.rr,t=this.K,n=t.N;return e.rr===this?e.rr=t:e.K===this?e.K=t:e.N=t,t.rr=e,t.N=this,this.rr=t,this.K=n,n&&(n.rr=this),t},e}(),qi=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tr=1,t}return Hi(t,e),t.prototype.ne=function(){var t=e.prototype.ne.call(this);return this.ie(),t.ie(),t},t.prototype.te=function(){var t=e.prototype.te.call(this);return this.ie(),t.ie(),t},t.prototype.ie=function(){this.tr=1,this.K&&(this.tr+=this.K.tr),this.N&&(this.tr+=this.N.tr)},t}(Wi),Vi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ki=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},$i=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Qi=function(e){function t(t,n){void 0===t&&(t=function(e,t){return e<t?-1:e>t?1:0}),void 0===n&&(n=!1);var r=e.call(this)||this;return r.W=void 0,r.$=t,n?(r.re=qi,r.v=function(e,t,n){var r=this.se(e,t,n);if(r){for(var o=r.rr;o!==this.h;)o.tr+=1,o=o.rr;var i=this.fe(r);if(i){var a=i,s=a.parentNode,l=a.grandParent,u=a.curNode;s.ie(),l.ie(),u.ie()}}return this.M},r.G=function(e){for(var t=this.he(e);t!==this.h;)t.tr-=1,t=t.rr}):(r.re=Wi,r.v=function(e,t,n){var r=this.se(e,t,n);return r&&this.fe(r),this.M},r.G=r.he),r.h=new r.re,r}return Vi(t,e),t.prototype.U=function(e,t){for(var n=this.h;e;){var r=this.$(e.u,t);if(r<0)e=e.N;else{if(!(r>0))return e;n=e,e=e.K}}return n},t.prototype.X=function(e,t){for(var n=this.h;e;){this.$(e.u,t)<=0?e=e.N:(n=e,e=e.K)}return n},t.prototype.Y=function(e,t){for(var n=this.h;e;){var r=this.$(e.u,t);if(r<0)n=e,e=e.N;else{if(!(r>0))return e;e=e.K}}return n},t.prototype.Z=function(e,t){for(var n=this.h;e;){this.$(e.u,t)<0?(n=e,e=e.N):e=e.K}return n},t.prototype.ue=function(e){for(;;){var t,n=e.rr;if(n===this.h)return;if(1===e.ee)return void(e.ee=0);if(e===n.K)if(1===(t=n.N).ee)t.ee=0,n.ee=1,n===this.W?this.W=n.ne():n.ne();else{if(t.N&&1===t.N.ee)return t.ee=n.ee,n.ee=0,t.N.ee=0,void(n===this.W?this.W=n.ne():n.ne());t.K&&1===t.K.ee?(t.ee=1,t.K.ee=0,t.te()):(t.ee=1,e=n)}else if(1===(t=n.K).ee)t.ee=0,n.ee=1,n===this.W?this.W=n.te():n.te();else{if(t.K&&1===t.K.ee)return t.ee=n.ee,n.ee=0,t.K.ee=0,void(n===this.W?this.W=n.te():n.te());t.N&&1===t.N.ee?(t.ee=1,t.N.ee=0,t.ne()):(t.ee=1,e=n)}}},t.prototype.he=function(e){var t,n;if(1===this.M)return this.clear(),this.h;for(var r=e;r.K||r.N;){if(r.N)for(r=r.N;r.K;)r=r.K;else r=r.K;t=Ki([r.u,e.u],2),e.u=t[0],r.u=t[1],n=Ki([r.p,e.p],2),e.p=n[0],r.p=n[1],e=r}this.h.K===r?this.h.K=r.rr:this.h.N===r&&(this.h.N=r.rr),this.ue(r);var o=r.rr;return r===o.K?o.K=void 0:o.N=void 0,this.M-=1,this.W.ee=0,o},t.prototype.ae=function(e,t){return void 0!==e&&(!!this.ae(e.K,t)||(!!t(e)||this.ae(e.N,t)))},t.prototype.fe=function(e){for(;;){var t=e.rr;if(0===t.ee)return;var n=t.rr;if(t===n.K){if((r=n.N)&&1===r.ee){if(r.ee=t.ee=0,n===this.W)return;n.ee=1,e=n;continue}if(e===t.N){if(e.ee=0,e.K&&(e.K.rr=t),e.N&&(e.N.rr=n),t.N=e.K,n.K=e.N,e.K=t,e.N=n,n===this.W)this.W=e,this.h.rr=e;else(o=n.rr).K===n?o.K=e:o.N=e;return e.rr=n.rr,t.rr=e,n.rr=e,n.ee=1,{parentNode:t,grandParent:n,curNode:e}}t.ee=0,n===this.W?this.W=n.te():n.te(),n.ee=1}else{var r;if((r=n.K)&&1===r.ee){if(r.ee=t.ee=0,n===this.W)return;n.ee=1,e=n;continue}if(e===t.K){var o;if(e.ee=0,e.K&&(e.K.rr=n),e.N&&(e.N.rr=t),n.N=e.K,t.K=e.N,e.K=n,e.N=t,n===this.W)this.W=e,this.h.rr=e;else(o=n.rr).K===n?o.K=e:o.N=e;return e.rr=n.rr,t.rr=e,n.rr=e,n.ee=1,{parentNode:t,grandParent:n,curNode:e}}t.ee=0,n===this.W?this.W=n.ne():n.ne(),n.ee=1}return}},t.prototype.se=function(e,t,n){if(void 0===this.W)return this.M+=1,this.W=new this.re(e,t),this.W.ee=0,this.W.rr=this.h,this.h.rr=this.W,this.h.K=this.W,void(this.h.N=this.W);var r,o=this.h.K,i=this.$(o.u,e);if(0!==i){if(i>0)o.K=new this.re(e,t),o.K.rr=o,r=o.K,this.h.K=r;else{var a=this.h.N,s=this.$(a.u,e);if(0===s)return void(a.p=t);if(s<0)a.N=new this.re(e,t),a.N.rr=a,r=a.N,this.h.N=r;else{if(void 0!==n){var l=n.o;if(l!==this.h){var u=this.$(l.u,e);if(0===u)return void(l.p=t);if(u>0){var c=l.L(),f=this.$(c.u,e);if(0===f)return void(c.p=t);f<0&&(r=new this.re(e,t),void 0===c.N?(c.N=r,r.rr=c):(l.K=r,r.rr=l))}}}if(void 0===r)for(r=this.W;;){var p=this.$(r.u,e);if(p>0){if(void 0===r.K){r.K=new this.re(e,t),r.K.rr=r,r=r.K;break}r=r.K}else{if(!(p<0))return void(r.p=t);if(void 0===r.N){r.N=new this.re(e,t),r.N.rr=r,r=r.N;break}r=r.N}}}}return this.M+=1,r}o.p=t},t.prototype.g=function(e,t){for(;e;){var n=this.$(e.u,t);if(n<0)e=e.N;else{if(!(n>0))return e;e=e.K}}return e||this.h},t.prototype.clear=function(){this.M=0,this.W=void 0,this.h.rr=void 0,this.h.K=this.h.N=void 0},t.prototype.updateKeyByIterator=function(e,t){var n=e.o;if(n===this.h&&Ei(),1===this.M)return n.u=t,!0;if(n===this.h.K)return this.$(n.m().u,t)>0&&(n.u=t,!0);if(n===this.h.N)return this.$(n.L().u,t)<0&&(n.u=t,!0);var r=n.L().u;if(this.$(r,t)>=0)return!1;var o=n.m().u;return!(this.$(o,t)<=0)&&(n.u=t,!0)},t.prototype.eraseElementByPos=function(e){if(e<0||e>this.M-1)throw new RangeError;var t=0,n=this;return this.ae(this.W,function(r){return e===t?(n.G(r),!0):(t+=1,!1)}),this.M},t.prototype.eraseElementByKey=function(e){if(0===this.M)return!1;var t=this.g(this.W,e);return t!==this.h&&(this.G(t),!0)},t.prototype.eraseElementByIterator=function(e){var t=e.o;t===this.h&&Ei();var n=void 0===t.N;return 0===e.iteratorType?n&&e.next():n&&void 0!==t.K||e.next(),this.G(t),e},t.prototype.forEach=function(e){var t,n,r=0;try{for(var o=$i(this),i=o.next();!i.done;i=o.next()){e(i.value,r++,this)}}catch(a){t={error:a}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}},t.prototype.getElementByPos=function(e){var t,n,r;if(e<0||e>this.M-1)throw new RangeError;var o=0;try{for(var i=$i(this),a=i.next();!a.done;a=i.next()){var s=a.value;if(o===e){r=s;break}o+=1}}catch(l){t={error:l}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},t.prototype.getHeight=function(){if(0===this.M)return 0;var e=function(t){return t?Math.max(e(t.K),e(t.N))+1:0};return e(this.W)},t}(hi),Gi=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yi=function(e){function t(t,n,r){var o=e.call(this,r)||this;return o.o=t,o.h=n,0===o.iteratorType?(o.pre=function(){return this.o===this.h.K&&Ei(),this.o=this.o.L(),this},o.next=function(){return this.o===this.h&&Ei(),this.o=this.o.m(),this}):(o.pre=function(){return this.o===this.h.N&&Ei(),this.o=this.o.m(),this},o.next=function(){return this.o===this.h&&Ei(),this.o=this.o.L(),this}),o}return Gi(t,e),Object.defineProperty(t.prototype,"index",{get:function(){var e=this.o,t=this.h.rr;if(e===this.h)return t?t.tr-1:0;var n=0;for(e.K&&(n+=e.K.tr);e!==t;){var r=e.rr;e===r.N&&(n+=1,r.K&&(n+=r.K.tr)),e=r}return n},enumerable:!1,configurable:!0}),t}(fi),Xi=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Zi=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(i){s=[6,i],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([i,s])}}},Ji=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ea=function(e){function t(t,n,r,o){var i=e.call(this,t,n,o)||this;return i.container=r,i}return Xi(t,e),Object.defineProperty(t.prototype,"pointer",{get:function(){return this.o===this.h&&Ei(),this.o.u},enumerable:!1,configurable:!0}),t.prototype.copy=function(){return new t(this.o,this.h,this.container,this.iteratorType)},t}(Yi),ta=function(e){function t(t,n,r){void 0===t&&(t=[]);var o=e.call(this,n,r)||this,i=o;return t.forEach(function(e){i.insert(e)}),o}return Xi(t,e),t.prototype.P=function(e){return Zi(this,function(t){switch(t.label){case 0:return void 0===e?[2]:[5,Ji(this.P(e.K))];case 1:return t.sent(),[4,e.u];case 2:return t.sent(),[5,Ji(this.P(e.N))];case 3:return t.sent(),[2]}})},t.prototype.begin=function(){return new ea(this.h.K||this.h,this.h,this)},t.prototype.end=function(){return new ea(this.h,this.h,this)},t.prototype.rBegin=function(){return new ea(this.h.N||this.h,this.h,this,1)},t.prototype.rEnd=function(){return new ea(this.h,this.h,this,1)},t.prototype.front=function(){return this.h.K?this.h.K.u:void 0},t.prototype.back=function(){return this.h.N?this.h.N.u:void 0},t.prototype.insert=function(e,t){return this.v(e,void 0,t)},t.prototype.find=function(e){var t=this.g(this.W,e);return new ea(t,this.h,this)},t.prototype.lowerBound=function(e){var t=this.U(this.W,e);return new ea(t,this.h,this)},t.prototype.upperBound=function(e){var t=this.X(this.W,e);return new ea(t,this.h,this)},t.prototype.reverseLowerBound=function(e){var t=this.Y(this.W,e);return new ea(t,this.h,this)},t.prototype.reverseUpperBound=function(e){var t=this.Z(this.W,e);return new ea(t,this.h,this)},t.prototype.union=function(e){var t=this;return e.forEach(function(e){t.insert(e)}),this.M},t.prototype[Symbol.iterator]=function(){return this.P(this.W)},t}(Qi),na=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ra=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(i){s=[6,i],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([i,s])}}},oa=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ia=function(e){function t(t,n,r,o){var i=e.call(this,t,n,o)||this;return i.container=r,i}return na(t,e),Object.defineProperty(t.prototype,"pointer",{get:function(){this.o===this.h&&Ei();var e=this;return new Proxy([],{get:function(t,n){return"0"===n?e.o.u:"1"===n?e.o.p:void 0},set:function(t,n,r){if("1"!==n)throw new TypeError("props must be 1");return e.o.p=r,!0}})},enumerable:!1,configurable:!0}),t.prototype.copy=function(){return new t(this.o,this.h,this.container,this.iteratorType)},t}(Yi),aa=function(e){function t(t,n,r){void 0===t&&(t=[]);var o=e.call(this,n,r)||this,i=o;return t.forEach(function(e){i.setElement(e[0],e[1])}),o}return na(t,e),t.prototype.P=function(e){return ra(this,function(t){switch(t.label){case 0:return void 0===e?[2]:[5,oa(this.P(e.K))];case 1:return t.sent(),[4,[e.u,e.p]];case 2:return t.sent(),[5,oa(this.P(e.N))];case 3:return t.sent(),[2]}})},t.prototype.begin=function(){return new ia(this.h.K||this.h,this.h,this)},t.prototype.end=function(){return new ia(this.h,this.h,this)},t.prototype.rBegin=function(){return new ia(this.h.N||this.h,this.h,this,1)},t.prototype.rEnd=function(){return new ia(this.h,this.h,this,1)},t.prototype.front=function(){if(0!==this.M){var e=this.h.K;return[e.u,e.p]}},t.prototype.back=function(){if(0!==this.M){var e=this.h.N;return[e.u,e.p]}},t.prototype.lowerBound=function(e){var t=this.U(this.W,e);return new ia(t,this.h,this)},t.prototype.upperBound=function(e){var t=this.X(this.W,e);return new ia(t,this.h,this)},t.prototype.reverseLowerBound=function(e){var t=this.Y(this.W,e);return new ia(t,this.h,this)},t.prototype.reverseUpperBound=function(e){var t=this.Z(this.W,e);return new ia(t,this.h,this)},t.prototype.setElement=function(e,t,n){return this.v(e,t,n)},t.prototype.find=function(e){var t=this.g(this.W,e);return new ia(t,this.h,this)},t.prototype.getElementByKey=function(e){return this.g(this.W,e).p},t.prototype.union=function(e){var t=this;return e.forEach(function(e){t.setElement(e[0],e[1])}),this.M},t.prototype[Symbol.iterator]=function(){return this.P(this.W)},t}(Qi);function sa(e){var t=typeof e;return"object"===t&&null!==e||"function"===t}var la=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ua=function(e){function t(t,n,r){var o=e.call(this,r)||this;return o.o=t,o.h=n,0===o.iteratorType?(o.pre=function(){return this.o.L===this.h&&Ei(),this.o=this.o.L,this},o.next=function(){return this.o===this.h&&Ei(),this.o=this.o.m,this}):(o.pre=function(){return this.o.m===this.h&&Ei(),this.o=this.o.m,this},o.next=function(){return this.o===this.h&&Ei(),this.o=this.o.L,this}),o}return la(t,e),t}(fi),ca=function(e){function t(){var t=e.call(this)||this;return t._=[],t.I={},t.HASH_TAG=Symbol("@@HASH_TAG"),Object.setPrototypeOf(t.I,null),t.h={},t.h.L=t.h.m=t.H=t.l=t.h,t}return la(t,e),t.prototype.G=function(e){var t=e.L,n=e.m;t.m=n,n.L=t,e===this.H&&(this.H=n),e===this.l&&(this.l=t),this.M-=1},t.prototype.v=function(e,t,n){var r;if(void 0===n&&(n=sa(e)),n){var o=e[this.HASH_TAG];if(void 0!==o)return this._[o].p=t,this.M;Object.defineProperty(e,this.HASH_TAG,{value:this._.length,configurable:!0}),r={u:e,p:t,L:this.l,m:this.h},this._.push(r)}else{var i=this.I[e];if(i)return i.p=t,this.M;r={u:e,p:t,L:this.l,m:this.h},this.I[e]=r}return 0===this.M?(this.H=r,this.h.m=r):this.l.m=r,this.l=r,this.h.L=r,++this.M},t.prototype.g=function(e,t){if(void 0===t&&(t=sa(e)),t){var n=e[this.HASH_TAG];return void 0===n?this.h:this._[n]}return this.I[e]||this.h},t.prototype.clear=function(){var e=this.HASH_TAG;this._.forEach(function(t){delete t.u[e]}),this._=[],this.I={},Object.setPrototypeOf(this.I,null),this.M=0,this.H=this.l=this.h.L=this.h.m=this.h},t.prototype.eraseElementByKey=function(e,t){var n;if(void 0===t&&(t=sa(e)),t){var r=e[this.HASH_TAG];if(void 0===r)return!1;delete e[this.HASH_TAG],n=this._[r],delete this._[r]}else{if(void 0===(n=this.I[e]))return!1;delete this.I[e]}return this.G(n),!0},t.prototype.eraseElementByIterator=function(e){var t=e.o;return t===this.h&&Ei(),this.G(t),e.next()},t.prototype.eraseElementByPos=function(e){if(e<0||e>this.M-1)throw new RangeError;for(var t=this.H;e--;)t=t.m;return this.G(t),this.M},t}(hi),fa=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),pa=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(i){s=[6,i],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([i,s])}}},ha=function(e){function t(t,n,r,o){var i=e.call(this,t,n,o)||this;return i.container=r,i}return fa(t,e),Object.defineProperty(t.prototype,"pointer",{get:function(){return this.o===this.h&&Ei(),this.o.u},enumerable:!1,configurable:!0}),t.prototype.copy=function(){return new t(this.o,this.h,this.container,this.iteratorType)},t}(ua),da=function(e){function t(t){void 0===t&&(t=[]);var n=e.call(this)||this,r=n;return t.forEach(function(e){r.insert(e)}),n}return fa(t,e),t.prototype.begin=function(){return new ha(this.H,this.h,this)},t.prototype.end=function(){return new ha(this.h,this.h,this)},t.prototype.rBegin=function(){return new ha(this.l,this.h,this,1)},t.prototype.rEnd=function(){return new ha(this.h,this.h,this,1)},t.prototype.front=function(){return this.H.u},t.prototype.back=function(){return this.l.u},t.prototype.insert=function(e,t){return this.v(e,void 0,t)},t.prototype.getElementByPos=function(e){if(e<0||e>this.M-1)throw new RangeError;for(var t=this.H;e--;)t=t.m;return t.u},t.prototype.find=function(e,t){var n=this.g(e,t);return new ha(n,this.h,this)},t.prototype.forEach=function(e){for(var t=0,n=this.H;n!==this.h;)e(n.u,t++,this),n=n.m},t.prototype[Symbol.iterator]=function(){return function(){var e;return pa(this,function(t){switch(t.label){case 0:e=this.H,t.label=1;case 1:return e===this.h?[3,3]:[4,e.u];case 2:return t.sent(),e=e.m,[3,1];case 3:return[2]}})}.bind(this)()},t}(ca),ya=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ga=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(i){s=[6,i],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([i,s])}}},ma=function(e){function t(t,n,r,o){var i=e.call(this,t,n,o)||this;return i.container=r,i}return ya(t,e),Object.defineProperty(t.prototype,"pointer",{get:function(){this.o===this.h&&Ei();var e=this;return new Proxy([],{get:function(t,n){return"0"===n?e.o.u:"1"===n?e.o.p:void 0},set:function(t,n,r){if("1"!==n)throw new TypeError("props must be 1");return e.o.p=r,!0}})},enumerable:!1,configurable:!0}),t.prototype.copy=function(){return new t(this.o,this.h,this.container,this.iteratorType)},t}(ua),va=function(e){function t(t){void 0===t&&(t=[]);var n=e.call(this)||this,r=n;return t.forEach(function(e){r.setElement(e[0],e[1])}),n}return ya(t,e),t.prototype.begin=function(){return new ma(this.H,this.h,this)},t.prototype.end=function(){return new ma(this.h,this.h,this)},t.prototype.rBegin=function(){return new ma(this.l,this.h,this,1)},t.prototype.rEnd=function(){return new ma(this.h,this.h,this,1)},t.prototype.front=function(){if(0!==this.M)return[this.H.u,this.H.p]},t.prototype.back=function(){if(0!==this.M)return[this.l.u,this.l.p]},t.prototype.setElement=function(e,t,n){return this.v(e,t,n)},t.prototype.getElementByKey=function(e,t){if(void 0===t&&(t=sa(e)),t){var n=e[this.HASH_TAG];return void 0!==n?this._[n].p:void 0}var r=this.I[e];return r?r.p:void 0},t.prototype.getElementByPos=function(e){if(e<0||e>this.M-1)throw new RangeError;for(var t=this.H;e--;)t=t.m;return[t.u,t.p]},t.prototype.find=function(e,t){var n=this.g(e,t);return new ma(n,this.h,this)},t.prototype.forEach=function(e){for(var t=0,n=this.H;n!==this.h;)e([n.u,n.p],t++,this),n=n.m},t.prototype[Symbol.iterator]=function(){return function(){var e;return ga(this,function(t){switch(t.label){case 0:e=this.H,t.label=1;case 1:return e===this.h?[3,3]:[4,[e.u,e.p]];case 2:return t.sent(),e=e.m,[3,1];case 3:return[2]}})}.bind(this)()},t}(ca);const ba=b(Object.freeze(Object.defineProperty({__proto__:null,Deque:Fi,HashMap:va,HashSet:da,LinkList:Ni,OrderedMap:aa,OrderedSet:ta,PriorityQueue:Si,Queue:mi,Stack:yi,Vector:Ri},Symbol.toStringTag,{value:"Module"})));var wa,Sa,ka,xa,Ea,_a,Ca,Ia,Ta,Aa,Pa={exports:{}};function ja(){if(Sa)return wa;Sa=1;var e=1e3,t=60*e,n=60*t,r=24*n,o=7*r,i=365.25*r;function a(e,t,n,r){var o=t>=1.5*n;return Math.round(e/n)+" "+r+(o?"s":"")}return wa=function(s,l){l=l||{};var u=typeof s;if("string"===u&&s.length>0)return function(a){if((a=String(a)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(a);if(!s)return;var l=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return l*i;case"weeks":case"week":case"w":return l*o;case"days":case"day":case"d":return l*r;case"hours":case"hour":case"hrs":case"hr":case"h":return l*n;case"minutes":case"minute":case"mins":case"min":case"m":return l*t;case"seconds":case"second":case"secs":case"sec":case"s":return l*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return}}(s);if("number"===u&&isFinite(s))return l.long?function(o){var i=Math.abs(o);if(i>=r)return a(o,i,r,"day");if(i>=n)return a(o,i,n,"hour");if(i>=t)return a(o,i,t,"minute");if(i>=e)return a(o,i,e,"second");return o+" ms"}(s):function(o){var i=Math.abs(o);if(i>=r)return Math.round(o/r)+"d";if(i>=n)return Math.round(o/n)+"h";if(i>=t)return Math.round(o/t)+"m";if(i>=e)return Math.round(o/e)+"s";return o+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function Oa(){return Ea||(Ea=1,function(e,t){var n={};t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(o=r))}),t.splice(o,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(n){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(r){}!e&&void 0!==N&&"env"in N&&(e=n.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=(xa||(xa=1,ka=function(e){function t(e){let r,o,i,a=null;function s(...e){if(!s.enabled)return;const n=s,o=Number(new Date),i=o-(r||o);n.diff=i,n.prev=r,n.curr=o,r=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,o)=>{if("%%"===r)return"%";a++;const i=t.formatters[o];if("function"==typeof i){const t=e[a];r=i.call(n,t),e.splice(a,1),a--}return r}),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(o!==t.namespaces&&(o=t.namespaces,i=t.enabled(e)),i),set:e=>{a=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e,t){let n=0,r=0,o=-1,i=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||"*"===t[r]))"*"===t[r]?(o=r,i=n,r++):(n++,r++);else{if(-1===o)return!1;r=o+1,i++,n=i}for(;r<t.length&&"*"===t[r];)r++;return r===t.length}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const r of n)"-"===r[0]?t.skips.push(r.slice(1)):t.names.push(r)},t.enabled=function(e){for(const n of t.skips)if(r(e,n))return!1;for(const n of t.names)if(r(e,n))return!0;return!1},t.humanize=ja(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}),ka)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}(Pa,Pa.exports)),Pa.exports}function Ra(){if(Ia)return ui;Ia=1;const e=function(){if(Ca)return _a;Ca=1;const e=ba.OrderedSet,t=Oa()("number-allocator:trace"),n=Oa()("number-allocator:error");function r(e,t){this.low=e,this.high=t}function o(n,r){if(!(this instanceof o))return new o(n,r);this.min=n,this.max=r,this.ss=new e([],(e,t)=>e.compare(t)),t("Create"),this.clear()}return r.prototype.equals=function(e){return this.low===e.low&&this.high===e.high},r.prototype.compare=function(e){return this.low<e.low&&this.high<e.low?-1:e.low<this.low&&e.high<this.low?1:0},o.prototype.firstVacant=function(){return 0===this.ss.size()?null:this.ss.front().low},o.prototype.alloc=function(){if(0===this.ss.size())return t("alloc():empty"),null;const e=this.ss.begin(),n=e.pointer.low,o=e.pointer.high,i=n;return i+1<=o?this.ss.updateKeyByIterator(e,new r(n+1,o)):this.ss.eraseElementByPos(0),t("alloc():"+i),i},o.prototype.use=function(e){const n=new r(e,e),o=this.ss.lowerBound(n);if(!o.equals(this.ss.end())){const i=o.pointer.low,a=o.pointer.high;return o.pointer.equals(n)?(this.ss.eraseElementByIterator(o),t("use():"+e),!0):!(i>e||(i===e?(this.ss.updateKeyByIterator(o,new r(i+1,a)),t("use():"+e),0):a===e?(this.ss.updateKeyByIterator(o,new r(i,a-1)),t("use():"+e),0):(this.ss.updateKeyByIterator(o,new r(e+1,a)),this.ss.insert(new r(i,e-1)),t("use():"+e),0)))}return t("use():failed"),!1},o.prototype.free=function(e){if(e<this.min||e>this.max)return void n("free():"+e+" is out of range");const o=new r(e,e),i=this.ss.upperBound(o);if(i.equals(this.ss.end())){if(i.equals(this.ss.begin()))return void this.ss.insert(o);i.pre();const t=i.pointer.high;i.pointer.high+1===e?this.ss.updateKeyByIterator(i,new r(t,e)):this.ss.insert(o)}else if(i.equals(this.ss.begin()))if(e+1===i.pointer.low){const t=i.pointer.high;this.ss.updateKeyByIterator(i,new r(e,t))}else this.ss.insert(o);else{const t=i.pointer.low,n=i.pointer.high;i.pre();const a=i.pointer.low;i.pointer.high+1===e?e+1===t?(this.ss.eraseElementByIterator(i),this.ss.updateKeyByIterator(i,new r(a,n))):this.ss.updateKeyByIterator(i,new r(a,e)):e+1===t?(this.ss.eraseElementByIterator(i.next()),this.ss.insert(new r(e,n))):this.ss.insert(o)}t("free():"+e)},o.prototype.clear=function(){t("clear()"),this.ss.clear(),this.ss.insert(new r(this.min,this.max))},o.prototype.intervalCount=function(){return this.ss.size()},o.prototype.dump=function(){console.log("length:"+this.ss.size());for(const e of this.ss)console.log(e)},_a=o}();return ui.NumberAllocator=e,ui}function Ma(){if(Aa)return Ta;Aa=1;const e=function(){if(Xo)return Yo;Xo=1;const e=li(),t=Symbol("max"),n=Symbol("length"),r=Symbol("lengthCalculator"),o=Symbol("allowStale"),i=Symbol("maxAge"),a=Symbol("dispose"),s=Symbol("noDisposeOnSet"),l=Symbol("lruList"),u=Symbol("cache"),c=Symbol("updateAgeOnGet"),f=()=>1,p=(e,t,n)=>{const r=e[u].get(t);if(r){const t=r.value;if(h(e,t)){if(y(e,r),!e[o])return}else n&&(e[c]&&(r.value.now=Date.now()),e[l].unshiftNode(r));return t.value}},h=(e,t)=>{if(!t||!t.maxAge&&!e[i])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[i]&&n>e[i]},d=e=>{if(e[n]>e[t])for(let r=e[l].tail;e[n]>e[t]&&null!==r;){const t=r.prev;y(e,r),r=t}},y=(e,t)=>{if(t){const r=t.value;e[a]&&e[a](r.key,r.value),e[n]-=r.length,e[u].delete(r.key),e[l].removeNode(t)}};class g{constructor(e,t,n,r,o){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=o||0}}const m=(e,t,n,r)=>{let i=n.value;h(e,i)&&(y(e,n),e[o]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};return Yo=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[t]=e.max||1/0;const n=e.length||f;if(this[r]="function"!=typeof n?f:n,this[o]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[i]=e.maxAge||0,this[a]=e.dispose,this[s]=e.noDisposeOnSet||!1,this[c]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[t]=e||1/0,d(this)}get max(){return this[t]}set allowStale(e){this[o]=!!e}get allowStale(){return this[o]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[i]=e,d(this)}get maxAge(){return this[i]}set lengthCalculator(e){"function"!=typeof e&&(e=f),e!==this[r]&&(this[r]=e,this[n]=0,this[l].forEach(e=>{e.length=this[r](e.value,e.key),this[n]+=e.length})),d(this)}get lengthCalculator(){return this[r]}get length(){return this[n]}get itemCount(){return this[l].length}rforEach(e,t){t=t||this;for(let n=this[l].tail;null!==n;){const r=n.prev;m(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(let n=this[l].head;null!==n;){const r=n.next;m(this,e,n,t),n=r}}keys(){return this[l].toArray().map(e=>e.key)}values(){return this[l].toArray().map(e=>e.value)}reset(){this[a]&&this[l]&&this[l].length&&this[l].forEach(e=>this[a](e.key,e.value)),this[u]=new Map,this[l]=new e,this[n]=0}dump(){return this[l].map(e=>!h(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[l]}set(e,o,c){if((c=c||this[i])&&"number"!=typeof c)throw new TypeError("maxAge must be a number");const f=c?Date.now():0,p=this[r](o,e);if(this[u].has(e)){if(p>this[t])return y(this,this[u].get(e)),!1;const r=this[u].get(e).value;return this[a]&&(this[s]||this[a](e,r.value)),r.now=f,r.maxAge=c,r.value=o,this[n]+=p-r.length,r.length=p,this.get(e),d(this),!0}const h=new g(e,o,p,f,c);return h.length>this[t]?(this[a]&&this[a](e,o),!1):(this[n]+=h.length,this[l].unshift(h),this[u].set(e,this[l].head),d(this),!0)}has(e){if(!this[u].has(e))return!1;const t=this[u].get(e).value;return!h(this,t)}get(e){return p(this,e,!0)}peek(e){return p(this,e,!1)}pop(){const e=this[l].tail;return e?(y(this,e),e.value):null}del(e){y(this,this[u].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const r=e[n],o=r.e||0;if(0===o)this.set(r.k,r.v);else{const e=o-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[u].forEach((e,t)=>p(this,t,!1))}},Yo}(),t=Ra().NumberAllocator;function n(r){if(!(this instanceof n))return new n(r);r>0&&(this.aliasToTopic=new e({max:r}),this.topicToAlias={},this.numberAllocator=new t(1,r),this.max=r,this.length=0)}return n.prototype.put=function(e,t){if(0===t||t>this.max)return!1;const n=this.aliasToTopic.get(t);return n&&delete this.topicToAlias[n],this.aliasToTopic.set(t,e),this.topicToAlias[e]=t,this.numberAllocator.use(t),this.length=this.aliasToTopic.length,!0},n.prototype.getTopicByAlias=function(e){return this.aliasToTopic.get(e)},n.prototype.getAliasByTopic=function(e){const t=this.topicToAlias[e];return void 0!==t&&this.aliasToTopic.get(t),t},n.prototype.clear=function(){this.aliasToTopic.reset(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0},n.prototype.getLruAlias=function(){const e=this.numberAllocator.firstVacant();return e||this.aliasToTopic.keys()[this.aliasToTopic.length-1]},Ta=n}var La,Ba,Na,Ua,Da,za={},Fa={exports:{}};function Ha(){if(Na)return Fa.exports;Na=1;const e=ai().Duplex,t=io(),n=function(){if(Ba)return La;Ba=1;const{Buffer:e}=rt(),t=Symbol.for("BufferList");function n(e){if(!(this instanceof n))return new n(e);n._init.call(this,e)}return n._init=function(e){Object.defineProperty(this,t,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)},n.prototype._new=function(e){return new n(e)},n.prototype._offset=function(e){if(0===e)return[0,0];let t=0;for(let n=0;n<this._bufs.length;n++){const r=t+this._bufs[n].length;if(e<r||n===this._bufs.length-1)return[n,e-t];t=r}},n.prototype._reverseOffset=function(e){const t=e[0];let n=e[1];for(let r=0;r<t;r++)n+=this._bufs[r].length;return n},n.prototype.get=function(e){if(e>this.length||e<0)return;const t=this._offset(e);return this._bufs[t[0]][t[1]]},n.prototype.slice=function(e,t){return"number"==typeof e&&e<0&&(e+=this.length),"number"==typeof t&&t<0&&(t+=this.length),this.copy(null,0,e,t)},n.prototype.copy=function(t,n,r,o){if(("number"!=typeof r||r<0)&&(r=0),("number"!=typeof o||o>this.length)&&(o=this.length),r>=this.length)return t||e.alloc(0);if(o<=0)return t||e.alloc(0);const i=!!t,a=this._offset(r),s=o-r;let l=s,u=i&&n||0,c=a[1];if(0===r&&o===this.length){if(!i)return 1===this._bufs.length?this._bufs[0]:e.concat(this._bufs,this.length);for(let e=0;e<this._bufs.length;e++)this._bufs[e].copy(t,u),u+=this._bufs[e].length;return t}if(l<=this._bufs[a[0]].length-c)return i?this._bufs[a[0]].copy(t,n,c,c+l):this._bufs[a[0]].slice(c,c+l);i||(t=e.allocUnsafe(s));for(let e=a[0];e<this._bufs.length;e++){const n=this._bufs[e].length-c;if(!(l>n)){this._bufs[e].copy(t,u,c,c+l),u+=n;break}this._bufs[e].copy(t,u,c),u+=n,l-=n,c&&(c=0)}return t.length>u?t.slice(0,u):t},n.prototype.shallowSlice=function(e,t){if(e=e||0,t="number"!=typeof t?this.length:t,e<0&&(e+=this.length),t<0&&(t+=this.length),e===t)return this._new();const n=this._offset(e),r=this._offset(t),o=this._bufs.slice(n[0],r[0]+1);return 0===r[1]?o.pop():o[o.length-1]=o[o.length-1].slice(0,r[1]),0!==n[1]&&(o[0]=o[0].slice(n[1])),this._new(o)},n.prototype.toString=function(e,t,n){return this.slice(t,n).toString(e)},n.prototype.consume=function(e){if(e=Math.trunc(e),Number.isNaN(e)||e<=0)return this;for(;this._bufs.length;){if(!(e>=this._bufs[0].length)){this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift()}return this},n.prototype.duplicate=function(){const e=this._new();for(let t=0;t<this._bufs.length;t++)e.append(this._bufs[t]);return e},n.prototype.append=function(t){if(null==t)return this;if(t.buffer)this._appendBuffer(e.from(t.buffer,t.byteOffset,t.byteLength));else if(Array.isArray(t))for(let e=0;e<t.length;e++)this.append(t[e]);else if(this._isBufferList(t))for(let e=0;e<t._bufs.length;e++)this.append(t._bufs[e]);else"number"==typeof t&&(t=t.toString()),this._appendBuffer(e.from(t));return this},n.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length},n.prototype.indexOf=function(t,n,r){if(void 0===r&&"string"==typeof n&&(r=n,n=void 0),"function"==typeof t||Array.isArray(t))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if("number"==typeof t?t=e.from([t]):"string"==typeof t?t=e.from(t,r):this._isBufferList(t)?t=t.slice():Array.isArray(t.buffer)?t=e.from(t.buffer,t.byteOffset,t.byteLength):e.isBuffer(t)||(t=e.from(t)),n=Number(n||0),isNaN(n)&&(n=0),n<0&&(n=this.length+n),n<0&&(n=0),0===t.length)return n>this.length?this.length:n;const o=this._offset(n);let i=o[0],a=o[1];for(;i<this._bufs.length;i++){const e=this._bufs[i];for(;a<e.length;)if(e.length-a>=t.length){const n=e.indexOf(t,a);if(-1!==n)return this._reverseOffset([i,n]);a=e.length-t.length+1}else{const e=this._reverseOffset([i,a]);if(this._match(e,t))return e;a++}a=0}return-1},n.prototype._match=function(e,t){if(this.length-e<t.length)return!1;for(let n=0;n<t.length;n++)if(this.get(e+n)!==t[n])return!1;return!0},function(){const e={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(const t in e)(function(t){n.prototype[t]=null===e[t]?function(e,n){return this.slice(e,e+n)[t](0,n)}:function(n=0){return this.slice(n,n+e[t])[t](0)}})(t)}(),n.prototype._isBufferList=function(e){return e instanceof n||n.isBufferList(e)},n.isBufferList=function(e){return null!=e&&e[t]},La=n}();function r(t){if(!(this instanceof r))return new r(t);if("function"==typeof t){this._callback=t;const e=function(e){this._callback&&(this._callback(e),this._callback=null)}.bind(this);this.on("pipe",function(t){t.on("error",e)}),this.on("unpipe",function(t){t.removeListener("error",e)}),t=null}n._init.call(this,t),e.call(this)}return t(r,e),Object.assign(r.prototype,n.prototype),r.prototype._new=function(e){return new r(e)},r.prototype._write=function(e,t,n){this._appendBuffer(e),"function"==typeof n&&n()},r.prototype._read=function(e){if(!this.length)return this.push(null);e=Math.min(e,this.length),this.push(this.slice(0,e)),this.consume(e)},r.prototype.end=function(t){e.prototype.end.call(this,t),this._callback&&(this._callback(null,this.slice()),this._callback=null)},r.prototype._destroy=function(e,t){this._bufs.length=0,this.length=0,t(e)},r.prototype._isBufferList=function(e){return e instanceof r||e instanceof n||r.isBufferList(e)},r.isBufferList=n.isBufferList,Fa.exports=r,Fa.exports.BufferListStream=r,Fa.exports.BufferList=n,Fa.exports}for(var Wa={},qa={byteLength:function(e){var t=Ya(e),n=t[0],r=t[1];return 3*(n+r)/4-r},toByteArray:function(e){var t,n,r=Ya(e),o=r[0],i=r[1],a=new $a(function(e,t,n){return 3*(t+n)/4-n}(0,o,i)),s=0,l=i>0?o-4:o;for(n=0;n<l;n+=4)t=Ka[e.charCodeAt(n)]<<18|Ka[e.charCodeAt(n+1)]<<12|Ka[e.charCodeAt(n+2)]<<6|Ka[e.charCodeAt(n+3)],a[s++]=t>>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===i&&(t=Ka[e.charCodeAt(n)]<<2|Ka[e.charCodeAt(n+1)]>>4,a[s++]=255&t);1===i&&(t=Ka[e.charCodeAt(n)]<<10|Ka[e.charCodeAt(n+1)]<<4|Ka[e.charCodeAt(n+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},fromByteArray:function(e){for(var t,n=e.length,r=n%3,o=[],i=16383,a=0,s=n-r;a<s;a+=i)o.push(Za(e,a,a+i>s?s:a+i));1===r?(t=e[n-1],o.push(Va[t>>2]+Va[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],o.push(Va[t>>10]+Va[t>>4&63]+Va[t<<2&63]+"="));return o.join("")}},Va=[],Ka=[],$a="undefined"!=typeof Uint8Array?Uint8Array:Array,Qa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ga=0;Ga<64;++Ga)Va[Ga]=Qa[Ga],Ka[Qa.charCodeAt(Ga)]=Ga;function Ya(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function Xa(e){return Va[e>>18&63]+Va[e>>12&63]+Va[e>>6&63]+Va[63&e]}function Za(e,t,n){for(var r,o=[],i=t;i<n;i+=3)r=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(Xa(r));return o.join("")}Ka["-".charCodeAt(0)]=62,Ka["_".charCodeAt(0)]=63;var Ja={read:function(e,t,n,r,o){var i,a,s=8*o-r-1,l=(1<<s)-1,u=l>>1,c=-7,f=n?o-1:0,p=n?-1:1,h=e[t+f];for(f+=p,i=h&(1<<-c)-1,h>>=-c,c+=s;c>0;i=256*i+e[t+f],f+=p,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=r;c>0;a=256*a+e[t+f],f+=p,c-=8);if(0===i)i=1-u;else{if(i===l)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=u}return(h?-1:1)*a*Math.pow(2,i-r)},write:function(e,t,n,r,o,i){var a,s,l,u=8*i-o-1,c=(1<<u)-1,f=c>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,d=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+f>=1?p/l:p*Math.pow(2,1-f))*l>=2&&(a++,l/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(t*l-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&s,h+=d,s/=256,o-=8);for(a=a<<o|s,u+=o;u>0;e[n+h]=255&a,h+=d,a/=256,u-=8);e[n+h-d]|=128*y}};!function(e){const t=qa,n=Ja,r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},e.INSPECT_MAX_BYTES=50;const o=2147483647;e.kMaxLength=o;const{Uint8Array:i,ArrayBuffer:s,SharedArrayBuffer:l}=globalThis;function u(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new i(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return f(e,t,n)}function f(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|m(e,t);let r=u(n);const o=r.write(e,t);o!==n&&(r=r.slice(0,o));return r}(e,t);if(s.isView(e))return function(e){if(X(e,i)){const t=new i(e);return y(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(X(e,s)||e&&X(e.buffer,s))return y(e,t,n);if(void 0!==l&&(X(e,l)||e&&X(e.buffer,l)))return y(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return c.from(r,t,n);const o=function(e){if(c.isBuffer(e)){const t=0|g(e.length),n=u(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||Z(e.length)?u(0):d(e);if("Buffer"===e.type&&Array.isArray(e.data))return d(e.data)}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function p(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return p(e),u(e<0?0:0|g(e))}function d(e){const t=e.length<0?0:0|g(e.length),n=u(t);for(let r=0;r<t;r+=1)n[r]=255&e[r];return n}function y(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===t&&void 0===n?new i(e):void 0===n?new i(e,t):new i(e,t,n),Object.setPrototypeOf(r,c.prototype),r}function g(e){if(e>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function m(e,t){if(c.isBuffer(e))return e.length;if(s.isView(e)||X(e,s))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return Q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return G(e).length;default:if(o)return r?-1:Q(e).length;t=(""+t).toLowerCase(),o=!0}}function v(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return P(this,t,n);case"latin1":case"binary":return j(this,t,n);case"base64":return I(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function b(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function w(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),Z(n=+n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:S(e,t,n,r,o);if("number"==typeof t)return t&=255,"function"==typeof i.prototype.indexOf?o?i.prototype.indexOf.call(e,t,n):i.prototype.lastIndexOf.call(e,t,n):S(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function S(e,t,n,r,o){let i,a=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let r=-1;for(i=n;i<s;i++)if(u(e,i)===u(t,-1===r?0:i-r)){if(-1===r&&(r=i),i-r+1===l)return r*a}else-1!==r&&(i-=i-r),r=-1}else for(n+l>s&&(n=s-l),i=n;i>=0;i--){let n=!0;for(let r=0;r<l;r++)if(u(e,i+r)!==u(t,r)){n=!1;break}if(n)return i}return-1}function k(e,t,n,r){n=Number(n)||0;const o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;const i=t.length;let a;for(r>i/2&&(r=i/2),a=0;a<r;++a){const r=parseInt(t.substr(2*a,2),16);if(Z(r))return a;e[n+a]=r}return a}function x(e,t,n,r){return Y(Q(t,e.length-n),e,n,r)}function E(e,t,n,r){return Y(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function _(e,t,n,r){return Y(G(t),e,n,r)}function C(e,t,n,r){return Y(function(e,t){let n,r,o;const i=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function I(e,n,r){return 0===n&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function T(e,t,n){n=Math.min(e.length,n);const r=[];let o=t;for(;o<n;){const t=e[o];let i=null,a=t>239?4:t>223?3:t>191?2:1;if(o+a<=n){let n,r,s,l;switch(a){case 1:t<128&&(i=t);break;case 2:n=e[o+1],128==(192&n)&&(l=(31&t)<<6|63&n,l>127&&(i=l));break;case 3:n=e[o+1],r=e[o+2],128==(192&n)&&128==(192&r)&&(l=(15&t)<<12|(63&n)<<6|63&r,l>2047&&(l<55296||l>57343)&&(i=l));break;case 4:n=e[o+1],r=e[o+2],s=e[o+3],128==(192&n)&&128==(192&r)&&128==(192&s)&&(l=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&s,l>65535&&l<1114112&&(i=l))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,r.push(i>>>10&1023|55296),i=56320|1023&i),r.push(i),o+=a}return function(e){const t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=A));return n}(r)}c.TYPED_ARRAY_SUPPORT=function(){try{const e=new i(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,i.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||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(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,n){return f(e,t,n)},Object.setPrototypeOf(c.prototype,i.prototype),Object.setPrototypeOf(c,i),c.alloc=function(e,t,n){return function(e,t,n){return p(e),e<=0?u(e):void 0!==t?"string"==typeof n?u(e).fill(t,n):u(e).fill(t):u(e)}(e,t,n)},c.allocUnsafe=function(e){return h(e)},c.allocUnsafeSlow=function(e){return h(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(X(e,i)&&(e=c.from(e,e.offset,e.byteLength)),X(t,i)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,r=t.length;for(let o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},c.isEncoding=function(e){switch(String(e).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}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const r=c.allocUnsafe(t);let o=0;for(n=0;n<e.length;++n){let t=e[n];if(X(t,i))o+t.length>r.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(r,o)):i.prototype.set.call(r,t,o);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,o)}o+=t.length}return r},c.byteLength=m,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)b(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?T(this,0,e):v.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let t="";const n=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"},r&&(c.prototype[r]=c.prototype.inspect),c.prototype.compare=function(e,t,n,r,o){if(X(e,i)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;let a=(o>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0);const l=Math.min(a,s),u=this.slice(r,o),f=e.slice(t,n);for(let i=0;i<l;++i)if(u[i]!==f[i]){a=u[i],s=f[i];break}return a<s?-1:s<a?1:0},c.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},c.prototype.indexOf=function(e,t,n){return w(this,e,t,n,!0)},c.prototype.lastIndexOf=function(e,t,n){return w(this,e,t,n,!1)},c.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let i=!1;for(;;)switch(r){case"hex":return k(this,e,t,n);case"utf8":case"utf-8":return x(this,e,t,n);case"ascii":case"latin1":case"binary":return E(this,e,t,n);case"base64":return _(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const A=4096;function P(e,t,n){let r="";n=Math.min(e.length,n);for(let o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function j(e,t,n){let r="";n=Math.min(e.length,n);for(let o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function O(e,t,n){const r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let o="";for(let i=t;i<n;++i)o+=J[e[i]];return o}function R(e,t,n){const r=e.slice(t,n);let o="";for(let i=0;i<r.length-1;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function M(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,n,r,o,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function B(e,t,n,r,o){q(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,n}function N(e,t,n,r,o){q(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n+7]=i,i>>=8,e[n+6]=i,i>>=8,e[n+5]=i,i>>=8,e[n+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function U(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(e,t,r,o,i){return t=+t,r>>>=0,i||U(e,0,r,4),n.write(e,t,r,o,23,4),r+4}function z(e,t,r,o,i){return t=+t,r>>>=0,i||U(e,0,r,8),n.write(e,t,r,o,52,8),r+8}c.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const r=this.subarray(e,t);return Object.setPrototypeOf(r,c.prototype),r},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||M(e,t,this.length);let r=this[e],o=1,i=0;for(;++i<t&&(o*=256);)r+=this[e+i]*o;return r},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||M(e,t,this.length);let r=this[e+--t],o=1;for(;t>0&&(o*=256);)r+=this[e+--t]*o;return r},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||M(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||M(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||M(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||M(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||M(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=ee(function(e){V(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||K(e,this.length-8);const r=t+this[++e]*a(2,8)+this[++e]*a(2,16)+this[++e]*a(2,24),o=this[++e]+this[++e]*a(2,8)+this[++e]*a(2,16)+n*a(2,24);return BigInt(r)+(BigInt(o)<<BigInt(32))}),c.prototype.readBigUInt64BE=ee(function(e){V(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||K(e,this.length-8);const r=t*a(2,24)+this[++e]*a(2,16)+this[++e]*a(2,8)+this[++e],o=this[++e]*a(2,24)+this[++e]*a(2,16)+this[++e]*a(2,8)+n;return(BigInt(r)<<BigInt(32))+BigInt(o)}),c.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||M(e,t,this.length);let r=this[e],o=1,i=0;for(;++i<t&&(o*=256);)r+=this[e+i]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||M(e,t,this.length);let r=t,o=1,i=this[e+--r];for(;r>0&&(o*=256);)i+=this[e+--r]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return e>>>=0,t||M(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||M(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){e>>>=0,t||M(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||M(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||M(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=ee(function(e){V(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||K(e,this.length-8);const r=this[e+4]+this[e+5]*a(2,8)+this[e+6]*a(2,16)+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+this[++e]*a(2,8)+this[++e]*a(2,16)+this[++e]*a(2,24))}),c.prototype.readBigInt64BE=ee(function(e){V(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||K(e,this.length-8);const r=(t<<24)+this[++e]*a(2,16)+this[++e]*a(2,8)+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*a(2,24)+this[++e]*a(2,16)+this[++e]*a(2,8)+n)}),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||M(e,4,this.length),n.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||M(e,4,this.length),n.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||M(e,8,this.length),n.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||M(e,8,this.length),n.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){L(this,e,t,n,Math.pow(2,8*n)-1,0)}let o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){L(this,e,t,n,Math.pow(2,8*n)-1,0)}let o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=ee(function(e,t=0){return B(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=ee(function(e,t=0){return N(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);L(this,e,t,n,r-1,-r)}let o=0,i=1,a=0;for(this[t]=255&e;++o<n&&(i*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);L(this,e,t,n,r-1,-r)}let o=n-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=ee(function(e,t=0){return B(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=ee(function(e,t=0){return N(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(e,t,n){return D(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return D(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return z(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return z(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);const o=r-n;return this===e&&"function"==typeof i.prototype.copyWithin?this.copyWithin(t,n,r):i.prototype.set.call(e,this.subarray(n,r),t),o},c.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!c.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){const t=e.charCodeAt(0);("utf8"===r&&t<128||"latin1"===r)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;let o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{const i=c.isBuffer(e)?e:c.from(e,r),a=i.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-t;++o)this[o+t]=i[o%a]}return this};const F={};function H(e,t,n){F[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function W(e){let t="",n=e.length;const r="-"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function q(e,t,n,r,o,i){if(e>n||e<t){const n="bigint"==typeof t?"n":"";let r;throw r=0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`,new F.ERR_OUT_OF_RANGE("value",r,e)}!function(e,t,n){V(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||K(t,e.length-(n+1))}(r,o,i)}function V(e,t){if("number"!=typeof e)throw new F.ERR_INVALID_ARG_TYPE(t,"number",e)}function K(e,t,n){if(Math.floor(e)!==e)throw V(e,n),new F.ERR_OUT_OF_RANGE("offset","an integer",e);if(t<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${t}`,e)}H("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),H("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),H("ERR_OUT_OF_RANGE",function(e,t,n){let r=`The value of "${e}" is out of range.`,o=n;return Number.isInteger(n)&&Math.abs(n)>a(2,32)?o=W(String(n)):"bigint"==typeof n&&(o=String(n),(n>a(BigInt(2),BigInt(32))||n<-a(BigInt(2),BigInt(32)))&&(o=W(o)),o+="n"),r+=` It must be ${t}. Received ${o}`,r},RangeError);const $=/[^+/0-9A-Za-z-_]/g;function Q(e,t){let n;t=t||1/0;const r=e.length;let o=null;const i=[];for(let a=0;a<r;++a){if(n=e.charCodeAt(a),n>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function G(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace($,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Y(e,t,n,r){let o;for(o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function X(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Z(e){return e!=e}const J=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let o=0;o<16;++o)t[r+o]=e[n]+e[o]}return t}();function ee(e){return"undefined"==typeof BigInt?te:e}function te(){throw new Error("BigInt not supported")}}(Wa);const es=Wa.Buffer;var ts,ns,rs,os,is,as={exports:{}};function ss(){return ts||(ts=1,function(){const e=as.exports;e.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"},e.codes={};for(const n in e.types){const t=e.types[n];e.codes[t]=n}e.CMD_SHIFT=4,e.CMD_MASK=240,e.DUP_MASK=8,e.QOS_MASK=3,e.QOS_SHIFT=1,e.RETAIN_MASK=1,e.VARBYTEINT_MASK=127,e.VARBYTEINT_FIN_MASK=128,e.VARBYTEINT_MAX=268435455,e.SESSIONPRESENT_MASK=1,e.SESSIONPRESENT_HEADER=es.from([e.SESSIONPRESENT_MASK]),e.CONNACK_HEADER=es.from([e.codes.connack<<e.CMD_SHIFT]),e.USERNAME_MASK=128,e.PASSWORD_MASK=64,e.WILL_RETAIN_MASK=32,e.WILL_QOS_MASK=24,e.WILL_QOS_SHIFT=3,e.WILL_FLAG_MASK=4,e.CLEAN_SESSION_MASK=2,e.CONNECT_HEADER=es.from([e.codes.connect<<e.CMD_SHIFT]),e.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11},e.propertiesCodes={};for(const n in e.properties){const t=e.properties[n];e.propertiesCodes[t]=n}function t(t){return[0,1,2].map(n=>[0,1].map(r=>[0,1].map(o=>{const i=es.alloc(1);return i.writeUInt8(e.codes[t]<<e.CMD_SHIFT|(r?e.DUP_MASK:0)|n<<e.QOS_SHIFT|o,0,!0),i})))}e.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"},e.PUBLISH_HEADER=t("publish"),e.SUBSCRIBE_HEADER=t("subscribe"),e.SUBSCRIBE_OPTIONS_QOS_MASK=3,e.SUBSCRIBE_OPTIONS_NL_MASK=1,e.SUBSCRIBE_OPTIONS_NL_SHIFT=2,e.SUBSCRIBE_OPTIONS_RAP_MASK=1,e.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,e.SUBSCRIBE_OPTIONS_RH_MASK=3,e.SUBSCRIBE_OPTIONS_RH_SHIFT=4,e.SUBSCRIBE_OPTIONS_RH=[0,16,32],e.SUBSCRIBE_OPTIONS_NL=4,e.SUBSCRIBE_OPTIONS_RAP=8,e.SUBSCRIBE_OPTIONS_QOS=[0,1,2],e.UNSUBSCRIBE_HEADER=t("unsubscribe"),e.ACKS={unsuback:t("unsuback"),puback:t("puback"),pubcomp:t("pubcomp"),pubrel:t("pubrel"),pubrec:t("pubrec")},e.SUBACK_HEADER=es.from([e.codes.suback<<e.CMD_SHIFT]),e.VERSION3=es.from([3]),e.VERSION4=es.from([4]),e.VERSION5=es.from([5]),e.VERSION131=es.from([131]),e.VERSION132=es.from([132]),e.QOS=[0,1,2].map(e=>es.from([e])),e.EMPTY={pingreq:es.from([e.codes.pingreq<<4,0]),pingresp:es.from([e.codes.pingresp<<4,0]),disconnect:es.from([e.codes.disconnect<<4,0])}}()),as.exports}function ls(){if(rs)return ns;rs=1;const e=Ha(),t=Ge(),n=Da?Ua:(Da=1,Ua=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}),r=ss(),o=Oa()("mqtt-packet:parser");class i extends t{constructor(){super(),this.parser=this.constructor.parser}static parser(e){return this instanceof i?(this.settings=e||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):(new i).parser(e)}_resetState(){o("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new n,this.error=null,this._list=e(),this._stateCounter=0}parse(e){for(this.error&&this._resetState(),this._list.append(e),o("parse: current state: %s",this._states[this._stateCounter]);(-1!==this.packet.length||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,o("parse: state complete. _stateCounter is now: %d",this._stateCounter),o("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return o("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){const e=this._list.readUInt8(0);return this.packet.cmd=r.types[e>>r.CMD_SHIFT],this.packet.retain=0!==(e&r.RETAIN_MASK),this.packet.qos=e>>r.QOS_SHIFT&r.QOS_MASK,this.packet.dup=0!==(e&r.DUP_MASK),o("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0}_parseLength(){const e=this._parseVarByteNum(!0);return e&&(this.packet.length=e.value,this._list.consume(e.bytes)),o("_parseLength %d",e.value),!!e}_parsePayload(){o("_parsePayload: payload %O",this._list);let e=!1;if(0===this.packet.length||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}e=!0}return o("_parsePayload complete result: %s",e),e}_parseConnect(){let e,t,n,i;o("_parseConnect");const a={},s=this.packet,l=this._parseString();if(null===l)return this._emitError(new Error("Cannot parse protocolId"));if("MQTT"!==l&&"MQIsdp"!==l)return this._emitError(new Error("Invalid protocolId"));if(s.protocolId=l,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(s.protocolVersion=this._list.readUInt8(this._pos),s.protocolVersion>=128&&(s.bridgeMode=!0,s.protocolVersion=s.protocolVersion-128),3!==s.protocolVersion&&4!==s.protocolVersion&&5!==s.protocolVersion)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(a.username=this._list.readUInt8(this._pos)&r.USERNAME_MASK,a.password=this._list.readUInt8(this._pos)&r.PASSWORD_MASK,a.will=this._list.readUInt8(this._pos)&r.WILL_FLAG_MASK,a.will&&(s.will={},s.will.retain=0!==(this._list.readUInt8(this._pos)&r.WILL_RETAIN_MASK),s.will.qos=(this._list.readUInt8(this._pos)&r.WILL_QOS_MASK)>>r.WILL_QOS_SHIFT),s.clean=0!==(this._list.readUInt8(this._pos)&r.CLEAN_SESSION_MASK),this._pos++,s.keepalive=this._parseNum(),-1===s.keepalive)return this._emitError(new Error("Packet too short"));if(5===s.protocolVersion){const e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(s.properties=e)}const u=this._parseString();if(null===u)return this._emitError(new Error("Packet too short"));if(s.clientId=u,o("_parseConnect: packet.clientId: %s",s.clientId),a.will){if(5===s.protocolVersion){const e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(s.will.properties=e)}if(e=this._parseString(),null===e)return this._emitError(new Error("Cannot parse will topic"));if(s.will.topic=e,o("_parseConnect: packet.will.topic: %s",s.will.topic),t=this._parseBuffer(),null===t)return this._emitError(new Error("Cannot parse will payload"));s.will.payload=t,o("_parseConnect: packet.will.paylaod: %s",s.will.payload)}if(a.username){if(i=this._parseString(),null===i)return this._emitError(new Error("Cannot parse username"));s.username=i,o("_parseConnect: packet.username: %s",s.username)}if(a.password){if(n=this._parseBuffer(),null===n)return this._emitError(new Error("Cannot parse password"));s.password=n}return this.settings=s,o("_parseConnect: complete"),s}_parseConnack(){o("_parseConnack");const e=this.packet;if(this._list.length<1)return null;if(e.sessionPresent=!!(this._list.readUInt8(this._pos++)&r.SESSIONPRESENT_MASK),5===this.settings.protocolVersion)this._list.length>=2?e.reasonCode=this._list.readUInt8(this._pos++):e.reasonCode=0;else{if(this._list.length<2)return null;e.returnCode=this._list.readUInt8(this._pos++)}if(-1===e.returnCode||-1===e.reasonCode)return this._emitError(new Error("Cannot parse return code"));if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}o("_parseConnack: complete")}_parsePublish(){o("_parsePublish");const e=this.packet;if(e.topic=this._parseString(),null===e.topic)return this._emitError(new Error("Cannot parse topic"));if(!(e.qos>0)||this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}e.payload=this._list.slice(this._pos,e.length),o("_parsePublish: payload from buffer list: %o",e.payload)}}_parseSubscribe(){o("_parseSubscribe");const e=this.packet;let t,n,i,a,s,l,u;if(1!==e.qos)return this._emitError(new Error("Wrong subscribe header"));if(e.subscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}for(;this._pos<e.length;){if(t=this._parseString(),null===t)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=e.length)return this._emitError(new Error("Malformed Subscribe Payload"));n=this._parseByte(),i=n&r.SUBSCRIBE_OPTIONS_QOS_MASK,l=0!==(n>>r.SUBSCRIBE_OPTIONS_NL_SHIFT&r.SUBSCRIBE_OPTIONS_NL_MASK),s=0!==(n>>r.SUBSCRIBE_OPTIONS_RAP_SHIFT&r.SUBSCRIBE_OPTIONS_RAP_MASK),a=n>>r.SUBSCRIBE_OPTIONS_RH_SHIFT&r.SUBSCRIBE_OPTIONS_RH_MASK,u={topic:t,qos:i},5===this.settings.protocolVersion?(u.nl=l,u.rap=s,u.rh=a):this.settings.bridgeMode&&(u.rh=0,u.rap=!0,u.nl=!0),o("_parseSubscribe: push subscription `%s` to subscription",u),e.subscriptions.push(u)}}}_parseSuback(){o("_parseSuback");const e=this.packet;if(this.packet.granted=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}for(;this._pos<this.packet.length;)this.packet.granted.push(this._list.readUInt8(this._pos++))}}_parseUnsubscribe(){o("_parseUnsubscribe");const e=this.packet;if(e.unsubscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}for(;this._pos<e.length;){const t=this._parseString();if(null===t)return this._emitError(new Error("Cannot parse topic"));o("_parseUnsubscribe: push topic `%s` to unsubscriptions",t),e.unsubscriptions.push(t)}}}_parseUnsuback(){o("_parseUnsuback");const e=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if(5===this.settings.protocolVersion){const t=this._parseProperties();for(Object.getOwnPropertyNames(t).length&&(e.properties=t),e.granted=[];this._pos<this.packet.length;)this.packet.granted.push(this._list.readUInt8(this._pos++))}}_parseConfirmation(){o("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);const e=this.packet;if(this._parseMessageId(),5===this.settings.protocolVersion&&(e.length>2?(e.reasonCode=this._parseByte(),o("_parseConfirmation: packet.reasonCode `%d`",e.reasonCode)):e.reasonCode=0,e.length>3)){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}return!0}_parseDisconnect(){const e=this.packet;if(o("_parseDisconnect"),5===this.settings.protocolVersion){this._list.length>0?e.reasonCode=this._parseByte():e.reasonCode=0;const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}return o("_parseDisconnect result: true"),!0}_parseAuth(){o("_parseAuth");const e=this.packet;if(5!==this.settings.protocolVersion)return this._emitError(new Error("Not supported auth packet for this version MQTT"));e.reasonCode=this._parseByte();const t=this._parseProperties();return Object.getOwnPropertyNames(t).length&&(e.properties=t),o("_parseAuth: result: true"),!0}_parseMessageId(){const e=this.packet;return e.messageId=this._parseNum(),null===e.messageId?(this._emitError(new Error("Cannot parse messageId")),!1):(o("_parseMessageId: packet.messageId %d",e.messageId),!0)}_parseString(e){const t=this._parseNum(),n=t+this._pos;if(-1===t||n>this._list.length||n>this.packet.length)return null;const r=this._list.toString("utf8",this._pos,n);return this._pos+=t,o("_parseString: result: %s",r),r}_parseStringPair(){return o("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){const e=this._parseNum(),t=e+this._pos;if(-1===e||t>this._list.length||t>this.packet.length)return null;const n=this._list.slice(this._pos,t);return this._pos+=e,o("_parseBuffer: result: %o",n),n}_parseNum(){if(this._list.length-this._pos<2)return-1;const e=this._list.readUInt16BE(this._pos);return this._pos+=2,o("_parseNum: result: %s",e),e}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;const e=this._list.readUInt32BE(this._pos);return this._pos+=4,o("_parse4ByteNum: result: %s",e),e}_parseVarByteNum(e){o("_parseVarByteNum");let t,n=0,i=1,a=0,s=!1;const l=this._pos?this._pos:0;for(;n<4&&l+n<this._list.length;){if(t=this._list.readUInt8(l+n++),a+=i*(t&r.VARBYTEINT_MASK),i*=128,0===(t&r.VARBYTEINT_FIN_MASK)){s=!0;break}if(this._list.length<=n)break}return!s&&4===n&&this._list.length>=n&&this._emitError(new Error("Invalid variable byte integer")),l&&(this._pos+=n),s=!!s&&(e?{bytes:n,value:a}:a),o("_parseVarByteNum: result: %o",s),s}_parseByte(){let e;return this._pos<this._list.length&&(e=this._list.readUInt8(this._pos),this._pos++),o("_parseByte: result: %o",e),e}_parseByType(e){switch(o("_parseByType: type: %s",e),e){case"byte":return 0!==this._parseByte();case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}_parseProperties(){o("_parseProperties");const e=this._parseVarByteNum(),t=this._pos+e,n={};for(;this._pos<t;){const e=this._parseByte();if(!e)return this._emitError(new Error("Cannot parse property code type")),!1;const t=r.propertiesCodes[e];if(!t)return this._emitError(new Error("Unknown property")),!1;if("userProperties"===t){n[t]||(n[t]=Object.create(null));const e=this._parseByType(r.propertiesTypes[t]);if(n[t][e.name])if(Array.isArray(n[t][e.name]))n[t][e.name].push(e.value);else{const r=n[t][e.name];n[t][e.name]=[r],n[t][e.name].push(e.value)}else n[t][e.name]=e.value;continue}n[t]?(Array.isArray(n[t])||(n[t]=[n[t]]),n[t].push(this._parseByType(r.propertiesTypes[t]))):n[t]=this._parseByType(r.propertiesTypes[t])}return n}_newPacket(){return o("_newPacket"),this.packet&&(this._list.consume(this.packet.length),o("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length),this.emit("packet",this.packet)),o("_newPacket: new packet"),this.packet=new n,this._pos=0,!0}_emitError(e){o("_emitError"),this.error=e,this.emit("error",e)}}return ns=i}var us,cs,fs,ps,hs,ds,ys,gs,ms,vs,bs,ws,Ss,ks,xs,Es,_s,Cs,Is={exports:{}};function Ts(){if(fs)return cs;fs=1;const e=ss(),t=es.allocUnsafe(0),n=es.from([0]),r=function(){if(is)return os;is=1;const e={},t=es.isBuffer(es.from([1,2]).subarray(0,1));function n(e){const t=es.allocUnsafe(2);return t.writeUInt8(e>>8,0),t.writeUInt8(255&e,1),t}return os={cache:e,generateCache:function(){for(let t=0;t<65536;t++)e[t]=n(t)},generateNumber:n,genBufVariableByteInt:function(e){let n=0,r=0;const o=es.allocUnsafe(4);do{n=e%128|0,(e=e/128|0)>0&&(n|=128),o.writeUInt8(n,r++)}while(e>0&&r<4);return e>0&&(r=0),t?o.subarray(0,r):o.slice(0,r)},generate4ByteBuffer:function(e){const t=es.allocUnsafe(4);return t.writeUInt32BE(e,0),t}},os}(),o=(us||(us=1,void 0===N||!N.version||0===N.version.indexOf("v0.")||0===N.version.indexOf("v1.")&&0!==N.version.indexOf("v1.8.")?Is.exports={nextTick:function(e,t,n,r){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,i,a=arguments.length;switch(a){case 0:case 1:return N.nextTick(e);case 2:return N.nextTick(function(){e.call(null,t)});case 3:return N.nextTick(function(){e.call(null,t,n)});case 4:return N.nextTick(function(){e.call(null,t,n,r)});default:for(o=new Array(a-1),i=0;i<o.length;)o[i++]=arguments[i];return N.nextTick(function(){e.apply(null,o)})}}}:Is.exports=N),Is.exports).nextTick,i=Oa()("mqtt-packet:writeToStream"),a=r.cache,s=r.generateNumber,l=r.generateCache,u=r.genBufVariableByteInt,c=r.generate4ByteBuffer;let f=b,p=!0;function h(r,a,s){switch(i("generate called"),a.cork&&(a.cork(),o(d,a)),p&&(p=!1,l()),i("generate: packet.cmd: %s",r.cmd),r.cmd){case"connect":return function(t,n){const r=t||{},o=r.protocolId||"MQTT";let i=r.protocolVersion||4;const a=r.will;let s=r.clean;const l=r.keepalive||0,u=r.clientId||"",c=r.username,p=r.password,h=r.properties;void 0===s&&(s=!0);let d=0;if("string"!=typeof o&&!es.isBuffer(o))return n.emit("error",new Error("Invalid protocolId")),!1;d+=o.length+2;if(3!==i&&4!==i&&5!==i)return n.emit("error",new Error("Invalid protocol version")),!1;d+=1;if(("string"==typeof u||es.isBuffer(u))&&(u||i>=4)&&(u||s))d+=es.byteLength(u)+2;else{if(i<4)return n.emit("error",new Error("clientId must be supplied before 3.1.1")),!1;if(1*s==0)return n.emit("error",new Error("clientId must be given if cleanSession set to 0")),!1}if("number"!=typeof l||l<0||l>65535||l%1!=0)return n.emit("error",new Error("Invalid keepalive")),!1;d+=2;if(d+=1,5===i){var y=k(n,h);if(!y)return!1;d+=y.length}if(a){if("object"!=typeof a)return n.emit("error",new Error("Invalid will")),!1;if(!a.topic||"string"!=typeof a.topic)return n.emit("error",new Error("Invalid will topic")),!1;if(d+=es.byteLength(a.topic)+2,d+=2,a.payload){if(!(a.payload.length>=0))return n.emit("error",new Error("Invalid will payload")),!1;"string"==typeof a.payload?d+=es.byteLength(a.payload):d+=a.payload.length}var v={};if(5===i){if(!(v=k(n,a.properties)))return!1;d+=v.length}}let b=!1;if(null!=c){if(!I(c))return n.emit("error",new Error("Invalid username")),!1;b=!0,d+=es.byteLength(c)+2}if(null!=p){if(!b)return n.emit("error",new Error("Username is required to use password")),!1;if(!I(p))return n.emit("error",new Error("Invalid password")),!1;d+=C(p)+2}n.write(e.CONNECT_HEADER),g(n,d),S(n,o),r.bridgeMode&&(i+=128);n.write(131===i?e.VERSION131:132===i?e.VERSION132:4===i?e.VERSION4:5===i?e.VERSION5:e.VERSION3);let w=0;w|=null!=c?e.USERNAME_MASK:0,w|=null!=p?e.PASSWORD_MASK:0,w|=a&&a.retain?e.WILL_RETAIN_MASK:0,w|=a&&a.qos?a.qos<<e.WILL_QOS_SHIFT:0,w|=a?e.WILL_FLAG_MASK:0,w|=s?e.CLEAN_SESSION_MASK:0,n.write(es.from([w])),f(n,l),5===i&&y.write();S(n,u),a&&(5===i&&v.write(),m(n,a.topic),S(n,a.payload));null!=c&&S(n,c);null!=p&&S(n,p);return!0}(r,a);case"connack":return function(t,r,o){const i=o?o.protocolVersion:4,a=t||{},s=5===i?a.reasonCode:a.returnCode,l=a.properties;let u=2;if("number"!=typeof s)return r.emit("error",new Error("Invalid return code")),!1;let c=null;if(5===i){if(c=k(r,l),!c)return!1;u+=c.length}r.write(e.CONNACK_HEADER),g(r,u),r.write(a.sessionPresent?e.SESSIONPRESENT_HEADER:n),r.write(es.from([s])),null!=c&&c.write();return!0}(r,a,s);case"publish":return function(n,r,o){i("publish: packet: %o",n);const a=o?o.protocolVersion:4,s=n||{},l=s.qos||0,u=s.retain?e.RETAIN_MASK:0,c=s.topic,p=s.payload||t,h=s.messageId,d=s.properties;let y=0;if("string"==typeof c)y+=es.byteLength(c)+2;else{if(!es.isBuffer(c))return r.emit("error",new Error("Invalid topic")),!1;y+=c.length+2}es.isBuffer(p)?y+=p.length:y+=es.byteLength(p);if(l&&"number"!=typeof h)return r.emit("error",new Error("Invalid messageId")),!1;l&&(y+=2);let m=null;if(5===a){if(m=k(r,d),!m)return!1;y+=m.length}r.write(e.PUBLISH_HEADER[l][s.dup?1:0][u?1:0]),g(r,y),f(r,C(c)),r.write(c),l>0&&f(r,h);null!=m&&m.write();return i("publish: payload: %o",p),r.write(p)}(r,a,s);case"puback":case"pubrec":case"pubrel":case"pubcomp":return function(t,n,r){const o=r?r.protocolVersion:4,i=t||{},a=i.cmd||"puback",s=i.messageId,l=i.dup&&"pubrel"===a?e.DUP_MASK:0;let u=0;const c=i.reasonCode,p=i.properties;let h=5===o?3:2;"pubrel"===a&&(u=1);if("number"!=typeof s)return n.emit("error",new Error("Invalid messageId")),!1;let d=null;if(5===o&&"object"==typeof p){if(d=x(n,p,r,h),!d)return!1;h+=d.length}n.write(e.ACKS[a][u][l][0]),g(n,h),f(n,s),5===o&&n.write(es.from([c]));null!==d&&d.write();return!0}(r,a,s);case"subscribe":return function(t,n,r){i("subscribe: packet: ");const o=r?r.protocolVersion:4,a=t||{},s=a.dup?e.DUP_MASK:0,l=a.messageId,u=a.subscriptions,c=a.properties;let p=0;if("number"!=typeof l)return n.emit("error",new Error("Invalid messageId")),!1;p+=2;let h=null;if(5===o){if(h=k(n,c),!h)return!1;p+=h.length}if("object"!=typeof u||!u.length)return n.emit("error",new Error("Invalid subscriptions")),!1;for(let e=0;e<u.length;e+=1){const t=u[e].topic,r=u[e].qos;if("string"!=typeof t)return n.emit("error",new Error("Invalid subscriptions - invalid topic")),!1;if("number"!=typeof r)return n.emit("error",new Error("Invalid subscriptions - invalid qos")),!1;if(5===o){if("boolean"!=typeof(u[e].nl||!1))return n.emit("error",new Error("Invalid subscriptions - invalid No Local")),!1;if("boolean"!=typeof(u[e].rap||!1))return n.emit("error",new Error("Invalid subscriptions - invalid Retain as Published")),!1;const t=u[e].rh||0;if("number"!=typeof t||t>2)return n.emit("error",new Error("Invalid subscriptions - invalid Retain Handling")),!1}p+=es.byteLength(t)+2+1}i("subscribe: writing to stream: %o",e.SUBSCRIBE_HEADER),n.write(e.SUBSCRIBE_HEADER[1][s?1:0][0]),g(n,p),f(n,l),null!==h&&h.write();let d=!0;for(const i of u){const t=i.topic,r=i.qos,a=+i.nl,s=+i.rap,l=i.rh;let u;m(n,t),u=e.SUBSCRIBE_OPTIONS_QOS[r],5===o&&(u|=a?e.SUBSCRIBE_OPTIONS_NL:0,u|=s?e.SUBSCRIBE_OPTIONS_RAP:0,u|=l?e.SUBSCRIBE_OPTIONS_RH[l]:0),d=n.write(es.from([u]))}return d}(r,a,s);case"suback":return function(t,n,r){const o=r?r.protocolVersion:4,i=t||{},a=i.messageId,s=i.granted,l=i.properties;let u=0;if("number"!=typeof a)return n.emit("error",new Error("Invalid messageId")),!1;u+=2;if("object"!=typeof s||!s.length)return n.emit("error",new Error("Invalid qos vector")),!1;for(let e=0;e<s.length;e+=1){if("number"!=typeof s[e])return n.emit("error",new Error("Invalid qos vector")),!1;u+=1}let c=null;if(5===o){if(c=x(n,l,r,u),!c)return!1;u+=c.length}n.write(e.SUBACK_HEADER),g(n,u),f(n,a),null!==c&&c.write();return n.write(es.from(s))}(r,a,s);case"unsubscribe":return function(t,n,r){const o=r?r.protocolVersion:4,i=t||{},a=i.messageId,s=i.dup?e.DUP_MASK:0,l=i.unsubscriptions,u=i.properties;let c=0;if("number"!=typeof a)return n.emit("error",new Error("Invalid messageId")),!1;c+=2;if("object"!=typeof l||!l.length)return n.emit("error",new Error("Invalid unsubscriptions")),!1;for(let e=0;e<l.length;e+=1){if("string"!=typeof l[e])return n.emit("error",new Error("Invalid unsubscriptions")),!1;c+=es.byteLength(l[e])+2}let p=null;if(5===o){if(p=k(n,u),!p)return!1;c+=p.length}n.write(e.UNSUBSCRIBE_HEADER[1][s?1:0][0]),g(n,c),f(n,a),null!==p&&p.write();let h=!0;for(let e=0;e<l.length;e++)h=m(n,l[e]);return h}(r,a,s);case"unsuback":return function(t,n,r){const o=r?r.protocolVersion:4,i=t||{},a=i.messageId,s=i.dup?e.DUP_MASK:0,l=i.granted,u=i.properties,c=i.cmd,p=0;let h=2;if("number"!=typeof a)return n.emit("error",new Error("Invalid messageId")),!1;if(5===o){if("object"!=typeof l||!l.length)return n.emit("error",new Error("Invalid qos vector")),!1;for(let e=0;e<l.length;e+=1){if("number"!=typeof l[e])return n.emit("error",new Error("Invalid qos vector")),!1;h+=1}}let d=null;if(5===o){if(d=x(n,u,r,h),!d)return!1;h+=d.length}n.write(e.ACKS[c][p][s][0]),g(n,h),f(n,a),null!==d&&d.write();5===o&&n.write(es.from(l));return!0}(r,a,s);case"pingreq":case"pingresp":return function(t,n){return n.write(e.EMPTY[t.cmd])}(r,a);case"disconnect":return function(t,n,r){const o=r?r.protocolVersion:4,i=t||{},a=i.reasonCode,s=i.properties;let l=5===o?1:0,u=null;if(5===o){if(u=x(n,s,r,l),!u)return!1;l+=u.length}n.write(es.from([e.codes.disconnect<<4])),g(n,l),5===o&&n.write(es.from([a]));null!==u&&u.write();return!0}(r,a,s);case"auth":return function(t,n,r){const o=r?r.protocolVersion:4,i=t||{},a=i.reasonCode,s=i.properties;let l=5===o?1:0;5!==o&&n.emit("error",new Error("Invalid mqtt version for auth packet"));const u=x(n,s,r,l);if(!u)return!1;l+=u.length,n.write(es.from([e.codes.auth<<4])),g(n,l),n.write(es.from([a])),null!==u&&u.write();return!0}(r,a,s);default:return a.emit("error",new Error("Unknown command")),!1}}function d(e){e.uncork()}Object.defineProperty(h,"cacheNumbers",{get:()=>f===b,set(e){e?(a&&0!==Object.keys(a).length||(p=!0),f=b):(p=!1,f=w)}});const y={};function g(t,n){if(n>e.VARBYTEINT_MAX)return t.emit("error",new Error(`Invalid variable byte integer: ${n}`)),!1;let r=y[n];return r||(r=u(n),n<16384&&(y[n]=r)),i("writeVarByteInt: writing to stream: %o",r),t.write(r)}function m(e,t){const n=es.byteLength(t);return f(e,n),i("writeString: %s",t),e.write(t,"utf8")}function v(e,t,n){m(e,t),m(e,n)}function b(e,t){return i("writeNumberCached: number: %d",t),i("writeNumberCached: %o",a[t]),e.write(a[t])}function w(e,t){const n=s(t);return i("writeNumberGenerated: %o",n),e.write(n)}function S(e,t){"string"==typeof t?m(e,t):t?(f(e,t.length),e.write(t)):f(e,0)}function k(t,n){if("object"!=typeof n||null!=n.length)return{length:1,write(){_(t,{},0)}};let r=0;function o(n,r){let o=0;switch(e.propertiesTypes[n]){case"byte":if("boolean"!=typeof r)return t.emit("error",new Error(`Invalid ${n}: ${r}`)),!1;o+=2;break;case"int8":if("number"!=typeof r||r<0||r>255)return t.emit("error",new Error(`Invalid ${n}: ${r}`)),!1;o+=2;break;case"binary":if(r&&null===r)return t.emit("error",new Error(`Invalid ${n}: ${r}`)),!1;o+=1+es.byteLength(r)+2;break;case"int16":if("number"!=typeof r||r<0||r>65535)return t.emit("error",new Error(`Invalid ${n}: ${r}`)),!1;o+=3;break;case"int32":if("number"!=typeof r||r<0||r>4294967295)return t.emit("error",new Error(`Invalid ${n}: ${r}`)),!1;o+=5;break;case"var":if("number"!=typeof r||r<0||r>268435455)return t.emit("error",new Error(`Invalid ${n}: ${r}`)),!1;o+=1+es.byteLength(u(r));break;case"string":if("string"!=typeof r)return t.emit("error",new Error(`Invalid ${n}: ${r}`)),!1;o+=3+es.byteLength(r.toString());break;case"pair":if("object"!=typeof r)return t.emit("error",new Error(`Invalid ${n}: ${r}`)),!1;o+=Object.getOwnPropertyNames(r).reduce((e,t)=>{const n=r[t];return Array.isArray(n)?e+=n.reduce((e,n)=>e+=3+es.byteLength(t.toString())+2+es.byteLength(n.toString()),0):e+=3+es.byteLength(t.toString())+2+es.byteLength(r[t].toString()),e},0);break;default:return t.emit("error",new Error(`Invalid property ${n}: ${r}`)),!1}return o}if(n)for(const e in n){let t=0,i=0;const a=n[e];if(Array.isArray(a))for(let n=0;n<a.length;n++){if(i=o(e,a[n]),!i)return!1;t+=i}else{if(i=o(e,a),!i)return!1;t=i}if(!t)return!1;r+=t}return{length:es.byteLength(u(r))+r,write(){_(t,n,r)}}}function x(e,t,n,r){const o=["reasonString","userProperties"],i=n&&n.properties&&n.properties.maximumPacketSize?n.properties.maximumPacketSize:0;let a=k(e,t);if(i)for(;r+a.length>i;){const n=o.shift();if(!n||!t[n])return!1;delete t[n],a=k(e,t)}return a}function E(t,n,r){switch(e.propertiesTypes[n]){case"byte":t.write(es.from([e.properties[n]])),t.write(es.from([+r]));break;case"int8":t.write(es.from([e.properties[n]])),t.write(es.from([r]));break;case"binary":t.write(es.from([e.properties[n]])),S(t,r);break;case"int16":t.write(es.from([e.properties[n]])),f(t,r);break;case"int32":t.write(es.from([e.properties[n]])),function(e,t){const n=c(t);i("write4ByteNumber: %o",n),e.write(n)}(t,r);break;case"var":t.write(es.from([e.properties[n]])),g(t,r);break;case"string":t.write(es.from([e.properties[n]])),m(t,r);break;case"pair":Object.getOwnPropertyNames(r).forEach(o=>{const i=r[o];Array.isArray(i)?i.forEach(r=>{t.write(es.from([e.properties[n]])),v(t,o.toString(),r.toString())}):(t.write(es.from([e.properties[n]])),v(t,o.toString(),i.toString()))});break;default:return t.emit("error",new Error(`Invalid property ${n} value: ${r}`)),!1}}function _(e,t,n){g(e,n);for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&null!==t[r]){const n=t[r];if(Array.isArray(n))for(let t=0;t<n.length;t++)E(e,r,n[t]);else E(e,r,n)}}function C(e){return e?e instanceof es?e.length:es.byteLength(e):0}function I(e){return"string"==typeof e||e instanceof es}return cs=h}function As(){return ds||(ds=1,za.parser=ls().parser,za.generate=function(){if(hs)return ps;hs=1;const e=Ts(),t=Ge();class n extends t{constructor(){super(),this._array=new Array(20),this._i=0}write(e){return this._array[this._i++]=e,!0}concat(){let e=0;const t=new Array(this._array.length),n=this._array;let r,o=0;for(r=0;r<n.length&&void 0!==n[r];r++)"string"!=typeof n[r]?t[r]=n[r].length:t[r]=es.byteLength(n[r]),e+=t[r];const i=es.allocUnsafe(e);for(r=0;r<n.length&&void 0!==n[r];r++)"string"!=typeof n[r]?(n[r].copy(i,o),o+=t[r]):(i.write(n[r],o),o+=t[r]);return i}}return ps=function(t,r){const o=new n;return e(t,o,r),o.concat()}}(),za.writeToStream=Ts()),za}function Ps(){if(ws)return bs;function e(e){return e instanceof es?es.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}return ws=1,bs=function(t){if((t=t||{}).circles)return function(t){const n=[],r=[],o=new Map;if(o.set(Date,e=>new Date(e)),o.set(Map,(e,t)=>new Map(a(Array.from(e),t))),o.set(Set,(e,t)=>new Set(a(Array.from(e),t))),t.constructorHandlers)for(const e of t.constructorHandlers)o.set(e[0],e[1]);let i=null;return t.proto?l:s;function a(t,a){const s=Object.keys(t),l=new Array(s.length);for(let u=0;u<s.length;u++){const c=s[u],f=t[c];if("object"!=typeof f||null===f)l[c]=f;else if(f.constructor!==Object&&(i=o.get(f.constructor)))l[c]=i(f,a);else if(ArrayBuffer.isView(f))l[c]=e(f);else{const e=n.indexOf(f);l[c]=-1!==e?r[e]:a(f)}}return l}function s(t){if("object"!=typeof t||null===t)return t;if(Array.isArray(t))return a(t,s);if(t.constructor!==Object&&(i=o.get(t.constructor)))return i(t,s);const l={};n.push(t),r.push(l);for(const a in t){if(!1===Object.hasOwnProperty.call(t,a))continue;const u=t[a];if("object"!=typeof u||null===u)l[a]=u;else if(u.constructor!==Object&&(i=o.get(u.constructor)))l[a]=i(u,s);else if(ArrayBuffer.isView(u))l[a]=e(u);else{const e=n.indexOf(u);l[a]=-1!==e?r[e]:s(u)}}return n.pop(),r.pop(),l}function l(t){if("object"!=typeof t||null===t)return t;if(Array.isArray(t))return a(t,l);if(t.constructor!==Object&&(i=o.get(t.constructor)))return i(t,l);const s={};n.push(t),r.push(s);for(const a in t){const u=t[a];if("object"!=typeof u||null===u)s[a]=u;else if(u.constructor!==Object&&(i=o.get(u.constructor)))s[a]=i(u,l);else if(ArrayBuffer.isView(u))s[a]=e(u);else{const e=n.indexOf(u);s[a]=-1!==e?r[e]:l(u)}}return n.pop(),r.pop(),s}}(t);const n=new Map;if(n.set(Date,e=>new Date(e)),n.set(Map,(e,t)=>new Map(o(Array.from(e),t))),n.set(Set,(e,t)=>new Set(o(Array.from(e),t))),t.constructorHandlers)for(const e of t.constructorHandlers)n.set(e[0],e[1]);let r=null;return t.proto?function t(i){if("object"!=typeof i||null===i)return i;if(Array.isArray(i))return o(i,t);if(i.constructor!==Object&&(r=n.get(i.constructor)))return r(i,t);const a={};for(const o in i){const s=i[o];"object"!=typeof s||null===s?a[o]=s:s.constructor!==Object&&(r=n.get(s.constructor))?a[o]=r(s,t):ArrayBuffer.isView(s)?a[o]=e(s):a[o]=t(s)}return a}:function t(i){if("object"!=typeof i||null===i)return i;if(Array.isArray(i))return o(i,t);if(i.constructor!==Object&&(r=n.get(i.constructor)))return r(i,t);const a={};for(const o in i){if(!1===Object.hasOwnProperty.call(i,o))continue;const s=i[o];"object"!=typeof s||null===s?a[o]=s:s.constructor!==Object&&(r=n.get(s.constructor))?a[o]=r(s,t):ArrayBuffer.isView(s)?a[o]=e(s):a[o]=t(s)}return a};function o(t,o){const i=Object.keys(t),a=new Array(i.length);for(let s=0;s<i.length;s++){const l=i[s],u=t[l];"object"!=typeof u||null===u?a[l]=u:u.constructor!==Object&&(r=n.get(u.constructor))?a[l]=r(u,o):ArrayBuffer.isView(u)?a[l]=e(u):a[l]=o(u)}return a}},bs}function js(){if(Cs)return _s;Cs=1;const e=Ge().EventEmitter,t=si(),n=function(){if(Vo)return qo;function e(t){if(!(this instanceof e))return new e(t);this.aliasToTopic={},this.max=t}return Vo=1,e.prototype.put=function(e,t){return!(0===t||t>this.max||(this.aliasToTopic[t]=e,this.length=Object.keys(this.aliasToTopic).length,0))},e.prototype.getTopicByAlias=function(e){return this.aliasToTopic[e]},e.prototype.clear=function(){this.aliasToTopic={}},qo=e}(),r=Ma(),o=As(),i=function(){if(gs)return ys;function e(){if(!(this instanceof e))return new e;this.nextId=Math.max(1,Math.floor(65535*Math.random()))}return gs=1,e.prototype.allocate=function(){const e=this.nextId++;return 65536===this.nextId&&(this.nextId=1),e},e.prototype.getLastAllocated=function(){return 1===this.nextId?65535:this.nextId-1},e.prototype.register=function(e){return!0},e.prototype.deallocate=function(e){},e.prototype.clear=function(){},ys=e}(),a=ai().Writable,s=io(),c=function(){if(vs)return ms;function e(e,t,n){var r=this;this._callback=e,this._args=n,this._interval=setInterval(e,t,this._args),this.reschedule=function(e){e||(e=r._interval),r._interval&&clearInterval(r._interval),r._interval=setInterval(r._callback,e,r._args)},this.clear=function(){r._interval&&(clearInterval(r._interval),r._interval=void 0)},this.destroy=function(){r._interval&&clearInterval(r._interval),r._callback=void 0,r._interval=void 0,r._args=void 0}}return vs=1,ms=function(){if("function"!=typeof arguments[0])throw new Error("callback needed");if("number"!=typeof arguments[1])throw new Error("interval needed");var t;if(arguments.length>0){t=new Array(arguments.length-2);for(var n=0;n<t.length;n++)t[n]=arguments[n+2]}return new e(arguments[0],arguments[1],t)},ms}(),f=ks?Ss:(ks=1,Ss=Ps()()),p=function(){if(Es)return xs;function e(e){const t=e.split("/");for(let n=0;n<t.length;n++)if("+"!==t[n]){if("#"===t[n])return n===t.length-1;if(-1!==t[n].indexOf("+")||-1!==t[n].indexOf("#"))return!1}return!0}return Es=1,xs={validateTopics:function(t){if(0===t.length)return"empty_topic_list";for(let n=0;n<t.length;n++)if(!e(t[n]))return t[n];return null}},xs}(),h=Ye(),d=Oa()("mqttjs:client"),y=N?N.nextTick:function(e){setTimeout(e,0)},g=m.setImmediate||function(e){y(e)},v={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:3e4,clean:!0,resubscribe:!0},b={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};function w(e,t){let n;t.properties&&(n=t.properties.topicAlias);let r=t.topic.toString();if(0===r.length){if(void 0===n)return new Error("Unregistered Topic Alias");if(r=e.topicAliasSend.getTopicByAlias(n),void 0===r)return new Error("Unregistered Topic Alias");t.topic=r}n&&delete t.properties.topicAlias}function S(e,t,n){d("sendPacket :: packet: %O",t),d("sendPacket :: emitting `packetsend`"),e.emit("packetsend",t),d("sendPacket :: writing to stream");const r=o.writeToStream(t,e.stream,e.options);d("sendPacket :: writeToStream result %s",r),!r&&n&&n!==x?(d("sendPacket :: handle events on `drain` once through callback."),e.stream.once("drain",n)):n&&(d("sendPacket :: invoking cb"),n())}function k(e,t,n,r){d("storeAndSend :: store packet with cmd %s to outgoingStore",t.cmd);let o,i=t;if("publish"===i.cmd&&(i=f(t),o=w(e,i),o))return n&&n(o);e.outgoingStore.put(i,function(o){if(o)return n&&n(o);r(),S(e,t,n)})}function x(e){d("nop ::",e)}function E(r,o){let a;const s=this;if(!(this instanceof E))return new E(r,o);for(a in this.options=o||{},v)void 0===this.options[a]?this.options[a]=v[a]:this.options[a]=o[a];d("MqttClient :: options.protocol",o.protocol),d("MqttClient :: options.protocolVersion",o.protocolVersion),d("MqttClient :: options.username",o.username),d("MqttClient :: options.keepalive",o.keepalive),d("MqttClient :: options.reconnectPeriod",o.reconnectPeriod),d("MqttClient :: options.rejectUnauthorized",o.rejectUnauthorized),d("MqttClient :: options.topicAliasMaximum",o.topicAliasMaximum),this.options.clientId="string"==typeof o.clientId?o.clientId:"mqttjs_"+Math.random().toString(16).substr(2,8),d("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=5===o.protocolVersion&&o.customHandleAcks?o.customHandleAcks:function(){arguments[3](0)},this.streamBuilder=r,this.messageIdProvider=void 0===this.options.messageIdProvider?new i:this.options.messageIdProvider,this.outgoingStore=o.outgoingStore||new t,this.incomingStore=o.incomingStore||new t,this.queueQoSZero=void 0===o.queueQoSZero||o.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.pingTimer=null,this.connected=!1,this.disconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,o.topicAliasMaximum>0&&(o.topicAliasMaximum>65535?d("MqttClient :: options.topicAliasMaximum is out of range"):this.topicAliasRecv=new n(o.topicAliasMaximum)),this.on("connect",function(){const e=this.queue;d("connect :: sending queued packets"),function t(){const n=e.shift();d("deliver :: entry %o",n);let r=null;if(!n)return void s._resubscribe();r=n.packet,d("deliver :: call _sendPacket for %o",r);let o=!0;r.messageId&&0!==r.messageId&&(s.messageIdProvider.register(r.messageId)||(o=!1)),o?s._sendPacket(r,function(e){n.cb&&n.cb(e),t()}):(d("messageId: %d has already used. The message is skipped and removed.",r.messageId),t())}()}),this.on("close",function(){d("close :: connected set to `false`"),this.connected=!1,d("close :: clearing connackTimer"),clearTimeout(this.connackTimer),d("close :: clearing ping timer"),null!==s.pingTimer&&(s.pingTimer.clear(),s.pingTimer=null),this.topicAliasRecv&&this.topicAliasRecv.clear(),d("close :: calling _setupReconnect"),this._setupReconnect()}),e.call(this),d("MqttClient :: setting up stream"),this._setupStream()}return s(E,e),E.prototype._setupStream=function(){const e=this,t=new a,n=o.parser(this.options);let r=null;const i=[];function s(){if(i.length)y(l);else{const e=r;r=null,e()}}function l(){d("work :: getting next packet in queue");const t=i.shift();if(t)d("work :: packet pulled from queue"),e._handlePacket(t,s);else{d("work :: no packets in queue");const e=r;r=null,d("work :: done flag is %s",!!e),e&&e()}}d("_setupStream :: calling method to clear reconnect"),this._clearReconnect(),d("_setupStream :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),n.on("packet",function(e){d("parser :: on packet push to packets array."),i.push(e)}),t._write=function(e,t,o){r=o,d("writable stream :: parsing buffer"),n.parse(e),l()},d("_setupStream :: pipe stream to writable stream"),this.stream.pipe(t),this.stream.on("error",function(t){d("streamErrorHandler :: error",t.message),t.code?(d("streamErrorHandler :: emitting error"),e.emit("error",t)):x(t)}),this.stream.on("close",function(){var t;d("(%s)stream :: on close",e.options.clientId),(t=e.outgoing)&&(d("flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(t).forEach(function(e){t[e].volatile&&"function"==typeof t[e].cb&&(t[e].cb(new Error("Connection closed")),delete t[e])})),d("stream: emit close to MqttClient"),e.emit("close")}),d("_setupStream: sending packet `connect`");const u=Object.create(this.options);if(u.cmd="connect",this.topicAliasRecv&&(u.properties||(u.properties={}),this.topicAliasRecv&&(u.properties.topicAliasMaximum=this.topicAliasRecv.max)),S(this,u),n.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return e.end(()=>this.emit("error",new Error("Packet has no Authentication Method"))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&"object"==typeof this.options.authPacket){S(this,h({cmd:"auth",reasonCode:0},this.options.authPacket))}}this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(function(){d("!!connectTimeout hit!! Calling _cleanUp with force `true`"),e._cleanUp(!0)},this.options.connectTimeout)},E.prototype._handlePacket=function(e,t){const n=this.options;if(5===n.protocolVersion&&n.properties&&n.properties.maximumPacketSize&&n.properties.maximumPacketSize<e.length)return this.emit("error",new Error("exceeding packets size "+e.cmd)),this.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),this;switch(d("_handlePacket :: emitting packetreceive"),this.emit("packetreceive",e),e.cmd){case"publish":this._handlePublish(e,t);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":this._handleAck(e),t();break;case"pubrel":this._handlePubrel(e,t);break;case"connack":this._handleConnack(e),t();break;case"auth":this._handleAuth(e),t();break;case"pingresp":this._handlePingresp(e),t();break;case"disconnect":this._handleDisconnect(e),t()}},E.prototype._checkDisconnecting=function(e){return this.disconnecting&&(e&&e!==x?e(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting},E.prototype.publish=function(e,t,n,r){d("publish :: message `%s` to topic `%s`",t,e);const o=this.options;"function"==typeof n&&(r=n,n=null);if(n=h({qos:0,retain:!1,dup:!1},n),this._checkDisconnecting(r))return this;const i=this,a=function(){let a=0;if((1===n.qos||2===n.qos)&&(a=i._nextId(),null===a))return d("No messageId left"),!1;const s={cmd:"publish",topic:e,payload:t,qos:n.qos,retain:n.retain,messageId:a,dup:n.dup};switch(5===o.protocolVersion&&(s.properties=n.properties),d("publish :: qos",n.qos),n.qos){case 1:case 2:i.outgoing[s.messageId]={volatile:!1,cb:r||x},d("MqttClient:publish: packet cmd: %s",s.cmd),i._sendPacket(s,void 0,n.cbStorePut);break;default:d("MqttClient:publish: packet cmd: %s",s.cmd),i._sendPacket(s,r,n.cbStorePut)}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!a())&&this._storeProcessingQueue.push({invoke:a,cbStorePut:n.cbStorePut,callback:r}),this},E.prototype.subscribe=function(){const e=this,t=new Array(arguments.length);for(let f=0;f<arguments.length;f++)t[f]=arguments[f];const n=[];let r=t.shift();const o=r.resubscribe;let i=t.pop()||x,a=t.pop();const s=this.options.protocolVersion;delete r.resubscribe,"string"==typeof r&&(r=[r]),"function"!=typeof i&&(a=i,i=x);const l=p.validateTopics(r);if(null!==l)return g(i,new Error("Invalid topic "+l)),this;if(this._checkDisconnecting(i))return d("subscribe: discconecting true"),this;const u={qos:0};if(5===s&&(u.nl=!1,u.rap=!1,u.rh=0),a=h(u,a),Array.isArray(r)?r.forEach(function(t){if(d("subscribe: array topic %s",t),!Object.prototype.hasOwnProperty.call(e._resubscribeTopics,t)||e._resubscribeTopics[t].qos<a.qos||o){const e={topic:t,qos:a.qos};5===s&&(e.nl=a.nl,e.rap=a.rap,e.rh=a.rh,e.properties=a.properties),d("subscribe: pushing topic `%s` and qos `%s` to subs list",e.topic,e.qos),n.push(e)}}):Object.keys(r).forEach(function(t){if(d("subscribe: object topic %s",t),!Object.prototype.hasOwnProperty.call(e._resubscribeTopics,t)||e._resubscribeTopics[t].qos<r[t].qos||o){const e={topic:t,qos:r[t].qos};5===s&&(e.nl=r[t].nl,e.rap=r[t].rap,e.rh=r[t].rh,e.properties=a.properties),d("subscribe: pushing `%s` to subs list",e),n.push(e)}}),!n.length)return i(null,[]),this;const c=function(){const t=e._nextId();if(null===t)return d("No messageId left"),!1;const r={cmd:"subscribe",subscriptions:n,qos:1,retain:!1,dup:!1,messageId:t};if(a.properties&&(r.properties=a.properties),e.options.resubscribe){d("subscribe :: resubscribe true");const t=[];n.forEach(function(n){if(e.options.reconnectPeriod>0){const r={qos:n.qos};5===s&&(r.nl=n.nl||!1,r.rap=n.rap||!1,r.rh=n.rh||0,r.properties=n.properties),e._resubscribeTopics[n.topic]=r,t.push(n.topic)}}),e.messageIdToTopic[r.messageId]=t}return e.outgoing[r.messageId]={volatile:!0,cb:function(e,t){if(!e){const e=t.granted;for(let t=0;t<e.length;t+=1)n[t].qos=e[t]}i(e,n)}},d("subscribe :: call _sendPacket"),e._sendPacket(r),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!c())&&this._storeProcessingQueue.push({invoke:c,callback:i}),this},E.prototype.unsubscribe=function(){const e=this,t=new Array(arguments.length);for(let s=0;s<arguments.length;s++)t[s]=arguments[s];let n=t.shift(),r=t.pop()||x,o=t.pop();"string"==typeof n&&(n=[n]),"function"!=typeof r&&(o=r,r=x);const i=p.validateTopics(n);if(null!==i)return g(r,new Error("Invalid topic "+i)),this;if(e._checkDisconnecting(r))return this;const a=function(){const t=e._nextId();if(null===t)return d("No messageId left"),!1;const i={cmd:"unsubscribe",qos:1,messageId:t};return"string"==typeof n?i.unsubscriptions=[n]:Array.isArray(n)&&(i.unsubscriptions=n),e.options.resubscribe&&i.unsubscriptions.forEach(function(t){delete e._resubscribeTopics[t]}),"object"==typeof o&&o.properties&&(i.properties=o.properties),e.outgoing[i.messageId]={volatile:!0,cb:r},d("unsubscribe: call _sendPacket"),e._sendPacket(i),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!a())&&this._storeProcessingQueue.push({invoke:a,callback:r}),this},E.prototype.end=function(e,t,n){const r=this;function o(){d("end :: closeStores: closing incoming and outgoing stores"),r.disconnected=!0,r.incomingStore.close(function(e){r.outgoingStore.close(function(t){if(d("end :: closeStores: emitting end"),r.emit("end"),n){const r=e||t;d("end :: closeStores: invoking callback with args"),n(r)}})}),r._deferredReconnect&&r._deferredReconnect()}function i(){d("end :: (%s) :: finish :: calling _cleanUp with force %s",r.options.clientId,e),r._cleanUp(e,()=>{d("end :: finish :: calling process.nextTick on closeStores"),y(o.bind(r))},t)}return d("end :: (%s)",this.options.clientId),null!=e&&"boolean"==typeof e||(n=t||x,t=e,e=!1,"object"!=typeof t&&(n=t,t=null,"function"!=typeof n&&(n=x))),"object"!=typeof t&&(n=t,t=null),d("end :: cb? %s",!!n),n=n||x,this.disconnecting?(n(),this):(this._clearReconnect(),this.disconnecting=!0,!e&&Object.keys(this.outgoing).length>0?(d("end :: (%s) :: calling finish in 10ms once outgoing is empty",r.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,i,10))):(d("end :: (%s) :: immediately calling finish",r.options.clientId),i()),this)},E.prototype.removeOutgoingMessage=function(e){const t=this.outgoing[e]?this.outgoing[e].cb:null;return delete this.outgoing[e],this.outgoingStore.del({messageId:e},function(){t(new Error("Message removed"))}),this},E.prototype.reconnect=function(e){d("client reconnect");const n=this,r=function(){e?(n.options.incomingStore=e.incomingStore,n.options.outgoingStore=e.outgoingStore):(n.options.incomingStore=null,n.options.outgoingStore=null),n.incomingStore=n.options.incomingStore||new t,n.outgoingStore=n.options.outgoingStore||new t,n.disconnecting=!1,n.disconnected=!1,n._deferredReconnect=null,n._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=r:r(),this},E.prototype._reconnect=function(){d("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this._setupStream()}),d("client already connected. disconnecting first.")):(d("_reconnect: calling _setupStream"),this._setupStream())},E.prototype._setupReconnect=function(){const e=this;!e.disconnecting&&!e.reconnectTimer&&e.options.reconnectPeriod>0?(this.reconnecting||(d("_setupReconnect :: emit `offline` state"),this.emit("offline"),d("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),d("_setupReconnect :: setting reconnectTimer for %d ms",e.options.reconnectPeriod),e.reconnectTimer=setInterval(function(){d("reconnectTimer :: reconnect triggered!"),e._reconnect()},e.options.reconnectPeriod)):d("_setupReconnect :: doing nothing...")},E.prototype._clearReconnect=function(){d("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)},E.prototype._cleanUp=function(e,t){const n=arguments[2];if(t&&(d("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",t)),d("_cleanUp :: forced? %s",e),e)0===this.options.reconnectPeriod&&this.options.clean&&(r=this.outgoing)&&(d("flush: queue exists? %b",!!r),Object.keys(r).forEach(function(e){"function"==typeof r[e].cb&&(r[e].cb(new Error("Connection closed")),delete r[e])})),d("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{const e=h({cmd:"disconnect"},n);d("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(e,g.bind(null,this.stream.end.bind(this.stream)))}var r;this.disconnecting||(d("_cleanUp :: client not disconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),null!==this.pingTimer&&(d("_cleanUp :: clearing pingTimer"),this.pingTimer.clear(),this.pingTimer=null),t&&!this.connected&&(d("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",t),t())},E.prototype._sendPacket=function(e,t,n){d("_sendPacket :: (%s) :: start",this.options.clientId),n=n||x,t=t||x;const r=function(e,t){if(5===e.options.protocolVersion&&"publish"===t.cmd){let n;t.properties&&(n=t.properties.topicAlias);const r=t.topic.toString();if(e.topicAliasSend)if(n){if(0!==r.length&&(d("applyTopicAlias :: register topic: %s - alias: %d",r,n),!e.topicAliasSend.put(r,n)))return d("applyTopicAlias :: error out of range. topic: %s - alias: %d",r,n),new Error("Sending Topic Alias out of range")}else 0!==r.length&&(e.options.autoAssignTopicAlias?(n=e.topicAliasSend.getAliasByTopic(r),n?(t.topic="",t.properties=u(l({},t.properties),{topicAlias:n}),d("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",r,n)):(n=e.topicAliasSend.getLruAlias(),e.topicAliasSend.put(r,n),t.properties=u(l({},t.properties),{topicAlias:n}),d("applyTopicAlias :: auto assign topic: %s - alias: %d",r,n))):e.options.autoUseTopicAlias&&(n=e.topicAliasSend.getAliasByTopic(r),n&&(t.topic="",t.properties=u(l({},t.properties),{topicAlias:n}),d("applyTopicAlias :: auto use topic: %s - alias: %d",r,n))));else if(n)return d("applyTopicAlias :: error out of range. topic: %s - alias: %d",r,n),new Error("Sending Topic Alias out of range")}}(this,e);if(r)t(r);else{if(!this.connected)return"auth"===e.cmd?(this._shiftPingInterval(),void S(this,e,t)):(d("_sendPacket :: client not connected. Storing packet offline."),void this._storePacket(e,t,n));switch(this._shiftPingInterval(),e.cmd){case"publish":break;case"pubrel":return void k(this,e,t,n);default:return void S(this,e,t)}switch(e.qos){case 2:case 1:k(this,e,t,n);break;default:S(this,e,t)}d("_sendPacket :: (%s) :: end",this.options.clientId)}},E.prototype._storePacket=function(e,t,n){d("_storePacket :: packet: %o",e),d("_storePacket :: cb? %s",!!t),n=n||x;let r=e;if("publish"===r.cmd){r=f(e);const n=w(this,r);if(n)return t&&t(n)}0===(r.qos||0)&&this.queueQoSZero||"publish"!==r.cmd?this.queue.push({packet:r,cb:t}):r.qos>0?(t=this.outgoing[r.messageId]?this.outgoing[r.messageId].cb:null,this.outgoingStore.put(r,function(e){if(e)return t&&t(e);n()})):t&&t(new Error("No connection to broker"))},E.prototype._setupPingTimer=function(){d("_setupPingTimer :: keepalive %d (seconds)",this.options.keepalive);const e=this;!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=c(function(){e._checkPing()},1e3*this.options.keepalive))},E.prototype._shiftPingInterval=function(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(1e3*this.options.keepalive)},E.prototype._checkPing=function(){d("_checkPing :: checking ping..."),this.pingResp?(d("_checkPing :: ping response received. Clearing flag and sending `pingreq`"),this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):(d("_checkPing :: calling _cleanUp with force true"),this._cleanUp(!0))},E.prototype._handlePingresp=function(){this.pingResp=!0},E.prototype._handleConnack=function(e){d("_handleConnack");const t=this.options,n=5===t.protocolVersion?e.reasonCode:e.returnCode;if(clearTimeout(this.connackTimer),delete this.topicAliasSend,e.properties){if(e.properties.topicAliasMaximum){if(e.properties.topicAliasMaximum>65535)return void this.emit("error",new Error("topicAliasMaximum from broker is out of range"));e.properties.topicAliasMaximum>0&&(this.topicAliasSend=new r(e.properties.topicAliasMaximum))}e.properties.serverKeepAlive&&t.keepalive&&(t.keepalive=e.properties.serverKeepAlive,this._shiftPingInterval()),e.properties.maximumPacketSize&&(t.properties||(t.properties={}),t.properties.maximumPacketSize=e.properties.maximumPacketSize)}if(0===n)this.reconnecting=!1,this._onConnect(e);else if(n>0){const e=new Error("Connection refused: "+b[n]);e.code=n,this.emit("error",e)}},E.prototype._handleAuth=function(e){const t=this.options.protocolVersion,n=5===t?e.reasonCode:e.returnCode;if(5!==t){const e=new Error("Protocol error: Auth packets are only supported in MQTT 5. Your version:"+t);return e.code=n,void this.emit("error",e)}const r=this;this.handleAuth(e,function(e,t){if(e)r.emit("error",e);else if(24===n)r.reconnecting=!1,r._sendPacket(t);else{const t=new Error("Connection refused: "+b[n]);e.code=n,r.emit("error",t)}})},E.prototype.handleAuth=function(e,t){t()},E.prototype._handlePublish=function(e,t){d("_handlePublish: packet %o",e),t=void 0!==t?t:x;let n=e.topic.toString();const r=e.payload,o=e.qos,i=e.messageId,a=this,s=this.options,l=[0,16,128,131,135,144,145,151,153];if(5===this.options.protocolVersion){let t;if(e.properties&&(t=e.properties.topicAlias),void 0!==t)if(0===n.length){if(!(t>0&&t<=65535))return d("_handlePublish :: topic alias out of range. alias: %d",t),void this.emit("error",new Error("Received Topic Alias is out of range"));{const e=this.topicAliasRecv.getTopicByAlias(t);if(!e)return d("_handlePublish :: unregistered topic alias. alias: %d",t),void this.emit("error",new Error("Received unregistered Topic Alias"));n=e,d("_handlePublish :: topic complemented by alias. topic: %s - alias: %d",n,t)}}else{if(!this.topicAliasRecv.put(n,t))return d("_handlePublish :: topic alias out of range. alias: %d",t),void this.emit("error",new Error("Received Topic Alias is out of range"));d("_handlePublish :: registered topic: %s - alias: %d",n,t)}}switch(d("_handlePublish: qos %d",o),o){case 2:s.customHandleAcks(n,r,e,function(n,r){return n instanceof Error||(r=n,n=null),n?a.emit("error",n):-1===l.indexOf(r)?a.emit("error",new Error("Wrong reason code for pubrec")):void(r?a._sendPacket({cmd:"pubrec",messageId:i,reasonCode:r},t):a.incomingStore.put(e,function(){a._sendPacket({cmd:"pubrec",messageId:i},t)}))});break;case 1:s.customHandleAcks(n,r,e,function(o,s){return o instanceof Error||(s=o,o=null),o?a.emit("error",o):-1===l.indexOf(s)?a.emit("error",new Error("Wrong reason code for puback")):(s||a.emit("message",n,r,e),void a.handleMessage(e,function(e){if(e)return t&&t(e);a._sendPacket({cmd:"puback",messageId:i,reasonCode:s},t)}))});break;case 0:this.emit("message",n,r,e),this.handleMessage(e,t);break;default:d("_handlePublish: unknown QoS. Doing nothing.")}},E.prototype.handleMessage=function(e,t){t()},E.prototype._handleAck=function(e){const t=e.messageId,n=e.cmd;let r=null;const o=this.outgoing[t]?this.outgoing[t].cb:null,i=this;let a;if(o){switch(d("_handleAck :: packet type",n),n){case"pubcomp":case"puback":{const n=e.reasonCode;n&&n>0&&16!==n&&(a=new Error("Publish error: "+b[n]),a.code=n,o(a,e)),delete this.outgoing[t],this.outgoingStore.del(e,o),this.messageIdProvider.deallocate(t),this._invokeStoreProcessingQueue();break}case"pubrec":{r={cmd:"pubrel",qos:2,messageId:t};const n=e.reasonCode;n&&n>0&&16!==n?(a=new Error("Publish error: "+b[n]),a.code=n,o(a,e)):this._sendPacket(r);break}case"suback":delete this.outgoing[t],this.messageIdProvider.deallocate(t);for(let n=0;n<e.granted.length;n++)if(128&e.granted[n]){const e=this.messageIdToTopic[t];e&&e.forEach(function(e){delete i._resubscribeTopics[e]})}this._invokeStoreProcessingQueue(),o(null,e);break;case"unsuback":delete this.outgoing[t],this.messageIdProvider.deallocate(t),this._invokeStoreProcessingQueue(),o(null);break;default:i.emit("error",new Error("unrecognized packet type"))}this.disconnecting&&0===Object.keys(this.outgoing).length&&this.emit("outgoingEmpty")}else d("_handleAck :: Server sent an ack in error. Ignoring.")},E.prototype._handlePubrel=function(e,t){d("handling pubrel packet"),t=void 0!==t?t:x;const n=e.messageId,r=this,o={cmd:"pubcomp",messageId:n};r.incomingStore.get(e,function(e,n){e?r._sendPacket(o,t):(r.emit("message",n.topic,n.payload,n),r.handleMessage(n,function(e){if(e)return t(e);r.incomingStore.del(n,x),r._sendPacket(o,t)}))})},E.prototype._handleDisconnect=function(e){this.emit("disconnect",e)},E.prototype._nextId=function(){return this.messageIdProvider.allocate()},E.prototype.getLastMessageId=function(){return this.messageIdProvider.getLastAllocated()},E.prototype._resubscribe=function(){d("_resubscribe");const e=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||5===this.options.protocolVersion&&!this.connackPacket.sessionPresent)&&e.length>0)if(this.options.resubscribe)if(5===this.options.protocolVersion){d("_resubscribe: protocolVersion 5");for(let t=0;t<e.length;t++){const n={};n[e[t]]=this._resubscribeTopics[e[t]],n.resubscribe=!0,this.subscribe(n,{properties:n[e[t]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1},E.prototype._onConnect=function(e){if(this.disconnected)return void this.emit("connect",e);const t=this;this.connackPacket=e,this.messageIdProvider.clear(),this._setupPingTimer(),this.connected=!0,function n(){let r=t.outgoingStore.createStream();function o(){t._storeProcessing=!1,t._packetIdsDuringStoreProcessing={}}function i(){r.destroy(),r=null,t._flushStoreProcessingQueue(),o()}t.once("close",i),r.on("error",function(e){o(),t._flushStoreProcessingQueue(),t.removeListener("close",i),t.emit("error",e)}),r.on("end",function(){let r=!0;for(const e in t._packetIdsDuringStoreProcessing)if(!t._packetIdsDuringStoreProcessing[e]){r=!1;break}r?(o(),t.removeListener("close",i),t._invokeAllStoreProcessingQueue(),t.emit("connect",e)):n()}),function e(){if(!r)return;t._storeProcessing=!0;const n=r.read(1);let o;n?t._packetIdsDuringStoreProcessing[n.messageId]?e():t.disconnecting||t.reconnectTimer?r.destroy&&r.destroy():(o=t.outgoing[n.messageId]?t.outgoing[n.messageId].cb:null,t.outgoing[n.messageId]={volatile:!1,cb:function(t,n){o&&o(t,n),e()}},t._packetIdsDuringStoreProcessing[n.messageId]=!0,t.messageIdProvider.register(n.messageId)?t._sendPacket(n):d("messageId: %d has already used.",n.messageId)):r.once("readable",e)}()}()},E.prototype._invokeStoreProcessingQueue=function(){if(this._storeProcessingQueue.length>0){const e=this._storeProcessingQueue[0];if(e&&e.invoke())return this._storeProcessingQueue.shift(),!0}return!1},E.prototype._invokeAllStoreProcessingQueue=function(){for(;this._invokeStoreProcessingQueue(););},E.prototype._flushStoreProcessingQueue=function(){for(const e of this._storeProcessingQueue)e.cbStorePut&&e.cbStorePut(new Error("Connection closed")),e.callback&&e.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)},_s=E}var Os,Rs={},Ms={exports:{}},Ls=Ms.exports;const Bs=b(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Ns,Us,Ds,zs,Fs,Hs,Ws,qs,Vs,Ks,$s,Qs,Gs,Ys,Xs,Zs,Js,el,tl,nl,rl,ol,il,al,sl;function ll(){if(Us)return Ns;Us=1;var e="function"==typeof Map&&Map.prototype,t=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,n=e&&t&&"function"==typeof t.get?t.get:null,r=e&&Map.prototype.forEach,o="function"==typeof Set&&Set.prototype,i=Object.getOwnPropertyDescriptor&&o?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,a=o&&i&&"function"==typeof i.get?i.get:null,s=o&&Set.prototype.forEach,l="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,u="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,c="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,f=Boolean.prototype.valueOf,p=Object.prototype.toString,h=Function.prototype.toString,d=String.prototype.match,y=String.prototype.slice,g=String.prototype.replace,v=String.prototype.toUpperCase,b=String.prototype.toLowerCase,w=RegExp.prototype.test,S=Array.prototype.concat,k=Array.prototype.join,x=Array.prototype.slice,E=Math.floor,_="function"==typeof BigInt?BigInt.prototype.valueOf:null,C=Object.getOwnPropertySymbols,I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,T="function"==typeof Symbol&&"object"==typeof Symbol.iterator,A="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===T||"symbol")?Symbol.toStringTag:null,P=Object.prototype.propertyIsEnumerable,j=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function O(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||w.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var r=e<0?-E(-e):E(e);if(r!==e){var o=String(r),i=y.call(t,o.length+1);return g.call(o,n,"$&_")+"."+g.call(g.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return g.call(t,n,"$&_")}var R=Bs,M=R.custom,L=W(M)?M:null,B={__proto__:null,double:'"',single:"'"},N={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function U(e,t,n){var r=n.quoteStyle||t,o=B[r];return o+e+o}function D(e){return g.call(String(e),/"/g,"&quot;")}function z(e){return!A||!("object"==typeof e&&(A in e||void 0!==e[A]))}function F(e){return"[object Array]"===K(e)&&z(e)}function H(e){return"[object RegExp]"===K(e)&&z(e)}function W(e){if(T)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!I)return!1;try{return I.call(e),!0}catch(t){}return!1}Ns=function e(t,o,i,p){var v=o||{};if(V(v,"quoteStyle")&&!V(B,v.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(V(v,"maxStringLength")&&("number"==typeof v.maxStringLength?v.maxStringLength<0&&v.maxStringLength!==1/0:null!==v.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var w=!V(v,"customInspect")||v.customInspect;if("boolean"!=typeof w&&"symbol"!==w)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(V(v,"indent")&&null!==v.indent&&"\t"!==v.indent&&!(parseInt(v.indent,10)===v.indent&&v.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(V(v,"numericSeparator")&&"boolean"!=typeof v.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var E=v.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return Q(t,v);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var C=String(t);return E?O(t,C):C}if("bigint"==typeof t){var M=String(t)+"n";return E?O(t,M):M}var N=void 0===v.depth?5:v.depth;if(void 0===i&&(i=0),i>=N&&N>0&&"object"==typeof t)return F(t)?"[Array]":"[Object]";var q=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;n=k.call(Array(e.indent+1)," ")}return{base:n,prev:k.call(Array(t+1),n)}}(v,i);if(void 0===p)p=[];else if($(p,t)>=0)return"[Circular]";function G(t,n,r){if(n&&(p=x.call(p)).push(n),r){var o={depth:v.depth};return V(v,"quoteStyle")&&(o.quoteStyle=v.quoteStyle),e(t,o,i+1,p)}return e(t,v,i+1,p)}if("function"==typeof t&&!H(t)){var te=function(e){if(e.name)return e.name;var t=d.call(h.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),ne=ee(t,G);return"[Function"+(te?": "+te:" (anonymous)")+"]"+(ne.length>0?" { "+k.call(ne,", ")+" }":"")}if(W(t)){var re=T?g.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):I.call(t);return"object"!=typeof t||T?re:Y(re)}if(function(e){if(!e||"object"!=typeof e)return!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"==typeof e.nodeName&&"function"==typeof e.getAttribute}(t)){for(var oe="<"+b.call(String(t.nodeName)),ie=t.attributes||[],ae=0;ae<ie.length;ae++)oe+=" "+ie[ae].name+"="+U(D(ie[ae].value),"double",v);return oe+=">",t.childNodes&&t.childNodes.length&&(oe+="..."),oe+="</"+b.call(String(t.nodeName))+">"}if(F(t)){if(0===t.length)return"[]";var se=ee(t,G);return q&&!function(e){for(var t=0;t<e.length;t++)if($(e[t],"\n")>=0)return!1;return!0}(se)?"["+J(se,q)+"]":"[ "+k.call(se,", ")+" ]"}if(function(e){return"[object Error]"===K(e)&&z(e)}(t)){var le=ee(t,G);return"cause"in Error.prototype||!("cause"in t)||P.call(t,"cause")?0===le.length?"["+String(t)+"]":"{ ["+String(t)+"] "+k.call(le,", ")+" }":"{ ["+String(t)+"] "+k.call(S.call("[cause]: "+G(t.cause),le),", ")+" }"}if("object"==typeof t&&w){if(L&&"function"==typeof t[L]&&R)return R(t,{depth:N-i});if("symbol"!==w&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!n||!e||"object"!=typeof e)return!1;try{n.call(e);try{a.call(e)}catch(oe){return!0}return e instanceof Map}catch(t){}return!1}(t)){var ue=[];return r&&r.call(t,function(e,n){ue.push(G(n,t,!0)+" => "+G(e,t))}),Z("Map",n.call(t),ue,q)}if(function(e){if(!a||!e||"object"!=typeof e)return!1;try{a.call(e);try{n.call(e)}catch(t){return!0}return e instanceof Set}catch(r){}return!1}(t)){var ce=[];return s&&s.call(t,function(e){ce.push(G(e,t))}),Z("Set",a.call(t),ce,q)}if(function(e){if(!l||!e||"object"!=typeof e)return!1;try{l.call(e,l);try{u.call(e,u)}catch(oe){return!0}return e instanceof WeakMap}catch(t){}return!1}(t))return X("WeakMap");if(function(e){if(!u||!e||"object"!=typeof e)return!1;try{u.call(e,u);try{l.call(e,l)}catch(oe){return!0}return e instanceof WeakSet}catch(t){}return!1}(t))return X("WeakSet");if(function(e){if(!c||!e||"object"!=typeof e)return!1;try{return c.call(e),!0}catch(t){}return!1}(t))return X("WeakRef");if(function(e){return"[object Number]"===K(e)&&z(e)}(t))return Y(G(Number(t)));if(function(e){if(!e||"object"!=typeof e||!_)return!1;try{return _.call(e),!0}catch(t){}return!1}(t))return Y(G(_.call(t)));if(function(e){return"[object Boolean]"===K(e)&&z(e)}(t))return Y(f.call(t));if(function(e){return"[object String]"===K(e)&&z(e)}(t))return Y(G(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&t===globalThis||void 0!==m&&t===m)return"{ [object globalThis] }";if(!function(e){return"[object Date]"===K(e)&&z(e)}(t)&&!H(t)){var fe=ee(t,G),pe=j?j(t)===Object.prototype:t instanceof Object||t.constructor===Object,he=t instanceof Object?"":"null prototype",de=!pe&&A&&Object(t)===t&&A in t?y.call(K(t),8,-1):he?"Object":"",ye=(pe||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(de||he?"["+k.call(S.call([],de||[],he||[]),": ")+"] ":"");return 0===fe.length?ye+"{}":q?ye+"{"+J(fe,q)+"}":ye+"{ "+k.call(fe,", ")+" }"}return String(t)};var q=Object.prototype.hasOwnProperty||function(e){return e in this};function V(e,t){return q.call(e,t)}function K(e){return p.call(e)}function $(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function Q(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return Q(y.call(e,0,t.maxStringLength),t)+r}var o=N[t.quoteStyle||"single"];return o.lastIndex=0,U(g.call(g.call(e,o,"\\$1"),/[\x00-\x1f]/g,G),"single",t)}function G(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+v.call(t.toString(16))}function Y(e){return"Object("+e+")"}function X(e){return e+" { ? }"}function Z(e,t,n,r){return e+" ("+t+") {"+(r?J(n,r):k.call(n,", "))+"}"}function J(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+k.call(e,","+n)+"\n"+t.prev}function ee(e,t){var n=F(e),r=[];if(n){r.length=e.length;for(var o=0;o<e.length;o++)r[o]=V(e,o)?t(e[o],e):""}var i,a="function"==typeof C?C(e):[];if(T){i={};for(var s=0;s<a.length;s++)i["$"+a[s]]=a[s]}for(var l in e)V(e,l)&&(n&&String(Number(l))===l&&l<e.length||T&&i["$"+l]instanceof Symbol||(w.call(/[^\w$]/,l)?r.push(t(l,e)+": "+t(e[l],e)):r.push(l+": "+t(e[l],e))));if("function"==typeof C)for(var u=0;u<a.length;u++)P.call(e,a[u])&&r.push("["+t(a[u])+"]: "+t(e[a[u]],e));return r}return Ns}function ul(){if(zs)return Ds;zs=1;var e=ll(),t=Xn(),n=function(e,t,n){for(var r,o=e;null!=(r=o.next);o=r)if(r.key===t)return o.next=r.next,n||(r.next=e.next,e.next=r),r};return Ds=function(){var r,o={assert:function(n){if(!o.has(n))throw new t("Side channel does not contain "+e(n))},delete:function(e){var t=r&&r.next,o=function(e,t){if(e)return n(e,t,!0)}(r,e);return o&&t&&t===o&&(r=void 0),!!o},get:function(e){return function(e,t){if(e){var r=n(e,t);return r&&r.value}}(r,e)},has:function(e){return function(e,t){return!!e&&!!n(e,t)}(r,e)},set:function(e,t){r||(r={next:void 0}),function(e,t,r){var o=n(e,t);o?o.value=r:e.next={key:t,next:e.next,value:r}}(r,e,t)}};return o}}function cl(){if(Hs)return Fs;Hs=1;var e=wr(),t=Sr(),n=ll(),r=Xn(),o=e("%Map%",!0),i=t("Map.prototype.get",!0),a=t("Map.prototype.set",!0),s=t("Map.prototype.has",!0),l=t("Map.prototype.delete",!0),u=t("Map.prototype.size",!0);return Fs=!!o&&function(){var e,t={assert:function(e){if(!t.has(e))throw new r("Side channel does not contain "+n(e))},delete:function(t){if(e){var n=l(e,t);return 0===u(e)&&(e=void 0),n}return!1},get:function(t){if(e)return i(e,t)},has:function(t){return!!e&&s(e,t)},set:function(t,n){e||(e=new o),a(e,t,n)}};return t}}function fl(){if(Ks)return Vs;Ks=1;var e=Xn(),t=ll(),n=ul(),r=cl(),o=function(){if(qs)return Ws;qs=1;var e=wr(),t=Sr(),n=ll(),r=cl(),o=Xn(),i=e("%WeakMap%",!0),a=t("WeakMap.prototype.get",!0),s=t("WeakMap.prototype.set",!0),l=t("WeakMap.prototype.has",!0),u=t("WeakMap.prototype.delete",!0);return Ws=i?function(){var e,t,c={assert:function(e){if(!c.has(e))throw new o("Side channel does not contain "+n(e))},delete:function(n){if(i&&n&&("object"==typeof n||"function"==typeof n)){if(e)return u(e,n)}else if(r&&t)return t.delete(n);return!1},get:function(n){return i&&n&&("object"==typeof n||"function"==typeof n)&&e?a(e,n):t&&t.get(n)},has:function(n){return i&&n&&("object"==typeof n||"function"==typeof n)&&e?l(e,n):!!t&&t.has(n)},set:function(n,o){i&&n&&("object"==typeof n||"function"==typeof n)?(e||(e=new i),s(e,n,o)):r&&(t||(t=r()),t.set(n,o))}};return c}:r}(),i=o||r||n;return Vs=function(){var n,r={assert:function(n){if(!r.has(n))throw new e("Side channel does not contain "+t(n))},delete:function(e){return!!n&&n.delete(e)},get:function(e){return n&&n.get(e)},has:function(e){return!!n&&n.has(e)},set:function(e,t){n||(n=i()),n.set(e,t)}};return r}}function pl(){if(Qs)return $s;Qs=1;var e=String.prototype.replace,t=/%20/g,n="RFC3986";return $s={default:n,formatters:{RFC1738:function(n){return e.call(n,t,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:n}}function hl(){if(Ys)return Gs;Ys=1;var e=pl(),t=fl(),n=Object.prototype.hasOwnProperty,r=Array.isArray,o=t(),i=function(e,t){return o.set(e,t),e},a=function(e){return o.has(e)},s=function(e){return o.get(e)},l=function(e,t){o.set(e,t)},u=function(){for(var e=[],t=0;t<256;++t)e[e.length]="%"+((t<16?"0":"")+t.toString(16)).toUpperCase();return e}(),c=function(e,t){for(var n=t&&t.plainObjects?{__proto__:null}:{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n},f=1024;return Gs={arrayToObject:c,assign:function(e,t){return Object.keys(t).reduce(function(e,n){return e[n]=t[n],e},e)},combine:function(e,t,n,r){if(a(e)){var o=s(e)+1;return e[o]=t,l(e,o),e}var u=[].concat(e,t);return u.length>n?i(c(u,{plainObjects:r}),u.length-1):u},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],o=0;o<t.length;++o)for(var i=t[o],a=i.obj[i.prop],s=Object.keys(a),l=0;l<s.length;++l){var u=s[l],c=a[u];"object"==typeof c&&null!==c&&-1===n.indexOf(c)&&(t[t.length]={obj:a,prop:u},n[n.length]=c)}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(r(n)){for(var o=[],i=0;i<n.length;++i)void 0!==n[i]&&(o[o.length]=n[i]);t.obj[t.prop]=o}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(o){return r}},encode:function(t,n,r,o,i){if(0===t.length)return t;var a=t;if("symbol"==typeof t?a=Symbol.prototype.toString.call(t):"string"!=typeof t&&(a=String(t)),"iso-8859-1"===r)return escape(a).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var s="",l=0;l<a.length;l+=f){for(var c=a.length>=f?a.slice(l,l+f):a,p=[],h=0;h<c.length;++h){var d=c.charCodeAt(h);45===d||46===d||95===d||126===d||d>=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||i===e.RFC1738&&(40===d||41===d)?p[p.length]=c.charAt(h):d<128?p[p.length]=u[d]:d<2048?p[p.length]=u[192|d>>6]+u[128|63&d]:d<55296||d>=57344?p[p.length]=u[224|d>>12]+u[128|d>>6&63]+u[128|63&d]:(h+=1,d=65536+((1023&d)<<10|1023&c.charCodeAt(h)),p[p.length]=u[240|d>>18]+u[128|d>>12&63]+u[128|d>>6&63]+u[128|63&d])}s+=p.join("")}return s},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isOverflow:a,isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},markOverflow:i,maybeMap:function(e,t){if(r(e)){for(var n=[],o=0;o<e.length;o+=1)n[n.length]=t(e[o]);return n}return t(e)},merge:function e(t,o,u){if(!o)return t;if("object"!=typeof o&&"function"!=typeof o){if(r(t)){var f=t.length;if(u&&"number"==typeof u.arrayLimit&&f>u.arrayLimit)return i(c(t.concat(o),u),f);t[f]=o}else{if(!t||"object"!=typeof t)return[t,o];if(a(t)){var p=s(t)+1;t[p]=o,l(t,p)}else{if(u&&u.strictMerge)return[t,o];(u&&(u.plainObjects||u.allowPrototypes)||!n.call(Object.prototype,o))&&(t[o]=!0)}}return t}if(!t||"object"!=typeof t){if(a(o)){for(var h=Object.keys(o),d=u&&u.plainObjects?{__proto__:null,0:t}:{0:t},y=0;y<h.length;y++){d[parseInt(h[y],10)+1]=o[h[y]]}return i(d,s(o)+1)}var g=[t].concat(o);return u&&"number"==typeof u.arrayLimit&&g.length>u.arrayLimit?i(c(g,u),g.length-1):g}var m=t;return r(t)&&!r(o)&&(m=c(t,u)),r(t)&&r(o)?(o.forEach(function(r,o){if(n.call(t,o)){var i=t[o];i&&"object"==typeof i&&r&&"object"==typeof r?t[o]=e(i,r,u):t[t.length]=r}else t[o]=r}),t):Object.keys(o).reduce(function(t,r){var c=o[r];if(n.call(t,r)?t[r]=e(t[r],c,u):t[r]=c,a(o)&&!a(t)&&i(t,s(o)),a(t)){var f=parseInt(r,10);String(f)===r&&f>=0&&f>s(t)&&l(t,f)}return t},m)}},Gs}function dl(){if(Zs)return Xs;Zs=1;var e=fl(),t=hl(),n=pl(),r=Object.prototype.hasOwnProperty,o={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},i=Array.isArray,a=Array.prototype.push,s=function(e,t){a.apply(e,i(t)?t:[t])},l=Date.prototype.toISOString,u=n.default,c={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:t.encode,encodeValuesOnly:!1,filter:void 0,format:u,formatter:n.formatters[u],indices:!1,serializeDate:function(e){return l.call(e)},skipNulls:!1,strictNullHandling:!1},f={},p=function n(r,o,a,l,u,p,h,d,y,g,m,v,b,w,S,k,x,E){for(var _,C=r,I=E,T=0,A=!1;void 0!==(I=I.get(f))&&!A;){var P=I.get(r);if(T+=1,void 0!==P){if(P===T)throw new RangeError("Cyclic object value");A=!0}void 0===I.get(f)&&(T=0)}if("function"==typeof g?C=g(o,C):C instanceof Date?C=b(C):"comma"===a&&i(C)&&(C=t.maybeMap(C,function(e){return e instanceof Date?b(e):e})),null===C){if(p)return y&&!k?y(o,c.encoder,x,"key",w):o;C=""}if("string"==typeof(_=C)||"number"==typeof _||"boolean"==typeof _||"symbol"==typeof _||"bigint"==typeof _||t.isBuffer(C))return y?[S(k?o:y(o,c.encoder,x,"key",w))+"="+S(y(C,c.encoder,x,"value",w))]:[S(o)+"="+S(String(C))];var j,O=[];if(void 0===C)return O;if("comma"===a&&i(C))k&&y&&(C=t.maybeMap(C,y)),j=[{value:C.length>0?C.join(",")||null:void 0}];else if(i(g))j=g;else{var R=Object.keys(C);j=m?R.sort(m):R}var M=d?String(o).replace(/\./g,"%2E"):String(o),L=l&&i(C)&&1===C.length?M+"[]":M;if(u&&i(C)&&0===C.length)return L+"[]";for(var B=0;B<j.length;++B){var N=j[B],U="object"==typeof N&&N&&void 0!==N.value?N.value:C[N];if(!h||null!==U){var D=v&&d?String(N).replace(/\./g,"%2E"):String(N),z=i(C)?"function"==typeof a?a(L,D):L:L+(v?"."+D:"["+D+"]");E.set(r,T);var F=e();F.set(f,E),s(O,n(U,z,a,l,u,p,h,d,"comma"===a&&k&&i(C)?null:y,g,m,v,b,w,S,k,x,F))}}return O};return Xs=function(t,a){var l,u=t,f=function(e){if(!e)return c;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.encodeDotInKeys&&"boolean"!=typeof e.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||c.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var a=n.default;if(void 0!==e.format){if(!r.call(n.formatters,e.format))throw new TypeError("Unknown format option provided.");a=e.format}var s,l=n.formatters[a],u=c.filter;if(("function"==typeof e.filter||i(e.filter))&&(u=e.filter),s=e.arrayFormat in o?e.arrayFormat:"indices"in e?e.indices?"indices":"repeat":c.arrayFormat,"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var f=void 0===e.allowDots?!0===e.encodeDotInKeys||c.allowDots:!!e.allowDots;return{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:c.addQueryPrefix,allowDots:f,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:c.allowEmptyArrays,arrayFormat:s,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:c.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:void 0===e.delimiter?c.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:c.encode,encodeDotInKeys:"boolean"==typeof e.encodeDotInKeys?e.encodeDotInKeys:c.encodeDotInKeys,encoder:"function"==typeof e.encoder?e.encoder:c.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:c.encodeValuesOnly,filter:u,format:a,formatter:l,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:c.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:c.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:c.strictNullHandling}}(a);"function"==typeof f.filter?u=(0,f.filter)("",u):i(f.filter)&&(l=f.filter);var h=[];if("object"!=typeof u||null===u)return"";var d=o[f.arrayFormat],y="comma"===d&&f.commaRoundTrip;l||(l=Object.keys(u)),f.sort&&l.sort(f.sort);for(var g=e(),m=0;m<l.length;++m){var v=l[m],b=u[v];f.skipNulls&&null===b||s(h,p(b,v,d,y,f.allowEmptyArrays,f.strictNullHandling,f.skipNulls,f.encodeDotInKeys,f.encode?f.encoder:null,f.filter,f.sort,f.allowDots,f.serializeDate,f.format,f.formatter,f.encodeValuesOnly,f.charset,g))}var w=h.join(f.delimiter),S=!0===f.addQueryPrefix?"?":"";return f.charsetSentinel&&("iso-8859-1"===f.charset?S+="utf8=%26%2310003%3B&":S+="utf8=%E2%9C%93&"),w.length>0?S+w:""},Xs}function yl(){if(el)return Js;el=1;var e=hl(),t=Object.prototype.hasOwnProperty,n=Array.isArray,r={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:e.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},o=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},i=function(e,t,n){if(e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1)return e.split(",");if(t.throwOnLimitExceeded&&n>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");return e},a=function(n,r,o,a){if(n){var s=function(e,n){var r=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(n.depth<=0){if(!n.plainObjects&&t.call(Object.prototype,r)&&!n.allowPrototypes)return;return[r]}var o=/(\[[^[\]]*])/g,i=/(\[[^[\]]*])/.exec(r),a=i?r.slice(0,i.index):r,s=[];if(a){if(!n.plainObjects&&t.call(Object.prototype,a)&&!n.allowPrototypes)return;s[s.length]=a}for(var l=0;null!==(i=o.exec(r))&&l<n.depth;){l+=1;var u=i[1].slice(1,-1);if(!n.plainObjects&&t.call(Object.prototype,u)&&!n.allowPrototypes)return;s[s.length]=i[1]}if(i){if(!0===n.strictDepth)throw new RangeError("Input depth exceeded depth option of "+n.depth+" and strictDepth is true");s[s.length]="["+r.slice(i.index)+"]"}return s}(n,o);if(s)return function(t,n,r,o){var a=0;if(t.length>0&&"[]"===t[t.length-1]){var s=t.slice(0,-1).join("");a=Array.isArray(n)&&n[s]?n[s].length:0}for(var l=o?n:i(n,r,a),u=t.length-1;u>=0;--u){var c,f=t[u];if("[]"===f&&r.parseArrays)c=e.isOverflow(l)?l:r.allowEmptyArrays&&(""===l||r.strictNullHandling&&null===l)?[]:e.combine([],l,r.arrayLimit,r.plainObjects);else{c=r.plainObjects?{__proto__:null}:{};var p="["===f.charAt(0)&&"]"===f.charAt(f.length-1)?f.slice(1,-1):f,h=r.decodeDotInKeys?p.replace(/%2E/g,"."):p,d=parseInt(h,10),y=!isNaN(d)&&f!==h&&String(d)===h&&d>=0&&r.parseArrays;if(r.parseArrays||""!==h)if(y&&d<r.arrayLimit)(c=[])[d]=l;else{if(y&&r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(1===r.arrayLimit?"":"s")+" allowed in an array.");y?(c[d]=l,e.markOverflow(c,d)):"__proto__"!==h&&(c[h]=l)}else c={0:l}}l=c}return l}(s,r,o,a)}};return Js=function(s,l){var u=function(t){if(!t)return r;if(void 0!==t.allowEmptyArrays&&"boolean"!=typeof t.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==t.decodeDotInKeys&&"boolean"!=typeof t.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(void 0!==t.throwOnLimitExceeded&&"boolean"!=typeof t.throwOnLimitExceeded)throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var n=void 0===t.charset?r.charset:t.charset,o=void 0===t.duplicates?r.duplicates:t.duplicates;if("combine"!==o&&"first"!==o&&"last"!==o)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===t.allowDots?!0===t.decodeDotInKeys||r.allowDots:!!t.allowDots,allowEmptyArrays:"boolean"==typeof t.allowEmptyArrays?!!t.allowEmptyArrays:r.allowEmptyArrays,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:r.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:r.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:r.arrayLimit,charset:n,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:r.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:r.comma,decodeDotInKeys:"boolean"==typeof t.decodeDotInKeys?t.decodeDotInKeys:r.decodeDotInKeys,decoder:"function"==typeof t.decoder?t.decoder:r.decoder,delimiter:"string"==typeof t.delimiter||e.isRegExp(t.delimiter)?t.delimiter:r.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:r.depth,duplicates:o,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:r.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:r.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:r.plainObjects,strictDepth:"boolean"==typeof t.strictDepth?!!t.strictDepth:r.strictDepth,strictMerge:"boolean"==typeof t.strictMerge?!!t.strictMerge:r.strictMerge,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:r.strictNullHandling,throwOnLimitExceeded:"boolean"==typeof t.throwOnLimitExceeded&&t.throwOnLimitExceeded}}(l);if(""===s||null==s)return u.plainObjects?{__proto__:null}:{};for(var c="string"==typeof s?function(a,s){var l={__proto__:null},u=s.ignoreQueryPrefix?a.replace(/^\?/,""):a;u=u.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var c=s.parameterLimit===1/0?void 0:s.parameterLimit,f=u.split(s.delimiter,s.throwOnLimitExceeded?c+1:c);if(s.throwOnLimitExceeded&&f.length>c)throw new RangeError("Parameter limit exceeded. Only "+c+" parameter"+(1===c?"":"s")+" allowed.");var p,h=-1,d=s.charset;if(s.charsetSentinel)for(p=0;p<f.length;++p)0===f[p].indexOf("utf8=")&&("utf8=%E2%9C%93"===f[p]?d="utf-8":"utf8=%26%2310003%3B"===f[p]&&(d="iso-8859-1"),h=p,p=f.length);for(p=0;p<f.length;++p)if(p!==h){var y,g,m=f[p],v=m.indexOf("]="),b=-1===v?m.indexOf("="):v+1;if(-1===b?(y=s.decoder(m,r.decoder,d,"key"),g=s.strictNullHandling?null:""):null!==(y=s.decoder(m.slice(0,b),r.decoder,d,"key"))&&(g=e.maybeMap(i(m.slice(b+1),s,n(l[y])?l[y].length:0),function(e){return s.decoder(e,r.decoder,d,"value")})),g&&s.interpretNumericEntities&&"iso-8859-1"===d&&(g=o(String(g))),m.indexOf("[]=")>-1&&(g=n(g)?[g]:g),s.comma&&n(g)&&g.length>s.arrayLimit){if(s.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+s.arrayLimit+" element"+(1===s.arrayLimit?"":"s")+" allowed in an array.");g=e.combine([],g,s.arrayLimit,s.plainObjects)}if(null!==y){var w=t.call(l,y);w&&("combine"===s.duplicates||m.indexOf("[]=")>-1)?l[y]=e.combine(l[y],g,s.arrayLimit,s.plainObjects):w&&"last"!==s.duplicates||(l[y]=g)}}return l}(s,u):s,f=u.plainObjects?{__proto__:null}:{},p=Object.keys(c),h=0;h<p.length;++h){var d=p[h],y=a(d,c[d],u,"string"==typeof s);f=e.merge(f,y,u)}return!0===u.allowSparse?f:e.compact(f)},Js}function gl(){if(nl)return tl;nl=1;var e=dl(),t=yl();return tl={formats:pl(),parse:t,stringify:e}}function ml(){if(rl)return Rs;rl=1;var e,t,n=(Os||(Os=1,e=Ms,t=Ms.exports,function(n){var r=t&&!t.nodeType&&t,o=e&&!e.nodeType&&e,i="object"==typeof m&&m;i.global!==i&&i.window!==i&&i.self!==i||(n=i);var a,s,l=2147483647,u=36,c=/^xn--/,f=/[^\x20-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,y=String.fromCharCode;function g(e){throw new RangeError(h[e])}function v(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function b(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+v((e=e.replace(p,".")).split("."),t).join(".")}function w(e){for(var t,n,r=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(n=e.charCodeAt(o++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--):r.push(t);return r}function S(e){return v(e,function(e){var t="";return e>65535&&(t+=y((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+y(e)}).join("")}function k(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:u}function x(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function E(e,t,n){var r=0;for(e=n?d(e/700):e>>1,e+=d(e/t);e>455;r+=u)e=d(e/35);return d(r+36*e/(e+38))}function _(e){var t,n,r,o,i,a,s,c,f,p,h=[],y=e.length,m=0,v=128,b=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&g("not-basic"),h.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<y;){for(i=m,a=1,s=u;o>=y&&g("invalid-input"),((c=k(e.charCodeAt(o++)))>=u||c>d((l-m)/a))&&g("overflow"),m+=c*a,!(c<(f=s<=b?1:s>=b+26?26:s-b));s+=u)a>d(l/(p=u-f))&&g("overflow"),a*=p;b=E(m-i,t=h.length+1,0==i),d(m/t)>l-v&&g("overflow"),v+=d(m/t),m%=t,h.splice(m++,0,v)}return S(h)}function C(e){var t,n,r,o,i,a,s,c,f,p,h,m,v,b,S,k=[];for(m=(e=w(e)).length,t=128,n=0,i=72,a=0;a<m;++a)(h=e[a])<128&&k.push(y(h));for(r=o=k.length,o&&k.push("-");r<m;){for(s=l,a=0;a<m;++a)(h=e[a])>=t&&h<s&&(s=h);for(s-t>d((l-n)/(v=r+1))&&g("overflow"),n+=(s-t)*v,t=s,a=0;a<m;++a)if((h=e[a])<t&&++n>l&&g("overflow"),h==t){for(c=n,f=u;!(c<(p=f<=i?1:f>=i+26?26:f-i));f+=u)S=c-p,b=u-p,k.push(y(x(p+S%b,0))),c=d(S/b);k.push(y(x(c,0))),i=E(n,v,r==o),n=0,++r}++n,++t}return k.join("")}if(a={version:"1.4.1",ucs2:{decode:w,encode:S},decode:_,encode:C,toASCII:function(e){return b(e,function(e){return f.test(e)?"xn--"+C(e):e})},toUnicode:function(e){return b(e,function(e){return c.test(e)?_(e.slice(4).toLowerCase()):e})}},r&&o)if(e.exports==r)o.exports=a;else for(s in a)a.hasOwnProperty(s)&&(r[s]=a[s]);else n.punycode=a}(Ls)),Ms.exports);function r(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var o=/^([a-z0-9.+-]+:)/i,i=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,s=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(s),u=["%","/","?",";","#"].concat(l),c=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,h={javascript:!0,"javascript:":!0},d={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},g=gl();function v(e,t,n){if(e&&"object"==typeof e&&e instanceof r)return e;var o=new r;return o.parse(e,t,n),o}return r.prototype.parse=function(e,t,r){if("string"!=typeof e)throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),s=-1!==i&&i<e.indexOf("#")?"?":"#",m=e.split(s);m[0]=m[0].replace(/\\/g,"/");var v=e=m.join(s);if(v=v.trim(),!r&&1===e.split("#").length){var b=a.exec(v);if(b)return this.path=v,this.href=v,this.pathname=b[1],b[2]?(this.search=b[2],this.query=t?g.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var w=o.exec(v);if(w){var S=(w=w[0]).toLowerCase();this.protocol=S,v=v.substr(w.length)}if(r||w||v.match(/^\/\/[^@/]+@[^@/]+/)){var k="//"===v.substr(0,2);!k||w&&d[w]||(v=v.substr(2),this.slashes=!0)}if(!d[w]&&(k||w&&!y[w])){for(var x,E,_=-1,C=0;C<c.length;C++){-1!==(I=v.indexOf(c[C]))&&(-1===_||I<_)&&(_=I)}-1!==(E=-1===_?v.lastIndexOf("@"):v.lastIndexOf("@",_))&&(x=v.slice(0,E),v=v.slice(E+1),this.auth=decodeURIComponent(x)),_=-1;for(C=0;C<u.length;C++){var I;-1!==(I=v.indexOf(u[C]))&&(-1===_||I<_)&&(_=I)}-1===_&&(_=v.length),this.host=v.slice(0,_),v=v.slice(_),this.parseHost(),this.hostname=this.hostname||"";var T="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!T)for(var A=this.hostname.split(/\./),P=(C=0,A.length);C<P;C++){var j=A[C];if(j&&!j.match(f)){for(var O="",R=0,M=j.length;R<M;R++)j.charCodeAt(R)>127?O+="x":O+=j[R];if(!O.match(f)){var L=A.slice(0,C),B=A.slice(C+1),N=j.match(p);N&&(L.push(N[1]),B.unshift(N[2])),B.length&&(v="/"+B.join(".")+v),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),T||(this.hostname=n.toASCII(this.hostname));var U=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+U,this.href+=this.host,T&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==v[0]&&(v="/"+v))}if(!h[S])for(C=0,P=l.length;C<P;C++){var z=l[C];if(-1!==v.indexOf(z)){var F=encodeURIComponent(z);F===z&&(F=escape(z)),v=v.split(z).join(F)}}var H=v.indexOf("#");-1!==H&&(this.hash=v.substr(H),v=v.slice(0,H));var W=v.indexOf("?");if(-1!==W?(this.search=v.substr(W),this.query=v.substr(W+1),t&&(this.query=g.parse(this.query)),v=v.slice(0,W)):t&&(this.search="",this.query={}),v&&(this.pathname=v),y[S]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){U=this.pathname||"";var q=this.search||"";this.path=U+q}return this.href=this.format(),this},r.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",o=!1,i="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(i=g.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var a=this.search||i&&"?"+i||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||y[t])&&!1!==o?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),r&&"#"!==r.charAt(0)&&(r="#"+r),a&&"?"!==a.charAt(0)&&(a="?"+a),t+o+(n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(a=a.replace("#","%23"))+r},r.prototype.resolve=function(e){return this.resolveObject(v(e,!1,!0)).format()},r.prototype.resolveObject=function(e){if("string"==typeof e){var t=new r;t.parse(e,!1,!0),e=t}for(var n=new r,o=Object.keys(this),i=0;i<o.length;i++){var a=o[i];n[a]=this[a]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),l=0;l<s.length;l++){var u=s[l];"protocol"!==u&&(n[u]=e[u])}return y[n.protocol]&&n.hostname&&!n.pathname&&(n.pathname="/",n.path=n.pathname),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!y[e.protocol]){for(var c=Object.keys(e),f=0;f<c.length;f++){var p=c[f];n[p]=e[p]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||d[e.protocol])n.pathname=e.pathname;else{for(var h=(e.pathname||"").split("/");h.length&&!(e.host=h.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==h[0]&&h.unshift(""),h.length<2&&h.unshift(""),n.pathname=h.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var g=n.pathname||"",m=n.search||"";n.path=g+m}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var v=n.pathname&&"/"===n.pathname.charAt(0),b=e.host||e.pathname&&"/"===e.pathname.charAt(0),w=b||v||n.host&&e.pathname,S=w,k=n.pathname&&n.pathname.split("/")||[],x=(h=e.pathname&&e.pathname.split("/")||[],n.protocol&&!y[n.protocol]);if(x&&(n.hostname="",n.port=null,n.host&&(""===k[0]?k[0]=n.host:k.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===h[0]?h[0]=e.host:h.unshift(e.host)),e.host=null),w=w&&(""===h[0]||""===k[0])),b)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,k=h;else if(h.length)k||(k=[]),k.pop(),k=k.concat(h),n.search=e.search,n.query=e.query;else if(null!=e.search){if(x)n.host=k.shift(),n.hostname=n.host,(T=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=T.shift(),n.hostname=T.shift(),n.host=n.hostname);return n.search=e.search,n.query=e.query,null===n.pathname&&null===n.search||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!k.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var E=k.slice(-1)[0],_=(n.host||e.host||k.length>1)&&("."===E||".."===E)||""===E,C=0,I=k.length;I>=0;I--)"."===(E=k[I])?k.splice(I,1):".."===E?(k.splice(I,1),C++):C&&(k.splice(I,1),C--);if(!w&&!S)for(;C--;C)k.unshift("..");!w||""===k[0]||k[0]&&"/"===k[0].charAt(0)||k.unshift(""),_&&"/"!==k.join("/").substr(-1)&&k.push("");var T,A=""===k[0]||k[0]&&"/"===k[0].charAt(0);x&&(n.hostname=A?"":k.length?k.shift():"",n.host=n.hostname,(T=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=T.shift(),n.hostname=T.shift(),n.host=n.hostname));return(w=w||n.host&&k.length)&&!A&&k.unshift(""),k.length>0?n.pathname=k.join("/"):(n.pathname=null,n.path=null),null===n.pathname&&null===n.search||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},r.prototype.parseHost=function(){var e=this.host,t=i.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},Rs.parse=v,Rs.resolve=function(e,t){return v(e,!1,!0).resolve(t)},Rs.resolveObject=function(e,t){return e?v(e,!1,!0).resolveObject(t):t},Rs.format=function(e){return"string"==typeof e&&(e=v(e)),e instanceof r?e.format():r.prototype.format.call(e)},Rs.Url=r,Rs}function vl(){if(il)return ol;il=1;const e=Bs,t=Oa()("mqttjs:tcp");return ol=function(n,r){r.port=r.port||1883,r.hostname=r.hostname||r.host||"localhost";const o=r.port,i=r.hostname;return t("port %d and host %s",o,i),e.createConnection(o,i)}}function bl(){if(sl)return al;sl=1;const e=Bs,t=Bs,n=Oa()("mqttjs:tls");return al=function(r,o){o.port=o.port||8883,o.host=o.hostname||o.host||"localhost",0===t.isIP(o.host)&&(o.servername=o.host),o.rejectUnauthorized=!1!==o.rejectUnauthorized,delete o.path,n("port %d host %s rejectUnauthorized %b",o.port,o.host,o.rejectUnauthorized);const i=e.connect(o);function a(e){o.rejectUnauthorized&&r.emit("error",e),i.end()}return i.on("secureConnect",function(){o.rejectUnauthorized&&!i.authorized?i.emit("error",new Error("TLS not authorized")):i.removeListener("error",a)}),i.on("error",a),i}}var wl,Sl,kl,xl,El,_l,Cl,Il,Tl,Al,Pl,jl,Ol,Rl={exports:{}};function Ml(){if(kl)return Rl.exports;kl=1;var e=(Sl||(Sl=1,wl=function e(t,n){if(t&&n)return e(t)(n);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(e){r[e]=t[e]}),r;function r(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];var r=t.apply(this,e),o=e[e.length-1];return"function"==typeof r&&r!==o&&Object.keys(o).forEach(function(e){r[e]=o[e]}),r}}),wl);function t(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function n(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},n=e.name||"Function wrapped with `once`";return t.onceError=n+" shouldn't be called more than once",t.called=!1,t}return Rl.exports=e(t),Rl.exports.strict=e(n),t.proto=t(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return t(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return n(this)},configurable:!0})}),Rl.exports}function Ll(){if(El)return xl;El=1;var e=Ml(),t=function(){},n=m.Bare?queueMicrotask:N.nextTick.bind(N),r=function(o,i,a){if("function"==typeof i)return r(o,null,i);i||(i={}),a=e(a||t);var s=o._writableState,l=o._readableState,u=i.readable||!1!==i.readable&&o.readable,c=i.writable||!1!==i.writable&&o.writable,f=!1,p=function(){o.writable||h()},h=function(){c=!1,u||a.call(o)},d=function(){u=!1,c||a.call(o)},y=function(e){a.call(o,e?new Error("exited with error code: "+e):null)},g=function(e){a.call(o,e)},m=function(){n(v)},v=function(){if(!f)return(!u||l&&l.ended&&!l.destroyed)&&(!c||s&&s.ended&&!s.destroyed)?void 0:a.call(o,new Error("premature close"))},b=function(){o.req.on("finish",h)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(o)?c&&!s&&(o.on("end",p),o.on("close",p)):(o.on("complete",h),o.on("abort",m),o.req?b():o.on("request",b)),function(e){return e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length}(o)&&o.on("exit",y),o.on("end",d),o.on("finish",h),!1!==i.error&&o.on("error",g),o.on("close",m),function(){f=!0,o.removeListener("complete",h),o.removeListener("abort",m),o.removeListener("request",b),o.req&&o.req.removeListener("finish",h),o.removeListener("end",p),o.removeListener("close",p),o.removeListener("finish",h),o.removeListener("exit",y),o.removeListener("end",d),o.removeListener("error",g),o.removeListener("close",m)}};return xl=r}function Bl(){if(Tl)return Il;Tl=1;var e=ai(),t=Ll(),n=io(),r=Cl?_l:(Cl=1,_l=function(e){var t=e._readableState;return t?t.objectMode||"number"==typeof e._duplexState?e.read():e.read(function(e){if(e.buffer.length){var t=e.bufferIndex||0;if(e.buffer.head)return e.buffer.head.data.length;if(e.buffer.length-t>0&&e.buffer[t])return e.buffer[t].length}return e.length}(t)):null}),o=es.from&&es.from!==Uint8Array.from?es.from([0]):new es([0]),i=function(e,t){e._corked?e.once("uncork",t):t()},a=function(e,t){return function(n){n?function(e,t){e._autoDestroy&&e.destroy(t)}(e,"premature close"===n.message?null:n):t&&!e._ended&&e.end()}},s=function(){},l=function(t,n,r){if(!(this instanceof l))return new l(t,n,r);e.Duplex.call(this,r),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!r||!1!==r.autoDestroy,this._forwardDestroy=!r||!1!==r.destroy,this._forwardEnd=!r||!1!==r.end,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,t&&this.setWritable(t),n&&this.setReadable(n)};return n(l,e.Duplex),l.obj=function(e,t,n){return n||(n={}),n.objectMode=!0,n.highWaterMark=16,new l(e,t,n)},l.prototype.cork=function(){1===++this._corked&&this.emit("cork")},l.prototype.uncork=function(){this._corked&&0===--this._corked&&this.emit("uncork")},l.prototype.setWritable=function(e){if(this._unwrite&&this._unwrite(),this.destroyed)e&&e.destroy&&e.destroy();else if(null!==e&&!1!==e){var n=this,r=t(e,{writable:!0,readable:!1},a(this,this._forwardEnd)),o=function(){var e=n._ondrain;n._ondrain=null,e&&e()};this._unwrite&&N.nextTick(o),this._writable=e,this._writable.on("drain",o),this._unwrite=function(){n._writable.removeListener("drain",o),r()},this.uncork()}else this.end()},l.prototype.setReadable=function(n){if(this._unread&&this._unread(),this.destroyed)n&&n.destroy&&n.destroy();else{if(null===n||!1===n)return this.push(null),void this.resume();var r,o=this,i=t(n,{writable:!1,readable:!0},a(this)),s=function(){o._forward()},l=function(){o.push(null)};this._drained=!0,this._readable=n,this._readable2=n._readableState?n:(r=n,new e.Readable({objectMode:!0,highWaterMark:16}).wrap(r)),this._readable2.on("readable",s),this._readable2.on("end",l),this._unread=function(){o._readable2.removeListener("readable",s),o._readable2.removeListener("end",l),i()},this._forward()}},l.prototype._read=function(){this._drained=!0,this._forward()},l.prototype._forward=function(){if(!this._forwarding&&this._readable2&&this._drained){var e;for(this._forwarding=!0;this._drained&&null!==(e=r(this._readable2));)this.destroyed||(this._drained=this.push(e));this._forwarding=!1}},l.prototype.destroy=function(e,t){if(t||(t=s),this.destroyed)return t(null);this.destroyed=!0;var n=this;N.nextTick(function(){n._destroy(e),t(null)})},l.prototype._destroy=function(e){if(e){var t=this._ondrain;this._ondrain=null,t?t(e):this.emit("error",e)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},l.prototype._write=function(e,t,n){if(!this.destroyed)return this._corked?i(this,this._write.bind(this,e,t,n)):e===o?this._finish(n):this._writable?void(!1===this._writable.write(e)?this._ondrain=n:this.destroyed||n()):n()},l.prototype._finish=function(e){var t=this;this.emit("preend"),i(this,function(){var n,r;n=t._forwardEnd&&t._writable,r=function(){!1===t._writableState.prefinished&&(t._writableState.prefinished=!0),t.emit("prefinish"),i(t,e)},n?n._writableState&&n._writableState.finished?r():n._writableState?n.end(r):(n.end(),r()):r()})},l.prototype.end=function(t,n,r){return"function"==typeof t?this.end(null,null,t):"function"==typeof n?this.end(t,null,n):(this._ended=!0,t&&this.write(t),this._writableState.ending||this._writableState.destroyed||this.write(o),e.Writable.prototype.end.call(this,r))},Il=l}function Nl(){if(Pl)return Al;Pl=1;const{Buffer:e}=rt(),t=ai().Transform,n=Bl();let r,o,i;return Al=function(a,s){if(s.hostname=s.hostname||s.host,!s.hostname)throw new Error("Could not determine host. Specify host manually.");const l="MQIsdp"===s.protocolId&&3===s.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(s);const u=function(e,t){const n="wxs"===e.protocol?"wss":"ws";let r=n+"://"+e.hostname+e.path;return e.port&&80!==e.port&&443!==e.port&&(r=n+"://"+e.hostname+":"+e.port+e.path),"function"==typeof e.transformWsUrl&&(r=e.transformWsUrl(r,e,t)),r}(s,a);r=wx.connectSocket({url:u,protocols:[l]}),o=function(){const e=new t;return e._write=function(e,t,n){r.send({data:e.buffer,success:function(){n()},fail:function(e){n(new Error(e))}})},e._flush=function(e){r.close({success:function(){e()}})},e}(),i=n.obj(),i._destroy=function(e,t){r.close({success:function(){t&&t(e)}})};const c=i.destroy;return i.destroy=function(){i.destroy=c;const e=this;setTimeout(function(){r.close({fail:function(){e._destroy(new Error)}})},0)}.bind(i),r.onOpen(function(){i.setReadable(o),i.setWritable(o),i.emit("connect")}),r.onMessage(function(t){let n=t.data;n=n instanceof ArrayBuffer?e.from(n):e.from(n,"utf8"),o.push(n)}),r.onClose(function(){i.end(),i.destroy()}),r.onError(function(e){i.destroy(new Error(e.errMsg))}),i}}function Ul(){if(Ol)return jl;Ol=1;const{Buffer:e}=rt(),t=ai().Transform,n=Bl();let r,o,i,a=!1;return jl=function(s,l){if(l.hostname=l.hostname||l.host,!l.hostname)throw new Error("Could not determine host. Specify host manually.");const u="MQIsdp"===l.protocolId&&3===l.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(l);const c=function(e,t){const n="alis"===e.protocol?"wss":"ws";let r=n+"://"+e.hostname+e.path;return e.port&&80!==e.port&&443!==e.port&&(r=n+"://"+e.hostname+":"+e.port+e.path),"function"==typeof e.transformWsUrl&&(r=e.transformWsUrl(r,e,t)),r}(l,s);return r=l.my,r.connectSocket({url:c,protocols:u}),o=function(){const e=new t;return e._write=function(e,t,n){r.sendSocketMessage({data:e.buffer,success:function(){n()},fail:function(){n(new Error)}})},e._flush=function(e){r.closeSocket({success:function(){e()}})},e}(),i=n.obj(),a||(a=!0,r.onSocketOpen(function(){i.setReadable(o),i.setWritable(o),i.emit("connect")}),r.onSocketMessage(function(t){if("string"==typeof t.data){const n=e.from(t.data,"base64");o.push(n)}else{const n=new FileReader;n.addEventListener("load",function(){let t=n.result;t=t instanceof ArrayBuffer?e.from(t):e.from(t,"utf8"),o.push(t)}),n.readAsArrayBuffer(t.data)}}),r.onSocketClose(function(){i.end(),i.destroy()}),r.onSocketError(function(e){i.destroy(e)})),i}}var Dl,zl,Fl,Hl,Wl={exports:{}};function ql(){if(Fl)return Wl.exports;Fl=1;const{Buffer:e}=rt(),t=zl?Dl:(zl=1,Dl=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}),n=Oa()("mqttjs:ws"),r=Bl(),o=ai().Transform,i=["rejectUnauthorized","ca","cert","key","pfx","passphrase"],a=void 0!==N&&"browser"===N.title||"function"==typeof __webpack_require__;function s(e,t){let n=e.protocol+"://"+e.hostname+":"+e.port+e.path;return"function"==typeof e.transformWsUrl&&(n=e.transformWsUrl(n,e,t)),n}function l(e){const t=e;return e.hostname||(t.hostname="localhost"),e.port||("wss"===e.protocol?t.port=443:t.port=80),e.path||(t.path="/"),e.wsOptions||(t.wsOptions={}),a||"wss"!==e.protocol||i.forEach(function(n){Object.prototype.hasOwnProperty.call(e,n)&&!Object.prototype.hasOwnProperty.call(e.wsOptions,n)&&(t.wsOptions[n]=e[n])}),t}return Wl.exports=a?function(t,i){let a;n("browserStreamBuilder");const u=function(e){const t=l(e);if(t.hostname||(t.hostname=t.host),!t.hostname){if("undefined"==typeof document)throw new Error("Could not determine host. Specify host manually.");const e=new URL(document.URL);t.hostname=e.hostname,t.port||(t.port=e.port)}return void 0===t.objectMode&&(t.objectMode=!(!0===t.binary||void 0===t.binary)),t}(i).browserBufferSize||524288,c=i.browserBufferTimeout||1e3,f=!i.objectMode,p=function(e,t){const n="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt",r=s(t,e),o=new WebSocket(r,[n]);return o.binaryType="arraybuffer",o}(t,i),h=function(e,t,n){const r=new o({objectModeMode:e.objectMode});return r._write=t,r._flush=n,r}(i,function t(n,r,o){p.bufferedAmount>u&&setTimeout(t,c,n,r,o),f&&"string"==typeof n&&(n=e.from(n,"utf8"));try{p.send(n)}catch(i){return o(i)}o()},function(e){p.close(),e()});i.objectMode||(h._writev=b),h.on("close",()=>{p.close()});const d=void 0!==p.addEventListener;function y(){a.setReadable(h),a.setWritable(h),a.emit("connect")}function g(){a.end(),a.destroy()}function m(e){a.destroy(e)}function v(t){let n=t.data;n=n instanceof ArrayBuffer?e.from(n):e.from(n,"utf8"),h.push(n)}function b(t,n){const r=new Array(t.length);for(let o=0;o<t.length;o++)"string"==typeof t[o].chunk?r[o]=e.from(t[o],"utf8"):r[o]=t[o].chunk;this._write(e.concat(r),"binary",n)}return p.readyState===p.OPEN?a=h:(a=a=r(void 0,void 0,i),i.objectMode||(a._writev=b),d?p.addEventListener("open",y):p.onopen=y),a.socket=p,d?(p.addEventListener("close",g),p.addEventListener("error",m),p.addEventListener("message",v)):(p.onclose=g,p.onerror=m,p.onmessage=v),a}:function(e,r){n("streamBuilder");const o=l(r),i=s(o,e),a=function(e,r,o){n("createWebSocket"),n("protocol: "+o.protocolId+" "+o.protocolVersion);const i="MQIsdp"===o.protocolId&&3===o.protocolVersion?"mqttv3.1":"mqtt";return n("creating new Websocket for url: "+r+" and protocol: "+i),new t(r,[i],o.wsOptions)}(0,i,o),u=t.createWebSocketStream(a,o.wsOptions);return u.url=i,a.on("close",()=>{u.destroy()}),u},Wl.exports}const Vl=v(function(){if(Hl)return $e.exports;Hl=1;const e=js(),t=si(),n=ml(),r=Ye(),o=Oa()("mqttjs"),i={};function a(t,a){if(o("connecting to an MQTT broker..."),"object"!=typeof t||a||(a=t,t=null),a=a||{},t){const e=n.parse(t,!0);if(null!=e.port&&(e.port=Number(e.port)),null===(a=r(e,a)).protocol)throw new Error("Missing protocol");a.protocol=a.protocol.replace(/:$/,"")}if(function(e){let t;e.auth&&(t=e.auth.match(/^(.+):(.+)$/),t?(e.username=t[1],e.password=t[2]):e.username=e.auth)}(a),a.query&&"string"==typeof a.query.clientId&&(a.clientId=a.query.clientId),a.cert&&a.key){if(!a.protocol)throw new Error("Missing secure protocol key");if(-1===["mqtts","wss","wxs","alis"].indexOf(a.protocol))switch(a.protocol){case"mqtt":a.protocol="mqtts";break;case"ws":a.protocol="wss";break;case"wx":a.protocol="wxs";break;case"ali":a.protocol="alis";break;default:throw new Error('Unknown protocol for secure connection: "'+a.protocol+'"!')}}if(!i[a.protocol]){const e=-1!==["mqtts","wss"].indexOf(a.protocol);a.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter(function(t,n){return(!e||n%2!=0)&&"function"==typeof i[t]})[0]}if(!1===a.clean&&!a.clientId)throw new Error("Missing clientId for unclean clients");a.protocol&&(a.defaultProtocol=a.protocol);const s=new e(function(e){return a.servers&&(e._reconnectCount&&e._reconnectCount!==a.servers.length||(e._reconnectCount=0),a.host=a.servers[e._reconnectCount].host,a.port=a.servers[e._reconnectCount].port,a.protocol=a.servers[e._reconnectCount].protocol?a.servers[e._reconnectCount].protocol:a.defaultProtocol,a.hostname=a.host,e._reconnectCount++),o("calling streambuilder for",a.protocol),i[a.protocol](e,a)},a);return s.on("error",function(){}),s}return void 0!==N&&"browser"!==N.title||"function"!=typeof __webpack_require__?(i.mqtt=vl(),i.tcp=vl(),i.ssl=bl(),i.tls=bl(),i.mqtts=bl()):(i.wx=Nl(),i.wxs=Nl(),i.ali=Ul(),i.alis=Ul()),i.ws=ql(),i.wss=ql(),$e.exports=a,$e.exports.connect=a,$e.exports.MqttClient=e,$e.exports.Store=t,$e.exports}());var Kl=new class{constructor(){c(this,"client",null),c(this,"subscriptions",new Map),c(this,"stateListeners",new Set),c(this,"connected",!1),c(this,"reconnectAttempts",0),c(this,"refCount",0)}connect(){if(this.refCount=this.refCount+1,!this.client){var e=pe().mqttUrl;console.info("[MQTT] Connecting to",e);var t=this;try{this.client=Vl.connect(e,{reconnectPeriod:5e3,connectTimeout:1e4,keepalive:30,clean:!0,protocolVersion:4}),this.client.on("connect",function(){console.info("[MQTT] Connected"),t.connected=!0,t.reconnectAttempts=0,t.notifyState(!0),t.subscriptions.forEach(function(e,n){t.client&&t.client.subscribe(n,function(e){e&&console.error("[MQTT] Re-subscribe failed for",n,e)})})}),this.client.on("message",function(e,n){try{var r=JSON.parse(n.toString());t.dispatch(r)}catch(o){console.error("[MQTT] Failed to parse message:",o)}}),this.client.on("close",function(){console.info("[MQTT] Connection closed"),t.connected=!1,t.notifyState(!1)}),this.client.on("reconnect",function(){t.reconnectAttempts=t.reconnectAttempts+1,console.info("[MQTT] Reconnecting (attempt",t.reconnectAttempts,")")}),this.client.on("error",function(e){console.error("[MQTT] Error:",e)})}catch(n){console.error("[MQTT] Failed to create client:",n)}}}disconnect(){if(this.refCount=Math.max(0,this.refCount-1),!(this.refCount>0)){if(this.client){try{this.client.end(!0)}catch(e){}this.client=null}this.connected=!1,this.reconnectAttempts=0,this.notifyState(!1)}}subscribe(e,t){var n="lightman/devices/"+e+"/events",r=this.subscriptions.get(n);r||(r=new Set,this.subscriptions.set(n,r),this.client&&this.connected&&this.client.subscribe(n,function(e){e?console.error("[MQTT] Subscribe failed for",n,e):console.info("[MQTT] Subscribed to",n)})),r.add(t)}unsubscribe(e,t){var n="lightman/devices/"+e+"/events",r=this.subscriptions.get(n);r&&(r.delete(t),0===r.size&&(this.subscriptions.delete(n),this.client&&this.connected&&this.client.unsubscribe(n,function(e){e&&console.error("[MQTT] Unsubscribe failed for",n,e)})))}onStateChange(e){this.stateListeners.add(e)}offStateChange(e){this.stateListeners.delete(e)}isConnected(){return this.connected}dispatch(e){var t="lightman/devices/"+e.controllerId+"/events",n=this.subscriptions.get(t);n&&n.forEach(function(t){try{t(e)}catch(n){console.error("[MQTT] Error in event listener:",n)}})}notifyState(e){this.stateListeners.forEach(function(t){try{t(e)}catch(n){console.error("[MQTT] Error in state listener:",n)}})}};function $l(e){var t=e.controllerId,n=void 0===e.enabled||e.enabled,[r,o]=W.useState(!1),[i,a]=W.useState(null),s=W.useRef(new Map);return W.useEffect(function(){if(n&&t){Kl.connect();var e=function(e){o(e)},r=function(e){a(e);var t=s.current.get(e.type);t&&t.forEach(function(t){try{"button:press"===e.type&&void 0!==e.buttonId?t(e.buttonId):"proximity:enter"===e.type&&void 0!==e.distance?t(e.distance):t()}catch(n){console.error("[useMqtt] Callback error:",n)}})};return Kl.onStateChange(e),Kl.subscribe(t,r),o(Kl.isConnected()),function(){Kl.offStateChange(e),Kl.unsubscribe(t,r),Kl.disconnect()}}},[t,n]),{isConnected:r,lastEvent:i}}function Ql(e){var t=e.controllerId,n=void 0===e.enabled||e.enabled,r=e.debounceMs||200,[o,i]=W.useState(!1),a=W.useRef(null),s=W.useRef(r);s.current=r;var l=$l({controllerId:t,enabled:n}),u=W.useRef(function(e){null!==a.current&&clearTimeout(a.current),a.current=setTimeout(function(){i(e),a.current=null},s.current)});return W.useEffect(function(){if(l.lastEvent){var e=l.lastEvent;return"monophone:pickup"!==e.type&&"monophone:hangup"!==e.type||u.current("monophone:pickup"===e.type),function(){null!==a.current&&clearTimeout(a.current)}}},[l.lastEvent]),W.useEffect(function(){if(n){var e=null,r=!1;return function n(){try{(e=new WebSocket("ws://127.0.0.1:3402")).onmessage=function(e){try{var n=JSON.parse(e.data);if("hardware:event"!==n.type||!n.payload)return;if(t&&n.payload.controllerId&&n.payload.controllerId!==t)return;"monophone:pickup"===n.payload.type?u.current(!0):"monophone:hangup"===n.payload.type&&u.current(!1)}catch(r){}},e.onclose=function(){r||setTimeout(n,2e3)}}catch(o){}}(),function(){r=!0,null==e||e.close()}}},[t,n]),{isPickedUp:o,isConnected:l.isConnected}}function Gl(e){var{deviceId:t,templateType:n,instanceId:r,enabled:o=!0}=e,i=W.useRef(Date.now()),a=W.useRef("loading"),s=W.useRef(void 0),l=W.useCallback(function(e){a.current=e},[]),u=W.useCallback(function(e){s.current=e},[]);return W.useEffect(function(){if(o){l();var e=setInterval(l,pe().heartbeatInterval);return function(){clearInterval(e)}}function r(){var e=performance;if(e&&e.memory)return e.memory.usedJSHeapSize}function l(){var e={deviceId:t,status:a.current,currentContent:s.current,templateType:n,uptime:Math.floor((Date.now()-i.current)/1e3),memoryUsage:r(),timestamp:Date.now()};"connected"!==xe.getState()?function(e,t){return f(this,null,function*(){var n=ve()+"/devices/"+encodeURIComponent(e)+"/heartbeat";yield Se(n,{method:"POST",headers:me(),body:JSON.stringify(t)})})}(t,e).catch(function(e){}):xe.send("heartbeat",e)}},[t,n,r,o]),{setStatus:l,setCurrentContent:u}}function Yl(e){var t=Me(),n=e.config,r=n.mode||"single",o=1e3*(n.delay||1),i=void 0!==n.loop&&n.loop,a=1e3*(void 0!==n.silenceGap?n.silenceGap:3),s=Ql({controllerId:n.controllerId,enabled:!0}),l=function(e){var t=e.controllerId,n=void 0===e.enabled||e.enabled,[r,o]=W.useState(null),[i,a]=W.useState(0),s=$l({controllerId:t,enabled:n});return W.useEffect(function(){if(s.lastEvent){var e=s.lastEvent;"button:press"===e.type&&void 0!==e.buttonId&&(o(e.buttonId),a(e.timestamp))}},[s.lastEvent]),{lastButtonId:r,lastPressTime:i,isConnected:s.isConnected}}({controllerId:n.controllerId,enabled:"multi"===r}),[u,c]=W.useState(!1),[f,p]=W.useState(!1),h=s.isPickedUp||u,{setStatus:d,setCurrentContent:y}=Gl({deviceId:pe().deviceId,templateType:"single"===r?"monophone-audio":"button-audio",instanceId:e.instanceId}),[g,m]=W.useState(null),[v,b]=W.useState(!1),w=W.useRef(null),S=W.useRef(0),k=W.useRef(!1),x=W.useRef(!0),E=W.useRef(null),_=W.useRef(null),C=W.useRef(!1),I=W.useRef(!1);W.useEffect(function(){I.current=h},[h]),W.useEffect(function(){return x.current=!0,function(){x.current=!1,S.current&&(cancelAnimationFrame(S.current),S.current=0),null!==E.current&&(clearTimeout(E.current),E.current=null),null!==_.current&&(clearTimeout(_.current),_.current=null);var e=w.current;e&&(e.pause(),e.currentTime=0)}},[]);var T=W.useCallback(function(){S.current&&(cancelAnimationFrame(S.current),S.current=0),null!==E.current&&(clearTimeout(E.current),E.current=null),null!==_.current&&(clearTimeout(_.current),_.current=null)},[]),A=W.useCallback(function(){var e=w.current;if(e){var t=n.fadeOutDuration||1e3,r=e.volume,o=-1;S.current&&(cancelAnimationFrame(S.current),S.current=0),S.current=requestAnimationFrame(function n(i){if(x.current){o<0&&(o=i);var a=(i-o)/t;if(a>=1)return e&&(e.volume=0,e.pause(),e.currentTime=0,e.volume=1),S.current=0,k.current=!1,void(x.current&&b(!1));var s=r*(1-a);e&&(e.volume=Math.max(0,s)),S.current=requestAnimationFrame(n)}})}},[n.fadeOutDuration]),P=W.useCallback(function(){T();var e=w.current;e&&(e.pause(),e.currentTime=0,e.volume=1),k.current=!1,b(!1),m(null),C.current=!1},[T]),j=W.useCallback(function(e,t){var n=w.current;if(n){T(),n.pause(),n.currentTime=0,e&&(n.src=e,n.load()),n.volume=1;var i=!1!==t?o:0,a=function(){if(x.current&&n&&(I.current||"single"===r)){var e;try{e=n.play()}catch(t){return}e&&"function"==typeof e.then?e.then(function(){x.current&&(k.current=!0,b(!0))}).catch(function(e){if(console.error("[MonophoneAudio] Audio play failed:",e),"NotAllowedError"===e.name){var t=function(){x.current&&n&&(n.play().then(function(){x.current&&(k.current=!0,b(!0))}).catch(function(){}),document.removeEventListener("pointerdown",t),document.removeEventListener("keydown",t))};document.addEventListener("pointerdown",t,{once:!0}),document.addEventListener("keydown",t,{once:!0})}}):(k.current=!0,b(!0))}};i>0?E.current=setTimeout(function(){E.current=null,a()},i):a()}},[o,T,r]),O=W.useCallback(function(){if(x.current)if(k.current=!1,b(!1),"single"===r)i&&I.current&&j(void 0,!1);else if("multi"===r){if(m(null),!I.current)return;_.current=setTimeout(function(){_.current=null,x.current&&I.current&&n.welcomeMessage&&j(n.welcomeMessage,!1)},a)}},[r,i,j,n.welcomeMessage,a]),R=W.useCallback(function(){if(x.current){k.current=!1,b(!1),d("error");var e=w.current?w.current.src:"unknown";t.send("error",{type:"playback",message:"Audio failed to load: "+e})}},[d]);W.useEffect(function(){"single"===r&&(h?j(n.audioUrl):(T(),k.current&&A()))},[r,h,n.audioUrl,j,A,T]),W.useEffect(function(){"multi"===r&&(h?n.welcomeMessage&&(C.current=!0,j(n.welcomeMessage)):P())},[r,h]);var M=W.useCallback(function(e){I.current&&(m(e),j(e.audioUrl,!1))},[j]),L=W.useCallback(function(){var e=w.current;e&&(e.pause(),e.currentTime=0),k.current=!1,b(!1),m(null),I.current&&n.welcomeMessage&&(_.current=setTimeout(function(){_.current=null,x.current&&I.current&&j(n.welcomeMessage,!1)},a))},[n.welcomeMessage,a,j]);W.useEffect(function(){if("multi"===r&&null!==l.lastButtonId){for(var e,t=(n.buttons||[]).slice(0,8),o=0;o<t.length;o++)if(t[o].buttonId===l.lastButtonId){e=t[o];break}e&&M(e)}},[r,l.lastButtonId,l.lastPressTime]),W.useEffect(function(){"single"===r?h?(d("playing"),y(n.audioUrl)):(d("idle"),y(void 0)):g&&v?(d("playing"),y(g.audioUrl)):h?(d("playing"),y(void 0)):(d("idle"),y(void 0))},[r,h,g,v,n.audioUrl,d,y]);var B=!h;return Pe.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",backgroundColor:"#000",overflow:"hidden"},children:[Pe.jsx("audio",{ref:w,src:"single"===r?n.audioUrl:void 0,preload:"auto",onEnded:O,onError:R}),"single"===r?Pe.jsx(Xl,{cfg:n,isPickedUp:h,isPlaying:v}):Pe.jsx(Zl,{cfg:n,activeButton:g,isPlaying:v,onButtonTap:M,onStop:L,isPickedUp:h}),n.idle&&Pe.jsx(We,{isIdle:B,idle:n.idle}),Pe.jsx(ru,{mode:r,show:f,onToggle:function(){p(!f)},isPickedUp:u,onPickup:function(){c(!0)},onHangup:function(){c(!1)},buttons:(n.buttons||[]).slice(0,8),onButtonPress:M})]})}function Xl(e){var t=e.cfg,n=e.isPickedUp,r={position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundImage:t.idleImageUrl?"url("+t.idleImageUrl+")":"none",backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",transform:"translateZ(0)"},o={position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",zIndex:10,opacity:n?1:0,transition:"opacity 400ms ease-in-out",pointerEvents:"none",transform:"translateZ(0)"};return Pe.jsxs(Pe.Fragment,{children:[t.idleVideoUrl?Pe.jsx(He,{src:t.idleVideoUrl,muted:!1,fit:"cover",backgroundColor:"#000",loop:!0,autoPlay:!0}):t.idleImageUrl?Pe.jsx("div",{style:r}):null,Pe.jsxs("div",{style:o,children:[Pe.jsx("div",{style:{width:"120px",height:"120px",borderRadius:"50%",backgroundColor:"rgba(255, 255, 255, 0.15)",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"24px",transform:"translateZ(0)"},children:Pe.jsx(tu,{})}),Pe.jsx(nu,{isPlaying:n}),Pe.jsx("div",{style:{color:"#ffffff",fontSize:"18px",fontWeight:"500",letterSpacing:"2px",textTransform:"uppercase",marginTop:"16px",opacity:.8},children:"Now Playing"})]})]})}function Zl(e){var t=e.cfg,n=e.activeButton,r=e.isPlaying,o=e.onButtonTap,i=e.onStop,a=(t.buttons||[]).slice(0,8),s=a.length>=4,c={position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"40px",boxSizing:"border-box",opacity:n?0:1,transition:"opacity 400ms ease-in-out",pointerEvents:n?"none":"auto",zIndex:n?1:5,transform:"translateZ(0)"},f={display:"grid",gridTemplateColumns:s?"1fr 1fr":"1fr",gap:"20px",width:"100%",maxWidth:s?"700px":"400px",transform:"translateZ(0)"},p={position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",opacity:n?1:0,transition:"opacity 400ms ease-in-out",pointerEvents:n?"auto":"none",zIndex:n?5:1,transform:"translateZ(0)"};return Pe.jsxs(Pe.Fragment,{children:[Pe.jsxs("div",{style:c,children:[Pe.jsx("div",{style:{color:"#ffffff",fontSize:"28px",fontWeight:"600",letterSpacing:"3px",textTransform:"uppercase",marginBottom:"40px",opacity:.7,textAlign:"center"},children:"Select a Track"}),Pe.jsx("div",{style:f,children:a.map(function(e){return Pe.jsx(Jl,{button:e,isActive:null!==n&&n.buttonId===e.buttonId,onTap:function(){o(e)}},e.buttonId)})})]}),Pe.jsxs("div",{style:p,children:[n&&n.videoUrl?Pe.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",transform:"translateZ(0)"},children:Pe.jsx(He,{src:n.videoUrl,muted:!1,fit:"cover",backgroundColor:"#000",loop:!0,autoPlay:!0})}):n&&n.imageUrl?Pe.jsx("div",{style:u(l({},{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",transform:"translateZ(0)"}),{backgroundImage:"url("+n.imageUrl+")"})}):Pe.jsx(eu,{isPlaying:r}),n&&Pe.jsxs("div",{style:{position:"absolute",bottom:0,left:0,width:"100%",padding:"32px",boxSizing:"border-box",background:"linear-gradient(transparent, rgba(0,0,0,0.8))",display:"flex",flexDirection:"column",alignItems:"center",zIndex:10,transform:"translateZ(0)"},children:[Pe.jsx("div",{style:{color:"#ffffff",fontSize:"14px",fontWeight:"500",letterSpacing:"2px",textTransform:"uppercase",opacity:.6,marginBottom:"8px"},children:"Now Playing"}),Pe.jsx("div",{style:{color:"#ffffff",fontSize:"24px",fontWeight:"600",textAlign:"center",marginBottom:"16px"},children:n.label}),Pe.jsx(nu,{isPlaying:r}),Pe.jsx("div",{onClick:i,onTouchEnd:function(e){e.preventDefault(),i()},style:{marginTop:"24px",padding:"10px 28px",borderRadius:"24px",border:"1px solid rgba(255,255,255,0.3)",color:"#ffffff",fontSize:"14px",fontWeight:"500",cursor:"pointer",opacity:.7,transition:"opacity 200ms",userSelect:"none",WebkitTapHighlightColor:"transparent"},children:"← Back to Tracks"})]})]})]})}function Jl(e){var t=e.button,n=e.isActive,r=e.onTap,o={position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"24px 16px",borderRadius:"16px",backgroundColor:n?"rgba(255, 255, 255, 0.15)":"rgba(255, 255, 255, 0.06)",border:n?"2px solid rgba(255, 255, 255, 0.6)":"2px solid rgba(255, 255, 255, 0.12)",boxShadow:n?"0 0 24px rgba(255, 255, 255, 0.2)":"none",cursor:"pointer",userSelect:"none",WebkitTapHighlightColor:"transparent",transition:"all 300ms ease-in-out",overflow:"hidden",transform:"translateZ(0)",minHeight:"100px"},i={width:"48px",height:"48px",borderRadius:"50%",backgroundColor:n?"rgba(255, 255, 255, 0.25)":"rgba(255, 255, 255, 0.1)",border:n?"2px solid rgba(255, 255, 255, 0.5)":"2px solid rgba(255, 255, 255, 0.2)",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"12px",transition:"all 300ms ease-in-out",transform:"translateZ(0)"},a={color:"#ffffff",fontSize:"20px",fontWeight:"700",opacity:n?1:.7},s={color:"#ffffff",fontSize:"16px",fontWeight:"500",textAlign:"center",opacity:n?1:.8,lineHeight:"1.3",transition:"opacity 300ms ease-in-out"};return Pe.jsxs("div",{style:o,onClick:r,onTouchEnd:function(e){e.preventDefault(),r()},children:[t.imageUrl&&Pe.jsx("div",{style:u(l({},{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",opacity:.2,pointerEvents:"none",transform:"translateZ(0)"}),{backgroundImage:"url("+t.imageUrl+")"})}),Pe.jsx("div",{style:u(l({},i),{pointerEvents:"none"}),children:Pe.jsx("span",{style:a,children:t.buttonId})}),Pe.jsx("div",{style:u(l({},s),{pointerEvents:"none"}),children:t.label})]})}function eu(e){var t=e.isPlaying,n={width:t?"200px":"120px",height:t?"200px":"120px",borderRadius:"50%",backgroundColor:"rgba(255, 255, 255, 0.05)",border:"2px solid rgba(255, 255, 255, 0.15)",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 600ms ease-in-out",transform:"translateZ(0)"},r={width:t?"120px":"80px",height:t?"120px":"80px",borderRadius:"50%",backgroundColor:"rgba(255, 255, 255, 0.08)",border:"2px solid rgba(255, 255, 255, 0.1)",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 600ms ease-in-out",transform:"translateZ(0)"};return Pe.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#0a0a0a",transform:"translateZ(0)"},children:Pe.jsx("div",{style:n,children:Pe.jsx("div",{style:r,children:Pe.jsx(tu,{size:t?48:32})})})})}function tu(e){var t=e&&e.size||56,n={width:t+"px",height:t+"px",fill:"#ffffff",opacity:.9,transition:"all 400ms ease-in-out"};return Pe.jsx("svg",{style:n,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:Pe.jsx("path",{d:"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"})})}function nu(e){for(var t=e.isPlaying,n=[12,20,32,20,12],r=[0,150,300,450,600],o=[],i=0;i<n.length;i++){var a={width:"4px",height:t?n[i]+"px":"4px",backgroundColor:"#ffffff",borderRadius:"2px",transition:"height 300ms ease-in-out",transitionDelay:r[i]+"ms",opacity:.8,transform:"translateZ(0)"};o.push(Pe.jsx("div",{style:a},i))}return Pe.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"3px",height:"40px"},children:o})}function ru(e){var t=e.show,n=e.onToggle,r=e.isPickedUp,o=e.onPickup,i=e.onHangup,a=e.mode,s=e.buttons,c=e.onButtonPress,f=W.useRef(0),p=W.useRef(null),h=W.useCallback(function(){f.current=f.current+1,null!==p.current&&clearTimeout(p.current),f.current>=3?(f.current=0,n()):p.current=setTimeout(function(){f.current=0,p.current=null},600)},[n]),d={position:"absolute",top:0,right:0,width:"60px",height:"60px",zIndex:9999,cursor:"default",background:"transparent"};if(!t)return Pe.jsx("div",{style:d,onClick:h});var y={display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"8px 16px",borderRadius:"8px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:"600",transition:"all 150ms",userSelect:"none",WebkitTapHighlightColor:"transparent"},g=u(l({},y),{backgroundColor:r?"#dc2626":"#16a34a",color:"#fff",width:"100%"}),m=u(l({},y),{backgroundColor:"rgba(255, 255, 255, 0.1)",color:"#fff",border:"1px solid rgba(255, 255, 255, 0.2)",padding:"6px 12px",fontSize:"12px",flex:"1"}),v={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:r?"#22c55e":"#ef4444",display:"inline-block",marginRight:"6px"};return Pe.jsxs(Pe.Fragment,{children:[Pe.jsx("div",{style:d,onClick:h}),Pe.jsxs("div",{style:{position:"absolute",top:"10px",right:"10px",zIndex:9998,backgroundColor:"rgba(0, 0, 0, 0.85)",border:"1px solid rgba(255, 255, 255, 0.2)",borderRadius:"12px",padding:"16px",minWidth:"200px",maxWidth:"280px",color:"#fff",fontFamily:"system-ui, sans-serif",fontSize:"13px"},children:[Pe.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"12px",paddingBottom:"8px",borderBottom:"1px solid rgba(255, 255, 255, 0.15)"},children:[Pe.jsx("span",{style:{fontWeight:"700",letterSpacing:"0.5px"},children:"TEST SIM"}),Pe.jsx("button",{onClick:n,style:{width:"36px",height:"36px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"none",backgroundColor:"rgba(255, 255, 255, 0.15)",color:"#fff",fontSize:"20px",fontWeight:"300",cursor:"pointer",transition:"background-color 150ms ease",WebkitTapHighlightColor:"transparent"},children:"×"})]}),Pe.jsxs("div",{style:{marginBottom:"12px",fontSize:"12px",opacity:.7},children:[Pe.jsx("span",{style:v}),"Handset: ",r?"PICKED UP":"ON HOOK"]}),Pe.jsx("div",{style:g,onClick:function(){r?i():o()},children:r?"Hang Up":"Pick Up"}),"multi"===a&&s.length>0&&Pe.jsxs("div",{style:{marginTop:"12px"},children:[Pe.jsx("div",{style:{fontSize:"11px",opacity:.5,marginBottom:"6px",textTransform:"uppercase",letterSpacing:"1px"},children:"Buttons"}),Pe.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:s.map(function(e){return Pe.jsxs("div",{style:m,onClick:function(){c(e)},children:[e.buttonId,": ",e.label||"—"]},e.buttonId)})})]}),Pe.jsx("div",{style:{marginTop:"12px",fontSize:"11px",opacity:.4,lineHeight:"1.4"},children:"Triple-click top-right corner to hide"})]})]})}function ou(e){var t=e.show,n=e.onToggle,r=e.isTriggered,o=e.onTrigger,i=e.onStop,a=W.useRef(0),s=W.useRef(null),l=W.useCallback(function(){a.current=a.current+1,null!==s.current&&clearTimeout(s.current),a.current>=3?(a.current=0,n()):s.current=setTimeout(function(){a.current=0,s.current=null},600)},[n]),u={position:"absolute",top:0,right:0,width:"60px",height:"60px",zIndex:9999,cursor:"default",background:"transparent"};if(!t)return Pe.jsx("div",{style:u,onClick:l});var c={display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"8px 16px",borderRadius:"8px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:"600",userSelect:"none",WebkitTapHighlightColor:"transparent",backgroundColor:r?"#dc2626":"#16a34a",color:"#fff",width:"100%"},f={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:r?"#22c55e":"#ef4444",display:"inline-block",marginRight:"6px"};return Pe.jsxs(Pe.Fragment,{children:[Pe.jsx("div",{style:u,onClick:l}),Pe.jsxs("div",{style:{position:"absolute",top:"10px",right:"10px",zIndex:9998,backgroundColor:"rgba(0, 0, 0, 0.85)",border:"1px solid rgba(255, 255, 255, 0.2)",borderRadius:"12px",padding:"16px",minWidth:"200px",color:"#fff",fontFamily:"system-ui, sans-serif",fontSize:"13px"},children:[Pe.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"12px",paddingBottom:"8px",borderBottom:"1px solid rgba(255, 255, 255, 0.15)"},children:[Pe.jsx("span",{style:{fontWeight:"700",letterSpacing:"0.5px"},children:"TEST SIM"}),Pe.jsx("button",{onClick:n,style:{width:"36px",height:"36px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"none",backgroundColor:"rgba(255, 255, 255, 0.15)",color:"#fff",fontSize:"20px",fontWeight:"300",cursor:"pointer",transition:"background-color 150ms ease",WebkitTapHighlightColor:"transparent"},children:"×"})]}),Pe.jsxs("div",{style:{marginBottom:"12px",fontSize:"12px",opacity:.7},children:[Pe.jsx("span",{style:f}),"Video: ",r?"PLAYING":"IDLE"]}),Pe.jsx("div",{style:c,onClick:function(){r?i():o()},children:r?"Stop Video":"Trigger Video"}),Pe.jsx("div",{style:{marginTop:"12px",fontSize:"11px",opacity:.4,lineHeight:"1.4"},children:"Triple-click top-right corner to hide"})]})]})}function iu({src:e,fit:t="cover",backgroundColor:n="#000"}){var[r,o]=W.useState(!1),[i,a]=W.useState(!1);return i?Pe.jsx("div",{style:{width:"100%",height:"100%",backgroundColor:n,display:"flex",alignItems:"center",justifyContent:"center"},children:Pe.jsx("span",{style:{color:"#666",fontSize:"14px"},children:"Image unavailable"})}):Pe.jsx("div",{style:{position:"relative",width:"100%",height:"100%",backgroundColor:n,overflow:"hidden"},children:Pe.jsx("img",{src:e,alt:"",onLoad:function(){o(!0)},onError:function(){a(!0)},style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:t,opacity:r?1:0,transition:"opacity 300ms ease-in-out",transform:"translateZ(0)"},draggable:!1})})}function au({contentKey:e,children:t,transition:n,transitionDuration:r,onTransitionComplete:o}){var[i,a]=W.useState({front:{key:e,content:t},back:null}),[s,c]=W.useState(!1),f=W.useRef(null),p=W.useRef(null),h=W.useRef(e);return W.useEffect(function(){if(e!==h.current)return h.current=e,"none"===n?(a({front:{key:e,content:t},back:null}),void(o&&o())):(a(function(n){return{front:n.front,back:{key:e,content:t}}}),p.current=requestAnimationFrame(function(){p.current=requestAnimationFrame(function(){p.current=null,c(!0)})}),f.current&&clearTimeout(f.current),f.current=setTimeout(function(){c(!1),a({front:{key:e,content:t},back:null}),o&&o()},r),function(){f.current&&(clearTimeout(f.current),f.current=null),null!==p.current&&(cancelAnimationFrame(p.current),p.current=null)});a(function(n){return u(l({},n),{front:{key:e,content:t}})})},[e]),Pe.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"},children:[Pe.jsx("div",{style:function(){var e={position:"absolute",top:0,left:0,width:"100%",height:"100%",transform:"translateZ(0)"};if(!s||!i.back)return e;var t=r+"ms";switch(n){case"fade":return u(l({},e),{opacity:0,transition:"opacity "+t+" ease-in-out"});case"slide-left":return u(l({},e),{transform:"translateX(-100%) translateZ(0)",transition:"transform "+t+" ease-in-out"});case"slide-right":return u(l({},e),{transform:"translateX(100%) translateZ(0)",transition:"transform "+t+" ease-in-out"});case"dissolve":return u(l({},e),{opacity:0,transition:"opacity "+t+" steps(8)"});default:return e}}(),children:i.front.content}),i.back&&Pe.jsx("div",{style:function(){var e={position:"absolute",top:0,left:0,width:"100%",height:"100%",transform:"translateZ(0)"};if(!s)switch(n){case"fade":case"dissolve":default:return u(l({},e),{opacity:0});case"slide-left":return u(l({},e),{transform:"translateX(100%) translateZ(0)"});case"slide-right":return u(l({},e),{transform:"translateX(-100%) translateZ(0)"})}var t=r+"ms";switch(n){case"fade":return u(l({},e),{opacity:1,transition:"opacity "+t+" ease-in-out"});case"slide-left":case"slide-right":return u(l({},e),{transform:"translateX(0) translateZ(0)",transition:"transform "+t+" ease-in-out"});case"dissolve":return u(l({},e),{opacity:1,transition:"opacity "+t+" steps(8)"});default:return e}}(),children:i.back.content})]})}function su(e){var t=e.playlistId,n=e.defaultDuration,r=e.shuffle,o=e.loop,i=void 0===e.enabled||e.enabled,a=W.useState([]),s=a[0],l=a[1],u=W.useState(0),c=u[0],p=u[1],h=W.useState(!0),d=h[0],y=h[1],g=W.useState(null),m=g[0],v=g[1],b=W.useRef(null),w=W.useRef(!0),S=W.useRef(0);var k=W.useCallback(function(){return f(this,null,function*(){if(t&&i){S.current=S.current+1;var e=S.current;y(!0),v(null);try{var n=yield function(e){return f(this,null,function*(){var t=ve()+"/playlists/"+encodeURIComponent(e),n=yield Se(t,{method:"GET",headers:me()}),r=(n.items||[]).map(function(e){var t=e.content||{},n=e.config,r=null;if(n&&"object"==typeof n&&!Array.isArray(n))r=n;else if("string"==typeof n)try{var o=JSON.parse(n);o&&"object"==typeof o&&!Array.isArray(o)&&(r=o)}catch(i){r=null}return{id:String(e.id||""),type:t.type||"image",url:String(e.url||""),duration:"number"==typeof e.duration?e.duration:void 0,metadata:r||void 0}});return{id:String(n.id||""),name:String(n.name||""),items:r}})}(t);if(!w.current)return;if(e!==S.current)return;var o=n.items||[];r&&(o=function(e){for(var t=e.slice(),n=t.length-1;n>0;n--){var r=Math.floor(Math.random()*(n+1)),o=t[n];t[n]=t[r],t[r]=o}return t}(o)),l(o),y(!1)}catch(a){if(!w.current)return;if(e!==S.current)return;v(a instanceof Error?a:new Error("Failed to fetch playlist")),y(!1)}}})},[t,r,i]);W.useEffect(function(){return w.current=!0,k(),function(){w.current=!1}},[k]);var x=W.useCallback(function(){p(function(e){if(0===s.length)return 0;var t=e+1;return t>=s.length?o?0:e:t})},[s.length,o]),E=W.useCallback(function(){p(function(e){if(0===s.length)return 0;var t=e-1;return t<0?o?s.length-1:0:t})},[s.length,o]),_=W.useCallback(function(e){e>=0&&e<s.length&&p(e)},[s.length]),C=W.useCallback(function(){x()},[x]),I=s.length>0&&s[c]||null,T=void 0===e.autoAdvance||e.autoAdvance;W.useEffect(function(){if(!1!==T&&I&&"image"===I.type){b.current&&clearTimeout(b.current);var e=1e3*(I.duration||n);return b.current=setTimeout(function(){C()},e),function(){b.current&&(clearTimeout(b.current),b.current=null)}}},[T,I,c,n,C]),W.useEffect(function(){if(0!==s.length){for(var e=[],t=1;t<=2;t++){var n=c+t;n<s.length?e.push(n):o&&e.push(n%s.length)}e.forEach(function(e){var t=s[e];t&&("image"===t.type&&((new Image).src=t.url))})}},[c,s,o]);var A=W.useCallback(function(){return f(this,null,function*(){var e=I?I.id:null;yield k(),e&&l(function(t){var n=t.findIndex(function(t){return t.id===e});return n>=0&&p(n),t})})},[k,I]),P=s.length>0?s[c+1]||(o?s[0]:null):null;return{items:s,currentItem:I,currentIndex:c,nextItem:P,isLoading:d,error:m,next:x,previous:E,goTo:_,refresh:A,onItemComplete:C}}function lu(e){var{enabled:t,schedule:n,inactivityTimeout:r=0,hasContent:o=!0,hasContentError:i=!1}=e,[a,s]=W.useState(!1),[l,u]=W.useState(null),c=W.useRef(null),f=W.useRef(null),p=W.useCallback(function(){s(!1),u(null)},[]),h=W.useCallback(function(e){s(!0),u(e||"command")},[]),d=W.useCallback(function(){c.current&&(clearTimeout(c.current),c.current=null),a&&"inactivity"===l&&p(),r>0&&t&&(c.current=setTimeout(function(){s(!0),u("inactivity")},r))},[r,t,a,l,p]);return W.useEffect(function(){t&&(o?"no-content"===l&&(s(!1),u(null)):(s(!0),u("no-content")))},[t,o,l]),W.useEffect(function(){t&&(i?(s(!0),u("content-error")):"content-error"===l&&(s(!1),u(null)))},[t,i,l]),W.useEffect(function(){if(t&&n)return e(),f.current=setInterval(e,6e4),function(){f.current&&clearInterval(f.current)};function e(){(function(e){try{var t=new Date,n=e.activeFrom.split(":"),r=e.activeTo.split(":"),o=60*parseInt(n[0],10)+parseInt(n[1],10),i=60*parseInt(r[0],10)+parseInt(r[1],10),a=60*t.getHours()+t.getMinutes();return o<=i?a>=o&&a<i:a>=o||a<i}catch(s){return!0}})(n)?"schedule"===l&&(s(!1),u(null)):(s(!0),u("schedule"))}},[t,n,l]),W.useEffect(function(){if(t&&!(r<=0))return c.current=setTimeout(function(){s(!0),u("inactivity")},r),document.addEventListener("touchstart",e),document.addEventListener("touchmove",e),document.addEventListener("mousedown",e),document.addEventListener("mousemove",e),document.addEventListener("keydown",e),function(){c.current&&clearTimeout(c.current),document.removeEventListener("touchstart",e),document.removeEventListener("touchmove",e),document.removeEventListener("mousedown",e),document.removeEventListener("mousemove",e),document.removeEventListener("keydown",e)};function e(){d()}},[t,r,d]),W.useEffect(function(){return function(){c.current&&clearTimeout(c.current),f.current&&clearInterval(f.current)}},[]),t?{isIdle:a,idleReason:l,activate:p,deactivate:h,resetInactivityTimer:d}:{isIdle:!1,idleReason:null,activate:function(){},deactivate:function(){},resetInactivityTimer:function(){}}}function uu(e){var{enabled:t=!0,onContentUpdated:n,onPlaylistUpdated:r,onConfigUpdated:o}=e,i=W.useRef(n),a=W.useRef(r),s=W.useRef(o);W.useEffect(function(){i.current=n,a.current=r,s.current=o}),W.useEffect(function(){if(t)return xe.on("content:updated",e),xe.on("playlist:updated",n),xe.on("config:updated",r),function(){xe.off("content:updated",e),xe.off("playlist:updated",n),xe.off("config:updated",r)};function e(e){var t=e.payload;i.current&&t&&t.contentId&&t.newUrl&&i.current(t.contentId,t.newUrl)}function n(e){var t=e.payload;a.current&&t&&t.playlistId&&a.current(t.playlistId)}function r(e){var t=e.payload;s.current&&t&&t.config&&s.current(t.config)}},[t])}function cu(e){var t=e.items,n=e.currentIndex,r=e.isVisible,o=e.thumbSize||80,i=e.onThumbnailTap,a=e.onInteraction,s=e.onTouchActiveChange,l=W.useRef(null),u=W.useRef(null),c=W.useRef([]);W.useEffect(function(){var e=c.current[n];e&&r&&e.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})},[n,r]);var f=t.length>0?(n+1)/t.length*100:0,p={position:"fixed",bottom:0,left:0,right:0,zIndex:100,transform:r?"translateY(0)":"translateY(100%)",transition:"transform 300ms ease-in-out",willChange:"transform",backgroundColor:"rgba(0, 0, 0, 0.7)",touchAction:"pan-x"},h={height:"100%",width:f+"%",backgroundColor:"#fff",transition:"width 300ms ease"};return Pe.jsxs("div",{style:p,children:[Pe.jsx("div",{style:{height:3,backgroundColor:"rgba(255, 255, 255, 0.2)",width:"100%"},children:Pe.jsx("div",{style:h})}),Pe.jsx("div",{ref:l,style:{display:"flex",overflowX:"auto",overflowY:"hidden",padding:"10px 8px",gap:8,scrollSnapType:"x mandatory",WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},onTouchStart:function(e){var t=e.touches[0];u.current={x:t.clientX,y:t.clientY},s&&s(!0),a()},onTouchMove:function(){a()},onTouchEnd:function(e){if(s&&s(!1),u.current){var t=e.changedTouches[0],n=Math.abs(t.clientX-u.current.x),r=Math.abs(t.clientY-u.current.y);if(Math.sqrt(n*n+r*r)<10){var o=e.target.closest("[data-thumb-index]");if(o){var a=parseInt(o.getAttribute("data-thumb-index")||"0",10);i(a)}}u.current=null}},onTouchCancel:function(){s&&s(!1),u.current=null},onScroll:function(){a()},onMouseDown:function(e){var t=e.target.closest("[data-thumb-index]");if(t){var n=parseInt(t.getAttribute("data-thumb-index")||"0",10);i(n)}a()},children:t.map(function(e,t){var r=t===n,i={flexShrink:0,width:o,height:o,borderRadius:4,overflow:"hidden",border:r?"2px solid #fff":"2px solid transparent",scrollSnapAlign:"center",cursor:"pointer",opacity:r?1:.6,transition:"border-color 200ms, opacity 200ms",position:"relative",transform:"translateZ(0)"};return Pe.jsx("div",{"data-thumb-index":t,ref:function(e){c.current[t]=e},style:i,children:"video"===e.type?Pe.jsx("div",{style:{width:"100%",height:"100%",backgroundColor:"#222",display:"flex",alignItems:"center",justifyContent:"center"},children:Pe.jsx("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",style:{opacity:.8},children:Pe.jsx("path",{d:"M8 5v14l11-7z",fill:"#fff"})})}):Pe.jsx("img",{src:e.url,loading:"lazy",draggable:!1,style:{width:"100%",height:"100%",objectFit:"cover",display:"block",pointerEvents:"none"},alt:""})},e.id+"-"+t)})})]})}function fu(e){var t=(e||"").replace(/\r\n/g,"\n").trim();if(!t)return{firstLine:"",remaining:""};var n=t.split("\n").map(function(e){return e.trim()}).filter(function(e){return e.length>0});return 0===n.length?{firstLine:"",remaining:""}:{firstLine:n[0],remaining:n.slice(1).join("\n")}}function pu(e){var t,n,r=e.items,o=e.backgroundColor,i=e.onActivity,a=W.useMemo(function(){return function(e){for(var t,n,r,o,i,a,s,l,u,c={},f=[],p=0;p<e.length;p++){var h=e[p],d=null==(t=h.metadata)?void 0:t.documentIndex;null!=d?(c[d]||(c[d]=[]),c[d].push(h)):f.push(h)}for(var y=[],g=Object.keys(c).map(Number).sort(function(e,t){return e-t}),m=0;m<g.length;m++){var v=c[g[m]],b=v[0];y.push({documentIndex:g[m],pages:v,caption:(null==(n=b.metadata)?void 0:n.documentCaption)||(null==(r=b.metadata)?void 0:r.caption)||"",sourceLabel:(null==(o=b.metadata)?void 0:o.documentSourceLabel)||(null==(i=b.metadata)?void 0:i.sourceLabel)||""})}for(var w=0;w<f.length;w++){var S=f[w];y.push({documentIndex:y.length,pages:[S],caption:(null==(a=S.metadata)?void 0:a.documentCaption)||(null==(s=S.metadata)?void 0:s.caption)||"",sourceLabel:(null==(l=S.metadata)?void 0:l.documentSourceLabel)||(null==(u=S.metadata)?void 0:u.sourceLabel)||""})}return y}(r)},[r]),[s,l]=W.useState("homepage"),[u,c]=W.useState(-1),[f,p]=W.useState(0),[h,d]=W.useState(0),[y,g]=W.useState({top:0,height:100}),[m,v]=W.useState({left:0,top:0,width:0,height:0,visible:!1}),b=W.useRef(null),w=W.useRef([]),S=W.useRef(null),k=W.useRef(null),x=W.useRef(null),E=a[f]||a[0],_=E?E.pages.length:0;W.useEffect(function(){return function(){S.current&&clearTimeout(S.current)}},[]);var C=W.useCallback(function(e){c(e),l("selecting"),i(),S.current=setTimeout(function(){p(e),d(0),g({top:0,height:100}),v({left:0,top:0,width:0,height:0,visible:!1}),l("reading")},1200)},[i]),I=W.useCallback(function(){l("homepage"),c(-1),d(0),b.current&&(b.current.scrollTop=0),i()},[i]),T=W.useCallback(function(){var e=x.current,t=k.current;if(e&&t){var n=t.getBoundingClientRect(),r=e.getBoundingClientRect();if(0!==r.width&&0!==r.height){var o=r.left-n.left,i=r.top-n.top+y.top/100*r.height,a=Math.max(y.height/100*r.height,4),s=y.height>=98;v({left:o,top:i,width:r.width,height:a,visible:!s})}}else v(function(e){return e.visible?{left:0,top:0,width:0,height:0,visible:!1}:e})},[y]);W.useEffect(function(){"reading"===s&&T()},[s,y,h,T]);var A,P,j,O=W.useCallback(function(){if(b.current){for(var e=b.current.getBoundingClientRect(),t=e.top+e.height/2,n=0,r=1/0,o=0;o<w.current.length;o++){var a=w.current[o];if(a){var s=a.getBoundingClientRect(),l=Math.abs(s.top+s.height/2-t);l<r&&(r=l,n=o)}}d(n);var u=w.current[n];if(u){var c=u.getBoundingClientRect();if(c.height>0){var f=Math.max(0,e.top-c.top),p=Math.min(c.height,e.bottom-c.top);g({top:f/c.height*100,height:(p-f)/c.height*100})}}i()}},[i]);return W.useEffect(function(){if("reading"===s){w.current=[],b.current&&(b.current.scrollTop=0);var e=setTimeout(O,250);return function(){clearTimeout(e)}}},[s,f]),a&&0!==a.length?"homepage"===s||"selecting"===s?Pe.jsxs("div",{style:{width:"100%",height:"100%",backgroundColor:"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",gap:48,padding:"48px 64px"},children:[Pe.jsx("style",{children:" .doc-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,0.12) !important; } "}),a.map(function(e,t){var n="selecting"===s&&u===t,r=e.pages[0],o=fu(e.caption||""),i=!!o.remaining,a=i&&0!==t?600:400;return Pe.jsxs("div",{className:"doc-card",onClick:function(){"homepage"===s&&C(t)},style:{flex:"1 1 0",maxWidth:820,height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:24,cursor:"homepage"===s?"pointer":"default",backgroundColor:n?"rgba(130, 160, 255, 0.18)":"transparent",borderRadius:16,padding:"28px 24px",transition:"background-color 0.35s ease, box-shadow 0.25s ease",boxShadow:"0 2px 12px rgba(0,0,0,0.04)"},children:[Pe.jsx("div",{style:{flex:"1 1 0",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},children:r&&Pe.jsx("img",{src:r.url,alt:e.caption||"Document "+(t+1),draggable:!1,style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain",boxShadow:"none"}})}),Pe.jsx("div",{style:{textAlign:"center"},children:e.caption?Pe.jsxs("div",{style:{color:"#333",fontSize:16,lineHeight:1.35,maxWidth:500,margin:"0 auto",paddingLeft:14,paddingRight:14},children:[Pe.jsx("div",{style:{fontWeight:a},children:o.firstLine}),i&&Pe.jsx("div",{style:{marginTop:4,fontWeight:400,whiteSpace:"pre-line"},children:o.remaining})]}):Pe.jsxs("div",{style:{color:"#999",fontSize:13},children:["Document ",t+1]})})]},e.documentIndex)})]}):Pe.jsxs("div",{style:{width:"100%",height:"100%",backgroundColor:"#ffffff",display:"flex",overflow:"hidden"},children:[Pe.jsx("style",{children:" .doc-scroll-panel::-webkit-scrollbar { width: 8px; } .doc-scroll-panel::-webkit-scrollbar-track { background: transparent; } .doc-scroll-panel::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 4px; } .doc-scroll-panel::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); } .doc-home-btn:hover { background-color: rgba(0,0,0,0.65) !important; } "}),Pe.jsxs("div",{style:{flex:"1 1 0",height:"100%",position:"relative",borderRight:"1px solid #e0e0e0"},children:[Pe.jsx("div",{className:"doc-home-btn",onClick:I,style:{position:"absolute",top:36,left:36,zIndex:30,width:48,height:48,borderRadius:24,backgroundColor:"rgba(0,0,0,0.50)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"background-color 200ms",boxShadow:"0 2px 8px rgba(0,0,0,0.2)"},children:Pe.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:Pe.jsx("path",{d:"M3 12L5 10M5 10L12 3L19 10M5 10V20C5 20.55 5.45 21 6 21H9M19 10L21 12M19 10V20C19 20.55 18.55 21 18 21H15M9 21C9.55 21 10 20.55 10 20V16C10 15.45 10.45 15 11 15H13C13.55 15 14 15.45 14 16V20C14 20.55 14.45 21 15 21M9 21H15",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),Pe.jsx("div",{ref:b,className:"doc-scroll-panel",onScroll:O,style:{width:"100%",height:"100%",overflowY:"auto",overflowX:"hidden",touchAction:"pan-y"},children:E.pages.map(function(e,t){return Pe.jsx("div",{ref:function(e){w.current[t]=e},style:{width:"100%"},children:"video"===e.type?Pe.jsx("video",{src:e.url,autoPlay:!0,muted:!1,loop:!0,playsInline:!0,draggable:!1,style:{width:"100%",height:"auto",display:"block",pointerEvents:"none"}}):Pe.jsx("img",{src:e.url,alt:"Page "+(t+1),draggable:!1,loading:t>1?"lazy":"eager",onLoad:0===t?O:void 0,style:{width:"100%",height:"auto",display:"block"}})},e.id+"-"+t)})})]}),Pe.jsxs("div",{style:{width:420,minWidth:420,height:"100%",display:"flex",flexDirection:"column",alignItems:"center",padding:"28px 24px",backgroundColor:"#f5f5f5"},children:[E.sourceLabel&&Pe.jsx("div",{style:{color:"#777",fontSize:11,textAlign:"center",lineHeight:1.5,maxWidth:360},children:E.sourceLabel}),Pe.jsxs("div",{style:{width:"100%",flex:"1 1 0",minHeight:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-start"},children:[Pe.jsxs("div",{ref:k,style:{width:"100%",maxHeight:E.caption?"calc(100% - 44px)":"100%",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},children:[Pe.jsx("img",{ref:x,src:(null==(t=E.pages[h])?void 0:t.url)||(null==(n=E.pages[0])?void 0:n.url),alt:"Page "+(h+1)+" overview",draggable:!1,onLoad:T,style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain",display:"block",border:"1px solid #d0d0d0"}}),m.visible&&Pe.jsx("div",{style:{position:"absolute",left:m.left,top:m.top,width:m.width,height:m.height,border:"2px dashed rgba(200, 40, 60, 0.7)",backgroundColor:"rgba(200, 40, 60, 0.04)",pointerEvents:"none",transition:"top 120ms ease-out, height 120ms ease-out",boxSizing:"border-box"}})]}),E.caption&&(A=fu(E.caption),P=!!A.remaining,j=P&&0!==f?600:400,Pe.jsxs("div",{style:{marginTop:10,color:"#444",fontSize:14,lineHeight:1.35,textAlign:"center",maxWidth:370,paddingLeft:12,paddingRight:12},children:[Pe.jsx("div",{style:{fontWeight:j},children:A.firstLine}),P&&Pe.jsx("div",{style:{marginTop:4,fontWeight:400,whiteSpace:"pre-line"},children:A.remaining})]}))]}),Pe.jsxs("div",{style:{color:"#888",fontSize:13,marginTop:10},children:["Page ",h+1," of ",_]})]})]}):Pe.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:o,color:"#fff",opacity:.4},children:"No documents"})}function hu({mapImageUrl:e,hotspots:t,onInteraction:n}){var r=q.useRef(null),[o,i]=q.useState({scale:1,translateX:0,translateY:0,startDistance:0,startScale:1,startX:0,startY:0,lastTapTime:0}),[a,s]=q.useState(null),c=q.useCallback(function(e){var t=e[0].clientX-e[1].clientX,n=e[0].clientY-e[1].clientY;return Math.sqrt(t*t+n*n)},[]),f=q.useCallback(function(e){if(n(),2===e.touches.length){var t=c(e.touches);i(function(e){return u(l({},e),{startDistance:t,startScale:e.scale})})}else if(1===e.touches.length){var r=Date.now(),a=r-o.lastTapTime;i(a<300&&a>0?function(e){var t=1===e.scale?2:1;return u(l({},e),{scale:t,translateX:1===t?0:e.translateX,translateY:1===t?0:e.translateY,lastTapTime:0})}:function(t){return u(l({},t),{startX:e.touches[0].clientX-t.translateX,startY:e.touches[0].clientY-t.translateY,lastTapTime:r})})}},[n,c,o.lastTapTime]),p=q.useCallback(function(e){if(e.preventDefault(),n(),2===e.touches.length){var t=c(e.touches)/o.startDistance*o.startScale;t=Math.max(1,Math.min(3,t)),i(function(e){return u(l({},e),{scale:t})})}else if(1===e.touches.length&&o.scale>1){var a=e.touches[0].clientX-o.startX,s=e.touches[0].clientY-o.startY;if(r.current){var f=r.current.getBoundingClientRect(),p=f.width*(o.scale-1)/2,h=f.height*(o.scale-1)/2;a=Math.max(-p,Math.min(p,a)),s=Math.max(-h,Math.min(h,s))}i(function(e){return u(l({},e),{translateX:a,translateY:s})})}},[n,c,o]),h=q.useCallback(function(e){n(),0===e.touches.length&&i(function(e){return u(l({},e),{startDistance:0,startX:0,startY:0})})},[n]),d=q.useCallback(function(e){return function(){n(),s(e)}},[n]),y=q.useCallback(function(){n(),s(null)},[n]),g={position:"absolute",top:0,left:0,width:"100%",height:"100%",transform:"translate("+o.translateX+"px, "+o.translateY+"px) scale("+o.scale+") translateZ(0)",transition:0===o.startDistance?"transform 0.3s ease-out":"none"},m={position:"absolute",bottom:a?0:"-100%",left:0,right:0,backgroundColor:"rgba(0, 0, 0, 0.95)",color:"#fff",padding:"32px",transition:"bottom 0.4s ease-out",maxHeight:"40%",overflowY:"auto",zIndex:1e3,transform:"translateZ(0)"};return Pe.jsxs("div",{ref:r,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",touchAction:"none",backgroundColor:"#000"},onTouchStart:f,onTouchMove:p,onTouchEnd:h,children:[Pe.jsxs("div",{style:g,children:[Pe.jsx("img",{src:e,alt:"Navigation Map",style:{display:"block",width:"100%",height:"100%",objectFit:"contain",pointerEvents:"none"}}),t.map(function(e){var t="you-are-here"===e.id,n={position:"absolute",left:e.x+"%",top:e.y+"%",width:e.width+"%",height:e.height+"%",backgroundColor:t?"transparent":"rgba(255, 200, 50, 0.3)",border:t?"none":"2px solid rgba(255, 200, 50, 0.6)",borderRadius:"8px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontSize:"16px",fontWeight:"bold",textShadow:"0 2px 4px rgba(0, 0, 0, 0.8)",transition:"background-color 0.2s",transform:"translateZ(0)",pointerEvents:"auto"};return t?Pe.jsxs("div",{style:n,children:[Pe.jsx("div",{style:{width:"20px",height:"20px",backgroundColor:"#ff0000",borderRadius:"50%",animation:"pulse 2s infinite",boxShadow:"0 0 0 0 rgba(255, 0, 0, 0.7)"}}),Pe.jsx("style",{children:"@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7); } 50% { box-shadow: 0 0 0 15px rgba(255, 0, 0, 0); } }"})]},e.id):Pe.jsx("div",{style:n,onClick:d(e),children:e.label},e.id)})]}),Pe.jsx("div",{style:m,children:a&&Pe.jsxs("div",{children:[Pe.jsx("button",{style:{position:"absolute",top:"16px",right:"16px",width:"56px",height:"56px",backgroundColor:"rgba(255, 255, 255, 0.2)",border:"none",borderRadius:"50%",color:"#fff",fontSize:"28px",fontWeight:"300",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transform:"translateZ(0)",transition:"background-color 150ms ease",WebkitTapHighlightColor:"transparent",userSelect:"none"},onClick:y,"aria-label":"Close",children:"×"}),Pe.jsx("div",{style:{fontSize:"28px",fontWeight:"bold",marginBottom:"16px",paddingRight:"50px"},children:a.label}),a.description&&Pe.jsx("div",{style:{fontSize:"18px",lineHeight:"1.6"},children:a.description})]})})]})}function du(e){var t=e.items,n=e.categories,r=e.selectedCategory,o=e.onItemSelect,i=e.onCategoryChange,a=W.useRef(null);var s=W.useCallback(function(){if(!n||0===n.length)return null;var e=[q.createElement("button",{key:"all",style:c(null===r),onTouchStart:function(e){e.preventDefault(),i(null)},onClick:function(){i(null)}},"All")];return n.forEach(function(t){e.push(q.createElement("button",{key:t,style:c(r===t),onTouchStart:function(e){e.preventDefault(),i(t)},onClick:function(){i(t)}},t))}),q.createElement("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"80px",backgroundColor:"#1a1a1a",display:"flex",alignItems:"center",justifyContent:"center",gap:"16px",padding:"0 32px",zIndex:10,borderBottom:"1px solid #333"}},e)},[n,r,i]);function c(e){return{minWidth:"120px",height:"48px",padding:"0 24px",fontSize:"16px",fontWeight:e?"600":"400",fontFamily:"system-ui, -apple-system, sans-serif",color:e?"#000":"#fff",backgroundColor:e?"#fff":"#333",border:"none",borderRadius:"8px",cursor:"pointer",userSelect:"none",WebkitTapHighlightColor:"transparent",transform:"translateZ(0)",transition:"background-color 200ms ease"}}var f=W.useCallback(function(){if(0===t.length){return q.createElement("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"#666",fontSize:"18px",fontFamily:"system-ui, -apple-system, sans-serif"}},"No media available")}return t.map(function(e){var t,n=function(e){return"video"===e.type?"video":"image"===e.type&&(e.url.toLowerCase().endsWith(".pdf")||e.metadata&&"pdf"===e.metadata.type)?"pdf":"image"}(e);return q.createElement("div",{key:e.id,style:{position:"relative",width:"100%",aspectRatio:"16 / 9",backgroundColor:"#1a1a1a",borderRadius:"8px",overflow:"hidden",cursor:"pointer",userSelect:"none",WebkitTapHighlightColor:"transparent",transform:"translateZ(0)",transition:"transform 150ms ease"},onTouchStart:function(t){t.preventDefault(),o(e.id)},onClick:function(){o(e.id)}},q.createElement("div",{style:(t=e.url,{width:"100%",height:"100%",backgroundImage:"url("+t+")",backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundColor:"#1a1a1a"})}),"video"===n&&q.createElement("div",{style:p("play")}),"pdf"===n&&q.createElement("div",{style:p("pdf")}))})},[t,o]);function p(e){var t={position:"absolute",top:"50%",left:"50%",width:"64px",height:"64px",marginTop:"-32px",marginLeft:"-32px",backgroundColor:"rgba(0, 0, 0, 0.7)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",fontSize:"32px",color:"#fff"};return"play"===e?u(l({},t),{width:0,height:0,backgroundColor:"transparent",borderStyle:"solid",borderWidth:"16px 0 16px 28px",borderColor:"transparent transparent transparent rgba(255, 255, 255, 0.9)",marginTop:"-16px",marginLeft:"-14px"}):t}var h=n&&n.length>0?"80px":"0",d={position:"absolute",top:h,left:0,width:"100%",height:"calc(100% - "+h+")",overflowY:"auto",overflowX:"hidden",WebkitOverflowScrolling:"touch",padding:"32px"};return q.createElement("div",{style:{position:"relative",width:"100%",height:"100%",backgroundColor:"#000"}},s(),q.createElement("div",{ref:a,style:d},q.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:"24px",width:"100%"}},f())))}function yu(e){var t=e.items,n=e.selectedItemId,r=e.onClose,[o,i]=W.useState(!1),[a,s]=W.useState(0),[c,f]=W.useState({scale:1,translateX:0,translateY:0}),p=W.useRef({startX:0,startY:0,currentX:0,currentY:0,isDragging:!1}),h=W.useRef(0),d=W.useRef(null);W.useEffect(function(){var e=t.findIndex(function(e){return e.id===n});e>=0&&s(e),requestAnimationFrame(function(){i(!0)})},[t,n]);var y=t[a];var g=W.useCallback(function(){a<t.length-1&&(s(a+1),f({scale:1,translateX:0,translateY:0}))},[a,t.length]),m=W.useCallback(function(){a>0&&(s(a-1),f({scale:1,translateX:0,translateY:0}))},[a]),v=W.useCallback(function(e){var t=e.touches;if(1===t.length)p.current={startX:t[0].clientX,startY:t[0].clientY,currentX:t[0].clientX,currentY:t[0].clientY,isDragging:!0};else if(2===t.length){var n=t[1].clientX-t[0].clientX,r=t[1].clientY-t[0].clientY,o=Math.sqrt(n*n+r*r);h.current=o}},[]),b=W.useCallback(function(e){var t=e.touches;if(1===t.length&&p.current.isDragging)p.current.currentX=t[0].clientX,p.current.currentY=t[0].clientY;else if(2===t.length){e.preventDefault();var n=t[1].clientX-t[0].clientX,r=t[1].clientY-t[0].clientY,o=Math.sqrt(n*n+r*r),i=(o-h.current)/200,a=Math.max(1,Math.min(4,c.scale+i));f(function(e){return u(l({},e),{scale:a})}),h.current=o}},[c.scale]),w=W.useCallback(function(e){var t=p.current;if(t.isDragging&&0===e.touches.length){var n=t.currentX-t.startX,r=t.currentY-t.startY;Math.abs(n)>50&&Math.abs(n)>2*Math.abs(r)&&(n>0?m():g()),p.current.isDragging=!1}},[g,m]),S=W.useCallback(function(e){e.stopPropagation(),i(!1),setTimeout(function(){r()},300)},[r]),k=W.useCallback(function(){if(!y)return null;var e,t="video"===(e=y).type?"video":"image"===e.type&&(e.url.toLowerCase().endsWith(".pdf")||e.metadata&&"pdf"===e.metadata.type)?"pdf":"image";if("video"===t)return q.createElement("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}},q.createElement(He,{src:y.url,muted:!1,volume:100,fit:"contain",backgroundColor:"#000",loop:!1,autoPlay:!0}));if("image"===t){var n={maxWidth:"100%",maxHeight:"100%",objectFit:"contain",transform:"scale("+c.scale+") translate("+c.translateX+"px, "+c.translateY+"px)",transition:"transform 150ms ease-out",transformOrigin:"center center",userSelect:"none"};return q.createElement("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",position:"relative"}},q.createElement("img",{src:y.url,alt:"",style:n,draggable:!1}))}if("pdf"===t){return q.createElement("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:"16px",color:"#fff",fontFamily:"system-ui, -apple-system, sans-serif"}},q.createElement("div",null,"PDF Document"),q.createElement("a",{href:y.url,target:"_blank",rel:"noopener noreferrer",style:{color:"#fff",textDecoration:"underline",fontSize:"16px",cursor:"pointer"}},"Open PDF"))}return null},[y,c]),x=W.useCallback(function(){return q.createElement("button",{style:{position:"absolute",top:"32px",right:"32px",width:"56px",height:"56px",backgroundColor:"rgba(255, 255, 255, 0.2)",border:"none",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:100,fontSize:"28px",color:"#fff",fontWeight:"300",userSelect:"none",WebkitTapHighlightColor:"transparent",transform:"translateZ(0)",transition:"background-color 150ms ease"},onTouchStart:S,onClick:S},"×")},[S]),E={position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"#000",zIndex:100,opacity:o?1:0,transition:"opacity 300ms ease-in-out",transform:"translateZ(0)"};return q.createElement("div",{ref:d,style:E,onTouchStart:v,onTouchMove:b,onTouchEnd:w},q.createElement("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"}},k()),x())}function gu({content:e,autoScroll:t,autoScrollSpeed:n,inactivityTimeout:r,onInteraction:o,backgroundColor:i,fit:a,resetToFirstFrame:s,isIdle:u}){var c=W.useRef(null),f=W.useRef(null),p=W.useRef(0),h=W.useRef(0),d=W.useRef(0),y=W.useRef([]),g=W.useRef(null),m=W.useRef(null),v=W.useRef(0),b=W.useRef(Date.now()),w=W.useRef(0),S=W.useRef(!1),k=W.useCallback(function(){null!==g.current&&(cancelAnimationFrame(g.current),g.current=null),v.current=0},[]),x=W.useCallback(function(){null!==m.current&&(cancelAnimationFrame(m.current),m.current=null)},[]),E=W.useCallback(function(e){var t=w.current,n=Math.max(0,Math.min(e,t));if(p.current=n,f.current){var r="translateY("+-n+"px) translateZ(0)";f.current.style.transform=r}},[]),_=W.useCallback(function(e){k();var t=e,n=function(){if(t*=.95,Math.abs(t)<.5)g.current=null;else{var e=p.current+t;E(e),g.current=requestAnimationFrame(n)}};g.current=requestAnimationFrame(n)},[k,E]),C=W.useCallback(function(){if(c.current&&f.current){var e=c.current.clientHeight,t=f.current.scrollHeight;w.current=Math.max(0,t-e)}},[]),I=W.useCallback(function(e){if(1===e.touches.length){k(),b.current=Date.now(),o&&o();var t=e.touches[0];h.current=t.clientY,d.current=t.clientY,y.current=[{y:t.clientY,time:Date.now()}]}},[k,o]),T=W.useCallback(function(e){if(1===e.touches.length){e.preventDefault();var t=e.touches[0].clientY,n=d.current-t;d.current=t;var r=p.current+n;E(r);var o=Date.now();y.current.push({y:t,time:o}),y.current=y.current.filter(function(e){return o-e.time<100})}},[E]),A=W.useCallback(function(){var e=y.current;if(e.length<2)y.current=[];else{var t=e[0],n=e[e.length-1],r=n.time-t.time;if(r>0){var o=n.y-t.y;_(-o/r*16)}y.current=[]}},[_]),P=W.useCallback(function(e){S.current=!0,k(),b.current=Date.now(),o&&o(),d.current=e.clientY,y.current=[{y:e.clientY,time:Date.now()}],e.preventDefault()},[k,o]),j=W.useCallback(function(e){if(S.current){var t=e.clientY,n=d.current-t;d.current=t;var r=p.current+n;E(r);var o=Date.now();y.current.push({y:t,time:o}),y.current=y.current.filter(function(e){return o-e.time<100})}},[E]),O=W.useCallback(function(){if(S.current){S.current=!1;var e=y.current;if(e.length>=2){var t=e[0],n=e[e.length-1],r=n.time-t.time;if(r>0){var o=n.y-t.y;_(-o/r*16)}}y.current=[]}},[_]);W.useEffect(function(){return window.addEventListener("mousemove",j),window.addEventListener("mouseup",O),function(){window.removeEventListener("mousemove",j),window.removeEventListener("mouseup",O)}},[j,O]);var R=W.useCallback(function(e){e.preventDefault(),k(),b.current=Date.now(),o&&o();var t=p.current+e.deltaY;E(t)},[k,E,o]);W.useEffect(function(){var e=c.current;if(e)return e.addEventListener("wheel",R,{passive:!1}),function(){null==e||e.removeEventListener("wheel",R)}},[R]);var M=W.useCallback(function(){if(t){x();var e=n/60,o=function(){if(Date.now()-b.current>=r){var t=p.current+e;t>=w.current&&(t=0),E(t)}m.current=requestAnimationFrame(o)};m.current=requestAnimationFrame(o)}},[t,n,r,x,E]);W.useEffect(function(){C();var e=function(){C(),E(p.current)};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[C,E,e]),W.useEffect(function(){return M(),function(){k(),x()}},[M,k,x]),W.useEffect(function(){if(s&&u){k(),x();var e=p.current;if(0!==e){var t=Date.now(),n=function(){var r=Date.now()-t,o=Math.min(r/800,1),i=1-Math.pow(1-o,3);E(e*(1-i)),o<1&&requestAnimationFrame(n)};requestAnimationFrame(n)}}},[u,s,k,x,E]);var L=W.useCallback(function(){var e=w.current;return 0===e?0:p.current/e},[]);W.useEffect(function(){var e=function(){if(c.current){var t=L(),n=c.current.querySelector("[data-progress-bar]");if(n){var r=c.current.clientHeight,o=10+t*(r-.3*r-20);n.style.top=o+"px"}}requestAnimationFrame(e)},t=requestAnimationFrame(e);return function(){cancelAnimationFrame(t)}},[L]);var B=i||"#000",N={width:"100%",height:"100%",position:"relative",overflow:"hidden",backgroundColor:B,touchAction:"none",cursor:"grab"};return Pe.jsxs("div",{ref:c,style:N,onTouchStart:I,onTouchMove:T,onTouchEnd:A,onMouseDown:P,children:[Pe.jsx("div",{ref:f,style:{width:"100%",transform:"translateY(0) translateZ(0)",transformOrigin:"top left"},children:e.map(function(e){var t=e.style||{};switch(e.type){case"heading":return Pe.jsx("div",{style:l({backgroundColor:B,color:"#fff",fontSize:"3rem",fontWeight:"bold",textAlign:"center",padding:"4rem 2rem",fontFamily:"system-ui"},t),children:e.content},e.id);case"text":return Pe.jsx("div",{style:l({backgroundColor:B,color:"#fff",fontSize:"1.25rem",lineHeight:"1.8",padding:"2rem",fontFamily:"system-ui"},t),children:e.content},e.id);case"image":return Pe.jsxs("div",{style:l({backgroundColor:B},t),children:[Pe.jsx("img",{src:e.content,alt:e.caption||"",style:{width:"100%",height:a?"100vh":"auto",display:"block",objectFit:a||void 0}}),e.caption&&Pe.jsx("div",{style:{color:"#aaa",fontSize:"1rem",padding:"1rem 2rem",fontFamily:"system-ui",fontStyle:"italic"},children:e.caption})]},e.id);case"video":return Pe.jsxs("div",{style:l({backgroundColor:B,width:"100%",height:"100vh",position:"relative"},t),children:[Pe.jsx(He,{src:e.content,loop:!0,autoPlay:!0,muted:!1}),e.caption&&Pe.jsx("div",{style:{position:"absolute",bottom:"2rem",left:"2rem",right:"2rem",color:"#fff",fontSize:"1.25rem",padding:"1rem",backgroundColor:"rgba(0, 0, 0, 0.7)",fontFamily:"system-ui"},children:e.caption})]},e.id);default:return null}})}),Pe.jsx("div",{"data-progress-bar":!0,style:{position:"absolute",right:"10px",top:"10px",width:"4px",height:"30%",backgroundColor:"rgba(255, 255, 255, 0.4)",borderRadius:"2px",zIndex:1e3,transition:"top 0.1s linear"}})]})}function mu({textColor:e,showDate:t,dateFormat:n}){var[r,o]=W.useState(new Date);W.useEffect(function(){var e=setInterval(function(){o(new Date)},1e3);return function(){clearInterval(e)}},[]);var i=r.toLocaleTimeString("en-IN",{hour:"2-digit",minute:"2-digit",hour12:!0}),a=t?r.toLocaleDateString("en-IN","short"===n?{day:"numeric",month:"short",year:"numeric"}:{weekday:"long",day:"numeric",month:"long",year:"numeric"}):"";return Pe.jsxs("div",{style:{textAlign:"right",color:e},children:[Pe.jsx("div",{style:{fontSize:"2.5rem",fontWeight:300,lineHeight:1.1,letterSpacing:"-0.02em"},children:i}),t&&Pe.jsx("div",{style:{fontSize:"0.95rem",opacity:.6,marginTop:4},children:a})]})}function vu({slide:e,accentColor:t,textColor:n}){var r=e.backgroundColor||"transparent",o=e.textColor||n;return Pe.jsxs("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:r,color:o,backgroundImage:e.backgroundImageUrl?"url("+e.backgroundImageUrl+")":void 0,backgroundSize:"cover",backgroundPosition:"center",position:"relative"},children:[e.backgroundImageUrl&&Pe.jsx("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(0,0,0,0.5)"}}),Pe.jsxs("div",{style:{position:"relative",zIndex:1,textAlign:"center",padding:"40px 60px"},children:[e.logoUrl&&Pe.jsx("img",{src:e.logoUrl,alt:"",style:{maxHeight:80,maxWidth:280,objectFit:"contain",marginBottom:40}}),Pe.jsx("h1",{style:{fontSize:"4rem",fontWeight:700,lineHeight:1.1,margin:0,letterSpacing:"-0.03em"},children:e.greeting}),e.subtitle&&Pe.jsx("p",{style:{fontSize:"1.5rem",fontWeight:300,marginTop:20,opacity:.75,lineHeight:1.4},children:e.subtitle}),Pe.jsx("div",{style:{width:60,height:3,backgroundColor:t,margin:"36px auto 0",borderRadius:2}})]})]})}function bu({slide:e,textColor:t}){var n=e.textColor||t;return Pe.jsxs("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:e.imageUrl?"row":"column",alignItems:"center",justifyContent:"center",backgroundColor:e.backgroundColor||"transparent",color:n,padding:"50px 60px"},children:[Pe.jsxs("div",{style:{flex:1,maxWidth:e.imageUrl?"55%":"80%"},children:[e.title&&Pe.jsx("h2",{style:{fontSize:"2.2rem",fontWeight:700,lineHeight:1.15,margin:0,letterSpacing:"-0.02em"},children:e.title}),e.body&&Pe.jsx("p",{style:{fontSize:"1.1rem",marginTop:24,opacity:.7,lineHeight:1.8,whiteSpace:"pre-line"},children:e.body})]}),e.imageUrl&&Pe.jsx("div",{style:{flex:1,display:"flex",justifyContent:"center",padding:"0 30px"},children:Pe.jsx("img",{src:e.imageUrl,alt:"",style:{maxWidth:"100%",maxHeight:"70vh",objectFit:"contain",borderRadius:16}})})]})}function wu({slide:e,accentColor:t,textColor:n}){var r=e.timelineItems||[],o=e.textColor||n;return Pe.jsxs("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column",backgroundColor:e.backgroundColor||"transparent",color:o,padding:"50px 60px"},children:[e.title&&Pe.jsx("h2",{style:{fontSize:"2rem",fontWeight:700,marginBottom:8,letterSpacing:"-0.01em"},children:e.title}),Pe.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:4,overflow:"hidden",marginTop:20},children:r.map(function(e,n){var r=e.color||t;return Pe.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"18px 24px",borderRadius:14,backgroundColor:"rgba(255,255,255,0.04)",borderLeft:"4px solid "+r},children:[Pe.jsx("div",{style:{width:40,height:40,borderRadius:10,backgroundColor:r+"20",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:Pe.jsx("div",{style:{width:12,height:12,borderRadius:6,backgroundColor:r}})}),Pe.jsxs("div",{style:{flex:1,marginLeft:20},children:[Pe.jsx("div",{style:{fontSize:"1.15rem",fontWeight:600},children:e.section}),e.description&&Pe.jsx("div",{style:{fontSize:"0.85rem",opacity:.5,marginTop:3},children:e.description})]}),Pe.jsx("div",{style:{fontSize:"1.1rem",fontWeight:600,color:r,backgroundColor:r+"15",padding:"6px 16px",borderRadius:8},children:e.duration})]},n)})})]})}function Su({slide:e,accentColor:t,textColor:n}){return"timeline"===e.type?Pe.jsx(wu,{slide:e,accentColor:t,textColor:n}):Pe.jsx(bu,{slide:e,textColor:n})}function ku({currentState:e,accentColor:t,textColor:n}){return Pe.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[Pe.jsx("div",{style:{width:"welcome"===e?20:8,height:8,borderRadius:4,backgroundColor:"welcome"===e?t:n+"30",transition:"all 400ms ease"}}),Pe.jsx("div",{style:{width:"info"===e?20:8,height:8,borderRadius:4,backgroundColor:"info"===e?t:n+"30",transition:"all 400ms ease"}})]})}const xu={"app01-monophone-audio":Yl,"app01-monophone-audio-multi":Yl,"app02-monophone-video":function(e){var t=Me(),n=e.config,r=n.triggerMode||"hardware",o="hardware"===r||"both"===r,i="touch"===r||"both"===r,a=n.idleType||"image",s="image"===a&&!!n.idleImageUrl,c="video"===a&&!!n.idleVideoUrl,f=Ql({controllerId:n.controllerId,enabled:o}),[p,h]=W.useState(!1),[d,y]=W.useState(!1),[g,m]=W.useState(!1),[v,b]=W.useState(!1),w=W.useRef(null),S=!v&&(o&&f.isPickedUp||i&&g||p),{setStatus:k,setCurrentContent:x}=Gl({deviceId:pe().deviceId,templateType:"video-sync",instanceId:e.instanceId}),E=W.useRef(null),_=W.useRef(null),C=W.useRef(!1),I=W.useRef(!0);W.useEffect(function(){return I.current=!0,function(){I.current=!1,E.current&&(E.current.pause(),E.current.currentTime=0),null!==w.current&&(clearTimeout(w.current),w.current=null)}},[]);var T=W.useCallback(function(){var e=E.current;if(e){var t;e.currentTime=0;try{t=e.play()}catch(n){return}t&&"function"==typeof t.then?t.then(function(){I.current&&(C.current=!0)}).catch(function(e){console.error("[VideoSync] Video play failed:",e)}):C.current=!0}},[]),A=W.useCallback(function(){var e=E.current;e&&(e.pause(),C.current=!1)},[]);W.useEffect(function(){S?(_.current&&_.current.pause(),T()):(C.current&&A(),_.current&&c&&_.current.play().catch(function(){}))},[S,T,A,c]),W.useEffect(function(){S?(k("playing"),x(n.videoUrl)):(k("idle"),x(void 0))},[S,n.videoUrl,k,x]);var P=W.useCallback(function(){k("error"),t.send("error",{type:"playback",message:"Video failed to load: "+n.videoUrl})},[n.videoUrl,k]),j=W.useCallback(function(){C.current=!1,i&&m(!1),h(!1);var e=n.resetDelay||0;e>0&&(b(!0),w.current=setTimeout(function(){w.current=null,I.current&&b(!1)},1e3*e))},[i,n.resetDelay]),O=W.useCallback(function(){i&&m(!g)},[i,g]),R={position:"relative",width:"100%",height:"100%",backgroundColor:n.backgroundColor||"#000",overflow:"hidden",cursor:i?"pointer":"default"},M={position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:n.fit||"cover",transform:"translateZ(0)"},L=n.transitionDuration||600,B=u(l({},M),{opacity:S?0:1,transition:"opacity "+L+"ms ease-in-out",zIndex:2}),N=u(l({},M),{opacity:S?1:0,transition:"opacity "+L+"ms ease-in-out",zIndex:3});return Pe.jsxs("div",{style:R,onClick:O,children:[s&&Pe.jsx("img",{src:n.idleImageUrl,alt:"Idle poster",style:B,draggable:!1}),c&&Pe.jsx("video",{ref:_,src:n.idleVideoUrl,style:B,playsInline:!0,autoPlay:!0,muted:!1,loop:!0,preload:"auto"}),n.titleText&&!S&&Pe.jsx("div",{style:{position:"absolute",bottom:"10%",left:"50%",transform:"translateX(-50%)",zIndex:4,color:"#ffffff",fontSize:"28px",fontWeight:"600",textAlign:"center",textShadow:"0 2px 8px rgba(0,0,0,0.7)",fontFamily:"system-ui, sans-serif",maxWidth:"80%",opacity:S?0:1,transition:"opacity "+L+"ms ease-in-out",pointerEvents:"none"},children:n.titleText}),Pe.jsx("video",{ref:E,src:n.videoUrl,style:N,playsInline:!0,muted:!1,preload:"auto",onError:P,onEnded:j}),n.idle&&Pe.jsx(We,{isIdle:!S,idle:n.idle}),i&&!S&&Pe.jsx("div",{style:{position:"absolute",bottom:"40px",left:"50%",transform:"translateX(-50%)",zIndex:10,color:"rgba(255,255,255,0.7)",fontSize:"14px",fontFamily:"system-ui, sans-serif",textAlign:"center",animation:"pulse 2s ease-in-out infinite",pointerEvents:"none"},children:"Tap to play"}),Pe.jsx(ou,{show:d,onToggle:function(){y(!d)},isTriggered:p,onTrigger:function(){h(!0)},onStop:function(){h(!1)}})]})},"app03-touch-carousel":function(e){var t,n,r,o,i,a,s,l,u,c,f,p,h,d,y,g=Me(),m=e.config,v=m.idle&&m.idle.url,b="slideshow"===m.displayMode,w="document-viewer"===m.displayMode,S=(t={carouselTimeout:1e3*(m.carouselTimeout||5),inactivityTimeout:1e3*(m.inactivityTimeout||30)},n=t&&t.carouselTimeout||5e3,r=t&&t.inactivityTimeout||3e4,o=W.useState(!1),i=o[0],a=o[1],s=W.useState(!0),l=s[0],u=s[1],c=W.useRef(null),f=W.useRef(null),p=W.useRef(!1),h=W.useCallback(function(){c.current&&(clearTimeout(c.current),c.current=null),f.current&&(clearTimeout(f.current),f.current=null)},[]),d=W.useCallback(function(){f.current&&clearTimeout(f.current),f.current=setTimeout(function(){u(!0),f.current=null},r)},[r]),y=W.useCallback(function(){c.current&&clearTimeout(c.current),c.current=setTimeout(function(){p.current?y():(a(!1),c.current=null,d())},n)},[n,d]),{isCarouselVisible:i,isAutoPlaying:l,showCarousel:W.useCallback(function(){h(),a(!0),u(!1),y()},[h,y]),resetCarouselTimer:W.useCallback(function(){y()},[y]),hideCarousel:W.useCallback(function(){h(),a(!1),d()},[h,d]),setTouchActive:W.useCallback(function(e){p.current=e,e||y()},[y])}),k=su({playlistId:m.playlistId,defaultDuration:m.defaultDuration||8,shuffle:m.shuffle||!1,loop:void 0===m.loop||m.loop,autoAdvance:!w&&(!!b||S.isAutoPlaying)}),x=pe().idleTimeout||3e5,E=lu({enabled:Boolean(v),schedule:m.schedule,inactivityTimeout:x,hasContent:k.items.length>0,hasContentError:Boolean(k.error)}),{setStatus:_,setCurrentContent:C}=Gl({deviceId:pe().deviceId,templateType:"slideshow",instanceId:e.instanceId});uu({onPlaylistUpdated:function(e){e===m.playlistId&&k.refresh()}}),W.useEffect(function(){v&&E.isIdle?_("idle"):k.currentItem?(_("playing"),C(k.currentItem.id)):k.isLoading?_("loading"):_("idle")},[v,E.isIdle,k.currentItem,k.isLoading,_,C]),W.useEffect(function(){v&&g.isIdle&&E.deactivate("command")},[g.isIdle]),W.useEffect(function(){v&&!g.isIdle&&E.isIdle&&"command"===E.idleReason&&E.activate()},[g.isIdle]);var I=W.useCallback(function(){(b||S.isAutoPlaying)&&k.onItemComplete()},[S.isAutoPlaying,k.onItemComplete]),T=W.useCallback(function(e){_("error"),g.send("error",{type:"playback",message:e.message})},[_,g]),A=W.useCallback(function(){S.showCarousel()},[S.showCarousel]),P=W.useCallback(function(e){k.goTo(e),S.resetCarouselTimer()},[k.goTo,S.resetCarouselTimer]),j=W.useCallback(function(){v&&E.activate()},[v,E]);if(k.isLoading)return null;var O=m.fit||"cover",R=m.backgroundColor||"#000";if(w)return 0===k.items.length?null:Pe.jsxs("div",{style:{position:"relative",width:"100%",height:"100%"},children:[Pe.jsx(pu,{items:k.items,backgroundColor:R,fit:O,onActivity:j}),v&&m.idle&&Pe.jsx(We,{isIdle:E.isIdle,idle:m.idle})]});if(!k.currentItem)return null;var M=k.currentItem;return Pe.jsxs("div",{style:{position:"relative",width:"100%",height:"100%"},children:[Pe.jsx("div",{style:{width:"100%",height:"100%"},onTouchStart:b?void 0:A,onMouseDown:b?void 0:A,children:Pe.jsx(au,{contentKey:M.id+"-"+k.currentIndex,transition:m.transition||"fade",transitionDuration:m.transitionDuration||800,children:"video"===M.type?Pe.jsx(He,{src:M.url,muted:!1,fit:O,backgroundColor:R,loop:!1,autoPlay:!0,onEnded:I,onError:T}):Pe.jsx(iu,{src:M.url,fit:O,backgroundColor:R})})}),v&&m.idle&&Pe.jsx(We,{isIdle:E.isIdle,idle:m.idle}),!b&&Pe.jsx(cu,{items:k.items,currentIndex:k.currentIndex,isVisible:S.isCarouselVisible,thumbSize:m.carouselHeight||80,onThumbnailTap:P,onInteraction:S.resetCarouselTimer,onTouchActiveChange:S.setTouchActive})]})},"app04-media-loop":function(e){var t=Me(),n=e.config,r=n.idle&&n.idle.url,o=pe().idleTimeout||3e5,i=lu({enabled:Boolean(r),schedule:n.schedule,inactivityTimeout:o,hasContent:Boolean(n.videoUrl)}),{setStatus:a,setCurrentContent:s}=Gl({deviceId:pe().deviceId,templateType:"video-loop",instanceId:e.instanceId});W.useEffect(function(){r&&i.isIdle?a("idle"):(a("playing"),s(n.videoUrl))},[r,i.isIdle,n.videoUrl,a,s]),W.useEffect(function(){r&&t.isIdle&&i.deactivate("command")},[t.isIdle]),W.useEffect(function(){r&&!t.isIdle&&i.isIdle&&"command"===i.idleReason&&i.activate()},[t.isIdle]);var l=W.useCallback(function(e){a("error"),t.send("error",{type:"playback",message:e.message})},[a,t]);return Pe.jsxs("div",{style:{position:"relative",width:"100%",height:"100%"},children:[Pe.jsx(He,{src:n.videoUrl,muted:!1,volume:void 0!==n.volume?n.volume:100,fit:n.fit||"cover",backgroundColor:n.backgroundColor||"#000",loop:!0,autoPlay:!0,onError:l}),r&&n.idle&&Pe.jsx(We,{isIdle:i.isIdle,idle:n.idle})]})},"app05-interactive-map":function(e){Me();var t=e.config,n=lu({enabled:!0,inactivityTimeout:t.inactivityTimeout});Gl({deviceId:pe().deviceId,templateType:"nav-map",instanceId:e.instanceId});var r=W.useCallback(function(){n.resetInactivityTimer()},[n.resetInactivityTimer]);return Pe.jsxs("div",{style:{position:"relative",width:"100%",height:"100%"},children:[Pe.jsx(hu,{mapImageUrl:t.mapImageUrl,hotspots:t.hotspots,onInteraction:r}),t.idle&&Pe.jsx(We,{isIdle:n.isIdle,idle:t.idle})]})},"app06-media-browser":function(e){Me();var t=e.config,[n,r]=W.useState(null),[o,i]=W.useState(null),a=su({playlistId:t.playlistId,defaultDuration:5,shuffle:!1,loop:!1,enabled:!0}),s=lu({enabled:!0,inactivityTimeout:t.inactivityTimeout,hasContent:a.items.length>0,hasContentError:null!==a.error}),l=Gl({deviceId:t.deviceId,templateType:t.templateType,instanceId:t.instanceId,enabled:!0});uu({enabled:!0,onPlaylistUpdated:function(e){e===t.playlistId&&a.refresh()}}),W.useEffect(function(){s.isIdle?l.setStatus("idle"):a.isLoading?l.setStatus("loading"):a.error?l.setStatus("error"):l.setStatus("playing")},[s.isIdle,a.isLoading,a.error]),W.useEffect(function(){n?l.setCurrentContent(n):l.setCurrentContent(void 0)},[n]);var u=a.items;o&&(u=a.items.filter(function(e){return(e.metadata&&e.metadata.category)===o}));var c=W.useCallback(function(e){r(e),s.resetInactivityTimer()},[s]),f=W.useCallback(function(){r(null),s.resetInactivityTimer()},[s]),p=W.useCallback(function(e){i(e),s.resetInactivityTimer()},[s]);if(a.error){return q.createElement("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"#000",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"18px",fontFamily:"system-ui, -apple-system, sans-serif"}},"Failed to load media gallery")}if(a.isLoading){return q.createElement("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"#000",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"18px",fontFamily:"system-ui, -apple-system, sans-serif"}},"Loading media...")}return q.createElement("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"#000",overflow:"hidden"}},q.createElement(du,{items:u,categories:t.categories,selectedCategory:o,onItemSelect:c,onCategoryChange:p}),n&&q.createElement(yu,{items:a.items,selectedItemId:n,onClose:f}),q.createElement(We,{isIdle:s.isIdle,idle:t.idle}))},proximity:function(e){var t=Me(),n=e.config,r=n.triggerMode||"hardware",o="hardware"===r||"both"===r,i="touch"===r||"both"===r,a=function(e){var t=e.controllerId,n=void 0===e.enabled||e.enabled,r=e.activationDistance||100,o=e.deactivationDelay||3e3,[i,a]=W.useState(!1),[s,l]=W.useState(null),u=W.useRef(null),c=$l({controllerId:t,enabled:n});return W.useEffect(function(){if(c.lastEvent){var e=c.lastEvent;if("proximity:enter"===e.type){var t=void 0!==e.distance?e.distance:0;l(t),t<=r&&(null!==u.current&&(clearTimeout(u.current),u.current=null),a(!0))}else"proximity:leave"===e.type&&(l(null),null!==u.current&&clearTimeout(u.current),u.current=setTimeout(function(){a(!1),u.current=null},o))}},[c.lastEvent,r,o]),W.useEffect(function(){return function(){null!==u.current&&clearTimeout(u.current)}},[]),{isPresent:i,distance:s,isConnected:c.isConnected}}({controllerId:n.controllerId,activationDistance:n.activationDistance,deactivationDelay:n.deactivationDelay,enabled:o}),[s,l]=W.useState(!1),u=o&&a.isPresent||i&&s,c=su({playlistId:n.playlistId||"",defaultDuration:5,shuffle:!1,loop:!0,enabled:"slideshow"===n.contentType}),{setStatus:f,setCurrentContent:p}=Gl({deviceId:pe().deviceId,templateType:"proximity",instanceId:e.instanceId});uu({onPlaylistUpdated:function(e){"slideshow"===n.contentType&&e===n.playlistId&&c.refresh()}}),W.useEffect(function(){u?(f("playing"),"video"===n.contentType&&n.videoUrl?p(n.videoUrl):"image"===n.contentType&&n.imageUrl?p(n.imageUrl):"slideshow"===n.contentType&&c.currentItem?p(c.currentItem.id):p(void 0)):(f("idle"),p(void 0))},[u,n.contentType,n.videoUrl,n.imageUrl,c.currentItem,f,p]);var h=W.useCallback(function(){i&&!o&&l(!1)},[i,o]),d=W.useCallback(function(e){f("error"),t.send("error",{type:"playback",message:e.message})},[f]),y=W.useCallback(function(){c.onItemComplete()},[c.onItemComplete]),g=W.useCallback(function(){i&&l(function(e){return!e})},[i]),m={position:"relative",width:"100%",height:"100%",backgroundColor:n.backgroundColor||"#000",overflow:"hidden",transform:"translateZ(0)",cursor:i?"pointer":"default"},v={position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:u?1:0,transition:"opacity 600ms ease-in-out",pointerEvents:u?"auto":"none",zIndex:u?5:1,transform:"translateZ(0)"};return Pe.jsxs("div",{style:m,onClick:g,children:[Pe.jsx("div",{style:v,children:function(){if("video"===n.contentType&&n.videoUrl)return Pe.jsx(He,{src:n.videoUrl,muted:!1,fit:n.fit||"cover",backgroundColor:n.backgroundColor||"#000",loop:!0,autoPlay:!0,onEnded:h,onError:d});if("image"===n.contentType&&n.imageUrl)return Pe.jsx(iu,{src:n.imageUrl,fit:n.fit||"cover",backgroundColor:n.backgroundColor||"#000"});if("slideshow"===n.contentType&&c.currentItem){var e=c.currentItem;return Pe.jsx(au,{contentKey:e.id+"-"+c.currentIndex,transition:"fade",transitionDuration:500,children:"video"===e.type?Pe.jsx(He,{src:e.url,muted:!1,fit:n.fit||"cover",backgroundColor:n.backgroundColor||"#000",loop:!1,autoPlay:!0,onEnded:y,onError:d}):Pe.jsx(iu,{src:e.url,fit:n.fit||"cover",backgroundColor:n.backgroundColor||"#000"})})}return null}()}),n.idle&&Pe.jsx(We,{isIdle:!u,idle:n.idle}),i&&!u&&Pe.jsx("div",{style:{position:"absolute",bottom:"40px",left:"50%",transform:"translateX(-50%)",zIndex:10,color:"rgba(255,255,255,0.7)",fontSize:"14px",fontFamily:"system-ui, sans-serif",textAlign:"center",animation:"pulse 2s ease-in-out infinite",pointerEvents:"none"},children:"Tap to activate"})]})},"touch-scroll":function(e){Me();var t=e.config,n=Boolean(t.playlistId),r=W.useState([]),o=r[0],i=r[1],a=W.useState(!n),s=a[0],l=a[1],u=W.useState(null),c=u[0],p=u[1],h=su({playlistId:t.playlistId||"",defaultDuration:0,shuffle:!1,loop:!1,enabled:n,autoAdvance:!1}),d=lu({enabled:Boolean(t.idle&&t.idle.url||t.resetToFirstFrame),inactivityTimeout:t.inactivityTimeout||3e4,hasContent:n?h.items.length>0:o.length>0,hasContentError:n?Boolean(h.error):null!==c}),{setStatus:y}=Gl({deviceId:pe().deviceId,templateType:"touch-scroll",instanceId:e.instanceId}),g=W.useCallback(function(){return f(this,null,function*(){if(!n&&t.contentUrl)try{l(!0),p(null);var e=yield we(t.contentUrl,{method:"GET",headers:{"Content-Type":"application/json"}},1e4);if(!e.ok)throw new Error("Failed to fetch content: "+e.status);var r=yield e.json();if(!Array.isArray(r))throw new Error("Invalid content format");i(r)}catch(a){var o=a instanceof Error?a.message:"Failed to load content";p(o)}finally{l(!1)}})},[t.contentUrl,n]);W.useEffect(function(){n||g()},[g,n]);var m=[];n&&(m=h.items.map(function(e,t){return{id:e.id||String(t),type:"video"===e.type?"video":"image",content:e.url,caption:void 0}}));var v=n?m:o,b=n?h.isLoading:s,w=n?Boolean(h.error):null!==c,S=n?h.error?h.error.message:"":c||"";return uu({onPlaylistUpdated:function(e){n&&e===t.playlistId&&h.refresh()},onConfigUpdated:function(){n||g()}}),W.useEffect(function(){y(b?"loading":w?"error":"playing")},[b,w,y]),b?Pe.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:t.backgroundColor||"#000",color:"#fff",fontSize:"2rem",fontFamily:"system-ui"},children:"Loading content..."}):w?Pe.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:t.backgroundColor||"#000",color:"#f44",fontSize:"1.5rem",fontFamily:"system-ui",textAlign:"center",padding:"2rem"},children:Pe.jsxs("div",{children:[Pe.jsx("div",{style:{marginBottom:"1rem"},children:"Error loading content"}),Pe.jsx("div",{style:{fontSize:"1rem",color:"#aaa"},children:S})]})}):Pe.jsxs("div",{style:{width:"100%",height:"100%",position:"relative",overflow:"hidden"},children:[Pe.jsx(gu,{content:v,autoScroll:t.autoScroll,autoScrollSpeed:t.autoScrollSpeed,inactivityTimeout:t.inactivityTimeout||3e4,onInteraction:d.resetInactivityTimer,backgroundColor:t.backgroundColor,fit:t.fit,resetToFirstFrame:t.resetToFirstFrame,isIdle:d.isIdle}),t.idle&&t.idle.url&&Pe.jsx(We,{isIdle:d.isIdle,idle:t.idle})]})},"multi-screen":function(e){Me();var t=e.config,n=t.exhibitId,r=t.screenIndex,o=t.totalScreens,i=t.contentType,a=t.videoUrl||"",s=t.imageUrl||"",l=t.playlistId||"",u=t.fit||"cover",c=t.backgroundColor||"#000",f=function(e){var t=e.exhibitId,n=e.screenIndex,r=e.enabled,o=0===n,i=W.useRef(null),a=W.useRef(new Set),s=W.useCallback(function(e,i){if(r&&o){var a={exhibitId:t,screenIndex:n,action:e,data:i,timestamp:Date.now()};xe.send("exhibit:sync",a)}},[r,o,t,n]);return W.useEffect(function(){if(r&&!o){var e=function(e){var n=e.payload;if(n&&n.exhibitId===t){var r={action:n.action||"",data:n.data||{},timestamp:n.timestamp||Date.now(),screenIndex:n.screenIndex||0};i.current=r,a.current.forEach(function(e){try{e(r)}catch(t){console.error("[ExhibitSync] Handler error:",t)}})}};return xe.on("exhibit:sync",e),function(){xe.off("exhibit:sync",e)}}},[r,o,t]),{isLeader:o,lastSync:i.current,sendSync:s}}({exhibitId:n,screenIndex:r,enabled:!0}),p=f.isLeader,h=f.sendSync,d=f.lastSync,y=W.useState(!1),g=y[0],m=y[1];W.useEffect(function(){"1"===new URLSearchParams(window.location.search).get("debug")&&m(!0)},[]);var v=W.useState(0),b=v[0],w=v[1],S=su({playlistId:l,defaultDuration:5,shuffle:!1,loop:!0,enabled:"slideshow"===i}),k=S.currentIndex,x=S.currentItem,E=S.goTo,_=S.onItemComplete;uu({onPlaylistUpdated:function(e){"slideshow"===i&&e===l&&S.refresh()}});var C=Gl({deviceId:t.deviceId,templateType:"multi-screen",instanceId:e.instanceId});W.useEffect(function(){C.setStatus("playing"),C.setCurrentContent("video"===i?a:"image"===i?s:l)},[i,a,s,l,C]),W.useEffect(function(){if(p){var e=setInterval(function(){if("video"===i){var e=document.querySelector("video");e&&h("state-update",{isPlaying:!e.paused,currentTime:e.currentTime})}else"slideshow"===i&&h("state-update",{currentIndex:k})},5e3);return function(){clearInterval(e)}}},[p,i,h,k]),W.useEffect(function(){p&&"slideshow"===i&&h("transition",{currentIndex:k})},[p,i,h,k]),W.useEffect(function(){if(!p&&d){var e=d.action,t=d.data;if("video"===i){var n=document.querySelector("video");if(!n)return;if("play"===e)try{n.play()}catch(r){}else if("pause"===e)n.pause();else if("seek"===e&&"number"==typeof t.currentTime)n.currentTime=t.currentTime;else if("state-update"===e&&("number"==typeof t.currentTime&&Math.abs(n.currentTime-t.currentTime)>.5&&(n.currentTime=t.currentTime),"boolean"==typeof t.isPlaying))if(t.isPlaying&&n.paused)try{n.play()}catch(r){}else t.isPlaying||n.paused||n.pause();w(Date.now())}else"slideshow"===i&&("transition"!==e&&"state-update"!==e||"number"!=typeof t.currentIndex||t.currentIndex===k||E(t.currentIndex),w(Date.now()))}},[p,d,i,k,E]);var I={position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:c,overflow:"hidden"},T="Not synced";return b>0&&(T="Synced "+Math.floor((Date.now()-b)/1e3)+"s ago"),Pe.jsxs("div",{style:I,children:["video"===i&&a&&Pe.jsx(He,{src:a,muted:!1,fit:u,backgroundColor:c,loop:!0,autoPlay:!0}),"image"===i&&s&&Pe.jsx(iu,{src:s,fit:u,backgroundColor:c}),"slideshow"===i&&x&&("image"===x.type?Pe.jsx(au,{contentKey:x.id,transition:"fade",transitionDuration:500,children:Pe.jsx(iu,{src:x.url,fit:u,backgroundColor:c})}):Pe.jsx(He,{src:x.url,muted:!1,fit:u,backgroundColor:c,loop:!1,autoPlay:!0,onEnded:_},x.id)),!i&&Pe.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"#666"},children:"No content configured"}),g&&Pe.jsxs("div",{style:{position:"fixed",bottom:"20px",right:"20px",padding:"12px 16px",backgroundColor:"rgba(0, 0, 0, 0.8)",color:"#fff",fontSize:"14px",fontFamily:"monospace",borderRadius:"4px",zIndex:9999,pointerEvents:"none"},children:[Pe.jsxs("div",{children:["Screen: ",r+1," / ",o]}),Pe.jsxs("div",{children:["Role: ",p?"Leader":"Follower"]}),Pe.jsxs("div",{children:["Exhibit: ",n]}),Pe.jsxs("div",{children:["Content: ",i]}),!p&&Pe.jsxs("div",{children:["Sync: ",T]})]})]})},"custom06-reception-program":function(e){var t=Me(),n=e.config,r=n.screenIndex||0,o=n.screens||[],i=o.find(function(e){return e.screenIndex===r})||o[0],a=i&&i.welcomeSlides||[],s=i&&i.infoSlides||[],l=1e3*(n.welcomeSlideDuration||8),u=1e3*(n.infoSlideDuration||10),c=1e3*(n.stateCycleDuration||30),f=n.backgroundColor||"#0f172a",p=n.accentColor||"#3b82f6",h=n.textColor||"#ffffff",d=!1!==n.showClock,y=!1!==n.showDate,g=n.dateFormat||"long",m=n.idle&&n.idle.url,[v,b]=W.useState("welcome"),[w,S]=W.useState(0),k=W.useRef(null),x=W.useRef(null),E=lu({enabled:Boolean(m),schedule:n.schedule,inactivityTimeout:pe().idleTimeout||3e5,hasContent:a.length>0||s.length>0,hasContentError:!1}),{setStatus:_,setCurrentContent:C}=Gl({deviceId:pe().deviceId,templateType:"custom06-reception-program",instanceId:e.instanceId});if(uu({}),W.useEffect(function(){var e=a.length>0,t=s.length>0;if(e||t)if(e){if(t)return k.current=setTimeout(function(){b(function(e){return"welcome"===e?"info":"welcome"}),S(0)},c),function(){k.current&&clearTimeout(k.current)};b("welcome")}else b("info")},[v,c,a.length,s.length]),W.useEffect(function(){var e="welcome"===v?a:s;if(!(e.length<=1)){var t="welcome"===v?l:u;return x.current=setInterval(function(){S(function(t){return(t+1)%e.length})},t),function(){x.current&&clearInterval(x.current)}}},[v,a.length,s.length,l,u]),W.useEffect(function(){m&&E.isIdle?_("idle"):a.length>0||s.length>0?(_("playing"),C(v+"-"+w)):_("idle")},[m,E.isIdle,v,w,a.length,s.length,_,C]),W.useEffect(function(){m&&t.isIdle&&E.deactivate("command")},[t.isIdle]),0===a.length&&0===s.length)return Pe.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:f,color:h,fontFamily:"system-ui, sans-serif"},children:Pe.jsxs("div",{style:{textAlign:"center",opacity:.4},children:[Pe.jsxs("div",{style:{fontSize:"1.5rem",fontWeight:300},children:["Screen ",r+1]}),Pe.jsx("div",{style:{fontSize:"0.9rem",marginTop:8},children:"No content configured — update via admin panel"})]})});var I="welcome"===v?a:s,T=w<I.length?w:0,A=I[T];return Pe.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",backgroundColor:f,fontFamily:"system-ui, -apple-system, sans-serif",overflow:"hidden"},children:[Pe.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,zIndex:10,display:"flex",alignItems:"center",justifyContent:"space-between",padding:"24px 40px"},children:[Pe.jsx("div",{style:{display:"flex",alignItems:"center",gap:16},children:n.logoUrl&&Pe.jsx("img",{src:n.logoUrl,alt:"",style:{height:36,objectFit:"contain"}})}),d&&Pe.jsx(mu,{textColor:h,showDate:y,dateFormat:g})]}),Pe.jsx(au,{contentKey:v+"-"+T+"-"+((null==A?void 0:A.id)||""),transition:n.transition||"fade",transitionDuration:n.transitionDuration||800,children:Pe.jsx("div",{style:{width:"100%",height:"100%",paddingTop:90},children:"welcome"===v&&A?Pe.jsx(vu,{slide:A,accentColor:p,textColor:h}):A?Pe.jsx(Su,{slide:A,accentColor:p,textColor:h}):null})}),Pe.jsxs("div",{style:{position:"absolute",bottom:0,left:0,right:0,zIndex:10,padding:"16px 40px",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Pe.jsx("div",{style:{fontSize:"0.8rem",color:h,opacity:.35},children:n.footerText||""}),Pe.jsx(ku,{currentState:v,accentColor:p,textColor:h})]}),m&&n.idle&&Pe.jsx(We,{isIdle:E.isIdle,idle:n.idle})]})},"custom07-osc":function(e){var t,n;const r=e.config,o=W.useRef(null),i=W.useRef(!1),a=W.useRef(!0),[s,l]=W.useState(!1),{setStatus:u}=Gl({deviceId:pe().deviceId,templateType:"custom07-osc",instanceId:e.instanceId}),c=W.useCallback(()=>{const e=o.current;e&&!i.current&&(i.current=!0,l(!0),u("playing"),e.currentTime=0,e.play().catch(()=>{i.current=!1,l(!1),u("idle")}))},[u]);!function(e){const t=W.useRef(e.onTrigger);t.current=e.onTrigger,W.useEffect(()=>{if(!e.enabled)return;let n=null,r=!1;return function e(){try{n=new WebSocket("ws://127.0.0.1:3402"),n.onmessage=e=>{try{const n=JSON.parse(e.data);if("hardware:event"!==n.type||!n.payload)return;"osc:trigger"===n.payload.type&&t.current()}catch(n){}},n.onclose=()=>{r||setTimeout(e,2e3)}}catch(o){}}(),()=>{r=!0,null==n||n.close()}},[e.enabled])}({enabled:"osc"===r.inputSource,onTrigger:c}),W.useEffect(()=>{const e=o.current;if(!e)return;const t=()=>{a.current&&(l(!1),u("idle"),e.currentTime=0,i.current=!1)};return e.addEventListener("ended",t),()=>e.removeEventListener("ended",t)},[u]),W.useEffect(()=>{const e=o.current;e&&r.videoUrl&&(e.preload="auto",e.src=r.videoUrl,e.load())},[r.videoUrl]),W.useEffect(()=>(a.current=!0,u("idle"),()=>{a.current=!1}),[u]);const f=r.idleImageUrl||(null==(t=r.idle)?void 0:t.imageUrl),p=(null==(n=r.idle)?void 0:n.enabled)?r.idle.videoUrl?{type:"video",url:r.idle.videoUrl,transitionDuration:800}:r.idle.imageUrl?{type:"image",url:r.idle.imageUrl,transitionDuration:800}:void 0:void 0;return Pe.jsxs("div",{style:{width:"100vw",height:"100vh",background:"#000",overflow:"hidden",cursor:"none",position:"relative"},children:[f&&!s&&Pe.jsx("img",{src:f,alt:"",style:{width:"100%",height:"100%",objectFit:"cover",position:"absolute",top:0,left:0}}),!f&&!s&&p&&Pe.jsx(We,{isIdle:!0,idle:p}),Pe.jsx("video",{ref:o,playsInline:!0,style:{width:"100%",height:"100%",objectFit:"cover",position:"absolute",top:0,left:0,display:s?"block":"none"}})]})}},Eu={};function _u(e){var t,n=(t=e.templateType,Eu[t]||t),r=xu[n];return r?q.createElement(r,{config:e.config,instanceId:e.instanceId}):q.createElement(Oe,{message:"Unknown template type: "+e.templateType})}function Cu(e){var t=window.location.search;if(!t||t.length<2)return"";for(var n=t.substring(1).split("&"),r=0;r<n.length;r++){var o=n[r].split("=");if(decodeURIComponent(o[0])===e)return o.length>1?decodeURIComponent(o[1]):""}return""}var Iu=document.getElementById("root");Iu&&ae.createRoot(Iu).render(q.createElement(q.StrictMode,null,q.createElement(function(){var e=function(){var e=window.location.pathname,t="/display/";if(0===e.indexOf(t)){var n=e.substring(9);return"/"===n.charAt(n.length-1)&&(n=n.substring(0,n.length-1)),n}return""}(),t=Cu("deviceId"),n=Cu("apiKey");t&&n&&ye(t,n);var r,o,i=W.useState((r=he(),o=de(),Boolean(r)&&Boolean(o))),a=i[0],s=i[1],l=W.useCallback(function(){s(!0)},[s]);return e?a?q.createElement(Ne,{children:function(e,t,n){return q.createElement(_u,{config:e,templateType:t,instanceId:n})}}):q.createElement(ze,{slug:e,onProvisioned:l}):q.createElement(Oe,{message:"No device slug in URL.\n\nExpected: /display/{device-slug}\n\nPlease check the URL."})},null)));