@flarehr/superhero-fasttrack-middleware 0.1.1396 → 0.1.1397
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.
|
@@ -26,4 +26,4 @@
|
|
|
26
26
|
* This source code is licensed under the MIT license found in the
|
|
27
27
|
* LICENSE file in the root directory of this source tree.
|
|
28
28
|
*/
|
|
29
|
-
function n(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(!(0<i(o,t)))break e;e[r]=t,e[n]=o,n=r}}function r(e){return 0===e.length?null:e[0]}function o(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,o=e.length,l=o>>>1;r<l;){var a=2*(r+1)-1,u=e[a],s=a+1,c=e[s];if(0>i(u,n))s<o&&0>i(c,u)?(e[r]=c,e[s]=n,r=s):(e[r]=u,e[a]=n,r=a);else{if(!(s<o&&0>i(c,n)))break e;e[r]=c,e[s]=n,r=s}}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var l=performance;t.unstable_now=function(){return l.now()}}else{var a=Date,u=a.now();t.unstable_now=function(){return a.now()-u}}var s=[],c=[],f=1,d=null,p=3,h=!1,m=!1,g=!1,v="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,b=void 0!==e?e:null;function w(e){for(var t=r(c);null!==t;){if(null===t.callback)o(c);else{if(!(t.startTime<=e))break;o(c),t.sortIndex=t.expirationTime,n(s,t)}t=r(c)}}function S(e){if(g=!1,w(e),!m)if(null!==r(s))m=!0,D(E);else{var t=r(c);null!==t&&F(S,t.startTime-e)}}function E(e,n){m=!1,g&&(g=!1,y(O),O=-1),h=!0;var i=p;try{for(w(n),d=r(s);null!==d&&(!(d.expirationTime>n)||e&&!N());){var l=d.callback;if("function"==typeof l){d.callback=null,p=d.priorityLevel;var a=l(d.expirationTime<=n);n=t.unstable_now(),"function"==typeof a?d.callback=a:d===r(s)&&o(s),w(n)}else o(s);d=r(s)}if(null!==d)var u=!0;else{var f=r(c);null!==f&&F(S,f.startTime-n),u=!1}return u}finally{d=null,p=i,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var k,C=!1,x=null,O=-1,T=5,I=-1;function N(){return!(t.unstable_now()-I<T)}function _(){if(null!==x){var e=t.unstable_now();I=e;var n=!0;try{n=x(!0,e)}finally{n?k():(C=!1,x=null)}}else C=!1}if("function"==typeof b)k=function(){b(_)};else if("undefined"!=typeof MessageChannel){var P=new MessageChannel,M=P.port2;P.port1.onmessage=_,k=function(){M.postMessage(null)}}else k=function(){v(_,0)};function D(e){x=e,C||(C=!0,k())}function F(e,n){O=v((function(){e(t.unstable_now())}),n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){m||h||(m=!0,D(E))},t.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"):T=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return r(s)},t.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}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.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}},t.unstable_scheduleCallback=function(e,o,i){var l=t.unstable_now();switch("object"==typeof i&&null!==i?i="number"==typeof(i=i.delay)&&0<i?l+i:l:i=l,e){case 1:var a=-1;break;case 2:a=250;break;case 5:a=1073741823;break;case 4:a=1e4;break;default:a=5e3}return e={id:f++,callback:o,priorityLevel:e,startTime:i,expirationTime:a=i+a,sortIndex:-1},i>l?(e.sortIndex=i,n(c,e),null===r(s)&&e===r(c)&&(g?(y(O),O=-1):g=!0,F(S,i-l))):(e.sortIndex=a,n(s,e),m||h||(m=!0,D(E))),e},t.unstable_shouldYield=N,t.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}}).call(this,n(10).setImmediate)},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(11),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(1))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,l,a,u=1,s={},c=!1,f=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){h(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(h,0,e)}:(l="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(l)&&h(+t.data.slice(l.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),r=function(t){e.postMessage(l+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var o={callback:e,args:t};return s[u]=o,r(u),u++},d.clearImmediate=p}function p(e){delete s[e]}function h(e){if(c)setTimeout(h,0,e);else{var t=s[e];if(t){c=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{p(e),c=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(1),n(12))},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:l}catch(e){r=l}}();var u,s=[],c=!1,f=-1;function d(){c&&u&&(c=!1,u.length?s=u.concat(s):f=-1,s.length&&p())}function p(){if(!c){var e=a(d);c=!0;for(var t=s.length;t;){for(u=s,s=[];++f<t;)u&&u[f].run();f=-1,t=s.length}u=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===l||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function m(){}o.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];s.push(new h(e,t)),1!==s.length||c||a(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";function r(e){return Array.isArray(e)||ArrayBuffer.isView(e)}function o(e){return"function"==typeof e.GetHashCode}function i(e){return null!=e&&"function"==typeof e.Dispose}function l(e,t){return Object.getPrototypeOf(e).constructor===Object.getPrototypeOf(t).constructor}n.r(t),n.d(t,"Msg",(function(){return Dd})),n.d(t,"Msg$reflection",(function(){return Fd})),n.d(t,"State",(function(){return Ld})),n.d(t,"State$reflection",(function(){return Rd})),n.d(t,"StateModule_init",(function(){return jd})),n.d(t,"StateModule_update",(function(){return Ad})),n.d(t,"Component",(function(){return Hd}));class a{constructor(e){this.iter=e}"System.Collections.Generic.IEnumerator`1.get_Current"(){return this.current}"System.Collections.IEnumerator.get_Current"(){return this.current}"System.Collections.IEnumerator.MoveNext"(){const e=this.iter.next();return this.current=e.value,!e.done}"System.Collections.IEnumerator.Reset"(){throw new Error("JS iterators cannot be reset")}Dispose(){}}function u(e){return"function"==typeof e.GetEnumerator?e.GetEnumerator():new a(e[Symbol.iterator]())}function s(e){return{[Symbol.iterator](){return this},next(){const t=e["System.Collections.IEnumerator.MoveNext"]();return{done:!t,value:t?e["System.Collections.IEnumerator.get_Current"]():void 0}}}}class c{constructor(e){this.factory=e,this.isValueCreated=!1}get Value(){return this.isValueCreated||(this.createdValue=this.factory(),this.isValueCreated=!0),this.createdValue}get IsValueCreated(){return this.isValueCreated}}function f(e,t){let n=e.toString(10);for(;n.length<t;)n="0"+n;return n}function d(e){const t=e;return"number"==typeof t.offset?t.offset:1===e.kind?0:-6e4*e.getTimezoneOffset()}function p(e,t){return(e=e<0&&null!=t&&10!==t?4294967295+e+1:e).toString(t)}class h{static id(e){return h.idMap.has(e)||h.idMap.set(e,++h.count),h.idMap.get(e)}}function m(e){let t=0,n=5381;const r=e.length;for(;t<r;)n=33*n^e.charCodeAt(t++);return n}function g(e){return 2654435761*e|0}function v(e){return 0===e.length?0:e.reduce((e,t)=>(e<<5)+e^t)}function y(e){if(null==e)return 0;switch(typeof e){case"boolean":return e?1:0;case"number":return g(e);case"string":return m(e);default:if(o(e))return e.GetHashCode();if(r(e))return function(e){const t=e.length,n=new Array(t);for(let r=0;r<t;r++)n[r]=y(e[r]);return v(n)}(e);if(e instanceof Date)return function(e){return e.getTime()}(e);if(Object.getPrototypeOf(e).constructor===Object){return v(Object.values(e).map(e=>y(e)))}return g(h.id(e))}}function b(e){return null==e?0:o(e)?e.GetHashCode():g(h.id(e))}function w(e,t,n){if(null==e)return null==t;if(null==t)return!1;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function S(e,t){return w(e,t,E)}function E(e,t){return e===t||(null==e?null==t:null!=t&&("object"==typeof e&&(function(e){return"function"==typeof e.Equals}(e)?e.Equals(t):r(e)?r(t)&&S(e,t):e instanceof Date?t instanceof Date&&0===k(e,t):Object.getPrototypeOf(e).constructor===Object&&function(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;n.sort(),r.sort();for(let o=0;o<n.length;o++)if(n[o]!==r[o]||!E(e[n[o]],t[r[o]]))return!1;return!0}(e,t))))}function k(e,t){let n,r;return"offset"in e&&"offset"in t?(n=e.getTime(),r=t.getTime()):(n=e.getTime()+d(e),r=t.getTime()+d(t)),n===r?0:n<r?-1:1}function C(e,t){return e===t?0:e<t?-1:1}function x(e,t){return function(e,t,n){if(null==e)return null==t?0:1;if(null==t)return-1;if(e.length!==t.length)return e.length<t.length?-1:1;for(let r=0,o=0;r<e.length;r++)if(o=n(e[r],t[r]),0!==o)return o;return 0}(e,t,O)}function O(e,t){return e===t?0:null==e?null==t?0:-1:null==t?1:"object"!=typeof e?e<t?-1:1:function(e){return"function"==typeof e.CompareTo}(e)?e.CompareTo(t):r(e)?r(t)?x(e,t):-1:e instanceof Date?t instanceof Date?k(e,t):-1:Object.getPrototypeOf(e).constructor===Object?function(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return n.length<r.length?-1:1;n.sort(),r.sort();for(let o=0,i=0;o<n.length;o++){const l=n[o];if(l!==r[o])return l<r[o]?-1:1;if(i=O(e[l],t[l]),0!==i)return i}return 0}(e,t):-1}function T(e,t,n){return e(t,n)>0?t:n}function I(e){const t={};for(const n of e)t[n[0]]=n[1];return t}h.idMap=new WeakMap,h.count=0;function N(e,t){if(null==t||t.length>1)return t;let n;switch(e){case 2:n=(e,n)=>t(e)(n);break;case 3:n=(e,n,r)=>t(e)(n)(r);break;case 4:n=(e,n,r,o)=>t(e)(n)(r)(o);break;case 5:n=(e,n,r,o,i)=>t(e)(n)(r)(o)(i);break;case 6:n=(e,n,r,o,i,l)=>t(e)(n)(r)(o)(i)(l);break;case 7:n=(e,n,r,o,i,l,a)=>t(e)(n)(r)(o)(i)(l)(a);break;case 8:n=(e,n,r,o,i,l,a,u)=>t(e)(n)(r)(o)(i)(l)(a)(u);break;default:throw new Error("Uncurrying to more than 8-arity is not supported: "+e)}return n.__CURRIED__=t,n}function _(e,t){if(null==t||1===t.length)return t;if("__CURRIED__"in t)return t.__CURRIED__;switch(e){case 2:return e=>n=>t(e,n);case 3:return e=>n=>r=>t(e,n,r);case 4:return e=>n=>r=>o=>t(e,n,r,o);case 5:return e=>n=>r=>o=>i=>t(e,n,r,o,i);case 6:return e=>n=>r=>o=>i=>l=>t(e,n,r,o,i,l);case 7:return e=>n=>r=>o=>i=>l=>a=>t(e,n,r,o,i,l,a);case 8:return e=>n=>r=>o=>i=>l=>a=>u=>t(e,n,r,o,i,l,a,u);default:throw new Error("Currying to more than 8-arity is not supported: "+e)}}function P(e,t,n){if(null!=t){if("__CURRIED__"in t){t=t.__CURRIED__;for(let e=0;e<n.length;e++)t=t(n[e]);return t}switch(e){case 1:return e=>t.apply(void 0,n.concat([e]));case 2:return e=>r=>t.apply(void 0,n.concat([e,r]));case 3:return e=>r=>o=>t.apply(void 0,n.concat([e,r,o]));case 4:return e=>r=>o=>i=>t.apply(void 0,n.concat([e,r,o,i]));case 5:return e=>r=>o=>i=>l=>t.apply(void 0,n.concat([e,r,o,i,l]));case 6:return e=>r=>o=>i=>l=>a=>t.apply(void 0,n.concat([e,r,o,i,l,a]));case 7:return e=>r=>o=>i=>l=>a=>u=>t.apply(void 0,n.concat([e,r,o,i,l,a,u]));case 8:return e=>r=>o=>i=>l=>a=>u=>s=>t.apply(void 0,n.concat([e,r,o,i,l,a,u,s]));default:throw new Error("Partially applying to more than 8-arity is not supported: "+e)}}}function M(e,t){return n=>function e(t,n,r,o){const i=r[o];if(0!==i){const e=i[0],t=i[1];e>1&&(n=_(e,n)),t>1&&(n=N(t,n))}const l=t(n);return o+1===r.length?l:t=>e(l,t,r,o+1)}(e,n,t,0)}function D(e,t=0){if(null!=e&&"object"==typeof e){if("function"==typeof e.toString)return e.toString();if(Symbol.iterator in e)return function(e){let t=0,n="[";for(const r of e){if(0===t)n+=D(r);else{if(100===t){n+="; ...";break}n+="; "+D(r)}t++}return n+"]"}(e);{const n=Object.getPrototypeOf(e).constructor;return n===Object&&t<10?"{ "+Object.entries(e).map(([e,n])=>e+" = "+D(n,t+1)).join("\n ")+" }":n.name}}return String(e)}class F{get name(){return this.cases()[this.tag]}toJSON(){return 0===this.fields.length?this.name:[this.name].concat(this.fields)}toString(){return function(e,t){if(0===t.length)return e;{let n="",r=!0;return 1===t.length?(n=D(t[0]),r=n.indexOf(" ")>=0):n=t.map(e=>D(e)).join(", "),e+(r?" (":" ")+n+(r?")":"")}}(this.name,this.fields)}GetHashCode(){const e=this.fields.map(e=>y(e));return e.splice(0,0,g(this.tag)),v(e)}Equals(e){return this===e||!!l(this,e)&&(this.tag===e.tag&&S(this.fields,e.fields))}CompareTo(e){return this===e?0:l(this,e)?this.tag===e.tag?x(this.fields,e.fields):this.tag<e.tag?-1:1:-1}}function L(e){const t={},n=Object.keys(e);for(let r=0;r<n.length;r++)t[n[r]]=e[n[r]];return t}function R(e){return"{ "+Object.entries(e).map(([e,t])=>e+" = "+D(t)).join("\n ")+" }"}function j(e){return v(Object.values(e).map(e=>y(e)))}function A(e,t){if(e===t)return!0;if(l(e,t)){const n=Object.keys(e);for(let r=0;r<n.length;r++)if(!E(e[n[r]],t[n[r]]))return!1;return!0}return!1}function z(e,t){if(e===t)return 0;if(l(e,t)){const n=Object.keys(e);for(let r=0;r<n.length;r++){const o=O(e[n[r]],t[n[r]]);if(0!==o)return o}return 0}return-1}class U{toJSON(){return L(this)}toString(){return R(this)}GetHashCode(){return j(this)}Equals(e){return A(this,e)}CompareTo(e){return z(this,e)}}class H{constructor(e,t){"function"==typeof t?(this.getter=e,this.setter=t):(this.getter=()=>e,this.setter=t=>{e=t})}get contents(){return this.getter()}set contents(e){this.setter(e)}}class B{constructor(e,t,n,r){this.declaringType=e,this.tag=t,this.name=n,this.fields=r}}class V{constructor(e,t,n,r,o,i,l){this.fullname=e,this.generics=t,this.construct=n,this.parent=r,this.fields=o,this.cases=i,this.enumCases=l}toString(){return re(this)}GetHashCode(){return G(this)}Equals(e){return W(this,e)}}function $(e){return null!=e.generics?e.generics:[]}function G(e){return v([m(e.fullname),...$(e).map(G)])}function W(e,t){return""===e.fullname?""===t.fullname&&w(he(e),he(t),([e,t],[n,r])=>e===n&&W(t,r)):e.fullname===t.fullname&&w($(e),$(t),W)}function q(e,t,n,r){return new V(e,t,n,void 0,r)}function Q(...e){return new V("",void 0,void 0,void 0,()=>e)}function K(e,t,n,r){const o=new V(e,t,n,void 0,void 0,()=>{const e=n.prototype.cases();return r().map((t,n)=>new B(o,n,e[n],t))});return o}function Y(e){return new V("Microsoft.FSharp.Core.FSharpOption`1",[e])}function X(e){return new V("Microsoft.FSharp.Collections.FSharpList`1",[e])}function J(e){return new V(e.fullname+"[]",[e])}const Z=new V("System.Object"),ee=(new V("Microsoft.FSharp.Core.Unit"),new V("System.Char"),new V("System.String")),te=new V("System.Boolean");new V("System.SByte"),new V("System.Byte"),new V("System.Int16"),new V("System.UInt16"),new V("System.Int32"),new V("System.UInt32"),new V("System.Single"),new V("System.Double"),new V("System.Decimal");function ne(e){if(Array.isArray(e))return e[0];if(e instanceof B)return e.name;{const t=e.fullname.lastIndexOf(".");return-1===t?e.fullname:e.fullname.substr(t+1)}}function re(e){const t=null==e.generics||oe(e)?[]:e.generics;return t.length>0?e.fullname+"["+t.map(e=>re(e)).join(",")+"]":e.fullname}function oe(e){return e.fullname.endsWith("[]")}function ie(e){var t;return oe(e)?null===(t=e.generics)||void 0===t?void 0:t[0]:void 0}function le(e){return null!=e.generics&&e.generics.length>0}function ae(e){return null!=e.enumCases&&e.enumCases.length>0}function ue(e){return null==e.generics?e:new V(e.fullname,e.generics.map(()=>Z))}function se(e){var t;return null===(t=e.generics)||void 0===t?void 0:t[0]}function ce(e){if(ae(e)&&null!=e.enumCases)return e.enumCases.map(e=>e[1]);throw new Error(e.fullname+" is not an enum type")}function fe(e,t){if(null!=e.enumCases){if("string"==typeof t){for(const n of e.enumCases)if(n[0]===t)return n;throw new Error(`'${t}' was not found in ${e.fullname}`)}for(const n of e.enumCases)if(n[1]===t)return n;return["",t]}throw new Error(e.fullname+" is not an enum type")}function de(e,t){const n=parseInt(t,10);return fe(e,isNaN(n)?t:n)[1]}function pe(e){if(null!=e.cases)return e.cases();throw new Error(e.fullname+" is not an F# union type")}function he(e){if(null!=e.fields)return e.fields();throw new Error(e.fullname+" is not an F# record type")}function me(e){if(ye(e)&&null!=e.generics)return e.generics;throw new Error(e.fullname+" is not a tuple type")}function ge(e){return e instanceof V?null!=e.cases:e instanceof F}function ve(e){return e instanceof V?null!=e.fields:e instanceof U}function ye(e){return e.fullname.startsWith("System.Tuple")&&!oe(e)}function be(e){return null==e.fields?[]:e.fields}function we(e,t){const n=(e.fields||[]).length;if(t.length!==n)throw new Error(`Expected an array of length ${n} but got ${t.length}`);return null!=e.declaringType.construct?new e.declaringType.construct(e.tag,...t):{}}var Se;function Ee(e,t){switch(t){case 8:return e?[0,255]:[-128,127];case 16:return e?[0,65535]:[-32768,32767];case 32:return e?[0,4294967295]:[-2147483648,2147483647];default:throw new Error("Invalid bit size.")}}function ke(e,t,n){const r=/^\s*([\+\-])?(0[xXoObB])?([0-9a-fA-F]+)\s*$/.exec(e.replace(/_/g,""));if(null!=r){const[,,e,o]=r;if(!function(e){switch(e){case 2:return/[^0-1]/;case 8:return/[^0-7]/;case 10:return/[^0-9]/;case 16:return/[^0-9a-fA-F]/;default:throw new Error("Invalid Base.")}}(n=n||function(e,t){if(t&Se.AllowHexSpecifier)return 16;switch(e){case"0b":case"0B":return 2;case"0o":case"0O":return 8;case"0x":case"0X":return 16;default:return 10}}(e,t)).test(o))return function(e,t){const[,n,r,o]=e;return{sign:n||"",prefix:r||"",digits:o,radix:t}}(r,n)}return null}function Ce(e,t,n,r,o){const i=ke(e,t,o);if(null!=i){let e=Number.parseInt(i.sign+i.digits,i.radix);if(!Number.isNaN(e)){const[t,o]=Ee(!0,r);!n&&10!==i.radix&&e>=t&&e<=o&&(e=e<<32-r>>32-r);const[l,a]=Ee(n,r);if(e>=l&&e<=a)return e}}throw new Error("Input string was not in a correct format.")}function xe(e,t,n,r,o){try{return o.contents=Ce(e,t,n,r),!0}catch(e){return!1}}function Oe(e){return-2147483648===e?e:-e}!function(e){e[e.AllowHexSpecifier=512]="AllowHexSpecifier"}(Se||(Se={}));const Te=Symbol("numeric");function Ie(e){return"number"==typeof e||(null==e?void 0:e[Te])}function Ne(e,t){return"number"==typeof e?e*t:e[Te]().multiply(t)}function _e(e,t){return"number"==typeof e?e.toFixed(t):e[Te]().toFixed(t)}function Pe(e,t){return"number"==typeof e?e.toPrecision(t):e[Te]().toPrecision(t)}function Me(e,t){return"number"==typeof e?e.toExponential(t):e[Te]().toExponential(t)}function De(e){return"number"==typeof e?(Number(e)>>>0).toString(16):e[Te]().toHex()}var Fe=null;try{Fe=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(gu){}function Le(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function Re(e){return!0===(e&&e.__isLong__)}Le.prototype.GetHashCode=function(){let e=this.unsigned?1:0;return e=(e<<5)+e^this.high,e=(e<<5)+e^this.low,e},Le.prototype.Equals=function(e){return st(this,e)},Le.prototype.CompareTo=function(e){return pt(this,e)},Le.prototype.toString=function(e){return it(this,e)},Le.prototype.toJSON=function(){return it(this)},Le.prototype[Te]=function(){const e=this;return{multiply:t=>vt(e,t),toPrecision:t=>String(e)+(0).toPrecision(t).substr(1),toExponential:t=>String(e)+(0).toExponential(t).substr(1),toFixed:t=>String(e)+(0).toFixed(t).substr(1),toHex:()=>it(e.unsigned?e:Ct(kt(e),!0),16)}},Le.prototype.__isLong__,Object.defineProperty(Le.prototype,"__isLong__",{value:!0});var je={},Ae={};function ze(e,t){var n,r,o;return t?(o=0<=(e>>>=0)&&e<256)&&(r=Ae[e])?r:(n=He(e,(0|e)<0?-1:0,!0),o&&(Ae[e]=n),n):(o=-128<=(e|=0)&&e<128)&&(r=je[e])?r:(n=He(e,e<0?-1:0,!1),o&&(je[e]=n),n)}function Ue(e,t){if(isNaN(e))return t?Ye:Ke;if(t){if(e<0)return Ye;if(e>=We)return tt}else{if(e<=-qe)return nt;if(e+1>=qe)return et}return e<0?ht(Ue(-e,t)):He(e%Ge|0,e/Ge|0,t)}function He(e,t,n){return new Le(e,t,n)}var Be=Math.pow;function Ve(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return Ke;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||36<n)throw RangeError("radix");var r=e.indexOf("-");if(r>0)throw Error("interior hyphen");if(0===r)return ht(Ve(e.substring(1),t,n));for(var o=Ue(Be(n,8)),i=Ke,l=0;l<e.length;l+=8){var a=Math.min(8,e.length-l),u=parseInt(e.substring(l,l+a),n);if(a<8)i=mt(vt(i,Ue(Be(n,a))),Ue(u));else i=mt(i=vt(i,o),Ue(u))}return i.unsigned=t,i}function $e(e,t){return"number"==typeof e?Ue(e,t):"string"==typeof e?Ve(e,t):He(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}var Ge=4294967296,We=Ge*Ge,qe=We/2,Qe=ze(1<<24),Ke=ze(0),Ye=ze(0,!0),Xe=ze(1),Je=ze(1,!0),Ze=ze(-1),et=He(-1,2147483647,!1),tt=He(-1,-1,!0),nt=He(0,-2147483648,!1);function rt(e){return e.unsigned?e.low>>>0:e.low}function ot(e){return e.unsigned?(e.high>>>0)*Ge+(e.low>>>0):e.high*Ge+(e.low>>>0)}function it(e,t){if((t=t||10)<2||36<t)throw RangeError("radix");if(lt(e))return"0";if(at(e)){if(st(e,nt)){var n=Ue(t),r=yt(e,n),o=gt(vt(r,n),e);return it(r,t)+rt(o).toString(t)}return"-"+it(ht(e),t)}for(var i=Ue(Be(t,6),e.unsigned),l=e,a="";;){var u=yt(l,i),s=(rt(gt(l,vt(u,i)))>>>0).toString(t);if(lt(l=u))return s+a;for(;s.length<6;)s="0"+s;a=""+s+a}}function lt(e){return 0===e.high&&0===e.low}function at(e){return!e.unsigned&&e.high<0}function ut(e){return 1==(1&e.low)}function st(e,t){return Re(t)||(t=$e(t)),(e.unsigned===t.unsigned||e.high>>>31!=1||t.high>>>31!=1)&&(e.high===t.high&&e.low===t.low)}function ct(e,t){return pt(e,t)<0}function ft(e,t){return pt(e,t)>0}function dt(e,t){return pt(e,t)>=0}function pt(e,t){if(Re(t)||(t=$e(t)),st(e,t))return 0;var n=at(e),r=at(t);return n&&!r?-1:!n&&r?1:e.unsigned?t.high>>>0>e.high>>>0||t.high===e.high&&t.low>>>0>e.low>>>0?-1:1:at(gt(e,t))?-1:1}function ht(e){return!e.unsigned&&st(e,nt)?nt:mt(bt(e),Xe)}function mt(e,t){Re(t)||(t=$e(t));var n=e.high>>>16,r=65535&e.high,o=e.low>>>16,i=65535&e.low,l=t.high>>>16,a=65535&t.high,u=t.low>>>16,s=0,c=0,f=0,d=0;return f+=(d+=i+(65535&t.low))>>>16,c+=(f+=o+u)>>>16,s+=(c+=r+a)>>>16,s+=n+l,He((f&=65535)<<16|(d&=65535),(s&=65535)<<16|(c&=65535),e.unsigned)}function gt(e,t){return Re(t)||(t=$e(t)),mt(e,ht(t))}function vt(e,t){if(lt(e))return e.unsigned?Ye:Ke;if(Re(t)||(t=$e(t)),Fe)return He(Fe.mul(e.low,e.high,t.low,t.high),Fe.get_high(),e.unsigned);if(lt(t))return e.unsigned?Ye:Ke;if(st(e,nt))return ut(t)?nt:Ke;if(st(t,nt))return ut(e)?nt:Ke;if(at(e))return at(t)?vt(ht(e),ht(t)):ht(vt(ht(e),t));if(at(t))return ht(vt(e,ht(t)));if(ct(e,Qe)&&ct(t,Qe))return Ue(ot(e)*ot(t),e.unsigned);var n=e.high>>>16,r=65535&e.high,o=e.low>>>16,i=65535&e.low,l=t.high>>>16,a=65535&t.high,u=t.low>>>16,s=65535&t.low,c=0,f=0,d=0,p=0;return d+=(p+=i*s)>>>16,f+=(d+=o*s)>>>16,d&=65535,f+=(d+=i*u)>>>16,c+=(f+=r*s)>>>16,f&=65535,c+=(f+=o*u)>>>16,f&=65535,c+=(f+=i*a)>>>16,c+=n*s+r*u+o*a+i*l,He((d&=65535)<<16|(p&=65535),(c&=65535)<<16|(f&=65535),e.unsigned)}function yt(e,t){if(Re(t)||(t=$e(t)),lt(t))throw Error("division by zero");var n,r,o;if(Fe)return e.unsigned||-2147483648!==e.high||-1!==t.low||-1!==t.high?He((e.unsigned?Fe.div_u:Fe.div_s)(e.low,e.high,t.low,t.high),Fe.get_high(),e.unsigned):e;if(lt(e))return e.unsigned?Ye:Ke;if(e.unsigned){if(t.unsigned||(t=function(e){return e.unsigned?e:He(e.low,e.high,!0)}(t)),ft(t,e))return Ye;if(ft(t,Et(e,1)))return Je;o=Ye}else{if(st(e,nt))return st(t,Xe)||st(t,Ze)?nt:st(t,nt)?Xe:st(n=wt(yt(St(e,1),t),1),Ke)?at(t)?Xe:Ze:o=mt(n,yt(r=gt(e,vt(t,n)),t));if(st(t,nt))return e.unsigned?Ye:Ke;if(at(e))return at(t)?yt(ht(e),ht(t)):ht(yt(ht(e),t));if(at(t))return ht(yt(e,ht(t)));o=Ke}for(r=e;dt(r,t);){n=Math.max(1,Math.floor(ot(r)/ot(t)));for(var i=Math.ceil(Math.log(n)/Math.LN2),l=i<=48?1:Be(2,i-48),a=Ue(n),u=vt(a,t);at(u)||ft(u,r);)u=vt(a=Ue(n-=l,e.unsigned),t);lt(a)&&(a=Xe),o=mt(o,a),r=gt(r,u)}return o}function bt(e){return He(~e.low,~e.high,e.unsigned)}function wt(e,t){return Re(t)&&(t=rt(t)),0==(t&=63)?e:t<32?He(e.low<<t,e.high<<t|e.low>>>32-t,e.unsigned):He(0,e.low<<t-32,e.unsigned)}function St(e,t){return Re(t)&&(t=rt(t)),0==(t&=63)?e:t<32?He(e.low>>>t|e.high<<32-t,e.high>>t,e.unsigned):He(e.high>>t-32,e.high>=0?0:-1,e.unsigned)}function Et(e,t){if(Re(t)&&(t=rt(t)),0===(t&=63))return e;var n=e.high;return t<32?He(e.low>>>t|n<<32-t,n>>>t,e.unsigned):He(32===t?n:n>>>t-32,0,e.unsigned)}function kt(e,t){return t?function(e){var t=e.high,n=e.low;return[255&n,n>>>8&255,n>>>16&255,n>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]}(e):function(e){var t=e.high,n=e.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,n>>>24,n>>>16&255,n>>>8&255,255&n]}(e)}function Ct(e,t,n){return n?function(e,t){return new Le(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)}(e,t):function(e,t){return new Le(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}(e,t)}const xt=mt,Ot=vt,Tt=yt,It=function(e,t){return Re(t)||(t=$e(t)),Fe?He((e.unsigned?Fe.rem_u:Fe.rem_s)(e.low,e.high,t.low,t.high),Fe.get_high(),e.unsigned):gt(e,vt(yt(e,t),t))},Nt=ht,_t=function(e,t){return Re(t)||(t=$e(t)),He(e.low&t.low,e.high&t.high,e.unsigned)},Pt=pt,Mt=He,Dt=rt,Ft=ot;function Lt(e,t,n){let r=e,o=0;switch(n){case 0:r=e<<24>>24,o=r;break;case 4:r=e<<24>>>24;break;case 1:r=e<<16>>16,o=r;break;case 5:r=e<<16>>>16;break;case 2:r=e>>0,o=r;break;case 6:r=e>>>0}return He(r,o>>31,t)}const Rt=/(?:Z|[+-](\d+):?([0-5]?\d)?)\s*$/;function jt(e){const t=e<0,n=(e=Math.abs(e))%36e5/6e4;return(t?"-":"+")+f(~~(e/36e5),2)+":"+f(n,2)}function At(e,t){const n=e.toISOString();return"first"===t?n.substring(0,n.indexOf("T")):n.substring(n.indexOf("T")+1,n.length-1)}function zt(e,t,n){return t.replace(/(\w)\1*/g,t=>{let r=Number.NaN;switch(t.substring(0,1)){case"y":const o=n?e.getUTCFullYear():e.getFullYear();r=t.length<4?o%100:o;break;case"M":r=(n?e.getUTCMonth():e.getMonth())+1;break;case"d":r=n?e.getUTCDate():e.getDate();break;case"H":r=n?e.getUTCHours():e.getHours();break;case"h":const i=n?e.getUTCHours():e.getHours();r=i>12?i%12:i;break;case"m":r=n?e.getUTCMinutes():e.getMinutes();break;case"s":r=n?e.getUTCSeconds():e.getSeconds();break;case"f":r=n?e.getUTCMilliseconds():e.getMilliseconds()}return Number.isNaN(r)?t:r<10&&t.length>1?"0"+r:""+r})}function Ut(e,t){var n,r,o;const i=new Date(e.getTime()+(null!==(n=e.offset)&&void 0!==n?n:0));if("string"!=typeof t)return i.toISOString().replace(/\.\d+/,"").replace(/[A-Z]|\.\d+/g," ")+jt(null!==(r=e.offset)&&void 0!==r?r:0);if(1!==t.length)return zt(i,t,!0);switch(t){case"D":case"d":return At(i,"first");case"T":case"t":return At(i,"second");case"O":case"o":return function(e,t){const n=e.toISOString();return n.substring(0,n.length-1)+jt(t)}(i,null!==(o=e.offset)&&void 0!==o?o:0);default:throw new Error("Unrecognized Date print format")}}function Ht(e,t){const n=1===e.kind;if("string"!=typeof t)return n?e.toUTCString():e.toLocaleString();if(1!==t.length)return zt(e,t,n);switch(t){case"D":case"d":return n?At(e,"first"):e.toLocaleDateString();case"T":case"t":return n?At(e,"second"):e.toLocaleTimeString();case"O":case"o":return function(e,t){if(t)return e.toISOString();{const t=null==e.kind||2===e.kind;return f(e.getFullYear(),4)+"-"+f(e.getMonth()+1,2)+"-"+f(e.getDate(),2)+"T"+f(e.getHours(),2)+":"+f(e.getMinutes(),2)+":"+f(e.getSeconds(),2)+"."+f(e.getMilliseconds(),3)+(t?jt(-6e4*e.getTimezoneOffset()):"")}}(e,n);default:throw new Error("Unrecognized Date print format")}}function Bt(e,t,n){return null!=e.offset?Ut(e,t):Ht(e,t)}function Vt(e,t){const n=new Date(e);return n.kind=0|(null==t?0:t),n}function $t(e){if(null===e)throw new Error("Value cannot be null when parsing DateTime");if(""===e.trim())throw new Error("An empty string is not recognized as a valid DateTime");let t=new Date(e);if(isNaN(t.getTime())){const n=/^\s*(\d+[^\w\s:]\d+[^\w\s:]\d+)?\s*(\d+:\d+(?::\d+(?:\.\d+)?)?)?\s*([AaPp][Mm])?\s*([+-]\d+(?::\d+)?)?\s*$/.exec(e);if(null==n)throw new Error("The string is not a valid Date.");{let e,r=0;if(null!=n[2]){const e=n[2].split(":");r=3600*parseInt(e[0],10)+60*parseInt(e[1]||"0",10)+parseFloat(e[2]||"0"),null!=n[3]&&"PM"===n[3].toUpperCase()&&(r+=720)}if(null!=n[4]){if(null!=n[1])e=new Date(n[1]+" UTC");else{const t=new Date;e=new Date(t.getUTCFullYear()+"/"+(t.getUTCMonth()+1)+"/"+t.getUTCDate())}const t=n[4].substr(1).split(":");let o=60*parseInt(t[0],10)+parseInt(t[1]||"0",10);"+"===n[4][0]&&(o*=-1),r+=60*o}else if(null!=n[1])e=new Date(n[1]);else{const t=new Date;e=new Date(t.getFullYear()+"/"+(t.getMonth()+1)+"/"+t.getDate())}t=new Date(e.getTime()+1e3*r),t=new Date(t.getTime()+6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))}}return t}function Gt(e,t){try{return t.contents=function(e,t=!1){const n=$t(e),r=Rt.exec(e),o=null!=r?t&&"Z"===r[0]?1:2:0;return Vt(n.getTime(),o)}(e),!0}catch(e){return!1}}function Wt(e,t=0){if(0!=(-276&t))throw new Error("RegexOptions only supports: IgnoreCase, Multiline, Singleline and ECMAScript");let n="g";return n+=1&t?"i":"",n+=2&t?"m":"",n+=16&t?"s":"",new RegExp(e,n)}function qt(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function Qt(e,t,n=0){let r;if(r=e instanceof RegExp?(r=e,e=t,r.lastIndex=n,r):r=Wt(t,n),!r.global)throw new Error("Non-global RegExp");let o=r.exec(e);const i=[];for(;null!==o;)i.push(o),o=r.exec(e);return i}const Kt=/(^|[^%])%([0+\- ]*)(\*|\d+)?(?:\.(\d+))?(\w)/g,Yt=/(?:(^|[^%])%([0+\- ]*)(\d+)?(?:\.(\d+))?(\w))?%P\(\)/g,Xt=/\{(\d+)(,-?\d+)?(?:\:([a-zA-Z])(\d{0,2})|\:(.+?))?\}/g;function Jt(e,t){return function(e,t){return"number"==typeof e?e<t?-1:e>t?1:0:e.CompareTo(t)}(e,t)<0}function Zt(e){return{input:e,cont:(t=e,e=>{Kt.lastIndex=0;const n=[],r=[];let o=0,i=Kt.exec(t);for(;i;){const e=i.index+(i[1]||"").length;n.push(t.substring(o,e).replace(/%%/g,"%")),r.push(i),o=Kt.lastIndex,Kt.lastIndex-=1,i=Kt.exec(t)}return 0===n.length?e(t.replace(/%%/g,"%")):(n.push(t.substring(o).replace(/%%/g,"%")),function e(t,n,r,o="",i=-1){return(...l)=>{let a=o;const u=n.slice(),s=r.slice();for(const e of l){const[,,t,n,r,o]=s[0];let l=n;if(i>=0)l=i,i=-1;else if("*"===l){if(e<0)throw new Error("Non-negative number required");i=e;continue}a+=u[0],a+=on(e,t,l,r,o),u.splice(0,1),s.splice(0,1)}return 0===s.length?(a+=u[0],t(a)):e(t,u,s,a,i)}}(e,n,r))})};var t}function en(e,t){let n=0,r=0,o="";Yt.lastIndex=0;let i=Yt.exec(e);for(;i;){const l=i.index+(i[1]||"").length;o+=e.substring(r,l).replace(/%%/g,"%");const[,,a,u,s,c]=i;o+=on(t[n++],a,u,s,c),r=Yt.lastIndex,Yt.lastIndex-=1,i=Yt.exec(e)}return o+=e.substring(r).replace(/%%/g,"%"),o}function tn(e,t){return"string"==typeof t?e(t):t.cont(e)}function nn(e){return tn(e=>e,e)}function rn(e){return tn(e=>{throw new Error(e)},e)}function on(e,t,n,r,o){let i="";if(t=t||"",o=o||"",Ie(e))switch("x"!==o.toLowerCase()&&(Jt(e,0)?(e=Ne(e,-1),i="-"):t.indexOf(" ")>=0?i=" ":t.indexOf("+")>=0&&(i="+")),r=null==r?null:parseInt(r,10),o){case"f":case"F":e=_e(e,r=null!=r?r:6);break;case"g":case"G":e=null!=r?Pe(e,r):Pe(e);break;case"e":case"E":e=null!=r?Me(e,r):Me(e);break;case"x":e=De(e);break;case"X":e=De(e).toUpperCase();break;default:e=String(e)}else e=e instanceof Date?Bt(e):D(e);if(n="number"==typeof n?n:parseInt(n,10),isNaN(n))e=i+e;else{const r=t.indexOf("0")>=0,o=t.indexOf("-")>=0,l=o||!r?" ":"0";e="0"===l?i+(e=cn(e,n-i.length,l,o)):cn(i+e,n,l,o)}return e}function ln(e,...t){return"object"==typeof e&&t.length>0&&(e=t[0],t.shift()),e.replace(Xt,(e,n,r,o,i,l)=>{let a=t[n];if(Ie(a))switch(i=null==i?null:parseInt(i,10),o){case"f":case"F":a=_e(a,i=null!=i?i:2);break;case"g":case"G":a=null!=i?Pe(a,i):Pe(a);break;case"e":case"E":a=null!=i?Me(a,i):Me(a);break;case"p":case"P":i=null!=i?i:2,a=_e(Ne(a,100),i)+" %";break;case"d":case"D":a=null!=i?cn(String(a),i,"0"):String(a);break;case"x":case"X":a=null!=i?cn(De(a),i,"0"):De(a),"X"===o&&(a=a.toUpperCase());break;default:if(l){let e="";a=l.replace(/(0+)(\.0+)?/,(t,n,r)=>(Jt(a,0)&&(a=Ne(a,-1),e="-"),a=_e(a,null!=r?r.length-1:0),cn(a,(n||"").length-e.length+(null!=r?r.length:0),"0"))),a=e+a}}else a=a instanceof Date?Bt(a,l||o):D(a);return r=parseInt((r||" ").substring(1),10),isNaN(r)||(a=cn(String(a),Math.abs(r)," ",r<0)),a})}function an(e){return"string"!=typeof e||0===e.length}function un(e){return"string"!=typeof e||/^\s*$/.test(e)}function sn(e,t){return Array.isArray(t)?t.join(e):Array.from(t).join(e)}function cn(e,t,n,r){n=n||" ",t-=e.length;for(let o=0;o<t;o++)e=r?e+n:n+e;return e}function fn(e,t,n,r){if(r="number"==typeof r?r:void 0,(n="number"==typeof n?n:void 0)&&n<0)throw new Error("Count cannot be less than zero");if(0===n)return[];if(!Array.isArray(t)){if(0===r)return e.split(t,n);const o=arguments.length;t=Array(o-1);for(let e=1;e<o;e++)t[e-1]=arguments[e]}t=(t=t.map(e=>qt(e))).length>0?t:[" "];let o=0;const i=[],l=new RegExp(t.join("|"),"g");for(;null==n||n>1;){const t=l.exec(e);if(null===t)break;(!r||t.index-o>0)&&(n=null!=n?n-1:n,i.push(e.substring(o,t.index))),o=l.lastIndex}return(!r||e.length-o>0)&&i.push(e.substring(o)),i}function dn(e,t,n){if(t+(n||0)>e.length)throw new Error("Invalid startIndex and/or length");return null!=n?e.substr(t,n):e.substr(t)}class pn{constructor(e){this.value=e}toJSON(){return this.value}toString(){return String(this.value)}GetHashCode(){return y(this.value)}Equals(e){return null!=e&&E(this.value,e instanceof pn?e.value:e)}CompareTo(e){return null==e?1:O(this.value,e instanceof pn?e.value:e)}}function hn(e){return null==e||e instanceof pn?new pn(e):e}function mn(e){if(null==e)throw new Error("Option has no value");return e instanceof pn?e.value:e}function gn(e){return null==e?[]:[mn(e)]}function vn(e,t){return null!=e?mn(e):t}function yn(e,t){return null!=t?hn(e(mn(t))):void 0}function bn(e,t){return"function"==typeof e?new e(t):new Array(t)}function wn(){throw new Error("Arrays had different lengths")}function Sn(e,t,n){const r=0|e.length,o=0|t.length,i=bn(n,r+o);for(let t=0;t<=r-1;t++)i[t]=e[t];for(let e=0;e<=o-1;e++)i[e+r]=t[e];return i}function En(e,t,n,r){const o=0|t;return e.fill(r,o,o+n)}function kn(e,t,n){const r=0|t.length,o=bn(n,r);for(let n=0;n<=r-1;n++)o[n]=e(t[n]);return o}function Cn(e,t,n){if(e<0)throw new Error("The input must be non-negative\\nParameter name: count");const r=bn(n,e);for(let n=0;n<=e-1;n++)r[n]=t(n);return r}function xn(e,t,n){return n.reduce((t,n)=>e(t,n),t)}function On(e,t,n){return 0===function(e,t,n){if(null==t)return null==n?0:-1;if(null==n)return 1;{let r=0,o=0;const i=0|t.length,l=0|n.length;if(i>l)return 1;if(i<l)return-1;for(;r<i&&0===o;)o=0|e(t[r],n[r]),r=r+1|0;return 0|o}}((e,t)=>O(e,t),t,n)}function Tn(e,t,n){return t.reduceRight((t,n)=>e(n,t),n)}function In(e,t,n,r){return function(e,t,n,r){let o=r;t.length!==n.length&&wn();const i=0|t.length;for(let r=1;r<=i;r++)o=e(r-1,t[i-r],n[i-r],o);return o}((t,n,r,o)=>e(n,r,o),t,n,r)}class Nn extends U{constructor(e,t){super(),this.head=e,this.tail=t}toString(){return"["+sn("; ",this)+"]"}Equals(e){const t=this;if(t===e)return!0;return((e,t)=>{e:for(;;){const n=e,r=t,o=[n.tail,r.tail];if(null!=o[0]){if(null!=o[1]){const i=o[0],l=o[1];if(E(n.head,r.head)){e=i,t=l;continue e}return!1}return!1}return null==o[1]}})(t,e)}GetHashCode(){return 0|((e,t,n)=>{for(;;){const r=e,o=t,i=n,l=i.tail;if(null==l)return 0|o;{const a=l;if(r>18)return 0|o;e=r+1,t=(o<<1)+y(i.head)+631*r,n=a}}})(0,0,this)}toJSON(e){return Array.from(this)}CompareTo(e){return 0|((e,t)=>{e:for(;;){const n=e,r=t,o=[n.tail,r.tail];if(null!=o[0]){if(null!=o[1]){const i=o[0],l=o[1],a=0|O(n.head,r.head);if(0===a){e=i,t=l;continue e}return 0|a}return 1}return null!=o[1]?-1:0}})(this,e)}GetEnumerator(){return function(e){return new _n(e)}(this)}[Symbol.iterator](){return s(this.GetEnumerator())}"System.Collections.IEnumerable.GetEnumerator"(){return u(this)}}class _n{constructor(e){this.xs=e,this.it=this.xs,this.current=null}"System.Collections.Generic.IEnumerator`1.get_Current"(){return this.current}"System.Collections.IEnumerator.get_Current"(){return this.current}"System.Collections.IEnumerator.MoveNext"(){const e=this,t=e.it.tail;if(null!=t){const n=t;return e.current=e.it.head,e.it=n,!0}return!1}"System.Collections.IEnumerator.Reset"(){this.it=this.xs,this.current=null}Dispose(){}}function Pn(){return new Nn(null,void 0)}function Mn(e,t){return new Nn(e,t)}function Dn(e){return null==e.tail}function Fn(e){return 0|((e,t)=>{for(;;){const n=e,r=t.tail;if(null==r)return 0|n;e=n+1,t=r}})(0,e)}function Ln(e){if(null!=e.tail)return e.head;throw new Error("List was empty\\nParameter name: list")}function Rn(e){const t=e.tail;if(null!=t)return t;throw new Error("List was empty\\nParameter name: list")}function jn(){return Pn()}function An(e,t){return Mn(e,t)}function zn(e){return Mn(e,Pn())}function Un(e){return Dn(e)}function Hn(e){return Ln(e)}function Bn(e){return Rn(e)}function Vn(e){const t=0|Fn(e),n=En(new Array(t),0,t,null);return((e,t)=>{for(;;){const r=e,o=t;if(Dn(o))break;n[r]=Ln(o),e=r+1,t=Rn(o)}})(0,e),n}function $n(e,t,n){let r=t,o=n;for(;!Dn(o);)r=e(r,Ln(o)),o=Rn(o);return r}function Gn(e){return $n((e,t)=>Mn(t,e),Pn(),e)}function Wn(e,t){$n((t,n)=>{e(n)},void 0,t)}function qn(e,t){let n=t;for(let t=e.length-1;t>=0;t--)n=Mn(e[t],n);return n}function Qn(e){return qn(e,Pn())}function Kn(e){let t,n;if(r(e))return Qn(e);if(e instanceof Nn)return e;{const r=Pn();let o=r;const i=u(e);try{for(;i["System.Collections.IEnumerator.MoveNext"]();){const e=i["System.Collections.Generic.IEnumerator`1.get_Current"]();t=o,n=new Nn(e,void 0),t.tail=n,o=n}}finally{i.Dispose()}const l=o,a=Pn();return l.tail=a,Rn(r)}}function Yn(e,t){return $n((e,t)=>Mn(t,e),t,Gn(e))}function Xn(e,t){const n=Pn(),r=function(e,t,n){return((t,n,r)=>{for(;;){const o=t,i=n,l=r;if(Dn(l))return i;t=o+1,n=e(o,i,Ln(l)),r=Rn(l)}})(0,t,n)}((t,n,r)=>{const o=new Nn(e(t,r),void 0);return n.tail=o,o},n,t),o=Pn();return r.tail=o,Rn(n)}function Jn(e,t){const n=Pn(),r=$n((t,n)=>{const r=new Nn(e(n),void 0);return t.tail=r,r},n,t),o=Pn();return r.tail=o,Rn(n)}function Zn(e,t){return((t,n)=>{for(;;){const r=t,o=n;if(Dn(o))return;if(e(Ln(o)))return r;t=r+1,n=Rn(o)}})(0,t)}function er(e,t,n){return null!=Zn(t=>n.Equals(e,t),t)}class tr{constructor(e=!1){this._id=0,this._cancelled=e,this._listeners=new Map}get isCancelled(){return this._cancelled}cancel(){if(!this._cancelled){this._cancelled=!0;for(const[,e]of this._listeners)e()}}addListener(e){const t=this._id;return this._listeners.set(this._id++,e),t}removeListener(e){return this._listeners.delete(e)}register(e,t){const n=this,r=this.addListener(null==t?e:()=>e(t));return{Dispose(){n.removeListener(r)}}}}class nr extends Error{constructor(){super("The operation was canceled"),Object.setPrototypeOf(this,nr.prototype)}}class rr{constructor(){this.callCount=0}static get maxTrampolineCallCount(){return 2e3}incrementAndCheck(){return this.callCount++>rr.maxTrampolineCallCount}hijack(e){this.callCount=0,setTimeout(e,0)}}function or(e){return t=>{if(t.cancelToken.isCancelled)t.onCancel(new nr);else if(t.trampoline.incrementAndCheck())t.trampoline.hijack(()=>{try{e(t)}catch(e){t.onError(e)}});else try{e(t)}catch(e){t.onError(e)}}}function ir(e,t){return or(n=>{e({onSuccess:e=>{try{t(e)(n)}catch(e){n.onError(e)}},onError:n.onError,onCancel:n.onCancel,cancelToken:n.cancelToken,trampoline:n.trampoline})})}function lr(e){return or(t=>t.onSuccess(e))}const ar=new class{Bind(e,t){return ir(e,t)}Combine(e,t){return this.Bind(e,()=>t)}Delay(e){return or(t=>e()(t))}For(e,t){const n=e[Symbol.iterator]();let r=n.next();return this.While(()=>!r.done,this.Delay(()=>{const e=t(r.value);return r=n.next(),e}))}Return(e){return lr(e)}ReturnFrom(e){return e}TryFinally(e,t){return or(n=>{e({onSuccess:e=>{t(),n.onSuccess(e)},onError:e=>{t(),n.onError(e)},onCancel:e=>{t(),n.onCancel(e)},cancelToken:n.cancelToken,trampoline:n.trampoline})})}TryWith(e,t){return or(n=>{e({onSuccess:n.onSuccess,onCancel:n.onCancel,cancelToken:n.cancelToken,trampoline:n.trampoline,onError:e=>{try{t(e)(n)}catch(e){n.onError(e)}}})})}Using(e,t){return this.TryFinally(t(e),()=>e.Dispose())}While(e,t){return e()?this.Bind(t,()=>this.While(e,t)):this.Return(void 0)}Zero(){return or(e=>e.onSuccess(void 0))}};class ur extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Ok","Error"]}}function sr(e,t){return 0===t.tag?new ur(0,e(t.fields[0])):new ur(1,t.fields[0])}class cr extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Choice1Of2","Choice2Of2"]}}function fr(e){}const dr=new tr;function pr(e){return or(t=>{e({onSuccess:e=>t.onSuccess(function(e){return new cr(0,e)}(e)),onError:e=>t.onSuccess(new cr(1,e)),onCancel:t.onCancel,cancelToken:t.cancelToken,trampoline:t.trampoline})})}function hr(e){return or(t=>e([t.onSuccess,t.onError,t.onCancel]))}function mr(e,t){return function(e,t){return gr(e,t)}(e,t)}function gr(e,t,n,r,o){"function"!=typeof t&&(o=t,t=void 0);const i=new rr;e({onSuccess:t||fr,onError:n||fr,onCancel:r||fr,cancelToken:o||dr,trampoline:i})}class vr{constructor(e,t,n){this.OnNext=e,this.OnError=t||(e=>{}),this.OnCompleted=n||(()=>{})}}class yr{constructor(e,t){this._subscriber=e,this.delegates=t||new Array}Add(e){this._addHandler(e)}get Publish(){return this}Trigger(e){this.delegates.forEach(t=>t(e))}AddHandler(e){null==this._dotnetDelegates&&(this._dotnetDelegates=new Map);const t=t=>e(null,t);this._dotnetDelegates.set(e,t),this._addHandler(t)}RemoveHandler(e){if(null!=this._dotnetDelegates){const t=this._dotnetDelegates.get(e);null!=t&&(this._dotnetDelegates.delete(e),this._removeHandler(t))}}Subscribe(e){return"function"==typeof e?this._subscribeFromCallback(e):this._subscribeFromObserver(e)}_addHandler(e){this.delegates.push(e)}_removeHandler(e){const t=this.delegates.indexOf(e);t>-1&&this.delegates.splice(t,1)}_subscribeFromObserver(e){if(this._subscriber)return this._subscriber(e);const t=e.OnNext;return this._addHandler(t),{Dispose:()=>{this._removeHandler(t)}}}_subscribeFromCallback(e){return this._addHandler(e),{Dispose:()=>{this._removeHandler(e)}}}}var br=yr;var wr=class{constructor(e){this._enabled=!1,this._isDisposed=!1,this._intervalId=0,this._timeoutId=0,this.Interval=e&&e>0?e:100,this.AutoReset=!0,this._elapsed=new br}get Elapsed(){return this._elapsed}get Enabled(){return this._enabled}set Enabled(e){this._isDisposed||this._enabled===e||(this._enabled=e,this._enabled?this.AutoReset?this._intervalId=setInterval(()=>{this.AutoReset||(this.Enabled=!1),this._elapsed.Trigger(new Date)},this.Interval):this._timeoutId=setTimeout(()=>{this.Enabled=!1,this._timeoutId=0,this.AutoReset&&(this.Enabled=!0),this._elapsed.Trigger(new Date)},this.Interval):(this._timeoutId&&(clearTimeout(this._timeoutId),this._timeoutId=0),this._intervalId&&(clearInterval(this._intervalId),this._intervalId=0)))}Dispose(){this.Enabled=!1,this._isDisposed=!0}Close(){this.Dispose()}Start(){this.Enabled=!0}Stop(){this.Enabled=!1}};function Sr(e,t){console.error(hn(e),t)}function Er(e,t){let n,r=new wr(e);r.AutoReset=!1,n=r,function(e,t){t.Subscribe(new vr(e))}(t,n.Elapsed),n.Enabled=!0,n.Start()}function kr(e,t,n){Wn(n=>{try{n(t)}catch(t){e(t)}},n)}function Cr(){return jn()}function xr(e){return function(e){const t=Pn();let n=t;const o=e=>{n=$n((e,t)=>{const n=new Nn(t,void 0);return e.tail=n,n},n,e)};if(r(e))e.forEach(o);else if(e instanceof Nn)Wn(o,e);else{const t=u(e);try{for(;t["System.Collections.IEnumerator.MoveNext"]();)o(t["System.Collections.Generic.IEnumerator`1.get_Current"]())}finally{t.Dispose()}}const i=n,l=Pn();return i.tail=l,Rn(t)}(e)}function Or(e){return zn(e)}function Tr(e,t,n,r,o){return zn(i=>{e(ar.Delay(()=>ar.Bind(pr(t(n)),e=>{const t=e;return i(1===t.tag?o(t.fields[0]):r(t.fields[0])),ar.Zero()})))})}function Ir(e){Er(0,t=>{mr(e)})}var Nr=n(0),_r=n.n(Nr);function Pr(){return e=(e,t)=>O(e,t),{Compare:(t,n)=>e(t,n)};var e}function Mr(){return Pr()}const Dr="The input sequence has an insufficient number of elements.";function Fr(){throw new Error("Enumeration has not started. Call MoveNext.")}function Lr(){throw new Error("Enumeration already finished.")}class Rr{constructor(e){this.f=e}toString(){let e=0,t="seq [";const n=u(this);try{for(;e<4&&n["System.Collections.IEnumerator.MoveNext"]();)e>0&&(t+="; "),t+=D(n["System.Collections.Generic.IEnumerator`1.get_Current"]()),e=e+1|0;return 4===e&&(t+="; ..."),t+"]"}finally{n.Dispose()}}GetEnumerator(){return this.f()}[Symbol.iterator](){return s(this.GetEnumerator())}"System.Collections.IEnumerable.GetEnumerator"(){return this.f()}}class jr{constructor(e,t,n){this.current=e,this.next=t,this.dispose=n}"System.Collections.Generic.IEnumerator`1.get_Current"(){return this.current()}"System.Collections.IEnumerator.get_Current"(){return this.current()}"System.Collections.IEnumerator.MoveNext"(){return this.next()}"System.Collections.IEnumerator.Reset"(){!function(){throw new Error("Reset is not supported on this enumerator.")}()}Dispose(){this.dispose()}}function Ar(e,t,n){return new jr(e,t,n)}function zr(e,t){return Ar(()=>t["System.Collections.Generic.IEnumerator`1.get_Current"](),()=>t["System.Collections.IEnumerator.MoveNext"](),()=>{try{t.Dispose()}finally{e()}})}function Ur(e,t,n){let r=!1,o=void 0,i=hn(e());const l=()=>{if(null!=i){const e=mn(i);try{n(e)}finally{i=void 0}}},a=()=>{try{l()}finally{o=void 0}};return Ar(()=>(r||Fr(),null!=o?mn(o):Lr()),()=>{if(r||(r=!0),null!=i){const e=mn(i);let n;try{n=t(e)}catch(e){throw a(),e}return null!=n?(o=n,!0):(a(),!1)}return!1},l)}function Hr(e,t){null==t&&function(e){throw new Error(e)}(e)}function Br(e){return function(e){return new Rr(e)}(e)}function Vr(e){return Hr("source",e),u(e)}function $r(e){return Br(()=>u(e()))}function Gr(e){return Br(()=>function(e){let t=void 0,n=void 0,r=!1,o=!1,i=void 0;const l=()=>{if(o=!0,null!=n){const e=n;try{e.Dispose()}finally{n=void 0}}if(null!=t){const e=t;try{e.Dispose()}finally{t=void 0}}};return Ar(()=>(r?o&&Lr():Fr(),null!=i?mn(i):Lr()),()=>{let a;if(r||(r=!0),o)return!1;{let r=void 0;for(;null==r;){const o=[t,n];if(null!=o[0])if(null!=o[1]){const e=o[1];if(e["System.Collections.IEnumerator.MoveNext"]())i=hn(e["System.Collections.Generic.IEnumerator`1.get_Current"]()),r=!0;else try{e.Dispose()}finally{n=void 0}}else{const e=o[0];if(e["System.Collections.IEnumerator.MoveNext"]()){a=e["System.Collections.Generic.IEnumerator`1.get_Current"](),n=u(a)}else l(),r=!1}else t=u(e)}return mn(r)}},()=>{o||l()})}(e))}function Wr(e,t){return Br(()=>function(e,t){let n=void 0,r=t;return Ar(()=>{if(null!=n){n[1];return n[0]}return Fr()},()=>{if(n=e(r),null!=n){n[0];const e=n[1];return r=e,!0}return!1},()=>{})}(e,t))}function qr(){return $r(()=>new Array(0))}function Qr(e){return $r(()=>function(e,t){const n=bn(t,1);return n[0]=e,n}(e))}function Kr(e){return r(e)?Qn(e):e instanceof Nn?e:Kn(e)}function Yr(e,t,n){return Br(()=>Ur(e,t,n))}function Xr(e,t,n){return Br(()=>{let r=-1;return Ur(e,e=>(r=r+1|0,t(r,e)),n)})}function Jr(e,t){return Gr([e,t])}function Zr(e,t,n){const r=Vr(t);try{let t=!1;for(;!t&&r["System.Collections.IEnumerator.MoveNext"]();)t=n.Equals(e,r["System.Collections.Generic.IEnumerator`1.get_Current"]());return t}finally{r.Dispose()}}function eo(e,t,n){const r=Vr(n);try{let n=t;for(;r["System.Collections.IEnumerator.MoveNext"]();)n=e(n,r["System.Collections.Generic.IEnumerator`1.get_Current"]());return n}finally{r.Dispose()}}function to(e,t){eo((t,n)=>{e(n)},void 0,t)}function no(e,t){return Yr(()=>Vr(t),t=>t["System.Collections.IEnumerator.MoveNext"]()?hn(e(t["System.Collections.Generic.IEnumerator`1.get_Current"]())):void 0,e=>{e.Dispose()})}function ro(e,t){return Xr(()=>Vr(t),(t,n)=>n["System.Collections.IEnumerator.MoveNext"]()?hn(e(t,n["System.Collections.Generic.IEnumerator`1.get_Current"]())):void 0,e=>{e.Dispose()})}function oo(e,t){return Br(()=>{const n=Vr(t);try{for(let t=1;t<=e;t++)if(!n["System.Collections.IEnumerator.MoveNext"]())throw new Error(Dr+"\\nParameter name: source");return zr(()=>{},n)}catch(e){throw n.Dispose(),e}})}function io(e,t){return $r(()=>Gr(no(e,t)))}const lo=_r.a,ao=e=>{Object(Nr.useEffect)(()=>{const t=e();return()=>{t.Dispose()}})},uo=(e,t)=>{Object(Nr.useEffect)(()=>{const t=e();return()=>{t.Dispose()}},t)},so=e=>{Object(Nr.useLayoutEffect)(()=>{const t=e();return()=>{t.Dispose()}})};function co(e,t,n,r){const o=lo.memo(e,N(2,vn(_(2,n),null)));return to(t=>{e.displayName=t},gn(t)),e=>lo.createElement(o,fo(r,e))}function fo(e,t){if(null==e)return t;{const n=e;return t.key=n(t),t}}function po(e){return{Dispose(){e()}}}function ho(e){return lo.useState(e)}function mo(e){ao(e)}function go(e,t){uo(e,t)}function vo(e,t){return lo.useCallback(e,vn(t,[]))}function yo(e){return lo.useRef(e)}function bo(e,t){return lo.useMemo(e,vn(t,[]))}function wo(e){const t=yo(e),n=vo(e=>t.current(e),[]);var r;return r=()=>{t.current=e},so(e=>(r(),po(()=>{}))),n}Nr.useState;function So(e){return lo.useState(e)}Nr.useState;const Eo=(()=>{try{"undefined"!=typeof window&&"function"==typeof window.addEventListener&&(window.addEventListener("testPassiveEventSupport",e=>{},{passive:!0}),window.removeEventListener("testPassiveEventSupport",e=>{}))}catch(e){}return!1})();function ko(e){return yn(e=>e.passive&&!Eo?{capture:e.capture,once:e.once,passive:!1}:e,e)}function Co(e){return t=e=>e.capture?{capture:!0}:void 0,null!=(n=e)?t(mn(n)):void 0;var t,n}const xo=/^[\(\{]{0,2}[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[\)\}]{0,2}$/,Oo=/^([0-9a-f]{8})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{12})$/,To=/^\{0x[0-9a-f]{8},(0x[0-9a-f]{4},){2}\{(0x[0-9a-f]{2},){7}0x[0-9a-f]{2}\}\}$/;function Io(e){function t(e){return e.replace(Oo,"$1-$2-$3-$4-$5")}const n=e.trim().toLowerCase();if(xo.test(n))return function(e,...t){if(0===t.length)return e.trim();const n="["+qt(t.join(""))+"]+";return e.replace(new RegExp("^"+n),"").replace(new RegExp(n+"$"),"")}(n,"{","}","(",")");if(Oo.test(n))return t(n);if(To.test(n))return t(n.replace(/[\{\},]|0x/g,""));throw new Error("Guid should contain 32 digits with 4 dashes: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")}function No(e,t){try{return t.contents=Io(e),!0}catch(e){return!1}}var _o={GetHashCode(){return v([this.s,this.e].concat(this.c))},Equals(e){return!this.cmp(e)},CompareTo(e){return this.cmp(e)},[Te](){const e=this;return{multiply:t=>e.mul(t),toPrecision:t=>e.toPrecision(t),toExponential:t=>e.toExponential(t),toFixed:t=>e.toFixed(t),toHex:()=>(Number(e)>>>0).toString(16)}}},Po="[big.js] ",Mo=Po+"Invalid ",Do=Mo+"decimal places",Fo=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function Lo(e,t){var n,r,o;if(!Fo.test(t))throw Error(Mo+"number");for(e.s="-"==t.charAt(0)?(t=t.slice(1),-1):1,(n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),o=t.length,r=0;r<n&&r<o&&"0"==t.charAt(r);)++r;if(r==o)e.c=[e.e=0];else for(e.e=n-r-1,e.c=[],n=0;r<o;)e.c[n++]=+t.charAt(r++);return e=Ro(e,Ao.DP+1,Ao.RM)}function Ro(e,t,n,r){var o=e.c;if(void 0===n&&(n=Ao.RM),0!==n&&1!==n&&2!==n&&3!==n)throw Error("[big.js] Invalid rounding mode");if(t<1)r=3===n&&(r||!!o[0])||0===t&&(1===n&&o[0]>=5||2===n&&(o[0]>5||5===o[0]&&(r||void 0!==o[1]))),o.length=1,r?(e.e=e.e-t+1,o[0]=1):o[0]=e.e=0;else if(t<o.length){const i=o.findIndex((e,n)=>n>=t&&e>0)<0;if(r=1===n&&o[t]>=5||2===n&&(o[t]>5||5===o[t]&&(r||void 0!==o[t+1]||1&o[t-1]))||3===n&&(r||!i),o.length=t--,r)for(;++o[t]>9;)o[t]=0,t--||(++e.e,o.unshift(1));for(t=o.length;!o[--t];)o.pop()}return e}function jo(e,t,n){var r=e.e,o=e.c.join(""),i=o.length;if(t)o=o.charAt(0)+(i>1?"."+o.slice(1):"")+(r<0?"e":"e+")+r;else if(r<0){for(;++r;)o="0"+o;o="0."+o}else if(r>0)if(++r>i)for(r-=i;r--;)o+="0";else r<i&&(o=o.slice(0,r)+"."+o.slice(r));else i>1&&(o=o.charAt(0)+"."+o.slice(1));return e.s<0&&n?"-"+o:o}_o.abs=function(){var e=new this.constructor(this);return e.s=1,e},_o.cmp=function(e){var t,n=this.constructor,r=new n(this),o=(e=new n(e),r.c),i=e.c,l=r.s,a=e.s,u=r.e,s=e.e;if(!o[0]||!i[0])return o[0]?l:i[0]?-a:0;if(l!=a)return l;if(t=l<0,u!=s)return u>s^t?1:-1;for(a=Math.max(o.length,i.length),l=0;l<a;l++)if((u=l<o.length?o[l]:0)!=(s=l<i.length?i[l]:0))return u>s^t?1:-1;return 0},_o.div=function(e){var t=this.constructor,n=new t(this),r=(e=new t(e),n.c),o=e.c,i=n.s==e.s?1:-1,l=t.DP;if(l!==~~l||l<0||l>1e6)throw Error(Do);if(!o[0])throw Error("[big.js] Division by zero");if(!r[0])return e.s=i,e.c=[e.e=0],e;var a,u,s,c,f,d=o.slice(),p=a=o.length,h=r.length,m=r.slice(0,a),g=m.length,v=e,y=v.c=[],b=0,w=l+(v.e=n.e-e.e)+1;for(v.s=i,i=w<0?0:w,d.unshift(0);g++<a;)m.push(0);do{for(s=0;s<10;s++){if(a!=(g=m.length))c=a>g?1:-1;else for(f=-1,c=0;++f<a;)if(o[f]!=m[f]){c=o[f]>m[f]?1:-1;break}if(!(c<0))break;for(u=g==a?o:d;g;){if(m[--g]<u[g]){for(f=g;f&&!m[--f];)m[f]=9;--m[f],m[g]+=10}m[g]-=u[g]}for(;!m[0];)m.shift()}y[b++]=c?s:++s,m[0]&&c?m[g]=r[p]||0:m=[r[p]]}while((p++<h||void 0!==m[0])&&i--);return y[0]||1==b||(y.shift(),v.e--,w--),b>w&&Ro(v,w,t.RM,void 0!==m[0]),v},_o.eq=function(e){return 0===this.cmp(e)},_o.gt=function(e){return this.cmp(e)>0},_o.gte=function(e){return this.cmp(e)>-1},_o.lt=function(e){return this.cmp(e)<0},_o.lte=function(e){return this.cmp(e)<1},_o.minus=_o.sub=function(e){var t,n,r,o,i=this.constructor,l=new i(this),a=(e=new i(e),l.s),u=e.s;if(a!=u)return e.s=-u,l.plus(e);var s=l.c.slice(),c=l.e,f=e.c,d=e.e;if(!s[0]||!f[0])return f[0]?e.s=-u:s[0]?e=new i(l):e.s=1,e;if(a=c-d){for((o=a<0)?(a=-a,r=s):(d=c,r=f),r.reverse(),u=a;u--;)r.push(0);r.reverse()}else for(n=((o=s.length<f.length)?s:f).length,a=u=0;u<n;u++)if(s[u]!=f[u]){o=s[u]<f[u];break}if(o&&(r=s,s=f,f=r,e.s=-e.s),(u=(n=f.length)-(t=s.length))>0)for(;u--;)s[t++]=0;for(u=t;n>a;){if(s[--n]<f[n]){for(t=n;t&&!s[--t];)s[t]=9;--s[t],s[n]+=10}s[n]-=f[n]}for(;0===s[--u];)s.pop();for(;0===s[0];)s.shift(),--d;return s[0]||(e.s=1,s=[d=0]),e.c=s,e.e=d,e},_o.mod=function(e){var t,n=this.constructor,r=new n(this),o=(e=new n(e),r.s),i=e.s;if(!e.c[0])throw Error("[big.js] Division by zero");return r.s=e.s=1,t=1==e.cmp(r),r.s=o,e.s=i,t?new n(r):(o=n.DP,i=n.RM,n.DP=n.RM=0,r=r.div(e),n.DP=o,n.RM=i,this.minus(r.times(e)))},_o.plus=_o.add=function(e){var t,n,r,o=this.constructor,i=new o(this);e=new o(e);if(i.s!=e.s)return e.s=-e.s,i.minus(e);var l=i.e,a=i.c,u=e.e,s=e.c;if(!a[0]||!s[0])return s[0]||(a[0]?e=new o(i):e.s=i.s),e;if(a=a.slice(),t=l-u){for(t>0?(u=l,r=s):(t=-t,r=a),r.reverse();t--;)r.push(0);r.reverse()}for(a.length-s.length<0&&(r=s,s=a,a=r),t=s.length,n=0;t;a[t]%=10)n=(a[--t]=a[t]+s[t]+n)/10|0;for(n&&(a.unshift(n),++u),t=a.length;0===a[--t];)a.pop();return e.c=a,e.e=u,e},_o.pow=function(e){var t=this.constructor,n=new t(this),r=new t("1"),o=new t("1"),i=e<0;if(e!==~~e||e<-1e6||e>1e6)throw Error(Mo+"exponent");for(i&&(e=-e);1&e&&(r=r.times(n)),e>>=1;)n=n.times(n);return i?o.div(r):r},_o.prec=function(e,t){if(e!==~~e||e<1||e>1e6)throw Error(Mo+"precision");return Ro(new this.constructor(this),e,t)},_o.round=function(e,t){if(void 0===e)e=0;else if(e!==~~e||e<-1e6||e>1e6)throw Error(Do);return Ro(new this.constructor(this),e+this.e+1,t)},_o.sqrt=function(){var e,t,n,r=this.constructor,o=new r(this),i=o.s,l=o.e,a=new r("0.5");if(!o.c[0])return new r(o);if(i<0)throw Error(Po+"No square root");0===(i=Math.sqrt(o+""))||i===1/0?((t=o.c.join("")).length+l&1||(t+="0"),l=((l+1)/2|0)-(l<0||1&l),e=new r(((i=Math.sqrt(t))==1/0?"5e":(i=i.toExponential()).slice(0,i.indexOf("e")+1))+l)):e=new r(i+""),l=e.e+(r.DP+=4);do{n=e,e=a.times(n.plus(o.div(n)))}while(n.c.slice(0,l).join("")!==e.c.slice(0,l).join(""));return Ro(e,(r.DP-=4)+e.e+1,r.RM)},_o.times=_o.mul=function(e){var t,n=this.constructor,r=new n(this),o=(e=new n(e),r.c),i=e.c,l=o.length,a=i.length,u=r.e,s=e.e;if(e.s=r.s==e.s?1:-1,!o[0]||!i[0])return e.c=[e.e=0],e;for(e.e=u+s,l<a&&(t=o,o=i,i=t,s=l,l=a,a=s),t=new Array(s=l+a);s--;)t[s]=0;for(u=a;u--;){for(a=0,s=l+u;s>u;)a=t[s]+i[u]*o[s-u-1]+a,t[s--]=a%10,a=a/10|0;t[s]=a}for(a?++e.e:t.shift(),u=t.length;!t[--u];)t.pop();return e.c=t,e},_o.toExponential=function(e,t){var n=this,r=n.c[0];if(void 0!==e){if(e!==~~e||e<0||e>1e6)throw Error(Do);for(n=Ro(new n.constructor(n),++e,t);n.c.length<e;)n.c.push(0)}return jo(n,!0,!!r)},_o.toFixed=function(e,t){var n=this,r=n.c[0];if(void 0!==e){if(e!==~~e||e<0||e>1e6)throw Error(Do);for(e=e+(n=Ro(new n.constructor(n),e+n.e+1,t)).e+1;n.c.length<e;)n.c.push(0)}return jo(n,!1,!!r)},_o.toJSON=_o.toString=function(){var e=this,t=e.constructor;return jo(e,e.e<=t.NE||e.e>=t.PE,!!e.c[0])},_o.toNumber=function(){var e=Number(jo(this,!0,!0));if(!0===this.constructor.strict&&!this.eq(e.toString()))throw Error(Po+"Imprecise conversion");return e},_o.toPrecision=function(e,t){var n=this,r=n.constructor,o=n.c[0];if(void 0!==e){if(e!==~~e||e<1||e>1e6)throw Error(Mo+"precision");for(n=Ro(new r(n),e,t);n.c.length<e;)n.c.push(0)}return jo(n,e<=n.e||n.e<=r.NE||n.e>=r.PE,!!o)},_o.valueOf=function(){var e=this,t=e.constructor;if(!0===t.strict)throw Error(Po+"valueOf disallowed");return jo(e,e.e<=t.NE||e.e>=t.PE,!0)};var Ao=function e(){function t(n){var r=this;if(!(r instanceof t))return void 0===n?e():new t(n);if(n instanceof t)r.s=n.s,r.e=n.e,r.c=n.c.slice(),function(e){if(e.c.length>1&&!e.c[0]){let t=e.c.findIndex(e=>e);e.c=e.c.slice(t),e.e=e.e-t}}(r);else{if("string"!=typeof n){if(!0===t.strict)throw TypeError(Mo+"number");n=0===n&&1/n<0?"-0":String(n)}Lo(r,n)}r.constructor=t}return t.prototype=_o,t.DP=28,t.RM=1,t.NE=-29,t.PE=29,t.strict=!1,t}(),zo=Ao;new zo(0),new zo(1),new zo(-1),new zo("79228162514264337593543950335"),new zo("-79228162514264337593543950335");function Uo(e,t){return 0===t.indexOf(e)?t:void 0}function Ho(e,t){return function(e,t){const n=e.lastIndexOf(t);return n>=0&&n===e.length-t.length}(t,e)?t:void 0}function Bo(e,t){return function(e){return 1===e?e=>{let t,n,r,o,i,l;return t=Uo("/",e),null!=t?(n=t,"#"+n):(r=Uo("#/",e),null!=r?(o=r,o):(i=Uo("#",e),null!=i?(l=i,"#/"+dn(l,1,l.length-1)):"#/"+e))}:e=>{let t,n;return t=Uo("/",e),null!=t?(n=t,n):"/"+e}}(t)(sn("/",Jn(e=>e.indexOf("?")>=0||0===e.indexOf("#")||0===e.indexOf("/")?e:encodeURIComponent(e),e)))}function Vo(e,t,n){1===t?history.pushState(void 0,"",Bo(e,n)):history.replaceState(void 0,"",Bo(e,n));const r=document.createEvent("CustomEvent");r.initEvent("CUSTOM_NAVIGATION_EVENT",!0,!0),window.dispatchEvent(r)}function $o(e,t){return function(e,t){let n,r;const o=Pn();let i=o,l=t;for(;!Dn(l);){let t=e(Ln(l));for(;!Dn(t);)n=i,r=new Nn(Ln(t),void 0),n.tail=r,i=r,t=Rn(t);l=Rn(l)}const a=i,u=Pn();return a.tail=u,Rn(o)}(e=>{if(un(e))return jn();{const t=function(e,...t){return 0===t.length?e.trimEnd():e.replace(new RegExp("["+qt(t.join(""))+"]+$"),"")}(e,"#");if("?"===t)return jn();if(null!=Uo("?",t))return zn(t);{const e=t.split("?");if(On(0,e,null)||1!==e.length){if(On(0,e,null)||2!==e.length)return jn();if(""===e[1]){const t=e[0];return zn(decodeURIComponent(t))}{const t=e[0],n=e[1];return Qn([decodeURIComponent(t),"?"+n])}}{const t=e[0];return zn(decodeURIComponent(t))}}}},Qn(fn(null!=Uo("#",e)?dn(e,1,e.length-1):1===t&&(null!=Ho("#",e)||null!=Ho("#/",e))?"":e,["/"],null,0)))}const Go=co(e=>{const t=wo(t=>{const n=vn(e.onUrlChanged,e=>{});!function(e,t,n){t($o(2===e?window.location.pathname+window.location.search:window.location.hash,e))}(vn(e.hashMode,1),n)});if(window.navigator.userAgent.indexOf("Trident")>=0||window.navigator.userAgent.indexOf("MSIE")>=0){const e="hashchange",n=e=>{t(e)},r=void 0,o=bo(()=>ko(r),[r]),i=bo(()=>Co(r),[r]),l=bo(()=>e=>{n(e)},[n]);mo(wo(()=>(null==o?window.addEventListener(e,l):window.addEventListener(e,l,o),po(()=>{null==i?window.removeEventListener(e,l):window.removeEventListener(e,l,i)}))))}else{const e="popstate",n=t,r=void 0,o=bo(()=>ko(r),[r]),i=bo(()=>Co(r),[r]),l=bo(()=>e=>{n(e)},[n]);mo(wo(()=>(null==o?window.addEventListener(e,l):window.addEventListener(e,l,o),po(()=>{null==i?window.removeEventListener(e,l):window.removeEventListener(e,l,i)}))))}const n="CUSTOM_NAVIGATION_EVENT",r=t,o=bo(()=>ko(void 0),[void 0]),i=bo(()=>Co(void 0),[void 0]),l=bo(()=>e=>{r(e)},[r]);mo(wo(()=>(null==o?window.addEventListener(n,l):window.addEventListener(n,l,o),po(()=>{null==i?window.removeEventListener(n,l):window.removeEventListener(n,l,i)}))));const a=e.application;return null==a?null:a},void 0,qo,Wo);var Wo,qo;class Qo extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Accounts","NotFound"]}}function Ko(){return K("Middleware.FastTrack.AdminUI.Types.Page",[],Qo,()=>[[],[]])}function Yo(e){let t;switch(t=Un(e)?1:"fasttrack-middleware"===Hn(e)?Un(Bn(e))?1:"accounts"===Hn(Bn(e))&&Un(Bn(Bn(e)))?0:1:1,t){case 0:return new Qo(0);case 1:return new Qo(1)}}const Xo=0,Jo=1,Zo=2,ei=3,ti=4;function ni(e,t){return e.replace(/[a-z]?[A-Z]/g,e=>1===e.length?e.toLowerCase():e.charAt(0)+t+e.charAt(1).toLowerCase())}function ri(e,t=Xo){const n={},r=t;function o(e){throw new Error("Cannot infer key and value of "+String(e))}function i(e,t,r){e=function(e,t){switch(t){case Jo:return e.charAt(0).toLowerCase()+e.slice(1);case Zo:return ni(e,"_");case ei:return ni(e,"_").toUpperCase();case ti:return ni(e,"-");case Xo:default:return e}}(e,t),n[e]=r}for(let t of e){let e=Xo;if(null==t&&o(t),t instanceof F){const n=t.cases()[t.tag];t=0===t.fields.length?n:[n].concat(t.fields),e=r}if(Array.isArray(t))switch(t.length){case 0:o(t);break;case 1:i(t[0],e,!0);break;case 2:const n=t[1];i(t[0],e,n);break;default:i(t[0],e,t.slice(1))}else"string"==typeof t?i(t,e,!0):o(t)}return n}class oi extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["BadPrimitive","BadPrimitiveExtra","BadType","BadField","BadPath","TooSmallArray","FailMessage","BadOneOf"]}}class ii extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["PascalCase","CamelCase","SnakeCase"]}}class li{constructor(){this.cache=new Map([])}}function ai(){return new li}ai(),ai();function ui(e){return e.slice(void 0,1).toLowerCase()+e.slice(1,e.length)}function si(e,t){switch(e.tag){case 2:return function(e,t,n,r,o=0){if("string"==typeof e){const n=e;e=Wt(t,null!=r?r:0),t=n,r=void 0}if("function"==typeof n)return r=null==r?-1:r,t.substring(0,o)+t.substring(o).replace(e,(function(){let e=arguments[0];if(r){r--;const t=[],o=arguments.length,i="string"!=typeof arguments[o-1];let l=i?o-3:o-2;for(let e=0;e<l;e++)t.push(arguments[e]);t.index=arguments[l++],t.input=arguments[l++],i&&(t.groups=arguments[l]),e=n(t)}return e}));if(n=n.replace(/\$0/g,e=>"$&").replace(/\${([^}]+)}/g,"$<$1>"),null!=r){let i;const l=t.substring(o),a=Qt(e,l),u=Qt.length>r?(i=a[r-1],l.substring(0,i.index+i[0].length)):l;return t.substring(0,o)+u.replace(e,n)+t.substring(o+u.length)}return t.replace(e,n)}(ui(t),"[A-Z]","_$0").toLowerCase();case 0:return t;default:return ui(t)}}class ci extends U{constructor(e,t){super(),this.bound=0|e,this.digits=t}}function fi(e,t){for(;;){const n=e,r=t;if(0===r)return 1;if(r%2!=0)return n*fi(n*n,~~(r/2))|0;e=n*n,t=~~(r/2)}}Mt(2013265921,0,!1),Mt(2013265921,0,!0);Cn(28,e=>fi(2,e),Int32Array);function di(e){return e.bound}function pi(e,t){return e.digits[t]}function hi(e,t){return Lt(pi(e,t),!1,2)}function mi(e,t,n){e.digits[t]=0|n}function gi(e,t){for(;;){const n=e,r=t;if(0===r)return Mt(1,0,!1);if(r%2!=0)return Ot(n,gi(Ot(n,n),~~(r/2)));e=Ot(n,n),t=~~(r/2)}}function vi(e,t){for(;;){const n=e,r=t;if(0===r)return 1;if(r%2!=0)return n*vi(n*n,~~(r/2))|0;e=n*n,t=~~(r/2)}}const yi=Mt(16777216,0,!1),bi=Mt(16777215,0,!1);Mt(16777215,0,!0);function wi(e){return new ci(e,new Int32Array(e))}function Si(e){const t=0|((e,t)=>{for(;;){const n=e,r=t;if(-1===r||0!==n[r])return r+1|0;e=n,t=r-1}})(e.digits,e.bound-1);return e.bound=0|t,e}function Ei(e){const t=0|(e<0?0:e);if(t<16777216){const e=wi(1);return e.digits[0]=0|t,Si(e)}{const e=wi(2);for(let n=0;n<=1;n++)e.digits[n]=~~(t/vi(16777216,n))%16777216|0;return Si(e)}}function ki(e){if(1===e.bound)return 0|e.digits[0];{let t=0;for(let n=e.bound-1;n>=0;n--)t=e.digits[n]+16777216*t|0;return 0|t}}const Ci=Ei(1),xi=Ei(0);function Oi(e){return e.bound-1}function Ti(e){return 0===e.bound}function Ii(e,t){if(e.bound===t.bound){return((e,t,n)=>{for(;;){const r=e,o=t,i=n;if(-1===i)return!0;if(r[i]!==o[i])return!1;e=r,t=o,n=i-1}})(e.digits,t.digits,e.bound-1)}return!1}function Ni(e,t){if(e.bound<t.bound)return-1;if(e.bound>t.bound)return 1;return 0|((e,t,n)=>{for(;;){const r=e,o=t,i=n;if(-1===i)return 0;if(r[i]!==o[i])return r[i]<o[i]?-1:1;e=r,t=o,n=i-1}})(e.digits,t.digits,e.bound-1)}function _i(e,t){return-1===Ni(e,t)}function Pi(e,t,n){for(;;){const r=e,o=t,i=n;if(!(Pt(o,Mt(0,0,!1))>0))break;{const l=xt(hi(r,i),o);mi(r,i,~~Dt(_t(l,bi))),e=r,t=Tt(l,yi),n=i+1}}}function Mi(e,t){const n=0|di(e),r=wi(n+1),o=Lt(t,!1,2);let i=Mt(0,0,!1);for(let t=0;t<=n-1;t++){const n=xt(xt(i,hi(r,t)),Ot(hi(e,t),o));mi(r,t,~~Dt(_t(n,bi))),i=Tt(n,yi)}return Pi(r,i,n),Si(r)}function Di(e,t){const n=1===di(e),r=1===di(t);return n&&r?function(e,t){const n=wi(2),r=Ot(Lt(e,!1,2),Lt(t,!1,2));return mi(n,0,~~Dt(_t(r,bi))),mi(n,1,~~Dt(Tt(r,yi))),Si(n)}(pi(e,0),pi(t,0)):n?Mi(t,pi(e,0)):r?Mi(e,pi(t,0)):function(e,t){const n=wi(e.bound+t.bound),r=n.digits;for(let o=0;o<=e.bound-1;o++){const i=Lt(e.digits[o],!1,2);let l=Mt(0,0,!1),a=o;for(let e=0;e<=t.bound-1;e++){const n=Lt(t.digits[e],!1,2),o=xt(xt(Lt(r[a],!1,2),l),Ot(i,n));r[a]=0|~~Dt(_t(o,bi)),l=Tt(o,yi),a=a+1|0}Pi(n,l,a)}return Si(n)}(e,t)}class Fi extends U{constructor(e,t,n,r,o,i,l){super(),this.bigL=0|e,this.twoToBigL=0|t,this.k=0|n,this.bigK=0|r,this.bigN=0|o,this.split=0|i,this.splits=l}}function Li(e,t,n,r){return new Fi(e,vi(2,e),t,n,r,~~(24/e),Cn(~~(24/e),t=>vi(2,e*t),Int32Array))}const Ri=[Li(1,28,268435456,268435456),Li(2,26,67108864,134217728),Li(3,24,16777216,50331648),Li(4,22,4194304,16777216),Li(5,20,1048576,5242880),Li(6,18,262144,1572864),Li(7,16,65536,458752),Li(8,14,16384,131072),Li(9,12,4096,36864),Li(10,10,1024,10240),Li(11,8,256,2816),Li(12,6,64,768),Li(13,4,16,208)];Cn(24,e=>vi(2,e)-1,Int32Array),Cn(24,e=>vi(2,e),Int32Array),Cn(24,e=>gi(Mt(2,0,!1),e));Ri[0].bigN;function ji(e,t){return Di(e,t)}function Ai(e,t,n,r){const o=[e.digits,Oi(e)],i=o[0],l=[n.digits,Oi(n)],a=0|l[1],u=l[0],s=Lt(t,!1,2);let c=0,f=Ot(s,Lt(u[0],!1,2));for(;Pt(f,Mt(0,0,!1))>0||c<a;){if(c>o[1])throw new Error("scaleSubInPlace: pre-condition did not apply, result would be -ve");let e=~~Dt(_t(f,bi)),t=Tt(f,yi);e<=i[c+r]?i[c+r]=i[c+r]-e|0:(i[c+r]=i[c+r]+(16777216-e)|0,t=xt(t,Mt(1,0,!1))),f=c<a?xt(t,Ot(s,Lt(u[c+1],!1,2))):t,c=c+1|0}Si(e)}function zi(e,t,n,r){const o=[e.digits,Oi(e)],i=o[0],l=[n.digits,Oi(n)],a=0|l[1],u=l[0],s=Lt(t,!1,2);let c=0,f=Ot(s,Lt(u[0],!1,2));for(;Pt(f,Mt(0,0,!1))>0||c<a;){if(c>o[1])throw new Error("scaleSubInPlace: pre-condition did not apply, result would be -ve");let e=~~Dt(_t(f,bi)),t=Tt(f,yi);e<16777216-i[c+r]?i[c+r]=i[c+r]+e|0:(i[c+r]=e-(16777216-i[c+r])|0,t=xt(t,Mt(1,0,!1))),f=c<a?xt(t,Ot(s,Lt(u[c+1],!1,2))):t,c=c+1|0}Si(e)}function Ui(e,t,n){const r=[Oi(t),Oi(e)],o=0|r[1],i=0|r[0];if(o<i+n)return 0;{const r=[t.digits,e.digits],c=r[1],f=r[0],d=0|(0===i?o===n?~~(c[n]/f[0]):~~Dt(Tt(xt(Ot(Lt(c[o],!1,2),yi),Lt(c[o-1],!1,2)),Lt(f[0],!1,2))):o===i+n?~~(c[o]/(f[i]+1)):~~Dt(Tt(xt(Ot(Lt(c[o],!1,2),yi),Lt(c[o-1],!1,2)),xt(Lt(f[i],!1,2),Mt(1,0,!1)))));return 0===d?1!=(a=n,u=e,s=0,(l=t).bound+a<u.bound+s?-1:l.bound+a>u.bound+a?1:0|((e,t,n)=>{e:for(;;){const r=e,o=t,i=n;if(-1===i)return 0;{const l=0|(i<a?0:r[i-a]),u=0|(i<s?0:o[i-s]);if(l===u){e=r,t=o,n=i-1;continue e}return l<u?-1:1}}})(l.digits,u.digits,l.bound+a-1))?1:0:0|d}var l,a,u,s}function Hi(e,t){if(Ti(t))throw new Error;if(Oi(e)<Oi(t))return[xi,e];{const n=function(e){return new ci(e.bound,e.digits.slice())}(e),r=wi(Oi(e)-Oi(t)+1+1);let o=Oi(e);const i=0|Oi(t);let l=o-i;const a=e=>{};let u=!1;for(;!u;){a([r,n,l,o]);const e=0|Ui(n,t,l);e>0?(Ai(n,e,t,l),zi(r,e,Ci,l),a([r,n,l,o])):(u=0===e&&0===l,u||(o===i+l?(a([r,n,l-1,o]),l=l-1|0):(a([r,n,l-1,o-1]),l=l-1|0,o=o-1|0)))}return[Si(r),Si(n)]}}Ei(2);function Bi(e){return Ei(e)}function Vi(e){return function(e){const t=Pt(e,Mt(0,0,!1))<0?Mt(0,0,!1):e,n=wi(3);for(let e=0;e<=2;e++)n.digits[e]=0|~~Dt(It(Tt(t,gi(yi,e)),yi));return Si(n)}(e)}function $i(e){const t=0|Oi(e),n=(e,t,r,o)=>{e:for(;;){const i=e,l=t,a=r,u=o;if(Un(u)){const e=0|ki(a);return i&&0===e?l:An(p(e),l)}{const s=Bn(u),c=Hi(a,Hn(u)[1]),f=c[1],d=c[0];if(i&&Ti(d)){e=i,t=l,r=f,o=s;continue e}e=i,t=n(!1,l,f,s),r=d,o=s;continue e}}},r=n(!0,jn(),e,((e,n,r)=>{for(;;){const o=e,i=n,l=r;if(Oi(l)>t)return An([i,l],o);e=An([i,l],o),n=i+1,r=ji(l,l)}})(jn(),0,Ei(10)));return Un(r)?"0":sn("",Vn(r))}function Gi(e){return e.bound<=1}function Wi(e){const t=e;return 0<t.bound?0|t.digits[0]:0}class qi extends U{constructor(e,t){super(),this.signInt=0|e,this.v=t}toString(){const e=this;switch(0|Yi(e)){case-1:return Ti(Xi(e))?"0":"-"+$i(Xi(e));case 0:return"0";case 1:return $i(Xi(e));default:throw new Error("signs should be +/- 1 or 0")}}Equals(e){return e instanceof qi&&Ji(this,e)}GetHashCode(){return 0|(0===Yi(e=this)?1:Yi(e)+function(e){let t=0;for(let n=0;n<=e.bound-1;n++)t=e.digits[n]+(t<<3)|0;return 0|t}(Xi(e))|0);var e}toJSON(e){return D(this)}CompareTo(e){if(e instanceof qi)return 0|(Zi(t=this,n=e)?-1:Ji(t,n)?0:1);throw new Error("the objects are not comparable\\nParameter name: obj");var t,n}}function Qi(e,t){return new qi(e,t)}function Ki(e){return Gi(e)&&Wi(e)<qi.smallLim?qi.smallPosTab[Wi(e)]:e}function Yi(e){return e.signInt}function Xi(e){return e.v}function Ji(e,t){const n=[Yi(e),Yi(t)];let r;switch(r=-1===n[0]?-1===n[1]?1:0===n[1]?8:1===n[1]?3:9:0===n[0]?-1===n[1]?6:0===n[1]?4:1===n[1]?5:9:1===n[0]?-1===n[1]?2:0===n[1]?7:1===n[1]?0:9:9,r){case 0:case 1:return Ii(Xi(e),Xi(t));case 2:case 3:return!!Ti(Xi(e))&&Ti(Xi(t));case 4:return!0;case 5:case 6:return Ti(Xi(t));case 7:case 8:return Ti(Xi(e));case 9:throw new Error("signs should be +/- 1 or 0\\nParameter name: x")}}function Zi(e,t){const n=[Yi(e),Yi(t)];let r;switch(r=-1===n[0]?-1===n[1]?1:0===n[1]?8:1===n[1]?3:9:0===n[0]?-1===n[1]?6:0===n[1]?4:1===n[1]?5:9:1===n[0]?-1===n[1]?2:0===n[1]?7:1===n[1]?0:9:9,r){case 0:return _i(Xi(e),Xi(t));case 1:return _i(Xi(t),Xi(e));case 2:return!1;case 3:return!Ti(Xi(e))||!Ti(Xi(t));case 4:return!1;case 5:return!Ti(Xi(t));case 6:case 7:return!1;case 8:return!Ti(Xi(e));case 9:throw new Error("signs should be +/- 1 or 0\\nParameter name: x")}}function el(e){return e>=0?Qi(1,Ki(Bi(e))):Qi(-1,Ki(-2147483648===e?Vi(Nt(Lt(e,!1,2))):Bi(Oe(e))))}function tl(){return qi.one}function nl(){return qi.two}function rl(){return qi.zero}qi.smallLim=4096,qi.smallPosTab=Cn(qi.smallLim,e=>Bi(e)),qi.one=el(1),qi.two=el(2),qi.zero=el(0);rl(),tl(),nl();rl(),tl();function ol(e,t){il(t);const n=new Date(e);return n.offset=null!=t?t:-6e4*(new Date).getTimezoneOffset(),n}function il(e){if(null!=e&&0!==e){if(e%6e4!=0)throw new Error("Offset must be specified in whole minutes.");if(Math.abs(e/36e5)>14)throw new Error("Offset must be within plus or minus 14 hours.")}}function ll(e,t){try{return t.contents=function(e){const t=$t(e),n=Rt.exec(e),r=null==n?-6e4*t.getTimezoneOffset():"Z"===n[0]?0:36e5*parseInt(n[1],10)+6e4*parseInt(n[2],10);return ol(t.getTime(),r)}(e),!0}catch(e){return!1}}function al(e){return e<0?Math.ceil(e):Math.floor(e)}function ul(e=0,t=0,n=0,r=0,o=0){switch(arguments.length){case 1:return sl(arguments[0]);case 3:e=0,t=arguments[0],n=arguments[1],r=arguments[2],o=0}return 864e5*e+36e5*t+6e4*n+1e3*r+o}function sl(e){return Ft(Tt(e,1e4))}function cl(e,t="c",n){if(-1===["c","g","G"].indexOf(t))throw new Error("Custom formats are not supported");const r=Math.abs(function(e){return al(e/864e5)}(e)),o=Math.abs(function(e){return al(e%864e5/36e5)}(e)),i=Math.abs(function(e){return al(e%36e5/6e4)}(e)),l=Math.abs(function(e){return al(e%6e4/1e3)}(e)),a=Math.abs(function(e){return al(e%1e3)}(e));return`${e<0?"-":""}${0!==r||"c"!==t&&"g"!==t?"c"===t?r+".":r+":":""}${"g"===t?o:f(o,2)}:${f(i,2)}:${f(l,2)}${0!==a||"c"!==t&&"g"!==t?"g"===t?"."+f(a,3):"."+function(e,t,n){let r=e.toString(10);for(;r.length<t;)r="0"+r;for(;r.length<n;)r+="0";return r}(a,3,7):""}`}function fl(e,t){try{return t.contents=function(e){const t=e.search("\\."),n=e.search("\\:");if(-1===t&&-1===n){const t=parseInt(e,0);if(isNaN(t))throw new Error(`String '${e}' was not recognized as a valid TimeSpan.`);return ul(t,0,0,0,0)}if(n>0){const t=/^(-?)((\d+)\.)?(?:0*)([0-9]|0[0-9]|1[0-9]|2[0-3]):(?:0*)([0-5][0-9]|[0-9])(:(?:0*)([0-5][0-9]|[0-9]))?\.?(\d+)?$/.exec(e);if(null!=t&&null!=t[4]&&null!=t[5]){let n=0,r=0,o=0;const i=null!=t[1]&&"-"===t[1]?-1:1,l=+t[4],a=+t[5];if(null!=t[3]&&(n=+t[3]),null!=t[7]&&(o=+t[7]),null!=t[8])switch(t[8].length){case 1:r=100*+t[8];break;case 2:r=10*+t[8];break;case 3:r=+t[8];break;case 4:r=+t[8]/10;break;case 5:r=+t[8]/100;break;case 6:r=+t[8]/1e3;break;case 7:r=+t[8]/1e4;break;default:throw new Error(`String '${e}' was not recognized as a valid TimeSpan.`)}return i*ul(n,l,a,o,r)}}throw new Error(`String '${e}' was not recognized as a valid TimeSpan.`)}(e),!0}catch(e){return!1}}class dl{constructor(e,t){this.k=e,this.v=t}}function pl(e,t){return new dl(e,t)}function hl(e){return e.k}function ml(e){return e.v}class gl extends dl{constructor(e,t,n,r,o){super(e,t),this.left=n,this.right=r,this.h=0|o}}function vl(e,t,n,r,o){return new gl(e,t,n,r,o)}function yl(e){return e.left}function bl(e){return e.right}function wl(e){return e.h}function Sl(e){return function e(t,n){e:for(;;){const r=t,o=n;if(null!=o){const i=o;if(i instanceof gl){t=e(r+1,yl(i)),n=bl(i);continue e}return r+1|0}return 0|r}}(0,e)}function El(e,t,n,r){let o;if(null!=e){const t=e;o=t instanceof gl?wl(t):1}else o=0;let i;if(null!=r){const e=r;i=e instanceof gl?wl(e):1}else i=0;const l=0|(o<i?i:o);return 0===l?pl(t,n):vl(t,n,e,r,l+1)}function kl(e,t,n,r){let o,i,l,a,u;if(null!=e){const t=e;u=t instanceof gl?wl(t):1}else u=0;let s;if(null!=r){const e=r;s=e instanceof gl?wl(e):1}else s=0;if(s>u+2){const l=mn(r);if(l instanceof gl){if(o=yl(l),(null!=o?(i=o,i instanceof gl?wl(i):1):0)>u+1){const r=mn(yl(l));if(r instanceof gl)return El(El(e,t,n,yl(r)),hl(r),ml(r),El(bl(r),hl(l),ml(l),bl(l)));throw new Error("internal error: Map.rebalance")}return El(El(e,t,n,yl(l)),hl(l),ml(l),bl(l))}throw new Error("internal error: Map.rebalance")}if(u>s+2){const o=mn(e);if(o instanceof gl){if(l=bl(o),(null!=l?(a=l,a instanceof gl?wl(a):1):0)>s+1){const e=mn(bl(o));if(e instanceof gl)return El(El(yl(o),hl(o),ml(o),yl(e)),hl(e),ml(e),El(bl(e),t,n,r));throw new Error("internal error: Map.rebalance")}return El(yl(o),hl(o),ml(o),El(bl(o),t,n,r))}throw new Error("internal error: Map.rebalance")}return El(e,t,n,r)}function Cl(e,t,n,r){if(null!=r){const o=r,i=0|e.Compare(t,hl(o));return o instanceof gl?i<0?kl(Cl(e,t,n,yl(o)),hl(o),ml(o),bl(o)):0===i?vl(t,n,yl(o),bl(o),wl(o)):kl(yl(o),hl(o),ml(o),Cl(e,t,n,bl(o))):i<0?vl(t,n,void 0,r,2):0===i?pl(t,n):vl(t,n,r,void 0,2)}return pl(t,n)}function xl(e,t,n){e:for(;;){const r=e,o=t,i=n;if(null!=i){const l=i,a=0|r.Compare(o,hl(l));if(0===a)return hn(ml(l));if(l instanceof gl){e=r,t=o,n=a<0?yl(l):bl(l);continue e}return}return}}function Ol(e,t){!function e(t,n){e:for(;;){const r=t,o=n;if(null!=o){const i=o;if(i instanceof gl){e(r,yl(i)),r(hl(i),ml(i)),t=r,n=bl(i);continue e}r(hl(i),ml(i))}break}}(e,t)}function Tl(e,t){return function e(t,n){if(null!=n){const r=n;if(r instanceof gl){const n=e(t,yl(r)),o=t(hl(r),ml(r)),i=e(t,bl(r));return vl(hl(r),o,n,i,wl(r))}return pl(hl(r),t(hl(r),ml(r)))}}(e,t)}function Il(e,t,n){let r=n;Ol((e,n)=>{t[r]=[e,n],r=r+1|0},e)}function Nl(e,t){let n=void 0;for(let r=0;r<=t.length-1;r++){const o=t[r];n=Cl(e,o[0],o[1],n)}return n}function _l(e,t){if(r(t))return Nl(e,t);if(t instanceof Nn)return function(e,t){return $n((t,n)=>Cl(e,n[0],n[1],t),void 0,t)}(e,t);{const n=u(t);try{return function(e,t,n){for(;;){const r=e,o=t,i=n;if(!i["System.Collections.IEnumerator.MoveNext"]())return o;{const l=i["System.Collections.Generic.IEnumerator`1.get_Current"]();e=r,t=Cl(r,l[0],l[1],o),n=i}}}(e,void 0,n)}finally{n.Dispose()}}}class Pl extends U{constructor(e,t){super(),this.stack=e,this.started=t}}function Ml(e){e:for(;;){const t=e;if(Un(t))return jn();{const n=Bn(t),r=Hn(t);if(null!=r){const o=r;if(o instanceof gl){e=qn([yl(o),pl(hl(o),ml(o)),bl(o)],n);continue e}return t}e=n;continue e}}}function Dl(e){return new Pl(Ml(zn(e)),!1)}function Fl(e){if(e.started){const t=e.stack;if(Un(t))return function(){throw new Error("enumeration already finished")}();if(null!=Hn(t)){const e=Hn(t);if(e instanceof gl)throw new Error("Please report error: Map iterator, unexpected stack for current");return[hl(e),ml(e)]}throw new Error("Please report error: Map iterator, unexpected stack for current")}return function(){throw new Error("enumeration not started")}()}function Ll(e){let t=Dl(e);return{"System.Collections.Generic.IEnumerator`1.get_Current":()=>Fl(t),"System.Collections.IEnumerator.get_Current":()=>Fl(t),"System.Collections.IEnumerator.MoveNext":()=>function(e){if(e.started){const t=e.stack;if(Un(t))return!1;if(null!=Hn(t)){if(Hn(t)instanceof gl)throw new Error("Please report error: Map iterator, unexpected stack for moveNext");return e.stack=Ml(Bn(t)),!Un(e.stack)}throw new Error("Please report error: Map iterator, unexpected stack for moveNext")}return e.started=!0,!Un(e.stack)}(t),"System.Collections.IEnumerator.Reset"(){t=Dl(e)},Dispose(){}}}class Rl{constructor(e,t){this.comparer=e,this.tree=t}GetHashCode(){return 0|function(e){const t=(e,t)=>(e<<1)+t+631;let n=0;const r=u(e);try{for(;r["System.Collections.IEnumerator.MoveNext"]();){const e=r["System.Collections.Generic.IEnumerator`1.get_Current"]();n=0|t(n,y(e[0])),n=0|t(n,y(e[1]))}}finally{r.Dispose()}return 0|n}(this)}Equals(e){if(!(e instanceof Rl))return!1;{const t=u(this);try{const n=u(e);try{const e=()=>{const r=t["System.Collections.IEnumerator.MoveNext"]();if(r===n["System.Collections.IEnumerator.MoveNext"]()){if(r){const r=t["System.Collections.Generic.IEnumerator`1.get_Current"](),o=n["System.Collections.Generic.IEnumerator`1.get_Current"]();return!(!E(r[0],o[0])||!E(r[1],o[1]))&&e()}return!0}return!1};return e()}finally{n.Dispose()}}finally{t.Dispose()}}}toString(){return"map ["+sn("; ",no(e=>ln("({0}, {1})",e[0],e[1]),this))+"]"}get[Symbol.toStringTag](){return"FSharpMap"}toJSON(e){return Array.from(this)}GetEnumerator(){return Ll(this.tree)}[Symbol.iterator](){return s(this.GetEnumerator())}"System.Collections.IEnumerable.GetEnumerator"(){return Ll(this.tree)}CompareTo(e){const t=this;if(e instanceof Rl)return 0|function(e,t,n){const r=Vr(t);try{const t=Vr(n);try{let n=0,o=r["System.Collections.IEnumerator.MoveNext"](),i=t["System.Collections.IEnumerator.MoveNext"]();for(;0===n&&o&&i;)n=0|e(r["System.Collections.Generic.IEnumerator`1.get_Current"](),t["System.Collections.Generic.IEnumerator`1.get_Current"]()),0===n&&(o=r["System.Collections.IEnumerator.MoveNext"](),i=t["System.Collections.IEnumerator.MoveNext"]());return 0|(0!==n?n:o?1:i?-1:0)}finally{t.Dispose()}}finally{r.Dispose()}}((e,n)=>{const r=0|t.comparer.Compare(e[0],n[0]);return 0|(0!==r?r:O(e[1],n[1]))},t,e);throw new Error("not comparable\\nParameter name: obj")}"System.Collections.Generic.ICollection`1.Add2B595"(e){throw new Error("Map cannot be mutated")}"System.Collections.Generic.ICollection`1.Clear"(){throw new Error("Map cannot be mutated")}"System.Collections.Generic.ICollection`1.Remove2B595"(e){throw new Error("Map cannot be mutated")}"System.Collections.Generic.ICollection`1.Contains2B595"(e){return!!Hl(this,e[0])&&E(zl(this,e[0]),e[1])}"System.Collections.Generic.ICollection`1.CopyToZ2E171D71"(e,t){Il(this.tree,e,t)}"System.Collections.Generic.ICollection`1.get_IsReadOnly"(){return!0}"System.Collections.Generic.ICollection`1.get_Count"(){return 0|Ul(this)}"System.Collections.Generic.IReadOnlyCollection`1.get_Count"(){return 0|Ul(this)}get size(){return 0|Ul(this)}clear(){throw new Error("Map cannot be mutated")}delete(e){throw new Error("Map cannot be mutated")}entries(){return no(e=>[e[0],e[1]],this)}get(e){return zl(this,e)}has(e){return Hl(this,e)}keys(){return no(e=>e[0],this)}set(e,t){throw new Error("Map cannot be mutated")}values(){return no(e=>e[1],this)}forEach(e,t){const n=this;to(t=>{e(t[1],t[0],n)},n)}}function jl(e,t){return new Rl(e,t)}function Al(e){const t=Mr();return jl(t,_l(t,e))}function zl(e,t){return function(e,t,n){const r=xl(e,t,n);if(null==r)throw new Error;return mn(r)}(e.comparer,t,e.tree)}function Ul(e){return Sl(e.tree)}function Hl(e,t){return function(e,t,n){e:for(;;){const r=e,o=t,i=n;if(null!=i){const l=i,a=0|r.Compare(o,hl(l));if(l instanceof gl){if(a<0){e=r,t=o,n=yl(l);continue e}if(0===a)return!0;e=r,t=o,n=bl(l);continue e}return 0===a}return!1}}(e.comparer,t,e.tree)}function Bl(e,t,n){return function(e,t,n){return jl(e.comparer,Cl(e.comparer,t,n,e.tree))}(n,e,t)}function Vl(e,t){return function(e,t){return xl(e.comparer,t,e.tree)}(t,e)}function $l(e,t){return r=e,jl((n=t).comparer,Tl(r,n.tree));var n,r}function Gl(){return Rl.empty}Rl.empty=jl(Mr(),void 0);class Wl{constructor(e){this.k=e}}function ql(e){return new Wl(e)}function Ql(e){return e.k}class Kl extends Wl{constructor(e,t,n,r){super(e),this.left=t,this.right=n,this.h=0|r}}function Yl(e,t,n,r){return new Kl(e,t,n,r)}function Xl(e){return e.left}function Jl(e){return e.right}function Zl(e){return e.h}function ea(e){return function e(t,n){e:for(;;){const r=t,o=n;if(null!=r){const i=r;if(i instanceof Kl){t=Xl(i),n=e(Jl(i),o+1);continue e}return o+1|0}return 0|o}}(e,0)}function ta(e,t,n){let r;if(null!=e){const t=e;r=t instanceof Kl?Zl(t):1}else r=0;let o;if(null!=n){const e=n;o=e instanceof Kl?Zl(e):1}else o=0;const i=0|(r<o?o:r);return 0===i?ql(t):Yl(t,e,n,i+1)}function na(e,t,n){let r,o,i,l,a;if(null!=e){const t=e;a=t instanceof Kl?Zl(t):1}else a=0;let u;if(null!=n){const e=n;u=e instanceof Kl?Zl(e):1}else u=0;if(u>a+2){const i=mn(n);if(i instanceof Kl){if(r=Xl(i),(null!=r?(o=r,o instanceof Kl?Zl(o):1):0)>a+1){const n=mn(Xl(i));if(n instanceof Kl)return ta(ta(e,t,Xl(n)),Ql(n),ta(Jl(n),Ql(i),Jl(i)));throw new Error("internal error: Set.rebalance")}return ta(ta(e,t,Xl(i)),Ql(i),Jl(i))}throw new Error("internal error: Set.rebalance")}if(a>u+2){const r=mn(e);if(r instanceof Kl){if(i=Jl(r),(null!=i?(l=i,l instanceof Kl?Zl(l):1):0)>u+1){const e=mn(Jl(r));if(e instanceof Kl)return ta(ta(Xl(r),Ql(r),Xl(e)),Ql(e),ta(Jl(e),t,n));throw new Error("internal error: Set.rebalance")}return ta(Xl(r),Ql(r),ta(Jl(r),t,n))}throw new Error("internal error: Set.rebalance")}return ta(e,t,n)}function ra(e,t,n){if(null!=n){const r=n,o=0|e.Compare(t,Ql(r));if(r instanceof Kl)return o<0?na(ra(e,t,Xl(r)),Ql(r),Jl(r)):0===o?n:na(Xl(r),Ql(r),ra(e,t,Jl(r)));{const o=0|e.Compare(t,Ql(r));return o<0?Yl(t,void 0,n,2):0===o?n:Yl(t,n,void 0,2)}}return ql(t)}function oa(e,t,n){e:for(;;){const r=e,o=t,i=n;if(null!=i){const l=i,a=0|r.Compare(o,Ql(l));if(l instanceof Kl){if(a<0){e=r,t=o,n=Xl(l);continue e}if(0===a)return!0;e=r,t=o,n=Jl(l);continue e}return 0===a}return!1}}function ia(e,t){e:for(;;){const n=e,r=t;if(null!=r){const o=r;if(o instanceof Kl){ia(n,Xl(o)),n(Ql(o)),e=n,t=Jl(o);continue e}n(Ql(o))}break}}class la extends U{constructor(e,t){super(),this.stack=e,this.started=t}}function aa(e){e:for(;;){const t=e;if(Un(t))return jn();{const n=Hn(t),r=Bn(t);if(null!=n){const o=n;if(o instanceof Kl){e=qn([Xl(o),ql(Ql(o)),Jl(o)],r);continue e}return t}e=r;continue e}}}function ua(e){return new la(aa(zn(e)),!1)}function sa(e){if(e.started){const t=e.stack;if(Un(t))return function(){throw new Error("Enumeration already started")}();if(null!=Hn(t)){return Ql(Hn(t))}throw new Error("Please report error: Set iterator, unexpected stack for current")}return function(){throw new Error("Enumeration not started")}()}function ca(e){let t=ua(e);return{"System.Collections.Generic.IEnumerator`1.get_Current":()=>sa(t),"System.Collections.IEnumerator.get_Current":()=>sa(t),"System.Collections.IEnumerator.MoveNext":()=>function(e){if(e.started){const t=e.stack;if(Un(t))return!1;if(null!=Hn(t)){if(Hn(t)instanceof Kl)throw new Error("Please report error: Set iterator, unexpected stack for moveNext");return e.stack=aa(Bn(t)),!Un(e.stack)}throw new Error("Please report error: Set iterator, unexpected stack for moveNext")}return e.started=!0,!Un(e.stack)}(t),"System.Collections.IEnumerator.Reset"(){t=ua(e)},Dispose(){}}}function fa(e,t,n){return null==t?null==n?0:-1:null==n?1:0|function(e,t,n){e:for(;;){const r=e,o=t,i=n,l=[o,i];if(Un(l[0]))return Un(l[1])?0:-1;if(Un(l[1]))return 1;if(null!=Hn(l[1]))if(null!=Hn(l[0])){const a=Hn(l[0]),u=Hn(l[1]);if(a instanceof Kl)if(null==Xl(a)){if(!(u instanceof Kl)){const o=0|r.Compare(Ql(a),Ql(u));if(0!==o)return 0|o;e=r,t=An(Jl(a),Bn(l[0])),n=An(void 0,Bn(l[1]));continue e}if(null==Xl(u)){const o=0|r.Compare(Ql(a),Ql(u));if(0!==o)return 0|o;e=r,t=An(Jl(a),Bn(l[0])),n=An(Jl(u),Bn(l[1]));continue e}{const l=[o,i];let a,u,s,c,f;switch(Un(l[0])?Un(l[1])?a=2:null!=Hn(l[1])?(a=1,c=Bn(l[1]),f=Hn(l[1])):a=2:null!=Hn(l[0])?(a=0,u=Bn(l[0]),s=Hn(l[0])):Un(l[1])?a=2:null!=Hn(l[1])?(a=1,c=Bn(l[1]),f=Hn(l[1])):a=2,a){case 0:if(s instanceof Kl){e=r,t=qn([Xl(s),Yl(Ql(s),void 0,Jl(s),0)],u),n=i;continue e}e=r,t=qn([void 0,ql(Ql(s))],u),n=i;continue e;case 1:if(f instanceof Kl){e=r,t=o,n=qn([Xl(f),Yl(Ql(f),void 0,Jl(f),0)],c);continue e}e=r,t=o,n=qn([void 0,ql(Ql(f))],c);continue e;case 2:throw new Error("unexpected state in SetTree.compareStacks")}}}else{const l=[o,i];let a,u,s,c,f;switch(Un(l[0])?Un(l[1])?a=2:null!=Hn(l[1])?(a=1,c=Bn(l[1]),f=Hn(l[1])):a=2:null!=Hn(l[0])?(a=0,u=Bn(l[0]),s=Hn(l[0])):Un(l[1])?a=2:null!=Hn(l[1])?(a=1,c=Bn(l[1]),f=Hn(l[1])):a=2,a){case 0:if(s instanceof Kl){e=r,t=qn([Xl(s),Yl(Ql(s),void 0,Jl(s),0)],u),n=i;continue e}e=r,t=qn([void 0,ql(Ql(s))],u),n=i;continue e;case 1:if(f instanceof Kl){e=r,t=o,n=qn([Xl(f),Yl(Ql(f),void 0,Jl(f),0)],c);continue e}e=r,t=o,n=qn([void 0,ql(Ql(f))],c);continue e;case 2:throw new Error("unexpected state in SetTree.compareStacks")}}else{if(!(u instanceof Kl)){const o=0|r.Compare(Ql(a),Ql(u));if(0!==o)return 0|o;e=r,t=Bn(l[0]),n=Bn(l[1]);continue e}if(null==Xl(u)){const o=0|r.Compare(Ql(a),Ql(u));if(0!==o)return 0|o;e=r,t=An(void 0,Bn(l[0])),n=An(Jl(u),Bn(l[1]));continue e}{const l=[o,i];let a,u,s,c,f;switch(Un(l[0])?Un(l[1])?a=2:null!=Hn(l[1])?(a=1,c=Bn(l[1]),f=Hn(l[1])):a=2:null!=Hn(l[0])?(a=0,u=Bn(l[0]),s=Hn(l[0])):Un(l[1])?a=2:null!=Hn(l[1])?(a=1,c=Bn(l[1]),f=Hn(l[1])):a=2,a){case 0:if(s instanceof Kl){e=r,t=qn([Xl(s),Yl(Ql(s),void 0,Jl(s),0)],u),n=i;continue e}e=r,t=qn([void 0,ql(Ql(s))],u),n=i;continue e;case 1:if(f instanceof Kl){e=r,t=o,n=qn([Xl(f),Yl(Ql(f),void 0,Jl(f),0)],c);continue e}e=r,t=o,n=qn([void 0,ql(Ql(f))],c);continue e;case 2:throw new Error("unexpected state in SetTree.compareStacks")}}}}else{Hn(l[1]);const a=[o,i];let u,s,c,f,d;switch(Un(a[0])?Un(a[1])?u=2:null!=Hn(a[1])?(u=1,f=Bn(a[1]),d=Hn(a[1])):u=2:null!=Hn(a[0])?(u=0,s=Bn(a[0]),c=Hn(a[0])):Un(a[1])?u=2:null!=Hn(a[1])?(u=1,f=Bn(a[1]),d=Hn(a[1])):u=2,u){case 0:if(c instanceof Kl){e=r,t=qn([Xl(c),Yl(Ql(c),void 0,Jl(c),0)],s),n=i;continue e}e=r,t=qn([void 0,ql(Ql(c))],s),n=i;continue e;case 1:if(d instanceof Kl){e=r,t=o,n=qn([Xl(d),Yl(Ql(d),void 0,Jl(d),0)],f);continue e}e=r,t=o,n=qn([void 0,ql(Ql(d))],f);continue e;case 2:throw new Error("unexpected state in SetTree.compareStacks")}}else{if(null==Hn(l[0])){e=r,t=Bn(l[0]),n=Bn(l[1]);continue e}{Hn(l[0]);const a=[o,i];let u,s,c,f,d;switch(Un(a[0])?Un(a[1])?u=2:null!=Hn(a[1])?(u=1,f=Bn(a[1]),d=Hn(a[1])):u=2:null!=Hn(a[0])?(u=0,s=Bn(a[0]),c=Hn(a[0])):Un(a[1])?u=2:null!=Hn(a[1])?(u=1,f=Bn(a[1]),d=Hn(a[1])):u=2,u){case 0:if(c instanceof Kl){e=r,t=qn([Xl(c),Yl(Ql(c),void 0,Jl(c),0)],s),n=i;continue e}e=r,t=qn([void 0,ql(Ql(c))],s),n=i;continue e;case 1:if(d instanceof Kl){e=r,t=o,n=qn([Xl(d),Yl(Ql(d),void 0,Jl(d),0)],f);continue e}e=r,t=o,n=qn([void 0,ql(Ql(d))],f);continue e;case 2:throw new Error("unexpected state in SetTree.compareStacks")}}}break}}(e,zn(t),zn(n))}function da(e,t,n){let r=n;ia(e=>{t[r]=e,r=r+1|0},e)}function pa(e,t){return xn((t,n)=>ra(e,n,t),void 0,t)}function ha(e,t){if(r(t))return pa(e,t);if(t instanceof Nn)return function(e,t){return $n((t,n)=>ra(e,n,t),void 0,t)}(e,t);{const n=u(t);try{return function(e,t,n){for(;;){const r=e,o=t,i=n;if(!i["System.Collections.IEnumerator.MoveNext"]())return o;e=r,t=ra(r,i["System.Collections.Generic.IEnumerator`1.get_Current"](),o),n=i}}(e,void 0,n)}finally{n.Dispose()}}}class ma{constructor(e,t){this.comparer=e,this.tree=t}GetHashCode(){return 0|function(e){let t=0;const n=u(e);try{for(;n["System.Collections.IEnumerator.MoveNext"]();){const e=n["System.Collections.Generic.IEnumerator`1.get_Current"]();t=(t<<1)+y(e)+631|0}}finally{n.Dispose()}return 0|Math.abs(t)}(this)}Equals(e){return e instanceof ma&&0===fa(va(this),ya(this),ya(e))}toString(){return"set ["+sn("; ",no(e=>D(e),this))+"]"}get[Symbol.toStringTag](){return"FSharpSet"}toJSON(e){return Array.from(this)}CompareTo(e){return 0|fa(va(this),ya(this),ya(e))}"System.Collections.Generic.ICollection`1.Add2B595"(e){throw new Error("ReadOnlyCollection")}"System.Collections.Generic.ICollection`1.Clear"(){throw new Error("ReadOnlyCollection")}"System.Collections.Generic.ICollection`1.Remove2B595"(e){throw new Error("ReadOnlyCollection")}"System.Collections.Generic.ICollection`1.Contains2B595"(e){return oa(va(this),e,ya(this))}"System.Collections.Generic.ICollection`1.CopyToZ2E171D71"(e,t){da(ya(this),e,t)}"System.Collections.Generic.ICollection`1.get_IsReadOnly"(){return!0}"System.Collections.Generic.ICollection`1.get_Count"(){return 0|ba(this)}"System.Collections.Generic.IReadOnlyCollection`1.get_Count"(){return 0|ba(this)}GetEnumerator(){return ca(ya(this))}[Symbol.iterator](){return s(this.GetEnumerator())}"System.Collections.IEnumerable.GetEnumerator"(){return ca(ya(this))}get size(){return 0|ba(this)}add(e){throw new Error("Set cannot be mutated")}clear(){throw new Error("Set cannot be mutated")}delete(e){throw new Error("Set cannot be mutated")}has(e){return wa(this,e)}keys(){return no(e=>e,this)}values(){return no(e=>e,this)}entries(){return no(e=>[e,e],this)}forEach(e,t){const n=this;to(t=>{e(t,t,n)},n)}}function ga(e,t){return new ma(e,t)}function va(e){return e.comparer}function ya(e){return e.tree}function ba(e){return ea(ya(e))}function wa(e,t){return oa(va(e),t,ya(e))}function Sa(e,t){return ga(t,ha(t,e))}function Ea(e,t,n){try{return"Expecting "+e+" but instead got:"+(n?"\n":" ")+JSON.stringify(t,null,4)}catch(t){return"Expecting "+e+" but decoder failed. Couldn't report given value due to circular structure."+(n?"\n":" ")}}function ka(e,t){const n=2===t.tag?Ea(t.fields[0],t.fields[1],!0):1===t.tag?Ea(t.fields[0],t.fields[1],!1)+"\nReason: "+t.fields[2]:3===t.tag?Ea(t.fields[0],t.fields[1],!0):4===t.tag?Ea(t.fields[0],t.fields[1],!0)+"\nNode `"+t.fields[2]+"` is unkown.":5===t.tag?"Expecting "+t.fields[0]+".\n"+JSON.stringify(t.fields[1],null,4):7===t.tag?"The following errors were found:\n\n"+sn("\n\n",t.fields[0]):6===t.tag?"The following `failure` occurred with the decoder: "+t.fields[0]:Ea(t.fields[0],t.fields[1],!1);return 7===t.tag?n:"Error at: `"+e+"`\n"+n}function Ca(e,t,n){const r=t(e,n);if(1===r.tag){const e=r.fields[0];return new ur(1,ka(e[0],e[1]))}return new ur(0,r.fields[0])}function xa(e,t){try{return Ca("$",e,JSON.parse(t))}catch(e){if(e instanceof SyntaxError)return new ur(1,"Given an invalid JSON: "+e.message);throw e}}const Oa=e=>t=>{const n=e,r=t;if("number"==typeof r){const e=r;return isFinite(e)&&Math.floor(e)===e?-128<=e&&e<=127?new ur(0,(e+128&255)-128):new ur(1,[n,new oi(1,"a sbyte",e,"Value was either too large or too small for a sbyte")]):new ur(1,[n,new oi(1,"a sbyte",e,"Value is not an integral value")])}if("string"==typeof r){let e,t=0;return e=[xe(r,511,!1,8,new H(()=>t,e=>{t=0|e})),t],e[0]?new ur(0,e[1]):new ur(1,[n,new oi(0,"a sbyte",r)])}return new ur(1,[n,new oi(0,"a sbyte",r)])},Ta=e=>t=>{const n=e,r=t;if("number"==typeof r){const e=r;return isFinite(e)&&Math.floor(e)===e?0<=e&&e<=255?new ur(0,255&e):new ur(1,[n,new oi(1,"a byte",e,"Value was either too large or too small for a byte")]):new ur(1,[n,new oi(1,"a byte",e,"Value is not an integral value")])}if("string"==typeof r){let e,t=0;return e=[xe(r,511,!0,8,new H(()=>t,e=>{t=e})),t],e[0]?new ur(0,e[1]):new ur(1,[n,new oi(0,"a byte",r)])}return new ur(1,[n,new oi(0,"a byte",r)])},Ia=e=>t=>{const n="an int16",r=e,o=t;if("number"==typeof o){const e=o;return isFinite(e)&&Math.floor(e)===e?-32768<=e&&e<=32767?new ur(0,(e+32768&65535)-32768):new ur(1,[r,new oi(1,n,e,"Value was either too large or too small for "+n)]):new ur(1,[r,new oi(1,n,e,"Value is not an integral value")])}if("string"==typeof o){let e,t=0;return e=[xe(o,511,!1,16,new H(()=>t,e=>{t=0|e})),t],e[0]?new ur(0,e[1]):new ur(1,[r,new oi(0,n,o)])}return new ur(1,[r,new oi(0,n,o)])},Na=e=>t=>{const n="an uint16",r=e,o=t;if("number"==typeof o){const e=o;return isFinite(e)&&Math.floor(e)===e?0<=e&&e<=65535?new ur(0,65535&e):new ur(1,[r,new oi(1,n,e,"Value was either too large or too small for "+n)]):new ur(1,[r,new oi(1,n,e,"Value is not an integral value")])}if("string"==typeof o){let e,t=0;return e=[xe(o,511,!0,16,new H(()=>t,e=>{t=e})),t],e[0]?new ur(0,e[1]):new ur(1,[r,new oi(0,n,o)])}return new ur(1,[r,new oi(0,n,o)])},_a=e=>t=>{const n=e,r=t;if("number"==typeof r){const e=r;return isFinite(e)&&Math.floor(e)===e?-2147483648<=e&&e<=2147483647?new ur(0,~~e):new ur(1,[n,new oi(1,"an int",e,"Value was either too large or too small for an int")]):new ur(1,[n,new oi(1,"an int",e,"Value is not an integral value")])}if("string"==typeof r){let e,t=0;return e=[xe(r,511,!1,32,new H(()=>t,e=>{t=0|e})),t],e[0]?new ur(0,e[1]):new ur(1,[n,new oi(0,"an int",r)])}return new ur(1,[n,new oi(0,"an int",r)])},Pa=e=>t=>{const n="an uint32",r=e,o=t;if("number"==typeof o){const e=o;return isFinite(e)&&Math.floor(e)===e?0<=e&&e<=4294967295?new ur(0,e>>>0):new ur(1,[r,new oi(1,n,e,"Value was either too large or too small for "+n)]):new ur(1,[r,new oi(1,n,e,"Value is not an integral value")])}if("string"==typeof o){let e,t=0;return e=[xe(o,511,!0,32,new H(()=>t,e=>{t=e})),t],e[0]?new ur(0,e[1]):new ur(1,[r,new oi(0,n,o)])}return new ur(1,[r,new oi(0,n,o)])};function Ma(e,t){if("string"==typeof t){let r,o=Vt(-621355968e5,0);return r=[Gt(t,new H(()=>o,e=>{o=e})),o],r[0]?new ur(0,1===(n=r[1]).kind?n:Vt(n.getTime(),1)):new ur(1,[e,new oi(0,"a datetime",t)])}return new ur(1,[e,new oi(0,"a datetime",t)]);var n}function Da(e,t){if("string"==typeof t){let n,r=ol(-621355968e5,0);return n=[ll(t,new H(()=>r,e=>{r=e})),r],n[0]?new ur(0,n[1]):new ur(1,[e,new oi(0,"a datetimeoffset",t)])}return new ur(1,[e,new oi(0,"a datetime",t)])}function Fa(e,t,n,r){let o;const i=n+".["+p(e)+"]";if(Array.isArray(r)){const n=r;return e<n.length?t(i,n[e]):new ur(1,[i,new oi(5,"a longer array. Need index `"+p(e)+"` but there are only `"+(o=n.length,p(o)+"` entries"),r)])}return new ur(1,[i,new oi(0,"an array",r)])}function La(e,t,n){if(Array.isArray(n)){let r=-1;return sr(e=>Gn(e),xn((n,o)=>{if(r=r+1|0,0===n.tag){const i=e(t+".["+p(r)+"]",o);return 0===i.tag?new ur(0,An(i.fields[0],n.fields[0])):new ur(1,i.fields[0])}return n},new ur(0,jn()),n))}return new ur(1,[t,new oi(0,"a list",n)])}function Ra(e,t,n){if(Array.isArray(n)){let r=-1;const o=n;return xn((n,o)=>{if(r=r+1|0,0===n.tag){const i=n.fields[0],l=e(t+".["+p(r)+"]",o);return 0===l.tag?(i[r]=l.fields[0],new ur(0,i)):new ur(1,l.fields[0])}return n},new ur(0,En(new Array(o.length),0,o.length,null)),o)}return new ur(1,[t,new oi(0,"an array",n)])}function ja(e,t,n){return new ur(0,e)}function Aa(e,t,n,r){const o=t(n,r);return 0===o.tag?e(o.fields[0],n,r):new ur(1,o.fields[0])}function za(e,t,n,r){const o=t(n,r);return 1===o.tag?new ur(1,o.fields[0]):new ur(0,e(o.fields[0]))}function Ua(e,t){let n;const r=e;return n=e=>t=>Fa(0,r,e,t),e=>r=>Aa(N(3,e=>{let n;const r=t;return n=e=>t=>Fa(1,r,e,t),t=>r=>Aa((t,n,r)=>ja([e,t]),N(2,n),t,r)}),N(2,n),e,r)}function Ha(e){return Al(e)}function Ba(e,t,n,r){let o,i;return t.length!==r.length?new ur(1,[n,new oi(6,(o=0|r.length,i=0|t.length,nn(Zt("Expected %i %s but got %i"))(i)(e)(o)))]):In(N(3,M(e=>t=>r=>0===r.tag?sr(e=>An(e,r.fields[0]),t(n,e)):r,[0,[0,2],0])),r,t,new ur(0,jn()))}function Va(e,t,n,r,o,i){const l=(a=e=>ne(e)===r,pe(n).find(a));var a;if(null!=l){const n=l;return 0===i.length?new ur(0,we(n,[])):sr(e=>we(n,Vn(e)),Ba("union fields",kn(n=>Ga(e,t,!1,n[1]),be(n)),o,i))}return new ur(1,[o,new oi(6,"Cannot find case "+r+" in "+re(n))])}function $a(e,t,n,r){const o=new H(null),i=Bl(re(r),o,e);let l;if(ve(r)){const e=kn(e=>[si(t,ne(e)),Ga(i,t,!1,e[1])],he(r));l=t=>n=>sr(e=>function(e,t){const n=he(e);if(n.length!==t.length)throw new Error(`Expected an array of length ${n.length} but got ${t.length}`);return null!=e.construct?new e.construct(...t):n.reduce((e,[n,r],o)=>(e[n]=t[o],e),{})}(r,Vn(e)),function(e,t,n){return null===n||Object.getPrototypeOf(n||!1)!==Object.prototype?new ur(1,[t,new oi(0,"an object",n)]):Tn(N(2,e=>{const r=e[0];return o=>0===o.tag?sr(e=>An(e,o.fields[0]),e[1](t+"."+r)(n[r])):o}),e,new ur(0,jn()))}(e,t,n))}else if(ge(r))l=e=>n=>{if("string"==typeof n)return Va(i,t,r,n,e,[]);if(Array.isArray(n)){const o=n;return Va(i,t,r,o[0],e,o.slice(1,o.length))}return new ur(1,[e,new oi(0,"a string or array",n)])};else{if(!n){let e;const t=re(r);throw e=nn(Zt("Cannot generate auto decoder for %s. Please pass an extra decoder."))(t),new Error(e)}l=e=>t=>new ur(1,[e,new oi(2,"an extra coder for "+re(r),t)])}return o.contents=l,l}function Ga(e,t,n,r){let o;const i=re(r),l=Vl(i,e);if(null==l){if(oe(r)){const n=Ga(e,t,!1,ie(r));return e=>t=>Ra(N(2,n),e,t)}if(ae(r)){const e=re(se(r));if("System.SByte"===e)return e=>t=>{const n=r,o=e,i=t,l=Oa(o)(i);if(1===l.tag)return new ur(1,l.fields[0]);{const e=l.fields[0];return Zr(e,ce(n),{Equals:(e,t)=>e===t,GetHashCode:e=>g(e)})?new ur(0,de(n,e.toString())):new ur(1,[o,new oi(1,re(n),i,"Unkown value provided for the enum")])}};if("System.Byte"===e)return e=>t=>{const n=r,o=e,i=t,l=Ta(o)(i);if(1===l.tag)return new ur(1,l.fields[0]);{const e=l.fields[0];return Zr(e,ce(n),{Equals:(e,t)=>e===t,GetHashCode:e=>g(e)})?new ur(0,de(n,e.toString())):new ur(1,[o,new oi(1,re(n),i,"Unkown value provided for the enum")])}};if("System.Int16"===e)return e=>t=>{const n=r,o=e,i=t,l=Ia(o)(i);if(1===l.tag)return new ur(1,l.fields[0]);{const e=l.fields[0];return Zr(e,ce(n),{Equals:(e,t)=>e===t,GetHashCode:e=>g(e)})?new ur(0,de(n,(a=(a=e)<0&&null!=u&&10!==u?65535+a+1:a).toString(u))):new ur(1,[o,new oi(1,re(n),i,"Unkown value provided for the enum")])}var a,u};if("System.UInt16"===e)return e=>t=>{const n=r,o=e,i=t,l=Na(o)(i);if(1===l.tag)return new ur(1,l.fields[0]);{const e=l.fields[0];return Zr(e,ce(n),{Equals:(e,t)=>e===t,GetHashCode:e=>g(e)})?new ur(0,de(n,e.toString())):new ur(1,[o,new oi(1,re(n),i,"Unkown value provided for the enum")])}};if("System.Int32"===e)return e=>t=>{const n=r,o=e,i=t,l=_a(o)(i);if(1===l.tag)return new ur(1,l.fields[0]);{const e=l.fields[0];return Zr(e,ce(n),{Equals:(e,t)=>e===t,GetHashCode:e=>g(e)})?new ur(0,de(n,p(e))):new ur(1,[o,new oi(1,re(n),i,"Unkown value provided for the enum")])}};if("System.UInt32"===e)return e=>t=>{const n=r,o=e,i=t,l=Pa(o)(i);if(1===l.tag)return new ur(1,l.fields[0]);{const e=l.fields[0];return Zr(e,ce(n),{Equals:(e,t)=>e===t,GetHashCode:e=>g(e)})?new ur(0,de(n,e.toString())):new ur(1,[o,new oi(1,re(n),i,"Unkown value provided for the enum")])}};{const e=re(r),t=rn(Zt("Cannot generate auto decoder for %s.\nThoth.Json.Net only support the folluwing enum types:\n- sbyte\n- byte\n- int16\n- uint16\n- int\n- uint32\nIf you can't use one of these types, please pass an extra decoder.\n "))(e);return e=>{const n=t(e);return e=>n(e)}}}if(le(r)){if(ye(r)){const n=kn(n=>Ga(e,t,!1,n),me(r));return e=>t=>Array.isArray(t)?sr(e=>Vn(e),Ba("tuple elements",n,e,t)):new ur(1,[e,new oi(0,"an array",t)])}{const i=re(ue(r));if("Microsoft.FSharp.Core.FSharpOption`1[System.Object]"===i){const n=Ga(e,t,!0,$(r)[0]);return e=>t=>{return r=N(2,n),o=e,null==(i=t)?new ur(0,void 0):sr(e=>hn(e),r(o,i));var r,o,i}}if("Microsoft.FSharp.Collections.FSharpList`1[System.Object]"===i){const n=Ga(e,t,!1,$(r)[0]);return e=>t=>La(N(2,n),e,t)}if("Microsoft.FSharp.Collections.FSharpMap`2[System.Object,System.Object]"===i){const n=Ga(e,t,!1,$(r)[0]),i=Ga(e,t,!1,$(r)[1]);let l;const a=Qn([e=>t=>function(e,t,n,r){return null===r||Object.getPrototypeOf(r||!1)!==Object.prototype?new ur(1,[n,new oi(0,"an object",r)]):eo((o,i)=>{if(0===o.tag){const l=e(n,i);if(0===l.tag){const e=t(n+"."+i,r[i]);return 0===e.tag?new ur(0,An([l.fields[0],e.fields[0]],o.fields[0])):new ur(1,e.fields[0])}return new ur(1,l.fields[0])}return o},new ur(0,jn()),Object.keys(r))}(N(2,n),N(2,i),e,t),(o=Ua(N(2,n),N(2,i)),e=>t=>La(N(2,o),e,t))]);return l=e=>t=>{return n=e,r=t,((e,t)=>{e:for(;;){const o=e,i=t;if(Un(o))return new ur(1,[n,new oi(7,i)]);{const l=Ca(n,N(2,Hn(o)),r);if(1===l.tag){e=Bn(o),t=Yn(i,zn(l.fields[0]));continue e}return new ur(0,l.fields[0])}}})(a,jn());var n,r},e=>t=>za(e=>Ha(e),N(2,l),e,t)}if("Microsoft.FSharp.Collections.FSharpSet`1[System.Object]"===i){const n=Ga(e,t,!1,$(r)[0]);return e=>t=>{const r=Ra(N(2,n),e,t);return 0===r.tag?new ur(0,Sa(r.fields[0],{Compare:(e,t)=>O(e,t)})):new ur(1,r.fields[0])}}return $a(e,t,n,r)}}return"System.Boolean"===i?e=>t=>{return n=e,"boolean"==typeof(r=t)?new ur(0,r):new ur(1,[n,new oi(0,"a boolean",r)]);var n,r}:"Microsoft.FSharp.Core.Unit"===i?e=>t=>{return n=e,null==(r=t)?new ur(0,void 0):new ur(1,[n,new oi(0,"null",r)]);var n,r}:"System.String"===i?e=>t=>{return n=e,"string"==typeof(r=t)?new ur(0,r):new ur(1,[n,new oi(0,"a string",r)]);var n,r}:"System.SByte"===i?Oa:"System.Byte"===i?Ta:"System.Int16"===i?Ia:"System.UInt16"===i?Na:"System.Int32"===i?_a:"System.UInt32"===i?Pa:"System.Double"===i?e=>t=>{return n=e,"number"==typeof(r=t)?new ur(0,r):new ur(1,[n,new oi(0,"a float",r)]);var n,r}:"System.Single"===i?e=>t=>{return n=e,"number"==typeof(r=t)?new ur(0,r):new ur(1,[n,new oi(0,"a float32",r)]);var n,r}:"System.DateTime"===i?e=>t=>Ma(e,t):"System.DateTimeOffset"===i?e=>t=>Da(e,t):"System.TimeSpan"===i?e=>t=>function(e,t){if("string"==typeof t){let n,r=0;return n=[fl(t,new H(()=>r,e=>{r=e})),r],n[0]?new ur(0,n[1]):new ur(1,[e,new oi(0,"a timespan",t)])}return new ur(1,[e,new oi(0,"a timespan",t)])}(e,t):"System.Guid"===i?e=>t=>function(e,t){if("string"==typeof t){let n,r="00000000-0000-0000-0000-000000000000";return n=[No(t,new H(()=>r,e=>{r=e})),r],n[0]?new ur(0,n[1]):new ur(1,[e,new oi(0,"a guid",t)])}return new ur(1,[e,new oi(0,"a guid",t)])}(e,t):"System.Object"===i?e=>e=>new ur(0,e):$a(e,t,n,r)}{const e=l;return t=>n=>e.contents(t)(n)}}function Wa(e){return null!=e?$l((e,t)=>new H(t[1]),e.Coders):Gl()}function qa(e,t,n){const r=vn(e,new ii(0)),o=mn(n).ResolveType();return Ga(Wa(t),r,!1,o)}function Qa(e,t,n,r){return xa(N(2,qa(t,n,r)),e)}function Ka(e,t){return e<=1?t:t+"s"}class Ya extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["AccessRole"]}}function Xa(e){return er(new Ya(0,"FastTrack.Access"),e,{Equals:(e,t)=>E(e,t),GetHashCode:e=>b(e)})?hn(void 0):void 0}class Ja extends U{constructor(e,t){super(),this.UserName=e,this.Roles=t}}function Za(e){let t,n;const r=fn(null==e?"":e,["."],null,0);if(n=On(0,r,null)||3!==r.length?new ur(1,"Failed to identify the user"):Qa((t=r[1],atob(t)),void 0,void 0,{ResolveType:()=>Q(["name",ee],["roles",J(ee)])}),1===n.tag)return new Ja(void 0,jn());{const e=n.fields[0];return new Ja(e.name,Jn(e=>function(e){return new Ya(0,e)}(e),Qn(e.roles)))}}class eu extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["RequestUpdateApiVersion","NoAction"]}}class tu extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Tab"]}}function nu(e,t){const n=(null!=t?"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300":"border-indigo-500 text-indigo-600")+" whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm";return r=Object(Nr.createElement)("a",I(Kr($r(()=>Jr(Qr(["key",e]),$r(()=>Jr(Qr(["children",e]),$r(()=>Jr(Qr(["className",n]),$r(()=>null!=t?Qr(["href",Bo(zn(mn(t)),1)]):qr())))))))))),new tu(0,r);var r}class ru extends U{constructor(e,t,n,r,o,i){super(),this.AccountName=e,this.ApiVersion=t,this.Email=n,this.PayeeIntegrationFlag=r,this.PayeeType=o,this.PayeeUpdateFlag=i}}class ou extends U{constructor(e,t,n,r){super(),this.Id=e,this.FastTrack=t,this.Flare=n,this.LastSummaryEmailChecked=r}}function iu(){return q("Middleware.FastTrack.AdminUI.Services.BackendDto.Flare.Account",[],ou,()=>[["Id",ee],["FastTrack",q("Middleware.FastTrack.AdminUI.Services.BackendDto.Common.FastTrackDetails",[],ru,()=>[["AccountName",Y(ee)],["ApiVersion",ee],["Email",Y(ee)],["PayeeIntegrationFlag",te],["PayeeType",Y(ee)],["PayeeUpdateFlag",te]])],["Flare",Y(q("Middleware.FastTrack.AdminUI.Services.BackendDto.Flare.FlareDetails",[],lu,()=>[["AccountName",Y(ee)],["RepName",ee],["WebhookSubscriptionId",Y(ee)],["UseDivisionLookup",te]]))],["LastSummaryEmailChecked",Y(ee)]])}class lu extends U{constructor(e,t,n,r){super(),this.AccountName=e,this.RepName=t,this.WebhookSubscriptionId=n,this.UseDivisionLookup=r}}class au extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["HasNotStartedYet","InProgress","Resolved","Failed"]}}class uu extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["ColumnHeader"]}}function su(e){return new uu(0,e)}class cu extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["RowCell"]}}function fu(e){return new cu(0,e)}function du(e){return su(Object(Nr.createElement)("th",I(Qn([["className","px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"],["scope","col"],["children",e]]))))}function pu(e,t){return fu(Object(Nr.createElement)("td",{className:sn(" ",Jr(e,["px-6","py-4","whitespace-nowrap","text-sm"])),children:t}))}function hu(e,t,...n){if(e in t){let r=t[e];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(e=>`"${e}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,hu),r}function mu(...e){return Array.from(new Set(e.flatMap(e=>"string"==typeof e?e.split(" "):[]))).filter(Boolean).join(" ")}var gu,vu,yu=((vu=yu||{})[vu.None=0]="None",vu[vu.RenderStrategy=1]="RenderStrategy",vu[vu.Static=2]="Static",vu),bu=((gu=bu||{})[gu.Unmount=0]="Unmount",gu[gu.Hidden=1]="Hidden",gu);function wu({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:l}){let a=Eu(t,e);if(i)return Su(a,n,r,l);let u=null!=o?o:0;if(2&u){let{static:e=!1,...t}=a;if(e)return Su(t,n,r,l)}if(1&u){let{unmount:e=!0,...t}=a;return hu(e?0:1,{0:()=>null,1:()=>Su({...t,hidden:!0,style:{display:"none"}},n,r,l)})}return Su(a,n,r,l)}function Su(e,t={},n,r){let{as:o=n,children:i,refName:l="ref",...a}=xu(e,["unmount","static"]),u=void 0!==e.ref?{[l]:e.ref}:{},s="function"==typeof i?i(t):i;"className"in a&&a.className&&"function"==typeof a.className&&(a.className=a.className(t));let c={};if(t){let e=!1,n=[];for(let[r,o]of Object.entries(t))"boolean"==typeof o&&(e=!0),!0===o&&n.push(r);e&&(c["data-headlessui-state"]=n.join(" "))}if(o===Nr.Fragment&&Object.keys(Cu(a)).length>0){if(!Object(Nr.isValidElement)(s)||Array.isArray(s)&&s.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(a).map(e=>" - "+e).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(e=>" - "+e).join("\n")].join("\n"));let e=s.props,t="function"==typeof(null==e?void 0:e.className)?(...t)=>mu(null==e?void 0:e.className(...t),a.className):mu(null==e?void 0:e.className,a.className),n=t?{className:t}:{};return Object(Nr.cloneElement)(s,Object.assign({},Eu(s.props,Cu(xu(a,["ref"]))),c,u,function(...e){return{ref:e.every(e=>null==e)?void 0:t=>{for(let n of e)null!=n&&("function"==typeof n?n(t):n.current=t)}}}(s.ref,u.ref),n))}return Object(Nr.createElement)(o,Object.assign({},xu(a,["ref"]),o!==Nr.Fragment&&u,o!==Nr.Fragment&&c),s)}function Eu(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(e=>[e,void 0])));for(let e in n)Object.assign(t,{[e](t,...r){let o=n[e];for(let e of o){if((t instanceof Event||(null==t?void 0:t.nativeEvent)instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function ku(e){var t;return Object.assign(Object(Nr.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function Cu(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function xu(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}function Ou(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}function Tu(){let e=[],t={addEventListener:(e,n,r,o)=>(e.addEventListener(n,r,o),t.add(()=>e.removeEventListener(n,r,o))),requestAnimationFrame(...e){let n=requestAnimationFrame(...e);return t.add(()=>cancelAnimationFrame(n))},nextFrame:(...e)=>t.requestAnimationFrame(()=>t.requestAnimationFrame(...e)),setTimeout(...e){let n=setTimeout(...e);return t.add(()=>clearTimeout(n))},microTask(...e){let n={current:!0};return Ou(()=>{n.current&&e[0]()}),t.add(()=>{n.current=!1})},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add(()=>{Object.assign(e.style,{[t]:r})})},group(e){let t=Tu();return e(t),this.add(()=>t.dispose())},add:t=>(e.push(t),()=>{let n=e.indexOf(t);if(n>=0)for(let t of e.splice(n,1))t()}),dispose(){for(let t of e.splice(0))t()}};return t}function Iu(){let[e]=Object(Nr.useState)(Tu);return Object(Nr.useEffect)(()=>()=>e.dispose(),[e]),e}var Nu=Object.defineProperty,_u=(e,t,n)=>(((e,t,n)=>{t in e?Nu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);let Pu=new class{constructor(){_u(this,"current",this.detect()),_u(this,"handoffState","pending"),_u(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return"undefined"==typeof window||"undefined"==typeof document?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}},Mu=(e,t)=>{Pu.isServer?Object(Nr.useEffect)(e,t):Object(Nr.useLayoutEffect)(e,t)};function Du(e){let t=Object(Nr.useRef)(e);return Mu(()=>{t.current=e},[e]),t}let Fu=function(e){let t=Du(e);return _r.a.useCallback((...e)=>t.current(...e),[t])},Lu=Symbol();function Ru(...e){let t=Object(Nr.useRef)(e);Object(Nr.useEffect)(()=>{t.current=e},[e]);let n=Fu(e=>{for(let n of t.current)null!=n&&("function"==typeof n?n(e):n.current=e)});return e.every(e=>null==e||(null==e?void 0:e[Lu]))?void 0:n}function ju(){let e=function(){let e="undefined"==typeof document;return"useSyncExternalStore"in Nr&&Nr.useSyncExternalStore(()=>()=>{},()=>!1,()=>!e)}(),[t,n]=Nr.useState(Pu.isHandoffComplete);return t&&!1===Pu.isHandoffComplete&&n(!1),Nr.useEffect(()=>{!0!==t&&n(!0)},[t]),Nr.useEffect(()=>Pu.handoff(),[]),!e&&t}var Au;let zu=null!=(Au=_r.a.useId)?Au:function(){let e=ju(),[t,n]=_r.a.useState(e?()=>Pu.nextId():null);return Mu(()=>{null===t&&n(Pu.nextId())},[t]),null!=t?""+t:void 0};var Uu,Hu=((Uu=Hu||{}).Space=" ",Uu.Enter="Enter",Uu.Escape="Escape",Uu.Backspace="Backspace",Uu.Delete="Delete",Uu.ArrowLeft="ArrowLeft",Uu.ArrowUp="ArrowUp",Uu.ArrowRight="ArrowRight",Uu.ArrowDown="ArrowDown",Uu.Home="Home",Uu.End="End",Uu.PageUp="PageUp",Uu.PageDown="PageDown",Uu.Tab="Tab",Uu);var Bu=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Bu||{});function Vu(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=null!=r?r:-1,i=(()=>{switch(e.focus){case 0:return n.findIndex(e=>!t.resolveDisabled(e));case 1:{let e=n.slice().reverse().findIndex((e,n,r)=>!(-1!==o&&r.length-n-1>=o)&&!t.resolveDisabled(e));return-1===e?e:n.length-1-e}case 2:return n.findIndex((e,n)=>!(n<=o)&&!t.resolveDisabled(e));case 3:{let e=n.slice().reverse().findIndex(e=>!t.resolveDisabled(e));return-1===e?e:n.length-1-e}case 4:return n.findIndex(n=>t.resolveId(n)===e.id);case 5:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}})();return-1===i?r:i}function $u(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=""===(null==t?void 0:t.getAttribute("disabled"));return(!r||!function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(n))&&r}function Gu(e){return Pu.isServer?null:e instanceof Node?e.ownerDocument:null!=e&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let Wu=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>e+":not([tabindex='-1'])").join(",");var qu,Qu,Ku,Yu=((Ku=Yu||{})[Ku.First=1]="First",Ku[Ku.Previous=2]="Previous",Ku[Ku.Next=4]="Next",Ku[Ku.Last=8]="Last",Ku[Ku.WrapAround=16]="WrapAround",Ku[Ku.NoScroll=32]="NoScroll",Ku),Xu=((Qu=Xu||{})[Qu.Error=0]="Error",Qu[Qu.Overflow=1]="Overflow",Qu[Qu.Success=2]="Success",Qu[Qu.Underflow=3]="Underflow",Qu),Ju=((qu=Ju||{})[qu.Previous=-1]="Previous",qu[qu.Next=1]="Next",qu);function Zu(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(Wu)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}var es=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(es||{});function ts(e,t=0){var n;return e!==(null==(n=Gu(e))?void 0:n.body)&&hu(t,{0:()=>e.matches(Wu),1(){let t=e;for(;null!==t;){if(t.matches(Wu))return!0;t=t.parentElement}return!1}})}function ns(e){let t=Gu(e);Tu().nextFrame(()=>{t&&!ts(t.activeElement,0)&&os(e)})}var rs=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(rs||{});function os(e){null==e||e.focus({preventScroll:!0})}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{1===e.detail?delete document.documentElement.dataset.headlessuiFocusVisible:0===e.detail&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let is=["textarea","input"].join(",");function ls(e,t=(e=>e)){return e.slice().sort((e,n)=>{let r=t(e),o=t(n);if(null===r||null===o)return 0;let i=r.compareDocumentPosition(o);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function as(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,l=Array.isArray(e)?n?ls(e):e:Zu(e);o.length>0&&l.length>1&&(l=l.filter(e=>!o.includes(e))),r=null!=r?r:i.activeElement;let a,u=(()=>{if(5&t)return 1;if(10&t)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),s=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,l.indexOf(r))-1;if(4&t)return Math.max(0,l.indexOf(r))+1;if(8&t)return l.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=32&t?{preventScroll:!0}:{},f=0,d=l.length;do{if(f>=d||f+d<=0)return 0;let e=s+f;if(16&t)e=(e+d)%d;else{if(e<0)return 3;if(e>=d)return 1}a=l[e],null==a||a.focus(c),f+=u}while(a!==i.activeElement);return 6&t&&function(e){var t,n;return null!=(n=null==(t=null==e?void 0:e.matches)?void 0:t.call(e,is))&&n}(a)&&a.select(),2}function us(e,t,n){let r=Du(t);Object(Nr.useEffect)(()=>{function t(e){r.current(e)}return document.addEventListener(e,t,n),()=>document.removeEventListener(e,t,n)},[e,n])}function ss(e,t,n){let r=Du(t);Object(Nr.useEffect)(()=>{function t(e){r.current(e)}return window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)},[e,n])}function cs(e,t,n=!0){let r=Object(Nr.useRef)(!1);function o(n,o){if(!r.current||n.defaultPrevented)return;let i=o(n);if(null===i||!i.getRootNode().contains(i)||!i.isConnected)return;let l=function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(e);for(let e of l){if(null===e)continue;let t=e instanceof HTMLElement?e:e.current;if(null!=t&&t.contains(i)||n.composed&&n.composedPath().includes(t))return}return!ts(i,es.Loose)&&-1!==i.tabIndex&&n.preventDefault(),t(n,i)}Object(Nr.useEffect)(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);let i=Object(Nr.useRef)(null);us("pointerdown",e=>{var t,n;r.current&&(i.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)},!0),us("mousedown",e=>{var t,n;r.current&&(i.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)},!0),us("click",e=>{i.current&&(o(e,()=>i.current),i.current=null)},!0),us("touchend",e=>o(e,()=>e.target instanceof HTMLElement?e.target:null),!0),ss("blur",e=>o(e,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}let fs=Object(Nr.createContext)(null);fs.displayName="OpenClosedContext";var ds=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(ds||{});function ps(){return Object(Nr.useContext)(fs)}function hs({value:e,children:t}){return _r.a.createElement(fs.Provider,{value:e},t)}function ms(e){var t;if(e.type)return e.type;let n=null!=(t=e.as)?t:"button";return"string"==typeof n&&"button"===n.toLowerCase()?"button":void 0}function gs(e,t){let[n,r]=Object(Nr.useState)(()=>ms(e));return Mu(()=>{r(ms(e))},[e.type,e.as]),Mu(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}function vs(...e){return Object(Nr.useMemo)(()=>Gu(...e),[...e])}function ys(e){return[e.screenX,e.screenY]}let bs=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function ws(e){var t,n;let r=null!=(t=e.innerText)?t:"",o=e.cloneNode(!0);if(!(o instanceof HTMLElement))return r;let i=!1;for(let e of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))e.remove(),i=!0;let l=i?null!=(n=o.innerText)?n:"":r;return bs.test(l)&&(l=l.replace(bs,"")),l}function Ss(e){let t=Object(Nr.useRef)(""),n=Object(Nr.useRef)("");return Fu(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let i=function(e){let t=e.getAttribute("aria-label");if("string"==typeof t)return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let e=n.split(" ").map(e=>{let t=document.getElementById(e);if(t){let e=t.getAttribute("aria-label");return"string"==typeof e?e.trim():ws(t).trim()}return null}).filter(Boolean);if(e.length>0)return e.join(", ")}return ws(e).trim()}(r).trim().toLowerCase();return t.current=o,n.current=i,i})}var Es=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Es||{}),ks=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(ks||{}),Cs=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e))(Cs||{});function xs(e,t=(e=>e)){let n=null!==e.activeItemIndex?e.items[e.activeItemIndex]:null,r=ls(t(e.items.slice()),e=>e.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return-1===o&&(o=null),{items:r,activeItemIndex:o}}let Os={1:e=>1===e.menuState?e:{...e,activeItemIndex:null,menuState:1},0:e=>0===e.menuState?e:{...e,__demoMode:!1,menuState:0},2:(e,t)=>{var n;let r=xs(e),o=Vu(t,{resolveItems:()=>r.items,resolveActiveIndex:()=>r.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeItemIndex:o,activationTrigger:null!=(n=t.trigger)?n:1}},3:(e,t)=>{let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),o=(null!==e.activeItemIndex?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find(e=>{var t;return(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))&&!e.dataRef.current.disabled}),i=o?e.items.indexOf(o):-1;return-1===i||i===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:i,activationTrigger:1}},4:e=>""===e.searchQuery?e:{...e,searchQuery:"",searchActiveItemIndex:null},5:(e,t)=>{let n=xs(e,e=>[...e,{id:t.id,dataRef:t.dataRef}]);return{...e,...n}},6:(e,t)=>{let n=xs(e,e=>{let n=e.findIndex(e=>e.id===t.id);return-1!==n&&e.splice(n,1),e});return{...e,...n,activationTrigger:1}}},Ts=Object(Nr.createContext)(null);function Is(e){let t=Object(Nr.useContext)(Ts);if(null===t){let t=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Is),t}return t}function Ns(e,t){return hu(t.type,Os,e,t)}Ts.displayName="MenuContext";let _s=Nr.Fragment;let Ps=yu.RenderStrategy|yu.Static;let Ms=Nr.Fragment;let Ds=ku((function(e,t){let{__demoMode:n=!1,...r}=e,o=Object(Nr.useReducer)(Ns,{__demoMode:n,menuState:n?0:1,buttonRef:Object(Nr.createRef)(),itemsRef:Object(Nr.createRef)(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:i,itemsRef:l,buttonRef:a},u]=o,s=Ru(t);cs([a,l],(e,t)=>{var n;u({type:1}),ts(t,es.Loose)||(e.preventDefault(),null==(n=a.current)||n.focus())},0===i);let c=Fu(()=>{u({type:1})}),f=Object(Nr.useMemo)(()=>({open:0===i,close:c}),[i,c]),d={ref:s};return _r.a.createElement(Ts.Provider,{value:o},_r.a.createElement(hs,{value:hu(i,{0:ds.Open,1:ds.Closed})},wu({ourProps:d,theirProps:r,slot:f,defaultTag:_s,name:"Menu"})))})),Fs=ku((function(e,t){var n;let r=zu(),{id:o="headlessui-menu-button-"+r,...i}=e,[l,a]=Is("Menu.Button"),u=Ru(l.buttonRef,t),s=Iu(),c=Fu(e=>{switch(e.key){case Hu.Space:case Hu.Enter:case Hu.ArrowDown:e.preventDefault(),e.stopPropagation(),a({type:0}),s.nextFrame(()=>a({type:2,focus:Bu.First}));break;case Hu.ArrowUp:e.preventDefault(),e.stopPropagation(),a({type:0}),s.nextFrame(()=>a({type:2,focus:Bu.Last}))}}),f=Fu(e=>{switch(e.key){case Hu.Space:e.preventDefault()}}),d=Fu(t=>{if($u(t.currentTarget))return t.preventDefault();e.disabled||(0===l.menuState?(a({type:1}),s.nextFrame(()=>{var e;return null==(e=l.buttonRef.current)?void 0:e.focus({preventScroll:!0})})):(t.preventDefault(),a({type:0})))}),p=Object(Nr.useMemo)(()=>({open:0===l.menuState}),[l]);return wu({ourProps:{ref:u,id:o,type:gs(e,l.buttonRef),"aria-haspopup":"menu","aria-controls":null==(n=l.itemsRef.current)?void 0:n.id,"aria-expanded":0===l.menuState,onKeyDown:c,onKeyUp:f,onClick:d},theirProps:i,slot:p,defaultTag:"button",name:"Menu.Button"})})),Ls=ku((function(e,t){var n,r;let o=zu(),{id:i="headlessui-menu-items-"+o,...l}=e,[a,u]=Is("Menu.Items"),s=Ru(a.itemsRef,t),c=vs(a.itemsRef),f=Iu(),d=ps(),p=null!==d?(d&ds.Open)===ds.Open:0===a.menuState;Object(Nr.useEffect)(()=>{let e=a.itemsRef.current;e&&0===a.menuState&&e!==(null==c?void 0:c.activeElement)&&e.focus({preventScroll:!0})},[a.menuState,a.itemsRef,c]),function({container:e,accept:t,walk:n,enabled:r=!0}){let o=Object(Nr.useRef)(t),i=Object(Nr.useRef)(n);Object(Nr.useEffect)(()=>{o.current=t,i.current=n},[t,n]),Mu(()=>{if(!e||!r)return;let t=Gu(e);if(!t)return;let n=o.current,l=i.current,a=Object.assign(e=>n(e),{acceptNode:n}),u=t.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,a,!1);for(;u.nextNode();)l(u.currentNode)},[e,r,o,i])}({container:a.itemsRef.current,enabled:0===a.menuState,accept:e=>"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let h=Fu(e=>{var t,n;switch(f.dispose(),e.key){case Hu.Space:if(""!==a.searchQuery)return e.preventDefault(),e.stopPropagation(),u({type:3,value:e.key});case Hu.Enter:if(e.preventDefault(),e.stopPropagation(),u({type:1}),null!==a.activeItemIndex){let{dataRef:e}=a.items[a.activeItemIndex];null==(n=null==(t=e.current)?void 0:t.domRef.current)||n.click()}ns(a.buttonRef.current);break;case Hu.ArrowDown:return e.preventDefault(),e.stopPropagation(),u({type:2,focus:Bu.Next});case Hu.ArrowUp:return e.preventDefault(),e.stopPropagation(),u({type:2,focus:Bu.Previous});case Hu.Home:case Hu.PageUp:return e.preventDefault(),e.stopPropagation(),u({type:2,focus:Bu.First});case Hu.End:case Hu.PageDown:return e.preventDefault(),e.stopPropagation(),u({type:2,focus:Bu.Last});case Hu.Escape:e.preventDefault(),e.stopPropagation(),u({type:1}),Tu().nextFrame(()=>{var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})});break;case Hu.Tab:e.preventDefault(),e.stopPropagation(),u({type:1}),Tu().nextFrame(()=>{!function(e,t){as(Zu(),t,{relativeTo:e})}(a.buttonRef.current,e.shiftKey?Yu.Previous:Yu.Next)});break;default:1===e.key.length&&(u({type:3,value:e.key}),f.setTimeout(()=>u({type:4}),350))}}),m=Fu(e=>{switch(e.key){case Hu.Space:e.preventDefault()}}),g=Object(Nr.useMemo)(()=>({open:0===a.menuState}),[a]);return wu({ourProps:{"aria-activedescendant":null===a.activeItemIndex||null==(n=a.items[a.activeItemIndex])?void 0:n.id,"aria-labelledby":null==(r=a.buttonRef.current)?void 0:r.id,id:i,onKeyDown:h,onKeyUp:m,role:"menu",tabIndex:0,ref:s},theirProps:l,slot:g,defaultTag:"div",features:Ps,visible:p,name:"Menu.Items"})})),Rs=ku((function(e,t){let n=zu(),{id:r="headlessui-menu-item-"+n,disabled:o=!1,...i}=e,[l,a]=Is("Menu.Item"),u=null!==l.activeItemIndex&&l.items[l.activeItemIndex].id===r,s=Object(Nr.useRef)(null),c=Ru(t,s);Mu(()=>{if(l.__demoMode||0!==l.menuState||!u||0===l.activationTrigger)return;let e=Tu();return e.requestAnimationFrame(()=>{var e,t;null==(t=null==(e=s.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})}),e.dispose},[l.__demoMode,s,u,l.menuState,l.activationTrigger,l.activeItemIndex]);let f=Ss(s),d=Object(Nr.useRef)({disabled:o,domRef:s,get textValue(){return f()}});Mu(()=>{d.current.disabled=o},[d,o]),Mu(()=>(a({type:5,id:r,dataRef:d}),()=>a({type:6,id:r})),[d,r]);let p=Fu(()=>{a({type:1})}),h=Fu(e=>{if(o)return e.preventDefault();a({type:1}),ns(l.buttonRef.current)}),m=Fu(()=>{if(o)return a({type:2,focus:Bu.Nothing});a({type:2,focus:Bu.Specific,id:r})}),g=function(){let e=Object(Nr.useRef)([-1,-1]);return{wasMoved(t){let n=ys(t);return(e.current[0]!==n[0]||e.current[1]!==n[1])&&(e.current=n,!0)},update(t){e.current=ys(t)}}}(),v=Fu(e=>g.update(e)),y=Fu(e=>{g.wasMoved(e)&&(o||u||a({type:2,focus:Bu.Specific,id:r,trigger:0}))}),b=Fu(e=>{g.wasMoved(e)&&(o||u&&a({type:2,focus:Bu.Nothing}))}),w=Object(Nr.useMemo)(()=>({active:u,disabled:o,close:p}),[u,o,p]);return wu({ourProps:{id:r,ref:c,role:"menuitem",tabIndex:!0===o?void 0:-1,"aria-disabled":!0===o||void 0,disabled:void 0,onClick:h,onFocus:m,onPointerEnter:v,onMouseEnter:v,onPointerMove:y,onMouseMove:y,onPointerLeave:b,onMouseLeave:b},theirProps:i,slot:w,defaultTag:Ms,name:"Menu.Item"})})),js=Object.assign(Ds,{Button:Fs,Items:Ls,Item:Rs});class As extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["As","ClassName","Children"]}}class zs extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["As","Key","ClassName","Children"]}}function Us(e){return Nr.createElement(js.Button,ri(e,1))}class Hs extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Key","ClassName","Children"]}}function Bs(e){return Nr.createElement(js.Items,ri(e,1))}class Vs extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["As","Key","ClassName","Children"]}}function $s(){let e=Object(Nr.useRef)(!1);return Mu(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Gs(e,...t){e&&t.length>0&&e.classList.add(...t)}function Ws(e,...t){e&&t.length>0&&e.classList.remove(...t)}function qs(e,t,n,r){let o=n?"enter":"leave",i=Tu(),l=void 0!==r?function(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}(r):()=>{};"enter"===o&&(e.removeAttribute("hidden"),e.style.display="");let a=hu(o,{enter:()=>t.enter,leave:()=>t.leave}),u=hu(o,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),s=hu(o,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return Ws(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Gs(e,...t.base,...a,...s),i.nextFrame(()=>{Ws(e,...t.base,...a,...s),Gs(e,...t.base,...a,...u),function(e,t){let n=Tu();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:o}=getComputedStyle(e),[i,l]=[r,o].map(e=>{let[t=0]=e.split(",").filter(Boolean).map(e=>e.includes("ms")?parseFloat(e):1e3*parseFloat(e)).sort((e,t)=>t-e);return t}),a=i+l;if(0!==a){n.group(n=>{n.setTimeout(()=>{t(),n.dispose()},a),n.addEventListener(e,"transitionrun",e=>{e.target===e.currentTarget&&n.dispose()})});let r=n.addEventListener(e,"transitionend",e=>{e.target===e.currentTarget&&(t(),r())})}else t();n.add(()=>t()),n.dispose}(e,()=>(Ws(e,...t.base,...a),Gs(e,...t.base,...t.entered),l()))}),i.dispose}function Qs(e=""){return e.split(" ").filter(e=>e.trim().length>1)}let Ks=Object(Nr.createContext)(null);Ks.displayName="TransitionContext";var Ys=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Ys||{});let Xs=Object(Nr.createContext)(null);function Js(e){return"children"in e?Js(e.children):e.current.filter(({el:e})=>null!==e.current).filter(({state:e})=>"visible"===e).length>0}function Zs(e,t){let n=Du(e),r=Object(Nr.useRef)([]),o=$s(),i=Iu(),l=Fu((e,t=bu.Hidden)=>{let l=r.current.findIndex(({el:t})=>t===e);-1!==l&&(hu(t,{[bu.Unmount](){r.current.splice(l,1)},[bu.Hidden](){r.current[l].state="hidden"}}),i.microTask(()=>{var e;!Js(r)&&o.current&&(null==(e=n.current)||e.call(n))}))}),a=Fu(e=>{let t=r.current.find(({el:t})=>t===e);return t?"visible"!==t.state&&(t.state="visible"):r.current.push({el:e,state:"visible"}),()=>l(e,bu.Unmount)}),u=Object(Nr.useRef)([]),s=Object(Nr.useRef)(Promise.resolve()),c=Object(Nr.useRef)({enter:[],leave:[],idle:[]}),f=Fu((e,n,r)=>{u.current.splice(0),t&&(t.chains.current[n]=t.chains.current[n].filter(([t])=>t!==e)),null==t||t.chains.current[n].push([e,new Promise(e=>{u.current.push(e)})]),null==t||t.chains.current[n].push([e,new Promise(e=>{Promise.all(c.current[n].map(([e,t])=>t)).then(()=>e())})]),"enter"===n?s.current=s.current.then(()=>null==t?void 0:t.wait.current).then(()=>r(n)):r(n)}),d=Fu((e,t,n)=>{Promise.all(c.current[t].splice(0).map(([e,t])=>t)).then(()=>{var e;null==(e=u.current.shift())||e()}).then(()=>n(t))});return Object(Nr.useMemo)(()=>({children:r,register:a,unregister:l,onStart:f,onStop:d,wait:s,chains:c}),[a,l,r,f,d,c,s])}function ec(){}Xs.displayName="NestingContext";let tc=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function nc(e){var t;let n={};for(let r of tc)n[r]=null!=(t=e[r])?t:ec;return n}let rc=yu.RenderStrategy;let oc=ku((function(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,l=Object(Nr.useRef)(null),a=Ru(l,t);ju();let u=ps();if(void 0===n&&null!==u&&(n=(u&ds.Open)===ds.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[s,c]=Object(Nr.useState)(n?"visible":"hidden"),f=Zs(()=>{c("hidden")}),[d,p]=Object(Nr.useState)(!0),h=Object(Nr.useRef)([n]);Mu(()=>{!1!==d&&h.current[h.current.length-1]!==n&&(h.current.push(n),p(!1))},[h,n]);let m=Object(Nr.useMemo)(()=>({show:n,appear:r,initial:d}),[n,r,d]);Object(Nr.useEffect)(()=>{if(n)c("visible");else if(Js(f)){let e=l.current;if(!e)return;let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&c("hidden")}else c("hidden")},[n,f]);let g={unmount:o},v=Fu(()=>{var t;d&&p(!1),null==(t=e.beforeEnter)||t.call(e)}),y=Fu(()=>{var t;d&&p(!1),null==(t=e.beforeLeave)||t.call(e)});return _r.a.createElement(Xs.Provider,{value:f},_r.a.createElement(Ks.Provider,{value:m},wu({ourProps:{...g,as:Nr.Fragment,children:_r.a.createElement(ic,{ref:a,...g,...i,beforeEnter:v,beforeLeave:y})},theirProps:{},defaultTag:Nr.Fragment,features:rc,visible:"visible"===s,name:"Transition"})))})),ic=ku((function(e,t){var n,r;let{beforeEnter:o,afterEnter:i,beforeLeave:l,afterLeave:a,enter:u,enterFrom:s,enterTo:c,entered:f,leave:d,leaveFrom:p,leaveTo:h,...m}=e,g=Object(Nr.useRef)(null),v=Ru(g,t),y=null==(n=m.unmount)||n?bu.Unmount:bu.Hidden,{show:b,appear:w,initial:S}=function(){let e=Object(Nr.useContext)(Ks);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),[E,k]=Object(Nr.useState)(b?"visible":"hidden"),C=function(){let e=Object(Nr.useContext)(Xs);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),{register:x,unregister:O}=C;Object(Nr.useEffect)(()=>x(g),[x,g]),Object(Nr.useEffect)(()=>{if(y===bu.Hidden&&g.current)return b&&"visible"!==E?void k("visible"):hu(E,{hidden:()=>O(g),visible:()=>x(g)})},[E,g,x,O,b,y]);let T=Du({base:Qs(m.className),enter:Qs(u),enterFrom:Qs(s),enterTo:Qs(c),entered:Qs(f),leave:Qs(d),leaveFrom:Qs(p),leaveTo:Qs(h)}),I=function(e){let t=Object(Nr.useRef)(nc(e));return Object(Nr.useEffect)(()=>{t.current=nc(e)},[e]),t}({beforeEnter:o,afterEnter:i,beforeLeave:l,afterLeave:a}),N=ju();Object(Nr.useEffect)(()=>{if(N&&"visible"===E&&null===g.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[g,E,N]);let _=w&&b&&S,P=!N||S&&!w?"idle":b?"enter":"leave",M=function(e=0){let[t,n]=Object(Nr.useState)(e),r=$s(),o=Object(Nr.useCallback)(e=>{r.current&&n(t=>t|e)},[t,r]),i=Object(Nr.useCallback)(e=>Boolean(t&e),[t]),l=Object(Nr.useCallback)(e=>{r.current&&n(t=>t&~e)},[n,r]),a=Object(Nr.useCallback)(e=>{r.current&&n(t=>t^e)},[n]);return{flags:t,addFlag:o,hasFlag:i,removeFlag:l,toggleFlag:a}}(0),D=Fu(e=>hu(e,{enter:()=>{M.addFlag(ds.Opening),I.current.beforeEnter()},leave:()=>{M.addFlag(ds.Closing),I.current.beforeLeave()},idle:()=>{}})),F=Fu(e=>hu(e,{enter:()=>{M.removeFlag(ds.Opening),I.current.afterEnter()},leave:()=>{M.removeFlag(ds.Closing),I.current.afterLeave()},idle:()=>{}})),L=Zs(()=>{k("hidden"),O(g)},C);!function({immediate:e,container:t,direction:n,classes:r,onStart:o,onStop:i}){let l=$s(),a=Iu(),u=Du(n);Mu(()=>{e&&(u.current="enter")},[e]),Mu(()=>{let e=Tu();a.add(e.dispose);let n=t.current;if(n&&"idle"!==u.current&&l.current)return e.dispose(),o.current(u.current),e.add(qs(n,r.current,"enter"===u.current,()=>{e.dispose(),i.current(u.current)})),e.dispose},[n])}({immediate:_,container:g,classes:T,direction:P,onStart:Du(e=>{L.onStart(g,e,D)}),onStop:Du(e=>{L.onStop(g,e,F),"leave"===e&&!Js(L)&&(k("hidden"),O(g))})});let R=m,j={ref:v};return _?R={...R,className:mu(m.className,...T.current.enter,...T.current.enterFrom)}:(R.className=mu(m.className,null==(r=g.current)?void 0:r.className),""===R.className&&delete R.className),_r.a.createElement(Xs.Provider,{value:L},_r.a.createElement(hs,{value:hu(E,{visible:ds.Open,hidden:ds.Closed})|M.flags},wu({ourProps:j,theirProps:R,defaultTag:"div",features:rc,visible:"visible"===E,name:"Transition.Child"})))})),lc=ku((function(e,t){let n=null!==Object(Nr.useContext)(Ks),r=null!==ps();return _r.a.createElement(_r.a.Fragment,null,!n&&r?_r.a.createElement(oc,{ref:t,...e}):_r.a.createElement(ic,{ref:t,...e}))})),ac=Object.assign(oc,{Child:lc,Root:oc});class uc extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Key","Appear","Show","ClassName","Enter","EnterFrom","EnterTo","Leave","LeaveFrom","LeaveTo","Children"]}}function sc(e){return Nr.createElement(ac,ri(e,1))}class cc extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Key","As","Show","Children"]}}class fc extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Key","Appear","Show","ClassName","Enter","EnterFrom","EnterTo","Leave","LeaveFrom","LeaveTo","Children"]}}function dc(e){return Nr.createElement(ac.Child,ri(e,1))}class pc extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Top","Left","Bottom"]}}class hc extends U{constructor(e,t,n){super(),this.Text=e,this.HasBorderOnTop=t,this.OnClick=n}}function mc(e){const t=Xn((e,t)=>function(e,t){const n=0===e?"flex items-center px-4 py-2 cursor-pointer":"flex items-center px-4 py-2 cursor-pointer justify-between";return Object(Nr.createElement)("div",{key:nn(en("%P()",[e+1])),onClick:e=>{t.OnClick()},className:0===e?"py-1 text-sm":"py-1",children:lo.Children.toArray([(r=Qn([new Vs(1,nn(en("menuItem%P()",[e+1]))),new Vs(0,"div"),new Vs(3,r=>[Object(Nr.createElement)("div",{key:"1",className:sn(" ",Kr($r(()=>Jr(Qr(n),$r(()=>Jr(e>0&&t.HasBorderOnTop?Qr("border-t border-gray-200"):qr(),$r(()=>r.active?Qr("bg-blue-100 text-primary-600"):Qr("text-gray-700")))))))),children:lo.Children.toArray([Object(Nr.createElement)("a",{className:0===e?"text-sm font-medium flex-auto":"text-sm font-medium",children:t.Text})])})])]),Nr.createElement(js.Item,ri(r,1)))])});var r}(e,t),e.MenuItems);return function(e){return Nr.createElement(js,ri(e,1))}(Qn([new As(0,"div"),new As(1,"relative inline-block text-left"),new As(2,[Us(Qn([new zs(1,"1"),new zs(0,"div"),new zs(3,t=>[Object(Nr.createElement)("div",{key:"1",children:lo.Children.toArray([e.Button(t.open)])})])])),sc(Qn([new uc(0,"2"),new uc(4,"transition ease-out duration-100"),new uc(5,"opacity-0"),new uc(6,"opacity-100"),new uc(7,"transition ease-in duration-75"),new uc(8,"transform opacity-100 scale-100"),new uc(9,"transform opacity-0 scale-95"),new uc(10,[Bs(Kr($r(()=>{let n;switch(e.Position.tag){case 2:n="right-0";break;case 1:n="right-12 -top-2";break;default:n="right-0 bottom-11"}return Jr(Qr(new Hs(0,"1")),$r(()=>Jr(Qr(new Hs(1,nn(en("absolute %P() z-10 mt-2 min-w-[240px] origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",[n])))),$r(()=>Qr(new Hs(2,t))))))})))])]))])]))}const gc=Object(Nr.createElement)("svg",{width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:lo.Children.toArray([Object(Nr.createElement)("path",I(Qn([["d","M4.29289 4.29289C4.68342 3.90237 5.31658 3.90237 5.70711 4.29289L10 8.58579L14.2929 4.29289C14.6834 3.90237 15.3166 3.90237 15.7071 4.29289C16.0976 4.68342 16.0976 5.31658 15.7071 5.70711L11.4142 10L15.7071 14.2929C16.0976 14.6834 16.0976 15.3166 15.7071 15.7071C15.3166 16.0976 14.6834 16.0976 14.2929 15.7071L10 11.4142L5.70711 15.7071C5.31658 16.0976 4.68342 16.0976 4.29289 15.7071C3.90237 15.3166 3.90237 14.6834 4.29289 14.2929L8.58579 10L4.29289 5.70711C3.90237 5.31658 3.90237 4.68342 4.29289 4.29289Z"],["fill","#9CA3AF"],(vc="evenodd",["fillRule",vc]),function(e){return["clipRule",e]}("evenodd")])))])});var vc;const yc=Object(Nr.createElement)("svg",{width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:lo.Children.toArray([Object(Nr.createElement)("path",{d:"M10 12C11.1046 12 12 11.1046 12 10C12 8.89543 11.1046 8 10 8C8.89543 8 8 8.89543 8 10C8 11.1046 8.89543 12 10 12Z",fill:"#9CA3AF"}),Object(Nr.createElement)("path",{d:"M4 12C5.10457 12 6 11.1046 6 10C6 8.89543 5.10457 8 4 8C2.89543 8 2 8.89543 2 10C2 11.1046 2.89543 12 4 12Z",fill:"#9CA3AF"}),Object(Nr.createElement)("path",{d:"M16 12C17.1046 12 18 11.1046 18 10C18 8.89543 17.1046 8 16 8C14.8954 8 14 8.89543 14 10C14 11.1046 14.8954 12 16 12Z",fill:"#9CA3AF"})])});var bc=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(bc||{});let wc=ku((function(e,t){let{features:n=1,...r}=e;return wu({ourProps:{ref:t,"aria-hidden":2==(2&n)||void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...4==(4&n)&&2!=(2&n)&&{display:"none"}}},theirProps:r,slot:{},defaultTag:"div",name:"Hidden"})}));var Sc=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Sc||{});function Ec(e,t,n,r){let o=Du(n);Object(Nr.useEffect)(()=>{function n(e){o.current(e)}return(e=null!=e?e:window).addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)},[e,t,r])}function kc(e,t){let n=Object(Nr.useRef)([]),r=Fu(e);Object(Nr.useEffect)(()=>{let e=[...n.current];for(let[o,i]of t.entries())if(n.current[o]!==i){let o=r(t,e);return n.current=t,o}},[r,...t])}function Cc(e){let t=Fu(e),n=Object(Nr.useRef)(!1);Object(Nr.useEffect)(()=>(n.current=!1,()=>{n.current=!0,Ou(()=>{n.current&&t()})}),[t])}function xc(e){if(!e)return new Set;if("function"==typeof e)return new Set(e());let t=new Set;for(let n of e.current)n.current instanceof HTMLElement&&t.add(n.current);return t}var Oc=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(Oc||{});let Tc=ku((function(e,t){let n=Object(Nr.useRef)(null),r=Ru(n,t),{initialFocus:o,containers:i,features:l=30,...a}=e;ju()||(l=1);let u=vs(n);!function({ownerDocument:e},t){let n=function(e=!0){let t=Object(Nr.useRef)(Nc.slice());return kc(([e],[n])=>{!0===n&&!1===e&&Ou(()=>{t.current.splice(0)}),!1===n&&!0===e&&(t.current=Nc.slice())},[e,Nc,t]),Fu(()=>{var e;return null!=(e=t.current.find(e=>null!=e&&e.isConnected))?e:null})}(t);kc(()=>{t||(null==e?void 0:e.activeElement)===(null==e?void 0:e.body)&&os(n())},[t]),Cc(()=>{t&&os(n())})}({ownerDocument:u},Boolean(16&l));let s=function({ownerDocument:e,container:t,initialFocus:n},r){let o=Object(Nr.useRef)(null),i=$s();return kc(()=>{if(!r)return;let l=t.current;l&&Ou(()=>{if(!i.current)return;let t=null==e?void 0:e.activeElement;if(null!=n&&n.current){if((null==n?void 0:n.current)===t)return void(o.current=t)}else if(l.contains(t))return void(o.current=t);null!=n&&n.current?os(n.current):as(l,Yu.First)===Xu.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),o.current=null==e?void 0:e.activeElement})},[r]),o}({ownerDocument:u,container:n,initialFocus:o},Boolean(2&l));!function({ownerDocument:e,container:t,containers:n,previousActiveElement:r},o){let i=$s();Ec(null==e?void 0:e.defaultView,"focus",e=>{if(!o||!i.current)return;let l=xc(n);t.current instanceof HTMLElement&&l.add(t.current);let a=r.current;if(!a)return;let u=e.target;u&&u instanceof HTMLElement?_c(l,u)?(r.current=u,os(u)):(e.preventDefault(),e.stopPropagation(),os(a)):os(r.current)},!0)}({ownerDocument:u,container:n,containers:i,previousActiveElement:s},Boolean(8&l));let c=function(){let e=Object(Nr.useRef)(0);return ss("keydown",t=>{"Tab"===t.key&&(e.current=t.shiftKey?1:0)},!0),e}(),f=Fu(e=>{let t=n.current;t&&hu(c.current,{[Sc.Forwards]:()=>{as(t,Yu.First,{skipElements:[e.relatedTarget]})},[Sc.Backwards]:()=>{as(t,Yu.Last,{skipElements:[e.relatedTarget]})}})}),d=Iu(),p=Object(Nr.useRef)(!1),h={ref:r,onKeyDown(e){"Tab"==e.key&&(p.current=!0,d.requestAnimationFrame(()=>{p.current=!1}))},onBlur(e){let t=xc(i);n.current instanceof HTMLElement&&t.add(n.current);let r=e.relatedTarget;r instanceof HTMLElement&&"true"!==r.dataset.headlessuiFocusGuard&&(_c(t,r)||(p.current?as(n.current,hu(c.current,{[Sc.Forwards]:()=>Yu.Next,[Sc.Backwards]:()=>Yu.Previous})|Yu.WrapAround,{relativeTo:e.target}):e.target instanceof HTMLElement&&os(e.target)))}};return _r.a.createElement(_r.a.Fragment,null,Boolean(4&l)&&_r.a.createElement(wc,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:f,features:bc.Focusable}),wu({ourProps:h,theirProps:a,defaultTag:"div",name:"FocusTrap"}),Boolean(4&l)&&_r.a.createElement(wc,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:f,features:bc.Focusable}))})),Ic=Object.assign(Tc,{features:Oc}),Nc=[];function _c(e,t){for(let n of e)if(n.contains(t))return!0;return!1}!function(e){function t(){"loading"!==document.readyState&&(e(),document.removeEventListener("DOMContentLoaded",t))}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("DOMContentLoaded",t),t())}(()=>{function e(e){e.target instanceof HTMLElement&&e.target!==document.body&&Nc[0]!==e.target&&(Nc.unshift(e.target),Nc=Nc.filter(e=>null!=e&&e.isConnected),Nc.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});var Pc=n(2);let Mc=Object(Nr.createContext)(!1);function Dc(e){return _r.a.createElement(Mc.Provider,{value:e.force},e.children)}function Fc(e){let t=Object(Nr.useContext)(Mc),n=Object(Nr.useContext)(jc),r=vs(e),[o,i]=Object(Nr.useState)(()=>{if(!t&&null!==n||Pu.isServer)return null;let e=null==r?void 0:r.getElementById("headlessui-portal-root");if(e)return e;if(null===r)return null;let o=r.createElement("div");return o.setAttribute("id","headlessui-portal-root"),r.body.appendChild(o)});return Object(Nr.useEffect)(()=>{null!==o&&(null!=r&&r.body.contains(o)||null==r||r.body.appendChild(o))},[o,r]),Object(Nr.useEffect)(()=>{t||null!==n&&i(n.current)},[n,i,t]),o}let Lc=Nr.Fragment;let Rc=Nr.Fragment,jc=Object(Nr.createContext)(null);let Ac=Object(Nr.createContext)(null);let zc=ku((function(e,t){let n=e,r=Object(Nr.useRef)(null),o=Ru(function(e,t=!0){return Object.assign(e,{[Lu]:t})}(e=>{r.current=e}),t),i=vs(r),l=Fc(r),[a]=Object(Nr.useState)(()=>{var e;return Pu.isServer?null:null!=(e=null==i?void 0:i.createElement("div"))?e:null}),u=Object(Nr.useContext)(Ac),s=ju();return Mu(()=>{!l||!a||l.contains(a)||(a.setAttribute("data-headlessui-portal",""),l.appendChild(a))},[l,a]),Mu(()=>{if(a&&u)return u.register(a)},[u,a]),Cc(()=>{var e;!l||!a||(a instanceof Node&&l.contains(a)&&l.removeChild(a),l.childNodes.length<=0&&(null==(e=l.parentElement)||e.removeChild(l)))}),s&&l&&a?Object(Pc.createPortal)(wu({ourProps:{ref:o},theirProps:n,defaultTag:Lc,name:"Portal"}),a):null})),Uc=ku((function(e,t){let{target:n,...r}=e,o={ref:Ru(t)};return _r.a.createElement(jc.Provider,{value:n},wu({ourProps:o,theirProps:r,defaultTag:Rc,name:"Popover.Group"}))})),Hc=Object.assign(zc,{Group:Uc}),Bc=Object(Nr.createContext)(null);function Vc(){let e=Object(Nr.useContext)(Bc);if(null===e){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,Vc),e}return e}let $c=ku((function(e,t){let n=zu(),{id:r="headlessui-description-"+n,...o}=e,i=Vc(),l=Ru(t);return Mu(()=>i.register(r),[r,i.register]),wu({ourProps:{ref:l,...i.props,id:r},theirProps:o,slot:i.slot||{},defaultTag:"p",name:i.name||"Description"})})),Gc=Object.assign($c,{}),Wc=Object(Nr.createContext)(()=>{});Wc.displayName="StackContext";var qc=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(qc||{});function Qc({children:e,onUpdate:t,type:n,element:r,enabled:o}){let i=Object(Nr.useContext)(Wc),l=Fu((...e)=>{null==t||t(...e),i(...e)});return Mu(()=>{let e=void 0===o||!0===o;return e&&l(0,n,r),()=>{e&&l(1,n,r)}},[l,n,r,o]),_r.a.createElement(Wc.Provider,{value:l},e)}const Kc="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},{useState:Yc,useEffect:Xc,useLayoutEffect:Jc,useDebugValue:Zc}=Nr;function ef(e){const t=e.getSnapshot,n=e.value;try{const e=t();return!Kc(n,e)}catch{return!0}}const tf=!("undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement)?function(e,t,n){return t()}:function(e,t,n){const r=t(),[{inst:o},i]=Yc({inst:{value:r,getSnapshot:t}});return Jc(()=>{o.value=r,o.getSnapshot=t,ef(o)&&i({inst:o})},[e,r,t]),Xc(()=>(ef(o)&&i({inst:o}),e(()=>{ef(o)&&i({inst:o})})),[e]),Zc(r),r},nf="useSyncExternalStore"in Nr?(e=>e.useSyncExternalStore)(Nr):tf;function rf(){let e;return{before({doc:t}){var n;let r=t.documentElement;e=(null!=(n=t.defaultView)?n:window).innerWidth-r.clientWidth},after({doc:t,d:n}){let r=t.documentElement,o=r.clientWidth-r.offsetWidth,i=e-o;n.style(r,"paddingRight",i+"px")}}}function of(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function lf(){if(!of())return{};let e;return{before(){e=window.pageYOffset},after({doc:t,d:n,meta:r}){function o(e){return r.containers.flatMap(e=>e()).some(t=>t.contains(e))}n.microTask(()=>{if("auto"!==window.getComputedStyle(t.documentElement).scrollBehavior){let e=Tu();e.style(t.documentElement,"scroll-behavior","auto"),n.add(()=>n.microTask(()=>e.dispose()))}n.style(t.body,"marginTop",`-${e}px`),window.scrollTo(0,0);let r=null;n.addEventListener(t,"click",e=>{if(e.target instanceof HTMLElement)try{let n=e.target.closest("a");if(!n)return;let{hash:i}=new URL(n.href),l=t.querySelector(i);l&&!o(l)&&(r=l)}catch{}},!0),n.addEventListener(t,"touchmove",e=>{e.target instanceof HTMLElement&&!o(e.target)&&e.preventDefault()},{passive:!1}),n.add(()=>{window.scrollTo(0,window.pageYOffset+e),r&&r.isConnected&&(r.scrollIntoView({block:"nearest"}),r=null)})})}}}function af(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let uf=function(e,t){let n=e(),r=new Set;return{getSnapshot:()=>n,subscribe:e=>(r.add(e),()=>r.delete(e)),dispatch(e,...o){let i=t[e].call(n,...o);i&&(n=i,r.forEach(e=>e()))}}}(()=>new Map,{PUSH(e,t){var n;let r=null!=(n=this.get(e))?n:{doc:e,count:0,d:Tu(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:af(n)},o=[lf(),rf(),{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}];o.forEach(({before:e})=>null==e?void 0:e(r)),o.forEach(({after:e})=>null==e?void 0:e(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});function sf(e,t,n){let r=function(e){return nf(e.subscribe,e.getSnapshot,e.getSnapshot)}(uf),o=e?r.get(e):void 0,i=!!o&&o.count>0;return Mu(()=>{if(e&&t)return uf.dispatch("PUSH",e,n),()=>uf.dispatch("POP",e,n)},[t,e]),i}uf.subscribe(()=>{let e=uf.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let e="hidden"===t.get(n.doc),r=0!==n.count;(r&&!e||!r&&e)&&uf.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),0===n.count&&uf.dispatch("TEARDOWN",n)}});let cf=new Map,ff=new Map;function df(e,t=!0){Mu(()=>{var n;if(!t)return;let r="function"==typeof e?e():e.current;if(!r)return;let o=null!=(n=ff.get(r))?n:0;return ff.set(r,o+1),0!==o||(cf.set(r,{"aria-hidden":r.getAttribute("aria-hidden"),inert:r.inert}),r.setAttribute("aria-hidden","true"),r.inert=!0),function(){var e;if(!r)return;let t=null!=(e=ff.get(r))?e:1;if(1===t?ff.delete(r):ff.set(r,t-1),1!==t)return;let n=cf.get(r);n&&(null===n["aria-hidden"]?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",n["aria-hidden"]),r.inert=n.inert,cf.delete(r))}},[e,t])}var pf=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(pf||{}),hf=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(hf||{});let mf={0:(e,t)=>e.titleId===t.id?e:{...e,titleId:t.id}},gf=Object(Nr.createContext)(null);function vf(e){let t=Object(Nr.useContext)(gf);if(null===t){let t=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,vf),t}return t}function yf(e,t){return hu(t.type,mf,e,t)}gf.displayName="DialogContext";let bf=yu.RenderStrategy|yu.Static;let wf=ku((function(e,t){var n;let r=zu(),{id:o="headlessui-dialog-"+r,open:i,onClose:l,initialFocus:a,__demoMode:u=!1,...s}=e,[c,f]=Object(Nr.useState)(0),d=ps();void 0===i&&null!==d&&(i=(d&ds.Open)===ds.Open);let p=Object(Nr.useRef)(null),h=Ru(p,t),m=vs(p),g=e.hasOwnProperty("open")||null!==d,v=e.hasOwnProperty("onClose");if(!g&&!v)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!g)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!v)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof i)throw new Error("You provided an `open` prop to the `Dialog`, but the value is not a boolean. Received: "+i);if("function"!=typeof l)throw new Error("You provided an `onClose` prop to the `Dialog`, but the value is not a function. Received: "+l);let y=i?0:1,[b,w]=Object(Nr.useReducer)(yf,{titleId:null,descriptionId:null,panelRef:Object(Nr.createRef)()}),S=Fu(()=>l(!1)),E=Fu(e=>w({type:0,id:e})),k=!!ju()&&(!u&&0===y),C=c>1,x=null!==Object(Nr.useContext)(gf),[O,T]=function(){let e=Object(Nr.useContext)(Ac),t=Object(Nr.useRef)([]),n=Fu(n=>(t.current.push(n),e&&e.register(n),()=>r(n))),r=Fu(n=>{let r=t.current.indexOf(n);-1!==r&&t.current.splice(r,1),e&&e.unregister(n)}),o=Object(Nr.useMemo)(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,Object(Nr.useMemo)(()=>function({children:e}){return _r.a.createElement(Ac.Provider,{value:o},e)},[o])]}(),{resolveContainers:I,mainTreeNodeRef:N,MainTreeNode:_}=function({defaultContainers:e=[],portals:t,mainTreeNodeRef:n}={}){var r;let o=Object(Nr.useRef)(null!=(r=null==n?void 0:n.current)?r:null),i=vs(o),l=Fu(()=>{var n;let r=[];for(let t of e)null!==t&&(t instanceof HTMLElement?r.push(t):"current"in t&&t.current instanceof HTMLElement&&r.push(t.current));if(null!=t&&t.current)for(let e of t.current)r.push(e);for(let e of null!=(n=null==i?void 0:i.querySelectorAll("html > *, body > *"))?n:[])e!==document.body&&e!==document.head&&e instanceof HTMLElement&&"headlessui-portal-root"!==e.id&&(e.contains(o.current)||r.some(t=>e.contains(t))||r.push(e));return r});return{resolveContainers:l,contains:Fu(e=>l().some(t=>t.contains(e))),mainTreeNodeRef:o,MainTreeNode:Object(Nr.useMemo)(()=>function(){return null!=n?null:_r.a.createElement(wc,{features:bc.Hidden,ref:o})},[o,n])}}({portals:O,defaultContainers:[null!=(n=b.panelRef.current)?n:p.current]}),P=C?"parent":"leaf",M=null!==d&&(d&ds.Closing)===ds.Closing,D=!x&&!M&&k;df(Object(Nr.useCallback)(()=>{var e,t;return null!=(t=Array.from(null!=(e=null==m?void 0:m.querySelectorAll("body > *"))?e:[]).find(e=>"headlessui-portal-root"!==e.id&&(e.contains(N.current)&&e instanceof HTMLElement)))?t:null},[N]),D);let F=!!C||k;df(Object(Nr.useCallback)(()=>{var e,t;return null!=(t=Array.from(null!=(e=null==m?void 0:m.querySelectorAll("[data-headlessui-portal]"))?e:[]).find(e=>e.contains(N.current)&&e instanceof HTMLElement))?t:null},[N]),F),cs(I,S,!(!k||C));let L=!(C||0!==y);Ec(null==m?void 0:m.defaultView,"keydown",e=>{L&&(e.defaultPrevented||e.key===Hu.Escape&&(e.preventDefault(),e.stopPropagation(),S()))}),function(e,t,n=(()=>[document.body])){sf(e,t,e=>{var t;return{containers:[...null!=(t=e.containers)?t:[],n]}})}(m,!(M||0!==y||x),I),Object(Nr.useEffect)(()=>{if(0!==y||!p.current)return;let e=new ResizeObserver(e=>{for(let t of e){let e=t.target.getBoundingClientRect();0===e.x&&0===e.y&&0===e.width&&0===e.height&&S()}});return e.observe(p.current),()=>e.disconnect()},[y,p,S]);let[R,j]=function(){let[e,t]=Object(Nr.useState)([]);return[e.length>0?e.join(" "):void 0,Object(Nr.useMemo)(()=>function(e){let n=Fu(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))),r=Object(Nr.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props}),[n,e.slot,e.name,e.props]);return _r.a.createElement(Bc.Provider,{value:r},e.children)},[t])]}(),A=Object(Nr.useMemo)(()=>[{dialogState:y,close:S,setTitleId:E},b],[y,b,S,E]),z=Object(Nr.useMemo)(()=>({open:0===y}),[y]),U={ref:h,id:o,role:"dialog","aria-modal":0===y||void 0,"aria-labelledby":b.titleId,"aria-describedby":R};return _r.a.createElement(Qc,{type:"Dialog",enabled:0===y,element:p,onUpdate:Fu((e,t)=>{"Dialog"===t&&hu(e,{[qc.Add]:()=>f(e=>e+1),[qc.Remove]:()=>f(e=>e-1)})})},_r.a.createElement(Dc,{force:!0},_r.a.createElement(Hc,null,_r.a.createElement(gf.Provider,{value:A},_r.a.createElement(Hc.Group,{target:p},_r.a.createElement(Dc,{force:!1},_r.a.createElement(j,{slot:z,name:"Dialog.Description"},_r.a.createElement(Ic,{initialFocus:a,containers:I,features:k?hu(P,{parent:Ic.features.RestoreFocus,leaf:Ic.features.All&~Ic.features.FocusLock}):Ic.features.None},_r.a.createElement(T,null,wu({ourProps:U,theirProps:s,slot:z,defaultTag:"div",features:bf,visible:0===y,name:"Dialog"}))))))))),_r.a.createElement(_,null))})),Sf=ku((function(e,t){let n=zu(),{id:r="headlessui-dialog-backdrop-"+n,...o}=e,[{dialogState:i},l]=vf("Dialog.Backdrop"),a=Ru(t);Object(Nr.useEffect)(()=>{if(null===l.panelRef.current)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[l.panelRef]);let u=Object(Nr.useMemo)(()=>({open:0===i}),[i]);return _r.a.createElement(Dc,{force:!0},_r.a.createElement(Hc,null,wu({ourProps:{ref:a,id:r,"aria-hidden":!0},theirProps:o,slot:u,defaultTag:"div",name:"Dialog.Backdrop"})))})),Ef=ku((function(e,t){let n=zu(),{id:r="headlessui-dialog-panel-"+n,...o}=e,[{dialogState:i},l]=vf("Dialog.Panel"),a=Ru(t,l.panelRef),u=Object(Nr.useMemo)(()=>({open:0===i}),[i]);return wu({ourProps:{ref:a,id:r,onClick:Fu(e=>{e.stopPropagation()})},theirProps:o,slot:u,defaultTag:"div",name:"Dialog.Panel"})})),kf=ku((function(e,t){let n=zu(),{id:r="headlessui-dialog-overlay-"+n,...o}=e,[{dialogState:i,close:l}]=vf("Dialog.Overlay");return wu({ourProps:{ref:Ru(t),id:r,"aria-hidden":!0,onClick:Fu(e=>{if(e.target===e.currentTarget){if($u(e.currentTarget))return e.preventDefault();e.preventDefault(),e.stopPropagation(),l()}})},theirProps:o,slot:Object(Nr.useMemo)(()=>({open:0===i}),[i]),defaultTag:"div",name:"Dialog.Overlay"})})),Cf=ku((function(e,t){let n=zu(),{id:r="headlessui-dialog-title-"+n,...o}=e,[{dialogState:i,setTitleId:l}]=vf("Dialog.Title"),a=Ru(t);Object(Nr.useEffect)(()=>(l(r),()=>l(null)),[r,l]);let u=Object(Nr.useMemo)(()=>({open:0===i}),[i]);return wu({ourProps:{ref:a,id:r},theirProps:o,slot:u,defaultTag:"h2",name:"Dialog.Title"})})),xf=Object.assign(wf,{Backdrop:Sf,Panel:Ef,Overlay:kf,Title:Cf,Description:Gc});class Of extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["As","Key","ClassName","Open","OnClose","Children"]}}function Tf(e){return Nr.createElement(xf,ri(e,1))}class If extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Key","ClassName","Children"]}}function Nf(e){return Nr.createElement(xf.Panel,ri(e,1))}class _f extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["As","Key","ClassName","Children"]}}function Pf(e){return Nr.createElement(xf.Title,ri(e,1))}class Mf extends U{constructor(e,t,n){super(),this.numberOfSelectedAccounts=0|e,this.okButtonClick=t,this.cancelButtonClick=n}}function Df(e){const t=So(""),n=t[0],r=""===n;let o;const i="inline-flex w-full justify-center rounded-md border border-transparent bg-blue-600 px-4 py-2 text-base font-medium text-white shadow-sm hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-gray-300 focus:ring-offset-2 sm:ml-3 sm:w-auto sm:text-sm";return o=r?nn(en("%P() opacity-50",[i])):i,function(e){return Nr.createElement(ac.Root,ri(e,1))}(Qn([new cc(0,"1"),new cc(2,!0),new cc(3,[Tf(Qn([new Of(1,"1"),new Of(0,"div"),new Of(2,"relative z-10"),new Of(4,e.cancelButtonClick),new Of(5,[dc(Qn([new fc(0,"1"),new fc(3,"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"),new fc(4,"ease-out duration-300"),new fc(5,"opacity-0"),new fc(6,"opacity-100"),new fc(7,"ease-in duration-200"),new fc(8,"opacity-100"),new fc(9,"opacity-0")])),Object(Nr.createElement)("div",{className:"fixed inset-0 z-10 overflow-y-auto",key:"2",children:lo.Children.toArray([Object(Nr.createElement)("div",{key:"1",className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:lo.Children.toArray([dc(Qn([new fc(0,"1"),new fc(4,"ease-out duration-300"),new fc(5,"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"),new fc(6,"opacity-100 translate-y-0 sm:scale-100"),new fc(7,"ease-in duration-200"),new fc(8,"opacity-100 translate-y-0 sm:scale-100"),new fc(9,"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"),new fc(10,[Nf(Qn([new If(0,"1"),new If(1,"relative transform overflow-hidden rounded-lg bg-white px-4 pt-5 pb-4 text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg sm:p-6"),new If(2,[Object(Nr.createElement)("div",{key:"1",className:"sm:flex sm:items-start",children:lo.Children.toArray([Object(Nr.createElement)("div",{key:"2",className:"mt-3 text-center sm:mt-0 sm:text-left",children:lo.Children.toArray([Pf(Qn([new _f(1,"1"),new _f(0,"h3"),new _f(2,"text-lg font-medium leading-6 text-gray-900"),new _f(3,[Object(Nr.createElement)("span",{children:"Update API Version",key:"1"})])])),Object(Nr.createElement)("div",{className:"mt-2",key:"2",children:lo.Children.toArray([Object(Nr.createElement)("p",{key:"1",className:"text-sm text-gray-500 mb-1",children:nn(en("Choose the new API version for %P() %P().",[e.numberOfSelectedAccounts,Ka(e.numberOfSelectedAccounts,"account")]))}),Object(Nr.createElement)("select",{key:"2",className:"mt-2 block w-full rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-indigo-600 sm:text-sm sm:leading-6",onChange:e=>{t[1](e.target.value)},children:lo.Children.toArray(Array.from(Jn(e=>Object(Nr.createElement)("option",{value:e,children:e}),Qn(["","V322","V321","V320","V319","V310","V280","V1138"]))))})])})])})])}),Object(Nr.createElement)("div",{key:"2",className:"mt-5 sm:mt-4 sm:flex sm:flex-row-reverse",children:lo.Children.toArray([Object(Nr.createElement)("button",{key:"Ok",className:o,onClick:t=>{e.okButtonClick(n)},children:"Update",disabled:r}),Object(Nr.createElement)("button",{key:"Cancel",className:"mt-3 inline-flex w-full justify-center rounded-md border border-gray-300 bg-white px-4 py-2 text-base font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-gray-200 focus:ring-offset-2 sm:mt-0 sm:w-auto sm:text-sm",onClick:t=>{e.cancelButtonClick()},children:"Cancel"})])})])]))])]))])})])})])]))])]))}function Ff(e,t,n,r,o){const i=function(e,t,n,r){const o=0|O(e,n);if(0===o)throw new Error("The step of a range cannot be zero");const i=o>0;return n=>{const o=0|O(n,t);return i&&o<=0||!i&&o>=0?[n,r(n,e)]:void 0}}(t,n,r,o);return $r(()=>Wr(i,e))}class Lf extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Writable","ReadWritable"]}}class Rf{constructor(e){this.state=new Lf(0,En(new Array(T((e,t)=>C(e,t),e,10)),0,T((e,t)=>C(e,t),e,10),null),0)}}function jf(e){const t=e.state;if(1===t.tag){const n=0|t.fields[1],r=0|t.fields[2],o=t.fields[0],i=(r+1)%o.length|0;return e.state=i===n?new Lf(0,o,n):new Lf(1,o,n,i),hn(o[r])}}function Af(e,t){const n=e.state;if(1===n.tag){const i=0|n.fields[1],l=0|n.fields[2],a=n.fields[0];a[i]=t;const u=(i+1)%a.length|0;e.state=u===l?new Lf(1,(r=l,o=a,Array.from($r(()=>Jr(oo(r,o),$r(()=>{return Jr((e=r,t=o,Xr(()=>Vr(t),(t,n)=>{if(t<e){if(n["System.Collections.IEnumerator.MoveNext"]())return hn(n["System.Collections.Generic.IEnumerator`1.get_Current"]());throw new Error(Dr+"\\nParameter name: source")}},e=>{e.Dispose()})),$r(()=>{return io(e=>Qr(null),(e=0,t=1,n=o.length,Ff(e,t,n,0,(e,t)=>e+t)));var e,t,n}));var e,t}))))),a.length,0):new Lf(1,a,u,l)}else{const r=0|n.fields[1],o=n.fields[0];o[r]=t;const i=(r+1)%o.length|0;e.state=new Lf(1,o,i,r)}var r,o}class zf extends U{constructor(e,t,n,r,o,i,l){super(),this.init=e,this.update=t,this.subscribe=n,this.view=r,this.setState=o,this.onError=i,this.syncDispatch=l}}function Uf(e,t,n){return new zf(e,t,e=>Cr(),n,(e,t)=>{n(e,t)},e=>{Sr(e[0],e[1])},N(2,e=>e))}function Hf(e,t){const n=t.init(e),r=n[0],o=new Rf(10);let i=!1,l=r;const a=P(1,t.syncDispatch,[e=>{if(i)Af(o,e);else{i=!0;let n=hn(e);for(;null!=n;){const e=mn(n);try{const n=t.update(e,l),r=n[0];t.setState(r,a),kr(n=>{t.onError([nn(Zt("Error in command while handling: %A"))(e),n])},a,n[1]),l=r}catch(n){t.onError([nn(Zt("Unable to process the message: %A"))(e),n])}n=jf(o)}i=!1}}]);t.setState(r,a),kr(e=>{t.onError(["Error intitializing:",e])},a,xr(Qn([(()=>{try{return t.subscribe(r)}catch(e){return t.onError(["Unable to subscribe:",e]),Cr()}})(),n[1]])))}class Bf{constructor(){this.hasDisposedOnce=!1,this.state=void 0,this.listener=void 0,this.dispatcher=void 0}}function Vf(){return new Bf}function $f(e,t,n,r){Hf(t,function(e,t){return new zf(t.init,t.update,t.subscribe,t.view,e,t.onError,t.syncDispatch)}((e,t)=>{!function(e,t,n){e.state=hn(t),e.dispatcher=n;const r=e.listener;null!=r&&r(t)}(n,e,t)},e()));const o=n.state;if(null!=o)return mn(o);throw new Error("Elmish program has not initialized")}function Gf(e,t,n){const r=ho(Vf)[0],o=ho(()=>$f(e,t,r)),l=o[1];var a,u;return go(()=>(r.hasDisposedOnce&&l($f(e,t,r)),po(()=>{!function(e){const t=e.state;if(null!=t){const e=mn(t);i(e)&&e.Dispose()}e.dispatcher=void 0,e.state=void 0,e.hasDisposedOnce=!0}(r)})),vn(n,[])),u=l,null==(a=r).listener&&(a.listener=u),[o[0],e=>{!function(e,t){const n=e.dispatcher;null!=n&&n(t)}(r,e)}]}function Wf(e,t){return Gf(e,void 0,t)}class qf extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]}}class Qf extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Header"]}}class Kf extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Empty","Text","Binary","Form"]}}class Yf extends U{constructor(e,t,n,r,o,i,l){super(),this.url=e,this.method=t,this.headers=n,this.withCredentials=r,this.overridenMimeType=o,this.overridenResponseType=i,this.content=l}}class Xf extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Text","Blob","ArrayBuffer","Unknown"]}}class Jf extends U{constructor(e,t,n,r,o){super(),this.statusCode=0|e,this.responseText=t,this.responseType=n,this.responseHeaders=r,this.content=o}}const Zf=new Yf("",new qf(0),jn(),!1,void 0,void 0,new Kf(0));new Jf(0,"","",Gl(),new Xf(0,""));function ed(e,t){return an(t)?[t]:fn(t,[e],null,0)}function td(e){return new Yf(e,Zf.method,Zf.headers,Zf.withCredentials,Zf.overridenMimeType,Zf.overridenResponseType,Zf.content)}function nd(e,t){return new Yf(t.url,e,t.headers,t.withCredentials,t.overridenMimeType,t.overridenResponseType,t.content)}function rd(e,t){return new Yf(t.url,t.method,Yn(t.headers,zn(e)),t.withCredentials,t.overridenMimeType,t.overridenResponseType,t.content)}function od(e,t){return new Yf(t.url,t.method,t.headers,t.withCredentials,t.overridenMimeType,t.overridenResponseType,e)}function id(e){return hr(t=>{const n=new XMLHttpRequest;n.open(function(e){switch(e.tag){case 1:return"POST";case 3:return"PATCH";case 2:return"PUT";case 4:return"DELETE";case 6:return"OPTIONS";case 5:return"HEAD";default:return"GET"}}(e.method),e.url),n.onreadystatechange=()=>{let e,r,o,i,l,a;4===n.readyState&&t[0]((r=n.responseType,e=""===r||"text"===r?n.responseText:"",o=0|n.status,i=n.responseType,a=n.responseType,l=""===a||"text"===a?new Xf(0,n.responseText):new Xf("arraybuffer"===a?2:"blob"===a?1:3,n.response),new Jf(o,e,i,function(e){const t=Mr();return jl(t,Nl(t,e))}(function(e,t,n){const r=[];for(let n=0;n<=t.length-1;n++){const o=e(t[n]);if(null!=o){const e=mn(o);r.push(e)}}return"function"==typeof n?kn(e=>e,r,n):r}(e=>{const t=Qn(ed(":",e));return Un(t)?void 0:[Hn(t).toLocaleLowerCase(),sn(":",Bn(t)).trim()]},ed("\r\n",n.getAllResponseHeaders()))),l)))};const r=u(e.headers);try{for(;r["System.Collections.IEnumerator.MoveNext"]();){const e=r["System.Collections.Generic.IEnumerator`1.get_Current"]();n.setRequestHeader(e.fields[0],e.fields[1])}}finally{r.Dispose()}n.withCredentials=e.withCredentials;const o=e.overridenMimeType;null==o||n.overrideMimeType(o);const i=e.overridenResponseType;null==i||(1===i.tag?n.responseType="blob":2===i.tag?n.responseType="arraybuffer":n.responseType="text");const l=[e.method,e.content];0===l[0].tag?n.send(hn(void 0)):1===l[1].tag||3===l[1].tag||2===l[1].tag?n.send(hn(l[1].fields[0])):n.send(hn(void 0))})}function ld(e){return Array.from(e)}function ad(e){return String(e)}function ud(e){return String(e)}function sd(e){return String(e)}function cd(e){return String(e)}function fd(){return null}function dd(e,t){return JSON.stringify(t,N(2,null),hn(e))}function pd(e){return t=>{return n=yn(e,t),r=()=>null,null!=n?mn(n):r();var n,r}}function hd(e,t,n,r){const o=new H(null),i=Bl(re(r),o,e);let l;if(ve(r)){const e=kn(e=>{const r=si(t,ne(e)),o=md(i,t,n,e[1]);return t=>i=>{const l=function(e,t){return e[t[0]]}(t,e);return(!n||n&&null!=l)&&(i[r]=o(l)),i}},he(r));l=t=>eo(N(2,M(e=>n=>n(t,e),[0,[0,2]])),{},e)}else{if(!ge(r)){let e;const t=re(r);throw e=nn(Zt("Cannot generate auto encoder for %s. Please pass an extra encoder."))(t),new Error(e)}l=e=>{const o=function(e,t){const n=pe(t)[e.tag];if(null==n)throw new Error(`Cannot find case ${e.name} in union type`);return[n,e.fields]}(e,r),l=o[0],a=o[1],u=0|a.length;if(0===u)return ne(l);{const e=0|u,r=be(l),o=En(new Array(e+1),0,e+1,null);o[0]=ne(l);for(let l=1;l<=e;l++){const e=md(i,t,n,r[l-1][1]);o[l]=e(a[l-1])}return o}}}return o.contents=l,l}function md(e,t,n,r){const o=re(r),i=Vl(o,e);if(null==i){if(oe(r)){const o=md(e,t,n,ie(r));return e=>ld(no(o,e))}if(ae(r)){const e=re(se(r));if("System.SByte"===e)return e=>ad(e);if("System.Byte"===e)return e=>ud(e);if("System.Int16"===e)return e=>sd(e);if("System.UInt16"===e)return e=>cd(e);if("System.Int32"===e)return e=>e;if("System.UInt32"===e)return e=>e;{const e=re(r),t=rn(Zt("Cannot generate auto encoder for %s.\nThoth.Json.Net only support the folluwing enum types:\n- sbyte\n- byte\n- int16\n- uint16\n- int\n- uint32\nIf you can't use one of these types, please pass an extra encoder.\n "))(e);return e=>t(e)}}if(le(r)){if(ye(r)){const o=kn(r=>md(e,t,n,r),me(r));return e=>ld(ro((e,t)=>o[e](t),e))}{const o=re(ue(r));if("Microsoft.FSharp.Core.FSharpOption`1[System.Object]"===o){const o=new c(()=>pd(md(e,t,n,$(r)[0])));return e=>null==e?null:o.Value(e)}if("Microsoft.FSharp.Collections.FSharpList`1[System.Object]"===o||"Microsoft.FSharp.Collections.FSharpSet`1[System.Object]"===o){const o=md(e,t,n,$(r)[0]);return e=>ld(no(o,e))}if("Microsoft.FSharp.Collections.FSharpMap`2[System.Object,System.Object]"===o){const o=$(r)[0],i=md(e,t,n,$(r)[1]);if("System.String"===re(o)||"System.Guid"===re(o))return e=>eo((e,t)=>{const n=t;return e[n[0]]=i(n[1]),e},{},e);{let r;const l=md(e,t,n,o);return r=e=>l(e),e=>ld(no(e=>{const t=e;return[r(t[0]),i(t[1])]},e))}}return hd(e,t,n,r)}}return"System.Boolean"===o?e=>e:"Microsoft.FSharp.Core.Unit"===o?fd:"System.String"===o?e=>e:"System.SByte"===o?e=>ad(e):"System.Byte"===o?e=>ud(e):"System.Int16"===o?e=>sd(e):"System.UInt16"===o?e=>cd(e):"System.Int32"===o?e=>e:"System.UInt32"===o?e=>e:"System.Double"===o?e=>e:"System.Single"===o?e=>e:"System.DateTime"===o?e=>function(e){return Bt(e,"O")}(e):"System.DateTimeOffset"===o?e=>function(e){return Bt(e,"O")}(e):"System.TimeSpan"===o?e=>function(e){return cl(e)}(e):"System.Guid"===o?e=>e:"System.Object"===o?e=>e:hd(e,t,n,r)}{const e=i;return t=>e.contents(t)}}function gd(e){return null!=e?$l((e,t)=>new H(t[0]),e.Coders):Gl()}function vd(e,t,n,r,o,i){return dd(e,function(e,t,n,r){const o=vn(e,new ii(0)),i=vn(n,!0),l=mn(r).ResolveType();return md(gd(t),o,i,l)}(n,r,o,i)(t))}function yd(e,t){return nn(en("%s%P()/fasttrack-middleware/admin/%P()",[e,t]))}function bd(e,t){return ar.Delay(()=>{const n=rd(function(e){return new Qf(0,"Authorization",e)}(nn(Zt("Bearer %s"))(e)),t);return ar.Bind(ar.Bind(id(n),e=>ar.Return(new ur(0,e))),e=>{const t=e;if(1===t.tag)return ar.Return(new ur(1,t.fields[0]));{const e=t.fields[0];return 429===e.statusCode||e.statusCode>=500?ar.Bind(id(n),e=>ar.Return(new ur(0,e))):ar.Return(new ur(0,e))}})})}function wd(e,t,n,r,o){return ar.Delay(()=>{let i,l;const a={apollo:r,flare:n};return ar.Bind(bd(t,(l=nd(new qf(2),td(yd(e,nn(en("accountSettings/ftApiVersion/%P()",[o]))))),i=od(new Kf(1,vd(0,a,void 0,void 0,void 0,{ResolveType:()=>Q(["apollo",J(ee)],["flare",J(ee)])})),l),rd(function(e){return new Qf(0,"Content-Type",e)}("application/json"),i))),e=>{const t=e;return 1===t.tag?ar.Return(new ur(1,t.fields[0])):200===t.fields[0].statusCode?ar.Return(new ur(0,void 0)):ar.Return(new ur(1,"Unexpected response from backend"))})})}class Sd extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["ConfirmApiVersionUpdate"]}}class Ed extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["LoadAccounts","ToggleSelected","ClearAllSelected","GetApiVersionUpdateConfirmation","ApiVersionUpdateConfirmed","ApiVersionUpdateCancelled"]}}class kd extends U{constructor(e,t,n){super(),this.Data=e,this.Selected=t,this.Dialog=n}}function Cd(){return[new kd(new au(0),[],void 0),(e=new Ed(0,new au(1)),zn(t=>{t(e)}))];var e}function xd(e){return e?"On":"Off"}function Od(e,t,n,r,o,i){const l=null!=(a=e.Roles,er(new Ya(0,"FastTrack.EditConfig"),a,{Equals:(e,t)=>E(e,t),GetHashCode:e=>b(e)})?hn(void 0):void 0);var a,u,s,c;return u=Kr($r(()=>Jr(l?Qr(du("")):qr(),$r(()=>Jr(Qr(du("ID")),$r(()=>Jr(Qr(du("Name")),$r(()=>Jr(Qr(du("Email")),$r(()=>Jr(Qr(du("Last Summary Email Checked")),$r(()=>Jr(Qr(du("FT API Version")),$r(()=>Jr(Qr(du("Payee Integration")),$r(()=>Jr(Qr(du("Payee Type")),$r(()=>Jr(Qr(du("Payee Update")),$r(()=>Jr(Qr(du("Use Division Lookup")),$r(()=>Jr(Qr(du("Flare Rep Name")),$r(()=>Qr(du("Flare Webhook Subscription ID")))))))))))))))))))))))))),s=On(0,n,null)||0!==n.length?function(e,t){return Object(Nr.createElement)("div",{className:"absolute left-0 right-0 bottom-[84px] mx-auto w-[440px] py-3 px-4 bg-gray-100 border border-solid border-gray-300 ring-1 ring-black ring-opacity-5 shadow-lg rounded-lg",children:lo.Children.toArray([Object(Nr.createElement)("div",{className:"flex justify-between items-center",children:lo.Children.toArray([Object(Nr.createElement)("div",{className:"text-gray-700 text-sm",children:lo.Children.toArray([Object(Nr.createElement)("span",{className:"font-medium",children:e.length}),Object(Nr.createElement)("span",{children:nn(en(" %P() selected",[Ka(e.length,"Account")]))})])}),Object(Nr.createElement)("div",{className:"flex items-center gap-3.5",children:lo.Children.toArray([mc({Button:e=>Object(Nr.createElement)("button",{className:sn(" ",Kr($r(()=>Jr(Qr("flex items-center gap-1.5 border border-solid rounded-md border-gray-300 shadow-sm py-1.5 px-3 bg-white text-gray-700 font-medium text-sm"),$r(()=>Jr(Qr("focus:outline-none focus:ring-2 focus:ring-blue-600 focus:ring-offset-2"),$r(()=>e?Qr("outline-none ring-2 ring-blue-600 ring-offset-2"):qr()))))))),children:lo.Children.toArray(["Actions",Object(Nr.createElement)("div",{children:lo.Children.toArray([gc])})])}),MenuItems:zn(new hc("Change FT Api Version",!1,()=>{t(new eu(0))})),Position:new pc(0)}),Object(Nr.createElement)("button",{className:"cursor-pointer focus:rounded-full focus:outline-none focus:ring-2 focus:ring-blue-600 focus:ring-offset-2",onClick:e=>{t(new eu(1))},children:lo.Children.toArray([yc])})])})])})])})}(n,o):void 0,c=kn(e=>{const o=n.some(t=>E(e,t));return Kr($r(()=>Jr(l?Qr(function(e,t,n){return fu(Object(Nr.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-right font-medium",children:lo.Children.toArray([Object(Nr.createElement)("input",{key:e,className:"h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600",type:"checkbox",checked:n,onChange:e=>{t()}})])}))}(e.Id,()=>{r(e)},o)):qr(),$r(()=>{let n;return Jr(null!=e.Flare?Qr(pu(["text-gray-900","font-medium"],e.Id)):Qr((n=[Bo(Qn(["account-registry","partners",t,"accounts",e.Id]),1),e.Id],r=n[0],o=n[1],fu(Object(Nr.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-left font-medium",children:lo.Children.toArray([Object(Nr.createElement)("a",{className:"text-indigo-600 hover:text-indigo-900",children:o,href:r})])})))),$r(()=>{let t;return Jr(Qr(pu(["text-gray-500"],vn((t=e.Flare,null==t?void 0:t.AccountName),vn(e.FastTrack.AccountName,"")))),$r(()=>Jr(Qr(pu(["text-gray-500"],vn(e.FastTrack.Email,""))),$r(()=>Jr(Qr(pu(["text-gray-500"],vn(e.LastSummaryEmailChecked,""))),$r(()=>Jr(Qr(pu(["text-gray-500"],e.FastTrack.ApiVersion)),$r(()=>Jr(Qr(pu(["text-gray-500"],xd(e.FastTrack.PayeeIntegrationFlag))),$r(()=>Jr(Qr(pu(["text-gray-500"],vn(e.FastTrack.PayeeType,""))),$r(()=>Jr(Qr(pu(["text-gray-500"],xd(e.FastTrack.PayeeUpdateFlag))),$r(()=>{let t;return Jr(Qr(pu(["text-gray-500"],vn((t=e.Flare,null==t?void 0:xd(t.UseDivisionLookup)),""))),$r(()=>{let t;return Jr(Qr(pu(["text-gray-500"],vn((t=e.Flare,null==t?void 0:t.RepName),""))),$r(()=>{let t;return Qr(pu(["text-gray-500"],vn((t=e.Flare,null==t?void 0:t.WebhookSubscriptionId),"")))}))}))}))))))))))))))}));var r,o}))))},i),Object(Nr.createElement)("div",{className:"flex flex-col mt-4",children:lo.Children.toArray([Object(Nr.createElement)("div",{className:"-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8",children:lo.Children.toArray([Object(Nr.createElement)("div",{className:"py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8",children:lo.Children.toArray(Array.from(Kr($r(()=>{let e,t;return Jr(Qr(Object(Nr.createElement)("div",{className:"shadow overflow-hidden border-b border-gray-200 sm:rounded-lg",children:lo.Children.toArray([Object(Nr.createElement)("table",{className:"min-w-full divide-y divide-gray-200",children:lo.Children.toArray([Object(Nr.createElement)("thead",{className:"bg-gray-50",children:(e=no(e=>e.fields[0],u),Object(Nr.createElement)("tr",{children:lo.Children.toArray(Array.from(e))}))}),(t=ro((e,t)=>{return n=t,Object(Nr.createElement)("tr",{className:e%2==0?"bg-white":"bg-gray-50",children:lo.Children.toArray(Array.from(no(e=>e.fields[0],n)))});var n},c),Object(Nr.createElement)("tbody",{children:lo.Children.toArray(Array.from(t))}))])})])})),$r(()=>null==s?qr():Qr(s)))}))))})])})])})}function Td(e){const t=e.apolloPartnerId,n=e.user,r=e.accessToken,o=e.backendUrl,i=(l=Cd,a=(e,t)=>function(e,t,n,r){const o=[n,r];let i,l,a,u;switch(0===o[0].tag?1===o[0].fields[0].tag?i=0===o[1].Data.tag?0:6:2===o[0].fields[0].tag?1===o[1].Data.tag?(i=1,l=o[0].fields[0].fields[0]):i=6:3===o[0].fields[0].tag&&1===o[1].Data.tag?(i=2,a=o[0].fields[0].fields[0]):i=6:1===o[0].tag?null==o[1].Dialog?(i=3,u=o[0].fields[0]):i=6:i=2===o[0].tag?null==o[1].Dialog?4:6:3===o[0].tag&&null==o[1].Dialog&&o[1].Selected.length>0?5:6,i){case 0:return[new kd(new au(1),r.Selected,r.Dialog),Tr(e=>{Ir(e)},e,void 0,e=>new Ed(0,new au(2,e)),e=>new Ed(0,new au(3,e)))];case 1:return[new kd(new au(2,l),r.Selected,r.Dialog),Cr()];case 2:return[new kd(new au(3,a),r.Selected,r.Dialog),Cr()];case 3:return[new kd(r.Data,r.Selected.some(e=>E(u,e))?r.Selected.filter(e=>!E(u,e)):Sn(r.Selected,[u]),r.Dialog),Cr()];case 4:return[new kd(r.Data,[],r.Dialog),Cr()];case 5:return[new kd(r.Data,r.Selected,new Sd(0)),Cr()];case 6:{let e,n,i;switch(5===o[0].tag?e=null!=o[1].Dialog?0:2:4===o[0].tag&&2===o[1].Data.tag&&0===o[1].Data.fields[0].tag&&null!=o[1].Dialog?(e=1,n=o[1].Data.fields[0].fields[0],i=o[0].fields[0]):e=2,e){case 0:return[new kd(r.Data,[],void 0),Cr()];case 1:{const e=kn(e=>e.Id,r.Selected.filter(e=>null!=e.Flare)),o=kn(e=>e.Id,r.Selected.filter(e=>null==e.Flare));return[new kd(new au(1),[],void 0),Tr(e=>{Ir(e)},P(1,t,[n]),[e,o,i],e=>new Ed(0,new au(2,e)),e=>new Ed(0,new au(3,e)))]}case 2:return[r,Cr()]}}}}(()=>function(e,t){return ar.Delay(()=>ar.Bind(bd(t,nd(new qf(0),td(yd(e,"accounts")))),e=>{const t=e;if(1===t.tag)return ar.Return(new ur(1,t.fields[0]));{const e=t.fields[0];return 200===e.statusCode?ar.Return(Qa(e.responseText,void 0,void 0,{ResolveType:()=>J(iu())})):ar.Return(new ur(1,"Unexpected response from backend"))}}))}(o,r),(e,t)=>{let n;const i=t[0],l=t[1],a=t[2];return ar.Bind((n=[i,l,a],wd(o,r,n[0],n[1],n[2])),t=>{let n;return ar.Return((n=t,1===n.tag?new ur(1,n.fields[0]):new ur(0,kn(e=>{let t;return function(e,t,n){return(r=>{for(;;){const o=r;if(o>=t.length)return!1;if(n.Equals(e,t[o]))return!0;r=o+1}})(0)}(e.Id,Sn(l,i),{Equals:(e,t)=>e===t,GetHashCode:e=>m(e)})?new ou(e.Id,(t=e.FastTrack,new ru(t.AccountName,a,t.Email,t.PayeeIntegrationFlag,t.PayeeType,t.PayeeUpdateFlag)),e.Flare,e.LastSummaryEmailChecked):e},e))))})},e,t),Wf(()=>Uf(l,a,(e,t)=>{}),[]));var l,a;const u=i[0],s=i[1],c=u.Data;let f,d;switch(1===c.tag?f=0:2===c.tag?0===c.fields[0].tag?(f=2,d=c.fields[0].fields[0]):f=1:f=3===c.tag?1:0,f){case 0:return Object(Nr.createElement)("div",{children:["Loading..."]});case 1:return Object(Nr.createElement)("div",{children:["There was an error loading Flare accounts."]});case 2:return Object(Nr.createElement)("div",{className:"h-full flex flex-col relative",children:lo.Children.toArray(Array.from(Kr($r(()=>Jr(Qr(Od(n,t,u.Selected,e=>{s(new Ed(1,e))},e=>{1===e.tag?s(new Ed(2)):s(new Ed(3))},d)),$r(()=>{return null==u.Dialog?Qr(null):Qr((e=e=>{s(new Ed(4,e))},t=()=>{s(new Ed(5))},n=u.Selected,Object(Nr.createElement)(Df,new Mf(n.length,e,t))));var e,t,n}))))))})}}var Id=n(4);var Nd,_d,Pd,Md=n(5);class Dd extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["PageChanged"]}}function Fd(){return K("Middleware.FastTrack.AdminUI.App.Msg",[],Dd,()=>[[["Item",Ko()]]])}class Ld extends U{constructor(e,t){super(),this.CurrentPage=e,this.User=t}}function Rd(){return q("Middleware.FastTrack.AdminUI.App.State",[],Ld,()=>[["CurrentPage",Ko()],["User",q("Middleware.FastTrack.AdminUI.Common.User",[],Ja,()=>[["UserName",Y(ee)],["Roles",X(K("Middleware.FastTrack.AdminUI.Common.AccessRole",[],Ya,()=>[[["Item",ee]]]))]])]])}function jd(e){const t=1===Yo($o(window.location.hash,1)).tag?function(e){if(0===e.tag){const e=["fasttrack-middleware","accounts"];return Or(t=>{Vo(Qn(e),1,1)})}{const e=["fasttrack-middleware","accounts"];return Or(t=>{Vo(Qn(e),1,1)})}}(new Qo(0)):Cr();return[new Ld(Yo($o(window.location.hash,1)),Za(e)),t]}function Ad(e,t){return[new Ld(e.fields[0],t.User),Cr()]}function zd(e){return t=1===e.tag?jn():zn(nu("Accounts",void 0)),Object(Nr.createElement)("div",{className:"border-b border-gray-200",children:lo.Children.toArray([Object(Nr.createElement)("nav",{className:"-mb-px flex space-x-8","aria-label":"Tabs",children:lo.Children.toArray(Array.from(no(e=>e.fields[0],t)))})])});var t}function Ud(e,t){const n=[t.CurrentPage,t.User.Roles];let r;switch(r=0===n[0].tag&&null!=Xa(n[1])?0:1,r){case 0:return Object(Nr.createElement)(Td,{backendUrl:e.backendUrl,accessToken:e.accessToken,user:t.User,apolloPartnerId:e.apolloPartnerId});case 1:{let e;switch(e=1===n[0].tag&&null!=Xa(n[1])?0:1,e){case 0:return Object(Nr.createElement)("h1",{children:["Not Found"]});case 1:return Object(Nr.createElement)("h1",{children:["Access denied"]})}}}}function Hd(e){const t=(n=jd(e.accessToken),r=(e,t)=>Ad(e,t),Wf(()=>Uf(()=>n,r,(e,t)=>{}),[]));var n,r;const o=t[0];return Go({onUrlChanged:e=>{t[1](new Dd(0,Yo(e)))},application:Nr.createElement(Nr.Fragment,{},zd(o.CurrentPage),Ud(e,o))})}Nd=e=>Object(Nr.createElement)(Hd,e),_d="superhero-fasttrack-middleware",Pd={props:{accessToken:"string",apolloPartnerId:"string",backendUrl:"string"}},customElements.define(_d,function(e,t,n,r={}){return Object(Id.a)(e,r,{mount:function(e,r,o){const i=t.createElement(r,o);if("createRoot"in n){const t=n.createRoot(e);return t.render(i),{container:e,root:t,ReactComponent:r}}if("render"in n)return n.render(i,e),{container:e,ReactComponent:r};throw new Error("Invalid ReactDOM instance provided.")},unmount:function({container:e,root:t}){t?t.unmount():"unmountComponentAtNode"in n&&n.unmountComponentAtNode(e)},update:function({container:e,root:r,ReactComponent:o},i){const l=t.createElement(o,i);r?r.render(l):"render"in n&&n.render(l,e)}})}(Nd,Nr,Md,Pd))}]);
|
|
29
|
+
function n(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(!(0<i(o,t)))break e;e[r]=t,e[n]=o,n=r}}function r(e){return 0===e.length?null:e[0]}function o(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,o=e.length,l=o>>>1;r<l;){var a=2*(r+1)-1,u=e[a],s=a+1,c=e[s];if(0>i(u,n))s<o&&0>i(c,u)?(e[r]=c,e[s]=n,r=s):(e[r]=u,e[a]=n,r=a);else{if(!(s<o&&0>i(c,n)))break e;e[r]=c,e[s]=n,r=s}}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var l=performance;t.unstable_now=function(){return l.now()}}else{var a=Date,u=a.now();t.unstable_now=function(){return a.now()-u}}var s=[],c=[],f=1,d=null,p=3,h=!1,m=!1,g=!1,v="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,b=void 0!==e?e:null;function w(e){for(var t=r(c);null!==t;){if(null===t.callback)o(c);else{if(!(t.startTime<=e))break;o(c),t.sortIndex=t.expirationTime,n(s,t)}t=r(c)}}function S(e){if(g=!1,w(e),!m)if(null!==r(s))m=!0,D(E);else{var t=r(c);null!==t&&F(S,t.startTime-e)}}function E(e,n){m=!1,g&&(g=!1,y(O),O=-1),h=!0;var i=p;try{for(w(n),d=r(s);null!==d&&(!(d.expirationTime>n)||e&&!N());){var l=d.callback;if("function"==typeof l){d.callback=null,p=d.priorityLevel;var a=l(d.expirationTime<=n);n=t.unstable_now(),"function"==typeof a?d.callback=a:d===r(s)&&o(s),w(n)}else o(s);d=r(s)}if(null!==d)var u=!0;else{var f=r(c);null!==f&&F(S,f.startTime-n),u=!1}return u}finally{d=null,p=i,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var k,C=!1,x=null,O=-1,T=5,I=-1;function N(){return!(t.unstable_now()-I<T)}function _(){if(null!==x){var e=t.unstable_now();I=e;var n=!0;try{n=x(!0,e)}finally{n?k():(C=!1,x=null)}}else C=!1}if("function"==typeof b)k=function(){b(_)};else if("undefined"!=typeof MessageChannel){var P=new MessageChannel,M=P.port2;P.port1.onmessage=_,k=function(){M.postMessage(null)}}else k=function(){v(_,0)};function D(e){x=e,C||(C=!0,k())}function F(e,n){O=v((function(){e(t.unstable_now())}),n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){m||h||(m=!0,D(E))},t.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"):T=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return r(s)},t.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}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.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}},t.unstable_scheduleCallback=function(e,o,i){var l=t.unstable_now();switch("object"==typeof i&&null!==i?i="number"==typeof(i=i.delay)&&0<i?l+i:l:i=l,e){case 1:var a=-1;break;case 2:a=250;break;case 5:a=1073741823;break;case 4:a=1e4;break;default:a=5e3}return e={id:f++,callback:o,priorityLevel:e,startTime:i,expirationTime:a=i+a,sortIndex:-1},i>l?(e.sortIndex=i,n(c,e),null===r(s)&&e===r(c)&&(g?(y(O),O=-1):g=!0,F(S,i-l))):(e.sortIndex=a,n(s,e),m||h||(m=!0,D(E))),e},t.unstable_shouldYield=N,t.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}}).call(this,n(10).setImmediate)},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(11),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(1))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,l,a,u=1,s={},c=!1,f=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){h(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(h,0,e)}:(l="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(l)&&h(+t.data.slice(l.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),r=function(t){e.postMessage(l+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var o={callback:e,args:t};return s[u]=o,r(u),u++},d.clearImmediate=p}function p(e){delete s[e]}function h(e){if(c)setTimeout(h,0,e);else{var t=s[e];if(t){c=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{p(e),c=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(1),n(12))},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:l}catch(e){r=l}}();var u,s=[],c=!1,f=-1;function d(){c&&u&&(c=!1,u.length?s=u.concat(s):f=-1,s.length&&p())}function p(){if(!c){var e=a(d);c=!0;for(var t=s.length;t;){for(u=s,s=[];++f<t;)u&&u[f].run();f=-1,t=s.length}u=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===l||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function m(){}o.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];s.push(new h(e,t)),1!==s.length||c||a(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";function r(e){return Array.isArray(e)||ArrayBuffer.isView(e)}function o(e){return"function"==typeof e.GetHashCode}function i(e){return null!=e&&"function"==typeof e.Dispose}function l(e,t){return Object.getPrototypeOf(e).constructor===Object.getPrototypeOf(t).constructor}n.r(t),n.d(t,"Msg",(function(){return Dd})),n.d(t,"Msg$reflection",(function(){return Fd})),n.d(t,"State",(function(){return Ld})),n.d(t,"State$reflection",(function(){return Rd})),n.d(t,"StateModule_init",(function(){return jd})),n.d(t,"StateModule_update",(function(){return Ad})),n.d(t,"Component",(function(){return Hd}));class a{constructor(e){this.iter=e}"System.Collections.Generic.IEnumerator`1.get_Current"(){return this.current}"System.Collections.IEnumerator.get_Current"(){return this.current}"System.Collections.IEnumerator.MoveNext"(){const e=this.iter.next();return this.current=e.value,!e.done}"System.Collections.IEnumerator.Reset"(){throw new Error("JS iterators cannot be reset")}Dispose(){}}function u(e){return"function"==typeof e.GetEnumerator?e.GetEnumerator():new a(e[Symbol.iterator]())}function s(e){return{[Symbol.iterator](){return this},next(){const t=e["System.Collections.IEnumerator.MoveNext"]();return{done:!t,value:t?e["System.Collections.IEnumerator.get_Current"]():void 0}}}}class c{constructor(e){this.factory=e,this.isValueCreated=!1}get Value(){return this.isValueCreated||(this.createdValue=this.factory(),this.isValueCreated=!0),this.createdValue}get IsValueCreated(){return this.isValueCreated}}function f(e,t){let n=e.toString(10);for(;n.length<t;)n="0"+n;return n}function d(e){const t=e;return"number"==typeof t.offset?t.offset:1===e.kind?0:-6e4*e.getTimezoneOffset()}function p(e,t){return(e=e<0&&null!=t&&10!==t?4294967295+e+1:e).toString(t)}class h{static id(e){return h.idMap.has(e)||h.idMap.set(e,++h.count),h.idMap.get(e)}}function m(e){let t=0,n=5381;const r=e.length;for(;t<r;)n=33*n^e.charCodeAt(t++);return n}function g(e){return 2654435761*e|0}function v(e){return 0===e.length?0:e.reduce((e,t)=>(e<<5)+e^t)}function y(e){if(null==e)return 0;switch(typeof e){case"boolean":return e?1:0;case"number":return g(e);case"string":return m(e);default:if(o(e))return e.GetHashCode();if(r(e))return function(e){const t=e.length,n=new Array(t);for(let r=0;r<t;r++)n[r]=y(e[r]);return v(n)}(e);if(e instanceof Date)return function(e){return e.getTime()}(e);if(Object.getPrototypeOf(e).constructor===Object){return v(Object.values(e).map(e=>y(e)))}return g(h.id(e))}}function b(e){return null==e?0:o(e)?e.GetHashCode():g(h.id(e))}function w(e,t,n){if(null==e)return null==t;if(null==t)return!1;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function S(e,t){return w(e,t,E)}function E(e,t){return e===t||(null==e?null==t:null!=t&&("object"==typeof e&&(function(e){return"function"==typeof e.Equals}(e)?e.Equals(t):r(e)?r(t)&&S(e,t):e instanceof Date?t instanceof Date&&0===k(e,t):Object.getPrototypeOf(e).constructor===Object&&function(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;n.sort(),r.sort();for(let o=0;o<n.length;o++)if(n[o]!==r[o]||!E(e[n[o]],t[r[o]]))return!1;return!0}(e,t))))}function k(e,t){let n,r;return"offset"in e&&"offset"in t?(n=e.getTime(),r=t.getTime()):(n=e.getTime()+d(e),r=t.getTime()+d(t)),n===r?0:n<r?-1:1}function C(e,t){return e===t?0:e<t?-1:1}function x(e,t){return function(e,t,n){if(null==e)return null==t?0:1;if(null==t)return-1;if(e.length!==t.length)return e.length<t.length?-1:1;for(let r=0,o=0;r<e.length;r++)if(o=n(e[r],t[r]),0!==o)return o;return 0}(e,t,O)}function O(e,t){return e===t?0:null==e?null==t?0:-1:null==t?1:"object"!=typeof e?e<t?-1:1:function(e){return"function"==typeof e.CompareTo}(e)?e.CompareTo(t):r(e)?r(t)?x(e,t):-1:e instanceof Date?t instanceof Date?k(e,t):-1:Object.getPrototypeOf(e).constructor===Object?function(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return n.length<r.length?-1:1;n.sort(),r.sort();for(let o=0,i=0;o<n.length;o++){const l=n[o];if(l!==r[o])return l<r[o]?-1:1;if(i=O(e[l],t[l]),0!==i)return i}return 0}(e,t):-1}function T(e,t,n){return e(t,n)>0?t:n}function I(e){const t={};for(const n of e)t[n[0]]=n[1];return t}h.idMap=new WeakMap,h.count=0;function N(e,t){if(null==t||t.length>1)return t;let n;switch(e){case 2:n=(e,n)=>t(e)(n);break;case 3:n=(e,n,r)=>t(e)(n)(r);break;case 4:n=(e,n,r,o)=>t(e)(n)(r)(o);break;case 5:n=(e,n,r,o,i)=>t(e)(n)(r)(o)(i);break;case 6:n=(e,n,r,o,i,l)=>t(e)(n)(r)(o)(i)(l);break;case 7:n=(e,n,r,o,i,l,a)=>t(e)(n)(r)(o)(i)(l)(a);break;case 8:n=(e,n,r,o,i,l,a,u)=>t(e)(n)(r)(o)(i)(l)(a)(u);break;default:throw new Error("Uncurrying to more than 8-arity is not supported: "+e)}return n.__CURRIED__=t,n}function _(e,t){if(null==t||1===t.length)return t;if("__CURRIED__"in t)return t.__CURRIED__;switch(e){case 2:return e=>n=>t(e,n);case 3:return e=>n=>r=>t(e,n,r);case 4:return e=>n=>r=>o=>t(e,n,r,o);case 5:return e=>n=>r=>o=>i=>t(e,n,r,o,i);case 6:return e=>n=>r=>o=>i=>l=>t(e,n,r,o,i,l);case 7:return e=>n=>r=>o=>i=>l=>a=>t(e,n,r,o,i,l,a);case 8:return e=>n=>r=>o=>i=>l=>a=>u=>t(e,n,r,o,i,l,a,u);default:throw new Error("Currying to more than 8-arity is not supported: "+e)}}function P(e,t,n){if(null!=t){if("__CURRIED__"in t){t=t.__CURRIED__;for(let e=0;e<n.length;e++)t=t(n[e]);return t}switch(e){case 1:return e=>t.apply(void 0,n.concat([e]));case 2:return e=>r=>t.apply(void 0,n.concat([e,r]));case 3:return e=>r=>o=>t.apply(void 0,n.concat([e,r,o]));case 4:return e=>r=>o=>i=>t.apply(void 0,n.concat([e,r,o,i]));case 5:return e=>r=>o=>i=>l=>t.apply(void 0,n.concat([e,r,o,i,l]));case 6:return e=>r=>o=>i=>l=>a=>t.apply(void 0,n.concat([e,r,o,i,l,a]));case 7:return e=>r=>o=>i=>l=>a=>u=>t.apply(void 0,n.concat([e,r,o,i,l,a,u]));case 8:return e=>r=>o=>i=>l=>a=>u=>s=>t.apply(void 0,n.concat([e,r,o,i,l,a,u,s]));default:throw new Error("Partially applying to more than 8-arity is not supported: "+e)}}}function M(e,t){return n=>function e(t,n,r,o){const i=r[o];if(0!==i){const e=i[0],t=i[1];e>1&&(n=_(e,n)),t>1&&(n=N(t,n))}const l=t(n);return o+1===r.length?l:t=>e(l,t,r,o+1)}(e,n,t,0)}function D(e,t=0){if(null!=e&&"object"==typeof e){if("function"==typeof e.toString)return e.toString();if(Symbol.iterator in e)return function(e){let t=0,n="[";for(const r of e){if(0===t)n+=D(r);else{if(100===t){n+="; ...";break}n+="; "+D(r)}t++}return n+"]"}(e);{const n=Object.getPrototypeOf(e).constructor;return n===Object&&t<10?"{ "+Object.entries(e).map(([e,n])=>e+" = "+D(n,t+1)).join("\n ")+" }":n.name}}return String(e)}class F{get name(){return this.cases()[this.tag]}toJSON(){return 0===this.fields.length?this.name:[this.name].concat(this.fields)}toString(){return function(e,t){if(0===t.length)return e;{let n="",r=!0;return 1===t.length?(n=D(t[0]),r=n.indexOf(" ")>=0):n=t.map(e=>D(e)).join(", "),e+(r?" (":" ")+n+(r?")":"")}}(this.name,this.fields)}GetHashCode(){const e=this.fields.map(e=>y(e));return e.splice(0,0,g(this.tag)),v(e)}Equals(e){return this===e||!!l(this,e)&&(this.tag===e.tag&&S(this.fields,e.fields))}CompareTo(e){return this===e?0:l(this,e)?this.tag===e.tag?x(this.fields,e.fields):this.tag<e.tag?-1:1:-1}}function L(e){const t={},n=Object.keys(e);for(let r=0;r<n.length;r++)t[n[r]]=e[n[r]];return t}function R(e){return"{ "+Object.entries(e).map(([e,t])=>e+" = "+D(t)).join("\n ")+" }"}function j(e){return v(Object.values(e).map(e=>y(e)))}function A(e,t){if(e===t)return!0;if(l(e,t)){const n=Object.keys(e);for(let r=0;r<n.length;r++)if(!E(e[n[r]],t[n[r]]))return!1;return!0}return!1}function z(e,t){if(e===t)return 0;if(l(e,t)){const n=Object.keys(e);for(let r=0;r<n.length;r++){const o=O(e[n[r]],t[n[r]]);if(0!==o)return o}return 0}return-1}class U{toJSON(){return L(this)}toString(){return R(this)}GetHashCode(){return j(this)}Equals(e){return A(this,e)}CompareTo(e){return z(this,e)}}class H{constructor(e,t){"function"==typeof t?(this.getter=e,this.setter=t):(this.getter=()=>e,this.setter=t=>{e=t})}get contents(){return this.getter()}set contents(e){this.setter(e)}}class B{constructor(e,t,n,r){this.declaringType=e,this.tag=t,this.name=n,this.fields=r}}class V{constructor(e,t,n,r,o,i,l){this.fullname=e,this.generics=t,this.construct=n,this.parent=r,this.fields=o,this.cases=i,this.enumCases=l}toString(){return re(this)}GetHashCode(){return G(this)}Equals(e){return W(this,e)}}function $(e){return null!=e.generics?e.generics:[]}function G(e){return v([m(e.fullname),...$(e).map(G)])}function W(e,t){return""===e.fullname?""===t.fullname&&w(he(e),he(t),([e,t],[n,r])=>e===n&&W(t,r)):e.fullname===t.fullname&&w($(e),$(t),W)}function q(e,t,n,r){return new V(e,t,n,void 0,r)}function Q(...e){return new V("",void 0,void 0,void 0,()=>e)}function K(e,t,n,r){const o=new V(e,t,n,void 0,void 0,()=>{const e=n.prototype.cases();return r().map((t,n)=>new B(o,n,e[n],t))});return o}function Y(e){return new V("Microsoft.FSharp.Core.FSharpOption`1",[e])}function X(e){return new V("Microsoft.FSharp.Collections.FSharpList`1",[e])}function J(e){return new V(e.fullname+"[]",[e])}const Z=new V("System.Object"),ee=(new V("Microsoft.FSharp.Core.Unit"),new V("System.Char"),new V("System.String")),te=new V("System.Boolean");new V("System.SByte"),new V("System.Byte"),new V("System.Int16"),new V("System.UInt16"),new V("System.Int32"),new V("System.UInt32"),new V("System.Single"),new V("System.Double"),new V("System.Decimal");function ne(e){if(Array.isArray(e))return e[0];if(e instanceof B)return e.name;{const t=e.fullname.lastIndexOf(".");return-1===t?e.fullname:e.fullname.substr(t+1)}}function re(e){const t=null==e.generics||oe(e)?[]:e.generics;return t.length>0?e.fullname+"["+t.map(e=>re(e)).join(",")+"]":e.fullname}function oe(e){return e.fullname.endsWith("[]")}function ie(e){var t;return oe(e)?null===(t=e.generics)||void 0===t?void 0:t[0]:void 0}function le(e){return null!=e.generics&&e.generics.length>0}function ae(e){return null!=e.enumCases&&e.enumCases.length>0}function ue(e){return null==e.generics?e:new V(e.fullname,e.generics.map(()=>Z))}function se(e){var t;return null===(t=e.generics)||void 0===t?void 0:t[0]}function ce(e){if(ae(e)&&null!=e.enumCases)return e.enumCases.map(e=>e[1]);throw new Error(e.fullname+" is not an enum type")}function fe(e,t){if(null!=e.enumCases){if("string"==typeof t){for(const n of e.enumCases)if(n[0]===t)return n;throw new Error(`'${t}' was not found in ${e.fullname}`)}for(const n of e.enumCases)if(n[1]===t)return n;return["",t]}throw new Error(e.fullname+" is not an enum type")}function de(e,t){const n=parseInt(t,10);return fe(e,isNaN(n)?t:n)[1]}function pe(e){if(null!=e.cases)return e.cases();throw new Error(e.fullname+" is not an F# union type")}function he(e){if(null!=e.fields)return e.fields();throw new Error(e.fullname+" is not an F# record type")}function me(e){if(ye(e)&&null!=e.generics)return e.generics;throw new Error(e.fullname+" is not a tuple type")}function ge(e){return e instanceof V?null!=e.cases:e instanceof F}function ve(e){return e instanceof V?null!=e.fields:e instanceof U}function ye(e){return e.fullname.startsWith("System.Tuple")&&!oe(e)}function be(e){return null==e.fields?[]:e.fields}function we(e,t){const n=(e.fields||[]).length;if(t.length!==n)throw new Error(`Expected an array of length ${n} but got ${t.length}`);return null!=e.declaringType.construct?new e.declaringType.construct(e.tag,...t):{}}var Se;function Ee(e,t){switch(t){case 8:return e?[0,255]:[-128,127];case 16:return e?[0,65535]:[-32768,32767];case 32:return e?[0,4294967295]:[-2147483648,2147483647];default:throw new Error("Invalid bit size.")}}function ke(e,t,n){const r=/^\s*([\+\-])?(0[xXoObB])?([0-9a-fA-F]+)\s*$/.exec(e.replace(/_/g,""));if(null!=r){const[,,e,o]=r;if(!function(e){switch(e){case 2:return/[^0-1]/;case 8:return/[^0-7]/;case 10:return/[^0-9]/;case 16:return/[^0-9a-fA-F]/;default:throw new Error("Invalid Base.")}}(n=n||function(e,t){if(t&Se.AllowHexSpecifier)return 16;switch(e){case"0b":case"0B":return 2;case"0o":case"0O":return 8;case"0x":case"0X":return 16;default:return 10}}(e,t)).test(o))return function(e,t){const[,n,r,o]=e;return{sign:n||"",prefix:r||"",digits:o,radix:t}}(r,n)}return null}function Ce(e,t,n,r,o){const i=ke(e,t,o);if(null!=i){let e=Number.parseInt(i.sign+i.digits,i.radix);if(!Number.isNaN(e)){const[t,o]=Ee(!0,r);!n&&10!==i.radix&&e>=t&&e<=o&&(e=e<<32-r>>32-r);const[l,a]=Ee(n,r);if(e>=l&&e<=a)return e}}throw new Error("Input string was not in a correct format.")}function xe(e,t,n,r,o){try{return o.contents=Ce(e,t,n,r),!0}catch(e){return!1}}function Oe(e){return-2147483648===e?e:-e}!function(e){e[e.AllowHexSpecifier=512]="AllowHexSpecifier"}(Se||(Se={}));const Te=Symbol("numeric");function Ie(e){return"number"==typeof e||(null==e?void 0:e[Te])}function Ne(e,t){return"number"==typeof e?e*t:e[Te]().multiply(t)}function _e(e,t){return"number"==typeof e?e.toFixed(t):e[Te]().toFixed(t)}function Pe(e,t){return"number"==typeof e?e.toPrecision(t):e[Te]().toPrecision(t)}function Me(e,t){return"number"==typeof e?e.toExponential(t):e[Te]().toExponential(t)}function De(e){return"number"==typeof e?(Number(e)>>>0).toString(16):e[Te]().toHex()}var Fe=null;try{Fe=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(gu){}function Le(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function Re(e){return!0===(e&&e.__isLong__)}Le.prototype.GetHashCode=function(){let e=this.unsigned?1:0;return e=(e<<5)+e^this.high,e=(e<<5)+e^this.low,e},Le.prototype.Equals=function(e){return st(this,e)},Le.prototype.CompareTo=function(e){return pt(this,e)},Le.prototype.toString=function(e){return it(this,e)},Le.prototype.toJSON=function(){return it(this)},Le.prototype[Te]=function(){const e=this;return{multiply:t=>vt(e,t),toPrecision:t=>String(e)+(0).toPrecision(t).substr(1),toExponential:t=>String(e)+(0).toExponential(t).substr(1),toFixed:t=>String(e)+(0).toFixed(t).substr(1),toHex:()=>it(e.unsigned?e:Ct(kt(e),!0),16)}},Le.prototype.__isLong__,Object.defineProperty(Le.prototype,"__isLong__",{value:!0});var je={},Ae={};function ze(e,t){var n,r,o;return t?(o=0<=(e>>>=0)&&e<256)&&(r=Ae[e])?r:(n=He(e,(0|e)<0?-1:0,!0),o&&(Ae[e]=n),n):(o=-128<=(e|=0)&&e<128)&&(r=je[e])?r:(n=He(e,e<0?-1:0,!1),o&&(je[e]=n),n)}function Ue(e,t){if(isNaN(e))return t?Ye:Ke;if(t){if(e<0)return Ye;if(e>=We)return tt}else{if(e<=-qe)return nt;if(e+1>=qe)return et}return e<0?ht(Ue(-e,t)):He(e%Ge|0,e/Ge|0,t)}function He(e,t,n){return new Le(e,t,n)}var Be=Math.pow;function Ve(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return Ke;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||36<n)throw RangeError("radix");var r=e.indexOf("-");if(r>0)throw Error("interior hyphen");if(0===r)return ht(Ve(e.substring(1),t,n));for(var o=Ue(Be(n,8)),i=Ke,l=0;l<e.length;l+=8){var a=Math.min(8,e.length-l),u=parseInt(e.substring(l,l+a),n);if(a<8)i=mt(vt(i,Ue(Be(n,a))),Ue(u));else i=mt(i=vt(i,o),Ue(u))}return i.unsigned=t,i}function $e(e,t){return"number"==typeof e?Ue(e,t):"string"==typeof e?Ve(e,t):He(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}var Ge=4294967296,We=Ge*Ge,qe=We/2,Qe=ze(1<<24),Ke=ze(0),Ye=ze(0,!0),Xe=ze(1),Je=ze(1,!0),Ze=ze(-1),et=He(-1,2147483647,!1),tt=He(-1,-1,!0),nt=He(0,-2147483648,!1);function rt(e){return e.unsigned?e.low>>>0:e.low}function ot(e){return e.unsigned?(e.high>>>0)*Ge+(e.low>>>0):e.high*Ge+(e.low>>>0)}function it(e,t){if((t=t||10)<2||36<t)throw RangeError("radix");if(lt(e))return"0";if(at(e)){if(st(e,nt)){var n=Ue(t),r=yt(e,n),o=gt(vt(r,n),e);return it(r,t)+rt(o).toString(t)}return"-"+it(ht(e),t)}for(var i=Ue(Be(t,6),e.unsigned),l=e,a="";;){var u=yt(l,i),s=(rt(gt(l,vt(u,i)))>>>0).toString(t);if(lt(l=u))return s+a;for(;s.length<6;)s="0"+s;a=""+s+a}}function lt(e){return 0===e.high&&0===e.low}function at(e){return!e.unsigned&&e.high<0}function ut(e){return 1==(1&e.low)}function st(e,t){return Re(t)||(t=$e(t)),(e.unsigned===t.unsigned||e.high>>>31!=1||t.high>>>31!=1)&&(e.high===t.high&&e.low===t.low)}function ct(e,t){return pt(e,t)<0}function ft(e,t){return pt(e,t)>0}function dt(e,t){return pt(e,t)>=0}function pt(e,t){if(Re(t)||(t=$e(t)),st(e,t))return 0;var n=at(e),r=at(t);return n&&!r?-1:!n&&r?1:e.unsigned?t.high>>>0>e.high>>>0||t.high===e.high&&t.low>>>0>e.low>>>0?-1:1:at(gt(e,t))?-1:1}function ht(e){return!e.unsigned&&st(e,nt)?nt:mt(bt(e),Xe)}function mt(e,t){Re(t)||(t=$e(t));var n=e.high>>>16,r=65535&e.high,o=e.low>>>16,i=65535&e.low,l=t.high>>>16,a=65535&t.high,u=t.low>>>16,s=0,c=0,f=0,d=0;return f+=(d+=i+(65535&t.low))>>>16,c+=(f+=o+u)>>>16,s+=(c+=r+a)>>>16,s+=n+l,He((f&=65535)<<16|(d&=65535),(s&=65535)<<16|(c&=65535),e.unsigned)}function gt(e,t){return Re(t)||(t=$e(t)),mt(e,ht(t))}function vt(e,t){if(lt(e))return e.unsigned?Ye:Ke;if(Re(t)||(t=$e(t)),Fe)return He(Fe.mul(e.low,e.high,t.low,t.high),Fe.get_high(),e.unsigned);if(lt(t))return e.unsigned?Ye:Ke;if(st(e,nt))return ut(t)?nt:Ke;if(st(t,nt))return ut(e)?nt:Ke;if(at(e))return at(t)?vt(ht(e),ht(t)):ht(vt(ht(e),t));if(at(t))return ht(vt(e,ht(t)));if(ct(e,Qe)&&ct(t,Qe))return Ue(ot(e)*ot(t),e.unsigned);var n=e.high>>>16,r=65535&e.high,o=e.low>>>16,i=65535&e.low,l=t.high>>>16,a=65535&t.high,u=t.low>>>16,s=65535&t.low,c=0,f=0,d=0,p=0;return d+=(p+=i*s)>>>16,f+=(d+=o*s)>>>16,d&=65535,f+=(d+=i*u)>>>16,c+=(f+=r*s)>>>16,f&=65535,c+=(f+=o*u)>>>16,f&=65535,c+=(f+=i*a)>>>16,c+=n*s+r*u+o*a+i*l,He((d&=65535)<<16|(p&=65535),(c&=65535)<<16|(f&=65535),e.unsigned)}function yt(e,t){if(Re(t)||(t=$e(t)),lt(t))throw Error("division by zero");var n,r,o;if(Fe)return e.unsigned||-2147483648!==e.high||-1!==t.low||-1!==t.high?He((e.unsigned?Fe.div_u:Fe.div_s)(e.low,e.high,t.low,t.high),Fe.get_high(),e.unsigned):e;if(lt(e))return e.unsigned?Ye:Ke;if(e.unsigned){if(t.unsigned||(t=function(e){return e.unsigned?e:He(e.low,e.high,!0)}(t)),ft(t,e))return Ye;if(ft(t,Et(e,1)))return Je;o=Ye}else{if(st(e,nt))return st(t,Xe)||st(t,Ze)?nt:st(t,nt)?Xe:st(n=wt(yt(St(e,1),t),1),Ke)?at(t)?Xe:Ze:o=mt(n,yt(r=gt(e,vt(t,n)),t));if(st(t,nt))return e.unsigned?Ye:Ke;if(at(e))return at(t)?yt(ht(e),ht(t)):ht(yt(ht(e),t));if(at(t))return ht(yt(e,ht(t)));o=Ke}for(r=e;dt(r,t);){n=Math.max(1,Math.floor(ot(r)/ot(t)));for(var i=Math.ceil(Math.log(n)/Math.LN2),l=i<=48?1:Be(2,i-48),a=Ue(n),u=vt(a,t);at(u)||ft(u,r);)u=vt(a=Ue(n-=l,e.unsigned),t);lt(a)&&(a=Xe),o=mt(o,a),r=gt(r,u)}return o}function bt(e){return He(~e.low,~e.high,e.unsigned)}function wt(e,t){return Re(t)&&(t=rt(t)),0==(t&=63)?e:t<32?He(e.low<<t,e.high<<t|e.low>>>32-t,e.unsigned):He(0,e.low<<t-32,e.unsigned)}function St(e,t){return Re(t)&&(t=rt(t)),0==(t&=63)?e:t<32?He(e.low>>>t|e.high<<32-t,e.high>>t,e.unsigned):He(e.high>>t-32,e.high>=0?0:-1,e.unsigned)}function Et(e,t){if(Re(t)&&(t=rt(t)),0===(t&=63))return e;var n=e.high;return t<32?He(e.low>>>t|n<<32-t,n>>>t,e.unsigned):He(32===t?n:n>>>t-32,0,e.unsigned)}function kt(e,t){return t?function(e){var t=e.high,n=e.low;return[255&n,n>>>8&255,n>>>16&255,n>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]}(e):function(e){var t=e.high,n=e.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,n>>>24,n>>>16&255,n>>>8&255,255&n]}(e)}function Ct(e,t,n){return n?function(e,t){return new Le(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)}(e,t):function(e,t){return new Le(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}(e,t)}const xt=mt,Ot=vt,Tt=yt,It=function(e,t){return Re(t)||(t=$e(t)),Fe?He((e.unsigned?Fe.rem_u:Fe.rem_s)(e.low,e.high,t.low,t.high),Fe.get_high(),e.unsigned):gt(e,vt(yt(e,t),t))},Nt=ht,_t=function(e,t){return Re(t)||(t=$e(t)),He(e.low&t.low,e.high&t.high,e.unsigned)},Pt=pt,Mt=He,Dt=rt,Ft=ot;function Lt(e,t,n){let r=e,o=0;switch(n){case 0:r=e<<24>>24,o=r;break;case 4:r=e<<24>>>24;break;case 1:r=e<<16>>16,o=r;break;case 5:r=e<<16>>>16;break;case 2:r=e>>0,o=r;break;case 6:r=e>>>0}return He(r,o>>31,t)}const Rt=/(?:Z|[+-](\d+):?([0-5]?\d)?)\s*$/;function jt(e){const t=e<0,n=(e=Math.abs(e))%36e5/6e4;return(t?"-":"+")+f(~~(e/36e5),2)+":"+f(n,2)}function At(e,t){const n=e.toISOString();return"first"===t?n.substring(0,n.indexOf("T")):n.substring(n.indexOf("T")+1,n.length-1)}function zt(e,t,n){return t.replace(/(\w)\1*/g,t=>{let r=Number.NaN;switch(t.substring(0,1)){case"y":const o=n?e.getUTCFullYear():e.getFullYear();r=t.length<4?o%100:o;break;case"M":r=(n?e.getUTCMonth():e.getMonth())+1;break;case"d":r=n?e.getUTCDate():e.getDate();break;case"H":r=n?e.getUTCHours():e.getHours();break;case"h":const i=n?e.getUTCHours():e.getHours();r=i>12?i%12:i;break;case"m":r=n?e.getUTCMinutes():e.getMinutes();break;case"s":r=n?e.getUTCSeconds():e.getSeconds();break;case"f":r=n?e.getUTCMilliseconds():e.getMilliseconds()}return Number.isNaN(r)?t:r<10&&t.length>1?"0"+r:""+r})}function Ut(e,t){var n,r,o;const i=new Date(e.getTime()+(null!==(n=e.offset)&&void 0!==n?n:0));if("string"!=typeof t)return i.toISOString().replace(/\.\d+/,"").replace(/[A-Z]|\.\d+/g," ")+jt(null!==(r=e.offset)&&void 0!==r?r:0);if(1!==t.length)return zt(i,t,!0);switch(t){case"D":case"d":return At(i,"first");case"T":case"t":return At(i,"second");case"O":case"o":return function(e,t){const n=e.toISOString();return n.substring(0,n.length-1)+jt(t)}(i,null!==(o=e.offset)&&void 0!==o?o:0);default:throw new Error("Unrecognized Date print format")}}function Ht(e,t){const n=1===e.kind;if("string"!=typeof t)return n?e.toUTCString():e.toLocaleString();if(1!==t.length)return zt(e,t,n);switch(t){case"D":case"d":return n?At(e,"first"):e.toLocaleDateString();case"T":case"t":return n?At(e,"second"):e.toLocaleTimeString();case"O":case"o":return function(e,t){if(t)return e.toISOString();{const t=null==e.kind||2===e.kind;return f(e.getFullYear(),4)+"-"+f(e.getMonth()+1,2)+"-"+f(e.getDate(),2)+"T"+f(e.getHours(),2)+":"+f(e.getMinutes(),2)+":"+f(e.getSeconds(),2)+"."+f(e.getMilliseconds(),3)+(t?jt(-6e4*e.getTimezoneOffset()):"")}}(e,n);default:throw new Error("Unrecognized Date print format")}}function Bt(e,t,n){return null!=e.offset?Ut(e,t):Ht(e,t)}function Vt(e,t){const n=new Date(e);return n.kind=0|(null==t?0:t),n}function $t(e){if(null===e)throw new Error("Value cannot be null when parsing DateTime");if(""===e.trim())throw new Error("An empty string is not recognized as a valid DateTime");let t=new Date(e);if(isNaN(t.getTime())){const n=/^\s*(\d+[^\w\s:]\d+[^\w\s:]\d+)?\s*(\d+:\d+(?::\d+(?:\.\d+)?)?)?\s*([AaPp][Mm])?\s*([+-]\d+(?::\d+)?)?\s*$/.exec(e);if(null==n)throw new Error("The string is not a valid Date.");{let e,r=0;if(null!=n[2]){const e=n[2].split(":");r=3600*parseInt(e[0],10)+60*parseInt(e[1]||"0",10)+parseFloat(e[2]||"0"),null!=n[3]&&"PM"===n[3].toUpperCase()&&(r+=720)}if(null!=n[4]){if(null!=n[1])e=new Date(n[1]+" UTC");else{const t=new Date;e=new Date(t.getUTCFullYear()+"/"+(t.getUTCMonth()+1)+"/"+t.getUTCDate())}const t=n[4].substr(1).split(":");let o=60*parseInt(t[0],10)+parseInt(t[1]||"0",10);"+"===n[4][0]&&(o*=-1),r+=60*o}else if(null!=n[1])e=new Date(n[1]);else{const t=new Date;e=new Date(t.getFullYear()+"/"+(t.getMonth()+1)+"/"+t.getDate())}t=new Date(e.getTime()+1e3*r),t=new Date(t.getTime()+6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))}}return t}function Gt(e,t){try{return t.contents=function(e,t=!1){const n=$t(e),r=Rt.exec(e),o=null!=r?t&&"Z"===r[0]?1:2:0;return Vt(n.getTime(),o)}(e),!0}catch(e){return!1}}function Wt(e,t=0){if(0!=(-276&t))throw new Error("RegexOptions only supports: IgnoreCase, Multiline, Singleline and ECMAScript");let n="g";return n+=1&t?"i":"",n+=2&t?"m":"",n+=16&t?"s":"",new RegExp(e,n)}function qt(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function Qt(e,t,n=0){let r;if(r=e instanceof RegExp?(r=e,e=t,r.lastIndex=n,r):r=Wt(t,n),!r.global)throw new Error("Non-global RegExp");let o=r.exec(e);const i=[];for(;null!==o;)i.push(o),o=r.exec(e);return i}const Kt=/(^|[^%])%([0+\- ]*)(\*|\d+)?(?:\.(\d+))?(\w)/g,Yt=/(?:(^|[^%])%([0+\- ]*)(\d+)?(?:\.(\d+))?(\w))?%P\(\)/g,Xt=/\{(\d+)(,-?\d+)?(?:\:([a-zA-Z])(\d{0,2})|\:(.+?))?\}/g;function Jt(e,t){return function(e,t){return"number"==typeof e?e<t?-1:e>t?1:0:e.CompareTo(t)}(e,t)<0}function Zt(e){return{input:e,cont:(t=e,e=>{Kt.lastIndex=0;const n=[],r=[];let o=0,i=Kt.exec(t);for(;i;){const e=i.index+(i[1]||"").length;n.push(t.substring(o,e).replace(/%%/g,"%")),r.push(i),o=Kt.lastIndex,Kt.lastIndex-=1,i=Kt.exec(t)}return 0===n.length?e(t.replace(/%%/g,"%")):(n.push(t.substring(o).replace(/%%/g,"%")),function e(t,n,r,o="",i=-1){return(...l)=>{let a=o;const u=n.slice(),s=r.slice();for(const e of l){const[,,t,n,r,o]=s[0];let l=n;if(i>=0)l=i,i=-1;else if("*"===l){if(e<0)throw new Error("Non-negative number required");i=e;continue}a+=u[0],a+=on(e,t,l,r,o),u.splice(0,1),s.splice(0,1)}return 0===s.length?(a+=u[0],t(a)):e(t,u,s,a,i)}}(e,n,r))})};var t}function en(e,t){let n=0,r=0,o="";Yt.lastIndex=0;let i=Yt.exec(e);for(;i;){const l=i.index+(i[1]||"").length;o+=e.substring(r,l).replace(/%%/g,"%");const[,,a,u,s,c]=i;o+=on(t[n++],a,u,s,c),r=Yt.lastIndex,Yt.lastIndex-=1,i=Yt.exec(e)}return o+=e.substring(r).replace(/%%/g,"%"),o}function tn(e,t){return"string"==typeof t?e(t):t.cont(e)}function nn(e){return tn(e=>e,e)}function rn(e){return tn(e=>{throw new Error(e)},e)}function on(e,t,n,r,o){let i="";if(t=t||"",o=o||"",Ie(e))switch("x"!==o.toLowerCase()&&(Jt(e,0)?(e=Ne(e,-1),i="-"):t.indexOf(" ")>=0?i=" ":t.indexOf("+")>=0&&(i="+")),r=null==r?null:parseInt(r,10),o){case"f":case"F":e=_e(e,r=null!=r?r:6);break;case"g":case"G":e=null!=r?Pe(e,r):Pe(e);break;case"e":case"E":e=null!=r?Me(e,r):Me(e);break;case"x":e=De(e);break;case"X":e=De(e).toUpperCase();break;default:e=String(e)}else e=e instanceof Date?Bt(e):D(e);if(n="number"==typeof n?n:parseInt(n,10),isNaN(n))e=i+e;else{const r=t.indexOf("0")>=0,o=t.indexOf("-")>=0,l=o||!r?" ":"0";e="0"===l?i+(e=cn(e,n-i.length,l,o)):cn(i+e,n,l,o)}return e}function ln(e,...t){return"object"==typeof e&&t.length>0&&(e=t[0],t.shift()),e.replace(Xt,(e,n,r,o,i,l)=>{let a=t[n];if(Ie(a))switch(i=null==i?null:parseInt(i,10),o){case"f":case"F":a=_e(a,i=null!=i?i:2);break;case"g":case"G":a=null!=i?Pe(a,i):Pe(a);break;case"e":case"E":a=null!=i?Me(a,i):Me(a);break;case"p":case"P":i=null!=i?i:2,a=_e(Ne(a,100),i)+" %";break;case"d":case"D":a=null!=i?cn(String(a),i,"0"):String(a);break;case"x":case"X":a=null!=i?cn(De(a),i,"0"):De(a),"X"===o&&(a=a.toUpperCase());break;default:if(l){let e="";a=l.replace(/(0+)(\.0+)?/,(t,n,r)=>(Jt(a,0)&&(a=Ne(a,-1),e="-"),a=_e(a,null!=r?r.length-1:0),cn(a,(n||"").length-e.length+(null!=r?r.length:0),"0"))),a=e+a}}else a=a instanceof Date?Bt(a,l||o):D(a);return r=parseInt((r||" ").substring(1),10),isNaN(r)||(a=cn(String(a),Math.abs(r)," ",r<0)),a})}function an(e){return"string"!=typeof e||0===e.length}function un(e){return"string"!=typeof e||/^\s*$/.test(e)}function sn(e,t){return Array.isArray(t)?t.join(e):Array.from(t).join(e)}function cn(e,t,n,r){n=n||" ",t-=e.length;for(let o=0;o<t;o++)e=r?e+n:n+e;return e}function fn(e,t,n,r){if(r="number"==typeof r?r:void 0,(n="number"==typeof n?n:void 0)&&n<0)throw new Error("Count cannot be less than zero");if(0===n)return[];if(!Array.isArray(t)){if(0===r)return e.split(t,n);const o=arguments.length;t=Array(o-1);for(let e=1;e<o;e++)t[e-1]=arguments[e]}t=(t=t.map(e=>qt(e))).length>0?t:[" "];let o=0;const i=[],l=new RegExp(t.join("|"),"g");for(;null==n||n>1;){const t=l.exec(e);if(null===t)break;(!r||t.index-o>0)&&(n=null!=n?n-1:n,i.push(e.substring(o,t.index))),o=l.lastIndex}return(!r||e.length-o>0)&&i.push(e.substring(o)),i}function dn(e,t,n){if(t+(n||0)>e.length)throw new Error("Invalid startIndex and/or length");return null!=n?e.substr(t,n):e.substr(t)}class pn{constructor(e){this.value=e}toJSON(){return this.value}toString(){return String(this.value)}GetHashCode(){return y(this.value)}Equals(e){return null!=e&&E(this.value,e instanceof pn?e.value:e)}CompareTo(e){return null==e?1:O(this.value,e instanceof pn?e.value:e)}}function hn(e){return null==e||e instanceof pn?new pn(e):e}function mn(e){if(null==e)throw new Error("Option has no value");return e instanceof pn?e.value:e}function gn(e){return null==e?[]:[mn(e)]}function vn(e,t){return null!=e?mn(e):t}function yn(e,t){return null!=t?hn(e(mn(t))):void 0}function bn(e,t){return"function"==typeof e?new e(t):new Array(t)}function wn(){throw new Error("Arrays had different lengths")}function Sn(e,t,n){const r=0|e.length,o=0|t.length,i=bn(n,r+o);for(let t=0;t<=r-1;t++)i[t]=e[t];for(let e=0;e<=o-1;e++)i[e+r]=t[e];return i}function En(e,t,n,r){const o=0|t;return e.fill(r,o,o+n)}function kn(e,t,n){const r=0|t.length,o=bn(n,r);for(let n=0;n<=r-1;n++)o[n]=e(t[n]);return o}function Cn(e,t,n){if(e<0)throw new Error("The input must be non-negative\\nParameter name: count");const r=bn(n,e);for(let n=0;n<=e-1;n++)r[n]=t(n);return r}function xn(e,t,n){return n.reduce((t,n)=>e(t,n),t)}function On(e,t,n){return 0===function(e,t,n){if(null==t)return null==n?0:-1;if(null==n)return 1;{let r=0,o=0;const i=0|t.length,l=0|n.length;if(i>l)return 1;if(i<l)return-1;for(;r<i&&0===o;)o=0|e(t[r],n[r]),r=r+1|0;return 0|o}}((e,t)=>O(e,t),t,n)}function Tn(e,t,n){return t.reduceRight((t,n)=>e(n,t),n)}function In(e,t,n,r){return function(e,t,n,r){let o=r;t.length!==n.length&&wn();const i=0|t.length;for(let r=1;r<=i;r++)o=e(r-1,t[i-r],n[i-r],o);return o}((t,n,r,o)=>e(n,r,o),t,n,r)}class Nn extends U{constructor(e,t){super(),this.head=e,this.tail=t}toString(){return"["+sn("; ",this)+"]"}Equals(e){const t=this;if(t===e)return!0;return((e,t)=>{e:for(;;){const n=e,r=t,o=[n.tail,r.tail];if(null!=o[0]){if(null!=o[1]){const i=o[0],l=o[1];if(E(n.head,r.head)){e=i,t=l;continue e}return!1}return!1}return null==o[1]}})(t,e)}GetHashCode(){return 0|((e,t,n)=>{for(;;){const r=e,o=t,i=n,l=i.tail;if(null==l)return 0|o;{const a=l;if(r>18)return 0|o;e=r+1,t=(o<<1)+y(i.head)+631*r,n=a}}})(0,0,this)}toJSON(e){return Array.from(this)}CompareTo(e){return 0|((e,t)=>{e:for(;;){const n=e,r=t,o=[n.tail,r.tail];if(null!=o[0]){if(null!=o[1]){const i=o[0],l=o[1],a=0|O(n.head,r.head);if(0===a){e=i,t=l;continue e}return 0|a}return 1}return null!=o[1]?-1:0}})(this,e)}GetEnumerator(){return function(e){return new _n(e)}(this)}[Symbol.iterator](){return s(this.GetEnumerator())}"System.Collections.IEnumerable.GetEnumerator"(){return u(this)}}class _n{constructor(e){this.xs=e,this.it=this.xs,this.current=null}"System.Collections.Generic.IEnumerator`1.get_Current"(){return this.current}"System.Collections.IEnumerator.get_Current"(){return this.current}"System.Collections.IEnumerator.MoveNext"(){const e=this,t=e.it.tail;if(null!=t){const n=t;return e.current=e.it.head,e.it=n,!0}return!1}"System.Collections.IEnumerator.Reset"(){this.it=this.xs,this.current=null}Dispose(){}}function Pn(){return new Nn(null,void 0)}function Mn(e,t){return new Nn(e,t)}function Dn(e){return null==e.tail}function Fn(e){return 0|((e,t)=>{for(;;){const n=e,r=t.tail;if(null==r)return 0|n;e=n+1,t=r}})(0,e)}function Ln(e){if(null!=e.tail)return e.head;throw new Error("List was empty\\nParameter name: list")}function Rn(e){const t=e.tail;if(null!=t)return t;throw new Error("List was empty\\nParameter name: list")}function jn(){return Pn()}function An(e,t){return Mn(e,t)}function zn(e){return Mn(e,Pn())}function Un(e){return Dn(e)}function Hn(e){return Ln(e)}function Bn(e){return Rn(e)}function Vn(e){const t=0|Fn(e),n=En(new Array(t),0,t,null);return((e,t)=>{for(;;){const r=e,o=t;if(Dn(o))break;n[r]=Ln(o),e=r+1,t=Rn(o)}})(0,e),n}function $n(e,t,n){let r=t,o=n;for(;!Dn(o);)r=e(r,Ln(o)),o=Rn(o);return r}function Gn(e){return $n((e,t)=>Mn(t,e),Pn(),e)}function Wn(e,t){$n((t,n)=>{e(n)},void 0,t)}function qn(e,t){let n=t;for(let t=e.length-1;t>=0;t--)n=Mn(e[t],n);return n}function Qn(e){return qn(e,Pn())}function Kn(e){let t,n;if(r(e))return Qn(e);if(e instanceof Nn)return e;{const r=Pn();let o=r;const i=u(e);try{for(;i["System.Collections.IEnumerator.MoveNext"]();){const e=i["System.Collections.Generic.IEnumerator`1.get_Current"]();t=o,n=new Nn(e,void 0),t.tail=n,o=n}}finally{i.Dispose()}const l=o,a=Pn();return l.tail=a,Rn(r)}}function Yn(e,t){return $n((e,t)=>Mn(t,e),t,Gn(e))}function Xn(e,t){const n=Pn(),r=function(e,t,n){return((t,n,r)=>{for(;;){const o=t,i=n,l=r;if(Dn(l))return i;t=o+1,n=e(o,i,Ln(l)),r=Rn(l)}})(0,t,n)}((t,n,r)=>{const o=new Nn(e(t,r),void 0);return n.tail=o,o},n,t),o=Pn();return r.tail=o,Rn(n)}function Jn(e,t){const n=Pn(),r=$n((t,n)=>{const r=new Nn(e(n),void 0);return t.tail=r,r},n,t),o=Pn();return r.tail=o,Rn(n)}function Zn(e,t){return((t,n)=>{for(;;){const r=t,o=n;if(Dn(o))return;if(e(Ln(o)))return r;t=r+1,n=Rn(o)}})(0,t)}function er(e,t,n){return null!=Zn(t=>n.Equals(e,t),t)}class tr{constructor(e=!1){this._id=0,this._cancelled=e,this._listeners=new Map}get isCancelled(){return this._cancelled}cancel(){if(!this._cancelled){this._cancelled=!0;for(const[,e]of this._listeners)e()}}addListener(e){const t=this._id;return this._listeners.set(this._id++,e),t}removeListener(e){return this._listeners.delete(e)}register(e,t){const n=this,r=this.addListener(null==t?e:()=>e(t));return{Dispose(){n.removeListener(r)}}}}class nr extends Error{constructor(){super("The operation was canceled"),Object.setPrototypeOf(this,nr.prototype)}}class rr{constructor(){this.callCount=0}static get maxTrampolineCallCount(){return 2e3}incrementAndCheck(){return this.callCount++>rr.maxTrampolineCallCount}hijack(e){this.callCount=0,setTimeout(e,0)}}function or(e){return t=>{if(t.cancelToken.isCancelled)t.onCancel(new nr);else if(t.trampoline.incrementAndCheck())t.trampoline.hijack(()=>{try{e(t)}catch(e){t.onError(e)}});else try{e(t)}catch(e){t.onError(e)}}}function ir(e,t){return or(n=>{e({onSuccess:e=>{try{t(e)(n)}catch(e){n.onError(e)}},onError:n.onError,onCancel:n.onCancel,cancelToken:n.cancelToken,trampoline:n.trampoline})})}function lr(e){return or(t=>t.onSuccess(e))}const ar=new class{Bind(e,t){return ir(e,t)}Combine(e,t){return this.Bind(e,()=>t)}Delay(e){return or(t=>e()(t))}For(e,t){const n=e[Symbol.iterator]();let r=n.next();return this.While(()=>!r.done,this.Delay(()=>{const e=t(r.value);return r=n.next(),e}))}Return(e){return lr(e)}ReturnFrom(e){return e}TryFinally(e,t){return or(n=>{e({onSuccess:e=>{t(),n.onSuccess(e)},onError:e=>{t(),n.onError(e)},onCancel:e=>{t(),n.onCancel(e)},cancelToken:n.cancelToken,trampoline:n.trampoline})})}TryWith(e,t){return or(n=>{e({onSuccess:n.onSuccess,onCancel:n.onCancel,cancelToken:n.cancelToken,trampoline:n.trampoline,onError:e=>{try{t(e)(n)}catch(e){n.onError(e)}}})})}Using(e,t){return this.TryFinally(t(e),()=>e.Dispose())}While(e,t){return e()?this.Bind(t,()=>this.While(e,t)):this.Return(void 0)}Zero(){return or(e=>e.onSuccess(void 0))}};class ur extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Ok","Error"]}}function sr(e,t){return 0===t.tag?new ur(0,e(t.fields[0])):new ur(1,t.fields[0])}class cr extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Choice1Of2","Choice2Of2"]}}function fr(e){}const dr=new tr;function pr(e){return or(t=>{e({onSuccess:e=>t.onSuccess(function(e){return new cr(0,e)}(e)),onError:e=>t.onSuccess(new cr(1,e)),onCancel:t.onCancel,cancelToken:t.cancelToken,trampoline:t.trampoline})})}function hr(e){return or(t=>e([t.onSuccess,t.onError,t.onCancel]))}function mr(e,t){return function(e,t){return gr(e,t)}(e,t)}function gr(e,t,n,r,o){"function"!=typeof t&&(o=t,t=void 0);const i=new rr;e({onSuccess:t||fr,onError:n||fr,onCancel:r||fr,cancelToken:o||dr,trampoline:i})}class vr{constructor(e,t,n){this.OnNext=e,this.OnError=t||(e=>{}),this.OnCompleted=n||(()=>{})}}class yr{constructor(e,t){this._subscriber=e,this.delegates=t||new Array}Add(e){this._addHandler(e)}get Publish(){return this}Trigger(e){this.delegates.forEach(t=>t(e))}AddHandler(e){null==this._dotnetDelegates&&(this._dotnetDelegates=new Map);const t=t=>e(null,t);this._dotnetDelegates.set(e,t),this._addHandler(t)}RemoveHandler(e){if(null!=this._dotnetDelegates){const t=this._dotnetDelegates.get(e);null!=t&&(this._dotnetDelegates.delete(e),this._removeHandler(t))}}Subscribe(e){return"function"==typeof e?this._subscribeFromCallback(e):this._subscribeFromObserver(e)}_addHandler(e){this.delegates.push(e)}_removeHandler(e){const t=this.delegates.indexOf(e);t>-1&&this.delegates.splice(t,1)}_subscribeFromObserver(e){if(this._subscriber)return this._subscriber(e);const t=e.OnNext;return this._addHandler(t),{Dispose:()=>{this._removeHandler(t)}}}_subscribeFromCallback(e){return this._addHandler(e),{Dispose:()=>{this._removeHandler(e)}}}}var br=yr;var wr=class{constructor(e){this._enabled=!1,this._isDisposed=!1,this._intervalId=0,this._timeoutId=0,this.Interval=e&&e>0?e:100,this.AutoReset=!0,this._elapsed=new br}get Elapsed(){return this._elapsed}get Enabled(){return this._enabled}set Enabled(e){this._isDisposed||this._enabled===e||(this._enabled=e,this._enabled?this.AutoReset?this._intervalId=setInterval(()=>{this.AutoReset||(this.Enabled=!1),this._elapsed.Trigger(new Date)},this.Interval):this._timeoutId=setTimeout(()=>{this.Enabled=!1,this._timeoutId=0,this.AutoReset&&(this.Enabled=!0),this._elapsed.Trigger(new Date)},this.Interval):(this._timeoutId&&(clearTimeout(this._timeoutId),this._timeoutId=0),this._intervalId&&(clearInterval(this._intervalId),this._intervalId=0)))}Dispose(){this.Enabled=!1,this._isDisposed=!0}Close(){this.Dispose()}Start(){this.Enabled=!0}Stop(){this.Enabled=!1}};function Sr(e,t){console.error(hn(e),t)}function Er(e,t){let n,r=new wr(e);r.AutoReset=!1,n=r,function(e,t){t.Subscribe(new vr(e))}(t,n.Elapsed),n.Enabled=!0,n.Start()}function kr(e,t,n){Wn(n=>{try{n(t)}catch(t){e(t)}},n)}function Cr(){return jn()}function xr(e){return function(e){const t=Pn();let n=t;const o=e=>{n=$n((e,t)=>{const n=new Nn(t,void 0);return e.tail=n,n},n,e)};if(r(e))e.forEach(o);else if(e instanceof Nn)Wn(o,e);else{const t=u(e);try{for(;t["System.Collections.IEnumerator.MoveNext"]();)o(t["System.Collections.Generic.IEnumerator`1.get_Current"]())}finally{t.Dispose()}}const i=n,l=Pn();return i.tail=l,Rn(t)}(e)}function Or(e){return zn(e)}function Tr(e,t,n,r,o){return zn(i=>{e(ar.Delay(()=>ar.Bind(pr(t(n)),e=>{const t=e;return i(1===t.tag?o(t.fields[0]):r(t.fields[0])),ar.Zero()})))})}function Ir(e){Er(0,t=>{mr(e)})}var Nr=n(0),_r=n.n(Nr);function Pr(){return e=(e,t)=>O(e,t),{Compare:(t,n)=>e(t,n)};var e}function Mr(){return Pr()}const Dr="The input sequence has an insufficient number of elements.";function Fr(){throw new Error("Enumeration has not started. Call MoveNext.")}function Lr(){throw new Error("Enumeration already finished.")}class Rr{constructor(e){this.f=e}toString(){let e=0,t="seq [";const n=u(this);try{for(;e<4&&n["System.Collections.IEnumerator.MoveNext"]();)e>0&&(t+="; "),t+=D(n["System.Collections.Generic.IEnumerator`1.get_Current"]()),e=e+1|0;return 4===e&&(t+="; ..."),t+"]"}finally{n.Dispose()}}GetEnumerator(){return this.f()}[Symbol.iterator](){return s(this.GetEnumerator())}"System.Collections.IEnumerable.GetEnumerator"(){return this.f()}}class jr{constructor(e,t,n){this.current=e,this.next=t,this.dispose=n}"System.Collections.Generic.IEnumerator`1.get_Current"(){return this.current()}"System.Collections.IEnumerator.get_Current"(){return this.current()}"System.Collections.IEnumerator.MoveNext"(){return this.next()}"System.Collections.IEnumerator.Reset"(){!function(){throw new Error("Reset is not supported on this enumerator.")}()}Dispose(){this.dispose()}}function Ar(e,t,n){return new jr(e,t,n)}function zr(e,t){return Ar(()=>t["System.Collections.Generic.IEnumerator`1.get_Current"](),()=>t["System.Collections.IEnumerator.MoveNext"](),()=>{try{t.Dispose()}finally{e()}})}function Ur(e,t,n){let r=!1,o=void 0,i=hn(e());const l=()=>{if(null!=i){const e=mn(i);try{n(e)}finally{i=void 0}}},a=()=>{try{l()}finally{o=void 0}};return Ar(()=>(r||Fr(),null!=o?mn(o):Lr()),()=>{if(r||(r=!0),null!=i){const e=mn(i);let n;try{n=t(e)}catch(e){throw a(),e}return null!=n?(o=n,!0):(a(),!1)}return!1},l)}function Hr(e,t){null==t&&function(e){throw new Error(e)}(e)}function Br(e){return function(e){return new Rr(e)}(e)}function Vr(e){return Hr("source",e),u(e)}function $r(e){return Br(()=>u(e()))}function Gr(e){return Br(()=>function(e){let t=void 0,n=void 0,r=!1,o=!1,i=void 0;const l=()=>{if(o=!0,null!=n){const e=n;try{e.Dispose()}finally{n=void 0}}if(null!=t){const e=t;try{e.Dispose()}finally{t=void 0}}};return Ar(()=>(r?o&&Lr():Fr(),null!=i?mn(i):Lr()),()=>{let a;if(r||(r=!0),o)return!1;{let r=void 0;for(;null==r;){const o=[t,n];if(null!=o[0])if(null!=o[1]){const e=o[1];if(e["System.Collections.IEnumerator.MoveNext"]())i=hn(e["System.Collections.Generic.IEnumerator`1.get_Current"]()),r=!0;else try{e.Dispose()}finally{n=void 0}}else{const e=o[0];if(e["System.Collections.IEnumerator.MoveNext"]()){a=e["System.Collections.Generic.IEnumerator`1.get_Current"](),n=u(a)}else l(),r=!1}else t=u(e)}return mn(r)}},()=>{o||l()})}(e))}function Wr(e,t){return Br(()=>function(e,t){let n=void 0,r=t;return Ar(()=>{if(null!=n){n[1];return n[0]}return Fr()},()=>{if(n=e(r),null!=n){n[0];const e=n[1];return r=e,!0}return!1},()=>{})}(e,t))}function qr(){return $r(()=>new Array(0))}function Qr(e){return $r(()=>function(e,t){const n=bn(t,1);return n[0]=e,n}(e))}function Kr(e){return r(e)?Qn(e):e instanceof Nn?e:Kn(e)}function Yr(e,t,n){return Br(()=>Ur(e,t,n))}function Xr(e,t,n){return Br(()=>{let r=-1;return Ur(e,e=>(r=r+1|0,t(r,e)),n)})}function Jr(e,t){return Gr([e,t])}function Zr(e,t,n){const r=Vr(t);try{let t=!1;for(;!t&&r["System.Collections.IEnumerator.MoveNext"]();)t=n.Equals(e,r["System.Collections.Generic.IEnumerator`1.get_Current"]());return t}finally{r.Dispose()}}function eo(e,t,n){const r=Vr(n);try{let n=t;for(;r["System.Collections.IEnumerator.MoveNext"]();)n=e(n,r["System.Collections.Generic.IEnumerator`1.get_Current"]());return n}finally{r.Dispose()}}function to(e,t){eo((t,n)=>{e(n)},void 0,t)}function no(e,t){return Yr(()=>Vr(t),t=>t["System.Collections.IEnumerator.MoveNext"]()?hn(e(t["System.Collections.Generic.IEnumerator`1.get_Current"]())):void 0,e=>{e.Dispose()})}function ro(e,t){return Xr(()=>Vr(t),(t,n)=>n["System.Collections.IEnumerator.MoveNext"]()?hn(e(t,n["System.Collections.Generic.IEnumerator`1.get_Current"]())):void 0,e=>{e.Dispose()})}function oo(e,t){return Br(()=>{const n=Vr(t);try{for(let t=1;t<=e;t++)if(!n["System.Collections.IEnumerator.MoveNext"]())throw new Error(Dr+"\\nParameter name: source");return zr(()=>{},n)}catch(e){throw n.Dispose(),e}})}function io(e,t){return $r(()=>Gr(no(e,t)))}const lo=_r.a,ao=e=>{Object(Nr.useEffect)(()=>{const t=e();return()=>{t.Dispose()}})},uo=(e,t)=>{Object(Nr.useEffect)(()=>{const t=e();return()=>{t.Dispose()}},t)},so=e=>{Object(Nr.useLayoutEffect)(()=>{const t=e();return()=>{t.Dispose()}})};function co(e,t,n,r){const o=lo.memo(e,N(2,vn(_(2,n),null)));return to(t=>{e.displayName=t},gn(t)),e=>lo.createElement(o,fo(r,e))}function fo(e,t){if(null==e)return t;{const n=e;return t.key=n(t),t}}function po(e){return{Dispose(){e()}}}function ho(e){return lo.useState(e)}function mo(e){ao(e)}function go(e,t){uo(e,t)}function vo(e,t){return lo.useCallback(e,vn(t,[]))}function yo(e){return lo.useRef(e)}function bo(e,t){return lo.useMemo(e,vn(t,[]))}function wo(e){const t=yo(e),n=vo(e=>t.current(e),[]);var r;return r=()=>{t.current=e},so(e=>(r(),po(()=>{}))),n}Nr.useState;function So(e){return lo.useState(e)}Nr.useState;const Eo=(()=>{try{"undefined"!=typeof window&&"function"==typeof window.addEventListener&&(window.addEventListener("testPassiveEventSupport",e=>{},{passive:!0}),window.removeEventListener("testPassiveEventSupport",e=>{}))}catch(e){}return!1})();function ko(e){return yn(e=>e.passive&&!Eo?{capture:e.capture,once:e.once,passive:!1}:e,e)}function Co(e){return t=e=>e.capture?{capture:!0}:void 0,null!=(n=e)?t(mn(n)):void 0;var t,n}const xo=/^[\(\{]{0,2}[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[\)\}]{0,2}$/,Oo=/^([0-9a-f]{8})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{12})$/,To=/^\{0x[0-9a-f]{8},(0x[0-9a-f]{4},){2}\{(0x[0-9a-f]{2},){7}0x[0-9a-f]{2}\}\}$/;function Io(e){function t(e){return e.replace(Oo,"$1-$2-$3-$4-$5")}const n=e.trim().toLowerCase();if(xo.test(n))return function(e,...t){if(0===t.length)return e.trim();const n="["+qt(t.join(""))+"]+";return e.replace(new RegExp("^"+n),"").replace(new RegExp(n+"$"),"")}(n,"{","}","(",")");if(Oo.test(n))return t(n);if(To.test(n))return t(n.replace(/[\{\},]|0x/g,""));throw new Error("Guid should contain 32 digits with 4 dashes: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")}function No(e,t){try{return t.contents=Io(e),!0}catch(e){return!1}}var _o={GetHashCode(){return v([this.s,this.e].concat(this.c))},Equals(e){return!this.cmp(e)},CompareTo(e){return this.cmp(e)},[Te](){const e=this;return{multiply:t=>e.mul(t),toPrecision:t=>e.toPrecision(t),toExponential:t=>e.toExponential(t),toFixed:t=>e.toFixed(t),toHex:()=>(Number(e)>>>0).toString(16)}}},Po="[big.js] ",Mo=Po+"Invalid ",Do=Mo+"decimal places",Fo=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function Lo(e,t){var n,r,o;if(!Fo.test(t))throw Error(Mo+"number");for(e.s="-"==t.charAt(0)?(t=t.slice(1),-1):1,(n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),o=t.length,r=0;r<n&&r<o&&"0"==t.charAt(r);)++r;if(r==o)e.c=[e.e=0];else for(e.e=n-r-1,e.c=[],n=0;r<o;)e.c[n++]=+t.charAt(r++);return e=Ro(e,Ao.DP+1,Ao.RM)}function Ro(e,t,n,r){var o=e.c;if(void 0===n&&(n=Ao.RM),0!==n&&1!==n&&2!==n&&3!==n)throw Error("[big.js] Invalid rounding mode");if(t<1)r=3===n&&(r||!!o[0])||0===t&&(1===n&&o[0]>=5||2===n&&(o[0]>5||5===o[0]&&(r||void 0!==o[1]))),o.length=1,r?(e.e=e.e-t+1,o[0]=1):o[0]=e.e=0;else if(t<o.length){const i=o.findIndex((e,n)=>n>=t&&e>0)<0;if(r=1===n&&o[t]>=5||2===n&&(o[t]>5||5===o[t]&&(r||void 0!==o[t+1]||1&o[t-1]))||3===n&&(r||!i),o.length=t--,r)for(;++o[t]>9;)o[t]=0,t--||(++e.e,o.unshift(1));for(t=o.length;!o[--t];)o.pop()}return e}function jo(e,t,n){var r=e.e,o=e.c.join(""),i=o.length;if(t)o=o.charAt(0)+(i>1?"."+o.slice(1):"")+(r<0?"e":"e+")+r;else if(r<0){for(;++r;)o="0"+o;o="0."+o}else if(r>0)if(++r>i)for(r-=i;r--;)o+="0";else r<i&&(o=o.slice(0,r)+"."+o.slice(r));else i>1&&(o=o.charAt(0)+"."+o.slice(1));return e.s<0&&n?"-"+o:o}_o.abs=function(){var e=new this.constructor(this);return e.s=1,e},_o.cmp=function(e){var t,n=this.constructor,r=new n(this),o=(e=new n(e),r.c),i=e.c,l=r.s,a=e.s,u=r.e,s=e.e;if(!o[0]||!i[0])return o[0]?l:i[0]?-a:0;if(l!=a)return l;if(t=l<0,u!=s)return u>s^t?1:-1;for(a=Math.max(o.length,i.length),l=0;l<a;l++)if((u=l<o.length?o[l]:0)!=(s=l<i.length?i[l]:0))return u>s^t?1:-1;return 0},_o.div=function(e){var t=this.constructor,n=new t(this),r=(e=new t(e),n.c),o=e.c,i=n.s==e.s?1:-1,l=t.DP;if(l!==~~l||l<0||l>1e6)throw Error(Do);if(!o[0])throw Error("[big.js] Division by zero");if(!r[0])return e.s=i,e.c=[e.e=0],e;var a,u,s,c,f,d=o.slice(),p=a=o.length,h=r.length,m=r.slice(0,a),g=m.length,v=e,y=v.c=[],b=0,w=l+(v.e=n.e-e.e)+1;for(v.s=i,i=w<0?0:w,d.unshift(0);g++<a;)m.push(0);do{for(s=0;s<10;s++){if(a!=(g=m.length))c=a>g?1:-1;else for(f=-1,c=0;++f<a;)if(o[f]!=m[f]){c=o[f]>m[f]?1:-1;break}if(!(c<0))break;for(u=g==a?o:d;g;){if(m[--g]<u[g]){for(f=g;f&&!m[--f];)m[f]=9;--m[f],m[g]+=10}m[g]-=u[g]}for(;!m[0];)m.shift()}y[b++]=c?s:++s,m[0]&&c?m[g]=r[p]||0:m=[r[p]]}while((p++<h||void 0!==m[0])&&i--);return y[0]||1==b||(y.shift(),v.e--,w--),b>w&&Ro(v,w,t.RM,void 0!==m[0]),v},_o.eq=function(e){return 0===this.cmp(e)},_o.gt=function(e){return this.cmp(e)>0},_o.gte=function(e){return this.cmp(e)>-1},_o.lt=function(e){return this.cmp(e)<0},_o.lte=function(e){return this.cmp(e)<1},_o.minus=_o.sub=function(e){var t,n,r,o,i=this.constructor,l=new i(this),a=(e=new i(e),l.s),u=e.s;if(a!=u)return e.s=-u,l.plus(e);var s=l.c.slice(),c=l.e,f=e.c,d=e.e;if(!s[0]||!f[0])return f[0]?e.s=-u:s[0]?e=new i(l):e.s=1,e;if(a=c-d){for((o=a<0)?(a=-a,r=s):(d=c,r=f),r.reverse(),u=a;u--;)r.push(0);r.reverse()}else for(n=((o=s.length<f.length)?s:f).length,a=u=0;u<n;u++)if(s[u]!=f[u]){o=s[u]<f[u];break}if(o&&(r=s,s=f,f=r,e.s=-e.s),(u=(n=f.length)-(t=s.length))>0)for(;u--;)s[t++]=0;for(u=t;n>a;){if(s[--n]<f[n]){for(t=n;t&&!s[--t];)s[t]=9;--s[t],s[n]+=10}s[n]-=f[n]}for(;0===s[--u];)s.pop();for(;0===s[0];)s.shift(),--d;return s[0]||(e.s=1,s=[d=0]),e.c=s,e.e=d,e},_o.mod=function(e){var t,n=this.constructor,r=new n(this),o=(e=new n(e),r.s),i=e.s;if(!e.c[0])throw Error("[big.js] Division by zero");return r.s=e.s=1,t=1==e.cmp(r),r.s=o,e.s=i,t?new n(r):(o=n.DP,i=n.RM,n.DP=n.RM=0,r=r.div(e),n.DP=o,n.RM=i,this.minus(r.times(e)))},_o.plus=_o.add=function(e){var t,n,r,o=this.constructor,i=new o(this);e=new o(e);if(i.s!=e.s)return e.s=-e.s,i.minus(e);var l=i.e,a=i.c,u=e.e,s=e.c;if(!a[0]||!s[0])return s[0]||(a[0]?e=new o(i):e.s=i.s),e;if(a=a.slice(),t=l-u){for(t>0?(u=l,r=s):(t=-t,r=a),r.reverse();t--;)r.push(0);r.reverse()}for(a.length-s.length<0&&(r=s,s=a,a=r),t=s.length,n=0;t;a[t]%=10)n=(a[--t]=a[t]+s[t]+n)/10|0;for(n&&(a.unshift(n),++u),t=a.length;0===a[--t];)a.pop();return e.c=a,e.e=u,e},_o.pow=function(e){var t=this.constructor,n=new t(this),r=new t("1"),o=new t("1"),i=e<0;if(e!==~~e||e<-1e6||e>1e6)throw Error(Mo+"exponent");for(i&&(e=-e);1&e&&(r=r.times(n)),e>>=1;)n=n.times(n);return i?o.div(r):r},_o.prec=function(e,t){if(e!==~~e||e<1||e>1e6)throw Error(Mo+"precision");return Ro(new this.constructor(this),e,t)},_o.round=function(e,t){if(void 0===e)e=0;else if(e!==~~e||e<-1e6||e>1e6)throw Error(Do);return Ro(new this.constructor(this),e+this.e+1,t)},_o.sqrt=function(){var e,t,n,r=this.constructor,o=new r(this),i=o.s,l=o.e,a=new r("0.5");if(!o.c[0])return new r(o);if(i<0)throw Error(Po+"No square root");0===(i=Math.sqrt(o+""))||i===1/0?((t=o.c.join("")).length+l&1||(t+="0"),l=((l+1)/2|0)-(l<0||1&l),e=new r(((i=Math.sqrt(t))==1/0?"5e":(i=i.toExponential()).slice(0,i.indexOf("e")+1))+l)):e=new r(i+""),l=e.e+(r.DP+=4);do{n=e,e=a.times(n.plus(o.div(n)))}while(n.c.slice(0,l).join("")!==e.c.slice(0,l).join(""));return Ro(e,(r.DP-=4)+e.e+1,r.RM)},_o.times=_o.mul=function(e){var t,n=this.constructor,r=new n(this),o=(e=new n(e),r.c),i=e.c,l=o.length,a=i.length,u=r.e,s=e.e;if(e.s=r.s==e.s?1:-1,!o[0]||!i[0])return e.c=[e.e=0],e;for(e.e=u+s,l<a&&(t=o,o=i,i=t,s=l,l=a,a=s),t=new Array(s=l+a);s--;)t[s]=0;for(u=a;u--;){for(a=0,s=l+u;s>u;)a=t[s]+i[u]*o[s-u-1]+a,t[s--]=a%10,a=a/10|0;t[s]=a}for(a?++e.e:t.shift(),u=t.length;!t[--u];)t.pop();return e.c=t,e},_o.toExponential=function(e,t){var n=this,r=n.c[0];if(void 0!==e){if(e!==~~e||e<0||e>1e6)throw Error(Do);for(n=Ro(new n.constructor(n),++e,t);n.c.length<e;)n.c.push(0)}return jo(n,!0,!!r)},_o.toFixed=function(e,t){var n=this,r=n.c[0];if(void 0!==e){if(e!==~~e||e<0||e>1e6)throw Error(Do);for(e=e+(n=Ro(new n.constructor(n),e+n.e+1,t)).e+1;n.c.length<e;)n.c.push(0)}return jo(n,!1,!!r)},_o.toJSON=_o.toString=function(){var e=this,t=e.constructor;return jo(e,e.e<=t.NE||e.e>=t.PE,!!e.c[0])},_o.toNumber=function(){var e=Number(jo(this,!0,!0));if(!0===this.constructor.strict&&!this.eq(e.toString()))throw Error(Po+"Imprecise conversion");return e},_o.toPrecision=function(e,t){var n=this,r=n.constructor,o=n.c[0];if(void 0!==e){if(e!==~~e||e<1||e>1e6)throw Error(Mo+"precision");for(n=Ro(new r(n),e,t);n.c.length<e;)n.c.push(0)}return jo(n,e<=n.e||n.e<=r.NE||n.e>=r.PE,!!o)},_o.valueOf=function(){var e=this,t=e.constructor;if(!0===t.strict)throw Error(Po+"valueOf disallowed");return jo(e,e.e<=t.NE||e.e>=t.PE,!0)};var Ao=function e(){function t(n){var r=this;if(!(r instanceof t))return void 0===n?e():new t(n);if(n instanceof t)r.s=n.s,r.e=n.e,r.c=n.c.slice(),function(e){if(e.c.length>1&&!e.c[0]){let t=e.c.findIndex(e=>e);e.c=e.c.slice(t),e.e=e.e-t}}(r);else{if("string"!=typeof n){if(!0===t.strict)throw TypeError(Mo+"number");n=0===n&&1/n<0?"-0":String(n)}Lo(r,n)}r.constructor=t}return t.prototype=_o,t.DP=28,t.RM=1,t.NE=-29,t.PE=29,t.strict=!1,t}(),zo=Ao;new zo(0),new zo(1),new zo(-1),new zo("79228162514264337593543950335"),new zo("-79228162514264337593543950335");function Uo(e,t){return 0===t.indexOf(e)?t:void 0}function Ho(e,t){return function(e,t){const n=e.lastIndexOf(t);return n>=0&&n===e.length-t.length}(t,e)?t:void 0}function Bo(e,t){return function(e){return 1===e?e=>{let t,n,r,o,i,l;return t=Uo("/",e),null!=t?(n=t,"#"+n):(r=Uo("#/",e),null!=r?(o=r,o):(i=Uo("#",e),null!=i?(l=i,"#/"+dn(l,1,l.length-1)):"#/"+e))}:e=>{let t,n;return t=Uo("/",e),null!=t?(n=t,n):"/"+e}}(t)(sn("/",Jn(e=>e.indexOf("?")>=0||0===e.indexOf("#")||0===e.indexOf("/")?e:encodeURIComponent(e),e)))}function Vo(e,t,n){1===t?history.pushState(void 0,"",Bo(e,n)):history.replaceState(void 0,"",Bo(e,n));const r=document.createEvent("CustomEvent");r.initEvent("CUSTOM_NAVIGATION_EVENT",!0,!0),window.dispatchEvent(r)}function $o(e,t){return function(e,t){let n,r;const o=Pn();let i=o,l=t;for(;!Dn(l);){let t=e(Ln(l));for(;!Dn(t);)n=i,r=new Nn(Ln(t),void 0),n.tail=r,i=r,t=Rn(t);l=Rn(l)}const a=i,u=Pn();return a.tail=u,Rn(o)}(e=>{if(un(e))return jn();{const t=function(e,...t){return 0===t.length?e.trimEnd():e.replace(new RegExp("["+qt(t.join(""))+"]+$"),"")}(e,"#");if("?"===t)return jn();if(null!=Uo("?",t))return zn(t);{const e=t.split("?");if(On(0,e,null)||1!==e.length){if(On(0,e,null)||2!==e.length)return jn();if(""===e[1]){const t=e[0];return zn(decodeURIComponent(t))}{const t=e[0],n=e[1];return Qn([decodeURIComponent(t),"?"+n])}}{const t=e[0];return zn(decodeURIComponent(t))}}}},Qn(fn(null!=Uo("#",e)?dn(e,1,e.length-1):1===t&&(null!=Ho("#",e)||null!=Ho("#/",e))?"":e,["/"],null,0)))}const Go=co(e=>{const t=wo(t=>{const n=vn(e.onUrlChanged,e=>{});!function(e,t,n){t($o(2===e?window.location.pathname+window.location.search:window.location.hash,e))}(vn(e.hashMode,1),n)});if(window.navigator.userAgent.indexOf("Trident")>=0||window.navigator.userAgent.indexOf("MSIE")>=0){const e="hashchange",n=e=>{t(e)},r=void 0,o=bo(()=>ko(r),[r]),i=bo(()=>Co(r),[r]),l=bo(()=>e=>{n(e)},[n]);mo(wo(()=>(null==o?window.addEventListener(e,l):window.addEventListener(e,l,o),po(()=>{null==i?window.removeEventListener(e,l):window.removeEventListener(e,l,i)}))))}else{const e="popstate",n=t,r=void 0,o=bo(()=>ko(r),[r]),i=bo(()=>Co(r),[r]),l=bo(()=>e=>{n(e)},[n]);mo(wo(()=>(null==o?window.addEventListener(e,l):window.addEventListener(e,l,o),po(()=>{null==i?window.removeEventListener(e,l):window.removeEventListener(e,l,i)}))))}const n="CUSTOM_NAVIGATION_EVENT",r=t,o=bo(()=>ko(void 0),[void 0]),i=bo(()=>Co(void 0),[void 0]),l=bo(()=>e=>{r(e)},[r]);mo(wo(()=>(null==o?window.addEventListener(n,l):window.addEventListener(n,l,o),po(()=>{null==i?window.removeEventListener(n,l):window.removeEventListener(n,l,i)}))));const a=e.application;return null==a?null:a},void 0,qo,Wo);var Wo,qo;class Qo extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Accounts","NotFound"]}}function Ko(){return K("Middleware.FastTrack.AdminUI.Types.Page",[],Qo,()=>[[],[]])}function Yo(e){let t;switch(t=Un(e)?1:"fasttrack-middleware"===Hn(e)?Un(Bn(e))?1:"accounts"===Hn(Bn(e))&&Un(Bn(Bn(e)))?0:1:1,t){case 0:return new Qo(0);case 1:return new Qo(1)}}const Xo=0,Jo=1,Zo=2,ei=3,ti=4;function ni(e,t){return e.replace(/[a-z]?[A-Z]/g,e=>1===e.length?e.toLowerCase():e.charAt(0)+t+e.charAt(1).toLowerCase())}function ri(e,t=Xo){const n={},r=t;function o(e){throw new Error("Cannot infer key and value of "+String(e))}function i(e,t,r){e=function(e,t){switch(t){case Jo:return e.charAt(0).toLowerCase()+e.slice(1);case Zo:return ni(e,"_");case ei:return ni(e,"_").toUpperCase();case ti:return ni(e,"-");case Xo:default:return e}}(e,t),n[e]=r}for(let t of e){let e=Xo;if(null==t&&o(t),t instanceof F){const n=t.cases()[t.tag];t=0===t.fields.length?n:[n].concat(t.fields),e=r}if(Array.isArray(t))switch(t.length){case 0:o(t);break;case 1:i(t[0],e,!0);break;case 2:const n=t[1];i(t[0],e,n);break;default:i(t[0],e,t.slice(1))}else"string"==typeof t?i(t,e,!0):o(t)}return n}class oi extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["BadPrimitive","BadPrimitiveExtra","BadType","BadField","BadPath","TooSmallArray","FailMessage","BadOneOf"]}}class ii extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["PascalCase","CamelCase","SnakeCase"]}}class li{constructor(){this.cache=new Map([])}}function ai(){return new li}ai(),ai();function ui(e){return e.slice(void 0,1).toLowerCase()+e.slice(1,e.length)}function si(e,t){switch(e.tag){case 2:return function(e,t,n,r,o=0){if("string"==typeof e){const n=e;e=Wt(t,null!=r?r:0),t=n,r=void 0}if("function"==typeof n)return r=null==r?-1:r,t.substring(0,o)+t.substring(o).replace(e,(function(){let e=arguments[0];if(r){r--;const t=[],o=arguments.length,i="string"!=typeof arguments[o-1];let l=i?o-3:o-2;for(let e=0;e<l;e++)t.push(arguments[e]);t.index=arguments[l++],t.input=arguments[l++],i&&(t.groups=arguments[l]),e=n(t)}return e}));if(n=n.replace(/\$0/g,e=>"$&").replace(/\${([^}]+)}/g,"$<$1>"),null!=r){let i;const l=t.substring(o),a=Qt(e,l),u=Qt.length>r?(i=a[r-1],l.substring(0,i.index+i[0].length)):l;return t.substring(0,o)+u.replace(e,n)+t.substring(o+u.length)}return t.replace(e,n)}(ui(t),"[A-Z]","_$0").toLowerCase();case 0:return t;default:return ui(t)}}class ci extends U{constructor(e,t){super(),this.bound=0|e,this.digits=t}}function fi(e,t){for(;;){const n=e,r=t;if(0===r)return 1;if(r%2!=0)return n*fi(n*n,~~(r/2))|0;e=n*n,t=~~(r/2)}}Mt(2013265921,0,!1),Mt(2013265921,0,!0);Cn(28,e=>fi(2,e),Int32Array);function di(e){return e.bound}function pi(e,t){return e.digits[t]}function hi(e,t){return Lt(pi(e,t),!1,2)}function mi(e,t,n){e.digits[t]=0|n}function gi(e,t){for(;;){const n=e,r=t;if(0===r)return Mt(1,0,!1);if(r%2!=0)return Ot(n,gi(Ot(n,n),~~(r/2)));e=Ot(n,n),t=~~(r/2)}}function vi(e,t){for(;;){const n=e,r=t;if(0===r)return 1;if(r%2!=0)return n*vi(n*n,~~(r/2))|0;e=n*n,t=~~(r/2)}}const yi=Mt(16777216,0,!1),bi=Mt(16777215,0,!1);Mt(16777215,0,!0);function wi(e){return new ci(e,new Int32Array(e))}function Si(e){const t=0|((e,t)=>{for(;;){const n=e,r=t;if(-1===r||0!==n[r])return r+1|0;e=n,t=r-1}})(e.digits,e.bound-1);return e.bound=0|t,e}function Ei(e){const t=0|(e<0?0:e);if(t<16777216){const e=wi(1);return e.digits[0]=0|t,Si(e)}{const e=wi(2);for(let n=0;n<=1;n++)e.digits[n]=~~(t/vi(16777216,n))%16777216|0;return Si(e)}}function ki(e){if(1===e.bound)return 0|e.digits[0];{let t=0;for(let n=e.bound-1;n>=0;n--)t=e.digits[n]+16777216*t|0;return 0|t}}const Ci=Ei(1),xi=Ei(0);function Oi(e){return e.bound-1}function Ti(e){return 0===e.bound}function Ii(e,t){if(e.bound===t.bound){return((e,t,n)=>{for(;;){const r=e,o=t,i=n;if(-1===i)return!0;if(r[i]!==o[i])return!1;e=r,t=o,n=i-1}})(e.digits,t.digits,e.bound-1)}return!1}function Ni(e,t){if(e.bound<t.bound)return-1;if(e.bound>t.bound)return 1;return 0|((e,t,n)=>{for(;;){const r=e,o=t,i=n;if(-1===i)return 0;if(r[i]!==o[i])return r[i]<o[i]?-1:1;e=r,t=o,n=i-1}})(e.digits,t.digits,e.bound-1)}function _i(e,t){return-1===Ni(e,t)}function Pi(e,t,n){for(;;){const r=e,o=t,i=n;if(!(Pt(o,Mt(0,0,!1))>0))break;{const l=xt(hi(r,i),o);mi(r,i,~~Dt(_t(l,bi))),e=r,t=Tt(l,yi),n=i+1}}}function Mi(e,t){const n=0|di(e),r=wi(n+1),o=Lt(t,!1,2);let i=Mt(0,0,!1);for(let t=0;t<=n-1;t++){const n=xt(xt(i,hi(r,t)),Ot(hi(e,t),o));mi(r,t,~~Dt(_t(n,bi))),i=Tt(n,yi)}return Pi(r,i,n),Si(r)}function Di(e,t){const n=1===di(e),r=1===di(t);return n&&r?function(e,t){const n=wi(2),r=Ot(Lt(e,!1,2),Lt(t,!1,2));return mi(n,0,~~Dt(_t(r,bi))),mi(n,1,~~Dt(Tt(r,yi))),Si(n)}(pi(e,0),pi(t,0)):n?Mi(t,pi(e,0)):r?Mi(e,pi(t,0)):function(e,t){const n=wi(e.bound+t.bound),r=n.digits;for(let o=0;o<=e.bound-1;o++){const i=Lt(e.digits[o],!1,2);let l=Mt(0,0,!1),a=o;for(let e=0;e<=t.bound-1;e++){const n=Lt(t.digits[e],!1,2),o=xt(xt(Lt(r[a],!1,2),l),Ot(i,n));r[a]=0|~~Dt(_t(o,bi)),l=Tt(o,yi),a=a+1|0}Pi(n,l,a)}return Si(n)}(e,t)}class Fi extends U{constructor(e,t,n,r,o,i,l){super(),this.bigL=0|e,this.twoToBigL=0|t,this.k=0|n,this.bigK=0|r,this.bigN=0|o,this.split=0|i,this.splits=l}}function Li(e,t,n,r){return new Fi(e,vi(2,e),t,n,r,~~(24/e),Cn(~~(24/e),t=>vi(2,e*t),Int32Array))}const Ri=[Li(1,28,268435456,268435456),Li(2,26,67108864,134217728),Li(3,24,16777216,50331648),Li(4,22,4194304,16777216),Li(5,20,1048576,5242880),Li(6,18,262144,1572864),Li(7,16,65536,458752),Li(8,14,16384,131072),Li(9,12,4096,36864),Li(10,10,1024,10240),Li(11,8,256,2816),Li(12,6,64,768),Li(13,4,16,208)];Cn(24,e=>vi(2,e)-1,Int32Array),Cn(24,e=>vi(2,e),Int32Array),Cn(24,e=>gi(Mt(2,0,!1),e));Ri[0].bigN;function ji(e,t){return Di(e,t)}function Ai(e,t,n,r){const o=[e.digits,Oi(e)],i=o[0],l=[n.digits,Oi(n)],a=0|l[1],u=l[0],s=Lt(t,!1,2);let c=0,f=Ot(s,Lt(u[0],!1,2));for(;Pt(f,Mt(0,0,!1))>0||c<a;){if(c>o[1])throw new Error("scaleSubInPlace: pre-condition did not apply, result would be -ve");let e=~~Dt(_t(f,bi)),t=Tt(f,yi);e<=i[c+r]?i[c+r]=i[c+r]-e|0:(i[c+r]=i[c+r]+(16777216-e)|0,t=xt(t,Mt(1,0,!1))),f=c<a?xt(t,Ot(s,Lt(u[c+1],!1,2))):t,c=c+1|0}Si(e)}function zi(e,t,n,r){const o=[e.digits,Oi(e)],i=o[0],l=[n.digits,Oi(n)],a=0|l[1],u=l[0],s=Lt(t,!1,2);let c=0,f=Ot(s,Lt(u[0],!1,2));for(;Pt(f,Mt(0,0,!1))>0||c<a;){if(c>o[1])throw new Error("scaleSubInPlace: pre-condition did not apply, result would be -ve");let e=~~Dt(_t(f,bi)),t=Tt(f,yi);e<16777216-i[c+r]?i[c+r]=i[c+r]+e|0:(i[c+r]=e-(16777216-i[c+r])|0,t=xt(t,Mt(1,0,!1))),f=c<a?xt(t,Ot(s,Lt(u[c+1],!1,2))):t,c=c+1|0}Si(e)}function Ui(e,t,n){const r=[Oi(t),Oi(e)],o=0|r[1],i=0|r[0];if(o<i+n)return 0;{const r=[t.digits,e.digits],c=r[1],f=r[0],d=0|(0===i?o===n?~~(c[n]/f[0]):~~Dt(Tt(xt(Ot(Lt(c[o],!1,2),yi),Lt(c[o-1],!1,2)),Lt(f[0],!1,2))):o===i+n?~~(c[o]/(f[i]+1)):~~Dt(Tt(xt(Ot(Lt(c[o],!1,2),yi),Lt(c[o-1],!1,2)),xt(Lt(f[i],!1,2),Mt(1,0,!1)))));return 0===d?1!=(a=n,u=e,s=0,(l=t).bound+a<u.bound+s?-1:l.bound+a>u.bound+a?1:0|((e,t,n)=>{e:for(;;){const r=e,o=t,i=n;if(-1===i)return 0;{const l=0|(i<a?0:r[i-a]),u=0|(i<s?0:o[i-s]);if(l===u){e=r,t=o,n=i-1;continue e}return l<u?-1:1}}})(l.digits,u.digits,l.bound+a-1))?1:0:0|d}var l,a,u,s}function Hi(e,t){if(Ti(t))throw new Error;if(Oi(e)<Oi(t))return[xi,e];{const n=function(e){return new ci(e.bound,e.digits.slice())}(e),r=wi(Oi(e)-Oi(t)+1+1);let o=Oi(e);const i=0|Oi(t);let l=o-i;const a=e=>{};let u=!1;for(;!u;){a([r,n,l,o]);const e=0|Ui(n,t,l);e>0?(Ai(n,e,t,l),zi(r,e,Ci,l),a([r,n,l,o])):(u=0===e&&0===l,u||(o===i+l?(a([r,n,l-1,o]),l=l-1|0):(a([r,n,l-1,o-1]),l=l-1|0,o=o-1|0)))}return[Si(r),Si(n)]}}Ei(2);function Bi(e){return Ei(e)}function Vi(e){return function(e){const t=Pt(e,Mt(0,0,!1))<0?Mt(0,0,!1):e,n=wi(3);for(let e=0;e<=2;e++)n.digits[e]=0|~~Dt(It(Tt(t,gi(yi,e)),yi));return Si(n)}(e)}function $i(e){const t=0|Oi(e),n=(e,t,r,o)=>{e:for(;;){const i=e,l=t,a=r,u=o;if(Un(u)){const e=0|ki(a);return i&&0===e?l:An(p(e),l)}{const s=Bn(u),c=Hi(a,Hn(u)[1]),f=c[1],d=c[0];if(i&&Ti(d)){e=i,t=l,r=f,o=s;continue e}e=i,t=n(!1,l,f,s),r=d,o=s;continue e}}},r=n(!0,jn(),e,((e,n,r)=>{for(;;){const o=e,i=n,l=r;if(Oi(l)>t)return An([i,l],o);e=An([i,l],o),n=i+1,r=ji(l,l)}})(jn(),0,Ei(10)));return Un(r)?"0":sn("",Vn(r))}function Gi(e){return e.bound<=1}function Wi(e){const t=e;return 0<t.bound?0|t.digits[0]:0}class qi extends U{constructor(e,t){super(),this.signInt=0|e,this.v=t}toString(){const e=this;switch(0|Yi(e)){case-1:return Ti(Xi(e))?"0":"-"+$i(Xi(e));case 0:return"0";case 1:return $i(Xi(e));default:throw new Error("signs should be +/- 1 or 0")}}Equals(e){return e instanceof qi&&Ji(this,e)}GetHashCode(){return 0|(0===Yi(e=this)?1:Yi(e)+function(e){let t=0;for(let n=0;n<=e.bound-1;n++)t=e.digits[n]+(t<<3)|0;return 0|t}(Xi(e))|0);var e}toJSON(e){return D(this)}CompareTo(e){if(e instanceof qi)return 0|(Zi(t=this,n=e)?-1:Ji(t,n)?0:1);throw new Error("the objects are not comparable\\nParameter name: obj");var t,n}}function Qi(e,t){return new qi(e,t)}function Ki(e){return Gi(e)&&Wi(e)<qi.smallLim?qi.smallPosTab[Wi(e)]:e}function Yi(e){return e.signInt}function Xi(e){return e.v}function Ji(e,t){const n=[Yi(e),Yi(t)];let r;switch(r=-1===n[0]?-1===n[1]?1:0===n[1]?8:1===n[1]?3:9:0===n[0]?-1===n[1]?6:0===n[1]?4:1===n[1]?5:9:1===n[0]?-1===n[1]?2:0===n[1]?7:1===n[1]?0:9:9,r){case 0:case 1:return Ii(Xi(e),Xi(t));case 2:case 3:return!!Ti(Xi(e))&&Ti(Xi(t));case 4:return!0;case 5:case 6:return Ti(Xi(t));case 7:case 8:return Ti(Xi(e));case 9:throw new Error("signs should be +/- 1 or 0\\nParameter name: x")}}function Zi(e,t){const n=[Yi(e),Yi(t)];let r;switch(r=-1===n[0]?-1===n[1]?1:0===n[1]?8:1===n[1]?3:9:0===n[0]?-1===n[1]?6:0===n[1]?4:1===n[1]?5:9:1===n[0]?-1===n[1]?2:0===n[1]?7:1===n[1]?0:9:9,r){case 0:return _i(Xi(e),Xi(t));case 1:return _i(Xi(t),Xi(e));case 2:return!1;case 3:return!Ti(Xi(e))||!Ti(Xi(t));case 4:return!1;case 5:return!Ti(Xi(t));case 6:case 7:return!1;case 8:return!Ti(Xi(e));case 9:throw new Error("signs should be +/- 1 or 0\\nParameter name: x")}}function el(e){return e>=0?Qi(1,Ki(Bi(e))):Qi(-1,Ki(-2147483648===e?Vi(Nt(Lt(e,!1,2))):Bi(Oe(e))))}function tl(){return qi.one}function nl(){return qi.two}function rl(){return qi.zero}qi.smallLim=4096,qi.smallPosTab=Cn(qi.smallLim,e=>Bi(e)),qi.one=el(1),qi.two=el(2),qi.zero=el(0);rl(),tl(),nl();rl(),tl();function ol(e,t){il(t);const n=new Date(e);return n.offset=null!=t?t:-6e4*(new Date).getTimezoneOffset(),n}function il(e){if(null!=e&&0!==e){if(e%6e4!=0)throw new Error("Offset must be specified in whole minutes.");if(Math.abs(e/36e5)>14)throw new Error("Offset must be within plus or minus 14 hours.")}}function ll(e,t){try{return t.contents=function(e){const t=$t(e),n=Rt.exec(e),r=null==n?-6e4*t.getTimezoneOffset():"Z"===n[0]?0:36e5*parseInt(n[1],10)+6e4*parseInt(n[2],10);return ol(t.getTime(),r)}(e),!0}catch(e){return!1}}function al(e){return e<0?Math.ceil(e):Math.floor(e)}function ul(e=0,t=0,n=0,r=0,o=0){switch(arguments.length){case 1:return sl(arguments[0]);case 3:e=0,t=arguments[0],n=arguments[1],r=arguments[2],o=0}return 864e5*e+36e5*t+6e4*n+1e3*r+o}function sl(e){return Ft(Tt(e,1e4))}function cl(e,t="c",n){if(-1===["c","g","G"].indexOf(t))throw new Error("Custom formats are not supported");const r=Math.abs(function(e){return al(e/864e5)}(e)),o=Math.abs(function(e){return al(e%864e5/36e5)}(e)),i=Math.abs(function(e){return al(e%36e5/6e4)}(e)),l=Math.abs(function(e){return al(e%6e4/1e3)}(e)),a=Math.abs(function(e){return al(e%1e3)}(e));return`${e<0?"-":""}${0!==r||"c"!==t&&"g"!==t?"c"===t?r+".":r+":":""}${"g"===t?o:f(o,2)}:${f(i,2)}:${f(l,2)}${0!==a||"c"!==t&&"g"!==t?"g"===t?"."+f(a,3):"."+function(e,t,n){let r=e.toString(10);for(;r.length<t;)r="0"+r;for(;r.length<n;)r+="0";return r}(a,3,7):""}`}function fl(e,t){try{return t.contents=function(e){const t=e.search("\\."),n=e.search("\\:");if(-1===t&&-1===n){const t=parseInt(e,0);if(isNaN(t))throw new Error(`String '${e}' was not recognized as a valid TimeSpan.`);return ul(t,0,0,0,0)}if(n>0){const t=/^(-?)((\d+)\.)?(?:0*)([0-9]|0[0-9]|1[0-9]|2[0-3]):(?:0*)([0-5][0-9]|[0-9])(:(?:0*)([0-5][0-9]|[0-9]))?\.?(\d+)?$/.exec(e);if(null!=t&&null!=t[4]&&null!=t[5]){let n=0,r=0,o=0;const i=null!=t[1]&&"-"===t[1]?-1:1,l=+t[4],a=+t[5];if(null!=t[3]&&(n=+t[3]),null!=t[7]&&(o=+t[7]),null!=t[8])switch(t[8].length){case 1:r=100*+t[8];break;case 2:r=10*+t[8];break;case 3:r=+t[8];break;case 4:r=+t[8]/10;break;case 5:r=+t[8]/100;break;case 6:r=+t[8]/1e3;break;case 7:r=+t[8]/1e4;break;default:throw new Error(`String '${e}' was not recognized as a valid TimeSpan.`)}return i*ul(n,l,a,o,r)}}throw new Error(`String '${e}' was not recognized as a valid TimeSpan.`)}(e),!0}catch(e){return!1}}class dl{constructor(e,t){this.k=e,this.v=t}}function pl(e,t){return new dl(e,t)}function hl(e){return e.k}function ml(e){return e.v}class gl extends dl{constructor(e,t,n,r,o){super(e,t),this.left=n,this.right=r,this.h=0|o}}function vl(e,t,n,r,o){return new gl(e,t,n,r,o)}function yl(e){return e.left}function bl(e){return e.right}function wl(e){return e.h}function Sl(e){return function e(t,n){e:for(;;){const r=t,o=n;if(null!=o){const i=o;if(i instanceof gl){t=e(r+1,yl(i)),n=bl(i);continue e}return r+1|0}return 0|r}}(0,e)}function El(e,t,n,r){let o;if(null!=e){const t=e;o=t instanceof gl?wl(t):1}else o=0;let i;if(null!=r){const e=r;i=e instanceof gl?wl(e):1}else i=0;const l=0|(o<i?i:o);return 0===l?pl(t,n):vl(t,n,e,r,l+1)}function kl(e,t,n,r){let o,i,l,a,u;if(null!=e){const t=e;u=t instanceof gl?wl(t):1}else u=0;let s;if(null!=r){const e=r;s=e instanceof gl?wl(e):1}else s=0;if(s>u+2){const l=mn(r);if(l instanceof gl){if(o=yl(l),(null!=o?(i=o,i instanceof gl?wl(i):1):0)>u+1){const r=mn(yl(l));if(r instanceof gl)return El(El(e,t,n,yl(r)),hl(r),ml(r),El(bl(r),hl(l),ml(l),bl(l)));throw new Error("internal error: Map.rebalance")}return El(El(e,t,n,yl(l)),hl(l),ml(l),bl(l))}throw new Error("internal error: Map.rebalance")}if(u>s+2){const o=mn(e);if(o instanceof gl){if(l=bl(o),(null!=l?(a=l,a instanceof gl?wl(a):1):0)>s+1){const e=mn(bl(o));if(e instanceof gl)return El(El(yl(o),hl(o),ml(o),yl(e)),hl(e),ml(e),El(bl(e),t,n,r));throw new Error("internal error: Map.rebalance")}return El(yl(o),hl(o),ml(o),El(bl(o),t,n,r))}throw new Error("internal error: Map.rebalance")}return El(e,t,n,r)}function Cl(e,t,n,r){if(null!=r){const o=r,i=0|e.Compare(t,hl(o));return o instanceof gl?i<0?kl(Cl(e,t,n,yl(o)),hl(o),ml(o),bl(o)):0===i?vl(t,n,yl(o),bl(o),wl(o)):kl(yl(o),hl(o),ml(o),Cl(e,t,n,bl(o))):i<0?vl(t,n,void 0,r,2):0===i?pl(t,n):vl(t,n,r,void 0,2)}return pl(t,n)}function xl(e,t,n){e:for(;;){const r=e,o=t,i=n;if(null!=i){const l=i,a=0|r.Compare(o,hl(l));if(0===a)return hn(ml(l));if(l instanceof gl){e=r,t=o,n=a<0?yl(l):bl(l);continue e}return}return}}function Ol(e,t){!function e(t,n){e:for(;;){const r=t,o=n;if(null!=o){const i=o;if(i instanceof gl){e(r,yl(i)),r(hl(i),ml(i)),t=r,n=bl(i);continue e}r(hl(i),ml(i))}break}}(e,t)}function Tl(e,t){return function e(t,n){if(null!=n){const r=n;if(r instanceof gl){const n=e(t,yl(r)),o=t(hl(r),ml(r)),i=e(t,bl(r));return vl(hl(r),o,n,i,wl(r))}return pl(hl(r),t(hl(r),ml(r)))}}(e,t)}function Il(e,t,n){let r=n;Ol((e,n)=>{t[r]=[e,n],r=r+1|0},e)}function Nl(e,t){let n=void 0;for(let r=0;r<=t.length-1;r++){const o=t[r];n=Cl(e,o[0],o[1],n)}return n}function _l(e,t){if(r(t))return Nl(e,t);if(t instanceof Nn)return function(e,t){return $n((t,n)=>Cl(e,n[0],n[1],t),void 0,t)}(e,t);{const n=u(t);try{return function(e,t,n){for(;;){const r=e,o=t,i=n;if(!i["System.Collections.IEnumerator.MoveNext"]())return o;{const l=i["System.Collections.Generic.IEnumerator`1.get_Current"]();e=r,t=Cl(r,l[0],l[1],o),n=i}}}(e,void 0,n)}finally{n.Dispose()}}}class Pl extends U{constructor(e,t){super(),this.stack=e,this.started=t}}function Ml(e){e:for(;;){const t=e;if(Un(t))return jn();{const n=Bn(t),r=Hn(t);if(null!=r){const o=r;if(o instanceof gl){e=qn([yl(o),pl(hl(o),ml(o)),bl(o)],n);continue e}return t}e=n;continue e}}}function Dl(e){return new Pl(Ml(zn(e)),!1)}function Fl(e){if(e.started){const t=e.stack;if(Un(t))return function(){throw new Error("enumeration already finished")}();if(null!=Hn(t)){const e=Hn(t);if(e instanceof gl)throw new Error("Please report error: Map iterator, unexpected stack for current");return[hl(e),ml(e)]}throw new Error("Please report error: Map iterator, unexpected stack for current")}return function(){throw new Error("enumeration not started")}()}function Ll(e){let t=Dl(e);return{"System.Collections.Generic.IEnumerator`1.get_Current":()=>Fl(t),"System.Collections.IEnumerator.get_Current":()=>Fl(t),"System.Collections.IEnumerator.MoveNext":()=>function(e){if(e.started){const t=e.stack;if(Un(t))return!1;if(null!=Hn(t)){if(Hn(t)instanceof gl)throw new Error("Please report error: Map iterator, unexpected stack for moveNext");return e.stack=Ml(Bn(t)),!Un(e.stack)}throw new Error("Please report error: Map iterator, unexpected stack for moveNext")}return e.started=!0,!Un(e.stack)}(t),"System.Collections.IEnumerator.Reset"(){t=Dl(e)},Dispose(){}}}class Rl{constructor(e,t){this.comparer=e,this.tree=t}GetHashCode(){return 0|function(e){const t=(e,t)=>(e<<1)+t+631;let n=0;const r=u(e);try{for(;r["System.Collections.IEnumerator.MoveNext"]();){const e=r["System.Collections.Generic.IEnumerator`1.get_Current"]();n=0|t(n,y(e[0])),n=0|t(n,y(e[1]))}}finally{r.Dispose()}return 0|n}(this)}Equals(e){if(!(e instanceof Rl))return!1;{const t=u(this);try{const n=u(e);try{const e=()=>{const r=t["System.Collections.IEnumerator.MoveNext"]();if(r===n["System.Collections.IEnumerator.MoveNext"]()){if(r){const r=t["System.Collections.Generic.IEnumerator`1.get_Current"](),o=n["System.Collections.Generic.IEnumerator`1.get_Current"]();return!(!E(r[0],o[0])||!E(r[1],o[1]))&&e()}return!0}return!1};return e()}finally{n.Dispose()}}finally{t.Dispose()}}}toString(){return"map ["+sn("; ",no(e=>ln("({0}, {1})",e[0],e[1]),this))+"]"}get[Symbol.toStringTag](){return"FSharpMap"}toJSON(e){return Array.from(this)}GetEnumerator(){return Ll(this.tree)}[Symbol.iterator](){return s(this.GetEnumerator())}"System.Collections.IEnumerable.GetEnumerator"(){return Ll(this.tree)}CompareTo(e){const t=this;if(e instanceof Rl)return 0|function(e,t,n){const r=Vr(t);try{const t=Vr(n);try{let n=0,o=r["System.Collections.IEnumerator.MoveNext"](),i=t["System.Collections.IEnumerator.MoveNext"]();for(;0===n&&o&&i;)n=0|e(r["System.Collections.Generic.IEnumerator`1.get_Current"](),t["System.Collections.Generic.IEnumerator`1.get_Current"]()),0===n&&(o=r["System.Collections.IEnumerator.MoveNext"](),i=t["System.Collections.IEnumerator.MoveNext"]());return 0|(0!==n?n:o?1:i?-1:0)}finally{t.Dispose()}}finally{r.Dispose()}}((e,n)=>{const r=0|t.comparer.Compare(e[0],n[0]);return 0|(0!==r?r:O(e[1],n[1]))},t,e);throw new Error("not comparable\\nParameter name: obj")}"System.Collections.Generic.ICollection`1.Add2B595"(e){throw new Error("Map cannot be mutated")}"System.Collections.Generic.ICollection`1.Clear"(){throw new Error("Map cannot be mutated")}"System.Collections.Generic.ICollection`1.Remove2B595"(e){throw new Error("Map cannot be mutated")}"System.Collections.Generic.ICollection`1.Contains2B595"(e){return!!Hl(this,e[0])&&E(zl(this,e[0]),e[1])}"System.Collections.Generic.ICollection`1.CopyToZ2E171D71"(e,t){Il(this.tree,e,t)}"System.Collections.Generic.ICollection`1.get_IsReadOnly"(){return!0}"System.Collections.Generic.ICollection`1.get_Count"(){return 0|Ul(this)}"System.Collections.Generic.IReadOnlyCollection`1.get_Count"(){return 0|Ul(this)}get size(){return 0|Ul(this)}clear(){throw new Error("Map cannot be mutated")}delete(e){throw new Error("Map cannot be mutated")}entries(){return no(e=>[e[0],e[1]],this)}get(e){return zl(this,e)}has(e){return Hl(this,e)}keys(){return no(e=>e[0],this)}set(e,t){throw new Error("Map cannot be mutated")}values(){return no(e=>e[1],this)}forEach(e,t){const n=this;to(t=>{e(t[1],t[0],n)},n)}}function jl(e,t){return new Rl(e,t)}function Al(e){const t=Mr();return jl(t,_l(t,e))}function zl(e,t){return function(e,t,n){const r=xl(e,t,n);if(null==r)throw new Error;return mn(r)}(e.comparer,t,e.tree)}function Ul(e){return Sl(e.tree)}function Hl(e,t){return function(e,t,n){e:for(;;){const r=e,o=t,i=n;if(null!=i){const l=i,a=0|r.Compare(o,hl(l));if(l instanceof gl){if(a<0){e=r,t=o,n=yl(l);continue e}if(0===a)return!0;e=r,t=o,n=bl(l);continue e}return 0===a}return!1}}(e.comparer,t,e.tree)}function Bl(e,t,n){return function(e,t,n){return jl(e.comparer,Cl(e.comparer,t,n,e.tree))}(n,e,t)}function Vl(e,t){return function(e,t){return xl(e.comparer,t,e.tree)}(t,e)}function $l(e,t){return r=e,jl((n=t).comparer,Tl(r,n.tree));var n,r}function Gl(){return Rl.empty}Rl.empty=jl(Mr(),void 0);class Wl{constructor(e){this.k=e}}function ql(e){return new Wl(e)}function Ql(e){return e.k}class Kl extends Wl{constructor(e,t,n,r){super(e),this.left=t,this.right=n,this.h=0|r}}function Yl(e,t,n,r){return new Kl(e,t,n,r)}function Xl(e){return e.left}function Jl(e){return e.right}function Zl(e){return e.h}function ea(e){return function e(t,n){e:for(;;){const r=t,o=n;if(null!=r){const i=r;if(i instanceof Kl){t=Xl(i),n=e(Jl(i),o+1);continue e}return o+1|0}return 0|o}}(e,0)}function ta(e,t,n){let r;if(null!=e){const t=e;r=t instanceof Kl?Zl(t):1}else r=0;let o;if(null!=n){const e=n;o=e instanceof Kl?Zl(e):1}else o=0;const i=0|(r<o?o:r);return 0===i?ql(t):Yl(t,e,n,i+1)}function na(e,t,n){let r,o,i,l,a;if(null!=e){const t=e;a=t instanceof Kl?Zl(t):1}else a=0;let u;if(null!=n){const e=n;u=e instanceof Kl?Zl(e):1}else u=0;if(u>a+2){const i=mn(n);if(i instanceof Kl){if(r=Xl(i),(null!=r?(o=r,o instanceof Kl?Zl(o):1):0)>a+1){const n=mn(Xl(i));if(n instanceof Kl)return ta(ta(e,t,Xl(n)),Ql(n),ta(Jl(n),Ql(i),Jl(i)));throw new Error("internal error: Set.rebalance")}return ta(ta(e,t,Xl(i)),Ql(i),Jl(i))}throw new Error("internal error: Set.rebalance")}if(a>u+2){const r=mn(e);if(r instanceof Kl){if(i=Jl(r),(null!=i?(l=i,l instanceof Kl?Zl(l):1):0)>u+1){const e=mn(Jl(r));if(e instanceof Kl)return ta(ta(Xl(r),Ql(r),Xl(e)),Ql(e),ta(Jl(e),t,n));throw new Error("internal error: Set.rebalance")}return ta(Xl(r),Ql(r),ta(Jl(r),t,n))}throw new Error("internal error: Set.rebalance")}return ta(e,t,n)}function ra(e,t,n){if(null!=n){const r=n,o=0|e.Compare(t,Ql(r));if(r instanceof Kl)return o<0?na(ra(e,t,Xl(r)),Ql(r),Jl(r)):0===o?n:na(Xl(r),Ql(r),ra(e,t,Jl(r)));{const o=0|e.Compare(t,Ql(r));return o<0?Yl(t,void 0,n,2):0===o?n:Yl(t,n,void 0,2)}}return ql(t)}function oa(e,t,n){e:for(;;){const r=e,o=t,i=n;if(null!=i){const l=i,a=0|r.Compare(o,Ql(l));if(l instanceof Kl){if(a<0){e=r,t=o,n=Xl(l);continue e}if(0===a)return!0;e=r,t=o,n=Jl(l);continue e}return 0===a}return!1}}function ia(e,t){e:for(;;){const n=e,r=t;if(null!=r){const o=r;if(o instanceof Kl){ia(n,Xl(o)),n(Ql(o)),e=n,t=Jl(o);continue e}n(Ql(o))}break}}class la extends U{constructor(e,t){super(),this.stack=e,this.started=t}}function aa(e){e:for(;;){const t=e;if(Un(t))return jn();{const n=Hn(t),r=Bn(t);if(null!=n){const o=n;if(o instanceof Kl){e=qn([Xl(o),ql(Ql(o)),Jl(o)],r);continue e}return t}e=r;continue e}}}function ua(e){return new la(aa(zn(e)),!1)}function sa(e){if(e.started){const t=e.stack;if(Un(t))return function(){throw new Error("Enumeration already started")}();if(null!=Hn(t)){return Ql(Hn(t))}throw new Error("Please report error: Set iterator, unexpected stack for current")}return function(){throw new Error("Enumeration not started")}()}function ca(e){let t=ua(e);return{"System.Collections.Generic.IEnumerator`1.get_Current":()=>sa(t),"System.Collections.IEnumerator.get_Current":()=>sa(t),"System.Collections.IEnumerator.MoveNext":()=>function(e){if(e.started){const t=e.stack;if(Un(t))return!1;if(null!=Hn(t)){if(Hn(t)instanceof Kl)throw new Error("Please report error: Set iterator, unexpected stack for moveNext");return e.stack=aa(Bn(t)),!Un(e.stack)}throw new Error("Please report error: Set iterator, unexpected stack for moveNext")}return e.started=!0,!Un(e.stack)}(t),"System.Collections.IEnumerator.Reset"(){t=ua(e)},Dispose(){}}}function fa(e,t,n){return null==t?null==n?0:-1:null==n?1:0|function(e,t,n){e:for(;;){const r=e,o=t,i=n,l=[o,i];if(Un(l[0]))return Un(l[1])?0:-1;if(Un(l[1]))return 1;if(null!=Hn(l[1]))if(null!=Hn(l[0])){const a=Hn(l[0]),u=Hn(l[1]);if(a instanceof Kl)if(null==Xl(a)){if(!(u instanceof Kl)){const o=0|r.Compare(Ql(a),Ql(u));if(0!==o)return 0|o;e=r,t=An(Jl(a),Bn(l[0])),n=An(void 0,Bn(l[1]));continue e}if(null==Xl(u)){const o=0|r.Compare(Ql(a),Ql(u));if(0!==o)return 0|o;e=r,t=An(Jl(a),Bn(l[0])),n=An(Jl(u),Bn(l[1]));continue e}{const l=[o,i];let a,u,s,c,f;switch(Un(l[0])?Un(l[1])?a=2:null!=Hn(l[1])?(a=1,c=Bn(l[1]),f=Hn(l[1])):a=2:null!=Hn(l[0])?(a=0,u=Bn(l[0]),s=Hn(l[0])):Un(l[1])?a=2:null!=Hn(l[1])?(a=1,c=Bn(l[1]),f=Hn(l[1])):a=2,a){case 0:if(s instanceof Kl){e=r,t=qn([Xl(s),Yl(Ql(s),void 0,Jl(s),0)],u),n=i;continue e}e=r,t=qn([void 0,ql(Ql(s))],u),n=i;continue e;case 1:if(f instanceof Kl){e=r,t=o,n=qn([Xl(f),Yl(Ql(f),void 0,Jl(f),0)],c);continue e}e=r,t=o,n=qn([void 0,ql(Ql(f))],c);continue e;case 2:throw new Error("unexpected state in SetTree.compareStacks")}}}else{const l=[o,i];let a,u,s,c,f;switch(Un(l[0])?Un(l[1])?a=2:null!=Hn(l[1])?(a=1,c=Bn(l[1]),f=Hn(l[1])):a=2:null!=Hn(l[0])?(a=0,u=Bn(l[0]),s=Hn(l[0])):Un(l[1])?a=2:null!=Hn(l[1])?(a=1,c=Bn(l[1]),f=Hn(l[1])):a=2,a){case 0:if(s instanceof Kl){e=r,t=qn([Xl(s),Yl(Ql(s),void 0,Jl(s),0)],u),n=i;continue e}e=r,t=qn([void 0,ql(Ql(s))],u),n=i;continue e;case 1:if(f instanceof Kl){e=r,t=o,n=qn([Xl(f),Yl(Ql(f),void 0,Jl(f),0)],c);continue e}e=r,t=o,n=qn([void 0,ql(Ql(f))],c);continue e;case 2:throw new Error("unexpected state in SetTree.compareStacks")}}else{if(!(u instanceof Kl)){const o=0|r.Compare(Ql(a),Ql(u));if(0!==o)return 0|o;e=r,t=Bn(l[0]),n=Bn(l[1]);continue e}if(null==Xl(u)){const o=0|r.Compare(Ql(a),Ql(u));if(0!==o)return 0|o;e=r,t=An(void 0,Bn(l[0])),n=An(Jl(u),Bn(l[1]));continue e}{const l=[o,i];let a,u,s,c,f;switch(Un(l[0])?Un(l[1])?a=2:null!=Hn(l[1])?(a=1,c=Bn(l[1]),f=Hn(l[1])):a=2:null!=Hn(l[0])?(a=0,u=Bn(l[0]),s=Hn(l[0])):Un(l[1])?a=2:null!=Hn(l[1])?(a=1,c=Bn(l[1]),f=Hn(l[1])):a=2,a){case 0:if(s instanceof Kl){e=r,t=qn([Xl(s),Yl(Ql(s),void 0,Jl(s),0)],u),n=i;continue e}e=r,t=qn([void 0,ql(Ql(s))],u),n=i;continue e;case 1:if(f instanceof Kl){e=r,t=o,n=qn([Xl(f),Yl(Ql(f),void 0,Jl(f),0)],c);continue e}e=r,t=o,n=qn([void 0,ql(Ql(f))],c);continue e;case 2:throw new Error("unexpected state in SetTree.compareStacks")}}}}else{Hn(l[1]);const a=[o,i];let u,s,c,f,d;switch(Un(a[0])?Un(a[1])?u=2:null!=Hn(a[1])?(u=1,f=Bn(a[1]),d=Hn(a[1])):u=2:null!=Hn(a[0])?(u=0,s=Bn(a[0]),c=Hn(a[0])):Un(a[1])?u=2:null!=Hn(a[1])?(u=1,f=Bn(a[1]),d=Hn(a[1])):u=2,u){case 0:if(c instanceof Kl){e=r,t=qn([Xl(c),Yl(Ql(c),void 0,Jl(c),0)],s),n=i;continue e}e=r,t=qn([void 0,ql(Ql(c))],s),n=i;continue e;case 1:if(d instanceof Kl){e=r,t=o,n=qn([Xl(d),Yl(Ql(d),void 0,Jl(d),0)],f);continue e}e=r,t=o,n=qn([void 0,ql(Ql(d))],f);continue e;case 2:throw new Error("unexpected state in SetTree.compareStacks")}}else{if(null==Hn(l[0])){e=r,t=Bn(l[0]),n=Bn(l[1]);continue e}{Hn(l[0]);const a=[o,i];let u,s,c,f,d;switch(Un(a[0])?Un(a[1])?u=2:null!=Hn(a[1])?(u=1,f=Bn(a[1]),d=Hn(a[1])):u=2:null!=Hn(a[0])?(u=0,s=Bn(a[0]),c=Hn(a[0])):Un(a[1])?u=2:null!=Hn(a[1])?(u=1,f=Bn(a[1]),d=Hn(a[1])):u=2,u){case 0:if(c instanceof Kl){e=r,t=qn([Xl(c),Yl(Ql(c),void 0,Jl(c),0)],s),n=i;continue e}e=r,t=qn([void 0,ql(Ql(c))],s),n=i;continue e;case 1:if(d instanceof Kl){e=r,t=o,n=qn([Xl(d),Yl(Ql(d),void 0,Jl(d),0)],f);continue e}e=r,t=o,n=qn([void 0,ql(Ql(d))],f);continue e;case 2:throw new Error("unexpected state in SetTree.compareStacks")}}}break}}(e,zn(t),zn(n))}function da(e,t,n){let r=n;ia(e=>{t[r]=e,r=r+1|0},e)}function pa(e,t){return xn((t,n)=>ra(e,n,t),void 0,t)}function ha(e,t){if(r(t))return pa(e,t);if(t instanceof Nn)return function(e,t){return $n((t,n)=>ra(e,n,t),void 0,t)}(e,t);{const n=u(t);try{return function(e,t,n){for(;;){const r=e,o=t,i=n;if(!i["System.Collections.IEnumerator.MoveNext"]())return o;e=r,t=ra(r,i["System.Collections.Generic.IEnumerator`1.get_Current"](),o),n=i}}(e,void 0,n)}finally{n.Dispose()}}}class ma{constructor(e,t){this.comparer=e,this.tree=t}GetHashCode(){return 0|function(e){let t=0;const n=u(e);try{for(;n["System.Collections.IEnumerator.MoveNext"]();){const e=n["System.Collections.Generic.IEnumerator`1.get_Current"]();t=(t<<1)+y(e)+631|0}}finally{n.Dispose()}return 0|Math.abs(t)}(this)}Equals(e){return e instanceof ma&&0===fa(va(this),ya(this),ya(e))}toString(){return"set ["+sn("; ",no(e=>D(e),this))+"]"}get[Symbol.toStringTag](){return"FSharpSet"}toJSON(e){return Array.from(this)}CompareTo(e){return 0|fa(va(this),ya(this),ya(e))}"System.Collections.Generic.ICollection`1.Add2B595"(e){throw new Error("ReadOnlyCollection")}"System.Collections.Generic.ICollection`1.Clear"(){throw new Error("ReadOnlyCollection")}"System.Collections.Generic.ICollection`1.Remove2B595"(e){throw new Error("ReadOnlyCollection")}"System.Collections.Generic.ICollection`1.Contains2B595"(e){return oa(va(this),e,ya(this))}"System.Collections.Generic.ICollection`1.CopyToZ2E171D71"(e,t){da(ya(this),e,t)}"System.Collections.Generic.ICollection`1.get_IsReadOnly"(){return!0}"System.Collections.Generic.ICollection`1.get_Count"(){return 0|ba(this)}"System.Collections.Generic.IReadOnlyCollection`1.get_Count"(){return 0|ba(this)}GetEnumerator(){return ca(ya(this))}[Symbol.iterator](){return s(this.GetEnumerator())}"System.Collections.IEnumerable.GetEnumerator"(){return ca(ya(this))}get size(){return 0|ba(this)}add(e){throw new Error("Set cannot be mutated")}clear(){throw new Error("Set cannot be mutated")}delete(e){throw new Error("Set cannot be mutated")}has(e){return wa(this,e)}keys(){return no(e=>e,this)}values(){return no(e=>e,this)}entries(){return no(e=>[e,e],this)}forEach(e,t){const n=this;to(t=>{e(t,t,n)},n)}}function ga(e,t){return new ma(e,t)}function va(e){return e.comparer}function ya(e){return e.tree}function ba(e){return ea(ya(e))}function wa(e,t){return oa(va(e),t,ya(e))}function Sa(e,t){return ga(t,ha(t,e))}function Ea(e,t,n){try{return"Expecting "+e+" but instead got:"+(n?"\n":" ")+JSON.stringify(t,null,4)}catch(t){return"Expecting "+e+" but decoder failed. Couldn't report given value due to circular structure."+(n?"\n":" ")}}function ka(e,t){const n=2===t.tag?Ea(t.fields[0],t.fields[1],!0):1===t.tag?Ea(t.fields[0],t.fields[1],!1)+"\nReason: "+t.fields[2]:3===t.tag?Ea(t.fields[0],t.fields[1],!0):4===t.tag?Ea(t.fields[0],t.fields[1],!0)+"\nNode `"+t.fields[2]+"` is unkown.":5===t.tag?"Expecting "+t.fields[0]+".\n"+JSON.stringify(t.fields[1],null,4):7===t.tag?"The following errors were found:\n\n"+sn("\n\n",t.fields[0]):6===t.tag?"The following `failure` occurred with the decoder: "+t.fields[0]:Ea(t.fields[0],t.fields[1],!1);return 7===t.tag?n:"Error at: `"+e+"`\n"+n}function Ca(e,t,n){const r=t(e,n);if(1===r.tag){const e=r.fields[0];return new ur(1,ka(e[0],e[1]))}return new ur(0,r.fields[0])}function xa(e,t){try{return Ca("$",e,JSON.parse(t))}catch(e){if(e instanceof SyntaxError)return new ur(1,"Given an invalid JSON: "+e.message);throw e}}const Oa=e=>t=>{const n=e,r=t;if("number"==typeof r){const e=r;return isFinite(e)&&Math.floor(e)===e?-128<=e&&e<=127?new ur(0,(e+128&255)-128):new ur(1,[n,new oi(1,"a sbyte",e,"Value was either too large or too small for a sbyte")]):new ur(1,[n,new oi(1,"a sbyte",e,"Value is not an integral value")])}if("string"==typeof r){let e,t=0;return e=[xe(r,511,!1,8,new H(()=>t,e=>{t=0|e})),t],e[0]?new ur(0,e[1]):new ur(1,[n,new oi(0,"a sbyte",r)])}return new ur(1,[n,new oi(0,"a sbyte",r)])},Ta=e=>t=>{const n=e,r=t;if("number"==typeof r){const e=r;return isFinite(e)&&Math.floor(e)===e?0<=e&&e<=255?new ur(0,255&e):new ur(1,[n,new oi(1,"a byte",e,"Value was either too large or too small for a byte")]):new ur(1,[n,new oi(1,"a byte",e,"Value is not an integral value")])}if("string"==typeof r){let e,t=0;return e=[xe(r,511,!0,8,new H(()=>t,e=>{t=e})),t],e[0]?new ur(0,e[1]):new ur(1,[n,new oi(0,"a byte",r)])}return new ur(1,[n,new oi(0,"a byte",r)])},Ia=e=>t=>{const n="an int16",r=e,o=t;if("number"==typeof o){const e=o;return isFinite(e)&&Math.floor(e)===e?-32768<=e&&e<=32767?new ur(0,(e+32768&65535)-32768):new ur(1,[r,new oi(1,n,e,"Value was either too large or too small for "+n)]):new ur(1,[r,new oi(1,n,e,"Value is not an integral value")])}if("string"==typeof o){let e,t=0;return e=[xe(o,511,!1,16,new H(()=>t,e=>{t=0|e})),t],e[0]?new ur(0,e[1]):new ur(1,[r,new oi(0,n,o)])}return new ur(1,[r,new oi(0,n,o)])},Na=e=>t=>{const n="an uint16",r=e,o=t;if("number"==typeof o){const e=o;return isFinite(e)&&Math.floor(e)===e?0<=e&&e<=65535?new ur(0,65535&e):new ur(1,[r,new oi(1,n,e,"Value was either too large or too small for "+n)]):new ur(1,[r,new oi(1,n,e,"Value is not an integral value")])}if("string"==typeof o){let e,t=0;return e=[xe(o,511,!0,16,new H(()=>t,e=>{t=e})),t],e[0]?new ur(0,e[1]):new ur(1,[r,new oi(0,n,o)])}return new ur(1,[r,new oi(0,n,o)])},_a=e=>t=>{const n=e,r=t;if("number"==typeof r){const e=r;return isFinite(e)&&Math.floor(e)===e?-2147483648<=e&&e<=2147483647?new ur(0,~~e):new ur(1,[n,new oi(1,"an int",e,"Value was either too large or too small for an int")]):new ur(1,[n,new oi(1,"an int",e,"Value is not an integral value")])}if("string"==typeof r){let e,t=0;return e=[xe(r,511,!1,32,new H(()=>t,e=>{t=0|e})),t],e[0]?new ur(0,e[1]):new ur(1,[n,new oi(0,"an int",r)])}return new ur(1,[n,new oi(0,"an int",r)])},Pa=e=>t=>{const n="an uint32",r=e,o=t;if("number"==typeof o){const e=o;return isFinite(e)&&Math.floor(e)===e?0<=e&&e<=4294967295?new ur(0,e>>>0):new ur(1,[r,new oi(1,n,e,"Value was either too large or too small for "+n)]):new ur(1,[r,new oi(1,n,e,"Value is not an integral value")])}if("string"==typeof o){let e,t=0;return e=[xe(o,511,!0,32,new H(()=>t,e=>{t=e})),t],e[0]?new ur(0,e[1]):new ur(1,[r,new oi(0,n,o)])}return new ur(1,[r,new oi(0,n,o)])};function Ma(e,t){if("string"==typeof t){let r,o=Vt(-621355968e5,0);return r=[Gt(t,new H(()=>o,e=>{o=e})),o],r[0]?new ur(0,1===(n=r[1]).kind?n:Vt(n.getTime(),1)):new ur(1,[e,new oi(0,"a datetime",t)])}return new ur(1,[e,new oi(0,"a datetime",t)]);var n}function Da(e,t){if("string"==typeof t){let n,r=ol(-621355968e5,0);return n=[ll(t,new H(()=>r,e=>{r=e})),r],n[0]?new ur(0,n[1]):new ur(1,[e,new oi(0,"a datetimeoffset",t)])}return new ur(1,[e,new oi(0,"a datetime",t)])}function Fa(e,t,n,r){let o;const i=n+".["+p(e)+"]";if(Array.isArray(r)){const n=r;return e<n.length?t(i,n[e]):new ur(1,[i,new oi(5,"a longer array. Need index `"+p(e)+"` but there are only `"+(o=n.length,p(o)+"` entries"),r)])}return new ur(1,[i,new oi(0,"an array",r)])}function La(e,t,n){if(Array.isArray(n)){let r=-1;return sr(e=>Gn(e),xn((n,o)=>{if(r=r+1|0,0===n.tag){const i=e(t+".["+p(r)+"]",o);return 0===i.tag?new ur(0,An(i.fields[0],n.fields[0])):new ur(1,i.fields[0])}return n},new ur(0,jn()),n))}return new ur(1,[t,new oi(0,"a list",n)])}function Ra(e,t,n){if(Array.isArray(n)){let r=-1;const o=n;return xn((n,o)=>{if(r=r+1|0,0===n.tag){const i=n.fields[0],l=e(t+".["+p(r)+"]",o);return 0===l.tag?(i[r]=l.fields[0],new ur(0,i)):new ur(1,l.fields[0])}return n},new ur(0,En(new Array(o.length),0,o.length,null)),o)}return new ur(1,[t,new oi(0,"an array",n)])}function ja(e,t,n){return new ur(0,e)}function Aa(e,t,n,r){const o=t(n,r);return 0===o.tag?e(o.fields[0],n,r):new ur(1,o.fields[0])}function za(e,t,n,r){const o=t(n,r);return 1===o.tag?new ur(1,o.fields[0]):new ur(0,e(o.fields[0]))}function Ua(e,t){let n;const r=e;return n=e=>t=>Fa(0,r,e,t),e=>r=>Aa(N(3,e=>{let n;const r=t;return n=e=>t=>Fa(1,r,e,t),t=>r=>Aa((t,n,r)=>ja([e,t]),N(2,n),t,r)}),N(2,n),e,r)}function Ha(e){return Al(e)}function Ba(e,t,n,r){let o,i;return t.length!==r.length?new ur(1,[n,new oi(6,(o=0|r.length,i=0|t.length,nn(Zt("Expected %i %s but got %i"))(i)(e)(o)))]):In(N(3,M(e=>t=>r=>0===r.tag?sr(e=>An(e,r.fields[0]),t(n,e)):r,[0,[0,2],0])),r,t,new ur(0,jn()))}function Va(e,t,n,r,o,i){const l=(a=e=>ne(e)===r,pe(n).find(a));var a;if(null!=l){const n=l;return 0===i.length?new ur(0,we(n,[])):sr(e=>we(n,Vn(e)),Ba("union fields",kn(n=>Ga(e,t,!1,n[1]),be(n)),o,i))}return new ur(1,[o,new oi(6,"Cannot find case "+r+" in "+re(n))])}function $a(e,t,n,r){const o=new H(null),i=Bl(re(r),o,e);let l;if(ve(r)){const e=kn(e=>[si(t,ne(e)),Ga(i,t,!1,e[1])],he(r));l=t=>n=>sr(e=>function(e,t){const n=he(e);if(n.length!==t.length)throw new Error(`Expected an array of length ${n.length} but got ${t.length}`);return null!=e.construct?new e.construct(...t):n.reduce((e,[n,r],o)=>(e[n]=t[o],e),{})}(r,Vn(e)),function(e,t,n){return null===n||Object.getPrototypeOf(n||!1)!==Object.prototype?new ur(1,[t,new oi(0,"an object",n)]):Tn(N(2,e=>{const r=e[0];return o=>0===o.tag?sr(e=>An(e,o.fields[0]),e[1](t+"."+r)(n[r])):o}),e,new ur(0,jn()))}(e,t,n))}else if(ge(r))l=e=>n=>{if("string"==typeof n)return Va(i,t,r,n,e,[]);if(Array.isArray(n)){const o=n;return Va(i,t,r,o[0],e,o.slice(1,o.length))}return new ur(1,[e,new oi(0,"a string or array",n)])};else{if(!n){let e;const t=re(r);throw e=nn(Zt("Cannot generate auto decoder for %s. Please pass an extra decoder."))(t),new Error(e)}l=e=>t=>new ur(1,[e,new oi(2,"an extra coder for "+re(r),t)])}return o.contents=l,l}function Ga(e,t,n,r){let o;const i=re(r),l=Vl(i,e);if(null==l){if(oe(r)){const n=Ga(e,t,!1,ie(r));return e=>t=>Ra(N(2,n),e,t)}if(ae(r)){const e=re(se(r));if("System.SByte"===e)return e=>t=>{const n=r,o=e,i=t,l=Oa(o)(i);if(1===l.tag)return new ur(1,l.fields[0]);{const e=l.fields[0];return Zr(e,ce(n),{Equals:(e,t)=>e===t,GetHashCode:e=>g(e)})?new ur(0,de(n,e.toString())):new ur(1,[o,new oi(1,re(n),i,"Unkown value provided for the enum")])}};if("System.Byte"===e)return e=>t=>{const n=r,o=e,i=t,l=Ta(o)(i);if(1===l.tag)return new ur(1,l.fields[0]);{const e=l.fields[0];return Zr(e,ce(n),{Equals:(e,t)=>e===t,GetHashCode:e=>g(e)})?new ur(0,de(n,e.toString())):new ur(1,[o,new oi(1,re(n),i,"Unkown value provided for the enum")])}};if("System.Int16"===e)return e=>t=>{const n=r,o=e,i=t,l=Ia(o)(i);if(1===l.tag)return new ur(1,l.fields[0]);{const e=l.fields[0];return Zr(e,ce(n),{Equals:(e,t)=>e===t,GetHashCode:e=>g(e)})?new ur(0,de(n,(a=(a=e)<0&&null!=u&&10!==u?65535+a+1:a).toString(u))):new ur(1,[o,new oi(1,re(n),i,"Unkown value provided for the enum")])}var a,u};if("System.UInt16"===e)return e=>t=>{const n=r,o=e,i=t,l=Na(o)(i);if(1===l.tag)return new ur(1,l.fields[0]);{const e=l.fields[0];return Zr(e,ce(n),{Equals:(e,t)=>e===t,GetHashCode:e=>g(e)})?new ur(0,de(n,e.toString())):new ur(1,[o,new oi(1,re(n),i,"Unkown value provided for the enum")])}};if("System.Int32"===e)return e=>t=>{const n=r,o=e,i=t,l=_a(o)(i);if(1===l.tag)return new ur(1,l.fields[0]);{const e=l.fields[0];return Zr(e,ce(n),{Equals:(e,t)=>e===t,GetHashCode:e=>g(e)})?new ur(0,de(n,p(e))):new ur(1,[o,new oi(1,re(n),i,"Unkown value provided for the enum")])}};if("System.UInt32"===e)return e=>t=>{const n=r,o=e,i=t,l=Pa(o)(i);if(1===l.tag)return new ur(1,l.fields[0]);{const e=l.fields[0];return Zr(e,ce(n),{Equals:(e,t)=>e===t,GetHashCode:e=>g(e)})?new ur(0,de(n,e.toString())):new ur(1,[o,new oi(1,re(n),i,"Unkown value provided for the enum")])}};{const e=re(r),t=rn(Zt("Cannot generate auto decoder for %s.\nThoth.Json.Net only support the folluwing enum types:\n- sbyte\n- byte\n- int16\n- uint16\n- int\n- uint32\nIf you can't use one of these types, please pass an extra decoder.\n "))(e);return e=>{const n=t(e);return e=>n(e)}}}if(le(r)){if(ye(r)){const n=kn(n=>Ga(e,t,!1,n),me(r));return e=>t=>Array.isArray(t)?sr(e=>Vn(e),Ba("tuple elements",n,e,t)):new ur(1,[e,new oi(0,"an array",t)])}{const i=re(ue(r));if("Microsoft.FSharp.Core.FSharpOption`1[System.Object]"===i){const n=Ga(e,t,!0,$(r)[0]);return e=>t=>{return r=N(2,n),o=e,null==(i=t)?new ur(0,void 0):sr(e=>hn(e),r(o,i));var r,o,i}}if("Microsoft.FSharp.Collections.FSharpList`1[System.Object]"===i){const n=Ga(e,t,!1,$(r)[0]);return e=>t=>La(N(2,n),e,t)}if("Microsoft.FSharp.Collections.FSharpMap`2[System.Object,System.Object]"===i){const n=Ga(e,t,!1,$(r)[0]),i=Ga(e,t,!1,$(r)[1]);let l;const a=Qn([e=>t=>function(e,t,n,r){return null===r||Object.getPrototypeOf(r||!1)!==Object.prototype?new ur(1,[n,new oi(0,"an object",r)]):eo((o,i)=>{if(0===o.tag){const l=e(n,i);if(0===l.tag){const e=t(n+"."+i,r[i]);return 0===e.tag?new ur(0,An([l.fields[0],e.fields[0]],o.fields[0])):new ur(1,e.fields[0])}return new ur(1,l.fields[0])}return o},new ur(0,jn()),Object.keys(r))}(N(2,n),N(2,i),e,t),(o=Ua(N(2,n),N(2,i)),e=>t=>La(N(2,o),e,t))]);return l=e=>t=>{return n=e,r=t,((e,t)=>{e:for(;;){const o=e,i=t;if(Un(o))return new ur(1,[n,new oi(7,i)]);{const l=Ca(n,N(2,Hn(o)),r);if(1===l.tag){e=Bn(o),t=Yn(i,zn(l.fields[0]));continue e}return new ur(0,l.fields[0])}}})(a,jn());var n,r},e=>t=>za(e=>Ha(e),N(2,l),e,t)}if("Microsoft.FSharp.Collections.FSharpSet`1[System.Object]"===i){const n=Ga(e,t,!1,$(r)[0]);return e=>t=>{const r=Ra(N(2,n),e,t);return 0===r.tag?new ur(0,Sa(r.fields[0],{Compare:(e,t)=>O(e,t)})):new ur(1,r.fields[0])}}return $a(e,t,n,r)}}return"System.Boolean"===i?e=>t=>{return n=e,"boolean"==typeof(r=t)?new ur(0,r):new ur(1,[n,new oi(0,"a boolean",r)]);var n,r}:"Microsoft.FSharp.Core.Unit"===i?e=>t=>{return n=e,null==(r=t)?new ur(0,void 0):new ur(1,[n,new oi(0,"null",r)]);var n,r}:"System.String"===i?e=>t=>{return n=e,"string"==typeof(r=t)?new ur(0,r):new ur(1,[n,new oi(0,"a string",r)]);var n,r}:"System.SByte"===i?Oa:"System.Byte"===i?Ta:"System.Int16"===i?Ia:"System.UInt16"===i?Na:"System.Int32"===i?_a:"System.UInt32"===i?Pa:"System.Double"===i?e=>t=>{return n=e,"number"==typeof(r=t)?new ur(0,r):new ur(1,[n,new oi(0,"a float",r)]);var n,r}:"System.Single"===i?e=>t=>{return n=e,"number"==typeof(r=t)?new ur(0,r):new ur(1,[n,new oi(0,"a float32",r)]);var n,r}:"System.DateTime"===i?e=>t=>Ma(e,t):"System.DateTimeOffset"===i?e=>t=>Da(e,t):"System.TimeSpan"===i?e=>t=>function(e,t){if("string"==typeof t){let n,r=0;return n=[fl(t,new H(()=>r,e=>{r=e})),r],n[0]?new ur(0,n[1]):new ur(1,[e,new oi(0,"a timespan",t)])}return new ur(1,[e,new oi(0,"a timespan",t)])}(e,t):"System.Guid"===i?e=>t=>function(e,t){if("string"==typeof t){let n,r="00000000-0000-0000-0000-000000000000";return n=[No(t,new H(()=>r,e=>{r=e})),r],n[0]?new ur(0,n[1]):new ur(1,[e,new oi(0,"a guid",t)])}return new ur(1,[e,new oi(0,"a guid",t)])}(e,t):"System.Object"===i?e=>e=>new ur(0,e):$a(e,t,n,r)}{const e=l;return t=>n=>e.contents(t)(n)}}function Wa(e){return null!=e?$l((e,t)=>new H(t[1]),e.Coders):Gl()}function qa(e,t,n){const r=vn(e,new ii(0)),o=mn(n).ResolveType();return Ga(Wa(t),r,!1,o)}function Qa(e,t,n,r){return xa(N(2,qa(t,n,r)),e)}function Ka(e,t){return e<=1?t:t+"s"}class Ya extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["AccessRole"]}}function Xa(e){return er(new Ya(0,"FastTrack.Access"),e,{Equals:(e,t)=>E(e,t),GetHashCode:e=>b(e)})?hn(void 0):void 0}class Ja extends U{constructor(e,t){super(),this.UserName=e,this.Roles=t}}function Za(e){let t,n;const r=fn(null==e?"":e,["."],null,0);if(n=On(0,r,null)||3!==r.length?new ur(1,"Failed to identify the user"):Qa((t=r[1],atob(t)),void 0,void 0,{ResolveType:()=>Q(["name",ee],["roles",J(ee)])}),1===n.tag)return new Ja(void 0,jn());{const e=n.fields[0];return new Ja(e.name,Jn(e=>function(e){return new Ya(0,e)}(e),Qn(e.roles)))}}class eu extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["RequestUpdateApiVersion","NoAction"]}}class tu extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Tab"]}}function nu(e,t){const n=(null!=t?"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300":"border-indigo-500 text-indigo-600")+" whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm";return r=Object(Nr.createElement)("a",I(Kr($r(()=>Jr(Qr(["key",e]),$r(()=>Jr(Qr(["children",e]),$r(()=>Jr(Qr(["className",n]),$r(()=>null!=t?Qr(["href",Bo(zn(mn(t)),1)]):qr())))))))))),new tu(0,r);var r}class ru extends U{constructor(e,t,n,r,o,i){super(),this.AccountName=e,this.ApiVersion=t,this.Email=n,this.PayeeIntegrationFlag=r,this.PayeeType=o,this.PayeeUpdateFlag=i}}class ou extends U{constructor(e,t,n,r){super(),this.Id=e,this.FastTrack=t,this.Flare=n,this.LastSummaryEmailChecked=r}}function iu(){return q("Middleware.FastTrack.AdminUI.Services.BackendDto.Flare.Account",[],ou,()=>[["Id",ee],["FastTrack",q("Middleware.FastTrack.AdminUI.Services.BackendDto.Common.FastTrackDetails",[],ru,()=>[["AccountName",Y(ee)],["ApiVersion",ee],["Email",Y(ee)],["PayeeIntegrationFlag",te],["PayeeType",Y(ee)],["PayeeUpdateFlag",te]])],["Flare",Y(q("Middleware.FastTrack.AdminUI.Services.BackendDto.Flare.FlareDetails",[],lu,()=>[["AccountName",Y(ee)],["RepName",ee],["WebhookSubscriptionId",Y(ee)],["UseDivisionLookup",te]]))],["LastSummaryEmailChecked",Y(ee)]])}class lu extends U{constructor(e,t,n,r){super(),this.AccountName=e,this.RepName=t,this.WebhookSubscriptionId=n,this.UseDivisionLookup=r}}class au extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["HasNotStartedYet","InProgress","Resolved","Failed"]}}class uu extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["ColumnHeader"]}}function su(e){return new uu(0,e)}class cu extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["RowCell"]}}function fu(e){return new cu(0,e)}function du(e){return su(Object(Nr.createElement)("th",I(Qn([["className","px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"],["scope","col"],["children",e]]))))}function pu(e,t){return fu(Object(Nr.createElement)("td",{className:sn(" ",Jr(e,["px-6","py-4","whitespace-nowrap","text-sm"])),children:t}))}function hu(e,t,...n){if(e in t){let r=t[e];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(e=>`"${e}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,hu),r}function mu(...e){return Array.from(new Set(e.flatMap(e=>"string"==typeof e?e.split(" "):[]))).filter(Boolean).join(" ")}var gu,vu,yu=((vu=yu||{})[vu.None=0]="None",vu[vu.RenderStrategy=1]="RenderStrategy",vu[vu.Static=2]="Static",vu),bu=((gu=bu||{})[gu.Unmount=0]="Unmount",gu[gu.Hidden=1]="Hidden",gu);function wu({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:l}){let a=Eu(t,e);if(i)return Su(a,n,r,l);let u=null!=o?o:0;if(2&u){let{static:e=!1,...t}=a;if(e)return Su(t,n,r,l)}if(1&u){let{unmount:e=!0,...t}=a;return hu(e?0:1,{0:()=>null,1:()=>Su({...t,hidden:!0,style:{display:"none"}},n,r,l)})}return Su(a,n,r,l)}function Su(e,t={},n,r){let{as:o=n,children:i,refName:l="ref",...a}=xu(e,["unmount","static"]),u=void 0!==e.ref?{[l]:e.ref}:{},s="function"==typeof i?i(t):i;"className"in a&&a.className&&"function"==typeof a.className&&(a.className=a.className(t));let c={};if(t){let e=!1,n=[];for(let[r,o]of Object.entries(t))"boolean"==typeof o&&(e=!0),!0===o&&n.push(r);e&&(c["data-headlessui-state"]=n.join(" "))}if(o===Nr.Fragment&&Object.keys(Cu(a)).length>0){if(!Object(Nr.isValidElement)(s)||Array.isArray(s)&&s.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(a).map(e=>" - "+e).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(e=>" - "+e).join("\n")].join("\n"));let e=s.props,t="function"==typeof(null==e?void 0:e.className)?(...t)=>mu(null==e?void 0:e.className(...t),a.className):mu(null==e?void 0:e.className,a.className),n=t?{className:t}:{};return Object(Nr.cloneElement)(s,Object.assign({},Eu(s.props,Cu(xu(a,["ref"]))),c,u,function(...e){return{ref:e.every(e=>null==e)?void 0:t=>{for(let n of e)null!=n&&("function"==typeof n?n(t):n.current=t)}}}(s.ref,u.ref),n))}return Object(Nr.createElement)(o,Object.assign({},xu(a,["ref"]),o!==Nr.Fragment&&u,o!==Nr.Fragment&&c),s)}function Eu(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(e=>[e,void 0])));for(let e in n)Object.assign(t,{[e](t,...r){let o=n[e];for(let e of o){if((t instanceof Event||(null==t?void 0:t.nativeEvent)instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function ku(e){var t;return Object.assign(Object(Nr.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function Cu(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function xu(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}function Ou(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}function Tu(){let e=[],t={addEventListener:(e,n,r,o)=>(e.addEventListener(n,r,o),t.add(()=>e.removeEventListener(n,r,o))),requestAnimationFrame(...e){let n=requestAnimationFrame(...e);return t.add(()=>cancelAnimationFrame(n))},nextFrame:(...e)=>t.requestAnimationFrame(()=>t.requestAnimationFrame(...e)),setTimeout(...e){let n=setTimeout(...e);return t.add(()=>clearTimeout(n))},microTask(...e){let n={current:!0};return Ou(()=>{n.current&&e[0]()}),t.add(()=>{n.current=!1})},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add(()=>{Object.assign(e.style,{[t]:r})})},group(e){let t=Tu();return e(t),this.add(()=>t.dispose())},add:t=>(e.push(t),()=>{let n=e.indexOf(t);if(n>=0)for(let t of e.splice(n,1))t()}),dispose(){for(let t of e.splice(0))t()}};return t}function Iu(){let[e]=Object(Nr.useState)(Tu);return Object(Nr.useEffect)(()=>()=>e.dispose(),[e]),e}var Nu=Object.defineProperty,_u=(e,t,n)=>(((e,t,n)=>{t in e?Nu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);let Pu=new class{constructor(){_u(this,"current",this.detect()),_u(this,"handoffState","pending"),_u(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return"undefined"==typeof window||"undefined"==typeof document?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}},Mu=(e,t)=>{Pu.isServer?Object(Nr.useEffect)(e,t):Object(Nr.useLayoutEffect)(e,t)};function Du(e){let t=Object(Nr.useRef)(e);return Mu(()=>{t.current=e},[e]),t}let Fu=function(e){let t=Du(e);return _r.a.useCallback((...e)=>t.current(...e),[t])},Lu=Symbol();function Ru(...e){let t=Object(Nr.useRef)(e);Object(Nr.useEffect)(()=>{t.current=e},[e]);let n=Fu(e=>{for(let n of t.current)null!=n&&("function"==typeof n?n(e):n.current=e)});return e.every(e=>null==e||(null==e?void 0:e[Lu]))?void 0:n}function ju(){let e=function(){let e="undefined"==typeof document;return"useSyncExternalStore"in Nr&&Nr.useSyncExternalStore(()=>()=>{},()=>!1,()=>!e)}(),[t,n]=Nr.useState(Pu.isHandoffComplete);return t&&!1===Pu.isHandoffComplete&&n(!1),Nr.useEffect(()=>{!0!==t&&n(!0)},[t]),Nr.useEffect(()=>Pu.handoff(),[]),!e&&t}var Au;let zu=null!=(Au=_r.a.useId)?Au:function(){let e=ju(),[t,n]=_r.a.useState(e?()=>Pu.nextId():null);return Mu(()=>{null===t&&n(Pu.nextId())},[t]),null!=t?""+t:void 0};var Uu,Hu=((Uu=Hu||{}).Space=" ",Uu.Enter="Enter",Uu.Escape="Escape",Uu.Backspace="Backspace",Uu.Delete="Delete",Uu.ArrowLeft="ArrowLeft",Uu.ArrowUp="ArrowUp",Uu.ArrowRight="ArrowRight",Uu.ArrowDown="ArrowDown",Uu.Home="Home",Uu.End="End",Uu.PageUp="PageUp",Uu.PageDown="PageDown",Uu.Tab="Tab",Uu);var Bu=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Bu||{});function Vu(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=null!=r?r:-1,i=(()=>{switch(e.focus){case 0:return n.findIndex(e=>!t.resolveDisabled(e));case 1:{let e=n.slice().reverse().findIndex((e,n,r)=>!(-1!==o&&r.length-n-1>=o)&&!t.resolveDisabled(e));return-1===e?e:n.length-1-e}case 2:return n.findIndex((e,n)=>!(n<=o)&&!t.resolveDisabled(e));case 3:{let e=n.slice().reverse().findIndex(e=>!t.resolveDisabled(e));return-1===e?e:n.length-1-e}case 4:return n.findIndex(n=>t.resolveId(n)===e.id);case 5:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}})();return-1===i?r:i}function $u(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=""===(null==t?void 0:t.getAttribute("disabled"));return(!r||!function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(n))&&r}function Gu(e){return Pu.isServer?null:e instanceof Node?e.ownerDocument:null!=e&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let Wu=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>e+":not([tabindex='-1'])").join(",");var qu,Qu,Ku,Yu=((Ku=Yu||{})[Ku.First=1]="First",Ku[Ku.Previous=2]="Previous",Ku[Ku.Next=4]="Next",Ku[Ku.Last=8]="Last",Ku[Ku.WrapAround=16]="WrapAround",Ku[Ku.NoScroll=32]="NoScroll",Ku),Xu=((Qu=Xu||{})[Qu.Error=0]="Error",Qu[Qu.Overflow=1]="Overflow",Qu[Qu.Success=2]="Success",Qu[Qu.Underflow=3]="Underflow",Qu),Ju=((qu=Ju||{})[qu.Previous=-1]="Previous",qu[qu.Next=1]="Next",qu);function Zu(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(Wu)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}var es=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(es||{});function ts(e,t=0){var n;return e!==(null==(n=Gu(e))?void 0:n.body)&&hu(t,{0:()=>e.matches(Wu),1(){let t=e;for(;null!==t;){if(t.matches(Wu))return!0;t=t.parentElement}return!1}})}function ns(e){let t=Gu(e);Tu().nextFrame(()=>{t&&!ts(t.activeElement,0)&&os(e)})}var rs=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(rs||{});function os(e){null==e||e.focus({preventScroll:!0})}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{1===e.detail?delete document.documentElement.dataset.headlessuiFocusVisible:0===e.detail&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let is=["textarea","input"].join(",");function ls(e,t=(e=>e)){return e.slice().sort((e,n)=>{let r=t(e),o=t(n);if(null===r||null===o)return 0;let i=r.compareDocumentPosition(o);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function as(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,l=Array.isArray(e)?n?ls(e):e:Zu(e);o.length>0&&l.length>1&&(l=l.filter(e=>!o.includes(e))),r=null!=r?r:i.activeElement;let a,u=(()=>{if(5&t)return 1;if(10&t)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),s=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,l.indexOf(r))-1;if(4&t)return Math.max(0,l.indexOf(r))+1;if(8&t)return l.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=32&t?{preventScroll:!0}:{},f=0,d=l.length;do{if(f>=d||f+d<=0)return 0;let e=s+f;if(16&t)e=(e+d)%d;else{if(e<0)return 3;if(e>=d)return 1}a=l[e],null==a||a.focus(c),f+=u}while(a!==i.activeElement);return 6&t&&function(e){var t,n;return null!=(n=null==(t=null==e?void 0:e.matches)?void 0:t.call(e,is))&&n}(a)&&a.select(),2}function us(e,t,n){let r=Du(t);Object(Nr.useEffect)(()=>{function t(e){r.current(e)}return document.addEventListener(e,t,n),()=>document.removeEventListener(e,t,n)},[e,n])}function ss(e,t,n){let r=Du(t);Object(Nr.useEffect)(()=>{function t(e){r.current(e)}return window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)},[e,n])}function cs(e,t,n=!0){let r=Object(Nr.useRef)(!1);function o(n,o){if(!r.current||n.defaultPrevented)return;let i=o(n);if(null===i||!i.getRootNode().contains(i)||!i.isConnected)return;let l=function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(e);for(let e of l){if(null===e)continue;let t=e instanceof HTMLElement?e:e.current;if(null!=t&&t.contains(i)||n.composed&&n.composedPath().includes(t))return}return!ts(i,es.Loose)&&-1!==i.tabIndex&&n.preventDefault(),t(n,i)}Object(Nr.useEffect)(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);let i=Object(Nr.useRef)(null);us("pointerdown",e=>{var t,n;r.current&&(i.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)},!0),us("mousedown",e=>{var t,n;r.current&&(i.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)},!0),us("click",e=>{i.current&&(o(e,()=>i.current),i.current=null)},!0),us("touchend",e=>o(e,()=>e.target instanceof HTMLElement?e.target:null),!0),ss("blur",e=>o(e,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}let fs=Object(Nr.createContext)(null);fs.displayName="OpenClosedContext";var ds=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(ds||{});function ps(){return Object(Nr.useContext)(fs)}function hs({value:e,children:t}){return _r.a.createElement(fs.Provider,{value:e},t)}function ms(e){var t;if(e.type)return e.type;let n=null!=(t=e.as)?t:"button";return"string"==typeof n&&"button"===n.toLowerCase()?"button":void 0}function gs(e,t){let[n,r]=Object(Nr.useState)(()=>ms(e));return Mu(()=>{r(ms(e))},[e.type,e.as]),Mu(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}function vs(...e){return Object(Nr.useMemo)(()=>Gu(...e),[...e])}function ys(e){return[e.screenX,e.screenY]}let bs=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function ws(e){var t,n;let r=null!=(t=e.innerText)?t:"",o=e.cloneNode(!0);if(!(o instanceof HTMLElement))return r;let i=!1;for(let e of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))e.remove(),i=!0;let l=i?null!=(n=o.innerText)?n:"":r;return bs.test(l)&&(l=l.replace(bs,"")),l}function Ss(e){let t=Object(Nr.useRef)(""),n=Object(Nr.useRef)("");return Fu(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let i=function(e){let t=e.getAttribute("aria-label");if("string"==typeof t)return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let e=n.split(" ").map(e=>{let t=document.getElementById(e);if(t){let e=t.getAttribute("aria-label");return"string"==typeof e?e.trim():ws(t).trim()}return null}).filter(Boolean);if(e.length>0)return e.join(", ")}return ws(e).trim()}(r).trim().toLowerCase();return t.current=o,n.current=i,i})}var Es=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Es||{}),ks=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(ks||{}),Cs=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e))(Cs||{});function xs(e,t=(e=>e)){let n=null!==e.activeItemIndex?e.items[e.activeItemIndex]:null,r=ls(t(e.items.slice()),e=>e.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return-1===o&&(o=null),{items:r,activeItemIndex:o}}let Os={1:e=>1===e.menuState?e:{...e,activeItemIndex:null,menuState:1},0:e=>0===e.menuState?e:{...e,__demoMode:!1,menuState:0},2:(e,t)=>{var n;let r=xs(e),o=Vu(t,{resolveItems:()=>r.items,resolveActiveIndex:()=>r.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeItemIndex:o,activationTrigger:null!=(n=t.trigger)?n:1}},3:(e,t)=>{let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),o=(null!==e.activeItemIndex?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find(e=>{var t;return(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))&&!e.dataRef.current.disabled}),i=o?e.items.indexOf(o):-1;return-1===i||i===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:i,activationTrigger:1}},4:e=>""===e.searchQuery?e:{...e,searchQuery:"",searchActiveItemIndex:null},5:(e,t)=>{let n=xs(e,e=>[...e,{id:t.id,dataRef:t.dataRef}]);return{...e,...n}},6:(e,t)=>{let n=xs(e,e=>{let n=e.findIndex(e=>e.id===t.id);return-1!==n&&e.splice(n,1),e});return{...e,...n,activationTrigger:1}}},Ts=Object(Nr.createContext)(null);function Is(e){let t=Object(Nr.useContext)(Ts);if(null===t){let t=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Is),t}return t}function Ns(e,t){return hu(t.type,Os,e,t)}Ts.displayName="MenuContext";let _s=Nr.Fragment;let Ps=yu.RenderStrategy|yu.Static;let Ms=Nr.Fragment;let Ds=ku((function(e,t){let{__demoMode:n=!1,...r}=e,o=Object(Nr.useReducer)(Ns,{__demoMode:n,menuState:n?0:1,buttonRef:Object(Nr.createRef)(),itemsRef:Object(Nr.createRef)(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:i,itemsRef:l,buttonRef:a},u]=o,s=Ru(t);cs([a,l],(e,t)=>{var n;u({type:1}),ts(t,es.Loose)||(e.preventDefault(),null==(n=a.current)||n.focus())},0===i);let c=Fu(()=>{u({type:1})}),f=Object(Nr.useMemo)(()=>({open:0===i,close:c}),[i,c]),d={ref:s};return _r.a.createElement(Ts.Provider,{value:o},_r.a.createElement(hs,{value:hu(i,{0:ds.Open,1:ds.Closed})},wu({ourProps:d,theirProps:r,slot:f,defaultTag:_s,name:"Menu"})))})),Fs=ku((function(e,t){var n;let r=zu(),{id:o="headlessui-menu-button-"+r,...i}=e,[l,a]=Is("Menu.Button"),u=Ru(l.buttonRef,t),s=Iu(),c=Fu(e=>{switch(e.key){case Hu.Space:case Hu.Enter:case Hu.ArrowDown:e.preventDefault(),e.stopPropagation(),a({type:0}),s.nextFrame(()=>a({type:2,focus:Bu.First}));break;case Hu.ArrowUp:e.preventDefault(),e.stopPropagation(),a({type:0}),s.nextFrame(()=>a({type:2,focus:Bu.Last}))}}),f=Fu(e=>{switch(e.key){case Hu.Space:e.preventDefault()}}),d=Fu(t=>{if($u(t.currentTarget))return t.preventDefault();e.disabled||(0===l.menuState?(a({type:1}),s.nextFrame(()=>{var e;return null==(e=l.buttonRef.current)?void 0:e.focus({preventScroll:!0})})):(t.preventDefault(),a({type:0})))}),p=Object(Nr.useMemo)(()=>({open:0===l.menuState}),[l]);return wu({ourProps:{ref:u,id:o,type:gs(e,l.buttonRef),"aria-haspopup":"menu","aria-controls":null==(n=l.itemsRef.current)?void 0:n.id,"aria-expanded":0===l.menuState,onKeyDown:c,onKeyUp:f,onClick:d},theirProps:i,slot:p,defaultTag:"button",name:"Menu.Button"})})),Ls=ku((function(e,t){var n,r;let o=zu(),{id:i="headlessui-menu-items-"+o,...l}=e,[a,u]=Is("Menu.Items"),s=Ru(a.itemsRef,t),c=vs(a.itemsRef),f=Iu(),d=ps(),p=null!==d?(d&ds.Open)===ds.Open:0===a.menuState;Object(Nr.useEffect)(()=>{let e=a.itemsRef.current;e&&0===a.menuState&&e!==(null==c?void 0:c.activeElement)&&e.focus({preventScroll:!0})},[a.menuState,a.itemsRef,c]),function({container:e,accept:t,walk:n,enabled:r=!0}){let o=Object(Nr.useRef)(t),i=Object(Nr.useRef)(n);Object(Nr.useEffect)(()=>{o.current=t,i.current=n},[t,n]),Mu(()=>{if(!e||!r)return;let t=Gu(e);if(!t)return;let n=o.current,l=i.current,a=Object.assign(e=>n(e),{acceptNode:n}),u=t.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,a,!1);for(;u.nextNode();)l(u.currentNode)},[e,r,o,i])}({container:a.itemsRef.current,enabled:0===a.menuState,accept:e=>"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let h=Fu(e=>{var t,n;switch(f.dispose(),e.key){case Hu.Space:if(""!==a.searchQuery)return e.preventDefault(),e.stopPropagation(),u({type:3,value:e.key});case Hu.Enter:if(e.preventDefault(),e.stopPropagation(),u({type:1}),null!==a.activeItemIndex){let{dataRef:e}=a.items[a.activeItemIndex];null==(n=null==(t=e.current)?void 0:t.domRef.current)||n.click()}ns(a.buttonRef.current);break;case Hu.ArrowDown:return e.preventDefault(),e.stopPropagation(),u({type:2,focus:Bu.Next});case Hu.ArrowUp:return e.preventDefault(),e.stopPropagation(),u({type:2,focus:Bu.Previous});case Hu.Home:case Hu.PageUp:return e.preventDefault(),e.stopPropagation(),u({type:2,focus:Bu.First});case Hu.End:case Hu.PageDown:return e.preventDefault(),e.stopPropagation(),u({type:2,focus:Bu.Last});case Hu.Escape:e.preventDefault(),e.stopPropagation(),u({type:1}),Tu().nextFrame(()=>{var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})});break;case Hu.Tab:e.preventDefault(),e.stopPropagation(),u({type:1}),Tu().nextFrame(()=>{!function(e,t){as(Zu(),t,{relativeTo:e})}(a.buttonRef.current,e.shiftKey?Yu.Previous:Yu.Next)});break;default:1===e.key.length&&(u({type:3,value:e.key}),f.setTimeout(()=>u({type:4}),350))}}),m=Fu(e=>{switch(e.key){case Hu.Space:e.preventDefault()}}),g=Object(Nr.useMemo)(()=>({open:0===a.menuState}),[a]);return wu({ourProps:{"aria-activedescendant":null===a.activeItemIndex||null==(n=a.items[a.activeItemIndex])?void 0:n.id,"aria-labelledby":null==(r=a.buttonRef.current)?void 0:r.id,id:i,onKeyDown:h,onKeyUp:m,role:"menu",tabIndex:0,ref:s},theirProps:l,slot:g,defaultTag:"div",features:Ps,visible:p,name:"Menu.Items"})})),Rs=ku((function(e,t){let n=zu(),{id:r="headlessui-menu-item-"+n,disabled:o=!1,...i}=e,[l,a]=Is("Menu.Item"),u=null!==l.activeItemIndex&&l.items[l.activeItemIndex].id===r,s=Object(Nr.useRef)(null),c=Ru(t,s);Mu(()=>{if(l.__demoMode||0!==l.menuState||!u||0===l.activationTrigger)return;let e=Tu();return e.requestAnimationFrame(()=>{var e,t;null==(t=null==(e=s.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})}),e.dispose},[l.__demoMode,s,u,l.menuState,l.activationTrigger,l.activeItemIndex]);let f=Ss(s),d=Object(Nr.useRef)({disabled:o,domRef:s,get textValue(){return f()}});Mu(()=>{d.current.disabled=o},[d,o]),Mu(()=>(a({type:5,id:r,dataRef:d}),()=>a({type:6,id:r})),[d,r]);let p=Fu(()=>{a({type:1})}),h=Fu(e=>{if(o)return e.preventDefault();a({type:1}),ns(l.buttonRef.current)}),m=Fu(()=>{if(o)return a({type:2,focus:Bu.Nothing});a({type:2,focus:Bu.Specific,id:r})}),g=function(){let e=Object(Nr.useRef)([-1,-1]);return{wasMoved(t){let n=ys(t);return(e.current[0]!==n[0]||e.current[1]!==n[1])&&(e.current=n,!0)},update(t){e.current=ys(t)}}}(),v=Fu(e=>g.update(e)),y=Fu(e=>{g.wasMoved(e)&&(o||u||a({type:2,focus:Bu.Specific,id:r,trigger:0}))}),b=Fu(e=>{g.wasMoved(e)&&(o||u&&a({type:2,focus:Bu.Nothing}))}),w=Object(Nr.useMemo)(()=>({active:u,disabled:o,close:p}),[u,o,p]);return wu({ourProps:{id:r,ref:c,role:"menuitem",tabIndex:!0===o?void 0:-1,"aria-disabled":!0===o||void 0,disabled:void 0,onClick:h,onFocus:m,onPointerEnter:v,onMouseEnter:v,onPointerMove:y,onMouseMove:y,onPointerLeave:b,onMouseLeave:b},theirProps:i,slot:w,defaultTag:Ms,name:"Menu.Item"})})),js=Object.assign(Ds,{Button:Fs,Items:Ls,Item:Rs});class As extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["As","ClassName","Children"]}}class zs extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["As","Key","ClassName","Children"]}}function Us(e){return Nr.createElement(js.Button,ri(e,1))}class Hs extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Key","ClassName","Children"]}}function Bs(e){return Nr.createElement(js.Items,ri(e,1))}class Vs extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["As","Key","ClassName","Children"]}}function $s(){let e=Object(Nr.useRef)(!1);return Mu(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Gs(e,...t){e&&t.length>0&&e.classList.add(...t)}function Ws(e,...t){e&&t.length>0&&e.classList.remove(...t)}function qs(e,t,n,r){let o=n?"enter":"leave",i=Tu(),l=void 0!==r?function(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}(r):()=>{};"enter"===o&&(e.removeAttribute("hidden"),e.style.display="");let a=hu(o,{enter:()=>t.enter,leave:()=>t.leave}),u=hu(o,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),s=hu(o,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return Ws(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Gs(e,...t.base,...a,...s),i.nextFrame(()=>{Ws(e,...t.base,...a,...s),Gs(e,...t.base,...a,...u),function(e,t){let n=Tu();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:o}=getComputedStyle(e),[i,l]=[r,o].map(e=>{let[t=0]=e.split(",").filter(Boolean).map(e=>e.includes("ms")?parseFloat(e):1e3*parseFloat(e)).sort((e,t)=>t-e);return t}),a=i+l;if(0!==a){n.group(n=>{n.setTimeout(()=>{t(),n.dispose()},a),n.addEventListener(e,"transitionrun",e=>{e.target===e.currentTarget&&n.dispose()})});let r=n.addEventListener(e,"transitionend",e=>{e.target===e.currentTarget&&(t(),r())})}else t();n.add(()=>t()),n.dispose}(e,()=>(Ws(e,...t.base,...a),Gs(e,...t.base,...t.entered),l()))}),i.dispose}function Qs(e=""){return e.split(" ").filter(e=>e.trim().length>1)}let Ks=Object(Nr.createContext)(null);Ks.displayName="TransitionContext";var Ys=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Ys||{});let Xs=Object(Nr.createContext)(null);function Js(e){return"children"in e?Js(e.children):e.current.filter(({el:e})=>null!==e.current).filter(({state:e})=>"visible"===e).length>0}function Zs(e,t){let n=Du(e),r=Object(Nr.useRef)([]),o=$s(),i=Iu(),l=Fu((e,t=bu.Hidden)=>{let l=r.current.findIndex(({el:t})=>t===e);-1!==l&&(hu(t,{[bu.Unmount](){r.current.splice(l,1)},[bu.Hidden](){r.current[l].state="hidden"}}),i.microTask(()=>{var e;!Js(r)&&o.current&&(null==(e=n.current)||e.call(n))}))}),a=Fu(e=>{let t=r.current.find(({el:t})=>t===e);return t?"visible"!==t.state&&(t.state="visible"):r.current.push({el:e,state:"visible"}),()=>l(e,bu.Unmount)}),u=Object(Nr.useRef)([]),s=Object(Nr.useRef)(Promise.resolve()),c=Object(Nr.useRef)({enter:[],leave:[],idle:[]}),f=Fu((e,n,r)=>{u.current.splice(0),t&&(t.chains.current[n]=t.chains.current[n].filter(([t])=>t!==e)),null==t||t.chains.current[n].push([e,new Promise(e=>{u.current.push(e)})]),null==t||t.chains.current[n].push([e,new Promise(e=>{Promise.all(c.current[n].map(([e,t])=>t)).then(()=>e())})]),"enter"===n?s.current=s.current.then(()=>null==t?void 0:t.wait.current).then(()=>r(n)):r(n)}),d=Fu((e,t,n)=>{Promise.all(c.current[t].splice(0).map(([e,t])=>t)).then(()=>{var e;null==(e=u.current.shift())||e()}).then(()=>n(t))});return Object(Nr.useMemo)(()=>({children:r,register:a,unregister:l,onStart:f,onStop:d,wait:s,chains:c}),[a,l,r,f,d,c,s])}function ec(){}Xs.displayName="NestingContext";let tc=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function nc(e){var t;let n={};for(let r of tc)n[r]=null!=(t=e[r])?t:ec;return n}let rc=yu.RenderStrategy;let oc=ku((function(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,l=Object(Nr.useRef)(null),a=Ru(l,t);ju();let u=ps();if(void 0===n&&null!==u&&(n=(u&ds.Open)===ds.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[s,c]=Object(Nr.useState)(n?"visible":"hidden"),f=Zs(()=>{c("hidden")}),[d,p]=Object(Nr.useState)(!0),h=Object(Nr.useRef)([n]);Mu(()=>{!1!==d&&h.current[h.current.length-1]!==n&&(h.current.push(n),p(!1))},[h,n]);let m=Object(Nr.useMemo)(()=>({show:n,appear:r,initial:d}),[n,r,d]);Object(Nr.useEffect)(()=>{if(n)c("visible");else if(Js(f)){let e=l.current;if(!e)return;let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&c("hidden")}else c("hidden")},[n,f]);let g={unmount:o},v=Fu(()=>{var t;d&&p(!1),null==(t=e.beforeEnter)||t.call(e)}),y=Fu(()=>{var t;d&&p(!1),null==(t=e.beforeLeave)||t.call(e)});return _r.a.createElement(Xs.Provider,{value:f},_r.a.createElement(Ks.Provider,{value:m},wu({ourProps:{...g,as:Nr.Fragment,children:_r.a.createElement(ic,{ref:a,...g,...i,beforeEnter:v,beforeLeave:y})},theirProps:{},defaultTag:Nr.Fragment,features:rc,visible:"visible"===s,name:"Transition"})))})),ic=ku((function(e,t){var n,r;let{beforeEnter:o,afterEnter:i,beforeLeave:l,afterLeave:a,enter:u,enterFrom:s,enterTo:c,entered:f,leave:d,leaveFrom:p,leaveTo:h,...m}=e,g=Object(Nr.useRef)(null),v=Ru(g,t),y=null==(n=m.unmount)||n?bu.Unmount:bu.Hidden,{show:b,appear:w,initial:S}=function(){let e=Object(Nr.useContext)(Ks);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),[E,k]=Object(Nr.useState)(b?"visible":"hidden"),C=function(){let e=Object(Nr.useContext)(Xs);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),{register:x,unregister:O}=C;Object(Nr.useEffect)(()=>x(g),[x,g]),Object(Nr.useEffect)(()=>{if(y===bu.Hidden&&g.current)return b&&"visible"!==E?void k("visible"):hu(E,{hidden:()=>O(g),visible:()=>x(g)})},[E,g,x,O,b,y]);let T=Du({base:Qs(m.className),enter:Qs(u),enterFrom:Qs(s),enterTo:Qs(c),entered:Qs(f),leave:Qs(d),leaveFrom:Qs(p),leaveTo:Qs(h)}),I=function(e){let t=Object(Nr.useRef)(nc(e));return Object(Nr.useEffect)(()=>{t.current=nc(e)},[e]),t}({beforeEnter:o,afterEnter:i,beforeLeave:l,afterLeave:a}),N=ju();Object(Nr.useEffect)(()=>{if(N&&"visible"===E&&null===g.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[g,E,N]);let _=w&&b&&S,P=!N||S&&!w?"idle":b?"enter":"leave",M=function(e=0){let[t,n]=Object(Nr.useState)(e),r=$s(),o=Object(Nr.useCallback)(e=>{r.current&&n(t=>t|e)},[t,r]),i=Object(Nr.useCallback)(e=>Boolean(t&e),[t]),l=Object(Nr.useCallback)(e=>{r.current&&n(t=>t&~e)},[n,r]),a=Object(Nr.useCallback)(e=>{r.current&&n(t=>t^e)},[n]);return{flags:t,addFlag:o,hasFlag:i,removeFlag:l,toggleFlag:a}}(0),D=Fu(e=>hu(e,{enter:()=>{M.addFlag(ds.Opening),I.current.beforeEnter()},leave:()=>{M.addFlag(ds.Closing),I.current.beforeLeave()},idle:()=>{}})),F=Fu(e=>hu(e,{enter:()=>{M.removeFlag(ds.Opening),I.current.afterEnter()},leave:()=>{M.removeFlag(ds.Closing),I.current.afterLeave()},idle:()=>{}})),L=Zs(()=>{k("hidden"),O(g)},C);!function({immediate:e,container:t,direction:n,classes:r,onStart:o,onStop:i}){let l=$s(),a=Iu(),u=Du(n);Mu(()=>{e&&(u.current="enter")},[e]),Mu(()=>{let e=Tu();a.add(e.dispose);let n=t.current;if(n&&"idle"!==u.current&&l.current)return e.dispose(),o.current(u.current),e.add(qs(n,r.current,"enter"===u.current,()=>{e.dispose(),i.current(u.current)})),e.dispose},[n])}({immediate:_,container:g,classes:T,direction:P,onStart:Du(e=>{L.onStart(g,e,D)}),onStop:Du(e=>{L.onStop(g,e,F),"leave"===e&&!Js(L)&&(k("hidden"),O(g))})});let R=m,j={ref:v};return _?R={...R,className:mu(m.className,...T.current.enter,...T.current.enterFrom)}:(R.className=mu(m.className,null==(r=g.current)?void 0:r.className),""===R.className&&delete R.className),_r.a.createElement(Xs.Provider,{value:L},_r.a.createElement(hs,{value:hu(E,{visible:ds.Open,hidden:ds.Closed})|M.flags},wu({ourProps:j,theirProps:R,defaultTag:"div",features:rc,visible:"visible"===E,name:"Transition.Child"})))})),lc=ku((function(e,t){let n=null!==Object(Nr.useContext)(Ks),r=null!==ps();return _r.a.createElement(_r.a.Fragment,null,!n&&r?_r.a.createElement(oc,{ref:t,...e}):_r.a.createElement(ic,{ref:t,...e}))})),ac=Object.assign(oc,{Child:lc,Root:oc});class uc extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Key","Appear","Show","ClassName","Enter","EnterFrom","EnterTo","Leave","LeaveFrom","LeaveTo","Children"]}}function sc(e){return Nr.createElement(ac,ri(e,1))}class cc extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Key","As","Show","Children"]}}class fc extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Key","Appear","Show","ClassName","Enter","EnterFrom","EnterTo","Leave","LeaveFrom","LeaveTo","Children"]}}function dc(e){return Nr.createElement(ac.Child,ri(e,1))}class pc extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Top","Left","Bottom"]}}class hc extends U{constructor(e,t,n){super(),this.Text=e,this.HasBorderOnTop=t,this.OnClick=n}}function mc(e){const t=Xn((e,t)=>function(e,t){const n=0===e?"flex items-center px-4 py-2 cursor-pointer":"flex items-center px-4 py-2 cursor-pointer justify-between";return Object(Nr.createElement)("div",{key:nn(en("%P()",[e+1])),onClick:e=>{t.OnClick()},className:0===e?"py-1 text-sm":"py-1",children:lo.Children.toArray([(r=Qn([new Vs(1,nn(en("menuItem%P()",[e+1]))),new Vs(0,"div"),new Vs(3,r=>[Object(Nr.createElement)("div",{key:"1",className:sn(" ",Kr($r(()=>Jr(Qr(n),$r(()=>Jr(e>0&&t.HasBorderOnTop?Qr("border-t border-gray-200"):qr(),$r(()=>r.active?Qr("bg-blue-100 text-primary-600"):Qr("text-gray-700")))))))),children:lo.Children.toArray([Object(Nr.createElement)("a",{className:0===e?"text-sm font-medium flex-auto":"text-sm font-medium",children:t.Text})])})])]),Nr.createElement(js.Item,ri(r,1)))])});var r}(e,t),e.MenuItems);return function(e){return Nr.createElement(js,ri(e,1))}(Qn([new As(0,"div"),new As(1,"relative inline-block text-left"),new As(2,[Us(Qn([new zs(1,"1"),new zs(0,"div"),new zs(3,t=>[Object(Nr.createElement)("div",{key:"1",children:lo.Children.toArray([e.Button(t.open)])})])])),sc(Qn([new uc(0,"2"),new uc(4,"transition ease-out duration-100"),new uc(5,"opacity-0"),new uc(6,"opacity-100"),new uc(7,"transition ease-in duration-75"),new uc(8,"transform opacity-100 scale-100"),new uc(9,"transform opacity-0 scale-95"),new uc(10,[Bs(Kr($r(()=>{let n;switch(e.Position.tag){case 2:n="right-0";break;case 1:n="right-12 -top-2";break;default:n="right-0 bottom-11"}return Jr(Qr(new Hs(0,"1")),$r(()=>Jr(Qr(new Hs(1,nn(en("absolute %P() z-10 mt-2 min-w-[240px] origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",[n])))),$r(()=>Qr(new Hs(2,t))))))})))])]))])]))}const gc=Object(Nr.createElement)("svg",{width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:lo.Children.toArray([Object(Nr.createElement)("path",I(Qn([["d","M4.29289 4.29289C4.68342 3.90237 5.31658 3.90237 5.70711 4.29289L10 8.58579L14.2929 4.29289C14.6834 3.90237 15.3166 3.90237 15.7071 4.29289C16.0976 4.68342 16.0976 5.31658 15.7071 5.70711L11.4142 10L15.7071 14.2929C16.0976 14.6834 16.0976 15.3166 15.7071 15.7071C15.3166 16.0976 14.6834 16.0976 14.2929 15.7071L10 11.4142L5.70711 15.7071C5.31658 16.0976 4.68342 16.0976 4.29289 15.7071C3.90237 15.3166 3.90237 14.6834 4.29289 14.2929L8.58579 10L4.29289 5.70711C3.90237 5.31658 3.90237 4.68342 4.29289 4.29289Z"],["fill","#9CA3AF"],(vc="evenodd",["fillRule",vc]),function(e){return["clipRule",e]}("evenodd")])))])});var vc;const yc=Object(Nr.createElement)("svg",{width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:lo.Children.toArray([Object(Nr.createElement)("path",{d:"M10 12C11.1046 12 12 11.1046 12 10C12 8.89543 11.1046 8 10 8C8.89543 8 8 8.89543 8 10C8 11.1046 8.89543 12 10 12Z",fill:"#9CA3AF"}),Object(Nr.createElement)("path",{d:"M4 12C5.10457 12 6 11.1046 6 10C6 8.89543 5.10457 8 4 8C2.89543 8 2 8.89543 2 10C2 11.1046 2.89543 12 4 12Z",fill:"#9CA3AF"}),Object(Nr.createElement)("path",{d:"M16 12C17.1046 12 18 11.1046 18 10C18 8.89543 17.1046 8 16 8C14.8954 8 14 8.89543 14 10C14 11.1046 14.8954 12 16 12Z",fill:"#9CA3AF"})])});var bc=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(bc||{});let wc=ku((function(e,t){let{features:n=1,...r}=e;return wu({ourProps:{ref:t,"aria-hidden":2==(2&n)||void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...4==(4&n)&&2!=(2&n)&&{display:"none"}}},theirProps:r,slot:{},defaultTag:"div",name:"Hidden"})}));var Sc=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Sc||{});function Ec(e,t,n,r){let o=Du(n);Object(Nr.useEffect)(()=>{function n(e){o.current(e)}return(e=null!=e?e:window).addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)},[e,t,r])}function kc(e,t){let n=Object(Nr.useRef)([]),r=Fu(e);Object(Nr.useEffect)(()=>{let e=[...n.current];for(let[o,i]of t.entries())if(n.current[o]!==i){let o=r(t,e);return n.current=t,o}},[r,...t])}function Cc(e){let t=Fu(e),n=Object(Nr.useRef)(!1);Object(Nr.useEffect)(()=>(n.current=!1,()=>{n.current=!0,Ou(()=>{n.current&&t()})}),[t])}function xc(e){if(!e)return new Set;if("function"==typeof e)return new Set(e());let t=new Set;for(let n of e.current)n.current instanceof HTMLElement&&t.add(n.current);return t}var Oc=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(Oc||{});let Tc=ku((function(e,t){let n=Object(Nr.useRef)(null),r=Ru(n,t),{initialFocus:o,containers:i,features:l=30,...a}=e;ju()||(l=1);let u=vs(n);!function({ownerDocument:e},t){let n=function(e=!0){let t=Object(Nr.useRef)(Nc.slice());return kc(([e],[n])=>{!0===n&&!1===e&&Ou(()=>{t.current.splice(0)}),!1===n&&!0===e&&(t.current=Nc.slice())},[e,Nc,t]),Fu(()=>{var e;return null!=(e=t.current.find(e=>null!=e&&e.isConnected))?e:null})}(t);kc(()=>{t||(null==e?void 0:e.activeElement)===(null==e?void 0:e.body)&&os(n())},[t]),Cc(()=>{t&&os(n())})}({ownerDocument:u},Boolean(16&l));let s=function({ownerDocument:e,container:t,initialFocus:n},r){let o=Object(Nr.useRef)(null),i=$s();return kc(()=>{if(!r)return;let l=t.current;l&&Ou(()=>{if(!i.current)return;let t=null==e?void 0:e.activeElement;if(null!=n&&n.current){if((null==n?void 0:n.current)===t)return void(o.current=t)}else if(l.contains(t))return void(o.current=t);null!=n&&n.current?os(n.current):as(l,Yu.First)===Xu.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),o.current=null==e?void 0:e.activeElement})},[r]),o}({ownerDocument:u,container:n,initialFocus:o},Boolean(2&l));!function({ownerDocument:e,container:t,containers:n,previousActiveElement:r},o){let i=$s();Ec(null==e?void 0:e.defaultView,"focus",e=>{if(!o||!i.current)return;let l=xc(n);t.current instanceof HTMLElement&&l.add(t.current);let a=r.current;if(!a)return;let u=e.target;u&&u instanceof HTMLElement?_c(l,u)?(r.current=u,os(u)):(e.preventDefault(),e.stopPropagation(),os(a)):os(r.current)},!0)}({ownerDocument:u,container:n,containers:i,previousActiveElement:s},Boolean(8&l));let c=function(){let e=Object(Nr.useRef)(0);return ss("keydown",t=>{"Tab"===t.key&&(e.current=t.shiftKey?1:0)},!0),e}(),f=Fu(e=>{let t=n.current;t&&hu(c.current,{[Sc.Forwards]:()=>{as(t,Yu.First,{skipElements:[e.relatedTarget]})},[Sc.Backwards]:()=>{as(t,Yu.Last,{skipElements:[e.relatedTarget]})}})}),d=Iu(),p=Object(Nr.useRef)(!1),h={ref:r,onKeyDown(e){"Tab"==e.key&&(p.current=!0,d.requestAnimationFrame(()=>{p.current=!1}))},onBlur(e){let t=xc(i);n.current instanceof HTMLElement&&t.add(n.current);let r=e.relatedTarget;r instanceof HTMLElement&&"true"!==r.dataset.headlessuiFocusGuard&&(_c(t,r)||(p.current?as(n.current,hu(c.current,{[Sc.Forwards]:()=>Yu.Next,[Sc.Backwards]:()=>Yu.Previous})|Yu.WrapAround,{relativeTo:e.target}):e.target instanceof HTMLElement&&os(e.target)))}};return _r.a.createElement(_r.a.Fragment,null,Boolean(4&l)&&_r.a.createElement(wc,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:f,features:bc.Focusable}),wu({ourProps:h,theirProps:a,defaultTag:"div",name:"FocusTrap"}),Boolean(4&l)&&_r.a.createElement(wc,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:f,features:bc.Focusable}))})),Ic=Object.assign(Tc,{features:Oc}),Nc=[];function _c(e,t){for(let n of e)if(n.contains(t))return!0;return!1}!function(e){function t(){"loading"!==document.readyState&&(e(),document.removeEventListener("DOMContentLoaded",t))}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("DOMContentLoaded",t),t())}(()=>{function e(e){e.target instanceof HTMLElement&&e.target!==document.body&&Nc[0]!==e.target&&(Nc.unshift(e.target),Nc=Nc.filter(e=>null!=e&&e.isConnected),Nc.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});var Pc=n(2);let Mc=Object(Nr.createContext)(!1);function Dc(e){return _r.a.createElement(Mc.Provider,{value:e.force},e.children)}function Fc(e){let t=Object(Nr.useContext)(Mc),n=Object(Nr.useContext)(jc),r=vs(e),[o,i]=Object(Nr.useState)(()=>{if(!t&&null!==n||Pu.isServer)return null;let e=null==r?void 0:r.getElementById("headlessui-portal-root");if(e)return e;if(null===r)return null;let o=r.createElement("div");return o.setAttribute("id","headlessui-portal-root"),r.body.appendChild(o)});return Object(Nr.useEffect)(()=>{null!==o&&(null!=r&&r.body.contains(o)||null==r||r.body.appendChild(o))},[o,r]),Object(Nr.useEffect)(()=>{t||null!==n&&i(n.current)},[n,i,t]),o}let Lc=Nr.Fragment;let Rc=Nr.Fragment,jc=Object(Nr.createContext)(null);let Ac=Object(Nr.createContext)(null);let zc=ku((function(e,t){let n=e,r=Object(Nr.useRef)(null),o=Ru(function(e,t=!0){return Object.assign(e,{[Lu]:t})}(e=>{r.current=e}),t),i=vs(r),l=Fc(r),[a]=Object(Nr.useState)(()=>{var e;return Pu.isServer?null:null!=(e=null==i?void 0:i.createElement("div"))?e:null}),u=Object(Nr.useContext)(Ac),s=ju();return Mu(()=>{!l||!a||l.contains(a)||(a.setAttribute("data-headlessui-portal",""),l.appendChild(a))},[l,a]),Mu(()=>{if(a&&u)return u.register(a)},[u,a]),Cc(()=>{var e;!l||!a||(a instanceof Node&&l.contains(a)&&l.removeChild(a),l.childNodes.length<=0&&(null==(e=l.parentElement)||e.removeChild(l)))}),s&&l&&a?Object(Pc.createPortal)(wu({ourProps:{ref:o},theirProps:n,defaultTag:Lc,name:"Portal"}),a):null})),Uc=ku((function(e,t){let{target:n,...r}=e,o={ref:Ru(t)};return _r.a.createElement(jc.Provider,{value:n},wu({ourProps:o,theirProps:r,defaultTag:Rc,name:"Popover.Group"}))})),Hc=Object.assign(zc,{Group:Uc}),Bc=Object(Nr.createContext)(null);function Vc(){let e=Object(Nr.useContext)(Bc);if(null===e){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,Vc),e}return e}let $c=ku((function(e,t){let n=zu(),{id:r="headlessui-description-"+n,...o}=e,i=Vc(),l=Ru(t);return Mu(()=>i.register(r),[r,i.register]),wu({ourProps:{ref:l,...i.props,id:r},theirProps:o,slot:i.slot||{},defaultTag:"p",name:i.name||"Description"})})),Gc=Object.assign($c,{}),Wc=Object(Nr.createContext)(()=>{});Wc.displayName="StackContext";var qc=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(qc||{});function Qc({children:e,onUpdate:t,type:n,element:r,enabled:o}){let i=Object(Nr.useContext)(Wc),l=Fu((...e)=>{null==t||t(...e),i(...e)});return Mu(()=>{let e=void 0===o||!0===o;return e&&l(0,n,r),()=>{e&&l(1,n,r)}},[l,n,r,o]),_r.a.createElement(Wc.Provider,{value:l},e)}const Kc="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},{useState:Yc,useEffect:Xc,useLayoutEffect:Jc,useDebugValue:Zc}=Nr;function ef(e){const t=e.getSnapshot,n=e.value;try{const e=t();return!Kc(n,e)}catch{return!0}}const tf=!("undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement)?function(e,t,n){return t()}:function(e,t,n){const r=t(),[{inst:o},i]=Yc({inst:{value:r,getSnapshot:t}});return Jc(()=>{o.value=r,o.getSnapshot=t,ef(o)&&i({inst:o})},[e,r,t]),Xc(()=>(ef(o)&&i({inst:o}),e(()=>{ef(o)&&i({inst:o})})),[e]),Zc(r),r},nf="useSyncExternalStore"in Nr?(e=>e.useSyncExternalStore)(Nr):tf;function rf(){let e;return{before({doc:t}){var n;let r=t.documentElement;e=(null!=(n=t.defaultView)?n:window).innerWidth-r.clientWidth},after({doc:t,d:n}){let r=t.documentElement,o=r.clientWidth-r.offsetWidth,i=e-o;n.style(r,"paddingRight",i+"px")}}}function of(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function lf(){if(!of())return{};let e;return{before(){e=window.pageYOffset},after({doc:t,d:n,meta:r}){function o(e){return r.containers.flatMap(e=>e()).some(t=>t.contains(e))}n.microTask(()=>{if("auto"!==window.getComputedStyle(t.documentElement).scrollBehavior){let e=Tu();e.style(t.documentElement,"scroll-behavior","auto"),n.add(()=>n.microTask(()=>e.dispose()))}n.style(t.body,"marginTop",`-${e}px`),window.scrollTo(0,0);let r=null;n.addEventListener(t,"click",e=>{if(e.target instanceof HTMLElement)try{let n=e.target.closest("a");if(!n)return;let{hash:i}=new URL(n.href),l=t.querySelector(i);l&&!o(l)&&(r=l)}catch{}},!0),n.addEventListener(t,"touchmove",e=>{e.target instanceof HTMLElement&&!o(e.target)&&e.preventDefault()},{passive:!1}),n.add(()=>{window.scrollTo(0,window.pageYOffset+e),r&&r.isConnected&&(r.scrollIntoView({block:"nearest"}),r=null)})})}}}function af(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let uf=function(e,t){let n=e(),r=new Set;return{getSnapshot:()=>n,subscribe:e=>(r.add(e),()=>r.delete(e)),dispatch(e,...o){let i=t[e].call(n,...o);i&&(n=i,r.forEach(e=>e()))}}}(()=>new Map,{PUSH(e,t){var n;let r=null!=(n=this.get(e))?n:{doc:e,count:0,d:Tu(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:af(n)},o=[lf(),rf(),{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}];o.forEach(({before:e})=>null==e?void 0:e(r)),o.forEach(({after:e})=>null==e?void 0:e(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});function sf(e,t,n){let r=function(e){return nf(e.subscribe,e.getSnapshot,e.getSnapshot)}(uf),o=e?r.get(e):void 0,i=!!o&&o.count>0;return Mu(()=>{if(e&&t)return uf.dispatch("PUSH",e,n),()=>uf.dispatch("POP",e,n)},[t,e]),i}uf.subscribe(()=>{let e=uf.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let e="hidden"===t.get(n.doc),r=0!==n.count;(r&&!e||!r&&e)&&uf.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),0===n.count&&uf.dispatch("TEARDOWN",n)}});let cf=new Map,ff=new Map;function df(e,t=!0){Mu(()=>{var n;if(!t)return;let r="function"==typeof e?e():e.current;if(!r)return;let o=null!=(n=ff.get(r))?n:0;return ff.set(r,o+1),0!==o||(cf.set(r,{"aria-hidden":r.getAttribute("aria-hidden"),inert:r.inert}),r.setAttribute("aria-hidden","true"),r.inert=!0),function(){var e;if(!r)return;let t=null!=(e=ff.get(r))?e:1;if(1===t?ff.delete(r):ff.set(r,t-1),1!==t)return;let n=cf.get(r);n&&(null===n["aria-hidden"]?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",n["aria-hidden"]),r.inert=n.inert,cf.delete(r))}},[e,t])}var pf=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(pf||{}),hf=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(hf||{});let mf={0:(e,t)=>e.titleId===t.id?e:{...e,titleId:t.id}},gf=Object(Nr.createContext)(null);function vf(e){let t=Object(Nr.useContext)(gf);if(null===t){let t=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,vf),t}return t}function yf(e,t){return hu(t.type,mf,e,t)}gf.displayName="DialogContext";let bf=yu.RenderStrategy|yu.Static;let wf=ku((function(e,t){var n;let r=zu(),{id:o="headlessui-dialog-"+r,open:i,onClose:l,initialFocus:a,__demoMode:u=!1,...s}=e,[c,f]=Object(Nr.useState)(0),d=ps();void 0===i&&null!==d&&(i=(d&ds.Open)===ds.Open);let p=Object(Nr.useRef)(null),h=Ru(p,t),m=vs(p),g=e.hasOwnProperty("open")||null!==d,v=e.hasOwnProperty("onClose");if(!g&&!v)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!g)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!v)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof i)throw new Error("You provided an `open` prop to the `Dialog`, but the value is not a boolean. Received: "+i);if("function"!=typeof l)throw new Error("You provided an `onClose` prop to the `Dialog`, but the value is not a function. Received: "+l);let y=i?0:1,[b,w]=Object(Nr.useReducer)(yf,{titleId:null,descriptionId:null,panelRef:Object(Nr.createRef)()}),S=Fu(()=>l(!1)),E=Fu(e=>w({type:0,id:e})),k=!!ju()&&(!u&&0===y),C=c>1,x=null!==Object(Nr.useContext)(gf),[O,T]=function(){let e=Object(Nr.useContext)(Ac),t=Object(Nr.useRef)([]),n=Fu(n=>(t.current.push(n),e&&e.register(n),()=>r(n))),r=Fu(n=>{let r=t.current.indexOf(n);-1!==r&&t.current.splice(r,1),e&&e.unregister(n)}),o=Object(Nr.useMemo)(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,Object(Nr.useMemo)(()=>function({children:e}){return _r.a.createElement(Ac.Provider,{value:o},e)},[o])]}(),{resolveContainers:I,mainTreeNodeRef:N,MainTreeNode:_}=function({defaultContainers:e=[],portals:t,mainTreeNodeRef:n}={}){var r;let o=Object(Nr.useRef)(null!=(r=null==n?void 0:n.current)?r:null),i=vs(o),l=Fu(()=>{var n;let r=[];for(let t of e)null!==t&&(t instanceof HTMLElement?r.push(t):"current"in t&&t.current instanceof HTMLElement&&r.push(t.current));if(null!=t&&t.current)for(let e of t.current)r.push(e);for(let e of null!=(n=null==i?void 0:i.querySelectorAll("html > *, body > *"))?n:[])e!==document.body&&e!==document.head&&e instanceof HTMLElement&&"headlessui-portal-root"!==e.id&&(e.contains(o.current)||r.some(t=>e.contains(t))||r.push(e));return r});return{resolveContainers:l,contains:Fu(e=>l().some(t=>t.contains(e))),mainTreeNodeRef:o,MainTreeNode:Object(Nr.useMemo)(()=>function(){return null!=n?null:_r.a.createElement(wc,{features:bc.Hidden,ref:o})},[o,n])}}({portals:O,defaultContainers:[null!=(n=b.panelRef.current)?n:p.current]}),P=C?"parent":"leaf",M=null!==d&&(d&ds.Closing)===ds.Closing,D=!x&&!M&&k;df(Object(Nr.useCallback)(()=>{var e,t;return null!=(t=Array.from(null!=(e=null==m?void 0:m.querySelectorAll("body > *"))?e:[]).find(e=>"headlessui-portal-root"!==e.id&&(e.contains(N.current)&&e instanceof HTMLElement)))?t:null},[N]),D);let F=!!C||k;df(Object(Nr.useCallback)(()=>{var e,t;return null!=(t=Array.from(null!=(e=null==m?void 0:m.querySelectorAll("[data-headlessui-portal]"))?e:[]).find(e=>e.contains(N.current)&&e instanceof HTMLElement))?t:null},[N]),F),cs(I,S,!(!k||C));let L=!(C||0!==y);Ec(null==m?void 0:m.defaultView,"keydown",e=>{L&&(e.defaultPrevented||e.key===Hu.Escape&&(e.preventDefault(),e.stopPropagation(),S()))}),function(e,t,n=(()=>[document.body])){sf(e,t,e=>{var t;return{containers:[...null!=(t=e.containers)?t:[],n]}})}(m,!(M||0!==y||x),I),Object(Nr.useEffect)(()=>{if(0!==y||!p.current)return;let e=new ResizeObserver(e=>{for(let t of e){let e=t.target.getBoundingClientRect();0===e.x&&0===e.y&&0===e.width&&0===e.height&&S()}});return e.observe(p.current),()=>e.disconnect()},[y,p,S]);let[R,j]=function(){let[e,t]=Object(Nr.useState)([]);return[e.length>0?e.join(" "):void 0,Object(Nr.useMemo)(()=>function(e){let n=Fu(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))),r=Object(Nr.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props}),[n,e.slot,e.name,e.props]);return _r.a.createElement(Bc.Provider,{value:r},e.children)},[t])]}(),A=Object(Nr.useMemo)(()=>[{dialogState:y,close:S,setTitleId:E},b],[y,b,S,E]),z=Object(Nr.useMemo)(()=>({open:0===y}),[y]),U={ref:h,id:o,role:"dialog","aria-modal":0===y||void 0,"aria-labelledby":b.titleId,"aria-describedby":R};return _r.a.createElement(Qc,{type:"Dialog",enabled:0===y,element:p,onUpdate:Fu((e,t)=>{"Dialog"===t&&hu(e,{[qc.Add]:()=>f(e=>e+1),[qc.Remove]:()=>f(e=>e-1)})})},_r.a.createElement(Dc,{force:!0},_r.a.createElement(Hc,null,_r.a.createElement(gf.Provider,{value:A},_r.a.createElement(Hc.Group,{target:p},_r.a.createElement(Dc,{force:!1},_r.a.createElement(j,{slot:z,name:"Dialog.Description"},_r.a.createElement(Ic,{initialFocus:a,containers:I,features:k?hu(P,{parent:Ic.features.RestoreFocus,leaf:Ic.features.All&~Ic.features.FocusLock}):Ic.features.None},_r.a.createElement(T,null,wu({ourProps:U,theirProps:s,slot:z,defaultTag:"div",features:bf,visible:0===y,name:"Dialog"}))))))))),_r.a.createElement(_,null))})),Sf=ku((function(e,t){let n=zu(),{id:r="headlessui-dialog-backdrop-"+n,...o}=e,[{dialogState:i},l]=vf("Dialog.Backdrop"),a=Ru(t);Object(Nr.useEffect)(()=>{if(null===l.panelRef.current)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[l.panelRef]);let u=Object(Nr.useMemo)(()=>({open:0===i}),[i]);return _r.a.createElement(Dc,{force:!0},_r.a.createElement(Hc,null,wu({ourProps:{ref:a,id:r,"aria-hidden":!0},theirProps:o,slot:u,defaultTag:"div",name:"Dialog.Backdrop"})))})),Ef=ku((function(e,t){let n=zu(),{id:r="headlessui-dialog-panel-"+n,...o}=e,[{dialogState:i},l]=vf("Dialog.Panel"),a=Ru(t,l.panelRef),u=Object(Nr.useMemo)(()=>({open:0===i}),[i]);return wu({ourProps:{ref:a,id:r,onClick:Fu(e=>{e.stopPropagation()})},theirProps:o,slot:u,defaultTag:"div",name:"Dialog.Panel"})})),kf=ku((function(e,t){let n=zu(),{id:r="headlessui-dialog-overlay-"+n,...o}=e,[{dialogState:i,close:l}]=vf("Dialog.Overlay");return wu({ourProps:{ref:Ru(t),id:r,"aria-hidden":!0,onClick:Fu(e=>{if(e.target===e.currentTarget){if($u(e.currentTarget))return e.preventDefault();e.preventDefault(),e.stopPropagation(),l()}})},theirProps:o,slot:Object(Nr.useMemo)(()=>({open:0===i}),[i]),defaultTag:"div",name:"Dialog.Overlay"})})),Cf=ku((function(e,t){let n=zu(),{id:r="headlessui-dialog-title-"+n,...o}=e,[{dialogState:i,setTitleId:l}]=vf("Dialog.Title"),a=Ru(t);Object(Nr.useEffect)(()=>(l(r),()=>l(null)),[r,l]);let u=Object(Nr.useMemo)(()=>({open:0===i}),[i]);return wu({ourProps:{ref:a,id:r},theirProps:o,slot:u,defaultTag:"h2",name:"Dialog.Title"})})),xf=Object.assign(wf,{Backdrop:Sf,Panel:Ef,Overlay:kf,Title:Cf,Description:Gc});class Of extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["As","Key","ClassName","Open","OnClose","Children"]}}function Tf(e){return Nr.createElement(xf,ri(e,1))}class If extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Key","ClassName","Children"]}}function Nf(e){return Nr.createElement(xf.Panel,ri(e,1))}class _f extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["As","Key","ClassName","Children"]}}function Pf(e){return Nr.createElement(xf.Title,ri(e,1))}class Mf extends U{constructor(e,t,n){super(),this.numberOfSelectedAccounts=0|e,this.okButtonClick=t,this.cancelButtonClick=n}}function Df(e){const t=So(""),n=t[0],r=""===n;let o;const i="inline-flex w-full justify-center rounded-md border border-transparent bg-blue-600 px-4 py-2 text-base font-medium text-white shadow-sm hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-gray-300 focus:ring-offset-2 sm:ml-3 sm:w-auto sm:text-sm";return o=r?nn(en("%P() opacity-50",[i])):i,function(e){return Nr.createElement(ac.Root,ri(e,1))}(Qn([new cc(0,"1"),new cc(2,!0),new cc(3,[Tf(Qn([new Of(1,"1"),new Of(0,"div"),new Of(2,"relative z-10"),new Of(4,e.cancelButtonClick),new Of(5,[dc(Qn([new fc(0,"1"),new fc(3,"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"),new fc(4,"ease-out duration-300"),new fc(5,"opacity-0"),new fc(6,"opacity-100"),new fc(7,"ease-in duration-200"),new fc(8,"opacity-100"),new fc(9,"opacity-0")])),Object(Nr.createElement)("div",{className:"fixed inset-0 z-10 overflow-y-auto",key:"2",children:lo.Children.toArray([Object(Nr.createElement)("div",{key:"1",className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:lo.Children.toArray([dc(Qn([new fc(0,"1"),new fc(4,"ease-out duration-300"),new fc(5,"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"),new fc(6,"opacity-100 translate-y-0 sm:scale-100"),new fc(7,"ease-in duration-200"),new fc(8,"opacity-100 translate-y-0 sm:scale-100"),new fc(9,"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"),new fc(10,[Nf(Qn([new If(0,"1"),new If(1,"relative transform overflow-hidden rounded-lg bg-white px-4 pt-5 pb-4 text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg sm:p-6"),new If(2,[Object(Nr.createElement)("div",{key:"1",className:"sm:flex sm:items-start",children:lo.Children.toArray([Object(Nr.createElement)("div",{key:"2",className:"mt-3 text-center sm:mt-0 sm:text-left",children:lo.Children.toArray([Pf(Qn([new _f(1,"1"),new _f(0,"h3"),new _f(2,"text-lg font-medium leading-6 text-gray-900"),new _f(3,[Object(Nr.createElement)("span",{children:"Update API Version",key:"1"})])])),Object(Nr.createElement)("div",{className:"mt-2",key:"2",children:lo.Children.toArray([Object(Nr.createElement)("p",{key:"1",className:"text-sm text-gray-500 mb-1",children:nn(en("Choose the new API version for %P() %P().",[e.numberOfSelectedAccounts,Ka(e.numberOfSelectedAccounts,"account")]))}),Object(Nr.createElement)("select",{key:"2",className:"mt-2 block w-full rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-indigo-600 sm:text-sm sm:leading-6",onChange:e=>{t[1](e.target.value)},children:lo.Children.toArray(Array.from(Jn(e=>Object(Nr.createElement)("option",{value:e,children:e}),Qn(["","V322","V321","V320","V319","V310","V280","V1138"]))))})])})])})])}),Object(Nr.createElement)("div",{key:"2",className:"mt-5 sm:mt-4 sm:flex sm:flex-row-reverse",children:lo.Children.toArray([Object(Nr.createElement)("button",{key:"Ok",className:o,onClick:t=>{e.okButtonClick(n)},children:"Update",disabled:r}),Object(Nr.createElement)("button",{key:"Cancel",className:"mt-3 inline-flex w-full justify-center rounded-md border border-gray-300 bg-white px-4 py-2 text-base font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-gray-200 focus:ring-offset-2 sm:mt-0 sm:w-auto sm:text-sm",onClick:t=>{e.cancelButtonClick()},children:"Cancel"})])})])]))])]))])})])})])]))])]))}function Ff(e,t,n,r,o){const i=function(e,t,n,r){const o=0|O(e,n);if(0===o)throw new Error("The step of a range cannot be zero");const i=o>0;return n=>{const o=0|O(n,t);return i&&o<=0||!i&&o>=0?[n,r(n,e)]:void 0}}(t,n,r,o);return $r(()=>Wr(i,e))}class Lf extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Writable","ReadWritable"]}}class Rf{constructor(e){this.state=new Lf(0,En(new Array(T((e,t)=>C(e,t),e,10)),0,T((e,t)=>C(e,t),e,10),null),0)}}function jf(e){const t=e.state;if(1===t.tag){const n=0|t.fields[1],r=0|t.fields[2],o=t.fields[0],i=(r+1)%o.length|0;return e.state=i===n?new Lf(0,o,n):new Lf(1,o,n,i),hn(o[r])}}function Af(e,t){const n=e.state;if(1===n.tag){const i=0|n.fields[1],l=0|n.fields[2],a=n.fields[0];a[i]=t;const u=(i+1)%a.length|0;e.state=u===l?new Lf(1,(r=l,o=a,Array.from($r(()=>Jr(oo(r,o),$r(()=>{return Jr((e=r,t=o,Xr(()=>Vr(t),(t,n)=>{if(t<e){if(n["System.Collections.IEnumerator.MoveNext"]())return hn(n["System.Collections.Generic.IEnumerator`1.get_Current"]());throw new Error(Dr+"\\nParameter name: source")}},e=>{e.Dispose()})),$r(()=>{return io(e=>Qr(null),(e=0,t=1,n=o.length,Ff(e,t,n,0,(e,t)=>e+t)));var e,t,n}));var e,t}))))),a.length,0):new Lf(1,a,u,l)}else{const r=0|n.fields[1],o=n.fields[0];o[r]=t;const i=(r+1)%o.length|0;e.state=new Lf(1,o,i,r)}var r,o}class zf extends U{constructor(e,t,n,r,o,i,l){super(),this.init=e,this.update=t,this.subscribe=n,this.view=r,this.setState=o,this.onError=i,this.syncDispatch=l}}function Uf(e,t,n){return new zf(e,t,e=>Cr(),n,(e,t)=>{n(e,t)},e=>{Sr(e[0],e[1])},N(2,e=>e))}function Hf(e,t){const n=t.init(e),r=n[0],o=new Rf(10);let i=!1,l=r;const a=P(1,t.syncDispatch,[e=>{if(i)Af(o,e);else{i=!0;let n=hn(e);for(;null!=n;){const e=mn(n);try{const n=t.update(e,l),r=n[0];t.setState(r,a),kr(n=>{t.onError([nn(Zt("Error in command while handling: %A"))(e),n])},a,n[1]),l=r}catch(n){t.onError([nn(Zt("Unable to process the message: %A"))(e),n])}n=jf(o)}i=!1}}]);t.setState(r,a),kr(e=>{t.onError(["Error intitializing:",e])},a,xr(Qn([(()=>{try{return t.subscribe(r)}catch(e){return t.onError(["Unable to subscribe:",e]),Cr()}})(),n[1]])))}class Bf{constructor(){this.hasDisposedOnce=!1,this.state=void 0,this.listener=void 0,this.dispatcher=void 0}}function Vf(){return new Bf}function $f(e,t,n,r){Hf(t,function(e,t){return new zf(t.init,t.update,t.subscribe,t.view,e,t.onError,t.syncDispatch)}((e,t)=>{!function(e,t,n){e.state=hn(t),e.dispatcher=n;const r=e.listener;null!=r&&r(t)}(n,e,t)},e()));const o=n.state;if(null!=o)return mn(o);throw new Error("Elmish program has not initialized")}function Gf(e,t,n){const r=ho(Vf)[0],o=ho(()=>$f(e,t,r)),l=o[1];var a,u;return go(()=>(r.hasDisposedOnce&&l($f(e,t,r)),po(()=>{!function(e){const t=e.state;if(null!=t){const e=mn(t);i(e)&&e.Dispose()}e.dispatcher=void 0,e.state=void 0,e.hasDisposedOnce=!0}(r)})),vn(n,[])),u=l,null==(a=r).listener&&(a.listener=u),[o[0],e=>{!function(e,t){const n=e.dispatcher;null!=n&&n(t)}(r,e)}]}function Wf(e,t){return Gf(e,void 0,t)}class qf extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]}}class Qf extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Header"]}}class Kf extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Empty","Text","Binary","Form"]}}class Yf extends U{constructor(e,t,n,r,o,i,l){super(),this.url=e,this.method=t,this.headers=n,this.withCredentials=r,this.overridenMimeType=o,this.overridenResponseType=i,this.content=l}}class Xf extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["Text","Blob","ArrayBuffer","Unknown"]}}class Jf extends U{constructor(e,t,n,r,o){super(),this.statusCode=0|e,this.responseText=t,this.responseType=n,this.responseHeaders=r,this.content=o}}const Zf=new Yf("",new qf(0),jn(),!1,void 0,void 0,new Kf(0));new Jf(0,"","",Gl(),new Xf(0,""));function ed(e,t){return an(t)?[t]:fn(t,[e],null,0)}function td(e){return new Yf(e,Zf.method,Zf.headers,Zf.withCredentials,Zf.overridenMimeType,Zf.overridenResponseType,Zf.content)}function nd(e,t){return new Yf(t.url,e,t.headers,t.withCredentials,t.overridenMimeType,t.overridenResponseType,t.content)}function rd(e,t){return new Yf(t.url,t.method,Yn(t.headers,zn(e)),t.withCredentials,t.overridenMimeType,t.overridenResponseType,t.content)}function od(e,t){return new Yf(t.url,t.method,t.headers,t.withCredentials,t.overridenMimeType,t.overridenResponseType,e)}function id(e){return hr(t=>{const n=new XMLHttpRequest;n.open(function(e){switch(e.tag){case 1:return"POST";case 3:return"PATCH";case 2:return"PUT";case 4:return"DELETE";case 6:return"OPTIONS";case 5:return"HEAD";default:return"GET"}}(e.method),e.url),n.onreadystatechange=()=>{let e,r,o,i,l,a;4===n.readyState&&t[0]((r=n.responseType,e=""===r||"text"===r?n.responseText:"",o=0|n.status,i=n.responseType,a=n.responseType,l=""===a||"text"===a?new Xf(0,n.responseText):new Xf("arraybuffer"===a?2:"blob"===a?1:3,n.response),new Jf(o,e,i,function(e){const t=Mr();return jl(t,Nl(t,e))}(function(e,t,n){const r=[];for(let n=0;n<=t.length-1;n++){const o=e(t[n]);if(null!=o){const e=mn(o);r.push(e)}}return"function"==typeof n?kn(e=>e,r,n):r}(e=>{const t=Qn(ed(":",e));return Un(t)?void 0:[Hn(t).toLocaleLowerCase(),sn(":",Bn(t)).trim()]},ed("\r\n",n.getAllResponseHeaders()))),l)))};const r=u(e.headers);try{for(;r["System.Collections.IEnumerator.MoveNext"]();){const e=r["System.Collections.Generic.IEnumerator`1.get_Current"]();n.setRequestHeader(e.fields[0],e.fields[1])}}finally{r.Dispose()}n.withCredentials=e.withCredentials;const o=e.overridenMimeType;null==o||n.overrideMimeType(o);const i=e.overridenResponseType;null==i||(1===i.tag?n.responseType="blob":2===i.tag?n.responseType="arraybuffer":n.responseType="text");const l=[e.method,e.content];0===l[0].tag?n.send(hn(void 0)):1===l[1].tag||3===l[1].tag||2===l[1].tag?n.send(hn(l[1].fields[0])):n.send(hn(void 0))})}function ld(e){return Array.from(e)}function ad(e){return String(e)}function ud(e){return String(e)}function sd(e){return String(e)}function cd(e){return String(e)}function fd(){return null}function dd(e,t){return JSON.stringify(t,N(2,null),hn(e))}function pd(e){return t=>{return n=yn(e,t),r=()=>null,null!=n?mn(n):r();var n,r}}function hd(e,t,n,r){const o=new H(null),i=Bl(re(r),o,e);let l;if(ve(r)){const e=kn(e=>{const r=si(t,ne(e)),o=md(i,t,n,e[1]);return t=>i=>{const l=function(e,t){return e[t[0]]}(t,e);return(!n||n&&null!=l)&&(i[r]=o(l)),i}},he(r));l=t=>eo(N(2,M(e=>n=>n(t,e),[0,[0,2]])),{},e)}else{if(!ge(r)){let e;const t=re(r);throw e=nn(Zt("Cannot generate auto encoder for %s. Please pass an extra encoder."))(t),new Error(e)}l=e=>{const o=function(e,t){const n=pe(t)[e.tag];if(null==n)throw new Error(`Cannot find case ${e.name} in union type`);return[n,e.fields]}(e,r),l=o[0],a=o[1],u=0|a.length;if(0===u)return ne(l);{const e=0|u,r=be(l),o=En(new Array(e+1),0,e+1,null);o[0]=ne(l);for(let l=1;l<=e;l++){const e=md(i,t,n,r[l-1][1]);o[l]=e(a[l-1])}return o}}}return o.contents=l,l}function md(e,t,n,r){const o=re(r),i=Vl(o,e);if(null==i){if(oe(r)){const o=md(e,t,n,ie(r));return e=>ld(no(o,e))}if(ae(r)){const e=re(se(r));if("System.SByte"===e)return e=>ad(e);if("System.Byte"===e)return e=>ud(e);if("System.Int16"===e)return e=>sd(e);if("System.UInt16"===e)return e=>cd(e);if("System.Int32"===e)return e=>e;if("System.UInt32"===e)return e=>e;{const e=re(r),t=rn(Zt("Cannot generate auto encoder for %s.\nThoth.Json.Net only support the folluwing enum types:\n- sbyte\n- byte\n- int16\n- uint16\n- int\n- uint32\nIf you can't use one of these types, please pass an extra encoder.\n "))(e);return e=>t(e)}}if(le(r)){if(ye(r)){const o=kn(r=>md(e,t,n,r),me(r));return e=>ld(ro((e,t)=>o[e](t),e))}{const o=re(ue(r));if("Microsoft.FSharp.Core.FSharpOption`1[System.Object]"===o){const o=new c(()=>pd(md(e,t,n,$(r)[0])));return e=>null==e?null:o.Value(e)}if("Microsoft.FSharp.Collections.FSharpList`1[System.Object]"===o||"Microsoft.FSharp.Collections.FSharpSet`1[System.Object]"===o){const o=md(e,t,n,$(r)[0]);return e=>ld(no(o,e))}if("Microsoft.FSharp.Collections.FSharpMap`2[System.Object,System.Object]"===o){const o=$(r)[0],i=md(e,t,n,$(r)[1]);if("System.String"===re(o)||"System.Guid"===re(o))return e=>eo((e,t)=>{const n=t;return e[n[0]]=i(n[1]),e},{},e);{let r;const l=md(e,t,n,o);return r=e=>l(e),e=>ld(no(e=>{const t=e;return[r(t[0]),i(t[1])]},e))}}return hd(e,t,n,r)}}return"System.Boolean"===o?e=>e:"Microsoft.FSharp.Core.Unit"===o?fd:"System.String"===o?e=>e:"System.SByte"===o?e=>ad(e):"System.Byte"===o?e=>ud(e):"System.Int16"===o?e=>sd(e):"System.UInt16"===o?e=>cd(e):"System.Int32"===o?e=>e:"System.UInt32"===o?e=>e:"System.Double"===o?e=>e:"System.Single"===o?e=>e:"System.DateTime"===o?e=>function(e){return Bt(e,"O")}(e):"System.DateTimeOffset"===o?e=>function(e){return Bt(e,"O")}(e):"System.TimeSpan"===o?e=>function(e){return cl(e)}(e):"System.Guid"===o?e=>e:"System.Object"===o?e=>e:hd(e,t,n,r)}{const e=i;return t=>e.contents(t)}}function gd(e){return null!=e?$l((e,t)=>new H(t[0]),e.Coders):Gl()}function vd(e,t,n,r,o,i){return dd(e,function(e,t,n,r){const o=vn(e,new ii(0)),i=vn(n,!0),l=mn(r).ResolveType();return md(gd(t),o,i,l)}(n,r,o,i)(t))}function yd(e,t){return nn(en("%s%P()/fasttrack-middleware/admin/%P()",[e,t]))}function bd(e,t){return ar.Delay(()=>{const n=rd(function(e){return new Qf(0,"Authorization",e)}(nn(Zt("Bearer %s"))(e)),t);return ar.Bind(ar.Bind(id(n),e=>ar.Return(new ur(0,e))),e=>{const t=e;if(1===t.tag)return ar.Return(new ur(1,t.fields[0]));{const e=t.fields[0];return 429===e.statusCode||e.statusCode>=500?ar.Bind(id(n),e=>ar.Return(new ur(0,e))):ar.Return(new ur(0,e))}})})}function wd(e,t,n,r,o){return ar.Delay(()=>{let i,l;const a={apollo:r,flare:n};return ar.Bind(bd(t,(l=nd(new qf(2),td(yd(e,nn(en("accountSettings/ftApiVersion/%P()",[o]))))),i=od(new Kf(1,vd(0,a,void 0,void 0,void 0,{ResolveType:()=>Q(["apollo",J(ee)],["flare",J(ee)])})),l),rd(function(e){return new Qf(0,"Content-Type",e)}("application/json"),i))),e=>{const t=e;return 1===t.tag?ar.Return(new ur(1,t.fields[0])):200===t.fields[0].statusCode?ar.Return(new ur(0,void 0)):ar.Return(new ur(1,"Unexpected response from backend"))})})}class Sd extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["ConfirmApiVersionUpdate"]}}class Ed extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["LoadAccounts","ToggleSelected","ClearAllSelected","GetApiVersionUpdateConfirmation","ApiVersionUpdateConfirmed","ApiVersionUpdateCancelled"]}}class kd extends U{constructor(e,t,n){super(),this.Data=e,this.Selected=t,this.Dialog=n}}function Cd(){return[new kd(new au(0),[],void 0),(e=new Ed(0,new au(1)),zn(t=>{t(e)}))];var e}function xd(e){return e?"On":"Off"}function Od(e,t,n,r,o,i){const l=null!=(a=e.Roles,er(new Ya(0,"FastTrack.EditConfig"),a,{Equals:(e,t)=>E(e,t),GetHashCode:e=>b(e)})?hn(void 0):void 0);var a,u,s,c;return u=Kr($r(()=>Jr(l?Qr(du("")):qr(),$r(()=>Jr(Qr(du("ID")),$r(()=>Jr(Qr(du("Name")),$r(()=>Jr(Qr(du("Email")),$r(()=>Jr(Qr(du("Last Summary Email Checked")),$r(()=>Jr(Qr(du("FT API Version")),$r(()=>Jr(Qr(du("Payee Integration")),$r(()=>Jr(Qr(du("Payee Type")),$r(()=>Jr(Qr(du("Payee Update")),$r(()=>Jr(Qr(du("Use Division Lookup")),$r(()=>Jr(Qr(du("Flare Rep Name")),$r(()=>Qr(du("Flare Webhook Subscription ID")))))))))))))))))))))))))),s=On(0,n,null)||0!==n.length?function(e,t){return Object(Nr.createElement)("div",{className:"absolute left-0 right-0 bottom-[84px] mx-auto w-[440px] py-3 px-4 bg-gray-100 border border-solid border-gray-300 ring-1 ring-black ring-opacity-5 shadow-lg rounded-lg",children:lo.Children.toArray([Object(Nr.createElement)("div",{className:"flex justify-between items-center",children:lo.Children.toArray([Object(Nr.createElement)("div",{className:"text-gray-700 text-sm",children:lo.Children.toArray([Object(Nr.createElement)("span",{className:"font-medium",children:e.length}),Object(Nr.createElement)("span",{children:nn(en(" %P() selected",[Ka(e.length,"Account")]))})])}),Object(Nr.createElement)("div",{className:"flex items-center gap-3.5",children:lo.Children.toArray([mc({Button:e=>Object(Nr.createElement)("button",{className:sn(" ",Kr($r(()=>Jr(Qr("flex items-center gap-1.5 border border-solid rounded-md border-gray-300 shadow-sm py-1.5 px-3 bg-white text-gray-700 font-medium text-sm"),$r(()=>Jr(Qr("focus:outline-none focus:ring-2 focus:ring-blue-600 focus:ring-offset-2"),$r(()=>e?Qr("outline-none ring-2 ring-blue-600 ring-offset-2"):qr()))))))),children:lo.Children.toArray(["Actions",Object(Nr.createElement)("div",{children:lo.Children.toArray([yc])})])}),MenuItems:zn(new hc("Change FT Api Version",!1,()=>{t(new eu(0))})),Position:new pc(0)}),Object(Nr.createElement)("button",{className:"cursor-pointer focus:rounded-full focus:outline-none focus:ring-2 focus:ring-blue-600 focus:ring-offset-2",onClick:e=>{t(new eu(1))},children:lo.Children.toArray([gc])})])})])})])})}(n,o):void 0,c=kn(e=>{const o=n.some(t=>E(e,t));return Kr($r(()=>Jr(l?Qr(function(e,t,n){return fu(Object(Nr.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-right font-medium",children:lo.Children.toArray([Object(Nr.createElement)("input",{key:e,className:"h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600",type:"checkbox",checked:n,onChange:e=>{t()}})])}))}(e.Id,()=>{r(e)},o)):qr(),$r(()=>{let n;return Jr(null!=e.Flare?Qr(pu(["text-gray-900","font-medium"],e.Id)):Qr((n=[Bo(Qn(["account-registry","partners",t,"accounts",e.Id]),1),e.Id],r=n[0],o=n[1],fu(Object(Nr.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-left font-medium",children:lo.Children.toArray([Object(Nr.createElement)("a",{className:"text-indigo-600 hover:text-indigo-900",children:o,href:r})])})))),$r(()=>{let t;return Jr(Qr(pu(["text-gray-500"],vn((t=e.Flare,null==t?void 0:t.AccountName),vn(e.FastTrack.AccountName,"")))),$r(()=>Jr(Qr(pu(["text-gray-500"],vn(e.FastTrack.Email,""))),$r(()=>Jr(Qr(pu(["text-gray-500"],vn(e.LastSummaryEmailChecked,""))),$r(()=>Jr(Qr(pu(["text-gray-500"],e.FastTrack.ApiVersion)),$r(()=>Jr(Qr(pu(["text-gray-500"],xd(e.FastTrack.PayeeIntegrationFlag))),$r(()=>Jr(Qr(pu(["text-gray-500"],vn(e.FastTrack.PayeeType,""))),$r(()=>Jr(Qr(pu(["text-gray-500"],xd(e.FastTrack.PayeeUpdateFlag))),$r(()=>{let t;return Jr(Qr(pu(["text-gray-500"],vn((t=e.Flare,null==t?void 0:xd(t.UseDivisionLookup)),""))),$r(()=>{let t;return Jr(Qr(pu(["text-gray-500"],vn((t=e.Flare,null==t?void 0:t.RepName),""))),$r(()=>{let t;return Qr(pu(["text-gray-500"],vn((t=e.Flare,null==t?void 0:t.WebhookSubscriptionId),"")))}))}))}))))))))))))))}));var r,o}))))},i),Object(Nr.createElement)("div",{className:"flex flex-col mt-4",children:lo.Children.toArray([Object(Nr.createElement)("div",{className:"-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8",children:lo.Children.toArray([Object(Nr.createElement)("div",{className:"py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8",children:lo.Children.toArray(Array.from(Kr($r(()=>{let e,t;return Jr(Qr(Object(Nr.createElement)("div",{className:"shadow overflow-hidden border-b border-gray-200 sm:rounded-lg",children:lo.Children.toArray([Object(Nr.createElement)("table",{className:"min-w-full divide-y divide-gray-200",children:lo.Children.toArray([Object(Nr.createElement)("thead",{className:"bg-gray-50",children:(e=no(e=>e.fields[0],u),Object(Nr.createElement)("tr",{children:lo.Children.toArray(Array.from(e))}))}),(t=ro((e,t)=>{return n=t,Object(Nr.createElement)("tr",{className:e%2==0?"bg-white":"bg-gray-50",children:lo.Children.toArray(Array.from(no(e=>e.fields[0],n)))});var n},c),Object(Nr.createElement)("tbody",{children:lo.Children.toArray(Array.from(t))}))])})])})),$r(()=>null==s?qr():Qr(s)))}))))})])})])})}function Td(e){const t=e.apolloPartnerId,n=e.user,r=e.accessToken,o=e.backendUrl,i=(l=Cd,a=(e,t)=>function(e,t,n,r){const o=[n,r];let i,l,a,u;switch(0===o[0].tag?1===o[0].fields[0].tag?i=0===o[1].Data.tag?0:6:2===o[0].fields[0].tag?1===o[1].Data.tag?(i=1,l=o[0].fields[0].fields[0]):i=6:3===o[0].fields[0].tag&&1===o[1].Data.tag?(i=2,a=o[0].fields[0].fields[0]):i=6:1===o[0].tag?null==o[1].Dialog?(i=3,u=o[0].fields[0]):i=6:i=2===o[0].tag?null==o[1].Dialog?4:6:3===o[0].tag&&null==o[1].Dialog&&o[1].Selected.length>0?5:6,i){case 0:return[new kd(new au(1),r.Selected,r.Dialog),Tr(e=>{Ir(e)},e,void 0,e=>new Ed(0,new au(2,e)),e=>new Ed(0,new au(3,e)))];case 1:return[new kd(new au(2,l),r.Selected,r.Dialog),Cr()];case 2:return[new kd(new au(3,a),r.Selected,r.Dialog),Cr()];case 3:return[new kd(r.Data,r.Selected.some(e=>E(u,e))?r.Selected.filter(e=>!E(u,e)):Sn(r.Selected,[u]),r.Dialog),Cr()];case 4:return[new kd(r.Data,[],r.Dialog),Cr()];case 5:return[new kd(r.Data,r.Selected,new Sd(0)),Cr()];case 6:{let e,n,i;switch(5===o[0].tag?e=null!=o[1].Dialog?0:2:4===o[0].tag&&2===o[1].Data.tag&&0===o[1].Data.fields[0].tag&&null!=o[1].Dialog?(e=1,n=o[1].Data.fields[0].fields[0],i=o[0].fields[0]):e=2,e){case 0:return[new kd(r.Data,[],void 0),Cr()];case 1:{const e=kn(e=>e.Id,r.Selected.filter(e=>null!=e.Flare)),o=kn(e=>e.Id,r.Selected.filter(e=>null==e.Flare));return[new kd(new au(1),[],void 0),Tr(e=>{Ir(e)},P(1,t,[n]),[e,o,i],e=>new Ed(0,new au(2,e)),e=>new Ed(0,new au(3,e)))]}case 2:return[r,Cr()]}}}}(()=>function(e,t){return ar.Delay(()=>ar.Bind(bd(t,nd(new qf(0),td(yd(e,"accounts")))),e=>{const t=e;if(1===t.tag)return ar.Return(new ur(1,t.fields[0]));{const e=t.fields[0];return 200===e.statusCode?ar.Return(Qa(e.responseText,void 0,void 0,{ResolveType:()=>J(iu())})):ar.Return(new ur(1,"Unexpected response from backend"))}}))}(o,r),(e,t)=>{let n;const i=t[0],l=t[1],a=t[2];return ar.Bind((n=[i,l,a],wd(o,r,n[0],n[1],n[2])),t=>{let n;return ar.Return((n=t,1===n.tag?new ur(1,n.fields[0]):new ur(0,kn(e=>{let t;return function(e,t,n){return(r=>{for(;;){const o=r;if(o>=t.length)return!1;if(n.Equals(e,t[o]))return!0;r=o+1}})(0)}(e.Id,Sn(l,i),{Equals:(e,t)=>e===t,GetHashCode:e=>m(e)})?new ou(e.Id,(t=e.FastTrack,new ru(t.AccountName,a,t.Email,t.PayeeIntegrationFlag,t.PayeeType,t.PayeeUpdateFlag)),e.Flare,e.LastSummaryEmailChecked):e},e))))})},e,t),Wf(()=>Uf(l,a,(e,t)=>{}),[]));var l,a;const u=i[0],s=i[1],c=u.Data;let f,d;switch(1===c.tag?f=0:2===c.tag?0===c.fields[0].tag?(f=2,d=c.fields[0].fields[0]):f=1:f=3===c.tag?1:0,f){case 0:return Object(Nr.createElement)("div",{children:["Loading..."]});case 1:return Object(Nr.createElement)("div",{children:["There was an error loading Flare accounts."]});case 2:return Object(Nr.createElement)("div",{className:"h-full flex flex-col relative",children:lo.Children.toArray(Array.from(Kr($r(()=>Jr(Qr(Od(n,t,u.Selected,e=>{s(new Ed(1,e))},e=>{1===e.tag?s(new Ed(2)):s(new Ed(3))},d)),$r(()=>{return null==u.Dialog?Qr(null):Qr((e=e=>{s(new Ed(4,e))},t=()=>{s(new Ed(5))},n=u.Selected,Object(Nr.createElement)(Df,new Mf(n.length,e,t))));var e,t,n}))))))})}}var Id=n(4);var Nd,_d,Pd,Md=n(5);class Dd extends F{constructor(e,...t){super(),this.tag=0|e,this.fields=t}cases(){return["PageChanged"]}}function Fd(){return K("Middleware.FastTrack.AdminUI.App.Msg",[],Dd,()=>[[["Item",Ko()]]])}class Ld extends U{constructor(e,t){super(),this.CurrentPage=e,this.User=t}}function Rd(){return q("Middleware.FastTrack.AdminUI.App.State",[],Ld,()=>[["CurrentPage",Ko()],["User",q("Middleware.FastTrack.AdminUI.Common.User",[],Ja,()=>[["UserName",Y(ee)],["Roles",X(K("Middleware.FastTrack.AdminUI.Common.AccessRole",[],Ya,()=>[[["Item",ee]]]))]])]])}function jd(e){const t=1===Yo($o(window.location.hash,1)).tag?function(e){if(0===e.tag){const e=["fasttrack-middleware","accounts"];return Or(t=>{Vo(Qn(e),1,1)})}{const e=["fasttrack-middleware","accounts"];return Or(t=>{Vo(Qn(e),1,1)})}}(new Qo(0)):Cr();return[new Ld(Yo($o(window.location.hash,1)),Za(e)),t]}function Ad(e,t){return[new Ld(e.fields[0],t.User),Cr()]}function zd(e){return t=1===e.tag?jn():zn(nu("Accounts",void 0)),Object(Nr.createElement)("div",{className:"border-b border-gray-200",children:lo.Children.toArray([Object(Nr.createElement)("nav",{className:"-mb-px flex space-x-8","aria-label":"Tabs",children:lo.Children.toArray(Array.from(no(e=>e.fields[0],t)))})])});var t}function Ud(e,t){const n=[t.CurrentPage,t.User.Roles];let r;switch(r=0===n[0].tag&&null!=Xa(n[1])?0:1,r){case 0:return Object(Nr.createElement)(Td,{backendUrl:e.backendUrl,accessToken:e.accessToken,user:t.User,apolloPartnerId:e.apolloPartnerId});case 1:{let e;switch(e=1===n[0].tag&&null!=Xa(n[1])?0:1,e){case 0:return Object(Nr.createElement)("h1",{children:["Not Found"]});case 1:return Object(Nr.createElement)("h1",{children:["Access denied"]})}}}}function Hd(e){const t=(n=jd(e.accessToken),r=(e,t)=>Ad(e,t),Wf(()=>Uf(()=>n,r,(e,t)=>{}),[]));var n,r;const o=t[0];return Go({onUrlChanged:e=>{t[1](new Dd(0,Yo(e)))},application:Nr.createElement(Nr.Fragment,{},zd(o.CurrentPage),Ud(e,o))})}Nd=e=>Object(Nr.createElement)(Hd,e),_d="superhero-fasttrack-middleware",Pd={props:{accessToken:"string",apolloPartnerId:"string",backendUrl:"string"}},customElements.define(_d,function(e,t,n,r={}){return Object(Id.a)(e,r,{mount:function(e,r,o){const i=t.createElement(r,o);if("createRoot"in n){const t=n.createRoot(e);return t.render(i),{container:e,root:t,ReactComponent:r}}if("render"in n)return n.render(i,e),{container:e,ReactComponent:r};throw new Error("Invalid ReactDOM instance provided.")},unmount:function({container:e,root:t}){t?t.unmount():"unmountComponentAtNode"in n&&n.unmountComponentAtNode(e)},update:function({container:e,root:r,ReactComponent:o},i){const l=t.createElement(o,i);r?r.render(l):"render"in n&&n.render(l,e)}})}(Nd,Nr,Md,Pd))}]);
|