scribe-widget 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +230 -0
- package/dist/scribe-widget.es.js +64563 -0
- package/dist/scribe-widget.umd.js +80 -0
- package/index.html +205 -0
- package/package.json +26 -0
- package/src/App.tsx +114 -0
- package/src/components/ConfigState.tsx +68 -0
- package/src/components/ErrorState.tsx +20 -0
- package/src/components/FloatingPanel.tsx +83 -0
- package/src/components/Icons.tsx +43 -0
- package/src/components/IdleState.tsx +24 -0
- package/src/components/PermissionState.tsx +22 -0
- package/src/components/ProcessingState.tsx +8 -0
- package/src/components/RecordingState.tsx +48 -0
- package/src/components/ResultsState.tsx +27 -0
- package/src/hooks/useScribeSession.ts +227 -0
- package/src/index.tsx +123 -0
- package/src/styles/widget.css +495 -0
- package/src/types.ts +14 -0
- package/src/vite-env.d.ts +6 -0
- package/tsconfig.json +21 -0
- package/vite.config.ts +27 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).EkaScribe={})}(this,function(exports){"use strict";var __defProp=Object.defineProperty,__defNormalProp=(e,t,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__publicField=(e,t,n)=>__defNormalProp(e,"symbol"!=typeof t?t+"":t,n),commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function getAugmentedNamespace(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={},react={exports:{}},react_production_min={},hasRequiredReact_production_min;function requireReact_production_min(){if(hasRequiredReact_production_min)return react_production_min;hasRequiredReact_production_min=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),i=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),d=Symbol.iterator;var f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p=Object.assign,h={};function m(e,t,n){this.props=e,this.context=t,this.refs=h,this.updater=n||f}function g(){}function b(e,t,n){this.props=e,this.context=t,this.refs=h,this.updater=n||f}m.prototype.isReactComponent={},m.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},g.prototype=m.prototype;var y=b.prototype=new g;y.constructor=b,p(y,m.prototype),y.isPureReactComponent=!0;var _=Array.isArray,v=Object.prototype.hasOwnProperty,w={current:null},S={key:!0,ref:!0,__self:!0,__source:!0};function x(t,n,r){var o,a={},i=null,s=null;if(null!=n)for(o in void 0!==n.ref&&(s=n.ref),void 0!==n.key&&(i=""+n.key),n)v.call(n,o)&&!S.hasOwnProperty(o)&&(a[o]=n[o]);var l=arguments.length-2;if(1===l)a.children=r;else if(1<l){for(var u=Array(l),c=0;c<l;c++)u[c]=arguments[c+2];a.children=u}if(t&&t.defaultProps)for(o in l=t.defaultProps)void 0===a[o]&&(a[o]=l[o]);return{$$typeof:e,type:t,key:i,ref:s,props:a,_owner:w.current}}function T(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var E=/\/+/g;function k(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function P(n,r,o,a,i){var s=typeof n;"undefined"!==s&&"boolean"!==s||(n=null);var l=!1;if(null===n)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(n.$$typeof){case e:case t:l=!0}}if(l)return i=i(l=n),n=""===a?"."+k(l,0):a,_(i)?(o="",null!=n&&(o=n.replace(E,"$&/")+"/"),P(i,r,o,"",function(e){return e})):null!=i&&(T(i)&&(i=function(t,n){return{$$typeof:e,type:t.type,key:n,ref:t.ref,props:t.props,_owner:t._owner}}(i,o+(!i.key||l&&l.key===i.key?"":(""+i.key).replace(E,"$&/")+"/")+n)),r.push(i)),1;if(l=0,a=""===a?".":a+":",_(n))for(var u=0;u<n.length;u++){var c=a+k(s=n[u],u);l+=P(s,r,o,c,i)}else if(c=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=d&&e[d]||e["@@iterator"])?e:null}(n),"function"==typeof c)for(n=c.call(n),u=0;!(s=n.next()).done;)l+=P(s=s.value,r,o,c=a+k(s,u++),i);else if("object"===s)throw r=String(n),Error("Objects are not valid as a React child (found: "+("[object Object]"===r?"object with keys {"+Object.keys(n).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.");return l}function O(e,t,n){if(null==e)return e;var r=[],o=0;return P(e,r,"","",function(e){return t.call(n,e,o++)}),r}function A(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var R={current:null},$={transition:null},I={ReactCurrentDispatcher:R,ReactCurrentBatchConfig:$,ReactCurrentOwner:w};function C(){throw Error("act(...) is not supported in production builds of React.")}return react_production_min.Children={map:O,forEach:function(e,t,n){O(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return O(e,function(){t++}),t},toArray:function(e){return O(e,function(e){return e})||[]},only:function(e){if(!T(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},react_production_min.Component=m,react_production_min.Fragment=n,react_production_min.Profiler=o,react_production_min.PureComponent=b,react_production_min.StrictMode=r,react_production_min.Suspense=l,react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I,react_production_min.act=C,react_production_min.cloneElement=function(t,n,r){if(null==t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var o=p({},t.props),a=t.key,i=t.ref,s=t._owner;if(null!=n){if(void 0!==n.ref&&(i=n.ref,s=w.current),void 0!==n.key&&(a=""+n.key),t.type&&t.type.defaultProps)var l=t.type.defaultProps;for(u in n)v.call(n,u)&&!S.hasOwnProperty(u)&&(o[u]=void 0===n[u]&&void 0!==l?l[u]:n[u])}var u=arguments.length-2;if(1===u)o.children=r;else if(1<u){l=Array(u);for(var c=0;c<u;c++)l[c]=arguments[c+2];o.children=l}return{$$typeof:e,type:t.type,key:a,ref:i,props:o,_owner:s}},react_production_min.createContext=function(e){return(e={$$typeof:i,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:a,_context:e},e.Consumer=e},react_production_min.createElement=x,react_production_min.createFactory=function(e){var t=x.bind(null,e);return t.type=e,t},react_production_min.createRef=function(){return{current:null}},react_production_min.forwardRef=function(e){return{$$typeof:s,render:e}},react_production_min.isValidElement=T,react_production_min.lazy=function(e){return{$$typeof:c,_payload:{_status:-1,_result:e},_init:A}},react_production_min.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},react_production_min.startTransition=function(e){var t=$.transition;$.transition={};try{e()}finally{$.transition=t}},react_production_min.unstable_act=C,react_production_min.useCallback=function(e,t){return R.current.useCallback(e,t)},react_production_min.useContext=function(e){return R.current.useContext(e)},react_production_min.useDebugValue=function(){},react_production_min.useDeferredValue=function(e){return R.current.useDeferredValue(e)},react_production_min.useEffect=function(e,t){return R.current.useEffect(e,t)},react_production_min.useId=function(){return R.current.useId()},react_production_min.useImperativeHandle=function(e,t,n){return R.current.useImperativeHandle(e,t,n)},react_production_min.useInsertionEffect=function(e,t){return R.current.useInsertionEffect(e,t)},react_production_min.useLayoutEffect=function(e,t){return R.current.useLayoutEffect(e,t)},react_production_min.useMemo=function(e,t){return R.current.useMemo(e,t)},react_production_min.useReducer=function(e,t,n){return R.current.useReducer(e,t,n)},react_production_min.useRef=function(e){return R.current.useRef(e)},react_production_min.useState=function(e){return R.current.useState(e)},react_production_min.useSyncExternalStore=function(e,t,n){return R.current.useSyncExternalStore(e,t,n)},react_production_min.useTransition=function(){return R.current.useTransition()},react_production_min.version="18.3.1",react_production_min}var react_development={exports:{}},hasRequiredReact_development,hasRequiredReact,hasRequiredReactJsxRuntime_production_min;
|
|
2
|
+
/**
|
|
3
|
+
* @license React
|
|
4
|
+
* react.development.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/function requireReact_development(){return hasRequiredReact_development||(hasRequiredReact_development=1,e=react_development,t=react_development.exports,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),m=Symbol.iterator;function g(e){if(null===e||"object"!=typeof e)return null;var t=m&&e[m]||e["@@iterator"];return"function"==typeof t?t:null}var b={current:null},y={transition:null},_={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},v={current:null},w={},S=null;function x(e){S=e}w.setExtraStackFrame=function(e){S=e},w.getCurrentStack=null,w.getStackAddendum=function(){var e="";S&&(e+=S);var t=w.getCurrentStack;return t&&(e+=t()||""),e};var T={ReactCurrentDispatcher:b,ReactCurrentBatchConfig:y,ReactCurrentOwner:v};function E(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];P("warn",e,n)}function k(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];P("error",e,n)}function P(e,t,n){var r=T.ReactDebugCurrentFrame.getStackAddendum();""!==r&&(t+="%s",n=n.concat([r]));var o=n.map(function(e){return String(e)});o.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,o)}T.ReactDebugCurrentFrame=w,T.ReactCurrentActQueue=_;var O={};function A(e,t){var n=e.constructor,r=n&&(n.displayName||n.name)||"ReactClass",o=r+"."+t;O[o]||(k("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,r),O[o]=!0)}var R={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,n){A(e,"forceUpdate")},enqueueReplaceState:function(e,t,n,r){A(e,"replaceState")},enqueueSetState:function(e,t,n,r){A(e,"setState")}},$=Object.assign,I={};function C(e,t,n){this.props=e,this.context=t,this.refs=I,this.updater=n||R}Object.freeze(I),C.prototype.isReactComponent={},C.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},C.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var D={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},N=function(e,t){Object.defineProperty(C.prototype,e,{get:function(){E("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})};for(var M in D)D.hasOwnProperty(M)&&N(M,D[M]);function L(){}function j(e,t,n){this.props=e,this.context=t,this.refs=I,this.updater=n||R}L.prototype=C.prototype;var F=j.prototype=new L;F.constructor=j,$(F,C.prototype),F.isPureReactComponent=!0;var B=Array.isArray;function U(e){return B(e)}function z(e){return""+e}function V(e){if(function(e){try{return z(e),!1}catch(t){return!0}}(e))return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),z(e)}function H(e){return e.displayName||"Context"}function q(e){if(null==e)return null;if("number"==typeof e.tag&&k("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case o:return"Fragment";case r:return"Portal";case i:return"Profiler";case a:return"StrictMode";case c:return"Suspense";case d:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case l:return H(e)+".Consumer";case s:return H(e._context)+".Provider";case u:return function(e,t,n){var r=e.displayName;if(r)return r;var o=t.displayName||t.name||"";return""!==o?n+"("+o+")":n}(e,e.render,"ForwardRef");case f:var t=e.displayName||null;return null!==t?t:q(e.type)||"Memo";case p:var n=e,h=n._payload,m=n._init;try{return q(m(h))}catch(g){return null}}return null}var G,W,Y,X=Object.prototype.hasOwnProperty,K={key:!0,ref:!0,__self:!0,__source:!0};function Q(e){if(X.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}function Z(e){if(X.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}Y={};var J=function(e,t,r,o,a,i,s){var l={$$typeof:n,type:e,key:t,ref:r,props:s,_owner:i,_store:{}};return Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(l,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(l,"_source",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l};function ee(e,t,n){var r,o={},a=null,i=null,s=null,l=null;if(null!=t)for(r in Q(t)&&(i=t.ref,function(e){if("string"==typeof e.ref&&v.current&&e.__self&&v.current.stateNode!==e.__self){var t=q(v.current.type);Y[t]||(k('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',t,e.ref),Y[t]=!0)}}(t)),Z(t)&&(V(t.key),a=""+t.key),s=void 0===t.__self?null:t.__self,l=void 0===t.__source?null:t.__source,t)X.call(t,r)&&!K.hasOwnProperty(r)&&(o[r]=t[r]);var u=arguments.length-2;if(1===u)o.children=n;else if(u>1){for(var c=Array(u),d=0;d<u;d++)c[d]=arguments[d+2];Object.freeze&&Object.freeze(c),o.children=c}if(e&&e.defaultProps){var f=e.defaultProps;for(r in f)void 0===o[r]&&(o[r]=f[r])}if(a||i){var p="function"==typeof e?e.displayName||e.name||"Unknown":e;a&&function(e,t){var n=function(){G||(G=!0,k("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(o,p),i&&function(e,t){var n=function(){W||(W=!0,k("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(o,p)}return J(e,a,i,s,l,v.current,o)}function te(e,t,n){if(null==e)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r,o,a=$({},e.props),i=e.key,s=e.ref,l=e._self,u=e._source,c=e._owner;if(null!=t)for(r in Q(t)&&(s=t.ref,c=v.current),Z(t)&&(V(t.key),i=""+t.key),e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)X.call(t,r)&&!K.hasOwnProperty(r)&&(void 0===t[r]&&void 0!==o?a[r]=o[r]:a[r]=t[r]);var d=arguments.length-2;if(1===d)a.children=n;else if(d>1){for(var f=Array(d),p=0;p<d;p++)f[p]=arguments[p+2];a.children=f}return J(e.type,i,s,l,u,c,a)}function ne(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var re,oe=!1,ae=/\/+/g;function ie(e){return e.replace(ae,"$&/")}function se(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(V(e.key),n=""+e.key,r={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var n,r}function le(e,t,o,a,i){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var l,u,c,d=!1;if(null===e)d=!0;else switch(s){case"string":case"number":d=!0;break;case"object":switch(e.$$typeof){case n:case r:d=!0}}if(d){var f=e,p=i(f),h=""===a?"."+se(f,0):a;if(U(p)){var m="";null!=h&&(m=ie(h)+"/"),le(p,t,m,"",function(e){return e})}else null!=p&&(ne(p)&&(!p.key||f&&f.key===p.key||V(p.key),l=p,u=o+(!p.key||f&&f.key===p.key?"":ie(""+p.key)+"/")+h,p=J(l.type,u,l.ref,l._self,l._source,l._owner,l.props)),t.push(p));return 1}var b=0,y=""===a?".":a+":";if(U(e))for(var _=0;_<e.length;_++)b+=le(c=e[_],t,o,y+se(c,_),i);else{var v=g(e);if("function"==typeof v){var w=e;v===w.entries&&(oe||E("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),oe=!0);for(var S,x=v.call(w),T=0;!(S=x.next()).done;)b+=le(c=S.value,t,o,y+se(c,T++),i)}else if("object"===s){var k=String(e);throw new Error("Objects are not valid as a React child (found: "+("[object Object]"===k?"object with keys {"+Object.keys(e).join(", ")+"}":k)+"). If you meant to render a collection of children, use an array instead.")}}return b}function ue(e,t,n){if(null==e)return e;var r=[],o=0;return le(e,r,"","",function(e){return t.call(n,e,o++)}),r}function ce(e){if(-1===e._status){var t=(0,e._result)();if(t.then(function(t){if(0===e._status||-1===e._status){var n=e;n._status=1,n._result=t}},function(t){if(0===e._status||-1===e._status){var n=e;n._status=2,n._result=t}}),-1===e._status){var n=e;n._status=0,n._result=t}}if(1===e._status){var r=e._result;return void 0===r&&k("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",r),"default"in r||k("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",r),r.default}throw e._result}function de(e){return"string"==typeof e||"function"==typeof e||e===o||e===i||e===a||e===c||e===d||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===f||e.$$typeof===s||e.$$typeof===l||e.$$typeof===u||e.$$typeof===re||void 0!==e.getModuleId)}function fe(){var e=b.current;return null===e&&k("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem."),e}re=Symbol.for("react.module.reference");var pe,he,me,ge,be,ye,_e,ve=0;function we(){}we.__reactDisabledLog=!0;var Se,xe=T.ReactCurrentDispatcher;function Te(e,t,n){if(void 0===Se)try{throw Error()}catch(o){var r=o.stack.trim().match(/\n( *(at )?)/);Se=r&&r[1]||""}return"\n"+Se+e}var Ee,ke=!1,Pe="function"==typeof WeakMap?WeakMap:Map;function Oe(e,t){if(!e||ke)return"";var n,r=Ee.get(e);if(void 0!==r)return r;ke=!0;var o,a=Error.prepareStackTrace;Error.prepareStackTrace=void 0,o=xe.current,xe.current=null,function(){if(0===ve){pe=console.log,he=console.info,me=console.warn,ge=console.error,be=console.group,ye=console.groupCollapsed,_e=console.groupEnd;var e={configurable:!0,enumerable:!0,value:we,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}ve++}();try{if(t){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(i,[])}catch(h){n=h}Reflect.construct(e,[],i)}else{try{i.call()}catch(h){n=h}e.call(i.prototype)}}else{try{throw Error()}catch(h){n=h}e()}}catch(m){if(m&&n&&"string"==typeof m.stack){for(var s=m.stack.split("\n"),l=n.stack.split("\n"),u=s.length-1,c=l.length-1;u>=1&&c>=0&&s[u]!==l[c];)c--;for(;u>=1&&c>=0;u--,c--)if(s[u]!==l[c]){if(1!==u||1!==c)do{if(u--,--c<0||s[u]!==l[c]){var d="\n"+s[u].replace(" at new "," at ");return e.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",e.displayName)),"function"==typeof e&&Ee.set(e,d),d}}while(u>=1&&c>=0);break}}}finally{ke=!1,xe.current=o,function(){if(0===--ve){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:$({},e,{value:pe}),info:$({},e,{value:he}),warn:$({},e,{value:me}),error:$({},e,{value:ge}),group:$({},e,{value:be}),groupCollapsed:$({},e,{value:ye}),groupEnd:$({},e,{value:_e})})}ve<0&&k("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=a}var f=e?e.displayName||e.name:"",p=f?Te(f):"";return"function"==typeof e&&Ee.set(e,p),p}function Ae(e,t,n){if(null==e)return"";if("function"==typeof e)return Oe(e,!(!(r=e.prototype)||!r.isReactComponent));var r;if("string"==typeof e)return Te(e);switch(e){case c:return Te("Suspense");case d:return Te("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case u:return Oe(e.render,!1);case f:return Ae(e.type,t,n);case p:var o=e,a=o._payload,i=o._init;try{return Ae(i(a),t,n)}catch(s){}}return""}Ee=new Pe;var Re,$e={},Ie=T.ReactDebugCurrentFrame;function Ce(e){if(e){var t=e._owner,n=Ae(e.type,e._source,t?t.type:null);Ie.setExtraStackFrame(n)}else Ie.setExtraStackFrame(null)}function De(e){if(e){var t=e._owner;x(Ae(e.type,e._source,t?t.type:null))}else x(null)}function Ne(){if(v.current){var e=q(v.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}Re=!1;var Me={};function Le(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=Ne();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!Me[n]){Me[n]=!0;var r="";e&&e._owner&&e._owner!==v.current&&(r=" It was passed a child from "+q(e._owner.type)+"."),De(e),k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,r),De(null)}}}function je(e,t){if("object"==typeof e)if(U(e))for(var n=0;n<e.length;n++){var r=e[n];ne(r)&&Le(r,t)}else if(ne(e))e._store&&(e._store.validated=!0);else if(e){var o=g(e);if("function"==typeof o&&o!==e.entries)for(var a,i=o.call(e);!(a=i.next()).done;)ne(a.value)&&Le(a.value,t)}}function Fe(e){var t,n=e.type;if(null!=n&&"string"!=typeof n){if("function"==typeof n)t=n.propTypes;else{if("object"!=typeof n||n.$$typeof!==u&&n.$$typeof!==f)return;t=n.propTypes}if(t){var r=q(n);!function(e,t,n,r,o){var a=Function.call.bind(X);for(var i in e)if(a(e,i)){var s=void 0;try{if("function"!=typeof e[i]){var l=Error((r||"React class")+": "+n+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}s=e[i](t,i,r,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(u){s=u}!s||s instanceof Error||(Ce(o),k("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||"React class",n,i,typeof s),Ce(null)),s instanceof Error&&!(s.message in $e)&&($e[s.message]=!0,Ce(o),k("Failed %s type: %s",n,s.message),Ce(null))}}(t,e.props,"prop",r,e)}else void 0===n.PropTypes||Re||(Re=!0,k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",q(n)||"Unknown"));"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Be(e,t,r){var a,i,s=de(e);if(!s){var l="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(l+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var u,c=null!=(a=t)&&void 0!==(i=a.__source)?"\n\nCheck your code at "+i.fileName.replace(/^.*[\\\/]/,"")+":"+i.lineNumber+".":"";l+=c||Ne(),null===e?u="null":U(e)?u="array":void 0!==e&&e.$$typeof===n?(u="<"+(q(e.type)||"Unknown")+" />",l=" Did you accidentally export a JSX literal instead of a component?"):u=typeof e,k("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",u,l)}var d=ee.apply(this,arguments);if(null==d)return d;if(s)for(var f=2;f<arguments.length;f++)je(arguments[f],e);return e===o?function(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var r=t[n];if("children"!==r&&"key"!==r){De(e),k("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r),De(null);break}}null!==e.ref&&(De(e),k("Invalid attribute `ref` supplied to `React.Fragment`."),De(null))}(d):Fe(d),d}var Ue=!1,ze=!1,Ve=null,He=0,qe=!1;function Ge(e){var t=He;He++,null===_.current&&(_.current=[]);var n,r=_.isBatchingLegacy;try{if(_.isBatchingLegacy=!0,n=e(),!r&&_.didScheduleLegacyUpdate){var o=_.current;null!==o&&(_.didScheduleLegacyUpdate=!1,Ke(o))}}catch(c){throw We(t),c}finally{_.isBatchingLegacy=r}if(null!==n&&"object"==typeof n&&"function"==typeof n.then){var a=n,i=!1,s={then:function(e,n){i=!0,a.then(function(r){We(t),0===He?Ye(r,e,n):e(r)},function(e){We(t),n(e)})}};return qe||"undefined"==typeof Promise||Promise.resolve().then(function(){}).then(function(){i||(qe=!0,k("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),s}var l=n;if(We(t),0===He){var u=_.current;return null!==u&&(Ke(u),_.current=null),{then:function(e,t){null===_.current?(_.current=[],Ye(l,e,t)):e(l)}}}return{then:function(e,t){e(l)}}}function We(e){e!==He-1&&k("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),He=e}function Ye(t,n,r){var o=_.current;if(null!==o)try{Ke(o),function(t){if(null===Ve)try{var n=("require"+Math.random()).slice(0,7),r=e&&e[n];Ve=r.call(e,"timers").setImmediate}catch(o){Ve=function(e){!1===ze&&(ze=!0,"undefined"==typeof MessageChannel&&k("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(void 0)}}Ve(t)}(function(){0===o.length?(_.current=null,n(t)):Ye(t,n,r)})}catch(a){r(a)}else n(t)}var Xe=!1;function Ke(e){if(!Xe){Xe=!0;var t=0;try{for(;t<e.length;t++){var n=e[t];do{n=n(!0)}while(null!==n)}e.length=0}catch(r){throw e=e.slice(t+1),r}finally{Xe=!1}}}var Qe=Be,Ze=function(e,t,n){for(var r=te.apply(this,arguments),o=2;o<arguments.length;o++)je(arguments[o],r.type);return Fe(r),r},Je=function(e){var t=Be.bind(null,e);return t.type=e,Ue||(Ue=!0,E("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(t,"type",{enumerable:!1,get:function(){return E("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t},et={map:ue,forEach:function(e,t,n){ue(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ue(e,function(){t++}),t},toArray:function(e){return ue(e,function(e){return e})||[]},only:function(e){if(!ne(e))throw new Error("React.Children.only expected to receive a single React element child.");return e}};t.Children=et,t.Component=C,t.Fragment=o,t.Profiler=i,t.PureComponent=j,t.StrictMode=a,t.Suspense=c,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=T,t.act=Ge,t.cloneElement=Ze,t.createContext=function(e){var t={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};t.Provider={$$typeof:s,_context:t};var n=!1,r=!1,o=!1,a={$$typeof:l,_context:t};return Object.defineProperties(a,{Provider:{get:function(){return r||(r=!0,k("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),t.Provider},set:function(e){t.Provider=e}},_currentValue:{get:function(){return t._currentValue},set:function(e){t._currentValue=e}},_currentValue2:{get:function(){return t._currentValue2},set:function(e){t._currentValue2=e}},_threadCount:{get:function(){return t._threadCount},set:function(e){t._threadCount=e}},Consumer:{get:function(){return n||(n=!0,k("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),t.Consumer}},displayName:{get:function(){return t.displayName},set:function(e){o||(E("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",e),o=!0)}}}),t.Consumer=a,t._currentRenderer=null,t._currentRenderer2=null,t},t.createElement=Qe,t.createFactory=Je,t.createRef=function(){var e={current:null};return Object.seal(e),e},t.forwardRef=function(e){null!=e&&e.$$typeof===f?k("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?k("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&k("forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&(null==e.defaultProps&&null==e.propTypes||k("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"));var t,n={$$typeof:u,render:e};return Object.defineProperty(n,"displayName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(n){t=n,e.name||e.displayName||(e.displayName=n)}}),n},t.isValidElement=ne,t.lazy=function(e){var t,n,r={$$typeof:p,_payload:{_status:-1,_result:e},_init:ce};return Object.defineProperties(r,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){k("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),t=e,Object.defineProperty(r,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return n},set:function(e){k("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),n=e,Object.defineProperty(r,"propTypes",{enumerable:!0})}}}),r},t.memo=function(e,t){de(e)||k("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e);var n,r={$$typeof:f,type:e,compare:void 0===t?null:t};return Object.defineProperty(r,"displayName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(t){n=t,e.name||e.displayName||(e.displayName=t)}}),r},t.startTransition=function(e,t){var n=y.transition;y.transition={};var r=y.transition;y.transition._updatedFibers=new Set;try{e()}finally{y.transition=n,null===n&&r._updatedFibers&&(r._updatedFibers.size>10&&E("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),r._updatedFibers.clear())}},t.unstable_act=Ge,t.useCallback=function(e,t){return fe().useCallback(e,t)},t.useContext=function(e){var t=fe();if(void 0!==e._context){var n=e._context;n.Consumer===e?k("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):n.Provider===e&&k("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return t.useContext(e)},t.useDebugValue=function(e,t){return fe().useDebugValue(e,t)},t.useDeferredValue=function(e){return fe().useDeferredValue(e)},t.useEffect=function(e,t){return fe().useEffect(e,t)},t.useId=function(){return fe().useId()},t.useImperativeHandle=function(e,t,n){return fe().useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return fe().useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return fe().useLayoutEffect(e,t)},t.useMemo=function(e,t){return fe().useMemo(e,t)},t.useReducer=function(e,t,n){return fe().useReducer(e,t,n)},t.useRef=function(e){return fe().useRef(e)},t.useState=function(e){return fe().useState(e)},t.useSyncExternalStore=function(e,t,n){return fe().useSyncExternalStore(e,t,n)},t.useTransition=function(){return fe().useTransition()},t.version="18.3.1","undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),react_development.exports;var e,t}function requireReact(){return hasRequiredReact||(hasRequiredReact=1,"production"===process.env.NODE_ENV?react.exports=requireReact_production_min():react.exports=requireReact_development()),react.exports}
|
|
11
|
+
/**
|
|
12
|
+
* @license React
|
|
13
|
+
* react-jsx-runtime.production.min.js
|
|
14
|
+
*
|
|
15
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
16
|
+
*
|
|
17
|
+
* This source code is licensed under the MIT license found in the
|
|
18
|
+
* LICENSE file in the root directory of this source tree.
|
|
19
|
+
*/function requireReactJsxRuntime_production_min(){if(hasRequiredReactJsxRuntime_production_min)return reactJsxRuntime_production_min;hasRequiredReactJsxRuntime_production_min=1;var e=requireReact(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function i(e,n,i){var s,l={},u=null,c=null;for(s in void 0!==i&&(u=""+i),void 0!==n.key&&(u=""+n.key),void 0!==n.ref&&(c=n.ref),n)r.call(n,s)&&!a.hasOwnProperty(s)&&(l[s]=n[s]);if(e&&e.defaultProps)for(s in n=e.defaultProps)void 0===l[s]&&(l[s]=n[s]);return{$$typeof:t,type:e,key:u,ref:c,props:l,_owner:o.current}}return reactJsxRuntime_production_min.Fragment=n,reactJsxRuntime_production_min.jsx=i,reactJsxRuntime_production_min.jsxs=i,reactJsxRuntime_production_min}react_development.exports;var reactJsxRuntime_development={},hasRequiredReactJsxRuntime_development;
|
|
20
|
+
/**
|
|
21
|
+
* @license React
|
|
22
|
+
* react-jsx-runtime.development.js
|
|
23
|
+
*
|
|
24
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
25
|
+
*
|
|
26
|
+
* This source code is licensed under the MIT license found in the
|
|
27
|
+
* LICENSE file in the root directory of this source tree.
|
|
28
|
+
*/function requireReactJsxRuntime_development(){return hasRequiredReactJsxRuntime_development||(hasRequiredReactJsxRuntime_development=1,"production"!==process.env.NODE_ENV&&function(){var e=requireReact(),t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),h=Symbol.iterator;var m=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];!function(e,t,n){var r=m.ReactDebugCurrentFrame.getStackAddendum();""!==r&&(t+="%s",n=n.concat([r]));var o=n.map(function(e){return String(e)});o.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,o)}("error",e,n)}var b;function y(e){return e.displayName||"Context"}function _(e){if(null==e)return null;if("number"==typeof e.tag&&g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case r:return"Fragment";case n:return"Portal";case a:return"Profiler";case o:return"StrictMode";case u:return"Suspense";case c:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case s:return y(e)+".Consumer";case i:return y(e._context)+".Provider";case l:return function(e,t,n){var r=e.displayName;if(r)return r;var o=t.displayName||t.name||"";return""!==o?n+"("+o+")":n}(e,e.render,"ForwardRef");case d:var t=e.displayName||null;return null!==t?t:_(e.type)||"Memo";case f:var p=e,h=p._payload,m=p._init;try{return _(m(h))}catch(b){return null}}return null}b=Symbol.for("react.module.reference");var v,w,S,x,T,E,k,P=Object.assign,O=0;function A(){}A.__reactDisabledLog=!0;var R,$=m.ReactCurrentDispatcher;function I(e,t,n){if(void 0===R)try{throw Error()}catch(o){var r=o.stack.trim().match(/\n( *(at )?)/);R=r&&r[1]||""}return"\n"+R+e}var C,D=!1,N="function"==typeof WeakMap?WeakMap:Map;function M(e,t){if(!e||D)return"";var n,r=C.get(e);if(void 0!==r)return r;D=!0;var o,a=Error.prepareStackTrace;Error.prepareStackTrace=void 0,o=$.current,$.current=null,function(){if(0===O){v=console.log,w=console.info,S=console.warn,x=console.error,T=console.group,E=console.groupCollapsed,k=console.groupEnd;var e={configurable:!0,enumerable:!0,value:A,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}O++}();try{if(t){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(i,[])}catch(h){n=h}Reflect.construct(e,[],i)}else{try{i.call()}catch(h){n=h}e.call(i.prototype)}}else{try{throw Error()}catch(h){n=h}e()}}catch(m){if(m&&n&&"string"==typeof m.stack){for(var s=m.stack.split("\n"),l=n.stack.split("\n"),u=s.length-1,c=l.length-1;u>=1&&c>=0&&s[u]!==l[c];)c--;for(;u>=1&&c>=0;u--,c--)if(s[u]!==l[c]){if(1!==u||1!==c)do{if(u--,--c<0||s[u]!==l[c]){var d="\n"+s[u].replace(" at new "," at ");return e.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",e.displayName)),"function"==typeof e&&C.set(e,d),d}}while(u>=1&&c>=0);break}}}finally{D=!1,$.current=o,function(){if(0===--O){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:P({},e,{value:v}),info:P({},e,{value:w}),warn:P({},e,{value:S}),error:P({},e,{value:x}),group:P({},e,{value:T}),groupCollapsed:P({},e,{value:E}),groupEnd:P({},e,{value:k})})}O<0&&g("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=a}var f=e?e.displayName||e.name:"",p=f?I(f):"";return"function"==typeof e&&C.set(e,p),p}function L(e,t,n){if(null==e)return"";if("function"==typeof e)return M(e,!(!(r=e.prototype)||!r.isReactComponent));var r;if("string"==typeof e)return I(e);switch(e){case u:return I("Suspense");case c:return I("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case l:return M(e.render,!1);case d:return L(e.type,t,n);case f:var o=e,a=o._payload,i=o._init;try{return L(i(a),t,n)}catch(s){}}return""}C=new N;var j=Object.prototype.hasOwnProperty,F={},B=m.ReactDebugCurrentFrame;function U(e){if(e){var t=e._owner,n=L(e.type,e._source,t?t.type:null);B.setExtraStackFrame(n)}else B.setExtraStackFrame(null)}var z=Array.isArray;function V(e){return z(e)}function H(e){return""+e}function q(e){if(function(e){try{return H(e),!1}catch(t){return!0}}(e))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),H(e)}var G,W,Y=m.ReactCurrentOwner,X={key:!0,ref:!0,__self:!0,__source:!0};function K(e,n,r,o,a){var i,s={},l=null,u=null;for(i in void 0!==r&&(q(r),l=""+r),function(e){if(j.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(n)&&(q(n.key),l=""+n.key),function(e){if(j.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(n)&&(u=n.ref,function(e){"string"==typeof e.ref&&Y.current}(n)),n)j.call(n,i)&&!X.hasOwnProperty(i)&&(s[i]=n[i]);if(e&&e.defaultProps){var c=e.defaultProps;for(i in c)void 0===s[i]&&(s[i]=c[i])}if(l||u){var d="function"==typeof e?e.displayName||e.name||"Unknown":e;l&&function(e,t){var n=function(){G||(G=!0,g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(s,d),u&&function(e,t){var n=function(){W||(W=!0,g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(s,d)}return function(e,n,r,o,a,i,s){var l={$$typeof:t,type:e,key:n,ref:r,props:s,_owner:i,_store:{}};return Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(l,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(l,"_source",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}(e,l,u,a,o,Y.current,s)}var Q,Z=m.ReactCurrentOwner,J=m.ReactDebugCurrentFrame;function ee(e){if(e){var t=e._owner,n=L(e.type,e._source,t?t.type:null);J.setExtraStackFrame(n)}else J.setExtraStackFrame(null)}function te(e){return"object"==typeof e&&null!==e&&e.$$typeof===t}function ne(){if(Z.current){var e=_(Z.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}Q=!1;var re={};function oe(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=ne();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!re[n]){re[n]=!0;var r="";e&&e._owner&&e._owner!==Z.current&&(r=" It was passed a child from "+_(e._owner.type)+"."),ee(e),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,r),ee(null)}}}function ae(e,t){if("object"==typeof e)if(V(e))for(var n=0;n<e.length;n++){var r=e[n];te(r)&&oe(r,t)}else if(te(e))e._store&&(e._store.validated=!0);else if(e){var o=function(e){if(null===e||"object"!=typeof e)return null;var t=h&&e[h]||e["@@iterator"];return"function"==typeof t?t:null}(e);if("function"==typeof o&&o!==e.entries)for(var a,i=o.call(e);!(a=i.next()).done;)te(a.value)&&oe(a.value,t)}}function ie(e){var t,n=e.type;if(null!=n&&"string"!=typeof n){if("function"==typeof n)t=n.propTypes;else{if("object"!=typeof n||n.$$typeof!==l&&n.$$typeof!==d)return;t=n.propTypes}if(t){var r=_(n);!function(e,t,n,r,o){var a=Function.call.bind(j);for(var i in e)if(a(e,i)){var s=void 0;try{if("function"!=typeof e[i]){var l=Error((r||"React class")+": "+n+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}s=e[i](t,i,r,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(u){s=u}!s||s instanceof Error||(U(o),g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||"React class",n,i,typeof s),U(null)),s instanceof Error&&!(s.message in F)&&(F[s.message]=!0,U(o),g("Failed %s type: %s",n,s.message),U(null))}}(t,e.props,"prop",r,e)}else if(void 0!==n.PropTypes&&!Q){Q=!0,g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",_(n)||"Unknown")}"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}var se={};function le(e,n,h,m,y,v){var w=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===a||e===o||e===u||e===c||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===d||e.$$typeof===i||e.$$typeof===s||e.$$typeof===l||e.$$typeof===b||void 0!==e.getModuleId)}(e);if(!w){var S="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(S+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var x;S+=ne(),null===e?x="null":V(e)?x="array":void 0!==e&&e.$$typeof===t?(x="<"+(_(e.type)||"Unknown")+" />",S=" Did you accidentally export a JSX literal instead of a component?"):x=typeof e,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",x,S)}var T=K(e,n,h,y,v);if(null==T)return T;if(w){var E=n.children;if(void 0!==E)if(m)if(V(E)){for(var k=0;k<E.length;k++)ae(E[k],e);Object.freeze&&Object.freeze(E)}else g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ae(E,e)}if(j.call(n,"key")){var P=_(e),O=Object.keys(n).filter(function(e){return"key"!==e}),A=O.length>0?"{key: someKey, "+O.join(": ..., ")+": ...}":"{key: someKey}";if(!se[P+A])g('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',A,P,O.length>0?"{"+O.join(": ..., ")+": ...}":"{}",P),se[P+A]=!0}return e===r?function(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var r=t[n];if("children"!==r&&"key"!==r){ee(e),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r),ee(null);break}}null!==e.ref&&(ee(e),g("Invalid attribute `ref` supplied to `React.Fragment`."),ee(null))}(T):ie(T),T}var ue=function(e,t,n){return le(e,t,n,!1)},ce=function(e,t,n){return le(e,t,n,!0)};reactJsxRuntime_development.Fragment=r,reactJsxRuntime_development.jsx=ue,reactJsxRuntime_development.jsxs=ce}()),reactJsxRuntime_development}"production"===process.env.NODE_ENV?jsxRuntime.exports=requireReactJsxRuntime_production_min():jsxRuntime.exports=requireReactJsxRuntime_development();var jsxRuntimeExports=jsxRuntime.exports,reactDom={exports:{}},reactDom_production_min={},scheduler={exports:{}},scheduler_production_min={},hasRequiredScheduler_production_min;function requireScheduler_production_min(){return hasRequiredScheduler_production_min||(hasRequiredScheduler_production_min=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,a=e[r];if(!(0<o(a,t)))break e;e[r]=t,e[n]=a,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,a=e.length,i=a>>>1;r<i;){var s=2*(r+1)-1,l=e[s],u=s+1,c=e[u];if(0>o(l,n))u<a&&0>o(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[s]=n,r=s);else{if(!(u<a&&0>o(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var a=performance;e.unstable_now=function(){return a.now()}}else{var i=Date,s=i.now();e.unstable_now=function(){return i.now()-s}}var l=[],u=[],c=1,d=null,f=3,p=!1,h=!1,m=!1,g="function"==typeof setTimeout?setTimeout:null,b="function"==typeof clearTimeout?clearTimeout:null,y="undefined"!=typeof setImmediate?setImmediate:null;function _(e){for(var o=n(u);null!==o;){if(null===o.callback)r(u);else{if(!(o.startTime<=e))break;r(u),o.sortIndex=o.expirationTime,t(l,o)}o=n(u)}}function v(e){if(m=!1,_(e),!h)if(null!==n(l))h=!0,I(w);else{var t=n(u);null!==t&&C(v,t.startTime-e)}}function w(t,o){h=!1,m&&(m=!1,b(E),E=-1),p=!0;var a=f;try{for(_(o),d=n(l);null!==d&&(!(d.expirationTime>o)||t&&!O());){var i=d.callback;if("function"==typeof i){d.callback=null,f=d.priorityLevel;var s=i(d.expirationTime<=o);o=e.unstable_now(),"function"==typeof s?d.callback=s:d===n(l)&&r(l),_(o)}else r(l);d=n(l)}if(null!==d)var c=!0;else{var g=n(u);null!==g&&C(v,g.startTime-o),c=!1}return c}finally{d=null,f=a,p=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S,x=!1,T=null,E=-1,k=5,P=-1;function O(){return!(e.unstable_now()-P<k)}function A(){if(null!==T){var t=e.unstable_now();P=t;var n=!0;try{n=T(!0,t)}finally{n?S():(x=!1,T=null)}}else x=!1}if("function"==typeof y)S=function(){y(A)};else if("undefined"!=typeof MessageChannel){var R=new MessageChannel,$=R.port2;R.port1.onmessage=A,S=function(){$.postMessage(null)}}else S=function(){g(A,0)};function I(e){T=e,x||(x=!0,S())}function C(t,n){E=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){h||p||(h=!0,I(w))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,o,a){var i=e.unstable_now();switch("object"==typeof a&&null!==a?a="number"==typeof(a=a.delay)&&0<a?i+a:i:a=i,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return r={id:c++,callback:o,priorityLevel:r,startTime:a,expirationTime:s=a+s,sortIndex:-1},a>i?(r.sortIndex=a,t(u,r),null===n(l)&&r===n(u)&&(m?(b(E),E=-1):m=!0,C(v,a-i))):(r.sortIndex=s,t(l,r),h||p||(h=!0,I(w))),r},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(scheduler_production_min)),scheduler_production_min}var scheduler_development={},hasRequiredScheduler_development,hasRequiredScheduler,hasRequiredReactDom_production_min;
|
|
29
|
+
/**
|
|
30
|
+
* @license React
|
|
31
|
+
* scheduler.development.js
|
|
32
|
+
*
|
|
33
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
34
|
+
*
|
|
35
|
+
* This source code is licensed under the MIT license found in the
|
|
36
|
+
* LICENSE file in the root directory of this source tree.
|
|
37
|
+
*/function requireScheduler_development(){return hasRequiredScheduler_development||(hasRequiredScheduler_development=1,e=scheduler_development,"production"!==process.env.NODE_ENV&&function(){function t(e,t){var n=e.length;e.push(t),function(e,t,n){for(var r=n;r>0;){var a=r-1>>>1,i=e[a];if(!(o(i,t)>0))return;e[a]=t,e[r]=i,r=a}}(e,t,n)}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();return n!==t&&(e[0]=n,function(e,t,n){for(var r=n,a=e.length,i=a>>>1;r<i;){var s=2*(r+1)-1,l=e[s],u=s+1,c=e[u];if(o(l,t)<0)u<a&&o(c,l)<0?(e[r]=c,e[u]=t,r=u):(e[r]=l,e[s]=t,r=s);else{if(!(u<a&&o(c,t)<0))return;e[r]=c,e[u]=t,r=u}}}(e,n,0)),t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error),"object"==typeof performance&&"function"==typeof performance.now){var a=performance;e.unstable_now=function(){return a.now()}}else{var i=Date,s=i.now();e.unstable_now=function(){return i.now()-s}}var l=[],u=[],c=1,d=null,f=3,p=!1,h=!1,m=!1,g="function"==typeof setTimeout?setTimeout:null,b="function"==typeof clearTimeout?clearTimeout:null,y="undefined"!=typeof setImmediate?setImmediate:null;function _(e){for(var o=n(u);null!==o;){if(null===o.callback)r(u);else{if(!(o.startTime<=e))return;r(u),o.sortIndex=o.expirationTime,t(l,o)}o=n(u)}}function v(e){if(m=!1,_(e),!h)if(null!==n(l))h=!0,I(w);else{var t=n(u);null!==t&&C(v,t.startTime-e)}}function w(t,o){h=!1,m&&(m=!1,D()),p=!0;var a=f;try{return function(t,o){var a=o;for(_(a),d=n(l);null!==d&&(!(d.expirationTime>a)||t&&!P());){var i=d.callback;if("function"==typeof i){d.callback=null,f=d.priorityLevel;var s=i(d.expirationTime<=a);a=e.unstable_now(),"function"==typeof s?d.callback=s:d===n(l)&&r(l),_(a)}else r(l);d=n(l)}if(null!==d)return!0;var c=n(u);return null!==c&&C(v,c.startTime-a),!1}(t,o)}finally{d=null,f=a,p=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S=!1,x=null,T=-1,E=5,k=-1;function P(){return!(e.unstable_now()-k<E)}var O,A=function(){if(null!==x){var t=e.unstable_now();k=t;var n=!0;try{n=x(!0,t)}finally{n?O():(S=!1,x=null)}}else S=!1};if("function"==typeof y)O=function(){y(A)};else if("undefined"!=typeof MessageChannel){var R=new MessageChannel,$=R.port2;R.port1.onmessage=A,O=function(){$.postMessage(null)}}else O=function(){g(A,0)};function I(e){x=e,S||(S=!0,O())}function C(t,n){T=g(function(){t(e.unstable_now())},n)}function D(){b(T),T=-1}var N=function(){};e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){h||p||(h=!0,I(w))},e.unstable_forceFrameRate=function(e){e<0||e>125?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=e>0?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(e){var t;switch(f){case 1:case 2:case 3:t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=N,e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,o,a){var i,s,d=e.unstable_now();if("object"==typeof a&&null!==a){var f=a.delay;i="number"==typeof f&&f>0?d+f:d}else i=d;switch(r){case 1:s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}var g=i+s,b={id:c++,callback:o,priorityLevel:r,startTime:i,expirationTime:g,sortIndex:-1};return i>d?(b.sortIndex=i,t(u,b),null===n(l)&&b===n(u)&&(m?D():m=!0,C(v,i-d))):(b.sortIndex=g,t(l,b),h||p||(h=!0,I(w))),b},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),scheduler_development;var e}function requireScheduler(){return hasRequiredScheduler||(hasRequiredScheduler=1,"production"===process.env.NODE_ENV?scheduler.exports=requireScheduler_production_min():scheduler.exports=requireScheduler_development()),scheduler.exports}
|
|
38
|
+
/**
|
|
39
|
+
* @license React
|
|
40
|
+
* react-dom.production.min.js
|
|
41
|
+
*
|
|
42
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
43
|
+
*
|
|
44
|
+
* This source code is licensed under the MIT license found in the
|
|
45
|
+
* LICENSE file in the root directory of this source tree.
|
|
46
|
+
*/function requireReactDom_production_min(){if(hasRequiredReactDom_production_min)return reactDom_production_min;hasRequiredReactDom_production_min=1;var e=requireReact(),t=requireScheduler();function n(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,o={};function a(e,t){i(e,t),i(e+"Capture",t)}function i(e,t){for(o[e]=t,e=0;e<t.length;e++)r.add(t[e])}var s=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),l=Object.prototype.hasOwnProperty,u=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,c={},d={};function f(e,t,n,r,o,a,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=i}var p={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){p[e]=new f(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];p[t]=new f(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){p[e]=new f(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){p[e]=new f(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){p[e]=new f(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){p[e]=new f(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){p[e]=new f(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){p[e]=new f(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){p[e]=new f(e,5,!1,e.toLowerCase(),null,!1,!1)});var h=/[\-:]([a-z])/g;function m(e){return e[1].toUpperCase()}function g(e,t,n,r){var o=p.hasOwnProperty(t)?p[t]:null;(null!==o?0!==o.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,o,r)&&(n=null),r||null===o?function(e){return!!l.call(d,e)||!l.call(c,e)&&(u.test(e)?d[e]=!0:(c[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(h,m);p[t]=new f(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(h,m);p[t]=new f(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(h,m);p[t]=new f(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){p[e]=new f(e,1,!1,e.toLowerCase(),null,!1,!1)}),p.xlinkHref=new f("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){p[e]=new f(e,1,!1,e.toLowerCase(),null,!0,!0)});var b=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,y=Symbol.for("react.element"),_=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),x=Symbol.for("react.provider"),T=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),$=Symbol.iterator;function I(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=$&&e[$]||e["@@iterator"])?e:null}var C,D=Object.assign;function N(e){if(void 0===C)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);C=t&&t[1]||""}return"\n"+C+e}var M=!1;function L(e,t){if(!e||M)return"";M=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&"string"==typeof u.stack){for(var o=u.stack.split("\n"),a=r.stack.split("\n"),i=o.length-1,s=a.length-1;1<=i&&0<=s&&o[i]!==a[s];)s--;for(;1<=i&&0<=s;i--,s--)if(o[i]!==a[s]){if(1!==i||1!==s)do{if(i--,0>--s||o[i]!==a[s]){var l="\n"+o[i].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=i&&0<=s);break}}}finally{M=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?N(e):""}function j(e){switch(e.tag){case 5:return N(e.type);case 16:return N("Lazy");case 13:return N("Suspense");case 19:return N("SuspenseList");case 0:case 2:case 15:return e=L(e.type,!1);case 11:return e=L(e.type.render,!1);case 1:return e=L(e.type,!0);default:return""}}function F(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case v:return"Fragment";case _:return"Portal";case S:return"Profiler";case w:return"StrictMode";case k:return"Suspense";case P:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case T:return(e.displayName||"Context")+".Consumer";case x:return(e._context.displayName||"Context")+".Provider";case E:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case O:return null!==(t=e.displayName||null)?t:F(e.type)||"Memo";case A:t=e._payload,e=e._init;try{return F(e(t))}catch(n){}}return null}function B(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return F(t);case 8:return t===w?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function U(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function z(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function V(e){e._valueTracker||(e._valueTracker=function(e){var t=z(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var o=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function H(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=z(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function q(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function G(e,t){var n=t.checked;return D({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function W(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=U(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Y(e,t){null!=(t=t.checked)&&g(e,"checked",t,!1)}function X(e,t){Y(e,t);var n=U(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?Q(e,t.type,n):t.hasOwnProperty("defaultValue")&&Q(e,t.type,U(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function K(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function Q(e,t,n){"number"===t&&q(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Z=Array.isArray;function J(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+U(n),t=null,o=0;o<e.length;o++){if(e[o].value===n)return e[o].selected=!0,void(r&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function ee(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(n(91));return D({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function te(e,t){var r=t.value;if(null==r){if(r=t.children,t=t.defaultValue,null!=r){if(null!=t)throw Error(n(92));if(Z(r)){if(1<r.length)throw Error(n(93));r=r[0]}t=r}null==t&&(t=""),r=t}e._wrapperState={initialValue:U(r)}}function ne(e,t){var n=U(t.value),r=U(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function re(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function oe(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ae(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?oe(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ie,se,le=(se=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ie=ie||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ie.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction(function(){return se(e,t)})}:se);function ue(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var ce={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},de=["Webkit","ms","Moz","O"];function fe(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||ce.hasOwnProperty(e)&&ce[e]?(""+t).trim():t+"px"}function pe(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=fe(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}Object.keys(ce).forEach(function(e){de.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ce[t]=ce[e]})});var he=D({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function me(e,t){if(t){if(he[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(n(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(n(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(n(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(n(62))}}function ge(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var be=null;function ye(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var _e=null,ve=null,we=null;function Se(e){if(e=bo(e)){if("function"!=typeof _e)throw Error(n(280));var t=e.stateNode;t&&(t=_o(t),_e(e.stateNode,e.type,t))}}function xe(e){ve?we?we.push(e):we=[e]:ve=e}function Te(){if(ve){var e=ve,t=we;if(we=ve=null,Se(e),t)for(e=0;e<t.length;e++)Se(t[e])}}function Ee(e,t){return e(t)}function ke(){}var Pe=!1;function Oe(e,t,n){if(Pe)return e(t,n);Pe=!0;try{return Ee(e,t,n)}finally{Pe=!1,(null!==ve||null!==we)&&(ke(),Te())}}function Ae(e,t){var r=e.stateNode;if(null===r)return null;var o=_o(r);if(null===o)return null;r=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(o=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!o;break e;default:e=!1}if(e)return null;if(r&&"function"!=typeof r)throw Error(n(231,t,typeof r));return r}var Re=!1;if(s)try{var $e={};Object.defineProperty($e,"passive",{get:function(){Re=!0}}),window.addEventListener("test",$e,$e),window.removeEventListener("test",$e,$e)}catch(se){Re=!1}function Ie(e,t,n,r,o,a,i,s,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var Ce=!1,De=null,Ne=!1,Me=null,Le={onError:function(e){Ce=!0,De=e}};function je(e,t,n,r,o,a,i,s,l){Ce=!1,De=null,Ie.apply(Le,arguments)}function Fe(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Be(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Ue(e){if(Fe(e)!==e)throw Error(n(188))}function ze(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=Fe(e)))throw Error(n(188));return t!==e?null:e}for(var r=e,o=t;;){var a=r.return;if(null===a)break;var i=a.alternate;if(null===i){if(null!==(o=a.return)){r=o;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===r)return Ue(a),e;if(i===o)return Ue(a),t;i=i.sibling}throw Error(n(188))}if(r.return!==o.return)r=a,o=i;else{for(var s=!1,l=a.child;l;){if(l===r){s=!0,r=a,o=i;break}if(l===o){s=!0,o=a,r=i;break}l=l.sibling}if(!s){for(l=i.child;l;){if(l===r){s=!0,r=i,o=a;break}if(l===o){s=!0,o=i,r=a;break}l=l.sibling}if(!s)throw Error(n(189))}}if(r.alternate!==o)throw Error(n(190))}if(3!==r.tag)throw Error(n(188));return r.stateNode.current===r?e:t}(e))?Ve(e):null}function Ve(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=Ve(e);if(null!==t)return t;e=e.sibling}return null}var He=t.unstable_scheduleCallback,qe=t.unstable_cancelCallback,Ge=t.unstable_shouldYield,We=t.unstable_requestPaint,Ye=t.unstable_now,Xe=t.unstable_getCurrentPriorityLevel,Ke=t.unstable_ImmediatePriority,Qe=t.unstable_UserBlockingPriority,Ze=t.unstable_NormalPriority,Je=t.unstable_LowPriority,et=t.unstable_IdlePriority,tt=null,nt=null;var rt=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(ot(e)/at|0)|0},ot=Math.log,at=Math.LN2;var it=64,st=4194304;function lt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ut(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,o=e.suspendedLanes,a=e.pingedLanes,i=268435455&n;if(0!==i){var s=i&~o;0!==s?r=lt(s):0!==(a&=i)&&(r=lt(a))}else 0!==(i=n&~o)?r=lt(i):0!==a&&(r=lt(a));if(0===r)return 0;if(0!==t&&t!==r&&0===(t&o)&&((o=r&-r)>=(a=t&-t)||16===o&&4194240&a))return t;if(4&r&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)o=1<<(n=31-rt(t)),r|=e[n],t&=~o;return r}function ct(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function dt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function ft(){var e=it;return!(4194240&(it<<=1))&&(it=64),e}function pt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ht(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-rt(t)]=n}function mt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-rt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var gt=0;function bt(e){return 1<(e&=-e)?4<e?268435455&e?16:536870912:4:1}var yt,_t,vt,wt,St,xt=!1,Tt=[],Et=null,kt=null,Pt=null,Ot=new Map,At=new Map,Rt=[],$t="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function It(e,t){switch(e){case"focusin":case"focusout":Et=null;break;case"dragenter":case"dragleave":kt=null;break;case"mouseover":case"mouseout":Pt=null;break;case"pointerover":case"pointerout":Ot.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":At.delete(t.pointerId)}}function Ct(e,t,n,r,o,a){return null===e||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[o]},null!==t&&(null!==(t=bo(t))&&_t(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==o&&-1===t.indexOf(o)&&t.push(o),e)}function Dt(e){var t=go(e.target);if(null!==t){var n=Fe(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Be(n)))return e.blockedOn=t,void St(e.priority,function(){vt(n)})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Nt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Gt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=bo(n))&&_t(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);be=r,n.target.dispatchEvent(r),be=null,t.shift()}return!0}function Mt(e,t,n){Nt(e)&&n.delete(t)}function Lt(){xt=!1,null!==Et&&Nt(Et)&&(Et=null),null!==kt&&Nt(kt)&&(kt=null),null!==Pt&&Nt(Pt)&&(Pt=null),Ot.forEach(Mt),At.forEach(Mt)}function jt(e,n){e.blockedOn===n&&(e.blockedOn=null,xt||(xt=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Lt)))}function Ft(e){function t(t){return jt(t,e)}if(0<Tt.length){jt(Tt[0],e);for(var n=1;n<Tt.length;n++){var r=Tt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==Et&&jt(Et,e),null!==kt&&jt(kt,e),null!==Pt&&jt(Pt,e),Ot.forEach(t),At.forEach(t),n=0;n<Rt.length;n++)(r=Rt[n]).blockedOn===e&&(r.blockedOn=null);for(;0<Rt.length&&null===(n=Rt[0]).blockedOn;)Dt(n),null===n.blockedOn&&Rt.shift()}var Bt=b.ReactCurrentBatchConfig,Ut=!0;function zt(e,t,n,r){var o=gt,a=Bt.transition;Bt.transition=null;try{gt=1,Ht(e,t,n,r)}finally{gt=o,Bt.transition=a}}function Vt(e,t,n,r){var o=gt,a=Bt.transition;Bt.transition=null;try{gt=4,Ht(e,t,n,r)}finally{gt=o,Bt.transition=a}}function Ht(e,t,n,r){if(Ut){var o=Gt(e,t,n,r);if(null===o)Ur(e,t,r,qt,n),It(e,r);else if(function(e,t,n,r,o){switch(t){case"focusin":return Et=Ct(Et,e,t,n,r,o),!0;case"dragenter":return kt=Ct(kt,e,t,n,r,o),!0;case"mouseover":return Pt=Ct(Pt,e,t,n,r,o),!0;case"pointerover":var a=o.pointerId;return Ot.set(a,Ct(Ot.get(a)||null,e,t,n,r,o)),!0;case"gotpointercapture":return a=o.pointerId,At.set(a,Ct(At.get(a)||null,e,t,n,r,o)),!0}return!1}(o,e,t,n,r))r.stopPropagation();else if(It(e,r),4&t&&-1<$t.indexOf(e)){for(;null!==o;){var a=bo(o);if(null!==a&&yt(a),null===(a=Gt(e,t,n,r))&&Ur(e,t,r,qt,n),a===o)break;o=a}null!==o&&r.stopPropagation()}else Ur(e,t,r,null,n)}}var qt=null;function Gt(e,t,n,r){if(qt=null,null!==(e=go(e=ye(r))))if(null===(t=Fe(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=Be(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return qt=e,null}function Wt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Xe()){case Ke:return 1;case Qe:return 4;case Ze:case Je:return 16;case et:return 536870912;default:return 16}default:return 16}}var Yt=null,Xt=null,Kt=null;function Qt(){if(Kt)return Kt;var e,t,n=Xt,r=n.length,o="value"in Yt?Yt.value:Yt.textContent,a=o.length;for(e=0;e<r&&n[e]===o[e];e++);var i=r-e;for(t=1;t<=i&&n[r-t]===o[a-t];t++);return Kt=o.slice(e,1<t?1-t:void 0)}function Zt(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function Jt(){return!0}function en(){return!1}function tn(e){function t(t,n,r,o,a){for(var i in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=o,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(i)&&(t=e[i],this[i]=t?t(o):o[i]);return this.isDefaultPrevented=(null!=o.defaultPrevented?o.defaultPrevented:!1===o.returnValue)?Jt:en,this.isPropagationStopped=en,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Jt)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Jt)},persist:function(){},isPersistent:Jt}),t}var nn,rn,on,an={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sn=tn(an),ln=D({},an,{view:0,detail:0}),un=tn(ln),cn=D({},ln,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==on&&(on&&"mousemove"===e.type?(nn=e.screenX-on.screenX,rn=e.screenY-on.screenY):rn=nn=0,on=e),nn)},movementY:function(e){return"movementY"in e?e.movementY:rn}}),dn=tn(cn),fn=tn(D({},cn,{dataTransfer:0})),pn=tn(D({},ln,{relatedTarget:0})),hn=tn(D({},an,{animationName:0,elapsedTime:0,pseudoElement:0})),mn=D({},an,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),gn=tn(mn),bn=tn(D({},an,{data:0})),yn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_n={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},vn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=vn[e])&&!!t[e]}function Sn(){return wn}var xn=D({},ln,{key:function(e){if(e.key){var t=yn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Zt(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?_n[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sn,charCode:function(e){return"keypress"===e.type?Zt(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Zt(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),Tn=tn(xn),En=tn(D({},cn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),kn=tn(D({},ln,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sn})),Pn=tn(D({},an,{propertyName:0,elapsedTime:0,pseudoElement:0})),On=D({},cn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),An=tn(On),Rn=[9,13,27,32],$n=s&&"CompositionEvent"in window,In=null;s&&"documentMode"in document&&(In=document.documentMode);var Cn=s&&"TextEvent"in window&&!In,Dn=s&&(!$n||In&&8<In&&11>=In),Nn=String.fromCharCode(32),Mn=!1;function Ln(e,t){switch(e){case"keyup":return-1!==Rn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Fn=!1;var Bn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Un(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Bn[e.type]:"textarea"===t}function zn(e,t,n,r){xe(r),0<(t=Vr(t,"onChange")).length&&(n=new sn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Vn=null,Hn=null;function qn(e){Nr(e,0)}function Gn(e){if(H(yo(e)))return e}function Wn(e,t){if("change"===e)return t}var Yn=!1;if(s){var Xn;if(s){var Kn="oninput"in document;if(!Kn){var Qn=document.createElement("div");Qn.setAttribute("oninput","return;"),Kn="function"==typeof Qn.oninput}Xn=Kn}else Xn=!1;Yn=Xn&&(!document.documentMode||9<document.documentMode)}function Zn(){Vn&&(Vn.detachEvent("onpropertychange",Jn),Hn=Vn=null)}function Jn(e){if("value"===e.propertyName&&Gn(Hn)){var t=[];zn(t,Hn,e,ye(e)),Oe(qn,t)}}function er(e,t,n){"focusin"===e?(Zn(),Hn=n,(Vn=t).attachEvent("onpropertychange",Jn)):"focusout"===e&&Zn()}function tr(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Gn(Hn)}function nr(e,t){if("click"===e)return Gn(t)}function rr(e,t){if("input"===e||"change"===e)return Gn(t)}var or="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function ar(e,t){if(or(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!l.call(t,o)||!or(e[o],t[o]))return!1}return!0}function ir(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function sr(e,t){var n,r=ir(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=ir(r)}}function lr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?lr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function ur(){for(var e=window,t=q();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=q((e=t.contentWindow).document)}return t}function cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function dr(e){var t=ur(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&lr(n.ownerDocument.documentElement,n)){if(null!==r&&cr(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var o=n.textContent.length,a=Math.min(r.start,o);r=void 0===r.end?a:Math.min(r.end,o),!e.extend&&a>r&&(o=r,r=a,a=o),o=sr(n,a);var i=sr(n,r);o&&i&&(1!==e.rangeCount||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&((t=t.createRange()).setStart(o.node,o.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var fr=s&&"documentMode"in document&&11>=document.documentMode,pr=null,hr=null,mr=null,gr=!1;function br(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;gr||null==pr||pr!==q(r)||("selectionStart"in(r=pr)&&cr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},mr&&ar(mr,r)||(mr=r,0<(r=Vr(hr,"onSelect")).length&&(t=new sn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=pr)))}function yr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var _r={animationend:yr("Animation","AnimationEnd"),animationiteration:yr("Animation","AnimationIteration"),animationstart:yr("Animation","AnimationStart"),transitionend:yr("Transition","TransitionEnd")},vr={},wr={};function Sr(e){if(vr[e])return vr[e];if(!_r[e])return e;var t,n=_r[e];for(t in n)if(n.hasOwnProperty(t)&&t in wr)return vr[e]=n[t];return e}s&&(wr=document.createElement("div").style,"AnimationEvent"in window||(delete _r.animationend.animation,delete _r.animationiteration.animation,delete _r.animationstart.animation),"TransitionEvent"in window||delete _r.transitionend.transition);var xr=Sr("animationend"),Tr=Sr("animationiteration"),Er=Sr("animationstart"),kr=Sr("transitionend"),Pr=new Map,Or="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ar(e,t){Pr.set(e,t),a(t,[e])}for(var Rr=0;Rr<Or.length;Rr++){var $r=Or[Rr];Ar($r.toLowerCase(),"on"+($r[0].toUpperCase()+$r.slice(1)))}Ar(xr,"onAnimationEnd"),Ar(Tr,"onAnimationIteration"),Ar(Er,"onAnimationStart"),Ar("dblclick","onDoubleClick"),Ar("focusin","onFocus"),Ar("focusout","onBlur"),Ar(kr,"onTransitionEnd"),i("onMouseEnter",["mouseout","mouseover"]),i("onMouseLeave",["mouseout","mouseover"]),i("onPointerEnter",["pointerout","pointerover"]),i("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ir="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Cr=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ir));function Dr(e,t,r){var o=e.type||"unknown-event";e.currentTarget=r,function(e,t,r,o,a,i,s,l,u){if(je.apply(this,arguments),Ce){if(!Ce)throw Error(n(198));var c=De;Ce=!1,De=null,Ne||(Ne=!0,Me=c)}}(o,t,void 0,e),e.currentTarget=null}function Nr(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var i=r.length-1;0<=i;i--){var s=r[i],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==a&&o.isPropagationStopped())break e;Dr(o,s,u),a=l}else for(i=0;i<r.length;i++){if(l=(s=r[i]).instance,u=s.currentTarget,s=s.listener,l!==a&&o.isPropagationStopped())break e;Dr(o,s,u),a=l}}}if(Ne)throw e=Me,Ne=!1,Me=null,e}function Mr(e,t){var n=t[po];void 0===n&&(n=t[po]=new Set);var r=e+"__bubble";n.has(r)||(Br(t,e,2,!1),n.add(r))}function Lr(e,t,n){var r=0;t&&(r|=4),Br(n,e,r,t)}var jr="_reactListening"+Math.random().toString(36).slice(2);function Fr(e){if(!e[jr]){e[jr]=!0,r.forEach(function(t){"selectionchange"!==t&&(Cr.has(t)||Lr(t,!1,e),Lr(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[jr]||(t[jr]=!0,Lr("selectionchange",!1,t))}}function Br(e,t,n,r){switch(Wt(t)){case 1:var o=zt;break;case 4:o=Vt;break;default:o=Ht}n=o.bind(null,t,n,e),o=void 0,!Re||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(o=!0),r?void 0!==o?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):void 0!==o?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Ur(e,t,n,r,o){var a=r;if(!(1&t||2&t||null===r))e:for(;;){if(null===r)return;var i=r.tag;if(3===i||4===i){var s=r.stateNode.containerInfo;if(s===o||8===s.nodeType&&s.parentNode===o)break;if(4===i)for(i=r.return;null!==i;){var l=i.tag;if((3===l||4===l)&&((l=i.stateNode.containerInfo)===o||8===l.nodeType&&l.parentNode===o))return;i=i.return}for(;null!==s;){if(null===(i=go(s)))return;if(5===(l=i.tag)||6===l){r=a=i;continue e}s=s.parentNode}}r=r.return}Oe(function(){var r=a,o=ye(n),i=[];e:{var s=Pr.get(e);if(void 0!==s){var l=sn,u=e;switch(e){case"keypress":if(0===Zt(n))break e;case"keydown":case"keyup":l=Tn;break;case"focusin":u="focus",l=pn;break;case"focusout":u="blur",l=pn;break;case"beforeblur":case"afterblur":l=pn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=dn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=fn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=kn;break;case xr:case Tr:case Er:l=hn;break;case kr:l=Pn;break;case"scroll":l=un;break;case"wheel":l=An;break;case"copy":case"cut":case"paste":l=gn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=En}var c=!!(4&t),d=!c&&"scroll"===e,f=c?null!==s?s+"Capture":null:s;c=[];for(var p,h=r;null!==h;){var m=(p=h).stateNode;if(5===p.tag&&null!==m&&(p=m,null!==f&&(null!=(m=Ae(h,f))&&c.push(zr(h,m,p)))),d)break;h=h.return}0<c.length&&(s=new l(s,u,null,n,o),i.push({event:s,listeners:c}))}}if(!(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||n===be||!(u=n.relatedTarget||n.fromElement)||!go(u)&&!u[fo])&&(l||s)&&(s=o.window===o?o:(s=o.ownerDocument)?s.defaultView||s.parentWindow:window,l?(l=r,null!==(u=(u=n.relatedTarget||n.toElement)?go(u):null)&&(u!==(d=Fe(u))||5!==u.tag&&6!==u.tag)&&(u=null)):(l=null,u=r),l!==u)){if(c=dn,m="onMouseLeave",f="onMouseEnter",h="mouse","pointerout"!==e&&"pointerover"!==e||(c=En,m="onPointerLeave",f="onPointerEnter",h="pointer"),d=null==l?s:yo(l),p=null==u?s:yo(u),(s=new c(m,h+"leave",l,n,o)).target=d,s.relatedTarget=p,m=null,go(o)===r&&((c=new c(f,h+"enter",u,n,o)).target=p,c.relatedTarget=d,m=c),d=m,l&&u)e:{for(f=u,h=0,p=c=l;p;p=Hr(p))h++;for(p=0,m=f;m;m=Hr(m))p++;for(;0<h-p;)c=Hr(c),h--;for(;0<p-h;)f=Hr(f),p--;for(;h--;){if(c===f||null!==f&&c===f.alternate)break e;c=Hr(c),f=Hr(f)}c=null}else c=null;null!==l&&qr(i,s,l,c,!1),null!==u&&null!==d&&qr(i,d,u,c,!0)}if("select"===(l=(s=r?yo(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===l&&"file"===s.type)var g=Wn;else if(Un(s))if(Yn)g=rr;else{g=tr;var b=er}else(l=s.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(g=nr);switch(g&&(g=g(e,r))?zn(i,g,n,o):(b&&b(e,s,r),"focusout"===e&&(b=s._wrapperState)&&b.controlled&&"number"===s.type&&Q(s,"number",s.value)),b=r?yo(r):window,e){case"focusin":(Un(b)||"true"===b.contentEditable)&&(pr=b,hr=r,mr=null);break;case"focusout":mr=hr=pr=null;break;case"mousedown":gr=!0;break;case"contextmenu":case"mouseup":case"dragend":gr=!1,br(i,n,o);break;case"selectionchange":if(fr)break;case"keydown":case"keyup":br(i,n,o)}var y;if($n)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else Fn?Ln(e,n)&&(_="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(_="onCompositionStart");_&&(Dn&&"ko"!==n.locale&&(Fn||"onCompositionStart"!==_?"onCompositionEnd"===_&&Fn&&(y=Qt()):(Xt="value"in(Yt=o)?Yt.value:Yt.textContent,Fn=!0)),0<(b=Vr(r,_)).length&&(_=new bn(_,e,null,n,o),i.push({event:_,listeners:b}),y?_.data=y:null!==(y=jn(n))&&(_.data=y))),(y=Cn?function(e,t){switch(e){case"compositionend":return jn(t);case"keypress":return 32!==t.which?null:(Mn=!0,Nn);case"textInput":return(e=t.data)===Nn&&Mn?null:e;default:return null}}(e,n):function(e,t){if(Fn)return"compositionend"===e||!$n&&Ln(e,t)?(e=Qt(),Kt=Xt=Yt=null,Fn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Dn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Vr(r,"onBeforeInput")).length&&(o=new bn("onBeforeInput","beforeinput",null,n,o),i.push({event:o,listeners:r}),o.data=y))}Nr(i,t)})}function zr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Vr(e,t){for(var n=t+"Capture",r=[];null!==e;){var o=e,a=o.stateNode;5===o.tag&&null!==a&&(o=a,null!=(a=Ae(e,n))&&r.unshift(zr(e,a,o)),null!=(a=Ae(e,t))&&r.push(zr(e,a,o))),e=e.return}return r}function Hr(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function qr(e,t,n,r,o){for(var a=t._reactName,i=[];null!==n&&n!==r;){var s=n,l=s.alternate,u=s.stateNode;if(null!==l&&l===r)break;5===s.tag&&null!==u&&(s=u,o?null!=(l=Ae(n,a))&&i.unshift(zr(n,l,s)):o||null!=(l=Ae(n,a))&&i.push(zr(n,l,s))),n=n.return}0!==i.length&&e.push({event:t,listeners:i})}var Gr=/\r\n?/g,Wr=/\u0000|\uFFFD/g;function Yr(e){return("string"==typeof e?e:""+e).replace(Gr,"\n").replace(Wr,"")}function Xr(e,t,r){if(t=Yr(t),Yr(e)!==t&&r)throw Error(n(425))}function Kr(){}var Qr=null,Zr=null;function Jr(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var eo="function"==typeof setTimeout?setTimeout:void 0,to="function"==typeof clearTimeout?clearTimeout:void 0,no="function"==typeof Promise?Promise:void 0,ro="function"==typeof queueMicrotask?queueMicrotask:void 0!==no?function(e){return no.resolve(null).then(e).catch(oo)}:eo;function oo(e){setTimeout(function(){throw e})}function ao(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&8===o.nodeType)if("/$"===(n=o.data)){if(0===r)return e.removeChild(o),void Ft(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=o}while(n);Ft(t)}function io(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function so(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var lo=Math.random().toString(36).slice(2),uo="__reactFiber$"+lo,co="__reactProps$"+lo,fo="__reactContainer$"+lo,po="__reactEvents$"+lo,ho="__reactListeners$"+lo,mo="__reactHandles$"+lo;function go(e){var t=e[uo];if(t)return t;for(var n=e.parentNode;n;){if(t=n[fo]||n[uo]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=so(e);null!==e;){if(n=e[uo])return n;e=so(e)}return t}n=(e=n).parentNode}return null}function bo(e){return!(e=e[uo]||e[fo])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function yo(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(n(33))}function _o(e){return e[co]||null}var vo=[],wo=-1;function So(e){return{current:e}}function xo(e){0>wo||(e.current=vo[wo],vo[wo]=null,wo--)}function To(e,t){wo++,vo[wo]=e.current,e.current=t}var Eo={},ko=So(Eo),Po=So(!1),Oo=Eo;function Ao(e,t){var n=e.type.contextTypes;if(!n)return Eo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,a={};for(o in n)a[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function Ro(e){return null!=(e=e.childContextTypes)}function $o(){xo(Po),xo(ko)}function Io(e,t,r){if(ko.current!==Eo)throw Error(n(168));To(ko,t),To(Po,r)}function Co(e,t,r){var o=e.stateNode;if(t=t.childContextTypes,"function"!=typeof o.getChildContext)return r;for(var a in o=o.getChildContext())if(!(a in t))throw Error(n(108,B(e)||"Unknown",a));return D({},r,o)}function Do(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Eo,Oo=ko.current,To(ko,e),To(Po,Po.current),!0}function No(e,t,r){var o=e.stateNode;if(!o)throw Error(n(169));r?(e=Co(e,t,Oo),o.__reactInternalMemoizedMergedChildContext=e,xo(Po),xo(ko),To(ko,e)):xo(Po),To(Po,r)}var Mo=null,Lo=!1,jo=!1;function Fo(e){null===Mo?Mo=[e]:Mo.push(e)}function Bo(){if(!jo&&null!==Mo){jo=!0;var e=0,t=gt;try{var n=Mo;for(gt=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}Mo=null,Lo=!1}catch(o){throw null!==Mo&&(Mo=Mo.slice(e+1)),He(Ke,Bo),o}finally{gt=t,jo=!1}}return null}var Uo=[],zo=0,Vo=null,Ho=0,qo=[],Go=0,Wo=null,Yo=1,Xo="";function Ko(e,t){Uo[zo++]=Ho,Uo[zo++]=Vo,Vo=e,Ho=t}function Qo(e,t,n){qo[Go++]=Yo,qo[Go++]=Xo,qo[Go++]=Wo,Wo=e;var r=Yo;e=Xo;var o=32-rt(r)-1;r&=~(1<<o),n+=1;var a=32-rt(t)+o;if(30<a){var i=o-o%5;a=(r&(1<<i)-1).toString(32),r>>=i,o-=i,Yo=1<<32-rt(t)+o|n<<o|r,Xo=a+e}else Yo=1<<a|n<<o|r,Xo=e}function Zo(e){null!==e.return&&(Ko(e,1),Qo(e,1,0))}function Jo(e){for(;e===Vo;)Vo=Uo[--zo],Uo[zo]=null,Ho=Uo[--zo],Uo[zo]=null;for(;e===Wo;)Wo=qo[--Go],qo[Go]=null,Xo=qo[--Go],qo[Go]=null,Yo=qo[--Go],qo[Go]=null}var ea=null,ta=null,na=!1,ra=null;function oa(e,t){var n=Ou(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function aa(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,ea=e,ta=io(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,ea=e,ta=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==Wo?{id:Yo,overflow:Xo}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=Ou(18,null,null,0)).stateNode=t,n.return=e,e.child=n,ea=e,ta=null,!0);default:return!1}}function ia(e){return!(!(1&e.mode)||128&e.flags)}function sa(e){if(na){var t=ta;if(t){var r=t;if(!aa(e,t)){if(ia(e))throw Error(n(418));t=io(r.nextSibling);var o=ea;t&&aa(e,t)?oa(o,r):(e.flags=-4097&e.flags|2,na=!1,ea=e)}}else{if(ia(e))throw Error(n(418));e.flags=-4097&e.flags|2,na=!1,ea=e}}}function la(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;ea=e}function ua(e){if(e!==ea)return!1;if(!na)return la(e),na=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!Jr(e.type,e.memoizedProps)),t&&(t=ta)){if(ia(e))throw ca(),Error(n(418));for(;t;)oa(e,t),t=io(t.nextSibling)}if(la(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(n(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var r=e.data;if("/$"===r){if(0===t){ta=io(e.nextSibling);break e}t--}else"$"!==r&&"$!"!==r&&"$?"!==r||t++}e=e.nextSibling}ta=null}}else ta=ea?io(e.stateNode.nextSibling):null;return!0}function ca(){for(var e=ta;e;)e=io(e.nextSibling)}function da(){ta=ea=null,na=!1}function fa(e){null===ra?ra=[e]:ra.push(e)}var pa=b.ReactCurrentBatchConfig;function ha(e,t,r){if(null!==(e=r.ref)&&"function"!=typeof e&&"object"!=typeof e){if(r._owner){if(r=r._owner){if(1!==r.tag)throw Error(n(309));var o=r.stateNode}if(!o)throw Error(n(147,e));var a=o,i=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===i?t.ref:((t=function(e){var t=a.refs;null===e?delete t[i]:t[i]=e})._stringRef=i,t)}if("string"!=typeof e)throw Error(n(284));if(!r._owner)throw Error(n(290,e))}return e}function ma(e,t){throw e=Object.prototype.toString.call(t),Error(n(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ga(e){return(0,e._init)(e._payload)}function ba(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function r(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function o(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function a(e,t){return(e=Ru(e,t)).index=0,e.sibling=null,e}function i(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function s(t){return e&&null===t.alternate&&(t.flags|=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Du(n,e.mode,r)).return=e,t):((t=a(t,n)).return=e,t)}function u(e,t,n,r){var o=n.type;return o===v?d(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===o||"object"==typeof o&&null!==o&&o.$$typeof===A&&ga(o)===t.type)?((r=a(t,n.props)).ref=ha(e,t,n),r.return=e,r):((r=$u(n.type,n.key,n.props,null,e.mode,r)).ref=ha(e,t,n),r.return=e,r)}function c(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Nu(n,e.mode,r)).return=e,t):((t=a(t,n.children||[])).return=e,t)}function d(e,t,n,r,o){return null===t||7!==t.tag?((t=Iu(n,e.mode,r,o)).return=e,t):((t=a(t,n)).return=e,t)}function f(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=Du(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case y:return(n=$u(t.type,t.key,t.props,null,e.mode,n)).ref=ha(e,null,t),n.return=e,n;case _:return(t=Nu(t,e.mode,n)).return=e,t;case A:return f(e,(0,t._init)(t._payload),n)}if(Z(t)||I(t))return(t=Iu(t,e.mode,n,null)).return=e,t;ma(e,t)}return null}function p(e,t,n,r){var o=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==o?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case y:return n.key===o?u(e,t,n,r):null;case _:return n.key===o?c(e,t,n,r):null;case A:return p(e,t,(o=n._init)(n._payload),r)}if(Z(n)||I(n))return null!==o?null:d(e,t,n,r,null);ma(e,n)}return null}function h(e,t,n,r,o){if("string"==typeof r&&""!==r||"number"==typeof r)return l(t,e=e.get(n)||null,""+r,o);if("object"==typeof r&&null!==r){switch(r.$$typeof){case y:return u(t,e=e.get(null===r.key?n:r.key)||null,r,o);case _:return c(t,e=e.get(null===r.key?n:r.key)||null,r,o);case A:return h(e,t,n,(0,r._init)(r._payload),o)}if(Z(r)||I(r))return d(t,e=e.get(n)||null,r,o,null);ma(t,r)}return null}return function l(u,c,d,m){if("object"==typeof d&&null!==d&&d.type===v&&null===d.key&&(d=d.props.children),"object"==typeof d&&null!==d){switch(d.$$typeof){case y:e:{for(var g=d.key,b=c;null!==b;){if(b.key===g){if((g=d.type)===v){if(7===b.tag){r(u,b.sibling),(c=a(b,d.props.children)).return=u,u=c;break e}}else if(b.elementType===g||"object"==typeof g&&null!==g&&g.$$typeof===A&&ga(g)===b.type){r(u,b.sibling),(c=a(b,d.props)).ref=ha(u,b,d),c.return=u,u=c;break e}r(u,b);break}t(u,b),b=b.sibling}d.type===v?((c=Iu(d.props.children,u.mode,m,d.key)).return=u,u=c):((m=$u(d.type,d.key,d.props,null,u.mode,m)).ref=ha(u,c,d),m.return=u,u=m)}return s(u);case _:e:{for(b=d.key;null!==c;){if(c.key===b){if(4===c.tag&&c.stateNode.containerInfo===d.containerInfo&&c.stateNode.implementation===d.implementation){r(u,c.sibling),(c=a(c,d.children||[])).return=u,u=c;break e}r(u,c);break}t(u,c),c=c.sibling}(c=Nu(d,u.mode,m)).return=u,u=c}return s(u);case A:return l(u,c,(b=d._init)(d._payload),m)}if(Z(d))return function(n,a,s,l){for(var u=null,c=null,d=a,m=a=0,g=null;null!==d&&m<s.length;m++){d.index>m?(g=d,d=null):g=d.sibling;var b=p(n,d,s[m],l);if(null===b){null===d&&(d=g);break}e&&d&&null===b.alternate&&t(n,d),a=i(b,a,m),null===c?u=b:c.sibling=b,c=b,d=g}if(m===s.length)return r(n,d),na&&Ko(n,m),u;if(null===d){for(;m<s.length;m++)null!==(d=f(n,s[m],l))&&(a=i(d,a,m),null===c?u=d:c.sibling=d,c=d);return na&&Ko(n,m),u}for(d=o(n,d);m<s.length;m++)null!==(g=h(d,n,m,s[m],l))&&(e&&null!==g.alternate&&d.delete(null===g.key?m:g.key),a=i(g,a,m),null===c?u=g:c.sibling=g,c=g);return e&&d.forEach(function(e){return t(n,e)}),na&&Ko(n,m),u}(u,c,d,m);if(I(d))return function(a,s,l,u){var c=I(l);if("function"!=typeof c)throw Error(n(150));if(null==(l=c.call(l)))throw Error(n(151));for(var d=c=null,m=s,g=s=0,b=null,y=l.next();null!==m&&!y.done;g++,y=l.next()){m.index>g?(b=m,m=null):b=m.sibling;var _=p(a,m,y.value,u);if(null===_){null===m&&(m=b);break}e&&m&&null===_.alternate&&t(a,m),s=i(_,s,g),null===d?c=_:d.sibling=_,d=_,m=b}if(y.done)return r(a,m),na&&Ko(a,g),c;if(null===m){for(;!y.done;g++,y=l.next())null!==(y=f(a,y.value,u))&&(s=i(y,s,g),null===d?c=y:d.sibling=y,d=y);return na&&Ko(a,g),c}for(m=o(a,m);!y.done;g++,y=l.next())null!==(y=h(m,a,g,y.value,u))&&(e&&null!==y.alternate&&m.delete(null===y.key?g:y.key),s=i(y,s,g),null===d?c=y:d.sibling=y,d=y);return e&&m.forEach(function(e){return t(a,e)}),na&&Ko(a,g),c}(u,c,d,m);ma(u,d)}return"string"==typeof d&&""!==d||"number"==typeof d?(d=""+d,null!==c&&6===c.tag?(r(u,c.sibling),(c=a(c,d)).return=u,u=c):(r(u,c),(c=Du(d,u.mode,m)).return=u,u=c),s(u)):r(u,c)}}var ya=ba(!0),_a=ba(!1),va=So(null),wa=null,Sa=null,xa=null;function Ta(){xa=Sa=wa=null}function Ea(e){var t=va.current;xo(va),e._currentValue=t}function ka(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Pa(e,t){wa=e,xa=Sa=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(gs=!0),e.firstContext=null)}function Oa(e){var t=e._currentValue;if(xa!==e)if(e={context:e,memoizedValue:t,next:null},null===Sa){if(null===wa)throw Error(n(308));Sa=e,wa.dependencies={lanes:0,firstContext:e}}else Sa=Sa.next=e;return t}var Aa=null;function Ra(e){null===Aa?Aa=[e]:Aa.push(e)}function $a(e,t,n,r){var o=t.interleaved;return null===o?(n.next=n,Ra(t)):(n.next=o.next,o.next=n),t.interleaved=n,Ia(e,r)}function Ia(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var Ca=!1;function Da(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Na(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ma(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function La(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&El){var o=r.pending;return null===o?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Ia(e,n)}return null===(o=r.interleaved)?(t.next=t,Ra(r)):(t.next=o.next,o.next=t),r.interleaved=t,Ia(e,n)}function ja(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,mt(e,n)}}function Fa(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var o=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===a?o=a=i:a=a.next=i,n=n.next}while(null!==n);null===a?o=a=t:a=a.next=t}else o=a=t;return n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:a,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ba(e,t,n,r){var o=e.updateQueue;Ca=!1;var a=o.firstBaseUpdate,i=o.lastBaseUpdate,s=o.shared.pending;if(null!==s){o.shared.pending=null;var l=s,u=l.next;l.next=null,null===i?a=u:i.next=u,i=l;var c=e.alternate;null!==c&&((s=(c=c.updateQueue).lastBaseUpdate)!==i&&(null===s?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(null!==a){var d=o.baseState;for(i=0,c=u=l=null,s=a;;){var f=s.lane,p=s.eventTime;if((r&f)===f){null!==c&&(c=c.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var h=e,m=s;switch(f=t,p=n,m.tag){case 1:if("function"==typeof(h=m.payload)){d=h.call(p,d,f);break e}d=h;break e;case 3:h.flags=-65537&h.flags|128;case 0:if(null==(f="function"==typeof(h=m.payload)?h.call(p,d,f):h))break e;d=D({},d,f);break e;case 2:Ca=!0}}null!==s.callback&&0!==s.lane&&(e.flags|=64,null===(f=o.effects)?o.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===c?(u=c=p,l=d):c=c.next=p,i|=f;if(null===(s=s.next)){if(null===(s=o.shared.pending))break;s=(f=s).next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}if(null===c&&(l=d),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=c,null!==(t=o.shared.interleaved)){o=t;do{i|=o.lane,o=o.next}while(o!==t)}else null===a&&(o.shared.lanes=0);Cl|=i,e.lanes=i,e.memoizedState=d}}function Ua(e,t,r){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var o=e[t],a=o.callback;if(null!==a){if(o.callback=null,o=r,"function"!=typeof a)throw Error(n(191,a));a.call(o)}}}var za={},Va=So(za),Ha=So(za),qa=So(za);function Ga(e){if(e===za)throw Error(n(174));return e}function Wa(e,t){switch(To(qa,t),To(Ha,e),To(Va,za),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ae(null,"");break;default:t=ae(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}xo(Va),To(Va,t)}function Ya(){xo(Va),xo(Ha),xo(qa)}function Xa(e){Ga(qa.current);var t=Ga(Va.current),n=ae(t,e.type);t!==n&&(To(Ha,e),To(Va,n))}function Ka(e){Ha.current===e&&(xo(Va),xo(Ha))}var Qa=So(0);function Za(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(128&t.flags)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ja=[];function ei(){for(var e=0;e<Ja.length;e++)Ja[e]._workInProgressVersionPrimary=null;Ja.length=0}var ti=b.ReactCurrentDispatcher,ni=b.ReactCurrentBatchConfig,ri=0,oi=null,ai=null,ii=null,si=!1,li=!1,ui=0,ci=0;function di(){throw Error(n(321))}function fi(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!or(e[n],t[n]))return!1;return!0}function pi(e,t,r,o,a,i){if(ri=i,oi=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ti.current=null===e||null===e.memoizedState?Ki:Qi,e=r(o,a),li){i=0;do{if(li=!1,ui=0,25<=i)throw Error(n(301));i+=1,ii=ai=null,t.updateQueue=null,ti.current=Zi,e=r(o,a)}while(li)}if(ti.current=Xi,t=null!==ai&&null!==ai.next,ri=0,ii=ai=oi=null,si=!1,t)throw Error(n(300));return e}function hi(){var e=0!==ui;return ui=0,e}function mi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ii?oi.memoizedState=ii=e:ii=ii.next=e,ii}function gi(){if(null===ai){var e=oi.alternate;e=null!==e?e.memoizedState:null}else e=ai.next;var t=null===ii?oi.memoizedState:ii.next;if(null!==t)ii=t,ai=e;else{if(null===e)throw Error(n(310));e={memoizedState:(ai=e).memoizedState,baseState:ai.baseState,baseQueue:ai.baseQueue,queue:ai.queue,next:null},null===ii?oi.memoizedState=ii=e:ii=ii.next=e}return ii}function bi(e,t){return"function"==typeof t?t(e):t}function yi(e){var t=gi(),r=t.queue;if(null===r)throw Error(n(311));r.lastRenderedReducer=e;var o=ai,a=o.baseQueue,i=r.pending;if(null!==i){if(null!==a){var s=a.next;a.next=i.next,i.next=s}o.baseQueue=a=i,r.pending=null}if(null!==a){i=a.next,o=o.baseState;var l=s=null,u=null,c=i;do{var d=c.lane;if((ri&d)===d)null!==u&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),o=c.hasEagerState?c.eagerState:e(o,c.action);else{var f={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};null===u?(l=u=f,s=o):u=u.next=f,oi.lanes|=d,Cl|=d}c=c.next}while(null!==c&&c!==i);null===u?s=o:u.next=l,or(o,t.memoizedState)||(gs=!0),t.memoizedState=o,t.baseState=s,t.baseQueue=u,r.lastRenderedState=o}if(null!==(e=r.interleaved)){a=e;do{i=a.lane,oi.lanes|=i,Cl|=i,a=a.next}while(a!==e)}else null===a&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function _i(e){var t=gi(),r=t.queue;if(null===r)throw Error(n(311));r.lastRenderedReducer=e;var o=r.dispatch,a=r.pending,i=t.memoizedState;if(null!==a){r.pending=null;var s=a=a.next;do{i=e(i,s.action),s=s.next}while(s!==a);or(i,t.memoizedState)||(gs=!0),t.memoizedState=i,null===t.baseQueue&&(t.baseState=i),r.lastRenderedState=i}return[i,o]}function vi(){}function wi(e,t){var r=oi,o=gi(),a=t(),i=!or(o.memoizedState,a);if(i&&(o.memoizedState=a,gs=!0),o=o.queue,Ci(Ti.bind(null,r,o,e),[e]),o.getSnapshot!==t||i||null!==ii&&1&ii.memoizedState.tag){if(r.flags|=2048,Oi(9,xi.bind(null,r,o,a,t),void 0,null),null===kl)throw Error(n(349));30&ri||Si(r,t,a)}return a}function Si(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=oi.updateQueue)?(t={lastEffect:null,stores:null},oi.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function xi(e,t,n,r){t.value=n,t.getSnapshot=r,Ei(t)&&ki(e)}function Ti(e,t,n){return n(function(){Ei(t)&&ki(e)})}function Ei(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!or(e,n)}catch(r){return!0}}function ki(e){var t=Ia(e,1);null!==t&&Jl(t,e,1,-1)}function Pi(e){var t=mi();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:bi,lastRenderedState:e},t.queue=e,e=e.dispatch=qi.bind(null,oi,e),[t.memoizedState,e]}function Oi(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=oi.updateQueue)?(t={lastEffect:null,stores:null},oi.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ai(){return gi().memoizedState}function Ri(e,t,n,r){var o=mi();oi.flags|=e,o.memoizedState=Oi(1|t,n,void 0,void 0===r?null:r)}function $i(e,t,n,r){var o=gi();r=void 0===r?null:r;var a=void 0;if(null!==ai){var i=ai.memoizedState;if(a=i.destroy,null!==r&&fi(r,i.deps))return void(o.memoizedState=Oi(t,n,a,r))}oi.flags|=e,o.memoizedState=Oi(1|t,n,a,r)}function Ii(e,t){return Ri(8390656,8,e,t)}function Ci(e,t){return $i(2048,8,e,t)}function Di(e,t){return $i(4,2,e,t)}function Ni(e,t){return $i(4,4,e,t)}function Mi(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Li(e,t,n){return n=null!=n?n.concat([e]):null,$i(4,4,Mi.bind(null,t,e),n)}function ji(){}function Fi(e,t){var n=gi();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&fi(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Bi(e,t){var n=gi();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&fi(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Ui(e,t,n){return 21&ri?(or(n,t)||(n=ft(),oi.lanes|=n,Cl|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,gs=!0),e.memoizedState=n)}function zi(e,t){var n=gt;gt=0!==n&&4>n?n:4,e(!0);var r=ni.transition;ni.transition={};try{e(!1),t()}finally{gt=n,ni.transition=r}}function Vi(){return gi().memoizedState}function Hi(e,t,n){var r=Zl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Gi(e))Wi(t,n);else if(null!==(n=$a(e,t,n,r))){Jl(n,e,r,Ql()),Yi(n,t,r)}}function qi(e,t,n){var r=Zl(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Gi(e))Wi(t,o);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var i=t.lastRenderedState,s=a(i,n);if(o.hasEagerState=!0,o.eagerState=s,or(s,i)){var l=t.interleaved;return null===l?(o.next=o,Ra(t)):(o.next=l.next,l.next=o),void(t.interleaved=o)}}catch(u){}null!==(n=$a(e,t,o,r))&&(Jl(n,e,r,o=Ql()),Yi(n,t,r))}}function Gi(e){var t=e.alternate;return e===oi||null!==t&&t===oi}function Wi(e,t){li=si=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Yi(e,t,n){if(4194240&n){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,mt(e,n)}}var Xi={readContext:Oa,useCallback:di,useContext:di,useEffect:di,useImperativeHandle:di,useInsertionEffect:di,useLayoutEffect:di,useMemo:di,useReducer:di,useRef:di,useState:di,useDebugValue:di,useDeferredValue:di,useTransition:di,useMutableSource:di,useSyncExternalStore:di,useId:di,unstable_isNewReconciler:!1},Ki={readContext:Oa,useCallback:function(e,t){return mi().memoizedState=[e,void 0===t?null:t],e},useContext:Oa,useEffect:Ii,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Ri(4194308,4,Mi.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ri(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ri(4,2,e,t)},useMemo:function(e,t){var n=mi();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=mi();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Hi.bind(null,oi,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},mi().memoizedState=e},useState:Pi,useDebugValue:ji,useDeferredValue:function(e){return mi().memoizedState=e},useTransition:function(){var e=Pi(!1),t=e[0];return e=zi.bind(null,e[1]),mi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var o=oi,a=mi();if(na){if(void 0===r)throw Error(n(407));r=r()}else{if(r=t(),null===kl)throw Error(n(349));30&ri||Si(o,t,r)}a.memoizedState=r;var i={value:r,getSnapshot:t};return a.queue=i,Ii(Ti.bind(null,o,i,e),[e]),o.flags|=2048,Oi(9,xi.bind(null,o,i,r,t),void 0,null),r},useId:function(){var e=mi(),t=kl.identifierPrefix;if(na){var n=Xo;t=":"+t+"R"+(n=(Yo&~(1<<32-rt(Yo)-1)).toString(32)+n),0<(n=ui++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=ci++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Qi={readContext:Oa,useCallback:Fi,useContext:Oa,useEffect:Ci,useImperativeHandle:Li,useInsertionEffect:Di,useLayoutEffect:Ni,useMemo:Bi,useReducer:yi,useRef:Ai,useState:function(){return yi(bi)},useDebugValue:ji,useDeferredValue:function(e){return Ui(gi(),ai.memoizedState,e)},useTransition:function(){return[yi(bi)[0],gi().memoizedState]},useMutableSource:vi,useSyncExternalStore:wi,useId:Vi,unstable_isNewReconciler:!1},Zi={readContext:Oa,useCallback:Fi,useContext:Oa,useEffect:Ci,useImperativeHandle:Li,useInsertionEffect:Di,useLayoutEffect:Ni,useMemo:Bi,useReducer:_i,useRef:Ai,useState:function(){return _i(bi)},useDebugValue:ji,useDeferredValue:function(e){var t=gi();return null===ai?t.memoizedState=e:Ui(t,ai.memoizedState,e)},useTransition:function(){return[_i(bi)[0],gi().memoizedState]},useMutableSource:vi,useSyncExternalStore:wi,useId:Vi,unstable_isNewReconciler:!1};function Ji(e,t){if(e&&e.defaultProps){for(var n in t=D({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}function es(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:D({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var ts={isMounted:function(e){return!!(e=e._reactInternals)&&Fe(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ql(),o=Zl(e),a=Ma(r,o);a.payload=t,null!=n&&(a.callback=n),null!==(t=La(e,a,o))&&(Jl(t,e,o,r),ja(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ql(),o=Zl(e),a=Ma(r,o);a.tag=1,a.payload=t,null!=n&&(a.callback=n),null!==(t=La(e,a,o))&&(Jl(t,e,o,r),ja(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ql(),r=Zl(e),o=Ma(n,r);o.tag=2,null!=t&&(o.callback=t),null!==(t=La(e,o,r))&&(Jl(t,e,r,n),ja(t,e,r))}};function ns(e,t,n,r,o,a,i){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,i):!t.prototype||!t.prototype.isPureReactComponent||(!ar(n,r)||!ar(o,a))}function rs(e,t,n){var r=!1,o=Eo,a=t.contextType;return"object"==typeof a&&null!==a?a=Oa(a):(o=Ro(t)?Oo:ko.current,a=(r=null!=(r=t.contextTypes))?Ao(e,o):Eo),t=new t(n,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=ts,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=a),t}function os(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ts.enqueueReplaceState(t,t.state,null)}function as(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},Da(e);var a=t.contextType;"object"==typeof a&&null!==a?o.context=Oa(a):(a=Ro(t)?Oo:ko.current,o.context=Ao(e,a)),o.state=e.memoizedState,"function"==typeof(a=t.getDerivedStateFromProps)&&(es(e,t,a,n),o.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(t=o.state,"function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),t!==o.state&&ts.enqueueReplaceState(o,o.state,null),Ba(e,n,o,r),o.state=e.memoizedState),"function"==typeof o.componentDidMount&&(e.flags|=4194308)}function is(e,t){try{var n="",r=t;do{n+=j(r),r=r.return}while(r);var o=n}catch(a){o="\nError generating stack: "+a.message+"\n"+a.stack}return{value:e,source:t,stack:o,digest:null}}function ss(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function ls(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var us="function"==typeof WeakMap?WeakMap:Map;function cs(e,t,n){(n=Ma(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ul||(Ul=!0,zl=r),ls(0,t)},n}function ds(e,t,n){(n=Ma(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){ls(0,t)}}var a=e.stateNode;return null!==a&&"function"==typeof a.componentDidCatch&&(n.callback=function(){ls(0,t),"function"!=typeof r&&(null===Vl?Vl=new Set([this]):Vl.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function fs(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new us;var o=new Set;r.set(t,o)}else void 0===(o=r.get(t))&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Su.bind(null,e,t,n),t.then(e,e))}function ps(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function hs(e,t,n,r,o){return 1&e.mode?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Ma(-1,1)).tag=2,La(n,t,1))),n.lanes|=1),e)}var ms=b.ReactCurrentOwner,gs=!1;function bs(e,t,n,r){t.child=null===e?_a(t,null,n,r):ya(t,e.child,n,r)}function ys(e,t,n,r,o){n=n.render;var a=t.ref;return Pa(t,o),r=pi(e,t,n,r,a,o),n=hi(),null===e||gs?(na&&n&&Zo(t),t.flags|=1,bs(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Us(e,t,o))}function _s(e,t,n,r,o){if(null===e){var a=n.type;return"function"!=typeof a||Au(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=$u(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,vs(e,t,a,r,o))}if(a=e.child,0===(e.lanes&o)){var i=a.memoizedProps;if((n=null!==(n=n.compare)?n:ar)(i,r)&&e.ref===t.ref)return Us(e,t,o)}return t.flags|=1,(e=Ru(a,r)).ref=t.ref,e.return=t,t.child=e}function vs(e,t,n,r,o){if(null!==e){var a=e.memoizedProps;if(ar(a,r)&&e.ref===t.ref){if(gs=!1,t.pendingProps=r=a,0===(e.lanes&o))return t.lanes=e.lanes,Us(e,t,o);131072&e.flags&&(gs=!0)}}return xs(e,t,n,r,o)}function ws(e,t,n){var r=t.pendingProps,o=r.children,a=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(1&t.mode){if(!(1073741824&n))return e=null!==a?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,To(Rl,Al),Al|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==a?a.baseLanes:n,To(Rl,Al),Al|=r}else t.memoizedState={baseLanes:0,cachePool:null,transitions:null},To(Rl,Al),Al|=n;else null!==a?(r=a.baseLanes|n,t.memoizedState=null):r=n,To(Rl,Al),Al|=r;return bs(e,t,o,n),t.child}function Ss(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function xs(e,t,n,r,o){var a=Ro(n)?Oo:ko.current;return a=Ao(t,a),Pa(t,o),n=pi(e,t,n,r,a,o),r=hi(),null===e||gs?(na&&r&&Zo(t),t.flags|=1,bs(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Us(e,t,o))}function Ts(e,t,n,r,o){if(Ro(n)){var a=!0;Do(t)}else a=!1;if(Pa(t,o),null===t.stateNode)Bs(e,t),rs(t,n,r),as(t,n,r,o),r=!0;else if(null===e){var i=t.stateNode,s=t.memoizedProps;i.props=s;var l=i.context,u=n.contextType;"object"==typeof u&&null!==u?u=Oa(u):u=Ao(t,u=Ro(n)?Oo:ko.current);var c=n.getDerivedStateFromProps,d="function"==typeof c||"function"==typeof i.getSnapshotBeforeUpdate;d||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(s!==r||l!==u)&&os(t,i,r,u),Ca=!1;var f=t.memoizedState;i.state=f,Ba(t,r,i,o),l=t.memoizedState,s!==r||f!==l||Po.current||Ca?("function"==typeof c&&(es(t,n,c,r),l=t.memoizedState),(s=Ca||ns(t,n,s,r,f,l,u))?(d||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||("function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount()),"function"==typeof i.componentDidMount&&(t.flags|=4194308)):("function"==typeof i.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),i.props=r,i.state=l,i.context=u,r=s):("function"==typeof i.componentDidMount&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Na(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:Ji(t.type,s),i.props=u,d=t.pendingProps,f=i.context,"object"==typeof(l=n.contextType)&&null!==l?l=Oa(l):l=Ao(t,l=Ro(n)?Oo:ko.current);var p=n.getDerivedStateFromProps;(c="function"==typeof p||"function"==typeof i.getSnapshotBeforeUpdate)||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(s!==d||f!==l)&&os(t,i,r,l),Ca=!1,f=t.memoizedState,i.state=f,Ba(t,r,i,o);var h=t.memoizedState;s!==d||f!==h||Po.current||Ca?("function"==typeof p&&(es(t,n,p,r),h=t.memoizedState),(u=Ca||ns(t,n,u,r,f,h,l)||!1)?(c||"function"!=typeof i.UNSAFE_componentWillUpdate&&"function"!=typeof i.componentWillUpdate||("function"==typeof i.componentWillUpdate&&i.componentWillUpdate(r,h,l),"function"==typeof i.UNSAFE_componentWillUpdate&&i.UNSAFE_componentWillUpdate(r,h,l)),"function"==typeof i.componentDidUpdate&&(t.flags|=4),"function"==typeof i.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof i.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof i.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),i.props=r,i.state=h,i.context=l,r=u):("function"!=typeof i.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof i.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Es(e,t,n,r,a,o)}function Es(e,t,n,r,o,a){Ss(e,t);var i=!!(128&t.flags);if(!r&&!i)return o&&No(t,n,!1),Us(e,t,a);r=t.stateNode,ms.current=t;var s=i&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&i?(t.child=ya(t,e.child,null,a),t.child=ya(t,null,s,a)):bs(e,t,s,a),t.memoizedState=r.state,o&&No(t,n,!0),t.child}function ks(e){var t=e.stateNode;t.pendingContext?Io(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Io(0,t.context,!1),Wa(e,t.containerInfo)}function Ps(e,t,n,r,o){return da(),fa(o),t.flags|=256,bs(e,t,n,r),t.child}var Os,As,Rs,$s,Is={dehydrated:null,treeContext:null,retryLane:0};function Cs(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ds(e,t,r){var o,a=t.pendingProps,i=Qa.current,s=!1,l=!!(128&t.flags);if((o=l)||(o=(null===e||null!==e.memoizedState)&&!!(2&i)),o?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(i|=1),To(Qa,1&i),null===e)return sa(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(1&t.mode?"$!"===e.data?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=a.children,e=a.fallback,s?(a=t.mode,s=t.child,l={mode:"hidden",children:l},1&a||null===s?s=Cu(l,a,0,null):(s.childLanes=0,s.pendingProps=l),e=Iu(e,a,r,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Cs(r),t.memoizedState=Is,e):Ns(t,l));if(null!==(i=e.memoizedState)&&null!==(o=i.dehydrated))return function(e,t,r,o,a,i,s){if(r)return 256&t.flags?(t.flags&=-257,Ms(e,t,s,o=ss(Error(n(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(i=o.fallback,a=t.mode,o=Cu({mode:"visible",children:o.children},a,0,null),(i=Iu(i,a,s,null)).flags|=2,o.return=t,i.return=t,o.sibling=i,t.child=o,1&t.mode&&ya(t,e.child,null,s),t.child.memoizedState=Cs(s),t.memoizedState=Is,i);if(!(1&t.mode))return Ms(e,t,s,null);if("$!"===a.data){if(o=a.nextSibling&&a.nextSibling.dataset)var l=o.dgst;return o=l,Ms(e,t,s,o=ss(i=Error(n(419)),o,void 0))}if(l=0!==(s&e.childLanes),gs||l){if(null!==(o=kl)){switch(s&-s){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}0!==(a=0!==(a&(o.suspendedLanes|s))?0:a)&&a!==i.retryLane&&(i.retryLane=a,Ia(e,a),Jl(o,e,a,-1))}return fu(),Ms(e,t,s,o=ss(Error(n(421))))}return"$?"===a.data?(t.flags|=128,t.child=e.child,t=Tu.bind(null,e),a._reactRetry=t,null):(e=i.treeContext,ta=io(a.nextSibling),ea=t,na=!0,ra=null,null!==e&&(qo[Go++]=Yo,qo[Go++]=Xo,qo[Go++]=Wo,Yo=e.id,Xo=e.overflow,Wo=t),t=Ns(t,o.children),t.flags|=4096,t)}(e,t,l,a,o,i,r);if(s){s=a.fallback,l=t.mode,o=(i=e.child).sibling;var u={mode:"hidden",children:a.children};return 1&l||t.child===i?(a=Ru(i,u)).subtreeFlags=14680064&i.subtreeFlags:((a=t.child).childLanes=0,a.pendingProps=u,t.deletions=null),null!==o?s=Ru(o,s):(s=Iu(s,l,r,null)).flags|=2,s.return=t,a.return=t,a.sibling=s,t.child=a,a=s,s=t.child,l=null===(l=e.child.memoizedState)?Cs(r):{baseLanes:l.baseLanes|r,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=e.childLanes&~r,t.memoizedState=Is,a}return e=(s=e.child).sibling,a=Ru(s,{mode:"visible",children:a.children}),!(1&t.mode)&&(a.lanes=r),a.return=t,a.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=a,t.memoizedState=null,a}function Ns(e,t){return(t=Cu({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Ms(e,t,n,r){return null!==r&&fa(r),ya(t,e.child,null,n),(e=Ns(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Ls(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),ka(e.return,t,n)}function js(e,t,n,r,o){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=o)}function Fs(e,t,n){var r=t.pendingProps,o=r.revealOrder,a=r.tail;if(bs(e,t,r.children,n),2&(r=Qa.current))r=1&r|2,t.flags|=128;else{if(null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Ls(e,n,t);else if(19===e.tag)Ls(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(To(Qa,r),1&t.mode)switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===Za(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),js(t,!1,o,n,a);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===Za(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}js(t,!0,n,null,a);break;case"together":js(t,!1,null,null,void 0);break;default:t.memoizedState=null}else t.memoizedState=null;return t.child}function Bs(e,t){!(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Us(e,t,r){if(null!==e&&(t.dependencies=e.dependencies),Cl|=t.lanes,0===(r&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(n(153));if(null!==t.child){for(r=Ru(e=t.child,e.pendingProps),t.child=r,r.return=t;null!==e.sibling;)e=e.sibling,(r=r.sibling=Ru(e,e.pendingProps)).return=t;r.sibling=null}return t.child}function zs(e,t){if(!na)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Vs(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=14680064&o.subtreeFlags,r|=14680064&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Hs(e,t,r){var a=t.pendingProps;switch(Jo(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vs(t),null;case 1:case 17:return Ro(t.type)&&$o(),Vs(t),null;case 3:return a=t.stateNode,Ya(),xo(Po),xo(ko),ei(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),null!==e&&null!==e.child||(ua(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,null!==ra&&(ru(ra),ra=null))),As(e,t),Vs(t),null;case 5:Ka(t);var i=Ga(qa.current);if(r=t.type,null!==e&&null!=t.stateNode)Rs(e,t,r,a,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!a){if(null===t.stateNode)throw Error(n(166));return Vs(t),null}if(e=Ga(Va.current),ua(t)){a=t.stateNode,r=t.type;var s=t.memoizedProps;switch(a[uo]=t,a[co]=s,e=!!(1&t.mode),r){case"dialog":Mr("cancel",a),Mr("close",a);break;case"iframe":case"object":case"embed":Mr("load",a);break;case"video":case"audio":for(i=0;i<Ir.length;i++)Mr(Ir[i],a);break;case"source":Mr("error",a);break;case"img":case"image":case"link":Mr("error",a),Mr("load",a);break;case"details":Mr("toggle",a);break;case"input":W(a,s),Mr("invalid",a);break;case"select":a._wrapperState={wasMultiple:!!s.multiple},Mr("invalid",a);break;case"textarea":te(a,s),Mr("invalid",a)}for(var l in me(r,s),i=null,s)if(s.hasOwnProperty(l)){var u=s[l];"children"===l?"string"==typeof u?a.textContent!==u&&(!0!==s.suppressHydrationWarning&&Xr(a.textContent,u,e),i=["children",u]):"number"==typeof u&&a.textContent!==""+u&&(!0!==s.suppressHydrationWarning&&Xr(a.textContent,u,e),i=["children",""+u]):o.hasOwnProperty(l)&&null!=u&&"onScroll"===l&&Mr("scroll",a)}switch(r){case"input":V(a),K(a,s,!0);break;case"textarea":V(a),re(a);break;case"select":case"option":break;default:"function"==typeof s.onClick&&(a.onclick=Kr)}a=i,t.updateQueue=a,null!==a&&(t.flags|=4)}else{l=9===i.nodeType?i:i.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=oe(r)),"http://www.w3.org/1999/xhtml"===e?"script"===r?((e=l.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof a.is?e=l.createElement(r,{is:a.is}):(e=l.createElement(r),"select"===r&&(l=e,a.multiple?l.multiple=!0:a.size&&(l.size=a.size))):e=l.createElementNS(e,r),e[uo]=t,e[co]=a,Os(e,t,!1,!1),t.stateNode=e;e:{switch(l=ge(r,a),r){case"dialog":Mr("cancel",e),Mr("close",e),i=a;break;case"iframe":case"object":case"embed":Mr("load",e),i=a;break;case"video":case"audio":for(i=0;i<Ir.length;i++)Mr(Ir[i],e);i=a;break;case"source":Mr("error",e),i=a;break;case"img":case"image":case"link":Mr("error",e),Mr("load",e),i=a;break;case"details":Mr("toggle",e),i=a;break;case"input":W(e,a),i=G(e,a),Mr("invalid",e);break;case"option":default:i=a;break;case"select":e._wrapperState={wasMultiple:!!a.multiple},i=D({},a,{value:void 0}),Mr("invalid",e);break;case"textarea":te(e,a),i=ee(e,a),Mr("invalid",e)}for(s in me(r,i),u=i)if(u.hasOwnProperty(s)){var c=u[s];"style"===s?pe(e,c):"dangerouslySetInnerHTML"===s?null!=(c=c?c.__html:void 0)&&le(e,c):"children"===s?"string"==typeof c?("textarea"!==r||""!==c)&&ue(e,c):"number"==typeof c&&ue(e,""+c):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(o.hasOwnProperty(s)?null!=c&&"onScroll"===s&&Mr("scroll",e):null!=c&&g(e,s,c,l))}switch(r){case"input":V(e),K(e,a,!1);break;case"textarea":V(e),re(e);break;case"option":null!=a.value&&e.setAttribute("value",""+U(a.value));break;case"select":e.multiple=!!a.multiple,null!=(s=a.value)?J(e,!!a.multiple,s,!1):null!=a.defaultValue&&J(e,!!a.multiple,a.defaultValue,!0);break;default:"function"==typeof i.onClick&&(e.onclick=Kr)}switch(r){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}}a&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return Vs(t),null;case 6:if(e&&null!=t.stateNode)$s(e,t,e.memoizedProps,a);else{if("string"!=typeof a&&null===t.stateNode)throw Error(n(166));if(r=Ga(qa.current),Ga(Va.current),ua(t)){if(a=t.stateNode,r=t.memoizedProps,a[uo]=t,(s=a.nodeValue!==r)&&null!==(e=ea))switch(e.tag){case 3:Xr(a.nodeValue,r,!!(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Xr(a.nodeValue,r,!!(1&e.mode))}s&&(t.flags|=4)}else(a=(9===r.nodeType?r:r.ownerDocument).createTextNode(a))[uo]=t,t.stateNode=a}return Vs(t),null;case 13:if(xo(Qa),a=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(na&&null!==ta&&1&t.mode&&!(128&t.flags))ca(),da(),t.flags|=98560,s=!1;else if(s=ua(t),null!==a&&null!==a.dehydrated){if(null===e){if(!s)throw Error(n(318));if(!(s=null!==(s=t.memoizedState)?s.dehydrated:null))throw Error(n(317));s[uo]=t}else da(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Vs(t),s=!1}else null!==ra&&(ru(ra),ra=null),s=!0;if(!s)return 65536&t.flags?t:null}return 128&t.flags?(t.lanes=r,t):((a=null!==a)!==(null!==e&&null!==e.memoizedState)&&a&&(t.child.flags|=8192,1&t.mode&&(null===e||1&Qa.current?0===$l&&($l=3):fu())),null!==t.updateQueue&&(t.flags|=4),Vs(t),null);case 4:return Ya(),As(e,t),null===e&&Fr(t.stateNode.containerInfo),Vs(t),null;case 10:return Ea(t.type._context),Vs(t),null;case 19:if(xo(Qa),null===(s=t.memoizedState))return Vs(t),null;if(a=!!(128&t.flags),null===(l=s.rendering))if(a)zs(s,!1);else{if(0!==$l||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(l=Za(e))){for(t.flags|=128,zs(s,!1),null!==(a=l.updateQueue)&&(t.updateQueue=a,t.flags|=4),t.subtreeFlags=0,a=r,r=t.child;null!==r;)e=a,(s=r).flags&=14680066,null===(l=s.alternate)?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=l.childLanes,s.lanes=l.lanes,s.child=l.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=l.memoizedProps,s.memoizedState=l.memoizedState,s.updateQueue=l.updateQueue,s.type=l.type,e=l.dependencies,s.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return To(Qa,1&Qa.current|2),t.child}e=e.sibling}null!==s.tail&&Ye()>Fl&&(t.flags|=128,a=!0,zs(s,!1),t.lanes=4194304)}else{if(!a)if(null!==(e=Za(l))){if(t.flags|=128,a=!0,null!==(r=e.updateQueue)&&(t.updateQueue=r,t.flags|=4),zs(s,!0),null===s.tail&&"hidden"===s.tailMode&&!l.alternate&&!na)return Vs(t),null}else 2*Ye()-s.renderingStartTime>Fl&&1073741824!==r&&(t.flags|=128,a=!0,zs(s,!1),t.lanes=4194304);s.isBackwards?(l.sibling=t.child,t.child=l):(null!==(r=s.last)?r.sibling=l:t.child=l,s.last=l)}return null!==s.tail?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Ye(),t.sibling=null,r=Qa.current,To(Qa,a?1&r|2:1&r),t):(Vs(t),null);case 22:case 23:return lu(),a=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==a&&(t.flags|=8192),a&&1&t.mode?!!(1073741824&Al)&&(Vs(t),6&t.subtreeFlags&&(t.flags|=8192)):Vs(t),null;case 24:case 25:return null}throw Error(n(156,t.tag))}function qs(e,t){switch(Jo(t),t.tag){case 1:return Ro(t.type)&&$o(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Ya(),xo(Po),xo(ko),ei(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 5:return Ka(t),null;case 13:if(xo(Qa),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(n(340));da()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return xo(Qa),null;case 4:return Ya(),null;case 10:return Ea(t.type._context),null;case 22:case 23:return lu(),null;default:return null}}Os=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},As=function(){},Rs=function(e,t,n,r){var a=e.memoizedProps;if(a!==r){e=t.stateNode,Ga(Va.current);var i,s=null;switch(n){case"input":a=G(e,a),r=G(e,r),s=[];break;case"select":a=D({},a,{value:void 0}),r=D({},r,{value:void 0}),s=[];break;case"textarea":a=ee(e,a),r=ee(e,r),s=[];break;default:"function"!=typeof a.onClick&&"function"==typeof r.onClick&&(e.onclick=Kr)}for(c in me(n,r),n=null,a)if(!r.hasOwnProperty(c)&&a.hasOwnProperty(c)&&null!=a[c])if("style"===c){var l=a[c];for(i in l)l.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else"dangerouslySetInnerHTML"!==c&&"children"!==c&&"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(o.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var u=r[c];if(l=null!=a?a[c]:void 0,r.hasOwnProperty(c)&&u!==l&&(null!=u||null!=l))if("style"===c)if(l){for(i in l)!l.hasOwnProperty(i)||u&&u.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in u)u.hasOwnProperty(i)&&l[i]!==u[i]&&(n||(n={}),n[i]=u[i])}else n||(s||(s=[]),s.push(c,n)),n=u;else"dangerouslySetInnerHTML"===c?(u=u?u.__html:void 0,l=l?l.__html:void 0,null!=u&&l!==u&&(s=s||[]).push(c,u)):"children"===c?"string"!=typeof u&&"number"!=typeof u||(s=s||[]).push(c,""+u):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&(o.hasOwnProperty(c)?(null!=u&&"onScroll"===c&&Mr("scroll",e),s||l===u||(s=[])):(s=s||[]).push(c,u))}n&&(s=s||[]).push("style",n);var c=s;(t.updateQueue=c)&&(t.flags|=4)}},$s=function(e,t,n,r){n!==r&&(t.flags|=4)};var Gs=!1,Ws=!1,Ys="function"==typeof WeakSet?WeakSet:Set,Xs=null;function Ks(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(r){wu(e,t,r)}else n.current=null}function Qs(e,t,n){try{n()}catch(r){wu(e,t,r)}}var Zs=!1;function Js(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var o=r=r.next;do{if((o.tag&e)===e){var a=o.destroy;o.destroy=void 0,void 0!==a&&Qs(t,n,a)}o=o.next}while(o!==r)}}function el(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function tl(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"==typeof t?t(e):t.current=e}}function nl(e){var t=e.alternate;null!==t&&(e.alternate=null,nl(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[uo],delete t[co],delete t[po],delete t[ho],delete t[mo])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function rl(e){return 5===e.tag||3===e.tag||4===e.tag}function ol(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||rl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function al(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Kr));else if(4!==r&&null!==(e=e.child))for(al(e,t,n),e=e.sibling;null!==e;)al(e,t,n),e=e.sibling}function il(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(il(e,t,n),e=e.sibling;null!==e;)il(e,t,n),e=e.sibling}var sl=null,ll=!1;function ul(e,t,n){for(n=n.child;null!==n;)cl(e,t,n),n=n.sibling}function cl(e,t,n){if(nt&&"function"==typeof nt.onCommitFiberUnmount)try{nt.onCommitFiberUnmount(tt,n)}catch(s){}switch(n.tag){case 5:Ws||Ks(n,t);case 6:var r=sl,o=ll;sl=null,ul(e,t,n),ll=o,null!==(sl=r)&&(ll?(e=sl,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):sl.removeChild(n.stateNode));break;case 18:null!==sl&&(ll?(e=sl,n=n.stateNode,8===e.nodeType?ao(e.parentNode,n):1===e.nodeType&&ao(e,n),Ft(e)):ao(sl,n.stateNode));break;case 4:r=sl,o=ll,sl=n.stateNode.containerInfo,ll=!0,ul(e,t,n),sl=r,ll=o;break;case 0:case 11:case 14:case 15:if(!Ws&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){o=r=r.next;do{var a=o,i=a.destroy;a=a.tag,void 0!==i&&(2&a||4&a)&&Qs(n,t,i),o=o.next}while(o!==r)}ul(e,t,n);break;case 1:if(!Ws&&(Ks(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){wu(n,t,s)}ul(e,t,n);break;case 21:ul(e,t,n);break;case 22:1&n.mode?(Ws=(r=Ws)||null!==n.memoizedState,ul(e,t,n),Ws=r):ul(e,t,n);break;default:ul(e,t,n)}}function dl(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Ys),t.forEach(function(t){var r=Eu.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function fl(e,t){var r=t.deletions;if(null!==r)for(var o=0;o<r.length;o++){var a=r[o];try{var i=e,s=t,l=s;e:for(;null!==l;){switch(l.tag){case 5:sl=l.stateNode,ll=!1;break e;case 3:case 4:sl=l.stateNode.containerInfo,ll=!0;break e}l=l.return}if(null===sl)throw Error(n(160));cl(i,s,a),sl=null,ll=!1;var u=a.alternate;null!==u&&(u.return=null),a.return=null}catch(c){wu(a,t,c)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)pl(t,e),t=t.sibling}function pl(e,t){var r=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(fl(t,e),hl(e),4&o){try{Js(3,e,e.return),el(3,e)}catch(b){wu(e,e.return,b)}try{Js(5,e,e.return)}catch(b){wu(e,e.return,b)}}break;case 1:fl(t,e),hl(e),512&o&&null!==r&&Ks(r,r.return);break;case 5:if(fl(t,e),hl(e),512&o&&null!==r&&Ks(r,r.return),32&e.flags){var a=e.stateNode;try{ue(a,"")}catch(b){wu(e,e.return,b)}}if(4&o&&null!=(a=e.stateNode)){var i=e.memoizedProps,s=null!==r?r.memoizedProps:i,l=e.type,u=e.updateQueue;if(e.updateQueue=null,null!==u)try{"input"===l&&"radio"===i.type&&null!=i.name&&Y(a,i),ge(l,s);var c=ge(l,i);for(s=0;s<u.length;s+=2){var d=u[s],f=u[s+1];"style"===d?pe(a,f):"dangerouslySetInnerHTML"===d?le(a,f):"children"===d?ue(a,f):g(a,d,f,c)}switch(l){case"input":X(a,i);break;case"textarea":ne(a,i);break;case"select":var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!i.multiple;var h=i.value;null!=h?J(a,!!i.multiple,h,!1):p!==!!i.multiple&&(null!=i.defaultValue?J(a,!!i.multiple,i.defaultValue,!0):J(a,!!i.multiple,i.multiple?[]:"",!1))}a[co]=i}catch(b){wu(e,e.return,b)}}break;case 6:if(fl(t,e),hl(e),4&o){if(null===e.stateNode)throw Error(n(162));a=e.stateNode,i=e.memoizedProps;try{a.nodeValue=i}catch(b){wu(e,e.return,b)}}break;case 3:if(fl(t,e),hl(e),4&o&&null!==r&&r.memoizedState.isDehydrated)try{Ft(t.containerInfo)}catch(b){wu(e,e.return,b)}break;case 4:default:fl(t,e),hl(e);break;case 13:fl(t,e),hl(e),8192&(a=e.child).flags&&(i=null!==a.memoizedState,a.stateNode.isHidden=i,!i||null!==a.alternate&&null!==a.alternate.memoizedState||(jl=Ye())),4&o&&dl(e);break;case 22:if(d=null!==r&&null!==r.memoizedState,1&e.mode?(Ws=(c=Ws)||d,fl(t,e),Ws=c):fl(t,e),hl(e),8192&o){if(c=null!==e.memoizedState,(e.stateNode.isHidden=c)&&!d&&1&e.mode)for(Xs=e,d=e.child;null!==d;){for(f=Xs=d;null!==Xs;){switch(h=(p=Xs).child,p.tag){case 0:case 11:case 14:case 15:Js(4,p,p.return);break;case 1:Ks(p,p.return);var m=p.stateNode;if("function"==typeof m.componentWillUnmount){o=p,r=p.return;try{t=o,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(b){wu(o,r,b)}}break;case 5:Ks(p,p.return);break;case 22:if(null!==p.memoizedState){yl(f);continue}}null!==h?(h.return=p,Xs=h):yl(f)}d=d.sibling}e:for(d=null,f=e;;){if(5===f.tag){if(null===d){d=f;try{a=f.stateNode,c?"function"==typeof(i=a.style).setProperty?i.setProperty("display","none","important"):i.display="none":(l=f.stateNode,s=null!=(u=f.memoizedProps.style)&&u.hasOwnProperty("display")?u.display:null,l.style.display=fe("display",s))}catch(b){wu(e,e.return,b)}}}else if(6===f.tag){if(null===d)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(b){wu(e,e.return,b)}}else if((22!==f.tag&&23!==f.tag||null===f.memoizedState||f===e)&&null!==f.child){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;null===f.sibling;){if(null===f.return||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:fl(t,e),hl(e),4&o&&dl(e);case 21:}}function hl(e){var t=e.flags;if(2&t){try{e:{for(var r=e.return;null!==r;){if(rl(r)){var o=r;break e}r=r.return}throw Error(n(160))}switch(o.tag){case 5:var a=o.stateNode;32&o.flags&&(ue(a,""),o.flags&=-33),il(e,ol(e),a);break;case 3:case 4:var i=o.stateNode.containerInfo;al(e,ol(e),i);break;default:throw Error(n(161))}}catch(s){wu(e,e.return,s)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function ml(e,t,n){Xs=e,gl(e)}function gl(e,t,n){for(var r=!!(1&e.mode);null!==Xs;){var o=Xs,a=o.child;if(22===o.tag&&r){var i=null!==o.memoizedState||Gs;if(!i){var s=o.alternate,l=null!==s&&null!==s.memoizedState||Ws;s=Gs;var u=Ws;if(Gs=i,(Ws=l)&&!u)for(Xs=o;null!==Xs;)l=(i=Xs).child,22===i.tag&&null!==i.memoizedState?_l(o):null!==l?(l.return=i,Xs=l):_l(o);for(;null!==a;)Xs=a,gl(a),a=a.sibling;Xs=o,Gs=s,Ws=u}bl(e)}else 8772&o.subtreeFlags&&null!==a?(a.return=o,Xs=a):bl(e)}}function bl(e){for(;null!==Xs;){var t=Xs;if(8772&t.flags){var r=t.alternate;try{if(8772&t.flags)switch(t.tag){case 0:case 11:case 15:Ws||el(5,t);break;case 1:var o=t.stateNode;if(4&t.flags&&!Ws)if(null===r)o.componentDidMount();else{var a=t.elementType===t.type?r.memoizedProps:Ji(t.type,r.memoizedProps);o.componentDidUpdate(a,r.memoizedState,o.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;null!==i&&Ua(t,i,o);break;case 3:var s=t.updateQueue;if(null!==s){if(r=null,null!==t.child)switch(t.child.tag){case 5:case 1:r=t.child.stateNode}Ua(t,s,r)}break;case 5:var l=t.stateNode;if(null===r&&4&t.flags){r=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&r.focus();break;case"img":u.src&&(r.src=u.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var c=t.alternate;if(null!==c){var d=c.memoizedState;if(null!==d){var f=d.dehydrated;null!==f&&Ft(f)}}}break;default:throw Error(n(163))}Ws||512&t.flags&&tl(t)}catch(p){wu(t,t.return,p)}}if(t===e){Xs=null;break}if(null!==(r=t.sibling)){r.return=t.return,Xs=r;break}Xs=t.return}}function yl(e){for(;null!==Xs;){var t=Xs;if(t===e){Xs=null;break}var n=t.sibling;if(null!==n){n.return=t.return,Xs=n;break}Xs=t.return}}function _l(e){for(;null!==Xs;){var t=Xs;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{el(4,t)}catch(l){wu(t,n,l)}break;case 1:var r=t.stateNode;if("function"==typeof r.componentDidMount){var o=t.return;try{r.componentDidMount()}catch(l){wu(t,o,l)}}var a=t.return;try{tl(t)}catch(l){wu(t,a,l)}break;case 5:var i=t.return;try{tl(t)}catch(l){wu(t,i,l)}}}catch(l){wu(t,t.return,l)}if(t===e){Xs=null;break}var s=t.sibling;if(null!==s){s.return=t.return,Xs=s;break}Xs=t.return}}var vl,wl=Math.ceil,Sl=b.ReactCurrentDispatcher,xl=b.ReactCurrentOwner,Tl=b.ReactCurrentBatchConfig,El=0,kl=null,Pl=null,Ol=0,Al=0,Rl=So(0),$l=0,Il=null,Cl=0,Dl=0,Nl=0,Ml=null,Ll=null,jl=0,Fl=1/0,Bl=null,Ul=!1,zl=null,Vl=null,Hl=!1,ql=null,Gl=0,Wl=0,Yl=null,Xl=-1,Kl=0;function Ql(){return 6&El?Ye():-1!==Xl?Xl:Xl=Ye()}function Zl(e){return 1&e.mode?2&El&&0!==Ol?Ol&-Ol:null!==pa.transition?(0===Kl&&(Kl=ft()),Kl):0!==(e=gt)?e:e=void 0===(e=window.event)?16:Wt(e.type):1}function Jl(e,t,r,o){if(50<Wl)throw Wl=0,Yl=null,Error(n(185));ht(e,r,o),2&El&&e===kl||(e===kl&&(!(2&El)&&(Dl|=r),4===$l&&ou(e,Ol)),eu(e,o),1===r&&0===El&&!(1&t.mode)&&(Fl=Ye()+500,Lo&&Bo()))}function eu(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,a=e.pendingLanes;0<a;){var i=31-rt(a),s=1<<i,l=o[i];-1===l?0!==(s&n)&&0===(s&r)||(o[i]=ct(s,t)):l<=t&&(e.expiredLanes|=s),a&=~s}}(e,t);var r=ut(e,e===kl?Ol:0);if(0===r)null!==n&&qe(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&qe(n),1===t)0===e.tag?function(e){Lo=!0,Fo(e)}(au.bind(null,e)):Fo(au.bind(null,e)),ro(function(){!(6&El)&&Bo()}),n=null;else{switch(bt(r)){case 1:n=Ke;break;case 4:n=Qe;break;case 16:default:n=Ze;break;case 536870912:n=et}n=ku(n,tu.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function tu(e,t){if(Xl=-1,Kl=0,6&El)throw Error(n(327));var r=e.callbackNode;if(_u()&&e.callbackNode!==r)return null;var o=ut(e,e===kl?Ol:0);if(0===o)return null;if(30&o||0!==(o&e.expiredLanes)||t)t=pu(e,o);else{t=o;var a=El;El|=2;var i=du();for(kl===e&&Ol===t||(Bl=null,Fl=Ye()+500,uu(e,t));;)try{mu();break}catch(l){cu(e,l)}Ta(),Sl.current=i,El=a,null!==Pl?t=0:(kl=null,Ol=0,t=$l)}if(0!==t){if(2===t&&(0!==(a=dt(e))&&(o=a,t=nu(e,a))),1===t)throw r=Il,uu(e,0),ou(e,o),eu(e,Ye()),r;if(6===t)ou(e,o);else{if(a=e.current.alternate,!(30&o||function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var o=n[r],a=o.getSnapshot;o=o.value;try{if(!or(a(),o))return!1}catch(s){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(a)||(t=pu(e,o),2===t&&(i=dt(e),0!==i&&(o=i,t=nu(e,i))),1!==t)))throw r=Il,uu(e,0),ou(e,o),eu(e,Ye()),r;switch(e.finishedWork=a,e.finishedLanes=o,t){case 0:case 1:throw Error(n(345));case 2:case 5:yu(e,Ll,Bl);break;case 3:if(ou(e,o),(130023424&o)===o&&10<(t=jl+500-Ye())){if(0!==ut(e,0))break;if(((a=e.suspendedLanes)&o)!==o){Ql(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=eo(yu.bind(null,e,Ll,Bl),t);break}yu(e,Ll,Bl);break;case 4:if(ou(e,o),(4194240&o)===o)break;for(t=e.eventTimes,a=-1;0<o;){var s=31-rt(o);i=1<<s,(s=t[s])>a&&(a=s),o&=~i}if(o=a,10<(o=(120>(o=Ye()-o)?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*wl(o/1960))-o)){e.timeoutHandle=eo(yu.bind(null,e,Ll,Bl),o);break}yu(e,Ll,Bl);break;default:throw Error(n(329))}}}return eu(e,Ye()),e.callbackNode===r?tu.bind(null,e):null}function nu(e,t){var n=Ml;return e.current.memoizedState.isDehydrated&&(uu(e,t).flags|=256),2!==(e=pu(e,t))&&(t=Ll,Ll=n,null!==t&&ru(t)),e}function ru(e){null===Ll?Ll=e:Ll.push.apply(Ll,e)}function ou(e,t){for(t&=~Nl,t&=~Dl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-rt(t),r=1<<n;e[n]=-1,t&=~r}}function au(e){if(6&El)throw Error(n(327));_u();var t=ut(e,0);if(!(1&t))return eu(e,Ye()),null;var r=pu(e,t);if(0!==e.tag&&2===r){var o=dt(e);0!==o&&(t=o,r=nu(e,o))}if(1===r)throw r=Il,uu(e,0),ou(e,t),eu(e,Ye()),r;if(6===r)throw Error(n(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,yu(e,Ll,Bl),eu(e,Ye()),null}function iu(e,t){var n=El;El|=1;try{return e(t)}finally{0===(El=n)&&(Fl=Ye()+500,Lo&&Bo())}}function su(e){null!==ql&&0===ql.tag&&!(6&El)&&_u();var t=El;El|=1;var n=Tl.transition,r=gt;try{if(Tl.transition=null,gt=1,e)return e()}finally{gt=r,Tl.transition=n,!(6&(El=t))&&Bo()}}function lu(){Al=Rl.current,xo(Rl)}function uu(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,to(n)),null!==Pl)for(n=Pl.return;null!==n;){var r=n;switch(Jo(r),r.tag){case 1:null!=(r=r.type.childContextTypes)&&$o();break;case 3:Ya(),xo(Po),xo(ko),ei();break;case 5:Ka(r);break;case 4:Ya();break;case 13:case 19:xo(Qa);break;case 10:Ea(r.type._context);break;case 22:case 23:lu()}n=n.return}if(kl=e,Pl=e=Ru(e.current,null),Ol=Al=t,$l=0,Il=null,Nl=Dl=Cl=0,Ll=Ml=null,null!==Aa){for(t=0;t<Aa.length;t++)if(null!==(r=(n=Aa[t]).interleaved)){n.interleaved=null;var o=r.next,a=n.pending;if(null!==a){var i=a.next;a.next=o,r.next=i}n.pending=r}Aa=null}return e}function cu(e,t){for(;;){var r=Pl;try{if(Ta(),ti.current=Xi,si){for(var o=oi.memoizedState;null!==o;){var a=o.queue;null!==a&&(a.pending=null),o=o.next}si=!1}if(ri=0,ii=ai=oi=null,li=!1,ui=0,xl.current=null,null===r||null===r.return){$l=1,Il=t,Pl=null;break}e:{var i=e,s=r.return,l=r,u=t;if(t=Ol,l.flags|=32768,null!==u&&"object"==typeof u&&"function"==typeof u.then){var c=u,d=l,f=d.tag;if(!(1&d.mode||0!==f&&11!==f&&15!==f)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var h=ps(s);if(null!==h){h.flags&=-257,hs(h,s,l,0,t),1&h.mode&&fs(i,c,t),u=c;var m=(t=h).updateQueue;if(null===m){var g=new Set;g.add(u),t.updateQueue=g}else m.add(u);break e}if(!(1&t)){fs(i,c,t),fu();break e}u=Error(n(426))}else if(na&&1&l.mode){var b=ps(s);if(null!==b){!(65536&b.flags)&&(b.flags|=256),hs(b,s,l,0,t),fa(is(u,l));break e}}i=u=is(u,l),4!==$l&&($l=2),null===Ml?Ml=[i]:Ml.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t,Fa(i,cs(0,u,t));break e;case 1:l=u;var y=i.type,_=i.stateNode;if(!(128&i.flags||"function"!=typeof y.getDerivedStateFromError&&(null===_||"function"!=typeof _.componentDidCatch||null!==Vl&&Vl.has(_)))){i.flags|=65536,t&=-t,i.lanes|=t,Fa(i,ds(i,l,t));break e}}i=i.return}while(null!==i)}bu(r)}catch(v){t=v,Pl===r&&null!==r&&(Pl=r=r.return);continue}break}}function du(){var e=Sl.current;return Sl.current=Xi,null===e?Xi:e}function fu(){0!==$l&&3!==$l&&2!==$l||($l=4),null===kl||!(268435455&Cl)&&!(268435455&Dl)||ou(kl,Ol)}function pu(e,t){var r=El;El|=2;var o=du();for(kl===e&&Ol===t||(Bl=null,uu(e,t));;)try{hu();break}catch(a){cu(e,a)}if(Ta(),El=r,Sl.current=o,null!==Pl)throw Error(n(261));return kl=null,Ol=0,$l}function hu(){for(;null!==Pl;)gu(Pl)}function mu(){for(;null!==Pl&&!Ge();)gu(Pl)}function gu(e){var t=vl(e.alternate,e,Al);e.memoizedProps=e.pendingProps,null===t?bu(e):Pl=t,xl.current=null}function bu(e){var t=e;do{var n=t.alternate;if(e=t.return,32768&t.flags){if(null!==(n=qs(n,t)))return n.flags&=32767,void(Pl=n);if(null===e)return $l=6,void(Pl=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}else if(null!==(n=Hs(n,t,Al)))return void(Pl=n);if(null!==(t=t.sibling))return void(Pl=t);Pl=t=e}while(null!==t);0===$l&&($l=5)}function yu(e,t,r){var o=gt,a=Tl.transition;try{Tl.transition=null,gt=1,function(e,t,r,o){do{_u()}while(null!==ql);if(6&El)throw Error(n(327));r=e.finishedWork;var a=e.finishedLanes;if(null===r)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(n(177));e.callbackNode=null,e.callbackPriority=0;var i=r.lanes|r.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-rt(n),a=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~a}}(e,i),e===kl&&(Pl=kl=null,Ol=0),!(2064&r.subtreeFlags)&&!(2064&r.flags)||Hl||(Hl=!0,ku(Ze,function(){return _u(),null})),i=!!(15990&r.flags),!!(15990&r.subtreeFlags)||i){i=Tl.transition,Tl.transition=null;var s=gt;gt=1;var l=El;El|=4,xl.current=null,function(e,t){if(Qr=Ut,cr(e=ur())){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{var o=(r=(r=e.ownerDocument)&&r.defaultView||window).getSelection&&r.getSelection();if(o&&0!==o.rangeCount){r=o.anchorNode;var a=o.anchorOffset,i=o.focusNode;o=o.focusOffset;try{r.nodeType,i.nodeType}catch(w){r=null;break e}var s=0,l=-1,u=-1,c=0,d=0,f=e,p=null;t:for(;;){for(var h;f!==r||0!==a&&3!==f.nodeType||(l=s+a),f!==i||0!==o&&3!==f.nodeType||(u=s+o),3===f.nodeType&&(s+=f.nodeValue.length),null!==(h=f.firstChild);)p=f,f=h;for(;;){if(f===e)break t;if(p===r&&++c===a&&(l=s),p===i&&++d===o&&(u=s),null!==(h=f.nextSibling))break;p=(f=p).parentNode}f=h}r=-1===l||-1===u?null:{start:l,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(Zr={focusedElem:e,selectionRange:r},Ut=!1,Xs=t;null!==Xs;)if(e=(t=Xs).child,1028&t.subtreeFlags&&null!==e)e.return=t,Xs=e;else for(;null!==Xs;){t=Xs;try{var m=t.alternate;if(1024&t.flags)switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==m){var g=m.memoizedProps,b=m.memoizedState,y=t.stateNode,_=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:Ji(t.type,g),b);y.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var v=t.stateNode.containerInfo;1===v.nodeType?v.textContent="":9===v.nodeType&&v.documentElement&&v.removeChild(v.documentElement);break;default:throw Error(n(163))}}catch(w){wu(t,t.return,w)}if(null!==(e=t.sibling)){e.return=t.return,Xs=e;break}Xs=t.return}m=Zs,Zs=!1}(e,r),pl(r,e),dr(Zr),Ut=!!Qr,Zr=Qr=null,e.current=r,ml(r),We(),El=l,gt=s,Tl.transition=i}else e.current=r;if(Hl&&(Hl=!1,ql=e,Gl=a),i=e.pendingLanes,0===i&&(Vl=null),function(e){if(nt&&"function"==typeof nt.onCommitFiberRoot)try{nt.onCommitFiberRoot(tt,e,void 0,!(128&~e.current.flags))}catch(t){}}(r.stateNode),eu(e,Ye()),null!==t)for(o=e.onRecoverableError,r=0;r<t.length;r++)a=t[r],o(a.value,{componentStack:a.stack,digest:a.digest});if(Ul)throw Ul=!1,e=zl,zl=null,e;!!(1&Gl)&&0!==e.tag&&_u(),i=e.pendingLanes,1&i?e===Yl?Wl++:(Wl=0,Yl=e):Wl=0,Bo()}(e,t,r,o)}finally{Tl.transition=a,gt=o}return null}function _u(){if(null!==ql){var e=bt(Gl),t=Tl.transition,r=gt;try{if(Tl.transition=null,gt=16>e?16:e,null===ql)var o=!1;else{if(e=ql,ql=null,Gl=0,6&El)throw Error(n(331));var a=El;for(El|=4,Xs=e.current;null!==Xs;){var i=Xs,s=i.child;if(16&Xs.flags){var l=i.deletions;if(null!==l){for(var u=0;u<l.length;u++){var c=l[u];for(Xs=c;null!==Xs;){var d=Xs;switch(d.tag){case 0:case 11:case 15:Js(8,d,i)}var f=d.child;if(null!==f)f.return=d,Xs=f;else for(;null!==Xs;){var p=(d=Xs).sibling,h=d.return;if(nl(d),d===c){Xs=null;break}if(null!==p){p.return=h,Xs=p;break}Xs=h}}}var m=i.alternate;if(null!==m){var g=m.child;if(null!==g){m.child=null;do{var b=g.sibling;g.sibling=null,g=b}while(null!==g)}}Xs=i}}if(2064&i.subtreeFlags&&null!==s)s.return=i,Xs=s;else e:for(;null!==Xs;){if(2048&(i=Xs).flags)switch(i.tag){case 0:case 11:case 15:Js(9,i,i.return)}var y=i.sibling;if(null!==y){y.return=i.return,Xs=y;break e}Xs=i.return}}var _=e.current;for(Xs=_;null!==Xs;){var v=(s=Xs).child;if(2064&s.subtreeFlags&&null!==v)v.return=s,Xs=v;else e:for(s=_;null!==Xs;){if(2048&(l=Xs).flags)try{switch(l.tag){case 0:case 11:case 15:el(9,l)}}catch(S){wu(l,l.return,S)}if(l===s){Xs=null;break e}var w=l.sibling;if(null!==w){w.return=l.return,Xs=w;break e}Xs=l.return}}if(El=a,Bo(),nt&&"function"==typeof nt.onPostCommitFiberRoot)try{nt.onPostCommitFiberRoot(tt,e)}catch(S){}o=!0}return o}finally{gt=r,Tl.transition=t}}return!1}function vu(e,t,n){e=La(e,t=cs(0,t=is(n,t),1),1),t=Ql(),null!==e&&(ht(e,1,t),eu(e,t))}function wu(e,t,n){if(3===e.tag)vu(e,e,n);else for(;null!==t;){if(3===t.tag){vu(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Vl||!Vl.has(r))){t=La(t,e=ds(t,e=is(n,e),1),1),e=Ql(),null!==t&&(ht(t,1,e),eu(t,e));break}}t=t.return}}function Su(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=Ql(),e.pingedLanes|=e.suspendedLanes&n,kl===e&&(Ol&n)===n&&(4===$l||3===$l&&(130023424&Ol)===Ol&&500>Ye()-jl?uu(e,0):Nl|=n),eu(e,t)}function xu(e,t){0===t&&(1&e.mode?(t=st,!(130023424&(st<<=1))&&(st=4194304)):t=1);var n=Ql();null!==(e=Ia(e,t))&&(ht(e,t,n),eu(e,n))}function Tu(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),xu(e,n)}function Eu(e,t){var r=0;switch(e.tag){case 13:var o=e.stateNode,a=e.memoizedState;null!==a&&(r=a.retryLane);break;case 19:o=e.stateNode;break;default:throw Error(n(314))}null!==o&&o.delete(t),xu(e,r)}function ku(e,t){return He(e,t)}function Pu(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ou(e,t,n,r){return new Pu(e,t,n,r)}function Au(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Ru(e,t){var n=e.alternate;return null===n?((n=Ou(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function $u(e,t,r,o,a,i){var s=2;if(o=e,"function"==typeof e)Au(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case v:return Iu(r.children,a,i,t);case w:s=8,a|=8;break;case S:return(e=Ou(12,r,t,2|a)).elementType=S,e.lanes=i,e;case k:return(e=Ou(13,r,t,a)).elementType=k,e.lanes=i,e;case P:return(e=Ou(19,r,t,a)).elementType=P,e.lanes=i,e;case R:return Cu(r,a,i,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case x:s=10;break e;case T:s=9;break e;case E:s=11;break e;case O:s=14;break e;case A:s=16,o=null;break e}throw Error(n(130,null==e?e:typeof e,""))}return(t=Ou(s,r,t,a)).elementType=e,t.type=o,t.lanes=i,t}function Iu(e,t,n,r){return(e=Ou(7,e,r,t)).lanes=n,e}function Cu(e,t,n,r){return(e=Ou(22,e,r,t)).elementType=R,e.lanes=n,e.stateNode={isHidden:!1},e}function Du(e,t,n){return(e=Ou(6,e,null,t)).lanes=n,e}function Nu(e,t,n){return(t=Ou(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Mu(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=pt(0),this.expirationTimes=pt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pt(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Lu(e,t,n,r,o,a,i,s,l){return e=new Mu(e,t,n,s,l),1===t?(t=1,!0===a&&(t|=8)):t=0,a=Ou(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Da(a),e}function ju(e){if(!e)return Eo;e:{if(Fe(e=e._reactInternals)!==e||1!==e.tag)throw Error(n(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ro(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(n(171))}if(1===e.tag){var r=e.type;if(Ro(r))return Co(e,r,t)}return t}function Fu(e,t,n,r,o,a,i,s,l){return(e=Lu(n,r,!0,e,0,a,0,s,l)).context=ju(null),n=e.current,(a=Ma(r=Ql(),o=Zl(n))).callback=null!=t?t:null,La(n,a,o),e.current.lanes=o,ht(e,o,r),eu(e,r),e}function Bu(e,t,n,r){var o=t.current,a=Ql(),i=Zl(o);return n=ju(n),null===t.context?t.context=n:t.pendingContext=n,(t=Ma(a,i)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=La(o,t,i))&&(Jl(e,o,i,a),ja(e,o,i)),i}function Uu(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function zu(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Vu(e,t){zu(e,t),(e=e.alternate)&&zu(e,t)}vl=function(e,t,r){if(null!==e)if(e.memoizedProps!==t.pendingProps||Po.current)gs=!0;else{if(0===(e.lanes&r)&&!(128&t.flags))return gs=!1,function(e,t,n){switch(t.tag){case 3:ks(t),da();break;case 5:Xa(t);break;case 1:Ro(t.type)&&Do(t);break;case 4:Wa(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;To(va,r._currentValue),r._currentValue=o;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(To(Qa,1&Qa.current),t.flags|=128,null):0!==(n&t.child.childLanes)?Ds(e,t,n):(To(Qa,1&Qa.current),null!==(e=Us(e,t,n))?e.sibling:null);To(Qa,1&Qa.current);break;case 19:if(r=0!==(n&t.childLanes),128&e.flags){if(r)return Fs(e,t,n);t.flags|=128}if(null!==(o=t.memoizedState)&&(o.rendering=null,o.tail=null,o.lastEffect=null),To(Qa,Qa.current),r)break;return null;case 22:case 23:return t.lanes=0,ws(e,t,n)}return Us(e,t,n)}(e,t,r);gs=!!(131072&e.flags)}else gs=!1,na&&1048576&t.flags&&Qo(t,Ho,t.index);switch(t.lanes=0,t.tag){case 2:var o=t.type;Bs(e,t),e=t.pendingProps;var a=Ao(t,ko.current);Pa(t,r),a=pi(null,t,o,e,a,r);var i=hi();return t.flags|=1,"object"==typeof a&&null!==a&&"function"==typeof a.render&&void 0===a.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ro(o)?(i=!0,Do(t)):i=!1,t.memoizedState=null!==a.state&&void 0!==a.state?a.state:null,Da(t),a.updater=ts,t.stateNode=a,a._reactInternals=t,as(t,o,e,r),t=Es(null,t,o,!0,i,r)):(t.tag=0,na&&i&&Zo(t),bs(null,t,a,r),t=t.child),t;case 16:o=t.elementType;e:{switch(Bs(e,t),e=t.pendingProps,o=(a=o._init)(o._payload),t.type=o,a=t.tag=function(e){if("function"==typeof e)return Au(e)?1:0;if(null!=e){if((e=e.$$typeof)===E)return 11;if(e===O)return 14}return 2}(o),e=Ji(o,e),a){case 0:t=xs(null,t,o,e,r);break e;case 1:t=Ts(null,t,o,e,r);break e;case 11:t=ys(null,t,o,e,r);break e;case 14:t=_s(null,t,o,Ji(o.type,e),r);break e}throw Error(n(306,o,""))}return t;case 0:return o=t.type,a=t.pendingProps,xs(e,t,o,a=t.elementType===o?a:Ji(o,a),r);case 1:return o=t.type,a=t.pendingProps,Ts(e,t,o,a=t.elementType===o?a:Ji(o,a),r);case 3:e:{if(ks(t),null===e)throw Error(n(387));o=t.pendingProps,a=(i=t.memoizedState).element,Na(e,t),Ba(t,o,null,r);var s=t.memoizedState;if(o=s.element,i.isDehydrated){if(i={element:o,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,256&t.flags){t=Ps(e,t,o,r,a=is(Error(n(423)),t));break e}if(o!==a){t=Ps(e,t,o,r,a=is(Error(n(424)),t));break e}for(ta=io(t.stateNode.containerInfo.firstChild),ea=t,na=!0,ra=null,r=_a(t,null,o,r),t.child=r;r;)r.flags=-3&r.flags|4096,r=r.sibling}else{if(da(),o===a){t=Us(e,t,r);break e}bs(e,t,o,r)}t=t.child}return t;case 5:return Xa(t),null===e&&sa(t),o=t.type,a=t.pendingProps,i=null!==e?e.memoizedProps:null,s=a.children,Jr(o,a)?s=null:null!==i&&Jr(o,i)&&(t.flags|=32),Ss(e,t),bs(e,t,s,r),t.child;case 6:return null===e&&sa(t),null;case 13:return Ds(e,t,r);case 4:return Wa(t,t.stateNode.containerInfo),o=t.pendingProps,null===e?t.child=ya(t,null,o,r):bs(e,t,o,r),t.child;case 11:return o=t.type,a=t.pendingProps,ys(e,t,o,a=t.elementType===o?a:Ji(o,a),r);case 7:return bs(e,t,t.pendingProps,r),t.child;case 8:case 12:return bs(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(o=t.type._context,a=t.pendingProps,i=t.memoizedProps,s=a.value,To(va,o._currentValue),o._currentValue=s,null!==i)if(or(i.value,s)){if(i.children===a.children&&!Po.current){t=Us(e,t,r);break e}}else for(null!==(i=t.child)&&(i.return=t);null!==i;){var l=i.dependencies;if(null!==l){s=i.child;for(var u=l.firstContext;null!==u;){if(u.context===o){if(1===i.tag){(u=Ma(-1,r&-r)).tag=2;var c=i.updateQueue;if(null!==c){var d=(c=c.shared).pending;null===d?u.next=u:(u.next=d.next,d.next=u),c.pending=u}}i.lanes|=r,null!==(u=i.alternate)&&(u.lanes|=r),ka(i.return,r,t),l.lanes|=r;break}u=u.next}}else if(10===i.tag)s=i.type===t.type?null:i.child;else if(18===i.tag){if(null===(s=i.return))throw Error(n(341));s.lanes|=r,null!==(l=s.alternate)&&(l.lanes|=r),ka(s,r,t),s=i.sibling}else s=i.child;if(null!==s)s.return=i;else for(s=i;null!==s;){if(s===t){s=null;break}if(null!==(i=s.sibling)){i.return=s.return,s=i;break}s=s.return}i=s}bs(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,o=t.pendingProps.children,Pa(t,r),o=o(a=Oa(a)),t.flags|=1,bs(e,t,o,r),t.child;case 14:return a=Ji(o=t.type,t.pendingProps),_s(e,t,o,a=Ji(o.type,a),r);case 15:return vs(e,t,t.type,t.pendingProps,r);case 17:return o=t.type,a=t.pendingProps,a=t.elementType===o?a:Ji(o,a),Bs(e,t),t.tag=1,Ro(o)?(e=!0,Do(t)):e=!1,Pa(t,r),rs(t,o,a),as(t,o,a,r),Es(null,t,o,!0,e,r);case 19:return Fs(e,t,r);case 22:return ws(e,t,r)}throw Error(n(156,t.tag))};var Hu="function"==typeof reportError?reportError:function(e){console.error(e)};function qu(e){this._internalRoot=e}function Gu(e){this._internalRoot=e}function Wu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Yu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Xu(){}function Ku(e,t,n,r,o){var a=n._reactRootContainer;if(a){var i=a;if("function"==typeof o){var s=o;o=function(){var e=Uu(i);s.call(e)}}Bu(t,i,e,o)}else i=function(e,t,n,r,o){if(o){if("function"==typeof r){var a=r;r=function(){var e=Uu(i);a.call(e)}}var i=Fu(t,r,e,0,null,!1,0,"",Xu);return e._reactRootContainer=i,e[fo]=i.current,Fr(8===e.nodeType?e.parentNode:e),su(),i}for(;o=e.lastChild;)e.removeChild(o);if("function"==typeof r){var s=r;r=function(){var e=Uu(l);s.call(e)}}var l=Lu(e,0,!1,null,0,!1,0,"",Xu);return e._reactRootContainer=l,e[fo]=l.current,Fr(8===e.nodeType?e.parentNode:e),su(function(){Bu(t,l,n,r)}),l}(n,t,e,o,r);return Uu(i)}Gu.prototype.render=qu.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(n(409));Bu(e,t,null,null)},Gu.prototype.unmount=qu.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;su(function(){Bu(null,e,null,null)}),t[fo]=null}},Gu.prototype.unstable_scheduleHydration=function(e){if(e){var t=wt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Rt.length&&0!==t&&t<Rt[n].priority;n++);Rt.splice(n,0,e),0===n&&Dt(e)}},yt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=lt(t.pendingLanes);0!==n&&(mt(t,1|n),eu(t,Ye()),!(6&El)&&(Fl=Ye()+500,Bo()))}break;case 13:su(function(){var t=Ia(e,1);if(null!==t){var n=Ql();Jl(t,e,1,n)}}),Vu(e,1)}},_t=function(e){if(13===e.tag){var t=Ia(e,134217728);if(null!==t)Jl(t,e,134217728,Ql());Vu(e,134217728)}},vt=function(e){if(13===e.tag){var t=Zl(e),n=Ia(e,t);if(null!==n)Jl(n,e,t,Ql());Vu(e,t)}},wt=function(){return gt},St=function(e,t){var n=gt;try{return gt=e,t()}finally{gt=n}},_e=function(e,t,r){switch(t){case"input":if(X(e,r),t=r.name,"radio"===r.type&&null!=t){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var o=r[t];if(o!==e&&o.form===e.form){var a=_o(o);if(!a)throw Error(n(90));H(o),X(o,a)}}}break;case"textarea":ne(e,r);break;case"select":null!=(t=r.value)&&J(e,!!r.multiple,t,!1)}},Ee=iu,ke=su;var Qu={usingClientEntryPoint:!1,Events:[bo,yo,_o,xe,Te,iu]},Zu={findFiberByHostInstance:go,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Ju={bundleType:Zu.bundleType,version:Zu.version,rendererPackageName:Zu.rendererPackageName,rendererConfig:Zu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:b.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=ze(e))?null:e.stateNode},findFiberByHostInstance:Zu.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var ec=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ec.isDisabled&&ec.supportsFiber)try{tt=ec.inject(Ju),nt=ec}catch(se){}}return reactDom_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Qu,reactDom_production_min.createPortal=function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Wu(t))throw Error(n(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:_,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,r)},reactDom_production_min.createRoot=function(e,t){if(!Wu(e))throw Error(n(299));var r=!1,o="",a=Hu;return null!=t&&(!0===t.unstable_strictMode&&(r=!0),void 0!==t.identifierPrefix&&(o=t.identifierPrefix),void 0!==t.onRecoverableError&&(a=t.onRecoverableError)),t=Lu(e,1,!1,null,0,r,0,o,a),e[fo]=t.current,Fr(8===e.nodeType?e.parentNode:e),new qu(t)},reactDom_production_min.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(n(188));throw e=Object.keys(e).join(","),Error(n(268,e))}return e=null===(e=ze(t))?null:e.stateNode},reactDom_production_min.flushSync=function(e){return su(e)},reactDom_production_min.hydrate=function(e,t,r){if(!Yu(t))throw Error(n(200));return Ku(null,e,t,!0,r)},reactDom_production_min.hydrateRoot=function(e,t,r){if(!Wu(e))throw Error(n(405));var o=null!=r&&r.hydratedSources||null,a=!1,i="",s=Hu;if(null!=r&&(!0===r.unstable_strictMode&&(a=!0),void 0!==r.identifierPrefix&&(i=r.identifierPrefix),void 0!==r.onRecoverableError&&(s=r.onRecoverableError)),t=Fu(t,null,e,1,null!=r?r:null,a,0,i,s),e[fo]=t.current,Fr(e),o)for(e=0;e<o.length;e++)a=(a=(r=o[e])._getVersion)(r._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[r,a]:t.mutableSourceEagerHydrationData.push(r,a);return new Gu(t)},reactDom_production_min.render=function(e,t,r){if(!Yu(t))throw Error(n(200));return Ku(null,e,t,!1,r)},reactDom_production_min.unmountComponentAtNode=function(e){if(!Yu(e))throw Error(n(40));return!!e._reactRootContainer&&(su(function(){Ku(null,null,e,!1,function(){e._reactRootContainer=null,e[fo]=null})}),!0)},reactDom_production_min.unstable_batchedUpdates=iu,reactDom_production_min.unstable_renderSubtreeIntoContainer=function(e,t,r,o){if(!Yu(r))throw Error(n(200));if(null==e||void 0===e._reactInternals)throw Error(n(38));return Ku(e,t,r,!1,o)},reactDom_production_min.version="18.3.1-next-f1338f8080-20240426",reactDom_production_min}var reactDom_development={},hasRequiredReactDom_development;
|
|
47
|
+
/**
|
|
48
|
+
* @license React
|
|
49
|
+
* react-dom.development.js
|
|
50
|
+
*
|
|
51
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
52
|
+
*
|
|
53
|
+
* This source code is licensed under the MIT license found in the
|
|
54
|
+
* LICENSE file in the root directory of this source tree.
|
|
55
|
+
*/function requireReactDom_development(){return hasRequiredReactDom_development||(hasRequiredReactDom_development=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=requireReact(),t=requireScheduler(),n=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,r=!1;function o(e){if(!r){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];i("warn",e,n)}}function a(e){if(!r){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];i("error",e,n)}}function i(e,t,r){var o=n.ReactDebugCurrentFrame.getStackAddendum();""!==o&&(t+="%s",r=r.concat([o]));var a=r.map(function(e){return String(e)});a.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,a)}var s=10,l=11,u=12,c=13,d=14,f=15,p=17,h=18,m=19,g=21,b=22,y=23,_=!1,v=!1,w=new Set,S={},x={};function T(e,t){E(e,t),E(e+"Capture",t)}function E(e,t){S[e]&&a("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.",e),S[e]=t;var n=e.toLowerCase();x[n]=e,"onDoubleClick"===e&&(x.ondblclick=e);for(var r=0;r<t.length;r++)w.add(t[r])}var k=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),P=Object.prototype.hasOwnProperty;function O(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}function A(e){try{return R(e),!1}catch(t){return!0}}function R(e){return""+e}function $(e,t){if(A(e))return a("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before before using it here.",t,O(e)),R(e)}function I(e){if(A(e))return a("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before before using it here.",O(e)),R(e)}var C=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",D=C+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",N=new RegExp("^["+C+"]["+D+"]*$"),M={},L={};function j(e){return!!P.call(L,e)||!P.call(M,e)&&(N.test(e)?(L[e]=!0,!0):(M[e]=!0,a("Invalid attribute name: `%s`",e),!1))}function F(e,t,n){return null!==t?0===t.type:!n&&(e.length>2&&("o"===e[0]||"O"===e[0])&&("n"===e[1]||"N"===e[1]))}function B(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":if(r)return!1;if(null!==n)return!n.acceptsBooleans;var o=e.toLowerCase().slice(0,5);return"data-"!==o&&"aria-"!==o;default:return!1}}function U(e,t,n,r){if(null==t)return!0;if(B(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||t<1}return!1}function z(e){return H.hasOwnProperty(e)?H[e]:null}function V(e,t,n,r,o,a,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=i}var H={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(function(e){H[e]=new V(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0],n=e[1];H[t]=new V(t,1,!1,n,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){H[e]=new V(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){H[e]=new V(e,2,!1,e,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(function(e){H[e]=new V(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){H[e]=new V(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){H[e]=new V(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){H[e]=new V(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){H[e]=new V(e,5,!1,e.toLowerCase(),null,!1,!1)});var q=/[\-\:]([a-z])/g,G=function(e){return e[1].toUpperCase()};["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(function(e){var t=e.replace(q,G);H[t]=new V(t,1,!1,e,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(function(e){var t=e.replace(q,G);H[t]=new V(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(q,G);H[t]=new V(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){H[e]=new V(e,1,!1,e.toLowerCase(),null,!1,!1)});H.xlinkHref=new V("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){H[e]=new V(e,1,!1,e.toLowerCase(),null,!0,!0)});var W=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i,Y=!1;function X(e){!Y&&W.test(e)&&(Y=!0,a("A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.",JSON.stringify(e)))}function K(e,t,n,r){if(r.mustUseProperty)return e[r.propertyName];$(n,t),r.sanitizeURL&&X(""+n);var o=r.attributeName,a=null;if(4===r.type){if(e.hasAttribute(o)){var i=e.getAttribute(o);return""===i||(U(t,n,r,!1)?i:i===""+n?n:i)}}else if(e.hasAttribute(o)){if(U(t,n,r,!1))return e.getAttribute(o);if(3===r.type)return n;a=e.getAttribute(o)}return U(t,n,r,!1)?null===a?n:a:a===""+n?n:a}function Q(e,t,n,r){if(j(t)){if(!e.hasAttribute(t))return void 0===n?void 0:null;var o=e.getAttribute(t);return $(n,t),o===""+n?n:o}}function Z(e,t,n,r){var o=z(t);if(!F(t,o,r))if(U(t,n,o,r)&&(n=null),r||null===o){if(j(t)){var a=t;null===n?e.removeAttribute(a):($(n,t),e.setAttribute(a,""+n))}}else if(o.mustUseProperty){var i=o.propertyName;if(null===n){var s=o.type;e[i]=3!==s&&""}else e[i]=n}else{var l=o.attributeName,u=o.attributeNamespace;if(null===n)e.removeAttribute(l);else{var c,d=o.type;3===d||4===d&&!0===n?c="":($(n,l),c=""+n,o.sanitizeURL&&X(c.toString())),u?e.setAttributeNS(u,l,c):e.setAttribute(l,c)}}}var J=Symbol.for("react.element"),ee=Symbol.for("react.portal"),te=Symbol.for("react.fragment"),ne=Symbol.for("react.strict_mode"),re=Symbol.for("react.profiler"),oe=Symbol.for("react.provider"),ae=Symbol.for("react.context"),ie=Symbol.for("react.forward_ref"),se=Symbol.for("react.suspense"),le=Symbol.for("react.suspense_list"),ue=Symbol.for("react.memo"),ce=Symbol.for("react.lazy"),de=(Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode"),Symbol.for("react.offscreen")),fe=(Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker"),Symbol.iterator);function pe(e){if(null===e||"object"!=typeof e)return null;var t=fe&&e[fe]||e["@@iterator"];return"function"==typeof t?t:null}var he,me,ge,be,ye,_e,ve,we=Object.assign,Se=0;function xe(){}xe.__reactDisabledLog=!0;var Te,Ee=n.ReactCurrentDispatcher;function ke(e,t,n){if(void 0===Te)try{throw Error()}catch(o){var r=o.stack.trim().match(/\n( *(at )?)/);Te=r&&r[1]||""}return"\n"+Te+e}var Pe,Oe=!1,Ae="function"==typeof WeakMap?WeakMap:Map;function Re(e,t){if(!e||Oe)return"";var n,r=Pe.get(e);if(void 0!==r)return r;Oe=!0;var o,i=Error.prepareStackTrace;Error.prepareStackTrace=void 0,o=Ee.current,Ee.current=null,function(){if(0===Se){he=console.log,me=console.info,ge=console.warn,be=console.error,ye=console.group,_e=console.groupCollapsed,ve=console.groupEnd;var e={configurable:!0,enumerable:!0,value:xe,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Se++}();try{if(t){var s=function(){throw Error()};if(Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(s,[])}catch(m){n=m}Reflect.construct(e,[],s)}else{try{s.call()}catch(m){n=m}e.call(s.prototype)}}else{try{throw Error()}catch(m){n=m}e()}}catch(g){if(g&&n&&"string"==typeof g.stack){for(var l=g.stack.split("\n"),u=n.stack.split("\n"),c=l.length-1,d=u.length-1;c>=1&&d>=0&&l[c]!==u[d];)d--;for(;c>=1&&d>=0;c--,d--)if(l[c]!==u[d]){if(1!==c||1!==d)do{if(c--,--d<0||l[c]!==u[d]){var f="\n"+l[c].replace(" at new "," at ");return e.displayName&&f.includes("<anonymous>")&&(f=f.replace("<anonymous>",e.displayName)),"function"==typeof e&&Pe.set(e,f),f}}while(c>=1&&d>=0);break}}}finally{Oe=!1,Ee.current=o,function(){if(0===--Se){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:we({},e,{value:he}),info:we({},e,{value:me}),warn:we({},e,{value:ge}),error:we({},e,{value:be}),group:we({},e,{value:ye}),groupCollapsed:we({},e,{value:_e}),groupEnd:we({},e,{value:ve})})}Se<0&&a("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=i}var p=e?e.displayName||e.name:"",h=p?ke(p):"";return"function"==typeof e&&Pe.set(e,h),h}function $e(e,t,n){return Re(e,!1)}function Ie(e,t,n){if(null==e)return"";if("function"==typeof e)return Re(e,!(!(r=e.prototype)||!r.isReactComponent));var r;if("string"==typeof e)return ke(e);switch(e){case se:return ke("Suspense");case le:return ke("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case ie:return $e(e.render);case ue:return Ie(e.type,t,n);case ce:var o=e,a=o._payload,i=o._init;try{return Ie(i(a),t,n)}catch(s){}}return""}function Ce(e){switch(e._debugOwner&&e._debugOwner.type,e._debugSource,e.tag){case 5:return ke(e.type);case 16:return ke("Lazy");case c:return ke("Suspense");case m:return ke("SuspenseList");case 0:case 2:case f:return $e(e.type);case l:return $e(e.type.render);case 1:return Re(e.type,!0);default:return""}}function De(e){try{var t="",n=e;do{t+=Ce(n),n=n.return}while(n);return t}catch(r){return"\nError generating stack: "+r.message+"\n"+r.stack}}function Ne(e){return e.displayName||"Context"}function Me(e){if(null==e)return null;if("number"==typeof e.tag&&a("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case te:return"Fragment";case ee:return"Portal";case re:return"Profiler";case ne:return"StrictMode";case se:return"Suspense";case le:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case ae:return Ne(e)+".Consumer";case oe:return Ne(e._context)+".Provider";case ie:return function(e,t,n){var r=e.displayName;if(r)return r;var o=t.displayName||t.name||"";return""!==o?n+"("+o+")":n}(e,e.render,"ForwardRef");case ue:var t=e.displayName||null;return null!==t?t:Me(e.type)||"Memo";case ce:var n=e,r=n._payload,o=n._init;try{return Me(o(r))}catch(i){return null}}return null}function Le(e){return e.displayName||"Context"}function je(e){var t,n,r,o,a=e.tag,i=e.type;switch(a){case 24:return"Cache";case 9:return Le(i)+".Consumer";case s:return Le(i._context)+".Provider";case 18:return"DehydratedFragment";case l:return t=i,n=i.render,r="ForwardRef",o=n.displayName||n.name||"",t.displayName||(""!==o?r+"("+o+")":r);case 7:return"Fragment";case 5:return i;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Me(i);case 8:return i===ne?"StrictMode":"Mode";case b:return"Offscreen";case u:return"Profiler";case g:return"Scope";case c:return"Suspense";case m:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case p:case 2:case d:case f:if("function"==typeof i)return i.displayName||i.name||null;if("string"==typeof i)return i}return null}Pe=new Ae;var Fe=n.ReactDebugCurrentFrame,Be=null,Ue=!1;function ze(){if(null===Be)return null;var e=Be._debugOwner;return null!=e?je(e):null}function Ve(){return null===Be?"":De(Be)}function He(){Fe.getCurrentStack=null,Be=null,Ue=!1}function qe(e){Fe.getCurrentStack=null===e?null:Ve,Be=e,Ue=!1}function Ge(e){Ue=e}function We(e){return""+e}function Ye(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return I(e),e;default:return""}}var Xe={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0};function Ke(e,t){Xe[t.type]||t.onChange||t.onInput||t.readOnly||t.disabled||null==t.value||a("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`."),t.onChange||t.readOnly||t.disabled||null==t.checked||a("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")}function Qe(e){var t=e.type,n=e.nodeName;return n&&"input"===n.toLowerCase()&&("checkbox"===t||"radio"===t)}function Ze(e){return e._valueTracker}function Je(e){Ze(e)||(e._valueTracker=function(e){var t=Qe(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);I(e[t]);var r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var o=n.get,a=n.set;Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){I(e),r=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable});var i={getValue:function(){return r},setValue:function(e){I(e),r=""+e},stopTracking:function(){!function(e){e._valueTracker=null}(e),delete e[t]}};return i}}(e))}function et(e){if(!e)return!1;var t=Ze(e);if(!t)return!0;var n=t.getValue(),r=function(e){var t="";return e?t=Qe(e)?e.checked?"true":"false":e.value:t}(e);return r!==n&&(t.setValue(r),!0)}function tt(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}var nt=!1,rt=!1,ot=!1,at=!1;function it(e){return"checkbox"===e.type||"radio"===e.type?null!=e.checked:null!=e.value}function st(e,t){var n=e,r=t.checked;return we({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=r?r:n._wrapperState.initialChecked})}function lt(e,t){Ke(0,t),void 0===t.checked||void 0===t.defaultChecked||rt||(a("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components",ze()||"A component",t.type),rt=!0),void 0===t.value||void 0===t.defaultValue||nt||(a("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components",ze()||"A component",t.type),nt=!0);var n=e,r=null==t.defaultValue?"":t.defaultValue;n._wrapperState={initialChecked:null!=t.checked?t.checked:t.defaultChecked,initialValue:Ye(null!=t.value?t.value:r),controlled:it(t)}}function ut(e,t){var n=e,r=t.checked;null!=r&&Z(n,"checked",r,!1)}function ct(e,t){var n=e,r=it(t);n._wrapperState.controlled||!r||at||(a("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"),at=!0),!n._wrapperState.controlled||r||ot||(a("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"),ot=!0),ut(e,t);var o=Ye(t.value),i=t.type;if(null!=o)"number"===i?(0===o&&""===n.value||n.value!=o)&&(n.value=We(o)):n.value!==We(o)&&(n.value=We(o));else if("submit"===i||"reset"===i)return void n.removeAttribute("value");t.hasOwnProperty("value")?pt(n,t.type,o):t.hasOwnProperty("defaultValue")&&pt(n,t.type,Ye(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(n.defaultChecked=!!t.defaultChecked)}function dt(e,t,n){var r=e;if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var o=t.type;if(("submit"===o||"reset"===o)&&(void 0===t.value||null===t.value))return;var a=We(r._wrapperState.initialValue);n||a!==r.value&&(r.value=a),r.defaultValue=a}var i=r.name;""!==i&&(r.name=""),r.defaultChecked=!r.defaultChecked,r.defaultChecked=!!r._wrapperState.initialChecked,""!==i&&(r.name=i)}function ft(e,t){var n=e;ct(n,t),function(e,t){var n=t.name;if("radio"===t.type&&null!=n){for(var r=e;r.parentNode;)r=r.parentNode;$(n,"name");for(var o=r.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),a=0;a<o.length;a++){var i=o[a];if(i!==e&&i.form===e.form){var s=Qu(i);if(!s)throw new Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");et(i),ct(i,s)}}}}(n,t)}function pt(e,t,n){"number"===t&&tt(e.ownerDocument)===e||(null==n?e.defaultValue=We(e._wrapperState.initialValue):e.defaultValue!==We(n)&&(e.defaultValue=We(n)))}var ht=!1,mt=!1,gt=!1;function bt(t,n){null==n.value&&("object"==typeof n.children&&null!==n.children?e.Children.forEach(n.children,function(e){null!=e&&"string"!=typeof e&&"number"!=typeof e&&(mt||(mt=!0,a("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>.")))}):null!=n.dangerouslySetInnerHTML&&(gt||(gt=!0,a("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected.")))),null==n.selected||ht||(a("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."),ht=!0)}var yt,_t=Array.isArray;function vt(e){return _t(e)}function wt(){var e=ze();return e?"\n\nCheck the render method of `"+e+"`.":""}yt=!1;var St=["value","defaultValue"];function xt(e,t,n,r){var o=e.options;if(t){for(var a=n,i={},s=0;s<a.length;s++)i["$"+a[s]]=!0;for(var l=0;l<o.length;l++){var u=i.hasOwnProperty("$"+o[l].value);o[l].selected!==u&&(o[l].selected=u),u&&r&&(o[l].defaultSelected=!0)}}else{for(var c=We(Ye(n)),d=null,f=0;f<o.length;f++){if(o[f].value===c)return o[f].selected=!0,void(r&&(o[f].defaultSelected=!0));null!==d||o[f].disabled||(d=o[f])}null!==d&&(d.selected=!0)}}function Tt(e,t){return we({},t,{value:void 0})}function Et(e,t){var n=e;!function(e){Ke(0,e);for(var t=0;t<St.length;t++){var n=St[t];if(null!=e[n]){var r=vt(e[n]);e.multiple&&!r?a("The `%s` prop supplied to <select> must be an array if `multiple` is true.%s",n,wt()):!e.multiple&&r&&a("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s",n,wt())}}}(t),n._wrapperState={wasMultiple:!!t.multiple},void 0===t.value||void 0===t.defaultValue||yt||(a("Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://reactjs.org/link/controlled-components"),yt=!0)}var kt=!1;function Pt(e,t){var n=e;if(null!=t.dangerouslySetInnerHTML)throw new Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");return we({},t,{value:void 0,defaultValue:void 0,children:We(n._wrapperState.initialValue)})}function Ot(e,t){var n=e;Ke(0,t),void 0===t.value||void 0===t.defaultValue||kt||(a("%s contains a textarea with both value and defaultValue props. Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://reactjs.org/link/controlled-components",ze()||"A component"),kt=!0);var r=t.value;if(null==r){var o=t.children,i=t.defaultValue;if(null!=o){if(a("Use the `defaultValue` or `value` props instead of setting children on <textarea>."),null!=i)throw new Error("If you supply `defaultValue` on a <textarea>, do not pass children.");if(vt(o)){if(o.length>1)throw new Error("<textarea> can only have at most one child.");o=o[0]}i=o}null==i&&(i=""),r=i}n._wrapperState={initialValue:Ye(r)}}function At(e,t){var n=e,r=Ye(t.value),o=Ye(t.defaultValue);if(null!=r){var a=We(r);a!==n.value&&(n.value=a),null==t.defaultValue&&n.defaultValue!==a&&(n.defaultValue=a)}null!=o&&(n.defaultValue=We(o))}function Rt(e,t){var n=e,r=n.textContent;r===n._wrapperState.initialValue&&""!==r&&null!==r&&(n.value=r)}var $t="http://www.w3.org/1999/xhtml",It="http://www.w3.org/2000/svg";function Ct(e){switch(e){case"svg":return It;case"math":return"http://www.w3.org/1998/Math/MathML";default:return $t}}function Dt(e,t){return null==e||e===$t?Ct(t):e===It&&"foreignObject"===t?$t:e}var Nt,Mt,Lt=(Mt=function(e,t){if(e.namespaceURI!==It||"innerHTML"in e)e.innerHTML=t;else{(Nt=Nt||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>";for(var n=Nt.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction(function(){return Mt(e,t,n,r)})}:Mt),jt=function(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t},Ft={animation:["animationDelay","animationDirection","animationDuration","animationFillMode","animationIterationCount","animationName","animationPlayState","animationTimingFunction"],background:["backgroundAttachment","backgroundClip","backgroundColor","backgroundImage","backgroundOrigin","backgroundPositionX","backgroundPositionY","backgroundRepeat","backgroundSize"],backgroundPosition:["backgroundPositionX","backgroundPositionY"],border:["borderBottomColor","borderBottomStyle","borderBottomWidth","borderImageOutset","borderImageRepeat","borderImageSlice","borderImageSource","borderImageWidth","borderLeftColor","borderLeftStyle","borderLeftWidth","borderRightColor","borderRightStyle","borderRightWidth","borderTopColor","borderTopStyle","borderTopWidth"],borderBlockEnd:["borderBlockEndColor","borderBlockEndStyle","borderBlockEndWidth"],borderBlockStart:["borderBlockStartColor","borderBlockStartStyle","borderBlockStartWidth"],borderBottom:["borderBottomColor","borderBottomStyle","borderBottomWidth"],borderColor:["borderBottomColor","borderLeftColor","borderRightColor","borderTopColor"],borderImage:["borderImageOutset","borderImageRepeat","borderImageSlice","borderImageSource","borderImageWidth"],borderInlineEnd:["borderInlineEndColor","borderInlineEndStyle","borderInlineEndWidth"],borderInlineStart:["borderInlineStartColor","borderInlineStartStyle","borderInlineStartWidth"],borderLeft:["borderLeftColor","borderLeftStyle","borderLeftWidth"],borderRadius:["borderBottomLeftRadius","borderBottomRightRadius","borderTopLeftRadius","borderTopRightRadius"],borderRight:["borderRightColor","borderRightStyle","borderRightWidth"],borderStyle:["borderBottomStyle","borderLeftStyle","borderRightStyle","borderTopStyle"],borderTop:["borderTopColor","borderTopStyle","borderTopWidth"],borderWidth:["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth"],columnRule:["columnRuleColor","columnRuleStyle","columnRuleWidth"],columns:["columnCount","columnWidth"],flex:["flexBasis","flexGrow","flexShrink"],flexFlow:["flexDirection","flexWrap"],font:["fontFamily","fontFeatureSettings","fontKerning","fontLanguageOverride","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontVariantAlternates","fontVariantCaps","fontVariantEastAsian","fontVariantLigatures","fontVariantNumeric","fontVariantPosition","fontWeight","lineHeight"],fontVariant:["fontVariantAlternates","fontVariantCaps","fontVariantEastAsian","fontVariantLigatures","fontVariantNumeric","fontVariantPosition"],gap:["columnGap","rowGap"],grid:["gridAutoColumns","gridAutoFlow","gridAutoRows","gridTemplateAreas","gridTemplateColumns","gridTemplateRows"],gridArea:["gridColumnEnd","gridColumnStart","gridRowEnd","gridRowStart"],gridColumn:["gridColumnEnd","gridColumnStart"],gridColumnGap:["columnGap"],gridGap:["columnGap","rowGap"],gridRow:["gridRowEnd","gridRowStart"],gridRowGap:["rowGap"],gridTemplate:["gridTemplateAreas","gridTemplateColumns","gridTemplateRows"],listStyle:["listStyleImage","listStylePosition","listStyleType"],margin:["marginBottom","marginLeft","marginRight","marginTop"],marker:["markerEnd","markerMid","markerStart"],mask:["maskClip","maskComposite","maskImage","maskMode","maskOrigin","maskPositionX","maskPositionY","maskRepeat","maskSize"],maskPosition:["maskPositionX","maskPositionY"],outline:["outlineColor","outlineStyle","outlineWidth"],overflow:["overflowX","overflowY"],padding:["paddingBottom","paddingLeft","paddingRight","paddingTop"],placeContent:["alignContent","justifyContent"],placeItems:["alignItems","justifyItems"],placeSelf:["alignSelf","justifySelf"],textDecoration:["textDecorationColor","textDecorationLine","textDecorationStyle"],textEmphasis:["textEmphasisColor","textEmphasisStyle"],transition:["transitionDelay","transitionDuration","transitionProperty","transitionTimingFunction"],wordWrap:["overflowWrap"]},Bt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};var Ut=["Webkit","ms","Moz","O"];function zt(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||Bt.hasOwnProperty(e)&&Bt[e]?(function(e,t){if(A(e))a("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before before using it here.",t,O(e)),R(e)}(t,e),(""+t).trim()):t+"px"}Object.keys(Bt).forEach(function(e){Ut.forEach(function(t){Bt[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(t,e)]=Bt[e]})});var Vt=/([A-Z])/g,Ht=/^ms-/;function qt(e){return e.replace(Vt,"-$1").toLowerCase().replace(Ht,"-ms-")}var Gt=/^(?:webkit|moz|o)[A-Z]/,Wt=/^-ms-/,Yt=/-(.)/g,Xt=/;\s*$/,Kt={},Qt={},Zt=!1,Jt=!1,en=function(e){Kt.hasOwnProperty(e)&&Kt[e]||(Kt[e]=!0,a("Unsupported style property %s. Did you mean %s?",e,e.replace(Wt,"ms-").replace(Yt,function(e,t){return t.toUpperCase()})))},tn=function(e,t){e.indexOf("-")>-1?en(e):Gt.test(e)?function(e){Kt.hasOwnProperty(e)&&Kt[e]||(Kt[e]=!0,a("Unsupported vendor-prefixed style property %s. Did you mean %s?",e,e.charAt(0).toUpperCase()+e.slice(1)))}(e):Xt.test(t)&&function(e,t){Qt.hasOwnProperty(t)&&Qt[t]||(Qt[t]=!0,a('Style property values shouldn\'t contain a semicolon. Try "%s: %s" instead.',e,t.replace(Xt,"")))}(e,t),"number"==typeof t&&(isNaN(t)?function(e){Zt||(Zt=!0,a("`NaN` is an invalid value for the `%s` css style property.",e))}(e):isFinite(t)||function(e){Jt||(Jt=!0,a("`Infinity` is an invalid value for the `%s` css style property.",e))}(e))};function nn(e){var t="",n="";for(var r in e)if(e.hasOwnProperty(r)){var o=e[r];if(null!=o){var a=0===r.indexOf("--");t+=n+(a?r:qt(r))+":",t+=zt(r,o,a),n=";"}}return t||null}function rn(e,t){var n=e.style;for(var r in t)if(t.hasOwnProperty(r)){var o=0===r.indexOf("--");o||tn(r,t[r]);var a=zt(r,t[r],o);"float"===r&&(r="cssFloat"),o?n.setProperty(r,a):n[r]=a}}function on(e){return null==e||"boolean"==typeof e||""===e}function an(e){var t={};for(var n in e)for(var r=Ft[n]||[n],o=0;o<r.length;o++)t[r[o]]=n;return t}var sn=we({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ln(e,t){if(t){if(sn[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw new Error(e+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw new Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw new Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.")}if(!t.suppressContentEditableWarning&&t.contentEditable&&null!=t.children&&a("A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional."),null!=t.style&&"object"!=typeof t.style)throw new Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.")}}function un(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var cn={accept:"accept",acceptcharset:"acceptCharset","accept-charset":"acceptCharset",accesskey:"accessKey",action:"action",allowfullscreen:"allowFullScreen",alt:"alt",as:"as",async:"async",autocapitalize:"autoCapitalize",autocomplete:"autoComplete",autocorrect:"autoCorrect",autofocus:"autoFocus",autoplay:"autoPlay",autosave:"autoSave",capture:"capture",cellpadding:"cellPadding",cellspacing:"cellSpacing",challenge:"challenge",charset:"charSet",checked:"checked",children:"children",cite:"cite",class:"className",classid:"classID",classname:"className",cols:"cols",colspan:"colSpan",content:"content",contenteditable:"contentEditable",contextmenu:"contextMenu",controls:"controls",controlslist:"controlsList",coords:"coords",crossorigin:"crossOrigin",dangerouslysetinnerhtml:"dangerouslySetInnerHTML",data:"data",datetime:"dateTime",default:"default",defaultchecked:"defaultChecked",defaultvalue:"defaultValue",defer:"defer",dir:"dir",disabled:"disabled",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback",download:"download",draggable:"draggable",enctype:"encType",enterkeyhint:"enterKeyHint",for:"htmlFor",form:"form",formmethod:"formMethod",formaction:"formAction",formenctype:"formEncType",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",headers:"headers",height:"height",hidden:"hidden",high:"high",href:"href",hreflang:"hrefLang",htmlfor:"htmlFor",httpequiv:"httpEquiv","http-equiv":"httpEquiv",icon:"icon",id:"id",imagesizes:"imageSizes",imagesrcset:"imageSrcSet",innerhtml:"innerHTML",inputmode:"inputMode",integrity:"integrity",is:"is",itemid:"itemID",itemprop:"itemProp",itemref:"itemRef",itemscope:"itemScope",itemtype:"itemType",keyparams:"keyParams",keytype:"keyType",kind:"kind",label:"label",lang:"lang",list:"list",loop:"loop",low:"low",manifest:"manifest",marginwidth:"marginWidth",marginheight:"marginHeight",max:"max",maxlength:"maxLength",media:"media",mediagroup:"mediaGroup",method:"method",min:"min",minlength:"minLength",multiple:"multiple",muted:"muted",name:"name",nomodule:"noModule",nonce:"nonce",novalidate:"noValidate",open:"open",optimum:"optimum",pattern:"pattern",placeholder:"placeholder",playsinline:"playsInline",poster:"poster",preload:"preload",profile:"profile",radiogroup:"radioGroup",readonly:"readOnly",referrerpolicy:"referrerPolicy",rel:"rel",required:"required",reversed:"reversed",role:"role",rows:"rows",rowspan:"rowSpan",sandbox:"sandbox",scope:"scope",scoped:"scoped",scrolling:"scrolling",seamless:"seamless",selected:"selected",shape:"shape",size:"size",sizes:"sizes",span:"span",spellcheck:"spellCheck",src:"src",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",start:"start",step:"step",style:"style",summary:"summary",tabindex:"tabIndex",target:"target",title:"title",type:"type",usemap:"useMap",value:"value",width:"width",wmode:"wmode",wrap:"wrap",about:"about",accentheight:"accentHeight","accent-height":"accentHeight",accumulate:"accumulate",additive:"additive",alignmentbaseline:"alignmentBaseline","alignment-baseline":"alignmentBaseline",allowreorder:"allowReorder",alphabetic:"alphabetic",amplitude:"amplitude",arabicform:"arabicForm","arabic-form":"arabicForm",ascent:"ascent",attributename:"attributeName",attributetype:"attributeType",autoreverse:"autoReverse",azimuth:"azimuth",basefrequency:"baseFrequency",baselineshift:"baselineShift","baseline-shift":"baselineShift",baseprofile:"baseProfile",bbox:"bbox",begin:"begin",bias:"bias",by:"by",calcmode:"calcMode",capheight:"capHeight","cap-height":"capHeight",clip:"clip",clippath:"clipPath","clip-path":"clipPath",clippathunits:"clipPathUnits",cliprule:"clipRule","clip-rule":"clipRule",color:"color",colorinterpolation:"colorInterpolation","color-interpolation":"colorInterpolation",colorinterpolationfilters:"colorInterpolationFilters","color-interpolation-filters":"colorInterpolationFilters",colorprofile:"colorProfile","color-profile":"colorProfile",colorrendering:"colorRendering","color-rendering":"colorRendering",contentscripttype:"contentScriptType",contentstyletype:"contentStyleType",cursor:"cursor",cx:"cx",cy:"cy",d:"d",datatype:"datatype",decelerate:"decelerate",descent:"descent",diffuseconstant:"diffuseConstant",direction:"direction",display:"display",divisor:"divisor",dominantbaseline:"dominantBaseline","dominant-baseline":"dominantBaseline",dur:"dur",dx:"dx",dy:"dy",edgemode:"edgeMode",elevation:"elevation",enablebackground:"enableBackground","enable-background":"enableBackground",end:"end",exponent:"exponent",externalresourcesrequired:"externalResourcesRequired",fill:"fill",fillopacity:"fillOpacity","fill-opacity":"fillOpacity",fillrule:"fillRule","fill-rule":"fillRule",filter:"filter",filterres:"filterRes",filterunits:"filterUnits",floodopacity:"floodOpacity","flood-opacity":"floodOpacity",floodcolor:"floodColor","flood-color":"floodColor",focusable:"focusable",fontfamily:"fontFamily","font-family":"fontFamily",fontsize:"fontSize","font-size":"fontSize",fontsizeadjust:"fontSizeAdjust","font-size-adjust":"fontSizeAdjust",fontstretch:"fontStretch","font-stretch":"fontStretch",fontstyle:"fontStyle","font-style":"fontStyle",fontvariant:"fontVariant","font-variant":"fontVariant",fontweight:"fontWeight","font-weight":"fontWeight",format:"format",from:"from",fx:"fx",fy:"fy",g1:"g1",g2:"g2",glyphname:"glyphName","glyph-name":"glyphName",glyphorientationhorizontal:"glyphOrientationHorizontal","glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphorientationvertical:"glyphOrientationVertical","glyph-orientation-vertical":"glyphOrientationVertical",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",hanging:"hanging",horizadvx:"horizAdvX","horiz-adv-x":"horizAdvX",horizoriginx:"horizOriginX","horiz-origin-x":"horizOriginX",ideographic:"ideographic",imagerendering:"imageRendering","image-rendering":"imageRendering",in2:"in2",in:"in",inlist:"inlist",intercept:"intercept",k1:"k1",k2:"k2",k3:"k3",k4:"k4",k:"k",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",kerning:"kerning",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",letterspacing:"letterSpacing","letter-spacing":"letterSpacing",lightingcolor:"lightingColor","lighting-color":"lightingColor",limitingconeangle:"limitingConeAngle",local:"local",markerend:"markerEnd","marker-end":"markerEnd",markerheight:"markerHeight",markermid:"markerMid","marker-mid":"markerMid",markerstart:"markerStart","marker-start":"markerStart",markerunits:"markerUnits",markerwidth:"markerWidth",mask:"mask",maskcontentunits:"maskContentUnits",maskunits:"maskUnits",mathematical:"mathematical",mode:"mode",numoctaves:"numOctaves",offset:"offset",opacity:"opacity",operator:"operator",order:"order",orient:"orient",orientation:"orientation",origin:"origin",overflow:"overflow",overlineposition:"overlinePosition","overline-position":"overlinePosition",overlinethickness:"overlineThickness","overline-thickness":"overlineThickness",paintorder:"paintOrder","paint-order":"paintOrder",panose1:"panose1","panose-1":"panose1",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointerevents:"pointerEvents","pointer-events":"pointerEvents",points:"points",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",prefix:"prefix",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",property:"property",r:"r",radius:"radius",refx:"refX",refy:"refY",renderingintent:"renderingIntent","rendering-intent":"renderingIntent",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",resource:"resource",restart:"restart",result:"result",results:"results",rotate:"rotate",rx:"rx",ry:"ry",scale:"scale",security:"security",seed:"seed",shaperendering:"shapeRendering","shape-rendering":"shapeRendering",slope:"slope",spacing:"spacing",specularconstant:"specularConstant",specularexponent:"specularExponent",speed:"speed",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stemh:"stemh",stemv:"stemv",stitchtiles:"stitchTiles",stopcolor:"stopColor","stop-color":"stopColor",stopopacity:"stopOpacity","stop-opacity":"stopOpacity",strikethroughposition:"strikethroughPosition","strikethrough-position":"strikethroughPosition",strikethroughthickness:"strikethroughThickness","strikethrough-thickness":"strikethroughThickness",string:"string",stroke:"stroke",strokedasharray:"strokeDasharray","stroke-dasharray":"strokeDasharray",strokedashoffset:"strokeDashoffset","stroke-dashoffset":"strokeDashoffset",strokelinecap:"strokeLinecap","stroke-linecap":"strokeLinecap",strokelinejoin:"strokeLinejoin","stroke-linejoin":"strokeLinejoin",strokemiterlimit:"strokeMiterlimit","stroke-miterlimit":"strokeMiterlimit",strokewidth:"strokeWidth","stroke-width":"strokeWidth",strokeopacity:"strokeOpacity","stroke-opacity":"strokeOpacity",suppresscontenteditablewarning:"suppressContentEditableWarning",suppresshydrationwarning:"suppressHydrationWarning",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textanchor:"textAnchor","text-anchor":"textAnchor",textdecoration:"textDecoration","text-decoration":"textDecoration",textlength:"textLength",textrendering:"textRendering","text-rendering":"textRendering",to:"to",transform:"transform",typeof:"typeof",u1:"u1",u2:"u2",underlineposition:"underlinePosition","underline-position":"underlinePosition",underlinethickness:"underlineThickness","underline-thickness":"underlineThickness",unicode:"unicode",unicodebidi:"unicodeBidi","unicode-bidi":"unicodeBidi",unicoderange:"unicodeRange","unicode-range":"unicodeRange",unitsperem:"unitsPerEm","units-per-em":"unitsPerEm",unselectable:"unselectable",valphabetic:"vAlphabetic","v-alphabetic":"vAlphabetic",values:"values",vectoreffect:"vectorEffect","vector-effect":"vectorEffect",version:"version",vertadvy:"vertAdvY","vert-adv-y":"vertAdvY",vertoriginx:"vertOriginX","vert-origin-x":"vertOriginX",vertoriginy:"vertOriginY","vert-origin-y":"vertOriginY",vhanging:"vHanging","v-hanging":"vHanging",videographic:"vIdeographic","v-ideographic":"vIdeographic",viewbox:"viewBox",viewtarget:"viewTarget",visibility:"visibility",vmathematical:"vMathematical","v-mathematical":"vMathematical",vocab:"vocab",widths:"widths",wordspacing:"wordSpacing","word-spacing":"wordSpacing",writingmode:"writingMode","writing-mode":"writingMode",x1:"x1",x2:"x2",x:"x",xchannelselector:"xChannelSelector",xheight:"xHeight","x-height":"xHeight",xlinkactuate:"xlinkActuate","xlink:actuate":"xlinkActuate",xlinkarcrole:"xlinkArcrole","xlink:arcrole":"xlinkArcrole",xlinkhref:"xlinkHref","xlink:href":"xlinkHref",xlinkrole:"xlinkRole","xlink:role":"xlinkRole",xlinkshow:"xlinkShow","xlink:show":"xlinkShow",xlinktitle:"xlinkTitle","xlink:title":"xlinkTitle",xlinktype:"xlinkType","xlink:type":"xlinkType",xmlbase:"xmlBase","xml:base":"xmlBase",xmllang:"xmlLang","xml:lang":"xmlLang",xmlns:"xmlns","xml:space":"xmlSpace",xmlnsxlink:"xmlnsXlink","xmlns:xlink":"xmlnsXlink",xmlspace:"xmlSpace",y1:"y1",y2:"y2",y:"y",ychannelselector:"yChannelSelector",z:"z",zoomandpan:"zoomAndPan"},dn={"aria-current":0,"aria-description":0,"aria-details":0,"aria-disabled":0,"aria-hidden":0,"aria-invalid":0,"aria-keyshortcuts":0,"aria-label":0,"aria-roledescription":0,"aria-autocomplete":0,"aria-checked":0,"aria-expanded":0,"aria-haspopup":0,"aria-level":0,"aria-modal":0,"aria-multiline":0,"aria-multiselectable":0,"aria-orientation":0,"aria-placeholder":0,"aria-pressed":0,"aria-readonly":0,"aria-required":0,"aria-selected":0,"aria-sort":0,"aria-valuemax":0,"aria-valuemin":0,"aria-valuenow":0,"aria-valuetext":0,"aria-atomic":0,"aria-busy":0,"aria-live":0,"aria-relevant":0,"aria-dropeffect":0,"aria-grabbed":0,"aria-activedescendant":0,"aria-colcount":0,"aria-colindex":0,"aria-colspan":0,"aria-controls":0,"aria-describedby":0,"aria-errormessage":0,"aria-flowto":0,"aria-labelledby":0,"aria-owns":0,"aria-posinset":0,"aria-rowcount":0,"aria-rowindex":0,"aria-rowspan":0,"aria-setsize":0},fn={},pn=new RegExp("^(aria)-["+D+"]*$"),hn=new RegExp("^(aria)[A-Z]["+D+"]*$");function mn(e,t){if(P.call(fn,t)&&fn[t])return!0;if(hn.test(t)){var n="aria-"+t.slice(4).toLowerCase(),r=dn.hasOwnProperty(n)?n:null;if(null==r)return a("Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.",t),fn[t]=!0,!0;if(t!==r)return a("Invalid ARIA attribute `%s`. Did you mean `%s`?",t,r),fn[t]=!0,!0}if(pn.test(t)){var o=t.toLowerCase(),i=dn.hasOwnProperty(o)?o:null;if(null==i)return fn[t]=!0,!1;if(t!==i)return a("Unknown ARIA attribute `%s`. Did you mean `%s`?",t,i),fn[t]=!0,!0}return!0}function gn(e,t){un(e,t)||function(e,t){var n=[];for(var r in t)mn(0,r)||n.push(r);var o=n.map(function(e){return"`"+e+"`"}).join(", ");1===n.length?a("Invalid aria prop %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props",o,e):n.length>1&&a("Invalid aria props %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props",o,e)}(e,t)}var bn=!1;var yn,_n={},vn=/^on./,wn=/^on[^A-Z]/,Sn=new RegExp("^(aria)-["+D+"]*$"),xn=new RegExp("^(aria)[A-Z]["+D+"]*$");yn=function(e,t,n,r){if(P.call(_n,t)&&_n[t])return!0;var o=t.toLowerCase();if("onfocusin"===o||"onfocusout"===o)return a("React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React."),_n[t]=!0,!0;if(null!=r){var i=r.registrationNameDependencies,s=r.possibleRegistrationNames;if(i.hasOwnProperty(t))return!0;var l=s.hasOwnProperty(o)?s[o]:null;if(null!=l)return a("Invalid event handler property `%s`. Did you mean `%s`?",t,l),_n[t]=!0,!0;if(vn.test(t))return a("Unknown event handler property `%s`. It will be ignored.",t),_n[t]=!0,!0}else if(vn.test(t))return wn.test(t)&&a("Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.",t),_n[t]=!0,!0;if(Sn.test(t)||xn.test(t))return!0;if("innerhtml"===o)return a("Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`."),_n[t]=!0,!0;if("aria"===o)return a("The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead."),_n[t]=!0,!0;if("is"===o&&null!=n&&"string"!=typeof n)return a("Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.",typeof n),_n[t]=!0,!0;if("number"==typeof n&&isNaN(n))return a("Received NaN for the `%s` attribute. If this is expected, cast the value to a string.",t),_n[t]=!0,!0;var u=z(t),c=null!==u&&0===u.type;if(cn.hasOwnProperty(o)){var d=cn[o];if(d!==t)return a("Invalid DOM property `%s`. Did you mean `%s`?",t,d),_n[t]=!0,!0}else if(!c&&t!==o)return a("React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.",t,o),_n[t]=!0,!0;return"boolean"==typeof n&&B(t,n,u,!1)?(n?a('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.',n,t,t,n,t):a('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.',n,t,t,n,t,t,t),_n[t]=!0,!0):!!c||(B(t,n,u,!1)?(_n[t]=!0,!1):("false"!==n&&"true"!==n||null===u||3!==u.type||(a("Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?",n,t,"false"===n?"The browser will interpret it as a truthy value.":'Although this works, it will not work as expected if you pass the string "false".',t,n),_n[t]=!0),!0))};function Tn(e,t,n){un(e,t)||function(e,t,n){var r=[];for(var o in t)yn(0,o,t[o],n)||r.push(o);var i=r.map(function(e){return"`"+e+"`"}).join(", ");1===r.length?a("Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://reactjs.org/link/attribute-behavior ",i,e):r.length>1&&a("Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://reactjs.org/link/attribute-behavior ",i,e)}(e,t,n)}var En=null;function kn(e){null!==En&&a("Expected currently replaying event to be null. This error is likely caused by a bug in React. Please file an issue."),En=e}function Pn(){null===En&&a("Expected currently replaying event to not be null. This error is likely caused by a bug in React. Please file an issue."),En=null}function On(e){var t=e.target||e.srcElement||window;return t.correspondingUseElement&&(t=t.correspondingUseElement),3===t.nodeType?t.parentNode:t}var An=null,Rn=null,$n=null;function In(e){var t=Xu(e);if(t){if("function"!=typeof An)throw new Error("setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.");var n=t.stateNode;if(n){var r=Qu(n);An(t.stateNode,t.type,r)}}}function Cn(e){Rn?$n?$n.push(e):$n=[e]:Rn=e}function Dn(){if(Rn){var e=Rn,t=$n;if(Rn=null,$n=null,In(e),t)for(var n=0;n<t.length;n++)In(t[n])}}var Nn=function(e,t){return e(t)},Mn=function(){},Ln=!1;function jn(){(null!==Rn||null!==$n)&&(Mn(),Dn())}function Fn(e,t,n){if(Ln)return e(t,n);Ln=!0;try{return Nn(e,t,n)}finally{Ln=!1,jn()}}function Bn(e,t){var n=e.stateNode;if(null===n)return null;var r=Qu(n);if(null===r)return null;var o=r[t];if(function(e,t,n){switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":return!(!n.disabled||(r=t,"button"!==r&&"input"!==r&&"select"!==r&&"textarea"!==r));default:return!1}var r}(t,e.type,r))return null;if(o&&"function"!=typeof o)throw new Error("Expected `"+t+"` listener to be a function, instead got a value of `"+typeof o+"` type.");return o}var Un=!1;if(k)try{var zn={};Object.defineProperty(zn,"passive",{get:function(){Un=!0}}),window.addEventListener("test",zn,zn),window.removeEventListener("test",zn,zn)}catch(rw){Un=!1}function Vn(e,t,n,r,o,a,i,s,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var Hn=Vn;if("undefined"!=typeof window&&"function"==typeof window.dispatchEvent&&"undefined"!=typeof document&&"function"==typeof document.createEvent){var qn=document.createElement("react");Hn=function(e,t,n,r,o,a,i,s,l){if("undefined"==typeof document||null===document)throw new Error("The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.");var u=document.createEvent("Event"),c=!1,d=!0,f=window.event,p=Object.getOwnPropertyDescriptor(window,"event");function h(){qn.removeEventListener(w,b,!1),void 0!==window.event&&window.hasOwnProperty("event")&&(window.event=f)}var m,g=Array.prototype.slice.call(arguments,3);function b(){c=!0,h(),t.apply(n,g),d=!1}var y=!1,_=!1;function v(e){if(m=e.error,y=!0,null===m&&0===e.colno&&0===e.lineno&&(_=!0),e.defaultPrevented&&null!=m&&"object"==typeof m)try{m._suppressLogging=!0}catch(t){}}var w="react-"+(e||"invokeguardedcallback");if(window.addEventListener("error",v),qn.addEventListener(w,b,!1),u.initEvent(w,!1,!1),qn.dispatchEvent(u),p&&Object.defineProperty(window,"event",p),c&&d&&(y?_&&(m=new Error("A cross-origin error was thrown. React doesn't have access to the actual error object in development. See https://reactjs.org/link/crossorigin-error for more information.")):m=new Error("An error was thrown inside one of your components, but React doesn't know what it was. This is likely due to browser flakiness. React does its best to preserve the \"Pause on exceptions\" behavior of the DevTools, which requires some DEV-mode only tricks. It's possible that these don't work in your browser. Try triggering the error in production mode, or switching to a modern browser. If you suspect that this is actually an issue with React, please file an issue."),this.onError(m)),window.removeEventListener("error",v),!c)return h(),Vn.apply(this,arguments)}}var Gn=Hn,Wn=!1,Yn=null,Xn=!1,Kn=null,Qn={onError:function(e){Wn=!0,Yn=e}};function Zn(e,t,n,r,o,a,i,s,l){Wn=!1,Yn=null,Gn.apply(Qn,arguments)}function Jn(){if(Wn){var e=Yn;return Wn=!1,Yn=null,e}throw new Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.")}function er(e){return e._reactInternals}var tr=16,nr=128,rr=256,or=512,ar=1024,ir=2048,sr=4096,lr=8192,ur=16384,cr=32768,dr=65536,fr=131072,pr=1048576,hr=2097152,mr=4194304,gr=16777216,br=33554432,yr=1028,_r=12854,vr=8772,wr=2064,Sr=14680064,xr=n.ReactCurrentOwner;function Tr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{var r=t;do{4098&(t=r).flags&&(n=t.return),r=t.return}while(r)}return 3===t.tag?n:null}function Er(e){if(e.tag===c){var t=e.memoizedState;if(null===t){var n=e.alternate;null!==n&&(t=n.memoizedState)}if(null!==t)return t.dehydrated}return null}function kr(e){return 3===e.tag?e.stateNode.containerInfo:null}function Pr(e){if(Tr(e)!==e)throw new Error("Unable to find node on an unmounted component.")}function Or(e){var t=e.alternate;if(!t){var n=Tr(e);if(null===n)throw new Error("Unable to find node on an unmounted component.");return n!==e?null:e}for(var r=e,o=t;;){var a=r.return;if(null===a)break;var i=a.alternate;if(null===i){var s=a.return;if(null!==s){r=o=s;continue}break}if(a.child===i.child){for(var l=a.child;l;){if(l===r)return Pr(a),e;if(l===o)return Pr(a),t;l=l.sibling}throw new Error("Unable to find node on an unmounted component.")}if(r.return!==o.return)r=a,o=i;else{for(var u=!1,c=a.child;c;){if(c===r){u=!0,r=a,o=i;break}if(c===o){u=!0,o=a,r=i;break}c=c.sibling}if(!u){for(c=i.child;c;){if(c===r){u=!0,r=i,o=a;break}if(c===o){u=!0,o=i,r=a;break}c=c.sibling}if(!u)throw new Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(r.alternate!==o)throw new Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(3!==r.tag)throw new Error("Unable to find node on an unmounted component.");return r.stateNode.current===r?e:t}function Ar(e){var t=Or(e);return null!==t?Rr(t):null}function Rr(e){if(5===e.tag||6===e.tag)return e;for(var t=e.child;null!==t;){var n=Rr(t);if(null!==n)return n;t=t.sibling}return null}function $r(e){var t=Or(e);return null!==t?Ir(t):null}function Ir(e){if(5===e.tag||6===e.tag)return e;for(var t=e.child;null!==t;){if(4!==t.tag){var n=Ir(t);if(null!==n)return n}t=t.sibling}return null}var Cr=t.unstable_scheduleCallback,Dr=t.unstable_cancelCallback,Nr=t.unstable_shouldYield,Mr=t.unstable_requestPaint,Lr=t.unstable_now,jr=t.unstable_getCurrentPriorityLevel,Fr=t.unstable_ImmediatePriority,Br=t.unstable_UserBlockingPriority,Ur=t.unstable_NormalPriority,zr=t.unstable_LowPriority,Vr=t.unstable_IdlePriority,Hr=t.unstable_yieldValue,qr=t.unstable_setDisableYieldValue,Gr=null,Wr=null,Yr=null,Xr=!1,Kr="undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__;function Qr(e){if("function"==typeof Hr&&(qr(e),r=e),Wr&&"function"==typeof Wr.setStrictMode)try{Wr.setStrictMode(Gr,e)}catch(t){Xr||(Xr=!0,a("React instrumentation encountered an error: %s",t))}}function Zr(e){Yr=e}function Jr(){for(var e=new Map,t=1,n=0;n<wo;n++){var r=Jo(t);e.set(t,r),t*=2}return e}function eo(){null!==Yr&&"function"==typeof Yr.markCommitStopped&&Yr.markCommitStopped()}function to(e){null!==Yr&&"function"==typeof Yr.markComponentRenderStarted&&Yr.markComponentRenderStarted(e)}function no(){null!==Yr&&"function"==typeof Yr.markComponentRenderStopped&&Yr.markComponentRenderStopped()}function ro(e){null!==Yr&&"function"==typeof Yr.markComponentPassiveEffectMountStarted&&Yr.markComponentPassiveEffectMountStarted(e)}function oo(){null!==Yr&&"function"==typeof Yr.markComponentPassiveEffectMountStopped&&Yr.markComponentPassiveEffectMountStopped()}function ao(e){null!==Yr&&"function"==typeof Yr.markComponentPassiveEffectUnmountStarted&&Yr.markComponentPassiveEffectUnmountStarted(e)}function io(){null!==Yr&&"function"==typeof Yr.markComponentPassiveEffectUnmountStopped&&Yr.markComponentPassiveEffectUnmountStopped()}function so(e){null!==Yr&&"function"==typeof Yr.markComponentLayoutEffectMountStarted&&Yr.markComponentLayoutEffectMountStarted(e)}function lo(){null!==Yr&&"function"==typeof Yr.markComponentLayoutEffectMountStopped&&Yr.markComponentLayoutEffectMountStopped()}function uo(e){null!==Yr&&"function"==typeof Yr.markComponentLayoutEffectUnmountStarted&&Yr.markComponentLayoutEffectUnmountStarted(e)}function co(){null!==Yr&&"function"==typeof Yr.markComponentLayoutEffectUnmountStopped&&Yr.markComponentLayoutEffectUnmountStopped()}function fo(e,t,n){null!==Yr&&"function"==typeof Yr.markComponentErrored&&Yr.markComponentErrored(e,t,n)}function po(e,t,n){null!==Yr&&"function"==typeof Yr.markComponentSuspended&&Yr.markComponentSuspended(e,t,n)}function ho(e){null!==Yr&&"function"==typeof Yr.markRenderStarted&&Yr.markRenderStarted(e)}function mo(){null!==Yr&&"function"==typeof Yr.markRenderStopped&&Yr.markRenderStopped()}function go(e,t){null!==Yr&&"function"==typeof Yr.markStateUpdateScheduled&&Yr.markStateUpdateScheduled(e,t)}var bo=16,yo=Math.clz32?Math.clz32:function(e){var t=e>>>0;if(0===t)return 32;return 31-(_o(t)/vo|0)|0},_o=Math.log,vo=Math.LN2;var wo=31,So=1,xo=2,To=4,Eo=8,ko=16,Po=32,Oo=4194240,Ao=1024,Ro=2048,$o=4096,Io=8192,Co=16384,Do=32768,No=65536,Mo=131072,Lo=262144,jo=524288,Fo=1048576,Bo=2097152,Uo=130023424,zo=4194304,Vo=8388608,Ho=16777216,qo=33554432,Go=67108864,Wo=zo,Yo=134217728,Xo=268435455,Ko=268435456,Qo=536870912,Zo=1073741824;function Jo(e){return e&So?"Sync":e&xo?"InputContinuousHydration":e&To?"InputContinuous":e&Eo?"DefaultHydration":e&ko?"Default":e&Po?"TransitionHydration":e&Oo?"Transition":e&Uo?"Retry":e&Yo?"SelectiveHydration":e&Ko?"IdleHydration":e&Qo?"Idle":e&Zo?"Offscreen":void 0}var ea=-1,ta=64,na=zo;function ra(e){switch(fa(e)){case So:return So;case xo:return xo;case To:return To;case Eo:return Eo;case ko:return ko;case Po:return Po;case 64:case 128:case 256:case 512:case Ao:case Ro:case $o:case Io:case Co:case Do:case No:case Mo:case Lo:case jo:case Fo:case Bo:return e&Oo;case zo:case Vo:case Ho:case qo:case Go:return e&Uo;case Yo:return Yo;case Ko:return Ko;case Qo:return Qo;case Zo:return Zo;default:return a("Should have found matching lanes. This is a bug in React."),e}}function oa(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,o=e.suspendedLanes,a=e.pingedLanes,i=n&Xo;if(0!==i){var s=i&~o;if(0!==s)r=ra(s);else{var l=i&a;0!==l&&(r=ra(l))}}else{var u=n&~o;0!==u?r=ra(u):0!==a&&(r=ra(a))}if(0===r)return 0;if(0!==t&&t!==r&&0===(t&o)){var c=fa(r),d=fa(t);if(c>=d||c===ko&&0!==(d&Oo))return t}0!==(r&To)&&(r|=n&ko);var f=e.entangledLanes;if(0!==f)for(var p=e.entanglements,h=r&f;h>0;){var m=ha(h),g=1<<m;r|=p[m],h&=~g}return r}function aa(e,t){switch(e){case So:case xo:case To:return t+250;case Eo:case ko:case Po:case 64:case 128:case 256:case 512:case Ao:case Ro:case $o:case Io:case Co:case Do:case No:case Mo:case Lo:case jo:case Fo:case Bo:return t+5e3;case zo:case Vo:case Ho:case qo:case Go:case Yo:case Ko:case Qo:case Zo:return ea;default:return a("Should have found matching lanes. This is a bug in React."),ea}}function ia(e){var t=e.pendingLanes&~Zo;return 0!==t?t:t&Zo?Zo:0}function sa(e){return 0!==(e&Xo)}function la(e){return(e&Uo)===e}function ua(e,t){return 0!==(t&(xo|To|Eo|ko))}function ca(e){return 0!==(e&Oo)}function da(){var e=ta;return 0===((ta<<=1)&Oo)&&(ta=64),e}function fa(e){return e&-e}function pa(e){return fa(e)}function ha(e){return 31-yo(e)}function ma(e){return ha(e)}function ga(e,t){return 0!==(e&t)}function ba(e,t){return(e&t)===t}function ya(e,t){return e|t}function _a(e,t){return e&~t}function va(e,t){return e&t}function wa(e){for(var t=[],n=0;n<wo;n++)t.push(e);return t}function Sa(e,t,n){e.pendingLanes|=t,t!==Qo&&(e.suspendedLanes=0,e.pingedLanes=0),e.eventTimes[ma(t)]=n}function xa(e,t,n){e.pingedLanes|=e.suspendedLanes&t}function Ta(e,t){for(var n=e.entangledLanes|=t,r=e.entanglements,o=n;o;){var a=ha(o),i=1<<a;i&t|r[a]&t&&(r[a]|=t),o&=~i}}function Ea(e,t,n){if(Kr)for(var r=e.pendingUpdatersLaneMap;n>0;){var o=ma(n),a=1<<o;r[o].add(t),n&=~a}}function ka(e,t){if(Kr)for(var n=e.pendingUpdatersLaneMap,r=e.memoizedUpdaters;t>0;){var o=ma(t),a=1<<o,i=n[o];i.size>0&&(i.forEach(function(e){var t=e.alternate;null!==t&&r.has(t)||r.add(e)}),i.clear()),t&=~a}}var Pa,Oa,Aa,Ra,$a,Ia=So,Ca=To,Da=ko,Na=Qo,Ma=0;function La(){return Ma}function ja(e){Ma=e}function Fa(e,t){return 0!==e&&e<t}function Ba(e){var t=fa(e);return Fa(Ia,t)?Fa(Ca,t)?sa(t)?Da:Na:Ca:Ia}function Ua(e){return e.current.memoizedState.isDehydrated}function za(e){Pa(e)}var Va=!1,Ha=[],qa=null,Ga=null,Wa=null,Ya=new Map,Xa=new Map,Ka=[],Qa=["mousedown","mouseup","touchcancel","touchend","touchstart","auxclick","dblclick","pointercancel","pointerdown","pointerup","dragend","dragstart","drop","compositionend","compositionstart","keydown","keypress","keyup","input","textInput","copy","cut","paste","click","change","contextmenu","reset","submit"];function Za(e,t){switch(e){case"focusin":case"focusout":qa=null;break;case"dragenter":case"dragleave":Ga=null;break;case"mouseover":case"mouseout":Wa=null;break;case"pointerover":case"pointerout":var n=t.pointerId;Ya.delete(n);break;case"gotpointercapture":case"lostpointercapture":var r=t.pointerId;Xa.delete(r)}}function Ja(e,t,n,r,o,a){if(null===e||e.nativeEvent!==a){var i=function(e,t,n,r,o){return{blockedOn:e,domEventName:t,eventSystemFlags:n,nativeEvent:o,targetContainers:[r]}}(t,n,r,o,a);if(null!==t){var s=Xu(t);null!==s&&Oa(s)}return i}e.eventSystemFlags|=r;var l=e.targetContainers;return null!==o&&-1===l.indexOf(o)&&l.push(o),e}function ei(e){var t=Yu(e.target);if(null!==t){var n=Tr(t);if(null!==n){var r=n.tag;if(r===c){var o=Er(n);if(null!==o)return e.blockedOn=o,void $a(e.priority,function(){Aa(n)})}else if(3===r){if(Ua(n.stateNode))return void(e.blockedOn=kr(n))}}}e.blockedOn=null}function ti(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;t.length>0;){var n=t[0],r=pi(e.domEventName,e.eventSystemFlags,n,e.nativeEvent);if(null!==r){var o=Xu(r);return null!==o&&Oa(o),e.blockedOn=r,!1}var a=e.nativeEvent,i=new a.constructor(a.type,a);kn(i),a.target.dispatchEvent(i),Pn(),t.shift()}return!0}function ni(e,t,n){ti(e)&&n.delete(t)}function ri(){Va=!1,null!==qa&&ti(qa)&&(qa=null),null!==Ga&&ti(Ga)&&(Ga=null),null!==Wa&&ti(Wa)&&(Wa=null),Ya.forEach(ni),Xa.forEach(ni)}function oi(e,n){e.blockedOn===n&&(e.blockedOn=null,Va||(Va=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,ri)))}function ai(e){if(Ha.length>0){oi(Ha[0],e);for(var t=1;t<Ha.length;t++){var n=Ha[t];n.blockedOn===e&&(n.blockedOn=null)}}null!==qa&&oi(qa,e),null!==Ga&&oi(Ga,e),null!==Wa&&oi(Wa,e);var r=function(t){return oi(t,e)};Ya.forEach(r),Xa.forEach(r);for(var o=0;o<Ka.length;o++){var a=Ka[o];a.blockedOn===e&&(a.blockedOn=null)}for(;Ka.length>0;){var i=Ka[0];if(null!==i.blockedOn)break;ei(i),null===i.blockedOn&&Ka.shift()}}var ii=n.ReactCurrentBatchConfig,si=!0;function li(e){si=!!e}function ui(e,t,n,r){var o=La(),a=ii.transition;ii.transition=null;try{ja(Ia),di(e,t,n,r)}finally{ja(o),ii.transition=a}}function ci(e,t,n,r){var o=La(),a=ii.transition;ii.transition=null;try{ja(Ca),di(e,t,n,r)}finally{ja(o),ii.transition=a}}function di(e,t,n,r){si&&function(e,t,n,r){var o=pi(e,t,n,r);if(null===o)return _l(e,t,r,fi,n),void Za(e,r);if(function(e,t,n,r,o){switch(t){case"focusin":return qa=Ja(qa,e,t,n,r,o),!0;case"dragenter":return Ga=Ja(Ga,e,t,n,r,o),!0;case"mouseover":return Wa=Ja(Wa,e,t,n,r,o),!0;case"pointerover":var a=o,i=a.pointerId;return Ya.set(i,Ja(Ya.get(i)||null,e,t,n,r,a)),!0;case"gotpointercapture":var s=o,l=s.pointerId;return Xa.set(l,Ja(Xa.get(l)||null,e,t,n,r,s)),!0}return!1}(o,e,t,n,r))return void r.stopPropagation();if(Za(e,r),4&t&&function(e){return Qa.indexOf(e)>-1}(e)){for(;null!==o;){var a=Xu(o);null!==a&&za(a);var i=pi(e,t,n,r);if(null===i&&_l(e,t,r,fi,n),i===o)break;o=i}return void(null!==o&&r.stopPropagation())}_l(e,t,r,null,n)}(e,t,n,r)}var fi=null;function pi(e,t,n,r){fi=null;var o=Yu(On(r));if(null!==o){var a=Tr(o);if(null===a)o=null;else{var i=a.tag;if(i===c){var s=Er(a);if(null!==s)return s;o=null}else if(3===i){if(Ua(a.stateNode))return kr(a);o=null}else a!==o&&(o=null)}}return fi=o,null}function hi(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return Ia;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return Ca;case"message":switch(jr()){case Fr:return Ia;case Br:return Ca;case Ur:case zr:return Da;case Vr:return Na;default:return Da}default:return Da}}var mi=null,gi=null,bi=null;function yi(){if(bi)return bi;var e,t,n=gi,r=n.length,o=_i(),a=o.length;for(e=0;e<r&&n[e]===o[e];e++);var i=r-e;for(t=1;t<=i&&n[r-t]===o[a-t];t++);var s=t>1?1-t:void 0;return bi=o.slice(e,s)}function _i(){return"value"in mi?mi.value:mi.textContent}function vi(e){var t,n=e.keyCode;return"charCode"in e?0===(t=e.charCode)&&13===n&&(t=13):t=n,10===t&&(t=13),t>=32||13===t?t:0}function wi(){return!0}function Si(){return!1}function xi(e){function t(t,n,r,o,a){for(var i in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=o,this.target=a,this.currentTarget=null,e)if(e.hasOwnProperty(i)){var s=e[i];this[i]=s?s(o):o[i]}var l=null!=o.defaultPrevented?o.defaultPrevented:!1===o.returnValue;return this.isDefaultPrevented=l?wi:Si,this.isPropagationStopped=Si,this}return we(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=wi)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=wi)},persist:function(){},isPersistent:wi}),t}var Ti,Ei,ki,Pi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Oi=xi(Pi),Ai=we({},Pi,{view:0,detail:0}),Ri=xi(Ai);var $i=we({},Ai,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vi,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(function(e){e!==ki&&(ki&&"mousemove"===e.type?(Ti=e.screenX-ki.screenX,Ei=e.screenY-ki.screenY):(Ti=0,Ei=0),ki=e)}(e),Ti)},movementY:function(e){return"movementY"in e?e.movementY:Ei}}),Ii=xi($i),Ci=xi(we({},$i,{dataTransfer:0})),Di=xi(we({},Ai,{relatedTarget:0})),Ni=xi(we({},Pi,{animationName:0,elapsedTime:0,pseudoElement:0})),Mi=xi(we({},Pi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),Li=xi(we({},Pi,{data:0})),ji=Li,Fi={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Bi={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};var Ui={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zi(e){var t=this.nativeEvent;if(t.getModifierState)return t.getModifierState(e);var n=Ui[e];return!!n&&!!t[n]}function Vi(e){return zi}var Hi=xi(we({},Ai,{key:function(e){if(e.key){var t=Fi[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=vi(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?Bi[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vi,charCode:function(e){return"keypress"===e.type?vi(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?vi(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),qi=xi(we({},$i,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Gi=xi(we({},Ai,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vi})),Wi=xi(we({},Pi,{propertyName:0,elapsedTime:0,pseudoElement:0})),Yi=xi(we({},$i,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Xi=[9,13,27,32],Ki=229,Qi=k&&"CompositionEvent"in window,Zi=null;k&&"documentMode"in document&&(Zi=document.documentMode);var Ji=k&&"TextEvent"in window&&!Zi,es=k&&(!Qi||Zi&&Zi>8&&Zi<=11),ts=32,ns=String.fromCharCode(ts);var rs=!1;function os(e,t){switch(e){case"keyup":return-1!==Xi.indexOf(t.keyCode);case"keydown":return t.keyCode!==Ki;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function as(e){var t=e.detail;return"object"==typeof t&&"data"in t?t.data:null}function is(e){return"ko"===e.locale}var ss=!1;function ls(e,t,n,r,o){var a,i;if(Qi?a=function(e){switch(e){case"compositionstart":return"onCompositionStart";case"compositionend":return"onCompositionEnd";case"compositionupdate":return"onCompositionUpdate"}}(t):ss?os(t,r)&&(a="onCompositionEnd"):function(e,t){return"keydown"===e&&t.keyCode===Ki}(t,r)&&(a="onCompositionStart"),!a)return null;es&&!is(r)&&(ss||"onCompositionStart"!==a?"onCompositionEnd"===a&&ss&&(i=yi()):ss=function(e){return mi=e,gi=_i(),!0}(o));var s=wl(n,a);if(s.length>0){var l=new Li(a,t,null,r,o);if(e.push({event:l,listeners:s}),i)l.data=i;else{var u=as(r);null!==u&&(l.data=u)}}}function us(e,t){if(ss){if("compositionend"===e||!Qi&&os(e,t)){var n=yi();return mi=null,gi=null,bi=null,ss=!1,n}return null}switch(e){case"paste":default:return null;case"keypress":if(!function(e){return(e.ctrlKey||e.altKey||e.metaKey)&&!(e.ctrlKey&&e.altKey)}(t)){if(t.char&&t.char.length>1)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return es&&!is(t)?null:t.data}}function cs(e,t,n,r,o){var a;if(!(a=Ji?function(e,t){switch(e){case"compositionend":return as(t);case"keypress":return t.which!==ts?null:(rs=!0,ns);case"textInput":var n=t.data;return n===ns&&rs?null:n;default:return null}}(t,r):us(t,r)))return null;var i=wl(n,"onBeforeInput");if(i.length>0){var s=new ji("onBeforeInput","beforeinput",null,r,o);e.push({event:s,listeners:i}),s.data=a}}var ds={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function fs(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!ds[e.type]:"textarea"===t}
|
|
56
|
+
/**
|
|
57
|
+
* Checks if an event is supported in the current execution environment.
|
|
58
|
+
*
|
|
59
|
+
* NOTE: This will not work correctly for non-generic events such as `change`,
|
|
60
|
+
* `reset`, `load`, `error`, and `select`.
|
|
61
|
+
*
|
|
62
|
+
* Borrows from Modernizr.
|
|
63
|
+
*
|
|
64
|
+
* @param {string} eventNameSuffix Event name, e.g. "click".
|
|
65
|
+
* @return {boolean} True if the event is supported.
|
|
66
|
+
* @internal
|
|
67
|
+
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
68
|
+
*/function ps(e,t,n,r){Cn(r);var o=wl(t,"onChange");if(o.length>0){var a=new Oi("onChange","change",null,n,r);e.push({event:a,listeners:o})}}var hs=null,ms=null;function gs(e){fl(e,0)}function bs(e){if(et(Ku(e)))return e}function ys(e,t){if("change"===e)return t}var _s=!1;function vs(){hs&&(hs.detachEvent("onpropertychange",ws),hs=null,ms=null)}function ws(e){"value"===e.propertyName&&bs(ms)&&function(e){var t=[];ps(t,ms,e,On(e)),Fn(gs,t)}(e)}function Ss(e,t,n){"focusin"===e?(vs(),function(e,t){ms=t,(hs=e).attachEvent("onpropertychange",ws)}(t,n)):"focusout"===e&&vs()}function xs(e,t){if("selectionchange"===e||"keyup"===e||"keydown"===e)return bs(ms)}function Ts(e,t){if("click"===e)return bs(t)}function Es(e,t){if("input"===e||"change"===e)return bs(t)}function ks(e,t,n,r,o,a,i){var s,l,u,c,d,f,p=n?Ku(n):window;if("select"===(c=(u=p).nodeName&&u.nodeName.toLowerCase())||"input"===c&&"file"===u.type?s=ys:fs(p)?_s?s=Es:(s=xs,l=Ss):function(e){var t=e.nodeName;return t&&"input"===t.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)}(p)&&(s=Ts),s){var h=s(t,n);if(h)return void ps(e,h,r,o)}l&&l(t,p,n),"focusout"===t&&(f=(d=p)._wrapperState)&&f.controlled&&"number"===d.type&&pt(d,"number",d.value)}function Ps(e,t,n,r,o,a,i){var s="mouseover"===t||"pointerover"===t,l="mouseout"===t||"pointerout"===t;if(s&&r!==En){var u=r.relatedTarget||r.fromElement;if(u&&(Yu(u)||Wu(u)))return}if(l||s){var c,d,f;if(o.window===o)c=o;else{var p=o.ownerDocument;c=p?p.defaultView||p.parentWindow:window}if(l){var h=r.relatedTarget||r.toElement;if(d=n,null!==(f=h?Yu(h):null))(f!==Tr(f)||5!==f.tag&&6!==f.tag)&&(f=null)}else d=null,f=n;if(d!==f){var m=Ii,g="onMouseLeave",b="onMouseEnter",y="mouse";"pointerout"!==t&&"pointerover"!==t||(m=qi,g="onPointerLeave",b="onPointerEnter",y="pointer");var _=null==d?c:Ku(d),v=null==f?c:Ku(f),w=new m(g,y+"leave",d,r,o);w.target=_,w.relatedTarget=v;var S=null;if(Yu(o)===n){var x=new m(b,y+"enter",f,r,o);x.target=v,x.relatedTarget=_,S=x}!function(e,t,n,r,o){var a=r&&o?function(e,t){for(var n=e,r=t,o=0,a=n;a;a=Sl(a))o++;for(var i=0,s=r;s;s=Sl(s))i++;for(;o-i>0;)n=Sl(n),o--;for(;i-o>0;)r=Sl(r),i--;var l=o;for(;l--;){if(n===r||null!==r&&n===r.alternate)return n;n=Sl(n),r=Sl(r)}return null}(r,o):null;null!==r&&xl(e,t,r,a,!1);null!==o&&null!==n&&xl(e,n,o,a,!0)}(e,w,S,d,f)}}}k&&(_s=function(e){if(!k)return!1;var t="on"+e,n=t in document;if(!n){var r=document.createElement("div");r.setAttribute(t,"return;"),n="function"==typeof r[t]}return n}("input")&&(!document.documentMode||document.documentMode>9));var Os="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function As(e,t){if(Os(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++){var a=n[o];if(!P.call(t,a)||!Os(e[a],t[a]))return!1}return!0}function Rs(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function $s(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function Is(e,t){for(var n=Rs(e),r=0,o=0;n;){if(3===n.nodeType){if(o=r+n.textContent.length,r<=t&&o>=t)return{node:n,offset:t-r};r=o}n=Rs($s(n))}}function Cs(e){var t=e.ownerDocument,n=t&&t.defaultView||window,r=n.getSelection&&n.getSelection();if(!r||0===r.rangeCount)return null;var o=r.anchorNode,a=r.anchorOffset,i=r.focusNode,s=r.focusOffset;try{o.nodeType,i.nodeType}catch(rw){return null}return function(e,t,n,r,o){var a=0,i=-1,s=-1,l=0,u=0,c=e,d=null;e:for(;;){for(var f=null;c!==t||0!==n&&3!==c.nodeType||(i=a+n),c!==r||0!==o&&3!==c.nodeType||(s=a+o),3===c.nodeType&&(a+=c.nodeValue.length),null!==(f=c.firstChild);)d=c,c=f;for(;;){if(c===e)break e;if(d===t&&++l===n&&(i=a),d===r&&++u===o&&(s=a),null!==(f=c.nextSibling))break;d=(c=d).parentNode}c=f}if(-1===i||-1===s)return null;return{start:i,end:s}}(e,o,a,i,s)}function Ds(e){return e&&3===e.nodeType}function Ns(e,t){return!(!e||!t)&&(e===t||!Ds(e)&&(Ds(t)?Ns(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function Ms(e){return e&&e.ownerDocument&&Ns(e.ownerDocument.documentElement,e)}function Ls(e){try{return"string"==typeof e.contentWindow.location.href}catch(t){return!1}}function js(){for(var e=window,t=tt();t instanceof e.HTMLIFrameElement;){if(!Ls(t))return t;t=tt((e=t.contentWindow).document)}return t}function Fs(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function Bs(e){var t=js(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&Ms(n)){null!==r&&Fs(n)&&function(e,t){var n=t.start,r=t.end;void 0===r&&(r=n);"selectionStart"in e?(e.selectionStart=n,e.selectionEnd=Math.min(r,e.value.length)):function(e,t){var n=e.ownerDocument||document,r=n&&n.defaultView||window;if(r.getSelection){var o=r.getSelection(),a=e.textContent.length,i=Math.min(t.start,a),s=void 0===t.end?i:Math.min(t.end,a);if(!o.extend&&i>s){var l=s;s=i,i=l}var u=Is(e,i),c=Is(e,s);if(u&&c){if(1===o.rangeCount&&o.anchorNode===u.node&&o.anchorOffset===u.offset&&o.focusNode===c.node&&o.focusOffset===c.offset)return;var d=n.createRange();d.setStart(u.node,u.offset),o.removeAllRanges(),i>s?(o.addRange(d),o.extend(c.node,c.offset)):(d.setEnd(c.node,c.offset),o.addRange(d))}}}(e,t)}(n,r);for(var o=[],a=n;a=a.parentNode;)1===a.nodeType&&o.push({element:a,left:a.scrollLeft,top:a.scrollTop});"function"==typeof n.focus&&n.focus();for(var i=0;i<o.length;i++){var s=o[i];s.element.scrollLeft=s.left,s.element.scrollTop=s.top}}}function Us(e){return("selectionStart"in e?{start:e.selectionStart,end:e.selectionEnd}:Cs(e))||{start:0,end:0}}var zs=k&&"documentMode"in document&&document.documentMode<=11;var Vs=null,Hs=null,qs=null,Gs=!1;function Ws(e,t,n){var r,o=(r=n).window===r?r.document:9===r.nodeType?r:r.ownerDocument;if(!Gs&&null!=Vs&&Vs===tt(o)){var a=function(e){if("selectionStart"in e&&Fs(e))return{start:e.selectionStart,end:e.selectionEnd};var t=(e.ownerDocument&&e.ownerDocument.defaultView||window).getSelection();return{anchorNode:t.anchorNode,anchorOffset:t.anchorOffset,focusNode:t.focusNode,focusOffset:t.focusOffset}}(Vs);if(!qs||!As(qs,a)){qs=a;var i=wl(Hs,"onSelect");if(i.length>0){var s=new Oi("onSelect","select",null,t,n);e.push({event:s,listeners:i}),s.target=Vs}}}}function Ys(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Xs={animationend:Ys("Animation","AnimationEnd"),animationiteration:Ys("Animation","AnimationIteration"),animationstart:Ys("Animation","AnimationStart"),transitionend:Ys("Transition","TransitionEnd")},Ks={},Qs={};function Zs(e){if(Ks[e])return Ks[e];if(!Xs[e])return e;var t=Xs[e];for(var n in t)if(t.hasOwnProperty(n)&&n in Qs)return Ks[e]=t[n];return e}k&&(Qs=document.createElement("div").style,"AnimationEvent"in window||(delete Xs.animationend.animation,delete Xs.animationiteration.animation,delete Xs.animationstart.animation),"TransitionEvent"in window||delete Xs.transitionend.transition);var Js=Zs("animationend"),el=Zs("animationiteration"),tl=Zs("animationstart"),nl=Zs("transitionend"),rl=new Map,ol=["abort","auxClick","cancel","canPlay","canPlayThrough","click","close","contextMenu","copy","cut","drag","dragEnd","dragEnter","dragExit","dragLeave","dragOver","dragStart","drop","durationChange","emptied","encrypted","ended","error","gotPointerCapture","input","invalid","keyDown","keyPress","keyUp","load","loadedData","loadedMetadata","loadStart","lostPointerCapture","mouseDown","mouseMove","mouseOut","mouseOver","mouseUp","paste","pause","play","playing","pointerCancel","pointerDown","pointerMove","pointerOut","pointerOver","pointerUp","progress","rateChange","reset","resize","seeked","seeking","stalled","submit","suspend","timeUpdate","touchCancel","touchEnd","touchStart","volumeChange","scroll","toggle","touchMove","waiting","wheel"];function al(e,t){rl.set(e,t),T(t,[e])}function il(e,t,n,r,o,a,i){var s=rl.get(t);if(void 0!==s){var l=Oi,u=t;switch(t){case"keypress":if(0===vi(r))return;case"keydown":case"keyup":l=Hi;break;case"focusin":u="focus",l=Di;break;case"focusout":u="blur",l=Di;break;case"beforeblur":case"afterblur":l=Di;break;case"click":if(2===r.button)return;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=Ii;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=Ci;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=Gi;break;case Js:case el:case tl:l=Ni;break;case nl:l=Wi;break;case"scroll":l=Ri;break;case"wheel":l=Yi;break;case"copy":case"cut":case"paste":l=Mi;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=qi}var c=!!(4&a),d=!c&&"scroll"===t,f=function(e,t,n,r,o){var a=null!==t?t+"Capture":null,i=r?a:t,s=[],l=e,u=null;for(;null!==l;){var c=l,d=c.stateNode;if(5===c.tag&&null!==d&&(u=d,null!==i)){var f=Bn(l,i);null!=f&&s.push(vl(l,f,u))}if(o)break;l=l.return}return s}(n,s,r.type,c,d);if(f.length>0){var p=new l(s,u,null,r,o);e.push({event:p,listeners:f})}}}function sl(e,t,n,r,o,a,i){il(e,t,n,r,o,a),!(7&a)&&(Ps(e,t,n,r,o),ks(e,t,n,r,o),function(e,t,n,r,o){var a=n?Ku(n):window;switch(t){case"focusin":(fs(a)||"true"===a.contentEditable)&&(Vs=a,Hs=n,qs=null);break;case"focusout":Vs=null,Hs=null,qs=null;break;case"mousedown":Gs=!0;break;case"contextmenu":case"mouseup":case"dragend":Gs=!1,Ws(e,r,o);break;case"selectionchange":if(zs)break;case"keydown":case"keyup":Ws(e,r,o)}}(e,t,n,r,o),function(e,t,n,r,o){ls(e,t,n,r,o),cs(e,t,n,r,o)}(e,t,n,r,o))}!function(){for(var e=0;e<ol.length;e++){var t=ol[e];al(t.toLowerCase(),"on"+(t[0].toUpperCase()+t.slice(1)))}al(Js,"onAnimationEnd"),al(el,"onAnimationIteration"),al(tl,"onAnimationStart"),al("dblclick","onDoubleClick"),al("focusin","onFocus"),al("focusout","onBlur"),al(nl,"onTransitionEnd")}(),E("onMouseEnter",["mouseout","mouseover"]),E("onMouseLeave",["mouseout","mouseover"]),E("onPointerEnter",["pointerout","pointerover"]),E("onPointerLeave",["pointerout","pointerover"]),T("onChange",["change","click","focusin","focusout","input","keydown","keyup","selectionchange"]),T("onSelect",["focusout","contextmenu","dragend","focusin","keydown","keyup","mousedown","mouseup","selectionchange"]),T("onBeforeInput",["compositionend","keypress","textInput","paste"]),T("onCompositionEnd",["compositionend","focusout","keydown","keypress","keyup","mousedown"]),T("onCompositionStart",["compositionstart","focusout","keydown","keypress","keyup","mousedown"]),T("onCompositionUpdate",["compositionupdate","focusout","keydown","keypress","keyup","mousedown"]);var ll=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","resize","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"],ul=new Set(["cancel","close","invalid","load","scroll","toggle"].concat(ll));function cl(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,o,a,i,s,l){if(Zn.apply(this,arguments),Wn){var u=Jn();Xn||(Xn=!0,Kn=u)}}(r,t,void 0,e),e.currentTarget=null}function dl(e,t,n){var r;if(n)for(var o=t.length-1;o>=0;o--){var a=t[o],i=a.instance,s=a.currentTarget,l=a.listener;if(i!==r&&e.isPropagationStopped())return;cl(e,l,s),r=i}else for(var u=0;u<t.length;u++){var c=t[u],d=c.instance,f=c.currentTarget,p=c.listener;if(d!==r&&e.isPropagationStopped())return;cl(e,p,f),r=d}}function fl(e,t){for(var n=!!(4&t),r=0;r<e.length;r++){var o=e[r];dl(o.event,o.listeners,n)}!function(){if(Xn){var e=Kn;throw Xn=!1,Kn=null,e}}()}function pl(e,t){ul.has(e)||a('Did not expect a listenToNonDelegatedEvent() call for "%s". This is a bug in React. Please file an issue.',e);var n=function(e){var t=e[Uu];void 0===t&&(t=e[Uu]=new Set);return t}(t),r=function(e){return e+"__bubble"}(e);n.has(r)||(bl(t,e,2,!1),n.add(r))}function hl(e,t,n){ul.has(e)&&!t&&a('Did not expect a listenToNativeEvent() call for "%s" in the bubble phase. This is a bug in React. Please file an issue.',e);var r=0;t&&(r|=4),bl(n,e,r,t)}var ml="_reactListening"+Math.random().toString(36).slice(2);function gl(e){if(!e[ml]){e[ml]=!0,w.forEach(function(t){"selectionchange"!==t&&(ul.has(t)||hl(t,!1,e),hl(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null!==t&&(t[ml]||(t[ml]=!0,hl("selectionchange",!1,t)))}}function bl(e,t,n,r,o){var a=function(e,t,n){var r;switch(hi(t)){case Ia:r=ui;break;case Ca:r=ci;break;default:r=di}return r.bind(null,t,n,e)}(e,t,n),i=void 0;Un&&("touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0)),r?void 0!==i?function(e,t,n,r){e.addEventListener(t,n,{capture:!0,passive:r})}(e,t,a,i):function(e,t,n){e.addEventListener(t,n,!0)}(e,t,a):void 0!==i?function(e,t,n,r){e.addEventListener(t,n,{passive:r})}(e,t,a,i):function(e,t,n){e.addEventListener(t,n,!1)}(e,t,a)}function yl(e,t){return e===t||8===e.nodeType&&e.parentNode===t}function _l(e,t,n,r,o){var a=r;if(!(1&t||2&t)){var i=o;if(null!==r){var s=r;e:for(;;){if(null===s)return;var l=s.tag;if(3===l||4===l){var u=s.stateNode.containerInfo;if(yl(u,i))break;if(4===l)for(var c=s.return;null!==c;){var d=c.tag;if(3===d||4===d)if(yl(c.stateNode.containerInfo,i))return;c=c.return}for(;null!==u;){var f=Yu(u);if(null===f)return;var p=f.tag;if(5===p||6===p){s=a=f;continue e}u=u.parentNode}}s=s.return}}}Fn(function(){return function(e,t,n,r){var o=[];sl(o,e,r,n,On(n),t),fl(o,t)}(e,t,n,a)})}function vl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function wl(e,t){for(var n=t+"Capture",r=[],o=e;null!==o;){var a=o,i=a.stateNode;if(5===a.tag&&null!==i){var s=i,l=Bn(o,n);null!=l&&r.unshift(vl(o,l,s));var u=Bn(o,t);null!=u&&r.push(vl(o,u,s))}o=o.return}return r}function Sl(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function xl(e,t,n,r,o){for(var a=t._reactName,i=[],s=n;null!==s&&s!==r;){var l=s,u=l.alternate,c=l.stateNode,d=l.tag;if(null!==u&&u===r)break;if(5===d&&null!==c){var f=c;if(o){var p=Bn(s,a);null!=p&&i.unshift(vl(s,p,f))}else if(!o){var h=Bn(s,a);null!=h&&i.push(vl(s,h,f))}}s=s.return}0!==i.length&&e.push({event:t,listeners:i})}var Tl,El,kl,Pl,Ol,Al,Rl,$l=!1,Il="dangerouslySetInnerHTML",Cl="suppressContentEditableWarning",Dl="suppressHydrationWarning",Nl="autoFocus",Ml="children",Ll="style",jl="__html";Tl={dialog:!0,webview:!0},El=function(e,t){gn(e,t),function(e,t){"input"!==e&&"textarea"!==e&&"select"!==e||null==t||null!==t.value||bn||(bn=!0,"select"===e&&t.multiple?a("`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.",e):a("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.",e))}(e,t),Tn(e,t,{registrationNameDependencies:S,possibleRegistrationNames:x})},Al=k&&!document.documentMode,kl=function(e,t,n){if(!$l){var r=Ul(n),o=Ul(t);o!==r&&($l=!0,a("Prop `%s` did not match. Server: %s Client: %s",e,JSON.stringify(o),JSON.stringify(r)))}},Pl=function(e){if(!$l){$l=!0;var t=[];e.forEach(function(e){t.push(e)}),a("Extra attributes from the server: %s",t)}},Ol=function(e,t){!1===t?a("Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.",e,e,e):a("Expected `%s` listener to be a function, instead got a value of `%s` type.",e,typeof t)},Rl=function(e,t){var n=e.namespaceURI===$t?e.ownerDocument.createElement(e.tagName):e.ownerDocument.createElementNS(e.namespaceURI,e.tagName);return n.innerHTML=t,n.innerHTML};var Fl=/\r\n?/g,Bl=/\u0000|\uFFFD/g;function Ul(e){return function(e){if(A(e))a("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before before using it here.",O(e)),R(e)}(e),("string"==typeof e?e:""+e).replace(Fl,"\n").replace(Bl,"")}function zl(e,t,n,r){var o=Ul(t),i=Ul(e);if(i!==o&&(r&&($l||($l=!0,a('Text content did not match. Server: "%s" Client: "%s"',i,o))),n))throw new Error("Text content does not match server-rendered HTML.")}function Vl(e){return 9===e.nodeType?e:e.ownerDocument}function Hl(){}function ql(e){e.onclick=Hl}function Gl(e,t,n,r){var o,a=un(t,n);switch(El(t,n),t){case"dialog":pl("cancel",e),pl("close",e),o=n;break;case"iframe":case"object":case"embed":pl("load",e),o=n;break;case"video":case"audio":for(var i=0;i<ll.length;i++)pl(ll[i],e);o=n;break;case"source":pl("error",e),o=n;break;case"img":case"image":case"link":pl("error",e),pl("load",e),o=n;break;case"details":pl("toggle",e),o=n;break;case"input":lt(e,n),o=st(e,n),pl("invalid",e);break;case"option":bt(0,n),o=n;break;case"select":Et(e,n),o=Tt(0,n),pl("invalid",e);break;case"textarea":Ot(e,n),o=Pt(e,n),pl("invalid",e);break;default:o=n}switch(ln(t,o),function(e,t,n,r,o){for(var a in r)if(r.hasOwnProperty(a)){var i=r[a];if(a===Ll)i&&Object.freeze(i),rn(t,i);else if(a===Il){var s=i?i[jl]:void 0;null!=s&&Lt(t,s)}else a===Ml?"string"==typeof i?("textarea"!==e||""!==i)&&jt(t,i):"number"==typeof i&&jt(t,""+i):a===Cl||a===Dl||a===Nl||(S.hasOwnProperty(a)?null!=i&&("function"!=typeof i&&Ol(a,i),"onScroll"===a&&pl("scroll",t)):null!=i&&Z(t,a,i,o))}}(t,e,0,o,a),t){case"input":Je(e),dt(e,n,!1);break;case"textarea":Je(e),Rt(e);break;case"option":!function(e,t){null!=t.value&&e.setAttribute("value",We(Ye(t.value)))}(e,n);break;case"select":!function(e,t){var n=e;n.multiple=!!t.multiple;var r=t.value;null!=r?xt(n,!!t.multiple,r,!1):null!=t.defaultValue&&xt(n,!!t.multiple,t.defaultValue,!0)}(e,n);break;default:"function"==typeof o.onClick&&ql(e)}}function Wl(e,t,n,r,o){El(t,r);var i,s,l,u,c=null;switch(t){case"input":i=st(e,n),s=st(e,r),c=[];break;case"select":i=Tt(0,n),s=Tt(0,r),c=[];break;case"textarea":i=Pt(e,n),s=Pt(e,r),c=[];break;default:s=r,"function"!=typeof(i=n).onClick&&"function"==typeof s.onClick&&ql(e)}ln(t,s);var d=null;for(l in i)if(!s.hasOwnProperty(l)&&i.hasOwnProperty(l)&&null!=i[l])if(l===Ll){var f=i[l];for(u in f)f.hasOwnProperty(u)&&(d||(d={}),d[u]="")}else l===Il||l===Ml||l===Cl||l===Dl||l===Nl||(S.hasOwnProperty(l)?c||(c=[]):(c=c||[]).push(l,null));for(l in s){var p=s[l],h=null!=i?i[l]:void 0;if(s.hasOwnProperty(l)&&p!==h&&(null!=p||null!=h))if(l===Ll)if(p&&Object.freeze(p),h){for(u in h)!h.hasOwnProperty(u)||p&&p.hasOwnProperty(u)||(d||(d={}),d[u]="");for(u in p)p.hasOwnProperty(u)&&h[u]!==p[u]&&(d||(d={}),d[u]=p[u])}else d||(c||(c=[]),c.push(l,d)),d=p;else if(l===Il){var m=p?p[jl]:void 0,g=h?h[jl]:void 0;null!=m&&g!==m&&(c=c||[]).push(l,m)}else l===Ml?"string"!=typeof p&&"number"!=typeof p||(c=c||[]).push(l,""+p):l===Cl||l===Dl||(S.hasOwnProperty(l)?(null!=p&&("function"!=typeof p&&Ol(l,p),"onScroll"===l&&pl("scroll",e)),c||h===p||(c=[])):(c=c||[]).push(l,p))}return d&&(!function(e,t){if(t){var n=an(e),r=an(t),o={};for(var i in n){var s=n[i],l=r[i];if(l&&s!==l){var u=s+","+l;if(o[u])continue;o[u]=!0,a("%s a style property during rerender (%s) when a conflicting property is set (%s) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.",on(e[s])?"Removing":"Updating",s,l)}}}}(d,s[Ll]),(c=c||[]).push(Ll,d)),c}function Yl(e,t,n,r,o){"input"===n&&"radio"===o.type&&null!=o.name&&ut(e,o);un(n,r);switch(function(e,t,n,r){for(var o=0;o<t.length;o+=2){var a=t[o],i=t[o+1];a===Ll?rn(e,i):a===Il?Lt(e,i):a===Ml?jt(e,i):Z(e,a,i,r)}}(e,t,0,un(n,o)),n){case"input":ct(e,o);break;case"textarea":At(e,o);break;case"select":!function(e,t){var n=e,r=n._wrapperState.wasMultiple;n._wrapperState.wasMultiple=!!t.multiple;var o=t.value;null!=o?xt(n,!!t.multiple,o,!1):r!==!!t.multiple&&(null!=t.defaultValue?xt(n,!!t.multiple,t.defaultValue,!0):xt(n,!!t.multiple,t.multiple?[]:"",!1))}(e,o)}}function Xl(e){var t=e.toLowerCase();return cn.hasOwnProperty(t)&&cn[t]||null}function Kl(e,t){$l||($l=!0,a("Did not expect server HTML to contain a <%s> in <%s>.",t.nodeName.toLowerCase(),e.nodeName.toLowerCase()))}function Ql(e,t){$l||($l=!0,a('Did not expect server HTML to contain the text node "%s" in <%s>.',t.nodeValue,e.nodeName.toLowerCase()))}function Zl(e,t,n){$l||($l=!0,a("Expected server HTML to contain a matching <%s> in <%s>.",t,e.nodeName.toLowerCase()))}function Jl(e,t){""!==t&&($l||($l=!0,a('Expected server HTML to contain a matching text node for "%s" in <%s>.',t,e.nodeName.toLowerCase())))}var eu,tu,nu=["address","applet","area","article","aside","base","basefont","bgsound","blockquote","body","br","button","caption","center","col","colgroup","dd","details","dir","div","dl","dt","embed","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","iframe","img","input","isindex","li","link","listing","main","marquee","menu","menuitem","meta","nav","noembed","noframes","noscript","object","ol","p","param","plaintext","pre","script","section","select","source","style","summary","table","tbody","td","template","textarea","tfoot","th","thead","title","tr","track","ul","wbr","xmp"],ru=["applet","caption","html","table","td","th","marquee","object","template","foreignObject","desc","title"],ou=ru.concat(["button"]),au=["dd","dt","li","option","optgroup","p","rp","rt"],iu={current:null,formTag:null,aTagInScope:null,buttonTagInScope:null,nobrTagInScope:null,pTagInButtonScope:null,listItemTagAutoclosing:null,dlItemTagAutoclosing:null};tu=function(e,t){var n=we({},e||iu),r={tag:t};return-1!==ru.indexOf(t)&&(n.aTagInScope=null,n.buttonTagInScope=null,n.nobrTagInScope=null),-1!==ou.indexOf(t)&&(n.pTagInButtonScope=null),-1!==nu.indexOf(t)&&"address"!==t&&"div"!==t&&"p"!==t&&(n.listItemTagAutoclosing=null,n.dlItemTagAutoclosing=null),n.current=r,"form"===t&&(n.formTag=r),"a"===t&&(n.aTagInScope=r),"button"===t&&(n.buttonTagInScope=r),"nobr"===t&&(n.nobrTagInScope=r),"p"===t&&(n.pTagInButtonScope=r),"li"===t&&(n.listItemTagAutoclosing=r),"dd"!==t&&"dt"!==t||(n.dlItemTagAutoclosing=r),n};var su={};eu=function(e,t,n){var r=(n=n||iu).current,o=r&&r.tag;null!=t&&(null!=e&&a("validateDOMNesting: when childText is passed, childTag should be null"),e="#text");var i=function(e,t){switch(t){case"select":return"option"===e||"optgroup"===e||"#text"===e;case"optgroup":return"option"===e||"#text"===e;case"option":return"#text"===e;case"tr":return"th"===e||"td"===e||"style"===e||"script"===e||"template"===e;case"tbody":case"thead":case"tfoot":return"tr"===e||"style"===e||"script"===e||"template"===e;case"colgroup":return"col"===e||"template"===e;case"table":return"caption"===e||"colgroup"===e||"tbody"===e||"tfoot"===e||"thead"===e||"style"===e||"script"===e||"template"===e;case"head":return"base"===e||"basefont"===e||"bgsound"===e||"link"===e||"meta"===e||"title"===e||"noscript"===e||"noframes"===e||"style"===e||"script"===e||"template"===e;case"html":return"head"===e||"body"===e||"frameset"===e;case"frameset":return"frame"===e;case"#document":return"html"===e}switch(e){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t;case"rp":case"rt":return-1===au.indexOf(t);case"body":case"caption":case"col":case"colgroup":case"frameset":case"frame":case"head":case"html":case"tbody":case"td":case"tfoot":case"th":case"thead":case"tr":return null==t}return!0}(e,o)?null:r,s=i?null:function(e,t){switch(e){case"address":case"article":case"aside":case"blockquote":case"center":case"details":case"dialog":case"dir":case"div":case"dl":case"fieldset":case"figcaption":case"figure":case"footer":case"header":case"hgroup":case"main":case"menu":case"nav":case"ol":case"p":case"section":case"summary":case"ul":case"pre":case"listing":case"table":case"hr":case"xmp":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return t.pTagInButtonScope;case"form":return t.formTag||t.pTagInButtonScope;case"li":return t.listItemTagAutoclosing;case"dd":case"dt":return t.dlItemTagAutoclosing;case"button":return t.buttonTagInScope;case"a":return t.aTagInScope;case"nobr":return t.nobrTagInScope}return null}(e,n),l=i||s;if(l){var u=l.tag,c=!!i+"|"+e+"|"+u;if(!su[c]){su[c]=!0;var d=e,f="";if("#text"===e?/\S/.test(t)?d="Text nodes":(d="Whitespace text nodes",f=" Make sure you don't have any extra whitespace between tags on each line of your source code."):d="<"+e+">",i){var p="";"table"===u&&"tr"===e&&(p+=" Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser."),a("validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s",d,u,f,p)}else a("validateDOMNesting(...): %s cannot appear as a descendant of <%s>.",d,u)}}};var lu="suppressHydrationWarning",uu="$",cu="/$",du="$?",fu="$!",pu=null,hu=null;function mu(e){var t;pu=si,t=js(),hu={focusedElem:t,selectionRange:Fs(t)?Us(t):null};return li(!1),null}function gu(e,t,n,r,o){var i=r;if(eu(e,null,i.ancestorInfo),"string"==typeof t.children||"number"==typeof t.children){var s=""+t.children,l=tu(i.ancestorInfo,e);eu(null,s,l)}var u=function(e,t,n,r){var o,i,s=Vl(n),l=r;if(l===$t&&(l=Ct(e)),l===$t){if((o=un(e,t))||e===e.toLowerCase()||a("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.",e),"script"===e){var u=s.createElement("div");u.innerHTML="<script><\/script>";var c=u.firstChild;i=u.removeChild(c)}else if("string"==typeof t.is)i=s.createElement(e,{is:t.is});else if(i=s.createElement(e),"select"===e){var d=i;t.multiple?d.multiple=!0:t.size&&(d.size=t.size)}}else i=s.createElementNS(l,e);return l===$t&&(o||"[object HTMLUnknownElement]"!==Object.prototype.toString.call(i)||P.call(Tl,e)||(Tl[e]=!0,a("The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.",e))),i}(e,t,n,i.namespace);return Hu(o,u),Zu(u,t),u}function bu(e,t){e.appendChild(t)}function yu(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}function _u(e,t,n,r){eu(null,e,n.ancestorInfo);var o=function(e,t){return Vl(t).createTextNode(e)}(e,t);return Hu(r,o),o}var vu="function"==typeof setTimeout?setTimeout:void 0,wu="function"==typeof clearTimeout?clearTimeout:void 0,Su="function"==typeof Promise?Promise:void 0,xu="function"==typeof queueMicrotask?queueMicrotask:void 0!==Su?function(e){return Su.resolve(null).then(e).catch(Tu)}:vu;function Tu(e){setTimeout(function(){throw e})}function Eu(e){jt(e,"")}function ku(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&8===o.nodeType){var a=o.data;if(a===cu){if(0===r)return e.removeChild(o),void ai(t);r--}else a!==uu&&a!==du&&a!==fu||r++}n=o}while(n);ai(t)}function Pu(e){var t=e.style;"function"==typeof t.setProperty?t.setProperty("display","none","important"):t.display="none"}function Ou(e){e.nodeValue=""}function Au(e,t){var n=t.style,r=null!=n&&n.hasOwnProperty("display")?n.display:null;e.style.display=zt("display",r)}function Ru(e,t){e.nodeValue=t}function $u(e){return e.data===du}function Iu(e){return e.data===fu}function Cu(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){var n=e.data;if(n===uu||n===fu||n===du)break;if(n===cu)return null}}return e}function Du(e){return Cu(e.nextSibling)}function Nu(e,t,n,r,o,a,i){return Hu(a,e),Zu(e,n),function(e,t,n,r,o,a,i){var s,l;switch(s=un(t,n),El(t,n),t){case"dialog":pl("cancel",e),pl("close",e);break;case"iframe":case"object":case"embed":pl("load",e);break;case"video":case"audio":for(var u=0;u<ll.length;u++)pl(ll[u],e);break;case"source":pl("error",e);break;case"img":case"image":case"link":pl("error",e),pl("load",e);break;case"details":pl("toggle",e);break;case"input":lt(e,n),pl("invalid",e);break;case"option":bt(0,n);break;case"select":Et(e,n),pl("invalid",e);break;case"textarea":Ot(e,n),pl("invalid",e)}ln(t,n),l=new Set;for(var c=e.attributes,d=0;d<c.length;d++)switch(c[d].name.toLowerCase()){case"value":case"checked":case"selected":break;default:l.add(c[d].name)}var f=null;for(var p in n)if(n.hasOwnProperty(p)){var h=n[p];if(p===Ml)"string"==typeof h?e.textContent!==h&&(!0!==n[Dl]&&zl(e.textContent,h,a,i),f=[Ml,h]):"number"==typeof h&&e.textContent!==""+h&&(!0!==n[Dl]&&zl(e.textContent,h,a,i),f=[Ml,""+h]);else if(S.hasOwnProperty(p))null!=h&&("function"!=typeof h&&Ol(p,h),"onScroll"===p&&pl("scroll",e));else if(i&&"boolean"==typeof s){var m=void 0,g=z(p);if(!0===n[Dl]);else if(p===Cl||p===Dl||"value"===p||"checked"===p||"selected"===p);else if(p===Il){var b=e.innerHTML,y=h?h[jl]:void 0;if(null!=y){var _=Rl(e,y);_!==b&&kl(p,b,_)}}else if(p===Ll){if(l.delete(p),Al){var v=nn(h);v!==(m=e.getAttribute("style"))&&kl(p,m,v)}}else if(s)l.delete(p.toLowerCase()),h!==(m=Q(e,p,h))&&kl(p,m,h);else if(!F(p,g,s)&&!U(p,h,g,s)){var w=!1;if(null!==g)l.delete(g.attributeName),m=K(e,p,h,g);else{var x=r;if(x===$t&&(x=Ct(t)),x===$t)l.delete(p.toLowerCase());else{var T=Xl(p);null!==T&&T!==p&&(w=!0,l.delete(T)),l.delete(p)}m=Q(e,p,h)}h===m||w||kl(p,m,h)}}}switch(i&&l.size>0&&!0!==n[Dl]&&Pl(l),t){case"input":Je(e),dt(e,n,!0);break;case"textarea":Je(e),Rt(e);break;case"select":case"option":break;default:"function"==typeof n.onClick&&ql(e)}return f}(e,t,n,o.namespace,0,!!(1&a.mode),i)}function Mu(e){for(var t=e.previousSibling,n=0;t;){if(8===t.nodeType){var r=t.data;if(r===uu||r===fu||r===du){if(0===n)return t;n--}else r===cu&&n++}t=t.previousSibling}return null}var Lu=Math.random().toString(36).slice(2),ju="__reactFiber$"+Lu,Fu="__reactProps$"+Lu,Bu="__reactContainer$"+Lu,Uu="__reactEvents$"+Lu,zu="__reactListeners$"+Lu,Vu="__reactHandles$"+Lu;function Hu(e,t){t[ju]=e}function qu(e,t){t[Bu]=e}function Gu(e){e[Bu]=null}function Wu(e){return!!e[Bu]}function Yu(e){var t=e[ju];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Bu]||n[ju]){var r=t.alternate;if(null!==t.child||null!==r&&null!==r.child)for(var o=Mu(e);null!==o;){var a=o[ju];if(a)return a;o=Mu(o)}return t}n=(e=n).parentNode}return null}function Xu(e){var t=e[ju]||e[Bu];return t&&(5===t.tag||6===t.tag||t.tag===c||3===t.tag)?t:null}function Ku(e){if(5===e.tag||6===e.tag)return e.stateNode;throw new Error("getNodeFromInstance: Invalid argument.")}function Qu(e){return e[Fu]||null}function Zu(e,t){e[Fu]=t}var Ju={},ec=n.ReactDebugCurrentFrame;function tc(e){if(e){var t=e._owner,n=Ie(e.type,e._source,t?t.type:null);ec.setExtraStackFrame(n)}else ec.setExtraStackFrame(null)}function nc(e,t,n,r,o){var i=Function.call.bind(P);for(var s in e)if(i(e,s)){var l=void 0;try{if("function"!=typeof e[s]){var u=Error((r||"React class")+": "+n+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[s]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}l=e[s](t,s,r,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(c){l=c}!l||l instanceof Error||(tc(o),a("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||"React class",n,s,typeof l),tc(null)),l instanceof Error&&!(l.message in Ju)&&(Ju[l.message]=!0,tc(o),a("Failed %s type: %s",n,l.message),tc(null))}}var rc,oc=[];rc=[];var ac,ic=-1;function sc(e){return{current:e}}function lc(e,t){ic<0?a("Unexpected pop."):(t!==rc[ic]&&a("Unexpected Fiber popped."),e.current=oc[ic],oc[ic]=null,rc[ic]=null,ic--)}function uc(e,t,n){ic++,oc[ic]=e.current,rc[ic]=n,e.current=t}ac={};var cc={};Object.freeze(cc);var dc=sc(cc),fc=sc(!1),pc=cc;function hc(e,t,n){return n&&yc(t)?pc:dc.current}function mc(e,t,n){var r=e.stateNode;r.__reactInternalMemoizedUnmaskedChildContext=t,r.__reactInternalMemoizedMaskedChildContext=n}function gc(e,t){var n=e.type.contextTypes;if(!n)return cc;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={};for(var a in n)o[a]=t[a];return nc(n,o,"context",je(e)||"Unknown"),r&&mc(e,t,o),o}function bc(){return fc.current}function yc(e){var t=e.childContextTypes;return null!=t}function _c(e){lc(fc,e),lc(dc,e)}function vc(e){lc(fc,e),lc(dc,e)}function wc(e,t,n){if(dc.current!==cc)throw new Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");uc(dc,t,e),uc(fc,n,e)}function Sc(e,t,n){var r=e.stateNode,o=t.childContextTypes;if("function"!=typeof r.getChildContext){var i=je(e)||"Unknown";return ac[i]||(ac[i]=!0,a("%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.",i,i)),n}var s=r.getChildContext();for(var l in s)if(!(l in o))throw new Error((je(e)||"Unknown")+'.getChildContext(): key "'+l+'" is not defined in childContextTypes.');return nc(o,s,"child context",je(e)||"Unknown"),we({},n,s)}function xc(e){var t=e.stateNode,n=t&&t.__reactInternalMemoizedMergedChildContext||cc;return pc=dc.current,uc(dc,n,e),uc(fc,fc.current,e),!0}function Tc(e,t,n){var r=e.stateNode;if(!r)throw new Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.");if(n){var o=Sc(e,t,pc);r.__reactInternalMemoizedMergedChildContext=o,lc(fc,e),lc(dc,e),uc(dc,o,e),uc(fc,n,e)}else lc(fc,e),uc(fc,n,e)}function Ec(e){if(!function(e){return Tr(e)===e}(e)||1!==e.tag)throw new Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.");var t=e;do{switch(t.tag){case 3:return t.stateNode.context;case 1:if(yc(t.type))return t.stateNode.__reactInternalMemoizedMergedChildContext}t=t.return}while(null!==t);throw new Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.")}var kc=null,Pc=!1,Oc=!1;function Ac(e){null===kc?kc=[e]:kc.push(e)}function Rc(){Pc&&$c()}function $c(){if(!Oc&&null!==kc){Oc=!0;var e=0,t=La();try{var n=kc;for(ja(Ia);e<n.length;e++){var r=n[e];do{r=r(true)}while(null!==r)}kc=null,Pc=!1}catch(o){throw null!==kc&&(kc=kc.slice(e+1)),Cr(Fr,$c),o}finally{ja(t),Oc=!1}}return null}var Ic=[],Cc=0,Dc=null,Nc=0,Mc=[],Lc=0,jc=null,Fc=1,Bc="";function Uc(){var e=Bc;return(Fc&~function(e){return 1<<qc(e)-1}(Fc)).toString(32)+e}function zc(e,t){Wc(),Ic[Cc++]=Nc,Ic[Cc++]=Dc,Dc=e,Nc=t}function Vc(e,t,n){Wc(),Mc[Lc++]=Fc,Mc[Lc++]=Bc,Mc[Lc++]=jc,jc=e;var r=Fc,o=Bc,a=qc(r)-1,i=r&~(1<<a),s=n+1,l=qc(t)+a;if(l>30){var u=a-a%5,c=(i&(1<<u)-1).toString(32),d=i>>u,f=a-u,p=qc(t)+f;Fc=1<<p|(s<<f|d),Bc=c+o}else{Fc=1<<l|(s<<a|i),Bc=o}}function Hc(e){if(Wc(),null!==e.return){zc(e,1),Vc(e,1,0)}}function qc(e){return 32-yo(e)}function Gc(e){for(;e===Dc;)Dc=Ic[--Cc],Ic[Cc]=null,Nc=Ic[--Cc],Ic[Cc]=null;for(;e===jc;)jc=Mc[--Lc],Mc[Lc]=null,Bc=Mc[--Lc],Mc[Lc]=null,Fc=Mc[--Lc],Mc[Lc]=null}function Wc(){yd()||a("Expected to be hydrating. This is a bug in React. Please file an issue.")}var Yc=null,Xc=null,Kc=!1,Qc=!1,Zc=null;function Jc(){Qc=!0}function ed(e){var t=e.stateNode.containerInfo;return Xc=Cu(t.firstChild),Yc=e,Kc=!0,Zc=null,Qc=!1,!0}function td(e,t,n){var r,o;return Xc=Cu(t.nextSibling),Yc=e,Kc=!0,Zc=null,Qc=!1,null!==n&&(r=e,o=n,Wc(),Mc[Lc++]=Fc,Mc[Lc++]=Bc,Mc[Lc++]=jc,Fc=o.id,Bc=o.overflow,jc=r),!0}function nd(e,t){switch(e.tag){case 3:!function(e,t){1===t.nodeType?Kl(e,t):8===t.nodeType||Ql(e,t)}(e.stateNode.containerInfo,t);break;case 5:var n=!!(1&e.mode);!function(e,t,n,r,o){(o||!0!==t[lu])&&(1===r.nodeType?Kl(n,r):8===r.nodeType||Ql(n,r))}(e.type,e.memoizedProps,e.stateNode,t,n);break;case c:var r=e.memoizedState;null!==r.dehydrated&&function(e,t){var n=e.parentNode;null!==n&&(1===t.nodeType?Kl(n,t):8===t.nodeType||Ql(n,t))}(r.dehydrated,t)}}function rd(e,t){nd(e,t);var n,r=((n=W_(5,null,null,0)).elementType="DELETED",n);r.stateNode=t,r.return=e;var o=e.deletions;null===o?(e.deletions=[r],e.flags|=tr):o.push(r)}function od(e,t){if(!Qc)switch(e.tag){case 3:var n=e.stateNode.containerInfo;switch(t.tag){case 5:var r=t.type;t.pendingProps,function(e,t){Zl(e,t)}(n,r);break;case 6:!function(e,t){Jl(e,t)}(n,t.pendingProps)}break;case 5:e.type;var o=e.memoizedProps,a=e.stateNode;switch(t.tag){case 5:var i=t.type;t.pendingProps;!function(e,t,n,r,o,a){(a||!0!==t[lu])&&Zl(n,r)}(0,o,a,i,0,!!(1&e.mode));break;case 6:!function(e,t,n,r,o){(o||!0!==t[lu])&&Jl(n,r)}(0,o,a,t.pendingProps,!!(1&e.mode))}break;case c:var s=e.memoizedState.dehydrated;if(null!==s)switch(t.tag){case 5:var l=t.type;t.pendingProps,function(e,t){var n=e.parentNode;null!==n&&Zl(n,t)}(s,l);break;case 6:!function(e,t){var n=e.parentNode;null!==n&&Jl(n,t)}(s,t.pendingProps)}break;default:return}}function ad(e,t){t.flags=-4097&t.flags|2,od(e,t)}function id(e,t){switch(e.tag){case 5:var n=e.type;e.pendingProps;var r=function(e,t){return 1!==e.nodeType||t.toLowerCase()!==e.nodeName.toLowerCase()?null:e}(t,n);return null!==r&&(e.stateNode=r,Yc=e,Xc=Cu(r.firstChild),!0);case 6:var o=function(e,t){return""===t||3!==e.nodeType?null:e}(t,e.pendingProps);return null!==o&&(e.stateNode=o,Yc=e,Xc=null,!0);case c:var a=function(e){return 8!==e.nodeType?null:e}(t);if(null!==a){var i={dehydrated:a,treeContext:(Wc(),null!==jc?{id:Fc,overflow:Bc}:null),retryLane:Zo};e.memoizedState=i;var s=function(e){var t=W_(h,null,null,0);return t.stateNode=e,t}(a);return s.return=e,e.child=s,Yc=e,Xc=null,!0}return!1;default:return!1}}function sd(e){return!!(1&e.mode)&&0===(e.flags&nr)}function ld(e){throw new Error("Hydration failed because the initial UI does not match what was rendered on the server.")}function ud(e){if(Kc){var t=Xc;if(!t)return sd(e)&&(od(Yc,e),ld()),ad(Yc,e),Kc=!1,void(Yc=e);var n=t;if(!id(e,t)){sd(e)&&(od(Yc,e),ld()),t=Du(n);var r=Yc;if(!t||!id(e,t))return ad(Yc,e),Kc=!1,void(Yc=e);rd(r,n)}}}function cd(e){var t=e.stateNode,n=e.memoizedProps,r=function(e,t,n){return Hu(n,e),n.mode,function(e,t){return e.nodeValue!==t}(e,t)}(t,n,e);if(r){var o=Yc;if(null!==o)switch(o.tag){case 3:o.stateNode.containerInfo;!function(e,t,n,r){zl(t.nodeValue,n,r,!0)}(0,t,n,!!(1&o.mode));break;case 5:o.type;var a=o.memoizedProps;o.stateNode;!function(e,t,n,r,o,a){!0!==t[lu]&&zl(r.nodeValue,o,a,!0)}(0,a,0,t,n,!!(1&o.mode))}}return r}function dd(e){var t=e.memoizedState,n=null!==t?t.dehydrated:null;if(!n)throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");!function(e,t){Hu(t,e)}(n,e)}function fd(e){var t=e.memoizedState,n=null!==t?t.dehydrated:null;if(!n)throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");return function(e){for(var t=e.nextSibling,n=0;t;){if(8===t.nodeType){var r=t.data;if(r===cu){if(0===n)return Du(t);n--}else r!==uu&&r!==fu&&r!==du||n++}t=t.nextSibling}return null}(n)}function pd(e){for(var t=e.return;null!==t&&5!==t.tag&&3!==t.tag&&t.tag!==c;)t=t.return;Yc=t}function hd(e){if(e!==Yc)return!1;if(!Kc)return pd(e),Kc=!0,!1;if(3!==e.tag&&(5!==e.tag||"head"!==(n=e.type)&&"body"!==n&&!yu(e.type,e.memoizedProps))){var t=Xc;if(t)if(sd(e))md(e),ld();else for(;t;)rd(e,t),t=Du(t)}var n;return pd(e),Xc=e.tag===c?fd(e):Yc?Du(e.stateNode):null,!0}function md(e){for(var t=Xc;t;)nd(e,t),t=Du(t)}function gd(){Yc=null,Xc=null,Kc=!1,Qc=!1}function bd(){null!==Zc&&(Hy(Zc),Zc=null)}function yd(){return Kc}function _d(e){null===Zc?Zc=[e]:Zc.push(e)}var vd=n.ReactCurrentBatchConfig;var wd={recordUnsafeLifecycleWarnings:function(e,t){},flushPendingUnsafeLifecycleWarnings:function(){},recordLegacyContextWarning:function(e,t){},flushLegacyContextWarning:function(){},discardPendingWarnings:function(){}},Sd=function(e){var t=[];return e.forEach(function(e){t.push(e)}),t.sort().join(", ")},xd=[],Td=[],Ed=[],kd=[],Pd=[],Od=[],Ad=new Set;wd.recordUnsafeLifecycleWarnings=function(e,t){Ad.has(e.type)||("function"==typeof t.componentWillMount&&!0!==t.componentWillMount.__suppressDeprecationWarning&&xd.push(e),8&e.mode&&"function"==typeof t.UNSAFE_componentWillMount&&Td.push(e),"function"==typeof t.componentWillReceiveProps&&!0!==t.componentWillReceiveProps.__suppressDeprecationWarning&&Ed.push(e),8&e.mode&&"function"==typeof t.UNSAFE_componentWillReceiveProps&&kd.push(e),"function"==typeof t.componentWillUpdate&&!0!==t.componentWillUpdate.__suppressDeprecationWarning&&Pd.push(e),8&e.mode&&"function"==typeof t.UNSAFE_componentWillUpdate&&Od.push(e))},wd.flushPendingUnsafeLifecycleWarnings=function(){var e=new Set;xd.length>0&&(xd.forEach(function(t){e.add(je(t)||"Component"),Ad.add(t.type)}),xd=[]);var t=new Set;Td.length>0&&(Td.forEach(function(e){t.add(je(e)||"Component"),Ad.add(e.type)}),Td=[]);var n=new Set;Ed.length>0&&(Ed.forEach(function(e){n.add(je(e)||"Component"),Ad.add(e.type)}),Ed=[]);var r=new Set;kd.length>0&&(kd.forEach(function(e){r.add(je(e)||"Component"),Ad.add(e.type)}),kd=[]);var i=new Set;Pd.length>0&&(Pd.forEach(function(e){i.add(je(e)||"Component"),Ad.add(e.type)}),Pd=[]);var s=new Set;(Od.length>0&&(Od.forEach(function(e){s.add(je(e)||"Component"),Ad.add(e.type)}),Od=[]),t.size>0)&&a("Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move code with side effects to componentDidMount, and set initial state in the constructor.\n\nPlease update the following components: %s",Sd(t));r.size>0&&a("Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n\nPlease update the following components: %s",Sd(r));s.size>0&&a("Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n\nPlease update the following components: %s",Sd(s));e.size>0&&o("componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move code with side effects to componentDidMount, and set initial state in the constructor.\n* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s",Sd(e));n.size>0&&o("componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s",Sd(n));i.size>0&&o("componentWillUpdate has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s",Sd(i))};var Rd,$d,Id,Cd,Dd,Nd=new Map,Md=new Set;wd.recordLegacyContextWarning=function(e,t){var n=function(e){for(var t=null,n=e;null!==n;)8&n.mode&&(t=n),n=n.return;return t}(e);if(null!==n){if(!Md.has(e.type)){var r=Nd.get(n);(null!=e.type.contextTypes||null!=e.type.childContextTypes||null!==t&&"function"==typeof t.getChildContext)&&(void 0===r&&(r=[],Nd.set(n,r)),r.push(e))}}else a("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue.")},wd.flushLegacyContextWarning=function(){Nd.forEach(function(e,t){if(0!==e.length){var n=e[0],r=new Set;e.forEach(function(e){r.add(je(e)||"Component"),Md.add(e.type)});var o=Sd(r);try{qe(n),a("Legacy context API has been detected within a strict-mode tree.\n\nThe old API will be supported in all 16.x releases, but applications using it should migrate to the new version.\n\nPlease update the following components: %s\n\nLearn more about this warning here: https://reactjs.org/link/legacy-context",o)}finally{He()}}})},wd.discardPendingWarnings=function(){xd=[],Td=[],Ed=[],kd=[],Pd=[],Od=[],Nd=new Map};var Ld;function jd(e,t,n){var r,o=n.ref;if(null!==o&&"function"!=typeof o&&"object"!=typeof o){if(e.mode,!(n._owner&&n._self&&n._owner.stateNode!==n._self||n._owner&&1!==n._owner.tag)&&("function"!=typeof n.type||(r=n.type).prototype&&r.prototype.isReactComponent)&&n._owner){var i=je(e)||"Component";Id[i]||(a('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',i,o),Id[i]=!0)}if(n._owner){var s,l=n._owner;if(l){var u=l;if(1!==u.tag)throw new Error("Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref");s=u.stateNode}if(!s)throw new Error("Missing owner for string ref "+o+". This error is likely caused by a bug in React. Please file an issue.");var c=s;!function(e,t){if(A(e))a("The provided `%s` prop is an unsupported type %s. This value must be coerced to a string before before using it here.",t,O(e)),R(e)}(o,"ref");var d=""+o;if(null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===d)return t.ref;var f=function(e){var t=c.refs;null===e?delete t[d]:t[d]=e};return f._stringRef=d,f}if("string"!=typeof o)throw new Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");if(!n._owner)throw new Error("Element ref was specified as a string ("+o+") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://reactjs.org/link/refs-must-have-owner for more information.")}return o}function Fd(e,t){var n=Object.prototype.toString.call(t);throw new Error("Objects are not valid as a React child (found: "+("[object Object]"===n?"object with keys {"+Object.keys(t).join(", ")+"}":n)+"). If you meant to render a collection of children, use an array instead.")}function Bd(e){var t=je(e)||"Component";Dd[t]||(Dd[t]=!0,a("Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it."))}function Ud(e){var t=e._payload;return(0,e._init)(t)}function zd(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=tr):r.push(n)}}function n(n,r){if(!e)return null;for(var o=r;null!==o;)t(n,o),o=o.sibling;return null}function r(e,t){for(var n=new Map,r=t;null!==r;)null!==r.key?n.set(r.key,r):n.set(r.index,r),r=r.sibling;return n}function o(e,t){var n=X_(e,t);return n.index=0,n.sibling=null,n}function i(t,n,r){if(t.index=r,!e)return t.flags|=pr,n;var o=t.alternate;if(null!==o){var a=o.index;return a<n?(t.flags|=2,n):a}return t.flags|=2,n}function s(t){return e&&null===t.alternate&&(t.flags|=2),t}function l(e,t,n,r){if(null===t||6!==t.tag){var a=tv(n,e.mode,r);return a.return=e,a}var i=o(t,n);return i.return=e,i}function u(e,t,n,r){var a=n.type;if(a===te)return d(e,t,n.props.children,r,n.key);if(null!==t&&(t.elementType===a||j_(t,n)||"object"==typeof a&&null!==a&&a.$$typeof===ce&&Ud(a)===t.type)){var i=o(t,n.props);return i.ref=jd(e,t,n),i.return=e,i._debugSource=n._source,i._debugOwner=n._owner,i}var s=Z_(n,e.mode,r);return s.ref=jd(e,t,n),s.return=e,s}function c(e,t,n,r){if(null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation){var a=nv(n,e.mode,r);return a.return=e,a}var i=o(t,n.children||[]);return i.return=e,i}function d(e,t,n,r,a){if(null===t||7!==t.tag){var i=J_(n,e.mode,r,a);return i.return=e,i}var s=o(t,n);return s.return=e,s}function f(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t){var r=tv(""+t,e.mode,n);return r.return=e,r}if("object"==typeof t&&null!==t){switch(t.$$typeof){case J:var o=Z_(t,e.mode,n);return o.ref=jd(e,null,t),o.return=e,o;case ee:var a=nv(t,e.mode,n);return a.return=e,a;case ce:var i=t._payload;return f(e,(0,t._init)(i),n)}if(vt(t)||pe(t)){var s=J_(t,e.mode,n,null);return s.return=e,s}Fd(0,t)}return"function"==typeof t&&Bd(e),null}function p(e,t,n,r){var o=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==o?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case J:return n.key===o?u(e,t,n,r):null;case ee:return n.key===o?c(e,t,n,r):null;case ce:var a=n._payload;return p(e,t,(0,n._init)(a),r)}if(vt(n)||pe(n))return null!==o?null:d(e,t,n,r,null);Fd(0,n)}return"function"==typeof n&&Bd(e),null}function h(e,t,n,r,o){if("string"==typeof r&&""!==r||"number"==typeof r)return l(t,e.get(n)||null,""+r,o);if("object"==typeof r&&null!==r){switch(r.$$typeof){case J:return u(t,e.get(null===r.key?n:r.key)||null,r,o);case ee:return c(t,e.get(null===r.key?n:r.key)||null,r,o);case ce:var a=r._payload;return h(e,t,n,(0,r._init)(a),o)}if(vt(r)||pe(r))return d(t,e.get(n)||null,r,o,null);Fd(0,r)}return"function"==typeof r&&Bd(t),null}function m(e,t,n){if("object"!=typeof e||null===e)return t;switch(e.$$typeof){case J:case ee:Ld(e,n);var r=e.key;if("string"!=typeof r)break;if(null===t){(t=new Set).add(r);break}if(!t.has(r)){t.add(r);break}a("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.",r);break;case ce:var o=e._payload;m((0,e._init)(o),t,n)}return t}return function l(u,c,d,g){if("object"==typeof d&&null!==d&&d.type===te&&null===d.key&&(d=d.props.children),"object"==typeof d&&null!==d){switch(d.$$typeof){case J:return s(function(e,r,a,i){for(var s=a.key,l=r;null!==l;){if(l.key===s){var u=a.type;if(u===te){if(7===l.tag){n(e,l.sibling);var c=o(l,a.props.children);return c.return=e,c._debugSource=a._source,c._debugOwner=a._owner,c}}else if(l.elementType===u||j_(l,a)||"object"==typeof u&&null!==u&&u.$$typeof===ce&&Ud(u)===l.type){n(e,l.sibling);var d=o(l,a.props);return d.ref=jd(e,l,a),d.return=e,d._debugSource=a._source,d._debugOwner=a._owner,d}n(e,l);break}t(e,l),l=l.sibling}if(a.type===te){var f=J_(a.props.children,e.mode,i,a.key);return f.return=e,f}var p=Z_(a,e.mode,i);return p.ref=jd(e,r,a),p.return=e,p}(u,c,d,g));case ee:return s(function(e,r,a,i){for(var s=a.key,l=r;null!==l;){if(l.key===s){if(4===l.tag&&l.stateNode.containerInfo===a.containerInfo&&l.stateNode.implementation===a.implementation){n(e,l.sibling);var u=o(l,a.children||[]);return u.return=e,u}n(e,l);break}t(e,l),l=l.sibling}var c=nv(a,e.mode,i);return c.return=e,c}(u,c,d,g));case ce:var b=d._payload;return l(u,c,(0,d._init)(b),g)}if(vt(d))return function(o,a,s,l){for(var u=null,c=0;c<s.length;c++)u=m(s[c],u,o);for(var d=null,g=null,b=a,y=0,_=0,v=null;null!==b&&_<s.length;_++){b.index>_?(v=b,b=null):v=b.sibling;var w=p(o,b,s[_],l);if(null===w){null===b&&(b=v);break}e&&b&&null===w.alternate&&t(o,b),y=i(w,y,_),null===g?d=w:g.sibling=w,g=w,b=v}if(_===s.length)return n(o,b),yd()&&zc(o,_),d;if(null===b){for(;_<s.length;_++){var S=f(o,s[_],l);null!==S&&(y=i(S,y,_),null===g?d=S:g.sibling=S,g=S)}return yd()&&zc(o,_),d}for(var x=r(0,b);_<s.length;_++){var T=h(x,o,_,s[_],l);null!==T&&(e&&null!==T.alternate&&x.delete(null===T.key?_:T.key),y=i(T,y,_),null===g?d=T:g.sibling=T,g=T)}return e&&x.forEach(function(e){return t(o,e)}),yd()&&zc(o,_),d}(u,c,d,g);if(pe(d))return function(o,s,l,u){var c=pe(l);if("function"!=typeof c)throw new Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");"function"==typeof Symbol&&"Generator"===l[Symbol.toStringTag]&&($d||a("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers."),$d=!0),l.entries===c&&(Rd||a("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),Rd=!0);var d=c.call(l);if(d)for(var g=null,b=d.next();!b.done;b=d.next())g=m(b.value,g,o);var y=c.call(l);if(null==y)throw new Error("An iterable object provided no iterator.");for(var _=null,v=null,w=s,S=0,x=0,T=null,E=y.next();null!==w&&!E.done;x++,E=y.next()){w.index>x?(T=w,w=null):T=w.sibling;var k=p(o,w,E.value,u);if(null===k){null===w&&(w=T);break}e&&w&&null===k.alternate&&t(o,w),S=i(k,S,x),null===v?_=k:v.sibling=k,v=k,w=T}if(E.done)return n(o,w),yd()&&zc(o,x),_;if(null===w){for(;!E.done;x++,E=y.next()){var P=f(o,E.value,u);null!==P&&(S=i(P,S,x),null===v?_=P:v.sibling=P,v=P)}return yd()&&zc(o,x),_}for(var O=r(0,w);!E.done;x++,E=y.next()){var A=h(O,o,x,E.value,u);null!==A&&(e&&null!==A.alternate&&O.delete(null===A.key?x:A.key),S=i(A,S,x),null===v?_=A:v.sibling=A,v=A)}return e&&O.forEach(function(e){return t(o,e)}),yd()&&zc(o,x),_}(u,c,d,g);Fd(0,d)}return"string"==typeof d&&""!==d||"number"==typeof d?s(function(e,t,r,a){if(null!==t&&6===t.tag){n(e,t.sibling);var i=o(t,r);return i.return=e,i}n(e,t);var s=tv(r,e.mode,a);return s.return=e,s}(u,c,""+d,g)):("function"==typeof d&&Bd(u),n(u,c))}}Rd=!1,$d=!1,Id={},Cd={},Dd={},Ld=function(e,t){if(null!==e&&"object"==typeof e&&e._store&&!e._store.validated&&null==e.key){if("object"!=typeof e._store)throw new Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");e._store.validated=!0;var n=je(t)||"Component";Cd[n]||(Cd[n]=!0,a('Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.'))}};var Vd=zd(!0),Hd=zd(!1);function qd(e,t){for(var n=e.child;null!==n;)K_(n,t),n=n.sibling}var Gd,Wd=sc(null);Gd={};var Yd=null,Xd=null,Kd=null,Qd=!1;function Zd(){Yd=null,Xd=null,Kd=null,Qd=!1}function Jd(){Qd=!0}function ef(){Qd=!1}function tf(e,t,n){uc(Wd,t._currentValue,e),t._currentValue=n,void 0!==t._currentRenderer&&null!==t._currentRenderer&&t._currentRenderer!==Gd&&a("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),t._currentRenderer=Gd}function nf(e,t){var n=Wd.current;lc(Wd,t),e._currentValue=n}function rf(e,t,n){for(var r=e;null!==r;){var o=r.alternate;if(ba(r.childLanes,t)?null===o||ba(o.childLanes,t)||(o.childLanes=ya(o.childLanes,t)):(r.childLanes=ya(r.childLanes,t),null!==o&&(o.childLanes=ya(o.childLanes,t))),r===n)break;r=r.return}r!==n&&a("Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue.")}function of(e,t,n){!function(e,t,n){var r=e.child;null!==r&&(r.return=e);for(;null!==r;){var o=void 0,a=r.dependencies;if(null!==a){o=r.child;for(var i=a.firstContext;null!==i;){if(i.context===t){if(1===r.tag){var l=pa(n),u=wf(ea,l);u.tag=bf;var c=r.updateQueue;if(null===c);else{var d=c.shared,f=d.pending;null===f?u.next=u:(u.next=f.next,f.next=u),d.pending=u}}r.lanes=ya(r.lanes,n);var p=r.alternate;null!==p&&(p.lanes=ya(p.lanes,n)),rf(r.return,n,e),a.lanes=ya(a.lanes,n);break}i=i.next}}else if(r.tag===s)o=r.type===e.type?null:r.child;else if(r.tag===h){var m=r.return;if(null===m)throw new Error("We just came from a parent so we must have had a parent. This is a bug in React.");m.lanes=ya(m.lanes,n);var g=m.alternate;null!==g&&(g.lanes=ya(g.lanes,n)),rf(m,n,e),o=r.sibling}else o=r.child;if(null!==o)o.return=r;else for(o=r;null!==o;){if(o===e){o=null;break}var b=o.sibling;if(null!==b){b.return=o.return,o=b;break}o=o.return}r=o}}(e,t,n)}function af(e,t){Yd=e,Xd=null,Kd=null;var n=e.dependencies;null!==n&&(null!==n.firstContext&&(ga(n.lanes,t)&&mg(),n.firstContext=null))}function sf(e){Qd&&a("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");var t=e._currentValue;if(Kd===e);else{var n={context:e,memoizedValue:t,next:null};if(null===Xd){if(null===Yd)throw new Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");Xd=n,Yd.dependencies={lanes:0,firstContext:n}}else Xd=Xd.next=n}return t}var lf=null;function uf(e){null===lf?lf=[e]:lf.push(e)}function cf(e,t,n,r){var o=t.interleaved;return null===o?(n.next=n,uf(t)):(n.next=o.next,o.next=n),t.interleaved=n,pf(e,r)}function df(e,t){return pf(e,t)}var ff=pf;function pf(e,t){e.lanes=ya(e.lanes,t);var n=e.alternate;null!==n&&(n.lanes=ya(n.lanes,t)),null===n&&4098&e.flags&&x_(e);for(var r=e,o=e.return;null!==o;)o.childLanes=ya(o.childLanes,t),null!==(n=o.alternate)?n.childLanes=ya(n.childLanes,t):4098&o.flags&&x_(e),r=o,o=o.return;return 3===r.tag?r.stateNode:null}var hf,mf,gf=0,bf=2,yf=!1;function _f(e){var t={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null};e.updateQueue=t}function vf(e,t){var n=t.updateQueue,r=e.updateQueue;if(n===r){var o={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects};t.updateQueue=o}}function wf(e,t){return{eventTime:e,lane:t,tag:gf,payload:null,callback:null,next:null}}function Sf(e,t,n){var r=e.updateQueue;if(null===r)return null;var o=r.shared;if(mf!==o||hf||(a("An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback."),hf=!0),(Qb&zb)!==Ub){var i=o.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),o.pending=t,ff(e,n)}return function(e,t,n,r){var o=t.interleaved;return null===o?(n.next=n,uf(t)):(n.next=o.next,o.next=n),t.interleaved=n,pf(e,r)}(e,o,t,n)}function xf(e,t,n){var r=t.updateQueue;if(null!==r){var o=r.shared;if(ca(n)){var a=o.lanes,i=ya(a=va(a,e.pendingLanes),n);o.lanes=i,Ta(e,i)}}}function Tf(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r){var o=r.updateQueue;if(n===o){var a=null,i=null,s=n.firstBaseUpdate;if(null!==s){var l=s;do{var u={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};null===i?a=i=u:(i.next=u,i=u),l=l.next}while(null!==l);null===i?a=i=t:(i.next=t,i=t)}else a=i=t;return n={baseState:o.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:o.shared,effects:o.effects},void(e.updateQueue=n)}}var c=n.lastBaseUpdate;null===c?n.firstBaseUpdate=t:c.next=t,n.lastBaseUpdate=t}function Ef(e,t,n,r,o,a){switch(n.tag){case 1:var i=n.payload;if("function"==typeof i){Jd();var s=i.call(a,r,o);if(8&e.mode){Qr(!0);try{i.call(a,r,o)}finally{Qr(!1)}}return ef(),s}return i;case 3:e.flags=-65537&e.flags|nr;case gf:var l,u=n.payload;if("function"==typeof u){if(Jd(),l=u.call(a,r,o),8&e.mode){Qr(!0);try{u.call(a,r,o)}finally{Qr(!1)}}ef()}else l=u;return null==l?r:we({},r,l);case bf:return yf=!0,r}return r}function kf(e,t,n,r){var o=e.updateQueue;yf=!1,mf=o.shared;var a=o.firstBaseUpdate,i=o.lastBaseUpdate,s=o.shared.pending;if(null!==s){o.shared.pending=null;var l=s,u=l.next;l.next=null,null===i?a=u:i.next=u,i=l;var c=e.alternate;if(null!==c){var d=c.updateQueue,f=d.lastBaseUpdate;f!==i&&(null===f?d.firstBaseUpdate=u:f.next=u,d.lastBaseUpdate=l)}}if(null!==a){for(var p=o.baseState,h=0,m=null,g=null,b=null,y=a;;){var _=y.lane,v=y.eventTime;if(ba(r,_)){if(null!==b){var w={eventTime:v,lane:0,tag:y.tag,payload:y.payload,callback:y.callback,next:null};b=b.next=w}if(p=Ef(e,0,y,p,t,n),null!==y.callback&&0!==y.lane){e.flags|=64;var S=o.effects;null===S?o.effects=[y]:S.push(y)}}else{var x={eventTime:v,lane:_,tag:y.tag,payload:y.payload,callback:y.callback,next:null};null===b?(g=b=x,m=p):b=b.next=x,h=ya(h,_)}if(null===(y=y.next)){if(null===(s=o.shared.pending))break;var T=s,E=T.next;T.next=null,y=E,o.lastBaseUpdate=T,o.shared.pending=null}}null===b&&(m=p),o.baseState=m,o.firstBaseUpdate=g,o.lastBaseUpdate=b;var k=o.shared.interleaved;if(null!==k){var P=k;do{h=ya(h,P.lane),P=P.next}while(P!==k)}else null===a&&(o.shared.lanes=0);n_(h),e.lanes=h,e.memoizedState=p}mf=null}function Pf(e,t){if("function"!=typeof e)throw new Error("Invalid argument passed as callback. Expected a function. Instead received: "+e);e.call(t)}function Of(){yf=!1}function Af(){return yf}function Rf(e,t,n){var r=t.effects;if(t.effects=null,null!==r)for(var o=0;o<r.length;o++){var a=r[o],i=a.callback;null!==i&&(a.callback=null,Pf(i,n))}}hf=!1,mf=null;var $f={},If=sc($f),Cf=sc($f),Df=sc($f);function Nf(e){if(e===$f)throw new Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");return e}function Mf(){return Nf(Df.current)}function Lf(e,t){uc(Df,t,e),uc(Cf,e,e),uc(If,$f,e);var n=function(e){var t,n,r=e.nodeType;switch(r){case 9:case 11:t=9===r?"#document":"#fragment";var o=e.documentElement;n=o?o.namespaceURI:Dt(null,"");break;default:var a=8===r?e.parentNode:e;n=Dt(a.namespaceURI||null,t=a.tagName)}var i=t.toLowerCase();return{namespace:n,ancestorInfo:tu(null,i)}}(t);lc(If,e),uc(If,n,e)}function jf(e){lc(If,e),lc(Cf,e),lc(Df,e)}function Ff(){return Nf(If.current)}function Bf(e){Nf(Df.current);var t,n,r,o=Nf(If.current),a=(t=o,n=e.type,{namespace:Dt((r=t).namespace,n),ancestorInfo:tu(r.ancestorInfo,n)});o!==a&&(uc(Cf,e,e),uc(If,a,e))}function Uf(e){Cf.current===e&&(lc(If,e),lc(Cf,e))}var zf=sc(0);function Vf(e,t){return 0!==(e&t)}function Hf(e){return 1&e}function qf(e,t){return 1&e|t}function Gf(e,t){uc(zf,t,e)}function Wf(e){lc(zf,e)}function Yf(e,t){var n=e.memoizedState;return null!==n?null!==n.dehydrated:(e.memoizedProps,!0)}function Xf(e){for(var t=e;null!==t;){if(t.tag===c){var n=t.memoizedState;if(null!==n){var r=n.dehydrated;if(null===r||$u(r)||Iu(r))return t}}else if(t.tag===m&&void 0!==t.memoizedProps.revealOrder){if(0!==(t.flags&nr))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)return null;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Kf=[];function Qf(){for(var e=0;e<Kf.length;e++){Kf[e]._workInProgressVersionPrimary=null}Kf.length=0}function Zf(e,t){var n=(0,t._getVersion)(t._source);null==e.mutableSourceEagerHydrationData?e.mutableSourceEagerHydrationData=[t,n]:e.mutableSourceEagerHydrationData.push(t,n)}var Jf,ep,tp=n.ReactCurrentDispatcher,np=n.ReactCurrentBatchConfig;Jf=new Set;var rp=0,op=null,ap=null,ip=null,sp=!1,lp=!1,up=0,cp=0,dp=null,fp=null,pp=-1,hp=!1;function mp(){var e=dp;null===fp?fp=[e]:fp.push(e)}function gp(){var e=dp;null!==fp&&(pp++,fp[pp]!==e&&function(e){var t=je(op);if(!Jf.has(t)&&(Jf.add(t),null!==fp)){for(var n="",r=30,o=0;o<=pp;o++){for(var i=fp[o],s=o===pp?e:i,l=o+1+". "+i;l.length<r;)l+=" ";n+=l+=s+"\n"}a("React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",t,n)}}(e))}function bp(e){null==e||vt(e)||a("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",dp,typeof e)}function yp(){throw new Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.")}function _p(e,t){if(hp)return!1;if(null===t)return a("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.",dp),!1;e.length!==t.length&&a("The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s",dp,"["+t.join(", ")+"]","["+e.join(", ")+"]");for(var n=0;n<t.length&&n<e.length;n++)if(!Os(e[n],t[n]))return!1;return!0}function vp(e,t,n,r,o,i){rp=i,op=t,fp=null!==e?e._debugHookTypes:null,pp=-1,hp=null!==e&&e.type!==t.type,t.memoizedState=null,t.updateQueue=null,t.lanes=0,null!==e&&null!==e.memoizedState?tp.current=kh:tp.current=null!==fp?Eh:Th;var s=n(r,o);if(lp){var l=0;do{if(lp=!1,up=0,l>=25)throw new Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");l+=1,hp=!1,ap=null,ip=null,t.updateQueue=null,pp=-1,tp.current=Ph,s=n(r,o)}while(lp)}tp.current=xh,t._debugHookTypes=fp;var u=null!==ap&&null!==ap.next;if(rp=0,op=null,ap=null,ip=null,dp=null,fp=null,pp=-1,null!==e&&(e.flags&Sr)!==(t.flags&Sr)&&1&e.mode&&a("Internal React error: Expected static flag was missing. Please notify the React team."),sp=!1,u)throw new Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");return s}function wp(){var e=0!==up;return up=0,e}function Sp(e,t,n){t.updateQueue=e.updateQueue,0!==(t.mode&bo)?t.flags&=-50333701:t.flags&=-2053,e.lanes=_a(e.lanes,n)}function xp(){if(tp.current=xh,sp){for(var e=op.memoizedState;null!==e;){var t=e.queue;null!==t&&(t.pending=null),e=e.next}sp=!1}rp=0,op=null,ap=null,ip=null,fp=null,pp=-1,dp=null,hh=!1,lp=!1,up=0}function Tp(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ip?op.memoizedState=ip=e:ip=ip.next=e,ip}function Ep(){var e,t;if(null===ap){var n=op.alternate;e=null!==n?n.memoizedState:null}else e=ap.next;if(null!==(t=null===ip?op.memoizedState:ip.next))t=(ip=t).next,ap=e;else{if(null===e)throw new Error("Rendered more hooks than during the previous render.");var r={memoizedState:(ap=e).memoizedState,baseState:ap.baseState,baseQueue:ap.baseQueue,queue:ap.queue,next:null};null===ip?op.memoizedState=ip=r:ip=ip.next=r}return ip}function kp(e,t){return"function"==typeof t?t(e):t}function Pp(e,t,n){var r,o=Tp();r=void 0!==n?n(t):t,o.memoizedState=o.baseState=r;var a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r};o.queue=a;var i=a.dispatch=bh.bind(null,op,a);return[o.memoizedState,i]}function Op(e,t,n){var r=Ep(),o=r.queue;if(null===o)throw new Error("Should have a queue. This is likely a bug in React. Please file an issue.");o.lastRenderedReducer=e;var i=ap,s=i.baseQueue,l=o.pending;if(null!==l){if(null!==s){var u=s.next,c=l.next;s.next=c,l.next=u}i.baseQueue!==s&&a("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."),i.baseQueue=s=l,o.pending=null}if(null!==s){var d=s.next,f=i.baseState,p=null,h=null,m=null,g=d;do{var b=g.lane;if(ba(rp,b)){if(null!==m){var y={lane:0,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null};m=m.next=y}if(g.hasEagerState)f=g.eagerState;else f=e(f,g.action)}else{var _={lane:b,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null};null===m?(h=m=_,p=f):m=m.next=_,op.lanes=ya(op.lanes,b),n_(b)}g=g.next}while(null!==g&&g!==d);null===m?p=f:m.next=h,Os(f,r.memoizedState)||mg(),r.memoizedState=f,r.baseState=p,r.baseQueue=m,o.lastRenderedState=f}var v=o.interleaved;if(null!==v){var w=v;do{var S=w.lane;op.lanes=ya(op.lanes,S),n_(S),w=w.next}while(w!==v)}else null===s&&(o.lanes=0);var x=o.dispatch;return[r.memoizedState,x]}function Ap(e,t,n){var r=Ep(),o=r.queue;if(null===o)throw new Error("Should have a queue. This is likely a bug in React. Please file an issue.");o.lastRenderedReducer=e;var a=o.dispatch,i=o.pending,s=r.memoizedState;if(null!==i){o.pending=null;var l=i.next,u=l;do{s=e(s,u.action),u=u.next}while(u!==l);Os(s,r.memoizedState)||mg(),r.memoizedState=s,null===r.baseQueue&&(r.baseState=s),o.lastRenderedState=s}return[s,a]}function Rp(e,t,n){var r,o=op,i=Tp();if(yd()){if(void 0===n)throw new Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");r=n(),ep||r!==n()&&(a("The result of getServerSnapshot should be cached to avoid an infinite loop"),ep=!0)}else{if(r=t(),!ep){var s=t();Os(r,s)||(a("The result of getSnapshot should be cached to avoid an infinite loop"),ep=!0)}var l=My();if(null===l)throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");ua(0,rp)||Ip(o,t,r)}i.memoizedState=r;var u={value:r,getSnapshot:t};return i.queue=u,qp(Dp.bind(null,o,u,e),[e]),o.flags|=ir,Bp(9,Cp.bind(null,o,u,r,t),void 0,null),r}function $p(e,t,n){var r=op,o=Ep(),i=t();if(!ep){var s=t();Os(i,s)||(a("The result of getSnapshot should be cached to avoid an infinite loop"),ep=!0)}var l=o.memoizedState,u=!Os(l,i);u&&(o.memoizedState=i,mg());var c=o.queue;if(Gp(Dp.bind(null,r,c,e),[e]),c.getSnapshot!==t||u||null!==ip&&1&ip.memoizedState.tag){r.flags|=ir,Bp(9,Cp.bind(null,r,c,i,t),void 0,null);var d=My();if(null===d)throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");ua(0,rp)||Ip(r,t,i)}return i}function Ip(e,t,n){e.flags|=ur;var r={getSnapshot:t,value:n},o=op.updateQueue;if(null===o)o={lastEffect:null,stores:null},op.updateQueue=o,o.stores=[r];else{var a=o.stores;null===a?o.stores=[r]:a.push(r)}}function Cp(e,t,n,r){t.value=n,t.getSnapshot=r,Np(t)&&Mp(e)}function Dp(e,t,n){return n(function(){Np(t)&&Mp(e)})}function Np(e){var t=e.getSnapshot,n=e.value;try{var r=t();return!Os(n,r)}catch(o){return!0}}function Mp(e){var t=df(e,So);null!==t&&By(t,e,So,ea)}function Lp(e){var t=Tp();"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e;var n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:kp,lastRenderedState:e};t.queue=n;var r=n.dispatch=yh.bind(null,op,n);return[t.memoizedState,r]}function jp(e){return Op(kp)}function Fp(e){return Ap(kp)}function Bp(e,t,n,r){var o={tag:e,create:t,destroy:n,deps:r,next:null},a=op.updateQueue;if(null===a)a={lastEffect:null,stores:null},op.updateQueue=a,a.lastEffect=o.next=o;else{var i=a.lastEffect;if(null===i)a.lastEffect=o.next=o;else{var s=i.next;i.next=o,o.next=s,a.lastEffect=o}}return o}function Up(e){var t={current:e};return Tp().memoizedState=t,t}function zp(e){return Ep().memoizedState}function Vp(e,t,n,r){var o=Tp(),a=void 0===r?null:r;op.flags|=e,o.memoizedState=Bp(1|t,n,void 0,a)}function Hp(e,t,n,r){var o=Ep(),a=void 0===r?null:r,i=void 0;if(null!==ap){var s=ap.memoizedState;if(i=s.destroy,null!==a)if(_p(a,s.deps))return void(o.memoizedState=Bp(t,n,i,a))}op.flags|=e,o.memoizedState=Bp(1|t,n,i,a)}function qp(e,t){return 0!==(op.mode&bo)?Vp(41945088,8,e,t):Vp(8390656,8,e,t)}function Gp(e,t){return Hp(ir,8,e,t)}function Wp(e,t){return Vp(4,2,e,t)}function Yp(e,t){return Hp(4,2,e,t)}function Xp(e,t){var n=4;return n|=mr,0!==(op.mode&bo)&&(n|=gr),Vp(n,4,e,t)}function Kp(e,t){return Hp(4,4,e,t)}function Qp(e,t){if("function"==typeof t){var n=t,r=e();return n(r),function(){n(null)}}if(null!=t){var o=t;o.hasOwnProperty("current")||a("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.","an object with keys {"+Object.keys(o).join(", ")+"}");var i=e();return o.current=i,function(){o.current=null}}}function Zp(e,t,n){"function"!=typeof t&&a("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",null!==t?typeof t:"null");var r=null!=n?n.concat([e]):null,o=4;return o|=mr,0!==(op.mode&bo)&&(o|=gr),Vp(o,4,Qp.bind(null,t,e),r)}function Jp(e,t,n){"function"!=typeof t&&a("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",null!==t?typeof t:"null");var r=null!=n?n.concat([e]):null;return Hp(4,4,Qp.bind(null,t,e),r)}function eh(e,t){}var th=eh;function nh(e,t){var n=void 0===t?null:t;return Tp().memoizedState=[e,n],e}function rh(e,t){var n=Ep(),r=void 0===t?null:t,o=n.memoizedState;if(null!==o&&(null!==r&&_p(r,o[1])))return o[0];return n.memoizedState=[e,r],e}function oh(e,t){var n=Tp(),r=void 0===t?null:t,o=e();return n.memoizedState=[o,r],o}function ah(e,t){var n=Ep(),r=void 0===t?null:t,o=n.memoizedState;if(null!==o&&(null!==r&&_p(r,o[1])))return o[0];var a=e();return n.memoizedState=[a,r],a}function ih(e){return Tp().memoizedState=e,e}function sh(e){return uh(Ep(),ap.memoizedState,e)}function lh(e){var t=Ep();return null===ap?(t.memoizedState=e,e):uh(t,ap.memoizedState,e)}function uh(e,t,n){if(!(0===(rp&(So|To|ko)))){if(!Os(n,t)){var r=da();op.lanes=ya(op.lanes,r),n_(r),e.baseState=!0}return t}return e.baseState&&(e.baseState=!1,mg()),e.memoizedState=n,n}function ch(e,t,n){var r,a,i=La();ja((a=Ca,0!==(r=i)&&r<a?r:a)),e(!0);var s=np.transition;np.transition={};var l=np.transition;np.transition._updatedFibers=new Set;try{e(!1),t()}finally{if(ja(i),np.transition=s,null===s&&l._updatedFibers)l._updatedFibers.size>10&&o("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),l._updatedFibers.clear()}}function dh(){var e=Lp(!1),t=e[0],n=e[1],r=ch.bind(null,n);return Tp().memoizedState=r,[t,r]}function fh(){return[jp()[0],Ep().memoizedState]}function ph(){return[Fp()[0],Ep().memoizedState]}var hh=!1;function mh(){var e,t=Tp(),n=My().identifierPrefix;if(yd()){e=":"+n+"R"+Uc();var r=up++;r>0&&(e+="H"+r.toString(32)),e+=":"}else{e=":"+n+"r"+(cp++).toString(32)+":"}return t.memoizedState=e,e}function gh(){return Ep().memoizedState}function bh(e,t,n){"function"==typeof arguments[3]&&a("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");var r=jy(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(_h(e))vh(t,o);else{var i=cf(e,t,o,r);if(null!==i)By(i,e,r,Ly()),wh(i,t,r)}Sh(e,r)}function yh(e,t,n){"function"==typeof arguments[3]&&a("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");var r=jy(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(_h(e))vh(t,o);else{var i=e.alternate;if(0===e.lanes&&(null===i||0===i.lanes)){var s=t.lastRenderedReducer;if(null!==s){var l;l=tp.current,tp.current=Ah;try{var u=t.lastRenderedState,c=s(u,n);if(o.hasEagerState=!0,o.eagerState=c,Os(c,u))return void function(e,t,n){var r=t.interleaved;null===r?(n.next=n,uf(t)):(n.next=r.next,r.next=n),t.interleaved=n}(0,t,o)}catch(f){}finally{tp.current=l}}}var d=cf(e,t,o,r);if(null!==d)By(d,e,r,Ly()),wh(d,t,r)}Sh(e,r)}function _h(e){var t=e.alternate;return e===op||null!==t&&t===op}function vh(e,t){lp=sp=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function wh(e,t,n){if(ca(n)){var r=t.lanes,o=ya(r=va(r,e.pendingLanes),n);t.lanes=o,Ta(e,o)}}function Sh(e,t,n){go(e,t)}var xh={readContext:sf,useCallback:yp,useContext:yp,useEffect:yp,useImperativeHandle:yp,useInsertionEffect:yp,useLayoutEffect:yp,useMemo:yp,useReducer:yp,useRef:yp,useState:yp,useDebugValue:yp,useDeferredValue:yp,useTransition:yp,useMutableSource:yp,useSyncExternalStore:yp,useId:yp,unstable_isNewReconciler:_},Th=null,Eh=null,kh=null,Ph=null,Oh=null,Ah=null,Rh=null,$h=function(){a("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")},Ih=function(){a("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks")};Th={readContext:function(e){return sf(e)},useCallback:function(e,t){return dp="useCallback",mp(),bp(t),nh(e,t)},useContext:function(e){return dp="useContext",mp(),sf(e)},useEffect:function(e,t){return dp="useEffect",mp(),bp(t),qp(e,t)},useImperativeHandle:function(e,t,n){return dp="useImperativeHandle",mp(),bp(n),Zp(e,t,n)},useInsertionEffect:function(e,t){return dp="useInsertionEffect",mp(),bp(t),Wp(e,t)},useLayoutEffect:function(e,t){return dp="useLayoutEffect",mp(),bp(t),Xp(e,t)},useMemo:function(e,t){dp="useMemo",mp(),bp(t);var n=tp.current;tp.current=Oh;try{return oh(e,t)}finally{tp.current=n}},useReducer:function(e,t,n){dp="useReducer",mp();var r=tp.current;tp.current=Oh;try{return Pp(e,t,n)}finally{tp.current=r}},useRef:function(e){return dp="useRef",mp(),Up(e)},useState:function(e){dp="useState",mp();var t=tp.current;tp.current=Oh;try{return Lp(e)}finally{tp.current=t}},useDebugValue:function(e,t){dp="useDebugValue",mp()},useDeferredValue:function(e){return dp="useDeferredValue",mp(),ih(e)},useTransition:function(){return dp="useTransition",mp(),dh()},useMutableSource:function(e,t,n){dp="useMutableSource",mp()},useSyncExternalStore:function(e,t,n){return dp="useSyncExternalStore",mp(),Rp(e,t,n)},useId:function(){return dp="useId",mp(),mh()},unstable_isNewReconciler:_},Eh={readContext:function(e){return sf(e)},useCallback:function(e,t){return dp="useCallback",gp(),nh(e,t)},useContext:function(e){return dp="useContext",gp(),sf(e)},useEffect:function(e,t){return dp="useEffect",gp(),qp(e,t)},useImperativeHandle:function(e,t,n){return dp="useImperativeHandle",gp(),Zp(e,t,n)},useInsertionEffect:function(e,t){return dp="useInsertionEffect",gp(),Wp(e,t)},useLayoutEffect:function(e,t){return dp="useLayoutEffect",gp(),Xp(e,t)},useMemo:function(e,t){dp="useMemo",gp();var n=tp.current;tp.current=Oh;try{return oh(e,t)}finally{tp.current=n}},useReducer:function(e,t,n){dp="useReducer",gp();var r=tp.current;tp.current=Oh;try{return Pp(e,t,n)}finally{tp.current=r}},useRef:function(e){return dp="useRef",gp(),Up(e)},useState:function(e){dp="useState",gp();var t=tp.current;tp.current=Oh;try{return Lp(e)}finally{tp.current=t}},useDebugValue:function(e,t){dp="useDebugValue",gp()},useDeferredValue:function(e){return dp="useDeferredValue",gp(),ih(e)},useTransition:function(){return dp="useTransition",gp(),dh()},useMutableSource:function(e,t,n){dp="useMutableSource",gp()},useSyncExternalStore:function(e,t,n){return dp="useSyncExternalStore",gp(),Rp(e,t,n)},useId:function(){return dp="useId",gp(),mh()},unstable_isNewReconciler:_},kh={readContext:function(e){return sf(e)},useCallback:function(e,t){return dp="useCallback",gp(),rh(e,t)},useContext:function(e){return dp="useContext",gp(),sf(e)},useEffect:function(e,t){return dp="useEffect",gp(),Gp(e,t)},useImperativeHandle:function(e,t,n){return dp="useImperativeHandle",gp(),Jp(e,t,n)},useInsertionEffect:function(e,t){return dp="useInsertionEffect",gp(),Yp(e,t)},useLayoutEffect:function(e,t){return dp="useLayoutEffect",gp(),Kp(e,t)},useMemo:function(e,t){dp="useMemo",gp();var n=tp.current;tp.current=Ah;try{return ah(e,t)}finally{tp.current=n}},useReducer:function(e,t,n){dp="useReducer",gp();var r=tp.current;tp.current=Ah;try{return Op(e)}finally{tp.current=r}},useRef:function(e){return dp="useRef",gp(),zp()},useState:function(e){dp="useState",gp();var t=tp.current;tp.current=Ah;try{return jp()}finally{tp.current=t}},useDebugValue:function(e,t){return dp="useDebugValue",gp(),th()},useDeferredValue:function(e){return dp="useDeferredValue",gp(),sh(e)},useTransition:function(){return dp="useTransition",gp(),fh()},useMutableSource:function(e,t,n){dp="useMutableSource",gp()},useSyncExternalStore:function(e,t,n){return dp="useSyncExternalStore",gp(),$p(e,t)},useId:function(){return dp="useId",gp(),gh()},unstable_isNewReconciler:_},Ph={readContext:function(e){return sf(e)},useCallback:function(e,t){return dp="useCallback",gp(),rh(e,t)},useContext:function(e){return dp="useContext",gp(),sf(e)},useEffect:function(e,t){return dp="useEffect",gp(),Gp(e,t)},useImperativeHandle:function(e,t,n){return dp="useImperativeHandle",gp(),Jp(e,t,n)},useInsertionEffect:function(e,t){return dp="useInsertionEffect",gp(),Yp(e,t)},useLayoutEffect:function(e,t){return dp="useLayoutEffect",gp(),Kp(e,t)},useMemo:function(e,t){dp="useMemo",gp();var n=tp.current;tp.current=Rh;try{return ah(e,t)}finally{tp.current=n}},useReducer:function(e,t,n){dp="useReducer",gp();var r=tp.current;tp.current=Rh;try{return Ap(e)}finally{tp.current=r}},useRef:function(e){return dp="useRef",gp(),zp()},useState:function(e){dp="useState",gp();var t=tp.current;tp.current=Rh;try{return Fp()}finally{tp.current=t}},useDebugValue:function(e,t){return dp="useDebugValue",gp(),th()},useDeferredValue:function(e){return dp="useDeferredValue",gp(),lh(e)},useTransition:function(){return dp="useTransition",gp(),ph()},useMutableSource:function(e,t,n){dp="useMutableSource",gp()},useSyncExternalStore:function(e,t,n){return dp="useSyncExternalStore",gp(),$p(e,t)},useId:function(){return dp="useId",gp(),gh()},unstable_isNewReconciler:_},Oh={readContext:function(e){return $h(),sf(e)},useCallback:function(e,t){return dp="useCallback",Ih(),mp(),nh(e,t)},useContext:function(e){return dp="useContext",Ih(),mp(),sf(e)},useEffect:function(e,t){return dp="useEffect",Ih(),mp(),qp(e,t)},useImperativeHandle:function(e,t,n){return dp="useImperativeHandle",Ih(),mp(),Zp(e,t,n)},useInsertionEffect:function(e,t){return dp="useInsertionEffect",Ih(),mp(),Wp(e,t)},useLayoutEffect:function(e,t){return dp="useLayoutEffect",Ih(),mp(),Xp(e,t)},useMemo:function(e,t){dp="useMemo",Ih(),mp();var n=tp.current;tp.current=Oh;try{return oh(e,t)}finally{tp.current=n}},useReducer:function(e,t,n){dp="useReducer",Ih(),mp();var r=tp.current;tp.current=Oh;try{return Pp(e,t,n)}finally{tp.current=r}},useRef:function(e){return dp="useRef",Ih(),mp(),Up(e)},useState:function(e){dp="useState",Ih(),mp();var t=tp.current;tp.current=Oh;try{return Lp(e)}finally{tp.current=t}},useDebugValue:function(e,t){dp="useDebugValue",Ih(),mp()},useDeferredValue:function(e){return dp="useDeferredValue",Ih(),mp(),ih(e)},useTransition:function(){return dp="useTransition",Ih(),mp(),dh()},useMutableSource:function(e,t,n){dp="useMutableSource",Ih(),mp()},useSyncExternalStore:function(e,t,n){return dp="useSyncExternalStore",Ih(),mp(),Rp(e,t,n)},useId:function(){return dp="useId",Ih(),mp(),mh()},unstable_isNewReconciler:_},Ah={readContext:function(e){return $h(),sf(e)},useCallback:function(e,t){return dp="useCallback",Ih(),gp(),rh(e,t)},useContext:function(e){return dp="useContext",Ih(),gp(),sf(e)},useEffect:function(e,t){return dp="useEffect",Ih(),gp(),Gp(e,t)},useImperativeHandle:function(e,t,n){return dp="useImperativeHandle",Ih(),gp(),Jp(e,t,n)},useInsertionEffect:function(e,t){return dp="useInsertionEffect",Ih(),gp(),Yp(e,t)},useLayoutEffect:function(e,t){return dp="useLayoutEffect",Ih(),gp(),Kp(e,t)},useMemo:function(e,t){dp="useMemo",Ih(),gp();var n=tp.current;tp.current=Ah;try{return ah(e,t)}finally{tp.current=n}},useReducer:function(e,t,n){dp="useReducer",Ih(),gp();var r=tp.current;tp.current=Ah;try{return Op(e)}finally{tp.current=r}},useRef:function(e){return dp="useRef",Ih(),gp(),zp()},useState:function(e){dp="useState",Ih(),gp();var t=tp.current;tp.current=Ah;try{return jp()}finally{tp.current=t}},useDebugValue:function(e,t){return dp="useDebugValue",Ih(),gp(),th()},useDeferredValue:function(e){return dp="useDeferredValue",Ih(),gp(),sh(e)},useTransition:function(){return dp="useTransition",Ih(),gp(),fh()},useMutableSource:function(e,t,n){dp="useMutableSource",Ih(),gp()},useSyncExternalStore:function(e,t,n){return dp="useSyncExternalStore",Ih(),gp(),$p(e,t)},useId:function(){return dp="useId",Ih(),gp(),gh()},unstable_isNewReconciler:_},Rh={readContext:function(e){return $h(),sf(e)},useCallback:function(e,t){return dp="useCallback",Ih(),gp(),rh(e,t)},useContext:function(e){return dp="useContext",Ih(),gp(),sf(e)},useEffect:function(e,t){return dp="useEffect",Ih(),gp(),Gp(e,t)},useImperativeHandle:function(e,t,n){return dp="useImperativeHandle",Ih(),gp(),Jp(e,t,n)},useInsertionEffect:function(e,t){return dp="useInsertionEffect",Ih(),gp(),Yp(e,t)},useLayoutEffect:function(e,t){return dp="useLayoutEffect",Ih(),gp(),Kp(e,t)},useMemo:function(e,t){dp="useMemo",Ih(),gp();var n=tp.current;tp.current=Ah;try{return ah(e,t)}finally{tp.current=n}},useReducer:function(e,t,n){dp="useReducer",Ih(),gp();var r=tp.current;tp.current=Ah;try{return Ap(e)}finally{tp.current=r}},useRef:function(e){return dp="useRef",Ih(),gp(),zp()},useState:function(e){dp="useState",Ih(),gp();var t=tp.current;tp.current=Ah;try{return Fp()}finally{tp.current=t}},useDebugValue:function(e,t){return dp="useDebugValue",Ih(),gp(),th()},useDeferredValue:function(e){return dp="useDeferredValue",Ih(),gp(),lh(e)},useTransition:function(){return dp="useTransition",Ih(),gp(),ph()},useMutableSource:function(e,t,n){dp="useMutableSource",Ih(),gp()},useSyncExternalStore:function(e,t,n){return dp="useSyncExternalStore",Ih(),gp(),$p(e,t)},useId:function(){return dp="useId",Ih(),gp(),gh()},unstable_isNewReconciler:_};var Ch=t.unstable_now,Dh=0,Nh=-1,Mh=-1,Lh=-1,jh=!1,Fh=!1;function Bh(){return jh}function Uh(){return Dh}function zh(){Dh=Ch()}function Vh(e){Mh=Ch(),e.actualStartTime<0&&(e.actualStartTime=Ch())}function Hh(e){Mh=-1}function qh(e,t){if(Mh>=0){var n=Ch()-Mh;e.actualDuration+=n,t&&(e.selfBaseDuration=n),Mh=-1}}function Gh(e){if(Nh>=0){var t=Ch()-Nh;Nh=-1;for(var n=e.return;null!==n;){switch(n.tag){case 3:return void(n.stateNode.effectDuration+=t);case u:return void(n.stateNode.effectDuration+=t)}n=n.return}}}function Wh(e){if(Lh>=0){var t=Ch()-Lh;Lh=-1;for(var n=e.return;null!==n;){switch(n.tag){case 3:var r=n.stateNode;return void(null!==r&&(r.passiveEffectDuration+=t));case u:var o=n.stateNode;return void(null!==o&&(o.passiveEffectDuration+=t))}n=n.return}}}function Yh(){Nh=Ch()}function Xh(){Lh=Ch()}function Kh(e){for(var t=e.child;t;)e.actualDuration+=t.actualDuration,t=t.sibling}function Qh(e,t){if(e&&e.defaultProps){var n=we({},t),r=e.defaultProps;for(var o in r)void 0===n[o]&&(n[o]=r[o]);return n}return t}var Zh,Jh,em,tm,nm,rm,om,am,im,sm,lm,um={};Zh=new Set,Jh=new Set,em=new Set,tm=new Set,am=new Set,nm=new Set,im=new Set,sm=new Set,lm=new Set;var cm=new Set;function dm(e,t,n,r){var o=e.memoizedState,a=n(r,o);if(8&e.mode){Qr(!0);try{a=n(r,o)}finally{Qr(!1)}}rm(t,a);var i=null==a?o:we({},o,a);(e.memoizedState=i,0===e.lanes)&&(e.updateQueue.baseState=i)}om=function(e,t){if(null!==e&&"function"!=typeof e){var n=t+"_"+e;cm.has(n)||(cm.add(n),a("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",t,e))}},rm=function(e,t){if(void 0===t){var n=Me(e)||"Component";nm.has(n)||(nm.add(n),a("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.",n))}},Object.defineProperty(um,"_processChildContext",{enumerable:!1,value:function(){throw new Error("_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).")}}),Object.freeze(um);var fm={isMounted:function(e){var t=xr.current;if(null!==t&&1===t.tag){var n=t,r=n.stateNode;r._warnedAboutRefsInRender||a("%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",je(n)||"A component"),r._warnedAboutRefsInRender=!0}var o=er(e);return!!o&&Tr(o)===o},enqueueSetState:function(e,t,n){var r=er(e),o=Ly(),a=jy(r),i=wf(o,a);i.payload=t,null!=n&&(om(n,"setState"),i.callback=n);var s=Sf(r,i,a);null!==s&&(By(s,r,a,o),xf(s,r,a)),go(r,a)},enqueueReplaceState:function(e,t,n){var r=er(e),o=Ly(),a=jy(r),i=wf(o,a);i.tag=1,i.payload=t,null!=n&&(om(n,"replaceState"),i.callback=n);var s=Sf(r,i,a);null!==s&&(By(s,r,a,o),xf(s,r,a)),go(r,a)},enqueueForceUpdate:function(e,t){var n=er(e),r=Ly(),o=jy(n),a=wf(r,o);a.tag=bf,null!=t&&(om(t,"forceUpdate"),a.callback=t);var i=Sf(n,a,o);null!==i&&(By(i,n,o,r),xf(i,n,o)),function(e,t){null!==Yr&&"function"==typeof Yr.markForceUpdateScheduled&&Yr.markForceUpdateScheduled(e,t)}(n,o)}};function pm(e,t,n,r,o,i,s){var l=e.stateNode;if("function"==typeof l.shouldComponentUpdate){var u=l.shouldComponentUpdate(r,i,s);if(8&e.mode){Qr(!0);try{u=l.shouldComponentUpdate(r,i,s)}finally{Qr(!1)}}return void 0===u&&a("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",Me(t)||"Component"),u}return!t.prototype||!t.prototype.isPureReactComponent||(!As(n,r)||!As(o,i))}function hm(e,t){var n;t.updater=fm,e.stateNode=t,n=e,t._reactInternals=n,t._reactInternalInstance=um}function mm(e,t,n){var r=!1,o=cc,i=cc,s=t.contextType;if("contextType"in t&&(!(null===s||void 0!==s&&s.$$typeof===ae&&void 0===s._context)&&!sm.has(t))){sm.add(t);var l="";l=void 0===s?" However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.":"object"!=typeof s?" However, it is set to a "+typeof s+".":s.$$typeof===oe?" Did you accidentally pass the Context.Provider instead?":void 0!==s._context?" Did you accidentally pass the Context.Consumer instead?":" However, it is set to an object with keys {"+Object.keys(s).join(", ")+"}.",a("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s",Me(t)||"Component",l)}if("object"==typeof s&&null!==s)i=sf(s);else{o=hc(0,t,!0);var u=t.contextTypes;i=(r=null!=u)?gc(e,o):cc}var c=new t(n,i);if(8&e.mode){Qr(!0);try{c=new t(n,i)}finally{Qr(!1)}}var d=e.memoizedState=null!==c.state&&void 0!==c.state?c.state:null;if(hm(e,c),"function"==typeof t.getDerivedStateFromProps&&null===d){var f=Me(t)||"Component";Jh.has(f)||(Jh.add(f),a("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.",f,null===c.state?"null":"undefined",f))}if("function"==typeof t.getDerivedStateFromProps||"function"==typeof c.getSnapshotBeforeUpdate){var p=null,h=null,m=null;if("function"==typeof c.componentWillMount&&!0!==c.componentWillMount.__suppressDeprecationWarning?p="componentWillMount":"function"==typeof c.UNSAFE_componentWillMount&&(p="UNSAFE_componentWillMount"),"function"==typeof c.componentWillReceiveProps&&!0!==c.componentWillReceiveProps.__suppressDeprecationWarning?h="componentWillReceiveProps":"function"==typeof c.UNSAFE_componentWillReceiveProps&&(h="UNSAFE_componentWillReceiveProps"),"function"==typeof c.componentWillUpdate&&!0!==c.componentWillUpdate.__suppressDeprecationWarning?m="componentWillUpdate":"function"==typeof c.UNSAFE_componentWillUpdate&&(m="UNSAFE_componentWillUpdate"),null!==p||null!==h||null!==m){var g=Me(t)||"Component",b="function"==typeof t.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";tm.has(g)||(tm.add(g),a("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://reactjs.org/link/unsafe-component-lifecycles",g,b,null!==p?"\n "+p:"",null!==h?"\n "+h:"",null!==m?"\n "+m:""))}}return r&&mc(e,o,i),c}function gm(e,t,n,r){var o=t.state;if("function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==o){var i=je(e)||"Component";Zh.has(i)||(Zh.add(i),a("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",i)),fm.enqueueReplaceState(t,t.state,null)}}function bm(e,t,n,r){!function(e,t,n){var r=e.stateNode,o=Me(t)||"Component";r.render||(t.prototype&&"function"==typeof t.prototype.render?a("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?",o):a("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.",o)),!r.getInitialState||r.getInitialState.isReactClassApproved||r.state||a("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",o),r.getDefaultProps&&!r.getDefaultProps.isReactClassApproved&&a("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",o),r.propTypes&&a("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.",o),r.contextType&&a("contextType was defined as an instance property on %s. Use a static property to define contextType instead.",o),!t.childContextTypes||lm.has(t)||8&e.mode||(lm.add(t),a("%s uses the legacy childContextTypes API which is no longer supported and will be removed in the next major release. Use React.createContext() instead\n\n.Learn more about this warning here: https://reactjs.org/link/legacy-context",o)),!t.contextTypes||lm.has(t)||8&e.mode||(lm.add(t),a("%s uses the legacy contextTypes API which is no longer supported and will be removed in the next major release. Use React.createContext() with static contextType instead.\n\nLearn more about this warning here: https://reactjs.org/link/legacy-context",o)),r.contextTypes&&a("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.",o),t.contextType&&t.contextTypes&&!im.has(t)&&(im.add(t),a("%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.",o)),"function"==typeof r.componentShouldUpdate&&a("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",o),t.prototype&&t.prototype.isPureReactComponent&&void 0!==r.shouldComponentUpdate&&a("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.",Me(t)||"A pure component"),"function"==typeof r.componentDidUnmount&&a("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",o),"function"==typeof r.componentDidReceiveProps&&a("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().",o),"function"==typeof r.componentWillRecieveProps&&a("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",o),"function"==typeof r.UNSAFE_componentWillRecieveProps&&a("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",o);var i=r.props!==n;void 0!==r.props&&i&&a("%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",o,o),r.defaultProps&&a("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.",o,o),"function"!=typeof r.getSnapshotBeforeUpdate||"function"==typeof r.componentDidUpdate||em.has(t)||(em.add(t),a("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.",Me(t))),"function"==typeof r.getDerivedStateFromProps&&a("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.",o),"function"==typeof r.getDerivedStateFromError&&a("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.",o),"function"==typeof t.getSnapshotBeforeUpdate&&a("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.",o);var s=r.state;s&&("object"!=typeof s||vt(s))&&a("%s.state: must be set to an object or null",o),"function"==typeof r.getChildContext&&"object"!=typeof t.childContextTypes&&a("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",o)}(e,t,n);var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},_f(e);var i=t.contextType;if("object"==typeof i&&null!==i)o.context=sf(i);else{var s=hc(0,t,!0);o.context=gc(e,s)}if(o.state===n){var l=Me(t)||"Component";am.has(l)||(am.add(l),a("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.",l))}8&e.mode&&wd.recordLegacyContextWarning(e,o),wd.recordUnsafeLifecycleWarnings(e,o),o.state=e.memoizedState;var u=t.getDerivedStateFromProps;if("function"==typeof u&&(dm(e,t,u,n),o.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(!function(e,t){var n=t.state;"function"==typeof t.componentWillMount&&t.componentWillMount(),"function"==typeof t.UNSAFE_componentWillMount&&t.UNSAFE_componentWillMount(),n!==t.state&&(a("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",je(e)||"Component"),fm.enqueueReplaceState(t,t.state,null))}(e,o),kf(e,n,o,r),o.state=e.memoizedState),"function"==typeof o.componentDidMount){var c=4;c|=mr,0!==(e.mode&bo)&&(c|=gr),e.flags|=c}}function ym(e,t){return{value:e,source:t,stack:De(t),digest:null}}function _m(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function vm(e,t){try{0;var n=t.value,r=t.source,o=t.stack,a=null!==o?o:"";if(null!=n&&n._suppressLogging){if(1===e.tag)return;console.error(n)}var i=r?je(r):null,s=(i?"The above error occurred in the <"+i+"> component:":"The above error occurred in one of your React components:")+"\n"+a+"\n\n"+(3===e.tag?"Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://reactjs.org/link/error-boundaries to learn more about error boundaries.":"React will try to recreate this component tree from scratch using the error boundary you provided, "+(je(e)||"Anonymous")+".");console.error(s)}catch(rw){setTimeout(function(){throw rw})}}var wm="function"==typeof WeakMap?WeakMap:Map;function Sm(e,t,n){var r=wf(ea,n);r.tag=3,r.payload={element:null};var o=t.value;return r.callback=function(){f_(o),vm(e,t)},r}function xm(e,t,n){var r=wf(ea,n);r.tag=3;var o=e.type.getDerivedStateFromError;if("function"==typeof o){var i=t.value;r.payload=function(){return o(i)},r.callback=function(){F_(e),vm(e,t)}}var s=e.stateNode;return null!==s&&"function"==typeof s.componentDidCatch&&(r.callback=function(){var n;F_(e),vm(e,t),"function"!=typeof o&&(n=this,null===_y?_y=new Set([n]):_y.add(n));var r=t.value,i=t.stack;this.componentDidCatch(r,{componentStack:null!==i?i:""}),"function"!=typeof o&&(ga(e.lanes,So)||a("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.",je(e)||"Unknown"))}),r}function Tm(e,t,n){var r,o=e.pingCache;if(null===o?(o=e.pingCache=new wm,r=new Set,o.set(t,r)):void 0===(r=o.get(t))&&(r=new Set,o.set(t,r)),!r.has(n)){r.add(n);var a=m_.bind(null,e,t,n);Kr&&k_(e,n),t.then(a,a)}}function Em(e){var t=e;do{if(t.tag===c&&Yf(t))return t;t=t.return}while(null!==t);return null}function km(e,t,n,r,o){if(!(1&e.mode)){if(e===t)e.flags|=dr;else{if(e.flags|=nr,n.flags|=fr,n.flags&=-52805,1===n.tag)if(null===n.alternate)n.tag=p;else{var a=wf(ea,So);a.tag=bf,Sf(n,a,So)}n.lanes=ya(n.lanes,So)}return e}return e.flags|=dr,e.lanes=o,e}function Pm(e,t,n,r,o){if(n.flags|=cr,Kr&&k_(e,o),null!==r&&"object"==typeof r&&"function"==typeof r.then){var a=r;!function(e){var t=e.tag;if(!(1&e.mode||0!==t&&t!==l&&t!==f)){var n=e.alternate;n?(e.updateQueue=n.updateQueue,e.memoizedState=n.memoizedState,e.lanes=n.lanes):(e.updateQueue=null,e.memoizedState=null)}}(n),yd()&&1&n.mode&&Jc();var i=Em(t);if(null!==i)return i.flags&=-257,km(i,t,n,0,o),1&i.mode&&Tm(e,a,o),void function(e,t,n){var r=e.updateQueue;if(null===r){var o=new Set;o.add(n),e.updateQueue=o}else r.add(n)}(i,0,a);if(0===(o&So))return Tm(e,a,o),void r_();r=new Error("A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition.")}else if(yd()&&1&n.mode){Jc();var s=Em(t);if(null!==s)return 0===(s.flags&dr)&&(s.flags|=rr),km(s,t,n,0,o),void _d(ym(r,n))}!function(e){ry!==Yb&&(ry=Gb);null===ly?ly=[e]:ly.push(e)}(r=ym(r,n));var u=t;do{switch(u.tag){case 3:var c=r;u.flags|=dr;var d=pa(o);return u.lanes=ya(u.lanes,d),void Tf(u,Sm(u,c,d));case 1:var p=r,h=u.type,m=u.stateNode;if(0===(u.flags&nr)&&("function"==typeof h.getDerivedStateFromError||null!==m&&"function"==typeof m.componentDidCatch&&!d_(m))){u.flags|=dr;var g=pa(o);return u.lanes=ya(u.lanes,g),void Tf(u,xm(u,p,g))}}u=u.return}while(null!==u)}var Om,Am,Rm,$m,Im,Cm,Dm,Nm,Mm,Lm=n.ReactCurrentOwner,jm=!1;function Fm(e,t,n,r){t.child=null===e?Hd(t,null,n,r):Vd(t,e.child,n,r)}function Bm(e,t,n,r,o){if(t.type!==t.elementType){var a=n.propTypes;a&&nc(a,r,"prop",Me(n))}var i,s,l=n.render,u=t.ref;if(af(t,o),to(t),Lm.current=t,Ge(!0),i=vp(e,t,l,r,u,o),s=wp(),8&t.mode){Qr(!0);try{i=vp(e,t,l,r,u,o),s=wp()}finally{Qr(!1)}}return Ge(!1),no(),null===e||jm?(yd()&&s&&Hc(t),t.flags|=1,Fm(e,t,i,o),t.child):(Sp(e,t,o),bg(e,t,o))}function Um(e,t,n,r,o){if(null===e){var i=n.type;if(function(e){return"function"==typeof e&&!Y_(e)&&void 0===e.defaultProps}(i)&&null===n.compare&&void 0===n.defaultProps){var s;return s=N_(i),t.tag=f,t.type=s,Qm(t,i),zm(e,t,s,r,o)}var l=i.propTypes;if(l&&nc(l,r,"prop",Me(i)),void 0!==n.defaultProps){var u=Me(i)||"Unknown";Mm[u]||(a("%s: Support for defaultProps will be removed from memo components in a future major release. Use JavaScript default parameters instead.",u),Mm[u]=!0)}var c=Q_(n.type,null,r,t,t.mode,o);return c.ref=t.ref,c.return=t,t.child=c,c}var d=n.type,p=d.propTypes;p&&nc(p,r,"prop",Me(d));var h=e.child;if(!yg(e,o)){var m=h.memoizedProps,g=n.compare;if((g=null!==g?g:As)(m,r)&&e.ref===t.ref)return bg(e,t,o)}t.flags|=1;var b=X_(h,r);return b.ref=t.ref,b.return=t,t.child=b,b}function zm(e,t,n,r,o){if(t.type!==t.elementType){var a=t.elementType;if(a.$$typeof===ce){var i=a,s=i._payload,l=i._init;try{a=l(s)}catch(d){a=null}var u=a&&a.propTypes;u&&nc(u,r,"prop",Me(a))}}if(null!==e){var c=e.memoizedProps;if(As(c,r)&&e.ref===t.ref&&t.type===e.type){if(jm=!1,t.pendingProps=r=c,!yg(e,o))return t.lanes=e.lanes,bg(e,t,o);0!==(e.flags&fr)&&(jm=!0)}}return qm(e,t,n,r,o)}function Vm(e,t,n){var r,o=t.pendingProps,a=o.children,i=null!==e?e.memoizedState:null;if("hidden"===o.mode)if(1&t.mode){if(!ga(n,Zo)){var s;if(null!==i)s=ya(i.baseLanes,n);else s=n;t.lanes=t.childLanes=Zo;var l={baseLanes:s,cachePool:null,transitions:null};return t.memoizedState=l,t.updateQueue=null,Ky(t,s),null}var u={baseLanes:0,cachePool:null,transitions:null};t.memoizedState=u,Ky(t,null!==i?i.baseLanes:n)}else{var c={baseLanes:0,cachePool:null,transitions:null};t.memoizedState=c,Ky(t,n)}else null!==i?(r=ya(i.baseLanes,n),t.memoizedState=null):r=n,Ky(t,r);return Fm(e,t,a,n),t.child}function Hm(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=or,t.flags|=hr)}function qm(e,t,n,r,o){if(t.type!==t.elementType){var a=n.propTypes;a&&nc(a,r,"prop",Me(n))}var i,s,l;if(i=gc(t,hc(0,n,!0)),af(t,o),to(t),Lm.current=t,Ge(!0),s=vp(e,t,n,r,i,o),l=wp(),8&t.mode){Qr(!0);try{s=vp(e,t,n,r,i,o),l=wp()}finally{Qr(!1)}}return Ge(!1),no(),null===e||jm?(yd()&&l&&Hc(t),t.flags|=1,Fm(e,t,s,o),t.child):(Sp(e,t,o),bg(e,t,o))}function Gm(e,t,n,r,o){switch(yv(t)){case!1:var i=t.stateNode,s=new(0,t.type)(t.memoizedProps,i.context).state;i.updater.enqueueSetState(i,s,null);break;case!0:t.flags|=nr,t.flags|=dr;var l=new Error("Simulated error coming from DevTools"),u=pa(o);t.lanes=ya(t.lanes,u),Tf(t,xm(t,ym(l,t),u))}if(t.type!==t.elementType){var c=n.propTypes;c&&nc(c,r,"prop",Me(n))}var d,f;yc(n)?(d=!0,xc(t)):d=!1,af(t,o),null===t.stateNode?(gg(e,t),mm(t,n,r),bm(t,n,r,o),f=!0):f=null===e?function(e,t,n,r){var o=e.stateNode,a=e.memoizedProps;o.props=a;var i=o.context,s=t.contextType,l=cc;l="object"==typeof s&&null!==s?sf(s):gc(e,hc(0,t,!0));var u=t.getDerivedStateFromProps,c="function"==typeof u||"function"==typeof o.getSnapshotBeforeUpdate;c||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||a===n&&i===l||gm(e,o,n,l),Of();var d=e.memoizedState,f=o.state=d;if(kf(e,n,o,r),f=e.memoizedState,a===n&&d===f&&!bc()&&!Af()){if("function"==typeof o.componentDidMount){var p=4;p|=mr,0!==(e.mode&bo)&&(p|=gr),e.flags|=p}return!1}"function"==typeof u&&(dm(e,t,u,n),f=e.memoizedState);var h=Af()||pm(e,t,a,n,d,f,l);if(h){if(c||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||("function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"==typeof o.componentDidMount){var m=4;m|=mr,0!==(e.mode&bo)&&(m|=gr),e.flags|=m}}else{if("function"==typeof o.componentDidMount){var g=4;g|=mr,0!==(e.mode&bo)&&(g|=gr),e.flags|=g}e.memoizedProps=n,e.memoizedState=f}return o.props=n,o.state=f,o.context=l,h}(t,n,r,o):function(e,t,n,r,o){var a=t.stateNode;vf(e,t);var i=t.memoizedProps,s=t.type===t.elementType?i:Qh(t.type,i);a.props=s;var l=t.pendingProps,u=a.context,c=n.contextType,d=cc;d="object"==typeof c&&null!==c?sf(c):gc(t,hc(0,n,!0));var f=n.getDerivedStateFromProps,p="function"==typeof f||"function"==typeof a.getSnapshotBeforeUpdate;p||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||i===l&&u===d||gm(t,a,r,d),Of();var h=t.memoizedState,m=a.state=h;if(kf(t,r,a,o),m=t.memoizedState,i===l&&h===m&&!bc()&&!Af())return"function"==typeof a.componentDidUpdate&&(i===e.memoizedProps&&h===e.memoizedState||(t.flags|=4)),"function"==typeof a.getSnapshotBeforeUpdate&&(i===e.memoizedProps&&h===e.memoizedState||(t.flags|=ar)),!1;"function"==typeof f&&(dm(t,n,f,r),m=t.memoizedState);var g=Af()||pm(t,n,s,r,h,m,d)||v;return g?(p||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,m,d),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,m,d)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=ar)):("function"==typeof a.componentDidUpdate&&(i===e.memoizedProps&&h===e.memoizedState||(t.flags|=4)),"function"==typeof a.getSnapshotBeforeUpdate&&(i===e.memoizedProps&&h===e.memoizedState||(t.flags|=ar)),t.memoizedProps=r,t.memoizedState=m),a.props=r,a.state=m,a.context=d,g}(e,t,n,r,o);var p=Wm(e,t,n,f,d,o),h=t.stateNode;return f&&h.props!==r&&(Cm||a("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",je(t)||"a component"),Cm=!0),p}function Wm(e,t,n,r,o,a){Hm(e,t);var i=0!==(t.flags&nr);if(!r&&!i)return o&&Tc(t,n,!1),bg(e,t,a);var s,l=t.stateNode;if(Lm.current=t,i&&"function"!=typeof n.getDerivedStateFromError)s=null,Hh();else{if(to(t),Ge(!0),s=l.render(),8&t.mode){Qr(!0);try{l.render()}finally{Qr(!1)}}Ge(!1),no()}return t.flags|=1,null!==e&&i?function(e,t,n,r){t.child=Vd(t,e.child,null,r),t.child=Vd(t,null,n,r)}(e,t,s,a):Fm(e,t,s,a),t.memoizedState=l.state,o&&Tc(t,n,!0),t.child}function Ym(e){var t=e.stateNode;t.pendingContext?wc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&wc(e,t.context,!1),Lf(e,t.containerInfo)}function Xm(e,t,n,r,o){return gd(),_d(o),t.flags|=rr,Fm(e,t,n,r),t.child}function Km(e,t,n,r){gg(e,t);var o=t.pendingProps,a=n,i=a._payload,s=(0,a._init)(i);t.type=s;var u=t.tag=function(e){if("function"==typeof e)return Y_(e)?1:0;if(null!=e){var t=e.$$typeof;if(t===ie)return l;if(t===ue)return d}return 2}(s),c=Qh(s,o);switch(u){case 0:return Qm(t,s),t.type=s=N_(s),qm(null,t,s,c,r);case 1:return t.type=s=M_(s),Gm(null,t,s,c,r);case l:return t.type=s=L_(s),Bm(null,t,s,c,r);case d:if(t.type!==t.elementType){var f=s.propTypes;f&&nc(f,c,"prop",Me(s))}return Um(null,t,s,Qh(s.type,c),r)}var p="";throw null!==s&&"object"==typeof s&&s.$$typeof===ce&&(p=" Did you wrap a component in React.lazy() more than once?"),new Error("Element type is invalid. Received a promise that resolves to: "+s+". Lazy element type must resolve to a class or function."+p)}function Qm(e,t){if(t&&t.childContextTypes&&a("%s(...): childContextTypes cannot be defined on a function component.",t.displayName||t.name||"Component"),null!==e.ref){var n="",r=ze();r&&(n+="\n\nCheck the render method of `"+r+"`.");var o=r||"",i=e._debugSource;i&&(o=i.fileName+":"+i.lineNumber),Im[o]||(Im[o]=!0,a("Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s",n))}if(void 0!==t.defaultProps){var s=Me(t)||"Unknown";Mm[s]||(a("%s: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.",s),Mm[s]=!0)}if("function"==typeof t.getDerivedStateFromProps){var l=Me(t)||"Unknown";$m[l]||(a("%s: Function components do not support getDerivedStateFromProps.",l),$m[l]=!0)}if("object"==typeof t.contextType&&null!==t.contextType){var u=Me(t)||"Unknown";Rm[u]||(a("%s: Function components do not support contextType.",u),Rm[u]=!0)}}Om={},Am={},Rm={},$m={},Im={},Cm=!1,Dm={},Nm={},Mm={};var Zm={dehydrated:null,treeContext:null,retryLane:0};function Jm(e){return{baseLanes:e,cachePool:null,transitions:null}}function eg(e,t,n){var r=t.pendingProps;_v(t)&&(t.flags|=nr);var o=zf.current,i=!1,s=0!==(t.flags&nr);if(s||function(e,t){return(null===t||null!==t.memoizedState)&&Vf(e,2)}(o,e)?(i=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(o=o|1),Gf(t,o=Hf(o)),null===e){ud(t);var l=t.memoizedState;if(null!==l){var u=l.dehydrated;if(null!==u)return function(e,t){1&e.mode?Iu(t)?e.lanes=Eo:e.lanes=Zo:(a("Cannot hydrate Suspense in legacy mode. Switch from ReactDOM.hydrate(element, container) to ReactDOMClient.hydrateRoot(container, <App />).render(element) or remove the Suspense components from the server rendered components."),e.lanes=So);return null}(t,u)}var c=r.children,d=r.fallback;if(i){var f=function(e,t,n,r){var o,a,i=e.mode,s=e.child,l={mode:"hidden",children:t};1&i||null===s?(o=ng(l,i),a=J_(n,i,r,null)):((o=s).childLanes=0,o.pendingProps=l,2&e.mode&&(o.actualDuration=0,o.actualStartTime=-1,o.selfBaseDuration=0,o.treeBaseDuration=0),a=J_(n,i,r,null));return o.return=e,a.return=e,o.sibling=a,e.child=o,a}(t,c,d,n);return t.child.memoizedState=Jm(n),t.memoizedState=Zm,f}return tg(t,c)}var p=e.memoizedState;if(null!==p){var h=p.dehydrated;if(null!==h)return function(e,t,n,r,o,i,s){if(n){if(t.flags&rr)return t.flags&=-257,og(e,t,s,_m(new Error("There was an error while hydrating this Suspense boundary. Switched to client rendering.")));if(null!==t.memoizedState)return t.child=e.child,t.flags|=nr,null;var l=function(e,t,n,r,o){var a=t.mode,i={mode:"visible",children:n},s=ng(i,a),l=J_(r,a,o,null);l.flags|=2,s.return=t,l.return=t,s.sibling=l,t.child=s,!(1&t.mode)||Vd(t,e.child,null,o);return l}(e,t,r.children,r.fallback,s);return t.child.memoizedState=Jm(s),t.memoizedState=Zm,l}if(Kc&&a("We should not be hydrating here. This is a bug in React. Please file a bug."),!(1&t.mode))return og(e,t,s,null);if(Iu(o)){var u,c,d,f=function(e){var t,n,r,o=e.nextSibling&&e.nextSibling.dataset;return o&&(t=o.dgst,n=o.msg,r=o.stck),{message:n,digest:t,stack:r}}(o);return u=f.digest,c=f.message,d=f.stack,og(e,t,s,_m(c?new Error(c):new Error("The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering."),u,d))}var p=ga(s,e.childLanes);if(jm||p){var h=My();if(null!==h){var m=function(e,t){var n;switch(fa(t)){case To:n=xo;break;case ko:n=Eo;break;case 64:case 128:case 256:case 512:case Ao:case Ro:case $o:case Io:case Co:case Do:case No:case Mo:case Lo:case jo:case Fo:case Bo:case zo:case Vo:case Ho:case qo:case Go:n=Po;break;case Qo:n=Ko;break;default:n=0}return 0!==(n&(e.suspendedLanes|t))?0:n}(h,s);if(0!==m&&m!==i.retryLane){i.retryLane=m;var g=ea;df(e,m),By(h,e,m,g)}}return r_(),og(e,t,s,_m(new Error("This Suspense boundary received an update before it finished hydrating. This caused the boundary to switch to client rendering. The usual way to fix this is to wrap the original update in startTransition.")))}if($u(o)){t.flags|=nr,t.child=e.child;var b=b_.bind(null,e);return _=b,o._reactRetry=_,null}td(t,o,i.treeContext);var y=tg(t,r.children);return y.flags|=sr,y;var _}(e,t,s,r,h,p,n)}if(i){var m=r.fallback,g=function(e,t,n,r,o){var a,i,s=t.mode,l=e.child,u=l.sibling,c={mode:"hidden",children:n};if(1&s||t.child===l)(a=rg(l,c)).subtreeFlags=l.subtreeFlags&Sr;else{(a=t.child).childLanes=0,a.pendingProps=c,2&t.mode&&(a.actualDuration=0,a.actualStartTime=-1,a.selfBaseDuration=l.selfBaseDuration,a.treeBaseDuration=l.treeBaseDuration),t.deletions=null}null!==u?i=X_(u,r):(i=J_(r,s,o,null)).flags|=2;return i.return=t,a.return=t,a.sibling=i,t.child=a,i}(e,t,r.children,m,n),b=t.child,y=e.child.memoizedState;return b.memoizedState=null===y?Jm(n):function(e,t){return{baseLanes:ya(e.baseLanes,t),cachePool:null,transitions:e.transitions}}(y,n),b.childLanes=function(e,t){return _a(e.childLanes,t)}(e,n),t.memoizedState=Zm,g}var _=function(e,t,n,r){var o=e.child,a=o.sibling,i=rg(o,{mode:"visible",children:n});1&t.mode||(i.lanes=r);if(i.return=t,i.sibling=null,null!==a){var s=t.deletions;null===s?(t.deletions=[a],t.flags|=tr):s.push(a)}return t.child=i,i}(e,t,r.children,n);return t.memoizedState=null,_}function tg(e,t,n){var r=ng({mode:"visible",children:t},e.mode);return r.return=e,e.child=r,r}function ng(e,t,n){return ev(e,t,0,null)}function rg(e,t){return X_(e,t)}function og(e,t,n,r){null!==r&&_d(r),Vd(t,e.child,null,n);var o=tg(t,t.pendingProps.children);return o.flags|=2,t.memoizedState=null,o}function ag(e,t,n){e.lanes=ya(e.lanes,t);var r=e.alternate;null!==r&&(r.lanes=ya(r.lanes,t)),rf(e.return,t,n)}function ig(e,t){var n=vt(e),r=!n&&"function"==typeof pe(e);if(n||r){var o=n?"array":"iterable";return a("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>",o,t,o),!1}return!0}function sg(e,t,n,r,o){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=o)}function lg(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail,s=r.children;!function(e){if(void 0!==e&&"forwards"!==e&&"backwards"!==e&&"together"!==e&&!Dm[e])if(Dm[e]=!0,"string"==typeof e)switch(e.toLowerCase()){case"together":case"forwards":case"backwards":a('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.',e,e.toLowerCase());break;case"forward":case"backward":a('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.',e,e.toLowerCase());break;default:a('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',e)}else a('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',e)}(o),function(e,t){void 0===e||Nm[e]||("collapsed"!==e&&"hidden"!==e?(Nm[e]=!0,a('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?',e)):"forwards"!==t&&"backwards"!==t&&(Nm[e]=!0,a('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?',e)))}(i,o),function(e,t){if(("forwards"===t||"backwards"===t)&&null!=e&&!1!==e)if(vt(e)){for(var n=0;n<e.length;n++)if(!ig(e[n],n))return}else{var r=pe(e);if("function"==typeof r){var o=r.call(e);if(o)for(var i=o.next(),s=0;!i.done;i=o.next()){if(!ig(i.value,s))return;s++}}else a('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?',t)}}(s,o),Fm(e,t,s,n);var l=zf.current;Vf(l,2)?(l=qf(l,2),t.flags|=nr):(null!==e&&0!==(e.flags&nr)&&function(e,t,n){for(var r=t;null!==r;){if(r.tag===c)null!==r.memoizedState&&ag(r,n,e);else if(r.tag===m)ag(r,n,e);else if(null!==r.child){r.child.return=r,r=r.child;continue}if(r===e)return;for(;null===r.sibling;){if(null===r.return||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}}(t,t.child,n),l=Hf(l));if(Gf(t,l),1&t.mode)switch(o){case"forwards":var u,d=function(e){for(var t=e,n=null;null!==t;){var r=t.alternate;null!==r&&null===Xf(r)&&(n=t),t=t.sibling}return n}(t.child);null===d?(u=t.child,t.child=null):(u=d.sibling,d.sibling=null),sg(t,!1,u,d,i);break;case"backwards":var f=null,p=t.child;for(t.child=null;null!==p;){var h=p.alternate;if(null!==h&&null===Xf(h)){t.child=p;break}var g=p.sibling;p.sibling=f,f=p,p=g}sg(t,!0,f,null,i);break;case"together":sg(t,!1,null,null,void 0);break;default:t.memoizedState=null}else t.memoizedState=null;return t.child}var ug=!1;var cg,dg,fg,pg,hg=!1;function mg(){jm=!0}function gg(e,t){1&t.mode||null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function bg(e,t,n){return null!==e&&(t.dependencies=e.dependencies),Hh(),n_(t.lanes),ga(n,t.childLanes)?(function(e,t){if(null!==e&&t.child!==e.child)throw new Error("Resuming work not yet implemented.");if(null!==t.child){var n=t.child,r=X_(n,n.pendingProps);for(t.child=r,r.return=t;null!==n.sibling;)n=n.sibling,(r=r.sibling=X_(n,n.pendingProps)).return=t;r.sibling=null}}(e,t),t.child):null}function yg(e,t){return!!ga(e.lanes,t)}function _g(e,t,n){if(t._debugNeedsRemount&&null!==e)return function(e,t,n){var r=t.return;if(null===r)throw new Error("Cannot swap the root fiber.");if(e.alternate=null,t.alternate=null,n.index=t.index,n.sibling=t.sibling,n.return=t.return,n.ref=t.ref,t===r.child)r.child=n;else{var o=r.child;if(null===o)throw new Error("Expected parent to have a child.");for(;o.sibling!==t;)if(null===(o=o.sibling))throw new Error("Expected to find the previous sibling.");o.sibling=n}var a=r.deletions;return null===a?(r.deletions=[e],r.flags|=tr):a.push(e),n.flags|=2,n}(e,t,Q_(t.type,t.key,t.pendingProps,t._debugOwner||null,t.mode,t.lanes));if(null!==e)if(e.memoizedProps!==t.pendingProps||bc()||t.type!==e.type)jm=!0;else{if(!yg(e,n)&&0===(t.flags&nr))return jm=!1,function(e,t,n){switch(t.tag){case 3:Ym(t),t.stateNode,gd();break;case 5:Bf(t);break;case 1:yc(t.type)&&xc(t);break;case 4:Lf(t,t.stateNode.containerInfo);break;case s:var r=t.memoizedProps.value;tf(t,t.type._context,r);break;case u:ga(n,t.childLanes)&&(t.flags|=4);var o=t.stateNode;o.effectDuration=0,o.passiveEffectDuration=0;break;case c:var a=t.memoizedState;if(null!==a){if(null!==a.dehydrated)return Gf(t,Hf(zf.current)),t.flags|=nr,null;if(ga(n,t.child.childLanes))return eg(e,t,n);Gf(t,Hf(zf.current));var i=bg(e,t,n);return null!==i?i.sibling:null}Gf(t,Hf(zf.current));break;case m:var l=0!==(e.flags&nr),d=ga(n,t.childLanes);if(l){if(d)return lg(e,t,n);t.flags|=nr}var f=t.memoizedState;if(null!==f&&(f.rendering=null,f.tail=null,f.lastEffect=null),Gf(t,zf.current),d)break;return null;case b:case y:return t.lanes=0,Vm(e,t,n)}return bg(e,t,n)}(e,t,n);jm=0!==(e.flags&fr)}else if(jm=!1,yd()&&function(e){return Wc(),0!==(e.flags&pr)}(t)){var r=t.index;Vc(t,(Wc(),Nc),r)}switch(t.lanes=0,t.tag){case 2:return function(e,t,n,r){gg(e,t);var o,i,s,l=t.pendingProps;if(o=gc(t,hc(0,n,!1)),af(t,r),to(t),n.prototype&&"function"==typeof n.prototype.render){var u=Me(n)||"Unknown";Om[u]||(a("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",u,u),Om[u]=!0)}if(8&t.mode&&wd.recordLegacyContextWarning(t,null),Ge(!0),Lm.current=t,i=vp(null,t,n,l,o,r),s=wp(),Ge(!1),no(),t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){var c=Me(n)||"Unknown";Am[c]||(a("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",c,c,c),Am[c]=!0)}if("object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){var d=Me(n)||"Unknown";Am[d]||(a("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",d,d,d),Am[d]=!0),t.tag=1,t.memoizedState=null,t.updateQueue=null;var f=!1;return yc(n)?(f=!0,xc(t)):f=!1,t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,_f(t),hm(t,i),bm(t,n,l,r),Wm(null,t,n,!0,f,r)}if(t.tag=0,8&t.mode){Qr(!0);try{i=vp(null,t,n,l,o,r),s=wp()}finally{Qr(!1)}}return yd()&&s&&Hc(t),Fm(null,t,i,r),Qm(t,n),t.child}(e,t,t.type,n);case 16:return Km(e,t,t.elementType,n);case 0:var o=t.type,i=t.pendingProps;return qm(e,t,o,t.elementType===o?i:Qh(o,i),n);case 1:var h=t.type,_=t.pendingProps;return Gm(e,t,h,t.elementType===h?_:Qh(h,_),n);case 3:return function(e,t,n){if(Ym(t),null===e)throw new Error("Should have a current fiber. This is a bug in React.");var r=t.pendingProps,o=t.memoizedState,a=o.element;vf(e,t),kf(t,r,null,n);var i=t.memoizedState;t.stateNode;var s=i.element;if(o.isDehydrated){var l={element:s,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions};if(t.updateQueue.baseState=l,t.memoizedState=l,t.flags&rr)return Xm(e,t,s,n,ym(new Error("There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering."),t));if(s!==a)return Xm(e,t,s,n,ym(new Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."),t));ed(t);var u=Hd(t,null,s,n);t.child=u;for(var c=u;c;)c.flags=-3&c.flags|sr,c=c.sibling}else{if(gd(),s===a)return bg(e,t,n);Fm(e,t,s,n)}return t.child}(e,t,n);case 5:return function(e,t,n){Bf(t),null===e&&ud(t);var r=t.type,o=t.pendingProps,a=null!==e?e.memoizedProps:null,i=o.children;return yu(r,o)?i=null:null!==a&&yu(r,a)&&(t.flags|=32),Hm(e,t),Fm(e,t,i,n),t.child}(e,t,n);case 6:return function(e,t){return null===e&&ud(t),null}(e,t);case c:return eg(e,t,n);case 4:return function(e,t,n){Lf(t,t.stateNode.containerInfo);var r=t.pendingProps;return null===e?t.child=Vd(t,null,r,n):Fm(e,t,r,n),t.child}(e,t,n);case l:var v=t.type,w=t.pendingProps;return Bm(e,t,v,t.elementType===v?w:Qh(v,w),n);case 7:return function(e,t,n){return Fm(e,t,t.pendingProps,n),t.child}(e,t,n);case 8:return function(e,t,n){return Fm(e,t,t.pendingProps.children,n),t.child}(e,t,n);case u:return function(e,t,n){t.flags|=4;var r=t.stateNode;return r.effectDuration=0,r.passiveEffectDuration=0,Fm(e,t,t.pendingProps.children,n),t.child}(e,t,n);case s:return function(e,t,n){var r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value;"value"in o||ug||(ug=!0,a("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?"));var l=t.type.propTypes;if(l&&nc(l,o,"prop","Context.Provider"),tf(t,r,s),null!==i){var u=i.value;if(Os(u,s)){if(i.children===o.children&&!bc())return bg(e,t,n)}else of(t,r,n)}return Fm(e,t,o.children,n),t.child}(e,t,n);case 9:return function(e,t,n){var r=t.type;void 0===r._context?r!==r.Consumer&&(hg||(hg=!0,a("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?"))):r=r._context;var o=t.pendingProps.children;"function"!=typeof o&&a("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."),af(t,n);var i,s=sf(r);return to(t),Lm.current=t,Ge(!0),i=o(s),Ge(!1),no(),t.flags|=1,Fm(e,t,i,n),t.child}(e,t,n);case d:var S=t.type,x=Qh(S,t.pendingProps);if(t.type!==t.elementType){var T=S.propTypes;T&&nc(T,x,"prop",Me(S))}return Um(e,t,S,x=Qh(S.type,x),n);case f:return zm(e,t,t.type,t.pendingProps,n);case p:var E=t.type,k=t.pendingProps;return function(e,t,n,r,o){var a;return gg(e,t),t.tag=1,yc(n)?(a=!0,xc(t)):a=!1,af(t,o),mm(t,n,r),bm(t,n,r,o),Wm(null,t,n,!0,a,o)}(e,t,E,t.elementType===E?k:Qh(E,k),n);case m:return lg(e,t,n);case g:break;case b:return Vm(e,t,n)}throw new Error("Unknown unit of work tag ("+t.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function vg(e){e.flags|=4}function wg(e){e.flags|=or,e.flags|=hr}function Sg(e,t){if(!yd())switch(e.tailMode){case"hidden":for(var n=e.tail,r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?e.tail=null:r.sibling=null;break;case"collapsed":for(var o=e.tail,a=null;null!==o;)null!==o.alternate&&(a=o),o=o.sibling;null===a?t||null===e.tail?e.tail=null:e.tail.sibling=null:a.sibling=null}}function xg(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t){if(2&e.mode){for(var o=e.selfBaseDuration,a=e.child;null!==a;)n=ya(n,ya(a.lanes,a.childLanes)),r|=a.subtreeFlags&Sr,r|=a.flags&Sr,o+=a.treeBaseDuration,a=a.sibling;e.treeBaseDuration=o}else for(var i=e.child;null!==i;)n=ya(n,ya(i.lanes,i.childLanes)),r|=i.subtreeFlags&Sr,r|=i.flags&Sr,i.return=e,i=i.sibling;e.subtreeFlags|=r}else{if(2&e.mode){for(var s=e.actualDuration,l=e.selfBaseDuration,u=e.child;null!==u;)n=ya(n,ya(u.lanes,u.childLanes)),r|=u.subtreeFlags,r|=u.flags,s+=u.actualDuration,l+=u.treeBaseDuration,u=u.sibling;e.actualDuration=s,e.treeBaseDuration=l}else for(var c=e.child;null!==c;)n=ya(n,ya(c.lanes,c.childLanes)),r|=c.subtreeFlags,r|=c.flags,c.return=e,c=c.sibling;e.subtreeFlags|=r}return e.childLanes=n,t}function Tg(e,t,n){if(Kc&&null!==Xc&&1&t.mode&&0===(t.flags&nr))return md(t),gd(),t.flags|=98560,!1;var r=hd(t);if(null!==n&&null!==n.dehydrated){if(null===e){if(!r)throw new Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");if(dd(t),xg(t),2&t.mode)if(null!==n){var o=t.child;null!==o&&(t.treeBaseDuration-=o.treeBaseDuration)}return!1}if(gd(),0===(t.flags&nr)&&(t.memoizedState=null),t.flags|=4,xg(t),2&t.mode&&null!==n){var a=t.child;null!==a&&(t.treeBaseDuration-=a.treeBaseDuration)}return!1}return bd(),!0}function Eg(e,t,n){var r=t.pendingProps;switch(Gc(t),t.tag){case 2:case 16:case f:case 0:case l:case 7:case 8:case u:case 9:case d:return xg(t),null;case 1:return yc(t.type)&&_c(t),xg(t),null;case 3:var o=t.stateNode;if(jf(t),vc(t),Qf(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),null===e||null===e.child)if(hd(t))vg(t);else if(null!==e)e.memoizedState.isDehydrated&&0===(t.flags&rr)||(t.flags|=ar,bd());return dg(e,t),xg(t),null;case 5:Uf(t);var a=Mf(),i=t.type;if(null!==e&&null!=t.stateNode)fg(e,t,i,r,a),e.ref!==t.ref&&wg(t);else{if(!r){if(null===t.stateNode)throw new Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return xg(t),null}var h=Ff();if(hd(t))(function(e,t,n){var r=e.stateNode,o=!Qc,a=Nu(r,e.type,e.memoizedProps,0,n,e,o);return e.updateQueue=a,null!==a})(t,0,h)&&vg(t);else{var _=gu(i,r,a,h,t);cg(_,t,!1,!1),t.stateNode=_,function(e,t,n){switch(Gl(e,t,n),t){case"button":case"input":case"select":case"textarea":return!!n.autoFocus;case"img":return!0;default:return!1}}(_,i,r)&&vg(t)}null!==t.ref&&wg(t)}return xg(t),null;case 6:var v=r;if(e&&null!=t.stateNode){var w=e.memoizedProps;pg(e,t,w,v)}else{if("string"!=typeof v&&null===t.stateNode)throw new Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");var S=Mf(),x=Ff();hd(t)?cd(t)&&vg(t):t.stateNode=_u(v,S,x,t)}return xg(t),null;case c:Wf(t);var T=t.memoizedState;if(null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated)if(!Tg(e,t,T))return t.flags&dr?t:null;if(0!==(t.flags&nr))return t.lanes=n,2&t.mode&&Kh(t),t;var E=null!==T;if(E!==(null!==e&&null!==e.memoizedState))if(E)if(t.child.flags|=lr,1&t.mode)null===e&&(!0!==t.memoizedProps.unstable_avoidThisFallback||!0)||Vf(zf.current,1)?ry===Hb&&(ry=Wb):r_();if(null!==t.updateQueue&&(t.flags|=4),xg(t),2&t.mode&&E){var k=t.child;null!==k&&(t.treeBaseDuration-=k.treeBaseDuration)}return null;case 4:return jf(t),dg(e,t),null===e&&gl(t.stateNode.containerInfo),xg(t),null;case s:return nf(t.type._context,t),xg(t),null;case p:return yc(t.type)&&_c(t),xg(t),null;case m:Wf(t);var P=t.memoizedState;if(null===P)return xg(t),null;var O=0!==(t.flags&nr),A=P.rendering;if(null===A)if(O)Sg(P,!1);else{if(!(ry===Hb&&(null===e||0===(e.flags&nr))))for(var R=t.child;null!==R;){var $=Xf(R);if(null!==$){O=!0,t.flags|=nr,Sg(P,!1);var I=$.updateQueue;return null!==I&&(t.updateQueue=I,t.flags|=4),t.subtreeFlags=0,qd(t,n),Gf(t,qf(zf.current,2)),t.child}R=R.sibling}null!==P.tail&&Lr()>gy()&&(t.flags|=nr,O=!0,Sg(P,!1),t.lanes=Wo)}else{if(!O){var C=Xf(A);if(null!==C){t.flags|=nr,O=!0;var D=C.updateQueue;if(null!==D&&(t.updateQueue=D,t.flags|=4),Sg(P,!0),null===P.tail&&"hidden"===P.tailMode&&!A.alternate&&!yd())return xg(t),null}else 2*Lr()-P.renderingStartTime>gy()&&n!==Zo&&(t.flags|=nr,O=!0,Sg(P,!1),t.lanes=Wo)}if(P.isBackwards)A.sibling=t.child,t.child=A;else{var N=P.last;null!==N?N.sibling=A:t.child=A,P.last=A}}if(null!==P.tail){var M=P.tail;P.rendering=M,P.tail=M.sibling,P.renderingStartTime=Lr(),M.sibling=null;var L=zf.current;return Gf(t,L=O?qf(L,2):Hf(L)),M}return xg(t),null;case g:break;case b:case y:Qy(t);var j=null!==t.memoizedState;if(null!==e)null!==e.memoizedState!==j&&(t.flags|=lr);return j&&1&t.mode?ga(ty,Zo)&&(xg(t),6&t.subtreeFlags&&(t.flags|=lr)):xg(t),null;case 24:case 25:return null}throw new Error("Unknown unit of work tag ("+t.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function kg(e,t,n){switch(Gc(t),t.tag){case 1:yc(t.type)&&_c(t);var r=t.flags;return r&dr?(t.flags=-65537&r|nr,2&t.mode&&Kh(t),t):null;case 3:t.stateNode,jf(t),vc(t),Qf();var o=t.flags;return 0!==(o&dr)&&0===(o&nr)?(t.flags=-65537&o|nr,t):null;case 5:return Uf(t),null;case c:Wf(t);var a=t.memoizedState;if(null!==a&&null!==a.dehydrated){if(null===t.alternate)throw new Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");gd()}var i=t.flags;return i&dr?(t.flags=-65537&i|nr,2&t.mode&&Kh(t),t):null;case m:return Wf(t),null;case 4:return jf(t),null;case s:return nf(t.type._context,t),null;case b:case y:return Qy(t),null;default:return null}}function Pg(e,t,n){switch(Gc(t),t.tag){case 1:var r=t.type.childContextTypes;null!=r&&_c(t);break;case 3:t.stateNode,jf(t),vc(t),Qf();break;case 5:Uf(t);break;case 4:jf(t);break;case c:case m:Wf(t);break;case s:nf(t.type._context,t);break;case b:case y:Qy(t)}}cg=function(e,t,n,r){for(var o=t.child;null!==o;){if(5===o.tag||6===o.tag)bu(e,o.stateNode);else if(4===o.tag);else if(null!==o.child){o.child.return=o,o=o.child;continue}if(o===t)return;for(;null===o.sibling;){if(null===o.return||o.return===t)return;o=o.return}o.sibling.return=o.return,o=o.sibling}},dg=function(e,t){},fg=function(e,t,n,r,o){var a=e.memoizedProps;if(a!==r){var i=function(e,t,n,r,o,a){var i=a;if(typeof r.children!=typeof n.children&&("string"==typeof r.children||"number"==typeof r.children)){var s=""+r.children,l=tu(i.ancestorInfo,t);eu(null,s,l)}return Wl(e,t,n,r)}(t.stateNode,n,a,r,0,Ff());t.updateQueue=i,i&&vg(t)}},pg=function(e,t,n,r){n!==r&&vg(t)};var Og=null;Og=new Set;var Ag=!1,Rg=!1,$g="function"==typeof WeakSet?WeakSet:Set,Ig=null,Cg=null,Dg=null;var Ng=function(e,t){if(t.props=e.memoizedProps,t.state=e.memoizedState,2&e.mode)try{Yh(),t.componentWillUnmount()}finally{Gh(e)}else t.componentWillUnmount()};function Mg(e,t){try{Gg(4,e)}catch(n){h_(e,t,n)}}function Lg(e,t,n){try{Ng(e,n)}catch(r){h_(e,t,r)}}function jg(e,t){try{Kg(e)}catch(n){h_(e,t,n)}}function Fg(e,t){var n=e.ref;if(null!==n)if("function"==typeof n){var r;try{if(2&e.mode)try{Yh(),r=n(null)}finally{Gh(e)}else r=n(null)}catch(o){h_(e,t,o)}"function"==typeof r&&a("Unexpected return value from a callback ref in %s. A callback ref should not return a function.",je(e))}else n.current=null}function Bg(e,t,n){try{n()}catch(r){h_(e,t,r)}}var Ug=!1;function zg(e,t){mu(e.containerInfo),Ig=t,function(){for(;null!==Ig;){var e=Ig,t=e.child;0!==(e.subtreeFlags&yr)&&null!==t?(t.return=e,Ig=t):Vg()}}();var n=Ug;return Ug=!1,n}function Vg(){for(;null!==Ig;){var e=Ig;qe(e);try{Hg(e)}catch(n){h_(e,e.return,n)}He();var t=e.sibling;if(null!==t)return t.return=e.return,void(Ig=t);Ig=e.return}}function Hg(e){var t,n=e.alternate;if(0!==(e.flags&ar)){switch(qe(e),e.tag){case 0:case l:case f:break;case 1:if(null!==n){var r=n.memoizedProps,o=n.memoizedState,i=e.stateNode;e.type!==e.elementType||Cm||(i.props!==e.memoizedProps&&a("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",je(e)||"instance"),i.state!==e.memoizedState&&a("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",je(e)||"instance"));var s=i.getSnapshotBeforeUpdate(e.elementType===e.type?r:Qh(e.type,r),o),u=Og;void 0!==s||u.has(e.type)||(u.add(e.type),a("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.",je(e))),i.__reactInternalSnapshotBeforeUpdate=s}break;case 3:var c=e.stateNode;1===(t=c.containerInfo).nodeType?t.textContent="":9===t.nodeType&&t.documentElement&&t.removeChild(t.documentElement);break;case 5:case 6:case 4:case p:break;default:throw new Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}He()}}function qg(e,t,n){var r=t.updateQueue,o=null!==r?r.lastEffect:null;if(null!==o){var a=o.next,i=a;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,void 0!==s&&(8&e?ao(t):4&e&&uo(t),2&e&&$_(!0),Bg(t,n,s),2&e&&$_(!1),8&e?io():4&e&&co())}i=i.next}while(i!==a)}}function Gg(e,t){var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var o=r.next,i=o;do{if((i.tag&e)===e){8&e?ro(t):4&e&&so(t);var s=i.create;2&e&&$_(!0),i.destroy=s(),2&e&&$_(!1),8&e?oo():4&e&&lo();var l=i.destroy;if(void 0!==l&&"function"!=typeof l){var u=void 0;a("%s must not return anything besides a function, which is used for clean-up.%s",u=4&i.tag?"useLayoutEffect":2&i.tag?"useInsertionEffect":"useEffect",null===l?" You returned null. If your effect does not require clean up, return undefined (or nothing).":"function"==typeof l.then?"\n\nIt looks like you wrote "+u+"(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n"+u+"(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching":" You returned: "+l)}}i=i.next}while(i!==o)}}function Wg(e,t){if(4&t.flags&&t.tag===u){var n=t.stateNode.passiveEffectDuration,r=t.memoizedProps,o=r.id,a=r.onPostCommit,i=Uh(),s=null===t.alternate?"mount":"update";Bh()&&(s="nested-update"),"function"==typeof a&&a(o,s,n,i);var l=t.return;e:for(;null!==l;){switch(l.tag){case 3:l.stateNode.passiveEffectDuration+=n;break e;case u:l.stateNode.passiveEffectDuration+=n;break e}l=l.return}}}function Yg(e,t,n,r){if(0!==(n.flags&vr))switch(n.tag){case 0:case l:case f:if(!Rg)if(2&n.mode)try{Yh(),Gg(5,n)}finally{Gh(n)}else Gg(5,n);break;case 1:var o=n.stateNode;if(4&n.flags&&!Rg)if(null===t)if(n.type!==n.elementType||Cm||(o.props!==n.memoizedProps&&a("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",je(n)||"instance"),o.state!==n.memoizedState&&a("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",je(n)||"instance")),2&n.mode)try{Yh(),o.componentDidMount()}finally{Gh(n)}else o.componentDidMount();else{var i=n.elementType===n.type?t.memoizedProps:Qh(n.type,t.memoizedProps),s=t.memoizedState;if(n.type!==n.elementType||Cm||(o.props!==n.memoizedProps&&a("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",je(n)||"instance"),o.state!==n.memoizedState&&a("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",je(n)||"instance")),2&n.mode)try{Yh(),o.componentDidUpdate(i,s,o.__reactInternalSnapshotBeforeUpdate)}finally{Gh(n)}else o.componentDidUpdate(i,s,o.__reactInternalSnapshotBeforeUpdate)}var d=n.updateQueue;null!==d&&(n.type!==n.elementType||Cm||(o.props!==n.memoizedProps&&a("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",je(n)||"instance"),o.state!==n.memoizedState&&a("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",je(n)||"instance")),Rf(0,d,o));break;case 3:var h=n.updateQueue;if(null!==h){var _=null;if(null!==n.child)switch(n.child.tag){case 5:case 1:_=n.child.stateNode}Rf(0,h,_)}break;case 5:var v=n.stateNode;if(null===t&&4&n.flags)!function(e,t,n){switch(t){case"button":case"input":case"select":case"textarea":return void(n.autoFocus&&e.focus());case"img":n.src&&(e.src=n.src)}}(v,n.type,n.memoizedProps);break;case 6:case 4:break;case u:var w=n.memoizedProps,S=w.onCommit,x=w.onRender,T=n.stateNode.effectDuration,E=Uh(),k=null===t?"mount":"update";Bh()&&(k="nested-update"),"function"==typeof x&&x(n.memoizedProps.id,k,n.actualDuration,n.treeBaseDuration,n.actualStartTime,E),"function"==typeof S&&S(n.memoizedProps.id,k,T,E),O=n,xy.push(O),vy||(vy=!0,O_(Ur,function(){return c_(),null}));var P=n.return;e:for(;null!==P;){switch(P.tag){case 3:P.stateNode.effectDuration+=T;break e;case u:P.stateNode.effectDuration+=T;break e}P=P.return}break;case c:!function(e,t){var n=t.memoizedState;if(null===n){var r=t.alternate;if(null!==r){var o=r.memoizedState;if(null!==o){var a=o.dehydrated;null!==a&&function(e){ai(e)}(a)}}}}(0,n);break;case m:case p:case g:case b:case y:case 25:break;default:throw new Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}var O;Rg||n.flags&or&&Kg(n)}function Xg(e){switch(e.tag){case 0:case l:case f:if(2&e.mode)try{Yh(),Mg(e,e.return)}finally{Gh(e)}else Mg(e,e.return);break;case 1:var t=e.stateNode;"function"==typeof t.componentDidMount&&function(e,t,n){try{n.componentDidMount()}catch(r){h_(e,t,r)}}(e,e.return,t),jg(e,e.return);break;case 5:jg(e,e.return)}}function Kg(e){var t=e.ref;if(null!==t){var n,r=e.stateNode;if(e.tag,n=r,"function"==typeof t){var o;if(2&e.mode)try{Yh(),o=t(n)}finally{Gh(e)}else o=t(n);"function"==typeof o&&a("Unexpected return value from a callback ref in %s. A callback ref should not return a function.",je(e))}else t.hasOwnProperty("current")||a("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",je(e)),t.current=n}}function Qg(e){var t,n=e.alternate;if(null!==n&&(e.alternate=null,Qg(n)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag){var r=e.stateNode;null!==r&&(delete(t=r)[ju],delete t[Fu],delete t[Uu],delete t[zu],delete t[Vu])}e.stateNode=null,e._debugOwner=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Zg(e){return 5===e.tag||3===e.tag||4===e.tag}function Jg(e){var t=e;e:for(;;){for(;null===t.sibling;){if(null===t.return||Zg(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;5!==t.tag&&6!==t.tag&&t.tag!==h;){if(2&t.flags)continue e;if(null===t.child||4===t.tag)continue e;t.child.return=t,t=t.child}if(!(2&t.flags))return t.stateNode}}function eb(e){var t=function(e){for(var t=e.return;null!==t;){if(Zg(t))return t;t=t.return}throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.")}(e);switch(t.tag){case 5:var n=t.stateNode;32&t.flags&&(Eu(n),t.flags&=-33),nb(e,Jg(e),n);break;case 3:case 4:var r=t.stateNode.containerInfo;tb(e,Jg(e),r);break;default:throw new Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.")}}function tb(e,t,n){var r=e.tag;if(5===r||6===r){var o=e.stateNode;t?function(e,t,n){8===e.nodeType?e.parentNode.insertBefore(t,n):e.insertBefore(t,n)}(n,o,t):function(e,t){var n;8===e.nodeType?(n=e.parentNode).insertBefore(t,e):(n=e).appendChild(t),null==e._reactRootContainer&&null===n.onclick&&ql(n)}(n,o)}else if(4===r);else{var a=e.child;if(null!==a){tb(a,t,n);for(var i=a.sibling;null!==i;)tb(i,t,n),i=i.sibling}}}function nb(e,t,n){var r=e.tag;if(5===r||6===r){var o=e.stateNode;t?function(e,t,n){e.insertBefore(t,n)}(n,o,t):function(e,t){e.appendChild(t)}(n,o)}else if(4===r);else{var a=e.child;if(null!==a){nb(a,t,n);for(var i=a.sibling;null!==i;)nb(i,t,n),i=i.sibling}}}var rb=null,ob=!1;function ab(e,t,n){var r,o,a=t;e:for(;null!==a;){switch(a.tag){case 5:rb=a.stateNode,ob=!1;break e;case 3:case 4:rb=a.stateNode.containerInfo,ob=!0;break e}a=a.return}if(null===rb)throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");sb(e,t,n),rb=null,ob=!1,null!==(o=(r=n).alternate)&&(o.return=null),r.return=null}function ib(e,t,n){for(var r=n.child;null!==r;)sb(e,t,r),r=r.sibling}function sb(e,t,n){switch(function(e){if(Wr&&"function"==typeof Wr.onCommitFiberUnmount)try{Wr.onCommitFiberUnmount(Gr,e)}catch(t){Xr||(Xr=!0,a("React instrumentation encountered an error: %s",t))}}(n),n.tag){case 5:Rg||Fg(n,t);case 6:var r=rb,o=ob;return rb=null,ib(e,t,n),ob=o,void(null!==(rb=r)&&(ob?(x=rb,T=n.stateNode,8===x.nodeType?x.parentNode.removeChild(T):x.removeChild(T)):function(e,t){e.removeChild(t)}(rb,n.stateNode)));case h:return void(null!==rb&&(ob?function(e,t){8===e.nodeType?ku(e.parentNode,t):1===e.nodeType&&ku(e,t),ai(e)}(rb,n.stateNode):ku(rb,n.stateNode)));case 4:var i=rb,s=ob;return rb=n.stateNode.containerInfo,ob=!0,ib(e,t,n),rb=i,void(ob=s);case 0:case l:case d:case f:if(!Rg){var u=n.updateQueue;if(null!==u){var c=u.lastEffect;if(null!==c){var p=c.next,m=p;do{var y=m,_=y.destroy,v=y.tag;void 0!==_&&(2&v?Bg(n,t,_):4&v&&(uo(n),2&n.mode?(Yh(),Bg(n,t,_),Gh(n)):Bg(n,t,_),co())),m=m.next}while(m!==p)}}}return void ib(e,t,n);case 1:if(!Rg){Fg(n,t);var w=n.stateNode;"function"==typeof w.componentWillUnmount&&Lg(n,t,w)}return void ib(e,t,n);case g:return void ib(e,t,n);case b:if(1&n.mode){var S=Rg;Rg=S||null!==n.memoizedState,ib(e,t,n),Rg=S}else ib(e,t,n);break;default:return void ib(e,t,n)}var x,T}function lb(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new $g),t.forEach(function(t){var r=y_.bind(null,e,t);if(!n.has(t)){if(n.add(t),Kr){if(null===Cg||null===Dg)throw Error("Expected finished root and lanes to be set. This is a bug in React.");k_(Dg,Cg)}t.then(r,r)}})}}function ub(e,t,n){var r=t.deletions;if(null!==r)for(var o=0;o<r.length;o++){var a=r[o];try{ab(e,t,a)}catch(l){h_(a,t,l)}}var i=Be;if(t.subtreeFlags&_r)for(var s=t.child;null!==s;)qe(s),cb(s,e),s=s.sibling;qe(i)}function cb(e,t,n){var r=e.alternate,o=e.flags;switch(e.tag){case 0:case l:case d:case f:if(ub(t,e),db(e),4&o){try{qg(3,e,e.return),Gg(3,e)}catch(R){h_(e,e.return,R)}if(2&e.mode){try{Yh(),qg(5,e,e.return)}catch(R){h_(e,e.return,R)}Gh(e)}else try{qg(5,e,e.return)}catch(R){h_(e,e.return,R)}}return;case 1:return ub(t,e),db(e),void(o&or&&null!==r&&Fg(r,r.return));case 5:if(ub(t,e),db(e),o&or&&null!==r&&Fg(r,r.return),32&e.flags){var a=e.stateNode;try{Eu(a)}catch(R){h_(e,e.return,R)}}if(4&o){var i=e.stateNode;if(null!=i){var s=e.memoizedProps,u=null!==r?r.memoizedProps:s,p=e.type,h=e.updateQueue;if(e.updateQueue=null,null!==h)try{!function(e,t,n,r,o){Yl(e,t,n,r,o),Zu(e,o)}(i,h,p,u,s)}catch(R){h_(e,e.return,R)}}}return;case 6:if(ub(t,e),db(e),4&o){if(null===e.stateNode)throw new Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");var _=e.stateNode,v=e.memoizedProps;null!==r&&r.memoizedProps;try{!function(e,t,n){e.nodeValue=n}(_,0,v)}catch(R){h_(e,e.return,R)}}return;case 3:if(ub(t,e),db(e),4&o)if(null!==r)if(r.memoizedState.isDehydrated)try{ai(t.containerInfo)}catch(R){h_(e,e.return,R)}return;case 4:return ub(t,e),void db(e);case c:ub(t,e),db(e);var w=e.child;if(w.flags&lr){var S=w.stateNode,x=null!==w.memoizedState;if(S.isHidden=x,x)null!==w.alternate&&null!==w.alternate.memoizedState||(cy=Lr())}if(4&o){try{!function(e){e.memoizedState}(e)}catch(R){h_(e,e.return,R)}lb(e)}return;case b:var T=null!==r&&null!==r.memoizedState;if(1&e.mode){var E=Rg;Rg=E||T,ub(t,e),Rg=E}else ub(t,e);if(db(e),o&lr){var k=e.stateNode,P=null!==e.memoizedState,O=e;if(k.isHidden=P,P&&!T&&1&O.mode){Ig=O;for(var A=O.child;null!==A;)Ig=A,mb(A),A=A.sibling}!function(e,t){for(var n=null,r=e;;){if(5===r.tag){if(null===n){n=r;try{var o=r.stateNode;t?Pu(o):Au(r.stateNode,r.memoizedProps)}catch(R){h_(e,e.return,R)}}}else if(6===r.tag){if(null===n)try{var a=r.stateNode;t?Ou(a):Ru(a,r.memoizedProps)}catch(R){h_(e,e.return,R)}}else if((r.tag!==b&&r.tag!==y||null===r.memoizedState||r===e)&&null!==r.child){r.child.return=r,r=r.child;continue}if(r===e)return;for(;null===r.sibling;){if(null===r.return||r.return===e)return;n===r&&(n=null),r=r.return}n===r&&(n=null),r.sibling.return=r.return,r=r.sibling}}(O,P)}return;case m:return ub(t,e),db(e),void(4&o&&lb(e));case g:return;default:return ub(t,e),void db(e)}}function db(e){var t=e.flags;if(2&t){try{eb(e)}catch(n){h_(e,e.return,n)}e.flags&=-3}t&sr&&(e.flags&=-4097)}function fb(e,t,n){Cg=n,Dg=t,Ig=e,pb(e,t,n),Cg=null,Dg=null}function pb(e,t,n){for(var r=!!(1&e.mode);null!==Ig;){var o=Ig,a=o.child;if(o.tag===b&&r){var i=null!==o.memoizedState||Ag;if(i){hb(e,t,n);continue}var s=o.alternate,l=null!==s&&null!==s.memoizedState,u=Ag,c=Rg;Ag=i,(Rg=l||Rg)&&!c&&(Ig=o,bb(o));for(var d=a;null!==d;)Ig=d,pb(d,t,n),d=d.sibling;Ig=o,Ag=u,Rg=c,hb(e,t,n)}else 0!==(o.subtreeFlags&vr)&&null!==a?(a.return=o,Ig=a):hb(e,t,n)}}function hb(e,t,n){for(;null!==Ig;){var r=Ig;if(0!==(r.flags&vr)){var o=r.alternate;qe(r);try{Yg(0,o,r)}catch(i){h_(r,r.return,i)}He()}if(r===e)return void(Ig=null);var a=r.sibling;if(null!==a)return a.return=r.return,void(Ig=a);Ig=r.return}}function mb(e){for(;null!==Ig;){var t=Ig,n=t.child;switch(t.tag){case 0:case l:case d:case f:if(2&t.mode)try{Yh(),qg(4,t,t.return)}finally{Gh(t)}else qg(4,t,t.return);break;case 1:Fg(t,t.return);var r=t.stateNode;"function"==typeof r.componentWillUnmount&&Lg(t,t.return,r);break;case 5:Fg(t,t.return);break;case b:if(null!==t.memoizedState){gb(e);continue}}null!==n?(n.return=t,Ig=n):gb(e)}}function gb(e){for(;null!==Ig;){var t=Ig;if(t===e)return void(Ig=null);var n=t.sibling;if(null!==n)return n.return=t.return,void(Ig=n);Ig=t.return}}function bb(e){for(;null!==Ig;){var t=Ig,n=t.child;if(t.tag===b)if(null!==t.memoizedState){yb(e);continue}null!==n?(n.return=t,Ig=n):yb(e)}}function yb(e){for(;null!==Ig;){var t=Ig;qe(t);try{Xg(t)}catch(r){h_(t,t.return,r)}if(He(),t===e)return void(Ig=null);var n=t.sibling;if(null!==n)return n.return=t.return,void(Ig=n);Ig=t.return}}function _b(e,t,n,r){Ig=t,function(e,t,n,r){for(;null!==Ig;){var o=Ig,a=o.child;0!==(o.subtreeFlags&wr)&&null!==a?(a.return=o,Ig=a):vb(e,t,n,r)}}(t,e,n,r)}function vb(e,t,n,r){for(;null!==Ig;){var o=Ig;if(0!==(o.flags&ir)){qe(o);try{wb(t,o,n,r)}catch(i){h_(o,o.return,i)}He()}if(o===e)return void(Ig=null);var a=o.sibling;if(null!==a)return a.return=o.return,void(Ig=a);Ig=o.return}}function wb(e,t,n,r){switch(t.tag){case 0:case l:case f:if(2&t.mode){Xh();try{Gg(9,t)}finally{Wh(t)}}else Gg(9,t)}}function Sb(e){Ig=e,function(){for(;null!==Ig;){var e=Ig,t=e.child;if(0!==(Ig.flags&tr)){var n=e.deletions;if(null!==n){for(var r=0;r<n.length;r++){var o=n[r];Ig=o,Eb(o,e)}var a=e.alternate;if(null!==a){var i=a.child;if(null!==i){a.child=null;do{var s=i.sibling;i.sibling=null,i=s}while(null!==i)}}Ig=e}}0!==(e.subtreeFlags&wr)&&null!==t?(t.return=e,Ig=t):xb()}}()}function xb(){for(;null!==Ig;){var e=Ig;0!==(e.flags&ir)&&(qe(e),Tb(e),He());var t=e.sibling;if(null!==t)return t.return=e.return,void(Ig=t);Ig=e.return}}function Tb(e){switch(e.tag){case 0:case l:case f:2&e.mode?(Xh(),qg(9,e,e.return),Wh(e)):qg(9,e,e.return)}}function Eb(e,t){for(;null!==Ig;){var n=Ig;qe(n),Pb(n,t),He();var r=n.child;null!==r?(r.return=n,Ig=r):kb(e)}}function kb(e){for(;null!==Ig;){var t=Ig,n=t.sibling,r=t.return;if(Qg(t),t===e)return void(Ig=null);if(null!==n)return n.return=r,void(Ig=n);Ig=r}}function Pb(e,t){switch(e.tag){case 0:case l:case f:2&e.mode?(Xh(),qg(8,e,t),Wh(e)):qg(8,e,t)}}function Ob(e){switch(e.tag){case 0:case l:case f:try{Gg(5,e)}catch(n){h_(e,e.return,n)}break;case 1:var t=e.stateNode;try{t.componentDidMount()}catch(n){h_(e,e.return,n)}}}function Ab(e){switch(e.tag){case 0:case l:case f:try{Gg(9,e)}catch(t){h_(e,e.return,t)}}}function Rb(e){switch(e.tag){case 0:case l:case f:try{qg(5,e,e.return)}catch(n){h_(e,e.return,n)}break;case 1:var t=e.stateNode;"function"==typeof t.componentWillUnmount&&Lg(e,e.return,t)}}function $b(e){switch(e.tag){case 0:case l:case f:try{qg(9,e,e.return)}catch(t){h_(e,e.return,t)}}}if("function"==typeof Symbol&&Symbol.for){var Ib=Symbol.for;Ib("selector.component"),Ib("selector.has_pseudo_class"),Ib("selector.role"),Ib("selector.test_id"),Ib("selector.text")}var Cb=[];var Db=n.ReactCurrentActQueue;function Nb(){var e="undefined"!=typeof IS_REACT_ACT_ENVIRONMENT?IS_REACT_ACT_ENVIRONMENT:void 0;return e||null===Db.current||a("The current testing environment is not configured to support act(...)"),e}var Mb=Math.ceil,Lb=n.ReactCurrentDispatcher,jb=n.ReactCurrentOwner,Fb=n.ReactCurrentBatchConfig,Bb=n.ReactCurrentActQueue,Ub=0,zb=2,Vb=4,Hb=0,qb=1,Gb=2,Wb=3,Yb=4,Xb=5,Kb=6,Qb=Ub,Zb=null,Jb=null,ey=0,ty=0,ny=sc(0),ry=Hb,oy=null,ay=0,iy=0,sy=0,ly=null,uy=null,cy=0,dy=500,fy=1/0,py=500,hy=null;function my(){fy=Lr()+py}function gy(){return fy}var by=!1,yy=null,_y=null,vy=!1,wy=null,Sy=0,xy=[],Ty=null,Ey=50,ky=0,Py=null,Oy=!1,Ay=!1,Ry=50,$y=0,Iy=null,Cy=ea,Dy=0,Ny=!1;function My(){return Zb}function Ly(){return(Qb&(zb|Vb))!==Ub?Lr():Cy!==ea?Cy:Cy=Lr()}function jy(e){if(!(1&e.mode))return So;if((Qb&zb)!==Ub&&0!==ey)return pa(ey);if(null!==vd.transition){if(null!==Fb.transition){var t=Fb.transition;t._updatedFibers||(t._updatedFibers=new Set),t._updatedFibers.add(e)}return 0===Dy&&(Dy=da()),Dy}var n,r=La();return 0!==r?r:void 0===(n=window.event)?Da:hi(n.type)}function Fy(e){var t;return 1&e.mode?(t=na,!((na<<=1)&Uo)&&(na=zo),t):So}function By(e,t,n,r){!function(){if(ky>Ey)throw ky=0,Py=null,new Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");$y>Ry&&($y=0,Iy=null,a("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render."))}(),Ny&&a("useInsertionEffect must not schedule updates."),Oy&&(Ay=!0),Sa(e,n,r),0!==(Qb&zb)&&e===Zb?function(e){if(Ue&&!hh)switch(e.tag){case 0:case l:case f:var t=Jb&&je(Jb)||"Unknown",n=t;if(!T_.has(n))T_.add(n),a("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render",je(e)||"Unknown",t,t);break;case 1:E_||(a("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."),E_=!0)}}(t):(Kr&&Ea(e,t,n),function(e){if(1&e.mode){if(!Nb())return}else{if(t="undefined"!=typeof IS_REACT_ACT_ENVIRONMENT?IS_REACT_ACT_ENVIRONMENT:void 0,"undefined"==typeof jest||!1===t)return;if(Qb!==Ub)return;if(0!==e.tag&&e.tag!==l&&e.tag!==f)return}var t;if(null===Bb.current){var n=Be;try{qe(e),a("An update to %s inside a test was not wrapped in act(...).\n\nWhen testing, code that causes React state updates should be wrapped into act(...):\n\nact(() => {\n /* fire events that update state */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act",je(e))}finally{n?qe(e):He()}}}(t),e===Zb&&((Qb&zb)===Ub&&(iy=ya(iy,n)),ry===Yb&&qy(e,ey)),Uy(e,r),n!==So||Qb!==Ub||1&t.mode||Bb.isBatchingLegacy||(my(),Rc()))}function Uy(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.pendingLanes,r=e.suspendedLanes,o=e.pingedLanes,a=e.expirationTimes,i=n;i>0;){var s=ha(i),l=1<<s,u=a[s];u===ea?0!==(l&r)&&0===(l&o)||(a[s]=aa(l,t)):u<=t&&(e.expiredLanes|=l),i&=~l}}(e,t);var r=oa(e,e===Zb?ey:0);if(0===r)return null!==n&&A_(n),e.callbackNode=null,void(e.callbackPriority=0);var o=fa(r),i=e.callbackPriority;if(i!==o||null!==Bb.current&&n!==P_){var s,l;if(null!=n&&A_(n),o===So)0===e.tag?(null!==Bb.isBatchingLegacy&&(Bb.didScheduleLegacyUpdate=!0),l=Gy.bind(null,e),Pc=!0,Ac(l)):Ac(Gy.bind(null,e)),null!==Bb.current?Bb.current.push($c):xu(function(){(Qb&(zb|Vb))===Ub&&$c()}),s=null;else{var u;switch(Ba(r)){case Ia:u=Fr;break;case Ca:u=Br;break;case Da:u=Ur;break;case Na:u=Vr;break;default:u=Ur}s=O_(u,zy.bind(null,e))}e.callbackPriority=o,e.callbackNode=s}else null==n&&i!==So&&a("Expected scheduled callback to exist. This error is likely caused by a bug in React. Please file an issue.")}function zy(e,t){if(jh=!1,Fh=!1,Cy=ea,Dy=0,(Qb&(zb|Vb))!==Ub)throw new Error("Should not already be working.");var n=e.callbackNode;if(c_()&&e.callbackNode!==n)return null;var r=oa(e,e===Zb?ey:0);if(0===r)return null;var o=!ua(0,r)&&!function(e,t){return 0!==(t&e.expiredLanes)}(e,r)&&!t,a=o?function(e,t){var n=Qb;Qb|=zb;var r=e_();if(Zb!==e||ey!==t){if(Kr){var o=e.memoizedUpdaters;o.size>0&&(k_(e,ey),o.clear()),ka(e,t)}hy=null,my(),Zy(e,t)}ho(t);for(;;)try{i_();break}catch(a){Jy(e,a)}return Zd(),t_(r),Qb=n,null!==Jb?(null!==Yr&&"function"==typeof Yr.markRenderYielded&&Yr.markRenderYielded(),Hb):(mo(),Zb=null,ey=0,ry)}(e,r):o_(e,r);if(a!==Hb){if(a===Gb){var i=ia(e);0!==i&&(r=i,a=Vy(e,i))}if(a===qb){var s=oy;throw Zy(e,0),qy(e,r),Uy(e,Lr()),s}if(a===Kb)qy(e,r);else{var l=!ua(0,r),u=e.current.alternate;if(l&&!function(e){var t=e;for(;;){if(t.flags&ur){var n=t.updateQueue;if(null!==n){var r=n.stores;if(null!==r)for(var o=0;o<r.length;o++){var a=r[o],i=a.getSnapshot,s=a.value;try{if(!Os(i(),s))return!1}catch(u){return!1}}}}var l=t.child;if(t.subtreeFlags&ur&&null!==l)l.return=t,t=l;else{if(t===e)return!0;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(u)){if((a=o_(e,r))===Gb){var c=ia(e);0!==c&&(r=c,a=Vy(e,c))}if(a===qb){var d=oy;throw Zy(e,0),qy(e,r),Uy(e,Lr()),d}}e.finishedWork=u,e.finishedLanes=r,function(e,t,n){switch(t){case Hb:case qb:throw new Error("Root did not complete. This is a bug in React.");case Gb:u_(e,uy,hy);break;case Wb:if(qy(e,n),la(n)&&!R_()){var r=cy+dy-Lr();if(r>10){if(0!==oa(e,0))break;var o=e.suspendedLanes;if(!ba(o,n)){Ly(),xa(e,o);break}e.timeoutHandle=vu(u_.bind(null,e,uy,hy),r);break}}u_(e,uy,hy);break;case Yb:if(qy(e,n),function(e){return(e&Oo)===e}(n))break;if(!R_()){var a=function(e,t){for(var n=e.eventTimes,r=ea;t>0;){var o=ha(t),a=1<<o,i=n[o];i>r&&(r=i),t&=~a}return r}(e,n),i=a,s=Lr()-i,l=((u=s)<120?120:u<480?480:u<1080?1080:u<1920?1920:u<3e3?3e3:u<4320?4320:1960*Mb(u/1960))-s;if(l>10){e.timeoutHandle=vu(u_.bind(null,e,uy,hy),l);break}}u_(e,uy,hy);break;case Xb:u_(e,uy,hy);break;default:throw new Error("Unknown root exit status.")}var u}(e,a,r)}}return Uy(e,Lr()),e.callbackNode===n?zy.bind(null,e):null}function Vy(e,t){var n=ly;Ua(e)&&(Zy(e,t).flags|=rr,a("An error occurred during hydration. The server HTML was replaced with client content in <%s>.",e.containerInfo.nodeName.toLowerCase()));var r=o_(e,t);if(r!==Gb){var o=uy;uy=n,null!==o&&Hy(o)}return r}function Hy(e){null===uy?uy=e:uy.push.apply(uy,e)}function qy(e,t){t=_a(t,sy),function(e,t){e.suspendedLanes|=t,e.pingedLanes&=~t;for(var n=e.expirationTimes,r=t;r>0;){var o=ha(r),a=1<<o;n[o]=ea,r&=~a}}(e,t=_a(t,iy))}function Gy(e){if(jh=Fh,Fh=!1,(Qb&(zb|Vb))!==Ub)throw new Error("Should not already be working.");c_();var t=oa(e,0);if(!ga(t,So))return Uy(e,Lr()),null;var n=o_(e,t);if(0!==e.tag&&n===Gb){var r=ia(e);0!==r&&(t=r,n=Vy(e,r))}if(n===qb){var o=oy;throw Zy(e,0),qy(e,t),Uy(e,Lr()),o}if(n===Kb)throw new Error("Root did not complete. This is a bug in React.");var a=e.current.alternate;return e.finishedWork=a,e.finishedLanes=t,u_(e,uy,hy),Uy(e,Lr()),null}function Wy(e,t){var n=Qb;Qb|=1;try{return e(t)}finally{(Qb=n)!==Ub||Bb.isBatchingLegacy||(my(),Rc())}}function Yy(e){null!==wy&&0===wy.tag&&(Qb&(zb|Vb))===Ub&&c_();var t=Qb;Qb|=1;var n=Fb.transition,r=La();try{return Fb.transition=null,ja(Ia),e?e():void 0}finally{ja(r),Fb.transition=n,((Qb=t)&(zb|Vb))===Ub&&$c()}}function Xy(){return(Qb&(zb|Vb))!==Ub}function Ky(e,t){uc(ny,ty,e),ty=ya(ty,t)}function Qy(e){ty=ny.current,lc(ny,e)}function Zy(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,wu(n)),null!==Jb)for(var r=Jb.return;null!==r;){r.alternate;Pg(0,r),r=r.return}Zb=e;var o=X_(e.current,null);return Jb=o,ey=ty=t,ry=Hb,oy=null,ay=0,iy=0,sy=0,ly=null,uy=null,function(){if(null!==lf){for(var e=0;e<lf.length;e++){var t=lf[e],n=t.interleaved;if(null!==n){t.interleaved=null;var r=n.next,o=t.pending;if(null!==o){var a=o.next;o.next=r,n.next=a}t.pending=n}}lf=null}}(),wd.discardPendingWarnings(),o}function Jy(e,t){for(;;){var n=Jb;try{if(Zd(),xp(),He(),jb.current=null,null===n||null===n.return)return ry=qb,oy=t,void(Jb=null);2&n.mode&&qh(n,!0),no(),null!==t&&"object"==typeof t&&"function"==typeof t.then?po(n,t,ey):fo(n,t,ey),Pm(e,n.return,n,t,ey),l_(n)}catch(r){t=r,Jb===n&&null!==n?(n=n.return,Jb=n):n=Jb;continue}return}}function e_(){var e=Lb.current;return Lb.current=xh,null===e?xh:e}function t_(e){Lb.current=e}function n_(e){ay=ya(e,ay)}function r_(){ry!==Hb&&ry!==Wb&&ry!==Gb||(ry=Yb),null!==Zb&&(sa(ay)||sa(iy))&&qy(Zb,ey)}function o_(e,t){var n=Qb;Qb|=zb;var r=e_();if(Zb!==e||ey!==t){if(Kr){var o=e.memoizedUpdaters;o.size>0&&(k_(e,ey),o.clear()),ka(e,t)}hy=null,Zy(e,t)}for(ho(t);;)try{a_();break}catch(a){Jy(e,a)}if(Zd(),Qb=n,t_(r),null!==Jb)throw new Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");return mo(),Zb=null,ey=0,ry}function a_(){for(;null!==Jb;)s_(Jb)}function i_(){for(;null!==Jb&&!Nr();)s_(Jb)}function s_(e){var t,n=e.alternate;qe(e),2&e.mode?(Vh(e),t=w_(n,e,ty),qh(e,!0)):t=w_(n,e,ty),He(),e.memoizedProps=e.pendingProps,null===t?l_(e):Jb=t,jb.current=null}function l_(e){var t=e;do{var n=t.alternate,r=t.return;if(0===(t.flags&cr)){qe(t);var o=void 0;if(2&t.mode?(Vh(t),o=Eg(n,t,ty),qh(t,!1)):o=Eg(n,t,ty),He(),null!==o)return void(Jb=o)}else{var a=kg(0,t);if(null!==a)return a.flags&=32767,void(Jb=a);if(2&t.mode){qh(t,!1);for(var i=t.actualDuration,s=t.child;null!==s;)i+=s.actualDuration,s=s.sibling;t.actualDuration=i}if(null===r)return ry=Kb,void(Jb=null);r.flags|=cr,r.subtreeFlags=0,r.deletions=null}var l=t.sibling;if(null!==l)return void(Jb=l);Jb=t=r}while(null!==t);ry===Hb&&(ry=Xb)}function u_(e,t,n){var r=La(),o=Fb.transition;try{Fb.transition=null,ja(Ia),function(e,t,n,r){do{c_()}while(null!==wy);if(function(){wd.flushLegacyContextWarning(),wd.flushPendingUnsafeLifecycleWarnings()}(),(Qb&(zb|Vb))!==Ub)throw new Error("Should not already be working.");var o=e.finishedWork,i=e.finishedLanes;if(function(e){null!==Yr&&"function"==typeof Yr.markCommitStarted&&Yr.markCommitStarted(e)}(i),null===o)return eo(),null;0===i&&a("root.finishedLanes should not be empty during a commit. This is a bug in React.");if(e.finishedWork=null,e.finishedLanes=0,o===e.current)throw new Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");e.callbackNode=null,e.callbackPriority=0;var s=ya(o.lanes,o.childLanes);(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t;for(var r=e.entanglements,o=e.eventTimes,a=e.expirationTimes,i=n;i>0;){var s=ha(i),l=1<<s;r[s]=0,o[s]=ea,a[s]=ea,i&=~l}})(e,s),e===Zb&&(Zb=null,Jb=null,ey=0);0===(o.subtreeFlags&wr)&&0===(o.flags&wr)||vy||(vy=!0,Ty=n,O_(Ur,function(){return c_(),null}));var l=!!(15990&o.subtreeFlags),u=!!(15990&o.flags);if(l||u){var c=Fb.transition;Fb.transition=null;var d=La();ja(Ia);var f=Qb;Qb|=Vb,jb.current=null,zg(e,o),zh(),function(e,t,n){Cg=n,Dg=e,qe(t),cb(t,e),qe(t),Cg=null,Dg=null}(e,o,i),e.containerInfo,Bs(hu),li(pu),pu=null,hu=null,e.current=o,function(e){null!==Yr&&"function"==typeof Yr.markLayoutEffectsStarted&&Yr.markLayoutEffectsStarted(e)}(i),fb(o,e,i),null!==Yr&&"function"==typeof Yr.markLayoutEffectsStopped&&Yr.markLayoutEffectsStopped(),Mr(),Qb=f,ja(d),Fb.transition=c}else e.current=o,zh();var p=vy;vy?(vy=!1,wy=e,Sy=i):($y=0,Iy=null);s=e.pendingLanes,0===s&&(_y=null);p||__(e.current,!1);(function(e,t){if(Wr&&"function"==typeof Wr.onCommitFiberRoot)try{var n,r=(e.current.flags&nr)===nr;switch(t){case Ia:n=Fr;break;case Ca:n=Br;break;case Da:n=Ur;break;case Na:n=Vr;break;default:n=Ur}Wr.onCommitFiberRoot(Gr,e,n,r)}catch(o){Xr||(Xr=!0,a("React instrumentation encountered an error: %s",o))}})(o.stateNode,r),Kr&&e.memoizedUpdaters.clear();if(function(){Cb.forEach(function(e){return e()})}(),Uy(e,Lr()),null!==t)for(var h=e.onRecoverableError,m=0;m<t.length;m++){var g=t[m],b=g.stack,y=g.digest;h(g.value,{componentStack:b,digest:y})}if(by){by=!1;var _=yy;throw yy=null,_}ga(Sy,So)&&0!==e.tag&&c_();s=e.pendingLanes,ga(s,So)?(Fh=!0,e===Py?ky++:(ky=0,Py=e)):ky=0;$c(),eo()}(e,t,n,r)}finally{Fb.transition=o,ja(r)}return null}function c_(){if(null!==wy){var e=Ba(Sy),t=(o=Da)>(i=e)?o:i,n=Fb.transition,r=La();try{return Fb.transition=null,ja(t),function(){if(null===wy)return!1;var e=Ty;Ty=null;var t=wy,n=Sy;if(wy=null,Sy=0,(Qb&(zb|Vb))!==Ub)throw new Error("Cannot flush passive effects while already rendering.");Oy=!0,Ay=!1,function(e){null!==Yr&&"function"==typeof Yr.markPassiveEffectsStarted&&Yr.markPassiveEffectsStarted(e)}(n);var r=Qb;Qb|=Vb,Sb(t.current),_b(t,t.current,n,e);var o=xy;xy=[];for(var i=0;i<o.length;i++){Wg(0,o[i])}void(null!==Yr&&"function"==typeof Yr.markPassiveEffectsStopped&&Yr.markPassiveEffectsStopped()),__(t.current,!0),Qb=r,$c(),Ay?t===Iy?$y++:($y=0,Iy=t):$y=0;Oy=!1,Ay=!1,function(e){if(Wr&&"function"==typeof Wr.onPostCommitFiberRoot)try{Wr.onPostCommitFiberRoot(Gr,e)}catch(t){Xr||(Xr=!0,a("React instrumentation encountered an error: %s",t))}}(t);var s=t.current.stateNode;return s.effectDuration=0,s.passiveEffectDuration=0,!0}()}finally{ja(r),Fb.transition=n}}var o,i;return!1}function d_(e){return null!==_y&&_y.has(e)}var f_=function(e){by||(by=!0,yy=e)};function p_(e,t,n){var r=Sf(e,Sm(e,ym(n,t),So),So),o=Ly();null!==r&&(Sa(r,So,o),Uy(r,o))}function h_(e,t,n){var r;if(r=n,Zn(null,function(){throw r}),Jn(),$_(!1),3!==e.tag){var o=null;for(o=t;null!==o;){if(3===o.tag)return void p_(o,e,n);if(1===o.tag){var i=o.type,s=o.stateNode;if("function"==typeof i.getDerivedStateFromError||"function"==typeof s.componentDidCatch&&!d_(s)){var l=Sf(o,xm(o,ym(n,e),So),So),u=Ly();return void(null!==l&&(Sa(l,So,u),Uy(l,u)))}}o=o.return}a("Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Likely causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.\n\nError message:\n\n%s",n)}else p_(e,e,n)}function m_(e,t,n){var r=e.pingCache;null!==r&&r.delete(t);var o=Ly();xa(e,n),function(e){0!==e.tag&&Nb()&&null===Bb.current&&a("A suspended resource finished loading inside a test, but the event was not wrapped in act(...).\n\nWhen testing, code that resolves suspended data should be wrapped into act(...):\n\nact(() => {\n /* finish loading suspended data */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act")}(e),Zb===e&&ba(ey,n)&&(ry===Yb||ry===Wb&&la(ey)&&Lr()-cy<dy?Zy(e,0):sy=ya(sy,n)),Uy(e,o)}function g_(e,t){0===t&&(t=Fy(e));var n=Ly(),r=df(e,t);null!==r&&(Sa(r,t,n),Uy(r,n))}function b_(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),g_(e,n)}function y_(e,t){var n,r=0;switch(e.tag){case c:n=e.stateNode;var o=e.memoizedState;null!==o&&(r=o.retryLane);break;case m:n=e.stateNode;break;default:throw new Error("Pinged unknown suspense boundary type. This is probably a bug in React.")}null!==n&&n.delete(t),g_(e,r)}function __(e,t){qe(e),v_(e,gr,Rb),t&&v_(e,br,$b),v_(e,gr,Ob),t&&v_(e,br,Ab),He()}function v_(e,t,n){for(var r=e,o=null;null!==r;){var a=r.subtreeFlags&t;r!==o&&null!==r.child&&0!==a?r=r.child:(0!==(r.flags&t)&&n(r),r=null!==r.sibling?r.sibling:o=r.return)}}var w_,S_=null;function x_(e){if((Qb&zb)===Ub&&1&e.mode){var t=e.tag;if(2===t||3===t||1===t||0===t||t===l||t===d||t===f){var n=je(e)||"ReactComponent";if(null!==S_){if(S_.has(n))return;S_.add(n)}else S_=new Set([n]);var r=Be;try{qe(e),a("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.")}finally{r?qe(e):He()}}}}w_=function(e,t,n){var r=rv(null,t);try{return _g(e,t,n)}catch(a){if(Qc||null!==a&&"object"==typeof a&&"function"==typeof a.then)throw a;if(Zd(),xp(),Pg(0,t),rv(t,r),2&t.mode&&Vh(t),Zn(null,_g,null,e,t,n),Wn){var o=Jn();"object"==typeof o&&null!==o&&o._suppressLogging&&"object"==typeof a&&null!==a&&!a._suppressLogging&&(a._suppressLogging=!0)}throw a}};var T_,E_=!1;function k_(e,t){Kr&&e.memoizedUpdaters.forEach(function(n){Ea(e,n,t)})}T_=new Set;var P_={};function O_(e,t){var n=Bb.current;return null!==n?(n.push(t),P_):Cr(e,t)}function A_(e){if(e!==P_)return Dr(e)}function R_(){return null!==Bb.current}function $_(e){Ny=e}var I_=null,C_=null,D_=function(e){I_=e};function N_(e){if(null===I_)return e;var t=I_(e);return void 0===t?e:t.current}function M_(e){return N_(e)}function L_(e){if(null===I_)return e;var t=I_(e);if(void 0===t){if(null!=e&&"function"==typeof e.render){var n=N_(e.render);if(e.render!==n){var r={$$typeof:ie,render:n};return void 0!==e.displayName&&(r.displayName=e.displayName),r}}return e}return t.current}function j_(e,t){if(null===I_)return!1;var n=e.elementType,r=t.type,o=!1,a="object"==typeof r&&null!==r?r.$$typeof:null;switch(e.tag){case 1:"function"==typeof r&&(o=!0);break;case 0:("function"==typeof r||a===ce)&&(o=!0);break;case l:(a===ie||a===ce)&&(o=!0);break;case d:case f:(a===ue||a===ce)&&(o=!0);break;default:return!1}if(o){var i=I_(n);if(void 0!==i&&i===I_(r))return!0}return!1}function F_(e){null!==I_&&"function"==typeof WeakSet&&(null===C_&&(C_=new WeakSet),C_.add(e))}var B_=function(e,t){if(null!==I_){var n=t.staleFamilies,r=t.updatedFamilies;c_(),Yy(function(){z_(e.current,r,n)})}},U_=function(e,t){e.context===cc&&(c_(),Yy(function(){pv(t,e,null,null)}))};function z_(e,t,n){var r=e.alternate,o=e.child,a=e.sibling,i=e.tag,s=e.type,u=null;switch(i){case 0:case f:case 1:u=s;break;case l:u=s.render}if(null===I_)throw new Error("Expected resolveFamily to be set during hot reload.");var c=!1,d=!1;if(null!==u){var p=I_(u);void 0!==p&&(n.has(p)?d=!0:t.has(p)&&(1===i?d=!0:c=!0))}if(null!==C_&&(C_.has(e)||null!==r&&C_.has(r))&&(d=!0),d&&(e._debugNeedsRemount=!0),d||c){var h=df(e,So);null!==h&&By(h,e,So,ea)}null===o||d||z_(o,t,n),null!==a&&z_(a,t,n)}var V_,H_=function(e,t){var n=new Set,r=new Set(t.map(function(e){return e.current}));return q_(e.current,r,n),n};function q_(e,t,n){var r=e.child,o=e.sibling,a=e.tag,i=e.type,s=null;switch(a){case 0:case f:case 1:s=i;break;case l:s=i.render}var u=!1;null!==s&&t.has(s)&&(u=!0),u?function(e,t){var n=function(e,t){var n=e,r=!1;for(;;){if(5===n.tag)r=!0,t.add(n.stateNode);else if(null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)return r;for(;null===n.sibling;){if(null===n.return||n.return===e)return r;n=n.return}n.sibling.return=n.return,n=n.sibling}return!1}(e,t);if(n)return;var r=e;for(;;){switch(r.tag){case 5:return void t.add(r.stateNode);case 4:case 3:return void t.add(r.stateNode.containerInfo)}if(null===r.return)throw new Error("Expected to reach root first.");r=r.return}}(e,n):null!==r&&q_(r,t,n),null!==o&&q_(o,t,n)}V_=!1;try{Object.preventExtensions({})}catch(rw){V_=!0}function G_(e,t,n,r){this.tag=e,this.key=n,this.elementType=null,this.type=null,this.stateNode=null,this.return=null,this.child=null,this.sibling=null,this.index=0,this.ref=null,this.pendingProps=t,this.memoizedProps=null,this.updateQueue=null,this.memoizedState=null,this.dependencies=null,this.mode=r,this.flags=0,this.subtreeFlags=0,this.deletions=null,this.lanes=0,this.childLanes=0,this.alternate=null,this.actualDuration=Number.NaN,this.actualStartTime=Number.NaN,this.selfBaseDuration=Number.NaN,this.treeBaseDuration=Number.NaN,this.actualDuration=0,this.actualStartTime=-1,this.selfBaseDuration=0,this.treeBaseDuration=0,this._debugSource=null,this._debugOwner=null,this._debugNeedsRemount=!1,this._debugHookTypes=null,V_||"function"!=typeof Object.preventExtensions||Object.preventExtensions(this)}var W_=function(e,t,n,r){return new G_(e,t,n,r)};function Y_(e){var t=e.prototype;return!(!t||!t.isReactComponent)}function X_(e,t){var n=e.alternate;null===n?((n=W_(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n._debugSource=e._debugSource,n._debugOwner=e._debugOwner,n._debugHookTypes=e._debugHookTypes,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null,n.actualDuration=0,n.actualStartTime=-1),n.flags=e.flags&Sr,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue;var r=e.dependencies;switch(n.dependencies=null===r?null:{lanes:r.lanes,firstContext:r.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.selfBaseDuration=e.selfBaseDuration,n.treeBaseDuration=e.treeBaseDuration,n._debugNeedsRemount=e._debugNeedsRemount,n.tag){case 2:case 0:case f:n.type=N_(e.type);break;case 1:n.type=M_(e.type);break;case l:n.type=L_(e.type)}return n}function K_(e,t){e.flags&=14680066;var n=e.alternate;if(null===n)e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null,e.selfBaseDuration=0,e.treeBaseDuration=0;else{e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type;var r=n.dependencies;e.dependencies=null===r?null:{lanes:r.lanes,firstContext:r.firstContext},e.selfBaseDuration=n.selfBaseDuration,e.treeBaseDuration=n.treeBaseDuration}return e}function Q_(e,t,n,r,o,i){var f=2,p=e;if("function"==typeof e)Y_(e)?(f=1,p=M_(p)):p=N_(p);else if("string"==typeof e)f=5;else e:switch(e){case te:return J_(n.children,o,i,t);case ne:f=8,1&(o|=8)&&(o|=bo);break;case re:return function(e,t,n,r){"string"!=typeof e.id&&a('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.',typeof e.id);var o=W_(u,e,r,2|t);return o.elementType=re,o.lanes=n,o.stateNode={effectDuration:0,passiveEffectDuration:0},o}(n,o,i,t);case se:return function(e,t,n,r){var o=W_(c,e,r,t);return o.elementType=se,o.lanes=n,o}(n,o,i,t);case le:return function(e,t,n,r){var o=W_(m,e,r,t);return o.elementType=le,o.lanes=n,o}(n,o,i,t);case de:return ev(n,o,i,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case oe:f=s;break e;case ae:f=9;break e;case ie:f=l,p=L_(p);break e;case ue:f=d;break e;case ce:f=16,p=null;break e}var h="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(h+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var g=r?je(r):null;throw g&&(h+="\n\nCheck the render method of `"+g+"`."),new Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: "+(null==e?e:typeof e)+"."+h)}var b=W_(f,n,t,o);return b.elementType=e,b.type=p,b.lanes=i,b._debugOwner=r,b}function Z_(e,t,n){var r;r=e._owner;var o=Q_(e.type,e.key,e.props,r,t,n);return o._debugSource=e._source,o._debugOwner=e._owner,o}function J_(e,t,n,r){var o=W_(7,e,r,t);return o.lanes=n,o}function ev(e,t,n,r){var o=W_(b,e,r,t);o.elementType=de,o.lanes=n;return o.stateNode={isHidden:!1},o}function tv(e,t,n){var r=W_(6,e,null,t);return r.lanes=n,r}function nv(e,t,n){var r=null!==e.children?e.children:[],o=W_(4,r,e.key,t);return o.lanes=n,o.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},o}function rv(e,t){return null===e&&(e=W_(2,null,null,0)),e.tag=t.tag,e.key=t.key,e.elementType=t.elementType,e.type=t.type,e.stateNode=t.stateNode,e.return=t.return,e.child=t.child,e.sibling=t.sibling,e.index=t.index,e.ref=t.ref,e.pendingProps=t.pendingProps,e.memoizedProps=t.memoizedProps,e.updateQueue=t.updateQueue,e.memoizedState=t.memoizedState,e.dependencies=t.dependencies,e.mode=t.mode,e.flags=t.flags,e.subtreeFlags=t.subtreeFlags,e.deletions=t.deletions,e.lanes=t.lanes,e.childLanes=t.childLanes,e.alternate=t.alternate,e.actualDuration=t.actualDuration,e.actualStartTime=t.actualStartTime,e.selfBaseDuration=t.selfBaseDuration,e.treeBaseDuration=t.treeBaseDuration,e._debugSource=t._debugSource,e._debugOwner=t._debugOwner,e._debugNeedsRemount=t._debugNeedsRemount,e._debugHookTypes=t._debugHookTypes,e}function ov(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.pendingChildren=null,this.current=null,this.pingCache=null,this.finishedWork=null,this.timeoutHandle=-1,this.context=null,this.pendingContext=null,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=wa(0),this.expirationTimes=wa(ea),this.pendingLanes=0,this.suspendedLanes=0,this.pingedLanes=0,this.expiredLanes=0,this.mutableReadLanes=0,this.finishedLanes=0,this.entangledLanes=0,this.entanglements=wa(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null,this.effectDuration=0,this.passiveEffectDuration=0,this.memoizedUpdaters=new Set;for(var a=this.pendingUpdatersLaneMap=[],i=0;i<wo;i++)a.push(new Set);switch(t){case 1:this._debugRootType=n?"hydrateRoot()":"createRoot()";break;case 0:this._debugRootType=n?"hydrate()":"render()"}}function av(e,t,n,r,o,a,i,s,l,u){var c=new ov(e,t,n,s,l),d=function(e,t){var n;return 1===e?(n=1,!0===t&&(n|=8,n|=bo)):n=0,Kr&&(n|=2),W_(3,null,null,n)}(t,a);c.current=d,d.stateNode=c;var f={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null};return d.memoizedState=f,_f(d),c}var iv,sv,lv="18.3.1";function uv(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return function(e){if(A(e))a("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",O(e)),R(e)}(r),{$$typeof:ee,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}function cv(e){if(!e)return cc;var t=er(e),n=Ec(t);if(1===t.tag){var r=t.type;if(yc(r))return Sc(t,r,n)}return n}function dv(e,t,n,r,o,a,i,s){return av(e,t,!1,null,0,r,0,a,i)}function fv(e,t,n,r,o,a,i,s,l,u){var c=av(n,r,!0,e,0,a,0,s,l);c.context=cv(null);var d=c.current,f=Ly(),p=jy(d),h=wf(f,p);return h.callback=null!=t?t:null,Sf(d,h,p),function(e,t,n){e.current.lanes=t,Sa(e,t,n),Uy(e,n)}(c,p,f),c}function pv(e,t,n,r){!function(e,t){if(Wr&&"function"==typeof Wr.onScheduleFiberRoot)try{Wr.onScheduleFiberRoot(Gr,e,t)}catch(n){Xr||(Xr=!0,a("React instrumentation encountered an error: %s",n))}}(t,e);var o=t.current,i=Ly(),s=jy(o);!function(e){null!==Yr&&"function"==typeof Yr.markRenderScheduled&&Yr.markRenderScheduled(e)}(s);var l=cv(n);null===t.context?t.context=l:t.pendingContext=l,Ue&&null!==Be&&!iv&&(iv=!0,a("Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.\n\nCheck the render method of %s.",je(Be)||"Unknown"));var u=wf(i,s);u.payload={element:e},null!==(r=void 0===r?null:r)&&("function"!=typeof r&&a("render(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",r),u.callback=r);var c=Sf(o,u,s);return null!==c&&(By(c,o,s,i),xf(c,o,s)),s}function hv(e){var t=e.current;return t.child?(t.child.tag,t.child.stateNode):null}function mv(e,t){var n,r,o=e.memoizedState;null!==o&&null!==o.dehydrated&&(o.retryLane=(n=o.retryLane,r=t,0!==n&&n<r?n:r))}function gv(e,t){mv(e,t);var n=e.alternate;n&&mv(n,t)}function bv(e){var t=$r(e);return null===t?null:t.stateNode}iv=!1,sv={};var yv=function(e){return null};var _v=function(e){return!1};var vv,wv,Sv,xv,Tv,Ev,kv,Pv,Ov,Av=function(e,t,n){var r=t[n],o=vt(e)?e.slice():we({},e);return n+1===t.length?(vt(o)?o.splice(r,1):delete o[r],o):(o[r]=Av(e[r],t,n+1),o)},Rv=function(e,t){return Av(e,t,0)},$v=function(e,t,n,r){var o=t[r],a=vt(e)?e.slice():we({},e);r+1===t.length?(a[n[r]]=a[o],vt(a)?a.splice(o,1):delete a[o]):a[o]=$v(e[o],t,n,r+1);return a},Iv=function(e,t,n){if(t.length===n.length){for(var r=0;r<n.length-1;r++)if(t[r]!==n[r])return void o("copyWithRename() expects paths to be the same except for the deepest key");return $v(e,t,n,0)}o("copyWithRename() expects paths of the same length")},Cv=function(e,t,n,r){if(n>=t.length)return r;var o=t[n],a=vt(e)?e.slice():we({},e);return a[o]=Cv(e[o],t,n+1,r),a},Dv=function(e,t,n){return Cv(e,t,0,n)},Nv=function(e,t){for(var n=e.memoizedState;null!==n&&t>0;)n=n.next,t--;return n};function Mv(e){var t=Ar(e);return null===t?null:t.stateNode}function Lv(e){return null}function jv(){return Be}vv=function(e,t,n,r){var o=Nv(e,t);if(null!==o){var a=Dv(o.memoizedState,n,r);o.memoizedState=a,o.baseState=a,e.memoizedProps=we({},e.memoizedProps);var i=df(e,So);null!==i&&By(i,e,So,ea)}},wv=function(e,t,n){var r=Nv(e,t);if(null!==r){var o=Rv(r.memoizedState,n);r.memoizedState=o,r.baseState=o,e.memoizedProps=we({},e.memoizedProps);var a=df(e,So);null!==a&&By(a,e,So,ea)}},Sv=function(e,t,n,r){var o=Nv(e,t);if(null!==o){var a=Iv(o.memoizedState,n,r);o.memoizedState=a,o.baseState=a,e.memoizedProps=we({},e.memoizedProps);var i=df(e,So);null!==i&&By(i,e,So,ea)}},xv=function(e,t,n){e.pendingProps=Dv(e.memoizedProps,t,n),e.alternate&&(e.alternate.pendingProps=e.pendingProps);var r=df(e,So);null!==r&&By(r,e,So,ea)},Tv=function(e,t){e.pendingProps=Rv(e.memoizedProps,t),e.alternate&&(e.alternate.pendingProps=e.pendingProps);var n=df(e,So);null!==n&&By(n,e,So,ea)},Ev=function(e,t,n){e.pendingProps=Iv(e.memoizedProps,t,n),e.alternate&&(e.alternate.pendingProps=e.pendingProps);var r=df(e,So);null!==r&&By(r,e,So,ea)},kv=function(e){var t=df(e,So);null!==t&&By(t,e,So,ea)},Pv=function(e){yv=e},Ov=function(e){_v=e};var Fv="function"==typeof reportError?reportError:function(e){console.error(e)};function Bv(e){this._internalRoot=e}function Uv(e){this._internalRoot=e}function zv(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Vv(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Hv(e){1===e.nodeType&&e.tagName&&"BODY"===e.tagName.toUpperCase()&&a("createRoot(): Creating roots directly with document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try using a container element created for your app."),Wu(e)&&(e._reactRootContainer?a("You are calling ReactDOMClient.createRoot() on a container that was previously passed to ReactDOM.render(). This is not supported."):a("You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it."))}Uv.prototype.render=Bv.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw new Error("Cannot update an unmounted root.");"function"==typeof arguments[1]?a("render(...): does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()."):zv(arguments[1])?a("You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root."):void 0!==arguments[1]&&a("You passed a second argument to root.render(...) but it only accepts one argument.");var n=t.containerInfo;if(8!==n.nodeType){var r=bv(t.current);r&&r.parentNode!==n&&a("render(...): It looks like the React-rendered content of the root container was removed without using React. This is not supported and will cause errors. Instead, call root.unmount() to empty a root's container.")}pv(e,t,null,null)},Uv.prototype.unmount=Bv.prototype.unmount=function(){"function"==typeof arguments[0]&&a("unmount(...): does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;Xy()&&a("Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition."),Yy(function(){pv(null,e,null,null)}),Gu(t)}},Uv.prototype.unstable_scheduleHydration=function(e){e&&function(e){for(var t=Ra(),n={blockedOn:null,target:e,priority:t},r=0;r<Ka.length&&Fa(t,Ka[r].priority);r++);Ka.splice(r,0,n),0===r&&ei(n)}(e)};var qv,Gv=n.ReactCurrentOwner;function Wv(e){return e?9===e.nodeType?e.documentElement:e.firstChild:null}function Yv(){}function Xv(e,t,n,r,o){qv(n),function(e,t){null!==e&&"function"!=typeof e&&a("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",t,e)}(void 0===o?null:o,"render");var i,s=n._reactRootContainer;if(s){if("function"==typeof o){var l=o;o=function(){var e=hv(i);l.call(e)}}pv(t,i=s,e,o)}else i=function(e,t,n,r,o){if(o){if("function"==typeof r){var a=r;r=function(){var e=hv(i);a.call(e)}}var i=fv(t,r,e,0,0,!1,0,"",Yv);return e._reactRootContainer=i,qu(i.current,e),gl(8===e.nodeType?e.parentNode:e),Yy(),i}for(var s;s=e.lastChild;)e.removeChild(s);if("function"==typeof r){var l=r;r=function(){var e=hv(u);l.call(e)}}var u=dv(e,0,0,!1,0,"",Yv);return e._reactRootContainer=u,qu(u.current,e),gl(8===e.nodeType?e.parentNode:e),Yy(function(){pv(t,u,n,r)}),u}(n,t,e,o,r);return hv(i)}qv=function(e){if(e._reactRootContainer&&8!==e.nodeType){var t=bv(e._reactRootContainer.current);t&&t.parentNode!==e&&a("render(...): It looks like the React-rendered content of this container was removed without using React. This is not supported and will cause errors. Instead, call ReactDOM.unmountComponentAtNode to empty a container.")}var n=!!e._reactRootContainer,r=Wv(e);!(!r||!Xu(r))&&!n&&a("render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render."),1===e.nodeType&&e.tagName&&"BODY"===e.tagName.toUpperCase()&&a("render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app.")};var Kv=!1;var Qv=!1;Pa=function(e){switch(e.tag){case 3:var t=e.stateNode;if(Ua(t)){var n=function(e){return ra(e.pendingLanes)}(t);!function(e,t){0!==t&&(Ta(e,ya(t,So)),Uy(e,Lr()),(Qb&(zb|Vb))===Ub&&(my(),$c()))}(t,n)}break;case c:Yy(function(){var t=df(e,So);if(null!==t){var n=Ly();By(t,e,So,n)}}),gv(e,So)}},function(e){Oa=e}(function(e){if(e.tag===c){var t=Yo,n=df(e,t);if(null!==n)By(n,e,t,Ly());gv(e,t)}}),function(e){Aa=e}(function(e){if(e.tag===c){var t=jy(e),n=df(e,t);if(null!==n)By(n,e,t,Ly());gv(e,t)}}),function(e){Ra=e}(La),function(e){$a=e}(function(e,t){var n=Ma;try{return Ma=e,t()}finally{Ma=n}}),"function"==typeof Map&&null!=Map.prototype&&"function"==typeof Map.prototype.forEach&&"function"==typeof Set&&null!=Set.prototype&&"function"==typeof Set.prototype.clear&&"function"==typeof Set.prototype.forEach||a("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),An=function(e,t,n){switch(t){case"input":return void ft(e,n);case"textarea":return void function(e,t){At(e,t)}(e,n);case"select":return void function(e,t){var n=e,r=t.value;null!=r&&xt(n,!!t.multiple,r,!1)}(e,n)}},Nn=Wy,Mn=Yy;var Zv,Jv,ew,tw={usingClientEntryPoint:!1,Events:[Xu,Ku,Qu,Cn,Dn,Wy]};if(!(Jv=(Zv={findFiberByHostInstance:Yu,bundleType:1,version:lv,rendererPackageName:"react-dom"}).findFiberByHostInstance,ew=n.ReactCurrentDispatcher,function(e){if("undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled)return!0;if(!t.supportsFiber)return a("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://reactjs.org/link/react-devtools"),!0;try{e=we({},e,{getLaneLabelMap:Jr,injectProfilingHooks:Zr}),Gr=t.inject(e),Wr=t}catch(n){a("React instrumentation encountered an error: %s.",n)}return!!t.checkDCE}({bundleType:Zv.bundleType,version:Zv.version,rendererPackageName:Zv.rendererPackageName,rendererConfig:Zv.rendererConfig,overrideHookState:vv,overrideHookStateDeletePath:wv,overrideHookStateRenamePath:Sv,overrideProps:xv,overridePropsDeletePath:Tv,overridePropsRenamePath:Ev,setErrorHandler:Pv,setSuspenseHandler:Ov,scheduleUpdate:kv,currentDispatcherRef:ew,findHostInstanceByFiber:Mv,findFiberByHostInstance:Jv||Lv,findHostInstancesForRefresh:H_,scheduleRefresh:B_,scheduleRoot:U_,setRefreshHandler:D_,getCurrentFiber:jv,reconcilerVersion:lv}))&&k&&window.top===window.self&&(navigator.userAgent.indexOf("Chrome")>-1&&-1===navigator.userAgent.indexOf("Edge")||navigator.userAgent.indexOf("Firefox")>-1)){var nw=window.location.protocol;/^(https?|file):$/.test(nw)&&console.info("%cDownload the React DevTools for a better development experience: https://reactjs.org/link/react-devtools"+("file:"===nw?"\nYou might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq":""),"font-weight:bold")}reactDom_development.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tw,reactDom_development.createPortal=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!zv(t))throw new Error("Target container is not a DOM element.");return uv(e,t,null,n)},reactDom_development.createRoot=function(e,t){return tw.usingClientEntryPoint||a('You are importing createRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".'),function(e,t){if(!zv(e))throw new Error("createRoot(...): Target container is not a DOM element.");Hv(e);var n=!1,r="",i=Fv;null!=t&&(t.hydrate?o("hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead."):"object"==typeof t&&null!==t&&t.$$typeof===J&&a("You passed a JSX element to createRoot. You probably meant to call root.render instead. Example usage:\n\n let root = createRoot(domContainer);\n root.render(<App />);"),!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onRecoverableError&&(i=t.onRecoverableError),void 0!==t.transitionCallbacks&&t.transitionCallbacks);var s=dv(e,1,0,n,0,r,i);return qu(s.current,e),gl(8===e.nodeType?e.parentNode:e),new Bv(s)}(e,t)},reactDom_development.findDOMNode=function(e){Kv||(Kv=!0,a("findDOMNode is deprecated and will be removed in the next major release. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node"));var t=Gv.current;return null!==t&&null!==t.stateNode&&(t.stateNode._warnedAboutRefsInRender||a("%s is accessing findDOMNode inside its render(). render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",Me(t.type)||"A component"),t.stateNode._warnedAboutRefsInRender=!0),null==e?null:1===e.nodeType?e:function(e,t){var n=er(e);if(void 0===n){if("function"==typeof e.render)throw new Error("Unable to find node on an unmounted component.");var r=Object.keys(e).join(",");throw new Error("Argument appears to not be a ReactComponent. Keys: "+r)}var o=Ar(n);if(null===o)return null;if(8&o.mode){var i=je(n)||"Component";if(!sv[i]){sv[i]=!0;var s=Be;try{qe(o),8&n.mode?a("%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node",t,t,i):a("%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node",t,t,i)}finally{s?qe(s):He()}}}return o.stateNode}(e,"findDOMNode")},reactDom_development.flushSync=function(e){return Xy()&&a("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."),Yy(e)},reactDom_development.hydrate=function(e,t,n){if(a("ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"),!Vv(t))throw new Error("Target container is not a DOM element.");return Wu(t)&&void 0===t._reactRootContainer&&a("You are calling ReactDOM.hydrate() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call hydrateRoot(container, element)?"),Xv(null,e,t,!0,n)},reactDom_development.hydrateRoot=function(e,t,n){return tw.usingClientEntryPoint||a('You are importing hydrateRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".'),function(e,t,n){if(!zv(e))throw new Error("hydrateRoot(...): Target container is not a DOM element.");Hv(e),void 0===t&&a("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");var r=null!=n&&n.hydratedSources||null,o=!1,i="",s=Fv;null!=n&&(!0===n.unstable_strictMode&&(o=!0),void 0!==n.identifierPrefix&&(i=n.identifierPrefix),void 0!==n.onRecoverableError&&(s=n.onRecoverableError));var l=fv(t,null,e,1,0,o,0,i,s);if(qu(l.current,e),gl(e),r)for(var u=0;u<r.length;u++)Zf(l,r[u]);return new Uv(l)}(e,t,n)},reactDom_development.render=function(e,t,n){if(a("ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"),!Vv(t))throw new Error("Target container is not a DOM element.");return Wu(t)&&void 0===t._reactRootContainer&&a("You are calling ReactDOM.render() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.render(element)?"),Xv(null,e,t,!1,n)},reactDom_development.unmountComponentAtNode=function(e){if(Qv||(Qv=!0,a("unmountComponentAtNode is deprecated and will be removed in the next major release. Switch to the createRoot API. Learn more: https://reactjs.org/link/switch-to-createroot")),!Vv(e))throw new Error("unmountComponentAtNode(...): Target container is not a DOM element.");if(Wu(e)&&void 0===e._reactRootContainer&&a("You are calling ReactDOM.unmountComponentAtNode() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.unmount()?"),e._reactRootContainer){var t=Wv(e);return t&&!Xu(t)&&a("unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React."),Yy(function(){Xv(null,null,e,!1,function(){e._reactRootContainer=null,Gu(e)})}),!0}var n=Wv(e),r=!(!n||!Xu(n)),o=1===e.nodeType&&Vv(e.parentNode)&&!!e.parentNode._reactRootContainer;return r&&a("unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s",o?"You may have accidentally passed in a React root node instead of its container.":"Instead, have the parent component update its state and rerender in order to remove this component."),!1},reactDom_development.unstable_batchedUpdates=Wy,reactDom_development.unstable_renderSubtreeIntoContainer=function(e,t,n,r){return function(e,t,n,r){if(a("ReactDOM.unstable_renderSubtreeIntoContainer() is no longer supported in React 18. Consider using a portal instead. Until you switch to the createRoot API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"),!Vv(n))throw new Error("Target container is not a DOM element.");if(null==e||void 0===e._reactInternals)throw new Error("parentComponent must be a valid React Component");return Xv(e,t,n,!1,r)}(e,t,n,r)},reactDom_development.version=lv,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),reactDom_development}function checkDCE(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){if("production"!==process.env.NODE_ENV)throw new Error("^_^");try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(e){console.error(e)}}}"production"===process.env.NODE_ENV?(checkDCE(),reactDom.exports=requireReactDom_production_min()):reactDom.exports=requireReactDom_development();var reactDomExports=reactDom.exports,createRoot,m=reactDomExports;if("production"===process.env.NODE_ENV)createRoot=m.createRoot,m.hydrateRoot;else{var i=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;createRoot=function(e,t){i.usingClientEntryPoint=!0;try{return m.createRoot(e,t)}finally{i.usingClientEntryPoint=!1}}}var reactExports=requireReact();const LogoIcon=()=>jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M16 4C9.37 4 4 9.37 4 16s5.37 12 12 12 12-5.37 12-12S22.63 4 16 4z",fill:"#2563eb"}),jsxRuntimeExports.jsx("path",{d:"M16 8c-2.2 0-4 1.8-4 4v4c0 2.2 1.8 4 4 4s4-1.8 4-4v-4c0-2.2-1.8-4-4-4z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M22 16c0 3.3-2.7 6-6 6s-6-2.7-6-6H8c0 4.1 3.1 7.5 7 7.9V26h2v-2.1c3.9-.4 7-3.8 7-7.9h-2z",fill:"white"})]}),MicIcon=()=>jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"}),jsxRuntimeExports.jsx("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}),jsxRuntimeExports.jsx("line",{x1:"12",x2:"12",y1:"19",y2:"22"})]}),CloseIcon=()=>jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntimeExports.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),MinimizeIcon=()=>jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),jsxRuntimeExports.jsx("path",{d:"M9 3v18"})]}),ErrorIcon=()=>jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"10"}),jsxRuntimeExports.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),jsxRuntimeExports.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),ChatIcon=()=>jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntimeExports.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})});function FloatingPanel({children:e,position:t,onClose:n,onMinimize:r}){const o=reactExports.useRef(null),a=reactExports.useRef(!1),i=reactExports.useRef({x:0,y:0,right:20,bottom:20}),s=reactExports.useCallback(e=>{if(e.target.closest("button"))return;a.current=!0;const t=o.current;t&&(i.current={x:e.clientX,y:e.clientY,right:parseInt(t.style.right||"20"),bottom:parseInt(t.style.bottom||"20")})},[]);reactExports.useEffect(()=>{const e=e=>{if(!a.current||!o.current)return;const t=i.current.x-e.clientX,n=i.current.y-e.clientY;o.current.style.right=`${i.current.right+t}px`,o.current.style.bottom=`${i.current.bottom+n}px`},t=()=>{a.current=!1};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[]);const l={bottom:(null==t?void 0:t.bottom)??20,right:(null==t?void 0:t.right)??20,...void 0!==(null==t?void 0:t.top)&&{top:t.top,bottom:"auto"},...void 0!==(null==t?void 0:t.left)&&{left:t.left,right:"auto"}};return jsxRuntimeExports.jsxs("div",{ref:o,className:"scribe-panel",style:l,children:[jsxRuntimeExports.jsxs("div",{className:"panel-header",onMouseDown:s,children:[jsxRuntimeExports.jsxs("div",{className:"drag-handle",children:[jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{})]}),jsxRuntimeExports.jsxs("div",{className:"header-actions",children:[jsxRuntimeExports.jsx("button",{className:"header-btn",onClick:r,title:"Minimize",children:jsxRuntimeExports.jsx(MinimizeIcon,{})}),jsxRuntimeExports.jsx("button",{className:"header-btn",onClick:n,title:"Close",children:jsxRuntimeExports.jsx(CloseIcon,{})})]})]}),jsxRuntimeExports.jsx("div",{className:"panel-content",children:e})]})}function ConfigState({onSubmit:e,initialApiKey:t="",initialBaseUrl:n=""}){const[r,o]=reactExports.useState(t),[a,i]=reactExports.useState(n),[s,l]=reactExports.useState("");return jsxRuntimeExports.jsxs("div",{className:"config-state",children:[jsxRuntimeExports.jsxs("div",{className:"logo",children:[jsxRuntimeExports.jsx("div",{className:"logo-icon",children:jsxRuntimeExports.jsx(LogoIcon,{})}),jsxRuntimeExports.jsx("span",{className:"logo-text",children:"eka.scribe"})]}),jsxRuntimeExports.jsxs("form",{className:"config-form",onSubmit:t=>{t.preventDefault(),a.trim()?(l(""),e(r.trim(),a.trim())):l("Base URL is required")},children:[jsxRuntimeExports.jsxs("div",{className:"form-group",children:[jsxRuntimeExports.jsx("label",{htmlFor:"eka-api-key",children:"API Key"}),jsxRuntimeExports.jsx("input",{id:"eka-api-key",type:"text",value:r,onChange:e=>o(e.target.value),placeholder:"Enter your API key (optional)"})]}),jsxRuntimeExports.jsxs("div",{className:"form-group",children:[jsxRuntimeExports.jsx("label",{htmlFor:"eka-base-url",children:"Base URL"}),jsxRuntimeExports.jsx("input",{id:"eka-base-url",type:"text",value:a,onChange:e=>i(e.target.value),placeholder:"https://api.eka.care",required:!0})]}),s&&jsxRuntimeExports.jsx("p",{className:"config-error",children:s}),jsxRuntimeExports.jsx("button",{type:"submit",className:"config-submit-btn",children:"Continue"})]})]})}function IdleState({onStartRecording:e}){return jsxRuntimeExports.jsxs("div",{className:"idle-state",children:[jsxRuntimeExports.jsxs("div",{className:"logo",children:[jsxRuntimeExports.jsx("div",{className:"logo-icon",children:jsxRuntimeExports.jsx(LogoIcon,{})}),jsxRuntimeExports.jsx("span",{className:"logo-text",children:"eka.scribe"})]}),jsxRuntimeExports.jsxs("button",{className:"start-btn",onClick:e,children:["Start Recording",jsxRuntimeExports.jsx("span",{className:"mic-icon",children:jsxRuntimeExports.jsx(MicIcon,{})})]})]})}function PermissionState({onRequestPermission:e}){return jsxRuntimeExports.jsxs("div",{className:"permission-state",children:[jsxRuntimeExports.jsx("div",{className:"permission-icon",children:jsxRuntimeExports.jsx(MicIcon,{})}),jsxRuntimeExports.jsxs("p",{className:"permission-text",children:["Microphone access is required to record audio.",jsxRuntimeExports.jsx("br",{}),"Please allow access when prompted."]}),jsxRuntimeExports.jsx("button",{className:"permission-btn",onClick:e,children:"Allow Microphone"})]})}function formatTime(e){const t=e%60;return`${Math.floor(e/60).toString().padStart(2,"0")}:${t.toString().padStart(2,"0")}`}function RecordingState({elapsedTime:e,isPaused:t,onPause:n,onResume:r,onStop:o}){return jsxRuntimeExports.jsxs("div",{className:"recording-state",children:[jsxRuntimeExports.jsxs("div",{className:"recording-indicator",children:[jsxRuntimeExports.jsx("div",{className:"recording-icon "+(t?"":"active"),children:jsxRuntimeExports.jsx(ChatIcon,{})}),jsxRuntimeExports.jsx("span",{className:"timer",children:formatTime(e)})]}),jsxRuntimeExports.jsxs("div",{className:"recording-actions",children:[t?jsxRuntimeExports.jsx("button",{className:"resume-btn",onClick:r,children:"Resume"}):jsxRuntimeExports.jsx("button",{className:"pause-btn",onClick:n,children:"Pause"}),jsxRuntimeExports.jsx("button",{className:"stop-btn",onClick:o,title:"Stop recording",children:jsxRuntimeExports.jsx("div",{className:"stop-icon"})})]})]})}function ProcessingState(){return jsxRuntimeExports.jsxs("div",{className:"processing-state",children:[jsxRuntimeExports.jsx("div",{className:"spinner"}),jsxRuntimeExports.jsx("p",{className:"processing-text",children:"Processing your recording..."})]})}function ResultsState({result:e,onNewRecording:t}){return jsxRuntimeExports.jsxs("div",{className:"results-state",children:[jsxRuntimeExports.jsxs("div",{className:"results-header",children:[jsxRuntimeExports.jsx("span",{className:"results-title",children:"Recording Complete"}),jsxRuntimeExports.jsx("button",{className:"new-recording-btn",onClick:t,children:"New Recording"})]}),jsxRuntimeExports.jsx("div",{className:"results-content",children:jsxRuntimeExports.jsxs("div",{className:"transcript-section",children:[jsxRuntimeExports.jsx("div",{className:"section-title",children:"Transcript"}),jsxRuntimeExports.jsx("div",{className:"transcript-text",children:e.transcript||"No transcript available."})]})})]})}function ErrorState({message:e,onRetry:t}){return jsxRuntimeExports.jsxs("div",{className:"error-state",children:[jsxRuntimeExports.jsx("div",{className:"error-icon",children:jsxRuntimeExports.jsx(ErrorIcon,{})}),jsxRuntimeExports.jsx("p",{className:"error-message",children:e}),jsxRuntimeExports.jsx("button",{className:"retry-btn",onClick:t,children:"Try Again"})]})}const WELL_KNOWN_PATH="/.well-known/medscribealliance";var SessionStatus,SessionStatus2,TemplateStatus,TemplateStatus2,UploadType,UploadType2,ErrorCode,ErrorCode2,HttpStatus,HttpStatus2;SessionStatus2=SessionStatus||(SessionStatus={}),SessionStatus2.CREATED="created",SessionStatus2.PROCESSING="processing",SessionStatus2.COMPLETED="completed",SessionStatus2.PARTIAL="partial",SessionStatus2.FAILED="failed",TemplateStatus2=TemplateStatus||(TemplateStatus={}),TemplateStatus2.SUCCESS="success",TemplateStatus2.FAILED="failed",UploadType2=UploadType||(UploadType={}),UploadType2.CHUNKED="chunked",UploadType2.SINGLE="single",ErrorCode2=ErrorCode||(ErrorCode={}),ErrorCode2.AUTHENTICATION_FAILED="authentication_failed",ErrorCode2.TOKEN_EXPIRED="token_expired",ErrorCode2.INVALID_API_KEY="invalid_api_key",ErrorCode2.FORBIDDEN="forbidden",ErrorCode2.RATE_LIMIT_EXCEEDED="rate_limit_exceeded",ErrorCode2.SESSION_NOT_FOUND="session_not_found",ErrorCode2.TEMPLATE_NOT_FOUND="template_not_found",ErrorCode2.WEBHOOK_NOT_FOUND="webhook_not_found",ErrorCode2.SESSION_EXPIRED="session_expired",ErrorCode2.INVALID_REQUEST="invalid_request",ErrorCode2.INVALID_AUDIO_FORMAT="invalid_audio_format",ErrorCode2.CHUNK_TOO_LARGE="chunk_too_large",ErrorCode2.INVALID_TEMPLATE="invalid_template",ErrorCode2.MISSING_REQUIRED_FIELD="missing_required_field",ErrorCode2.PROCESSING_FAILED="processing_failed",ErrorCode2.AUDIO_QUALITY_POOR="audio_quality_poor",ErrorCode2.AUDIO_TOO_SHORT="audio_too_short",ErrorCode2.LANGUAGE_UNSUPPORTED="language_unsupported",ErrorCode2.INTERNAL_ERROR="internal_error",ErrorCode2.SERVICE_UNAVAILABLE="service_unavailable",HttpStatus2=HttpStatus||(HttpStatus={}),HttpStatus2[HttpStatus2.OK=200]="OK",HttpStatus2[HttpStatus2.CREATED=201]="CREATED",HttpStatus2[HttpStatus2.ACCEPTED=202]="ACCEPTED",HttpStatus2[HttpStatus2.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",HttpStatus2[HttpStatus2.BAD_REQUEST=400]="BAD_REQUEST",HttpStatus2[HttpStatus2.UNAUTHORIZED=401]="UNAUTHORIZED",HttpStatus2[HttpStatus2.FORBIDDEN=403]="FORBIDDEN",HttpStatus2[HttpStatus2.NOT_FOUND=404]="NOT_FOUND",HttpStatus2[HttpStatus2.GONE=410]="GONE",HttpStatus2[HttpStatus2.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",HttpStatus2[HttpStatus2.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",HttpStatus2[HttpStatus2.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",HttpStatus2[HttpStatus2.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE";class DiscoveryAPI{constructor(e){this.cachedDiscovery=null,this.cacheTimestamp=0,this.cacheDuration=36e5,this.httpClient=e}async getDiscovery(e,t=!1){const n=Date.now();if(!t&&this.cachedDiscovery&&n-this.cacheTimestamp<this.cacheDuration)return this.cachedDiscovery;const r=e+WELL_KNOWN_PATH,o=await this.httpClient.get(r);return this.cachedDiscovery=o,this.cacheTimestamp=n,o}clearCache(){this.cachedDiscovery=null,this.cacheTimestamp=0}getCachedDiscovery(){const e=Date.now();return this.cachedDiscovery&&e-this.cacheTimestamp<this.cacheDuration?this.cachedDiscovery:null}}var ajv={exports:{}},core$2={},validate={},boolSchema={},errors={},codegen={},code$1={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class r extends t{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e),{})}}function o(e,...t){const n=[e[0]];let o=0;for(;o<t.length;)s(n,t[o]),n.push(e[++o]);return new r(n)}e._Code=r,e.nil=new r(""),e._=o;const a=new r("+");function i(e,...t){const n=[u(e[0])];let o=0;for(;o<t.length;)n.push(a),s(n,t[o]),n.push(a,u(e[++o]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===a){const n=l(e[t-1],e[t+1]);if(void 0!==n){e.splice(t-1,3,n);continue}e[t++]="+"}t++}}(n),new r(n)}function s(e,t){var o;t instanceof r?e.push(...t._items):t instanceof n?e.push(t):e.push("number"==typeof(o=t)||"boolean"==typeof o||null===o?o:u(Array.isArray(o)?o.join(","):o))}function l(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof n||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof n?void 0:`"${e}${t.slice(1)}`}function u(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.str=i,e.addCodeArg=s,e.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:i`${e}${t}`},e.stringify=function(e){return new r(u(e))},e.safeStringify=u,e.getProperty=function(t){return"string"==typeof t&&e.IDENTIFIER.test(t)?new r(`.${t}`):o`[${t}]`},e.getEsmExportName=function(t){if("string"==typeof t&&e.IDENTIFIER.test(t))return new r(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)},e.regexpCode=function(e){return new r(e.toString())}}(code$1);var scope={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=code$1;class n extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var r,o;(o=r||(e.UsedValueState=r={}))[o.Started=0]="Started",o[o.Completed=1]="Completed",e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class a{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,n;if((null===(n=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===n?void 0:n.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}e.Scope=a;class i extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:n,itemIndex:r}){this.value=e,this.scopePath=t._`.${new t.Name(n)}[${r}]`}}e.ValueScopeName=i;const s=t._`\n`;e.ValueScope=class extends a{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?s:t.nil}}get(){return this._scope}name(e){return new i(e,this._newName(e))}value(e,t){var n;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const r=this.toName(e),{prefix:o}=r,a=null!==(n=t.key)&&void 0!==n?n:t.ref;let i=this._values[o];if(i){const e=i.get(a);if(e)return e}else i=this._values[o]=new Map;i.set(a,r);const s=this._scope[o]||(this._scope[o]=[]),l=s.length;return s[l]=t.ref,r.setValue(t,{property:o,itemIndex:l}),r}getValue(e,t){const n=this._values[e];if(n)return n.get(t)}scopeRefs(e,n=this._values){return this._reduceValues(n,n=>{if(void 0===n.scopePath)throw new Error(`CodeGen: name "${n}" has no value`);return t._`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,n)}_reduceValues(o,a,i={},s){let l=t.nil;for(const u in o){const c=o[u];if(!c)continue;const d=i[u]=i[u]||new Map;c.forEach(o=>{if(d.has(o))return;d.set(o,r.Started);let i=a(o);if(i){const n=this.opts.es5?e.varKinds.var:e.varKinds.const;l=t._`${l}${n} ${o} = ${i};${this.opts._n}`}else{if(!(i=null==s?void 0:s(o)))throw new n(o);l=t._`${l}${i}${this.opts._n}`}d.set(o,r.Completed)})}return l}}}(scope),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=code$1,n=scope;var r=code$1;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var o=scope;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class i extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){const r=e?n.varKinds.var:this.varKind,o=void 0===this.rhs?"":` = ${this.rhs}`;return`${r} ${this.name}${o};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=A(this.rhs,e,t)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class s extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof t.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=A(this.rhs,e,n),this}get names(){return O(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}}class l extends s{constructor(e,t,n,r){super(e,n,r),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class u extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class c extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class d extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class f extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=A(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class p extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:n}=this;let r=n.length;for(;r--;){const o=n[r];o.optimizeNames(e,t)||(R(e,o.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>P(e,t.names),{})}}class h extends p{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class m extends p{}class g extends h{}g.kind="else";class b extends h{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new g(e):e}return t?!1===e?t instanceof b?t:t.nodes:this.nodes.length?this:new b($(e),t instanceof b?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var n;if(this.else=null===(n=this.else)||void 0===n?void 0:n.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=A(this.condition,e,t),this}get names(){const e=super.names;return O(e,this.condition),this.else&&P(e,this.else.names),e}}b.kind="if";class y extends h{}y.kind="for";class _ extends y{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=A(this.iteration,e,t),this}get names(){return P(super.names,this.iteration.names)}}class v extends y{constructor(e,t,n,r){super(),this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){const t=e.es5?n.varKinds.var:this.varKind,{name:r,from:o,to:a}=this;return`for(${t} ${r}=${o}; ${r}<${a}; ${r}++)`+super.render(e)}get names(){const e=O(super.names,this.from);return O(e,this.to)}}class w extends y{constructor(e,t,n,r){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=A(this.iterable,e,t),this}get names(){return P(super.names,this.iterable.names)}}class S extends h{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}S.kind="func";class x extends p{render(e){return"return "+super.render(e)}}x.kind="return";class T extends h{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),null===(n=this.catch)||void 0===n||n.optimizeNames(e,t),null===(r=this.finally)||void 0===r||r.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&P(e,this.catch.names),this.finally&&P(e,this.finally.names),e}}class E extends h{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}E.kind="catch";class k extends h{render(e){return"finally"+super.render(e)}}k.kind="finally";function P(e,t){for(const n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function O(e,n){return n instanceof t._CodeOrName?P(e,n.names):e}function A(e,n,r){return e instanceof t.Name?a(e):(o=e)instanceof t._Code&&o._items.some(e=>e instanceof t.Name&&1===n[e.str]&&void 0!==r[e.str])?new t._Code(e._items.reduce((e,n)=>(n instanceof t.Name&&(n=a(n)),n instanceof t._Code?e.push(...n._items):e.push(n),e),[])):e;var o;function a(e){const t=r[e.str];return void 0===t||1!==n[e.str]?e:(delete n[e.str],t)}}function R(e,t){for(const n in t)e[n]=(e[n]||0)-(t[n]||0)}function $(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:t._`!${N(e)}`}e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new n.Scope({parent:e}),this._nodes=[new m]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){const o=this._scope.toName(t);return void 0!==n&&r&&(this._constants[o.str]=n),this._leafNode(new i(e,o,n)),o}const(e,t,r){return this._def(n.varKinds.const,e,t,r)}let(e,t,r){return this._def(n.varKinds.let,e,t,r)}var(e,t,r){return this._def(n.varKinds.var,e,t,r)}assign(e,t,n){return this._leafNode(new s(e,t,n))}add(t,n){return this._leafNode(new l(t,e.operators.ADD,n))}code(e){return"function"==typeof e?e():e!==t.nil&&this._leafNode(new f(e)),this}object(...e){const n=["{"];for(const[r,o]of e)n.length>1&&n.push(","),n.push(r),(r!==o||this.opts.es5)&&(n.push(":"),(0,t.addCodeArg)(n,o));return n.push("}"),new t._Code(n)}if(e,t,n){if(this._blockNode(new b(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new b(e))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(b,g)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new _(e),t)}forRange(e,t,r,o,a=(this.opts.es5?n.varKinds.var:n.varKinds.let)){const i=this._scope.toName(e);return this._for(new v(a,i,t,r),()=>o(i))}forOf(e,r,o,a=n.varKinds.const){const i=this._scope.toName(e);if(this.opts.es5){const e=r instanceof t.Name?r:this.var("_arr",r);return this.forRange("_i",0,t._`${e}.length`,n=>{this.var(i,t._`${e}[${n}]`),o(i)})}return this._for(new w("of",a,i,r),()=>o(i))}forIn(e,r,o,a=(this.opts.es5?n.varKinds.var:n.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,t._`Object.keys(${r})`,o);const i=this._scope.toName(e);return this._for(new w("in",a,i,r),()=>o(i))}endFor(){return this._endBlockNode(y)}label(e){return this._leafNode(new u(e))}break(e){return this._leafNode(new c(e))}return(e){const t=new x;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(x)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const r=new T;if(this._blockNode(r),this.code(e),t){const e=this.name("e");this._currNode=r.catch=new E(e),t(e)}return n&&(this._currNode=r.finally=new k,this.code(n)),this._endBlockNode(E,k)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const n=this._nodes.length-t;if(n<0||void 0!==e&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,n=t.nil,r,o){return this._blockNode(new S(e,n,r)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof b))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},e.not=$;const I=D(e.operators.AND);e.and=function(...e){return e.reduce(I)};const C=D(e.operators.OR);function D(e){return(n,r)=>n===t.nil?r:r===t.nil?n:t._`${N(n)} ${e} ${N(r)}`}function N(e){return e instanceof t.Name?e:t._`(${e})`}e.or=function(...e){return e.reduce(C)}}(codegen);var util={};Object.defineProperty(util,"__esModule",{value:!0}),util.checkStrictMode=util.getErrorPath=util.Type=util.useFunc=util.setEvaluated=util.evaluatedPropsToName=util.mergeEvaluated=util.eachItem=util.unescapeJsonPointer=util.escapeJsonPointer=util.escapeFragment=util.unescapeFragment=util.schemaRefOrVal=util.schemaHasRulesButRef=util.schemaHasRules=util.checkUnknownRules=util.alwaysValidSchema=util.toHash=void 0;const codegen_1$o=codegen,code_1$9=code$1;function toHash(e){const t={};for(const n of e)t[n]=!0;return t}function alwaysValidSchema(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(checkUnknownRules(e,t),!schemaHasRules(t,e.self.RULES.all))}function checkUnknownRules(e,t=e.schema){const{opts:n,self:r}=e;if(!n.strictSchema)return;if("boolean"==typeof t)return;const o=r.RULES.keywords;for(const a in t)o[a]||checkStrictMode(e,`unknown keyword: "${a}"`)}function schemaHasRules(e,t){if("boolean"==typeof e)return!e;for(const n in e)if(t[n])return!0;return!1}function schemaHasRulesButRef(e,t){if("boolean"==typeof e)return!e;for(const n in e)if("$ref"!==n&&t.all[n])return!0;return!1}function schemaRefOrVal({topSchemaRef:e,schemaPath:t},n,r,o){if(!o){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return codegen_1$o._`${n}`}return codegen_1$o._`${e}${t}${(0,codegen_1$o.getProperty)(r)}`}function unescapeFragment(e){return unescapeJsonPointer(decodeURIComponent(e))}function escapeFragment(e){return encodeURIComponent(escapeJsonPointer(e))}function escapeJsonPointer(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function unescapeJsonPointer(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function eachItem(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)}function makeMergeEvaluated({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:r}){return(o,a,i,s)=>{const l=void 0===i?a:i instanceof codegen_1$o.Name?(a instanceof codegen_1$o.Name?e(o,a,i):t(o,a,i),i):a instanceof codegen_1$o.Name?(t(o,i,a),a):n(a,i);return s!==codegen_1$o.Name||l instanceof codegen_1$o.Name?l:r(o,l)}}function evaluatedPropsToName(e,t){if(!0===t)return e.var("props",!0);const n=e.var("props",codegen_1$o._`{}`);return void 0!==t&&setEvaluated(e,n,t),n}function setEvaluated(e,t,n){Object.keys(n).forEach(n=>e.assign(codegen_1$o._`${t}${(0,codegen_1$o.getProperty)(n)}`,!0))}util.toHash=toHash,util.alwaysValidSchema=alwaysValidSchema,util.checkUnknownRules=checkUnknownRules,util.schemaHasRules=schemaHasRules,util.schemaHasRulesButRef=schemaHasRulesButRef,util.schemaRefOrVal=schemaRefOrVal,util.unescapeFragment=unescapeFragment,util.escapeFragment=escapeFragment,util.escapeJsonPointer=escapeJsonPointer,util.unescapeJsonPointer=unescapeJsonPointer,util.eachItem=eachItem,util.mergeEvaluated={props:makeMergeEvaluated({mergeNames:(e,t,n)=>e.if(codegen_1$o._`${n} !== true && ${t} !== undefined`,()=>{e.if(codegen_1$o._`${t} === true`,()=>e.assign(n,!0),()=>e.assign(n,codegen_1$o._`${n} || {}`).code(codegen_1$o._`Object.assign(${n}, ${t})`))}),mergeToName:(e,t,n)=>e.if(codegen_1$o._`${n} !== true`,()=>{!0===t?e.assign(n,!0):(e.assign(n,codegen_1$o._`${n} || {}`),setEvaluated(e,n,t))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:evaluatedPropsToName}),items:makeMergeEvaluated({mergeNames:(e,t,n)=>e.if(codegen_1$o._`${n} !== true && ${t} !== undefined`,()=>e.assign(n,codegen_1$o._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`)),mergeToName:(e,t,n)=>e.if(codegen_1$o._`${n} !== true`,()=>e.assign(n,!0===t||codegen_1$o._`${n} > ${t} ? ${n} : ${t}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},util.evaluatedPropsToName=evaluatedPropsToName,util.setEvaluated=setEvaluated;const snippets={};function useFunc(e,t){return e.scopeValue("func",{ref:t,code:snippets[t.code]||(snippets[t.code]=new code_1$9._Code(t.code))})}var Type,Type2;function getErrorPath(e,t,n){if(e instanceof codegen_1$o.Name){const r=t===Type.Num;return n?r?codegen_1$o._`"[" + ${e} + "]"`:codegen_1$o._`"['" + ${e} + "']"`:r?codegen_1$o._`"/" + ${e}`:codegen_1$o._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,codegen_1$o.getProperty)(e).toString():"/"+escapeJsonPointer(e)}function checkStrictMode(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,!0===n)throw new Error(t);e.self.logger.warn(t)}}util.useFunc=useFunc,Type2=Type||(util.Type=Type={}),Type2[Type2.Num=0]="Num",Type2[Type2.Str=1]="Str",util.getErrorPath=getErrorPath,util.checkStrictMode=checkStrictMode;var names={},hasRequiredNames,hasRequiredBoolSchema;function requireNames(){if(hasRequiredNames)return names;hasRequiredNames=1,Object.defineProperty(names,"__esModule",{value:!0});const e=codegen,t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return names.default=t,names}function requireBoolSchema(){if(hasRequiredBoolSchema)return boolSchema;hasRequiredBoolSchema=1,Object.defineProperty(boolSchema,"__esModule",{value:!0}),boolSchema.boolOrEmptySchema=boolSchema.topBoolOrEmptySchema=void 0;const e=errors,t=codegen,n=requireNames(),r={message:"boolean schema is false"};function o(t,n){const{gen:o,data:a}=t,i={gen:o,keyword:"false schema",data:a,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,e.reportError)(i,r,void 0,n)}return boolSchema.topBoolOrEmptySchema=function(e){const{gen:r,schema:a,validateName:i}=e;!1===a?o(e,!1):"object"==typeof a&&!0===a.$async?r.return(n.default.data):(r.assign(t._`${i}.errors`,null),r.return(!0))},boolSchema.boolOrEmptySchema=function(e,t){const{gen:n,schema:r}=e;!1===r?(n.var(t,!1),o(e)):n.var(t,!0)},boolSchema}!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=codegen,n=util,r=requireNames();function o(e,n){const o=e.const("err",n);e.if(t._`${r.default.vErrors} === null`,()=>e.assign(r.default.vErrors,t._`[${o}]`),t._`${r.default.vErrors}.push(${o})`),e.code(t._`${r.default.errors}++`)}function a(e,n){const{gen:r,validateName:o,schemaEnv:a}=e;a.$async?r.throw(t._`new ${e.ValidationError}(${n})`):(r.assign(t._`${o}.errors`,n),r.return(!1))}e.keywordError={message:({keyword:e})=>t.str`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:n})=>n?t.str`"${e}" keyword must be ${n} ($data)`:t.str`"${e}" keyword is invalid ($data)`},e.reportError=function(n,r=e.keywordError,i,l){const{it:u}=n,{gen:c,compositeRule:d,allErrors:f}=u,p=s(n,r,i);(null!=l?l:d||f)?o(c,p):a(u,t._`[${p}]`)},e.reportExtraError=function(t,n=e.keywordError,i){const{it:l}=t,{gen:u,compositeRule:c,allErrors:d}=l;o(u,s(t,n,i)),c||d||a(l,r.default.vErrors)},e.resetErrorsCount=function(e,n){e.assign(r.default.errors,n),e.if(t._`${r.default.vErrors} !== null`,()=>e.if(n,()=>e.assign(t._`${r.default.vErrors}.length`,n),()=>e.assign(r.default.vErrors,null)))},e.extendErrors=function({gen:e,keyword:n,schemaValue:o,data:a,errsCount:i,it:s}){if(void 0===i)throw new Error("ajv implementation error");const l=e.name("err");e.forRange("i",i,r.default.errors,i=>{e.const(l,t._`${r.default.vErrors}[${i}]`),e.if(t._`${l}.instancePath === undefined`,()=>e.assign(t._`${l}.instancePath`,(0,t.strConcat)(r.default.instancePath,s.errorPath))),e.assign(t._`${l}.schemaPath`,t.str`${s.errSchemaPath}/${n}`),s.opts.verbose&&(e.assign(t._`${l}.schema`,o),e.assign(t._`${l}.data`,a))})};const i={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function s(e,n,o){const{createErrors:a}=e.it;return!1===a?t._`{}`:function(e,n,o={}){const{gen:a,it:s}=e,c=[l(s,o),u(e,o)];return function(e,{params:n,message:o},a){const{keyword:s,data:l,schemaValue:u,it:c}=e,{opts:d,propertyName:f,topSchemaRef:p,schemaPath:h}=c;a.push([i.keyword,s],[i.params,"function"==typeof n?n(e):n||t._`{}`]),d.messages&&a.push([i.message,"function"==typeof o?o(e):o]);d.verbose&&a.push([i.schema,u],[i.parentSchema,t._`${p}${h}`],[r.default.data,l]);f&&a.push([i.propertyName,f])}(e,n,c),a.object(...c)}(e,n,o)}function l({errorPath:e},{instancePath:o}){const a=o?t.str`${e}${(0,n.getErrorPath)(o,n.Type.Str)}`:e;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,a)]}function u({keyword:e,it:{errSchemaPath:r}},{schemaPath:o,parentSchema:a}){let s=a?r:t.str`${r}/${e}`;return o&&(s=t.str`${s}${(0,n.getErrorPath)(o,n.Type.Str)}`),[i.schemaPath,s]}}(errors);var dataType={},rules={};Object.defineProperty(rules,"__esModule",{value:!0}),rules.getRules=rules.isJSONType=void 0;const _jsonTypes=["string","number","integer","boolean","null","object","array"],jsonTypes=new Set(_jsonTypes);function isJSONType(e){return"string"==typeof e&&jsonTypes.has(e)}function getRules(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}rules.isJSONType=isJSONType,rules.getRules=getRules;var applicability={},hasRequiredApplicability;function requireApplicability(){if(hasRequiredApplicability)return applicability;function e(e,n){return n.rules.some(n=>t(e,n))}function t(e,t){var n;return void 0!==e[t.keyword]||(null===(n=t.definition.implements)||void 0===n?void 0:n.some(t=>void 0!==e[t]))}return hasRequiredApplicability=1,Object.defineProperty(applicability,"__esModule",{value:!0}),applicability.shouldUseRule=applicability.shouldUseGroup=applicability.schemaHasRulesForType=void 0,applicability.schemaHasRulesForType=function({schema:t,self:n},r){const o=n.RULES.types[r];return o&&!0!==o&&e(t,o)},applicability.shouldUseGroup=e,applicability.shouldUseRule=t,applicability}Object.defineProperty(dataType,"__esModule",{value:!0}),dataType.reportTypeError=dataType.checkDataTypes=dataType.checkDataType=dataType.coerceAndCheckDataType=dataType.getJSONTypes=dataType.getSchemaTypes=dataType.DataType=void 0;const rules_1=rules,applicability_1=requireApplicability(),errors_1=errors,codegen_1$n=codegen,util_1$m=util;var DataType,DataType2;function getSchemaTypes(e){const t=getJSONTypes(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t}function getJSONTypes(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(rules_1.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}function coerceAndCheckDataType(e,t){const{gen:n,data:r,opts:o}=e,a=coerceToTypes(t,o.coerceTypes),i=t.length>0&&!(0===a.length&&1===t.length&&(0,applicability_1.schemaHasRulesForType)(e,t[0]));if(i){const i=checkDataTypes(t,r,o.strictNumbers,DataType.Wrong);n.if(i,()=>{a.length?coerceData(e,t,a):reportTypeError(e)})}return i}DataType2=DataType||(dataType.DataType=DataType={}),DataType2[DataType2.Correct=0]="Correct",DataType2[DataType2.Wrong=1]="Wrong",dataType.getSchemaTypes=getSchemaTypes,dataType.getJSONTypes=getJSONTypes,dataType.coerceAndCheckDataType=coerceAndCheckDataType;const COERCIBLE=new Set(["string","number","integer","boolean","null"]);function coerceToTypes(e,t){return t?e.filter(e=>COERCIBLE.has(e)||"array"===t&&"array"===e):[]}function coerceData(e,t,n){const{gen:r,data:o,opts:a}=e,i=r.let("dataType",codegen_1$n._`typeof ${o}`),s=r.let("coerced",codegen_1$n._`undefined`);"array"===a.coerceTypes&&r.if(codegen_1$n._`${i} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>r.assign(o,codegen_1$n._`${o}[0]`).assign(i,codegen_1$n._`typeof ${o}`).if(checkDataTypes(t,o,a.strictNumbers),()=>r.assign(s,o))),r.if(codegen_1$n._`${s} !== undefined`);for(const u of n)(COERCIBLE.has(u)||"array"===u&&"array"===a.coerceTypes)&&l(u);function l(e){switch(e){case"string":return void r.elseIf(codegen_1$n._`${i} == "number" || ${i} == "boolean"`).assign(s,codegen_1$n._`"" + ${o}`).elseIf(codegen_1$n._`${o} === null`).assign(s,codegen_1$n._`""`);case"number":return void r.elseIf(codegen_1$n._`${i} == "boolean" || ${o} === null
|
|
69
|
+
|| (${i} == "string" && ${o} && ${o} == +${o})`).assign(s,codegen_1$n._`+${o}`);case"integer":return void r.elseIf(codegen_1$n._`${i} === "boolean" || ${o} === null
|
|
70
|
+
|| (${i} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(s,codegen_1$n._`+${o}`);case"boolean":return void r.elseIf(codegen_1$n._`${o} === "false" || ${o} === 0 || ${o} === null`).assign(s,!1).elseIf(codegen_1$n._`${o} === "true" || ${o} === 1`).assign(s,!0);case"null":return r.elseIf(codegen_1$n._`${o} === "" || ${o} === 0 || ${o} === false`),void r.assign(s,null);case"array":r.elseIf(codegen_1$n._`${i} === "string" || ${i} === "number"
|
|
71
|
+
|| ${i} === "boolean" || ${o} === null`).assign(s,codegen_1$n._`[${o}]`)}}r.else(),reportTypeError(e),r.endIf(),r.if(codegen_1$n._`${s} !== undefined`,()=>{r.assign(o,s),assignParentData(e,s)})}function assignParentData({gen:e,parentData:t,parentDataProperty:n},r){e.if(codegen_1$n._`${t} !== undefined`,()=>e.assign(codegen_1$n._`${t}[${n}]`,r))}function checkDataType(e,t,n,r=DataType.Correct){const o=r===DataType.Correct?codegen_1$n.operators.EQ:codegen_1$n.operators.NEQ;let a;switch(e){case"null":return codegen_1$n._`${t} ${o} null`;case"array":a=codegen_1$n._`Array.isArray(${t})`;break;case"object":a=codegen_1$n._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":a=i(codegen_1$n._`!(${t} % 1) && !isNaN(${t})`);break;case"number":a=i();break;default:return codegen_1$n._`typeof ${t} ${o} ${e}`}return r===DataType.Correct?a:(0,codegen_1$n.not)(a);function i(e=codegen_1$n.nil){return(0,codegen_1$n.and)(codegen_1$n._`typeof ${t} == "number"`,e,n?codegen_1$n._`isFinite(${t})`:codegen_1$n.nil)}}function checkDataTypes(e,t,n,r){if(1===e.length)return checkDataType(e[0],t,n,r);let o;const a=(0,util_1$m.toHash)(e);if(a.array&&a.object){const e=codegen_1$n._`typeof ${t} != "object"`;o=a.null?e:codegen_1$n._`!${t} || ${e}`,delete a.null,delete a.array,delete a.object}else o=codegen_1$n.nil;a.number&&delete a.integer;for(const i in a)o=(0,codegen_1$n.and)(o,checkDataType(i,t,n,r));return o}dataType.checkDataType=checkDataType,dataType.checkDataTypes=checkDataTypes;const typeError={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?codegen_1$n._`{type: ${e}}`:codegen_1$n._`{type: ${t}}`};function reportTypeError(e){const t=getTypeErrorContext(e);(0,errors_1.reportError)(t,typeError)}function getTypeErrorContext(e){const{gen:t,data:n,schema:r}=e,o=(0,util_1$m.schemaRefOrVal)(e,r,"type");return{gen:t,keyword:"type",data:n,schema:r.type,schemaCode:o,schemaValue:o,parentSchema:r,params:{},it:e}}dataType.reportTypeError=reportTypeError;var defaults={},hasRequiredDefaults;function requireDefaults(){if(hasRequiredDefaults)return defaults;hasRequiredDefaults=1,Object.defineProperty(defaults,"__esModule",{value:!0}),defaults.assignDefaults=void 0;const e=codegen,t=util;function n(n,r,o){const{gen:a,compositeRule:i,data:s,opts:l}=n;if(void 0===o)return;const u=e._`${s}${(0,e.getProperty)(r)}`;if(i)return void(0,t.checkStrictMode)(n,`default is ignored for: ${u}`);let c=e._`${u} === undefined`;"empty"===l.useDefaults&&(c=e._`${c} || ${u} === null || ${u} === ""`),a.if(c,e._`${u} = ${(0,e.stringify)(o)}`)}return defaults.assignDefaults=function(e,t){const{properties:r,items:o}=e.schema;if("object"===t&&r)for(const a in r)n(e,a,r[a].default);else"array"===t&&Array.isArray(o)&&o.forEach((t,r)=>n(e,r,t.default))},defaults}var keyword={},code={},hasRequiredCode,hasRequiredKeyword;function requireCode(){if(hasRequiredCode)return code;hasRequiredCode=1,Object.defineProperty(code,"__esModule",{value:!0}),code.validateUnion=code.validateArray=code.usePattern=code.callValidateCode=code.schemaProperties=code.allSchemaProperties=code.noPropertyInData=code.propertyInData=code.isOwnProperty=code.hasPropFunc=code.reportMissingProp=code.checkMissingProp=code.checkReportMissingProp=void 0;const e=codegen,t=util,n=requireNames(),r=util;function o(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:e._`Object.prototype.hasOwnProperty`})}function a(t,n,r){return e._`${o(t)}.call(${n}, ${r})`}function i(t,n,r,o){const i=e._`${n}${(0,e.getProperty)(r)} === undefined`;return o?(0,e.or)(i,(0,e.not)(a(t,n,r))):i}function s(e){return e?Object.keys(e).filter(e=>"__proto__"!==e):[]}code.checkReportMissingProp=function(t,n){const{gen:r,data:o,it:a}=t;r.if(i(r,o,n,a.opts.ownProperties),()=>{t.setParams({missingProperty:e._`${n}`},!0),t.error()})},code.checkMissingProp=function({gen:t,data:n,it:{opts:r}},o,a){return(0,e.or)(...o.map(o=>(0,e.and)(i(t,n,o,r.ownProperties),e._`${a} = ${o}`)))},code.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},code.hasPropFunc=o,code.isOwnProperty=a,code.propertyInData=function(t,n,r,o){const i=e._`${n}${(0,e.getProperty)(r)} !== undefined`;return o?e._`${i} && ${a(t,n,r)}`:i},code.noPropertyInData=i,code.allSchemaProperties=s,code.schemaProperties=function(e,n){return s(n).filter(r=>!(0,t.alwaysValidSchema)(e,n[r]))},code.callValidateCode=function({schemaCode:t,data:r,it:{gen:o,topSchemaRef:a,schemaPath:i,errorPath:s},it:l},u,c,d){const f=d?e._`${t}, ${r}, ${a}${i}`:r,p=[[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,s)],[n.default.parentData,l.parentData],[n.default.parentDataProperty,l.parentDataProperty],[n.default.rootData,n.default.rootData]];l.opts.dynamicRef&&p.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);const h=e._`${f}, ${o.object(...p)}`;return c!==e.nil?e._`${u}.call(${c}, ${h})`:e._`${u}(${h})`};const l=e._`new RegExp`;return code.usePattern=function({gen:t,it:{opts:n}},o){const a=n.unicodeRegExp?"u":"",{regExp:i}=n.code,s=i(o,a);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:e._`${"new RegExp"===i.code?l:(0,r.useFunc)(t,i)}(${o}, ${a})`})},code.validateArray=function(n){const{gen:r,data:o,keyword:a,it:i}=n,s=r.name("valid");if(i.allErrors){const e=r.let("valid",!0);return l(()=>r.assign(e,!1)),e}return r.var(s,!0),l(()=>r.break()),s;function l(i){const l=r.const("len",e._`${o}.length`);r.forRange("i",0,l,o=>{n.subschema({keyword:a,dataProp:o,dataPropType:t.Type.Num},s),r.if((0,e.not)(s),i)})}},code.validateUnion=function(n){const{gen:r,schema:o,keyword:a,it:i}=n;if(!Array.isArray(o))throw new Error("ajv implementation error");if(o.some(e=>(0,t.alwaysValidSchema)(i,e))&&!i.opts.unevaluated)return;const s=r.let("valid",!1),l=r.name("_valid");r.block(()=>o.forEach((t,o)=>{const i=n.subschema({keyword:a,schemaProp:o,compositeRule:!0},l);r.assign(s,e._`${s} || ${l}`);n.mergeValidEvaluated(i,l)||r.if((0,e.not)(s))})),n.result(s,()=>n.reset(),()=>n.error(!0))},code}function requireKeyword(){if(hasRequiredKeyword)return keyword;hasRequiredKeyword=1,Object.defineProperty(keyword,"__esModule",{value:!0}),keyword.validateKeywordUsage=keyword.validSchemaType=keyword.funcKeywordCode=keyword.macroKeywordCode=void 0;const e=codegen,t=requireNames(),n=requireCode(),r=errors;function o(t){const{gen:n,data:r,it:o}=t;n.if(o.parentData,()=>n.assign(r,e._`${o.parentData}[${o.parentDataProperty}]`))}function a(t,n,r){if(void 0===r)throw new Error(`keyword "${n}" failed to compile`);return t.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,e.stringify)(r)})}return keyword.macroKeywordCode=function(t,n){const{gen:r,keyword:o,schema:i,parentSchema:s,it:l}=t,u=n.macro.call(l.self,i,s,l),c=a(r,o,u);!1!==l.opts.validateSchema&&l.self.validateSchema(u,!0);const d=r.name("valid");t.subschema({schema:u,schemaPath:e.nil,errSchemaPath:`${l.errSchemaPath}/${o}`,topSchemaRef:c,compositeRule:!0},d),t.pass(d,()=>t.error(!0))},keyword.funcKeywordCode=function(i,s){var l;const{gen:u,keyword:c,schema:d,parentSchema:f,$data:p,it:h}=i;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(h,s);const m=!p&&s.compile?s.compile.call(h.self,d,f,h):s.validate,g=a(u,c,m),b=u.let("valid");function y(r=(s.async?e._`await `:e.nil)){const o=h.opts.passContext?t.default.this:t.default.self,a=!("compile"in s&&!p||!1===s.schema);u.assign(b,e._`${r}${(0,n.callValidateCode)(i,g,o,a)}`,s.modifying)}function _(t){var n;u.if((0,e.not)(null!==(n=s.valid)&&void 0!==n?n:b),t)}i.block$data(b,function(){if(!1===s.errors)y(),s.modifying&&o(i),_(()=>i.error());else{const n=s.async?function(){const t=u.let("ruleErrs",null);return u.try(()=>y(e._`await `),n=>u.assign(b,!1).if(e._`${n} instanceof ${h.ValidationError}`,()=>u.assign(t,e._`${n}.errors`),()=>u.throw(n))),t}():function(){const t=e._`${g}.errors`;return u.assign(t,null),y(e.nil),t}();s.modifying&&o(i),_(()=>function(n,o){const{gen:a}=n;a.if(e._`Array.isArray(${o})`,()=>{a.assign(t.default.vErrors,e._`${t.default.vErrors} === null ? ${o} : ${t.default.vErrors}.concat(${o})`).assign(t.default.errors,e._`${t.default.vErrors}.length`),(0,r.extendErrors)(n)},()=>n.error())}(i,n))}}),i.ok(null!==(l=s.valid)&&void 0!==l?l:b)},keyword.validSchemaType=function(e,t,n=!1){return!t.length||t.some(t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||n&&void 0===e)},keyword.validateKeywordUsage=function({schema:e,opts:t,self:n,errSchemaPath:r},o,a){if(Array.isArray(o.keyword)?!o.keyword.includes(a):o.keyword!==a)throw new Error("ajv implementation error");const i=o.dependencies;if(null==i?void 0:i.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw new Error(`parent schema must have dependencies of ${a}: ${i.join(",")}`);if(o.validateSchema){if(!o.validateSchema(e[a])){const e=`keyword "${a}" value is invalid at path "${r}": `+n.errorsText(o.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);n.logger.error(e)}}},keyword}var subschema={},hasRequiredSubschema;function requireSubschema(){if(hasRequiredSubschema)return subschema;hasRequiredSubschema=1,Object.defineProperty(subschema,"__esModule",{value:!0}),subschema.extendSubschemaMode=subschema.extendSubschemaData=subschema.getSubschema=void 0;const e=codegen,t=util;return subschema.getSubschema=function(n,{keyword:r,schemaProp:o,schema:a,schemaPath:i,errSchemaPath:s,topSchemaRef:l}){if(void 0!==r&&void 0!==a)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==r){const a=n.schema[r];return void 0===o?{schema:a,schemaPath:e._`${n.schemaPath}${(0,e.getProperty)(r)}`,errSchemaPath:`${n.errSchemaPath}/${r}`}:{schema:a[o],schemaPath:e._`${n.schemaPath}${(0,e.getProperty)(r)}${(0,e.getProperty)(o)}`,errSchemaPath:`${n.errSchemaPath}/${r}/${(0,t.escapeFragment)(o)}`}}if(void 0!==a){if(void 0===i||void 0===s||void 0===l)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:a,schemaPath:i,topSchemaRef:l,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')},subschema.extendSubschemaData=function(n,r,{dataProp:o,dataPropType:a,data:i,dataTypes:s,propertyName:l}){if(void 0!==i&&void 0!==o)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:u}=r;if(void 0!==o){const{errorPath:i,dataPathArr:s,opts:l}=r;c(u.let("data",e._`${r.data}${(0,e.getProperty)(o)}`,!0)),n.errorPath=e.str`${i}${(0,t.getErrorPath)(o,a,l.jsPropertySyntax)}`,n.parentDataProperty=e._`${o}`,n.dataPathArr=[...s,n.parentDataProperty]}if(void 0!==i){c(i instanceof e.Name?i:u.let("data",i,!0)),void 0!==l&&(n.propertyName=l)}function c(e){n.data=e,n.dataLevel=r.dataLevel+1,n.dataTypes=[],r.definedProperties=new Set,n.parentData=r.data,n.dataNames=[...r.dataNames,e]}s&&(n.dataTypes=s)},subschema.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:o,allErrors:a}){void 0!==r&&(e.compositeRule=r),void 0!==o&&(e.createErrors=o),void 0!==a&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=n},subschema}var resolve$2={},fastDeepEqual=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,a;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!==o--;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(a=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!==o--;)if(!Object.prototype.hasOwnProperty.call(n,a[o]))return!1;for(o=r;0!==o--;){var i=a[o];if(!e(t[i],n[i]))return!1}return!0}return t!=t&&n!=n},jsonSchemaTraverse={exports:{}},traverse$1=jsonSchemaTraverse.exports=function(e,t,n){"function"==typeof t&&(n=t,t={}),_traverse(t,"function"==typeof(n=t.cb||n)?n:n.pre||function(){},n.post||function(){},e,"",e)};function _traverse(e,t,n,r,o,a,i,s,l,u){if(r&&"object"==typeof r&&!Array.isArray(r)){for(var c in t(r,o,a,i,s,l,u),r){var d=r[c];if(Array.isArray(d)){if(c in traverse$1.arrayKeywords)for(var f=0;f<d.length;f++)_traverse(e,t,n,d[f],o+"/"+c+"/"+f,a,o,c,r,f)}else if(c in traverse$1.propsKeywords){if(d&&"object"==typeof d)for(var p in d)_traverse(e,t,n,d[p],o+"/"+c+"/"+escapeJsonPtr(p),a,o,c,r,p)}else(c in traverse$1.keywords||e.allKeys&&!(c in traverse$1.skipKeywords))&&_traverse(e,t,n,d,o+"/"+c,a,o,c,r)}n(r,o,a,i,s,l,u)}}function escapeJsonPtr(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}traverse$1.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},traverse$1.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},traverse$1.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},traverse$1.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};var jsonSchemaTraverseExports=jsonSchemaTraverse.exports;Object.defineProperty(resolve$2,"__esModule",{value:!0}),resolve$2.getSchemaRefs=resolve$2.resolveUrl=resolve$2.normalizeId=resolve$2._getFullPath=resolve$2.getFullPath=resolve$2.inlineRef=void 0;const util_1$l=util,equal$3=fastDeepEqual,traverse=jsonSchemaTraverseExports,SIMPLE_INLINED=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function inlineRef(e,t=!0){return"boolean"==typeof e||(!0===t?!hasRef(e):!!t&&countKeys(e)<=t)}resolve$2.inlineRef=inlineRef;const REF_KEYWORDS=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function hasRef(e){for(const t in e){if(REF_KEYWORDS.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(hasRef))return!0;if("object"==typeof n&&hasRef(n))return!0}return!1}function countKeys(e){let t=0;for(const n in e){if("$ref"===n)return 1/0;if(t++,!SIMPLE_INLINED.has(n)&&("object"==typeof e[n]&&(0,util_1$l.eachItem)(e[n],e=>t+=countKeys(e)),t===1/0))return 1/0}return t}function getFullPath(e,t="",n){!1!==n&&(t=normalizeId(t));const r=e.parse(t);return _getFullPath(e,r)}function _getFullPath(e,t){return e.serialize(t).split("#")[0]+"#"}resolve$2.getFullPath=getFullPath,resolve$2._getFullPath=_getFullPath;const TRAILING_SLASH_HASH=/#\/?$/;function normalizeId(e){return e?e.replace(TRAILING_SLASH_HASH,""):""}function resolveUrl(e,t,n){return n=normalizeId(n),e.resolve(t,n)}resolve$2.normalizeId=normalizeId,resolve$2.resolveUrl=resolveUrl;const ANCHOR=/^[a-z_][-a-z0-9._]*$/i;function getSchemaRefs(e,t){if("boolean"==typeof e)return{};const{schemaId:n,uriResolver:r}=this.opts,o=normalizeId(e[n]||t),a={"":o},i=getFullPath(r,o,!1),s={},l=new Set;return traverse(e,{allKeys:!0},(e,t,r,o)=>{if(void 0===o)return;const d=i+t;let f=a[o];function p(t){const n=this.opts.uriResolver.resolve;if(t=normalizeId(f?n(f,t):t),l.has(t))throw c(t);l.add(t);let r=this.refs[t];return"string"==typeof r&&(r=this.refs[r]),"object"==typeof r?u(e,r.schema,t):t!==normalizeId(d)&&("#"===t[0]?(u(e,s[t],t),s[t]=e):this.refs[t]=d),t}function h(e){if("string"==typeof e){if(!ANCHOR.test(e))throw new Error(`invalid anchor "${e}"`);p.call(this,`#${e}`)}}"string"==typeof e[n]&&(f=p.call(this,e[n])),h.call(this,e.$anchor),h.call(this,e.$dynamicAnchor),a[t]=f}),s;function u(e,t,n){if(void 0!==t&&!equal$3(e,t))throw c(n)}function c(e){return new Error(`reference "${e}" resolves to more than one schema`)}}var hasRequiredValidate;function requireValidate(){if(hasRequiredValidate)return validate;hasRequiredValidate=1,Object.defineProperty(validate,"__esModule",{value:!0}),validate.getData=validate.KeywordCxt=validate.validateFunctionCode=void 0;const e=requireBoolSchema(),t=dataType,n=requireApplicability(),r=dataType,o=requireDefaults(),a=requireKeyword(),i=requireSubschema(),s=codegen,l=requireNames(),u=resolve$2,c=util,d=errors;function f({gen:e,validateName:t,schema:n,schemaEnv:r,opts:o},a){o.code.es5?e.func(t,s._`${l.default.data}, ${l.default.valCxt}`,r.$async,()=>{e.code(s._`"use strict"; ${p(n,o)}`),function(e,t){e.if(l.default.valCxt,()=>{e.var(l.default.instancePath,s._`${l.default.valCxt}.${l.default.instancePath}`),e.var(l.default.parentData,s._`${l.default.valCxt}.${l.default.parentData}`),e.var(l.default.parentDataProperty,s._`${l.default.valCxt}.${l.default.parentDataProperty}`),e.var(l.default.rootData,s._`${l.default.valCxt}.${l.default.rootData}`),t.dynamicRef&&e.var(l.default.dynamicAnchors,s._`${l.default.valCxt}.${l.default.dynamicAnchors}`)},()=>{e.var(l.default.instancePath,s._`""`),e.var(l.default.parentData,s._`undefined`),e.var(l.default.parentDataProperty,s._`undefined`),e.var(l.default.rootData,l.default.data),t.dynamicRef&&e.var(l.default.dynamicAnchors,s._`{}`)})}(e,o),e.code(a)}):e.func(t,s._`${l.default.data}, ${function(e){return s._`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${e.dynamicRef?s._`, ${l.default.dynamicAnchors}={}`:s.nil}}={}`}(o)}`,r.$async,()=>e.code(p(n,o)).code(a))}function p(e,t){const n="object"==typeof e&&e[t.schemaId];return n&&(t.code.source||t.code.process)?s._`/*# sourceURL=${n} */`:s.nil}function h(t,n){g(t)&&(b(t),m(t))?function(e,t){const{schema:n,gen:r,opts:o}=e;o.$comment&&n.$comment&&_(e);(function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,u.resolveUrl)(e.opts.uriResolver,e.baseId,t))})(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const a=r.const("_errs",l.default.errors);y(e,a),r.var(t,s._`${a} === ${l.default.errors}`)}(t,n):(0,e.boolOrEmptySchema)(t,n)}function m({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const n in e)if(t.RULES.all[n])return!0;return!1}function g(e){return"boolean"!=typeof e.schema}function b(e){(0,c.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:n,opts:r,self:o}=e;t.$ref&&r.ignoreKeywordsWithRef&&(0,c.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}(e)}function y(e,n){if(e.opts.jtd)return v(e,[],!1,n);const r=(0,t.getSchemaTypes)(e.schema);v(e,r,!(0,t.coerceAndCheckDataType)(e,r),n)}function _({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:o}){const a=n.$comment;if(!0===o.$comment)e.code(s._`${l.default.self}.logger.log(${a})`);else if("function"==typeof o.$comment){const n=s.str`${r}/$comment`,o=e.scopeValue("root",{ref:t.root});e.code(s._`${l.default.self}.opts.$comment(${a}, ${n}, ${o}.schema)`)}}function v(e,t,o,a){const{gen:i,schema:u,data:d,allErrors:f,opts:p,self:h}=e,{RULES:m}=h;function g(c){(0,n.shouldUseGroup)(u,c)&&(c.type?(i.if((0,r.checkDataType)(c.type,d,p.strictNumbers)),w(e,c),1===t.length&&t[0]===c.type&&o&&(i.else(),(0,r.reportTypeError)(e)),i.endIf()):w(e,c),f||i.if(s._`${l.default.errors} === ${a||0}`))}!u.$ref||!p.ignoreKeywordsWithRef&&(0,c.schemaHasRulesButRef)(u,m)?(p.jtd||function(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;(function(e,t){if(!t.length)return;if(!e.dataTypes.length)return void(e.dataTypes=t);t.forEach(t=>{x(e.dataTypes,t)||T(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)}),function(e,t){const n=[];for(const r of e.dataTypes)x(t,r)?n.push(r):t.includes("integer")&&"number"===r&&n.push("integer");e.dataTypes=n}(e,t)})(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&T(e,"use allowUnionTypes to allow union type keyword")}(e,t);!function(e,t){const r=e.self.RULES.all;for(const o in r){const a=r[o];if("object"==typeof a&&(0,n.shouldUseRule)(e.schema,a)){const{type:n}=a.definition;n.length&&!n.some(e=>S(t,e))&&T(e,`missing type "${n.join(",")}" for keyword "${o}"`)}}}(e,e.dataTypes)}(e,t),i.block(()=>{for(const e of m.rules)g(e);g(m.post)})):i.block(()=>k(e,"$ref",m.all.$ref.definition))}function w(e,t){const{gen:r,schema:a,opts:{useDefaults:i}}=e;i&&(0,o.assignDefaults)(e,t.type),r.block(()=>{for(const r of t.rules)(0,n.shouldUseRule)(a,r)&&k(e,r.keyword,r.definition,t.type)})}function S(e,t){return e.includes(t)||"number"===t&&e.includes("integer")}function x(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function T(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,c.checkStrictMode)(e,t,e.opts.strictTypes)}validate.validateFunctionCode=function(t){g(t)&&(b(t),m(t))?function(e){const{schema:t,opts:n,gen:r}=e;f(e,()=>{n.$comment&&t.$comment&&_(e),function(e){const{schema:t,opts:n}=e;void 0!==t.default&&n.useDefaults&&n.strictSchema&&(0,c.checkStrictMode)(e,"default is ignored in the schema root")}(e),r.let(l.default.vErrors,null),r.let(l.default.errors,0),n.unevaluated&&function(e){const{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",s._`${n}.evaluated`),t.if(s._`${e.evaluated}.dynamicProps`,()=>t.assign(s._`${e.evaluated}.props`,s._`undefined`)),t.if(s._`${e.evaluated}.dynamicItems`,()=>t.assign(s._`${e.evaluated}.items`,s._`undefined`))}(e),y(e),function(e){const{gen:t,schemaEnv:n,validateName:r,ValidationError:o,opts:a}=e;n.$async?t.if(s._`${l.default.errors} === 0`,()=>t.return(l.default.data),()=>t.throw(s._`new ${o}(${l.default.vErrors})`)):(t.assign(s._`${r}.errors`,l.default.vErrors),a.unevaluated&&function({gen:e,evaluated:t,props:n,items:r}){n instanceof s.Name&&e.assign(s._`${t}.props`,n);r instanceof s.Name&&e.assign(s._`${t}.items`,r)}(e),t.return(s._`${l.default.errors} === 0`))}(e)})}(t):f(t,()=>(0,e.topBoolOrEmptySchema)(t))};class E{constructor(e,t,n){if((0,a.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,c.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",A(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,a.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",l.default.errors))}result(e,t,n){this.failResult((0,s.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,s.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(s._`${t} !== undefined && (${(0,s.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t)return this.setParams(t),this._error(e,n),void this.setParams({});this._error(e,n)}_error(e,t){(e?d.reportExtraError:d.reportError)(this,this.def.error,t)}$dataError(){(0,d.reportError)(this,this.def.$dataError||d.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,d.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=s.nil){this.gen.block(()=>{this.check$data(e,n),t()})}check$data(e=s.nil,t=s.nil){if(!this.$data)return;const{gen:n,schemaCode:r,schemaType:o,def:a}=this;n.if((0,s.or)(s._`${r} === undefined`,t)),e!==s.nil&&n.assign(e,!0),(o.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==s.nil&&n.assign(e,!1)),n.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:n,def:o,it:a}=this;return(0,s.or)(function(){if(n.length){if(!(t instanceof s.Name))throw new Error("ajv implementation error");const e=Array.isArray(n)?n:[n];return s._`${(0,r.checkDataTypes)(e,t,a.opts.strictNumbers,r.DataType.Wrong)}`}return s.nil}(),function(){if(o.validateSchema){const n=e.scopeValue("validate$data",{ref:o.validateSchema});return s._`!${n}(${t})`}return s.nil}())}subschema(e,t){const n=(0,i.getSubschema)(this.it,e);(0,i.extendSubschemaData)(n,this.it,e),(0,i.extendSubschemaMode)(n,e);const r={...this.it,...n,items:void 0,props:void 0};return h(r,t),r}mergeEvaluated(e,t){const{it:n,gen:r}=this;n.opts.unevaluated&&(!0!==n.props&&void 0!==e.props&&(n.props=c.mergeEvaluated.props(r,e.props,n.props,t)),!0!==n.items&&void 0!==e.items&&(n.items=c.mergeEvaluated.items(r,e.items,n.items,t)))}mergeValidEvaluated(e,t){const{it:n,gen:r}=this;if(n.opts.unevaluated&&(!0!==n.props||!0!==n.items))return r.if(t,()=>this.mergeEvaluated(e,s.Name)),!0}}function k(e,t,n,r){const o=new E(e,n,t);"code"in n?n.code(o,r):o.$data&&n.validate?(0,a.funcKeywordCode)(o,n):"macro"in n?(0,a.macroKeywordCode)(o,n):(n.compile||n.validate)&&(0,a.funcKeywordCode)(o,n)}validate.KeywordCxt=E;const P=/^\/(?:[^~]|~0|~1)*$/,O=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function A(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let o,a;if(""===e)return l.default.rootData;if("/"===e[0]){if(!P.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,a=l.default.rootData}else{const i=O.exec(e);if(!i)throw new Error(`Invalid JSON-pointer: ${e}`);const s=+i[1];if(o=i[2],"#"===o){if(s>=t)throw new Error(d("property/index",s));return r[t-s]}if(s>t)throw new Error(d("data",s));if(a=n[t-s],!o)return a}let i=a;const u=o.split("/");for(const l of u)l&&(a=s._`${a}${(0,s.getProperty)((0,c.unescapeJsonPointer)(l))}`,i=s._`${i} && ${a}`);return i;function d(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}return validate.getData=A,validate}resolve$2.getSchemaRefs=getSchemaRefs;var validation_error={};Object.defineProperty(validation_error,"__esModule",{value:!0});let ValidationError$1=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};validation_error.default=ValidationError$1;var ref_error={};Object.defineProperty(ref_error,"__esModule",{value:!0});const resolve_1$1=resolve$2;class MissingRefError extends Error{constructor(e,t,n,r){super(r||`can't resolve reference ${n} from id ${t}`),this.missingRef=(0,resolve_1$1.resolveUrl)(e,t,n),this.missingSchema=(0,resolve_1$1.normalizeId)((0,resolve_1$1.getFullPath)(e,this.missingRef))}}ref_error.default=MissingRefError;var compile={};Object.defineProperty(compile,"__esModule",{value:!0}),compile.resolveSchema=compile.getCompilingSchema=compile.resolveRef=compile.compileSchema=compile.SchemaEnv=void 0;const codegen_1$m=codegen,validation_error_1=validation_error,names_1$2=requireNames(),resolve_1=resolve$2,util_1$k=util,validate_1$1=requireValidate();class SchemaEnv{constructor(e){var t;let n;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,resolve_1.normalizeId)(null==n?void 0:n[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==n?void 0:n.$async,this.refs={}}}function compileSchema(e){const t=getCompilingSchema.call(this,e);if(t)return t;const n=(0,resolve_1.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:r,lines:o}=this.opts.code,{ownProperties:a}=this.opts,i=new codegen_1$m.CodeGen(this.scope,{es5:r,lines:o,ownProperties:a});let s;e.$async&&(s=i.scopeValue("Error",{ref:validation_error_1.default,code:codegen_1$m._`require("ajv/dist/runtime/validation_error").default`}));const l=i.scopeName("validate");e.validateName=l;const u={gen:i,allErrors:this.opts.allErrors,data:names_1$2.default.data,parentData:names_1$2.default.parentData,parentDataProperty:names_1$2.default.parentDataProperty,dataNames:[names_1$2.default.data],dataPathArr:[codegen_1$m.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,codegen_1$m.stringify)(e.schema)}:{ref:e.schema}),validateName:l,ValidationError:s,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:codegen_1$m.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:codegen_1$m._`""`,opts:this.opts,self:this};let c;try{this._compilations.add(e),(0,validate_1$1.validateFunctionCode)(u),i.optimize(this.opts.code.optimize);const t=i.toString();c=`${i.scopeRefs(names_1$2.default.scope)}return ${t}`,this.opts.code.process&&(c=this.opts.code.process(c,e));const n=new Function(`${names_1$2.default.self}`,`${names_1$2.default.scope}`,c)(this,this.scope.get());if(this.scope.value(l,{ref:n}),n.errors=null,n.schema=e.schema,n.schemaEnv=e,e.$async&&(n.$async=!0),!0===this.opts.code.source&&(n.source={validateName:l,validateCode:t,scopeValues:i._values}),this.opts.unevaluated){const{props:e,items:t}=u;n.evaluated={props:e instanceof codegen_1$m.Name?void 0:e,items:t instanceof codegen_1$m.Name?void 0:t,dynamicProps:e instanceof codegen_1$m.Name,dynamicItems:t instanceof codegen_1$m.Name},n.source&&(n.source.evaluated=(0,codegen_1$m.stringify)(n.evaluated))}return e.validate=n,e}catch(d){throw delete e.validate,delete e.validateName,c&&this.logger.error("Error compiling schema, function code:",c),d}finally{this._compilations.delete(e)}}function resolveRef(e,t,n){var r;n=(0,resolve_1.resolveUrl)(this.opts.uriResolver,t,n);const o=e.refs[n];if(o)return o;let a=resolve$1.call(this,e,n);if(void 0===a){const o=null===(r=e.localRefs)||void 0===r?void 0:r[n],{schemaId:i}=this.opts;o&&(a=new SchemaEnv({schema:o,schemaId:i,root:e,baseId:t}))}return void 0!==a?e.refs[n]=inlineOrCompile.call(this,a):void 0}function inlineOrCompile(e){return(0,resolve_1.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:compileSchema.call(this,e)}function getCompilingSchema(e){for(const t of this._compilations)if(sameSchemaEnv(t,e))return t}function sameSchemaEnv(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function resolve$1(e,t){let n;for(;"string"==typeof(n=this.refs[t]);)t=n;return n||this.schemas[t]||resolveSchema.call(this,e,t)}function resolveSchema(e,t){const n=this.opts.uriResolver.parse(t),r=(0,resolve_1._getFullPath)(this.opts.uriResolver,n);let o=(0,resolve_1.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===o)return getJsonPointer.call(this,n,e);const a=(0,resolve_1.normalizeId)(r),i=this.refs[a]||this.schemas[a];if("string"==typeof i){const t=resolveSchema.call(this,e,i);if("object"!=typeof(null==t?void 0:t.schema))return;return getJsonPointer.call(this,n,t)}if("object"==typeof(null==i?void 0:i.schema)){if(i.validate||compileSchema.call(this,i),a===(0,resolve_1.normalizeId)(t)){const{schema:t}=i,{schemaId:n}=this.opts,r=t[n];return r&&(o=(0,resolve_1.resolveUrl)(this.opts.uriResolver,o,r)),new SchemaEnv({schema:t,schemaId:n,root:e,baseId:o})}return getJsonPointer.call(this,n,i)}}compile.SchemaEnv=SchemaEnv,compile.compileSchema=compileSchema,compile.resolveRef=resolveRef,compile.getCompilingSchema=getCompilingSchema,compile.resolveSchema=resolveSchema;const PREVENT_SCOPE_CHANGE=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function getJsonPointer(e,{baseId:t,schema:n,root:r}){var o;if("/"!==(null===(o=e.fragment)||void 0===o?void 0:o[0]))return;for(const s of e.fragment.slice(1).split("/")){if("boolean"==typeof n)return;const e=n[(0,util_1$k.unescapeFragment)(s)];if(void 0===e)return;const r="object"==typeof(n=e)&&n[this.opts.schemaId];!PREVENT_SCOPE_CHANGE.has(s)&&r&&(t=(0,resolve_1.resolveUrl)(this.opts.uriResolver,t,r))}let a;if("boolean"!=typeof n&&n.$ref&&!(0,util_1$k.schemaHasRulesButRef)(n,this.RULES)){const e=(0,resolve_1.resolveUrl)(this.opts.uriResolver,t,n.$ref);a=resolveSchema.call(this,r,e)}const{schemaId:i}=this.opts;return a=a||new SchemaEnv({schema:n,schemaId:i,root:r,baseId:t}),a.schema!==a.root.schema?a:void 0}const $id$1="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description="Meta-schema for $data reference (JSON AnySchema extension proposal)",type$1="object",required$1=["$data"],properties$2={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties$1=!1,require$$9={$id:$id$1,description:description,type:type$1,required:required$1,properties:properties$2,additionalProperties:additionalProperties$1};var uri$1={},fastUri$1={exports:{}};const isUUID$1=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),isIPv4$1=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function stringArrayToHexStripped(e){let t="",n=0,r=0;for(r=0;r<e.length;r++)if(n=e[r].charCodeAt(0),48!==n){if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[r];break}for(r+=1;r<e.length;r++){if(n=e[r].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[r]}return t}const nonSimpleDomain$1=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function consumeIsZone(e){return e.length=0,!0}function consumeHextets(e,t,n){if(e.length){const r=stringArrayToHexStripped(e);if(""===r)return n.error=!0,!1;t.push(r),e.length=0}return!0}function getIPV6(e){let t=0;const n={error:!1,address:"",zone:""},r=[],o=[];let a=!1,i=!1,s=consumeHextets;for(let l=0;l<e.length;l++){const u=e[l];if("["!==u&&"]"!==u)if(":"!==u)if("%"===u){if(!s(o,r,n))break;s=consumeIsZone}else o.push(u);else{if(!0===a&&(i=!0),!s(o,r,n))break;if(++t>7){n.error=!0;break}l>0&&":"===e[l-1]&&(a=!0),r.push(":")}}return o.length&&(s===consumeIsZone?n.zone=o.join(""):i?r.push(o.join("")):r.push(stringArrayToHexStripped(o))),n.address=r.join(""),n}function normalizeIPv6$1(e){if(findToken(e,":")<2)return{host:e,isIPV6:!1};const t=getIPV6(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,n=t.address;return t.zone&&(e+="%"+t.zone,n+="%25"+t.zone),{host:e,isIPV6:!0,escapedHost:n}}}function findToken(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}function removeDotSegments$1(e){let t=e;const n=[];let r=-1,o=0;for(;o=t.length;){if(1===o){if("."===t)break;if("/"===t){n.push("/");break}n.push(t);break}if(2===o){if("."===t[0]){if("."===t[1])break;if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&("."===t[1]||"/"===t[1])){n.push("/");break}}else if(3===o&&"/.."===t){0!==n.length&&n.pop(),n.push("/");break}if("."===t[0]){if("."===t[1]){if("/"===t[2]){t=t.slice(3);continue}}else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&"."===t[1]){if("/"===t[2]){t=t.slice(2);continue}if("."===t[2]&&"/"===t[3]){t=t.slice(3),0!==n.length&&n.pop();continue}}if(-1===(r=t.indexOf("/",1))){n.push(t);break}n.push(t.slice(0,r)),t=t.slice(r)}return n.join("")}function normalizeComponentEncoding$1(e,t){const n=!0!==t?escape:unescape;return void 0!==e.scheme&&(e.scheme=n(e.scheme)),void 0!==e.userinfo&&(e.userinfo=n(e.userinfo)),void 0!==e.host&&(e.host=n(e.host)),void 0!==e.path&&(e.path=n(e.path)),void 0!==e.query&&(e.query=n(e.query)),void 0!==e.fragment&&(e.fragment=n(e.fragment)),e}function recomposeAuthority$1(e){const t=[];if(void 0!==e.userinfo&&(t.push(e.userinfo),t.push("@")),void 0!==e.host){let n=unescape(e.host);if(!isIPv4$1(n)){const t=normalizeIPv6$1(n);n=!0===t.isIPV6?`[${t.escapedHost}]`:e.host}t.push(n)}return"number"!=typeof e.port&&"string"!=typeof e.port||(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}var utils$1={nonSimpleDomain:nonSimpleDomain$1,recomposeAuthority:recomposeAuthority$1,normalizeComponentEncoding:normalizeComponentEncoding$1,removeDotSegments:removeDotSegments$1,isIPv4:isIPv4$1,isUUID:isUUID$1,normalizeIPv6:normalizeIPv6$1};const{isUUID:isUUID}=utils$1,URN_REG=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function wsIsSecure(e){return!0===e.secure||!1!==e.secure&&(!!e.scheme&&!(3!==e.scheme.length||"w"!==e.scheme[0]&&"W"!==e.scheme[0]||"s"!==e.scheme[1]&&"S"!==e.scheme[1]||"s"!==e.scheme[2]&&"S"!==e.scheme[2]))}function httpParse(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function httpSerialize(e){const t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}function wsParse(e){return e.secure=wsIsSecure(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function wsSerialize(e){if(e.port!==(wsIsSecure(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[t,n]=e.resourceName.split("?");e.path=t&&"/"!==t?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}function urnParse(e,t){if(!e.path)return e.error="URN can not be parsed",e;const n=e.path.match(URN_REG);if(n){const r=t.scheme||e.scheme||"urn";e.nid=n[1].toLowerCase(),e.nss=n[2];const o=getSchemeHandler$1(`${r}:${t.nid||e.nid}`);e.path=void 0,o&&(e=o.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function urnSerialize(e,t){if(void 0===e.nid)throw new Error("URN without nid cannot be serialized");const n=t.scheme||e.scheme||"urn",r=e.nid.toLowerCase(),o=getSchemeHandler$1(`${n}:${t.nid||r}`);o&&(e=o.serialize(e,t));const a=e,i=e.nss;return a.path=`${r||t.nid}:${i}`,t.skipEscape=!0,a}function urnuuidParse(e,t){const n=e;return n.uuid=n.nss,n.nss=void 0,t.tolerant||n.uuid&&isUUID(n.uuid)||(n.error=n.error||"UUID is not valid."),n}function urnuuidSerialize(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t}const http={scheme:"http",domainHost:!0,parse:httpParse,serialize:httpSerialize},https={scheme:"https",domainHost:http.domainHost,parse:httpParse,serialize:httpSerialize},ws={scheme:"ws",domainHost:!0,parse:wsParse,serialize:wsSerialize},wss={scheme:"wss",domainHost:ws.domainHost,parse:ws.parse,serialize:ws.serialize},urn={scheme:"urn",parse:urnParse,serialize:urnSerialize,skipNormalize:!0},urnuuid={scheme:"urn:uuid",parse:urnuuidParse,serialize:urnuuidSerialize,skipNormalize:!0},SCHEMES$1={http:http,https:https,ws:ws,wss:wss,urn:urn,"urn:uuid":urnuuid};function getSchemeHandler$1(e){return e&&(SCHEMES$1[e]||SCHEMES$1[e.toLowerCase()])||void 0}Object.setPrototypeOf(SCHEMES$1,null);var schemes={SCHEMES:SCHEMES$1,getSchemeHandler:getSchemeHandler$1};const{normalizeIPv6:normalizeIPv6,removeDotSegments:removeDotSegments,recomposeAuthority:recomposeAuthority,normalizeComponentEncoding:normalizeComponentEncoding,isIPv4:isIPv4,nonSimpleDomain:nonSimpleDomain}=utils$1,{SCHEMES:SCHEMES,getSchemeHandler:getSchemeHandler}=schemes;function normalize(e,t){return"string"==typeof e?e=serialize(parse(e,t),t):"object"==typeof e&&(e=parse(serialize(e,t),t)),e}function resolve(e,t,n){const r=n?Object.assign({scheme:"null"},n):{scheme:"null"},o=resolveComponent(parse(e,r),parse(t,r),r,!0);return r.skipEscape=!0,serialize(o,r)}function resolveComponent(e,t,n,r){const o={};return r||(e=parse(serialize(e,n),n),t=parse(serialize(t,n),n)),!(n=n||{}).tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=removeDotSegments(t.path||""),o.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=removeDotSegments(t.path||""),o.query=t.query):(t.path?("/"===t.path[0]?o.path=removeDotSegments(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path:o.path="/"+t.path,o.path=removeDotSegments(o.path)),o.query=t.query):(o.path=e.path,void 0!==t.query?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}function equal$2(e,t,n){return"string"==typeof e?(e=unescape(e),e=serialize(normalizeComponentEncoding(parse(e,n),!0),{...n,skipEscape:!0})):"object"==typeof e&&(e=serialize(normalizeComponentEncoding(e,!0),{...n,skipEscape:!0})),"string"==typeof t?(t=unescape(t),t=serialize(normalizeComponentEncoding(parse(t,n),!0),{...n,skipEscape:!0})):"object"==typeof t&&(t=serialize(normalizeComponentEncoding(t,!0),{...n,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function serialize(e,t){const n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},r=Object.assign({},t),o=[],a=getSchemeHandler(r.scheme||n.scheme);a&&a.serialize&&a.serialize(n,r),void 0!==n.path&&(r.skipEscape?n.path=unescape(n.path):(n.path=escape(n.path),void 0!==n.scheme&&(n.path=n.path.split("%3A").join(":")))),"suffix"!==r.reference&&n.scheme&&o.push(n.scheme,":");const i=recomposeAuthority(n);if(void 0!==i&&("suffix"!==r.reference&&o.push("//"),o.push(i),n.path&&"/"!==n.path[0]&&o.push("/")),void 0!==n.path){let e=n.path;r.absolutePath||a&&a.absolutePath||(e=removeDotSegments(e)),void 0===i&&"/"===e[0]&&"/"===e[1]&&(e="/%2F"+e.slice(2)),o.push(e)}return void 0!==n.query&&o.push("?",n.query),void 0!==n.fragment&&o.push("#",n.fragment),o.join("")}const URI_PARSE=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function parse(e,t){const n=Object.assign({},t),r={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let o=!1;"suffix"===n.reference&&(e=n.scheme?n.scheme+":"+e:"//"+e);const a=e.match(URI_PARSE);if(a){if(r.scheme=a[1],r.userinfo=a[3],r.host=a[4],r.port=parseInt(a[5],10),r.path=a[6]||"",r.query=a[7],r.fragment=a[8],isNaN(r.port)&&(r.port=a[5]),r.host){if(!1===isIPv4(r.host)){const e=normalizeIPv6(r.host);r.host=e.host.toLowerCase(),o=e.isIPV6}else o=!0}void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||void 0!==r.query||r.path?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",n.reference&&"suffix"!==n.reference&&n.reference!==r.reference&&(r.error=r.error||"URI is not a "+n.reference+" reference.");const t=getSchemeHandler(n.scheme||r.scheme);if(!(n.unicodeSupport||t&&t.unicodeSupport)&&r.host&&(n.domainHost||t&&t.domainHost)&&!1===o&&nonSimpleDomain(r.host))try{r.host=URL.domainToASCII(r.host.toLowerCase())}catch(i){r.error=r.error||"Host's domain name can not be converted to ASCII: "+i}(!t||t&&!t.skipNormalize)&&(-1!==e.indexOf("%")&&(void 0!==r.scheme&&(r.scheme=unescape(r.scheme)),void 0!==r.host&&(r.host=unescape(r.host))),r.path&&(r.path=escape(unescape(r.path))),r.fragment&&(r.fragment=encodeURI(decodeURIComponent(r.fragment)))),t&&t.parse&&t.parse(r,n)}else r.error=r.error||"URI can not be parsed.";return r}const fastUri={SCHEMES:SCHEMES,normalize:normalize,resolve:resolve,resolveComponent:resolveComponent,equal:equal$2,serialize:serialize,parse:parse};fastUri$1.exports=fastUri,fastUri$1.exports.default=fastUri,fastUri$1.exports.fastUri=fastUri;var fastUriExports=fastUri$1.exports;Object.defineProperty(uri$1,"__esModule",{value:!0});const uri=fastUriExports;uri.code='require("ajv/dist/runtime/uri").default',uri$1.default=uri,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=requireValidate();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=codegen;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const r=validation_error,o=ref_error,a=rules,i=compile,s=codegen,l=resolve$2,u=dataType,c=util,d=require$$9,f=uri$1,p=(e,t)=>new RegExp(e,t);p.code="new RegExp";const h=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},b={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function y(e){var t,n,r,o,a,i,s,l,u,c,d,h,m,g,b,y,_,v,w,S,x,T,E,k,P;const O=e.strict,A=null===(t=e.code)||void 0===t?void 0:t.optimize,R=!0===A||void 0===A?1:A||0,$=null!==(r=null===(n=e.code)||void 0===n?void 0:n.regExp)&&void 0!==r?r:p,I=null!==(o=e.uriResolver)&&void 0!==o?o:f.default;return{strictSchema:null===(i=null!==(a=e.strictSchema)&&void 0!==a?a:O)||void 0===i||i,strictNumbers:null===(l=null!==(s=e.strictNumbers)&&void 0!==s?s:O)||void 0===l||l,strictTypes:null!==(c=null!==(u=e.strictTypes)&&void 0!==u?u:O)&&void 0!==c?c:"log",strictTuples:null!==(h=null!==(d=e.strictTuples)&&void 0!==d?d:O)&&void 0!==h?h:"log",strictRequired:null!==(g=null!==(m=e.strictRequired)&&void 0!==m?m:O)&&void 0!==g&&g,code:e.code?{...e.code,optimize:R,regExp:$}:{optimize:R,regExp:$},loopRequired:null!==(b=e.loopRequired)&&void 0!==b?b:200,loopEnum:null!==(y=e.loopEnum)&&void 0!==y?y:200,meta:null===(_=e.meta)||void 0===_||_,messages:null===(v=e.messages)||void 0===v||v,inlineRefs:null===(w=e.inlineRefs)||void 0===w||w,schemaId:null!==(S=e.schemaId)&&void 0!==S?S:"$id",addUsedSchema:null===(x=e.addUsedSchema)||void 0===x||x,validateSchema:null===(T=e.validateSchema)||void 0===T||T,validateFormats:null===(E=e.validateFormats)||void 0===E||E,unicodeRegExp:null===(k=e.unicodeRegExp)||void 0===k||k,int32range:null===(P=e.int32range)||void 0===P||P,uriResolver:I}}class _{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...y(e)};const{es5:t,lines:n}=this.opts.code;this.scope=new s.ValueScope({scope:{},prefixes:m,es5:t,lines:n}),this.logger=function(e){if(!1===e)return k;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),v.call(this,g,e,"NOT SUPPORTED"),v.call(this,b,e,"DEPRECATED","warn"),this._metaOpts=E.call(this),e.formats&&x.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&T.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),S.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:n}=this.opts;let r=d;"id"===n&&(r={...d},r.id=r.$id,delete r.$id),t&&e&&this.addMetaSchema(r,r[n],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let n;if("string"==typeof e){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);const r=n(t);return"$async"in n||(this.errors=n.errors),r}compile(e,t){const n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:n}=this.opts;return r.call(this,e,t);async function r(e,t){await a.call(this,e.$schema);const n=this._addSchema(e,t);return n.validate||i.call(this,n)}async function a(e){e&&!this.getSchema(e)&&await r.call(this,{$ref:e},!0)}async function i(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof o.default))throw t;return s.call(this,t),await l.call(this,t.missingSchema),i.call(this,e)}}function s({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function l(e){const n=await u.call(this,e);this.refs[e]||await a.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function u(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n,r=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,n,r);return this}let o;if("object"==typeof e){const{schemaId:t}=this.opts;if(o=e[t],void 0!==o&&"string"!=typeof o)throw new Error(`schema ${t} must be string`)}return t=(0,l.normalizeId)(t||o),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,r,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let n;if(n=e.$schema,void 0!==n&&"string"!=typeof n)throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const r=this.validate(n,e);if(!r&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return r}getSchema(e){let t;for(;"string"==typeof(t=w.call(this,e));)e=t;if(void 0===t){const{schemaId:n}=this.opts,r=new i.SchemaEnv({schema:{},schemaId:n});if(t=i.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=w.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,l.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if("string"==typeof e)n=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=n);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(n=(t=e).keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(O.call(this,n,t),!t)return(0,c.eachItem)(n,e=>A.call(this,e)),this;$.call(this,t);const r={...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)};return(0,c.eachItem)(n,0===r.type.length?e=>A.call(this,e,r):e=>r.type.forEach(t=>A.call(this,e,r,t))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const n of t.rules){const t=n.rules.findIndex(t=>t.keyword===e);t>=0&&n.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:n="data"}={}){return e&&0!==e.length?e.map(e=>`${n}${e.instancePath} ${e.message}`).reduce((e,n)=>e+t+n):"No errors"}$dataMetaSchema(e,t){const n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const r of t){const t=r.split("/").slice(1);let o=e;for(const e of t)o=o[e];for(const e in n){const t=n[e];if("object"!=typeof t)continue;const{$data:r}=t.definition,a=o[e];r&&a&&(o[e]=C(a))}}return e}_removeAllSchemas(e,t){for(const n in e){const r=e[n];t&&!t.test(n)||("string"==typeof r?delete e[n]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[n]))}}_addSchema(e,t,n,r=this.opts.validateSchema,o=this.opts.addUsedSchema){let a;const{schemaId:s}=this.opts;if("object"==typeof e)a=e[s];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let u=this._cache.get(e);if(void 0!==u)return u;n=(0,l.normalizeId)(a||n);const c=l.getSchemaRefs.call(this,e,n);return u=new i.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:n,localRefs:c}),this._cache.set(u.schema,u),o&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=u),r&&this.validateSchema(e,!0),u}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):i.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{i.compileSchema.call(this,e)}finally{this.opts=t}}}function v(e,t,n,r="error"){for(const o in e){const a=o;a in t&&this.logger[r](`${n}: option ${o}. ${e[a]}`)}}function w(e){return e=(0,l.normalizeId)(e),this.schemas[e]||this.refs[e]}function S(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function x(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function T(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const n=e[t];n.keyword||(n.keyword=t),this.addKeyword(n)}}}function E(){const e={...this.opts};for(const t of h)delete e[t];return e}_.ValidationError=r.default,_.MissingRefError=o.default,e.default=_;const k={log(){},warn(){},error(){}};const P=/^[a-z_$][a-z0-9_$:-]*$/i;function O(e,t){const{RULES:n}=this;if((0,c.eachItem)(e,e=>{if(n.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!P.test(e))throw new Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function A(e,t,n){var r;const o=null==t?void 0:t.post;if(n&&o)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:a}=this;let i=o?a.post:a.rules.find(({type:e})=>e===n);if(i||(i={type:n,rules:[]},a.rules.push(i)),a.keywords[e]=!0,!t)return;const s={keyword:e,definition:{...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)}};t.before?R.call(this,i,s,t.before):i.rules.push(s),a.all[e]=s,null===(r=t.implements)||void 0===r||r.forEach(e=>this.addKeyword(e))}function R(e,t,n){const r=e.rules.findIndex(e=>e.keyword===n);r>=0?e.rules.splice(r,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function $(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=C(t)),e.validateSchema=this.compile(t,!0))}const I={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function C(e){return{anyOf:[e,I]}}}(core$2);var draft7={},core$1={},id={};Object.defineProperty(id,"__esModule",{value:!0});const def$s={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};id.default=def$s;var ref={};Object.defineProperty(ref,"__esModule",{value:!0}),ref.callRef=ref.getValidate=void 0;const ref_error_1$1=ref_error,code_1$8=requireCode(),codegen_1$l=codegen,names_1$1=requireNames(),compile_1$1=compile,util_1$j=util,def$r={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:n,it:r}=e,{baseId:o,schemaEnv:a,validateName:i,opts:s,self:l}=r,{root:u}=a;if(("#"===n||"#/"===n)&&o===u.baseId)return function(){if(a===u)return callRef(e,i,a,a.$async);const n=t.scopeValue("root",{ref:u});return callRef(e,codegen_1$l._`${n}.validate`,u,u.$async)}();const c=compile_1$1.resolveRef.call(l,u,o,n);if(void 0===c)throw new ref_error_1$1.default(r.opts.uriResolver,o,n);return c instanceof compile_1$1.SchemaEnv?function(t){const n=getValidate(e,t);callRef(e,n,t,t.$async)}(c):function(r){const o=t.scopeValue("schema",!0===s.code.source?{ref:r,code:(0,codegen_1$l.stringify)(r)}:{ref:r}),a=t.name("valid"),i=e.subschema({schema:r,dataTypes:[],schemaPath:codegen_1$l.nil,topSchemaRef:o,errSchemaPath:n},a);e.mergeEvaluated(i),e.ok(a)}(c)}};function getValidate(e,t){const{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):codegen_1$l._`${n.scopeValue("wrapper",{ref:t})}.validate`}function callRef(e,t,n,r){const{gen:o,it:a}=e,{allErrors:i,schemaEnv:s,opts:l}=a,u=l.passContext?names_1$1.default.this:codegen_1$l.nil;function c(e){const t=codegen_1$l._`${e}.errors`;o.assign(names_1$1.default.vErrors,codegen_1$l._`${names_1$1.default.vErrors} === null ? ${t} : ${names_1$1.default.vErrors}.concat(${t})`),o.assign(names_1$1.default.errors,codegen_1$l._`${names_1$1.default.vErrors}.length`)}function d(e){var t;if(!a.opts.unevaluated)return;const r=null===(t=null==n?void 0:n.validate)||void 0===t?void 0:t.evaluated;if(!0!==a.props)if(r&&!r.dynamicProps)void 0!==r.props&&(a.props=util_1$j.mergeEvaluated.props(o,r.props,a.props));else{const t=o.var("props",codegen_1$l._`${e}.evaluated.props`);a.props=util_1$j.mergeEvaluated.props(o,t,a.props,codegen_1$l.Name)}if(!0!==a.items)if(r&&!r.dynamicItems)void 0!==r.items&&(a.items=util_1$j.mergeEvaluated.items(o,r.items,a.items));else{const t=o.var("items",codegen_1$l._`${e}.evaluated.items`);a.items=util_1$j.mergeEvaluated.items(o,t,a.items,codegen_1$l.Name)}}r?function(){if(!s.$async)throw new Error("async schema referenced by sync schema");const n=o.let("valid");o.try(()=>{o.code(codegen_1$l._`await ${(0,code_1$8.callValidateCode)(e,t,u)}`),d(t),i||o.assign(n,!0)},e=>{o.if(codegen_1$l._`!(${e} instanceof ${a.ValidationError})`,()=>o.throw(e)),c(e),i||o.assign(n,!1)}),e.ok(n)}():e.result((0,code_1$8.callValidateCode)(e,t,u),()=>d(t),()=>c(t))}ref.getValidate=getValidate,ref.callRef=callRef,ref.default=def$r,Object.defineProperty(core$1,"__esModule",{value:!0});const id_1=id,ref_1=ref,core=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",id_1.default,ref_1.default];core$1.default=core;var validation$1={},limitNumber={};Object.defineProperty(limitNumber,"__esModule",{value:!0});const codegen_1$k=codegen,ops=codegen_1$k.operators,KWDs={maximum:{okStr:"<=",ok:ops.LTE,fail:ops.GT},minimum:{okStr:">=",ok:ops.GTE,fail:ops.LT},exclusiveMaximum:{okStr:"<",ok:ops.LT,fail:ops.GTE},exclusiveMinimum:{okStr:">",ok:ops.GT,fail:ops.LTE}},error$i={message:({keyword:e,schemaCode:t})=>codegen_1$k.str`must be ${KWDs[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>codegen_1$k._`{comparison: ${KWDs[e].okStr}, limit: ${t}}`},def$q={keyword:Object.keys(KWDs),type:"number",schemaType:"number",$data:!0,error:error$i,code(e){const{keyword:t,data:n,schemaCode:r}=e;e.fail$data(codegen_1$k._`${n} ${KWDs[t].fail} ${r} || isNaN(${n})`)}};limitNumber.default=def$q;var multipleOf={};Object.defineProperty(multipleOf,"__esModule",{value:!0});const codegen_1$j=codegen,error$h={message:({schemaCode:e})=>codegen_1$j.str`must be multiple of ${e}`,params:({schemaCode:e})=>codegen_1$j._`{multipleOf: ${e}}`},def$p={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:error$h,code(e){const{gen:t,data:n,schemaCode:r,it:o}=e,a=o.opts.multipleOfPrecision,i=t.let("res"),s=a?codegen_1$j._`Math.abs(Math.round(${i}) - ${i}) > 1e-${a}`:codegen_1$j._`${i} !== parseInt(${i})`;e.fail$data(codegen_1$j._`(${r} === 0 || (${i} = ${n}/${r}, ${s}))`)}};multipleOf.default=def$p;var limitLength={},ucs2length$1={};function ucs2length(e){const t=e.length;let n,r=0,o=0;for(;o<t;)r++,n=e.charCodeAt(o++),n>=55296&&n<=56319&&o<t&&(n=e.charCodeAt(o),56320==(64512&n)&&o++);return r}Object.defineProperty(ucs2length$1,"__esModule",{value:!0}),ucs2length$1.default=ucs2length,ucs2length.code='require("ajv/dist/runtime/ucs2length").default',Object.defineProperty(limitLength,"__esModule",{value:!0});const codegen_1$i=codegen,util_1$i=util,ucs2length_1=ucs2length$1,error$g={message({keyword:e,schemaCode:t}){const n="maxLength"===e?"more":"fewer";return codegen_1$i.str`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>codegen_1$i._`{limit: ${e}}`},def$o={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:error$g,code(e){const{keyword:t,data:n,schemaCode:r,it:o}=e,a="maxLength"===t?codegen_1$i.operators.GT:codegen_1$i.operators.LT,i=!1===o.opts.unicode?codegen_1$i._`${n}.length`:codegen_1$i._`${(0,util_1$i.useFunc)(e.gen,ucs2length_1.default)}(${n})`;e.fail$data(codegen_1$i._`${i} ${a} ${r}`)}};limitLength.default=def$o;var pattern={};Object.defineProperty(pattern,"__esModule",{value:!0});const code_1$7=requireCode(),codegen_1$h=codegen,error$f={message:({schemaCode:e})=>codegen_1$h.str`must match pattern "${e}"`,params:({schemaCode:e})=>codegen_1$h._`{pattern: ${e}}`},def$n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:error$f,code(e){const{data:t,$data:n,schema:r,schemaCode:o,it:a}=e,i=a.opts.unicodeRegExp?"u":"",s=n?codegen_1$h._`(new RegExp(${o}, ${i}))`:(0,code_1$7.usePattern)(e,r);e.fail$data(codegen_1$h._`!${s}.test(${t})`)}};pattern.default=def$n;var limitProperties={};Object.defineProperty(limitProperties,"__esModule",{value:!0});const codegen_1$g=codegen,error$e={message({keyword:e,schemaCode:t}){const n="maxProperties"===e?"more":"fewer";return codegen_1$g.str`must NOT have ${n} than ${t} properties`},params:({schemaCode:e})=>codegen_1$g._`{limit: ${e}}`},def$m={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:error$e,code(e){const{keyword:t,data:n,schemaCode:r}=e,o="maxProperties"===t?codegen_1$g.operators.GT:codegen_1$g.operators.LT;e.fail$data(codegen_1$g._`Object.keys(${n}).length ${o} ${r}`)}};limitProperties.default=def$m;var required={};Object.defineProperty(required,"__esModule",{value:!0});const code_1$6=requireCode(),codegen_1$f=codegen,util_1$h=util,error$d={message:({params:{missingProperty:e}})=>codegen_1$f.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>codegen_1$f._`{missingProperty: ${e}}`},def$l={keyword:"required",type:"object",schemaType:"array",$data:!0,error:error$d,code(e){const{gen:t,schema:n,schemaCode:r,data:o,$data:a,it:i}=e,{opts:s}=i;if(!a&&0===n.length)return;const l=n.length>=s.loopRequired;if(i.allErrors?function(){if(l||a)e.block$data(codegen_1$f.nil,u);else for(const t of n)(0,code_1$6.checkReportMissingProp)(e,t)}():function(){const i=t.let("missing");if(l||a){const n=t.let("valid",!0);e.block$data(n,()=>function(n,a){e.setParams({missingProperty:n}),t.forOf(n,r,()=>{t.assign(a,(0,code_1$6.propertyInData)(t,o,n,s.ownProperties)),t.if((0,codegen_1$f.not)(a),()=>{e.error(),t.break()})},codegen_1$f.nil)}(i,n)),e.ok(n)}else t.if((0,code_1$6.checkMissingProp)(e,n,i)),(0,code_1$6.reportMissingProp)(e,i),t.else()}(),s.strictRequired){const t=e.parentSchema.properties,{definedProperties:r}=e.it;for(const e of n)if(void 0===(null==t?void 0:t[e])&&!r.has(e)){const t=`required property "${e}" is not defined at "${i.schemaEnv.baseId+i.errSchemaPath}" (strictRequired)`;(0,util_1$h.checkStrictMode)(i,t,i.opts.strictRequired)}}function u(){t.forOf("prop",r,n=>{e.setParams({missingProperty:n}),t.if((0,code_1$6.noPropertyInData)(t,o,n,s.ownProperties),()=>e.error())})}}};required.default=def$l;var limitItems={};Object.defineProperty(limitItems,"__esModule",{value:!0});const codegen_1$e=codegen,error$c={message({keyword:e,schemaCode:t}){const n="maxItems"===e?"more":"fewer";return codegen_1$e.str`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>codegen_1$e._`{limit: ${e}}`},def$k={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:error$c,code(e){const{keyword:t,data:n,schemaCode:r}=e,o="maxItems"===t?codegen_1$e.operators.GT:codegen_1$e.operators.LT;e.fail$data(codegen_1$e._`${n}.length ${o} ${r}`)}};limitItems.default=def$k;var uniqueItems={},equal$1={};Object.defineProperty(equal$1,"__esModule",{value:!0});const equal=fastDeepEqual;equal.code='require("ajv/dist/runtime/equal").default',equal$1.default=equal,Object.defineProperty(uniqueItems,"__esModule",{value:!0});const dataType_1=dataType,codegen_1$d=codegen,util_1$g=util,equal_1$2=equal$1,error$b={message:({params:{i:e,j:t}})=>codegen_1$d.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>codegen_1$d._`{i: ${e}, j: ${t}}`},def$j={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:error$b,code(e){const{gen:t,data:n,$data:r,schema:o,parentSchema:a,schemaCode:i,it:s}=e;if(!r&&!o)return;const l=t.let("valid"),u=a.items?(0,dataType_1.getSchemaTypes)(a.items):[];function c(r,o){const a=t.name("item"),i=(0,dataType_1.checkDataTypes)(u,a,s.opts.strictNumbers,dataType_1.DataType.Wrong),c=t.const("indices",codegen_1$d._`{}`);t.for(codegen_1$d._`;${r}--;`,()=>{t.let(a,codegen_1$d._`${n}[${r}]`),t.if(i,codegen_1$d._`continue`),u.length>1&&t.if(codegen_1$d._`typeof ${a} == "string"`,codegen_1$d._`${a} += "_"`),t.if(codegen_1$d._`typeof ${c}[${a}] == "number"`,()=>{t.assign(o,codegen_1$d._`${c}[${a}]`),e.error(),t.assign(l,!1).break()}).code(codegen_1$d._`${c}[${a}] = ${r}`)})}function d(r,o){const a=(0,util_1$g.useFunc)(t,equal_1$2.default),i=t.name("outer");t.label(i).for(codegen_1$d._`;${r}--;`,()=>t.for(codegen_1$d._`${o} = ${r}; ${o}--;`,()=>t.if(codegen_1$d._`${a}(${n}[${r}], ${n}[${o}])`,()=>{e.error(),t.assign(l,!1).break(i)})))}e.block$data(l,function(){const r=t.let("i",codegen_1$d._`${n}.length`),o=t.let("j");e.setParams({i:r,j:o}),t.assign(l,!0),t.if(codegen_1$d._`${r} > 1`,()=>(u.length>0&&!u.some(e=>"object"===e||"array"===e)?c:d)(r,o))},codegen_1$d._`${i} === false`),e.ok(l)}};uniqueItems.default=def$j;var _const={};Object.defineProperty(_const,"__esModule",{value:!0});const codegen_1$c=codegen,util_1$f=util,equal_1$1=equal$1,error$a={message:"must be equal to constant",params:({schemaCode:e})=>codegen_1$c._`{allowedValue: ${e}}`},def$i={keyword:"const",$data:!0,error:error$a,code(e){const{gen:t,data:n,$data:r,schemaCode:o,schema:a}=e;r||a&&"object"==typeof a?e.fail$data(codegen_1$c._`!${(0,util_1$f.useFunc)(t,equal_1$1.default)}(${n}, ${o})`):e.fail(codegen_1$c._`${a} !== ${n}`)}};_const.default=def$i;var _enum={};Object.defineProperty(_enum,"__esModule",{value:!0});const codegen_1$b=codegen,util_1$e=util,equal_1=equal$1,error$9={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>codegen_1$b._`{allowedValues: ${e}}`},def$h={keyword:"enum",schemaType:"array",$data:!0,error:error$9,code(e){const{gen:t,data:n,$data:r,schema:o,schemaCode:a,it:i}=e;if(!r&&0===o.length)throw new Error("enum must have non-empty array");const s=o.length>=i.opts.loopEnum;let l;const u=()=>null!=l?l:l=(0,util_1$e.useFunc)(t,equal_1.default);let c;if(s||r)c=t.let("valid"),e.block$data(c,function(){t.assign(c,!1),t.forOf("v",a,e=>t.if(codegen_1$b._`${u()}(${n}, ${e})`,()=>t.assign(c,!0).break()))});else{if(!Array.isArray(o))throw new Error("ajv implementation error");const e=t.const("vSchema",a);c=(0,codegen_1$b.or)(...o.map((t,r)=>function(e,t){const r=o[t];return"object"==typeof r&&null!==r?codegen_1$b._`${u()}(${n}, ${e}[${t}])`:codegen_1$b._`${n} === ${r}`}(e,r)))}e.pass(c)}};_enum.default=def$h,Object.defineProperty(validation$1,"__esModule",{value:!0});const limitNumber_1=limitNumber,multipleOf_1=multipleOf,limitLength_1=limitLength,pattern_1=pattern,limitProperties_1=limitProperties,required_1=required,limitItems_1=limitItems,uniqueItems_1=uniqueItems,const_1=_const,enum_1=_enum,validation=[limitNumber_1.default,multipleOf_1.default,limitLength_1.default,pattern_1.default,limitProperties_1.default,required_1.default,limitItems_1.default,uniqueItems_1.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},const_1.default,enum_1.default];validation$1.default=validation;var applicator={},additionalItems={};Object.defineProperty(additionalItems,"__esModule",{value:!0}),additionalItems.validateAdditionalItems=void 0;const codegen_1$a=codegen,util_1$d=util,error$8={message:({params:{len:e}})=>codegen_1$a.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>codegen_1$a._`{limit: ${e}}`},def$g={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:error$8,code(e){const{parentSchema:t,it:n}=e,{items:r}=t;Array.isArray(r)?validateAdditionalItems(e,r):(0,util_1$d.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas')}};function validateAdditionalItems(e,t){const{gen:n,schema:r,data:o,keyword:a,it:i}=e;i.items=!0;const s=n.const("len",codegen_1$a._`${o}.length`);if(!1===r)e.setParams({len:t.length}),e.pass(codegen_1$a._`${s} <= ${t.length}`);else if("object"==typeof r&&!(0,util_1$d.alwaysValidSchema)(i,r)){const r=n.var("valid",codegen_1$a._`${s} <= ${t.length}`);n.if((0,codegen_1$a.not)(r),()=>function(r){n.forRange("i",t.length,s,t=>{e.subschema({keyword:a,dataProp:t,dataPropType:util_1$d.Type.Num},r),i.allErrors||n.if((0,codegen_1$a.not)(r),()=>n.break())})}(r)),e.ok(r)}}additionalItems.validateAdditionalItems=validateAdditionalItems,additionalItems.default=def$g;var prefixItems={},items={};Object.defineProperty(items,"__esModule",{value:!0}),items.validateTuple=void 0;const codegen_1$9=codegen,util_1$c=util,code_1$5=requireCode(),def$f={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return validateTuple(e,"additionalItems",t);n.items=!0,(0,util_1$c.alwaysValidSchema)(n,t)||e.ok((0,code_1$5.validateArray)(e))}};function validateTuple(e,t,n=e.schema){const{gen:r,parentSchema:o,data:a,keyword:i,it:s}=e;!function(e){const{opts:r,errSchemaPath:o}=s,a=n.length,l=a===e.minItems&&(a===e.maxItems||!1===e[t]);if(r.strictTuples&&!l){const e=`"${i}" is ${a}-tuple, but minItems or maxItems/${t} are not specified or different at path "${o}"`;(0,util_1$c.checkStrictMode)(s,e,r.strictTuples)}}(o),s.opts.unevaluated&&n.length&&!0!==s.items&&(s.items=util_1$c.mergeEvaluated.items(r,n.length,s.items));const l=r.name("valid"),u=r.const("len",codegen_1$9._`${a}.length`);n.forEach((t,n)=>{(0,util_1$c.alwaysValidSchema)(s,t)||(r.if(codegen_1$9._`${u} > ${n}`,()=>e.subschema({keyword:i,schemaProp:n,dataProp:n},l)),e.ok(l))})}items.validateTuple=validateTuple,items.default=def$f,Object.defineProperty(prefixItems,"__esModule",{value:!0});const items_1$1=items,def$e={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,items_1$1.validateTuple)(e,"items")};prefixItems.default=def$e;var items2020={};Object.defineProperty(items2020,"__esModule",{value:!0});const codegen_1$8=codegen,util_1$b=util,code_1$4=requireCode(),additionalItems_1$1=additionalItems,error$7={message:({params:{len:e}})=>codegen_1$8.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>codegen_1$8._`{limit: ${e}}`},def$d={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:error$7,code(e){const{schema:t,parentSchema:n,it:r}=e,{prefixItems:o}=n;r.items=!0,(0,util_1$b.alwaysValidSchema)(r,t)||(o?(0,additionalItems_1$1.validateAdditionalItems)(e,o):e.ok((0,code_1$4.validateArray)(e)))}};items2020.default=def$d;var contains={};Object.defineProperty(contains,"__esModule",{value:!0});const codegen_1$7=codegen,util_1$a=util,error$6={message:({params:{min:e,max:t}})=>void 0===t?codegen_1$7.str`must contain at least ${e} valid item(s)`:codegen_1$7.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?codegen_1$7._`{minContains: ${e}}`:codegen_1$7._`{minContains: ${e}, maxContains: ${t}}`},def$c={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:error$6,code(e){const{gen:t,schema:n,parentSchema:r,data:o,it:a}=e;let i,s;const{minContains:l,maxContains:u}=r;a.opts.next?(i=void 0===l?1:l,s=u):i=1;const c=t.const("len",codegen_1$7._`${o}.length`);if(e.setParams({min:i,max:s}),void 0===s&&0===i)return void(0,util_1$a.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==s&&i>s)return(0,util_1$a.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,util_1$a.alwaysValidSchema)(a,n)){let t=codegen_1$7._`${c} >= ${i}`;return void 0!==s&&(t=codegen_1$7._`${t} && ${c} <= ${s}`),void e.pass(t)}a.items=!0;const d=t.name("valid");function f(){const e=t.name("_valid"),n=t.let("count",0);p(e,()=>t.if(e,()=>function(e){t.code(codegen_1$7._`${e}++`),void 0===s?t.if(codegen_1$7._`${e} >= ${i}`,()=>t.assign(d,!0).break()):(t.if(codegen_1$7._`${e} > ${s}`,()=>t.assign(d,!1).break()),1===i?t.assign(d,!0):t.if(codegen_1$7._`${e} >= ${i}`,()=>t.assign(d,!0)))}(n)))}function p(n,r){t.forRange("i",0,c,t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:util_1$a.Type.Num,compositeRule:!0},n),r()})}void 0===s&&1===i?p(d,()=>t.if(d,()=>t.break())):0===i?(t.let(d,!0),void 0!==s&&t.if(codegen_1$7._`${o}.length > 0`,f)):(t.let(d,!1),f()),e.result(d,()=>e.reset())}};contains.default=def$c;var dependencies={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=codegen,n=util,r=requireCode();e.error={message:({params:{property:e,depsCount:n,deps:r}})=>{const o=1===n?"property":"properties";return t.str`must have ${o} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:n,deps:r,missingProperty:o}})=>t._`{property: ${e},
|
|
72
|
+
missingProperty: ${o},
|
|
73
|
+
depsCount: ${n},
|
|
74
|
+
deps: ${r}}`};const o={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(e){const[t,n]=function({schema:e}){const t={},n={};for(const r in e){if("__proto__"===r)continue;(Array.isArray(e[r])?t:n)[r]=e[r]}return[t,n]}(e);a(e,t),i(e,n)}};function a(e,n=e.schema){const{gen:o,data:a,it:i}=e;if(0===Object.keys(n).length)return;const s=o.let("missing");for(const l in n){const u=n[l];if(0===u.length)continue;const c=(0,r.propertyInData)(o,a,l,i.opts.ownProperties);e.setParams({property:l,depsCount:u.length,deps:u.join(", ")}),i.allErrors?o.if(c,()=>{for(const t of u)(0,r.checkReportMissingProp)(e,t)}):(o.if(t._`${c} && (${(0,r.checkMissingProp)(e,u,s)})`),(0,r.reportMissingProp)(e,s),o.else())}}function i(e,t=e.schema){const{gen:o,data:a,keyword:i,it:s}=e,l=o.name("valid");for(const u in t)(0,n.alwaysValidSchema)(s,t[u])||(o.if((0,r.propertyInData)(o,a,u,s.opts.ownProperties),()=>{const t=e.subschema({keyword:i,schemaProp:u},l);e.mergeValidEvaluated(t,l)},()=>o.var(l,!0)),e.ok(l))}e.validatePropertyDeps=a,e.validateSchemaDeps=i,e.default=o}(dependencies);var propertyNames={};Object.defineProperty(propertyNames,"__esModule",{value:!0});const codegen_1$6=codegen,util_1$9=util,error$5={message:"property name must be valid",params:({params:e})=>codegen_1$6._`{propertyName: ${e.propertyName}}`},def$b={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:error$5,code(e){const{gen:t,schema:n,data:r,it:o}=e;if((0,util_1$9.alwaysValidSchema)(o,n))return;const a=t.name("valid");t.forIn("key",r,n=>{e.setParams({propertyName:n}),e.subschema({keyword:"propertyNames",data:n,dataTypes:["string"],propertyName:n,compositeRule:!0},a),t.if((0,codegen_1$6.not)(a),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(a)}};propertyNames.default=def$b;var additionalProperties={};Object.defineProperty(additionalProperties,"__esModule",{value:!0});const code_1$3=requireCode(),codegen_1$5=codegen,names_1=requireNames(),util_1$8=util,error$4={message:"must NOT have additional properties",params:({params:e})=>codegen_1$5._`{additionalProperty: ${e.additionalProperty}}`},def$a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:error$4,code(e){const{gen:t,schema:n,parentSchema:r,data:o,errsCount:a,it:i}=e;if(!a)throw new Error("ajv implementation error");const{allErrors:s,opts:l}=i;if(i.props=!0,"all"!==l.removeAdditional&&(0,util_1$8.alwaysValidSchema)(i,n))return;const u=(0,code_1$3.allSchemaProperties)(r.properties),c=(0,code_1$3.allSchemaProperties)(r.patternProperties);function d(e){t.code(codegen_1$5._`delete ${o}[${e}]`)}function f(r){if("all"===l.removeAdditional||l.removeAdditional&&!1===n)d(r);else{if(!1===n)return e.setParams({additionalProperty:r}),e.error(),void(s||t.break());if("object"==typeof n&&!(0,util_1$8.alwaysValidSchema)(i,n)){const n=t.name("valid");"failing"===l.removeAdditional?(p(r,n,!1),t.if((0,codegen_1$5.not)(n),()=>{e.reset(),d(r)})):(p(r,n),s||t.if((0,codegen_1$5.not)(n),()=>t.break()))}}}function p(t,n,r){const o={keyword:"additionalProperties",dataProp:t,dataPropType:util_1$8.Type.Str};!1===r&&Object.assign(o,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(o,n)}t.forIn("key",o,n=>{u.length||c.length?t.if(function(n){let o;if(u.length>8){const e=(0,util_1$8.schemaRefOrVal)(i,r.properties,"properties");o=(0,code_1$3.isOwnProperty)(t,e,n)}else o=u.length?(0,codegen_1$5.or)(...u.map(e=>codegen_1$5._`${n} === ${e}`)):codegen_1$5.nil;return c.length&&(o=(0,codegen_1$5.or)(o,...c.map(t=>codegen_1$5._`${(0,code_1$3.usePattern)(e,t)}.test(${n})`))),(0,codegen_1$5.not)(o)}(n),()=>f(n)):f(n)}),e.ok(codegen_1$5._`${a} === ${names_1.default.errors}`)}};additionalProperties.default=def$a;var properties$1={};Object.defineProperty(properties$1,"__esModule",{value:!0});const validate_1=requireValidate(),code_1$2=requireCode(),util_1$7=util,additionalProperties_1$1=additionalProperties,def$9={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,parentSchema:r,data:o,it:a}=e;"all"===a.opts.removeAdditional&&void 0===r.additionalProperties&&additionalProperties_1$1.default.code(new validate_1.KeywordCxt(a,additionalProperties_1$1.default,"additionalProperties"));const i=(0,code_1$2.allSchemaProperties)(n);for(const d of i)a.definedProperties.add(d);a.opts.unevaluated&&i.length&&!0!==a.props&&(a.props=util_1$7.mergeEvaluated.props(t,(0,util_1$7.toHash)(i),a.props));const s=i.filter(e=>!(0,util_1$7.alwaysValidSchema)(a,n[e]));if(0===s.length)return;const l=t.name("valid");for(const d of s)u(d)?c(d):(t.if((0,code_1$2.propertyInData)(t,o,d,a.opts.ownProperties)),c(d),a.allErrors||t.else().var(l,!0),t.endIf()),e.it.definedProperties.add(d),e.ok(l);function u(e){return a.opts.useDefaults&&!a.compositeRule&&void 0!==n[e].default}function c(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},l)}}};properties$1.default=def$9;var patternProperties={};Object.defineProperty(patternProperties,"__esModule",{value:!0});const code_1$1=requireCode(),codegen_1$4=codegen,util_1$6=util,util_2=util,def$8={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,data:r,parentSchema:o,it:a}=e,{opts:i}=a,s=(0,code_1$1.allSchemaProperties)(n),l=s.filter(e=>(0,util_1$6.alwaysValidSchema)(a,n[e]));if(0===s.length||l.length===s.length&&(!a.opts.unevaluated||!0===a.props))return;const u=i.strictSchema&&!i.allowMatchingProperties&&o.properties,c=t.name("valid");!0===a.props||a.props instanceof codegen_1$4.Name||(a.props=(0,util_2.evaluatedPropsToName)(t,a.props));const{props:d}=a;function f(e){for(const t in u)new RegExp(e).test(t)&&(0,util_1$6.checkStrictMode)(a,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function p(n){t.forIn("key",r,r=>{t.if(codegen_1$4._`${(0,code_1$1.usePattern)(e,n)}.test(${r})`,()=>{const o=l.includes(n);o||e.subschema({keyword:"patternProperties",schemaProp:n,dataProp:r,dataPropType:util_2.Type.Str},c),a.opts.unevaluated&&!0!==d?t.assign(codegen_1$4._`${d}[${r}]`,!0):o||a.allErrors||t.if((0,codegen_1$4.not)(c),()=>t.break())})})}!function(){for(const e of s)u&&f(e),a.allErrors?p(e):(t.var(c,!0),p(e),t.if(c))}()}};patternProperties.default=def$8;var not={};Object.defineProperty(not,"__esModule",{value:!0});const util_1$5=util,def$7={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:n,it:r}=e;if((0,util_1$5.alwaysValidSchema)(r,n))return void e.fail();const o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};not.default=def$7;var anyOf={};Object.defineProperty(anyOf,"__esModule",{value:!0});const code_1=requireCode(),def$6={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:code_1.validateUnion,error:{message:"must match a schema in anyOf"}};anyOf.default=def$6;var oneOf={};Object.defineProperty(oneOf,"__esModule",{value:!0});const codegen_1$3=codegen,util_1$4=util,error$3={message:"must match exactly one schema in oneOf",params:({params:e})=>codegen_1$3._`{passingSchemas: ${e.passing}}`},def$5={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:error$3,code(e){const{gen:t,schema:n,parentSchema:r,it:o}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(o.opts.discriminator&&r.discriminator)return;const a=n,i=t.let("valid",!1),s=t.let("passing",null),l=t.name("_valid");e.setParams({passing:s}),t.block(function(){a.forEach((n,r)=>{let a;(0,util_1$4.alwaysValidSchema)(o,n)?t.var(l,!0):a=e.subschema({keyword:"oneOf",schemaProp:r,compositeRule:!0},l),r>0&&t.if(codegen_1$3._`${l} && ${i}`).assign(i,!1).assign(s,codegen_1$3._`[${s}, ${r}]`).else(),t.if(l,()=>{t.assign(i,!0),t.assign(s,r),a&&e.mergeEvaluated(a,codegen_1$3.Name)})})}),e.result(i,()=>e.reset(),()=>e.error(!0))}};oneOf.default=def$5;var allOf={};Object.defineProperty(allOf,"__esModule",{value:!0});const util_1$3=util,def$4={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:n,it:r}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");const o=t.name("valid");n.forEach((t,n)=>{if((0,util_1$3.alwaysValidSchema)(r,t))return;const a=e.subschema({keyword:"allOf",schemaProp:n},o);e.ok(o),e.mergeEvaluated(a)})}};allOf.default=def$4;var _if={};Object.defineProperty(_if,"__esModule",{value:!0});const codegen_1$2=codegen,util_1$2=util,error$2={message:({params:e})=>codegen_1$2.str`must match "${e.ifClause}" schema`,params:({params:e})=>codegen_1$2._`{failingKeyword: ${e.ifClause}}`},def$3={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:error$2,code(e){const{gen:t,parentSchema:n,it:r}=e;void 0===n.then&&void 0===n.else&&(0,util_1$2.checkStrictMode)(r,'"if" without "then" and "else" is ignored');const o=hasSchema(r,"then"),a=hasSchema(r,"else");if(!o&&!a)return;const i=t.let("valid",!0),s=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},s);e.mergeEvaluated(t)}(),e.reset(),o&&a){const n=t.let("ifClause");e.setParams({ifClause:n}),t.if(s,l("then",n),l("else",n))}else o?t.if(s,l("then")):t.if((0,codegen_1$2.not)(s),l("else"));function l(n,r){return()=>{const o=e.subschema({keyword:n},s);t.assign(i,s),e.mergeValidEvaluated(o,i),r?t.assign(r,codegen_1$2._`${n}`):e.setParams({ifClause:n})}}e.pass(i,()=>e.error(!0))}};function hasSchema(e,t){const n=e.schema[t];return void 0!==n&&!(0,util_1$2.alwaysValidSchema)(e,n)}_if.default=def$3;var thenElse={};Object.defineProperty(thenElse,"__esModule",{value:!0});const util_1$1=util,def$2={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){void 0===t.if&&(0,util_1$1.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};thenElse.default=def$2,Object.defineProperty(applicator,"__esModule",{value:!0});const additionalItems_1=additionalItems,prefixItems_1=prefixItems,items_1=items,items2020_1=items2020,contains_1=contains,dependencies_1=dependencies,propertyNames_1=propertyNames,additionalProperties_1=additionalProperties,properties_1=properties$1,patternProperties_1=patternProperties,not_1=not,anyOf_1=anyOf,oneOf_1=oneOf,allOf_1=allOf,if_1=_if,thenElse_1=thenElse;function getApplicator(e=!1){const t=[not_1.default,anyOf_1.default,oneOf_1.default,allOf_1.default,if_1.default,thenElse_1.default,propertyNames_1.default,additionalProperties_1.default,dependencies_1.default,properties_1.default,patternProperties_1.default];return e?t.push(prefixItems_1.default,items2020_1.default):t.push(additionalItems_1.default,items_1.default),t.push(contains_1.default),t}applicator.default=getApplicator;var format$2={},format$1={};Object.defineProperty(format$1,"__esModule",{value:!0});const codegen_1$1=codegen,error$1={message:({schemaCode:e})=>codegen_1$1.str`must match format "${e}"`,params:({schemaCode:e})=>codegen_1$1._`{format: ${e}}`},def$1={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:error$1,code(e,t){const{gen:n,data:r,$data:o,schema:a,schemaCode:i,it:s}=e,{opts:l,errSchemaPath:u,schemaEnv:c,self:d}=s;l.validateFormats&&(o?function(){const o=n.scopeValue("formats",{ref:d.formats,code:l.code.formats}),a=n.const("fDef",codegen_1$1._`${o}[${i}]`),s=n.let("fType"),u=n.let("format");n.if(codegen_1$1._`typeof ${a} == "object" && !(${a} instanceof RegExp)`,()=>n.assign(s,codegen_1$1._`${a}.type || "string"`).assign(u,codegen_1$1._`${a}.validate`),()=>n.assign(s,codegen_1$1._`"string"`).assign(u,a)),e.fail$data((0,codegen_1$1.or)(!1===l.strictSchema?codegen_1$1.nil:codegen_1$1._`${i} && !${u}`,function(){const e=c.$async?codegen_1$1._`(${a}.async ? await ${u}(${r}) : ${u}(${r}))`:codegen_1$1._`${u}(${r})`,n=codegen_1$1._`(typeof ${u} == "function" ? ${e} : ${u}.test(${r}))`;return codegen_1$1._`${u} && ${u} !== true && ${s} === ${t} && !${n}`}()))}():function(){const o=d.formats[a];if(!o)return void function(){if(!1===l.strictSchema)return void d.logger.warn(e());throw new Error(e());function e(){return`unknown format "${a}" ignored in schema at path "${u}"`}}();if(!0===o)return;const[i,s,f]=function(e){const t=e instanceof RegExp?(0,codegen_1$1.regexpCode)(e):l.code.formats?codegen_1$1._`${l.code.formats}${(0,codegen_1$1.getProperty)(a)}`:void 0,r=n.scopeValue("formats",{key:a,ref:e,code:t});if("object"==typeof e&&!(e instanceof RegExp))return[e.type||"string",e.validate,codegen_1$1._`${r}.validate`];return["string",e,r]}(o);i===t&&e.pass(function(){if("object"==typeof o&&!(o instanceof RegExp)&&o.async){if(!c.$async)throw new Error("async format in sync schema");return codegen_1$1._`await ${f}(${r})`}return"function"==typeof s?codegen_1$1._`${f}(${r})`:codegen_1$1._`${f}.test(${r})`}())}())}};format$1.default=def$1,Object.defineProperty(format$2,"__esModule",{value:!0});const format_1$1=format$1,format=[format_1$1.default];format$2.default=format;var metadata={};Object.defineProperty(metadata,"__esModule",{value:!0}),metadata.contentVocabulary=metadata.metadataVocabulary=void 0,metadata.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],metadata.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"],Object.defineProperty(draft7,"__esModule",{value:!0});const core_1=core$1,validation_1=validation$1,applicator_1=applicator,format_1=format$2,metadata_1=metadata,draft7Vocabularies=[core_1.default,validation_1.default,(0,applicator_1.default)(),format_1.default,metadata_1.metadataVocabulary,metadata_1.contentVocabulary];draft7.default=draft7Vocabularies;var discriminator={},types={},DiscrError,DiscrError2;Object.defineProperty(types,"__esModule",{value:!0}),types.DiscrError=void 0,DiscrError2=DiscrError||(types.DiscrError=DiscrError={}),DiscrError2.Tag="tag",DiscrError2.Mapping="mapping",Object.defineProperty(discriminator,"__esModule",{value:!0});const codegen_1=codegen,types_1=types,compile_1=compile,ref_error_1=ref_error,util_1=util,error={message:({params:{discrError:e,tagName:t}})=>e===types_1.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>codegen_1._`{error: ${e}, tag: ${n}, tagValue: ${t}}`},def={keyword:"discriminator",type:"object",schemaType:"object",error:error,code(e){const{gen:t,data:n,schema:r,parentSchema:o,it:a}=e,{oneOf:i}=o;if(!a.opts.discriminator)throw new Error("discriminator: requires discriminator option");const s=r.propertyName;if("string"!=typeof s)throw new Error("discriminator: requires propertyName");if(r.mapping)throw new Error("discriminator: mapping is not supported");if(!i)throw new Error("discriminator: requires oneOf keyword");const l=t.let("valid",!1),u=t.const("tag",codegen_1._`${n}${(0,codegen_1.getProperty)(s)}`);function c(n){const r=t.name("valid"),o=e.subschema({keyword:"oneOf",schemaProp:n},r);return e.mergeEvaluated(o,codegen_1.Name),r}t.if(codegen_1._`typeof ${u} == "string"`,()=>function(){const n=function(){var e;const t={},n=l(o);let r=!0;for(let o=0;o<i.length;o++){let t=i[o];if((null==t?void 0:t.$ref)&&!(0,util_1.schemaHasRulesButRef)(t,a.self.RULES)){const e=t.$ref;if(t=compile_1.resolveRef.call(a.self,a.schemaEnv.root,a.baseId,e),t instanceof compile_1.SchemaEnv&&(t=t.schema),void 0===t)throw new ref_error_1.default(a.opts.uriResolver,a.baseId,e)}const c=null===(e=null==t?void 0:t.properties)||void 0===e?void 0:e[s];if("object"!=typeof c)throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${s}"`);r=r&&(n||l(t)),u(c,o)}if(!r)throw new Error(`discriminator: "${s}" must be required`);return t;function l({required:e}){return Array.isArray(e)&&e.includes(s)}function u(e,t){if(e.const)c(e.const,t);else{if(!e.enum)throw new Error(`discriminator: "properties/${s}" must have "const" or "enum"`);for(const n of e.enum)c(n,t)}}function c(e,n){if("string"!=typeof e||e in t)throw new Error(`discriminator: "${s}" values must be unique strings`);t[e]=n}}();t.if(!1);for(const e in n)t.elseIf(codegen_1._`${u} === ${e}`),t.assign(l,c(n[e]));t.else(),e.error(!1,{discrError:types_1.DiscrError.Mapping,tag:u,tagName:s}),t.endIf()}(),()=>e.error(!1,{discrError:types_1.DiscrError.Tag,tag:u,tagName:s})),e.ok(l)}};discriminator.default=def;const $schema$1="http://json-schema.org/draft-07/schema#",$id="http://json-schema.org/draft-07/schema#",title="Core schema meta-schema",definitions$1={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type=["object","boolean"],properties={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},require$$3={$schema:$schema$1,$id:$id,title:title,definitions:definitions$1,type:type,properties:properties,default:!0};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=core$2,r=draft7,o=discriminator,a=require$$3,i=["/properties"],s="http://json-schema.org/draft-07/schema";class l extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(a,i):a;this.addMetaSchema(e,s,!1),this.refs["http://json-schema.org/schema"]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}}t.Ajv=l,e.exports=t=l,e.exports.Ajv=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var u=requireValidate();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var c=codegen;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return c._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return c.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return c.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return c.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return c.CodeGen}});var d=validation_error;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var f=ref_error;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return f.default}})}(ajv,ajv.exports);var ajvExports=ajv.exports;const Ajv=getDefaultExportFromCjs(ajvExports);var dist$1={exports:{}},formats={};!function(e){function t(e,t){return{validate:e,compare:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0,e.fullFormats={date:t(o,a),time:t(s(!0),l),"date-time":t(d(!0),f),"iso-time":t(s(),u),"iso-date-time":t(d(),p),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(e){return h.test(e)&&m.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function(e){if(v.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function(e){return g.lastIndex=0,g.test(e)},int32:{type:"number",validate:function(e){return Number.isInteger(e)&&e<=y&&e>=b}},int64:{type:"number",validate:function(e){return Number.isInteger(e)}},float:{type:"number",validate:_},double:{type:"number",validate:_},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,a),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,f),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,p),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,r=[0,31,28,31,30,31,30,31,31,30,31,30,31];function o(e){const t=n.exec(e);if(!t)return!1;const o=+t[1],a=+t[2],i=+t[3];return a>=1&&a<=12&&i>=1&&i<=(2===a&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(o)?29:r[a])}function a(e,t){if(e&&t)return e>t?1:e<t?-1:0}const i=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function s(e){return function(t){const n=i.exec(t);if(!n)return!1;const r=+n[1],o=+n[2],a=+n[3],s=n[4],l="-"===n[5]?-1:1,u=+(n[6]||0),c=+(n[7]||0);if(u>23||c>59||e&&!s)return!1;if(r<=23&&o<=59&&a<60)return!0;const d=o-c*l,f=r-u*l-(d<0?1:0);return(23===f||-1===f)&&(59===d||-1===d)&&a<61}}function l(e,t){if(!e||!t)return;const n=new Date("2020-01-01T"+e).valueOf(),r=new Date("2020-01-01T"+t).valueOf();return n&&r?n-r:void 0}function u(e,t){if(!e||!t)return;const n=i.exec(e),r=i.exec(t);return n&&r?(e=n[1]+n[2]+n[3])>(t=r[1]+r[2]+r[3])?1:e<t?-1:0:void 0}const c=/t|\s/i;function d(e){const t=s(e);return function(e){const n=e.split(c);return 2===n.length&&o(n[0])&&t(n[1])}}function f(e,t){if(!e||!t)return;const n=new Date(e).valueOf(),r=new Date(t).valueOf();return n&&r?n-r:void 0}function p(e,t){if(!e||!t)return;const[n,r]=e.split(c),[o,i]=t.split(c),s=a(n,o);return void 0!==s?s||l(r,i):void 0}const h=/\/|:/,m=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;const g=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;const b=-2147483648,y=2**31-1;function _(){return!0}const v=/[^\\]\\Z/}(formats);var limit={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=ajvExports,n=codegen,r=n.operators,o={formatMaximum:{okStr:"<=",ok:r.LTE,fail:r.GT},formatMinimum:{okStr:">=",ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},a={message:({keyword:e,schemaCode:t})=>n.str`should be ${o[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>n._`{comparison: ${o[e].okStr}, limit: ${t}}`};e.formatLimitDefinition={keyword:Object.keys(o),type:"string",schemaType:"string",$data:!0,error:a,code(e){const{gen:r,data:a,schemaCode:i,keyword:s,it:l}=e,{opts:u,self:c}=l;if(!u.validateFormats)return;const d=new t.KeywordCxt(l,c.RULES.all.format.definition,"format");function f(e){return n._`${e}.compare(${a}, ${i}) ${o[s].fail} 0`}d.$data?function(){const t=r.scopeValue("formats",{ref:c.formats,code:u.code.formats}),o=r.const("fmt",n._`${t}[${d.schemaCode}]`);e.fail$data((0,n.or)(n._`typeof ${o} != "object"`,n._`${o} instanceof RegExp`,n._`typeof ${o}.compare != "function"`,f(o)))}():function(){const t=d.schema,o=c.formats[t];if(!o||!0===o)return;if("object"!=typeof o||o instanceof RegExp||"function"!=typeof o.compare)throw new Error(`"${s}": format "${t}" does not define "compare" function`);const a=r.scopeValue("formats",{key:t,ref:o,code:u.code.formats?n._`${u.code.formats}${(0,n.getProperty)(t)}`:void 0});e.fail$data(f(a))}()},dependencies:["format"]};e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)}(limit),function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n=formats,r=limit,o=codegen,a=new o.Name("fullFormats"),i=new o.Name("fastFormats"),s=(e,t={keywords:!0})=>{if(Array.isArray(t))return l(e,t,n.fullFormats,a),e;const[o,s]="fast"===t.mode?[n.fastFormats,i]:[n.fullFormats,a];return l(e,t.formats||n.formatNames,o,s),t.keywords&&(0,r.default)(e),e};function l(e,t,n,r){var a,i;null!==(a=(i=e.opts.code).formats)&&void 0!==a||(i.formats=o._`require("ajv-formats/dist/formats").${r}`);for(const o of t)e.addFormat(o,n[o])}s.get=(e,t="full")=>{const r=("fast"===t?n.fastFormats:n.fullFormats)[e];if(!r)throw new Error(`Unknown format "${e}"`);return r},e.exports=t=s,Object.defineProperty(t,"__esModule",{value:!0}),t.default=s}(dist$1,dist$1.exports);var distExports=dist$1.exports;const addFormats=getDefaultExportFromCjs(distExports);class ScribeError extends Error{constructor(e,t=ErrorCode.INTERNAL_ERROR,n,r){super(e),this.name="ScribeError",this.code=t,this.httpStatus=n,this.details=r,Error.captureStackTrace&&Error.captureStackTrace(this,ScribeError)}static fromApiError(e,t){return new ScribeError(e.message,e.code,t,e.details)}toJSON(){return{name:this.name,message:this.message,code:this.code,httpStatus:this.httpStatus,details:this.details}}}class ValidationError extends ScribeError{constructor(e,t){super(e,ErrorCode.INVALID_REQUEST,HttpStatus.BAD_REQUEST,t),this.name="ValidationError"}}const $schema="http://json-schema.org/draft-07/schema#",definitions={CreateSessionRequest:{type:"object",required:["templates","upload_type","communication_protocol"],properties:{templates:{type:"array",items:{type:"string"},maxItems:2,description:"Derived from /templates api response in /.well-known/discovery. See discovery document for validations."},model:{type:"string",enum:["pro","lite"],default:"lite"},language_hint:{type:"array",items:{type:"string",maxLength:2},description:"IRC language codes. See discovery document for supported languages."},transcript_language:{type:"array",items:{type:"string",maxLength:2},default:["en"],description:"IRC language codes. See discovery document for supported languages."},upload_type:{type:"string",enum:["chunked","single","stream"]},communication_protocol:{type:"string",enum:["websocket","http","rpc"]},additional_data:{type:"object",additionalProperties:!0}}},SessionIdParam:{type:"string",pattern:"^ses_[a-zA-Z0-9]+$",description:"Unique session identifier"},CreateSessionResponse:{type:"object",required:["session_id","status","created_at","expires_at","upload_url"],properties:{session_id:{type:"string",minLength:16,maxLength:32,pattern:"^ses_[a-zA-Z0-9]+$",description:"Unique identifier for the session (16 or 32 bytes string)",example:"ses_abc123def456"},status:{type:"string",enum:["created","initialized","processing","completed","failed"],description:"Current status of the session",example:"created"},created_at:{type:"string",format:"date-time",description:"ISO 8601 timestamp when the session was created",example:"2025-01-19T10:30:00Z"},expires_at:{type:"string",format:"date-time",description:"ISO 8601 timestamp when the session will expire",example:"2025-01-19T11:30:00Z"},upload_url:{type:"string",format:"uri",description:"URL endpoint for uploading audio files to this session",example:"https://api.scribe.example.com/v1/sessions/ses_abc123def456/audio"}}},SessionProcessingResponse:{type:"object",required:["session_id","status","created_at","expires_at","audio_files_received","audio_files","additional_data","transcript"],properties:{session_id:{type:"string",minLength:16,maxLength:32,pattern:"^ses_[a-zA-Z0-9]+$"},status:{type:"string",enum:["created","initialized","processing","completed","failed"]},created_at:{type:"string",format:"date-time"},expires_at:{type:"string",format:"date-time"},audio_files_received:{type:"integer"},audio_files:{type:"array",items:{type:"string"}},additional_data:{type:"object",additionalProperties:!0},transcript:{type:"string"}}},SessionCompletedResponse:{type:"object",required:["session_id","status","created_at","audio_files_received","audio_files"],properties:{session_id:{type:"string",minLength:16,maxLength:32,pattern:"^ses_[a-zA-Z0-9]+$"},status:{type:"string",enum:["created","initialized","processing","completed","failed"]},created_at:{type:"string",format:"date-time"},completed_at:{type:"string",format:"date-time"},model_used:{type:"string",enum:["pro","lite"]},language_detected:{type:"string",minLength:2,maxLength:2},audio_files_received:{type:"integer",minimum:0},audio_files:{type:"array",items:{type:"string"}},additional_data:{type:"object",additionalProperties:!0},templates:{type:"object",additionalProperties:{$ref:"#/definitions/TemplateResult"}},transcript:{type:"string"}}},SessionPartialResponse:{type:"object",required:["session_id","status","created_at","audio_files_received","audio_files","audio_files_processed","templates"],properties:{session_id:{type:"string",minLength:16,maxLength:32,pattern:"^ses_[a-zA-Z0-9]+$"},status:{type:"string",enum:["created","processing","partial","completed","failed"]},created_at:{type:"string",format:"date-time"},completed_at:{type:["string","null"],format:"date-time"},model_used:{type:"string",enum:["pro","lite"]},language_detected:{type:"string",minLength:2,maxLength:5},audio_files_received:{type:"integer",minimum:0},audio_files_processed:{type:"integer",minimum:0},audio_files:{type:"array",items:{type:"string"}},additional_data:{type:"object",additionalProperties:!0},templates:{type:"object",additionalProperties:{$ref:"#/definitions/TemplateResult"}},transcript:{type:"string"},processing_errors:{type:"array",items:{$ref:"#/definitions/ProcessingError"}}}},EndSessionResponse:{type:"object",required:["session_id","status","message","audio_files_received","audio_files"],properties:{session_id:{type:"string",minLength:16,maxLength:32,pattern:"^ses_[a-zA-Z0-9]+$"},status:{type:"string",enum:["processing"]},message:{type:"string"},audio_files_received:{type:"integer",minimum:0},audio_files:{type:"array",items:{type:"string"}}}},ExpiredSessionResponse:{type:"object",required:["session_id","status","created_at","expired_at","message","audio_files_received","audio_files"],properties:{session_id:{type:"string",minLength:16,maxLength:32,pattern:"^ses_[a-zA-Z0-9]+$"},status:{type:"string",enum:["expired"]},created_at:{type:"string",format:"date-time"},expired_at:{type:"string",format:"date-time"},message:{type:"string"},audio_files_received:{type:"integer",minimum:0},audio_files:{type:"array",items:{type:"string"}},additional_data:{type:"object",additionalProperties:!0},templates:{type:"object",additionalProperties:{$ref:"#/definitions/TemplateResult"}},transcript:{type:["string","null"]},model_used:{type:"string",enum:["pro","lite"]},language_detected:{type:"string",minLength:2,maxLength:2},audio_files_processed:{type:"integer",minimum:0}}},TemplateResult:{type:"object",required:["status"],properties:{status:{type:"string",enum:["success","failed","processing"]},data:{oneOf:[{type:"object",additionalProperties:!0},{type:"array",items:{type:"object",additionalProperties:!0}}]},error:{$ref:"#/definitions/TemplateError"}}},TemplateError:{type:"object",required:["code","message"],properties:{code:{type:"string"},message:{type:"string"}}},ProcessingError:{type:"object",required:["type","message"],properties:{type:{type:"string"},message:{type:"string"},file:{type:"string"}}}},schemas={$schema:$schema,definitions:definitions};class SchemaValidator{constructor(){this.validators=new Map,this.ajv=new Ajv({allErrors:!0,strict:!0,validateFormats:!0}),addFormats(this.ajv),this.compileSchemas()}compileSchemas(){schemas.definitions&&Object.entries(schemas.definitions).forEach(([e,t])=>{try{const n=this.ajv.compile({...t,$schema:schemas.$schema,definitions:schemas.definitions});this.validators.set(e,n)}catch(n){console.error(`Failed to compile schema for ${e}:`,n)}})}validate(e,t){const n=this.validators.get(e);if(!n)throw new ValidationError(`Schema '${e}' not found`);if(!n(t)&&n.errors){const t=this.formatErrors(n.errors);throw new ValidationError(`Validation failed for ${e}:\n${t}`)}}validateCreateSessionRequest(e){this.validate("CreateSessionRequest",e)}validateSessionId(e){this.validate("SessionIdParam",e)}formatErrors(e){return e.map(e=>{var t;let n=`${e.instancePath||"root"}: ${e.message}`;return"enum"===e.keyword?n+=` (allowed values: ${null==(t=e.params.allowedValues)?void 0:t.join(", ")})`:"pattern"===e.keyword?n+=` (pattern: ${e.params.pattern})`:"required"===e.keyword?n+=` (missing property: ${e.params.missingProperty})`:"type"===e.keyword&&(n+=` (expected type: ${e.params.type})`),` - ${n}`}).join("\n")}getValidator(e){return this.validators.get(e)}}const schemaValidator=new SchemaValidator;class SessionAPI{constructor(e,t){this.httpClient=e,this.baseUrl=t}setBaseUrl(e){this.baseUrl=e}async createSession(e){schemaValidator.validateCreateSessionRequest(e);const t=`${this.baseUrl}/sessions`;return this.httpClient.post(t,e)}async getSessionStatus(e){schemaValidator.validateSessionId(e);const t=`${this.baseUrl}/sessions/${e}`;return this.httpClient.get(t)}async endSession(e,t){const n=`${this.baseUrl}/sessions/${e}/end`,r=void 0!==t?{audio_files_sent:t}:void 0;return this.httpClient.post(n,r)}async pollSessionStatus(e,t={}){const{maxAttempts:n=60,intervalMs:r=2e3,onProgress:o}=t;for(let a=0;a<n;a++){const t=await this.getSessionStatus(e);if(o&&o(t),"completed"===t.status||"partial"===t.status||"failed"===t.status)return t;a<n-1&&await this.sleep(r)}throw new Error(`Polling timeout: session ${e} did not complete after ${n} attempts`)}sleep(e){return new Promise(t=>setTimeout(t,e))}}class HttpClient{constructor(e,t=!1){this.apiKey=e,this.debug=t}async request(e,t){const n={"Content-Type":"application/json",Accept:"application/json",...t.headers};this.apiKey&&(n["X-API-Key"]=this.apiKey);const r={method:t.method,headers:n,credentials:"include"};t.body&&(r.body=JSON.stringify(t.body)),this.debug&&console.log("[ScribeSDK] Request:",{url:e,method:t.method,headers:n,body:t.body});try{const t=await fetch(e,r);if(this.debug&&console.log("[ScribeSDK] Response:",{status:t.status,statusText:t.statusText}),t.ok){return await t.json()}throw await this.handleErrorResponse(t),new ScribeError("Unexpected error occurred")}catch(o){if(o instanceof ScribeError)throw o;throw new ScribeError(`Network error: ${o instanceof Error?o.message:"Unknown error"}`,"network_error")}}async handleErrorResponse(e){let t=null;try{t=await e.json()}catch{throw new ScribeError(`HTTP ${e.status}: ${e.statusText}`,"http_error",e.status)}if(null==t?void 0:t.error)throw ScribeError.fromApiError(t.error,e.status);throw new ScribeError(`HTTP ${e.status}: ${e.statusText}`,"http_error",e.status)}async get(e,t){return this.request(e,{method:"GET",headers:t})}async post(e,t,n){return this.request(e,{method:"POST",body:t,headers:n})}async put(e,t,n){return this.request(e,{method:"PUT",body:t,headers:n})}async patch(e,t,n){return this.request(e,{method:"PATCH",body:t,headers:n})}async delete(e,t){return this.request(e,{method:"DELETE",headers:t})}}const PREF_CHUNK_LENGTH=10,DESP_CHUNK_LENGTH=20,MAX_CHUNK_LENGTH=25,FRAME_SIZE=1024,SAMPLING_RATE=16e3,SHORT_SILENCE_THRESHOLD=.1,LONG_SILENCE_THRESHOLD=.5,PRE_SPEECH_PAD_FRAMES=20,BITRATE=128,AUDIO_BUFFER_SIZE_IN_S=DESP_CHUNK_LENGTH+5,OUTPUT_FORMAT="mp3",AUDIO_EXTENSION_TYPE_MAP={m4a:"audio/m4a",wav:"audio/wav",mp3:"audio/mpeg"};function Xa(e){return new Int8Array(e)}function ma(e){return new Int16Array(e)}function ba(e){return new Int32Array(e)}function ca(e){return new Float32Array(e)}function Ya(e){return new Float64Array(e)}function Sa(e){if(1==e.length)return ca(e[0]);var t=e[0];e=e.slice(1);for(var n=[],r=0;r<t;r++)n.push(Sa(e));return n}function da(e){if(1==e.length)return ba(e[0]);var t=e[0];e=e.slice(1);for(var n=[],r=0;r<t;r++)n.push(da(e));return n}function Aa(e){if(1==e.length)return ma(e[0]);var t=e[0];e=e.slice(1);for(var n=[],r=0;r<t;r++)n.push(Aa(e));return n}function Ra(e){if(1==e.length)return new Array(e[0]);var t=e[0];e=e.slice(1);for(var n=[],r=0;r<t;r++)n.push(Ra(e));return n}var xa={fill:function(e,t,n,r){if(2==arguments.length)for(var o=0;o<e.length;o++)e[o]=arguments[1];else for(o=t;o<n;o++)e[o]=r}},W1={arraycopy:function(e,t,n,r,o){for(var a=t+o;t<a;)n[r++]=e[t++]},out:{}};W1.out.println=function(e){console.log(e)},W1.out.printf=function(){console.log.apply(console,arguments)};var se={};function B1(e){this.ordinal=e}se.SQRT2=1.4142135623730951,se.FAST_LOG10=function(e){return Math.log10(e)},se.FAST_LOG10_X=function(e,t){return Math.log10(e)*t},B1.short_block_allowed=new B1(0),B1.short_block_coupled=new B1(1),B1.short_block_dispensed=new B1(2),B1.short_block_forced=new B1(3);var Ma={};function u1(e){this.ordinal=e}Ma.MAX_VALUE=34028235e31,u1.vbr_off=new u1(0),u1.vbr_mt=new u1(1),u1.vbr_rh=new u1(2),u1.vbr_abr=new u1(3),u1.vbr_mtrh=new u1(4),u1.vbr_default=u1.vbr_mtrh;var qa=function(e){},Q0={System:W1,VbrMode:u1,Float:Ma,ShortBlock:B1,Util:se,Arrays:xa,new_array_n:Ra,new_byte:Xa,new_double:Ya,new_float:ca,new_float_n:Sa,new_int:ba,new_int_n:da,new_short_n:Aa,assert:qa},ce,De,Se,Ge,de,$e;function Da(){if(De)return ce;De=1;var e=Q0,t=e.System,n=e.Util,r=e.Arrays,o=e.new_float,a=t1();return ce=function(){var e=[-.1482523854003001,32.308141959636465,296.40344946382766,883.1344870032432,11113.947376231741,1057.2713659324597,305.7402417275812,30.825928907280012,3.8533188138216365,59.42900443849514,709.5899960123345,5281.91112291017,-5829.66483675846,-817.6293103748613,-76.91656988279972,-4.594269939176596,.9063471690191471,.1960342806591213,-.15466694054279598,34.324387823855965,301.8067566458425,817.599602898885,11573.795901679885,1181.2520595540152,321.59731579894424,31.232021761053772,3.7107095756221318,53.650946155329365,684.167428119626,5224.56624370173,-6366.391851890084,-908.9766368219582,-89.83068876699639,-5.411397422890401,.8206787908286602,.3901806440322567,-.16070888947830023,36.147034243915876,304.11815768187864,732.7429163887613,11989.60988270091,1300.012278487897,335.28490093152146,31.48816102859945,3.373875931311736,47.232241542899175,652.7371796173471,5132.414255594984,-6909.087078780055,-1001.9990371107289,-103.62185754286375,-6.104916304710272,.7416505462720353,.5805693545089249,-.16636367662261495,37.751650073343995,303.01103387567713,627.9747488785183,12358.763425278165,1412.2779918482834,346.7496836825721,31.598286663170416,3.1598635433980946,40.57878626349686,616.1671130880391,5007.833007176154,-7454.040671756168,-1095.7960341867115,-118.24411666465777,-6.818469345853504,.6681786379192989,.7653668647301797,-.1716176790982088,39.11551877123304,298.3413246578966,503.5259106886539,12679.589408408976,1516.5821921214542,355.9850766329023,31.395241710249053,2.9164211881972335,33.79716964664243,574.8943997801362,4853.234992253242,-7997.57021486075,-1189.7624067269965,-133.6444792601766,-7.7202770609839915,.5993769336819237,.9427934736519954,-.17645823955292173,40.21879108166477,289.9982036694474,359.3226160751053,12950.259102786438,1612.1013903507662,362.85067106591504,31.045922092242872,2.822222032597987,26.988862316190684,529.8996541764288,4671.371946949588,-8535.899136645805,-1282.5898586244496,-149.58553632943463,-8.643494270763135,.5345111359507916,1.111140466039205,-.36174739330527045,41.04429910497807,277.5463268268618,195.6386023135583,13169.43812144731,1697.6433561479398,367.40983966190305,30.557037410382826,2.531473372857427,20.070154905927314,481.50208566532336,4464.970341588308,-9065.36882077239,-1373.62841526722,-166.1660487028118,-9.58289321133207,.4729647758913199,1.268786568327291,-.36970682634889585,41.393213350082036,261.2935935556502,12.935476055240873,13336.131683328815,1772.508612059496,369.76534388639965,29.751323653701338,2.4023193045459172,13.304795348228817,430.5615775526625,4237.0568611071185,-9581.931701634761,-1461.6913552409758,-183.12733958476446,-10.718010163869403,.41421356237309503,1.414213562373095,-.37677560326535325,41.619486213528496,241.05423794991074,-187.94665032361226,13450.063605744153,1836.153896465782,369.4908799925761,29.001847876923147,2.0714759319987186,6.779591200894186,377.7767837205709,3990.386575512536,-10081.709459700915,-1545.947424837898,-200.3762958015653,-11.864482073055006,.3578057213145241,1.546020906725474,-.3829366947518991,41.1516456456653,216.47684307105183,-406.1569483347166,13511.136535077321,1887.8076599260432,367.3025214564151,28.136213436723654,1.913880671464418,.3829366947518991,323.85365704338597,3728.1472257487526,-10561.233882199509,-1625.2025997821418,-217.62525175416,-13.015432208941645,.3033466836073424,1.66293922460509,-.5822628872992417,40.35639251440489,188.20071124269245,-640.2706748618148,13519.21490106562,1927.6022433578062,362.8197642637487,26.968821921868447,1.7463817695935329,-5.62650678237171,269.3016715297017,3453.386536448852,-11016.145278780888,-1698.6569643425091,-234.7658734267683,-14.16351421663124,.2504869601913055,1.76384252869671,-.5887180101749253,39.23429103868072,155.76096234403798,-889.2492977967378,13475.470561874661,1955.0535223723712,356.4450994756727,25.894952980042156,1.5695032905781554,-11.181939564328772,214.80884394039484,3169.1640829158237,-11443.321309975563,-1765.1588461316153,-251.68908574481912,-15.49755935939164,.198912367379658,1.847759065022573,-.7912582233652842,37.39369355329111,119.699486012458,-1151.0956593239027,13380.446257078214,1970.3952110853447,348.01959814116185,24.731487364283044,1.3850130831637748,-16.421408865300393,161.05030052864092,2878.3322807850063,-11838.991423510031,-1823.985884688674,-268.2854986386903,-16.81724543849939,.1483359875383474,1.913880671464418,-.7960642926861912,35.2322109610459,80.01928065061526,-1424.0212633405113,13235.794061869668,1973.804052543835,337.9908651258184,23.289159354463873,1.3934255946442087,-21.099669467133474,108.48348407242611,2583.700758091299,-12199.726194855148,-1874.2780658979746,-284.2467154529415,-18.11369784385905,.09849140335716425,1.961570560806461,-.998795456205172,32.56307803611191,36.958364584370486,-1706.075448829146,13043.287458812016,1965.3831106103316,326.43182772364605,22.175018750622293,1.198638339011324,-25.371248002043963,57.53505923036915,2288.41886619975,-12522.674544337233,-1914.8400385312243,-299.26241273417224,-19.37805630698734,.04912684976946725,1.990369453344394,.035780907*n.SQRT2*.5/2384e-9,.017876148*n.SQRT2*.5/2384e-9,.003134727*n.SQRT2*.5/2384e-9,.002457142*n.SQRT2*.5/2384e-9,971317e-9*n.SQRT2*.5/2384e-9,218868e-9*n.SQRT2*.5/2384e-9,101566e-9*n.SQRT2*.5/2384e-9,13828e-9*n.SQRT2*.5/2384e-9,12804.797818791945,1945.5515939597317,313.4244966442953,20.801593959731544,1995.1556208053692,9.000838926174497,-29.20218120805369],i=[[2382191739347913e-28,6423305872147834e-28,9400849094049688e-28,1122435026096556e-27,1183840321267481e-27,1122435026096556e-27,940084909404969e-27,6423305872147839e-28,2382191739347918e-28,5456116108943412e-27,4878985199565852e-27,4240448995017367e-27,3559909094758252e-27,2858043359288075e-27,2156177623817898e-27,1475637723558783e-27,8371015190102974e-28,2599706096327376e-28,-5456116108943412e-27,-4878985199565852e-27,-4240448995017367e-27,-3559909094758252e-27,-2858043359288076e-27,-2156177623817898e-27,-1475637723558783e-27,-8371015190102975e-28,-2599706096327376e-28,-2382191739347923e-28,-6423305872147843e-28,-9400849094049696e-28,-1122435026096556e-27,-1183840321267481e-27,-1122435026096556e-27,-9400849094049694e-28,-642330587214784e-27,-2382191739347918e-28],[2382191739347913e-28,6423305872147834e-28,9400849094049688e-28,1122435026096556e-27,1183840321267481e-27,1122435026096556e-27,9400849094049688e-28,6423305872147841e-28,2382191739347918e-28,5456116108943413e-27,4878985199565852e-27,4240448995017367e-27,3559909094758253e-27,2858043359288075e-27,2156177623817898e-27,1475637723558782e-27,8371015190102975e-28,2599706096327376e-28,-5461314069809755e-27,-4921085770524055e-27,-4343405037091838e-27,-3732668368707687e-27,-3093523840190885e-27,-2430835727329465e-27,-1734679010007751e-27,-974825365660928e-27,-2797435120168326e-28,0,0,0,0,0,0,-2283748241799531e-28,-4037858874020686e-28,-2146547464825323e-28],[.1316524975873958,.414213562373095,.7673269879789602,1.091308501069271,1.303225372841206,1.56968557711749,1.920982126971166,2.414213562373094,3.171594802363212,4.510708503662055,7.595754112725146,22.90376554843115,.984807753012208,.6427876096865394,.3420201433256688,.9396926207859084,-.1736481776669303,-.7660444431189779,.8660254037844387,.5,-.5144957554275265,-.4717319685649723,-.3133774542039019,-.1819131996109812,-.09457419252642064,-.04096558288530405,-.01419856857247115,-.003699974673760037,.8574929257125442,.8817419973177052,.9496286491027329,.9833145924917901,.9955178160675857,.9991605581781475,.999899195244447,.9999931550702802],[0,0,0,0,0,0,2283748241799531e-28,4037858874020686e-28,2146547464825323e-28,5461314069809755e-27,4921085770524055e-27,4343405037091838e-27,3732668368707687e-27,3093523840190885e-27,2430835727329466e-27,1734679010007751e-27,974825365660928e-27,2797435120168326e-28,-5456116108943413e-27,-4878985199565852e-27,-4240448995017367e-27,-3559909094758253e-27,-2858043359288075e-27,-2156177623817898e-27,-1475637723558782e-27,-8371015190102975e-28,-2599706096327376e-28,-2382191739347913e-28,-6423305872147834e-28,-9400849094049688e-28,-1122435026096556e-27,-1183840321267481e-27,-1122435026096556e-27,-9400849094049688e-28,-6423305872147841e-28,-2382191739347918e-28]],s=i[a.SHORT_TYPE],l=i[a.SHORT_TYPE],u=i[a.SHORT_TYPE],c=i[a.SHORT_TYPE],d=[0,1,16,17,8,9,24,25,4,5,20,21,12,13,28,29,2,3,18,19,10,11,26,27,6,7,22,23,14,15,30,31];function f(t,r,o){for(var a=10,i=r+238-14-286,s=-15;s<0;s++){var l;l=e[a+-10],u=t[i+-224]*l,c=t[r+224]*l,l=e[a+-9],u+=t[i+-160]*l,c+=t[r+160]*l,l=e[a+-8],u+=t[i+-96]*l,c+=t[r+96]*l,l=e[a+-7],u+=t[i+-32]*l,c+=t[r+32]*l,l=e[a+-6],u+=t[i+32]*l,c+=t[r+-32]*l,l=e[a+-5],u+=t[i+96]*l,c+=t[r+-96]*l,l=e[a+-4],u+=t[i+160]*l,c+=t[r+-160]*l,l=e[a+-3],u+=t[i+224]*l,c+=t[r+-224]*l,l=e[a+-2],u+=t[r+-256]*l,c-=t[i+256]*l,l=e[a+-1],u+=t[r+-192]*l,c-=t[i+192]*l,l=e[a+0],u+=t[r+-128]*l,c-=t[i+128]*l,l=e[a+1],u+=t[r+-64]*l,c-=t[i+64]*l,l=e[a+2],u+=t[r+0]*l,c-=t[i+0]*l,l=e[a+3],u+=t[r+64]*l,c-=t[i+-64]*l,l=e[a+4],u+=t[r+128]*l,c-=t[i+-128]*l,l=e[a+5],u+=t[r+192]*l,l=(c-=t[i+-192]*l)-(u*=e[a+6]),o[30+2*s]=c+u,o[31+2*s]=e[a+7]*l,a+=18,r--,i++}var u,c,d,f,p;c=t[r+-16]*e[a+-10],u=t[r+-32]*e[a+-2],c+=(t[r+-48]-t[r+16])*e[a+-9],u+=t[r+-96]*e[a+-1],c+=(t[r+-80]+t[r+48])*e[a+-8],u+=t[r+-160]*e[a+0],c+=(t[r+-112]-t[r+80])*e[a+-7],u+=t[r+-224]*e[a+1],c+=(t[r+-144]+t[r+112])*e[a+-6],u-=t[r+32]*e[a+2],c+=(t[r+-176]-t[r+144])*e[a+-5],u-=t[r+96]*e[a+3],c+=(t[r+-208]+t[r+176])*e[a+-4],u-=t[r+160]*e[a+4],c+=(t[r+-240]-t[r+208])*e[a+-3],d=(u-=t[r+224])-c,f=u+c,c=o[14],u=o[15]-c,o[31]=f+c,o[30]=d+u,o[15]=d-u,o[14]=f-c,p=o[28]-o[0],o[0]+=o[28],o[28]=p*e[a+-36+7],p=o[29]-o[1],o[1]+=o[29],o[29]=p*e[a+-36+7],p=o[26]-o[2],o[2]+=o[26],o[26]=p*e[a+-72+7],p=o[27]-o[3],o[3]+=o[27],o[27]=p*e[a+-72+7],p=o[24]-o[4],o[4]+=o[24],o[24]=p*e[a+-108+7],p=o[25]-o[5],o[5]+=o[25],o[25]=p*e[a+-108+7],p=o[22]-o[6],o[6]+=o[22],o[22]=p*n.SQRT2,p=o[23]-o[7],o[7]+=o[23],o[23]=p*n.SQRT2-o[7],o[7]-=o[6],o[22]-=o[7],o[23]-=o[22],p=o[6],o[6]=o[31]-p,o[31]=o[31]+p,p=o[7],o[7]=o[30]-p,o[30]=o[30]+p,p=o[22],o[22]=o[15]-p,o[15]=o[15]+p,p=o[23],o[23]=o[14]-p,o[14]=o[14]+p,p=o[20]-o[8],o[8]+=o[20],o[20]=p*e[a+-180+7],p=o[21]-o[9],o[9]+=o[21],o[21]=p*e[a+-180+7],p=o[18]-o[10],o[10]+=o[18],o[18]=p*e[a+-216+7],p=o[19]-o[11],o[11]+=o[19],o[19]=p*e[a+-216+7],p=o[16]-o[12],o[12]+=o[16],o[16]=p*e[a+-252+7],p=o[17]-o[13],o[13]+=o[17],o[17]=p*e[a+-252+7],p=-o[20]+o[24],o[20]+=o[24],o[24]=p*e[a+-216+7],p=-o[21]+o[25],o[21]+=o[25],o[25]=p*e[a+-216+7],p=o[4]-o[8],o[4]+=o[8],o[8]=p*e[a+-216+7],p=o[5]-o[9],o[5]+=o[9],o[9]=p*e[a+-216+7],p=o[0]-o[12],o[0]+=o[12],o[12]=p*e[a+-72+7],p=o[1]-o[13],o[1]+=o[13],o[13]=p*e[a+-72+7],p=o[16]-o[28],o[16]+=o[28],o[28]=p*e[a+-72+7],p=-o[17]+o[29],o[17]+=o[29],o[29]=p*e[a+-72+7],p=n.SQRT2*(o[2]-o[10]),o[2]+=o[10],o[10]=p,p=n.SQRT2*(o[3]-o[11]),o[3]+=o[11],o[11]=p,p=n.SQRT2*(-o[18]+o[26]),o[18]+=o[26],o[26]=p-o[18],p=n.SQRT2*(-o[19]+o[27]),o[19]+=o[27],o[27]=p-o[19],p=o[2],o[19]-=o[3],o[3]-=p,o[2]=o[31]-p,o[31]+=p,p=o[3],o[11]-=o[19],o[18]-=p,o[3]=o[30]-p,o[30]+=p,p=o[18],o[27]-=o[11],o[19]-=p,o[18]=o[15]-p,o[15]+=p,p=o[19],o[10]-=p,o[19]=o[14]-p,o[14]+=p,p=o[10],o[11]-=p,o[10]=o[23]-p,o[23]+=p,p=o[11],o[26]-=p,o[11]=o[22]-p,o[22]+=p,p=o[26],o[27]-=p,o[26]=o[7]-p,o[7]+=p,p=o[27],o[27]=o[6]-p,o[6]+=p,p=n.SQRT2*(o[0]-o[4]),o[0]+=o[4],o[4]=p,p=n.SQRT2*(o[1]-o[5]),o[1]+=o[5],o[5]=p,p=n.SQRT2*(o[16]-o[20]),o[16]+=o[20],o[20]=p,p=n.SQRT2*(o[17]-o[21]),o[17]+=o[21],o[21]=p,p=-n.SQRT2*(o[8]-o[12]),o[8]+=o[12],o[12]=p-o[8],p=-n.SQRT2*(o[9]-o[13]),o[9]+=o[13],o[13]=p-o[9],p=-n.SQRT2*(o[25]-o[29]),o[25]+=o[29],o[29]=p-o[25],p=-n.SQRT2*(o[24]+o[28]),o[24]-=o[28],o[28]=p-o[24],p=o[24]-o[16],o[24]=p,p=o[20]-p,o[20]=p,p=o[28]-p,o[28]=p,p=o[25]-o[17],o[25]=p,p=o[21]-p,o[21]=p,p=o[29]-p,o[29]=p,p=o[17]-o[1],o[17]=p,p=o[9]-p,o[9]=p,p=o[25]-p,o[25]=p,p=o[5]-p,o[5]=p,p=o[21]-p,o[21]=p,p=o[13]-p,o[13]=p,p=o[29]-p,o[29]=p,p=o[1]-o[0],o[1]=p,p=o[16]-p,o[16]=p,p=o[17]-p,o[17]=p,p=o[8]-p,o[8]=p,p=o[9]-p,o[9]=p,p=o[24]-p,o[24]=p,p=o[25]-p,o[25]=p,p=o[4]-p,o[4]=p,p=o[5]-p,o[5]=p,p=o[20]-p,o[20]=p,p=o[21]-p,o[21]=p,p=o[12]-p,o[12]=p,p=o[13]-p,o[13]=p,p=o[28]-p,o[28]=p,p=o[29]-p,o[29]=p,p=o[0],o[0]+=o[31],o[31]-=p,p=o[1],o[1]+=o[30],o[30]-=p,p=o[16],o[16]+=o[15],o[15]-=p,p=o[17],o[17]+=o[14],o[14]-=p,p=o[8],o[8]+=o[23],o[23]-=p,p=o[9],o[9]+=o[22],o[22]-=p,p=o[24],o[24]+=o[7],o[7]-=p,p=o[25],o[25]+=o[6],o[6]-=p,p=o[4],o[4]+=o[27],o[27]-=p,p=o[5],o[5]+=o[26],o[26]-=p,p=o[20],o[20]+=o[11],o[11]-=p,p=o[21],o[21]+=o[10],o[10]-=p,p=o[12],o[12]+=o[19],o[19]-=p,p=o[13],o[13]+=o[18],o[18]-=p,p=o[28],o[28]+=o[3],o[3]-=p,p=o[29],o[29]+=o[2],o[2]-=p}function p(e,t){for(var n=0;n<3;n++){var r,o,s,l,u,c;o=(l=e[t+6]*i[a.SHORT_TYPE][0]-e[t+15])+(r=e[t+0]*i[a.SHORT_TYPE][2]-e[t+9]),s=l-r,u=(l=e[t+15]*i[a.SHORT_TYPE][0]+e[t+6])+(r=e[t+9]*i[a.SHORT_TYPE][2]+e[t+0]),c=-l+r,r=2069978111953089e-26*(e[t+3]*i[a.SHORT_TYPE][1]-e[t+12]),l=2069978111953089e-26*(e[t+12]*i[a.SHORT_TYPE][1]+e[t+3]),e[t+0]=190752519173728e-25*o+r,e[t+15]=190752519173728e-25*-u+l,s=.8660254037844387*s*1907525191737281e-26,u=.5*u*1907525191737281e-26+l,e[t+3]=s-u,e[t+6]=s+u,o=.5*o*1907525191737281e-26-r,c=.8660254037844387*c*1907525191737281e-26,e[t+9]=o+c,e[t+12]=o-c,t++}}function h(e,t,n){var r,o,a,i,s,u,c,d,f,p,h,m,g,b,y,_,v,w;a=n[17]-n[9],s=n[15]-n[11],u=n[14]-n[12],c=n[0]+n[8],d=n[1]+n[7],f=n[2]+n[6],p=n[3]+n[5],e[t+17]=c+f-p-(d-n[4]),o=(c+f-p)*l[19]+(d-n[4]),r=(a-s-u)*l[18],e[t+5]=r+o,e[t+6]=r-o,i=(n[16]-n[10])*l[18],d=d*l[19]+n[4],r=a*l[12]+i+s*l[13]+u*l[14],o=-c*l[16]+d-f*l[17]+p*l[15],e[t+1]=r+o,e[t+2]=r-o,r=a*l[13]-i-s*l[14]+u*l[12],o=-c*l[17]+d-f*l[15]+p*l[16],e[t+9]=r+o,e[t+10]=r-o,r=a*l[14]-i+s*l[12]-u*l[13],o=c*l[15]-d+f*l[16]-p*l[17],e[t+13]=r+o,e[t+14]=r-o,h=n[8]-n[0],g=n[6]-n[2],b=n[5]-n[3],y=n[17]+n[9],_=n[16]+n[10],v=n[15]+n[11],w=n[14]+n[12],e[t+0]=y+v+w+(_+n[13]),r=(y+v+w)*l[19]-(_+n[13]),o=(h-g+b)*l[18],e[t+11]=r+o,e[t+12]=r-o,m=(n[7]-n[1])*l[18],_=n[13]-_*l[19],r=y*l[15]-_+v*l[16]+w*l[17],o=h*l[14]+m+g*l[12]+b*l[13],e[t+3]=r+o,e[t+4]=r-o,r=-y*l[17]+_-v*l[15]-w*l[16],o=h*l[13]+m-g*l[14]-b*l[12],e[t+7]=r+o,e[t+8]=r-o,r=-y*l[16]+_-v*l[17]-w*l[15],o=h*l[12]-m+g*l[13]-b*l[14],e[t+15]=r+o,e[t+16]=r-o}this.mdct_sub48=function(e,n,l){for(var m=n,g=286,b=0;b<e.channels_out;b++){for(var y=0;y<e.mode_gr;y++){for(var _,v=e.l3_side.tt[y][b],w=v.xr,S=0,x=e.sb_sample[b][1-y],T=0,E=0;E<9;E++)for(f(m,g,x[T]),f(m,g+32,x[T+1]),T+=2,g+=64,_=1;_<32;_+=2)x[T-1][_]*=-1;for(_=0;_<32;_++,S+=18){var k=v.block_type,P=e.sb_sample[b][y],O=e.sb_sample[b][1-y];if(0!=v.mixed_block_flag&&_<2&&(k=0),e.amp_filter[_]<1e-12)r.fill(w,S+0,S+18,0);else{if(e.amp_filter[_]<1)for(E=0;E<18;E++)O[E][d[_]]*=e.amp_filter[_];if(k==a.SHORT_TYPE){for(E=-3;E<0;E++){var A=i[a.SHORT_TYPE][E+3];w[S+3*E+9]=P[9+E][d[_]]*A-P[8-E][d[_]],w[S+3*E+18]=P[14-E][d[_]]*A+P[15+E][d[_]],w[S+3*E+10]=P[15+E][d[_]]*A-P[14-E][d[_]],w[S+3*E+19]=O[2-E][d[_]]*A+O[3+E][d[_]],w[S+3*E+11]=O[3+E][d[_]]*A-O[2-E][d[_]],w[S+3*E+20]=O[8-E][d[_]]*A+O[9+E][d[_]]}p(w,S)}else{var R=o(18);for(E=-9;E<0;E++){var $,I;$=i[k][E+27]*O[E+9][d[_]]+i[k][E+36]*O[8-E][d[_]],I=i[k][E+9]*P[E+9][d[_]]-i[k][E+18]*P[8-E][d[_]],R[E+9]=$-I*s[3+E+9],R[E+18]=$*s[3+E+9]+I}h(w,S,R)}}if(k!=a.SHORT_TYPE&&0!=_)for(E=7;E>=0;--E){var C,D;C=w[S+E]*u[20+E]+w[S+-1-E]*c[28+E],D=w[S+E]*c[28+E]-w[S+-1-E]*u[20+E],w[S+-1-E]=C,w[S+E]=D}}}if(m=l,g=286,1==e.mode_gr)for(var N=0;N<18;N++)t.arraycopy(e.sb_sample[b][1][N],0,e.sb_sample[b][0][N],0,32)}}}}function Ea(){if(Ge)return Se;Ge=1;var e=t1(),t=Q0,n=t.System,r=t.new_float,o=t.new_float_n;return Se=function(){this.l=r(e.SBMAX_l),this.s=o([e.SBMAX_s,3]);var t=this;this.assign=function(r){n.arraycopy(r.l,0,t.l,0,e.SBMAX_l);for(var o=0;o<e.SBMAX_s;o++)for(var a=0;a<3;a++)t.s[o][a]=r.s[o][a]}}}function Ga(){if($e)return de;$e=1;var e=Ea();return de=function(){this.thm=new e,this.en=new e}}function R1(e){var t=e;this.ordinal=function(){return t}}R1.STEREO=new R1(0),R1.JOINT_STEREO=new R1(1),R1.DUAL_CHANNEL=new R1(2),R1.MONO=new R1(3),R1.NOT_SET=new R1(4);var j1=R1,Ae,Pe;function t1(){if(Pe)return Ae;Pe=1;var e=Q0,t=e.System,n=e.VbrMode,r=e.new_array_n,o=e.new_float,a=e.new_float_n,i=e.new_int,s=e.assert;function l(){var e=Da(),u=Ga(),c=j1,d=l.FFTOFFSET,f=l.MPG_MD_MS_LR,p=null;this.psy=null;var h=null,m=null,g=null;this.setModules=function(e,t,n,r){p=e,this.psy=t,h=t,m=r,g=n};var b=new e;this.lame_encode_mp3_frame=function(e,y,_,v,w,S){var x,T=r([2,2]);T[0][0]=new u,T[0][1]=new u,T[1][0]=new u,T[1][1]=new u;var E=r([2,2]);E[0][0]=new u,E[0][1]=new u,E[1][0]=new u,E[1][1]=new u;var k,P,O,A,R=[null,null],$=e.internal_flags,I=a([2,4]),C=[.5,.5],D=[[0,0],[0,0]],N=[[0,0],[0,0]];if(R[0]=y,R[1]=_,0==$.lame_encode_frame_init&&function(e,t){var n,r,a=e.internal_flags;if(0==a.lame_encode_frame_init){var i,u,c=o(2014),d=o(2014);for(a.lame_encode_frame_init=1,i=0,u=0;i<286+576*(1+a.mode_gr);++i)i<576*a.mode_gr?(c[i]=0,2==a.channels_out&&(d[i]=0)):(c[i]=t[0][u],2==a.channels_out&&(d[i]=t[1][u]),++u);for(r=0;r<a.mode_gr;r++)for(n=0;n<a.channels_out;n++)a.l3_side.tt[r][n].block_type=l.SHORT_TYPE;b.mdct_sub48(a,c,d),s(576>=l.FFTOFFSET),s(a.mf_size>=l.BLKSIZE+e.framesize-l.FFTOFFSET),s(a.mf_size>=512+e.framesize-32)}}(e,R),$.padding=0,($.slot_lag-=$.frac_SpF)<0&&($.slot_lag+=e.out_samplerate,$.padding=1),0!=$.psymodel){var M=[null,null],L=0,j=i(2);for(A=0;A<$.mode_gr;A++){for(O=0;O<$.channels_out;O++)M[O]=R[O],L=576+576*A-l.FFTOFFSET;if(0!=(e.VBR==n.vbr_mtrh||e.VBR==n.vbr_mt?h.L3psycho_anal_vbr(e,M,L,A,T,E,D[A],N[A],I[A],j):h.L3psycho_anal_ns(e,M,L,A,T,E,D[A],N[A],I[A],j)))return-4;for(e.mode==c.JOINT_STEREO&&(C[A]=I[A][2]+I[A][3],C[A]>0&&(C[A]=I[A][3]/C[A])),O=0;O<$.channels_out;O++){var F=$.l3_side.tt[A][O];F.block_type=j[O],F.mixed_block_flag=0}}}else for(A=0;A<$.mode_gr;A++)for(O=0;O<$.channels_out;O++)$.l3_side.tt[A][O].block_type=l.NORM_TYPE,$.l3_side.tt[A][O].mixed_block_flag=0,N[A][O]=D[A][O]=700;if(function(e){var t,n;if(0!=e.ATH.useAdjust)if(n=e.loudness_sq[0][0],t=e.loudness_sq[1][0],2==e.channels_out?(n+=e.loudness_sq[0][1],t+=e.loudness_sq[1][1]):(n+=n,t+=t),2==e.mode_gr&&(n=Math.max(n,t)),n*=.5,(n*=e.ATH.aaSensitivityP)>.03125)e.ATH.adjust>=1?e.ATH.adjust=1:e.ATH.adjust<e.ATH.adjustLimit&&(e.ATH.adjust=e.ATH.adjustLimit),e.ATH.adjustLimit=1;else{var r=31.98*n+625e-6;e.ATH.adjust>=r?(e.ATH.adjust*=.075*r+.925,e.ATH.adjust<r&&(e.ATH.adjust=r)):e.ATH.adjustLimit>=r?e.ATH.adjust=r:e.ATH.adjust<e.ATH.adjustLimit&&(e.ATH.adjust=e.ATH.adjustLimit),e.ATH.adjustLimit=r}else e.ATH.adjust=1}($),b.mdct_sub48($,R[0],R[1]),$.mode_ext=l.MPG_MD_LR_LR,e.force_ms)$.mode_ext=l.MPG_MD_MS_LR;else if(e.mode==c.JOINT_STEREO){var B=0,U=0;for(A=0;A<$.mode_gr;A++)for(O=0;O<$.channels_out;O++)B+=N[A][O],U+=D[A][O];if(B<=1*U){var z=$.l3_side.tt[0],V=$.l3_side.tt[$.mode_gr-1];z[0].block_type==z[1].block_type&&V[0].block_type==V[1].block_type&&($.mode_ext=l.MPG_MD_MS_LR)}}if($.mode_ext==f?(k=E,P=N):(k=T,P=D),e.analysis&&null!=$.pinfo)for(A=0;A<$.mode_gr;A++)for(O=0;O<$.channels_out;O++)$.pinfo.ms_ratio[A]=$.ms_ratio[A],$.pinfo.ms_ener_ratio[A]=C[A],$.pinfo.blocktype[A][O]=$.l3_side.tt[A][O].block_type,$.pinfo.pe[A][O]=P[A][O],t.arraycopy($.l3_side.tt[A][O].xr,0,$.pinfo.xr[A][O],0,576),$.mode_ext==f&&($.pinfo.ers[A][O]=$.pinfo.ers[A][O+2],t.arraycopy($.pinfo.energy[A][O+2],0,$.pinfo.energy[A][O],0,$.pinfo.energy[A][O].length));if(e.VBR==n.vbr_off||e.VBR==n.vbr_abr){var H,q;for(H=0;H<18;H++)$.nsPsy.pefirbuf[H]=$.nsPsy.pefirbuf[H+1];for(q=0,A=0;A<$.mode_gr;A++)for(O=0;O<$.channels_out;O++)q+=P[A][O];for($.nsPsy.pefirbuf[18]=q,q=$.nsPsy.pefirbuf[9],H=0;H<9;H++)q+=($.nsPsy.pefirbuf[H]+$.nsPsy.pefirbuf[18-H])*l.fircoef[H];for(q=3350*$.mode_gr*$.channels_out/q,A=0;A<$.mode_gr;A++)for(O=0;O<$.channels_out;O++)P[A][O]*=q}if($.iteration_loop.iteration_loop(e,P,C,k),p.format_bitstream(e),x=p.copy_buffer($,v,w,S,1),e.bWriteVbrTag&&m.addVbrFrame(e),e.analysis&&null!=$.pinfo){for(O=0;O<$.channels_out;O++){var G;for(G=0;G<d;G++)$.pinfo.pcmdata[O][G]=$.pinfo.pcmdata[O][G+e.framesize];for(G=d;G<1600;G++)$.pinfo.pcmdata[O][G]=R[O][G-d]}g.set_frame_pinfo(e,k)}return function(e){var t,n;for(s(0<=e.bitrate_index&&e.bitrate_index<16),s(0<=e.mode_ext&&e.mode_ext<4),e.bitrate_stereoMode_Hist[e.bitrate_index][4]++,e.bitrate_stereoMode_Hist[15][4]++,2==e.channels_out&&(e.bitrate_stereoMode_Hist[e.bitrate_index][e.mode_ext]++,e.bitrate_stereoMode_Hist[15][e.mode_ext]++),t=0;t<e.mode_gr;++t)for(n=0;n<e.channels_out;++n){var r=0|e.l3_side.tt[t][n].block_type;0!=e.l3_side.tt[t][n].mixed_block_flag&&(r=4),e.bitrate_blockType_Hist[e.bitrate_index][r]++,e.bitrate_blockType_Hist[e.bitrate_index][5]++,e.bitrate_blockType_Hist[15][r]++,e.bitrate_blockType_Hist[15][5]++}}($),x}}return l.ENCDELAY=576,l.POSTDELAY=1152,l.MDCTDELAY=48,l.FFTOFFSET=224+l.MDCTDELAY,l.DECDELAY=528,l.SBLIMIT=32,l.CBANDS=64,l.SBPSY_l=21,l.SBPSY_s=12,l.SBMAX_l=22,l.SBMAX_s=13,l.PSFB21=6,l.PSFB12=6,l.BLKSIZE=1024,l.HBLKSIZE=l.BLKSIZE/2+1,l.BLKSIZE_s=256,l.HBLKSIZE_s=l.BLKSIZE_s/2+1,l.NORM_TYPE=0,l.START_TYPE=1,l.SHORT_TYPE=2,l.STOP_TYPE=3,l.MPG_MD_LR_LR=0,l.MPG_MD_LR_I=1,l.MPG_MD_MS_LR=2,l.MPG_MD_MS_I=3,l.fircoef=[-.1039435,-.1892065,5*-.0432472,-.155915,3898045e-23,.0467745*5,.50455,.756825,.187098*5],Ae=l}var Ba=Q0,Ze=Ba.Util,Ke=Ba.new_float,J0=t1();function $a(){var e=Ke(J0.BLKSIZE),t=Ke(J0.BLKSIZE_s/2),n=[.9238795325112867,.3826834323650898,.9951847266721969,.0980171403295606,.9996988186962042,.02454122852291229,.9999811752826011,.006135884649154475];function r(e,t,r){var o,a,i,s=0,l=t+(r<<=1);o=4;do{var u,c,d,f,p,h,m;m=o>>1,h=(p=o<<1)+(f=o),o=p<<1,i=(a=t)+m;do{S=e[a+0]-e[a+f],w=e[a+0]+e[a+f],k=e[a+p]-e[a+h],T=e[a+p]+e[a+h],e[a+p]=w-T,e[a+0]=w+T,e[a+h]=S-k,e[a+f]=S+k,S=e[i+0]-e[i+f],w=e[i+0]+e[i+f],k=Ze.SQRT2*e[i+h],T=Ze.SQRT2*e[i+p],e[i+p]=w-T,e[i+0]=w+T,e[i+h]=S-k,e[i+f]=S+k,i+=o,a+=o}while(a<l);for(c=n[s+0],u=n[s+1],d=1;d<m;d++){var g,b;g=1-2*u*u,b=2*u*c,a=t+d,i=t+f-d;do{var y,_,v,w,S,x,T,E,k,P;_=b*e[a+f]-g*e[i+f],y=g*e[a+f]+b*e[i+f],S=e[a+0]-y,w=e[a+0]+y,x=e[i+0]-_,v=e[i+0]+_,_=b*e[a+h]-g*e[i+h],y=g*e[a+h]+b*e[i+h],k=e[a+p]-y,T=e[a+p]+y,P=e[i+p]-_,E=e[i+p]+_,_=u*T-c*P,y=c*T+u*P,e[a+p]=w-y,e[a+0]=w+y,e[i+h]=x-_,e[i+f]=x+_,_=c*E-u*k,y=u*E+c*k,e[i+p]=v-y,e[i+0]=v+y,e[a+h]=S-_,e[a+f]=S+_,i+=o,a+=o}while(a<l);c=(g=c)*n[s+0]-u*n[s+1],u=g*n[s+1]+u*n[s+0]}s+=2}while(o<r)}var o=[0,128,64,192,32,160,96,224,16,144,80,208,48,176,112,240,8,136,72,200,40,168,104,232,24,152,88,216,56,184,120,248,4,132,68,196,36,164,100,228,20,148,84,212,52,180,116,244,12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254];this.fft_short=function(e,n,a,i,s){for(var l=0;l<3;l++){var u=J0.BLKSIZE_s/2,c=65535&192*(l+1),d=J0.BLKSIZE_s/8-1;do{var f,p,h,m,g,b=255&o[d<<2];p=(f=t[b]*i[a][s+b+c])-(g=t[127-b]*i[a][s+b+c+128]),f+=g,m=(h=t[b+64]*i[a][s+b+c+64])-(g=t[63-b]*i[a][s+b+c+192]),h+=g,u-=4,n[l][u+0]=f+h,n[l][u+2]=f-h,n[l][u+1]=p+m,n[l][u+3]=p-m,p=(f=t[b+1]*i[a][s+b+c+1])-(g=t[126-b]*i[a][s+b+c+129]),f+=g,m=(h=t[b+65]*i[a][s+b+c+65])-(g=t[62-b]*i[a][s+b+c+193]),h+=g,n[l][u+J0.BLKSIZE_s/2+0]=f+h,n[l][u+J0.BLKSIZE_s/2+2]=f-h,n[l][u+J0.BLKSIZE_s/2+1]=p+m,n[l][u+J0.BLKSIZE_s/2+3]=p-m}while(--d>=0);r(n[l],u,J0.BLKSIZE_s/2)}},this.fft_long=function(t,n,a,i,s){var l=J0.BLKSIZE/8-1,u=J0.BLKSIZE/2;do{var c,d,f,p,h,m=255&o[l];d=(c=e[m]*i[a][s+m])-(h=e[m+512]*i[a][s+m+512]),c+=h,p=(f=e[m+256]*i[a][s+m+256])-(h=e[m+768]*i[a][s+m+768]),f+=h,n[(u-=4)+0]=c+f,n[u+2]=c-f,n[u+1]=d+p,n[u+3]=d-p,d=(c=e[m+1]*i[a][s+m+1])-(h=e[m+513]*i[a][s+m+513]),c+=h,p=(f=e[m+257]*i[a][s+m+257])-(h=e[m+769]*i[a][s+m+769]),f+=h,n[u+J0.BLKSIZE/2+0]=c+f,n[u+J0.BLKSIZE/2+2]=c-f,n[u+J0.BLKSIZE/2+1]=d+p,n[u+J0.BLKSIZE/2+3]=d-p}while(--l>=0);r(n,u,J0.BLKSIZE/2)},this.init_fft=function(n){for(var r=0;r<J0.BLKSIZE;r++)e[r]=.42-.5*Math.cos(2*Math.PI*(r+.5)/J0.BLKSIZE)+.08*Math.cos(4*Math.PI*(r+.5)/J0.BLKSIZE);for(r=0;r<J0.BLKSIZE_s/2;r++)t[r]=.5*(1-Math.cos(2*Math.PI*(r+.5)/J0.BLKSIZE_s))}}var Pa=$a,T1=Q0,C1=T1.VbrMode,Ue=T1.Float,F1=T1.ShortBlock,n1=T1.Util,Za=T1.Arrays,g0=T1.new_float,m1=T1.new_float_n,L1=T1.new_int,C0=T1.assert,Ka=Pa,r0=t1();function Ua(){var e=j1,t=new Ka,n=2.302585092994046,r=1/217621504/(r0.BLKSIZE/2),o=.3,a=21,i=.2302585093;function s(e,t){for(var n=0,o=0;o<r0.BLKSIZE/2;++o)n+=e[o]*t.ATH.eql_w[o];return n*=r}function l(e,n,r,o,a,i,l,u,c,d,f){var p=e.internal_flags;if(c<2)t.fft_long(p,o[a],c,d,f),t.fft_short(p,i[l],c,d,f);else if(2==c){for(var h=r0.BLKSIZE-1;h>=0;--h){var m=o[a+0][h],g=o[a+1][h];o[a+0][h]=(m+g)*n1.SQRT2*.5,o[a+1][h]=(m-g)*n1.SQRT2*.5}for(var b=2;b>=0;--b)for(h=r0.BLKSIZE_s-1;h>=0;--h){m=i[l+0][b][h],g=i[l+1][b][h];i[l+0][b][h]=(m+g)*n1.SQRT2*.5,i[l+1][b][h]=(m-g)*n1.SQRT2*.5}}n[0]=o[a+0][0],n[0]*=n[0];for(h=r0.BLKSIZE/2-1;h>=0;--h){var y=o[a+0][r0.BLKSIZE/2-h],_=o[a+0][r0.BLKSIZE/2+h];n[r0.BLKSIZE/2-h]=.5*(y*y+_*_)}for(b=2;b>=0;--b){r[b][0]=i[l+0][b][0],r[b][0]*=r[b][0];for(h=r0.BLKSIZE_s/2-1;h>=0;--h){y=i[l+0][b][r0.BLKSIZE_s/2-h],_=i[l+0][b][r0.BLKSIZE_s/2+h];r[b][r0.BLKSIZE_s/2-h]=.5*(y*y+_*_)}}var v=0;for(h=11;h<r0.HBLKSIZE;h++)v+=n[h];if(p.tot_ener[c]=v,e.analysis){for(h=0;h<r0.HBLKSIZE;h++)p.pinfo.energy[u][c][h]=p.pinfo.energy_save[c][h],p.pinfo.energy_save[c][h]=n[h];p.pinfo.pe[u][c]=p.pe[c]}2==e.athaa_loudapprox&&c<2&&(p.loudness_sq[u][c]=p.loudness_sq_save[c],p.loudness_sq_save[c]=s(n,p))}var u,c,d,f=[1,.79433,.63096,.63096,.63096,.63096,.63096,.25119,.11749];var p=[3.3246*3.3246,3.23837*3.23837,9.9500500969,9.0247369744,8.1854926609,7.0440875649,2.46209*2.46209,2.284*2.284,4.4892710641,1.96552*1.96552,1.82335*1.82335,1.69146*1.69146,2.4621061921,2.1508568964,1.37074*1.37074,1.31036*1.31036,1.5691069696,1.4555939904,1.16203*1.16203,1.2715945225,1.09428*1.09428,1.0659*1.0659,1.0779838276,1.0382591025,1],h=[1.7782755904,1.35879*1.35879,1.38454*1.38454,1.39497*1.39497,1.40548*1.40548,1.3537*1.3537,1.6999465924,1.22321*1.22321,1.3169398564,1],m=[5.5396212496,2.29259*2.29259,4.9868695969,2.12675*2.12675,2.02545*2.02545,1.87894*1.87894,1.74303*1.74303,1.61695*1.61695,2.2499700001,1.39148*1.39148,1.29083*1.29083,1.19746*1.19746,1.2339655056,1.0779838276];function g(e,t,n,r,o,a){var i;if(t>e){if(!(t<e*c))return e+t;i=t/e}else{if(e>=t*c)return e+t;i=e/t}if(e+=t,r+3<=6){if(i>=u)return e;var s=0|n1.FAST_LOG10_X(i,16);return e*h[s]}var l,f;s=0|n1.FAST_LOG10_X(i,16);return t=o.ATH.cb_l[n]*o.ATH.adjust,e<d*t?e>t?(l=1,s<=13&&(l=m[s]),f=n1.FAST_LOG10_X(e/t,10/15),e*((p[s]-l)*f+l)):s>13?e:e*m[s]:e*p[s]}var b=[1.7782755904,1.35879*1.35879,1.38454*1.38454,1.39497*1.39497,1.40548*1.40548,1.3537*1.3537,1.6999465924,1.22321*1.22321,1.3169398564,1];function y(e,t,n){var r;if(e<0&&(e=0),t<0&&(t=0),e<=0)return t;if(t<=0)return e;if(r=t>e?t/e:e/t,-2<=n&&n<=2){if(r>=u)return e+t;var o=0|n1.FAST_LOG10_X(r,16);return(e+t)*b[o]}return r<c?e+t:(e<t&&(e=t),e)}function _(e,t,n,r,o){var a,i,s=0,l=0;for(a=i=0;a<r0.SBMAX_s;++i,++a){for(var u=e.bo_s[a],c=e.npart_s,d=u<c?u:c;i<d;)C0(t[i]>=0),C0(n[i]>=0),s+=t[i],l+=n[i],i++;if(e.en[r].s[a][o]=s,e.thm[r].s[a][o]=l,i>=c){++a;break}C0(t[i]>=0),C0(n[i]>=0);var f=e.PSY.bo_s_weight[a],p=1-f;s=f*t[i],l=f*n[i],e.en[r].s[a][o]+=s,e.thm[r].s[a][o]+=l,s=p*t[i],l=p*n[i]}for(;a<r0.SBMAX_s;++a)e.en[r].s[a][o]=0,e.thm[r].s[a][o]=0}function v(e,t,n,r){var o,a,i=0,s=0;for(o=a=0;o<r0.SBMAX_l;++a,++o){for(var l=e.bo_l[o],u=e.npart_l,c=l<u?l:u;a<c;)C0(t[a]>=0),C0(n[a]>=0),i+=t[a],s+=n[a],a++;if(e.en[r].l[o]=i,e.thm[r].l[o]=s,a>=u){++o;break}C0(t[a]>=0),C0(n[a]>=0);var d=e.PSY.bo_l_weight[o],f=1-d;i=d*t[a],s=d*n[a],e.en[r].l[o]+=i,e.thm[r].l[o]+=s,i=f*t[a],s=f*n[a]}for(;o<r0.SBMAX_l;++o)e.en[r].l[o]=0,e.thm[r].l[o]=0}function w(e,t,n,r,o,a){var i,s,l=e.internal_flags;for(s=i=0;s<l.npart_s;++s){for(var u=0,c=l.numlines_s[s],d=0;d<c;++d,++i){u+=t[a][i]}n[s]=u}for(C0(s==l.npart_s),i=s=0;s<l.npart_s;s++){var f=l.s3ind_s[s][0],p=l.s3_ss[i++]*n[f];for(++f;f<=l.s3ind_s[s][1];)p+=l.s3_ss[i]*n[f],++i,++f;var h=2*l.nb_s1[o][s];if(r[s]=Math.min(p,h),l.blocktype_old[1&o]==r0.SHORT_TYPE){h=16*l.nb_s2[o][s];var m=r[s];r[s]=Math.min(h,m)}l.nb_s2[o][s]=l.nb_s1[o][s],l.nb_s1[o][s]=p,C0(r[s]>=0)}for(;s<=r0.CBANDS;++s)n[s]=0,r[s]=0}function S(e,t,n){return n>=1?e:n<=0?t:t>0?Math.pow(e/t,n)*t:0}var x=[11.8,13.6,17.2,32,46.5,51.3,57.5,67.1,71.5,84.6,97.6,130];function T(e,t){for(var r=309.07,o=0;o<r0.SBMAX_s-1;o++)for(var a=0;a<3;a++){var i=e.thm.s[o][a];if(i>0){var s=i*t,l=e.en.s[o][a];l>s&&(r+=l>1e10*s?x[o]*(10*n):x[o]*n1.FAST_LOG10(l/s))}}return r}var E=[6.8,5.8,5.8,6.4,6.5,9.9,12.1,14.4,15,18.9,21.6,26.9,34.2,40.2,46.8,56.5,60.7,73.9,85.7,93.4,126.1];function k(e,t){for(var r=281.0575,o=0;o<r0.SBMAX_l-1;o++){var a=e.thm.l[o];if(a>0){var i=a*t,s=e.en.l[o];s>i&&(r+=s>1e10*i?E[o]*(10*n):E[o]*n1.FAST_LOG10(s/i))}}return r}function P(e,t,n,r,o){var a,i;for(a=i=0;a<e.npart_l;++a){var s,l=0,u=0;for(s=0;s<e.numlines_l[a];++s,++i){var c=t[i];l+=c,u<c&&(u=c)}n[a]=l,r[a]=u,o[a]=l*e.rnumlines_l[a],C0(e.rnumlines_l[a]>=0),C0(n[a]>=0),C0(r[a]>=0),C0(o[a]>=0)}}function O(e,t,n,r){var o=f.length-1,a=0,i=n[a]+n[a+1];i>0?((s=t[a])<t[a+1]&&(s=t[a+1]),C0(e.numlines_l[a]+e.numlines_l[a+1]-1>0),(l=0|(i=20*(2*s-i)/(i*(e.numlines_l[a]+e.numlines_l[a+1]-1))))>o&&(l=o),r[a]=l):r[a]=0;for(a=1;a<e.npart_l-1;a++)if((i=n[a-1]+n[a]+n[a+1])>0){var s,l;(s=t[a-1])<t[a]&&(s=t[a]),s<t[a+1]&&(s=t[a+1]),C0(e.numlines_l[a-1]+e.numlines_l[a]+e.numlines_l[a+1]-1>0),(l=0|(i=20*(3*s-i)/(i*(e.numlines_l[a-1]+e.numlines_l[a]+e.numlines_l[a+1]-1))))>o&&(l=o),r[a]=l}else r[a]=0;(C0(a==e.npart_l-1),(i=n[a-1]+n[a])>0)?((s=t[a-1])<t[a]&&(s=t[a]),C0(e.numlines_l[a-1]+e.numlines_l[a]-1>0),(l=0|(i=20*(2*s-i)/(i*(e.numlines_l[a-1]+e.numlines_l[a]-1))))>o&&(l=o),r[a]=l):r[a]=0;C0(a==e.npart_l-1)}var A=[-1730326e-23,-.01703172,-1349528e-23,.0418072,-673278e-22,-.0876324,-30835e-21,.1863476,-1104424e-22,-.627638];function R(e,n,r,o,a,i,s,l){var u=e.internal_flags;if(o<2)t.fft_long(u,s[l],o,n,r);else if(2==o)for(var c=r0.BLKSIZE-1;c>=0;--c){var d=s[l+0][c],f=s[l+1][c];s[l+0][c]=(d+f)*n1.SQRT2*.5,s[l+1][c]=(d-f)*n1.SQRT2*.5}i[0]=s[l+0][0],i[0]*=i[0];for(c=r0.BLKSIZE/2-1;c>=0;--c){var p=s[l+0][r0.BLKSIZE/2-c],h=s[l+0][r0.BLKSIZE/2+c];i[r0.BLKSIZE/2-c]=.5*(p*p+h*h)}var m=0;for(c=11;c<r0.HBLKSIZE;c++)m+=i[c];if(u.tot_ener[o]=m,e.analysis){for(c=0;c<r0.HBLKSIZE;c++)u.pinfo.energy[a][o][c]=u.pinfo.energy_save[o][c],u.pinfo.energy_save[o][c]=i[c];u.pinfo.pe[a][o]=u.pe[o]}}function $(e,n,r,o,a,i,s,l){var u=e.internal_flags;if(0==a&&o<2&&t.fft_short(u,s[l],o,n,r),2==o)for(var c=r0.BLKSIZE_s-1;c>=0;--c){var d=s[l+0][a][c],f=s[l+1][a][c];s[l+0][a][c]=(d+f)*n1.SQRT2*.5,s[l+1][a][c]=(d-f)*n1.SQRT2*.5}i[a][0]=s[l+0][a][0],i[a][0]*=i[a][0];for(c=r0.BLKSIZE_s/2-1;c>=0;--c){var p=s[l+0][a][r0.BLKSIZE_s/2-c],h=s[l+0][a][r0.BLKSIZE_s/2+c];i[a][r0.BLKSIZE_s/2-c]=.5*(p*p+h*h)}}function I(e,t,n,r){var o=e.internal_flags;2==e.athaa_loudapprox&&n<2&&(o.loudness_sq[t][n]=o.loudness_sq_save[n],o.loudness_sq_save[n]=s(r,o))}this.L3psycho_anal_ns=function(t,n,r,i,s,u,c,d,p,h){var m,b,y,x,E,R,$,I,C,D,N=t.internal_flags,M=m1([2,r0.BLKSIZE]),L=m1([2,3,r0.BLKSIZE_s]),j=g0(r0.CBANDS+1),F=g0(r0.CBANDS+1),B=g0(r0.CBANDS+2),U=L1(2),z=L1(2),V=m1([2,576]),H=L1(r0.CBANDS+2),q=L1(r0.CBANDS+2);for(Za.fill(q,0),m=N.channels_out,t.mode==e.JOINT_STEREO&&(m=4),C=t.VBR==C1.vbr_off?0==N.ResvMax?0:N.ResvSize/N.ResvMax*.5:t.VBR==C1.vbr_rh||t.VBR==C1.vbr_mtrh||t.VBR==C1.vbr_mt?.6:1,b=0;b<N.channels_out;b++){var G=n[b],W=r+576-350-a+192;for(x=0;x<576;x++){var Y,X;for(Y=G[W+x+10],X=0,E=0;E<9;E+=2)Y+=A[E]*(G[W+x+E]+G[W+x+a-E]),X+=A[E+1]*(G[W+x+E+1]+G[W+x+a-E-1]);V[b][x]=Y+X}s[i][b].en.assign(N.en[b]),s[i][b].thm.assign(N.thm[b]),m>2&&(u[i][b].en.assign(N.en[b+2]),u[i][b].thm.assign(N.thm[b+2]))}for(b=0;b<m;b++){var K,Q=g0(12),Z=[0,0,0,0],J=g0(12),ee=1,te=g0(r0.CBANDS),ne=g0(r0.CBANDS),re=[0,0,0,0],oe=g0(r0.HBLKSIZE),ae=m1([3,r0.HBLKSIZE_s]);for(C0(N.npart_s<=r0.CBANDS),C0(N.npart_l<=r0.CBANDS),x=0;x<3;x++)Q[x]=N.nsPsy.last_en_subshort[b][x+6],C0(N.nsPsy.last_en_subshort[b][x+4]>0),J[x]=Q[x]/N.nsPsy.last_en_subshort[b][x+4],Z[0]+=Q[x];if(2==b)for(x=0;x<576;x++){var ie,se;ie=V[0][x],se=V[1][x],V[0][x]=ie+se,V[1][x]=ie-se}var le=V[1&b],ue=0;for(x=0;x<9;x++){for(var ce=ue+64,de=1;ue<ce;ue++)de<Math.abs(le[ue])&&(de=Math.abs(le[ue]));N.nsPsy.last_en_subshort[b][x]=Q[x+3]=de,Z[1+x/3]+=de,de>Q[x+3-2]?(C0(Q[x+3-2]>0),de/=Q[x+3-2]):de=Q[x+3-2]>10*de?Q[x+3-2]/(10*de):0,J[x+3]=de}if(t.analysis){var fe=J[0];for(x=1;x<12;x++)fe<J[x]&&(fe=J[x]);N.pinfo.ers[i][b]=N.pinfo.ers_save[b],N.pinfo.ers_save[b]=fe}for(K=3==b?N.nsPsy.attackthre_s:N.nsPsy.attackthre,x=0;x<12;x++)0==re[x/3]&&J[x]>K&&(re[x/3]=x%3+1);for(x=1;x<4;x++){var pe;Z[x-1]>Z[x]?(C0(Z[x]>0),pe=Z[x-1]/Z[x]):(C0(Z[x-1]>0),pe=Z[x]/Z[x-1]),pe<1.7&&(re[x]=0,1==x&&(re[0]=0))}for(0!=re[0]&&0!=N.nsPsy.lastAttacks[b]&&(re[0]=0),(3==N.nsPsy.lastAttacks[b]||re[0]+re[1]+re[2]+re[3]!=0)&&(ee=0,0!=re[1]&&0!=re[0]&&(re[1]=0),0!=re[2]&&0!=re[1]&&(re[2]=0),0!=re[3]&&0!=re[2]&&(re[3]=0)),b<2?z[b]=ee:0==ee&&(z[0]=z[1]=0),p[b]=N.tot_ener[b],l(t,oe,ae,M,1&b,L,1&b,i,b,n,r),P(N,oe,j,te,ne),O(N,te,ne,H),I=0;I<3;I++){var he,me;for(w(t,ae,F,B,b,I),_(N,F,B,b,I),$=0;$<r0.SBMAX_s;$++){if(me=N.thm[b].s[$][I],me*=.8,re[I]>=2||1==re[I+1]){var ge=0!=I?I-1:2;de=S(N.thm[b].s[$][ge],me,.6*C);me=Math.min(me,de)}if(1==re[I]){ge=0!=I?I-1:2,de=S(N.thm[b].s[$][ge],me,o*C);me=Math.min(me,de)}else if(0!=I&&3==re[I-1]||0==I&&3==N.nsPsy.lastAttacks[b]){ge=2!=I?I+1:0,de=S(N.thm[b].s[$][ge],me,o*C);me=Math.min(me,de)}he=Q[3*I+3]+Q[3*I+4]+Q[3*I+5],6*Q[3*I+5]<he&&(me*=.5,6*Q[3*I+4]<he&&(me*=.5)),N.thm[b].s[$][I]=me}}for(N.nsPsy.lastAttacks[b]=re[2],R=0,y=0;y<N.npart_l;y++){for(var be=N.s3ind[y][0],ye=j[be]*f[H[be]],_e=N.s3_ll[R++]*ye;++be<=N.s3ind[y][1];)ye=j[be]*f[H[be]],_e=g(_e,N.s3_ll[R++]*ye,be,be-y,N);_e*=.158489319246111,N.blocktype_old[1&b]==r0.SHORT_TYPE?B[y]=_e:B[y]=S(Math.min(_e,Math.min(2*N.nb_1[b][y],16*N.nb_2[b][y])),_e,C),N.nb_2[b][y]=N.nb_1[b][y],N.nb_1[b][y]=_e}for(;y<=r0.CBANDS;++y)j[y]=0,B[y]=0;v(N,j,B,b)}((t.mode==e.STEREO||t.mode==e.JOINT_STEREO)&&t.interChRatio>0&&function(e,t){var n=e.internal_flags;if(n.channels_out>1){for(var r=0;r<r0.SBMAX_l;r++){var o=n.thm[0].l[r],a=n.thm[1].l[r];n.thm[0].l[r]+=a*t,n.thm[1].l[r]+=o*t}for(r=0;r<r0.SBMAX_s;r++)for(var i=0;i<3;i++)o=n.thm[0].s[r][i],a=n.thm[1].s[r][i],n.thm[0].s[r][i]+=a*t,n.thm[1].s[r][i]+=o*t}}(t,t.interChRatio),t.mode==e.JOINT_STEREO)&&(function(e){for(var t=0;t<r0.SBMAX_l;t++)if(!(e.thm[0].l[t]>1.58*e.thm[1].l[t]||e.thm[1].l[t]>1.58*e.thm[0].l[t])){var n=e.mld_l[t]*e.en[3].l[t],r=Math.max(e.thm[2].l[t],Math.min(e.thm[3].l[t],n));n=e.mld_l[t]*e.en[2].l[t];var o=Math.max(e.thm[3].l[t],Math.min(e.thm[2].l[t],n));e.thm[2].l[t]=r,e.thm[3].l[t]=o}for(t=0;t<r0.SBMAX_s;t++)for(var a=0;a<3;a++)e.thm[0].s[t][a]>1.58*e.thm[1].s[t][a]||e.thm[1].s[t][a]>1.58*e.thm[0].s[t][a]||(n=e.mld_s[t]*e.en[3].s[t][a],r=Math.max(e.thm[2].s[t][a],Math.min(e.thm[3].s[t][a],n)),n=e.mld_s[t]*e.en[2].s[t][a],o=Math.max(e.thm[3].s[t][a],Math.min(e.thm[2].s[t][a],n)),e.thm[2].s[t][a]=r,e.thm[3].s[t][a]=o)}(N),D=t.msfix,Math.abs(D)>0&&function(e,t,n){var r=t,o=Math.pow(10,n);t*=2,r*=2;for(var a=0;a<r0.SBMAX_l;a++)c=e.ATH.cb_l[e.bm_l[a]]*o,(s=Math.min(Math.max(e.thm[0].l[a],c),Math.max(e.thm[1].l[a],c)))*t<(l=Math.max(e.thm[2].l[a],c))+(u=Math.max(e.thm[3].l[a],c))&&(l*=d=s*r/(l+u),u*=d),e.thm[2].l[a]=Math.min(l,e.thm[2].l[a]),e.thm[3].l[a]=Math.min(u,e.thm[3].l[a]);for(o*=r0.BLKSIZE_s/r0.BLKSIZE,a=0;a<r0.SBMAX_s;a++)for(var i=0;i<3;i++){var s,l,u,c,d;c=e.ATH.cb_s[e.bm_s[a]]*o,(s=Math.min(Math.max(e.thm[0].s[a][i],c),Math.max(e.thm[1].s[a][i],c)))*t<(l=Math.max(e.thm[2].s[a][i],c))+(u=Math.max(e.thm[3].s[a][i],c))&&(l*=d=s*t/(l+u),u*=d),e.thm[2].s[a][i]=Math.min(e.thm[2].s[a][i],l),e.thm[3].s[a][i]=Math.min(e.thm[3].s[a][i],u)}}(N,D,t.ATHlower*N.ATH.adjust));for(function(e,t,n,r){var o=e.internal_flags;e.short_blocks==F1.short_block_coupled&&(0==t[0]||0==t[1])&&(t[0]=t[1]=0);for(var a=0;a<o.channels_out;a++)r[a]=r0.NORM_TYPE,e.short_blocks==F1.short_block_dispensed&&(t[a]=1),e.short_blocks==F1.short_block_forced&&(t[a]=0),0!=t[a]?(C0(o.blocktype_old[a]!=r0.START_TYPE),o.blocktype_old[a]==r0.SHORT_TYPE&&(r[a]=r0.STOP_TYPE)):(r[a]=r0.SHORT_TYPE,o.blocktype_old[a]==r0.NORM_TYPE&&(o.blocktype_old[a]=r0.START_TYPE),o.blocktype_old[a]==r0.STOP_TYPE&&(o.blocktype_old[a]=r0.SHORT_TYPE)),n[a]=o.blocktype_old[a],o.blocktype_old[a]=r[a]}(t,z,h,U),b=0;b<m;b++){var ve,we,Se,xe=0;b>1?(ve=d,xe=-2,we=r0.NORM_TYPE,(h[0]==r0.SHORT_TYPE||h[1]==r0.SHORT_TYPE)&&(we=r0.SHORT_TYPE),Se=u[i][b-2]):(ve=c,xe=0,we=h[b],Se=s[i][b]),we==r0.SHORT_TYPE?ve[xe+b]=T(Se,N.masking_lower):ve[xe+b]=k(Se,N.masking_lower),t.analysis&&(N.pinfo.pe[i][b]=ve[xe+b])}return 0};var C=[-1730326e-23,-.01703172,-1349528e-23,.0418072,-673278e-22,-.0876324,-30835e-21,.1863476,-1104424e-22,-.627638];function D(e,t,n){if(0==n)for(var r=0;r<e.npart_s;r++)e.nb_s2[t][r]=e.nb_s1[t][r],e.nb_s1[t][r]=0}function N(e,t){for(var n=0;n<e.npart_l;n++)e.nb_2[t][n]=e.nb_1[t][n],e.nb_1[t][n]=0}function M(e,t,n,r,o,a){var i,s,l,u=e.internal_flags,c=new float[r0.CBANDS],d=g0(r0.CBANDS),p=new int[r0.CBANDS];for(l=s=0;l<u.npart_s;++l){var h=0,m=0,g=u.numlines_s[l];for(i=0;i<g;++i,++s){var b=t[a][s];h+=b,m<b&&(m=b)}n[l]=h,c[l]=m,d[l]=h/g,C0(d[l]>=0)}for(C0(l==u.npart_s);l<r0.CBANDS;++l)c[l]=0,d[l]=0;for(function(e,t,n,r){var o=f.length-1,a=0,i=n[a]+n[a+1];for(i>0?((s=t[a])<t[a+1]&&(s=t[a+1]),C0(e.numlines_s[a]+e.numlines_s[a+1]-1>0),(l=0|(i=20*(2*s-i)/(i*(e.numlines_s[a]+e.numlines_s[a+1]-1))))>o&&(l=o),r[a]=l):r[a]=0,a=1;a<e.npart_s-1;a++)if(i=n[a-1]+n[a]+n[a+1],C0(a+1<e.npart_s),i>0){var s,l;(s=t[a-1])<t[a]&&(s=t[a]),s<t[a+1]&&(s=t[a+1]),C0(e.numlines_s[a-1]+e.numlines_s[a]+e.numlines_s[a+1]-1>0),(l=0|(i=20*(3*s-i)/(i*(e.numlines_s[a-1]+e.numlines_s[a]+e.numlines_s[a+1]-1))))>o&&(l=o),r[a]=l}else r[a]=0;C0(a==e.npart_s-1),(i=n[a-1]+n[a])>0?((s=t[a-1])<t[a]&&(s=t[a]),C0(e.numlines_s[a-1]+e.numlines_s[a]-1>0),(l=0|(i=20*(2*s-i)/(i*(e.numlines_s[a-1]+e.numlines_s[a]-1))))>o&&(l=o),r[a]=l):r[a]=0,C0(a==e.npart_s-1)}(u,c,d,p),s=l=0;l<u.npart_s;l++){var _,v,w,S,x,T=u.s3ind_s[l][0],E=u.s3ind_s[l][1];for(_=p[T],v=1,S=u.s3_ss[s]*n[T]*f[p[T]],++s,++T;T<=E;)_+=p[T],v+=1,S=y(S,w=u.s3_ss[s]*n[T]*f[p[T]],T-l),++s,++T;S*=x=.5*f[_=(1+2*_)/(2*v)],r[l]=S,u.nb_s2[o][l]=u.nb_s1[o][l],u.nb_s1[o][l]=S,w=c[l],w*=u.minval_s[l],w*=x,r[l]>w&&(r[l]=w),u.masking_lower>1&&(r[l]*=u.masking_lower),r[l]>n[l]&&(r[l]=n[l]),u.masking_lower<1&&(r[l]*=u.masking_lower),C0(r[l]>=0)}for(;l<r0.CBANDS;++l)n[l]=0,r[l]=0}function L(e,t,n,r,a){var i,s=g0(r0.CBANDS),l=g0(r0.CBANDS),u=L1(r0.CBANDS+2);P(e,t,n,s,l),O(e,s,l,u);var c=0;for(i=0;i<e.npart_l;i++){var d,p,h,m=e.s3ind[i][0],g=e.s3ind[i][1],b=0,_=0;for(b=u[m],_+=1,p=e.s3_ll[c]*n[m]*f[u[m]],++c,++m;m<=g;)b+=u[m],_+=1,p=y(p,d=e.s3_ll[c]*n[m]*f[u[m]],m-i),++c,++m;if(p*=h=.5*f[b=(1+2*b)/(2*_)],e.blocktype_old[1&a]==r0.SHORT_TYPE){var v=2*e.nb_1[a][i];r[i]=v>0?Math.min(p,v):Math.min(p,n[i]*o)}else{var w=16*e.nb_2[a][i],S=2*e.nb_1[a][i];w<=0&&(w=p),S<=0&&(S=p),v=e.blocktype_old[1&a]==r0.NORM_TYPE?Math.min(S,w):S,r[i]=Math.min(p,v)}e.nb_2[a][i]=e.nb_1[a][i],e.nb_1[a][i]=p,d=s[i],d*=e.minval_l[i],d*=h,r[i]>d&&(r[i]=d),e.masking_lower>1&&(r[i]*=e.masking_lower),r[i]>n[i]&&(r[i]=n[i]),e.masking_lower<1&&(r[i]*=e.masking_lower),C0(r[i]>=0)}for(;i<r0.CBANDS;++i)n[i]=0,r[i]=0}function j(e,t,n,r,o,a,i){for(var s,l,u=2*a,c=a>0?Math.pow(10,o):1,d=0;d<i;++d){var f=e[2][d],p=e[3][d],h=t[0][d],m=t[1][d],g=t[2][d],b=t[3][d];if(h<=1.58*m&&m<=1.58*h){var y=n[d]*p,_=n[d]*f;l=Math.max(g,Math.min(b,y)),s=Math.max(b,Math.min(g,_))}else l=g,s=b;if(a>0){var v,w,S=r[d]*c;if(v=Math.min(Math.max(h,S),Math.max(m,S)),(w=(g=Math.max(l,S))+(b=Math.max(s,S)))>0&&v*u<w){var x=v*u/w;g*=x,b*=x}l=Math.min(g,l),s=Math.min(b,s)}l>f&&(l=f),s>p&&(s=p),t[2][d]=l,t[3][d]=s}}function F(e,t){var n;return(n=e>=0?27*-e:e*t)<=-72?0:Math.exp(n*i)}function B(e){var t,n,r=0;for(r=0;F(r,e)>1e-20;r-=1);for(o=r,a=0;Math.abs(a-o)>1e-12;)F(r=(a+o)/2,e)>0?a=r:o=r;t=o;var o,a;r=0;for(r=0;F(r,e)>1e-20;r+=1);for(o=0,a=r;Math.abs(a-o)>1e-12;)F(r=(a+o)/2,e)>0?o=r:a=r;n=a;var i,s=0,l=1e3;for(i=0;i<=l;++i){s+=F(r=t+i*(n-t)/l,e)}return(l+1)/(s*(n-t))}function U(e){var t,n,r,o;return t=e,(t*=t>=0?3:1.5)>=.5&&t<=2.5?n=8*((o=t-.5)*o-2*o):n=0,(r=15.811389+7.5*(t+=.474)-17.5*Math.sqrt(1+t*t))<=-60?0:(t=Math.exp((n+r)*i),t/=.6609193)}function z(e){return e<0&&(e=0),e*=.001,13*Math.atan(.76*e)+3.5*Math.atan(e*e/56.25)}function V(e,t,n,r,o,a,i,s,l,u,c,d){var f,p=g0(r0.CBANDS+1),h=s/(d>15?1152:384),m=L1(r0.HBLKSIZE);s/=l;var g=0,b=0;for(f=0;f<r0.CBANDS;f++){var y;for(P=z(s*g),p[f]=s*g,y=g;z(s*y)-P<.34&&y<=l/2;y++);for(e[f]=y-g,b=f+1;g<y;)C0(g<r0.HBLKSIZE),m[g++]=f;if(g>l/2){g=l/2,++f;break}}C0(f<r0.CBANDS),p[f]=s*g;for(var _=0;_<d;_++){var v,w,S,x,T;S=u[_],x=u[_+1],(v=0|Math.floor(.5+c*(S-.5)))<0&&(v=0),(w=0|Math.floor(.5+c*(x-.5)))>l/2&&(w=l/2),n[_]=(m[v]+m[w])/2,t[_]=m[w];var E=h*x;i[_]=(E-p[t[_]])/(p[t[_]+1]-p[t[_]]),i[_]<0?i[_]=0:i[_]>1&&(i[_]=1),T=z(s*u[_]*c),T=Math.min(T,15.5)/15.5,a[_]=Math.pow(10,1.25*(1-Math.cos(Math.PI*T))-2.5)}g=0;for(var k=0;k<b;k++){var P,O,A=e[k];P=z(s*g),O=z(s*(g+A-1)),r[k]=.5*(P+O),P=z(s*(g-.5)),O=z(s*(g+A-.5)),o[k]=O-P,g+=A}return b}function H(e,t,n,r,o,a){var i,s=m1([r0.CBANDS,r0.CBANDS]),l=0;if(a)for(var u=0;u<t;u++)for(i=0;i<t;i++){var c=U(n[u]-n[i])*r[i];s[u][i]=c*o[u]}else for(i=0;i<t;i++){var d=15+Math.min(21/n[i],12),f=B(d);for(u=0;u<t;u++){c=f*F(n[u]-n[i],d)*r[i];s[u][i]=c*o[u]}}for(u=0;u<t;u++){for(i=0;i<t&&!(s[u][i]>0);i++);for(e[u][0]=i,i=t-1;i>0&&!(s[u][i]>0);i--);e[u][1]=i,l+=e[u][1]-e[u][0]+1}var p=g0(l),h=0;for(u=0;u<t;u++)for(i=e[u][0];i<=e[u][1];i++)p[h++]=s[u][i];return p}function q(e){var t=z(e);return t=Math.min(t,15.5)/15.5,Math.pow(10,1.25*(1-Math.cos(Math.PI*t))-2.5)}function G(e,t){return e<-.3&&(e=3410),e/=1e3,e=Math.max(.1,e),3.64*Math.pow(e,-.8)-6.8*Math.exp(-.6*Math.pow(e-3.4,2))+6*Math.exp(-.15*Math.pow(e-8.7,2))+.001*(.6+.04*t)*Math.pow(e,4)}this.L3psycho_anal_vbr=function(t,n,r,o,i,s,l,u,c,d){var f=t.internal_flags,p=g0(r0.HBLKSIZE),h=m1([3,r0.HBLKSIZE_s]),m=m1([2,r0.BLKSIZE]),g=m1([2,3,r0.BLKSIZE_s]),b=m1([4,r0.CBANDS]),y=m1([4,r0.CBANDS]),w=m1([4,3]),x=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],E=L1(2),P=t.mode==e.JOINT_STEREO?4:f.channels_out;(function(t,n,r,o,i,s,l,u,c,d){for(var f=m1([2,576]),p=t.internal_flags,h=p.channels_out,m=t.mode==e.JOINT_STEREO?4:h,g=0;g<h;g++){firbuf=n[g];for(var b=r+576-350-a+192,y=0;y<576;y++){var _,v;_=firbuf[b+y+10],v=0;for(var w=0;w<9;w+=2)_+=C[w]*(firbuf[b+y+w]+firbuf[b+y+a-w]),v+=C[w+1]*(firbuf[b+y+w+1]+firbuf[b+y+a-w-1]);f[g][y]=_+v}i[o][g].en.assign(p.en[g]),i[o][g].thm.assign(p.thm[g]),m>2&&(s[o][g].en.assign(p.en[g+2]),s[o][g].thm.assign(p.thm[g+2]))}for(g=0;g<m;g++){var S=g0(12),x=g0(12),T=[0,0,0,0],E=f[1&g],k=0,P=3==g?p.nsPsy.attackthre_s:p.nsPsy.attackthre,O=1;if(2==g)for(y=0,w=576;w>0;++y,--w){var A=f[0][y],R=f[1][y];f[0][y]=A+R,f[1][y]=A-R}for(y=0;y<3;y++)x[y]=p.nsPsy.last_en_subshort[g][y+6],C0(p.nsPsy.last_en_subshort[g][y+4]>0),S[y]=x[y]/p.nsPsy.last_en_subshort[g][y+4],T[0]+=x[y];for(y=0;y<9;y++){for(var $=k+64,I=1;k<$;k++)I<Math.abs(E[k])&&(I=Math.abs(E[k]));p.nsPsy.last_en_subshort[g][y]=x[y+3]=I,T[1+y/3]+=I,I>x[y+3-2]?(C0(x[y+3-2]>0),I/=x[y+3-2]):I=x[y+3-2]>10*I?x[y+3-2]/(10*I):0,S[y+3]=I}for(y=0;y<3;++y){var D=x[3*y+3]+x[3*y+4]+x[3*y+5],N=1;6*x[3*y+5]<D&&(N*=.5,6*x[3*y+4]<D&&(N*=.5)),u[g][y]=N}if(t.analysis){var M=S[0];for(y=1;y<12;y++)M<S[y]&&(M=S[y]);p.pinfo.ers[o][g]=p.pinfo.ers_save[g],p.pinfo.ers_save[g]=M}for(y=0;y<12;y++)0==c[g][y/3]&&S[y]>P&&(c[g][y/3]=y%3+1);for(y=1;y<4;y++){var L=T[y-1],j=T[y];Math.max(L,j)<4e4&&L<1.7*j&&j<1.7*L&&(1==y&&c[g][0]<=c[g][y]&&(c[g][0]=0),c[g][y]=0)}c[g][0]<=p.nsPsy.lastAttacks[g]&&(c[g][0]=0),(3==p.nsPsy.lastAttacks[g]||c[g][0]+c[g][1]+c[g][2]+c[g][3]!=0)&&(O=0,0!=c[g][1]&&0!=c[g][0]&&(c[g][1]=0),0!=c[g][2]&&0!=c[g][1]&&(c[g][2]=0),0!=c[g][3]&&0!=c[g][2]&&(c[g][3]=0)),g<2?d[g]=O:0==O&&(d[0]=d[1]=0),l[g]=p.tot_ener[g]}})(t,n,r,o,i,s,c,w,x,E),function(e,t){var n=e.internal_flags;e.short_blocks==F1.short_block_coupled&&(0==t[0]||0==t[1])&&(t[0]=t[1]=0);for(var r=0;r<n.channels_out;r++)e.short_blocks==F1.short_block_dispensed&&(t[r]=1),e.short_blocks==F1.short_block_forced&&(t[r]=0)}(t,E);for(var O=0;O<P;O++){R(t,n,r,O,o,p,m,F=1&O),I(t,o,O,p),0!=E[F]?L(f,p,b[O],y[O],O):N(f,O)}E[0]+E[1]==2&&t.mode==e.JOINT_STEREO&&j(b,y,f.mld_cb_l,f.ATH.cb_l,t.ATHlower*f.ATH.adjust,t.msfix,f.npart_l);for(O=0;O<P;O++){0!=E[F=1&O]&&v(f,b[O],y[O],O)}for(var A=0;A<3;A++){for(O=0;O<P;++O){0!=E[F=1&O]?D(f,O,A):($(t,n,r,O,A,h,g,F),M(t,h,b[O],y[O],O,A))}E[0]+E[1]==0&&t.mode==e.JOINT_STEREO&&j(b,y,f.mld_cb_s,f.ATH.cb_s,t.ATHlower*f.ATH.adjust,t.msfix,f.npart_s);for(O=0;O<P;++O){0==E[F=1&O]&&_(f,b[O],y[O],O,A)}}for(O=0;O<P;O++){var F;if(0==E[F=1&O])for(var B=0;B<r0.SBMAX_s;B++){var U=g0(3);for(A=0;A<3;A++){var z=f.thm[O].s[B][A];if(z*=.8,x[O][A]>=2||1==x[O][A+1]){var V=0!=A?A-1:2,H=S(f.thm[O].s[B][V],z,.36);z=Math.min(z,H)}else if(1==x[O][A]){V=0!=A?A-1:2,H=S(f.thm[O].s[B][V],z,.18);z=Math.min(z,H)}else if(0!=A&&3==x[O][A-1]||0==A&&3==f.nsPsy.lastAttacks[O]){V=2!=A?A+1:0,H=S(f.thm[O].s[B][V],z,.18);z=Math.min(z,H)}z*=w[O][A],U[A]=z}for(A=0;A<3;A++)f.thm[O].s[B][A]=U[A]}}for(O=0;O<P;O++)f.nsPsy.lastAttacks[O]=x[O][2];!function(e,t,n){for(var r=e.internal_flags,o=0;o<r.channels_out;o++){var a=r0.NORM_TYPE;0!=t[o]?(C0(r.blocktype_old[o]!=r0.START_TYPE),r.blocktype_old[o]==r0.SHORT_TYPE&&(a=r0.STOP_TYPE)):(a=r0.SHORT_TYPE,r.blocktype_old[o]==r0.NORM_TYPE&&(r.blocktype_old[o]=r0.START_TYPE),r.blocktype_old[o]==r0.STOP_TYPE&&(r.blocktype_old[o]=r0.SHORT_TYPE)),n[o]=r.blocktype_old[o],r.blocktype_old[o]=a}}(t,E,d);for(O=0;O<P;O++){var q,G,W,Y;O>1?(q=u,G=-2,W=r0.NORM_TYPE,(d[0]==r0.SHORT_TYPE||d[1]==r0.SHORT_TYPE)&&(W=r0.SHORT_TYPE),Y=s[o][O-2]):(q=l,G=0,W=d[O],Y=i[o][O]),W==r0.SHORT_TYPE?q[G+O]=T(Y,f.masking_lower):q[G+O]=k(Y,f.masking_lower),t.analysis&&(f.pinfo.pe[o][O]=q[G+O])}return 0},this.psymodel_init=function(e){var r,o=e.internal_flags,a=!0,i=13,s=24,l=0,f=0,p=-8.25,h=-4.5,m=g0(r0.CBANDS),g=g0(r0.CBANDS),b=g0(r0.CBANDS),y=e.out_samplerate;switch(e.experimentalZ){default:case 0:a=!0;break;case 1:a=!(e.VBR==C1.vbr_mtrh||e.VBR==C1.vbr_mt);break;case 2:a=!1;break;case 3:i=8,l=-1.75,f=-.0125,p=-8.25,h=-2.25}for(o.ms_ener_ratio_old=.25,o.blocktype_old[0]=o.blocktype_old[1]=r0.NORM_TYPE,r=0;r<4;++r){for(var _=0;_<r0.CBANDS;++_)o.nb_1[r][_]=1e20,o.nb_2[r][_]=1e20,o.nb_s1[r][_]=o.nb_s2[r][_]=1;for(var v=0;v<r0.SBMAX_l;v++)o.en[r].l[v]=1e20,o.thm[r].l[v]=1e20;for(_=0;_<3;++_){for(v=0;v<r0.SBMAX_s;v++)o.en[r].s[v][_]=1e20,o.thm[r].s[v][_]=1e20;o.nsPsy.lastAttacks[r]=0}for(_=0;_<9;_++)o.nsPsy.last_en_subshort[r][_]=10}for(o.loudness_sq_save[0]=o.loudness_sq_save[1]=0,o.npart_l=V(o.numlines_l,o.bo_l,o.bm_l,m,g,o.mld_l,o.PSY.bo_l_weight,y,r0.BLKSIZE,o.scalefac_band.l,r0.BLKSIZE/1152,r0.SBMAX_l),C0(o.npart_l<r0.CBANDS),r=0;r<o.npart_l;r++){var w=l;m[r]>=i&&(w=f*(m[r]-i)/(s-i)+l*(s-m[r])/(s-i)),b[r]=Math.pow(10,w/10),o.numlines_l[r]>0?o.rnumlines_l[r]=1/o.numlines_l[r]:o.rnumlines_l[r]=0}o.s3_ll=H(o.s3ind,o.npart_l,m,g,b,a);var S;_=0;for(r=0;r<o.npart_l;r++){E=Ue.MAX_VALUE;for(var x=0;x<o.numlines_l[r];x++,_++){var T=y*_/(1e3*r0.BLKSIZE);k=this.ATHformula(1e3*T,e)-20,k=Math.pow(10,.1*k),E>(k*=o.numlines_l[r])&&(E=k)}o.ATH.cb_l[r]=E,(E=20*m[r]/10-20)>6&&(E=100),E<-15&&(E=-15),E-=8,o.minval_l[r]=Math.pow(10,E/10)*o.numlines_l[r]}for(o.npart_s=V(o.numlines_s,o.bo_s,o.bm_s,m,g,o.mld_s,o.PSY.bo_s_weight,y,r0.BLKSIZE_s,o.scalefac_band.s,r0.BLKSIZE_s/384,r0.SBMAX_s),C0(o.npart_s<r0.CBANDS),_=0,r=0;r<o.npart_s;r++){var E;w=p;m[r]>=i&&(w=h*(m[r]-i)/(s-i)+p*(s-m[r])/(s-i)),b[r]=Math.pow(10,w/10),E=Ue.MAX_VALUE;for(x=0;x<o.numlines_s[r];x++,_++){var k;T=y*_/(1e3*r0.BLKSIZE_s);k=this.ATHformula(1e3*T,e)-20,k=Math.pow(10,.1*k),E>(k*=o.numlines_s[r])&&(E=k)}o.ATH.cb_s[r]=E,E=7*m[r]/12-7,m[r]>12&&(E*=1+3.1*Math.log(1+E)),m[r]<12&&(E*=1+2.3*Math.log(1-E)),E<-15&&(E=-15),E-=8,o.minval_s[r]=Math.pow(10,E/10)*o.numlines_s[r]}o.s3_ss=H(o.s3ind_s,o.npart_s,m,g,b,a),u=Math.pow(10,9/16),c=Math.pow(10,1.5),d=Math.pow(10,1.5),t.init_fft(o),o.decay=Math.exp(-1*n/(.01*y/192)),S=3.5,2&e.exp_nspsytune&&(S=1),Math.abs(e.msfix)>0&&(S=e.msfix),e.msfix=S;for(var P=0;P<o.npart_l;P++)o.s3ind[P][1]>o.npart_l-1&&(o.s3ind[P][1]=o.npart_l-1);var O=576*o.mode_gr/y;if(o.ATH.decay=Math.pow(10,-1.2*O),o.ATH.adjust=.01,o.ATH.adjustLimit=1,C0(o.bo_l[r0.SBMAX_l-1]<=o.npart_l),C0(o.bo_s[r0.SBMAX_s-1]<=o.npart_s),-1!=e.ATHtype){var A=e.out_samplerate/r0.BLKSIZE,R=0;for(T=0,r=0;r<r0.BLKSIZE/2;++r)T+=A,o.ATH.eql_w[r]=1/Math.pow(10,this.ATHformula(T,e)/10),R+=o.ATH.eql_w[r];for(R=1/R,r=r0.BLKSIZE/2;--r>=0;)o.ATH.eql_w[r]*=R}for(P=_=0;P<o.npart_s;++P)for(r=0;r<o.numlines_s[P];++r)++_;for(P=_=0;P<o.npart_l;++P)for(r=0;r<o.numlines_l[P];++r)++_;for(_=0,r=0;r<o.npart_l;r++){T=y*(_+o.numlines_l[r]/2)/(1*r0.BLKSIZE);o.mld_cb_l[r]=q(T),_+=o.numlines_l[r]}for(;r<r0.CBANDS;++r)o.mld_cb_l[r]=1;for(_=0,r=0;r<o.npart_s;r++){T=y*(_+o.numlines_s[r]/2)/(1*r0.BLKSIZE_s);o.mld_cb_s[r]=q(T),_+=o.numlines_s[r]}for(;r<r0.CBANDS;++r)o.mld_cb_s[r]=1;return 0},this.ATHformula=function(e,t){var n;switch(t.ATHtype){case 0:n=G(e,9);break;case 1:n=G(e,-1);break;case 2:default:n=G(e,0);break;case 3:n=G(e,1)+6;break;case 4:n=G(e,t.ATHcurve)}return n}}var Qa=Ua,Wa=j1;function ja(){this.class_id=0,this.num_samples=0,this.num_channels=0,this.in_samplerate=0,this.out_samplerate=0,this.scale=0,this.scale_left=0,this.scale_right=0,this.analysis=!1,this.bWriteVbrTag=!1,this.decode_only=!1,this.quality=0,this.mode=Wa.STEREO,this.force_ms=!1,this.free_format=!1,this.findReplayGain=!1,this.decode_on_the_fly=!1,this.write_id3tag_automatic=!1,this.brate=0,this.compression_ratio=0,this.copyright=0,this.original=0,this.extension=0,this.emphasis=0,this.error_protection=0,this.strict_ISO=!1,this.disable_reservoir=!1,this.quant_comp=0,this.quant_comp_short=0,this.experimentalY=!1,this.experimentalZ=0,this.exp_nspsytune=0,this.preset=0,this.VBR=null,this.VBR_q_frac=0,this.VBR_q=0,this.VBR_mean_bitrate_kbps=0,this.VBR_min_bitrate_kbps=0,this.VBR_max_bitrate_kbps=0,this.VBR_hard_min=0,this.lowpassfreq=0,this.highpassfreq=0,this.lowpasswidth=0,this.highpasswidth=0,this.maskingadjust=0,this.maskingadjust_short=0,this.ATHonly=!1,this.ATHshort=!1,this.noATH=!1,this.ATHtype=0,this.ATHcurve=0,this.ATHlower=0,this.athaa_type=0,this.athaa_loudapprox=0,this.athaa_sensitivity=0,this.short_blocks=null,this.useTemporal=!1,this.interChRatio=0,this.msfix=0,this.tune=!1,this.tune_value_a=0,this.version=0,this.encoder_delay=0,this.encoder_padding=0,this.framesize=0,this.frameNum=0,this.lame_allocated_gfp=0,this.internal_flags=null}var za=ja,Ja=t1(),Ta={};Ta.SFBMAX=3*Ja.SBMAX_s;var ie=Ta,ya=Q0,ga=ya.new_float,N1=ya.new_int,Re=ie;function e2(){this.xr=ga(576),this.l3_enc=N1(576),this.scalefac=N1(Re.SFBMAX),this.xrpow_max=0,this.part2_3_length=0,this.big_values=0,this.count1=0,this.global_gain=0,this.scalefac_compress=0,this.block_type=0,this.mixed_block_flag=0,this.table_select=N1(3),this.subblock_gain=N1(4),this.region0_count=0,this.region1_count=0,this.preflag=0,this.scalefac_scale=0,this.count1table_select=0,this.part2_length=0,this.sfb_lmax=0,this.sfb_smin=0,this.psy_lmax=0,this.sfbmax=0,this.psymax=0,this.sfbdivide=0,this.width=N1(Re.SFBMAX),this.window=N1(Re.SFBMAX),this.count1bits=0,this.sfb_partition_table=null,this.slen=N1(4),this.max_nonzero_coeff=0;var e=this;function t(e){return new Int32Array(e)}this.assign=function(n){e.xr=function(e){return new Float32Array(e)}(n.xr),e.l3_enc=t(n.l3_enc),e.scalefac=t(n.scalefac),e.xrpow_max=n.xrpow_max,e.part2_3_length=n.part2_3_length,e.big_values=n.big_values,e.count1=n.count1,e.global_gain=n.global_gain,e.scalefac_compress=n.scalefac_compress,e.block_type=n.block_type,e.mixed_block_flag=n.mixed_block_flag,e.table_select=t(n.table_select),e.subblock_gain=t(n.subblock_gain),e.region0_count=n.region0_count,e.region1_count=n.region1_count,e.preflag=n.preflag,e.scalefac_scale=n.scalefac_scale,e.count1table_select=n.count1table_select,e.part2_length=n.part2_length,e.sfb_lmax=n.sfb_lmax,e.sfb_smin=n.sfb_smin,e.psy_lmax=n.psy_lmax,e.sfbmax=n.sfbmax,e.psymax=n.psymax,e.sfbdivide=n.sfbdivide,e.width=t(n.width),e.window=t(n.window),e.count1bits=n.count1bits,e.sfb_partition_table=n.sfb_partition_table.slice(0),e.slen=t(n.slen),e.max_nonzero_coeff=n.max_nonzero_coeff}}var Le=e2,a2=Q0,Qe=a2.new_int,r2=Le;function t2(){this.tt=[[null,null],[null,null]],this.main_data_begin=0,this.private_bits=0,this.resvDrain_pre=0,this.resvDrain_post=0,this.scfsi=[Qe(4),Qe(4)];for(var e=0;e<2;e++)for(var t=0;t<2;t++)this.tt[e][t]=new r2}var s2=t2,wa=Q0,g1=wa.System,ee=wa.new_int,ae=t1();function i2(e,t,n,r){this.l=ee(1+ae.SBMAX_l),this.s=ee(1+ae.SBMAX_s),this.psfb21=ee(1+ae.PSFB21),this.psfb12=ee(1+ae.PSFB12);var o=this.l,a=this.s;4==arguments.length&&(this.arrL=arguments[0],this.arrS=arguments[1],this.arr21=arguments[2],this.arr12=arguments[3],g1.arraycopy(this.arrL,0,o,0,Math.min(this.arrL.length,this.l.length)),g1.arraycopy(this.arrS,0,a,0,Math.min(this.arrS.length,this.s.length)),g1.arraycopy(this.arr21,0,this.psfb21,0,Math.min(this.arr21.length,this.psfb21.length)),g1.arraycopy(this.arr12,0,this.psfb12,0,Math.min(this.arr12.length,this.psfb12.length)))}var Ia=i2,Ne=Q0,xe=Ne.new_float,n2=Ne.new_float_n,_2=Ne.new_int,We=t1();function l2(){this.last_en_subshort=n2([4,9]),this.lastAttacks=_2(4),this.pefirbuf=xe(19),this.longfact=xe(We.SBMAX_l),this.shortfact=xe(We.SBMAX_s),this.attackthre=0,this.attackthre_s=0}var v2=l2;function o2(){this.sum=0,this.seen=0,this.want=0,this.pos=0,this.size=0,this.bag=null,this.nVbrNumFrames=0,this.nBytesWritten=0,this.TotalFrameSize=0}var h2=o2,Y1=Q0,u2=Y1.new_byte,f2=Y1.new_double,b1=Y1.new_float,p1=Y1.new_float_n,d1=Y1.new_int,re=Y1.new_int_n,m2=s2,b2=Ia,c2=v2,S2=h2,je=Ea(),W0=t1(),d2=ie;function E1(){function e(){this.write_timing=0,this.ptr=0,this.buf=u2(40)}this.Class_ID=0,this.lame_encode_frame_init=0,this.iteration_init_init=0,this.fill_buffer_resample_init=0,this.mfbuf=p1([2,E1.MFSIZE]),this.mode_gr=0,this.channels_in=0,this.channels_out=0,this.resample_ratio=0,this.mf_samples_to_encode=0,this.mf_size=0,this.VBR_min_bitrate=0,this.VBR_max_bitrate=0,this.bitrate_index=0,this.samplerate_index=0,this.mode_ext=0,this.lowpass1=0,this.lowpass2=0,this.highpass1=0,this.highpass2=0,this.noise_shaping=0,this.noise_shaping_amp=0,this.substep_shaping=0,this.psymodel=0,this.noise_shaping_stop=0,this.subblock_gain=0,this.use_best_huffman=0,this.full_outer_loop=0,this.l3_side=new m2,this.ms_ratio=b1(2),this.padding=0,this.frac_SpF=0,this.slot_lag=0,this.tag_spec=null,this.nMusicCRC=0,this.OldValue=d1(2),this.CurrentStep=d1(2),this.masking_lower=0,this.bv_scf=d1(576),this.pseudohalf=d1(d2.SFBMAX),this.sfb21_extra=!1,this.inbuf_old=new Array(2),this.blackfilt=new Array(2*E1.BPC+1),this.itime=f2(2),this.sideinfo_len=0,this.sb_sample=p1([2,2,18,W0.SBLIMIT]),this.amp_filter=b1(32),this.header=new Array(E1.MAX_HEADER_BUF),this.h_ptr=0,this.w_ptr=0,this.ancillary_flag=0,this.ResvSize=0,this.ResvMax=0,this.scalefac_band=new b2,this.minval_l=b1(W0.CBANDS),this.minval_s=b1(W0.CBANDS),this.nb_1=p1([4,W0.CBANDS]),this.nb_2=p1([4,W0.CBANDS]),this.nb_s1=p1([4,W0.CBANDS]),this.nb_s2=p1([4,W0.CBANDS]),this.s3_ss=null,this.s3_ll=null,this.decay=0,this.thm=new Array(4),this.en=new Array(4),this.tot_ener=b1(4),this.loudness_sq=p1([2,2]),this.loudness_sq_save=b1(2),this.mld_l=b1(W0.SBMAX_l),this.mld_s=b1(W0.SBMAX_s),this.bm_l=d1(W0.SBMAX_l),this.bo_l=d1(W0.SBMAX_l),this.bm_s=d1(W0.SBMAX_s),this.bo_s=d1(W0.SBMAX_s),this.npart_l=0,this.npart_s=0,this.s3ind=re([W0.CBANDS,2]),this.s3ind_s=re([W0.CBANDS,2]),this.numlines_s=d1(W0.CBANDS),this.numlines_l=d1(W0.CBANDS),this.rnumlines_l=b1(W0.CBANDS),this.mld_cb_l=b1(W0.CBANDS),this.mld_cb_s=b1(W0.CBANDS),this.numlines_s_num1=0,this.numlines_l_num1=0,this.pe=b1(4),this.ms_ratio_s_old=0,this.ms_ratio_l_old=0,this.ms_ener_ratio_old=0,this.blocktype_old=d1(2),this.nsPsy=new c2,this.VBR_seek_table=new S2,this.ATH=null,this.PSY=null,this.nogap_total=0,this.nogap_current=0,this.decode_on_the_fly=!0,this.findReplayGain=!0,this.findPeakSample=!0,this.PeakSample=0,this.RadioGain=0,this.AudiophileGain=0,this.rgdata=null,this.noclipGainChange=0,this.noclipScale=0,this.bitrate_stereoMode_Hist=re([16,5]),this.bitrate_blockType_Hist=re([16,6]),this.pinfo=null,this.hip=null,this.in_buffer_nsamples=0,this.in_buffer_0=null,this.in_buffer_1=null,this.iteration_loop=null;for(var t=0;t<this.en.length;t++)this.en[t]=new je;for(t=0;t<this.thm.length;t++)this.thm[t]=new je;for(t=0;t<this.header.length;t++)this.header[t]=new e}E1.MFSIZE=3456+W0.ENCDELAY-W0.MDCTDELAY,E1.MAX_HEADER_BUF=256,E1.MAX_BITS_PER_CHANNEL=4095,E1.MAX_BITS_PER_GRANULE=7680,E1.BPC=320;var ne=E1,A2=Q0,H1=A2.new_float,V1=t1();function R2(){this.useAdjust=0,this.aaSensitivityP=0,this.adjust=0,this.adjustLimit=0,this.decay=0,this.floor=0,this.l=H1(V1.SBMAX_l),this.s=H1(V1.SBMAX_s),this.psfb21=H1(V1.PSFB21),this.psfb12=H1(V1.PSFB12),this.cb_l=H1(V1.CBANDS),this.cb_s=H1(V1.CBANDS),this.eql_w=H1(V1.BLKSIZE/2)}var x2=R2,La=Q0,_1=La.System,ze=La.Arrays;function j0(){var e=j0.RMS_WINDOW_TIME_NUMERATOR,t=j0.RMS_WINDOW_TIME_DENOMINATOR,n=[[.038575994352,-3.84664617118067,-.02160367184185,7.81501653005538,-.00123395316851,-11.34170355132042,-9291677959e-14,13.05504219327545,-.01655260341619,-12.28759895145294,.02161526843274,9.4829380631979,-.02074045215285,-5.87257861775999,.00594298065125,2.75465861874613,.00306428023191,-.86984376593551,.00012025322027,.13919314567432,.00288463683916],[.0541865640643,-3.47845948550071,-.02911007808948,6.36317777566148,-.00848709379851,-8.54751527471874,-.00851165645469,9.4769360780128,-.00834990904936,-8.81498681370155,.02245293253339,6.85401540936998,-.02596338512915,-4.39470996079559,.01624864962975,2.19611684890774,-.00240879051584,-.75104302451432,.00674613682247,.13149317958808,-.00187763777362],[.15457299681924,-2.37898834973084,-.09331049056315,2.84868151156327,-.06247880153653,-2.64577170229825,.02163541888798,2.23697657451713,-.05588393329856,-1.67148153367602,.04781476674921,1.00595954808547,.00222312597743,-.45953458054983,.03174092540049,.16378164858596,-.01390589421898,-.05032077717131,.00651420667831,.0234789740702,-.00881362733839],[.30296907319327,-1.61273165137247,-.22613988682123,1.0797749225997,-.08587323730772,-.2565625775407,.03282930172664,-.1627671912044,-.00915702933434,-.22638893773906,-.02364141202522,.39120800788284,-.00584456039913,-.22138138954925,.06276101321749,.04500235387352,-828086748e-14,.02005851806501,.00205861885564,.00302439095741,-.02950134983287],[.33642304856132,-1.49858979367799,-.2557224142557,.87350271418188,-.11828570177555,.12205022308084,.11921148675203,-.80774944671438,-.07834489609479,.47854794562326,-.0046997791438,-.12453458140019,-.0058950022444,-.04067510197014,.05724228140351,.08333755284107,.00832043980773,-.04237348025746,-.0163538138454,.02977207319925,-.0176017656815],[.4491525660845,-.62820619233671,-.14351757464547,.29661783706366,-.22784394429749,-.372563729424,-.01419140100551,.00213767857124,.04078262797139,-.42029820170918,-.12398163381748,.22199650564824,.04097565135648,.00613424350682,.10478503600251,.06747620744683,-.01863887810927,.05784820375801,-.03193428438915,.03222754072173,.00541907748707],[.56619470757641,-1.04800335126349,-.75464456939302,.29156311971249,.1624213774223,-.26806001042947,.16744243493672,.00819999645858,-.18901604199609,.45054734505008,.3093178284183,-.33032403314006,-.27562961986224,.0673936833311,.00647310677246,-.04784254229033,.08647503780351,.01639907836189,-.0378898455484,.01807364323573,-.00588215443421],[.58100494960553,-.51035327095184,-.53174909058578,-.31863563325245,-.14289799034253,-.20256413484477,.17520704835522,.1472815413433,.02377945217615,.38952639978999,.15558449135573,-.23313271880868,-.25344790059353,-.05246019024463,.01628462406333,-.02505961724053,.06920467763959,.02442357316099,-.03721611395801,.01818801111503,-.00749618797172],[.53648789255105,-.2504987195602,-.42163034350696,-.43193942311114,-.00275953611929,-.03424681017675,.04267842219415,-.04678328784242,-.10214864179676,.26408300200955,.14590772289388,.15113130533216,-.02459864859345,-.17556493366449,-.11202315195388,-.18823009262115,-.04060034127,.05477720428674,.0478866554818,.0470440968812,-.02217936801134]],r=[[.98621192462708,-1.97223372919527,-1.97242384925416,.97261396931306,.98621192462708],[.98500175787242,-1.96977855582618,-1.97000351574484,.9702284756635,.98500175787242],[.97938932735214,-1.95835380975398,-1.95877865470428,.95920349965459,.97938932735214],[.97531843204928,-1.95002759149878,-1.95063686409857,.95124613669835,.97531843204928],[.97316523498161,-1.94561023566527,-1.94633046996323,.94705070426118,.97316523498161],[.96454515552826,-1.92783286977036,-1.92909031105652,.93034775234268,.96454515552826],[.96009142950541,-1.91858953033784,-1.92018285901082,.92177618768381,.96009142950541],[.95856916599601,-1.9154210807478,-1.91713833199203,.91885558323625,.95856916599601],[.94597685600279,-1.88903307939452,-1.89195371200558,.89487434461664,.94597685600279]];function o(e,t,n,r,o,a){for(;0!=o--;)n[r]=1e-10+e[t+0]*a[0]-n[r-1]*a[1]+e[t-1]*a[2]-n[r-2]*a[3]+e[t-2]*a[4]-n[r-3]*a[5]+e[t-3]*a[6]-n[r-4]*a[7]+e[t-4]*a[8]-n[r-5]*a[9]+e[t-5]*a[10]-n[r-6]*a[11]+e[t-6]*a[12]-n[r-7]*a[13]+e[t-7]*a[14]-n[r-8]*a[15]+e[t-8]*a[16]-n[r-9]*a[17]+e[t-9]*a[18]-n[r-10]*a[19]+e[t-10]*a[20],++r,++t}function a(e,t,n,r,o,a){for(;0!=o--;)n[r]=e[t+0]*a[0]-n[r-1]*a[1]+e[t-1]*a[2]-n[r-2]*a[3]+e[t-2]*a[4],++r,++t}function i(e){return e*e}this.InitGainAnalysis=function(n,r){return function(n,r){for(var o=0;o<MAX_ORDER;o++)n.linprebuf[o]=n.lstepbuf[o]=n.loutbuf[o]=n.rinprebuf[o]=n.rstepbuf[o]=n.routbuf[o]=0;switch(0|r){case 48e3:n.reqindex=0;break;case 44100:n.reqindex=1;break;case 32e3:n.reqindex=2;break;case 24e3:n.reqindex=3;break;case 22050:n.reqindex=4;break;case 16e3:n.reqindex=5;break;case 12e3:n.reqindex=6;break;case 11025:n.reqindex=7;break;case 8e3:n.reqindex=8;break;default:return INIT_GAIN_ANALYSIS_ERROR}return n.sampleWindow=0|(r*e+t-1)/t,n.lsum=0,n.rsum=0,n.totsamp=0,ze.ill(n.A,0),INIT_GAIN_ANALYSIS_OK}(n,r)!=INIT_GAIN_ANALYSIS_OK?INIT_GAIN_ANALYSIS_ERROR:(n.linpre=MAX_ORDER,n.rinpre=MAX_ORDER,n.lstep=MAX_ORDER,n.rstep=MAX_ORDER,n.lout=MAX_ORDER,n.rout=MAX_ORDER,ze.fill(n.B,0),INIT_GAIN_ANALYSIS_OK)},this.AnalyzeSamples=function(e,t,s,l,u,c,d){var f,p,h,m,g,b,y;if(0==c)return GAIN_ANALYSIS_OK;switch(y=0,g=c,d){case 1:l=t,u=s;break;case 2:break;default:return GAIN_ANALYSIS_ERROR}for(c<MAX_ORDER?(_1.arraycopy(t,s,e.linprebuf,MAX_ORDER,c),_1.arraycopy(l,u,e.rinprebuf,MAX_ORDER,c)):(_1.arraycopy(t,s,e.linprebuf,MAX_ORDER,MAX_ORDER),_1.arraycopy(l,u,e.rinprebuf,MAX_ORDER,MAX_ORDER));g>0;){b=g>e.sampleWindow-e.totsamp?e.sampleWindow-e.totsamp:g,y<MAX_ORDER?(f=e.linpre+y,p=e.linprebuf,h=e.rinpre+y,m=e.rinprebuf,b>MAX_ORDER-y&&(b=MAX_ORDER-y)):(f=s+y,p=t,h=u+y,m=l),o(p,f,e.lstepbuf,e.lstep+e.totsamp,b,n[e.reqindex]),o(m,h,e.rstepbuf,e.rstep+e.totsamp,b,n[e.reqindex]),a(e.lstepbuf,e.lstep+e.totsamp,e.loutbuf,e.lout+e.totsamp,b,r[e.reqindex]),a(e.rstepbuf,e.rstep+e.totsamp,e.routbuf,e.rout+e.totsamp,b,r[e.reqindex]),f=e.lout+e.totsamp,p=e.loutbuf,h=e.rout+e.totsamp,m=e.routbuf;for(var _=b%8;0!=_--;)e.lsum+=i(p[f++]),e.rsum+=i(m[h++]);for(_=b/8;0!=_--;)e.lsum+=i(p[f+0])+i(p[f+1])+i(p[f+2])+i(p[f+3])+i(p[f+4])+i(p[f+5])+i(p[f+6])+i(p[f+7]),f+=8,e.rsum+=i(m[h+0])+i(m[h+1])+i(m[h+2])+i(m[h+3])+i(m[h+4])+i(m[h+5])+i(m[h+6])+i(m[h+7]),h+=8;if(g-=b,y+=b,e.totsamp+=b,e.totsamp==e.sampleWindow){var v=10*j0.STEPS_per_dB*Math.log10((e.lsum+e.rsum)/e.totsamp*.5+1e-37),w=v<=0?0:0|v;w>=e.A.length&&(w=e.A.length-1),e.A[w]++,e.lsum=e.rsum=0,_1.arraycopy(e.loutbuf,e.totsamp,e.loutbuf,0,MAX_ORDER),_1.arraycopy(e.routbuf,e.totsamp,e.routbuf,0,MAX_ORDER),_1.arraycopy(e.lstepbuf,e.totsamp,e.lstepbuf,0,MAX_ORDER),_1.arraycopy(e.rstepbuf,e.totsamp,e.rstepbuf,0,MAX_ORDER),e.totsamp=0}if(e.totsamp>e.sampleWindow)return GAIN_ANALYSIS_ERROR}return c<MAX_ORDER?(_1.arraycopy(e.linprebuf,c,e.linprebuf,0,MAX_ORDER-c),_1.arraycopy(e.rinprebuf,c,e.rinprebuf,0,MAX_ORDER-c),_1.arraycopy(t,s,e.linprebuf,MAX_ORDER-c,c),_1.arraycopy(l,u,e.rinprebuf,MAX_ORDER-c,c)):(_1.arraycopy(t,s+c-MAX_ORDER,e.linprebuf,0,MAX_ORDER),_1.arraycopy(l,u+c-MAX_ORDER,e.rinprebuf,0,MAX_ORDER)),GAIN_ANALYSIS_OK},this.GetTitleGain=function(e){for(var t=function(e,t){var n,r=0;for(n=0;n<t;n++)r+=e[n];if(0==r)return GAIN_NOT_ENOUGH_SAMPLES;var o=0|Math.ceil(r*(1-.95));for(n=t;n-- >0&&!((o-=e[n])<=0););return 64.82-n/j0.STEPS_per_dB}(e.A,e.A.length),n=0;n<e.A.length;n++)e.B[n]+=e.A[n],e.A[n]=0;for(n=0;n<MAX_ORDER;n++)e.linprebuf[n]=e.lstepbuf[n]=e.loutbuf[n]=e.rinprebuf[n]=e.rstepbuf[n]=e.routbuf[n]=0;return e.totsamp=0,e.lsum=e.rsum=0,t}}j0.STEPS_per_dB=100,j0.MAX_dB=120,j0.GAIN_NOT_ENOUGH_SAMPLES=-24601,j0.GAIN_ANALYSIS_ERROR=0,j0.GAIN_ANALYSIS_OK=1,j0.INIT_GAIN_ANALYSIS_ERROR=0,j0.INIT_GAIN_ANALYSIS_OK=1,j0.YULE_ORDER=10,j0.MAX_ORDER=j0.YULE_ORDER,j0.MAX_SAMP_FREQ=48e3,j0.RMS_WINDOW_TIME_NUMERATOR=1,j0.RMS_WINDOW_TIME_DENOMINATOR=20,j0.MAX_SAMPLES_PER_WINDOW=j0.MAX_SAMP_FREQ*j0.RMS_WINDOW_TIME_NUMERATOR/j0.RMS_WINDOW_TIME_DENOMINATOR+1;var Na=j0,pa=Q0,k1=pa.new_float,Je=pa.new_int,l1=Na;function M2(){this.linprebuf=k1(2*l1.MAX_ORDER),this.linpre=0,this.lstepbuf=k1(l1.MAX_SAMPLES_PER_WINDOW+l1.MAX_ORDER),this.lstep=0,this.loutbuf=k1(l1.MAX_SAMPLES_PER_WINDOW+l1.MAX_ORDER),this.lout=0,this.rinprebuf=k1(2*l1.MAX_ORDER),this.rinpre=0,this.rstepbuf=k1(l1.MAX_SAMPLES_PER_WINDOW+l1.MAX_ORDER),this.rstep=0,this.routbuf=k1(l1.MAX_SAMPLES_PER_WINDOW+l1.MAX_ORDER),this.rout=0,this.sampleWindow=0,this.totsamp=0,this.lsum=0,this.rsum=0,this.freqindex=0,this.first=0,this.A=Je(0|l1.STEPS_per_dB*l1.MAX_dB),this.B=Je(0|l1.STEPS_per_dB*l1.MAX_dB)}var E2=M2;function B2(e){this.bits=e}var Ha=B2,pe=Q0,ge=pe.new_float,T2=pe.new_int,ea=pe.assert,y2=Ha,aa=t1(),w2=ie,I2=ne;function L2(e){var t=e;this.quantize=t,this.iteration_loop=function(e,t,n,r){var o,a=e.internal_flags,i=ge(w2.SFBMAX),s=ge(576),l=T2(2),u=0,c=a.l3_side,d=new y2(u);this.quantize.rv.ResvFrameBegin(e,d),u=d.bits;for(var f=0;f<a.mode_gr;f++){o=this.quantize.qupvt.on_pe(e,t,l,u,f,f),a.mode_ext==aa.MPG_MD_MS_LR&&(this.quantize.ms_convert(a.l3_side,f),this.quantize.qupvt.reduce_side(l,n[f],u,o));for(var p=0;p<a.channels_out;p++){var h,m,g=c.tt[f][p];g.block_type!=aa.SHORT_TYPE?(h=0,m=a.PSY.mask_adjust-h):(h=0,m=a.PSY.mask_adjust_short-h),a.masking_lower=Math.pow(10,.1*m),this.quantize.init_outer_loop(a,g),this.quantize.init_xrpow(a,g,s)&&(this.quantize.qupvt.calc_xmin(e,r[f][p],g,i),this.quantize.outer_loop(e,g,i,s,p,l[p])),this.quantize.iteration_finish_one(a,f,p),ea(g.part2_3_length<=I2.MAX_BITS_PER_CHANNEL),ea(g.part2_3_length<=l[p])}}this.quantize.rv.ResvFrameEnd(a,u)}}var N2=L2;function q0(e,t,n,r){this.xlen=e,this.linmax=t,this.table=n,this.hlen=r}var o0={t1HB:[1,1,1,0],t2HB:[1,2,1,3,1,1,3,2,0],t3HB:[3,2,1,1,1,1,3,2,0],t5HB:[1,2,6,5,3,1,4,4,7,5,7,1,6,1,1,0],t6HB:[7,3,5,1,6,2,3,2,5,4,4,1,3,3,2,0],t7HB:[1,2,10,19,16,10,3,3,7,10,5,3,11,4,13,17,8,4,12,11,18,15,11,2,7,6,9,14,3,1,6,4,5,3,2,0],t8HB:[3,4,6,18,12,5,5,1,2,16,9,3,7,3,5,14,7,3,19,17,15,13,10,4,13,5,8,11,5,1,12,4,4,1,1,0],t9HB:[7,5,9,14,15,7,6,4,5,5,6,7,7,6,8,8,8,5,15,6,9,10,5,1,11,7,9,6,4,1,14,4,6,2,6,0],t10HB:[1,2,10,23,35,30,12,17,3,3,8,12,18,21,12,7,11,9,15,21,32,40,19,6,14,13,22,34,46,23,18,7,20,19,33,47,27,22,9,3,31,22,41,26,21,20,5,3,14,13,10,11,16,6,5,1,9,8,7,8,4,4,2,0],t11HB:[3,4,10,24,34,33,21,15,5,3,4,10,32,17,11,10,11,7,13,18,30,31,20,5,25,11,19,59,27,18,12,5,35,33,31,58,30,16,7,5,28,26,32,19,17,15,8,14,14,12,9,13,14,9,4,1,11,4,6,6,6,3,2,0],t12HB:[9,6,16,33,41,39,38,26,7,5,6,9,23,16,26,11,17,7,11,14,21,30,10,7,17,10,15,12,18,28,14,5,32,13,22,19,18,16,9,5,40,17,31,29,17,13,4,2,27,12,11,15,10,7,4,1,27,12,8,12,6,3,1,0],t13HB:[1,5,14,21,34,51,46,71,42,52,68,52,67,44,43,19,3,4,12,19,31,26,44,33,31,24,32,24,31,35,22,14,15,13,23,36,59,49,77,65,29,40,30,40,27,33,42,16,22,20,37,61,56,79,73,64,43,76,56,37,26,31,25,14,35,16,60,57,97,75,114,91,54,73,55,41,48,53,23,24,58,27,50,96,76,70,93,84,77,58,79,29,74,49,41,17,47,45,78,74,115,94,90,79,69,83,71,50,59,38,36,15,72,34,56,95,92,85,91,90,86,73,77,65,51,44,43,42,43,20,30,44,55,78,72,87,78,61,46,54,37,30,20,16,53,25,41,37,44,59,54,81,66,76,57,54,37,18,39,11,35,33,31,57,42,82,72,80,47,58,55,21,22,26,38,22,53,25,23,38,70,60,51,36,55,26,34,23,27,14,9,7,34,32,28,39,49,75,30,52,48,40,52,28,18,17,9,5,45,21,34,64,56,50,49,45,31,19,12,15,10,7,6,3,48,23,20,39,36,35,53,21,16,23,13,10,6,1,4,2,16,15,17,27,25,20,29,11,17,12,16,8,1,1,0,1],t15HB:[7,12,18,53,47,76,124,108,89,123,108,119,107,81,122,63,13,5,16,27,46,36,61,51,42,70,52,83,65,41,59,36,19,17,15,24,41,34,59,48,40,64,50,78,62,80,56,33,29,28,25,43,39,63,55,93,76,59,93,72,54,75,50,29,52,22,42,40,67,57,95,79,72,57,89,69,49,66,46,27,77,37,35,66,58,52,91,74,62,48,79,63,90,62,40,38,125,32,60,56,50,92,78,65,55,87,71,51,73,51,70,30,109,53,49,94,88,75,66,122,91,73,56,42,64,44,21,25,90,43,41,77,73,63,56,92,77,66,47,67,48,53,36,20,71,34,67,60,58,49,88,76,67,106,71,54,38,39,23,15,109,53,51,47,90,82,58,57,48,72,57,41,23,27,62,9,86,42,40,37,70,64,52,43,70,55,42,25,29,18,11,11,118,68,30,55,50,46,74,65,49,39,24,16,22,13,14,7,91,44,39,38,34,63,52,45,31,52,28,19,14,8,9,3,123,60,58,53,47,43,32,22,37,24,17,12,15,10,2,1,71,37,34,30,28,20,17,26,21,16,10,6,8,6,2,0],t16HB:[1,5,14,44,74,63,110,93,172,149,138,242,225,195,376,17,3,4,12,20,35,62,53,47,83,75,68,119,201,107,207,9,15,13,23,38,67,58,103,90,161,72,127,117,110,209,206,16,45,21,39,69,64,114,99,87,158,140,252,212,199,387,365,26,75,36,68,65,115,101,179,164,155,264,246,226,395,382,362,9,66,30,59,56,102,185,173,265,142,253,232,400,388,378,445,16,111,54,52,100,184,178,160,133,257,244,228,217,385,366,715,10,98,48,91,88,165,157,148,261,248,407,397,372,380,889,884,8,85,84,81,159,156,143,260,249,427,401,392,383,727,713,708,7,154,76,73,141,131,256,245,426,406,394,384,735,359,710,352,11,139,129,67,125,247,233,229,219,393,743,737,720,885,882,439,4,243,120,118,115,227,223,396,746,742,736,721,712,706,223,436,6,202,224,222,218,216,389,386,381,364,888,443,707,440,437,1728,4,747,211,210,208,370,379,734,723,714,1735,883,877,876,3459,865,2,377,369,102,187,726,722,358,711,709,866,1734,871,3458,870,434,0,12,10,7,11,10,17,11,9,13,12,10,7,5,3,1,3],t24HB:[15,13,46,80,146,262,248,434,426,669,653,649,621,517,1032,88,14,12,21,38,71,130,122,216,209,198,327,345,319,297,279,42,47,22,41,74,68,128,120,221,207,194,182,340,315,295,541,18,81,39,75,70,134,125,116,220,204,190,178,325,311,293,271,16,147,72,69,135,127,118,112,210,200,188,352,323,306,285,540,14,263,66,129,126,119,114,214,202,192,180,341,317,301,281,262,12,249,123,121,117,113,215,206,195,185,347,330,308,291,272,520,10,435,115,111,109,211,203,196,187,353,332,313,298,283,531,381,17,427,212,208,205,201,193,186,177,169,320,303,286,268,514,377,16,335,199,197,191,189,181,174,333,321,305,289,275,521,379,371,11,668,184,183,179,175,344,331,314,304,290,277,530,383,373,366,10,652,346,171,168,164,318,309,299,287,276,263,513,375,368,362,6,648,322,316,312,307,302,292,284,269,261,512,376,370,364,359,4,620,300,296,294,288,282,273,266,515,380,374,369,365,361,357,2,1033,280,278,274,267,264,259,382,378,372,367,363,360,358,356,0,43,20,19,17,15,13,11,9,7,6,4,7,5,3,1,3],t32HB:[1,10,8,20,12,20,16,32,14,12,24,0,28,16,24,16],t33HB:[15,28,26,48,22,40,36,64,14,24,20,32,12,16,8,0],t1l:[1,4,3,5],t2l:[1,4,7,4,5,7,6,7,8],t3l:[2,3,7,4,4,7,6,7,8],t5l:[1,4,7,8,4,5,8,9,7,8,9,10,8,8,9,10],t6l:[3,4,6,8,4,4,6,7,5,6,7,8,7,7,8,9],t7l:[1,4,7,9,9,10,4,6,8,9,9,10,7,7,9,10,10,11,8,9,10,11,11,11,8,9,10,11,11,12,9,10,11,12,12,12],t8l:[2,4,7,9,9,10,4,4,6,10,10,10,7,6,8,10,10,11,9,10,10,11,11,12,9,9,10,11,12,12,10,10,11,11,13,13],t9l:[3,4,6,7,9,10,4,5,6,7,8,10,5,6,7,8,9,10,7,7,8,9,9,10,8,8,9,9,10,11,9,9,10,10,11,11],t10l:[1,4,7,9,10,10,10,11,4,6,8,9,10,11,10,10,7,8,9,10,11,12,11,11,8,9,10,11,12,12,11,12,9,10,11,12,12,12,12,12,10,11,12,12,13,13,12,13,9,10,11,12,12,12,13,13,10,10,11,12,12,13,13,13],t11l:[2,4,6,8,9,10,9,10,4,5,6,8,10,10,9,10,6,7,8,9,10,11,10,10,8,8,9,11,10,12,10,11,9,10,10,11,11,12,11,12,9,10,11,12,12,13,12,13,9,9,9,10,11,12,12,12,9,9,10,11,12,12,12,12],t12l:[4,4,6,8,9,10,10,10,4,5,6,7,9,9,10,10,6,6,7,8,9,10,9,10,7,7,8,8,9,10,10,10,8,8,9,9,10,10,10,11,9,9,10,10,10,11,10,11,9,9,9,10,10,11,11,12,10,10,10,11,11,11,11,12],t13l:[1,5,7,8,9,10,10,11,10,11,12,12,13,13,14,14,4,6,8,9,10,10,11,11,11,11,12,12,13,14,14,14,7,8,9,10,11,11,12,12,11,12,12,13,13,14,15,15,8,9,10,11,11,12,12,12,12,13,13,13,13,14,15,15,9,9,11,11,12,12,13,13,12,13,13,14,14,15,15,16,10,10,11,12,12,12,13,13,13,13,14,13,15,15,16,16,10,11,12,12,13,13,13,13,13,14,14,14,15,15,16,16,11,11,12,13,13,13,14,14,14,14,15,15,15,16,18,18,10,10,11,12,12,13,13,14,14,14,14,15,15,16,17,17,11,11,12,12,13,13,13,15,14,15,15,16,16,16,18,17,11,12,12,13,13,14,14,15,14,15,16,15,16,17,18,19,12,12,12,13,14,14,14,14,15,15,15,16,17,17,17,18,12,13,13,14,14,15,14,15,16,16,17,17,17,18,18,18,13,13,14,15,15,15,16,16,16,16,16,17,18,17,18,18,14,14,14,15,15,15,17,16,16,19,17,17,17,19,18,18,13,14,15,16,16,16,17,16,17,17,18,18,21,20,21,18],t15l:[3,5,6,8,8,9,10,10,10,11,11,12,12,12,13,14,5,5,7,8,9,9,10,10,10,11,11,12,12,12,13,13,6,7,7,8,9,9,10,10,10,11,11,12,12,13,13,13,7,8,8,9,9,10,10,11,11,11,12,12,12,13,13,13,8,8,9,9,10,10,11,11,11,11,12,12,12,13,13,13,9,9,9,10,10,10,11,11,11,11,12,12,13,13,13,14,10,9,10,10,10,11,11,11,11,12,12,12,13,13,14,14,10,10,10,11,11,11,11,12,12,12,12,12,13,13,13,14,10,10,10,11,11,11,11,12,12,12,12,13,13,14,14,14,10,10,11,11,11,11,12,12,12,13,13,13,13,14,14,14,11,11,11,11,12,12,12,12,12,13,13,13,13,14,15,14,11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,15,12,12,11,12,12,12,13,13,13,13,13,13,14,14,15,15,12,12,12,12,12,13,13,13,13,14,14,14,14,14,15,15,13,13,13,13,13,13,13,13,14,14,14,14,15,15,14,15,13,13,13,13,13,13,13,14,14,14,14,14,15,15,15,15],t16_5l:[1,5,7,9,10,10,11,11,12,12,12,13,13,13,14,11,4,6,8,9,10,11,11,11,12,12,12,13,14,13,14,11,7,8,9,10,11,11,12,12,13,12,13,13,13,14,14,12,9,9,10,11,11,12,12,12,13,13,14,14,14,15,15,13,10,10,11,11,12,12,13,13,13,14,14,14,15,15,15,12,10,10,11,11,12,13,13,14,13,14,14,15,15,15,16,13,11,11,11,12,13,13,13,13,14,14,14,14,15,15,16,13,11,11,12,12,13,13,13,14,14,15,15,15,15,17,17,13,11,12,12,13,13,13,14,14,15,15,15,15,16,16,16,13,12,12,12,13,13,14,14,15,15,15,15,16,15,16,15,14,12,13,12,13,14,14,14,14,15,16,16,16,17,17,16,13,13,13,13,13,14,14,15,16,16,16,16,16,16,15,16,14,13,14,14,14,14,15,15,15,15,17,16,16,16,16,18,14,15,14,14,14,15,15,16,16,16,18,17,17,17,19,17,14,14,15,13,14,16,16,15,16,16,17,18,17,19,17,16,14,11,11,11,12,12,13,13,13,14,14,14,14,14,14,14,12],t16l:[1,5,7,9,10,10,11,11,12,12,12,13,13,13,14,10,4,6,8,9,10,11,11,11,12,12,12,13,14,13,14,10,7,8,9,10,11,11,12,12,13,12,13,13,13,14,14,11,9,9,10,11,11,12,12,12,13,13,14,14,14,15,15,12,10,10,11,11,12,12,13,13,13,14,14,14,15,15,15,11,10,10,11,11,12,13,13,14,13,14,14,15,15,15,16,12,11,11,11,12,13,13,13,13,14,14,14,14,15,15,16,12,11,11,12,12,13,13,13,14,14,15,15,15,15,17,17,12,11,12,12,13,13,13,14,14,15,15,15,15,16,16,16,12,12,12,12,13,13,14,14,15,15,15,15,16,15,16,15,13,12,13,12,13,14,14,14,14,15,16,16,16,17,17,16,12,13,13,13,13,14,14,15,16,16,16,16,16,16,15,16,13,13,14,14,14,14,15,15,15,15,17,16,16,16,16,18,13,15,14,14,14,15,15,16,16,16,18,17,17,17,19,17,13,14,15,13,14,16,16,15,16,16,17,18,17,19,17,16,13,10,10,10,11,11,12,12,12,13,13,13,13,13,13,13,10],t24l:[4,5,7,8,9,10,10,11,11,12,12,12,12,12,13,10,5,6,7,8,9,10,10,11,11,11,12,12,12,12,12,10,7,7,8,9,9,10,10,11,11,11,11,12,12,12,13,9,8,8,9,9,10,10,10,11,11,11,11,12,12,12,12,9,9,9,9,10,10,10,10,11,11,11,12,12,12,12,13,9,10,9,10,10,10,10,11,11,11,11,12,12,12,12,12,9,10,10,10,10,10,11,11,11,11,12,12,12,12,12,13,9,11,10,10,10,11,11,11,11,12,12,12,12,12,13,13,10,11,11,11,11,11,11,11,11,11,12,12,12,12,13,13,10,11,11,11,11,11,11,11,12,12,12,12,12,13,13,13,10,12,11,11,11,11,12,12,12,12,12,12,13,13,13,13,10,12,12,11,11,11,12,12,12,12,12,12,13,13,13,13,10,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,10,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,10,13,12,12,12,12,12,12,13,13,13,13,13,13,13,13,10,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,6],t32l:[1,5,5,7,5,8,7,9,5,7,7,9,7,9,9,10],t33l:[4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8]};o0.ht=[new q0(0,0,null,null),new q0(2,0,o0.t1HB,o0.t1l),new q0(3,0,o0.t2HB,o0.t2l),new q0(3,0,o0.t3HB,o0.t3l),new q0(0,0,null,null),new q0(4,0,o0.t5HB,o0.t5l),new q0(4,0,o0.t6HB,o0.t6l),new q0(6,0,o0.t7HB,o0.t7l),new q0(6,0,o0.t8HB,o0.t8l),new q0(6,0,o0.t9HB,o0.t9l),new q0(8,0,o0.t10HB,o0.t10l),new q0(8,0,o0.t11HB,o0.t11l),new q0(8,0,o0.t12HB,o0.t12l),new q0(16,0,o0.t13HB,o0.t13l),new q0(0,0,null,o0.t16_5l),new q0(16,0,o0.t15HB,o0.t15l),new q0(1,1,o0.t16HB,o0.t16l),new q0(2,3,o0.t16HB,o0.t16l),new q0(3,7,o0.t16HB,o0.t16l),new q0(4,15,o0.t16HB,o0.t16l),new q0(6,63,o0.t16HB,o0.t16l),new q0(8,255,o0.t16HB,o0.t16l),new q0(10,1023,o0.t16HB,o0.t16l),new q0(13,8191,o0.t16HB,o0.t16l),new q0(4,15,o0.t24HB,o0.t24l),new q0(5,31,o0.t24HB,o0.t24l),new q0(6,63,o0.t24HB,o0.t24l),new q0(7,127,o0.t24HB,o0.t24l),new q0(8,255,o0.t24HB,o0.t24l),new q0(9,511,o0.t24HB,o0.t24l),new q0(11,2047,o0.t24HB,o0.t24l),new q0(13,8191,o0.t24HB,o0.t24l),new q0(0,0,o0.t32HB,o0.t32l),new q0(0,0,o0.t33HB,o0.t33l)],o0.largetbl=[65540,327685,458759,589832,655369,655370,720906,720907,786443,786444,786444,851980,851980,851980,917517,655370,262149,393222,524295,589832,655369,720906,720906,720907,786443,786443,786444,851980,917516,851980,917516,655370,458759,524295,589832,655369,720905,720906,786442,786443,851979,786443,851979,851980,851980,917516,917517,720905,589832,589832,655369,720905,720906,786442,786442,786443,851979,851979,917515,917516,917516,983052,983052,786441,655369,655369,720905,720906,786442,786442,851978,851979,851979,917515,917516,917516,983052,983052,983053,720905,655370,655369,720906,720906,786442,851978,851979,917515,851979,917515,917516,983052,983052,983052,1048588,786441,720906,720906,720906,786442,851978,851979,851979,851979,917515,917516,917516,917516,983052,983052,1048589,786441,720907,720906,786442,786442,851979,851979,851979,917515,917516,983052,983052,983052,983052,1114125,1114125,786442,720907,786443,786443,851979,851979,851979,917515,917515,983051,983052,983052,983052,1048588,1048589,1048589,786442,786443,786443,786443,851979,851979,917515,917515,983052,983052,983052,983052,1048588,983053,1048589,983053,851978,786444,851979,786443,851979,917515,917516,917516,917516,983052,1048588,1048588,1048589,1114125,1114125,1048589,786442,851980,851980,851979,851979,917515,917516,983052,1048588,1048588,1048588,1048588,1048589,1048589,983053,1048589,851978,851980,917516,917516,917516,917516,983052,983052,983052,983052,1114124,1048589,1048589,1048589,1048589,1179661,851978,983052,917516,917516,917516,983052,983052,1048588,1048588,1048589,1179661,1114125,1114125,1114125,1245197,1114125,851978,917517,983052,851980,917516,1048588,1048588,983052,1048589,1048589,1114125,1179661,1114125,1245197,1114125,1048589,851978,655369,655369,655369,720905,720905,786441,786441,786441,851977,851977,851977,851978,851978,851978,851978,655366],o0.table23=[65538,262147,458759,262148,327684,458759,393222,458759,524296],o0.table56=[65539,262148,458758,524296,262148,327684,524294,589831,458757,524294,589831,655368,524295,524295,589832,655369],o0.bitrate_table=[[0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,-1],[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],[0,8,16,24,32,40,48,56,64,-1,-1,-1,-1,-1,-1,-1]],o0.samplerate_table=[[22050,24e3,16e3,-1],[44100,48e3,32e3,-1],[11025,12e3,8e3,-1]],o0.scfsi_band=[0,6,11,16,21];var He=o0,Me,ra,Ee,ta,Be,sa,Te,ia;function Va(){if(ra)return Me;ra=1;var e=Ia,t=Q0,n=t.VbrMode,r=t.Float,o=t.Util,a=t.new_float,i=t.new_int,s=t.assert,l=t1(),u=Ha,c=ne;function d(){var t=Ve(),f=null,p=null,h=null;function m(e){return s(0<=e+d.Q_MAX2&&e<d.Q_MAX),w[e+d.Q_MAX2]}this.setModules=function(e,t,n){f=e,p=t,h=n},this.IPOW20=function(e){return s(0<=e&&e<d.Q_MAX),S[e]};var g=2220446049250313e-31,b=d.IXMAX_VAL+2,y=d.Q_MAX,_=d.Q_MAX2;d.LARGE_BITS;this.nr_of_sfb_block=[[[6,5,5,5],[9,9,9,9],[6,9,9,9]],[[6,5,7,3],[9,9,12,6],[6,9,12,6]],[[11,10,0,0],[18,18,0,0],[15,18,0,0]],[[7,7,7,0],[12,12,12,0],[6,15,12,0]],[[6,6,6,3],[12,9,9,6],[6,12,9,6]],[[8,8,5,0],[15,12,9,0],[6,18,9,0]]];var v=[0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0];this.pretab=v,this.sfBandIndex=[new e([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,24,32,42,56,74,100,132,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new e([0,6,12,18,24,30,36,44,54,66,80,96,114,136,162,194,232,278,332,394,464,540,576],[0,4,8,12,18,26,36,48,62,80,104,136,180,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new e([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,26,36,48,62,80,104,134,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new e([0,4,8,12,16,20,24,30,36,44,52,62,74,90,110,134,162,196,238,288,342,418,576],[0,4,8,12,16,22,30,40,52,66,84,106,136,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new e([0,4,8,12,16,20,24,30,36,42,50,60,72,88,106,128,156,190,230,276,330,384,576],[0,4,8,12,16,22,28,38,50,64,80,100,126,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new e([0,4,8,12,16,20,24,30,36,44,54,66,82,102,126,156,194,240,296,364,448,550,576],[0,4,8,12,16,22,30,42,58,78,104,138,180,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new e([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,26,36,48,62,80,104,134,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new e([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,26,36,48,62,80,104,134,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new e([0,12,24,36,48,60,72,88,108,132,160,192,232,280,336,400,476,566,568,570,572,574,576],[0,8,16,24,36,52,72,96,124,160,162,164,166,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0])];var w=a(y+_+1),S=a(y),x=a(b),T=a(b);function E(e,t){var n=h.ATHformula(t,e);return n-=100,n=Math.pow(10,n/10+e.ATHlower)}function k(e){this.s=e}this.adj43=T,this.iteration_init=function(e){var t,n=e.internal_flags,o=n.l3_side;if(0==n.iteration_init_init){for(n.iteration_init_init=1,o.main_data_begin=0,function(e){for(var t=e.internal_flags.ATH.l,n=e.internal_flags.ATH.psfb21,o=e.internal_flags.ATH.s,a=e.internal_flags.ATH.psfb12,i=e.internal_flags,s=e.out_samplerate,u=0;u<l.SBMAX_l;u++){var c=i.scalefac_band.l[u],d=i.scalefac_band.l[u+1];t[u]=r.MAX_VALUE;for(var f=c;f<d;f++){var p=E(e,f*s/1152);t[u]=Math.min(t[u],p)}}for(u=0;u<l.PSFB21;u++)for(c=i.scalefac_band.psfb21[u],d=i.scalefac_band.psfb21[u+1],n[u]=r.MAX_VALUE,f=c;f<d;f++)p=E(e,f*s/1152),n[u]=Math.min(n[u],p);for(u=0;u<l.SBMAX_s;u++){for(c=i.scalefac_band.s[u],d=i.scalefac_band.s[u+1],o[u]=r.MAX_VALUE,f=c;f<d;f++)p=E(e,f*s/384),o[u]=Math.min(o[u],p);o[u]*=i.scalefac_band.s[u+1]-i.scalefac_band.s[u]}for(u=0;u<l.PSFB12;u++){for(c=i.scalefac_band.psfb12[u],d=i.scalefac_band.psfb12[u+1],a[u]=r.MAX_VALUE,f=c;f<d;f++)p=E(e,f*s/384),a[u]=Math.min(a[u],p);a[u]*=i.scalefac_band.s[13]-i.scalefac_band.s[12]}if(e.noATH){for(u=0;u<l.SBMAX_l;u++)t[u]=1e-20;for(u=0;u<l.PSFB21;u++)n[u]=1e-20;for(u=0;u<l.SBMAX_s;u++)o[u]=1e-20;for(u=0;u<l.PSFB12;u++)a[u]=1e-20}i.ATH.floor=10*Math.log10(E(e,-1))}(e),x[0]=0,t=1;t<b;t++)x[t]=Math.pow(t,4/3);for(t=0;t<b-1;t++)T[t]=t+1-Math.pow(.5*(x[t]+x[t+1]),.75);for(T[t]=.5,t=0;t<y;t++)S[t]=Math.pow(2,-.1875*(t-210));for(t=0;t<=y+_;t++)w[t]=Math.pow(2,.25*(t-210-_));var a,i,s,u;for(f.huffman_init(n),(t=e.exp_nspsytune>>2&63)>=32&&(t-=64),a=Math.pow(10,t/4/10),(t=e.exp_nspsytune>>8&63)>=32&&(t-=64),i=Math.pow(10,t/4/10),(t=e.exp_nspsytune>>14&63)>=32&&(t-=64),s=Math.pow(10,t/4/10),(t=e.exp_nspsytune>>20&63)>=32&&(t-=64),u=s*Math.pow(10,t/4/10),t=0;t<l.SBMAX_l;t++){c=t<=6?a:t<=13?i:t<=20?s:u,n.nsPsy.longfact[t]=c}for(t=0;t<l.SBMAX_s;t++){var c;c=t<=5?a:t<=10?i:t<=11?s:u,n.nsPsy.shortfact[t]=c}}},this.on_pe=function(e,t,n,r,o,a){var s,l,d=e.internal_flags,f=0,h=i(2),m=new u(f),g=p.ResvMaxBits(e,r,m,a),b=(f=m.bits)+g;for(b>c.MAX_BITS_PER_GRANULE&&(b=c.MAX_BITS_PER_GRANULE),s=0,l=0;l<d.channels_out;++l)n[l]=Math.min(c.MAX_BITS_PER_CHANNEL,f/d.channels_out),h[l]=0|n[l]*t[o][l]/700-n[l],h[l]>3*r/4&&(h[l]=3*r/4),h[l]<0&&(h[l]=0),h[l]+n[l]>c.MAX_BITS_PER_CHANNEL&&(h[l]=Math.max(0,c.MAX_BITS_PER_CHANNEL-n[l])),s+=h[l];if(s>g)for(l=0;l<d.channels_out;++l)h[l]=g*h[l]/s;for(l=0;l<d.channels_out;++l)n[l]+=h[l],g-=h[l];for(s=0,l=0;l<d.channels_out;++l)s+=n[l];if(s>c.MAX_BITS_PER_GRANULE){for(l=0;l<d.channels_out;++l)n[l]*=c.MAX_BITS_PER_GRANULE,n[l]/=s,n[l]}return b},this.reduce_side=function(e,t,n,r){s(e[0]+e[1]<=c.MAX_BITS_PER_GRANULE);var o=.33*(.5-t)/.5;o<0&&(o=0),o>.5&&(o=.5);var a=0|.5*o*(e[0]+e[1]);a>c.MAX_BITS_PER_CHANNEL-e[0]&&(a=c.MAX_BITS_PER_CHANNEL-e[0]),a<0&&(a=0),e[1]>=125&&(e[1]-a>125?(e[0]<n&&(e[0]+=a),e[1]-=a):(e[0]+=e[1]-125,e[1]=125)),(a=e[0]+e[1])>r&&(e[0]=r*e[0]/a,e[1]=r*e[1]/a),s(e[0]<=c.MAX_BITS_PER_CHANNEL),s(e[1]<=c.MAX_BITS_PER_CHANNEL),s(e[0]+e[1]<=c.MAX_BITS_PER_GRANULE)},this.athAdjust=function(e,t,n){var r=90.30873362,a=o.FAST_LOG10_X(t,10),i=e*e,s=0;return a-=n,i>1e-20&&(s=1+o.FAST_LOG10_X(i,10/r)),s<0&&(s=0),a*=s,a+=n+r-94.82444863,Math.pow(10,.1*a)},this.calc_xmin=function(e,r,o,a){var i,s=0,u=e.internal_flags,c=0,d=0,f=u.ATH,p=o.xr,h=e.VBR==n.vbr_mtrh?1:0,m=u.masking_lower;for((e.VBR==n.vbr_mtrh||e.VBR==n.vbr_mt)&&(m=1),i=0;i<o.psy_lmax;i++){T=(x=e.VBR==n.vbr_rh||e.VBR==n.vbr_mtrh?athAdjust(f.adjust,f.l[i],f.floor):f.adjust*f.l[i])/(v=o.width[i]),E=g,A=v>>1,O=0;do{O+=R=p[c]*p[c],E+=R<T?R:T,O+=$=p[++c]*p[c],E+=$<T?$:T,c++}while(--A>0);if(O>x&&d++,i==l.SBPSY_l)E<(P=x*u.nsPsy.longfact[i])&&(E=P);if(0!=h&&(x=E),!e.ATHonly)if((k=r.en.l[i])>0)P=O*r.thm.l[i]*m/k,0!=h&&(P*=u.nsPsy.longfact[i]),x<P&&(x=P);a[s++]=0!=h?x:x*u.nsPsy.longfact[i]}var b=575;if(o.block_type!=l.SHORT_TYPE)for(var y=576;0!=y--&&t.EQ(p[y],0);)b=y;o.max_nonzero_coeff=b;for(var _=o.sfb_smin;i<o.psymax;_++,i+=3){var v,w,S;for(S=e.VBR==n.vbr_rh||e.VBR==n.vbr_mtrh?athAdjust(f.adjust,f.s[_],f.floor):f.adjust*f.s[_],v=o.width[i],w=0;w<3;w++){var x,T,E,k,P,O=0,A=v>>1;T=S/v,E=g;do{var R,$;O+=R=p[c]*p[c],E+=R<T?R:T,O+=$=p[++c]*p[c],E+=$<T?$:T,c++}while(--A>0);if(O>S&&d++,_==l.SBPSY_s)E<(P=S*u.nsPsy.shortfact[_])&&(E=P);if(x=0!=h?E:S,!e.ATHonly&&!e.ATHshort)if((k=r.en.s[_][w])>0)P=O*r.thm.s[_][w]*m/k,0!=h&&(P*=u.nsPsy.shortfact[_]),x<P&&(x=P);a[s++]=0!=h?x:x*u.nsPsy.shortfact[_]}e.useTemporal&&(a[s-3]>a[s-3+1]&&(a[s-3+1]+=(a[s-3]-a[s-3+1])*u.decay),a[s-3+1]>a[s-3+2]&&(a[s-3+2]+=(a[s-3+1]-a[s-3+2])*u.decay))}return d},this.calc_noise_core=function(e,t,n,r){var o=0,i=t.s,s=e.l3_enc;if(i>e.count1)for(;0!=n--;){u=e.xr[i],i++,o+=u*u,u=e.xr[i],i++,o+=u*u}else if(i>e.big_values){var l=a(2);for(l[0]=0,l[1]=r;0!=n--;){u=Math.abs(e.xr[i])-l[s[i]],i++,o+=u*u,u=Math.abs(e.xr[i])-l[s[i]],i++,o+=u*u}}else for(;0!=n--;){var u;u=Math.abs(e.xr[i])-x[s[i]]*r,i++,o+=u*u,u=Math.abs(e.xr[i])-x[s[i]]*r,i++,o+=u*u}return t.s=i,o},this.calc_noise=function(e,t,n,r,a){var i,s,l=0,u=0,c=0,d=0,f=0,p=-20,h=0,g=e.scalefac,b=0;for(r.over_SSD=0,i=0;i<e.psymax;i++){var y,_=e.global_gain-(g[b++]+(0!=e.preflag?v[i]:0)<<e.scalefac_scale+1)-8*e.subblock_gain[e.window[i]],w=0;if(null!=a&&a.step[i]==_)w=a.noise[i],h+=e.width[i],n[l++]=w/t[u++],w=a.noise_log[i];else{var S,x=m(_);if(s=e.width[i]>>1,h+e.width[i]>e.max_nonzero_coeff)s=(S=e.max_nonzero_coeff-h+1)>0?S>>1:0;var T=new k(h);w=this.calc_noise_core(e,T,s,x),h=T.s,null!=a&&(a.step[i]=_,a.noise[i]=w),w=n[l++]=w/t[u++],w=o.FAST_LOG10(Math.max(w,1e-20)),null!=a&&(a.noise_log[i]=w)}if(null!=a&&(a.global_gain=e.global_gain),f+=w,w>0)y=Math.max(0|10*w+.5,1),r.over_SSD+=y*y,c++,d+=w;p=Math.max(p,w)}return r.over_count=c,r.tot_noise=f,r.over_noise=d,r.max_noise=p,c},this.set_pinfo=function(e,t,n,r,o){var i,u,c,d,f,p=e.internal_flags,h=0==t.scalefac_scale?.5:1,m=t.scalefac,g=a(L3Side.SFBMAX),b=a(L3Side.SFBMAX),y=new CalcNoiseResult;calc_xmin(e,n,t,g),calc_noise(t,g,b,y,null);var _=0;for(u=t.sfb_lmax,t.block_type!=l.SHORT_TYPE&&0==t.mixed_block_flag&&(u=22),i=0;i<u;i++){var w=p.scalefac_band.l[i],S=(x=p.scalefac_band.l[i+1])-w;for(d=0;_<x;_++)d+=t.xr[_]*t.xr[_];d/=S,f=1e15,p.pinfo.en[r][o][i]=f*d,p.pinfo.xfsf[r][o][i]=f*g[i]*b[i]/S,n.en.l[i]>0&&!e.ATHonly?d/=n.en.l[i]:d=0,p.pinfo.thr[r][o][i]=f*Math.max(d*n.thm.l[i],p.ATH.l[i]),p.pinfo.LAMEsfb[r][o][i]=0,0!=t.preflag&&i>=11&&(p.pinfo.LAMEsfb[r][o][i]=-h*v[i]),i<l.SBPSY_l&&(s(m[i]>=0),p.pinfo.LAMEsfb[r][o][i]-=h*m[i])}if(t.block_type==l.SHORT_TYPE)for(u=i,i=t.sfb_smin;i<l.SBMAX_s;i++){w=p.scalefac_band.s[i],S=(x=p.scalefac_band.s[i+1])-w;for(var x,T=0;T<3;T++){for(d=0,c=w;c<x;c++)d+=t.xr[_]*t.xr[_],_++;d=Math.max(d/S,1e-20),f=1e15,p.pinfo.en_s[r][o][3*i+T]=f*d,p.pinfo.xfsf_s[r][o][3*i+T]=f*g[u]*b[u]/S,n.en.s[i][T]>0?d/=n.en.s[i][T]:d=0,(e.ATHonly||e.ATHshort)&&(d=0),p.pinfo.thr_s[r][o][3*i+T]=f*Math.max(d*n.thm.s[i][T],p.ATH.s[i]),p.pinfo.LAMEsfb_s[r][o][3*i+T]=-2*t.subblock_gain[T],i<l.SBPSY_s&&(p.pinfo.LAMEsfb_s[r][o][3*i+T]-=h*m[u]),u++}}p.pinfo.LAMEqss[r][o]=t.global_gain,p.pinfo.LAMEmainbits[r][o]=t.part2_3_length+t.part2_length,p.pinfo.LAMEsfbits[r][o]=t.part2_length,p.pinfo.over[r][o]=y.over_count,p.pinfo.max_noise[r][o]=10*y.max_noise,p.pinfo.over_noise[r][o]=10*y.over_noise,p.pinfo.tot_noise[r][o]=10*y.tot_noise,p.pinfo.over_SSD[r][o]=y.over_SSD}}return d.Q_MAX=257,d.Q_MAX2=116,d.LARGE_BITS=1e5,d.IXMAX_VAL=8206,Me=d}function Oa(){if(ta)return Ee;ta=1;var e=Q0,t=e.System,n=e.Arrays,r=e.new_int,o=e.assert,a=t1(),i=He,s=Le,l=Va();return Ee=function e(){var u=null;function c(e){this.bits=0|e}this.qupvt=null,this.setModules=function(e){this.qupvt=e,u=e};var d=[[0,0],[0,0],[0,0],[0,0],[0,0],[0,1],[1,1],[1,1],[1,2],[2,2],[2,3],[2,3],[3,4],[3,4],[3,4],[4,5],[4,5],[4,6],[5,6],[5,6],[5,7],[6,7],[6,7]];function f(e,t,n,r,o,a){var i=.5946/t;for(e>>=1;0!=e--;)o[a++]=i>n[r++]?0:1,o[a++]=i>n[r++]?0:1}function p(e,t,n,r,o,a){var i=(e>>=1)%2;for(e>>=1;0!=e--;){var s,l,c,d,f,p,h,m;s=n[r++]*t,l=n[r++]*t,f=0|s,c=n[r++]*t,p=0|l,d=n[r++]*t,h=0|c,s+=u.adj43[f],m=0|d,l+=u.adj43[p],o[a++]=0|s,c+=u.adj43[h],o[a++]=0|l,d+=u.adj43[m],o[a++]=0|c,o[a++]=0|d}0!=i&&(f=0|(s=n[r++]*t),p=0|(l=n[r++]*t),s+=u.adj43[f],l+=u.adj43[p],o[a++]=0|s,o[a++]=0|l)}var h=[1,2,5,7,7,10,10,13,13,13,13,13,13,13,13];function m(e,t,n,r){var o=function(e,t,n){var r=0,o=0;do{var a=e[t++],i=e[t++];r<a&&(r=a),o<i&&(o=i)}while(t<n);return r<o&&(r=o),r}(e,t,n);switch(o){case 0:return o;case 1:return function(e,t,n,r){var o=0,a=i.ht[1].hlen;do{var s=2*e[t+0]+e[t+1];t+=2,o+=a[s]}while(t<n);return r.bits+=o,1}(e,t,n,r);case 2:case 3:return function(e,t,n,r,o){var a,s,l=0,u=i.ht[r].xlen;s=2==r?i.table23:i.table56;do{var c=e[t+0]*u+e[t+1];t+=2,l+=s[c]}while(t<n);return a=65535&l,(l>>=16)>a&&(l=a,r++),o.bits+=l,r}(e,t,n,h[o-1],r);case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return function(e,t,n,r,o){var a=0,s=0,l=0,u=i.ht[r].xlen,c=i.ht[r].hlen,d=i.ht[r+1].hlen,f=i.ht[r+2].hlen;do{var p=e[t+0]*u+e[t+1];t+=2,a+=c[p],s+=d[p],l+=f[p]}while(t<n);var h=r;return a>s&&(a=s,h++),a>l&&(a=l,h=r+2),o.bits+=a,h}(e,t,n,h[o-1],r);default:if(o>l.IXMAX_VAL)return r.bits=l.LARGE_BITS,-1;var a,s;for(o-=15,a=24;a<32&&!(i.ht[a].linmax>=o);a++);for(s=a-8;s<24&&!(i.ht[s].linmax>=o);s++);return function(e,t,n,r,o,a){var s,l=65536*i.ht[r].xlen+i.ht[o].xlen,u=0;do{var c=e[t++],d=e[t++];0!=c&&(c>14&&(c=15,u+=l),c*=16),0!=d&&(d>14&&(d=15,u+=l),c+=d),u+=i.largetbl[c]}while(t<n);return s=65535&u,(u>>=16)>s&&(u=s,r=o),a.bits+=u,r}(e,t,n,s,a,r)}}function g(e,t,n,r,o,i,s,l){for(var u=t.big_values,d=2;d<a.SBMAX_l+1;d++){var f=e.scalefac_band.l[d];if(f>=u)break;var p=o[d-2]+t.count1bits;if(n.part2_3_length<=p)break;var h=new c(p),g=m(r,f,u,h);p=h.bits,!(n.part2_3_length<=p)&&(n.assign(t),n.part2_3_length=p,n.region0_count=i[d-2],n.region1_count=d-2-i[d-2],n.table_select[0]=s[d-2],n.table_select[1]=l[d-2],n.table_select[2]=g)}}this.noquant_count_bits=function(e,t,n){var r=t.l3_enc,s=Math.min(576,t.max_nonzero_coeff+2>>1<<1);for(null!=n&&(n.sfb_count1=0);s>1&&!(r[s-1]|r[s-2]);s-=2);t.count1=s;for(var l=0,u=0;s>3;s-=4){var d;if((2147483647&(r[s-1]|r[s-2]|r[s-3]|r[s-4]))>1)break;d=2*(2*(2*r[s-4]+r[s-3])+r[s-2])+r[s-1],l+=i.t32l[d],u+=i.t33l[d]}var f=l;if(t.count1table_select=0,l>u&&(f=u,t.count1table_select=1),t.count1bits=f,t.big_values=s,0==s)return f;if(t.block_type==a.SHORT_TYPE)(l=3*e.scalefac_band.s[3])>t.big_values&&(l=t.big_values),u=t.big_values;else if(t.block_type==a.NORM_TYPE){if(l=t.region0_count=e.bv_scf[s-2],u=t.region1_count=e.bv_scf[s-1],o(l+u+2<a.SBPSY_l),u=e.scalefac_band.l[l+u+2],l=e.scalefac_band.l[l+1],u<s){var p=new c(f);t.table_select[2]=m(r,u,s,p),f=p.bits}}else t.region0_count=7,t.region1_count=a.SBMAX_l-1-7-1,(l=e.scalefac_band.l[8])>(u=s)&&(l=u);if(l=Math.min(l,s),u=Math.min(u,s),0<l){p=new c(f);t.table_select[0]=m(r,0,l,p),f=p.bits}if(l<u){p=new c(f);t.table_select[1]=m(r,l,u,p),f=p.bits}if(2==e.use_best_huffman&&(t.part2_3_length=f,best_huffman_divide(e,t),f=t.part2_3_length),null!=n&&t.block_type==a.NORM_TYPE){for(var h=0;e.scalefac_band.l[h]<t.big_values;)h++;n.sfb_count1=h}return f},this.count_bits=function(e,t,r,i){var s=r.l3_enc,c=l.IXMAX_VAL/u.IPOW20(r.global_gain);if(r.xrpow_max>c)return l.LARGE_BITS;if(function(e,t,r,i,s){var l,c,d,h=0,m=0,g=0,b=0,y=t,_=0,v=y,w=0,S=e,x=0;for(d=null!=s&&i.global_gain==s.global_gain,c=i.block_type==a.SHORT_TYPE?38:21,l=0;l<=c;l++){var T=-1;if((d||i.block_type==a.NORM_TYPE)&&(T=i.global_gain-(i.scalefac[l]+(0!=i.preflag?u.pretab[l]:0)<<i.scalefac_scale+1)-8*i.subblock_gain[i.window[l]]),o(i.width[l]>=0),d&&s.step[l]==T)0!=m&&(p(m,r,S,x,v,w),m=0),0!=g&&(f(g,r,S,x,v,w),g=0);else{var E,k=i.width[l];if(h+i.width[l]>i.max_nonzero_coeff&&(E=i.max_nonzero_coeff-h+1,n.fill(t,i.max_nonzero_coeff,576,0),(k=E)<0&&(k=0),l=c+1),0==m&&0==g&&(v=y,w=_,S=e,x=b),null!=s&&s.sfb_count1>0&&l>=s.sfb_count1&&s.step[l]>0&&T>=s.step[l]?(0!=m&&(p(m,r,S,x,v,w),m=0,v=y,w=_,S=e,x=b),g+=k):(0!=g&&(f(g,r,S,x,v,w),g=0,v=y,w=_,S=e,x=b),m+=k),k<=0){0!=g&&(f(g,r,S,x,v,w),g=0),0!=m&&(p(m,r,S,x,v,w),m=0);break}}l<=c&&(_+=i.width[l],b+=i.width[l],h+=i.width[l])}0!=m&&(p(m,r,S,x,v,w),m=0),0!=g&&(f(g,r,S,x,v,w),g=0)}(t,s,u.IPOW20(r.global_gain),r,i),2&e.substep_shaping)for(var d=0,h=r.global_gain+r.scalefac_scale,m=.634521682242439/u.IPOW20(h),g=0;g<r.sfbmax;g++){var b,y=r.width[g];if(0==e.pseudohalf[g])d+=y;else for(b=d,d+=y;b<d;++b)s[b]=t[b]>=m?s[b]:0}return this.noquant_count_bits(e,r,i)},this.best_huffman_divide=function(e,t){var n=new s,o=t.l3_enc,u=r(23),d=r(23),f=r(23),p=r(23);if(t.block_type!=a.SHORT_TYPE||1!=e.mode_gr){n.assign(t),t.block_type==a.NORM_TYPE&&(function(e,t,n,r,o,a,i){for(var s=t.big_values,u=0;u<=22;u++)r[u]=l.LARGE_BITS;for(u=0;u<16;u++){var d=e.scalefac_band.l[u+1];if(d>=s)break;var f=0,p=new c(f),h=m(n,0,d,p);f=p.bits;for(var g=0;g<8;g++){var b=e.scalefac_band.l[u+g+2];if(b>=s)break;var y=f,_=m(n,d,b,p=new c(y));y=p.bits,r[u+g]>y&&(r[u+g]=y,o[u+g]=u,a[u+g]=h,i[u+g]=_)}}}(e,t,o,u,d,f,p),g(e,n,t,o,u,d,f,p));var h=n.big_values;if(!(0==h||(o[h-2]|o[h-1])>1||(h=t.count1+2,h>576))){n.assign(t),n.count1=h;for(var b=0,y=0;h>n.big_values;h-=4){var _=2*(2*(2*o[h-4]+o[h-3])+o[h-2])+o[h-1];b+=i.t32l[_],y+=i.t33l[_]}if(n.big_values=h,n.count1table_select=0,b>y&&(b=y,n.count1table_select=1),n.count1bits=b,n.block_type==a.NORM_TYPE)g(e,n,t,o,u,d,f,p);else{if(n.part2_3_length=b,(b=e.scalefac_band.l[8])>h&&(b=h),b>0){var v=new c(n.part2_3_length);n.table_select[0]=m(o,0,b,v),n.part2_3_length=v.bits}if(h>b){v=new c(n.part2_3_length);n.table_select[1]=m(o,b,h,v),n.part2_3_length=v.bits}t.part2_3_length>n.part2_3_length&&t.assign(n)}}}};var b=[1,1,1,1,8,2,2,2,4,4,4,8,8,8,16,16],y=[1,2,4,8,1,2,4,8,2,4,8,2,4,8,4,8],_=[0,0,0,0,3,1,1,1,2,2,2,3,3,3,4,4],v=[0,1,2,3,0,1,2,3,1,2,3,1,2,3,2,3];e.slen1_tab=_,e.slen2_tab=v,this.best_scalefac_store=function(e,t,n,r){var o,s,l,c,d=r.tt[t][n],f=0;for(l=0,o=0;o<d.sfbmax;o++){var p=d.width[o];for(l+=p,c=-p;c<0&&0==d.l3_enc[c+l];c++);0==c&&(d.scalefac[o]=f=-2)}if(0==d.scalefac_scale&&0==d.preflag){var h=0;for(o=0;o<d.sfbmax;o++)d.scalefac[o]>0&&(h|=d.scalefac[o]);if(!(1&h)&&0!=h){for(o=0;o<d.sfbmax;o++)d.scalefac[o]>0&&(d.scalefac[o]>>=1);d.scalefac_scale=f=1}}if(0==d.preflag&&d.block_type!=a.SHORT_TYPE&&2==e.mode_gr){for(o=11;o<a.SBPSY_l&&!(d.scalefac[o]<u.pretab[o]&&-2!=d.scalefac[o]);o++);if(o==a.SBPSY_l){for(o=11;o<a.SBPSY_l;o++)d.scalefac[o]>0&&(d.scalefac[o]-=u.pretab[o]);d.preflag=f=1}}for(s=0;s<4;s++)r.scfsi[n][s]=0;for(2==e.mode_gr&&1==t&&r.tt[0][n].block_type!=a.SHORT_TYPE&&r.tt[1][n].block_type!=a.SHORT_TYPE&&(function(e,t){for(var n,r=t.tt[1][e],o=t.tt[0][e],s=0;s<i.scfsi_band.length-1;s++){for(n=i.scfsi_band[s];n<i.scfsi_band[s+1]&&!(o.scalefac[n]!=r.scalefac[n]&&r.scalefac[n]>=0);n++);if(n==i.scfsi_band[s+1]){for(n=i.scfsi_band[s];n<i.scfsi_band[s+1];n++)r.scalefac[n]=-1;t.scfsi[e][s]=1}}var l=0,u=0;for(n=0;n<11;n++)-1!=r.scalefac[n]&&(u++,l<r.scalefac[n]&&(l=r.scalefac[n]));for(var c=0,d=0;n<a.SBPSY_l;n++)-1!=r.scalefac[n]&&(d++,c<r.scalefac[n]&&(c=r.scalefac[n]));for(s=0;s<16;s++)if(l<b[s]&&c<y[s]){var f=_[s]*u+v[s]*d;r.part2_length>f&&(r.part2_length=f,r.scalefac_compress=s)}}(n,r),f=0),o=0;o<d.sfbmax;o++)-2==d.scalefac[o]&&(d.scalefac[o]=0);0!=f&&(2==e.mode_gr?this.scale_bitcount(d):this.scale_bitcount_lsf(e,d))};var w=[0,18,36,54,54,36,54,72,54,72,90,72,90,108,108,126],S=[0,18,36,54,51,35,53,71,52,70,88,69,87,105,104,122],x=[0,10,20,30,33,21,31,41,32,42,52,43,53,63,64,74];this.scale_bitcount=function(e){var t,n,r,i=0,s=0,c=e.scalefac;if(o(function(e,t){for(var n=0;n<t;++n)if(e[n]<0)return!1;return!0}(c,e.sfbmax)),e.block_type==a.SHORT_TYPE)r=w,0!=e.mixed_block_flag&&(r=S);else if(r=x,0==e.preflag){for(n=11;n<a.SBPSY_l&&!(c[n]<u.pretab[n]);n++);if(n==a.SBPSY_l)for(e.preflag=1,n=11;n<a.SBPSY_l;n++)c[n]-=u.pretab[n]}for(n=0;n<e.sfbdivide;n++)i<c[n]&&(i=c[n]);for(;n<e.sfbmax;n++)s<c[n]&&(s=c[n]);for(e.part2_length=l.LARGE_BITS,t=0;t<16;t++)i<b[t]&&s<y[t]&&e.part2_length>r[t]&&(e.part2_length=r[t],e.scalefac_compress=t);return e.part2_length==l.LARGE_BITS};var T=[[15,15,7,7],[15,15,7,0],[7,3,0,0],[15,31,31,0],[7,7,7,0],[3,3,0,0]];this.scale_bitcount_lsf=function(e,n){var i,s,l,c,d,f,p,h,m=r(4),g=n.scalefac;for(i=0!=n.preflag?2:0,p=0;p<4;p++)m[p]=0;if(n.block_type==a.SHORT_TYPE){s=1;var b=u.nr_of_sfb_block[i][s];for(h=0,l=0;l<4;l++)for(c=b[l]/3,p=0;p<c;p++,h++)for(d=0;d<3;d++)g[3*h+d]>m[l]&&(m[l]=g[3*h+d])}else{s=0;b=u.nr_of_sfb_block[i][s];for(h=0,l=0;l<4;l++)for(c=b[l],p=0;p<c;p++,h++)g[h]>m[l]&&(m[l]=g[h])}for(f=!1,l=0;l<4;l++)m[l]>T[i][l]&&(f=!0);if(!f){var y,_,v,w;for(n.sfb_partition_table=u.nr_of_sfb_block[i][s],l=0;l<4;l++)n.slen[l]=E[m[l]];switch(y=n.slen[0],_=n.slen[1],v=n.slen[2],w=n.slen[3],i){case 0:n.scalefac_compress=(5*y+_<<4)+(v<<2)+w;break;case 1:n.scalefac_compress=400+(5*y+_<<2)+v;break;case 2:n.scalefac_compress=500+3*y+_;break;default:t.err.printf("intensity stereo not implemented yet\n")}}if(!f)for(o(null!=n.sfb_partition_table),n.part2_length=0,l=0;l<4;l++)n.part2_length+=n.slen[l]*n.sfb_partition_table[l];return f};var E=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];this.huffman_init=function(e){for(var t=2;t<=576;t+=2){for(var n,r=0;e.scalefac_band.l[++r]<t;);for(n=d[r][0];e.scalefac_band.l[n+1]>t;)n--;for(n<0&&(n=d[r][0]),e.bv_scf[t-2]=n,n=d[r][1];e.scalefac_band.l[n+e.bv_scf[t-2]+2]>t;)n--;n<0&&(n=d[r][1]),e.bv_scf[t-1]=n}}},Ee}function Ve(){if(sa)return Be;sa=1;var e=Q0,t=e.System,n=e.Arrays,r=e.new_byte,o=e.new_float_n,a=e.new_int,i=e.assert,s=Oa(),l=He,u=t1(),c=ne;function d(){var e=Oe(),d=this,f=null,p=null,h=null,m=null;this.setModules=function(e,t,n,r){f=e,p=t,h=n,m=r};var g=null,b=0,y=0,_=0;function v(e){t.arraycopy(e.header[e.w_ptr].buf,0,g,y,e.sideinfo_len),y+=e.sideinfo_len,b+=8*e.sideinfo_len,e.w_ptr=e.w_ptr+1&c.MAX_HEADER_BUF-1}function w(t,n,r){for(;r>0;){var o;0==_&&(_=8,y++,i(y<e.LAME_MAXMP3BUFFER),i(t.header[t.w_ptr].write_timing>=b),t.header[t.w_ptr].write_timing==b&&v(t),g[y]=0),r-=o=Math.min(r,_),_-=o,g[y]|=n>>r<<_,b+=o}}function S(t,n,r){for(;r>0;){var o;0==_&&(_=8,y++,i(y<e.LAME_MAXMP3BUFFER),g[y]=0),r-=o=Math.min(r,_),_-=o,g[y]|=n>>r<<_,b+=o}}function x(e,t){var n,r=e.internal_flags;if(t>=8&&(w(r,76,8),t-=8),t>=8&&(w(r,65,8),t-=8),t>=8&&(w(r,77,8),t-=8),t>=8&&(w(r,69,8),t-=8),t>=32){var o=h.getLameShortVersion();if(t>=32)for(n=0;n<o.length&&t>=8;++n)t-=8,w(r,o.charAt(n),8)}for(;t>=1;t-=1)w(r,r.ancillary_flag,1),r.ancillary_flag^=e.disable_reservoir?0:1}function T(e,t,n){for(var r=e.header[e.h_ptr].ptr;n>0;){var o=Math.min(n,8-(7&r));n-=o,e.header[e.h_ptr].buf[r>>3]|=t>>n<<8-(7&r)-o,r+=o}e.header[e.h_ptr].ptr=r}function E(e,t){e<<=8;for(var n=0;n<8;n++)65536&((t<<=1)^(e<<=1))&&(t^=32773);return t}function k(e,t){var n,r=l.ht[t.count1table_select+32],o=0,a=t.big_values,s=t.big_values;for(i(t.count1table_select<2),n=(t.count1-t.big_values)/4;n>0;--n){var u=0,c=0;0!=t.l3_enc[a+0]&&(c+=8,t.xr[s+0]<0&&u++),0!=t.l3_enc[a+1]&&(c+=4,u*=2,t.xr[s+1]<0&&u++),0!=t.l3_enc[a+2]&&(c+=2,u*=2,t.xr[s+2]<0&&u++),0!=t.l3_enc[a+3]&&(c++,u*=2,t.xr[s+3]<0&&u++),a+=4,s+=4,w(e,u+r.table[c],r.hlen[c]),o+=r.hlen[c]}return o}function P(e,t,n,r,o){var a=l.ht[t],s=0;if(0==t)return s;for(var u=n;u<r;u+=2){var c=0,d=0,f=a.xlen,p=a.xlen,h=0,m=o.l3_enc[u],g=o.l3_enc[u+1];if(0!=m&&(o.xr[u]<0&&h++,c--),t>15){if(m>14){var b=m-15;i(b<=a.linmax),h|=b<<1,d=f,m=15}if(g>14){var y=g-15;i(y<=a.linmax),h<<=f,h|=y,d+=f,g=15}p=16}0!=g&&(h<<=1,o.xr[u+1]<0&&h++,c--),m=m*p+g,d-=c,c+=a.hlen[m],w(e,a.table[m],c),w(e,h,d),s+=c+d}return s}function O(e,t){var n=3*e.scalefac_band.s[3];n>t.big_values&&(n=t.big_values);var r=P(e,t.table_select[0],0,n,t);return r+=P(e,t.table_select[1],n,t.big_values,t)}function A(e,t){var n,r,o,a;n=t.big_values;var s=t.region0_count+1;return i(s<e.scalefac_band.l.length),o=e.scalefac_band.l[s],s+=t.region1_count+1,i(s<e.scalefac_band.l.length),o>n&&(o=n),(a=e.scalefac_band.l[s])>n&&(a=n),r=P(e,t.table_select[0],0,o,t),r+=P(e,t.table_select[1],o,a,t),r+=P(e,t.table_select[2],a,n,t)}function R(){this.total=0}function $(e,n){var r,o,a,i,s,l=e.internal_flags;return s=l.w_ptr,-1==(i=l.h_ptr-1)&&(i=c.MAX_HEADER_BUF-1),r=l.header[i].write_timing-b,n.total=r,r>=0&&(o=1+i-s,i<s&&(o=1+i-s+c.MAX_HEADER_BUF),r-=8*o*l.sideinfo_len),r+=a=d.getframebits(e),n.total+=a,n.total%8!=0?n.total=1+n.total/8:n.total=n.total/8,n.total+=y+1,r<0&&t.err.println("strange error flushing buffer ... \n"),r}this.getframebits=function(e){var t,n=e.internal_flags;return t=0!=n.bitrate_index?l.bitrate_table[e.version][n.bitrate_index]:e.brate,8*(0|72e3*(e.version+1)*t/e.out_samplerate+n.padding)},this.CRC_writeheader=function(e,t){var n=65535;n=E(255&t[2],n),n=E(255&t[3],n);for(var r=6;r<e.sideinfo_len;r++)n=E(255&t[r],n);t[4]=byte(n>>8),t[5]=byte(255&n)},this.flush_bitstream=function(e){var t,n,r=e.internal_flags,o=r.h_ptr-1;if(-1==o&&(o=c.MAX_HEADER_BUF-1),t=r.l3_side,!((n=$(e,new R))<0)){if(x(e,n),i(r.header[o].write_timing+this.getframebits(e)==b),r.ResvSize=0,t.main_data_begin=0,r.findReplayGain){var a=f.GetTitleGain(r.rgdata);i(NEQ(a,GainAnalysis.GAIN_NOT_ENOUGH_SAMPLES)),r.RadioGain=0|Math.floor(10*a+.5)}r.findPeakSample&&(r.noclipGainChange=0|Math.ceil(20*Math.log10(r.PeakSample/32767)*10),r.noclipGainChange>0&&(EQ(e.scale,1)||EQ(e.scale,0))?r.noclipScale=Math.floor(32767/r.PeakSample*100)/100:r.noclipScale=-1)}},this.add_dummy_byte=function(e,t,n){for(var r,o=e.internal_flags;n-- >0;)for(S(0,t,8),r=0;r<c.MAX_HEADER_BUF;++r)o.header[r].write_timing+=8},this.format_bitstream=function(e){var r,o=e.internal_flags;r=o.l3_side;var a=this.getframebits(e);x(e,r.resvDrain_pre),function(e,r){var o,a,s,l=e.internal_flags;if(o=l.l3_side,l.header[l.h_ptr].ptr=0,n.fill(l.header[l.h_ptr].buf,0,l.sideinfo_len,0),e.out_samplerate<16e3?T(l,4094,12):T(l,4095,12),T(l,e.version,1),T(l,1,2),T(l,e.error_protection?0:1,1),T(l,l.bitrate_index,4),T(l,l.samplerate_index,2),T(l,l.padding,1),T(l,e.extension,1),T(l,e.mode.ordinal(),2),T(l,l.mode_ext,2),T(l,e.copyright,1),T(l,e.original,1),T(l,e.emphasis,2),e.error_protection&&T(l,0,16),1==e.version){for(i(o.main_data_begin>=0),T(l,o.main_data_begin,9),2==l.channels_out?T(l,o.private_bits,3):T(l,o.private_bits,5),s=0;s<l.channels_out;s++){var d;for(d=0;d<4;d++)T(l,o.scfsi[s][d],1)}for(a=0;a<2;a++)for(s=0;s<l.channels_out;s++)T(l,(f=o.tt[a][s]).part2_3_length+f.part2_length,12),T(l,f.big_values/2,9),T(l,f.global_gain,8),T(l,f.scalefac_compress,4),f.block_type!=u.NORM_TYPE?(T(l,1,1),T(l,f.block_type,2),T(l,f.mixed_block_flag,1),14==f.table_select[0]&&(f.table_select[0]=16),T(l,f.table_select[0],5),14==f.table_select[1]&&(f.table_select[1]=16),T(l,f.table_select[1],5),T(l,f.subblock_gain[0],3),T(l,f.subblock_gain[1],3),T(l,f.subblock_gain[2],3)):(T(l,0,1),14==f.table_select[0]&&(f.table_select[0]=16),T(l,f.table_select[0],5),14==f.table_select[1]&&(f.table_select[1]=16),T(l,f.table_select[1],5),14==f.table_select[2]&&(f.table_select[2]=16),T(l,f.table_select[2],5),i(0<=f.region0_count&&f.region0_count<16),i(0<=f.region1_count&&f.region1_count<8),T(l,f.region0_count,4),T(l,f.region1_count,3)),T(l,f.preflag,1),T(l,f.scalefac_scale,1),T(l,f.count1table_select,1)}else for(i(o.main_data_begin>=0),T(l,o.main_data_begin,8),T(l,o.private_bits,l.channels_out),a=0,s=0;s<l.channels_out;s++){var f;T(l,(f=o.tt[a][s]).part2_3_length+f.part2_length,12),T(l,f.big_values/2,9),T(l,f.global_gain,8),T(l,f.scalefac_compress,9),f.block_type!=u.NORM_TYPE?(T(l,1,1),T(l,f.block_type,2),T(l,f.mixed_block_flag,1),14==f.table_select[0]&&(f.table_select[0]=16),T(l,f.table_select[0],5),14==f.table_select[1]&&(f.table_select[1]=16),T(l,f.table_select[1],5),T(l,f.subblock_gain[0],3),T(l,f.subblock_gain[1],3),T(l,f.subblock_gain[2],3)):(T(l,0,1),14==f.table_select[0]&&(f.table_select[0]=16),T(l,f.table_select[0],5),14==f.table_select[1]&&(f.table_select[1]=16),T(l,f.table_select[1],5),14==f.table_select[2]&&(f.table_select[2]=16),T(l,f.table_select[2],5),i(0<=f.region0_count&&f.region0_count<16),i(0<=f.region1_count&&f.region1_count<8),T(l,f.region0_count,4),T(l,f.region1_count,3)),T(l,f.scalefac_scale,1),T(l,f.count1table_select,1)}e.error_protection&&CRC_writeheader(l,l.header[l.h_ptr].buf);var p=l.h_ptr;i(l.header[p].ptr==8*l.sideinfo_len),l.h_ptr=p+1&c.MAX_HEADER_BUF-1,l.header[l.h_ptr].write_timing=l.header[p].write_timing+r,l.h_ptr==l.w_ptr&&t.err.println("Error: MAX_HEADER_BUF too small in bitstream.c \n")}(e,a);var l=8*o.sideinfo_len;if(l+=function(e){var t,n,r,o,a=0,l=e.internal_flags,c=l.l3_side;if(1==e.version)for(t=0;t<2;t++)for(n=0;n<l.channels_out;n++){var d=c.tt[t][n],f=s.slen1_tab[d.scalefac_compress],p=s.slen2_tab[d.scalefac_compress];for(o=0,r=0;r<d.sfbdivide;r++)-1!=d.scalefac[r]&&(w(l,d.scalefac[r],f),o+=f);for(;r<d.sfbmax;r++)-1!=d.scalefac[r]&&(w(l,d.scalefac[r],p),o+=p);i(o==d.part2_length),d.block_type==u.SHORT_TYPE?o+=O(l,d):o+=A(l,d),o+=k(l,d),i(o==d.part2_3_length+d.part2_length),a+=o}else for(t=0,n=0;n<l.channels_out;n++){d=c.tt[t][n];var h,m,g=0;if(i(null!=d.sfb_partition_table),o=0,r=0,m=0,d.block_type==u.SHORT_TYPE){for(;m<4;m++){var b=d.sfb_partition_table[m]/3,y=d.slen[m];for(h=0;h<b;h++,r++)w(l,Math.max(d.scalefac[3*r+0],0),y),w(l,Math.max(d.scalefac[3*r+1],0),y),w(l,Math.max(d.scalefac[3*r+2],0),y),g+=3*y}o+=O(l,d)}else{for(;m<4;m++)for(b=d.sfb_partition_table[m],y=d.slen[m],h=0;h<b;h++,r++)w(l,Math.max(d.scalefac[r],0),y),g+=y;o+=A(l,d)}o+=k(l,d),i(o==d.part2_3_length),i(g==d.part2_length),a+=g+o}return a}(e),x(e,r.resvDrain_post),l+=r.resvDrain_post,r.main_data_begin+=(a-l)/8,$(e,new R)!=o.ResvSize&&t.err.println("Internal buffer inconsistency. flushbits <> ResvSize"),8*r.main_data_begin!=o.ResvSize&&(t.err.printf("bit reservoir error: \nl3_side.main_data_begin: %d \nResvoir size: %d \nresv drain (post) %d \nresv drain (pre) %d \nheader and sideinfo: %d \ndata bits: %d \ntotal bits: %d (remainder: %d) \nbitsperframe: %d \n",8*r.main_data_begin,o.ResvSize,r.resvDrain_post,r.resvDrain_pre,8*o.sideinfo_len,l-r.resvDrain_post-8*o.sideinfo_len,l,l%8,a),t.err.println("This is a fatal error. It has several possible causes:"),t.err.println("90%% LAME compiled with buggy version of gcc using advanced optimizations"),t.err.println(" 9%% Your system is overclocked"),t.err.println(" 1%% bug in LAME encoding library"),o.ResvSize=8*r.main_data_begin),b>1e9){var d;for(d=0;d<c.MAX_HEADER_BUF;++d)o.header[d].write_timing-=b;b=0}return 0},this.copy_buffer=function(e,n,r,i,s){var l=y+1;if(l<=0)return 0;if(0!=i&&l>i)return-1;if(t.arraycopy(g,0,n,r,l),y=-1,_=0,0!=s){var u=a(1);if(u[0]=e.nMusicCRC,m.updateMusicCRC(u,n,r,l),e.nMusicCRC=u[0],l>0&&(e.VBR_seek_table.nBytesWritten+=l),e.decode_on_the_fly)for(var c,d=o([2,1152]),h=l,b=-1;0!=b;)if(b=p.hip_decode1_unclipped(e.hip,n,r,h,d[0],d[1]),h=0,-1==b&&(b=0),b>0){if(e.findPeakSample){for(c=0;c<b;c++)d[0][c]>e.PeakSample?e.PeakSample=d[0][c]:-d[0][c]>e.PeakSample&&(e.PeakSample=-d[0][c]);if(e.channels_out>1)for(c=0;c<b;c++)d[1][c]>e.PeakSample?e.PeakSample=d[1][c]:-d[1][c]>e.PeakSample&&(e.PeakSample=-d[1][c])}if(e.findReplayGain&&f.AnalyzeSamples(e.rgdata,d[0],0,d[1],0,b,e.channels_out)==GainAnalysis.GAIN_ANALYSIS_ERROR)return-6}}return l},this.init_bit_stream_w=function(t){g=r(e.LAME_MAXMP3BUFFER),t.h_ptr=t.w_ptr=0,t.header[t.h_ptr].write_timing=0,y=-1,_=0,b=0}}return d.EQ=function(e,t){return Math.abs(e)>Math.abs(t)?Math.abs(e-t)<=1e-6*Math.abs(e):Math.abs(e-t)<=1e-6*Math.abs(t)},d.NEQ=function(e,t){return!d.EQ(e,t)},Be=d}function Oe(){if(ia)return Te;ia=1;var e=Q0,t=e.System,n=e.VbrMode,r=e.ShortBlock,o=e.new_float,a=e.new_int_n,i=e.new_short_n,s=e.assert,l=Qa,u=za,c=ne,d=x2,f=E2,p=N2,h=Ve(),m=He,g=t1();return Te=function e(){var b=j1,y=this;e.V9=410,e.V8=420,e.V7=430,e.V6=440,e.V5=450,e.V4=460,e.V3=470,e.V2=480,e.V1=490,e.V0=500,e.R3MIX=1e3,e.STANDARD=1001,e.EXTREME=1002,e.INSANE=1003,e.STANDARD_FAST=1004,e.EXTREME_FAST=1005,e.MEDIUM=1006,e.MEDIUM_FAST=1007,e.LAME_MAXMP3BUFFER=147456;var _,v,w,S,x,T,E,k,P=new l;function O(){this.mask_adjust=0,this.mask_adjust_short=0,this.bo_l_weight=o(g.SBMAX_l),this.bo_s_weight=o(g.SBMAX_s)}function A(){this.lowerlimit=0}function R(e,t){this.lowpass=t}this.enc=new g,this.setModules=function(e,t,n,r,o,a,i,s,l){_=e,v=t,w=n,S=r,x=o,T=a,E=s,k=l,this.enc.setModules(v,P,S,T)};var $=4294479419;function I(e){return e>1?0:e<=0?1:Math.cos(Math.PI/2*e)}function C(e,t){switch(e){case 44100:return t.version=1,0;case 48e3:return t.version=1,1;case 32e3:return t.version=1,2;case 22050:case 11025:return t.version=0,0;case 24e3:case 12e3:return t.version=0,1;case 16e3:case 8e3:return t.version=0,2;default:return t.version=0,-1}}function D(e,t,n){n<16e3&&(t=2);for(var r=m.bitrate_table[t][1],o=2;o<=14;o++)m.bitrate_table[t][o]>0&&Math.abs(m.bitrate_table[t][o]-e)<Math.abs(r-e)&&(r=m.bitrate_table[t][o]);return r}function N(e,t,n){n<16e3&&(t=2);for(var r=0;r<=14;r++)if(m.bitrate_table[t][r]>0&&m.bitrate_table[t][r]==e)return r;return-1}function M(e,t){var n=[new R(8,2e3),new R(16,3700),new R(24,3900),new R(32,5500),new R(40,7e3),new R(48,7500),new R(56,1e4),new R(64,11e3),new R(80,13500),new R(96,15100),new R(112,15600),new R(128,17e3),new R(160,17500),new R(192,18600),new R(224,19400),new R(256,19700),new R(320,20500)],r=y.nearestBitrateFullIndex(t);e.lowerlimit=n[r].lowpass}function L(e){var t=g.BLKSIZE+e.framesize-g.FFTOFFSET;return t=Math.max(t,512+e.framesize-32)}function j(e,t,n,r,o,a){var i=y.enc.lame_encode_mp3_frame(e,t,n,r,o,a);return e.frameNum++,i}function F(){this.n_in=0,this.n_out=0}function B(){this.num_used=0}function U(e,t){return 0!=t?U(t,e%t):e}function z(e,t,n){var r=Math.PI*t;(e/=n)<0&&(e=0),e>1&&(e=1);var o=e-.5,a=.42-.5*Math.cos(2*e*Math.PI)+.08*Math.cos(4*e*Math.PI);return Math.abs(o)<1e-9?r/Math.PI:a*Math.sin(n*r*o)/(Math.PI*n*o)}function V(e,t,n,r,a,i,l,u,d){var f,p,h=e.internal_flags,m=0,g=e.out_samplerate/U(e.out_samplerate,e.in_samplerate);g>c.BPC&&(g=c.BPC);var b=Math.abs(h.resample_ratio-Math.floor(.5+h.resample_ratio))<1e-4?1:0,y=1/h.resample_ratio;y>1&&(y=1);var _=31;_%2==0&&--_;var v=(_+=b)+1;if(0==h.fill_buffer_resample_init){for(h.inbuf_old[0]=o(v),h.inbuf_old[1]=o(v),f=0;f<=2*g;++f)h.blackfilt[f]=o(v);for(h.itime[0]=0,h.itime[1]=0,m=0;m<=2*g;m++){var w=0,S=(m-g)/(2*g);for(f=0;f<=_;f++)w+=h.blackfilt[m][f]=z(f-S,y,_);for(f=0;f<=_;f++)h.blackfilt[m][f]/=w}h.fill_buffer_resample_init=1}var x=h.inbuf_old[d];for(p=0;p<r;p++){var T,E;if(T=p*h.resample_ratio,_+(m=0|Math.floor(T-h.itime[d]))-_/2>=l)break;S=T-h.itime[d]-(m+_%2*.5);E=0|Math.floor(2*S*g+g+.5);var k=0;for(f=0;f<=_;++f){var P=0|f+m-_/2;k+=(P<0?x[v+P]:a[i+P])*h.blackfilt[E][f]}t[n+p]=k}if(u.num_used=Math.min(l,_+m-_/2),h.itime[d]+=u.num_used-p*h.resample_ratio,u.num_used>=v)for(f=0;f<v;f++)x[f]=a[i+u.num_used+f-v];else{var O=v-u.num_used;for(f=0;f<O;++f)x[f]=x[f+u.num_used];for(m=0;f<v;++f,++m)x[f]=a[i+m];s(m==u.num_used)}return p}function H(e,t,n,r,o,a){var i=e.internal_flags;if(i.resample_ratio<.9999||i.resample_ratio>1.0001)for(var s=0;s<i.channels_out;s++){var l=new B;a.n_out=V(e,t[s],i.mf_size,e.framesize,n[s],r,o,l,s),a.n_in=l.num_used}else{a.n_out=Math.min(e.framesize,o),a.n_in=a.n_out;for(var u=0;u<a.n_out;++u)t[0][i.mf_size+u]=n[0][r+u],2==i.channels_out&&(t[1][i.mf_size+u]=n[1][r+u])}}this.lame_init=function(){var e=new u;return function(e){var t;e.class_id=$,t=e.internal_flags=new c,e.mode=b.NOT_SET,e.original=1,e.in_samplerate=44100,e.num_channels=2,e.num_samples=-1,e.bWriteVbrTag=!0,e.quality=-1,e.short_blocks=null,t.subblock_gain=-1,e.lowpassfreq=0,e.highpassfreq=0,e.lowpasswidth=-1,e.highpasswidth=-1,e.VBR=n.vbr_off,e.VBR_q=4,e.ATHcurve=-1,e.VBR_mean_bitrate_kbps=128,e.VBR_min_bitrate_kbps=0,e.VBR_max_bitrate_kbps=0,e.VBR_hard_min=0,t.VBR_min_bitrate=1,t.VBR_max_bitrate=13,e.quant_comp=-1,e.quant_comp_short=-1,e.msfix=-1,t.resample_ratio=1,t.OldValue[0]=180,t.OldValue[1]=180,t.CurrentStep[0]=4,t.CurrentStep[1]=4,t.masking_lower=1,t.nsPsy.attackthre=-1,t.nsPsy.attackthre_s=-1,e.scale=-1,e.athaa_type=-1,e.ATHtype=-1,e.athaa_loudapprox=-1,e.athaa_sensitivity=0,e.useTemporal=null,e.interChRatio=-1,t.mf_samples_to_encode=g.ENCDELAY+g.POSTDELAY,e.encoder_padding=0,t.mf_size=g.ENCDELAY-g.MDCTDELAY,e.findReplayGain=!1,e.decode_on_the_fly=!1,t.decode_on_the_fly=!1,t.findReplayGain=!1,t.findPeakSample=!1,t.RadioGain=0,t.AudiophileGain=0,t.noclipGainChange=0,t.noclipScale=-1,e.preset=0,e.write_id3tag_automatic=!0}(e),e.lame_allocated_gfp=1,e},this.nearestBitrateFullIndex=function(e){var t=[8,16,24,32,40,48,56,64,80,96,112,128,160,192,224,256,320],n=0,r=0,o=0,a=0;a=t[16],o=16,r=t[16],n=16;for(var i=0;i<16;i++)if(Math.max(e,t[i+1])!=e){a=t[i+1],o=i+1,r=t[i],n=i;break}return a-e>e-r?n:o},this.lame_init_params=function(e){var o,i=e.internal_flags;if(i.Class_ID=0,null==i.ATH&&(i.ATH=new d),null==i.PSY&&(i.PSY=new O),null==i.rgdata&&(i.rgdata=new f),i.channels_in=e.num_channels,1==i.channels_in&&(e.mode=b.MONO),i.channels_out=e.mode==b.MONO?1:2,i.mode_ext=g.MPG_MD_MS_LR,e.mode==b.MONO&&(e.force_ms=!1),e.VBR==n.vbr_off&&128!=e.VBR_mean_bitrate_kbps&&0==e.brate&&(e.brate=e.VBR_mean_bitrate_kbps),e.VBR==n.vbr_off||e.VBR==n.vbr_mtrh||e.VBR==n.vbr_mt||(e.free_format=!1),e.VBR==n.vbr_off&&0==e.brate&&h.EQ(e.compression_ratio,0)&&(e.compression_ratio=11.025),e.VBR==n.vbr_off&&e.compression_ratio>0&&(0==e.out_samplerate&&(e.out_samplerate=map2MP3Frequency(int(.97*e.in_samplerate))),e.brate=0|16*e.out_samplerate*i.channels_out/(1e3*e.compression_ratio),i.samplerate_index=C(e.out_samplerate,e),e.free_format||(e.brate=D(e.brate,e.version,e.out_samplerate))),0!=e.out_samplerate&&(e.out_samplerate<16e3?(e.VBR_mean_bitrate_kbps=Math.max(e.VBR_mean_bitrate_kbps,8),e.VBR_mean_bitrate_kbps=Math.min(e.VBR_mean_bitrate_kbps,64)):e.out_samplerate<32e3?(e.VBR_mean_bitrate_kbps=Math.max(e.VBR_mean_bitrate_kbps,8),e.VBR_mean_bitrate_kbps=Math.min(e.VBR_mean_bitrate_kbps,160)):(e.VBR_mean_bitrate_kbps=Math.max(e.VBR_mean_bitrate_kbps,32),e.VBR_mean_bitrate_kbps=Math.min(e.VBR_mean_bitrate_kbps,320))),0==e.lowpassfreq){var u=16e3;switch(e.VBR){case n.vbr_off:M(c=new A,e.brate),u=c.lowerlimit;break;case n.vbr_abr:var c;M(c=new A,e.VBR_mean_bitrate_kbps),u=c.lowerlimit;break;case n.vbr_rh:var y=[19500,19e3,18600,18e3,17500,16e3,15600,14900,12500,1e4,3950];if(0<=e.VBR_q&&e.VBR_q<=9){var R=y[e.VBR_q],L=y[e.VBR_q+1],j=e.VBR_q_frac;u=linear_int(R,L,j)}else u=19500;break;default:y=[19500,19e3,18500,18e3,17500,16500,15500,14500,12500,9500,3950];if(0<=e.VBR_q&&e.VBR_q<=9){R=y[e.VBR_q],L=y[e.VBR_q+1],j=e.VBR_q_frac;u=linear_int(R,L,j)}else u=19500}e.mode==b.MONO&&(e.VBR==n.vbr_off||e.VBR==n.vbr_abr)&&(u*=1.5),e.lowpassfreq=0|u}if(0==e.out_samplerate&&(2*e.lowpassfreq>e.in_samplerate&&(e.lowpassfreq=e.in_samplerate/2),e.out_samplerate=function(e,t){var n=44100;return t>=48e3?n=48e3:t>=44100?n=44100:t>=32e3?n=32e3:t>=24e3?n=24e3:t>=22050?n=22050:t>=16e3?n=16e3:t>=12e3?n=12e3:t>=11025?n=11025:t>=8e3&&(n=8e3),-1==e?n:(e<=15960&&(n=44100),e<=15250&&(n=32e3),e<=11220&&(n=24e3),e<=9970&&(n=22050),e<=7230&&(n=16e3),e<=5420&&(n=12e3),e<=4510&&(n=11025),e<=3970&&(n=8e3),t<n?t>44100?48e3:t>32e3?44100:t>24e3?32e3:t>22050?24e3:t>16e3?22050:t>12e3?16e3:t>11025?12e3:t>8e3?11025:8e3:n)}(0|e.lowpassfreq,e.in_samplerate)),e.lowpassfreq=Math.min(20500,e.lowpassfreq),e.lowpassfreq=Math.min(e.out_samplerate/2,e.lowpassfreq),e.VBR==n.vbr_off&&(e.compression_ratio=16*e.out_samplerate*i.channels_out/(1e3*e.brate)),e.VBR==n.vbr_abr&&(e.compression_ratio=16*e.out_samplerate*i.channels_out/(1e3*e.VBR_mean_bitrate_kbps)),e.bWriteVbrTag||(e.findReplayGain=!1,e.decode_on_the_fly=!1,i.findPeakSample=!1),i.findReplayGain=e.findReplayGain,i.decode_on_the_fly=e.decode_on_the_fly,i.decode_on_the_fly&&(i.findPeakSample=!0),i.findReplayGain&&_.InitGainAnalysis(i.rgdata,e.out_samplerate)==GainAnalysis.INIT_GAIN_ANALYSIS_ERROR)return e.internal_flags=null,-6;switch(i.decode_on_the_fly&&!e.decode_only&&(null!=i.hip&&k.hip_decode_exit(i.hip),i.hip=k.hip_decode_init()),i.mode_gr=e.out_samplerate<=24e3?1:2,e.framesize=576*i.mode_gr,e.encoder_delay=g.ENCDELAY,i.resample_ratio=e.in_samplerate/e.out_samplerate,e.VBR){case n.vbr_mt:case n.vbr_rh:case n.vbr_mtrh:e.compression_ratio=[5.7,6.5,7.3,8.2,10,11.9,13,14,15,16.5][e.VBR_q];break;case n.vbr_abr:e.compression_ratio=16*e.out_samplerate*i.channels_out/(1e3*e.VBR_mean_bitrate_kbps);break;default:e.compression_ratio=16*e.out_samplerate*i.channels_out/(1e3*e.brate)}if(e.mode==b.NOT_SET&&(e.mode=b.JOINT_STEREO),e.highpassfreq>0?(i.highpass1=2*e.highpassfreq,e.highpasswidth>=0?i.highpass2=2*(e.highpassfreq+e.highpasswidth):i.highpass2=2*e.highpassfreq,i.highpass1/=e.out_samplerate,i.highpass2/=e.out_samplerate):(i.highpass1=0,i.highpass2=0),e.lowpassfreq>0?(i.lowpass2=2*e.lowpassfreq,e.lowpasswidth>=0?(i.lowpass1=2*(e.lowpassfreq-e.lowpasswidth),i.lowpass1<0&&(i.lowpass1=0)):i.lowpass1=2*e.lowpassfreq,i.lowpass1/=e.out_samplerate,i.lowpass2/=e.out_samplerate):(i.lowpass1=0,i.lowpass2=0),function(e){var n=e.internal_flags,r=32,o=-1;if(n.lowpass1>0){for(var a=999,i=0;i<=31;i++)(c=i/31)>=n.lowpass2&&(r=Math.min(r,i)),n.lowpass1<c&&c<n.lowpass2&&(a=Math.min(a,i));n.lowpass1=999==a?(r-.75)/31:(a-.75)/31,n.lowpass2=r/31}if(n.highpass2>0&&n.highpass2<.75/31*.9&&(n.highpass1=0,n.highpass2=0,t.err.println("Warning: highpass filter disabled. highpass frequency too small\n")),n.highpass2>0){var s=-1;for(i=0;i<=31;i++)(c=i/31)<=n.highpass1&&(o=Math.max(o,i)),n.highpass1<c&&c<n.highpass2&&(s=Math.max(s,i));n.highpass1=o/31,n.highpass2=-1==s?(o+.75)/31:(s+.75)/31}for(i=0;i<32;i++){var l,u,c=i/31;l=n.highpass2>n.highpass1?I((n.highpass2-c)/(n.highpass2-n.highpass1+1e-20)):1,u=n.lowpass2>n.lowpass1?I((c-n.lowpass1)/(n.lowpass2-n.lowpass1+1e-20)):1,n.amp_filter[i]=l*u}}(e),i.samplerate_index=C(e.out_samplerate,e),i.samplerate_index<0)return e.internal_flags=null,-1;if(e.VBR==n.vbr_off){if(e.free_format)i.bitrate_index=0;else if(e.brate=D(e.brate,e.version,e.out_samplerate),i.bitrate_index=N(e.brate,e.version,e.out_samplerate),i.bitrate_index<=0)return e.internal_flags=null,-1}else i.bitrate_index=1;e.analysis&&(e.bWriteVbrTag=!1),null!=i.pinfo&&(e.bWriteVbrTag=!1),v.init_bit_stream_w(i);for(var F=i.samplerate_index+3*e.version+6*(e.out_samplerate<16e3?1:0),B=0;B<g.SBMAX_l+1;B++)i.scalefac_band.l[B]=S.sfBandIndex[F].l[B];for(B=0;B<g.PSFB21+1;B++){var U=(i.scalefac_band.l[22]-i.scalefac_band.l[21])/g.PSFB21,z=i.scalefac_band.l[21]+B*U;i.scalefac_band.psfb21[B]=z}i.scalefac_band.psfb21[g.PSFB21]=576;for(B=0;B<g.SBMAX_s+1;B++)i.scalefac_band.s[B]=S.sfBandIndex[F].s[B];for(B=0;B<g.PSFB12+1;B++){U=(i.scalefac_band.s[13]-i.scalefac_band.s[12])/g.PSFB12,z=i.scalefac_band.s[12]+B*U;i.scalefac_band.psfb12[B]=z}for(i.scalefac_band.psfb12[g.PSFB12]=192,1==e.version?i.sideinfo_len=1==i.channels_out?21:36:i.sideinfo_len=1==i.channels_out?13:21,e.error_protection&&(i.sideinfo_len+=2),function(e){var t=e.internal_flags;e.frameNum=0,e.write_id3tag_automatic&&E.id3tag_write_v2(e),t.bitrate_stereoMode_Hist=a([16,5]),t.bitrate_blockType_Hist=a([16,6]),t.PeakSample=0,e.bWriteVbrTag&&T.InitVbrTag(e)}(e),i.Class_ID=$,o=0;o<19;o++)i.nsPsy.pefirbuf[o]=700*i.mode_gr*i.channels_out;switch(-1==e.ATHtype&&(e.ATHtype=4),s(e.VBR_q<=9),s(e.VBR_q>=0),e.VBR){case n.vbr_mt:e.VBR=n.vbr_mtrh;case n.vbr_mtrh:null==e.useTemporal&&(e.useTemporal=!1),w.apply_preset(e,500-10*e.VBR_q,0),e.quality<0&&(e.quality=LAME_DEFAULT_QUALITY),e.quality<5&&(e.quality=0),e.quality>5&&(e.quality=5),i.PSY.mask_adjust=e.maskingadjust,i.PSY.mask_adjust_short=e.maskingadjust_short,e.experimentalY?i.sfb21_extra=!1:i.sfb21_extra=e.out_samplerate>44e3,i.iteration_loop=new VBRNewIterationLoop(x);break;case n.vbr_rh:w.apply_preset(e,500-10*e.VBR_q,0),i.PSY.mask_adjust=e.maskingadjust,i.PSY.mask_adjust_short=e.maskingadjust_short,e.experimentalY?i.sfb21_extra=!1:i.sfb21_extra=e.out_samplerate>44e3,e.quality>6&&(e.quality=6),e.quality<0&&(e.quality=LAME_DEFAULT_QUALITY),i.iteration_loop=new VBROldIterationLoop(x);break;default:var V;i.sfb21_extra=!1,e.quality<0&&(e.quality=LAME_DEFAULT_QUALITY),(V=e.VBR)==n.vbr_off&&(e.VBR_mean_bitrate_kbps=e.brate),w.apply_preset(e,e.VBR_mean_bitrate_kbps,0),e.VBR=V,i.PSY.mask_adjust=e.maskingadjust,i.PSY.mask_adjust_short=e.maskingadjust_short,V==n.vbr_off?i.iteration_loop=new p(x):i.iteration_loop=new ABRIterationLoop(x)}if(s(e.scale>=0),e.VBR!=n.vbr_off){if(i.VBR_min_bitrate=1,i.VBR_max_bitrate=14,e.out_samplerate<16e3&&(i.VBR_max_bitrate=8),0!=e.VBR_min_bitrate_kbps&&(e.VBR_min_bitrate_kbps=D(e.VBR_min_bitrate_kbps,e.version,e.out_samplerate),i.VBR_min_bitrate=N(e.VBR_min_bitrate_kbps,e.version,e.out_samplerate),i.VBR_min_bitrate<0)||0!=e.VBR_max_bitrate_kbps&&(e.VBR_max_bitrate_kbps=D(e.VBR_max_bitrate_kbps,e.version,e.out_samplerate),i.VBR_max_bitrate=N(e.VBR_max_bitrate_kbps,e.version,e.out_samplerate),i.VBR_max_bitrate<0))return-1;e.VBR_min_bitrate_kbps=m.bitrate_table[e.version][i.VBR_min_bitrate],e.VBR_max_bitrate_kbps=m.bitrate_table[e.version][i.VBR_max_bitrate],e.VBR_mean_bitrate_kbps=Math.min(m.bitrate_table[e.version][i.VBR_max_bitrate],e.VBR_mean_bitrate_kbps),e.VBR_mean_bitrate_kbps=Math.max(m.bitrate_table[e.version][i.VBR_min_bitrate],e.VBR_mean_bitrate_kbps)}return e.tune&&(i.PSY.mask_adjust+=e.tune_value_a,i.PSY.mask_adjust_short+=e.tune_value_a),function(e){var t=e.internal_flags;switch(e.quality){default:case 9:t.psymodel=0,t.noise_shaping=0,t.noise_shaping_amp=0,t.noise_shaping_stop=0,t.use_best_huffman=0,t.full_outer_loop=0;break;case 8:e.quality=7;case 7:t.psymodel=1,t.noise_shaping=0,t.noise_shaping_amp=0,t.noise_shaping_stop=0,t.use_best_huffman=0,t.full_outer_loop=0;break;case 6:case 5:t.psymodel=1,0==t.noise_shaping&&(t.noise_shaping=1),t.noise_shaping_amp=0,t.noise_shaping_stop=0,-1==t.subblock_gain&&(t.subblock_gain=1),t.use_best_huffman=0,t.full_outer_loop=0;break;case 4:t.psymodel=1,0==t.noise_shaping&&(t.noise_shaping=1),t.noise_shaping_amp=0,t.noise_shaping_stop=0,-1==t.subblock_gain&&(t.subblock_gain=1),t.use_best_huffman=1,t.full_outer_loop=0;break;case 3:t.psymodel=1,0==t.noise_shaping&&(t.noise_shaping=1),t.noise_shaping_amp=1,t.noise_shaping_stop=1,-1==t.subblock_gain&&(t.subblock_gain=1),t.use_best_huffman=1,t.full_outer_loop=0;break;case 2:t.psymodel=1,0==t.noise_shaping&&(t.noise_shaping=1),0==t.substep_shaping&&(t.substep_shaping=2),t.noise_shaping_amp=1,t.noise_shaping_stop=1,-1==t.subblock_gain&&(t.subblock_gain=1),t.use_best_huffman=1,t.full_outer_loop=0;break;case 1:case 0:t.psymodel=1,0==t.noise_shaping&&(t.noise_shaping=1),0==t.substep_shaping&&(t.substep_shaping=2),t.noise_shaping_amp=2,t.noise_shaping_stop=1,-1==t.subblock_gain&&(t.subblock_gain=1),t.use_best_huffman=1,t.full_outer_loop=0}}(e),s(e.scale>=0),e.athaa_type<0?i.ATH.useAdjust=3:i.ATH.useAdjust=e.athaa_type,i.ATH.aaSensitivityP=Math.pow(10,e.athaa_sensitivity/-10),null==e.short_blocks&&(e.short_blocks=r.short_block_allowed),e.short_blocks==r.short_block_allowed&&(e.mode==b.JOINT_STEREO||e.mode==b.STEREO)&&(e.short_blocks=r.short_block_coupled),e.quant_comp<0&&(e.quant_comp=1),e.quant_comp_short<0&&(e.quant_comp_short=0),e.msfix<0&&(e.msfix=0),e.exp_nspsytune=1|e.exp_nspsytune,e.internal_flags.nsPsy.attackthre<0&&(e.internal_flags.nsPsy.attackthre=l.NSATTACKTHRE),e.internal_flags.nsPsy.attackthre_s<0&&(e.internal_flags.nsPsy.attackthre_s=l.NSATTACKTHRE_S),s(e.scale>=0),e.scale<0&&(e.scale=1),e.ATHtype<0&&(e.ATHtype=4),e.ATHcurve<0&&(e.ATHcurve=4),e.athaa_loudapprox<0&&(e.athaa_loudapprox=2),e.interChRatio<0&&(e.interChRatio=0),null==e.useTemporal&&(e.useTemporal=!0),i.slot_lag=i.frac_SpF=0,e.VBR==n.vbr_off&&(i.slot_lag=i.frac_SpF=72e3*(e.version+1)*e.brate%e.out_samplerate|0),S.iteration_init(e),P.psymodel_init(e),s(e.scale>=0),0},this.lame_encode_flush=function(e,t,n,r){var o,a,s,l,u=e.internal_flags,c=i([2,1152]),d=0,f=u.mf_samples_to_encode-g.POSTDELAY,p=L(e);if(u.mf_samples_to_encode<1)return 0;for(o=0,e.in_samplerate!=e.out_samplerate&&(f+=16*e.out_samplerate/e.in_samplerate),(s=e.framesize-f%e.framesize)<576&&(s+=e.framesize),e.encoder_padding=s,l=(f+s)/e.framesize;l>0&&d>=0;){var h=p-u.mf_size,m=e.frameNum;h*=e.in_samplerate,(h/=e.out_samplerate)>1152&&(h=1152),h<1&&(h=1),a=r-o,0==r&&(a=0),n+=d=this.lame_encode_buffer(e,c[0],c[1],h,t,n,a),o+=d,l-=m!=e.frameNum?1:0}if(u.mf_samples_to_encode=0,d<0||(a=r-o,0==r&&(a=0),v.flush_bitstream(e),(d=v.copy_buffer(u,t,n,a,1))<0))return d;if(n+=d,a=r-(o+=d),0==r&&(a=0),e.write_id3tag_automatic){if(E.id3tag_write_v1(e),(d=v.copy_buffer(u,t,n,a,0))<0)return d;o+=d}return o},this.lame_encode_buffer=function(e,t,n,r,a,i,l){var u=e.internal_flags,d=[null,null];if(u.Class_ID!=$)return-3;if(0==r)return 0;(function(e,t){(null==e.in_buffer_0||e.in_buffer_nsamples<t)&&(e.in_buffer_0=o(t),e.in_buffer_1=o(t),e.in_buffer_nsamples=t)})(u,r),d[0]=u.in_buffer_0,d[1]=u.in_buffer_1;for(var f=0;f<r;f++)d[0][f]=t[f],u.channels_in>1&&(d[1][f]=n[f]);return function(e,t,n,r,o,a,i){var l,u,d,f,p,m=e.internal_flags,b=0,y=[null,null],w=[null,null];if(m.Class_ID!=$)return-3;if(0==r)return 0;if(p=v.copy_buffer(m,o,a,i,0),p<0)return p;if(a+=p,b+=p,w[0]=t,w[1]=n,h.NEQ(e.scale,0)&&h.NEQ(e.scale,1))for(u=0;u<r;++u)w[0][u]*=e.scale,2==m.channels_out&&(w[1][u]*=e.scale);if(h.NEQ(e.scale_left,0)&&h.NEQ(e.scale_left,1))for(u=0;u<r;++u)w[0][u]*=e.scale_left;if(h.NEQ(e.scale_right,0)&&h.NEQ(e.scale_right,1))for(u=0;u<r;++u)w[1][u]*=e.scale_right;if(2==e.num_channels&&1==m.channels_out)for(u=0;u<r;++u)w[0][u]=.5*(w[0][u]+w[1][u]),w[1][u]=0;f=L(e),y[0]=m.mfbuf[0],y[1]=m.mfbuf[1];for(var S=0;r>0;){var x=[null,null],T=0,E=0;x[0]=w[0],x[1]=w[1];var k=new F;if(H(e,y,x,S,r,k),T=k.n_in,E=k.n_out,m.findReplayGain&&!m.decode_on_the_fly&&_.AnalyzeSamples(m.rgdata,y[0],m.mf_size,y[1],m.mf_size,E,m.channels_out)==GainAnalysis.GAIN_ANALYSIS_ERROR)return-6;if(r-=T,S+=T,m.channels_out,m.mf_size+=E,s(m.mf_size<=c.MFSIZE),m.mf_samples_to_encode<1&&(m.mf_samples_to_encode=g.ENCDELAY+g.POSTDELAY),m.mf_samples_to_encode+=E,m.mf_size>=f){var P=i-b;if(0==i&&(P=0),(l=j(e,y[0],y[1],o,a,P))<0)return l;for(a+=l,b+=l,m.mf_size-=e.framesize,m.mf_samples_to_encode-=e.framesize,d=0;d<m.channels_out;d++)for(u=0;u<m.mf_size;u++)y[d][u]=y[d][u+e.framesize]}}return b}(e,d[0],d[1],r,a,i,l)}},Te}var p2=Q0,M1=p2.VbrMode;function H2(){var e,t=Oe();function n(e,t,n,r,o,a,i,s,l,u,c,d,f,p,h){this.vbr_q=e,this.quant_comp=t,this.quant_comp_s=n,this.expY=r,this.st_lrm=o,this.st_s=a,this.masking_adj=i,this.masking_adj_short=s,this.ath_lower=l,this.ath_curve=u,this.ath_sensitivity=c,this.interch=d,this.safejoint=f,this.sfb21mod=p,this.msfix=h}function r(e,t,n,r,o,a,i,s,l,u,c,d,f,p){this.quant_comp=t,this.quant_comp_s=n,this.safejoint=r,this.nsmsfix=o,this.st_lrm=a,this.st_s=i,this.nsbass=s,this.scale=l,this.masking_adj=u,this.ath_lower=c,this.ath_curve=d,this.interch=f,this.sfscale=p}this.setModules=function(t){e=t};var o=[new n(0,9,9,0,5.2,125,-4.2,-6.3,4.8,1,0,0,2,21,.97),new n(1,9,9,0,5.3,125,-3.6,-5.6,4.5,1.5,0,0,2,21,1.35),new n(2,9,9,0,5.6,125,-2.2,-3.5,2.8,2,0,0,2,21,1.49),new n(3,9,9,1,5.8,130,-1.8,-2.8,2.6,3,-4,0,2,20,1.64),new n(4,9,9,1,6,135,-.7,-1.1,1.1,3.5,-8,0,2,0,1.79),new n(5,9,9,1,6.4,140,.5,.4,-7.5,4,-12,2e-4,0,0,1.95),new n(6,9,9,1,6.6,145,.67,.65,-14.7,6.5,-19,4e-4,0,0,2.3),new n(7,9,9,1,6.6,145,.8,.75,-19.7,8,-22,6e-4,0,0,2.7),new n(8,9,9,1,6.6,145,1.2,1.15,-27.5,10,-23,7e-4,0,0,0),new n(9,9,9,1,6.6,145,1.6,1.6,-36,11,-25,8e-4,0,0,0),new n(10,9,9,1,6.6,145,2,2,-36,12,-25,8e-4,0,0,0)],a=[new n(0,9,9,0,4.2,25,-7,-4,7.5,1,0,0,2,26,.97),new n(1,9,9,0,4.2,25,-5.6,-3.6,4.5,1.5,0,0,2,21,1.35),new n(2,9,9,0,4.2,25,-4.4,-1.8,2,2,0,0,2,18,1.49),new n(3,9,9,1,4.2,25,-3.4,-1.25,1.1,3,-4,0,2,15,1.64),new n(4,9,9,1,4.2,25,-2.2,.1,0,3.5,-8,0,2,0,1.79),new n(5,9,9,1,4.2,25,-1,1.65,-7.7,4,-12,2e-4,0,0,1.95),new n(6,9,9,1,4.2,25,-0,2.47,-7.7,6.5,-19,4e-4,0,0,2),new n(7,9,9,1,4.2,25,.5,2,-14.5,8,-22,6e-4,0,0,2),new n(8,9,9,1,4.2,25,1,2.4,-22,10,-23,7e-4,0,0,2),new n(9,9,9,1,4.2,25,1.5,2.95,-30,11,-25,8e-4,0,0,2),new n(10,9,9,1,4.2,25,2,2.95,-36,12,-30,8e-4,0,0,2)];function i(e,t,n){var r=e.VBR==M1.vbr_rh?o:a,i=e.VBR_q_frac,s=r[t],l=r[t+1],u=s;s.st_lrm=s.st_lrm+i*(l.st_lrm-s.st_lrm),s.st_s=s.st_s+i*(l.st_s-s.st_s),s.masking_adj=s.masking_adj+i*(l.masking_adj-s.masking_adj),s.masking_adj_short=s.masking_adj_short+i*(l.masking_adj_short-s.masking_adj_short),s.ath_lower=s.ath_lower+i*(l.ath_lower-s.ath_lower),s.ath_curve=s.ath_curve+i*(l.ath_curve-s.ath_curve),s.ath_sensitivity=s.ath_sensitivity+i*(l.ath_sensitivity-s.ath_sensitivity),s.interch=s.interch+i*(l.interch-s.interch),s.msfix=s.msfix+i*(l.msfix-s.msfix),function(e,t){var n=0;0>t&&(n=-1,t=0),9<t&&(n=-1,t=9),e.VBR_q=t,e.VBR_q_frac=0}(e,u.vbr_q),0!=n?e.quant_comp=u.quant_comp:Math.abs(e.quant_comp- -1)>0||(e.quant_comp=u.quant_comp),0!=n?e.quant_comp_short=u.quant_comp_s:Math.abs(e.quant_comp_short- -1)>0||(e.quant_comp_short=u.quant_comp_s),0!=u.expY&&(e.experimentalY=0!=u.expY),0!=n?e.internal_flags.nsPsy.attackthre=u.st_lrm:Math.abs(e.internal_flags.nsPsy.attackthre- -1)>0||(e.internal_flags.nsPsy.attackthre=u.st_lrm),0!=n?e.internal_flags.nsPsy.attackthre_s=u.st_s:Math.abs(e.internal_flags.nsPsy.attackthre_s- -1)>0||(e.internal_flags.nsPsy.attackthre_s=u.st_s),0!=n?e.maskingadjust=u.masking_adj:Math.abs(e.maskingadjust-0)>0||(e.maskingadjust=u.masking_adj),0!=n?e.maskingadjust_short=u.masking_adj_short:Math.abs(e.maskingadjust_short-0)>0||(e.maskingadjust_short=u.masking_adj_short),0!=n?e.ATHlower=-u.ath_lower/10:Math.abs(10*-e.ATHlower-0)>0||(e.ATHlower=-u.ath_lower/10),0!=n?e.ATHcurve=u.ath_curve:Math.abs(e.ATHcurve- -1)>0||(e.ATHcurve=u.ath_curve),0!=n?e.athaa_sensitivity=u.ath_sensitivity:Math.abs(e.athaa_sensitivity- -1)>0||(e.athaa_sensitivity=u.ath_sensitivity),u.interch>0&&(0!=n?e.interChRatio=u.interch:Math.abs(e.interChRatio- -1)>0||(e.interChRatio=u.interch)),u.safejoint>0&&(e.exp_nspsytune=e.exp_nspsytune|u.safejoint),u.sfb21mod>0&&(e.exp_nspsytune=e.exp_nspsytune|u.sfb21mod<<20),0!=n?e.msfix=u.msfix:Math.abs(e.msfix- -1)>0||(e.msfix=u.msfix),0==n&&(e.VBR_q=t,e.VBR_q_frac=i)}var s=[new r(8,9,9,0,0,6.6,145,0,.95,0,-30,11,.0012,1),new r(16,9,9,0,0,6.6,145,0,.95,0,-25,11,.001,1),new r(24,9,9,0,0,6.6,145,0,.95,0,-20,11,.001,1),new r(32,9,9,0,0,6.6,145,0,.95,0,-15,11,.001,1),new r(40,9,9,0,0,6.6,145,0,.95,0,-10,11,9e-4,1),new r(48,9,9,0,0,6.6,145,0,.95,0,-10,11,9e-4,1),new r(56,9,9,0,0,6.6,145,0,.95,0,-6,11,8e-4,1),new r(64,9,9,0,0,6.6,145,0,.95,0,-2,11,8e-4,1),new r(80,9,9,0,0,6.6,145,0,.95,0,0,8,7e-4,1),new r(96,9,9,0,2.5,6.6,145,0,.95,0,1,5.5,6e-4,1),new r(112,9,9,0,2.25,6.6,145,0,.95,0,2,4.5,5e-4,1),new r(128,9,9,0,1.95,6.4,140,0,.95,0,3,4,2e-4,1),new r(160,9,9,1,1.79,6,135,0,.95,-2,5,3.5,0,1),new r(192,9,9,1,1.49,5.6,125,0,.97,-4,7,3,0,0),new r(224,9,9,1,1.25,5.2,125,0,.98,-6,9,2,0,0),new r(256,9,9,1,.97,5.2,125,0,1,-8,10,1,0,0),new r(320,9,9,1,.9,5.2,125,0,1,-10,12,0,0,0)];function l(t,n,r){var o=n,a=e.nearestBitrateFullIndex(n);if(t.VBR=M1.vbr_abr,t.VBR_mean_bitrate_kbps=o,t.VBR_mean_bitrate_kbps=Math.min(t.VBR_mean_bitrate_kbps,320),t.VBR_mean_bitrate_kbps=Math.max(t.VBR_mean_bitrate_kbps,8),t.brate=t.VBR_mean_bitrate_kbps,t.VBR_mean_bitrate_kbps>320&&(t.disable_reservoir=!0),s[a].safejoint>0&&(t.exp_nspsytune=2|t.exp_nspsytune),s[a].sfscale>0&&(t.internal_flags.noise_shaping=2),Math.abs(s[a].nsbass)>0){var i=int(4*s[a].nsbass);i<0&&(i+=64),t.exp_nspsytune=t.exp_nspsytune|i<<2}return 0!=r?t.quant_comp=s[a].quant_comp:Math.abs(t.quant_comp- -1)>0||(t.quant_comp=s[a].quant_comp),0!=r?t.quant_comp_short=s[a].quant_comp_s:Math.abs(t.quant_comp_short- -1)>0||(t.quant_comp_short=s[a].quant_comp_s),0!=r?t.msfix=s[a].nsmsfix:Math.abs(t.msfix- -1)>0||(t.msfix=s[a].nsmsfix),0!=r?t.internal_flags.nsPsy.attackthre=s[a].st_lrm:Math.abs(t.internal_flags.nsPsy.attackthre- -1)>0||(t.internal_flags.nsPsy.attackthre=s[a].st_lrm),0!=r?t.internal_flags.nsPsy.attackthre_s=s[a].st_s:Math.abs(t.internal_flags.nsPsy.attackthre_s- -1)>0||(t.internal_flags.nsPsy.attackthre_s=s[a].st_s),0!=r?t.scale=s[a].scale:Math.abs(t.scale- -1)>0||(t.scale=s[a].scale),0!=r?t.maskingadjust=s[a].masking_adj:Math.abs(t.maskingadjust-0)>0||(t.maskingadjust=s[a].masking_adj),s[a].masking_adj>0?0!=r?t.maskingadjust_short=.9*s[a].masking_adj:Math.abs(t.maskingadjust_short-0)>0||(t.maskingadjust_short=.9*s[a].masking_adj):0!=r?t.maskingadjust_short=1.1*s[a].masking_adj:Math.abs(t.maskingadjust_short-0)>0||(t.maskingadjust_short=1.1*s[a].masking_adj),0!=r?t.ATHlower=-s[a].ath_lower/10:Math.abs(10*-t.ATHlower-0)>0||(t.ATHlower=-s[a].ath_lower/10),0!=r?t.ATHcurve=s[a].ath_curve:Math.abs(t.ATHcurve- -1)>0||(t.ATHcurve=s[a].ath_curve),0!=r?t.interChRatio=s[a].interch:Math.abs(t.interChRatio- -1)>0||(t.interChRatio=s[a].interch),n}this.apply_preset=function(e,n,r){switch(n){case t.R3MIX:n=t.V3,e.VBR=M1.vbr_mtrh;break;case t.MEDIUM:n=t.V4,e.VBR=M1.vbr_rh;break;case t.MEDIUM_FAST:n=t.V4,e.VBR=M1.vbr_mtrh;break;case t.STANDARD:n=t.V2,e.VBR=M1.vbr_rh;break;case t.STANDARD_FAST:n=t.V2,e.VBR=M1.vbr_mtrh;break;case t.EXTREME:n=t.V0,e.VBR=M1.vbr_rh;break;case t.EXTREME_FAST:n=t.V0,e.VBR=M1.vbr_mtrh;break;case t.INSANE:return n=320,e.preset=n,l(e,n,r),e.VBR=M1.vbr_off,n}switch(e.preset=n,n){case t.V9:return i(e,9,r),n;case t.V8:return i(e,8,r),n;case t.V7:return i(e,7,r),n;case t.V6:return i(e,6,r),n;case t.V5:return i(e,5,r),n;case t.V4:return i(e,4,r),n;case t.V3:return i(e,3,r),n;case t.V2:return i(e,2,r),n;case t.V1:return i(e,1,r),n;case t.V0:return i(e,0,r),n}return 8<=n&&n<=320?l(e,n,r):(e.preset=0,n)}}var V2=H2;function O2(){this.setModules=function(e,t){}}var C2=O2;function F2(){this.over_noise=0,this.tot_noise=0,this.max_noise=0,this.over_count=0,this.over_SSD=0,this.bits=0}var k2=F2,Ca=Q0,na=Ca.new_float,X2=Ca.new_int;function Y2(){this.global_gain=0,this.sfb_count1=0,this.step=X2(39),this.noise=na(39),this.noise_log=na(39)}var q2=Y2,q1=Q0,y1=q1.System,_a$2=q1.VbrMode,ye=q1.Util,X1=q1.Arrays,K1=q1.new_float,U1=q1.assert,D2=C2,we=k2,G2=q2,D0=t1(),la=Le,va=ie;function $2(){var e,t;this.rv=null,this.qupvt=null;var n,r,o=new D2;function a(e){this.ordinal=e}function i(e){for(var t=0;t<e.sfbmax;t++)if(e.scalefac[t]+e.subblock_gain[e.window[t]]==0)return!1;return!0}function s(e){return ye.FAST_LOG10(.368+.632*e*e*e)}function l(e,t,n,r,o){var a;switch(e){default:case 9:t.over_count>0?(a=n.over_SSD<=t.over_SSD,n.over_SSD==t.over_SSD&&(a=n.bits<t.bits)):a=n.max_noise<0&&10*n.max_noise+n.bits<=10*t.max_noise+t.bits;break;case 0:a=n.over_count<t.over_count||n.over_count==t.over_count&&n.over_noise<t.over_noise||n.over_count==t.over_count&&BitStream.EQ(n.over_noise,t.over_noise)&&n.tot_noise<t.tot_noise;break;case 8:n.max_noise=function(e,t){for(var n=1e-37,r=0;r<t.psymax;r++)n+=s(e[r]);return Math.max(1e-20,n)}(o,r);case 1:a=n.max_noise<t.max_noise;break;case 2:a=n.tot_noise<t.tot_noise;break;case 3:a=n.tot_noise<t.tot_noise&&n.max_noise<t.max_noise;break;case 4:a=n.max_noise<=0&&t.max_noise>.2||n.max_noise<=0&&t.max_noise<0&&t.max_noise>n.max_noise-.2&&n.tot_noise<t.tot_noise||n.max_noise<=0&&t.max_noise>0&&t.max_noise>n.max_noise-.2&&n.tot_noise<t.tot_noise+t.over_noise||n.max_noise>0&&t.max_noise>-.05&&t.max_noise>n.max_noise-.1&&n.tot_noise+n.over_noise<t.tot_noise+t.over_noise||n.max_noise>0&&t.max_noise>-.1&&t.max_noise>n.max_noise-.15&&n.tot_noise+n.over_noise+n.over_noise<t.tot_noise+t.over_noise+t.over_noise;break;case 5:a=n.over_noise<t.over_noise||BitStream.EQ(n.over_noise,t.over_noise)&&n.tot_noise<t.tot_noise;break;case 6:a=n.over_noise<t.over_noise||BitStream.EQ(n.over_noise,t.over_noise)&&(n.max_noise<t.max_noise||BitStream.EQ(n.max_noise,t.max_noise)&&n.tot_noise<=t.tot_noise);break;case 7:a=n.over_count<t.over_count||n.over_noise<t.over_noise}return 0==t.over_count&&(a=a&&n.bits<t.bits),a}function u(e,t,o,a,s){var l=e.internal_flags;!function(e,t,n,r,o){var a,i=e.internal_flags;a=0==t.scalefac_scale?1.2968395546510096:1.6817928305074292;for(var s=0,l=0;l<t.sfbmax;l++)s<n[l]&&(s=n[l]);var u=i.noise_shaping_amp;switch(3==u&&(u=o?2:1),u){case 2:break;case 1:s>1?s=Math.pow(s,.5):s*=.95;break;default:s>1?s=1:s*=.95}var c=0;for(l=0;l<t.sfbmax;l++){var d,f=t.width[l];if(c+=f,!(n[l]<s)){if(2&i.substep_shaping&&(i.pseudohalf[l]=0==i.pseudohalf[l]?1:0,0==i.pseudohalf[l]&&2==i.noise_shaping_amp))return;for(t.scalefac[l]++,d=-f;d<0;d++)r[c+d]*=a,r[c+d]>t.xrpow_max&&(t.xrpow_max=r[c+d]);if(2==i.noise_shaping_amp)return}}}(e,t,o,a,s);var u=i(t);return!u&&(!(u=2==l.mode_gr?r.scale_bitcount(t):r.scale_bitcount_lsf(l,t))||(l.noise_shaping>1&&(X1.fill(l.pseudohalf,0),0==t.scalefac_scale?(function(e,t){for(var r=0,o=0;o<e.sfbmax;o++){var a=e.width[o],i=e.scalefac[o];if(0!=e.preflag&&(i+=n.pretab[o]),r+=a,1&i){i++;for(var s=-a;s<0;s++)t[r+s]*=1.2968395546510096,t[r+s]>e.xrpow_max&&(e.xrpow_max=t[r+s])}e.scalefac[o]=i>>1}e.preflag=0,e.scalefac_scale=1}(t,a),u=!1):t.block_type==D0.SHORT_TYPE&&l.subblock_gain>0&&(u=function(e,t,r){var o,a=t.scalefac;for(o=0;o<t.sfb_lmax;o++)if(a[o]>=16)return!0;for(var i=0;i<3;i++){var s=0,l=0;for(o=t.sfb_lmax+i;o<t.sfbdivide;o+=3)s<a[o]&&(s=a[o]);for(;o<t.sfbmax;o+=3)l<a[o]&&(l=a[o]);if(!(s<16&&l<8)){if(t.subblock_gain[i]>=7)return!0;t.subblock_gain[i]++;var u=e.scalefac_band.l[t.sfb_lmax];for(o=t.sfb_lmax+i;o<t.sfbmax;o+=3){var c=t.width[o],d=a[o];if((d-=4>>t.scalefac_scale)>=0)a[o]=d,u+=3*c;else{a[o]=0;var f=210+(d<<t.scalefac_scale+1);h=n.IPOW20(f),u+=c*(i+1);for(var p=-c;p<0;p++)r[u+p]*=h,r[u+p]>t.xrpow_max&&(t.xrpow_max=r[u+p]);u+=c*(3-i-1)}}var h=n.IPOW20(202);for(u+=t.width[o]*(i+1),p=-t.width[o];p<0;p++)r[u+p]*=h,r[u+p]>t.xrpow_max&&(t.xrpow_max=r[u+p])}}return!1}(l,t,a)||i(t))),u||(u=2==l.mode_gr?r.scale_bitcount(t):r.scale_bitcount_lsf(l,t)),!u))}this.setModules=function(a,i,s,l){e=a,t=i,this.rv=i,n=s,this.qupvt=s,r=l,o.setModules(n,r)},this.ms_convert=function(e,t){for(var n=0;n<576;++n){var r=e.tt[t][0].xr[n],o=e.tt[t][1].xr[n];e.tt[t][0].xr[n]=(r+o)*(.5*ye.SQRT2),e.tt[t][1].xr[n]=(r-o)*(.5*ye.SQRT2)}},this.init_xrpow=function(e,t,n){var r=0,o=0|t.max_nonzero_coeff;if(t.xrpow_max=0,X1.fill(n,o,576,0),r=function(e,t,n,r){r=0;for(var o=0;o<=n;++o){var a=Math.abs(e.xr[o]);r+=a,t[o]=Math.sqrt(a*Math.sqrt(a)),t[o]>e.xrpow_max&&(e.xrpow_max=t[o])}return r}(t,n,o,r),r>1e-20){var a=0;2&e.substep_shaping&&(a=1);for(var i=0;i<t.psymax;i++)e.pseudohalf[i]=a;return!0}return X1.fill(t.l3_enc,0,576,0),!1},this.init_outer_loop=function(e,t){t.part2_3_length=0,t.big_values=0,t.count1=0,t.global_gain=210,t.scalefac_compress=0,t.table_select[0]=0,t.table_select[1]=0,t.table_select[2]=0,t.subblock_gain[0]=0,t.subblock_gain[1]=0,t.subblock_gain[2]=0,t.subblock_gain[3]=0,t.region0_count=0,t.region1_count=0,t.preflag=0,t.scalefac_scale=0,t.count1table_select=0,t.part2_length=0,t.sfb_lmax=D0.SBPSY_l,t.sfb_smin=D0.SBPSY_s,t.psy_lmax=e.sfb21_extra?D0.SBMAX_l:D0.SBPSY_l,t.psymax=t.psy_lmax,t.sfbmax=t.sfb_lmax,t.sfbdivide=11;for(var r=0;r<D0.SBMAX_l;r++)t.width[r]=e.scalefac_band.l[r+1]-e.scalefac_band.l[r],t.window[r]=3;if(t.block_type==D0.SHORT_TYPE){var o=K1(576);t.sfb_smin=0,t.sfb_lmax=0,0!=t.mixed_block_flag&&(t.sfb_smin=3,t.sfb_lmax=2*e.mode_gr+4),t.psymax=t.sfb_lmax+3*((e.sfb21_extra?D0.SBMAX_s:D0.SBPSY_s)-t.sfb_smin),t.sfbmax=t.sfb_lmax+3*(D0.SBPSY_s-t.sfb_smin),t.sfbdivide=t.sfbmax-18,t.psy_lmax=t.sfb_lmax;var a=e.scalefac_band.l[t.sfb_lmax];y1.arraycopy(t.xr,0,o,0,576);for(r=t.sfb_smin;r<D0.SBMAX_s;r++)for(var i=e.scalefac_band.s[r],s=e.scalefac_band.s[r+1],l=0;l<3;l++)for(var u=i;u<s;u++)t.xr[a++]=o[3*u+l];var c=t.sfb_lmax;for(r=t.sfb_smin;r<D0.SBMAX_s;r++)t.width[c]=t.width[c+1]=t.width[c+2]=e.scalefac_band.s[r+1]-e.scalefac_band.s[r],t.window[c]=0,t.window[c+1]=1,t.window[c+2]=2,c+=3}t.count1bits=0,t.sfb_partition_table=n.nr_of_sfb_block[0][0],t.slen[0]=0,t.slen[1]=0,t.slen[2]=0,t.slen[3]=0,t.max_nonzero_coeff=575,X1.fill(t.scalefac,0),function(e,t){var r=e.ATH,o=t.xr;if(t.block_type!=D0.SHORT_TYPE)for(var a=!1,i=D0.PSFB21-1;i>=0&&!a;i--){var s=e.scalefac_band.psfb21[i],l=e.scalefac_band.psfb21[i+1],u=n.athAdjust(r.adjust,r.psfb21[i],r.floor);e.nsPsy.longfact[21]>1e-12&&(u*=e.nsPsy.longfact[21]);for(var c=l-1;c>=s;c--){if(!(Math.abs(o[c])<u)){a=!0;break}o[c]=0}}else for(var d=0;d<3;d++)for(a=!1,i=D0.PSFB12-1;i>=0&&!a;i--){l=(s=3*e.scalefac_band.s[12]+(e.scalefac_band.s[13]-e.scalefac_band.s[12])*d+(e.scalefac_band.psfb12[i]-e.scalefac_band.psfb12[0]))+(e.scalefac_band.psfb12[i+1]-e.scalefac_band.psfb12[i]);var f=n.athAdjust(r.adjust,r.psfb12[i],r.floor);for(e.nsPsy.shortfact[12]>1e-12&&(f*=e.nsPsy.shortfact[12]),c=l-1;c>=s;c--){if(!(Math.abs(o[c])<f)){a=!0;break}o[c]=0}}}(e,t)},a.BINSEARCH_NONE=new a(0),a.BINSEARCH_UP=new a(1),a.BINSEARCH_DOWN=new a(2),this.trancate_smallspectrums=function(e,t,o,a){var i=K1(va.SFBMAX);if((4&e.substep_shaping||t.block_type!=D0.SHORT_TYPE)&&!(128&e.substep_shaping)){n.calc_noise(t,o,i,new we,null);for(var s=0;s<576;s++){var l=0;0!=t.l3_enc[s]&&(l=Math.abs(t.xr[s])),a[s]=l}s=0;var u=8;t.block_type==D0.SHORT_TYPE&&(u=6);do{var c,d,f,p,h=t.width[u];if(s+=h,!(i[u]>=1||(X1.sort(a,s-h,h),BitStream.EQ(a[s-1],0)))){c=(1-i[u])*o[u],d=0,p=0;do{var m;for(f=1;p+f<h&&!BitStream.NEQ(a[p+s-h],a[p+s+f-h]);f++);if(c<(m=a[p+s-h]*a[p+s-h]*f)){0!=p&&(d=a[p+s-h-1]);break}c-=m,p+=f}while(p<h);if(!BitStream.EQ(d,0))do{Math.abs(t.xr[s-h])<=d&&(t.l3_enc[s-h]=0)}while(--h>0)}}while(++u<t.psymax);t.part2_3_length=r.noquant_count_bits(e,t,null)}},this.outer_loop=function(e,t,o,i,s,c){var d=e.internal_flags,f=new la,p=K1(576),h=K1(va.SFBMAX),m=new we,g=new G2,b=9999999,y=!1,_=!1,v=0;if(function(e,t,n,o,i){var s,l=e.CurrentStep[o],u=!1,c=e.OldValue[o],d=a.BINSEARCH_NONE;for(t.global_gain=c,n-=t.part2_length;;){var f;if(s=r.count_bits(e,i,t,null),1==l||s==n)break;s>n?(d==a.BINSEARCH_DOWN&&(u=!0),u&&(l/=2),d=a.BINSEARCH_UP,f=l):(d==a.BINSEARCH_UP&&(u=!0),u&&(l/=2),d=a.BINSEARCH_DOWN,f=-l),t.global_gain+=f,t.global_gain<0&&(t.global_gain=0,u=!0),t.global_gain>255&&(t.global_gain=255,u=!0)}for(U1(t.global_gain>=0),U1(t.global_gain<256);s>n&&t.global_gain<255;)t.global_gain++,s=r.count_bits(e,i,t,null);e.CurrentStep[o]=c-t.global_gain>=4?4:2,e.OldValue[o]=t.global_gain,t.part2_3_length=s}(d,t,c,s,i),0==d.noise_shaping)return 100;n.calc_noise(t,o,h,m,g),m.bits=t.part2_3_length,f.assign(t);var w=0;for(y1.arraycopy(i,0,p,0,576);!y;){do{var S,x=new we,T=255;if(S=2&d.substep_shaping?20:3,d.sfb21_extra&&(h[f.sfbmax]>1||f.block_type==D0.SHORT_TYPE&&(h[f.sfbmax+1]>1||h[f.sfbmax+2]>1))||!u(e,f,h,i,_))break;0!=f.scalefac_scale&&(T=254);var E=c-f.part2_length;if(E<=0)break;for(;(f.part2_3_length=r.count_bits(d,i,f,g))>E&&f.global_gain<=T;)f.global_gain++;if(f.global_gain>T)break;if(0==m.over_count){for(;(f.part2_3_length=r.count_bits(d,i,f,g))>b&&f.global_gain<=T;)f.global_gain++;if(f.global_gain>T)break}if(n.calc_noise(f,o,h,x,g),x.bits=f.part2_3_length,0!=(l(t.block_type!=D0.SHORT_TYPE?e.quant_comp:e.quant_comp_short,m,x,f,h)?1:0))b=t.part2_3_length,m=x,t.assign(f),w=0,y1.arraycopy(i,0,p,0,576);else if(0==d.full_outer_loop&&(++w>S&&0==m.over_count||3==d.noise_shaping_amp&&_&&w>30||3==d.noise_shaping_amp&&_&&f.global_gain-v>15))break}while(f.global_gain+f.scalefac_scale<255);3==d.noise_shaping_amp?_?y=!0:(f.assign(t),y1.arraycopy(p,0,i,0,576),w=0,v=f.global_gain,_=!0):y=!0}return U1(t.global_gain+t.scalefac_scale<=255),e.VBR==_a$2.vbr_rh||e.VBR==_a$2.vbr_mtrh?y1.arraycopy(p,0,i,0,576):1&d.substep_shaping&&trancate_smallspectrums(d,t,o,i),m.over_count},this.iteration_finish_one=function(e,n,o){var a=e.l3_side,i=a.tt[n][o];r.best_scalefac_store(e,n,o,a),1==e.use_best_huffman&&r.best_huffman_divide(e,i),t.ResvAdjust(e,i)},this.VBR_encode_granule=function(e,t,n,r,o,a,i){var s,l=e.internal_flags,u=new la,c=K1(576),d=i,f=i+1,p=(i+a)/2,h=0,m=l.sfb21_extra;U1(d<=LameInternalFlags.MAX_BITS_PER_CHANNEL),X1.fill(u.l3_enc,0);do{l.sfb21_extra=!(p>d-42)&&m,outer_loop(e,t,n,r,o,p)<=0?(h=1,f=t.part2_3_length,u.assign(t),y1.arraycopy(r,0,c,0,576),s=(i=f-32)-a,p=(i+a)/2):(s=i-(a=p+32),p=(i+a)/2,0!=h&&(h=2,t.assign(u),y1.arraycopy(c,0,r,0,576)))}while(s>12);l.sfb21_extra=m,2==h&&y1.arraycopy(u.l3_enc,0,t.l3_enc,0,576),U1(t.part2_3_length<=d)},this.get_framebits=function(n,r){var o=n.internal_flags;o.bitrate_index=o.VBR_min_bitrate;var a=e.getframebits(n);o.bitrate_index=1,a=e.getframebits(n);for(var i=1;i<=o.VBR_max_bitrate;i++){o.bitrate_index=i;var s=new MeanBits(a);r[i]=t.ResvFrameBegin(n,s),a=s.bits}},this.VBR_old_prepare=function(e,r,o,a,i,s,l,u,c){var d,f=e.internal_flags,p=0,h=1,m=0;f.bitrate_index=f.VBR_max_bitrate;var g=t.ResvFrameBegin(e,new MeanBits(0))/f.mode_gr;get_framebits(e,s);for(var b=0;b<f.mode_gr;b++){var y=n.on_pe(e,r,u[b],g,b,0);f.mode_ext==D0.MPG_MD_MS_LR&&(ms_convert(f.l3_side,b),n.reduce_side(u[b],o[b],g,y));for(var _=0;_<f.channels_out;++_){var v=f.l3_side.tt[b][_];v.block_type!=D0.SHORT_TYPE?(p=1.28/(1+Math.exp(3.5-r[b][_]/300))-.05,d=f.PSY.mask_adjust-p):(p=2.56/(1+Math.exp(3.5-r[b][_]/300))-.14,d=f.PSY.mask_adjust_short-p),f.masking_lower=Math.pow(10,.1*d),init_outer_loop(f,v),c[b][_]=n.calc_xmin(e,a[b][_],v,i[b][_]),0!=c[b][_]&&(h=0),l[b][_]=126,m+=u[b][_]}}for(b=0;b<f.mode_gr;b++)for(_=0;_<f.channels_out;_++)m>s[f.VBR_max_bitrate]&&(u[b][_]*=s[f.VBR_max_bitrate],u[b][_]/=m),l[b][_]>u[b][_]&&(l[b][_]=u[b][_]);return h},this.bitpressure_strategy=function(e,t,n,r){for(var o=0;o<e.mode_gr;o++)for(var a=0;a<e.channels_out;a++){for(var i=e.l3_side.tt[o][a],s=t[o][a],l=0,u=0;u<i.psy_lmax;u++)s[l++]*=1+.029*u*u/D0.SBMAX_l/D0.SBMAX_l;if(i.block_type==D0.SHORT_TYPE)for(u=i.sfb_smin;u<D0.SBMAX_s;u++)s[l++]*=1+.029*u*u/D0.SBMAX_s/D0.SBMAX_s,s[l++]*=1+.029*u*u/D0.SBMAX_s/D0.SBMAX_s,s[l++]*=1+.029*u*u/D0.SBMAX_s/D0.SBMAX_s;r[o][a]=0|Math.max(n[o][a],.9*r[o][a])}},this.VBR_new_prepare=function(e,r,o,a,i,s){var l,u=e.internal_flags,c=1,d=0,f=0;if(e.free_format){u.bitrate_index=0;var p=new MeanBits(d);l=t.ResvFrameBegin(e,p),d=p.bits,i[0]=l}else{u.bitrate_index=u.VBR_max_bitrate;p=new MeanBits(d);t.ResvFrameBegin(e,p),d=p.bits,get_framebits(e,i),l=i[u.VBR_max_bitrate]}for(var h=0;h<u.mode_gr;h++){n.on_pe(e,r,s[h],d,h,0),u.mode_ext==D0.MPG_MD_MS_LR&&ms_convert(u.l3_side,h);for(var m=0;m<u.channels_out;++m){var g=u.l3_side.tt[h][m];u.masking_lower=Math.pow(10,.1*u.PSY.mask_adjust),init_outer_loop(u,g),0!=n.calc_xmin(e,o[h][m],g,a[h][m])&&(c=0),f+=s[h][m]}}for(h=0;h<u.mode_gr;h++)for(m=0;m<u.channels_out;m++)f>l&&(s[h][m]*=l,s[h][m]/=f);return c},this.calc_target_bits=function(r,o,a,i,s,l){var u,c,d,f,p=r.internal_flags,h=p.l3_side,m=0;p.bitrate_index=p.VBR_max_bitrate;var g=new MeanBits(m);for(l[0]=t.ResvFrameBegin(r,g),m=g.bits,p.bitrate_index=1,m=e.getframebits(r)-8*p.sideinfo_len,s[0]=m/(p.mode_gr*p.channels_out),m=r.VBR_mean_bitrate_kbps*r.framesize*1e3,1&p.substep_shaping&&(m*=1.09),m/=r.out_samplerate,m-=8*p.sideinfo_len,m/=p.mode_gr*p.channels_out,(u=.93+.07*(11-r.compression_ratio)/5.5)<.9&&(u=.9),u>1&&(u=1),c=0;c<p.mode_gr;c++){var b=0;for(d=0;d<p.channels_out;d++){if(i[c][d]=int(u*m),o[c][d]>700){var y=int((o[c][d]-700)/1.4),_=h.tt[c][d];i[c][d]=int(u*m),_.block_type==D0.SHORT_TYPE&&y<m/2&&(y=m/2),y>3*m/2?y=3*m/2:y<0&&(y=0),i[c][d]+=y}i[c][d]>LameInternalFlags.MAX_BITS_PER_CHANNEL&&(i[c][d]=LameInternalFlags.MAX_BITS_PER_CHANNEL),b+=i[c][d]}if(b>LameInternalFlags.MAX_BITS_PER_GRANULE)for(d=0;d<p.channels_out;++d)i[c][d]*=LameInternalFlags.MAX_BITS_PER_GRANULE,i[c][d]/=b}if(p.mode_ext==D0.MPG_MD_MS_LR)for(c=0;c<p.mode_gr;c++)n.reduce_side(i[c],a[c],m*p.channels_out,LameInternalFlags.MAX_BITS_PER_GRANULE);for(f=0,c=0;c<p.mode_gr;c++)for(d=0;d<p.channels_out;d++)i[c][d]>LameInternalFlags.MAX_BITS_PER_CHANNEL&&(i[c][d]=LameInternalFlags.MAX_BITS_PER_CHANNEL),f+=i[c][d];if(f>l[0])for(c=0;c<p.mode_gr;c++)for(d=0;d<p.channels_out;d++)i[c][d]*=l[0],i[c][d]/=f}}var P2=$2,Z2=Q0,oa=Z2.assert;function K2(){var e;this.setModules=function(t){e=t},this.ResvFrameBegin=function(t,n){var r,o=t.internal_flags,a=o.l3_side,i=e.getframebits(t);n.bits=(i-8*o.sideinfo_len)/o.mode_gr;var s=2048*o.mode_gr-8;t.brate>320?r=8*int(1e3*t.brate/(t.out_samplerate/1152)/8+.5):(r=11520,t.strict_ISO&&(r=8*int(32e4/(t.out_samplerate/1152)/8+.5))),o.ResvMax=r-i,o.ResvMax>s&&(o.ResvMax=s),(o.ResvMax<0||t.disable_reservoir)&&(o.ResvMax=0);var l=n.bits*o.mode_gr+Math.min(o.ResvSize,o.ResvMax);return l>r&&(l=r),oa(o.ResvMax%8==0),oa(o.ResvMax>=0),a.resvDrain_pre=0,null!=o.pinfo&&(o.pinfo.mean_bits=n.bits/2,o.pinfo.resvsize=o.ResvSize),l},this.ResvMaxBits=function(e,t,n,r){var o,a=e.internal_flags,i=a.ResvSize,s=a.ResvMax;0!=r&&(i+=t),1&a.substep_shaping&&(s*=.9),n.bits=t,10*i>9*s?(o=i-9*s/10,n.bits+=o,a.substep_shaping|=128):(o=0,a.substep_shaping&=127,!e.disable_reservoir&&!(1&a.substep_shaping)&&(n.bits-=.1*t));var l=i<6*a.ResvMax/10?i:6*a.ResvMax/10;return(l-=o)<0&&(l=0),l},this.ResvAdjust=function(e,t){e.ResvSize-=t.part2_3_length+t.part2_length},this.ResvFrameEnd=function(e,t){var n,r=e.l3_side;e.ResvSize+=t*e.mode_gr;var o=0;r.resvDrain_post=0,r.resvDrain_pre=0,0!=(n=e.ResvSize%8)&&(o+=n),(n=e.ResvSize-o-e.ResvMax)>0&&(o+=n);var a=Math.min(8*r.main_data_begin,o)/8;r.resvDrain_pre+=8*a,o-=8*a,e.ResvSize-=8*a,r.main_data_begin-=a,r.resvDrain_post+=o,e.ResvSize-=o}}var U2=K2;function Q2(){this.getLameVersion=function(){return"3.98.4"},this.getLameShortVersion=function(){return"3.98.4"},this.getLameVeryShortVersion=function(){return"LAME3.98r"},this.getPsyVersion=function(){return"0.93"},this.getLameUrl=function(){return"http://www.mp3dev.org/"},this.getLameOsBitness=function(){return"32bits"}}var W2=Q2,D1=Q0,j2=D1.System,Ie=D1.VbrMode,ha=D1.ShortBlock,z2=D1.Arrays,te=D1.new_byte,J2=D1.assert;function Q1(){var e,t,n;this.setModules=function(r,o,a){e=r,t=o,n=a};var r=Q1.NUMTOCENTRIES,o=Q1.MAXFRAMESIZE,a=r+4+4+4+4+4+9+1+1+8+1+1+3+1+1+2+4+2+2,i="Xing",s="Info",l=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];function u(e,t){var n=255&e[t+0];return n<<=8,n|=255&e[t+1],n<<=8,n|=255&e[t+2],n<<=8,n|=255&e[t+3]}function c(e,t,n){e[t+0]=255&n>>24,e[t+1]=255&n>>16,e[t+2]=255&n>>8,e[t+3]=255&n}function d(e,t,n){e[t+0]=255&n>>8,e[t+1]=255&n}function f(e,t,n){return 255&(e<<t|n&~(-1<<t))}function p(t,n){var r=t.internal_flags;n[0]=f(n[0],8,255),n[1]=f(n[1],3,7),n[1]=f(n[1],1,t.out_samplerate<16e3?0:1),n[1]=f(n[1],1,t.version),n[1]=f(n[1],2,1),n[1]=f(n[1],1,t.error_protection?0:1),n[2]=f(n[2],4,r.bitrate_index),n[2]=f(n[2],2,r.samplerate_index),n[2]=f(n[2],1,0),n[2]=f(n[2],1,t.extension),n[3]=f(n[3],2,t.mode.ordinal()),n[3]=f(n[3],2,r.mode_ext),n[3]=f(n[3],1,t.copyright),n[3]=f(n[3],1,t.original),n[3]=f(n[3],2,t.emphasis),n[0]=255;var o,a,i=241&n[1];o=1==t.version?128:t.out_samplerate<16e3?32:64,t.VBR==Ie.vbr_off&&(o=t.brate),a=t.free_format?0:255&16*e.BitrateIndex(o,t.version,t.out_samplerate),1==t.version?(n[1]=255&i|10,i=13&n[2],n[2]=255&(a|i)):(n[1]=255&i|2,i=13&n[2],n[2]=255&(a|i))}function h(e,t){return t=t>>8^l[255&(t^e)]}this.addVbrFrame=function(e){var t=e.internal_flags,n=Tables.bitrate_table[e.version][t.bitrate_index];J2(null!=t.VBR_seek_table.bag),function(e,t){if(e.nVbrNumFrames++,e.sum+=t,e.seen++,!(e.seen<e.want)&&(e.pos<e.size&&(e.bag[e.pos]=e.sum,e.pos++,e.seen=0),e.pos==e.size)){for(var n=1;n<e.size;n+=2)e.bag[n/2]=e.bag[n];e.want*=2,e.pos/=2}}(t.VBR_seek_table,n)},this.getVbrTag=function(e){var t=new VBRTagData,n=0;t.flags=0;var o=e[n+1]>>3&1,a=e[n+2]>>2&3,l=e[n+3]>>6&3,c=e[n+2]>>4&15;if(c=Tables.bitrate_table[o][c],e[n+1]>>4==14?t.samprate=Tables.samplerate_table[2][a]:t.samprate=Tables.samplerate_table[o][a],!function(e,t){return new String(e,t,4(),null).equals(i)||new String(e,t,4(),null).equals(s)}(e,n+=0!=o?3!=l?36:21:3!=l?21:13))return null;n+=4,t.hId=o;var d=t.flags=u(e,n);if(n+=4,1&d&&(t.frames=u(e,n),n+=4),2&d&&(t.bytes=u(e,n),n+=4),4&d){if(null!=t.toc)for(var f=0;f<r;f++)t.toc[f]=e[n+f];n+=r}t.vbrScale=-1,8&d&&(t.vbrScale=u(e,n),n+=4),t.headersize=72e3*(o+1)*c/t.samprate;var p=e[(n+=21)+0]<<4;p+=e[n+1]>>4;var h=(15&e[n+1])<<8;return(p<0||p>3e3)&&(p=-1),((h+=255&e[n+2])<0||h>3e3)&&(h=-1),t.encDelay=p,t.encPadding=h,t},this.InitVbrTag=function(e){var n,r=e.internal_flags;n=1==e.version?128:e.out_samplerate<16e3?32:64,e.VBR==Ie.vbr_off&&(n=e.brate);var i=72e3*(e.version+1)*n/e.out_samplerate,s=r.sideinfo_len+a;if(r.VBR_seek_table.TotalFrameSize=i,i<s||i>o)e.bWriteVbrTag=!1;else{r.VBR_seek_table.nVbrNumFrames=0,r.VBR_seek_table.nBytesWritten=0,r.VBR_seek_table.sum=0,r.VBR_seek_table.seen=0,r.VBR_seek_table.want=1,r.VBR_seek_table.pos=0,null==r.VBR_seek_table.bag&&(r.VBR_seek_table.bag=new int[400],r.VBR_seek_table.size=400);var l=te(o);p(e,l);for(var u=r.VBR_seek_table.TotalFrameSize,c=0;c<u;++c)t.add_dummy_byte(e,255&l[c],1)}},this.updateMusicCRC=function(e,t,n,r){for(var o=0;o<r;++o)e[0]=h(t[n+o],e[0])},this.getLameTagFrame=function(e,o){var a=e.internal_flags;if(!e.bWriteVbrTag||a.Class_ID!=Lame.LAME_ID||a.VBR_seek_table.pos<=0)return 0;if(o.length<a.VBR_seek_table.TotalFrameSize)return a.VBR_seek_table.TotalFrameSize;z2.fill(o,0,a.VBR_seek_table.TotalFrameSize,0),p(e,o);var l=te(r);if(e.free_format)for(var u=1;u<r;++u)l[u]=255&255*u/100;else!function(e,t){if(!(e.pos<=0))for(var n=1;n<r;++n){var o=n/r,a=0|Math.floor(o*e.pos);a>e.pos-1&&(a=e.pos-1);var i=0|256*e.bag[a]/e.sum;i>255&&(i=255),t[n]=255&i}}(a.VBR_seek_table,l);var f=a.sideinfo_len;e.error_protection&&(f-=2),e.VBR==Ie.vbr_off?(o[f++]=255&s.charAt(0),o[f++]=255&s.charAt(1),o[f++]=255&s.charAt(2),o[f++]=255&s.charAt(3)):(o[f++]=255&i.charAt(0),o[f++]=255&i.charAt(1),o[f++]=255&i.charAt(2),o[f++]=255&i.charAt(3)),c(o,f,15),c(o,f+=4,a.VBR_seek_table.nVbrNumFrames),f+=4;var m=a.VBR_seek_table.nBytesWritten+a.VBR_seek_table.TotalFrameSize;c(o,f,0|m),f+=4,j2.arraycopy(l,0,o,f,l.length),f+=l.length,e.error_protection&&t.CRC_writeheader(a,o);var g=0;for(u=0;u<f;u++)g=h(o[u],g);return f+=function(e,t,r,o,a){var i,s,l,u,f,p=e.internal_flags,m=0,g=e.encoder_delay,b=e.encoder_padding,y=100-10*e.VBR_q-e.quality,_=n.getLameVeryShortVersion(),v=[1,5,3,2,4,0,3],w=0|(e.lowpassfreq/100+.5>255?255:e.lowpassfreq/100+.5),S=0,x=0,T=e.internal_flags.noise_shaping,E=0,k=0,P=0,O=!!(1&e.exp_nspsytune),A=!!(2&e.exp_nspsytune),R=!1,$=!1,I=e.internal_flags.nogap_total,C=e.internal_flags.nogap_current,D=e.ATHtype;switch(e.VBR){case vbr_abr:f=e.VBR_mean_bitrate_kbps;break;case vbr_off:f=e.brate;break;default:f=e.VBR_min_bitrate_kbps}switch(i=0+(e.VBR.ordinal()<v.length?v[e.VBR.ordinal()]:0),p.findReplayGain&&(p.RadioGain>510&&(p.RadioGain=510),p.RadioGain<-510&&(p.RadioGain=-510),x=8192,x|=3072,p.RadioGain>=0?x|=p.RadioGain:(x|=512,x|=-p.RadioGain)),p.findPeakSample&&(S=Math.abs(0|p.PeakSample/32767*Math.pow(2,23)+.5)),-1!=I&&(C>0&&($=!0),C<I-1&&(R=!0)),u=D+((O?1:0)<<4)+((A?1:0)<<5)+((R?1:0)<<6)+(($?1:0)<<7),y<0&&(y=0),e.mode){case MONO:E=0;break;case STEREO:E=1;break;case DUAL_CHANNEL:E=2;break;case JOINT_STEREO:E=e.force_ms?4:3;break;case NOT_SET:default:E=7}P=e.in_samplerate<=32e3?0:48e3==e.in_samplerate?2:e.in_samplerate>48e3?3:1,(e.short_blocks==ha.short_block_forced||e.short_blocks==ha.short_block_dispensed||-1==e.lowpassfreq&&-1==e.highpassfreq||e.scale_left<e.scale_right||e.scale_left>e.scale_right||e.disable_reservoir&&e.brate<320||e.noATH||e.ATHonly||0==D||e.in_samplerate<=32e3)&&(k=1),s=T+(E<<2)+(k<<5)+(P<<6),l=p.nMusicCRC,c(r,o+m,y),m+=4;for(var N=0;N<9;N++)r[o+m+N]=255&_.charAt(N);r[o+(m+=9)]=255&i,r[o+ ++m]=255&w,c(r,o+ ++m,S),d(r,o+(m+=4),x),d(r,o+(m+=2),0),r[o+(m+=2)]=255&u,r[o+ ++m]=f>=255?255:255&f,r[o+ ++m]=255&g>>4,r[o+m+1]=255&(g<<4)+(b>>8),r[o+m+2]=255&b,r[o+(m+=3)]=255&s,m++,r[o+m++]=0,d(r,o+m,e.preset),c(r,o+(m+=2),t),d(r,o+(m+=4),l),m+=2;for(var M=0;M<m;M++)a=h(r[o+M],a);return d(r,o+m,a),m+2}(e,m,o,f,g),a.VBR_seek_table.TotalFrameSize},this.putVbrTag=function(e,t){if(e.internal_flags.VBR_seek_table.pos<=0||(t.seek(t.length()),0==t.length()))return-1;var n=function(e){e.seek(0);var t=te(10);return e.readFully(t),new String(t,"ISO-8859-1").startsWith("ID3")?0:((127&t[6])<<21|(127&t[7])<<14|(127&t[8])<<7|127&t[9])+t.length}(t);t.seek(n);var r=te(o),a=getLameTagFrame(e,r);return a>r.length?-1:(a<1||t.write(r,0,a),0)}}Q1.NUMTOCENTRIES=100,Q1.MAXFRAMESIZE=2880;var g2=Q1,Fa=Q0,ua=Fa.new_byte,er=Fa.assert,ar=Oe(),rr=V2,tr=Na,sr=Va(),ir=P2,nr=Oa(),_r=U2,lr=j1,vr=Ve();t1();var or=W2,hr=g2;function ur(){this.setModules=function(e,t){}}function fr(){this.setModules=function(e,t,n){}}function mr(){}function br(){this.setModules=function(e,t){}}function cr(e,t,n){3!=arguments.length&&(console.error("WARN: Mp3Encoder(channels, samplerate, kbps) not specified"),e=1,t=44100,n=128);var r=new ar,o=new ur,a=new tr,i=new vr,s=new rr,l=new sr,u=new ir,c=new hr,d=new or,f=new br,p=new _r,h=new nr,m=new fr,g=new mr;r.setModules(a,i,s,l,u,c,d,f,g),i.setModules(a,g,d,c),f.setModules(i,d),s.setModules(r),u.setModules(i,p,l,h),l.setModules(h,p,r.enc.psy),p.setModules(i),h.setModules(l),c.setModules(r,i,d),o.setModules(m,g),m.setModules(d,f,s);var b=r.lame_init();b.num_channels=e,b.in_samplerate=t,b.brate=n,b.mode=lr.STEREO,b.quality=3,b.bWriteVbrTag=!1,b.disable_reservoir=!0,b.write_id3tag_automatic=!1,r.lame_init_params(b);var y=1152,_=0|1.25*y+7200,v=ua(_);this.encodeBuffer=function(t,n){1==e&&(n=t),er(t.length==n.length),t.length>y&&(y=t.length,v=ua(_=0|1.25*y+7200));var o=r.lame_encode_buffer(b,t,n,t.length,v,0,_);return new Int8Array(v.subarray(0,o))},this.flush=function(){var e=r.lame_encode_flush(b,v,0,_);return new Int8Array(v.subarray(0,e))}}function A1(){this.dataOffset=0,this.dataLen=0,this.channels=0,this.sampleRate=0}function _e(e){return e.charCodeAt(0)<<24|e.charCodeAt(1)<<16|e.charCodeAt(2)<<8|e.charCodeAt(3)}A1.RIFF=_e("RIFF"),A1.WAVE=_e("WAVE"),A1.fmt_=_e("fmt "),A1.data=_e("data"),A1.readHeader=function(e){var t=new A1,n=e.getUint32(0,!1);if(A1.RIFF==n&&(e.getUint32(4,!0),A1.WAVE==e.getUint32(8,!1)&&A1.fmt_==e.getUint32(12,!1))){var r=e.getUint32(16,!0),o=20;switch(r){case 16:case 18:t.channels=e.getUint16(o+2,!0),t.sampleRate=e.getUint32(o+4,!0);break;default:throw"extended fmt chunk not implemented"}o+=r;for(var a=A1.data,i=0;a!=n&&(n=e.getUint32(o,!1),i=e.getUint32(o+4,!0),a!=n);)o+=i+8;return t.dataLen=i,t.dataOffset=o+8,t}};var Sr=cr;const compressAudioToMp3=e=>{try{const t=new Sr(1,SAMPLING_RATE,BITRATE),n=new Int16Array(e.length);for(let i=0;i<e.length;i++){const t=Math.max(-1,Math.min(1,e[i]));n[i]=t<0?32768*t:32767*t}const r=[],o=t.encodeBuffer(n);o&&o.length>0&&r.push(o);const a=t.flush();return a&&a.length>0&&r.push(a),r}catch(t){return console.error("Error compressing audio to MP3: lamejs: ",t),[]}};class AudioBufferManager{constructor(e,t){this.currentSampleLength=0,this.currentFrameLength=0,this.samplingRate=0,this.incrementalAllocationSize=0,this.samplingRate=e,this.incrementalAllocationSize=Math.floor(e*t),this.buffer=new Float32Array(this.incrementalAllocationSize),this.currentSampleLength=0}append(e){return this.currentSampleLength+e.length>this.buffer.length&&this.expandBuffer(),this.buffer.set(e,this.currentSampleLength),this.currentSampleLength+=e.length,this.currentFrameLength+=1,this.currentSampleLength}getAudioData(){return this.buffer.slice(0,this.currentSampleLength)}getCurrentSampleLength(){return this.currentSampleLength}getCurrentFrameLength(){return this.currentFrameLength}getDurationInSeconds(){return this.currentSampleLength/this.samplingRate}expandBuffer(){const e=this.buffer.length+this.incrementalAllocationSize,t=new Float32Array(e);t.set(this.buffer,0),this.buffer=t}calculateChunkTimestamps(e){const t=e/SAMPLING_RATE-this.getDurationInSeconds(),n=t+this.getDurationInSeconds();return{start:`${Math.floor(t/60).toString().padStart(2,"0")}:${(t%60).toFixed(6).toString().padStart(2,"0")}`,end:`${Math.floor(n/60).toString().padStart(2,"0")}:${(n%60).toFixed(6).toString().padStart(2,"0")}`}}resetBufferState(){this.currentSampleLength=0,this.currentFrameLength=0}resetBufferManagerInstance(){this.buffer=new Float32Array(this.incrementalAllocationSize),this.currentSampleLength=0,this.currentFrameLength=0}}const DEFAULT_MAX_RETRIES=3,DEFAULT_DELAY=2e3;async function retryWrapper(e,t={}){const{maxRetries:n=DEFAULT_MAX_RETRIES,delay:r=DEFAULT_DELAY}=t;let o=null;for(let i=0;i<=n;i++)try{return await e()}catch(a){o=a,console.log(`Upload attempt ${i+1} failed:`,(null==a?void 0:a.message)||a);const e=(null==a?void 0:a.statusCode)||(null==a?void 0:a.code);if("number"==typeof e&&e>=400&&e<500&&408!==e&&429!==e)throw a;i<n&&await new Promise(e=>setTimeout(e,r))}throw o||new Error("Upload failed after retries")}async function uploadFileWithFormData(e,t,n,r,o){const a=async()=>{const o=new FormData;o.append("file",n,t);const a=await fetch(e,{method:"POST",body:o,headers:{...r||{}}});if(!a.ok){const e=new Error(a.statusText||"Upload failed");throw e.statusCode=a.status,e}return{success:a.headers.get("ETag")||"Upload successful"}};try{return await retryWrapper(a,o)}catch(i){return{error:i.message||"Network error",code:i.statusCode||0}}}class AudioFileManager{initialiseClassInstance(){this.audioChunks=[],this.uploadPromises=[],this.successfulUploads=[],this.totalInsertedFrames=0,this.totalInsertedSamples=0,this.totalRawSamples=0,this.totalRawFrames=0}constructor(){this.audioChunks=[],this.uploadPromises=[],this.successfulUploads=[],this.totalRawSamples=0,this.totalRawFrames=0,this.totalInsertedSamples=0,this.totalInsertedFrames=0,this.sessionId="",this.uploadUrl="",this.initialiseClassInstance()}setSessionInfo({sessionId:e,uploadUrl:t,uploadHeaders:n}){this.sessionId=e,this.uploadUrl=t,this.uploadHeaders=n}setUploadProgressCallback(e){this.onUploadProgress=e}getRawSampleDetails(){return{totalRawSamples:this.totalRawSamples,totalRawFrames:this.totalRawFrames}}incrementTotalRawSamples(e){this.totalRawSamples+=e.length,this.totalRawFrames+=1}incrementInsertedSamples(e,t){this.totalInsertedSamples+=e,this.totalInsertedFrames+=t}getInsertedSampleDetails(){return{totalInsertedSamples:this.totalInsertedSamples,totalInsertedFrames:this.totalInsertedFrames}}updateAudioInfo(e){return this.audioChunks.push(e),this.audioChunks.length}async uploadAudio({audioFrames:e,fileName:t,chunkIndex:n}){await this.uploadAudioChunkInMain({audioFrames:e,fileName:t,chunkIndex:n})}async uploadAudioChunkInMain({audioFrames:e,fileName:t,chunkIndex:n}){if(!this.uploadUrl)return console.error("Upload URL not set"),{success:!1,fileName:t};const r=compressAudioToMp3(e),o=new Blob(r,{type:AUDIO_EXTENSION_TYPE_MAP[OUTPUT_FORMAT]}),a=uploadFileWithFormData(this.uploadUrl,t,o,this.uploadHeaders).then(e=>{var r;return e.success?(this.successfulUploads.push(t),-1!==n&&this.audioChunks[n]&&(this.audioChunks[n]={...this.audioChunks[n],audioFrames:void 0,fileBlob:void 0,status:"success",response:e.success}),null==(r=this.onUploadProgress)||r.call(this,[...this.successfulUploads],this.audioChunks.length)):-1!==n&&this.audioChunks[n]&&(this.audioChunks[n]={...this.audioChunks[n],fileBlob:o,audioFrames:void 0,status:"failure",response:e.error||"Upload failed"}),e});return this.uploadPromises.push(a),{success:!0,fileName:t}}async waitForAllUploads(){await Promise.allSettled(this.uploadPromises)}getSuccessfulUploads(){return[...this.successfulUploads]}getFailedUploads(){const e=[];return this.audioChunks.forEach(t=>{"success"!=t.status&&e.push(t.fileName)}),e}getTotalAudioChunks(){return this.audioChunks}async retryFailedUploads(){return 0===this.getFailedUploads().length?[]:(this.uploadPromises=[],this.audioChunks.forEach((e,t)=>{const{fileName:n,fileBlob:r,status:o,audioFrames:a}=e;if("success"!=o){let e;if("failure"===o)e=r;else if("pending"===o&&a){const t=compressAudioToMp3(a);e=new Blob(t,{type:AUDIO_EXTENSION_TYPE_MAP[OUTPUT_FORMAT]})}if(e){const r=uploadFileWithFormData(this.uploadUrl,n,e,this.uploadHeaders).then(e=>{var r;return e.success&&(this.successfulUploads.push(n),this.audioChunks[t]={...this.audioChunks[t],audioFrames:void 0,fileBlob:void 0,status:"success",response:e.success},null==(r=this.onUploadProgress)||r.call(this,[...this.successfulUploads],this.audioChunks.length)),e});this.uploadPromises.push(r)}}}),await this.waitForAllUploads(),this.getFailedUploads())}resetFileManagerInstance(){this.uploadPromises.forEach(e=>e.catch(()=>{})),this.initialiseClassInstance(),this.sessionId="",this.uploadUrl="",this.uploadHeaders=void 0}}var dist={},ortWeb_min={exports:{}};const backends={},backendsSortedByPriority=[],registerBackend=(e,t,n)=>{if(t&&"function"==typeof t.init&&"function"==typeof t.createSessionHandler){const r=backends[e];if(void 0===r)backends[e]={backend:t,priority:n};else{if(r.priority>n)return;if(r.priority===n&&r.backend!==t)throw new Error(`cannot register backend "${e}" using priority ${n}`)}if(n>=0){const t=backendsSortedByPriority.indexOf(e);-1!==t&&backendsSortedByPriority.splice(t,1);for(let r=0;r<backendsSortedByPriority.length;r++)if(backends[backendsSortedByPriority[r]].priority<=n)return void backendsSortedByPriority.splice(r,0,e);backendsSortedByPriority.push(e)}return}throw new TypeError("not a valid backend")},resolveBackend=async e=>{const t=0===e.length?backendsSortedByPriority:e,n=[];for(const o of t){const e=backends[o];if(e){if(e.initialized)return e.backend;if(e.aborted)continue;const t=!!e.initPromise;try{return t||(e.initPromise=e.backend.init()),await e.initPromise,e.initialized=!0,e.backend}catch(r){t||n.push({name:o,err:r}),e.aborted=!0}finally{delete e.initPromise}}}throw new Error(`no available backend found. ERR: ${n.map(e=>`[${e.name}] ${e.err}`).join(", ")}`)};class EnvImpl{constructor(){this.wasm={},this.webgl={},this.logLevelInternal="warning"}set logLevel(e){if(void 0!==e){if("string"!=typeof e||-1===["verbose","info","warning","error","fatal"].indexOf(e))throw new Error(`Unsupported logging level: ${e}`);this.logLevelInternal=e}}get logLevel(){return this.logLevelInternal}}const env=new EnvImpl,isBigInt64ArrayAvailable="undefined"!=typeof BigInt64Array&&"function"==typeof BigInt64Array.from,isBigUint64ArrayAvailable="undefined"!=typeof BigUint64Array&&"function"==typeof BigUint64Array.from,NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array]]),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);isBigInt64ArrayAvailable&&(NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set("int64",BigInt64Array),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigInt64Array,"int64")),isBigUint64ArrayAvailable&&(NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set("uint64",BigUint64Array),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigUint64Array,"uint64"));const calculateSize=e=>{let t=1;for(let n=0;n<e.length;n++){const r=e[n];if("number"!=typeof r||!Number.isSafeInteger(r))throw new TypeError(`dims[${n}] must be an integer, got: ${r}`);if(r<0)throw new RangeError(`dims[${n}] must be a non-negative integer, got: ${r}`);t*=r}return t};let Tensor$1=class e{constructor(e,t,n){let r,o,a;if("string"==typeof e)if(r=e,a=n,"string"===e){if(!Array.isArray(t))throw new TypeError("A string tensor's data must be a string array.");o=t}else{const n=NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.get(e);if(void 0===n)throw new TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(t))o=n.from(t);else{if(!(t instanceof n))throw new TypeError(`A ${r} tensor's data must be type of ${n}`);o=t}}else if(a=t,Array.isArray(e)){if(0===e.length)throw new TypeError("Tensor type cannot be inferred from an empty array.");const t=typeof e[0];if("string"===t)r="string",o=e;else{if("boolean"!==t)throw new TypeError(`Invalid element type of data array: ${t}.`);r="bool",o=Uint8Array.from(e)}}else{const t=NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.get(e.constructor);if(void 0===t)throw new TypeError(`Unsupported type for tensor data: ${e.constructor}.`);r=t,o=e}if(void 0===a)a=[o.length];else if(!Array.isArray(a))throw new TypeError("A tensor's dims must be a number array");const i=calculateSize(a);if(i!==o.length)throw new Error(`Tensor's size(${i}) does not match data length(${o.length}).`);this.dims=a,this.type=r,this.data=o,this.size=i}static bufferToTensor(t,n){if(void 0===t)throw new Error("Image buffer must be defined");if(void 0===n.height||void 0===n.width)throw new Error("Image height and width must be defined");const{height:r,width:o}=n,a=n.norm;let i,s;i=void 0===a||void 0===a.mean?255:a.mean,s=void 0===a||void 0===a.bias?0:a.bias;const l=void 0!==n.bitmapFormat?n.bitmapFormat:"RGBA",u=void 0!==n.tensorFormat&&void 0!==n.tensorFormat?n.tensorFormat:"RGB",c=r*o,d="RGBA"===u?new Float32Array(4*c):new Float32Array(3*c);let f=4,p=0,h=1,m=2,g=3,b=0,y=c,_=2*c,v=-1;"RGB"===l&&(f=3,p=0,h=1,m=2,g=-1),"RGBA"===u?v=3*c:"RBG"===u?(b=0,_=c,y=2*c):"BGR"===u&&(_=0,y=c,b=2*c);for(let e=0;e<c;e++,p+=f,m+=f,h+=f,g+=f)d[b++]=(t[p]+s)/i,d[y++]=(t[h]+s)/i,d[_++]=(t[m]+s)/i,-1!==v&&-1!==g&&(d[v++]=(t[g]+s)/i);return new e("float32",d,"RGBA"===u?[1,4,r,o]:[1,3,r,o])}static async fromImage(t,n){const r="undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement,o="undefined"!=typeof ImageData&&t instanceof ImageData,a="undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap,i="undefined"!=typeof String&&(t instanceof String||"string"==typeof t);let s,l={};if(r){const e=document.createElement("canvas"),r=e.getContext("2d");if(null==r)throw new Error("Can not access image data");{let o=t.naturalHeight,a=t.naturalWidth;if(void 0!==n&&void 0!==n.resizedHeight&&void 0!==n.resizedWidth&&(o=n.resizedHeight,a=n.resizedWidth),void 0!==n){if(l=n,void 0!==n.tensorFormat)throw new Error("Image input config format must be RGBA for HTMLImageElement");if(l.tensorFormat="RGBA",void 0!==n.height&&n.height!==o)throw new Error("Image input config height doesn't match HTMLImageElement height");if(l.height=o,void 0!==n.width&&n.width!==a)throw new Error("Image input config width doesn't match HTMLImageElement width");l.width=a}else l.tensorFormat="RGBA",l.height=o,l.width=a;e.width=a,e.height=o,r.drawImage(t,0,0,a,o),s=r.getImageData(0,0,a,o).data}}else{if(!o){if(a){if(void 0===n)throw new Error("Please provide image config with format for Imagebitmap");if(void 0!==n.bitmapFormat)throw new Error("Image input config format must be defined for ImageBitmap");const r=document.createElement("canvas").getContext("2d");if(null!=r){const o=t.height,a=t.width;if(r.drawImage(t,0,0,a,o),s=r.getImageData(0,0,a,o).data,void 0!==n){if(void 0!==n.height&&n.height!==o)throw new Error("Image input config height doesn't match ImageBitmap height");if(l.height=o,void 0!==n.width&&n.width!==a)throw new Error("Image input config width doesn't match ImageBitmap width");l.width=a}else l.height=o,l.width=a;return e.bufferToTensor(s,l)}throw new Error("Can not access image data")}if(i)return new Promise((r,o)=>{const a=document.createElement("canvas"),i=a.getContext("2d");if(!t||!i)return o();const s=new Image;s.crossOrigin="Anonymous",s.src=t,s.onload=()=>{a.width=s.width,a.height=s.height,i.drawImage(s,0,0,a.width,a.height);const t=i.getImageData(0,0,a.width,a.height);if(void 0!==n){if(void 0!==n.height&&n.height!==a.height)throw new Error("Image input config height doesn't match ImageBitmap height");if(l.height=a.height,void 0!==n.width&&n.width!==a.width)throw new Error("Image input config width doesn't match ImageBitmap width");l.width=a.width}else l.height=a.height,l.width=a.width;r(e.bufferToTensor(t.data,l))}});throw new Error("Input data provided is not supported - aborted tensor creation")}{const e="RGBA";let r,o;if(void 0!==n&&void 0!==n.resizedWidth&&void 0!==n.resizedHeight?(r=n.resizedHeight,o=n.resizedWidth):(r=t.height,o=t.width),void 0!==n){if(l=n,void 0!==n.bitmapFormat&&n.bitmapFormat!==e)throw new Error("Image input config format must be RGBA for ImageData");l.bitmapFormat="RGBA"}else l.bitmapFormat="RGBA";if(l.height=r,l.width=o,void 0!==n){const e=document.createElement("canvas");e.width=o,e.height=r;const n=e.getContext("2d");if(null==n)throw new Error("Can not access image data");n.putImageData(t,0,0),s=n.getImageData(0,0,o,r).data}else s=t.data}}if(void 0!==s)return e.bufferToTensor(s,l);throw new Error("Input data provided is not supported - aborted tensor creation")}toImageData(e){var t,n;const r=document.createElement("canvas").getContext("2d");let o;if(null==r)throw new Error("Can not access image data");{const a=this.dims[3],i=this.dims[2],s=this.dims[1],l=void 0!==e&&void 0!==e.format?e.format:"RGB",u=void 0!==e&&void 0!==(null===(t=e.norm)||void 0===t?void 0:t.mean)?e.norm.mean:255,c=void 0!==e&&void 0!==(null===(n=e.norm)||void 0===n?void 0:n.bias)?e.norm.bias:0,d=i*a;if(void 0!==e){if(void 0!==e.height&&e.height!==i)throw new Error("Image output config height doesn't match tensor height");if(void 0!==e.width&&e.width!==a)throw new Error("Image output config width doesn't match tensor width");if(void 0!==e.format&&4===s&&"RGBA"!==e.format||3===s&&"RGB"!==e.format&&"BGR"!==e.format)throw new Error("Tensor format doesn't match input tensor dims")}const f=4;let p=0,h=1,m=2,g=3,b=0,y=d,_=2*d,v=-1;"RGBA"===l?(b=0,y=d,_=2*d,v=3*d):"RGB"===l?(b=0,y=d,_=2*d):"RBG"===l&&(b=0,_=d,y=2*d),o=r.createImageData(a,i);for(let e=0;e<i*a;p+=f,h+=f,m+=f,g+=f,e++)o.data[p]=(this.data[b++]-c)*u,o.data[h]=(this.data[y++]-c)*u,o.data[m]=(this.data[_++]-c)*u,o.data[g]=-1===v?255:(this.data[v++]-c)*u}return o}reshape(t){return new e(this.type,this.data,t)}};const Tensor=Tensor$1;let InferenceSession$1=class e{constructor(e){this.handler=e}async run(e,t,n){const r={};let o={};if("object"!=typeof e||null===e||e instanceof Tensor||Array.isArray(e))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let a=!0;if("object"==typeof t){if(null===t)throw new TypeError("Unexpected argument[1]: cannot be null.");if(t instanceof Tensor)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(t)){if(0===t.length)throw new TypeError("'fetches' cannot be an empty array.");a=!1;for(const e of t){if("string"!=typeof e)throw new TypeError("'fetches' must be a string array or an object.");if(-1===this.outputNames.indexOf(e))throw new RangeError(`'fetches' contains invalid output name: ${e}.`);r[e]=null}if("object"==typeof n&&null!==n)o=n;else if(void 0!==n)throw new TypeError("'options' must be an object.")}else{let e=!1;const i=Object.getOwnPropertyNames(t);for(const n of this.outputNames)if(-1!==i.indexOf(n)){const o=t[n];(null===o||o instanceof Tensor)&&(e=!0,a=!1,r[n]=o)}if(e){if("object"==typeof n&&null!==n)o=n;else if(void 0!==n)throw new TypeError("'options' must be an object.")}else o=t}}else if(void 0!==t)throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(const l of this.inputNames)if(void 0===e[l])throw new Error(`input '${l}' is missing in 'feeds'.`);if(a)for(const l of this.outputNames)r[l]=null;const i=await this.handler.run(e,r,o),s={};for(const l in i)Object.hasOwnProperty.call(i,l)&&(s[l]=new Tensor(i[l].type,i[l].data,i[l].dims));return s}static async create(t,n,r,o){let a,i={};if("string"==typeof t){if(a=t,"object"==typeof n&&null!==n)i=n;else if(void 0!==n)throw new TypeError("'options' must be an object.")}else if(t instanceof Uint8Array){if(a=t,"object"==typeof n&&null!==n)i=n;else if(void 0!==n)throw new TypeError("'options' must be an object.")}else{if(!(t instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&t instanceof SharedArrayBuffer))throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");{const e=t;let s=0,l=t.byteLength;if("object"==typeof n&&null!==n)i=n;else if("number"==typeof n){if(s=n,!Number.isSafeInteger(s))throw new RangeError("'byteOffset' must be an integer.");if(s<0||s>=e.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${e.byteLength}).`);if(l=t.byteLength-s,"number"==typeof r){if(l=r,!Number.isSafeInteger(l))throw new RangeError("'byteLength' must be an integer.");if(l<=0||s+l>e.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${e.byteLength-s}].`);if("object"==typeof o&&null!==o)i=o;else if(void 0!==o)throw new TypeError("'options' must be an object.")}else if(void 0!==r)throw new TypeError("'byteLength' must be a number.")}else if(void 0!==n)throw new TypeError("'options' must be an object.");a=new Uint8Array(e,s,l)}}const s=(i.executionProviders||[]).map(e=>"string"==typeof e?e:e.name),l=await resolveBackend(s),u=await l.createSessionHandler(a,i);return new e(u)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}};const InferenceSession=InferenceSession$1,lib=Object.freeze(Object.defineProperty({__proto__:null,InferenceSession:InferenceSession,Tensor:Tensor,env:env,registerBackend:registerBackend},Symbol.toStringTag,{value:"Module"})),require$$0=getAugmentedNamespace(lib);
|
|
75
|
+
/*!
|
|
76
|
+
* ONNX Runtime Web v1.14.0
|
|
77
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
78
|
+
* Licensed under the MIT License.
|
|
79
|
+
*/
|
|
80
|
+
(function(module,exports$1){var e;self,e=__WEBPACK_EXTERNAL_MODULE__1670__=>(()=>{var __webpack_modules__={3474:(e,t,n)=>{var r,o=(r=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(e){function t(){return I.buffer!=D&&G(I.buffer),N}function o(){return I.buffer!=D&&G(I.buffer),M}function a(){return I.buffer!=D&&G(I.buffer),L}function i(){return I.buffer!=D&&G(I.buffer),j}function s(){return I.buffer!=D&&G(I.buffer),F}var l,u,c;e=e||{},l||(l=void 0!==e?e:{}),l.ready=new Promise(function(e,t){u=e,c=t});var d,f,p,h,m,g,b=Object.assign({},l),y="./this.program",_=(e,t)=>{throw t},v="object"==typeof window,w="function"==typeof importScripts,S="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,x=l.ENVIRONMENT_IS_PTHREAD||!1,T="";function E(e){return l.locateFile?l.locateFile(e,T):T+e}if(S){let e;T=w?n(908).dirname(T)+"/":"//",g=()=>{m||(h=n(1384),m=n(908))},d=function(e,t){return g(),e=m.normalize(e),h.readFileSync(e,t?void 0:"utf8")},p=e=>((e=d(e,!0)).buffer||(e=new Uint8Array(e)),e),f=(e,t,n)=>{g(),e=m.normalize(e),h.readFile(e,function(e,r){e?n(e):t(r.buffer)})},1<process.argv.length&&(y=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",function(e){if(!(e instanceof le))throw e}),process.on("unhandledRejection",function(e){throw e}),_=(e,t)=>{if(J())throw process.exitCode=e,t;t instanceof le||R("exiting due to exception: "+t),process.exit(e)},l.inspect=function(){return"[Emscripten Module object]"};try{e=n(9925)}catch(Ut){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),Ut}n.g.Worker=e.Worker}else(v||w)&&(w?T=self.location.href:"undefined"!=typeof document&&document.currentScript&&(T=document.currentScript.src),r&&(T=r),T=0!==T.indexOf("blob:")?T.substr(0,T.replace(/[?#].*/,"").lastIndexOf("/")+1):"",S||(d=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},w&&(p=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),f=(e,t,n)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)}));S&&"undefined"==typeof performance&&(n.g.performance=n(6953).performance);var k=console.log.bind(console),P=console.warn.bind(console);S&&(g(),k=e=>h.writeSync(1,e+"\n"),P=e=>h.writeSync(2,e+"\n"));var O,A=l.print||k,R=l.printErr||P;Object.assign(l,b),b=null,l.thisProgram&&(y=l.thisProgram),l.quit&&(_=l.quit),l.wasmBinary&&(O=l.wasmBinary);var $=l.noExitRuntime||!1;"object"!=typeof WebAssembly&&oe("no native wasm support detected");var I,C,D,N,M,L,j,F,B=!1,U="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function z(e,t,n){var r=(t>>>=0)+n;for(n=t;e[n]&&!(n>=r);)++n;if(16<n-t&&e.buffer&&U)return U.decode(e.buffer instanceof SharedArrayBuffer?e.slice(t,n):e.subarray(t,n));for(r="";t<n;){var o=e[t++];if(128&o){var a=63&e[t++];if(192==(224&o))r+=String.fromCharCode((31&o)<<6|a);else{var i=63&e[t++];65536>(o=224==(240&o)?(15&o)<<12|a<<6|i:(7&o)<<18|a<<12|i<<6|63&e[t++])?r+=String.fromCharCode(o):(o-=65536,r+=String.fromCharCode(55296|o>>10,56320|1023&o))}}else r+=String.fromCharCode(o)}return r}function V(e,t){return(e>>>=0)?z(o(),e,t):""}function H(e,t,n,r){if(!(0<r))return 0;var o=n>>>=0;r=n+r-1;for(var a=0;a<e.length;++a){var i=e.charCodeAt(a);if(55296<=i&&57343>=i&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++a)),127>=i){if(n>=r)break;t[n++>>>0]=i}else{if(2047>=i){if(n+1>=r)break;t[n++>>>0]=192|i>>6}else{if(65535>=i){if(n+2>=r)break;t[n++>>>0]=224|i>>12}else{if(n+3>=r)break;t[n++>>>0]=240|i>>18,t[n++>>>0]=128|i>>12&63}t[n++>>>0]=128|i>>6&63}t[n++>>>0]=128|63&i}}return t[n>>>0]=0,n-o}function q(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);127>=r?t++:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,++n):t+=3}return t}function G(e){D=e,l.HEAP8=N=new Int8Array(e),l.HEAP16=new Int16Array(e),l.HEAP32=L=new Int32Array(e),l.HEAPU8=M=new Uint8Array(e),l.HEAPU16=new Uint16Array(e),l.HEAPU32=j=new Uint32Array(e),l.HEAPF32=new Float32Array(e),l.HEAPF64=F=new Float64Array(e)}x&&(D=l.buffer);var W=l.INITIAL_MEMORY||16777216;if(x)I=l.wasmMemory,D=l.buffer;else if(l.wasmMemory)I=l.wasmMemory;else if(!((I=new WebAssembly.Memory({initial:W/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw R("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),S&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");I&&(D=I.buffer),W=D.byteLength,G(D);var Y,X=[],K=[],Q=[],Z=[];function J(){return $||!1}function ee(){var e=l.preRun.shift();X.unshift(e)}var te,ne=0,re=null;function oe(e){throw x?postMessage({cmd:"onAbort",arg:e}):l.onAbort&&l.onAbort(e),R(e="Aborted("+e+")"),B=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),c(e),e}function ae(){return te.startsWith("data:application/octet-stream;base64,")}function ie(){var e=te;try{if(e==te&&O)return new Uint8Array(O);if(p)return p(e);throw"both async and sync fetching of the wasm failed"}catch(t){oe(t)}}te="ort-wasm-threaded.wasm",ae()||(te=E(te));var se={};function le(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function ue(e){(e=pe.Vb[e])||oe(),pe.mc(e)}function ce(e){var t=pe.Cc();if(!t)return 6;pe.ac.push(t),pe.Vb[e.Ub]=t,t.Ub=e.Ub;var n={cmd:"run",start_routine:e.Ic,arg:e.zc,pthread_ptr:e.Ub};return t.$b=()=>{n.time=performance.now(),t.postMessage(n,e.Nc)},t.loaded&&(t.$b(),delete t.$b),0}function de(e){if(x)return Ge(1,1,e);J()||(pe.oc(),l.onExit&&l.onExit(e),B=!0),_(e,new le(e))}function fe(e,t){if(!t&&x)throw me(e),"unwind";J()||x||(gt(),he(Q),mt(0),nt[1].length&&rt(1,10),nt[2].length&&rt(2,10),pe.oc()),de(e)}var pe={Yb:[],ac:[],qc:[],Vb:{},fc:function(){x&&pe.Ec()},Pc:function(){},Ec:function(){pe.receiveObjectTransfer=pe.Gc,pe.threadInitTLS=pe.pc,pe.setExitStatus=pe.nc,$=!1},nc:function(){},oc:function(){for(var e of Object.values(pe.Vb))pe.mc(e);for(e of pe.Yb)e.terminate();pe.Yb=[]},mc:function(e){var t=e.Ub;delete pe.Vb[t],pe.Yb.push(e),pe.ac.splice(pe.ac.indexOf(e),1),e.Ub=0,wt(t)},Gc:function(){},pc:function(){pe.qc.forEach(e=>e())},Fc:function(e,t){e.onmessage=n=>{var r=(n=n.data).cmd;if(e.Ub&&(pe.Bc=e.Ub),n.targetThread&&n.targetThread!=ft()){var o=pe.Vb[n.Qc];o?o.postMessage(n,n.transferList):R('Internal error! Worker sent a message "'+r+'" to target pthread '+n.targetThread+", but that thread no longer exists!")}else"processProxyingQueue"===r?Be(n.queue):"spawnThread"===r?ce(n):"cleanupThread"===r?ue(n.thread):"killThread"===r?(n=n.thread,r=pe.Vb[n],delete pe.Vb[n],r.terminate(),wt(n),pe.ac.splice(pe.ac.indexOf(r),1),r.Ub=0):"cancelThread"===r?pe.Vb[n.thread].postMessage({cmd:"cancel"}):"loaded"===r?(e.loaded=!0,t&&t(e),e.$b&&(e.$b(),delete e.$b)):"print"===r?A("Thread "+n.threadId+": "+n.text):"printErr"===r?R("Thread "+n.threadId+": "+n.text):"alert"===r?alert("Thread "+n.threadId+": "+n.text):"setimmediate"===n.target?e.postMessage(n):"onAbort"===r?l.onAbort&&l.onAbort(n.arg):r&&R("worker sent an unknown command "+r);pe.Bc=void 0},e.onerror=e=>{throw R("worker sent an error! "+e.filename+":"+e.lineno+": "+e.message),e},S&&(e.on("message",function(t){e.onmessage({data:t})}),e.on("error",function(t){e.onerror(t)}),e.on("detachedExit",function(){})),e.postMessage({cmd:"load",urlOrBlob:l.mainScriptUrlOrBlob||r,wasmMemory:I,wasmModule:C})},yc:function(){var e=E("ort-wasm-threaded.worker.js");pe.Yb.push(new Worker(e))},Cc:function(){return 0==pe.Yb.length&&(pe.yc(),pe.Fc(pe.Yb[0])),pe.Yb.pop()}};function he(e){for(;0<e.length;)e.shift()(l)}function me(e){if(x)return Ge(2,0,e);try{fe(e)}catch(t){t instanceof le||"unwind"==t||_(1,t)}}l.PThread=pe,l.establishStackSpace=function(){var e=ft(),t=a()[e+44>>2>>>0];e=a()[e+48>>2>>>0],Tt(t,t-e),kt(t)};var ge=[];function be(e){var t=ge[e];return t||(e>=ge.length&&(ge.length=e+1),ge[e]=t=Y.get(e)),t}l.invokeEntryPoint=function(e,t){e=be(e)(t),J()?pe.nc(e):St(e)};var ye,_e,ve=[],we=0,Se=0;function xe(e){this.Zb=e,this.Sb=e-24,this.xc=function(e){i()[this.Sb+4>>2>>>0]=e},this.bc=function(){return i()[this.Sb+4>>2>>>0]},this.wc=function(e){i()[this.Sb+8>>2>>>0]=e},this.Dc=function(){return i()[this.Sb+8>>2>>>0]},this.rc=function(){a()[this.Sb>>2>>>0]=0},this.hc=function(e){e=e?1:0,t()[(this.Sb+12|0)>>>0]=e},this.uc=function(){return 0!=t()[(this.Sb+12|0)>>>0]},this.ic=function(e){e=e?1:0,t()[(this.Sb+13|0)>>>0]=e},this.kc=function(){return 0!=t()[(this.Sb+13|0)>>>0]},this.fc=function(e,t){this.cc(0),this.xc(e),this.wc(t),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(a(),this.Sb>>2,1)},this.Hc=function(){return 1===Atomics.sub(a(),this.Sb>>2,1)},this.cc=function(e){i()[this.Sb+16>>2>>>0]=e},this.tc=function(){return i()[this.Sb+16>>2>>>0]},this.vc=function(){if(At(this.bc()))return i()[this.Zb>>2>>>0];var e=this.tc();return 0!==e?e:this.Zb}}function Te(e){return ht(new xe(e).Sb)}function Ee(e,t,n,r){return x?Ge(3,1,e,t,n,r):ke(e,t,n,r)}function ke(e,t,n,r){if("undefined"==typeof SharedArrayBuffer)return R("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var o=[];return x&&0===o.length?Ee(e,t,n,r):(e={Ic:n,Ub:e,zc:r,Nc:o},x?(e.Oc="spawnThread",postMessage(e,o),0):ce(e))}function Pe(e,t,n){return x?Ge(4,1,e,t,n):0}function Oe(e,t){if(x)return Ge(5,1,e,t)}function Ae(e,t){if(x)return Ge(6,1,e,t)}function Re(e,t,n){if(x)return Ge(7,1,e,t,n)}function $e(e,t,n){return x?Ge(8,1,e,t,n):0}function Ie(e,t){if(x)return Ge(9,1,e,t)}function Ce(e,t,n){if(x)return Ge(10,1,e,t,n)}function De(e,t,n,r){if(x)return Ge(11,1,e,t,n,r)}function Ne(e,t,n,r){if(x)return Ge(12,1,e,t,n,r)}function Me(e,t,n,r){if(x)return Ge(13,1,e,t,n,r)}function Le(e){if(x)return Ge(14,1,e)}function je(e,t){if(x)return Ge(15,1,e,t)}function Fe(e,t,n){if(x)return Ge(16,1,e,t,n)}function Be(e){Atomics.store(a(),e>>2,1),ft()&&vt(e),Atomics.compareExchange(a(),e>>2,1,0)}function Ue(e){return i()[e>>>2]+4294967296*a()[e+4>>>2]}function ze(e,t,n,r,o,a){return x?Ge(17,1,e,t,n,r,o,a):-52}function Ve(e,t,n,r,o,a){if(x)return Ge(18,1,e,t,n,r,o,a)}function He(e){var n=q(e)+1,r=pt(n);return r&&H(e,t(),r,n),r}function qe(e,t,n){function r(e){return(e=e.toTimeString().match(/\(([A-Za-z ]+)\)$/))?e[1]:"GMT"}if(x)return Ge(19,1,e,t,n);var o=(new Date).getFullYear(),s=new Date(o,0,1),l=new Date(o,6,1);o=s.getTimezoneOffset();var u=l.getTimezoneOffset(),c=Math.max(o,u);a()[e>>2>>>0]=60*c,a()[t>>2>>>0]=Number(o!=u),e=r(s),t=r(l),e=He(e),t=He(t),u<o?(i()[n>>2>>>0]=e,i()[n+4>>2>>>0]=t):(i()[n>>2>>>0]=t,i()[n+4>>2>>>0]=e)}function Ge(e,t){var n=arguments.length-2,r=arguments;return function(e){var t=Et();return e=e(),kt(t),e}(()=>{for(var o=Pt(8*n),a=o>>3,i=0;i<n;i++){var l=r[2+i];s()[a+i>>>0]=l}return _t(e,n,o,t)})}l.executeNotifiedProxyingQueue=Be,_e=S?()=>{var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:x?()=>performance.now()-l.__performance_now_clock_drift:()=>performance.now();var We,Ye=[],Xe={};function Ke(){if(!We){var e,t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:y||"./this.program"};for(e in Xe)void 0===Xe[e]?delete t[e]:t[e]=Xe[e];var n=[];for(e in t)n.push(e+"="+t[e]);We=n}return We}function Qe(e,n){if(x)return Ge(20,1,e,n);var r=0;return Ke().forEach(function(o,a){var s=n+r;for(a=i()[e+4*a>>2>>>0]=s,s=0;s<o.length;++s)t()[(0|a++)>>>0]=o.charCodeAt(s);t()[(0|a)>>>0]=0,r+=o.length+1}),0}function Ze(e,t){if(x)return Ge(21,1,e,t);var n=Ke();i()[e>>2>>>0]=n.length;var r=0;return n.forEach(function(e){r+=e.length+1}),i()[t>>2>>>0]=r,0}function Je(e){return x?Ge(22,1,e):52}function et(e,t,n,r){return x?Ge(23,1,e,t,n,r):52}function tt(e,t,n,r,o){return x?Ge(24,1,e,t,n,r,o):70}var nt=[null,[],[]];function rt(e,t){var n=nt[e];0===t||10===t?((1===e?A:R)(z(n,0)),n.length=0):n.push(t)}function ot(e,t,n,r){if(x)return Ge(25,1,e,t,n,r);for(var a=0,s=0;s<n;s++){var l=i()[t>>2>>>0],u=i()[t+4>>2>>>0];t+=8;for(var c=0;c<u;c++)rt(e,o()[l+c>>>0]);a+=u}return i()[r>>2>>>0]=a,0}var at=0;function it(e){return 0==e%4&&(0!=e%100||0==e%400)}var st=[31,29,31,30,31,30,31,31,30,31,30,31],lt=[31,28,31,30,31,30,31,31,30,31,30,31];function ut(e,n,r,o){function i(e,t,n){for(e="number"==typeof e?e.toString():e||"";e.length<t;)e=n[0]+e;return e}function s(e,t){return i(e,t,"0")}function l(e,t){function n(e){return 0>e?-1:0<e?1:0}var r;return 0===(r=n(e.getFullYear()-t.getFullYear()))&&0===(r=n(e.getMonth()-t.getMonth()))&&(r=n(e.getDate()-t.getDate())),r}function u(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function c(e){var t=e.Wb;for(e=new Date(new Date(e.Xb+1900,0,1).getTime());0<t;){var n=e.getMonth(),r=(it(e.getFullYear())?st:lt)[n];if(!(t>r-e.getDate())){e.setDate(e.getDate()+t);break}t-=r-e.getDate()+1,e.setDate(1),11>n?e.setMonth(n+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return n=new Date(e.getFullYear()+1,0,4),t=u(new Date(e.getFullYear(),0,4)),n=u(n),0>=l(t,e)?0>=l(n,e)?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var d=a()[o+40>>2>>>0];for(var f in o={Lc:a()[o>>2>>>0],Kc:a()[o+4>>2>>>0],dc:a()[o+8>>2>>>0],jc:a()[o+12>>2>>>0],ec:a()[o+16>>2>>>0],Xb:a()[o+20>>2>>>0],Tb:a()[o+24>>2>>>0],Wb:a()[o+28>>2>>>0],Rc:a()[o+32>>2>>>0],Jc:a()[o+36>>2>>>0],Mc:d?V(d):""},r=V(r),d={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})r=r.replace(new RegExp(f,"g"),d[f]);var p,h,m="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),g="January February March April May June July August September October November December".split(" ");for(f in d={"%a":function(e){return m[e.Tb].substring(0,3)},"%A":function(e){return m[e.Tb]},"%b":function(e){return g[e.ec].substring(0,3)},"%B":function(e){return g[e.ec]},"%C":function(e){return s((e.Xb+1900)/100|0,2)},"%d":function(e){return s(e.jc,2)},"%e":function(e){return i(e.jc,2," ")},"%g":function(e){return c(e).toString().substring(2)},"%G":function(e){return c(e)},"%H":function(e){return s(e.dc,2)},"%I":function(e){return 0==(e=e.dc)?e=12:12<e&&(e-=12),s(e,2)},"%j":function(e){for(var t=0,n=0;n<=e.ec-1;t+=(it(e.Xb+1900)?st:lt)[n++]);return s(e.jc+t,3)},"%m":function(e){return s(e.ec+1,2)},"%M":function(e){return s(e.Kc,2)},"%n":function(){return"\n"},"%p":function(e){return 0<=e.dc&&12>e.dc?"AM":"PM"},"%S":function(e){return s(e.Lc,2)},"%t":function(){return"\t"},"%u":function(e){return e.Tb||7},"%U":function(e){return s(Math.floor((e.Wb+7-e.Tb)/7),2)},"%V":function(e){var t=Math.floor((e.Wb+7-(e.Tb+6)%7)/7);if(2>=(e.Tb+371-e.Wb-2)%7&&t++,t)53==t&&(4==(n=(e.Tb+371-e.Wb)%7)||3==n&&it(e.Xb)||(t=1));else{t=52;var n=(e.Tb+7-e.Wb-1)%7;(4==n||5==n&&it(e.Xb%400-1))&&t++}return s(t,2)},"%w":function(e){return e.Tb},"%W":function(e){return s(Math.floor((e.Wb+7-(e.Tb+6)%7)/7),2)},"%y":function(e){return(e.Xb+1900).toString().substring(2)},"%Y":function(e){return e.Xb+1900},"%z":function(e){var t=0<=(e=e.Jc);return e=Math.abs(e)/60,(t?"+":"-")+String("0000"+(e/60*100+e%60)).slice(-4)},"%Z":function(e){return e.Mc},"%%":function(){return"%"}},r=r.replace(/%%/g,"\0\0"),d)r.includes(f)&&(r=r.replace(new RegExp(f,"g"),d[f](o)));return p=r=r.replace(/\0\0/g,"%"),h=Array(q(p)+1),H(p,h,0,h.length),(f=h).length>n?0:(function(e,n){t().set(e,n>>>0)}(f,e),f.length-1)}pe.fc();var ct=[null,de,me,Ee,Pe,Oe,Ae,Re,$e,Ie,Ce,De,Ne,Me,Le,je,Fe,ze,Ve,qe,Qe,Ze,Je,et,tt,ot],dt={b:function(e){return pt(e+24)+24},n:function(e){return(e=new xe(e)).uc()||(e.hc(!0),we--),e.ic(!1),ve.push(e),e.sc(),e.vc()},ma:function(e){throw R("Unexpected exception thrown, this is not properly supported - aborting"),B=!0,e},x:function(){xt(0);var e=ve.pop();if(e.Hc()&&!e.kc()){var t=e.Dc();t&&be(t)(e.Zb),Te(e.Zb)}Se=0},e:function(){var e=Se;if(!e)return at=0;var t=new xe(e);t.cc(e);var n=t.bc();if(!n)return at=0,e;for(var r=Array.prototype.slice.call(arguments),o=0;o<r.length;o++){var a=r[o];if(0===a||a===n)break;if(Ot(a,n,t.Sb+16))return at=a,e}return at=n,e},l:function(){var e=Se;if(!e)return at=0;var t=new xe(e);t.cc(e);var n=t.bc();if(!n)return at=0,e;for(var r=Array.prototype.slice.call(arguments),o=0;o<r.length;o++){var a=r[o];if(0===a||a===n)break;if(Ot(a,n,t.Sb+16))return at=a,e}return at=n,e},h:function(){var e=Se;if(!e)return at=0;var t=new xe(e);t.cc(e);var n=t.bc();if(!n)return at=0,e;for(var r=Array.prototype.slice.call(arguments),o=0;o<r.length;o++){var a=r[o];if(0===a||a===n)break;if(Ot(a,n,t.Sb+16))return at=a,e}return at=n,e},t:Te,M:function(){var e=ve.pop();e||oe("no exception to throw");var t=e.Zb;throw e.kc()||(ve.push(e),e.ic(!0),e.hc(!1),we++),Se=t,t},c:function(e,t,n){throw new xe(e).fc(t,n),Se=e,we++,e},pa:function(){return we},Fa:function(e){bt(e,!w,1,!v),pe.pc()},T:function(e){x?postMessage({cmd:"cleanupThread",thread:e}):ue(e)},xa:ke,j:function(e){throw Se||(Se=e),e},H:Pe,Ma:Oe,ua:Ae,wa:Re,oa:$e,Ka:Ie,Ca:Ce,Ja:De,V:Ne,va:Me,sa:Le,La:je,ta:Fe,Ta:function(){},X:function(){oe("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},Ua:function(){oe("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},W:function(){return Date.now()},ya:function(){return 2097152},Oa:function(){return!0},za:function(e,t,n,r){if(e==t)setTimeout(()=>Be(r));else if(x)postMessage({targetThread:e,cmd:"processProxyingQueue",queue:r});else{if(!(e=pe.Vb[e]))return;e.postMessage({cmd:"processProxyingQueue",queue:r})}return 1},Ea:function(){return-1},Pa:function(e,t){e=new Date(1e3*Ue(e)),a()[t>>2>>>0]=e.getUTCSeconds(),a()[t+4>>2>>>0]=e.getUTCMinutes(),a()[t+8>>2>>>0]=e.getUTCHours(),a()[t+12>>2>>>0]=e.getUTCDate(),a()[t+16>>2>>>0]=e.getUTCMonth(),a()[t+20>>2>>>0]=e.getUTCFullYear()-1900,a()[t+24>>2>>>0]=e.getUTCDay(),e=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,a()[t+28>>2>>>0]=e},Qa:function(e,t){e=new Date(1e3*Ue(e)),a()[t>>2>>>0]=e.getSeconds(),a()[t+4>>2>>>0]=e.getMinutes(),a()[t+8>>2>>>0]=e.getHours(),a()[t+12>>2>>>0]=e.getDate(),a()[t+16>>2>>>0]=e.getMonth(),a()[t+20>>2>>>0]=e.getFullYear()-1900,a()[t+24>>2>>>0]=e.getDay();var n=new Date(e.getFullYear(),0,1),r=(e.getTime()-n.getTime())/864e5|0;a()[t+28>>2>>>0]=r,a()[t+36>>2>>>0]=-60*e.getTimezoneOffset(),r=new Date(e.getFullYear(),6,1).getTimezoneOffset(),e=0|(r!=(n=n.getTimezoneOffset())&&e.getTimezoneOffset()==Math.min(n,r)),a()[t+32>>2>>>0]=e},Ra:function(e){var t=new Date(a()[e+20>>2>>>0]+1900,a()[e+16>>2>>>0],a()[e+12>>2>>>0],a()[e+8>>2>>>0],a()[e+4>>2>>>0],a()[e>>2>>>0],0),n=a()[e+32>>2>>>0],r=t.getTimezoneOffset(),o=new Date(t.getFullYear(),0,1),i=new Date(t.getFullYear(),6,1).getTimezoneOffset(),s=o.getTimezoneOffset(),l=Math.min(s,i);return 0>n?a()[e+32>>2>>>0]=Number(i!=s&&l==r):0<n!=(l==r)&&(i=Math.max(s,i),t.setTime(t.getTime()+6e4*((0<n?l:i)-r))),a()[e+24>>2>>>0]=t.getDay(),n=(t.getTime()-o.getTime())/864e5|0,a()[e+28>>2>>>0]=n,a()[e>>2>>>0]=t.getSeconds(),a()[e+4>>2>>>0]=t.getMinutes(),a()[e+8>>2>>>0]=t.getHours(),a()[e+12>>2>>>0]=t.getDate(),a()[e+16>>2>>>0]=t.getMonth(),t.getTime()/1e3|0},Aa:ze,Ba:Ve,Sa:function e(t,n,r){e.Ac||(e.Ac=!0,qe(t,n,r))},y:function(){oe("")},U:function(){if(!S&&!w){var e="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";ye||(ye={}),ye[e]||(ye[e]=1,S&&(e="warning: "+e),R(e))}},ra:function(){return 4294901760},B:_e,Ia:function(e,t,n){o().copyWithin(e>>>0,t>>>0,t+n>>>0)},F:function(){return S?n(3993).cpus().length:navigator.hardwareConcurrency},Da:function(e,t,n){Ye.length=t,n>>=3;for(var r=0;r<t;r++)Ye[r]=s()[n+r>>>0];return(0>e?se[-e-1]:ct[e]).apply(null,Ye)},qa:function(e){var t=o().length;if((e>>>=0)<=t||4294901760<e)return!1;for(var n=1;4>=n;n*=2){var r=t*(1+.2/n);r=Math.min(r,e+100663296);var a=Math;r=Math.max(e,r),a=a.min.call(a,4294901760,r+(65536-r%65536)%65536);e:{try{I.grow(a-D.byteLength+65535>>>16),G(I.buffer);var i=1;break e}catch(s){}i=void 0}if(i)return!0}return!1},Na:function(){throw"unwind"},Ga:Qe,Ha:Ze,J:fe,I:Je,S:et,ga:tt,R:ot,d:function(){return at},na:function e(r,o){e.lc||(e.lc=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return()=>(crypto.getRandomValues(e),e[0])}if(S)try{var t=n(Object(function(){var e=new Error("Cannot find module 'crypto'");throw e.code="MODULE_NOT_FOUND",e}()));return()=>t.randomBytes(1)[0]}catch(r){}return()=>oe("randomDevice")}());for(var a=0;a<o;a++)t()[(r+a|0)>>>0]=e.lc();return 0},ia:function(e,t,n){var r=Et();try{return be(e)(t,n)}catch(o){if(kt(r),o!==o+0)throw o;xt(1,0)}},ja:function(e,t,n){var r=Et();try{return be(e)(t,n)}catch(o){if(kt(r),o!==o+0)throw o;xt(1,0)}},K:function(e){var t=Et();try{return be(e)()}catch(n){if(kt(t),n!==n+0)throw n;xt(1,0)}},f:function(e,t){var n=Et();try{return be(e)(t)}catch(r){if(kt(n),r!==r+0)throw r;xt(1,0)}},P:function(e,t,n){var r=Et();try{return be(e)(t,n)}catch(o){if(kt(r),o!==o+0)throw o;xt(1,0)}},Q:function(e,t,n){var r=Et();try{return be(e)(t,n)}catch(o){if(kt(r),o!==o+0)throw o;xt(1,0)}},k:function(e,t,n){var r=Et();try{return be(e)(t,n)}catch(o){if(kt(r),o!==o+0)throw o;xt(1,0)}},p:function(e,t,n,r){var o=Et();try{return be(e)(t,n,r)}catch(a){if(kt(o),a!==a+0)throw a;xt(1,0)}},q:function(e,t,n,r,o){var a=Et();try{return be(e)(t,n,r,o)}catch(i){if(kt(a),i!==i+0)throw i;xt(1,0)}},N:function(e,t,n,r,o,a){var i=Et();try{return be(e)(t,n,r,o,a)}catch(s){if(kt(i),s!==s+0)throw s;xt(1,0)}},s:function(e,t,n,r,o,a){var i=Et();try{return be(e)(t,n,r,o,a)}catch(s){if(kt(i),s!==s+0)throw s;xt(1,0)}},w:function(e,t,n,r,o,a,i){var s=Et();try{return be(e)(t,n,r,o,a,i)}catch(l){if(kt(s),l!==l+0)throw l;xt(1,0)}},L:function(e,t,n,r,o,a,i,s){var l=Et();try{return be(e)(t,n,r,o,a,i,s)}catch(u){if(kt(l),u!==u+0)throw u;xt(1,0)}},E:function(e,t,n,r,o,a,i,s,l,u,c,d){var f=Et();try{return be(e)(t,n,r,o,a,i,s,l,u,c,d)}catch(p){if(kt(f),p!==p+0)throw p;xt(1,0)}},aa:function(e,t,n,r,o,a,i,s){var l=Et();try{return jt(e,t,n,r,o,a,i,s)}catch(u){if(kt(l),u!==u+0)throw u;xt(1,0)}},_:function(e,t,n,r,o,a,i){var s=Et();try{return $t(e,t,n,r,o,a,i)}catch(l){if(kt(s),l!==l+0)throw l;xt(1,0)}},Z:function(e,t,n,r,o){var a=Et();try{return Ft(e,t,n,r,o)}catch(i){if(kt(a),i!==i+0)throw i;xt(1,0)}},ca:function(e,t,n,r){var o=Et();try{return Mt(e,t,n,r)}catch(a){if(kt(o),a!==a+0)throw a;xt(1,0)}},$:function(e){var t=Et();try{return Rt(e)}catch(n){if(kt(t),n!==n+0)throw n;xt(1,0)}},ba:function(e,t){var n=Et();try{return Lt(e,t)}catch(r){if(kt(n),r!==r+0)throw r;xt(1,0)}},Y:function(e,t,n){var r=Et();try{return It(e,t,n)}catch(o){if(kt(r),o!==o+0)throw o;xt(1,0)}},g:function(e){var t=Et();try{be(e)()}catch(n){if(kt(t),n!==n+0)throw n;xt(1,0)}},r:function(e,t){var n=Et();try{be(e)(t)}catch(r){if(kt(n),r!==r+0)throw r;xt(1,0)}},i:function(e,t,n){var r=Et();try{be(e)(t,n)}catch(o){if(kt(r),o!==o+0)throw o;xt(1,0)}},ha:function(e,t,n,r){var o=Et();try{be(e)(t,n,r)}catch(a){if(kt(o),a!==a+0)throw a;xt(1,0)}},m:function(e,t,n,r){var o=Et();try{be(e)(t,n,r)}catch(a){if(kt(o),a!==a+0)throw a;xt(1,0)}},v:function(e,t,n,r,o){var a=Et();try{be(e)(t,n,r,o)}catch(i){if(kt(a),i!==i+0)throw i;xt(1,0)}},u:function(e,t,n,r,o,a){var i=Et();try{be(e)(t,n,r,o,a)}catch(s){if(kt(i),s!==s+0)throw s;xt(1,0)}},O:function(e,t,n,r,o,a,i){var s=Et();try{be(e)(t,n,r,o,a,i)}catch(l){if(kt(s),l!==l+0)throw l;xt(1,0)}},A:function(e,t,n,r,o,a,i,s){var l=Et();try{be(e)(t,n,r,o,a,i,s)}catch(u){if(kt(l),u!==u+0)throw u;xt(1,0)}},ka:function(e,t,n,r,o,a,i,s,l){var u=Et();try{be(e)(t,n,r,o,a,i,s,l)}catch(c){if(kt(u),c!==c+0)throw c;xt(1,0)}},C:function(e,t,n,r,o,a,i,s,l,u,c){var d=Et();try{be(e)(t,n,r,o,a,i,s,l,u,c)}catch(f){if(kt(d),f!==f+0)throw f;xt(1,0)}},D:function(e,t,n,r,o,a,i,s,l,u,c,d,f,p,h,m){var g=Et();try{be(e)(t,n,r,o,a,i,s,l,u,c,d,f,p,h,m)}catch(b){if(kt(g),b!==b+0)throw b;xt(1,0)}},fa:function(e,t,n,r,o,a,i,s){var l=Et();try{Ct(e,t,n,r,o,a,i,s)}catch(u){if(kt(l),u!==u+0)throw u;xt(1,0)}},da:function(e,t,n,r,o,a,i,s,l,u,c,d){var f=Et();try{Nt(e,t,n,r,o,a,i,s,l,u,c,d)}catch(p){if(kt(f),p!==p+0)throw p;xt(1,0)}},ea:function(e,t,n,r,o,a){var i=Et();try{Dt(e,t,n,r,o,a)}catch(s){if(kt(i),s!==s+0)throw s;xt(1,0)}},o:function(e){return e},a:I||l.wasmMemory,G:function(e){at=e},la:ut,z:function(e,t,n,r){return ut(e,t,n,r)}};!function(){function e(e,t){l.asm=e.exports,pe.qc.push(l.asm.sb),Y=l.asm.ub,K.unshift(l.asm.Va),C=t,x||(ne--,l.monitorRunDependencies&&l.monitorRunDependencies(ne),0==ne&&re&&(e=re,re=null,e()))}function t(t){e(t.instance,t.module)}function n(e){return function(){if(!O&&(v||w)){if("function"==typeof fetch&&!te.startsWith("file://"))return fetch(te,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+te+"'";return e.arrayBuffer()}).catch(function(){return ie()});if(f)return new Promise(function(e,t){f(te,function(t){e(new Uint8Array(t))},t)})}return Promise.resolve().then(function(){return ie()})}().then(function(e){return WebAssembly.instantiate(e,r)}).then(function(e){return e}).then(e,function(e){R("failed to asynchronously prepare wasm: "+e),oe(e)})}var r={a:dt};if(x||(ne++,l.monitorRunDependencies&&l.monitorRunDependencies(ne)),l.instantiateWasm)try{return l.instantiateWasm(r,e)}catch(o){return R("Module.instantiateWasm callback failed with error: "+o),!1}(O||"function"!=typeof WebAssembly.instantiateStreaming||ae()||te.startsWith("file://")||S||"function"!=typeof fetch?n(t):fetch(te,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,r).then(t,function(e){return R("wasm streaming compile failed: "+e),R("falling back to ArrayBuffer instantiation"),n(t)})})).catch(c)}(),l.___wasm_call_ctors=function(){return(l.___wasm_call_ctors=l.asm.Va).apply(null,arguments)},l._OrtInit=function(){return(l._OrtInit=l.asm.Wa).apply(null,arguments)},l._OrtCreateSessionOptions=function(){return(l._OrtCreateSessionOptions=l.asm.Xa).apply(null,arguments)},l._OrtAppendExecutionProvider=function(){return(l._OrtAppendExecutionProvider=l.asm.Ya).apply(null,arguments)},l._OrtAddSessionConfigEntry=function(){return(l._OrtAddSessionConfigEntry=l.asm.Za).apply(null,arguments)},l._OrtReleaseSessionOptions=function(){return(l._OrtReleaseSessionOptions=l.asm._a).apply(null,arguments)},l._OrtCreateSession=function(){return(l._OrtCreateSession=l.asm.$a).apply(null,arguments)},l._OrtReleaseSession=function(){return(l._OrtReleaseSession=l.asm.ab).apply(null,arguments)},l._OrtGetInputCount=function(){return(l._OrtGetInputCount=l.asm.bb).apply(null,arguments)},l._OrtGetOutputCount=function(){return(l._OrtGetOutputCount=l.asm.cb).apply(null,arguments)},l._OrtGetInputName=function(){return(l._OrtGetInputName=l.asm.db).apply(null,arguments)},l._OrtGetOutputName=function(){return(l._OrtGetOutputName=l.asm.eb).apply(null,arguments)},l._OrtFree=function(){return(l._OrtFree=l.asm.fb).apply(null,arguments)},l._OrtCreateTensor=function(){return(l._OrtCreateTensor=l.asm.gb).apply(null,arguments)},l._OrtGetTensorData=function(){return(l._OrtGetTensorData=l.asm.hb).apply(null,arguments)},l._OrtReleaseTensor=function(){return(l._OrtReleaseTensor=l.asm.ib).apply(null,arguments)},l._OrtCreateRunOptions=function(){return(l._OrtCreateRunOptions=l.asm.jb).apply(null,arguments)},l._OrtAddRunConfigEntry=function(){return(l._OrtAddRunConfigEntry=l.asm.kb).apply(null,arguments)},l._OrtReleaseRunOptions=function(){return(l._OrtReleaseRunOptions=l.asm.lb).apply(null,arguments)},l._OrtRun=function(){return(l._OrtRun=l.asm.mb).apply(null,arguments)},l._OrtEndProfiling=function(){return(l._OrtEndProfiling=l.asm.nb).apply(null,arguments)};var ft=l._pthread_self=function(){return(ft=l._pthread_self=l.asm.ob).apply(null,arguments)},pt=l._malloc=function(){return(pt=l._malloc=l.asm.pb).apply(null,arguments)},ht=l._free=function(){return(ht=l._free=l.asm.qb).apply(null,arguments)},mt=l._fflush=function(){return(mt=l._fflush=l.asm.rb).apply(null,arguments)};l.__emscripten_tls_init=function(){return(l.__emscripten_tls_init=l.asm.sb).apply(null,arguments)};var gt=l.___funcs_on_exit=function(){return(gt=l.___funcs_on_exit=l.asm.tb).apply(null,arguments)},bt=l.__emscripten_thread_init=function(){return(bt=l.__emscripten_thread_init=l.asm.vb).apply(null,arguments)};l.__emscripten_thread_crashed=function(){return(l.__emscripten_thread_crashed=l.asm.wb).apply(null,arguments)};var yt,_t=l._emscripten_run_in_main_runtime_thread_js=function(){return(_t=l._emscripten_run_in_main_runtime_thread_js=l.asm.xb).apply(null,arguments)},vt=l.__emscripten_proxy_execute_task_queue=function(){return(vt=l.__emscripten_proxy_execute_task_queue=l.asm.yb).apply(null,arguments)},wt=l.__emscripten_thread_free_data=function(){return(wt=l.__emscripten_thread_free_data=l.asm.zb).apply(null,arguments)},St=l.__emscripten_thread_exit=function(){return(St=l.__emscripten_thread_exit=l.asm.Ab).apply(null,arguments)},xt=l._setThrew=function(){return(xt=l._setThrew=l.asm.Bb).apply(null,arguments)},Tt=l._emscripten_stack_set_limits=function(){return(Tt=l._emscripten_stack_set_limits=l.asm.Cb).apply(null,arguments)},Et=l.stackSave=function(){return(Et=l.stackSave=l.asm.Db).apply(null,arguments)},kt=l.stackRestore=function(){return(kt=l.stackRestore=l.asm.Eb).apply(null,arguments)},Pt=l.stackAlloc=function(){return(Pt=l.stackAlloc=l.asm.Fb).apply(null,arguments)},Ot=l.___cxa_can_catch=function(){return(Ot=l.___cxa_can_catch=l.asm.Gb).apply(null,arguments)},At=l.___cxa_is_pointer_type=function(){return(At=l.___cxa_is_pointer_type=l.asm.Hb).apply(null,arguments)},Rt=l.dynCall_j=function(){return(Rt=l.dynCall_j=l.asm.Ib).apply(null,arguments)},$t=l.dynCall_iiiiij=function(){return($t=l.dynCall_iiiiij=l.asm.Jb).apply(null,arguments)},It=l.dynCall_jii=function(){return(It=l.dynCall_jii=l.asm.Kb).apply(null,arguments)},Ct=l.dynCall_viiiiij=function(){return(Ct=l.dynCall_viiiiij=l.asm.Lb).apply(null,arguments)},Dt=l.dynCall_vjji=function(){return(Dt=l.dynCall_vjji=l.asm.Mb).apply(null,arguments)},Nt=l.dynCall_viiijjjii=function(){return(Nt=l.dynCall_viiijjjii=l.asm.Nb).apply(null,arguments)},Mt=l.dynCall_iij=function(){return(Mt=l.dynCall_iij=l.asm.Ob).apply(null,arguments)},Lt=l.dynCall_ji=function(){return(Lt=l.dynCall_ji=l.asm.Pb).apply(null,arguments)},jt=l.dynCall_iiiiiij=function(){return(jt=l.dynCall_iiiiiij=l.asm.Qb).apply(null,arguments)},Ft=l.dynCall_iiij=function(){return(Ft=l.dynCall_iiij=l.asm.Rb).apply(null,arguments)};function Bt(){function e(){if(!yt&&(yt=!0,l.calledRun=!0,!B)&&(x||he(K),u(l),l.onRuntimeInitialized&&l.onRuntimeInitialized(),!x)){if(l.postRun)for("function"==typeof l.postRun&&(l.postRun=[l.postRun]);l.postRun.length;){var e=l.postRun.shift();Z.unshift(e)}he(Z)}}if(!(0<ne))if(x)u(l),x||he(K),postMessage({cmd:"loaded"});else{if(l.preRun)for("function"==typeof l.preRun&&(l.preRun=[l.preRun]);l.preRun.length;)ee();he(X),0<ne||(l.setStatus?(l.setStatus("Running..."),setTimeout(function(){setTimeout(function(){l.setStatus("")},1),e()},1)):e())}}if(l.UTF8ToString=V,l.stringToUTF8=function(e,t,n){return H(e,o(),t,n)},l.lengthBytesUTF8=q,l.keepRuntimeAlive=J,l.wasmMemory=I,l.stackSave=Et,l.stackRestore=kt,l.stackAlloc=Pt,l.ExitStatus=le,l.PThread=pe,re=function e(){yt||Bt(),yt||(re=e)},l.preInit)for("function"==typeof l.preInit&&(l.preInit=[l.preInit]);0<l.preInit.length;)l.preInit.pop()();return Bt(),e.ready});e.exports=o},932:(e,t,n)=>{var r,o=(r=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(e){var t,o,a;e=e||{},t||(t=void 0!==e?e:{}),t.ready=new Promise(function(e,t){o=e,a=t});var i,s,l,u,c,d,f=Object.assign({},t),p="./this.program",h=(e,t)=>{throw t},m="object"==typeof window,g="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,y="";b?(y=g?n(908).dirname(y)+"/":"//",d=()=>{c||(u=n(1384),c=n(908))},i=function(e,t){return d(),e=c.normalize(e),u.readFileSync(e,t?void 0:"utf8")},l=e=>((e=i(e,!0)).buffer||(e=new Uint8Array(e)),e),s=(e,t,n)=>{d(),e=c.normalize(e),u.readFile(e,function(e,r){e?n(e):t(r.buffer)})},1<process.argv.length&&(p=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",function(e){if(!(e instanceof K))throw e}),process.on("unhandledRejection",function(e){throw e}),h=(e,t)=>{if(S||0<U)throw process.exitCode=e,t;t instanceof K||w("exiting due to exception: "+t),process.exit(e)},t.inspect=function(){return"[Emscripten Module object]"}):(m||g)&&(g?y=self.location.href:"undefined"!=typeof document&&document.currentScript&&(y=document.currentScript.src),r&&(y=r),y=0!==y.indexOf("blob:")?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf("/")+1):"",i=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},g&&(l=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),s=(e,t,n)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)});var _,v=t.print||console.log.bind(console),w=t.printErr||console.warn.bind(console);Object.assign(t,f),f=null,t.thisProgram&&(p=t.thisProgram),t.quit&&(h=t.quit),t.wasmBinary&&(_=t.wasmBinary);var S=t.noExitRuntime||!1;"object"!=typeof WebAssembly&&G("no native wasm support detected");var x,T,E,k,P,O,A=!1,R="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function $(e,t,n){var r=(t>>>=0)+n;for(n=t;e[n]&&!(n>=r);)++n;if(16<n-t&&e.buffer&&R)return R.decode(e.subarray(t,n));for(r="";t<n;){var o=e[t++];if(128&o){var a=63&e[t++];if(192==(224&o))r+=String.fromCharCode((31&o)<<6|a);else{var i=63&e[t++];65536>(o=224==(240&o)?(15&o)<<12|a<<6|i:(7&o)<<18|a<<12|i<<6|63&e[t++])?r+=String.fromCharCode(o):(o-=65536,r+=String.fromCharCode(55296|o>>10,56320|1023&o))}}else r+=String.fromCharCode(o)}return r}function I(e,t){return(e>>>=0)?$(k,e,t):""}function C(e,t,n,r){if(!(0<r))return 0;var o=n>>>=0;r=n+r-1;for(var a=0;a<e.length;++a){var i=e.charCodeAt(a);if(55296<=i&&57343>=i&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++a)),127>=i){if(n>=r)break;t[n++>>>0]=i}else{if(2047>=i){if(n+1>=r)break;t[n++>>>0]=192|i>>6}else{if(65535>=i){if(n+2>=r)break;t[n++>>>0]=224|i>>12}else{if(n+3>=r)break;t[n++>>>0]=240|i>>18,t[n++>>>0]=128|i>>12&63}t[n++>>>0]=128|i>>6&63}t[n++>>>0]=128|63&i}}return t[n>>>0]=0,n-o}function D(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);127>=r?t++:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,++n):t+=3}return t}function N(){var e=x.buffer;T=e,t.HEAP8=E=new Int8Array(e),t.HEAP16=new Int16Array(e),t.HEAP32=P=new Int32Array(e),t.HEAPU8=k=new Uint8Array(e),t.HEAPU16=new Uint16Array(e),t.HEAPU32=O=new Uint32Array(e),t.HEAPF32=new Float32Array(e),t.HEAPF64=new Float64Array(e)}var M,L=[],j=[],F=[],B=[],U=0;function z(){var e=t.preRun.shift();L.unshift(e)}var V,H=0,q=null;function G(e){throw t.onAbort&&t.onAbort(e),w(e="Aborted("+e+")"),A=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),a(e),e}function W(){return V.startsWith("data:application/octet-stream;base64,")}if(V="ort-wasm.wasm",!W()){var Y=V;V=t.locateFile?t.locateFile(Y,y):y+Y}function X(){var e=V;try{if(e==V&&_)return new Uint8Array(_);if(l)return l(e);throw"both async and sync fetching of the wasm failed"}catch(t){G(t)}}function K(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Q(e){for(;0<e.length;)e.shift()(t)}var Z=[],J=0,ee=0;function te(e){this.Db=e,this.zb=e-24,this.Ub=function(e){O[this.zb+4>>2>>>0]=e},this.Eb=function(){return O[this.zb+4>>2>>>0]},this.Sb=function(e){O[this.zb+8>>2>>>0]=e},this.Wb=function(){return O[this.zb+8>>2>>>0]},this.Tb=function(){P[this.zb>>2>>>0]=0},this.Ib=function(e){E[(this.zb+12|0)>>>0]=e?1:0},this.Pb=function(){return 0!=E[(this.zb+12|0)>>>0]},this.Jb=function(e){E[(this.zb+13|0)>>>0]=e?1:0},this.Lb=function(){return 0!=E[(this.zb+13|0)>>>0]},this.Rb=function(e,t){this.Fb(0),this.Ub(e),this.Sb(t),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){P[this.zb>>2>>>0]+=1},this.Xb=function(){var e=P[this.zb>>2>>>0];return P[this.zb>>2>>>0]=e-1,1===e},this.Fb=function(e){O[this.zb+16>>2>>>0]=e},this.Ob=function(){return O[this.zb+16>>2>>>0]},this.Qb=function(){if(Pe(this.Eb()))return O[this.Db>>2>>>0];var e=this.Ob();return 0!==e?e:this.Db}}function ne(e){return _e(new te(e).zb)}var re=[];function oe(e){var t=re[e];return t||(e>=re.length&&(re.length=e+1),re[e]=t=M.get(e)),t}function ae(e){var t=D(e)+1,n=ye(t);return n&&C(e,E,n,t),n}var ie={};function se(){if(!le){var e,t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:p||"./this.program"};for(e in ie)void 0===ie[e]?delete t[e]:t[e]=ie[e];var n=[];for(e in t)n.push(e+"="+t[e]);le=n}return le}var le,ue=[null,[],[]];function ce(e,t){var n=ue[e];0===t||10===t?((1===e?v:w)($(n,0)),n.length=0):n.push(t)}var de=0;function fe(e){return 0==e%4&&(0!=e%100||0==e%400)}var pe=[31,29,31,30,31,30,31,31,30,31,30,31],he=[31,28,31,30,31,30,31,31,30,31,30,31];function me(e,t,n,r){function o(e,t,n){for(e="number"==typeof e?e.toString():e||"";e.length<t;)e=n[0]+e;return e}function a(e,t){return o(e,t,"0")}function i(e,t){function n(e){return 0>e?-1:0<e?1:0}var r;return 0===(r=n(e.getFullYear()-t.getFullYear()))&&0===(r=n(e.getMonth()-t.getMonth()))&&(r=n(e.getDate()-t.getDate())),r}function s(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function l(e){var t=e.Bb;for(e=new Date(new Date(e.Cb+1900,0,1).getTime());0<t;){var n=e.getMonth(),r=(fe(e.getFullYear())?pe:he)[n];if(!(t>r-e.getDate())){e.setDate(e.getDate()+t);break}t-=r-e.getDate()+1,e.setDate(1),11>n?e.setMonth(n+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return n=new Date(e.getFullYear()+1,0,4),t=s(new Date(e.getFullYear(),0,4)),n=s(n),0>=i(t,e)?0>=i(n,e)?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var u=P[r+40>>2>>>0];for(var c in r={$b:P[r>>2>>>0],Zb:P[r+4>>2>>>0],Gb:P[r+8>>2>>>0],Kb:P[r+12>>2>>>0],Hb:P[r+16>>2>>>0],Cb:P[r+20>>2>>>0],Ab:P[r+24>>2>>>0],Bb:P[r+28>>2>>>0],bc:P[r+32>>2>>>0],Yb:P[r+36>>2>>>0],ac:u?I(u):""},n=I(n),u={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(c,"g"),u[c]);var d,f,p="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),h="January February March April May June July August September October November December".split(" ");for(c in u={"%a":function(e){return p[e.Ab].substring(0,3)},"%A":function(e){return p[e.Ab]},"%b":function(e){return h[e.Hb].substring(0,3)},"%B":function(e){return h[e.Hb]},"%C":function(e){return a((e.Cb+1900)/100|0,2)},"%d":function(e){return a(e.Kb,2)},"%e":function(e){return o(e.Kb,2," ")},"%g":function(e){return l(e).toString().substring(2)},"%G":function(e){return l(e)},"%H":function(e){return a(e.Gb,2)},"%I":function(e){return 0==(e=e.Gb)?e=12:12<e&&(e-=12),a(e,2)},"%j":function(e){for(var t=0,n=0;n<=e.Hb-1;t+=(fe(e.Cb+1900)?pe:he)[n++]);return a(e.Kb+t,3)},"%m":function(e){return a(e.Hb+1,2)},"%M":function(e){return a(e.Zb,2)},"%n":function(){return"\n"},"%p":function(e){return 0<=e.Gb&&12>e.Gb?"AM":"PM"},"%S":function(e){return a(e.$b,2)},"%t":function(){return"\t"},"%u":function(e){return e.Ab||7},"%U":function(e){return a(Math.floor((e.Bb+7-e.Ab)/7),2)},"%V":function(e){var t=Math.floor((e.Bb+7-(e.Ab+6)%7)/7);if(2>=(e.Ab+371-e.Bb-2)%7&&t++,t)53==t&&(4==(n=(e.Ab+371-e.Bb)%7)||3==n&&fe(e.Cb)||(t=1));else{t=52;var n=(e.Ab+7-e.Bb-1)%7;(4==n||5==n&&fe(e.Cb%400-1))&&t++}return a(t,2)},"%w":function(e){return e.Ab},"%W":function(e){return a(Math.floor((e.Bb+7-(e.Ab+6)%7)/7),2)},"%y":function(e){return(e.Cb+1900).toString().substring(2)},"%Y":function(e){return e.Cb+1900},"%z":function(e){var t=0<=(e=e.Yb);return e=Math.abs(e)/60,(t?"+":"-")+String("0000"+(e/60*100+e%60)).slice(-4)},"%Z":function(e){return e.ac},"%%":function(){return"%"}},n=n.replace(/%%/g,"\0\0"),u)n.includes(c)&&(n=n.replace(new RegExp(c,"g"),u[c](r)));return d=n=n.replace(/\0\0/g,"%"),f=Array(D(d)+1),C(d,f,0,f.length),(c=f).length>t?0:(E.set(c,e>>>0),c.length-1)}var ge={a:function(e){return ye(e+24)+24},m:function(e){return(e=new te(e)).Pb()||(e.Ib(!0),J--),e.Jb(!1),Z.push(e),e.Nb(),e.Qb()},ia:function(e){throw w("Unexpected exception thrown, this is not properly supported - aborting"),A=!0,e},w:function(){Se(0);var e=Z.pop();if(e.Xb()&&!e.Lb()){var t=e.Wb();t&&oe(t)(e.Db),ne(e.Db)}ee=0},d:function(){var e=ee;if(!e)return de=0;var t=new te(e);t.Fb(e);var n=t.Eb();if(!n)return de=0,e;for(var r=Array.prototype.slice.call(arguments),o=0;o<r.length;o++){var a=r[o];if(0===a||a===n)break;if(ke(a,n,t.zb+16))return de=a,e}return de=n,e},k:function(){var e=ee;if(!e)return de=0;var t=new te(e);t.Fb(e);var n=t.Eb();if(!n)return de=0,e;for(var r=Array.prototype.slice.call(arguments),o=0;o<r.length;o++){var a=r[o];if(0===a||a===n)break;if(ke(a,n,t.zb+16))return de=a,e}return de=n,e},g:function(){var e=ee;if(!e)return de=0;var t=new te(e);t.Fb(e);var n=t.Eb();if(!n)return de=0,e;for(var r=Array.prototype.slice.call(arguments),o=0;o<r.length;o++){var a=r[o];if(0===a||a===n)break;if(ke(a,n,t.zb+16))return de=a,e}return de=n,e},s:ne,L:function(){var e=Z.pop();e||G("no exception to throw");var t=e.Db;throw e.Lb()||(Z.push(e),e.Jb(!0),e.Ib(!1),J++),ee=t,t},b:function(e,t,n){throw new te(e).Rb(t,n),ee=e,J++,e},la:function(){return J},i:function(e){throw ee||(ee=e),e},H:function(){return 0},Ba:function(){},pa:function(){},ra:function(){},ka:function(){return 0},za:function(){},ua:function(){},ya:function(){},R:function(){},qa:function(){},na:function(){},Aa:function(){},oa:function(){},Ha:function(){},Ja:function(){G("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},Ia:function(){G("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},S:function(){return Date.now()},Ca:function(){return!0},Da:function(e,t){e=new Date(1e3*(O[e>>>2]+4294967296*P[e+4>>>2])),P[t>>2>>>0]=e.getUTCSeconds(),P[t+4>>2>>>0]=e.getUTCMinutes(),P[t+8>>2>>>0]=e.getUTCHours(),P[t+12>>2>>>0]=e.getUTCDate(),P[t+16>>2>>>0]=e.getUTCMonth(),P[t+20>>2>>>0]=e.getUTCFullYear()-1900,P[t+24>>2>>>0]=e.getUTCDay(),P[t+28>>2>>>0]=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(e,t){e=new Date(1e3*(O[e>>>2]+4294967296*P[e+4>>>2])),P[t>>2>>>0]=e.getSeconds(),P[t+4>>2>>>0]=e.getMinutes(),P[t+8>>2>>>0]=e.getHours(),P[t+12>>2>>>0]=e.getDate(),P[t+16>>2>>>0]=e.getMonth(),P[t+20>>2>>>0]=e.getFullYear()-1900,P[t+24>>2>>>0]=e.getDay();var n=new Date(e.getFullYear(),0,1);P[t+28>>2>>>0]=(e.getTime()-n.getTime())/864e5|0,P[t+36>>2>>>0]=-60*e.getTimezoneOffset();var r=new Date(e.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),P[t+32>>2>>>0]=0|(r!=n&&e.getTimezoneOffset()==Math.min(n,r))},Fa:function(e){var t=new Date(P[e+20>>2>>>0]+1900,P[e+16>>2>>>0],P[e+12>>2>>>0],P[e+8>>2>>>0],P[e+4>>2>>>0],P[e>>2>>>0],0),n=P[e+32>>2>>>0],r=t.getTimezoneOffset(),o=new Date(t.getFullYear(),0,1),a=new Date(t.getFullYear(),6,1).getTimezoneOffset(),i=o.getTimezoneOffset(),s=Math.min(i,a);return 0>n?P[e+32>>2>>>0]=Number(a!=i&&s==r):0<n!=(s==r)&&(a=Math.max(i,a),t.setTime(t.getTime()+6e4*((0<n?s:a)-r))),P[e+24>>2>>>0]=t.getDay(),P[e+28>>2>>>0]=(t.getTime()-o.getTime())/864e5|0,P[e>>2>>>0]=t.getSeconds(),P[e+4>>2>>>0]=t.getMinutes(),P[e+8>>2>>>0]=t.getHours(),P[e+12>>2>>>0]=t.getDate(),P[e+16>>2>>>0]=t.getMonth(),t.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function e(t,n,r){e.Vb||(e.Vb=!0,function(e,t,n){function r(e){return(e=e.toTimeString().match(/\(([A-Za-z ]+)\)$/))?e[1]:"GMT"}var o=(new Date).getFullYear(),a=new Date(o,0,1),i=new Date(o,6,1);o=a.getTimezoneOffset();var s=i.getTimezoneOffset();P[e>>2>>>0]=60*Math.max(o,s),P[t>>2>>>0]=Number(o!=s),e=r(a),t=r(i),e=ae(e),t=ae(t),s<o?(O[n>>2>>>0]=e,O[n+4>>2>>>0]=t):(O[n>>2>>>0]=t,O[n+4>>2>>>0]=e)}(t,n,r))},B:function(){G("")},ma:function(){return 4294901760},I:b?()=>{var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:()=>performance.now(),xa:function(e,t,n){k.copyWithin(e>>>0,t>>>0,t+n>>>0)},G:function(e){var t=k.length;if(4294901760<(e>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=t*(1+.2/n);r=Math.min(r,e+100663296);var o=Math;r=Math.max(e,r),o=o.min.call(o,4294901760,r+(65536-r%65536)%65536);e:{try{x.grow(o-T.byteLength+65535>>>16),N();var a=1;break e}catch(i){}a=void 0}if(a)return!0}return!1},va:function(e,t){var n=0;return se().forEach(function(r,o){var a=t+n;for(o=O[e+4*o>>2>>>0]=a,a=0;a<r.length;++a)E[(0|o++)>>>0]=r.charCodeAt(a);E[(0|o)>>>0]=0,n+=r.length+1}),0},wa:function(e,t){var n=se();O[e>>2>>>0]=n.length;var r=0;return n.forEach(function(e){r+=e.length+1}),O[t>>2>>>0]=r,0},ba:function(e){S||0<U||(we(),Q(F),ve(0),ue[1].length&&ce(1,10),ue[2].length&&ce(2,10)),S||0<U||(t.onExit&&t.onExit(e),A=!0),h(e,new K(e))},E:function(){return 52},Q:function(){return 52},ca:function(){return 70},P:function(e,t,n,r){for(var o=0,a=0;a<n;a++){var i=O[t>>2>>>0],s=O[t+4>>2>>>0];t+=8;for(var l=0;l<s;l++)ce(e,k[i+l>>>0]);o+=s}return O[r>>2>>>0]=o,0},c:function(){return de},ja:function e(t,r){e.Mb||(e.Mb=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return()=>(crypto.getRandomValues(e),e[0])}if(b)try{var t=n(Object(function(){var e=new Error("Cannot find module 'crypto'");throw e.code="MODULE_NOT_FOUND",e}()));return()=>t.randomBytes(1)[0]}catch(r){}return()=>G("randomDevice")}());for(var o=0;o<r;o++)E[(t+o|0)>>>0]=e.Mb();return 0},ea:function(e,t,n){var r=xe();try{return oe(e)(t,n)}catch(o){if(Te(r),o!==o+0)throw o;Se(1,0)}},fa:function(e,t,n){var r=xe();try{return oe(e)(t,n)}catch(o){if(Te(r),o!==o+0)throw o;Se(1,0)}},J:function(e){var t=xe();try{return oe(e)()}catch(n){if(Te(t),n!==n+0)throw n;Se(1,0)}},e:function(e,t){var n=xe();try{return oe(e)(t)}catch(r){if(Te(n),r!==r+0)throw r;Se(1,0)}},N:function(e,t,n){var r=xe();try{return oe(e)(t,n)}catch(o){if(Te(r),o!==o+0)throw o;Se(1,0)}},O:function(e,t,n){var r=xe();try{return oe(e)(t,n)}catch(o){if(Te(r),o!==o+0)throw o;Se(1,0)}},j:function(e,t,n){var r=xe();try{return oe(e)(t,n)}catch(o){if(Te(r),o!==o+0)throw o;Se(1,0)}},o:function(e,t,n,r){var o=xe();try{return oe(e)(t,n,r)}catch(a){if(Te(o),a!==a+0)throw a;Se(1,0)}},p:function(e,t,n,r,o){var a=xe();try{return oe(e)(t,n,r,o)}catch(i){if(Te(a),i!==i+0)throw i;Se(1,0)}},M:function(e,t,n,r,o,a){var i=xe();try{return oe(e)(t,n,r,o,a)}catch(s){if(Te(i),s!==s+0)throw s;Se(1,0)}},r:function(e,t,n,r,o,a){var i=xe();try{return oe(e)(t,n,r,o,a)}catch(s){if(Te(i),s!==s+0)throw s;Se(1,0)}},v:function(e,t,n,r,o,a,i){var s=xe();try{return oe(e)(t,n,r,o,a,i)}catch(l){if(Te(s),l!==l+0)throw l;Se(1,0)}},K:function(e,t,n,r,o,a,i,s){var l=xe();try{return oe(e)(t,n,r,o,a,i,s)}catch(u){if(Te(l),u!==u+0)throw u;Se(1,0)}},D:function(e,t,n,r,o,a,i,s,l,u,c,d){var f=xe();try{return oe(e)(t,n,r,o,a,i,s,l,u,c,d)}catch(p){if(Te(f),p!==p+0)throw p;Se(1,0)}},X:function(e,t,n,r,o,a,i,s){var l=xe();try{return Me(e,t,n,r,o,a,i,s)}catch(u){if(Te(l),u!==u+0)throw u;Se(1,0)}},V:function(e,t,n,r,o,a,i){var s=xe();try{return Ae(e,t,n,r,o,a,i)}catch(l){if(Te(s),l!==l+0)throw l;Se(1,0)}},U:function(e,t,n,r,o){var a=xe();try{return Le(e,t,n,r,o)}catch(i){if(Te(a),i!==i+0)throw i;Se(1,0)}},Z:function(e,t,n,r){var o=xe();try{return De(e,t,n,r)}catch(a){if(Te(o),a!==a+0)throw a;Se(1,0)}},W:function(e){var t=xe();try{return Oe(e)}catch(n){if(Te(t),n!==n+0)throw n;Se(1,0)}},Y:function(e,t){var n=xe();try{return Ne(e,t)}catch(r){if(Te(n),r!==r+0)throw r;Se(1,0)}},T:function(e,t,n){var r=xe();try{return Re(e,t,n)}catch(o){if(Te(r),o!==o+0)throw o;Se(1,0)}},f:function(e){var t=xe();try{oe(e)()}catch(n){if(Te(t),n!==n+0)throw n;Se(1,0)}},q:function(e,t){var n=xe();try{oe(e)(t)}catch(r){if(Te(n),r!==r+0)throw r;Se(1,0)}},h:function(e,t,n){var r=xe();try{oe(e)(t,n)}catch(o){if(Te(r),o!==o+0)throw o;Se(1,0)}},da:function(e,t,n,r){var o=xe();try{oe(e)(t,n,r)}catch(a){if(Te(o),a!==a+0)throw a;Se(1,0)}},l:function(e,t,n,r){var o=xe();try{oe(e)(t,n,r)}catch(a){if(Te(o),a!==a+0)throw a;Se(1,0)}},t:function(e,t,n,r,o){var a=xe();try{oe(e)(t,n,r,o)}catch(i){if(Te(a),i!==i+0)throw i;Se(1,0)}},u:function(e,t,n,r,o,a){var i=xe();try{oe(e)(t,n,r,o,a)}catch(s){if(Te(i),s!==s+0)throw s;Se(1,0)}},x:function(e,t,n,r,o,a,i){var s=xe();try{oe(e)(t,n,r,o,a,i)}catch(l){if(Te(s),l!==l+0)throw l;Se(1,0)}},z:function(e,t,n,r,o,a,i,s){var l=xe();try{oe(e)(t,n,r,o,a,i,s)}catch(u){if(Te(l),u!==u+0)throw u;Se(1,0)}},ga:function(e,t,n,r,o,a,i,s,l){var u=xe();try{oe(e)(t,n,r,o,a,i,s,l)}catch(c){if(Te(u),c!==c+0)throw c;Se(1,0)}},A:function(e,t,n,r,o,a,i,s,l,u,c){var d=xe();try{oe(e)(t,n,r,o,a,i,s,l,u,c)}catch(f){if(Te(d),f!==f+0)throw f;Se(1,0)}},C:function(e,t,n,r,o,a,i,s,l,u,c,d,f,p,h,m){var g=xe();try{oe(e)(t,n,r,o,a,i,s,l,u,c,d,f,p,h,m)}catch(b){if(Te(g),b!==b+0)throw b;Se(1,0)}},aa:function(e,t,n,r,o,a,i,s){var l=xe();try{$e(e,t,n,r,o,a,i,s)}catch(u){if(Te(l),u!==u+0)throw u;Se(1,0)}},_:function(e,t,n,r,o,a,i,s,l,u,c,d){var f=xe();try{Ce(e,t,n,r,o,a,i,s,l,u,c,d)}catch(p){if(Te(f),p!==p+0)throw p;Se(1,0)}},$:function(e,t,n,r,o,a){var i=xe();try{Ie(e,t,n,r,o,a)}catch(s){if(Te(i),s!==s+0)throw s;Se(1,0)}},n:function(e){return e},F:function(e){de=e},ha:me,y:function(e,t,n,r){return me(e,t,n,r)}};!function(){function e(e){t.asm=e.exports,x=t.asm.Ka,N(),M=t.asm.ib,j.unshift(t.asm.La),H--,t.monitorRunDependencies&&t.monitorRunDependencies(H),0==H&&q&&(e=q,q=null,e())}function n(t){e(t.instance)}function r(e){return function(){if(!_&&(m||g)){if("function"==typeof fetch&&!V.startsWith("file://"))return fetch(V,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+V+"'";return e.arrayBuffer()}).catch(function(){return X()});if(s)return new Promise(function(e,t){s(V,function(t){e(new Uint8Array(t))},t)})}return Promise.resolve().then(function(){return X()})}().then(function(e){return WebAssembly.instantiate(e,o)}).then(function(e){return e}).then(e,function(e){w("failed to asynchronously prepare wasm: "+e),G(e)})}var o={a:ge};if(H++,t.monitorRunDependencies&&t.monitorRunDependencies(H),t.instantiateWasm)try{return t.instantiateWasm(o,e)}catch(i){return w("Module.instantiateWasm callback failed with error: "+i),!1}(_||"function"!=typeof WebAssembly.instantiateStreaming||W()||V.startsWith("file://")||b||"function"!=typeof fetch?r(n):fetch(V,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,o).then(n,function(e){return w("wasm streaming compile failed: "+e),w("falling back to ArrayBuffer instantiation"),r(n)})})).catch(a)}(),t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.La).apply(null,arguments)},t._OrtInit=function(){return(t._OrtInit=t.asm.Ma).apply(null,arguments)},t._OrtCreateSessionOptions=function(){return(t._OrtCreateSessionOptions=t.asm.Na).apply(null,arguments)},t._OrtAppendExecutionProvider=function(){return(t._OrtAppendExecutionProvider=t.asm.Oa).apply(null,arguments)},t._OrtAddSessionConfigEntry=function(){return(t._OrtAddSessionConfigEntry=t.asm.Pa).apply(null,arguments)},t._OrtReleaseSessionOptions=function(){return(t._OrtReleaseSessionOptions=t.asm.Qa).apply(null,arguments)},t._OrtCreateSession=function(){return(t._OrtCreateSession=t.asm.Ra).apply(null,arguments)},t._OrtReleaseSession=function(){return(t._OrtReleaseSession=t.asm.Sa).apply(null,arguments)},t._OrtGetInputCount=function(){return(t._OrtGetInputCount=t.asm.Ta).apply(null,arguments)},t._OrtGetOutputCount=function(){return(t._OrtGetOutputCount=t.asm.Ua).apply(null,arguments)},t._OrtGetInputName=function(){return(t._OrtGetInputName=t.asm.Va).apply(null,arguments)},t._OrtGetOutputName=function(){return(t._OrtGetOutputName=t.asm.Wa).apply(null,arguments)},t._OrtFree=function(){return(t._OrtFree=t.asm.Xa).apply(null,arguments)},t._OrtCreateTensor=function(){return(t._OrtCreateTensor=t.asm.Ya).apply(null,arguments)},t._OrtGetTensorData=function(){return(t._OrtGetTensorData=t.asm.Za).apply(null,arguments)},t._OrtReleaseTensor=function(){return(t._OrtReleaseTensor=t.asm._a).apply(null,arguments)},t._OrtCreateRunOptions=function(){return(t._OrtCreateRunOptions=t.asm.$a).apply(null,arguments)},t._OrtAddRunConfigEntry=function(){return(t._OrtAddRunConfigEntry=t.asm.ab).apply(null,arguments)},t._OrtReleaseRunOptions=function(){return(t._OrtReleaseRunOptions=t.asm.bb).apply(null,arguments)},t._OrtRun=function(){return(t._OrtRun=t.asm.cb).apply(null,arguments)},t._OrtEndProfiling=function(){return(t._OrtEndProfiling=t.asm.db).apply(null,arguments)};var be,ye=t._malloc=function(){return(ye=t._malloc=t.asm.eb).apply(null,arguments)},_e=t._free=function(){return(_e=t._free=t.asm.fb).apply(null,arguments)},ve=t._fflush=function(){return(ve=t._fflush=t.asm.gb).apply(null,arguments)},we=t.___funcs_on_exit=function(){return(we=t.___funcs_on_exit=t.asm.hb).apply(null,arguments)},Se=t._setThrew=function(){return(Se=t._setThrew=t.asm.jb).apply(null,arguments)},xe=t.stackSave=function(){return(xe=t.stackSave=t.asm.kb).apply(null,arguments)},Te=t.stackRestore=function(){return(Te=t.stackRestore=t.asm.lb).apply(null,arguments)},Ee=t.stackAlloc=function(){return(Ee=t.stackAlloc=t.asm.mb).apply(null,arguments)},ke=t.___cxa_can_catch=function(){return(ke=t.___cxa_can_catch=t.asm.nb).apply(null,arguments)},Pe=t.___cxa_is_pointer_type=function(){return(Pe=t.___cxa_is_pointer_type=t.asm.ob).apply(null,arguments)},Oe=t.dynCall_j=function(){return(Oe=t.dynCall_j=t.asm.pb).apply(null,arguments)},Ae=t.dynCall_iiiiij=function(){return(Ae=t.dynCall_iiiiij=t.asm.qb).apply(null,arguments)},Re=t.dynCall_jii=function(){return(Re=t.dynCall_jii=t.asm.rb).apply(null,arguments)},$e=t.dynCall_viiiiij=function(){return($e=t.dynCall_viiiiij=t.asm.sb).apply(null,arguments)},Ie=t.dynCall_vjji=function(){return(Ie=t.dynCall_vjji=t.asm.tb).apply(null,arguments)},Ce=t.dynCall_viiijjjii=function(){return(Ce=t.dynCall_viiijjjii=t.asm.ub).apply(null,arguments)},De=t.dynCall_iij=function(){return(De=t.dynCall_iij=t.asm.vb).apply(null,arguments)},Ne=t.dynCall_ji=function(){return(Ne=t.dynCall_ji=t.asm.wb).apply(null,arguments)},Me=t.dynCall_iiiiiij=function(){return(Me=t.dynCall_iiiiiij=t.asm.xb).apply(null,arguments)},Le=t.dynCall_iiij=function(){return(Le=t.dynCall_iiij=t.asm.yb).apply(null,arguments)};function je(){function e(){if(!be&&(be=!0,t.calledRun=!0,!A)){if(Q(j),o(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),t.postRun)for("function"==typeof t.postRun&&(t.postRun=[t.postRun]);t.postRun.length;){var e=t.postRun.shift();B.unshift(e)}Q(B)}}if(!(0<H)){if(t.preRun)for("function"==typeof t.preRun&&(t.preRun=[t.preRun]);t.preRun.length;)z();Q(L),0<H||(t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),e()},1)):e())}}if(t.UTF8ToString=I,t.stringToUTF8=function(e,t,n){return C(e,k,t,n)},t.lengthBytesUTF8=D,t.stackSave=xe,t.stackRestore=Te,t.stackAlloc=Ee,q=function e(){be||je(),be||(q=e)},t.preInit)for("function"==typeof t.preInit&&(t.preInit=[t.preInit]);0<t.preInit.length;)t.preInit.pop()();return je(),e.ready});e.exports=o},4537:e=>{e.exports=function(e,t){for(var n=new Array(arguments.length-1),r=0,o=2,a=!0;o<arguments.length;)n[r++]=arguments[o++];return new Promise(function(o,i){n[r]=function(e){if(a)if(a=!1,e)i(e);else{for(var t=new Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];o.apply(null,t)}};try{e.apply(t||null,n)}catch(s){a&&(a=!1,i(s))}})}},7419:(e,t)=>{var n=t;n.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var r=new Array(64),o=new Array(123),a=0;a<64;)o[r[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;n.encode=function(e,t,n){for(var o,a=null,i=[],s=0,l=0;t<n;){var u=e[t++];switch(l){case 0:i[s++]=r[u>>2],o=(3&u)<<4,l=1;break;case 1:i[s++]=r[o|u>>4],o=(15&u)<<2,l=2;break;case 2:i[s++]=r[o|u>>6],i[s++]=r[63&u],l=0}s>8191&&((a||(a=[])).push(String.fromCharCode.apply(String,i)),s=0)}return l&&(i[s++]=r[o],i[s++]=61,1===l&&(i[s++]=61)),a?(s&&a.push(String.fromCharCode.apply(String,i.slice(0,s))),a.join("")):String.fromCharCode.apply(String,i.slice(0,s))};var i="invalid encoding";n.decode=function(e,t,n){for(var r,a=n,s=0,l=0;l<e.length;){var u=e.charCodeAt(l++);if(61===u&&s>1)break;if(void 0===(u=o[u]))throw Error(i);switch(s){case 0:r=u,s=1;break;case 1:t[n++]=r<<2|(48&u)>>4,r=u,s=2;break;case 2:t[n++]=(15&r)<<4|(60&u)>>2,r=u,s=3;break;case 3:t[n++]=(3&r)<<6|u,s=0}}if(1===s)throw Error(i);return n-a},n.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},9211:e=>{function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}},945:e=>{function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=128===n[3];function o(e,r,o){t[0]=e,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3]}function a(e,r,o){t[0]=e,r[o]=n[3],r[o+1]=n[2],r[o+2]=n[1],r[o+3]=n[0]}function i(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function s(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.writeFloatLE=r?o:a,e.writeFloatBE=r?a:o,e.readFloatLE=r?i:s,e.readFloatBE=r?s:i}():function(){function t(e,t,n,r){var o=t<0?1:0;if(o&&(t=-t),0===t)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((o<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((o<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var a=Math.floor(Math.log(t)/Math.LN2);e((o<<31|a+127<<23|8388607&Math.round(t*Math.pow(2,-a)*8388608))>>>0,n,r)}}function i(e,t,n){var r=e(t,n),o=2*(r>>31)+1,a=r>>>23&255,i=8388607&r;return 255===a?i?NaN:o*(1/0):0===a?1401298464324817e-60*o*i:o*Math.pow(2,a-150)*(i+8388608)}e.writeFloatLE=t.bind(null,n),e.writeFloatBE=t.bind(null,r),e.readFloatLE=i.bind(null,o),e.readFloatBE=i.bind(null,a)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=128===n[7];function o(e,r,o){t[0]=e,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3],r[o+4]=n[4],r[o+5]=n[5],r[o+6]=n[6],r[o+7]=n[7]}function a(e,r,o){t[0]=e,r[o]=n[7],r[o+1]=n[6],r[o+2]=n[5],r[o+3]=n[4],r[o+4]=n[3],r[o+5]=n[2],r[o+6]=n[1],r[o+7]=n[0]}function i(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function s(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.writeDoubleLE=r?o:a,e.writeDoubleBE=r?a:o,e.readDoubleLE=r?i:s,e.readDoubleBE=r?s:i}():function(){function t(e,t,n,r,o,a){var i=r<0?1:0;if(i&&(r=-r),0===r)e(0,o,a+t),e(1/r>0?0:2147483648,o,a+n);else if(isNaN(r))e(0,o,a+t),e(2146959360,o,a+n);else if(r>17976931348623157e292)e(0,o,a+t),e((i<<31|2146435072)>>>0,o,a+n);else{var s;if(r<22250738585072014e-324)e((s=r/5e-324)>>>0,o,a+t),e((i<<31|s/4294967296)>>>0,o,a+n);else{var l=Math.floor(Math.log(r)/Math.LN2);1024===l&&(l=1023),e(4503599627370496*(s=r*Math.pow(2,-l))>>>0,o,a+t),e((i<<31|l+1023<<20|1048576*s&1048575)>>>0,o,a+n)}}}function i(e,t,n,r,o){var a=e(r,o+t),i=e(r,o+n),s=2*(i>>31)+1,l=i>>>20&2047,u=4294967296*(1048575&i)+a;return 2047===l?u?NaN:s*(1/0):0===l?5e-324*s*u:s*Math.pow(2,l-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,n,0,4),e.writeDoubleBE=t.bind(null,r,4,0),e.readDoubleLE=i.bind(null,o,0,4),e.readDoubleBE=i.bind(null,a,4,0)}(),e}function n(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function r(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function o(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function a(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},7199:module=>{function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(t){}return null}module.exports=inquire},6662:e=>{e.exports=function(e,t,n){var r=n||8192,o=r>>>1,a=null,i=r;return function(n){if(n<1||n>o)return e(n);i+n>r&&(a=e(r),i=0);var s=t.call(a,i,i+=n);return 7&i&&(i=1+(7|i)),s}}},4997:(e,t)=>{var n=t;n.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)(n=e.charCodeAt(r))<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t},n.read=function(e,t,n){if(n-t<1)return"";for(var r,o=null,a=[],i=0;t<n;)(r=e[t++])<128?a[i++]=r:r>191&&r<224?a[i++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,a[i++]=55296+(r>>10),a[i++]=56320+(1023&r)):a[i++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],i>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,a)),i=0);return o?(i&&o.push(String.fromCharCode.apply(String,a.slice(0,i))),o.join("")):String.fromCharCode.apply(String,a.slice(0,i))},n.write=function(e,t,n){for(var r,o,a=n,i=0;i<e.length;++i)(r=e.charCodeAt(i))<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(o=e.charCodeAt(i+1)))?(r=65536+((1023&r)<<10)+(1023&o),++i,t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128);return n-a}},3442:(e,t)=>{t.__esModule=!0;var n=function(){function e(t){if(!t)throw new TypeError("Invalid argument; `value` has no value.");this.value=e.EMPTY,t&&e.isGuid(t)&&(this.value=t)}return e.isGuid=function(t){var n=t.toString();return t&&(t instanceof e||e.validator.test(n))},e.create=function(){return new e([e.gen(2),e.gen(1),e.gen(1),e.gen(1),e.gen(3)].join("-"))},e.createEmpty=function(){return new e("emptyguid")},e.parse=function(t){return new e(t)},e.raw=function(){return[e.gen(2),e.gen(1),e.gen(1),e.gen(1),e.gen(3)].join("-")},e.gen=function(e){for(var t="",n=0;n<e;n++)t+=(65536*(1+Math.random())|0).toString(16).substring(1);return t},e.prototype.equals=function(t){return e.isGuid(t)&&this.value===t.toString()},e.prototype.isEmpty=function(){return this.value===e.EMPTY},e.prototype.toString=function(){return this.value},e.prototype.toJSON=function(){return{value:this.value}},e.validator=new RegExp("^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$","i"),e.EMPTY="00000000-0000-0000-0000-000000000000",e}();t.Guid=n},3720:e=>{e.exports=n;var t=null;try{t=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(E){}function n(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function r(e){return!0===(e&&e.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=r;var o={},a={};function i(e,t){var n,r,i;return t?(i=0<=(e>>>=0)&&e<256)&&(r=a[e])?r:(n=l(e,(0|e)<0?-1:0,!0),i&&(a[e]=n),n):(i=-128<=(e|=0)&&e<128)&&(r=o[e])?r:(n=l(e,e<0?-1:0,!1),i&&(o[e]=n),n)}function s(e,t){if(isNaN(e))return t?b:g;if(t){if(e<0)return b;if(e>=p)return S}else{if(e<=-h)return x;if(e+1>=h)return w}return e<0?s(-e,t).neg():l(e%f|0,e/f|0,t)}function l(e,t,r){return new n(e,t,r)}n.fromInt=i,n.fromNumber=s,n.fromBits=l;var u=Math.pow;function c(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||36<n)throw RangeError("radix");var r;if((r=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===r)return c(e.substring(1),t,n).neg();for(var o=s(u(n,8)),a=g,i=0;i<e.length;i+=8){var l=Math.min(8,e.length-i),d=parseInt(e.substring(i,i+l),n);if(l<8){var f=s(u(n,l));a=a.mul(f).add(s(d))}else a=(a=a.mul(o)).add(s(d))}return a.unsigned=t,a}function d(e,t){return"number"==typeof e?s(e,t):"string"==typeof e?c(e,t):l(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}n.fromString=c,n.fromValue=d;var f=4294967296,p=f*f,h=p/2,m=i(1<<24),g=i(0);n.ZERO=g;var b=i(0,!0);n.UZERO=b;var y=i(1);n.ONE=y;var _=i(1,!0);n.UONE=_;var v=i(-1);n.NEG_ONE=v;var w=l(-1,2147483647,!1);n.MAX_VALUE=w;var S=l(-1,-1,!0);n.MAX_UNSIGNED_VALUE=S;var x=l(0,-2147483648,!1);n.MIN_VALUE=x;var T=n.prototype;T.toInt=function(){return this.unsigned?this.low>>>0:this.low},T.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},T.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(x)){var t=s(e),n=this.div(t),r=n.mul(t).sub(this);return n.toString(e)+r.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var o=s(u(e,6),this.unsigned),a=this,i="";;){var l=a.div(o),c=(a.sub(l.mul(o)).toInt()>>>0).toString(e);if((a=l).isZero())return c+i;for(;c.length<6;)c="0"+c;i=""+c+i}},T.getHighBits=function(){return this.high},T.getHighBitsUnsigned=function(){return this.high>>>0},T.getLowBits=function(){return this.low},T.getLowBitsUnsigned=function(){return this.low>>>0},T.getNumBitsAbs=function(){if(this.isNegative())return this.eq(x)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},T.isZero=function(){return 0===this.high&&0===this.low},T.eqz=T.isZero,T.isNegative=function(){return!this.unsigned&&this.high<0},T.isPositive=function(){return this.unsigned||this.high>=0},T.isOdd=function(){return!(1&~this.low)},T.isEven=function(){return!(1&this.low)},T.equals=function(e){return r(e)||(e=d(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},T.eq=T.equals,T.notEquals=function(e){return!this.eq(e)},T.neq=T.notEquals,T.ne=T.notEquals,T.lessThan=function(e){return this.comp(e)<0},T.lt=T.lessThan,T.lessThanOrEqual=function(e){return this.comp(e)<=0},T.lte=T.lessThanOrEqual,T.le=T.lessThanOrEqual,T.greaterThan=function(e){return this.comp(e)>0},T.gt=T.greaterThan,T.greaterThanOrEqual=function(e){return this.comp(e)>=0},T.gte=T.greaterThanOrEqual,T.ge=T.greaterThanOrEqual,T.compare=function(e){if(r(e)||(e=d(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},T.comp=T.compare,T.negate=function(){return!this.unsigned&&this.eq(x)?x:this.not().add(y)},T.neg=T.negate,T.add=function(e){r(e)||(e=d(e));var t=this.high>>>16,n=65535&this.high,o=this.low>>>16,a=65535&this.low,i=e.high>>>16,s=65535&e.high,u=e.low>>>16,c=0,f=0,p=0,h=0;return p+=(h+=a+(65535&e.low))>>>16,f+=(p+=o+u)>>>16,c+=(f+=n+s)>>>16,c+=t+i,l((p&=65535)<<16|(h&=65535),(c&=65535)<<16|(f&=65535),this.unsigned)},T.subtract=function(e){return r(e)||(e=d(e)),this.add(e.neg())},T.sub=T.subtract,T.multiply=function(e){if(this.isZero())return g;if(r(e)||(e=d(e)),t)return l(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(x))return e.isOdd()?x:g;if(e.eq(x))return this.isOdd()?x:g;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(m)&&e.lt(m))return s(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,o=65535&this.high,a=this.low>>>16,i=65535&this.low,u=e.high>>>16,c=65535&e.high,f=e.low>>>16,p=65535&e.low,h=0,b=0,y=0,_=0;return y+=(_+=i*p)>>>16,b+=(y+=a*p)>>>16,y&=65535,b+=(y+=i*f)>>>16,h+=(b+=o*p)>>>16,b&=65535,h+=(b+=a*f)>>>16,b&=65535,h+=(b+=i*c)>>>16,h+=n*p+o*f+a*c+i*u,l((y&=65535)<<16|(_&=65535),(h&=65535)<<16|(b&=65535),this.unsigned)},T.mul=T.multiply,T.divide=function(e){if(r(e)||(e=d(e)),e.isZero())throw Error("division by zero");var n,o,a;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?l((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?b:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return b;if(e.gt(this.shru(1)))return _;a=b}else{if(this.eq(x))return e.eq(y)||e.eq(v)?x:e.eq(x)?y:(n=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?y:v:(o=this.sub(e.mul(n)),a=n.add(o.div(e)));if(e.eq(x))return this.unsigned?b:g;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();a=g}for(o=this;o.gte(e);){n=Math.max(1,Math.floor(o.toNumber()/e.toNumber()));for(var i=Math.ceil(Math.log(n)/Math.LN2),c=i<=48?1:u(2,i-48),f=s(n),p=f.mul(e);p.isNegative()||p.gt(o);)p=(f=s(n-=c,this.unsigned)).mul(e);f.isZero()&&(f=y),a=a.add(f),o=o.sub(p)}return a},T.div=T.divide,T.modulo=function(e){return r(e)||(e=d(e)),t?l((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},T.mod=T.modulo,T.rem=T.modulo,T.not=function(){return l(~this.low,~this.high,this.unsigned)},T.and=function(e){return r(e)||(e=d(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},T.or=function(e){return r(e)||(e=d(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},T.xor=function(e){return r(e)||(e=d(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},T.shiftLeft=function(e){return r(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):l(0,this.low<<e-32,this.unsigned)},T.shl=T.shiftLeft,T.shiftRight=function(e){return r(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},T.shr=T.shiftRight,T.shiftRightUnsigned=function(e){if(r(e)&&(e=e.toInt()),0==(e&=63))return this;var t=this.high;return e<32?l(this.low>>>e|t<<32-e,t>>>e,this.unsigned):l(32===e?t:t>>>e-32,0,this.unsigned)},T.shru=T.shiftRightUnsigned,T.shr_u=T.shiftRightUnsigned,T.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},T.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},T.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},T.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},T.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},n.fromBytes=function(e,t,r){return r?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},1446:(e,t,n)=>{var r,o,a,i=n(2100),s=i.Reader,l=i.Writer,u=i.util,c=i.roots.default||(i.roots.default={});c.onnx=((a={}).Version=(r={},(o=Object.create(r))[r[0]="_START_VERSION"]=0,o[r[1]="IR_VERSION_2017_10_10"]=1,o[r[2]="IR_VERSION_2017_10_30"]=2,o[r[3]="IR_VERSION_2017_11_3"]=3,o[r[4]="IR_VERSION_2019_1_22"]=4,o[r[5]="IR_VERSION"]=5,o),a.AttributeProto=function(){function e(e){if(this.floats=[],this.ints=[],this.strings=[],this.tensors=[],this.graphs=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.name="",e.prototype.refAttrName="",e.prototype.docString="",e.prototype.type=0,e.prototype.f=0,e.prototype.i=u.Long?u.Long.fromBits(0,0,!1):0,e.prototype.s=u.newBuffer([]),e.prototype.t=null,e.prototype.g=null,e.prototype.floats=u.emptyArray,e.prototype.ints=u.emptyArray,e.prototype.strings=u.emptyArray,e.prototype.tensors=u.emptyArray,e.prototype.graphs=u.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=l.create()),null!=e.name&&e.hasOwnProperty("name")&&t.uint32(10).string(e.name),null!=e.f&&e.hasOwnProperty("f")&&t.uint32(21).float(e.f),null!=e.i&&e.hasOwnProperty("i")&&t.uint32(24).int64(e.i),null!=e.s&&e.hasOwnProperty("s")&&t.uint32(34).bytes(e.s),null!=e.t&&e.hasOwnProperty("t")&&c.onnx.TensorProto.encode(e.t,t.uint32(42).fork()).ldelim(),null!=e.g&&e.hasOwnProperty("g")&&c.onnx.GraphProto.encode(e.g,t.uint32(50).fork()).ldelim(),null!=e.floats&&e.floats.length){t.uint32(58).fork();for(var n=0;n<e.floats.length;++n)t.float(e.floats[n]);t.ldelim()}if(null!=e.ints&&e.ints.length){for(t.uint32(66).fork(),n=0;n<e.ints.length;++n)t.int64(e.ints[n]);t.ldelim()}if(null!=e.strings&&e.strings.length)for(n=0;n<e.strings.length;++n)t.uint32(74).bytes(e.strings[n]);if(null!=e.tensors&&e.tensors.length)for(n=0;n<e.tensors.length;++n)c.onnx.TensorProto.encode(e.tensors[n],t.uint32(82).fork()).ldelim();if(null!=e.graphs&&e.graphs.length)for(n=0;n<e.graphs.length;++n)c.onnx.GraphProto.encode(e.graphs[n],t.uint32(90).fork()).ldelim();return null!=e.docString&&e.hasOwnProperty("docString")&&t.uint32(106).string(e.docString),null!=e.type&&e.hasOwnProperty("type")&&t.uint32(160).int32(e.type),null!=e.refAttrName&&e.hasOwnProperty("refAttrName")&&t.uint32(170).string(e.refAttrName),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.AttributeProto;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.name=e.string();break;case 21:r.refAttrName=e.string();break;case 13:r.docString=e.string();break;case 20:r.type=e.int32();break;case 2:r.f=e.float();break;case 3:r.i=e.int64();break;case 4:r.s=e.bytes();break;case 5:r.t=c.onnx.TensorProto.decode(e,e.uint32());break;case 6:r.g=c.onnx.GraphProto.decode(e,e.uint32());break;case 7:if(r.floats&&r.floats.length||(r.floats=[]),2==(7&o))for(var a=e.uint32()+e.pos;e.pos<a;)r.floats.push(e.float());else r.floats.push(e.float());break;case 8:if(r.ints&&r.ints.length||(r.ints=[]),2==(7&o))for(a=e.uint32()+e.pos;e.pos<a;)r.ints.push(e.int64());else r.ints.push(e.int64());break;case 9:r.strings&&r.strings.length||(r.strings=[]),r.strings.push(e.bytes());break;case 10:r.tensors&&r.tensors.length||(r.tensors=[]),r.tensors.push(c.onnx.TensorProto.decode(e,e.uint32()));break;case 11:r.graphs&&r.graphs.length||(r.graphs=[]),r.graphs.push(c.onnx.GraphProto.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!u.isString(e.name))return"name: string expected";if(null!=e.refAttrName&&e.hasOwnProperty("refAttrName")&&!u.isString(e.refAttrName))return"refAttrName: string expected";if(null!=e.docString&&e.hasOwnProperty("docString")&&!u.isString(e.docString))return"docString: string expected";if(null!=e.type&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:}if(null!=e.f&&e.hasOwnProperty("f")&&"number"!=typeof e.f)return"f: number expected";if(null!=e.i&&e.hasOwnProperty("i")&&!(u.isInteger(e.i)||e.i&&u.isInteger(e.i.low)&&u.isInteger(e.i.high)))return"i: integer|Long expected";if(null!=e.s&&e.hasOwnProperty("s")&&!(e.s&&"number"==typeof e.s.length||u.isString(e.s)))return"s: buffer expected";if(null!=e.t&&e.hasOwnProperty("t")&&(n=c.onnx.TensorProto.verify(e.t)))return"t."+n;if(null!=e.g&&e.hasOwnProperty("g")&&(n=c.onnx.GraphProto.verify(e.g)))return"g."+n;if(null!=e.floats&&e.hasOwnProperty("floats")){if(!Array.isArray(e.floats))return"floats: array expected";for(var t=0;t<e.floats.length;++t)if("number"!=typeof e.floats[t])return"floats: number[] expected"}if(null!=e.ints&&e.hasOwnProperty("ints")){if(!Array.isArray(e.ints))return"ints: array expected";for(t=0;t<e.ints.length;++t)if(!(u.isInteger(e.ints[t])||e.ints[t]&&u.isInteger(e.ints[t].low)&&u.isInteger(e.ints[t].high)))return"ints: integer|Long[] expected"}if(null!=e.strings&&e.hasOwnProperty("strings")){if(!Array.isArray(e.strings))return"strings: array expected";for(t=0;t<e.strings.length;++t)if(!(e.strings[t]&&"number"==typeof e.strings[t].length||u.isString(e.strings[t])))return"strings: buffer[] expected"}if(null!=e.tensors&&e.hasOwnProperty("tensors")){if(!Array.isArray(e.tensors))return"tensors: array expected";for(t=0;t<e.tensors.length;++t)if(n=c.onnx.TensorProto.verify(e.tensors[t]))return"tensors."+n}if(null!=e.graphs&&e.hasOwnProperty("graphs")){if(!Array.isArray(e.graphs))return"graphs: array expected";for(t=0;t<e.graphs.length;++t){var n;if(n=c.onnx.GraphProto.verify(e.graphs[t]))return"graphs."+n}}return null},e.fromObject=function(e){if(e instanceof c.onnx.AttributeProto)return e;var t=new c.onnx.AttributeProto;switch(null!=e.name&&(t.name=String(e.name)),null!=e.refAttrName&&(t.refAttrName=String(e.refAttrName)),null!=e.docString&&(t.docString=String(e.docString)),e.type){case"UNDEFINED":case 0:t.type=0;break;case"FLOAT":case 1:t.type=1;break;case"INT":case 2:t.type=2;break;case"STRING":case 3:t.type=3;break;case"TENSOR":case 4:t.type=4;break;case"GRAPH":case 5:t.type=5;break;case"FLOATS":case 6:t.type=6;break;case"INTS":case 7:t.type=7;break;case"STRINGS":case 8:t.type=8;break;case"TENSORS":case 9:t.type=9;break;case"GRAPHS":case 10:t.type=10}if(null!=e.f&&(t.f=Number(e.f)),null!=e.i&&(u.Long?(t.i=u.Long.fromValue(e.i)).unsigned=!1:"string"==typeof e.i?t.i=parseInt(e.i,10):"number"==typeof e.i?t.i=e.i:"object"==typeof e.i&&(t.i=new u.LongBits(e.i.low>>>0,e.i.high>>>0).toNumber())),null!=e.s&&("string"==typeof e.s?u.base64.decode(e.s,t.s=u.newBuffer(u.base64.length(e.s)),0):e.s.length&&(t.s=e.s)),null!=e.t){if("object"!=typeof e.t)throw TypeError(".onnx.AttributeProto.t: object expected");t.t=c.onnx.TensorProto.fromObject(e.t)}if(null!=e.g){if("object"!=typeof e.g)throw TypeError(".onnx.AttributeProto.g: object expected");t.g=c.onnx.GraphProto.fromObject(e.g)}if(e.floats){if(!Array.isArray(e.floats))throw TypeError(".onnx.AttributeProto.floats: array expected");t.floats=[];for(var n=0;n<e.floats.length;++n)t.floats[n]=Number(e.floats[n])}if(e.ints){if(!Array.isArray(e.ints))throw TypeError(".onnx.AttributeProto.ints: array expected");for(t.ints=[],n=0;n<e.ints.length;++n)u.Long?(t.ints[n]=u.Long.fromValue(e.ints[n])).unsigned=!1:"string"==typeof e.ints[n]?t.ints[n]=parseInt(e.ints[n],10):"number"==typeof e.ints[n]?t.ints[n]=e.ints[n]:"object"==typeof e.ints[n]&&(t.ints[n]=new u.LongBits(e.ints[n].low>>>0,e.ints[n].high>>>0).toNumber())}if(e.strings){if(!Array.isArray(e.strings))throw TypeError(".onnx.AttributeProto.strings: array expected");for(t.strings=[],n=0;n<e.strings.length;++n)"string"==typeof e.strings[n]?u.base64.decode(e.strings[n],t.strings[n]=u.newBuffer(u.base64.length(e.strings[n])),0):e.strings[n].length&&(t.strings[n]=e.strings[n])}if(e.tensors){if(!Array.isArray(e.tensors))throw TypeError(".onnx.AttributeProto.tensors: array expected");for(t.tensors=[],n=0;n<e.tensors.length;++n){if("object"!=typeof e.tensors[n])throw TypeError(".onnx.AttributeProto.tensors: object expected");t.tensors[n]=c.onnx.TensorProto.fromObject(e.tensors[n])}}if(e.graphs){if(!Array.isArray(e.graphs))throw TypeError(".onnx.AttributeProto.graphs: array expected");for(t.graphs=[],n=0;n<e.graphs.length;++n){if("object"!=typeof e.graphs[n])throw TypeError(".onnx.AttributeProto.graphs: object expected");t.graphs[n]=c.onnx.GraphProto.fromObject(e.graphs[n])}}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.floats=[],n.ints=[],n.strings=[],n.tensors=[],n.graphs=[]),t.defaults){if(n.name="",n.f=0,u.Long){var r=new u.Long(0,0,!1);n.i=t.longs===String?r.toString():t.longs===Number?r.toNumber():r}else n.i=t.longs===String?"0":0;t.bytes===String?n.s="":(n.s=[],t.bytes!==Array&&(n.s=u.newBuffer(n.s))),n.t=null,n.g=null,n.docString="",n.type=t.enums===String?"UNDEFINED":0,n.refAttrName=""}if(null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.f&&e.hasOwnProperty("f")&&(n.f=t.json&&!isFinite(e.f)?String(e.f):e.f),null!=e.i&&e.hasOwnProperty("i")&&("number"==typeof e.i?n.i=t.longs===String?String(e.i):e.i:n.i=t.longs===String?u.Long.prototype.toString.call(e.i):t.longs===Number?new u.LongBits(e.i.low>>>0,e.i.high>>>0).toNumber():e.i),null!=e.s&&e.hasOwnProperty("s")&&(n.s=t.bytes===String?u.base64.encode(e.s,0,e.s.length):t.bytes===Array?Array.prototype.slice.call(e.s):e.s),null!=e.t&&e.hasOwnProperty("t")&&(n.t=c.onnx.TensorProto.toObject(e.t,t)),null!=e.g&&e.hasOwnProperty("g")&&(n.g=c.onnx.GraphProto.toObject(e.g,t)),e.floats&&e.floats.length){n.floats=[];for(var o=0;o<e.floats.length;++o)n.floats[o]=t.json&&!isFinite(e.floats[o])?String(e.floats[o]):e.floats[o]}if(e.ints&&e.ints.length)for(n.ints=[],o=0;o<e.ints.length;++o)"number"==typeof e.ints[o]?n.ints[o]=t.longs===String?String(e.ints[o]):e.ints[o]:n.ints[o]=t.longs===String?u.Long.prototype.toString.call(e.ints[o]):t.longs===Number?new u.LongBits(e.ints[o].low>>>0,e.ints[o].high>>>0).toNumber():e.ints[o];if(e.strings&&e.strings.length)for(n.strings=[],o=0;o<e.strings.length;++o)n.strings[o]=t.bytes===String?u.base64.encode(e.strings[o],0,e.strings[o].length):t.bytes===Array?Array.prototype.slice.call(e.strings[o]):e.strings[o];if(e.tensors&&e.tensors.length)for(n.tensors=[],o=0;o<e.tensors.length;++o)n.tensors[o]=c.onnx.TensorProto.toObject(e.tensors[o],t);if(e.graphs&&e.graphs.length)for(n.graphs=[],o=0;o<e.graphs.length;++o)n.graphs[o]=c.onnx.GraphProto.toObject(e.graphs[o],t);return null!=e.docString&&e.hasOwnProperty("docString")&&(n.docString=e.docString),null!=e.type&&e.hasOwnProperty("type")&&(n.type=t.enums===String?c.onnx.AttributeProto.AttributeType[e.type]:e.type),null!=e.refAttrName&&e.hasOwnProperty("refAttrName")&&(n.refAttrName=e.refAttrName),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e.AttributeType=(t={},(n=Object.create(t))[t[0]="UNDEFINED"]=0,n[t[1]="FLOAT"]=1,n[t[2]="INT"]=2,n[t[3]="STRING"]=3,n[t[4]="TENSOR"]=4,n[t[5]="GRAPH"]=5,n[t[6]="FLOATS"]=6,n[t[7]="INTS"]=7,n[t[8]="STRINGS"]=8,n[t[9]="TENSORS"]=9,n[t[10]="GRAPHS"]=10,n),e;var t,n}(),a.ValueInfoProto=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.name="",e.prototype.type=null,e.prototype.docString="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=l.create()),null!=e.name&&e.hasOwnProperty("name")&&t.uint32(10).string(e.name),null!=e.type&&e.hasOwnProperty("type")&&c.onnx.TypeProto.encode(e.type,t.uint32(18).fork()).ldelim(),null!=e.docString&&e.hasOwnProperty("docString")&&t.uint32(26).string(e.docString),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.ValueInfoProto;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.name=e.string();break;case 2:r.type=c.onnx.TypeProto.decode(e,e.uint32());break;case 3:r.docString=e.string();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!u.isString(e.name))return"name: string expected";if(null!=e.type&&e.hasOwnProperty("type")){var t=c.onnx.TypeProto.verify(e.type);if(t)return"type."+t}return null!=e.docString&&e.hasOwnProperty("docString")&&!u.isString(e.docString)?"docString: string expected":null},e.fromObject=function(e){if(e instanceof c.onnx.ValueInfoProto)return e;var t=new c.onnx.ValueInfoProto;if(null!=e.name&&(t.name=String(e.name)),null!=e.type){if("object"!=typeof e.type)throw TypeError(".onnx.ValueInfoProto.type: object expected");t.type=c.onnx.TypeProto.fromObject(e.type)}return null!=e.docString&&(t.docString=String(e.docString)),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.name="",n.type=null,n.docString=""),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.type&&e.hasOwnProperty("type")&&(n.type=c.onnx.TypeProto.toObject(e.type,t)),null!=e.docString&&e.hasOwnProperty("docString")&&(n.docString=e.docString),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),a.NodeProto=function(){function e(e){if(this.input=[],this.output=[],this.attribute=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.input=u.emptyArray,e.prototype.output=u.emptyArray,e.prototype.name="",e.prototype.opType="",e.prototype.domain="",e.prototype.attribute=u.emptyArray,e.prototype.docString="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=l.create()),null!=e.input&&e.input.length)for(var n=0;n<e.input.length;++n)t.uint32(10).string(e.input[n]);if(null!=e.output&&e.output.length)for(n=0;n<e.output.length;++n)t.uint32(18).string(e.output[n]);if(null!=e.name&&e.hasOwnProperty("name")&&t.uint32(26).string(e.name),null!=e.opType&&e.hasOwnProperty("opType")&&t.uint32(34).string(e.opType),null!=e.attribute&&e.attribute.length)for(n=0;n<e.attribute.length;++n)c.onnx.AttributeProto.encode(e.attribute[n],t.uint32(42).fork()).ldelim();return null!=e.docString&&e.hasOwnProperty("docString")&&t.uint32(50).string(e.docString),null!=e.domain&&e.hasOwnProperty("domain")&&t.uint32(58).string(e.domain),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.NodeProto;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.input&&r.input.length||(r.input=[]),r.input.push(e.string());break;case 2:r.output&&r.output.length||(r.output=[]),r.output.push(e.string());break;case 3:r.name=e.string();break;case 4:r.opType=e.string();break;case 7:r.domain=e.string();break;case 5:r.attribute&&r.attribute.length||(r.attribute=[]),r.attribute.push(c.onnx.AttributeProto.decode(e,e.uint32()));break;case 6:r.docString=e.string();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.input&&e.hasOwnProperty("input")){if(!Array.isArray(e.input))return"input: array expected";for(var t=0;t<e.input.length;++t)if(!u.isString(e.input[t]))return"input: string[] expected"}if(null!=e.output&&e.hasOwnProperty("output")){if(!Array.isArray(e.output))return"output: array expected";for(t=0;t<e.output.length;++t)if(!u.isString(e.output[t]))return"output: string[] expected"}if(null!=e.name&&e.hasOwnProperty("name")&&!u.isString(e.name))return"name: string expected";if(null!=e.opType&&e.hasOwnProperty("opType")&&!u.isString(e.opType))return"opType: string expected";if(null!=e.domain&&e.hasOwnProperty("domain")&&!u.isString(e.domain))return"domain: string expected";if(null!=e.attribute&&e.hasOwnProperty("attribute")){if(!Array.isArray(e.attribute))return"attribute: array expected";for(t=0;t<e.attribute.length;++t){var n=c.onnx.AttributeProto.verify(e.attribute[t]);if(n)return"attribute."+n}}return null!=e.docString&&e.hasOwnProperty("docString")&&!u.isString(e.docString)?"docString: string expected":null},e.fromObject=function(e){if(e instanceof c.onnx.NodeProto)return e;var t=new c.onnx.NodeProto;if(e.input){if(!Array.isArray(e.input))throw TypeError(".onnx.NodeProto.input: array expected");t.input=[];for(var n=0;n<e.input.length;++n)t.input[n]=String(e.input[n])}if(e.output){if(!Array.isArray(e.output))throw TypeError(".onnx.NodeProto.output: array expected");for(t.output=[],n=0;n<e.output.length;++n)t.output[n]=String(e.output[n])}if(null!=e.name&&(t.name=String(e.name)),null!=e.opType&&(t.opType=String(e.opType)),null!=e.domain&&(t.domain=String(e.domain)),e.attribute){if(!Array.isArray(e.attribute))throw TypeError(".onnx.NodeProto.attribute: array expected");for(t.attribute=[],n=0;n<e.attribute.length;++n){if("object"!=typeof e.attribute[n])throw TypeError(".onnx.NodeProto.attribute: object expected");t.attribute[n]=c.onnx.AttributeProto.fromObject(e.attribute[n])}}return null!=e.docString&&(t.docString=String(e.docString)),t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.input=[],n.output=[],n.attribute=[]),t.defaults&&(n.name="",n.opType="",n.docString="",n.domain=""),e.input&&e.input.length){n.input=[];for(var r=0;r<e.input.length;++r)n.input[r]=e.input[r]}if(e.output&&e.output.length)for(n.output=[],r=0;r<e.output.length;++r)n.output[r]=e.output[r];if(null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.opType&&e.hasOwnProperty("opType")&&(n.opType=e.opType),e.attribute&&e.attribute.length)for(n.attribute=[],r=0;r<e.attribute.length;++r)n.attribute[r]=c.onnx.AttributeProto.toObject(e.attribute[r],t);return null!=e.docString&&e.hasOwnProperty("docString")&&(n.docString=e.docString),null!=e.domain&&e.hasOwnProperty("domain")&&(n.domain=e.domain),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),a.ModelProto=function(){function e(e){if(this.opsetImport=[],this.metadataProps=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.irVersion=u.Long?u.Long.fromBits(0,0,!1):0,e.prototype.opsetImport=u.emptyArray,e.prototype.producerName="",e.prototype.producerVersion="",e.prototype.domain="",e.prototype.modelVersion=u.Long?u.Long.fromBits(0,0,!1):0,e.prototype.docString="",e.prototype.graph=null,e.prototype.metadataProps=u.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=l.create()),null!=e.irVersion&&e.hasOwnProperty("irVersion")&&t.uint32(8).int64(e.irVersion),null!=e.producerName&&e.hasOwnProperty("producerName")&&t.uint32(18).string(e.producerName),null!=e.producerVersion&&e.hasOwnProperty("producerVersion")&&t.uint32(26).string(e.producerVersion),null!=e.domain&&e.hasOwnProperty("domain")&&t.uint32(34).string(e.domain),null!=e.modelVersion&&e.hasOwnProperty("modelVersion")&&t.uint32(40).int64(e.modelVersion),null!=e.docString&&e.hasOwnProperty("docString")&&t.uint32(50).string(e.docString),null!=e.graph&&e.hasOwnProperty("graph")&&c.onnx.GraphProto.encode(e.graph,t.uint32(58).fork()).ldelim(),null!=e.opsetImport&&e.opsetImport.length)for(var n=0;n<e.opsetImport.length;++n)c.onnx.OperatorSetIdProto.encode(e.opsetImport[n],t.uint32(66).fork()).ldelim();if(null!=e.metadataProps&&e.metadataProps.length)for(n=0;n<e.metadataProps.length;++n)c.onnx.StringStringEntryProto.encode(e.metadataProps[n],t.uint32(114).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.ModelProto;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.irVersion=e.int64();break;case 8:r.opsetImport&&r.opsetImport.length||(r.opsetImport=[]),r.opsetImport.push(c.onnx.OperatorSetIdProto.decode(e,e.uint32()));break;case 2:r.producerName=e.string();break;case 3:r.producerVersion=e.string();break;case 4:r.domain=e.string();break;case 5:r.modelVersion=e.int64();break;case 6:r.docString=e.string();break;case 7:r.graph=c.onnx.GraphProto.decode(e,e.uint32());break;case 14:r.metadataProps&&r.metadataProps.length||(r.metadataProps=[]),r.metadataProps.push(c.onnx.StringStringEntryProto.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.irVersion&&e.hasOwnProperty("irVersion")&&!(u.isInteger(e.irVersion)||e.irVersion&&u.isInteger(e.irVersion.low)&&u.isInteger(e.irVersion.high)))return"irVersion: integer|Long expected";if(null!=e.opsetImport&&e.hasOwnProperty("opsetImport")){if(!Array.isArray(e.opsetImport))return"opsetImport: array expected";for(var t=0;t<e.opsetImport.length;++t)if(n=c.onnx.OperatorSetIdProto.verify(e.opsetImport[t]))return"opsetImport."+n}if(null!=e.producerName&&e.hasOwnProperty("producerName")&&!u.isString(e.producerName))return"producerName: string expected";if(null!=e.producerVersion&&e.hasOwnProperty("producerVersion")&&!u.isString(e.producerVersion))return"producerVersion: string expected";if(null!=e.domain&&e.hasOwnProperty("domain")&&!u.isString(e.domain))return"domain: string expected";if(null!=e.modelVersion&&e.hasOwnProperty("modelVersion")&&!(u.isInteger(e.modelVersion)||e.modelVersion&&u.isInteger(e.modelVersion.low)&&u.isInteger(e.modelVersion.high)))return"modelVersion: integer|Long expected";if(null!=e.docString&&e.hasOwnProperty("docString")&&!u.isString(e.docString))return"docString: string expected";if(null!=e.graph&&e.hasOwnProperty("graph")&&(n=c.onnx.GraphProto.verify(e.graph)))return"graph."+n;if(null!=e.metadataProps&&e.hasOwnProperty("metadataProps")){if(!Array.isArray(e.metadataProps))return"metadataProps: array expected";for(t=0;t<e.metadataProps.length;++t){var n;if(n=c.onnx.StringStringEntryProto.verify(e.metadataProps[t]))return"metadataProps."+n}}return null},e.fromObject=function(e){if(e instanceof c.onnx.ModelProto)return e;var t=new c.onnx.ModelProto;if(null!=e.irVersion&&(u.Long?(t.irVersion=u.Long.fromValue(e.irVersion)).unsigned=!1:"string"==typeof e.irVersion?t.irVersion=parseInt(e.irVersion,10):"number"==typeof e.irVersion?t.irVersion=e.irVersion:"object"==typeof e.irVersion&&(t.irVersion=new u.LongBits(e.irVersion.low>>>0,e.irVersion.high>>>0).toNumber())),e.opsetImport){if(!Array.isArray(e.opsetImport))throw TypeError(".onnx.ModelProto.opsetImport: array expected");t.opsetImport=[];for(var n=0;n<e.opsetImport.length;++n){if("object"!=typeof e.opsetImport[n])throw TypeError(".onnx.ModelProto.opsetImport: object expected");t.opsetImport[n]=c.onnx.OperatorSetIdProto.fromObject(e.opsetImport[n])}}if(null!=e.producerName&&(t.producerName=String(e.producerName)),null!=e.producerVersion&&(t.producerVersion=String(e.producerVersion)),null!=e.domain&&(t.domain=String(e.domain)),null!=e.modelVersion&&(u.Long?(t.modelVersion=u.Long.fromValue(e.modelVersion)).unsigned=!1:"string"==typeof e.modelVersion?t.modelVersion=parseInt(e.modelVersion,10):"number"==typeof e.modelVersion?t.modelVersion=e.modelVersion:"object"==typeof e.modelVersion&&(t.modelVersion=new u.LongBits(e.modelVersion.low>>>0,e.modelVersion.high>>>0).toNumber())),null!=e.docString&&(t.docString=String(e.docString)),null!=e.graph){if("object"!=typeof e.graph)throw TypeError(".onnx.ModelProto.graph: object expected");t.graph=c.onnx.GraphProto.fromObject(e.graph)}if(e.metadataProps){if(!Array.isArray(e.metadataProps))throw TypeError(".onnx.ModelProto.metadataProps: array expected");for(t.metadataProps=[],n=0;n<e.metadataProps.length;++n){if("object"!=typeof e.metadataProps[n])throw TypeError(".onnx.ModelProto.metadataProps: object expected");t.metadataProps[n]=c.onnx.StringStringEntryProto.fromObject(e.metadataProps[n])}}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.opsetImport=[],n.metadataProps=[]),t.defaults){if(u.Long){var r=new u.Long(0,0,!1);n.irVersion=t.longs===String?r.toString():t.longs===Number?r.toNumber():r}else n.irVersion=t.longs===String?"0":0;n.producerName="",n.producerVersion="",n.domain="",u.Long?(r=new u.Long(0,0,!1),n.modelVersion=t.longs===String?r.toString():t.longs===Number?r.toNumber():r):n.modelVersion=t.longs===String?"0":0,n.docString="",n.graph=null}if(null!=e.irVersion&&e.hasOwnProperty("irVersion")&&("number"==typeof e.irVersion?n.irVersion=t.longs===String?String(e.irVersion):e.irVersion:n.irVersion=t.longs===String?u.Long.prototype.toString.call(e.irVersion):t.longs===Number?new u.LongBits(e.irVersion.low>>>0,e.irVersion.high>>>0).toNumber():e.irVersion),null!=e.producerName&&e.hasOwnProperty("producerName")&&(n.producerName=e.producerName),null!=e.producerVersion&&e.hasOwnProperty("producerVersion")&&(n.producerVersion=e.producerVersion),null!=e.domain&&e.hasOwnProperty("domain")&&(n.domain=e.domain),null!=e.modelVersion&&e.hasOwnProperty("modelVersion")&&("number"==typeof e.modelVersion?n.modelVersion=t.longs===String?String(e.modelVersion):e.modelVersion:n.modelVersion=t.longs===String?u.Long.prototype.toString.call(e.modelVersion):t.longs===Number?new u.LongBits(e.modelVersion.low>>>0,e.modelVersion.high>>>0).toNumber():e.modelVersion),null!=e.docString&&e.hasOwnProperty("docString")&&(n.docString=e.docString),null!=e.graph&&e.hasOwnProperty("graph")&&(n.graph=c.onnx.GraphProto.toObject(e.graph,t)),e.opsetImport&&e.opsetImport.length){n.opsetImport=[];for(var o=0;o<e.opsetImport.length;++o)n.opsetImport[o]=c.onnx.OperatorSetIdProto.toObject(e.opsetImport[o],t)}if(e.metadataProps&&e.metadataProps.length)for(n.metadataProps=[],o=0;o<e.metadataProps.length;++o)n.metadataProps[o]=c.onnx.StringStringEntryProto.toObject(e.metadataProps[o],t);return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),a.StringStringEntryProto=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.key="",e.prototype.value="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=l.create()),null!=e.key&&e.hasOwnProperty("key")&&t.uint32(10).string(e.key),null!=e.value&&e.hasOwnProperty("value")&&t.uint32(18).string(e.value),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.StringStringEntryProto;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.key=e.string();break;case 2:r.value=e.string();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.key&&e.hasOwnProperty("key")&&!u.isString(e.key)?"key: string expected":null!=e.value&&e.hasOwnProperty("value")&&!u.isString(e.value)?"value: string expected":null},e.fromObject=function(e){if(e instanceof c.onnx.StringStringEntryProto)return e;var t=new c.onnx.StringStringEntryProto;return null!=e.key&&(t.key=String(e.key)),null!=e.value&&(t.value=String(e.value)),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.key="",n.value=""),null!=e.key&&e.hasOwnProperty("key")&&(n.key=e.key),null!=e.value&&e.hasOwnProperty("value")&&(n.value=e.value),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),a.TensorAnnotation=function(){function e(e){if(this.quantParameterTensorNames=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.tensorName="",e.prototype.quantParameterTensorNames=u.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=l.create()),null!=e.tensorName&&e.hasOwnProperty("tensorName")&&t.uint32(10).string(e.tensorName),null!=e.quantParameterTensorNames&&e.quantParameterTensorNames.length)for(var n=0;n<e.quantParameterTensorNames.length;++n)c.onnx.StringStringEntryProto.encode(e.quantParameterTensorNames[n],t.uint32(18).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.TensorAnnotation;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.tensorName=e.string();break;case 2:r.quantParameterTensorNames&&r.quantParameterTensorNames.length||(r.quantParameterTensorNames=[]),r.quantParameterTensorNames.push(c.onnx.StringStringEntryProto.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.tensorName&&e.hasOwnProperty("tensorName")&&!u.isString(e.tensorName))return"tensorName: string expected";if(null!=e.quantParameterTensorNames&&e.hasOwnProperty("quantParameterTensorNames")){if(!Array.isArray(e.quantParameterTensorNames))return"quantParameterTensorNames: array expected";for(var t=0;t<e.quantParameterTensorNames.length;++t){var n=c.onnx.StringStringEntryProto.verify(e.quantParameterTensorNames[t]);if(n)return"quantParameterTensorNames."+n}}return null},e.fromObject=function(e){if(e instanceof c.onnx.TensorAnnotation)return e;var t=new c.onnx.TensorAnnotation;if(null!=e.tensorName&&(t.tensorName=String(e.tensorName)),e.quantParameterTensorNames){if(!Array.isArray(e.quantParameterTensorNames))throw TypeError(".onnx.TensorAnnotation.quantParameterTensorNames: array expected");t.quantParameterTensorNames=[];for(var n=0;n<e.quantParameterTensorNames.length;++n){if("object"!=typeof e.quantParameterTensorNames[n])throw TypeError(".onnx.TensorAnnotation.quantParameterTensorNames: object expected");t.quantParameterTensorNames[n]=c.onnx.StringStringEntryProto.fromObject(e.quantParameterTensorNames[n])}}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.quantParameterTensorNames=[]),t.defaults&&(n.tensorName=""),null!=e.tensorName&&e.hasOwnProperty("tensorName")&&(n.tensorName=e.tensorName),e.quantParameterTensorNames&&e.quantParameterTensorNames.length){n.quantParameterTensorNames=[];for(var r=0;r<e.quantParameterTensorNames.length;++r)n.quantParameterTensorNames[r]=c.onnx.StringStringEntryProto.toObject(e.quantParameterTensorNames[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),a.GraphProto=function(){function e(e){if(this.node=[],this.initializer=[],this.input=[],this.output=[],this.valueInfo=[],this.quantizationAnnotation=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.node=u.emptyArray,e.prototype.name="",e.prototype.initializer=u.emptyArray,e.prototype.docString="",e.prototype.input=u.emptyArray,e.prototype.output=u.emptyArray,e.prototype.valueInfo=u.emptyArray,e.prototype.quantizationAnnotation=u.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=l.create()),null!=e.node&&e.node.length)for(var n=0;n<e.node.length;++n)c.onnx.NodeProto.encode(e.node[n],t.uint32(10).fork()).ldelim();if(null!=e.name&&e.hasOwnProperty("name")&&t.uint32(18).string(e.name),null!=e.initializer&&e.initializer.length)for(n=0;n<e.initializer.length;++n)c.onnx.TensorProto.encode(e.initializer[n],t.uint32(42).fork()).ldelim();if(null!=e.docString&&e.hasOwnProperty("docString")&&t.uint32(82).string(e.docString),null!=e.input&&e.input.length)for(n=0;n<e.input.length;++n)c.onnx.ValueInfoProto.encode(e.input[n],t.uint32(90).fork()).ldelim();if(null!=e.output&&e.output.length)for(n=0;n<e.output.length;++n)c.onnx.ValueInfoProto.encode(e.output[n],t.uint32(98).fork()).ldelim();if(null!=e.valueInfo&&e.valueInfo.length)for(n=0;n<e.valueInfo.length;++n)c.onnx.ValueInfoProto.encode(e.valueInfo[n],t.uint32(106).fork()).ldelim();if(null!=e.quantizationAnnotation&&e.quantizationAnnotation.length)for(n=0;n<e.quantizationAnnotation.length;++n)c.onnx.TensorAnnotation.encode(e.quantizationAnnotation[n],t.uint32(114).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.GraphProto;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.node&&r.node.length||(r.node=[]),r.node.push(c.onnx.NodeProto.decode(e,e.uint32()));break;case 2:r.name=e.string();break;case 5:r.initializer&&r.initializer.length||(r.initializer=[]),r.initializer.push(c.onnx.TensorProto.decode(e,e.uint32()));break;case 10:r.docString=e.string();break;case 11:r.input&&r.input.length||(r.input=[]),r.input.push(c.onnx.ValueInfoProto.decode(e,e.uint32()));break;case 12:r.output&&r.output.length||(r.output=[]),r.output.push(c.onnx.ValueInfoProto.decode(e,e.uint32()));break;case 13:r.valueInfo&&r.valueInfo.length||(r.valueInfo=[]),r.valueInfo.push(c.onnx.ValueInfoProto.decode(e,e.uint32()));break;case 14:r.quantizationAnnotation&&r.quantizationAnnotation.length||(r.quantizationAnnotation=[]),r.quantizationAnnotation.push(c.onnx.TensorAnnotation.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.node&&e.hasOwnProperty("node")){if(!Array.isArray(e.node))return"node: array expected";for(var t=0;t<e.node.length;++t)if(n=c.onnx.NodeProto.verify(e.node[t]))return"node."+n}if(null!=e.name&&e.hasOwnProperty("name")&&!u.isString(e.name))return"name: string expected";if(null!=e.initializer&&e.hasOwnProperty("initializer")){if(!Array.isArray(e.initializer))return"initializer: array expected";for(t=0;t<e.initializer.length;++t)if(n=c.onnx.TensorProto.verify(e.initializer[t]))return"initializer."+n}if(null!=e.docString&&e.hasOwnProperty("docString")&&!u.isString(e.docString))return"docString: string expected";if(null!=e.input&&e.hasOwnProperty("input")){if(!Array.isArray(e.input))return"input: array expected";for(t=0;t<e.input.length;++t)if(n=c.onnx.ValueInfoProto.verify(e.input[t]))return"input."+n}if(null!=e.output&&e.hasOwnProperty("output")){if(!Array.isArray(e.output))return"output: array expected";for(t=0;t<e.output.length;++t)if(n=c.onnx.ValueInfoProto.verify(e.output[t]))return"output."+n}if(null!=e.valueInfo&&e.hasOwnProperty("valueInfo")){if(!Array.isArray(e.valueInfo))return"valueInfo: array expected";for(t=0;t<e.valueInfo.length;++t)if(n=c.onnx.ValueInfoProto.verify(e.valueInfo[t]))return"valueInfo."+n}if(null!=e.quantizationAnnotation&&e.hasOwnProperty("quantizationAnnotation")){if(!Array.isArray(e.quantizationAnnotation))return"quantizationAnnotation: array expected";for(t=0;t<e.quantizationAnnotation.length;++t){var n;if(n=c.onnx.TensorAnnotation.verify(e.quantizationAnnotation[t]))return"quantizationAnnotation."+n}}return null},e.fromObject=function(e){if(e instanceof c.onnx.GraphProto)return e;var t=new c.onnx.GraphProto;if(e.node){if(!Array.isArray(e.node))throw TypeError(".onnx.GraphProto.node: array expected");t.node=[];for(var n=0;n<e.node.length;++n){if("object"!=typeof e.node[n])throw TypeError(".onnx.GraphProto.node: object expected");t.node[n]=c.onnx.NodeProto.fromObject(e.node[n])}}if(null!=e.name&&(t.name=String(e.name)),e.initializer){if(!Array.isArray(e.initializer))throw TypeError(".onnx.GraphProto.initializer: array expected");for(t.initializer=[],n=0;n<e.initializer.length;++n){if("object"!=typeof e.initializer[n])throw TypeError(".onnx.GraphProto.initializer: object expected");t.initializer[n]=c.onnx.TensorProto.fromObject(e.initializer[n])}}if(null!=e.docString&&(t.docString=String(e.docString)),e.input){if(!Array.isArray(e.input))throw TypeError(".onnx.GraphProto.input: array expected");for(t.input=[],n=0;n<e.input.length;++n){if("object"!=typeof e.input[n])throw TypeError(".onnx.GraphProto.input: object expected");t.input[n]=c.onnx.ValueInfoProto.fromObject(e.input[n])}}if(e.output){if(!Array.isArray(e.output))throw TypeError(".onnx.GraphProto.output: array expected");for(t.output=[],n=0;n<e.output.length;++n){if("object"!=typeof e.output[n])throw TypeError(".onnx.GraphProto.output: object expected");t.output[n]=c.onnx.ValueInfoProto.fromObject(e.output[n])}}if(e.valueInfo){if(!Array.isArray(e.valueInfo))throw TypeError(".onnx.GraphProto.valueInfo: array expected");for(t.valueInfo=[],n=0;n<e.valueInfo.length;++n){if("object"!=typeof e.valueInfo[n])throw TypeError(".onnx.GraphProto.valueInfo: object expected");t.valueInfo[n]=c.onnx.ValueInfoProto.fromObject(e.valueInfo[n])}}if(e.quantizationAnnotation){if(!Array.isArray(e.quantizationAnnotation))throw TypeError(".onnx.GraphProto.quantizationAnnotation: array expected");for(t.quantizationAnnotation=[],n=0;n<e.quantizationAnnotation.length;++n){if("object"!=typeof e.quantizationAnnotation[n])throw TypeError(".onnx.GraphProto.quantizationAnnotation: object expected");t.quantizationAnnotation[n]=c.onnx.TensorAnnotation.fromObject(e.quantizationAnnotation[n])}}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.node=[],n.initializer=[],n.input=[],n.output=[],n.valueInfo=[],n.quantizationAnnotation=[]),t.defaults&&(n.name="",n.docString=""),e.node&&e.node.length){n.node=[];for(var r=0;r<e.node.length;++r)n.node[r]=c.onnx.NodeProto.toObject(e.node[r],t)}if(null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),e.initializer&&e.initializer.length)for(n.initializer=[],r=0;r<e.initializer.length;++r)n.initializer[r]=c.onnx.TensorProto.toObject(e.initializer[r],t);if(null!=e.docString&&e.hasOwnProperty("docString")&&(n.docString=e.docString),e.input&&e.input.length)for(n.input=[],r=0;r<e.input.length;++r)n.input[r]=c.onnx.ValueInfoProto.toObject(e.input[r],t);if(e.output&&e.output.length)for(n.output=[],r=0;r<e.output.length;++r)n.output[r]=c.onnx.ValueInfoProto.toObject(e.output[r],t);if(e.valueInfo&&e.valueInfo.length)for(n.valueInfo=[],r=0;r<e.valueInfo.length;++r)n.valueInfo[r]=c.onnx.ValueInfoProto.toObject(e.valueInfo[r],t);if(e.quantizationAnnotation&&e.quantizationAnnotation.length)for(n.quantizationAnnotation=[],r=0;r<e.quantizationAnnotation.length;++r)n.quantizationAnnotation[r]=c.onnx.TensorAnnotation.toObject(e.quantizationAnnotation[r],t);return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),a.TensorProto=function(){function e(e){if(this.dims=[],this.floatData=[],this.int32Data=[],this.stringData=[],this.int64Data=[],this.externalData=[],this.doubleData=[],this.uint64Data=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.dims=u.emptyArray,e.prototype.dataType=0,e.prototype.segment=null,e.prototype.floatData=u.emptyArray,e.prototype.int32Data=u.emptyArray,e.prototype.stringData=u.emptyArray,e.prototype.int64Data=u.emptyArray,e.prototype.name="",e.prototype.docString="",e.prototype.rawData=u.newBuffer([]),e.prototype.externalData=u.emptyArray,e.prototype.dataLocation=0,e.prototype.doubleData=u.emptyArray,e.prototype.uint64Data=u.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=l.create()),null!=e.dims&&e.dims.length){t.uint32(10).fork();for(var n=0;n<e.dims.length;++n)t.int64(e.dims[n]);t.ldelim()}if(null!=e.dataType&&e.hasOwnProperty("dataType")&&t.uint32(16).int32(e.dataType),null!=e.segment&&e.hasOwnProperty("segment")&&c.onnx.TensorProto.Segment.encode(e.segment,t.uint32(26).fork()).ldelim(),null!=e.floatData&&e.floatData.length){for(t.uint32(34).fork(),n=0;n<e.floatData.length;++n)t.float(e.floatData[n]);t.ldelim()}if(null!=e.int32Data&&e.int32Data.length){for(t.uint32(42).fork(),n=0;n<e.int32Data.length;++n)t.int32(e.int32Data[n]);t.ldelim()}if(null!=e.stringData&&e.stringData.length)for(n=0;n<e.stringData.length;++n)t.uint32(50).bytes(e.stringData[n]);if(null!=e.int64Data&&e.int64Data.length){for(t.uint32(58).fork(),n=0;n<e.int64Data.length;++n)t.int64(e.int64Data[n]);t.ldelim()}if(null!=e.name&&e.hasOwnProperty("name")&&t.uint32(66).string(e.name),null!=e.rawData&&e.hasOwnProperty("rawData")&&t.uint32(74).bytes(e.rawData),null!=e.doubleData&&e.doubleData.length){for(t.uint32(82).fork(),n=0;n<e.doubleData.length;++n)t.double(e.doubleData[n]);t.ldelim()}if(null!=e.uint64Data&&e.uint64Data.length){for(t.uint32(90).fork(),n=0;n<e.uint64Data.length;++n)t.uint64(e.uint64Data[n]);t.ldelim()}if(null!=e.docString&&e.hasOwnProperty("docString")&&t.uint32(98).string(e.docString),null!=e.externalData&&e.externalData.length)for(n=0;n<e.externalData.length;++n)c.onnx.StringStringEntryProto.encode(e.externalData[n],t.uint32(106).fork()).ldelim();return null!=e.dataLocation&&e.hasOwnProperty("dataLocation")&&t.uint32(112).int32(e.dataLocation),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.TensorProto;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:if(r.dims&&r.dims.length||(r.dims=[]),2==(7&o))for(var a=e.uint32()+e.pos;e.pos<a;)r.dims.push(e.int64());else r.dims.push(e.int64());break;case 2:r.dataType=e.int32();break;case 3:r.segment=c.onnx.TensorProto.Segment.decode(e,e.uint32());break;case 4:if(r.floatData&&r.floatData.length||(r.floatData=[]),2==(7&o))for(a=e.uint32()+e.pos;e.pos<a;)r.floatData.push(e.float());else r.floatData.push(e.float());break;case 5:if(r.int32Data&&r.int32Data.length||(r.int32Data=[]),2==(7&o))for(a=e.uint32()+e.pos;e.pos<a;)r.int32Data.push(e.int32());else r.int32Data.push(e.int32());break;case 6:r.stringData&&r.stringData.length||(r.stringData=[]),r.stringData.push(e.bytes());break;case 7:if(r.int64Data&&r.int64Data.length||(r.int64Data=[]),2==(7&o))for(a=e.uint32()+e.pos;e.pos<a;)r.int64Data.push(e.int64());else r.int64Data.push(e.int64());break;case 8:r.name=e.string();break;case 12:r.docString=e.string();break;case 9:r.rawData=e.bytes();break;case 13:r.externalData&&r.externalData.length||(r.externalData=[]),r.externalData.push(c.onnx.StringStringEntryProto.decode(e,e.uint32()));break;case 14:r.dataLocation=e.int32();break;case 10:if(r.doubleData&&r.doubleData.length||(r.doubleData=[]),2==(7&o))for(a=e.uint32()+e.pos;e.pos<a;)r.doubleData.push(e.double());else r.doubleData.push(e.double());break;case 11:if(r.uint64Data&&r.uint64Data.length||(r.uint64Data=[]),2==(7&o))for(a=e.uint32()+e.pos;e.pos<a;)r.uint64Data.push(e.uint64());else r.uint64Data.push(e.uint64());break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.dims&&e.hasOwnProperty("dims")){if(!Array.isArray(e.dims))return"dims: array expected";for(var t=0;t<e.dims.length;++t)if(!(u.isInteger(e.dims[t])||e.dims[t]&&u.isInteger(e.dims[t].low)&&u.isInteger(e.dims[t].high)))return"dims: integer|Long[] expected"}if(null!=e.dataType&&e.hasOwnProperty("dataType")&&!u.isInteger(e.dataType))return"dataType: integer expected";if(null!=e.segment&&e.hasOwnProperty("segment")&&(n=c.onnx.TensorProto.Segment.verify(e.segment)))return"segment."+n;if(null!=e.floatData&&e.hasOwnProperty("floatData")){if(!Array.isArray(e.floatData))return"floatData: array expected";for(t=0;t<e.floatData.length;++t)if("number"!=typeof e.floatData[t])return"floatData: number[] expected"}if(null!=e.int32Data&&e.hasOwnProperty("int32Data")){if(!Array.isArray(e.int32Data))return"int32Data: array expected";for(t=0;t<e.int32Data.length;++t)if(!u.isInteger(e.int32Data[t]))return"int32Data: integer[] expected"}if(null!=e.stringData&&e.hasOwnProperty("stringData")){if(!Array.isArray(e.stringData))return"stringData: array expected";for(t=0;t<e.stringData.length;++t)if(!(e.stringData[t]&&"number"==typeof e.stringData[t].length||u.isString(e.stringData[t])))return"stringData: buffer[] expected"}if(null!=e.int64Data&&e.hasOwnProperty("int64Data")){if(!Array.isArray(e.int64Data))return"int64Data: array expected";for(t=0;t<e.int64Data.length;++t)if(!(u.isInteger(e.int64Data[t])||e.int64Data[t]&&u.isInteger(e.int64Data[t].low)&&u.isInteger(e.int64Data[t].high)))return"int64Data: integer|Long[] expected"}if(null!=e.name&&e.hasOwnProperty("name")&&!u.isString(e.name))return"name: string expected";if(null!=e.docString&&e.hasOwnProperty("docString")&&!u.isString(e.docString))return"docString: string expected";if(null!=e.rawData&&e.hasOwnProperty("rawData")&&!(e.rawData&&"number"==typeof e.rawData.length||u.isString(e.rawData)))return"rawData: buffer expected";if(null!=e.externalData&&e.hasOwnProperty("externalData")){if(!Array.isArray(e.externalData))return"externalData: array expected";for(t=0;t<e.externalData.length;++t){var n;if(n=c.onnx.StringStringEntryProto.verify(e.externalData[t]))return"externalData."+n}}if(null!=e.dataLocation&&e.hasOwnProperty("dataLocation"))switch(e.dataLocation){default:return"dataLocation: enum value expected";case 0:case 1:}if(null!=e.doubleData&&e.hasOwnProperty("doubleData")){if(!Array.isArray(e.doubleData))return"doubleData: array expected";for(t=0;t<e.doubleData.length;++t)if("number"!=typeof e.doubleData[t])return"doubleData: number[] expected"}if(null!=e.uint64Data&&e.hasOwnProperty("uint64Data")){if(!Array.isArray(e.uint64Data))return"uint64Data: array expected";for(t=0;t<e.uint64Data.length;++t)if(!(u.isInteger(e.uint64Data[t])||e.uint64Data[t]&&u.isInteger(e.uint64Data[t].low)&&u.isInteger(e.uint64Data[t].high)))return"uint64Data: integer|Long[] expected"}return null},e.fromObject=function(e){if(e instanceof c.onnx.TensorProto)return e;var t=new c.onnx.TensorProto;if(e.dims){if(!Array.isArray(e.dims))throw TypeError(".onnx.TensorProto.dims: array expected");t.dims=[];for(var n=0;n<e.dims.length;++n)u.Long?(t.dims[n]=u.Long.fromValue(e.dims[n])).unsigned=!1:"string"==typeof e.dims[n]?t.dims[n]=parseInt(e.dims[n],10):"number"==typeof e.dims[n]?t.dims[n]=e.dims[n]:"object"==typeof e.dims[n]&&(t.dims[n]=new u.LongBits(e.dims[n].low>>>0,e.dims[n].high>>>0).toNumber())}if(null!=e.dataType&&(t.dataType=0|e.dataType),null!=e.segment){if("object"!=typeof e.segment)throw TypeError(".onnx.TensorProto.segment: object expected");t.segment=c.onnx.TensorProto.Segment.fromObject(e.segment)}if(e.floatData){if(!Array.isArray(e.floatData))throw TypeError(".onnx.TensorProto.floatData: array expected");for(t.floatData=[],n=0;n<e.floatData.length;++n)t.floatData[n]=Number(e.floatData[n])}if(e.int32Data){if(!Array.isArray(e.int32Data))throw TypeError(".onnx.TensorProto.int32Data: array expected");for(t.int32Data=[],n=0;n<e.int32Data.length;++n)t.int32Data[n]=0|e.int32Data[n]}if(e.stringData){if(!Array.isArray(e.stringData))throw TypeError(".onnx.TensorProto.stringData: array expected");for(t.stringData=[],n=0;n<e.stringData.length;++n)"string"==typeof e.stringData[n]?u.base64.decode(e.stringData[n],t.stringData[n]=u.newBuffer(u.base64.length(e.stringData[n])),0):e.stringData[n].length&&(t.stringData[n]=e.stringData[n])}if(e.int64Data){if(!Array.isArray(e.int64Data))throw TypeError(".onnx.TensorProto.int64Data: array expected");for(t.int64Data=[],n=0;n<e.int64Data.length;++n)u.Long?(t.int64Data[n]=u.Long.fromValue(e.int64Data[n])).unsigned=!1:"string"==typeof e.int64Data[n]?t.int64Data[n]=parseInt(e.int64Data[n],10):"number"==typeof e.int64Data[n]?t.int64Data[n]=e.int64Data[n]:"object"==typeof e.int64Data[n]&&(t.int64Data[n]=new u.LongBits(e.int64Data[n].low>>>0,e.int64Data[n].high>>>0).toNumber())}if(null!=e.name&&(t.name=String(e.name)),null!=e.docString&&(t.docString=String(e.docString)),null!=e.rawData&&("string"==typeof e.rawData?u.base64.decode(e.rawData,t.rawData=u.newBuffer(u.base64.length(e.rawData)),0):e.rawData.length&&(t.rawData=e.rawData)),e.externalData){if(!Array.isArray(e.externalData))throw TypeError(".onnx.TensorProto.externalData: array expected");for(t.externalData=[],n=0;n<e.externalData.length;++n){if("object"!=typeof e.externalData[n])throw TypeError(".onnx.TensorProto.externalData: object expected");t.externalData[n]=c.onnx.StringStringEntryProto.fromObject(e.externalData[n])}}switch(e.dataLocation){case"DEFAULT":case 0:t.dataLocation=0;break;case"EXTERNAL":case 1:t.dataLocation=1}if(e.doubleData){if(!Array.isArray(e.doubleData))throw TypeError(".onnx.TensorProto.doubleData: array expected");for(t.doubleData=[],n=0;n<e.doubleData.length;++n)t.doubleData[n]=Number(e.doubleData[n])}if(e.uint64Data){if(!Array.isArray(e.uint64Data))throw TypeError(".onnx.TensorProto.uint64Data: array expected");for(t.uint64Data=[],n=0;n<e.uint64Data.length;++n)u.Long?(t.uint64Data[n]=u.Long.fromValue(e.uint64Data[n])).unsigned=!0:"string"==typeof e.uint64Data[n]?t.uint64Data[n]=parseInt(e.uint64Data[n],10):"number"==typeof e.uint64Data[n]?t.uint64Data[n]=e.uint64Data[n]:"object"==typeof e.uint64Data[n]&&(t.uint64Data[n]=new u.LongBits(e.uint64Data[n].low>>>0,e.uint64Data[n].high>>>0).toNumber(!0))}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.dims=[],n.floatData=[],n.int32Data=[],n.stringData=[],n.int64Data=[],n.doubleData=[],n.uint64Data=[],n.externalData=[]),t.defaults&&(n.dataType=0,n.segment=null,n.name="",t.bytes===String?n.rawData="":(n.rawData=[],t.bytes!==Array&&(n.rawData=u.newBuffer(n.rawData))),n.docString="",n.dataLocation=t.enums===String?"DEFAULT":0),e.dims&&e.dims.length){n.dims=[];for(var r=0;r<e.dims.length;++r)"number"==typeof e.dims[r]?n.dims[r]=t.longs===String?String(e.dims[r]):e.dims[r]:n.dims[r]=t.longs===String?u.Long.prototype.toString.call(e.dims[r]):t.longs===Number?new u.LongBits(e.dims[r].low>>>0,e.dims[r].high>>>0).toNumber():e.dims[r]}if(null!=e.dataType&&e.hasOwnProperty("dataType")&&(n.dataType=e.dataType),null!=e.segment&&e.hasOwnProperty("segment")&&(n.segment=c.onnx.TensorProto.Segment.toObject(e.segment,t)),e.floatData&&e.floatData.length)for(n.floatData=[],r=0;r<e.floatData.length;++r)n.floatData[r]=t.json&&!isFinite(e.floatData[r])?String(e.floatData[r]):e.floatData[r];if(e.int32Data&&e.int32Data.length)for(n.int32Data=[],r=0;r<e.int32Data.length;++r)n.int32Data[r]=e.int32Data[r];if(e.stringData&&e.stringData.length)for(n.stringData=[],r=0;r<e.stringData.length;++r)n.stringData[r]=t.bytes===String?u.base64.encode(e.stringData[r],0,e.stringData[r].length):t.bytes===Array?Array.prototype.slice.call(e.stringData[r]):e.stringData[r];if(e.int64Data&&e.int64Data.length)for(n.int64Data=[],r=0;r<e.int64Data.length;++r)"number"==typeof e.int64Data[r]?n.int64Data[r]=t.longs===String?String(e.int64Data[r]):e.int64Data[r]:n.int64Data[r]=t.longs===String?u.Long.prototype.toString.call(e.int64Data[r]):t.longs===Number?new u.LongBits(e.int64Data[r].low>>>0,e.int64Data[r].high>>>0).toNumber():e.int64Data[r];if(null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.rawData&&e.hasOwnProperty("rawData")&&(n.rawData=t.bytes===String?u.base64.encode(e.rawData,0,e.rawData.length):t.bytes===Array?Array.prototype.slice.call(e.rawData):e.rawData),e.doubleData&&e.doubleData.length)for(n.doubleData=[],r=0;r<e.doubleData.length;++r)n.doubleData[r]=t.json&&!isFinite(e.doubleData[r])?String(e.doubleData[r]):e.doubleData[r];if(e.uint64Data&&e.uint64Data.length)for(n.uint64Data=[],r=0;r<e.uint64Data.length;++r)"number"==typeof e.uint64Data[r]?n.uint64Data[r]=t.longs===String?String(e.uint64Data[r]):e.uint64Data[r]:n.uint64Data[r]=t.longs===String?u.Long.prototype.toString.call(e.uint64Data[r]):t.longs===Number?new u.LongBits(e.uint64Data[r].low>>>0,e.uint64Data[r].high>>>0).toNumber(!0):e.uint64Data[r];if(null!=e.docString&&e.hasOwnProperty("docString")&&(n.docString=e.docString),e.externalData&&e.externalData.length)for(n.externalData=[],r=0;r<e.externalData.length;++r)n.externalData[r]=c.onnx.StringStringEntryProto.toObject(e.externalData[r],t);return null!=e.dataLocation&&e.hasOwnProperty("dataLocation")&&(n.dataLocation=t.enums===String?c.onnx.TensorProto.DataLocation[e.dataLocation]:e.dataLocation),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e.DataType=(t={},(n=Object.create(t))[t[0]="UNDEFINED"]=0,n[t[1]="FLOAT"]=1,n[t[2]="UINT8"]=2,n[t[3]="INT8"]=3,n[t[4]="UINT16"]=4,n[t[5]="INT16"]=5,n[t[6]="INT32"]=6,n[t[7]="INT64"]=7,n[t[8]="STRING"]=8,n[t[9]="BOOL"]=9,n[t[10]="FLOAT16"]=10,n[t[11]="DOUBLE"]=11,n[t[12]="UINT32"]=12,n[t[13]="UINT64"]=13,n[t[14]="COMPLEX64"]=14,n[t[15]="COMPLEX128"]=15,n[t[16]="BFLOAT16"]=16,n),e.Segment=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.begin=u.Long?u.Long.fromBits(0,0,!1):0,e.prototype.end=u.Long?u.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=l.create()),null!=e.begin&&e.hasOwnProperty("begin")&&t.uint32(8).int64(e.begin),null!=e.end&&e.hasOwnProperty("end")&&t.uint32(16).int64(e.end),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.TensorProto.Segment;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.begin=e.int64();break;case 2:r.end=e.int64();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.begin&&e.hasOwnProperty("begin")&&!(u.isInteger(e.begin)||e.begin&&u.isInteger(e.begin.low)&&u.isInteger(e.begin.high))?"begin: integer|Long expected":null!=e.end&&e.hasOwnProperty("end")&&!(u.isInteger(e.end)||e.end&&u.isInteger(e.end.low)&&u.isInteger(e.end.high))?"end: integer|Long expected":null},e.fromObject=function(e){if(e instanceof c.onnx.TensorProto.Segment)return e;var t=new c.onnx.TensorProto.Segment;return null!=e.begin&&(u.Long?(t.begin=u.Long.fromValue(e.begin)).unsigned=!1:"string"==typeof e.begin?t.begin=parseInt(e.begin,10):"number"==typeof e.begin?t.begin=e.begin:"object"==typeof e.begin&&(t.begin=new u.LongBits(e.begin.low>>>0,e.begin.high>>>0).toNumber())),null!=e.end&&(u.Long?(t.end=u.Long.fromValue(e.end)).unsigned=!1:"string"==typeof e.end?t.end=parseInt(e.end,10):"number"==typeof e.end?t.end=e.end:"object"==typeof e.end&&(t.end=new u.LongBits(e.end.low>>>0,e.end.high>>>0).toNumber())),t},e.toObject=function(e,t){t||(t={});var n={};if(t.defaults){if(u.Long){var r=new u.Long(0,0,!1);n.begin=t.longs===String?r.toString():t.longs===Number?r.toNumber():r}else n.begin=t.longs===String?"0":0;u.Long?(r=new u.Long(0,0,!1),n.end=t.longs===String?r.toString():t.longs===Number?r.toNumber():r):n.end=t.longs===String?"0":0}return null!=e.begin&&e.hasOwnProperty("begin")&&("number"==typeof e.begin?n.begin=t.longs===String?String(e.begin):e.begin:n.begin=t.longs===String?u.Long.prototype.toString.call(e.begin):t.longs===Number?new u.LongBits(e.begin.low>>>0,e.begin.high>>>0).toNumber():e.begin),null!=e.end&&e.hasOwnProperty("end")&&("number"==typeof e.end?n.end=t.longs===String?String(e.end):e.end:n.end=t.longs===String?u.Long.prototype.toString.call(e.end):t.longs===Number?new u.LongBits(e.end.low>>>0,e.end.high>>>0).toNumber():e.end),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),e.DataLocation=function(){var e={},t=Object.create(e);return t[e[0]="DEFAULT"]=0,t[e[1]="EXTERNAL"]=1,t}(),e;var t,n}(),a.TensorShapeProto=function(){function e(e){if(this.dim=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.dim=u.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=l.create()),null!=e.dim&&e.dim.length)for(var n=0;n<e.dim.length;++n)c.onnx.TensorShapeProto.Dimension.encode(e.dim[n],t.uint32(10).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.TensorShapeProto;e.pos<n;){var o=e.uint32();o>>>3==1?(r.dim&&r.dim.length||(r.dim=[]),r.dim.push(c.onnx.TensorShapeProto.Dimension.decode(e,e.uint32()))):e.skipType(7&o)}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.dim&&e.hasOwnProperty("dim")){if(!Array.isArray(e.dim))return"dim: array expected";for(var t=0;t<e.dim.length;++t){var n=c.onnx.TensorShapeProto.Dimension.verify(e.dim[t]);if(n)return"dim."+n}}return null},e.fromObject=function(e){if(e instanceof c.onnx.TensorShapeProto)return e;var t=new c.onnx.TensorShapeProto;if(e.dim){if(!Array.isArray(e.dim))throw TypeError(".onnx.TensorShapeProto.dim: array expected");t.dim=[];for(var n=0;n<e.dim.length;++n){if("object"!=typeof e.dim[n])throw TypeError(".onnx.TensorShapeProto.dim: object expected");t.dim[n]=c.onnx.TensorShapeProto.Dimension.fromObject(e.dim[n])}}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.dim=[]),e.dim&&e.dim.length){n.dim=[];for(var r=0;r<e.dim.length;++r)n.dim[r]=c.onnx.TensorShapeProto.Dimension.toObject(e.dim[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e.Dimension=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var t;return e.prototype.dimValue=u.Long?u.Long.fromBits(0,0,!1):0,e.prototype.dimParam="",e.prototype.denotation="",Object.defineProperty(e.prototype,"value",{get:u.oneOfGetter(t=["dimValue","dimParam"]),set:u.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=l.create()),null!=e.dimValue&&e.hasOwnProperty("dimValue")&&t.uint32(8).int64(e.dimValue),null!=e.dimParam&&e.hasOwnProperty("dimParam")&&t.uint32(18).string(e.dimParam),null!=e.denotation&&e.hasOwnProperty("denotation")&&t.uint32(26).string(e.denotation),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.TensorShapeProto.Dimension;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.dimValue=e.int64();break;case 2:r.dimParam=e.string();break;case 3:r.denotation=e.string();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.dimValue&&e.hasOwnProperty("dimValue")&&(t.value=1,!(u.isInteger(e.dimValue)||e.dimValue&&u.isInteger(e.dimValue.low)&&u.isInteger(e.dimValue.high))))return"dimValue: integer|Long expected";if(null!=e.dimParam&&e.hasOwnProperty("dimParam")){if(1===t.value)return"value: multiple values";if(t.value=1,!u.isString(e.dimParam))return"dimParam: string expected"}return null!=e.denotation&&e.hasOwnProperty("denotation")&&!u.isString(e.denotation)?"denotation: string expected":null},e.fromObject=function(e){if(e instanceof c.onnx.TensorShapeProto.Dimension)return e;var t=new c.onnx.TensorShapeProto.Dimension;return null!=e.dimValue&&(u.Long?(t.dimValue=u.Long.fromValue(e.dimValue)).unsigned=!1:"string"==typeof e.dimValue?t.dimValue=parseInt(e.dimValue,10):"number"==typeof e.dimValue?t.dimValue=e.dimValue:"object"==typeof e.dimValue&&(t.dimValue=new u.LongBits(e.dimValue.low>>>0,e.dimValue.high>>>0).toNumber())),null!=e.dimParam&&(t.dimParam=String(e.dimParam)),null!=e.denotation&&(t.denotation=String(e.denotation)),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.denotation=""),null!=e.dimValue&&e.hasOwnProperty("dimValue")&&("number"==typeof e.dimValue?n.dimValue=t.longs===String?String(e.dimValue):e.dimValue:n.dimValue=t.longs===String?u.Long.prototype.toString.call(e.dimValue):t.longs===Number?new u.LongBits(e.dimValue.low>>>0,e.dimValue.high>>>0).toNumber():e.dimValue,t.oneofs&&(n.value="dimValue")),null!=e.dimParam&&e.hasOwnProperty("dimParam")&&(n.dimParam=e.dimParam,t.oneofs&&(n.value="dimParam")),null!=e.denotation&&e.hasOwnProperty("denotation")&&(n.denotation=e.denotation),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),e}(),a.TypeProto=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var t;return e.prototype.tensorType=null,e.prototype.denotation="",Object.defineProperty(e.prototype,"value",{get:u.oneOfGetter(t=["tensorType"]),set:u.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=l.create()),null!=e.tensorType&&e.hasOwnProperty("tensorType")&&c.onnx.TypeProto.Tensor.encode(e.tensorType,t.uint32(10).fork()).ldelim(),null!=e.denotation&&e.hasOwnProperty("denotation")&&t.uint32(50).string(e.denotation),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.TypeProto;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.tensorType=c.onnx.TypeProto.Tensor.decode(e,e.uint32());break;case 6:r.denotation=e.string();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.tensorType&&e.hasOwnProperty("tensorType")){var t=c.onnx.TypeProto.Tensor.verify(e.tensorType);if(t)return"tensorType."+t}return null!=e.denotation&&e.hasOwnProperty("denotation")&&!u.isString(e.denotation)?"denotation: string expected":null},e.fromObject=function(e){if(e instanceof c.onnx.TypeProto)return e;var t=new c.onnx.TypeProto;if(null!=e.tensorType){if("object"!=typeof e.tensorType)throw TypeError(".onnx.TypeProto.tensorType: object expected");t.tensorType=c.onnx.TypeProto.Tensor.fromObject(e.tensorType)}return null!=e.denotation&&(t.denotation=String(e.denotation)),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.denotation=""),null!=e.tensorType&&e.hasOwnProperty("tensorType")&&(n.tensorType=c.onnx.TypeProto.Tensor.toObject(e.tensorType,t),t.oneofs&&(n.value="tensorType")),null!=e.denotation&&e.hasOwnProperty("denotation")&&(n.denotation=e.denotation),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e.Tensor=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.elemType=0,e.prototype.shape=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=l.create()),null!=e.elemType&&e.hasOwnProperty("elemType")&&t.uint32(8).int32(e.elemType),null!=e.shape&&e.hasOwnProperty("shape")&&c.onnx.TensorShapeProto.encode(e.shape,t.uint32(18).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.TypeProto.Tensor;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.elemType=e.int32();break;case 2:r.shape=c.onnx.TensorShapeProto.decode(e,e.uint32());break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.elemType&&e.hasOwnProperty("elemType")&&!u.isInteger(e.elemType))return"elemType: integer expected";if(null!=e.shape&&e.hasOwnProperty("shape")){var t=c.onnx.TensorShapeProto.verify(e.shape);if(t)return"shape."+t}return null},e.fromObject=function(e){if(e instanceof c.onnx.TypeProto.Tensor)return e;var t=new c.onnx.TypeProto.Tensor;if(null!=e.elemType&&(t.elemType=0|e.elemType),null!=e.shape){if("object"!=typeof e.shape)throw TypeError(".onnx.TypeProto.Tensor.shape: object expected");t.shape=c.onnx.TensorShapeProto.fromObject(e.shape)}return t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.elemType=0,n.shape=null),null!=e.elemType&&e.hasOwnProperty("elemType")&&(n.elemType=e.elemType),null!=e.shape&&e.hasOwnProperty("shape")&&(n.shape=c.onnx.TensorShapeProto.toObject(e.shape,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),e}(),a.OperatorSetIdProto=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.domain="",e.prototype.version=u.Long?u.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=l.create()),null!=e.domain&&e.hasOwnProperty("domain")&&t.uint32(10).string(e.domain),null!=e.version&&e.hasOwnProperty("version")&&t.uint32(16).int64(e.version),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.onnx.OperatorSetIdProto;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.domain=e.string();break;case 2:r.version=e.int64();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.domain&&e.hasOwnProperty("domain")&&!u.isString(e.domain)?"domain: string expected":null!=e.version&&e.hasOwnProperty("version")&&!(u.isInteger(e.version)||e.version&&u.isInteger(e.version.low)&&u.isInteger(e.version.high))?"version: integer|Long expected":null},e.fromObject=function(e){if(e instanceof c.onnx.OperatorSetIdProto)return e;var t=new c.onnx.OperatorSetIdProto;return null!=e.domain&&(t.domain=String(e.domain)),null!=e.version&&(u.Long?(t.version=u.Long.fromValue(e.version)).unsigned=!1:"string"==typeof e.version?t.version=parseInt(e.version,10):"number"==typeof e.version?t.version=e.version:"object"==typeof e.version&&(t.version=new u.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber())),t},e.toObject=function(e,t){t||(t={});var n={};if(t.defaults)if(n.domain="",u.Long){var r=new u.Long(0,0,!1);n.version=t.longs===String?r.toString():t.longs===Number?r.toNumber():r}else n.version=t.longs===String?"0":0;return null!=e.domain&&e.hasOwnProperty("domain")&&(n.domain=e.domain),null!=e.version&&e.hasOwnProperty("version")&&("number"==typeof e.version?n.version=t.longs===String?String(e.version):e.version:n.version=t.longs===String?u.Long.prototype.toString.call(e.version):t.longs===Number?new u.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber():e.version),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e}(),a),e.exports=c},2100:(e,t,n)=>{e.exports=n(9482)},9482:(e,t,n)=>{var r=t;function o(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=n(1173),r.BufferWriter=n(3155),r.Reader=n(1408),r.BufferReader=n(593),r.util=n(9693),r.rpc=n(5994),r.roots=n(5054),r.configure=o,o()},1408:(e,t,n)=>{e.exports=l;var r,o=n(9693),a=o.LongBits,i=o.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function l(e){this.buf=e,this.pos=0,this.len=e.length}var u,c="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new l(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new l(e);throw Error("illegal buffer")},d=function(){return o.Buffer?function(e){return(l.create=function(e){return o.Buffer.isBuffer(e)?new r(e):c(e)})(e)}:c};function f(){var e=new a(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function p(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function h(){if(this.pos+8>this.len)throw s(this,8);return new a(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}l.create=d(),l.prototype._slice=o.Array.prototype.subarray||o.Array.prototype.slice,l.prototype.uint32=(u=4294967295,function(){if(u=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return u;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return u}),l.prototype.int32=function(){return 0|this.uint32()},l.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},l.prototype.bool=function(){return 0!==this.uint32()},l.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return p(this.buf,this.pos+=4)},l.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|p(this.buf,this.pos+=4)},l.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},l.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},l.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw s(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},l.prototype.string=function(){var e=this.bytes();return i.read(e,0,e.length)},l.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},l.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},l._configure=function(e){r=e,l.create=d(),r._configure();var t=o.Long?"toLong":"toNumber";o.merge(l.prototype,{int64:function(){return f.call(this)[t](!1)},uint64:function(){return f.call(this)[t](!0)},sint64:function(){return f.call(this).zzDecode()[t](!1)},fixed64:function(){return h.call(this)[t](!0)},sfixed64:function(){return h.call(this)[t](!1)}})}},593:(e,t,n)=>{e.exports=a;var r=n(1408);(a.prototype=Object.create(r.prototype)).constructor=a;var o=n(9693);function a(e){r.call(this,e)}a._configure=function(){o.Buffer&&(a.prototype._slice=o.Buffer.prototype.slice)},a.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},a._configure()},5054:e=>{e.exports={}},5994:(e,t,n)=>{t.Service=n(7948)},7948:(e,t,n)=>{e.exports=o;var r=n(9693);function o(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(o.prototype=Object.create(r.EventEmitter.prototype)).constructor=o,o.prototype.rpcCall=function e(t,n,o,a,i){if(!a)throw TypeError("request must be specified");var s=this;if(!i)return r.asPromise(e,s,t,n,o,a);if(s.rpcImpl)try{return s.rpcImpl(t,n[s.requestDelimited?"encodeDelimited":"encode"](a).finish(),function(e,n){if(e)return s.emit("error",e,t),i(e);if(null!==n){if(!(n instanceof o))try{n=o[s.responseDelimited?"decodeDelimited":"decode"](n)}catch(r){return s.emit("error",r,t),i(r)}return s.emit("data",n,t),i(null,n)}s.end(!0)})}catch(l){return s.emit("error",l,t),void setTimeout(function(){i(l)},0)}else setTimeout(function(){i(Error("already ended"))},0)},o.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},1945:(e,t,n)=>{e.exports=o;var r=n(9693);function o(e,t){this.lo=e>>>0,this.hi=t>>>0}var a=o.zero=new o(0,0);a.toNumber=function(){return 0},a.zzEncode=a.zzDecode=function(){return this},a.length=function(){return 1};var i=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(e){if(0===e)return a;var t=e<0;t&&(e=-e);var n=e>>>0,r=(e-n)/4294967296>>>0;return t&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new o(n,r)},o.from=function(e){if("number"==typeof e)return o.fromNumber(e);if(r.isString(e)){if(!r.Long)return o.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new o(e.low>>>0,e.high>>>0):a},o.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},o.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var s=String.prototype.charCodeAt;o.fromHash=function(e){return e===i?a:new o((s.call(e,0)|s.call(e,1)<<8|s.call(e,2)<<16|s.call(e,3)<<24)>>>0,(s.call(e,4)|s.call(e,5)<<8|s.call(e,6)<<16|s.call(e,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},o.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},o.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}},9693:function(e,t,n){var r=t;function o(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;++o)void 0!==e[r[o]]&&n||(e[r[o]]=t[r[o]]);return e}function a(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&o(this,n)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}r.asPromise=n(4537),r.base64=n(7419),r.EventEmitter=n(9211),r.float=n(945),r.inquire=n(7199),r.utf8=n(4997),r.pool=n(6662),r.LongBits=n(1945),r.isNode=Boolean(void 0!==n.g&&n.g&&n.g.process&&n.g.process.versions&&n.g.process.versions.node),r.global=r.isNode&&n.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==typeof e},r.isset=r.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(t){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var n=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},r.merge=o,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=a,r.ProtocolError=a("ProtocolError"),r.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},r.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var e=r.Buffer;e?(r._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},r._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},1173:(e,t,n)=>{e.exports=d;var r,o=n(9693),a=o.LongBits,i=o.base64,s=o.utf8;function l(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function u(){}function c(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function d(){this.len=0,this.head=new l(u,0,0),this.tail=this.head,this.states=null}var f=function(){return o.Buffer?function(){return(d.create=function(){return new r})()}:function(){return new d}};function p(e,t,n){t[n]=255&e}function h(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function g(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}d.create=f(),d.alloc=function(e){return new o.Array(e)},o.Array!==Array&&(d.alloc=o.pool(d.alloc,o.Array.prototype.subarray)),d.prototype._push=function(e,t,n){return this.tail=this.tail.next=new l(e,t,n),this.len+=t,this},h.prototype=Object.create(l.prototype),h.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},d.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new h((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},d.prototype.int32=function(e){return e<0?this._push(m,10,a.fromNumber(e)):this.uint32(e)},d.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},d.prototype.uint64=function(e){var t=a.from(e);return this._push(m,t.length(),t)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(e){var t=a.from(e).zzEncode();return this._push(m,t.length(),t)},d.prototype.bool=function(e){return this._push(p,1,e?1:0)},d.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(e){var t=a.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(e){return this._push(o.float.writeFloatLE,4,e)},d.prototype.double=function(e){return this._push(o.float.writeDoubleLE,8,e)};var b=o.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};d.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(p,1,0);if(o.isString(e)){var n=d.alloc(t=i.length(e));i.decode(e,n,0),e=n}return this.uint32(t)._push(b,t,e)},d.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t)._push(s.write,t,e):this._push(p,1,0)},d.prototype.fork=function(){return this.states=new c(this),this.head=this.tail=new l(u,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new l(u,0,0),this.len=0),this},d.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},d.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},d._configure=function(e){r=e,d.create=f(),r._configure()}},3155:(e,t,n)=>{e.exports=a;var r=n(1173);(a.prototype=Object.create(r.prototype)).constructor=a;var o=n(9693);function a(){r.call(this)}function i(e,t,n){e.length<40?o.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}a._configure=function(){a.alloc=o._Buffer_allocUnsafe,a.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&"set"===o.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},a.prototype.bytes=function(e){o.isString(e)&&(e=o._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(a.writeBytesBuffer,t,e),this},a.prototype.string=function(e){var t=o.Buffer.byteLength(e);return this.uint32(t),t&&this._push(i,t,e),this},a._configure()},7714:(e,t,n)=>{t.R=void 0;const r=n(6919),o=n(7448);t.R=new class{async init(){}async createSessionHandler(e,t){const n=new r.Session(t);return await n.loadModel(e),new o.OnnxjsSessionHandler(n)}}},4200:(e,t,n)=>{t.c8=t.rX=void 0;const r=n(1670),o=n(5381),a=n(2157),i=n(2306);t.rX=()=>{if(("number"!=typeof r.env.wasm.initTimeout||r.env.wasm.initTimeout<0)&&(r.env.wasm.initTimeout=0),"boolean"!=typeof r.env.wasm.simd&&(r.env.wasm.simd=!0),"boolean"!=typeof r.env.wasm.proxy&&(r.env.wasm.proxy=!1),"number"!=typeof r.env.wasm.numThreads||!Number.isInteger(r.env.wasm.numThreads)||r.env.wasm.numThreads<=0){const e="undefined"==typeof navigator?(0,o.cpus)().length:navigator.hardwareConcurrency;r.env.wasm.numThreads=Math.min(4,Math.ceil((e||1)/2))}},t.c8=new class{async init(){(0,t.rX)(),await(0,a.initWasm)()}async createSessionHandler(e,t){const n=new i.OnnxruntimeWebAssemblySessionHandler;return await n.loadModel(e,t),Promise.resolve(n)}}},6018:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(1670),t);const a=n(1670);{const e=n(7714).R;(0,a.registerBackend)("webgl",e,-10)}{const e=n(4200).c8;(0,a.registerBackend)("cpu",e,10),(0,a.registerBackend)("wasm",e,10),(0,a.registerBackend)("xnnpack",e,9)}},246:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createAttributeWithCacheKey=void 0;class n{constructor(e){Object.assign(this,e)}get cacheKey(){return this._cacheKey||(this._cacheKey=Object.getOwnPropertyNames(this).sort().map(e=>`${this[e]}`).join(";")),this._cacheKey}}t.createAttributeWithCacheKey=e=>new n(e)},7778:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Attribute=void 0;const r=n(1446),o=n(9395),a=n(9162),i=n(2517);var s=o.onnxruntime.experimental.fbs;class l{constructor(e){if(this._attributes=new Map,null!=e){for(const t of e)t instanceof r.onnx.AttributeProto?this._attributes.set(t.name,[l.getValue(t),l.getType(t)]):t instanceof s.Attribute&&this._attributes.set(t.name(),[l.getValue(t),l.getType(t)]);if(this._attributes.size<e.length)throw new Error("duplicated attribute names")}}set(e,t,n){this._attributes.set(e,[n,t])}delete(e){this._attributes.delete(e)}getFloat(e,t){return this.get(e,"float",t)}getInt(e,t){return this.get(e,"int",t)}getString(e,t){return this.get(e,"string",t)}getTensor(e,t){return this.get(e,"tensor",t)}getFloats(e,t){return this.get(e,"floats",t)}getInts(e,t){return this.get(e,"ints",t)}getStrings(e,t){return this.get(e,"strings",t)}getTensors(e,t){return this.get(e,"tensors",t)}get(e,t,n){const r=this._attributes.get(e);if(void 0===r){if(void 0!==n)return n;throw new Error(`required attribute not found: ${e}`)}if(r[1]!==t)throw new Error(`type mismatch: expected ${t} but got ${r[1]}`);return r[0]}static getType(e){const t=e instanceof r.onnx.AttributeProto?e.type:e.type();switch(t){case r.onnx.AttributeProto.AttributeType.FLOAT:return"float";case r.onnx.AttributeProto.AttributeType.INT:return"int";case r.onnx.AttributeProto.AttributeType.STRING:return"string";case r.onnx.AttributeProto.AttributeType.TENSOR:return"tensor";case r.onnx.AttributeProto.AttributeType.FLOATS:return"floats";case r.onnx.AttributeProto.AttributeType.INTS:return"ints";case r.onnx.AttributeProto.AttributeType.STRINGS:return"strings";case r.onnx.AttributeProto.AttributeType.TENSORS:return"tensors";default:throw new Error(`attribute type is not supported yet: ${r.onnx.AttributeProto.AttributeType[t]}`)}}static getValue(e){const t=e instanceof r.onnx.AttributeProto?e.type:e.type();if(t===r.onnx.AttributeProto.AttributeType.GRAPH||t===r.onnx.AttributeProto.AttributeType.GRAPHS)throw new Error("graph attribute is not supported yet");const n=this.getValueNoCheck(e);if(t===r.onnx.AttributeProto.AttributeType.INT&&i.LongUtil.isLong(n))return i.LongUtil.longToNumber(n);if(t===r.onnx.AttributeProto.AttributeType.INTS){const e=n,t=new Array(e.length);for(let n=0;n<e.length;n++){const r=e[n];t[n]=i.LongUtil.longToNumber(r)}return t}if(t===r.onnx.AttributeProto.AttributeType.TENSOR)return e instanceof r.onnx.AttributeProto?a.Tensor.fromProto(n):a.Tensor.fromOrtTensor(n);if(t===r.onnx.AttributeProto.AttributeType.TENSORS){if(e instanceof r.onnx.AttributeProto)return n.map(e=>a.Tensor.fromProto(e));if(e instanceof s.Attribute)return n.map(e=>a.Tensor.fromOrtTensor(e))}if(t===r.onnx.AttributeProto.AttributeType.STRING&&e instanceof r.onnx.AttributeProto){const e=n;return(0,i.decodeUtf8String)(e)}return t===r.onnx.AttributeProto.AttributeType.STRINGS&&e instanceof r.onnx.AttributeProto?n.map(i.decodeUtf8String):n}static getValueNoCheck(e){return e instanceof r.onnx.AttributeProto?this.getValueNoCheckFromOnnxFormat(e):this.getValueNoCheckFromOrtFormat(e)}static getValueNoCheckFromOnnxFormat(e){switch(e.type){case r.onnx.AttributeProto.AttributeType.FLOAT:return e.f;case r.onnx.AttributeProto.AttributeType.INT:return e.i;case r.onnx.AttributeProto.AttributeType.STRING:return e.s;case r.onnx.AttributeProto.AttributeType.TENSOR:return e.t;case r.onnx.AttributeProto.AttributeType.GRAPH:return e.g;case r.onnx.AttributeProto.AttributeType.FLOATS:return e.floats;case r.onnx.AttributeProto.AttributeType.INTS:return e.ints;case r.onnx.AttributeProto.AttributeType.STRINGS:return e.strings;case r.onnx.AttributeProto.AttributeType.TENSORS:return e.tensors;case r.onnx.AttributeProto.AttributeType.GRAPHS:return e.graphs;default:throw new Error(`unsupported attribute type: ${r.onnx.AttributeProto.AttributeType[e.type]}`)}}static getValueNoCheckFromOrtFormat(e){switch(e.type()){case s.AttributeType.FLOAT:return e.f();case s.AttributeType.INT:return e.i();case s.AttributeType.STRING:return e.s();case s.AttributeType.TENSOR:return e.t();case s.AttributeType.GRAPH:return e.g();case s.AttributeType.FLOATS:return e.floatsArray();case s.AttributeType.INTS:{const t=[];for(let n=0;n<e.intsLength();n++)t.push(e.ints(n));return t}case s.AttributeType.STRINGS:{const t=[];for(let n=0;n<e.stringsLength();n++)t.push(e.strings(n));return t}case s.AttributeType.TENSORS:{const t=[];for(let n=0;n<e.tensorsLength();n++)t.push(e.tensors(n));return t}default:throw new Error(`unsupported attribute type: ${s.AttributeType[e.type()]}`)}}}t.Attribute=l},7091:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resolveBackend=t.backend=void 0;const r=n(5038),o=new Map;async function a(e){const n=t.backend;if(void 0!==n[e]&&function(e){const t=e;return"initialize"in t&&"function"==typeof t.initialize&&"createSessionHandler"in t&&"function"==typeof t.createSessionHandler&&"dispose"in t&&"function"==typeof t.dispose}(n[e])){const t=n[e];let r=t.initialize();if("object"==typeof r&&"then"in r&&(r=await r),r)return o.set(e,t),t}}t.backend={webgl:new r.WebGLBackend},t.resolveBackend=async function e(t){if(!t)return e(["webgl"]);{const e="string"==typeof t?[t]:t;for(const t of e){const e=o.get(t);if(e)return e;const n=await a(t);if(n)return n}}throw new Error("no available backend to use")}},5038:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WebGLBackend=void 0;const r=n(1670),o=n(6231),a=n(6416),i=n(7305);t.WebGLBackend=class{get contextId(){return r.env.webgl.contextId}set contextId(e){r.env.webgl.contextId=e}get matmulMaxBatchSize(){return r.env.webgl.matmulMaxBatchSize}set matmulMaxBatchSize(e){r.env.webgl.matmulMaxBatchSize=e}get textureCacheMode(){return r.env.webgl.textureCacheMode}set textureCacheMode(e){r.env.webgl.textureCacheMode=e}get pack(){return r.env.webgl.pack}set pack(e){r.env.webgl.pack=e}get async(){return r.env.webgl.async}set async(e){r.env.webgl.async=e}initialize(){try{return this.glContext=(0,i.createWebGLContext)(this.contextId),"number"!=typeof this.matmulMaxBatchSize&&(this.matmulMaxBatchSize=16),"string"!=typeof this.textureCacheMode&&(this.textureCacheMode="full"),"boolean"!=typeof this.pack&&(this.pack=!1),"boolean"!=typeof this.async&&(this.async=!1),o.Logger.setWithEnv(r.env),o.Logger.verbose("WebGLBackend",`Created WebGLContext: ${typeof this.glContext} with matmulMaxBatchSize: ${this.matmulMaxBatchSize}; textureCacheMode: ${this.textureCacheMode}; pack: ${this.pack}; async: ${this.async}.`),!0}catch(e){return o.Logger.warning("WebGLBackend",`Unable to initialize WebGLBackend. ${e}`),!1}}createSessionHandler(e){return new a.WebGLSessionHandler(this,e)}dispose(){this.glContext.dispose()}}},5107:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoordsGlslLib=void 0;const r=n(2517),o=n(8520),a=n(5060),i=n(7859),s=n(9390);class l extends o.GlslLib{constructor(e){super(e)}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.offsetToCoords()),this.coordsToOffset()),this.toVec()),this.valueFrom()),this.getCommonUtilFuncs()),this.getInputsSamplingSnippets()),this.getOutputSamplingSnippet())}getCustomTypes(){return{}}offsetToCoords(){return{offsetToCoords:new o.GlslLibRoutine("\n vec2 offsetToCoords(int offset, int width, int height) {\n int t = offset / width;\n int s = offset - t*width;\n vec2 coords = (vec2(s,t) + vec2(0.5,0.5)) / vec2(width, height);\n return coords;\n }\n ")}}coordsToOffset(){return{coordsToOffset:new o.GlslLibRoutine("\n int coordsToOffset(vec2 coords, int width, int height) {\n float s = coords.s * float(width);\n float t = coords.t * float(height);\n int offset = int(t) * width + int(s);\n return offset;\n }\n ")}}getOutputSamplingSnippet(){const e=this.context.outputTextureLayout;return e.isPacked?this.getPackedOutputSamplingSnippet(e):this.getUnpackedOutputSamplingSnippet(e)}getPackedOutputSamplingSnippet(e){const t=e.unpackedShape,n=[e.width,e.height],r={},i="getOutputCoords";switch(t.length){case 0:r[i]=this.getOutputScalarCoords();break;case 1:r[i]=this.getOutputPacked1DCoords(t,n);break;case 2:r[i]=this.getOutputPacked2DCoords(t,n);break;case 3:r[i]=this.getOutputPacked3DCoords(t,n);break;default:r[i]=this.getOutputPackedNDCoords(t,n)}const s=`\n void setOutput(vec4 val) {\n ${(0,a.getGlsl)(this.context.glContext.version).output} = val;\n }\n `;return r.floatTextureSetRGBA=new o.GlslLibRoutine(s),r}getUnpackedOutputSamplingSnippet(e){const t=e.unpackedShape,n=[e.width,e.height],r={},i="getOutputCoords";switch(t.length){case 0:r[i]=this.getOutputScalarCoords();break;case 1:r[i]=this.getOutputUnpacked1DCoords(t,n);break;case 2:r[i]=this.getOutputUnpacked2DCoords(t,n);break;case 3:r[i]=this.getOutputUnpacked3DCoords(t,n);break;case 4:r[i]=this.getOutputUnpacked4DCoords(t,n);break;case 5:r[i]=this.getOutputUnpacked5DCoords(t,n);break;case 6:r[i]=this.getOutputUnpacked6DCoords(t,n);break;default:throw new Error(`Unsupported output dimensionality: ${t.length}`)}const s=`\n void setOutput(float val) {\n ${(0,a.getGlsl)(this.context.glContext.version).output} = vec4(val, 0, 0, 0);\n }\n `;return r.floatTextureSetR=new o.GlslLibRoutine(s),r}getOutputScalarCoords(){return new o.GlslLibRoutine("\n int getOutputCoords() {\n return 0;\n }\n ")}getOutputPacked1DCoords(e,t){const n=t;let r="";return 1===n[0]?(r=`\n int getOutputCoords() {\n return 2 * int(TexCoords.y * ${n[1]}.0);\n }\n `,new o.GlslLibRoutine(r)):1===n[1]?(r=`\n int getOutputCoords() {\n return 2 * int(TexCoords.x * ${n[0]}.0);\n }\n `,new o.GlslLibRoutine(r)):(r=`\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${n[0]}, ${n[1]}));\n return 2 * (resTexRC.y * ${n[0]} + resTexRC.x);\n }\n `,new o.GlslLibRoutine(r))}getOutputPacked2DCoords(e,t){let n="";if(r.ArrayUtil.arraysEqual(e,t))return n=`\n ivec2 getOutputCoords() {\n return 2 * ivec2(TexCoords.xy * vec2(${t[0]}, ${t[1]}));\n }\n `,new o.GlslLibRoutine(n);const a=t,i=Math.ceil(e[1]/2);return n=`\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${a[0]}, ${a[1]}));\n\n int index = resTexRC.y * ${a[0]} + resTexRC.x;\n\n // reverse r and c order for packed texture\n int r = imod(index, ${i}) * 2;\n int c = 2 * (index / ${i});\n\n return ivec2(r, c);\n }\n `,new o.GlslLibRoutine(n)}getOutputPacked3DCoords(e,t){const n=[t[0],t[1]],r=Math.ceil(e[2]/2),a=r*Math.ceil(e[1]/2),i=`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${n[0]}, ${n[1]}));\n int index = resTexRC.y * ${n[0]} + resTexRC.x;\n\n int b = index / ${a};\n index -= b * ${a};\n\n // reverse r and c order for packed texture\n int r = imod(index, ${r}) * 2;\n int c = 2 * (index / ${r});\n\n return ivec3(b, r, c);\n }\n `;return new o.GlslLibRoutine(i)}getOutputPackedNDCoords(e,t){const n=[t[0],t[1]],r=Math.ceil(e[e.length-1]/2),a=r*Math.ceil(e[e.length-2]/2);let i=a,s="",l="b, r, c";for(let o=2;o<e.length-1;o++)i*=e[e.length-o-1],s=`\n int b${o} = index / ${i};\n index -= b${o} * ${i};\n `+s,l=`b${o}, `+l;const u=`\n ivec${e.length} getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${n[0]}, ${n[1]}));\n int index = resTexRC.y * ${n[0]} + resTexRC.x;\n\n ${s}\n\n int b = index / ${a};\n index -= b * ${a};\n\n // reverse r and c order for packed texture\n int r = imod(index, ${r}) * 2;\n int c = 2 * (index / ${r});\n\n return ivec${e.length}(${l});\n }\n `;return new o.GlslLibRoutine(u)}getOutputUnpacked1DCoords(e,t){const n=`\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${t[0]}, ${t[1]}));\n return resTexRC.y * ${t[0]} + resTexRC.x;\n }\n `;return new o.GlslLibRoutine(n)}getOutputUnpacked2DCoords(e,t){const n=`\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.y * ${t[0]} + resTexRC.x;\n int r = index / ${e[1]};\n int c = index - r * ${e[1]};\n return ivec2(r, c);\n }\n `;return new o.GlslLibRoutine(n)}getOutputUnpacked3DCoords(e,t){let n="";const r=e.length;let a=null;r<2&&(a=[]),a=new Array(r-1),a[r-2]=e[r-1];for(let o=r-3;o>=0;--o)a[o]=a[o+1]*e[o+1];const i=["r","c","d"],s=a.map((e,t)=>`int ${i[t]} = index / ${e}; ${t===a.length-1?`int ${i[t+1]} = index - ${i[t]} * ${e}`:`index -= ${i[t]} * ${e}`};`).join("");return n=`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.y * ${t[0]} + resTexRC.x;\n ${s}\n return ivec3(r, c, d);\n }\n `,new o.GlslLibRoutine(n)}getOutputUnpacked4DCoords(e,t){let n="";const r=e.length;let a=null;r<2&&(a=[]),a=new Array(r-1),a[r-2]=e[r-1];for(let o=r-3;o>=0;--o)a[o]=a[o+1]*e[o+1];const i=["r","c","d","d2"],s=a.map((e,t)=>`int ${i[t]} = index / ${e}; ${t===a.length-1?`int ${i[t+1]} = index - ${i[t]} * ${e}`:`index -= ${i[t]} * ${e}`};`).join("");return n=`\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.y * ${t[0]} + resTexRC.x;\n ${s}\n return ivec4(r, c, d, d2);\n }\n `,new o.GlslLibRoutine(n)}getOutputUnpacked5DCoords(e,t){let n="";const r=e.length;let a=null;r<2&&(a=[]),a=new Array(r-1),a[r-2]=e[r-1];for(let o=r-3;o>=0;--o)a[o]=a[o+1]*e[o+1];const i=["r","c","d","d2","d3"],s=a.map((e,t)=>`int ${i[t]} = index / ${e}; ${t===a.length-1?`int ${i[t+1]} = index - ${i[t]} * ${e}`:`index -= ${i[t]} * ${e}`};`).join("");return n=`\n ivec5 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.y * ${t[0]} + resTexRC.x;\n ${s}\n return ivec5(r, c, d, d2, d3);\n }\n `,new o.GlslLibRoutine(n)}getOutputUnpacked6DCoords(e,t){let n="";const r=e.length;let a=null;r<2&&(a=[]),a=new Array(r-1),a[r-2]=e[r-1];for(let o=r-3;o>=0;--o)a[o]=a[o+1]*e[o+1];const i=["r","c","d","d2","d3","d4"],s=a.map((e,t)=>`int ${i[t]} = index / ${e}; ${t===a.length-1?`int ${i[t+1]} = index - ${i[t]} * ${e}`:`index -= ${i[t]} * ${e}`};`).join("");return n=`\n ivec6 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.y * ${t[0]} + resTexRC.x;\n ${s}\n return ivec6(r, c, d, d2, d3, d4);\n }\n `,new o.GlslLibRoutine(n)}getCommonUtilFuncs(){const e={};let t="uvFromFlat";e[t]=new o.GlslLibRoutine("\n vec2 uvFromFlat(int texNumR, int texNumC, int index) {\n int texC = index / texNumR;\n int texR = index - texC * texNumR;\n // TODO: swap texR, texC order in following function so row is corresponding to u and column is corresponding to\n // v.\n return (vec2(texR, texC) + halfCR) / vec2(texNumR, texNumC);\n }\n "),t="packedUVfrom1D",e[t]=new o.GlslLibRoutine("\n vec2 packedUVfrom1D(int texNumR, int texNumC, int index) {\n int texelIndex = index / 2;\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n "),t="packedUVfrom2D",e[t]=new o.GlslLibRoutine("\n vec2 packedUVfrom2D(int texNumR, int texNumC, int texelsInLogicalRow, int row, int col) {\n int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n "),t="packedUVfrom3D",e[t]=new o.GlslLibRoutine("\n vec2 packedUVfrom3D(int texNumR, int texNumC,\n int texelsInBatch, int texelsInLogicalRow, int b,\n int row, int col) {\n int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n "),t="sampleTexture";const n=(0,a.getGlsl)(this.context.glContext.version);return e[t]=new o.GlslLibRoutine(`\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return ${n.texture2D}(textureSampler, uv).r;\n }`),e}getInputsSamplingSnippets(){const e={},t=this.context.outputTextureLayout;return this.context.programInfo.inputNames.forEach((n,r)=>{const o=this.context.inputTextureLayouts[r],a=(0,s.generateShaderFuncNameFromInputSamplerName)(n);o.isPacked?e[a]=this.getPackedSamplerFromInput(a,n,o):e[a]=this.getUnpackedSamplerFromInput(a,n,o);const i=(0,s.generateShaderFuncNameFromInputSamplerNameAtOutCoords)(n);o.unpackedShape.length<=t.unpackedShape.length&&(o.isPacked?e[i]=this.getPackedSamplerAtOutputCoords(i,o,t,n):e[i]=this.getUnpackedSamplerAtOutputCoords(i,o,t,n))}),e}getPackedSamplerAtOutputCoords(e,t,n,a){const i=t.unpackedShape,l=n.unpackedShape,u=a,c=(0,s.generateShaderFuncNameFromInputSamplerName)(u),d=i.length,f=l.length,p=r.BroadcastUtil.getBroadcastDims(i,l),h=(0,s.getCoordsDataType)(f),m=f-d;let g;const b=(0,s.getGlChannels)();g=0===d?"":f<2&&p.length>=1?"coords = 0;":p.map(e=>`coords.${b[e+m]} = 0;`).join("\n");let y="";y=f<2&&d>0?"coords":i.map((e,t)=>`coords.${b[t+m]}`).join(", ");let _="return outputValue;";const v=1===r.ShapeUtil.size(i),w=1===r.ShapeUtil.size(l);if(1!==d||v||w){if(v&&!w)_=1===f?"\n return vec4(outputValue.x, outputValue.x, 0., 0.);\n ":"\n return vec4(outputValue.x);\n ";else if(p.length){const e=d-2,t=d-1;p.indexOf(e)>-1&&p.indexOf(t)>-1?_="return vec4(outputValue.x);":p.indexOf(e)>-1?_="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":p.indexOf(t)>-1&&(_="return vec4(outputValue.xx, outputValue.zz);")}}else _="\n return vec4(outputValue.xy, outputValue.xy);\n ";const S=`\n vec4 ${e}() {\n ${h} coords = getOutputCoords();\n \n int lastDim = coords.${b[f-1]};\n coords.${b[f-1]} = coords.${b[f-2]};\n coords.${b[f-2]} = lastDim;\n \n ${g}\n vec4 outputValue = ${c}(${y});\n ${_}\n }\n `;return new o.GlslLibRoutine(S,["coordinates.getOutputCoords"])}getUnpackedSamplerAtOutputCoords(e,t,n,a){const i=[n.width,n.height],l=[t.width,t.height],u=t.unpackedShape.length,c=n.unpackedShape.length,d=t.unpackedShape,f=n.unpackedShape,p=(0,s.generateShaderFuncNameFromInputSamplerName)(a);if(u===c&&r.ArrayUtil.arraysEqual(l,i)){const t=`\n float ${e}() {\n return sampleTexture(${a}, TexCoords);\n }\n `;return new o.GlslLibRoutine(t,["coordinates.sampleTexture"])}const h=(0,s.getCoordsDataType)(c),m=r.BroadcastUtil.getBroadcastDims(d,f),g=c-u;let b;const y=(0,s.getGlChannels)();b=0===u?"":c<2&&m.length>=1?"coords = 0;":m.map(e=>`coords.${y[e+g]} = 0;`).join("\n");let _="";_=c<2&&u>0?"coords":t.unpackedShape.map((e,t)=>`coords.${y[t+g]}`).join(", ");const v=`\n float ${e}() {\n ${h} coords = getOutputCoords();\n ${b}\n return ${p}(${_});\n }\n `;return new o.GlslLibRoutine(v,["coordinates.getOutputCoords"])}getPackedSamplerFromInput(e,t,n){switch(n.unpackedShape.length){case 0:return this.getPackedSamplerScalar(e,t);case 1:return this.getPackedSampler1D(e,t,n);case 2:return this.getPackedSampler2D(e,t,n);case 3:return this.getPackedSampler3D(e,t,n);default:return this.getPackedSamplerND(e,t,n)}}getUnpackedSamplerFromInput(e,t,n){const r=n.unpackedShape;switch(r.length){case 0:return this.getUnpackedSamplerScalar(e,t,n);case 1:return this.getUnpackedSampler1D(e,t,n);case 2:return this.getUnpackedSampler2D(e,t,n);case 3:return this.getUnpackedSampler3D(e,t,n);case 4:return this.getUnpackedSampler4D(e,t,n);case 5:return this.getUnpackedSampler5D(e,t,n);case 6:return this.getUnpackedSampler6D(e,t,n);default:throw new Error(`Unsupported dimension ${r.length}-D`)}}getPackedSamplerScalar(e,t){const n=`\n vec4 ${e}() {\n return ${(0,a.getGlsl)(this.context.glContext.version).texture2D}(${t}, halfCR);\n }\n `;return new o.GlslLibRoutine(n)}getPackedSampler1D(e,t,n){const r=[n.width,n.height],i=[r[1],r[0]],s=(0,a.getGlsl)(this.context.glContext.version),l=`vec4 ${e}(int index) {\n vec2 uv = packedUVfrom1D(\n ${i[0]}, ${i[1]}, index);\n return ${s.texture2D}(${t}, uv);\n }`;return new o.GlslLibRoutine(l,["coordinates.packedUVfrom1D"])}getPackedSampler2D(e,t,n){const i=n.unpackedShape,s=[n.width,n.height],l=(0,a.getGlsl)(this.context.glContext.version),u=s[0],c=s[1];if(null!=s&&r.ArrayUtil.arraysEqual(i,s)){const n=`vec4 ${e}(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(${c}.0, ${u}.0);\n return ${l.texture2D}(${t}, uv);\n }`;return new o.GlslLibRoutine(n)}const d=s,f=Math.ceil(i[1]/2),p=`vec4 ${e}(int row, int col) {\n vec2 uv = packedUVfrom2D(${d[1]}, ${d[0]}, ${f}, row, col);\n return ${l.texture2D}(${t}, uv);\n }`;return new o.GlslLibRoutine(p,["coordinates.packedUVfrom2D"])}getPackedSampler3D(e,t,n){const r=n.unpackedShape,i=[n.width,n.height],l=[i[0],i[1]],u=(0,a.getGlsl)(this.context.glContext.version);if(1===r[0]){const a=r.slice(1),i=[1,2],l=(0,s.squeezeInputShape)(r,a),u=["b","row","col"],c=JSON.parse(JSON.stringify(n));c.unpackedShape=l;const d=this.getPackedSamplerFromInput(e,t,c),f=`${d.routineBody}\n vec4 ${e}(int b, int row, int col) {\n return ${e}(${(0,s.getSqueezedParams)(u,i)});\n } `;return new o.GlslLibRoutine(f,d.dependencies)}const c=l[0],d=l[1],f=Math.ceil(r[2]/2),p=`vec4 ${e}(int b, int row, int col) {\n vec2 uv = packedUVfrom3D(\n ${d}, ${c}, ${f*Math.ceil(r[1]/2)}, ${f}, b, row, col);\n return ${u.texture2D}(${t}, uv);}`;return new o.GlslLibRoutine(p,["coordinates.packedUVfrom3D"])}getPackedSamplerND(e,t,n){const r=n.unpackedShape,i=r.length,s=[n.width,n.height],l=(0,a.getGlsl)(this.context.glContext.version),u=[s[0],s[1]],c=u[1],d=u[0],f=Math.ceil(r[i-1]/2);let p=f*Math.ceil(r[i-2]/2),h="int b, int row, int col",m=`b * ${p} + (row / 2) * ${f} + (col / 2)`;for(let o=2;o<i-1;o++)h=`int b${o}, `+h,p*=r[i-o-1],m=`b${o} * ${p} + `+m;const g=`vec4 ${e}(${h}) {\n int index = ${m};\n int texR = index / ${d};\n int texC = index - texR * ${d};\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${d}, ${c});\n return ${l.texture2D}(${t}, uv);\n }`;return new o.GlslLibRoutine(g)}getUnpackedSamplerScalar(e,t,n){const[r,a]=[n.width,n.height];if(1===r&&1===a){const n=`\n float ${e}() {\n return sampleTexture(${t}, halfCR);\n }\n `;return new o.GlslLibRoutine(n,["coordinates.sampleTexture"])}const i=`\n float ${e}() {\n int offset_${t} = coordsToOffset(TexCoords, ${r}, ${a});\n vec2 uv = uvFromFlat(${r}, ${a}, offset_${t});\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(i,["coordinates.uvFromFlat","coordinates.sampleTexture","coordinates.coordsToOffset"])}getUnpackedSampler1D(e,t,n){const r=n.width,a=n.height;if(1===a&&1===r){const n=`\n float ${e}(int index) {\n return sampleTexture(${t}, halfCR);\n }\n `;return new o.GlslLibRoutine(n,["coordinates.sampleTexture"])}if(1===a){const n=`\n float ${e}(int index) {\n vec2 uv = vec2((float(index) + 0.5) / ${r}.0, 0.5);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(n,["coordinates.sampleTexture"])}if(1===r){const n=`\n float ${e}(int index) {\n vec2 uv = vec2(0.5, (float(index) + 0.5) / ${a}.0);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(n,["coordinates.sampleTexture"])}const i=`\n float ${e}(int index) {\n vec2 uv = uvFromFlat(${r}, ${a}, index);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(i,["coordinates.uvFromFlat","coordinates.sampleTexture"])}getUnpackedSampler2D(e,t,n){const a=n.unpackedShape,l=[n.height,n.width];if(null!=l&&r.ArrayUtil.arraysEqual(a,l)){const n=`\n float ${e}(int row, int col) {\n vec2 uv = (vec2(row, col) + halfCR) / vec2(${l[1]}.0, ${l[0]}.0);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(n,["coordinates.sampleTexture"])}const{newShape:u,keptDims:c}=(0,i.squeezeShape)(a),d=u;if(d.length<a.length){const r=(0,s.squeezeInputShape)(a,d),i=JSON.parse(JSON.stringify(n));i.unpackedShape=r;const l=["col","row"],u=`\n ${this.getUnpackedSamplerFromInput(e,t,i).routineBody}\n float ${e}(int row, int col) {\n return ${e}(${(0,s.getSqueezedParams)(l,c)});\n }\n `;return new o.GlslLibRoutine(u,["coordinates.sampleTexture"])}const f=l[1],p=l[0];if(1===p){const n=`\n float ${e}(int row, int col) {\n int offset_${t} = coordsToOffset(TexCoords, ${f}, ${p});\n float index = dot(vec3(row, col, offset_${t}), vec3(${a[1]}, 1, 1));\n vec2 uv = vec2(0.5, (index + 0.5) / ${f}.0);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(n,["coordinates.sampleTexture","coordinates.coordsToOffset"])}if(1===f){const n=`\n float ${e}(int row, int col) {\n int offset_${t} = coordsToOffset(TexCoords, ${f}, ${p});\n float index = dot(vec3(row, col, offset_${t}), vec3(${a[1]}, 1, 1));\n vec2 uv = vec2((index + 0.5) / ${p}.0, 0.5);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(n,["coordinates.sampleTexture","coordinates.coordsToOffset"])}const h=`\n float ${e}(int row, int col) {\n int index = col * ${a[1]} + row;\n vec2 uv = uvFromFlat(${f}, ${p}, index);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(h,["coordinates.uvFromFlat","coordinates.sampleTexture","coordinates.coordsToOffset"])}getUnpackedSampler3D(e,t,n){const r=n.unpackedShape,a=r[1]*r[2],l=r[2],{newShape:u,keptDims:c}=(0,i.squeezeShape)(r),d=u;if(d.length<r.length){const a=(0,s.squeezeInputShape)(r,d),i=["batch","col","row"],l=JSON.parse(JSON.stringify(n));l.unpackedShape=a;const u=this.getUnpackedSamplerFromInput(e,t,l),f=c.reverse(),p=`\n ${u.routineBody}\n float ${e}(int batch, int row, int col) {\n return ${e}(${(0,s.getSqueezedParams)(i,f)});\n }\n `;return new o.GlslLibRoutine(p,u.dependencies)}const f=`\n float ${e}(int depth, int row, int col) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = depth * ${a} + col * ${l} + row;\n vec2 uv = uvFromFlat(${n.width}, ${n.height}, index);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(f,["coordinates.uvFromFlat","coordinates.sampleTexture","coordinates.coordsToOffset"])}getUnpackedSampler4D(e,t,n){const r=n.unpackedShape,a=r[3],i=r[2]*a,s=`\n float ${e}(int row, int col, int depth, int depth2) {\n int index = row * ${r[1]*i} + col * ${i} +\n depth2 * ${a} + depth;\n vec2 uv = uvFromFlat(${n.width}, ${n.height}, index);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(s,["coordinates.uvFromFlat","coordinates.sampleTexture"])}getUnpackedSampler5D(e,t,n){const r=n.unpackedShape,a=r[4],l=r[3]*a,u=r[2]*l,c=r[1]*u,{newShape:d,keptDims:f}=(0,i.squeezeShape)(r);if(d.length<r.length){const a=(0,s.squeezeInputShape)(r,d),i=["row","col","depth","depth2","depth3"],l=JSON.parse(JSON.stringify(n));l.unpackedShape=a;const u=`\n ${this.getUnpackedSamplerFromInput(e,t,l).routineBody}\n float ${e}(int row, int col, int depth, int depth2, int depth3) {\n return ${e}(${(0,s.getSqueezedParams)(i,f)});\n }\n `;return new o.GlslLibRoutine(u,["coordinates.sampleTexture","coordinates.uvFromFlat"])}const p=`\n float ${e}(int row, int col, int depth, int depth2, int depth3) {\n int index = row * ${c} + col * ${u} + depth * ${l} +\n depth3 * ${a} + depth2;\n vec2 uv = uvFromFlat(${n.width}, ${n.height}, index);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(p,["coordinates.sampleTexture","coordinates.uvFromFlat"])}getUnpackedSampler6D(e,t,n){const r=n.unpackedShape,a=r[5],l=r[4]*a,u=r[3]*l,c=r[2]*u,d=r[1]*c,{newShape:f,keptDims:p}=(0,i.squeezeShape)(r);if(f.length<r.length){const a=(0,s.squeezeInputShape)(r,f),i=["row","col","depth","depth2","depth3","depth4"],l=JSON.parse(JSON.stringify(n));l.unpackedShape=a;const u=`\n ${this.getUnpackedSamplerFromInput(e,t,l).routineBody}\n float ${e}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n return ${e}(${(0,s.getSqueezedParams)(i,p)});\n }\n `;return new o.GlslLibRoutine(u,["coordinates.sampleTexture","coordinates.uvFromFlat"])}const h=`\n float ${e}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int index = row * ${d} + col * ${c} + depth * ${u} +\n depth2 * ${l} + depth3 * ${a} + depth4;\n vec2 uv = uvFromFlat(${n.width}, ${n.height}, index);\n return sampleTexture(${t}, uv);\n }\n `;return new o.GlslLibRoutine(h,["coordinates.uvFromFlat","coordinates.sampleTexture","coordinates.coordsToOffset"])}toVec(){const e=this.context.outputTextureLayout,t=e.shape.length,n=e.strides,r=e.width,a=e.height,i=[];for(let o=0;o<t-1;++o)i.push(`\n c[${o}] = offset / ${n[o]};`),i.push(`\n offset -= c[${o}] * ${n[o]};`);i.push(`\n c[${t-1}] = offset;`);const s=`\n void toVec(vec2 texCoords, out int c[${t}]) {\n int offset = coordsToOffset(texCoords, ${r}, ${a});\n ${i.join("")}\n }\n void toVec(int offset, out int c[${t}]) {\n ${i.join("")}\n }\n `;return{toVec:new o.GlslLibRoutine(s,["coordinates.coordsToOffset"])}}valueFrom(){const e={};return this.context.programInfo.inputNames.forEach((t,n)=>{const r=this.context.inputTextureLayouts[n],a=(r.unpackedShape.length>0?r.unpackedShape:r.shape).length;let i=`_${t}`;e[i]=new o.GlslLibRoutine(this.getValueFromSingle(t,a,r.width,r.height,!1),[`shapeUtils.indicesToOffset${i}`,"coordinates.offsetToCoords","fragcolor.getColorAsFloat"]),i+="_T",e[i]=new o.GlslLibRoutine(this.getValueFromSingle(t,a,r.width,r.height,!0),[`shapeUtils.indicesToOffset${i}`,"coordinates.offsetToCoords","fragcolor.getColorAsFloat"])}),e}getValueFromSingle(e,t,n,r,o){let i=`_${e}`;return o&&(i+="_T"),`\n float ${i}(int m[${t}]) {\n int offset = indicesToOffset${i}(m);\n vec2 coords = offsetToCoords(offset, ${n}, ${r});\n float value = getColorAsFloat(${(0,a.getGlsl)(this.context.glContext.version).texture2D}(${e}, coords));\n return value;\n }\n `}getPackedValueFrom(e,t,n,r,o){let i=`_${e}_Pack`;return o&&(i+="_T"),`\n vec4 ${i}(int m[${t}]) {\n int offset = indicesToOffset_${e}(m);\n vec2 coords = offsetToCoords(offset, ${n}, ${r});\n return ${(0,a.getGlsl)(this.context.glContext.version).texture2D}(${e}, coords);\n }\n `}}t.CoordsGlslLib=l},8520:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.TopologicalSortGlslRoutines=t.GlslLibRoutineNode=t.GlslLibRoutine=t.GlslLib=t.GlslContext=t.FunctionType=void 0,(n=t.FunctionType||(t.FunctionType={}))[n.ValueBased=0]="ValueBased",n[n.Positional=1]="Positional",t.GlslContext=class{constructor(e,t,n,r){this.glContext=e,this.programInfo=t,this.inputTextureLayouts=n,this.outputTextureLayout=r}},t.GlslLib=class{constructor(e){this.context=e}},t.GlslLibRoutine=class{constructor(e,t){this.routineBody=e,this.dependencies=t}},t.GlslLibRoutineNode=class{constructor(e,t,n){this.name=e,this.dependencies=n||[],t&&(this.routineBody=t)}addDependency(e){e&&this.dependencies.push(e)}},t.TopologicalSortGlslRoutines=class{static returnOrderedNodes(e){if(!e||0===e.length)return[];if(1===e.length)return e;const t=new Set,n=new Set,r=new Array;return this.createOrderedNodes(e,t,n,r),r}static createOrderedNodes(e,t,n,r){for(let o=0;o<e.length;++o)this.dfsTraverse(e[o],t,n,r)}static dfsTraverse(e,t,n,r){if(!e||n.has(e.name))return;if(t.has(e.name))throw new Error("Cyclic dependency detected. Can't topologically sort routines needed for shader.");t.add(e.name);const o=e.dependencies;if(o&&o.length>0)for(let a=0;a<o.length;++a)this.dfsTraverse(o[a],t,n,r);r.push(e),n.add(e.name),t.delete(e.name)}}},7341:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EncodingGlslLib=void 0;const r=n(8520);class o extends r.GlslLib{constructor(e){super(e)}getFunctions(){return Object.assign(Object.assign({},this.encodeFloat32()),this.decodeFloat32())}getCustomTypes(){return{}}encodeFloat32(){return{encode:new r.GlslLibRoutine("highp vec4 encode(highp float f) {\n return vec4(f, 0.0, 0.0, 0.0);\n }\n ")}}decodeFloat32(){return{decode:new r.GlslLibRoutine("highp float decode(highp vec4 rgba) {\n return rgba.r;\n }\n ")}}encodeUint8(){const e=o.isLittleEndian()?"rgba.rgba=rgba.abgr;":"";return{encode:new r.GlslLibRoutine(`\n highp vec4 encode(highp float f) {\n highp float F = abs(f);\n highp float Sign = step(0.0,-f);\n highp float Exponent = floor(log2(F));\n highp float Mantissa = (exp2(- Exponent) * F);\n Exponent = floor(log2(F) + 127.0) + floor(log2(Mantissa));\n highp vec4 rgba;\n rgba[0] = 128.0 * Sign + floor(Exponent*exp2(-1.0));\n rgba[1] = 128.0 * mod(Exponent,2.0) + mod(floor(Mantissa*128.0),128.0);\n rgba[2] = floor(mod(floor(Mantissa*exp2(23.0 -8.0)),exp2(8.0)));\n rgba[3] = floor(exp2(23.0)*mod(Mantissa,exp2(-15.0)));\n ${e}\n rgba = rgba / 255.0; // values need to be normalized to [0,1]\n return rgba;\n }\n `)}}decodeUint8(){const e=o.isLittleEndian()?"rgba.rgba=rgba.abgr;":"";return{decode:new r.GlslLibRoutine(`\n highp float decode(highp vec4 rgba) {\n rgba = rgba * 255.0; // values need to be de-normalized from [0,1] to [0,255]\n ${e}\n highp float Sign = 1.0 - step(128.0,rgba[0])*2.0;\n highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0;\n highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000);\n highp float Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 ));\n return Result;\n }\n `)}}static isLittleEndian(){const e=new ArrayBuffer(4),t=new Uint32Array(e),n=new Uint8Array(e);if(t[0]=3735928559,239===n[0])return!0;if(222===n[0])return!1;throw new Error("unknown endianness")}}t.EncodingGlslLib=o},9894:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FragColorGlslLib=void 0;const r=n(8520),o=n(5060);class a extends r.GlslLib{constructor(e){super(e)}getFunctions(){return Object.assign(Object.assign({},this.setFragColor()),this.getColorAsFloat())}getCustomTypes(){return{}}setFragColor(){const e=(0,o.getGlsl)(this.context.glContext.version);return{setFragColor:new r.GlslLibRoutine(`\n void setFragColor(float value) {\n ${e.output} = encode(value);\n }\n `,["encoding.encode"])}}getColorAsFloat(){return{getColorAsFloat:new r.GlslLibRoutine("\n float getColorAsFloat(vec4 color) {\n return decode(color);\n }\n ",["encoding.decode"])}}}t.FragColorGlslLib=a},2848:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.replaceInlines=void 0;const n=/@inline[\s\n\r]+(\w+)[\s\n\r]+([0-9a-zA-Z_]+)\s*\(([^)]*)\)\s*{(([^}]|[\n\r])*)}/gm;t.replaceInlines=function(e){const t={};let r;for(;null!==(r=n.exec(e));){const e=r[3].split(",").map(e=>{const t=e.trim().split(" ");return t&&2===t.length?{type:t[0],name:t[1]}:null}).filter(e=>null!==e);t[r[2]]={params:e,body:r[4]}}for(const n in t){const o="(\\w+)?\\s+([_0-9a-zA-Z]+)\\s+=\\s+__FUNC__\\((.*)\\)\\s*;".replace("__FUNC__",n),a=new RegExp(o,"gm");for(;null!==(r=a.exec(e));){const o=r[1],a=r[2],i=r[3].split(","),s=o?`${o} ${a};`:"";let l=t[n].body,u="";t[n].params.forEach((e,t)=>{e&&(u+=`${e.type} ${e.name} = ${i[t]};\n`)}),l=`${u}\n ${l}`,l=l.replace("return",`${a} = `);const c=`\n ${s}\n {\n ${l}\n }\n `;e=e.replace(r[0],c)}}return e.replace(n,"")}},8879:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GlslPreprocessor=void 0;const r=n(8520),o=n(2848),a=n(5483),i=n(5060);t.GlslPreprocessor=class{constructor(e,t,n,o){this.libs={},this.glslLibRoutineDependencyGraph={},this.context=new r.GlslContext(e,t,n,o),Object.keys(a.glslRegistry).forEach(e=>{const t=new a.glslRegistry[e](this.context);this.libs[e]=t});const i=this.glslLibRoutineDependencyGraph;for(const a in this.libs){const e=this.libs[a].getFunctions();for(const t in e){const n=a+"."+t;let o;i[n]?(o=i[n],o.routineBody=e[t].routineBody):(o=new r.GlslLibRoutineNode(n,e[t].routineBody),i[n]=o);const s=e[t].dependencies;if(s)for(let e=0;e<s.length;++e)if(i[s[e]])o.addDependency(i[s[e]]);else{const t=new r.GlslLibRoutineNode(s[e]);i[s[e]]=t,o.addDependency(t)}}}}preprocess(){const e=this.context.programInfo;let t=e.shaderSource;return this.context.programInfo.hasMain||(t=`${t}\n ${(0,i.getDefaultFragShaderMain)(this.context.glContext.version,this.context.outputTextureLayout.shape.length)}`),t=(0,o.replaceInlines)(t),`${(0,i.getFragShaderPreamble)(this.context.glContext.version)}\n ${this.getUniforms(e.inputNames,e.variables)}\n ${this.getImports(t)}\n ${t}`}getImports(e){const t=this.selectGlslLibRoutinesToBeIncluded(e);if(0===t.length)return"";let n="";for(let r=0;r<t.length;++r){if(!t[r].routineBody)throw new Error(`Missing body for the Glsl Library routine: ${t[r].name}`);n+=t[r].routineBody+"\n"}return n}selectGlslLibRoutinesToBeIncluded(e){const t=[];return Object.keys(this.glslLibRoutineDependencyGraph).forEach(n=>{const r=n.split(".")[1];-1!==e.indexOf(r)&&t.push(this.glslLibRoutineDependencyGraph[n])}),r.TopologicalSortGlslRoutines.returnOrderedNodes(t)}getUniforms(e,t){const n=[];if(e)for(const r of e)n.push(`uniform sampler2D ${r};`);if(t)for(const r of t)n.push(`uniform ${r.type} ${r.name}${r.arrayLength?`[${r.arrayLength}]`:""};`);return n.join("\n")}}},5483:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.glslRegistry=void 0;const r=n(5107),o=n(7341),a=n(9894),i=n(2655),s=n(3891);t.glslRegistry={encoding:o.EncodingGlslLib,fragcolor:a.FragColorGlslLib,vec:s.VecGlslLib,shapeUtils:i.ShapeUtilsGlslLib,coordinates:r.CoordsGlslLib}},2655:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ShapeUtilsGlslLib=void 0;const r=n(8520);class o extends r.GlslLib{constructor(e){super(e)}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.bcastIndex()),this.bcastMatmulIndex()),this.offsetToIndices()),this.indicesToOffset()),this.incrementIndices())}getCustomTypes(){return{}}bcastIndex(){const e=this.context.outputTextureLayout.shape.length,t={};return this.context.programInfo.inputNames.forEach((n,o)=>{const a=this.context.inputTextureLayouts[o].unpackedShape;if(a.length<=e){const o=a.length,i=e-o,s=`bcastIndices_${n}`;let l="";for(let e=0;e<o;++e)l+=`\n realIndices[${e}] = int( mod(float(bcastedIndices[${i+e}]), ${a[e]}.0) );\n `;const u=`\n void ${s} (int bcastedIndices[${e}], out int realIndices[${o}]) {\n ${l}\n }\n `;t[s]=new r.GlslLibRoutine(u)}}),t}bcastMatmulIndex(){const e=this.context.outputTextureLayout.shape.length,t={};return this.context.programInfo.inputNames.forEach((n,o)=>{const a=this.context.inputTextureLayouts[o].shape;if(!(a.length<2||a.length>e)){const o=a.length,i=e-o,s=`bcastMatmulIndices_${n}`;let l="";for(let e=0;e<o-2;++e)l+=`\n realIndices[${e}] = int( mod(float(bcastedIndices[${i+e}]), ${a[e]}.0) );\n `;const u=`\n void ${s}(int bcastedIndices[${e}], out int realIndices[${o}]) {\n ${l}\n realIndices[${o-1}] = bcastedIndices[${e-1}];\n realIndices[${o-2}] = bcastedIndices[${e-2}];\n }\n `;t[s]=new r.GlslLibRoutine(u)}}),t}indicesToOffset(){const e={};return this.context.programInfo.inputNames.forEach((t,n)=>{const a=this.context.inputTextureLayouts[n].shape,i=this.context.inputTextureLayouts[n].strides,s=a.length;let l=`indicesToOffset_${t}`;e[l]=new r.GlslLibRoutine(o.indexToOffsetSingle(l,s,i)),l=`indicesToOffset_${t}_T`,e[l]=new r.GlslLibRoutine(o.indexToOffsetSingle(l,s,i.slice().reverse()))}),e}static indexToOffsetSingle(e,t,n){let r="";for(let o=t-1;o>=0;--o)r+=`\n offset += indices[${o}] * ${n[o]};\n `;return`\n int ${e}(int indices[${t}]) {\n int offset = 0;\n ${r}\n return offset;\n }\n `}offsetToIndices(){const e={};return this.context.programInfo.inputNames.forEach((t,n)=>{const a=this.context.inputTextureLayouts[n].shape,i=this.context.inputTextureLayouts[n].strides,s=a.length;let l=`offsetToIndices_${t}`;e[l]=new r.GlslLibRoutine(o.offsetToIndicesSingle(l,s,i)),l=`offsetToIndices_${t}_T`,e[l]=new r.GlslLibRoutine(o.offsetToIndicesSingle(l,s,i.slice().reverse()))}),e}static offsetToIndicesSingle(e,t,n){const r=[];for(let o=0;o<t-1;++o)r.push(`\n indices[${o}] = offset / ${n[o]};`),r.push(`\n offset -= indices[${o}] * ${n[o]};`);return r.push(`\n indices[${t-1}] = offset;`),`\n void ${e}(int offset, out int indices[${t}]) {\n ${r.join("")}\n }\n `}incrementIndices(){const e={};return this.context.programInfo.inputNames.forEach((t,n)=>{const o=this.context.inputTextureLayouts[n].shape,a=o.length,i=`incrementIndices_${t}`;let s="";for(let e=0;e<a;++e)s+=`\n shape[${e}] = ${o[e]};`;const l=`\n void ${i}(int axis, out int indices[${a}]) {\n int shape[${a}];\n ${s};\n for(int i = ${a} -1 ; i >= 0; --i) {\n if(i > axis) continue;\n indices[i] += 1;\n if(indices[i] < shape[i]) {\n break;\n }\n indices[i] = 0;\n }\n }\n `;e[i]=new r.GlslLibRoutine(l)}),e}}t.ShapeUtilsGlslLib=o},5060:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultFragShaderMain=t.getFragShaderPreamble=t.getVertexShaderSource=t.getGlsl=void 0;const n={version:"",attribute:"attribute",varyingVertex:"varying",varyingFrag:"varying",texture2D:"texture2D",output:"gl_FragColor",outputDeclaration:""},r={version:"#version 300 es",attribute:"in",varyingVertex:"out",varyingFrag:"in",texture2D:"texture",output:"outputColor",outputDeclaration:"out vec4 outputColor;"};function o(e){return 1===e?n:r}t.getGlsl=o,t.getVertexShaderSource=function(e){const t=o(e);return`${t.version}\n precision highp float;\n ${t.attribute} vec3 position;\n ${t.attribute} vec2 textureCoord;\n\n ${t.varyingVertex} vec2 TexCoords;\n\n void main()\n {\n gl_Position = vec4(position, 1.0);\n TexCoords = textureCoord;\n }`},t.getFragShaderPreamble=function(e){const t=o(e);return`${t.version}\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n ${t.varyingFrag} vec2 TexCoords;\n ${t.outputDeclaration}\n const vec2 halfCR = vec2(0.5, 0.5);\n\n // Custom vector types to handle higher dimenalities.\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n `},t.getDefaultFragShaderMain=function(e,t){return`\n void main() {\n int indices[${t}];\n toVec(TexCoords, indices);\n vec4 result = vec4(process(indices));\n ${o(e).output} = result;\n }\n `}},3891:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VecGlslLib=void 0;const r=n(8520);class o extends r.GlslLib{constructor(e){super(e)}getCustomTypes(){return{}}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign({},this.binaryVecFunctions()),this.copyVec()),this.setVecItem()),this.getVecItem())}binaryVecFunctions(){const e=this.context.outputTextureLayout.shape.length,t={add:"+=",sub:"-=",mul:"*=",div:"/="},n={};for(const o in t){const a=`${o}Vec`;let i="";for(let n=0;n<e;++n)i+=`\n dest[${n}] ${t[o]} src[${n}];\n `;const s=`\n void ${a}(int src[${e}], out int dest[${e}]) {\n ${i}\n }\n `;n[a]=new r.GlslLibRoutine(s)}return n}copyVec(){const e=this.context.outputTextureLayout.shape.length;let t="";for(let r=0;r<e;++r)t+=`\n dest[${r}] = src[${r}];\n `;const n=`\n void copyVec(int src[${e}], out int dest[${e}]) {\n ${t}\n }\n `;return{copyVec:new r.GlslLibRoutine(n)}}setVecItem(){const e=this.context.outputTextureLayout.shape.length;let t=`\n if(index < 0)\n index =${e} + index;\n if (index == 0)\n m[0] = value;\n `;for(let r=1;r<e-1;++r)t+=`\n else if (index == ${r})\n m[${r}] = value;\n `;t+=`\n else\n m[${e-1}] = value;\n `;const n=`\n void setVecItem(out int m[${e}], int index, int value) {\n ${t}\n }\n `;return{setVecItem:new r.GlslLibRoutine(n)}}getVecItem(){const e=this.context.outputTextureLayout.shape.length;let t=`\n if(index < 0)\n index = ${e} + index;\n if (index == 0)\n return m[0];\n `;for(let r=1;r<e-1;++r)t+=`\n else if (index == ${r})\n return m[${r}];\n `;t+=`\n else\n return m[${e-1}];\n `;const n=`\n int getVecItem(int m[${e}], int index) {\n ${t}\n }\n `;return{getVecItem:new r.GlslLibRoutine(n)}}}t.VecGlslLib=o},8316:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WebGLInferenceHandler=void 0;const r=n(6231),o=n(9162),a=n(2517),i=n(2403),s=n(7019),l=n(8710),u=n(5611),c=n(4057),d=n(2039);t.WebGLInferenceHandler=class{constructor(e){this.session=e,this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map}calculateTextureWidthAndHeight(e,t){return(0,c.calculateTextureWidthAndHeight)(this.session.layoutStrategy,e,t)}executeProgram(e,t){if(t.length<e.inputNames.length)throw new Error(`Input size mustn't be less than ${e.inputNames.length}.`);if(e.inputNames.length!==e.inputTypes.length)throw new Error("input names size does not match input types");const n=[];for(let l=0;l<e.inputNames.length;++l)n[l]=this.getOrCreateTextureData(t[l],e.inputTypes[l]);const r=((e,t)=>{const n=t.map(e=>`${e.unpackedShape.join(",")};${e.width}x${e.height}`).join("_");let r=e.name;return e.cacheHint&&(r+="["+e.cacheHint+"]"),r+=":"+n,r})(e,n);let o=this.session.programManager.getArtifact(r);const a=o?o.programInfo:"function"==typeof e.get?e.get():e,i=(0,c.createTextureLayoutFromTextureType)(this.session.layoutStrategy,a.output.dims,a.output.textureType),s=this.createTextureData(i,a.output.type);return o||(o=this.session.programManager.build(a,n,s),this.session.programManager.setArtifact(r,o)),this.runProgram(o,n,s),s}run(e,t){return this.executeProgram(e,t).tensor}runProgram(e,t,n){for(let r=0;r<t.length;++r)if(!!t[r].isPacked!=(e.programInfo.inputTypes[r]===d.TextureType.packed))throw new Error(`input[${r}] property packed inconsistent`);if(!!n.isPacked!=(e.programInfo.output.textureType===d.TextureType.packed))throw new Error("output property packed inconsistent");this.session.programManager.run(e,t,n)}getOrCreateTextureData(e,t){let n=this.getTextureData(e.dataId,t===d.TextureType.packed);if(!n&&(n=this.getTextureData(e.dataId,t!==d.TextureType.packed),n))return t===d.TextureType.packed?this.pack(n):this.unpack(n);if(!n){const r=(0,c.createTextureLayoutFromTextureType)(this.session.layoutStrategy,e.dims,t);if(t===d.TextureType.packedLastDimension){const n=1,r=4,o=e.dims;if(4===o.length){const a=[o[0],Math.ceil(o[1]*o[2]*o[3]/r)],i=(0,c.createTextureLayoutFromTextureType)(this.session.layoutStrategy,a,t);let s=e.numberData;if(o[1]*o[2]*o[3]%r!=0){const t=o[0],a=o[1]*o[2]*o[3],i=Math.ceil(a*n/r)*r;s=new Float32Array(t*i);for(let r=0;r<t;++r){const t=r*a,o=r*i+r%n*a;s.set(e.numberData.subarray(t,t+a),o)}}return this.createTextureData(i,e.type,s,e,1)}}if(t===d.TextureType.packed){const t=(0,c.createTextureLayoutFromShape)(this.session.layoutStrategy,e.dims,1,[],{reverseWH:!0}),r=this.createTextureData(t,e.type,e.numberData,e,1);n=this.pack(r)}else n=this.createTextureData(r,e.type,e.numberData,e,1)}return n}createTextureDataFromLayoutBindTensor(e,t,n,r){return this.createTextureData(e,t,n,r,1)}createTextureData(e,t,n,o,a){r.Logger.verbose("InferenceHandler",`Creating TextureData: layout:[${JSON.stringify(e)}]`);const i=this.session.textureManager.createTextureFromLayout(t,e,n,a);return this.createTextureDataFromTexture(e,t,i,o)}reshapeUnpacked(e,t){const n=this.getOrCreateTextureData(e,d.TextureType.unpacked),r={channels:n.channels,height:n.height,width:n.width,shape:0!==t.length?t:[1],strides:a.ShapeUtil.computeStrides(t),unpackedShape:t};return this.createTextureDataFromTexture(r,e.type,n.texture).tensor}reshapePacked(e,t){const n=this.getOrCreateTextureData(e,d.TextureType.packed);if((0,s.isReshapeCheap)(e.dims,t)){const r={channels:n.channels,height:n.height,width:n.width,shape:0!==t.length?t:[1],strides:a.ShapeUtil.computeStrides(t),unpackedShape:t,isPacked:!0};return this.createTextureDataFromTexture(r,e.type,n.texture).tensor}const r=(0,s.processDims3D)(e.dims),o=(0,s.processDims3D)(t),i=this.reshapePacked(e,r),l=this.run((0,s.createPackedReshape3DProgramInfoLoader)(this,i,o),[i]);return this.reshapePacked(l,t)}cast(e,t){const n=this.getOrCreateTextureData(e,d.TextureType.unpacked);return this.createTextureDataFromTexture(n,t,n.texture).tensor}createTextureDataFromTexture(e,t,n,r,a){const i=Object.assign(Object.assign({},e),{tensor:r||new o.Tensor(e.unpackedShape,t,e=>this.readTexture(i),async e=>this.readTextureAsync(i),void 0,a),texture:n});return this.setTextureData(i.tensor.dataId,i,e.isPacked),i}getTextureData(e,t=!1){return this.session.isInitializer(e)?this.session.getTextureData(e,t):t?this.packedTextureDataCache.get(e):this.unpackedTextureDataCache.get(e)}setTextureData(e,t,n=!1){this.session.isInitializer(e)?this.session.setTextureData(e,t,n):(n?this.packedTextureDataCache:this.unpackedTextureDataCache).set(e,t)}isTextureLayoutCached(e,t=!1){return!!this.getTextureData(e.dataId,t)}dispose(){this.session.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach(e=>this.session.textureManager.releaseTexture(e)),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach(e=>this.session.textureManager.releaseTexture(e)),this.unpackedTextureDataCache=new Map}readTexture(e){return e.isPacked?this.readTexture(this.unpack(e)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTexture(e,e.tensor.type,e.channels):this.session.textureManager.readUint8TextureAsFloat((0,l.encodeAsUint8)(this,e))}async readTextureAsync(e){return e.isPacked?this.readTextureAsync(this.unpack(e)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTextureAsync(e,e.tensor.type,e.channels):this.session.textureManager.readUint8TextureAsFloat((0,l.encodeAsUint8)(this,e))}pack(e){return this.executeProgram((0,i.createPackProgramInfoLoader)(this,e.tensor),[e.tensor])}unpack(e){return this.executeProgram((0,u.createUnpackProgramInfoLoader)(this,e.tensor),[e.tensor])}}},1640:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.WEBGL_OP_RESOLVE_RULES=void 0;const i=n(2898),s=a(n(7839)),l=n(4196),u=n(2069),c=n(8138),d=n(9663),f=n(5193),p=n(7992),h=n(1253),m=n(4776),g=n(6572),b=n(3346),y=n(5623),_=n(2870),v=n(2143),w=n(4939),S=n(718),x=n(2268),T=n(8117),E=n(2278),k=n(5524),P=n(5975),O=n(3933),A=n(6558),R=n(5723),$=n(3738),I=a(n(4909)),C=n(8428),D=n(9793);t.WEBGL_OP_RESOLVE_RULES=[["Abs","","6+",I.abs],["Acos","","7+",I.acos],["Add","","7+",s.add],["And","","7+",s.and],["Asin","","7+",I.asin],["Atan","","7+",I.atan],["AveragePool","","7+",v.averagePool,v.parseAveragePoolAttributes],["BatchNormalization","","7+",i.batchNormalization,i.parseBatchNormalizationAttributes],["Cast","","6+",l.cast,l.parseCastAttributes],["Ceil","","6+",I.ceil],["Clip","","6-10",I.clip,I.parseClipAttributes],["Clip","","11+",I.clipV11],["Concat","","4+",u.concat,u.parseConcatAttributes],["Conv","","1+",c.conv,c.parseConvAttributes],["ConvTranspose","","1+",d.convTranspose,d.parseConvTransposeAttributes],["Cos","","7+",I.cos],["Div","","7+",s.div],["Dropout","","7+",I.identity],["DepthToSpace","","1+",f.depthToSpace,f.parseDepthToSpaceAttributes],["Equal","","7+",s.equal],["Elu","","6+",I.elu,I.parseEluAttributes],["Exp","","6+",I.exp],["Flatten","","1+",p.flatten,p.parseFlattenAttributes],["Floor","","6+",I.floor],["FusedConv","com.microsoft","1+",c.conv,c.parseConvAttributes],["Gather","","1+",h.gather,h.parseGatherAttributes],["Gemm","","7-10",m.gemm,m.parseGemmAttributesV7],["Gemm","","11+",m.gemm,m.parseGemmAttributesV11],["GlobalAveragePool","","1+",v.globalAveragePool,v.parseGlobalAveragePoolAttributes],["GlobalMaxPool","","1+",v.globalMaxPool],["Greater","","7+",s.greater],["Identity","","1+",I.identity],["ImageScaler","","1+",g.imageScaler,g.parseImageScalerAttributes],["InstanceNormalization","","6+",b.instanceNormalization,b.parseInstanceNormalizationAttributes],["LeakyRelu","","6+",I.leakyRelu,I.parseLeakyReluAttributes],["Less","","7+",s.less],["Log","","6+",I.log],["MatMul","","1+",y.matMul,y.parseMatMulAttributes],["MaxPool","","1+",v.maxPool,v.parseMaxPoolAttributes],["Mul","","7+",s.mul],["Neg","","6+",I.neg],["Not","","1+",I.not],["Or","","7+",s.or],["Pad","","2-10",_.padV2,_.parsePadAttributesV2],["Pad","","11+",_.padV11,_.parsePadAttributesV11],["Pow","","7+",s.pow],["PRelu","","7+",s.pRelu],["ReduceLogSum","","1+",w.reduceLogSum,w.parseReduceAttributes],["ReduceMax","","1+",w.reduceMax,w.parseReduceAttributes],["ReduceMean","","1+",w.reduceMean,w.parseReduceAttributes],["ReduceMin","","1+",w.reduceMin,w.parseReduceAttributes],["ReduceProd","","1+",w.reduceProd,w.parseReduceAttributes],["ReduceSum","","1-12",w.reduceSum,w.parseReduceAttributes],["ReduceSumSquare","","1+",w.reduceLogSumSquare,w.parseReduceAttributes],["Relu","","6+",I.relu],["Reshape","","5+",S.reshape],["Resize","","10",x.resize,x.parseResizeAttributesV10],["Resize","","11+",x.resize,x.parseResizeAttributesV11],["Shape","","1+",T.shape],["Sigmoid","","6+",I.sigmoid],["Sin","","7+",I.sin],["Slice","","10+",E.sliceV10],["Slice","","1-9",E.slice,E.parseSliceAttributes],["Softmax","","1-12",k.softmax,k.parseSoftmaxAttributes],["Softmax","","13+",k.softmaxV13,k.parseSoftmaxAttributesV13],["Split","","2-12",P.split,P.parseSplitAttributes],["Sqrt","","6+",I.sqrt],["Squeeze","","1-12",O.squeeze,O.parseSqueezeAttributes],["Squeeze","","13+",O.squeezeV13],["Sub","","7+",s.sub],["Sum","","6+",A.sum],["Tan","","7+",I.tan],["Tanh","","6+",I.tanh],["Tile","","6+",R.tile],["Transpose","","1+",$.transpose,$.parseTransposeAttributes],["Upsample","","7-8",D.upsample,D.parseUpsampleAttributesV7],["Upsample","","9",D.upsample,D.parseUpsampleAttributesV9],["Unsqueeze","","1-12",C.unsqueeze,C.parseUnsqueezeAttributes],["Unsqueeze","","13+",C.unsqueezeV13],["Xor","","7+",s.xor]]},2898:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseBatchNormalizationAttributes=t.batchNormalization=void 0;const r=n(246),o=n(5060),a=n(2039),i={name:"BatchNormalization",inputNames:["A","Scale","B","Mean","Variance"],inputTypes:[a.TextureType.unpacked,a.TextureType.unpacked,a.TextureType.unpacked,a.TextureType.unpacked,a.TextureType.unpacked]};t.batchNormalization=(e,t,n)=>(l(t),[e.run(Object.assign(Object.assign({},i),{cacheHint:n.cacheKey,get:()=>s(e,t,n)}),t)]),t.parseBatchNormalizationAttributes=e=>{const t=e.attributes.getFloat("epsilon",1e-5),n=e.attributes.getFloat("momentum",.9),o=e.attributes.getInt("spatial",1);return(0,r.createAttributeWithCacheKey)({epsilon:t,momentum:n,spatial:o})};const s=(e,t,n)=>{const r=(0,o.getGlsl)(e.session.backend.glContext.version),s=t[0].dims.length,[l,u]=e.calculateTextureWidthAndHeight(t[1].dims,a.TextureType.unpacked),c=`\n float process(int[${s}] indices) {\n vec2 position = offsetToCoords(indices[1], ${l}, ${u});\n float scale = getColorAsFloat(${r.texture2D}(Scale, position));\n float mean = getColorAsFloat(${r.texture2D}(Mean, position));\n float variance = getColorAsFloat(${r.texture2D}(Variance, position));\n float b = getColorAsFloat(${r.texture2D}(B, position));\n\n return scale * ( (_A(indices) - mean) / sqrt(variance + float(${n.epsilon})) ) + b;\n }`;return Object.assign(Object.assign({},i),{output:{dims:t[0].dims,type:t[0].type,textureType:a.TextureType.unpacked},shaderSource:c})},l=e=>{if(!e||5!==e.length)throw new Error("BatchNormalization requires 5 inputs.");const t=e[0],n=e[1],r=e[2],o=e[3],a=e[4];if(t.dims.length<3||1!==n.dims.length||1!==r.dims.length||1!==o.dims.length||1!==a.dims.length)throw new Error("invalid input shape.");if(n.dims[0]!==t.dims[1]||r.dims[0]!==t.dims[1]||o.dims[0]!==t.dims[1]||a.dims[0]!==t.dims[1])throw new Error("invalid input shape.");if("float32"!==t.type&&"float64"!==t.type||"float32"!==n.type&&"float64"!==n.type||"float32"!==r.type&&"float64"!==r.type||"float32"!==o.type&&"float64"!==o.type||"float32"!==a.type&&"float64"!==a.type)throw new Error("invalid input tensor types.")}},7839:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.xor=t.sub=t.pRelu=t.pow=t.or=t.mul=t.less=t.greater=t.equal=t.div=t.and=t.add=t.glslPRelu=t.glslPow=t.glslXor=t.glslOr=t.glslAnd=t.glslLess=t.glslGreater=t.glslEqual=t.glslSub=t.glslMul=t.glslDiv=t.glslAdd=void 0;const r=n(2517),o=n(8520),a=n(5060),i=n(2039);function s(){const e="add_";return{body:`\n float ${e}(float a, float b) {\n return a + b;\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return v1 + v2;\n }\n `,name:e,type:o.FunctionType.ValueBased}}function l(){const e="div_";return{body:`\n float ${e}(float a, float b) {\n return a / b;\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return v1 / v2;\n }\n `,name:e,type:o.FunctionType.ValueBased}}function u(){const e="mul_";return{body:`\n float ${e}(float a, float b) {\n return a * b;\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return v1 * v2;\n }\n `,name:e,type:o.FunctionType.ValueBased}}function c(){const e="sub_";return{body:`\n float ${e}(float a, float b) {\n return a - b;\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return v1 - v2;\n }\n `,name:e,type:o.FunctionType.ValueBased}}function d(){const e="equal_";return{body:`\n float ${e}(float a, float b) {\n return float(a == b);\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return vec4(equal(v1, v2));\n }\n `,name:e,type:o.FunctionType.ValueBased}}function f(){const e="greater_";return{body:`\n float ${e}(float a, float b) {\n return float(a > b);\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return vec4( v1.r > v2.r ,\n v1.g > v2.g,\n v1.b > v2.b,\n v1.a > v2.a );\n }\n `,name:e,type:o.FunctionType.ValueBased}}function p(){const e="less_";return{body:`\n float ${e}(float a, float b) {\n return float(a < b);\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return vec4( v1.r < v2.r ,\n v1.g < v2.g,\n v1.b < v2.b,\n v1.a < v2.a );\n }\n `,name:e,type:o.FunctionType.ValueBased}}function h(){const e="and_";return{body:`\n float ${e}(float a, float b) {\n return float( bool(a) && bool(b) );\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r && b2.r ,\n b1.g && b2.g,\n b1.b && b2.b,\n b1.a && b2.a );\n }\n `,name:e,type:o.FunctionType.ValueBased}}function m(){const e="or_";return{body:`\n float ${e}(float a, float b) {\n return float( bool(a) || bool(b) );\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r || b2.r ,\n b1.g || b2.g,\n b1.b || b2.b,\n b1.a || b2.a );\n }\n `,name:e,type:o.FunctionType.ValueBased}}function g(){const e="xor_";return{body:`\n float ${e}(float a, float b) {\n return float( bool(a) ^^ bool(b) );\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r ^^ b2.r ,\n b1.g ^^ b2.g,\n b1.b ^^ b2.b,\n b1.a ^^ b2.a );\n }\n `,name:e,type:o.FunctionType.ValueBased}}function b(){return function(e){const t=`${e}_`;return{body:`\n float ${t}(float a, float b) {\n return ${e}(a, b);\n }\n vec4 ${t}(vec4 v1, vec4 v2) {\n return ${e}(v1, v2);\n }\n `,name:t,type:o.FunctionType.ValueBased}}("pow")}function y(){const e="prelu_";return{body:`\n float ${e}(float a, float b) {\n return a < 0.0 ? a * b: a;\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return vec4(\n v1.r < 0.0 ? v1.r * v2.r: v1.r,\n v1.g < 0.0 ? v1.g * v2.g: v1.g,\n v1.b < 0.0 ? v1.b * v2.b: v1.b,\n v1.a < 0.0 ? v1.a * v2.a: v1.a\n );\n }\n `,name:e,type:o.FunctionType.ValueBased}}t.glslAdd=s,t.glslDiv=l,t.glslMul=u,t.glslSub=c,t.glslEqual=d,t.glslGreater=f,t.glslLess=p,t.glslAnd=h,t.glslOr=m,t.glslXor=g,t.glslPow=b,t.glslPRelu=y;const _=(e,t,n,r=t[0].type,o)=>{const a=e.session.pack?i.TextureType.packed:i.TextureType.unpacked;return{name:n.name,inputNames:["A","B"],inputTypes:[a,a],cacheHint:o,get:()=>v(e,t,n,r)}},v=(e,t,n,o=t[0].type)=>{const s=e.session.pack?i.TextureType.packed:i.TextureType.unpacked,l=!r.ShapeUtil.areEqual(t[0].dims,t[1].dims);let u=t[0].dims;const c=e.session.pack;if(l){const i=r.BroadcastUtil.calcShape(t[0].dims,t[1].dims,!1);if(!i)throw new Error("Can't perform binary op on the given tensors");u=i;const l=u.length,d=0!==t[0].dims.length?t[0].dims.length:1,f=0!==t[1].dims.length?t[1].dims.length:1,p=0!==t[0].dims.length?"bcastIndices_A(indices, aindices);":"aindices[0] = 0;",h=0!==t[1].dims.length?"bcastIndices_B(indices, bindices);":"bindices[0] = 0;",m=(0,a.getGlsl)(e.session.backend.glContext.version),g=c?`\n ${n.body}\n void main() {\n vec4 a = getAAtOutCoords();\n vec4 b = getBAtOutCoords();\n vec4 result = ${n.name}(a, b);\n ${m.output} = result;\n }`:`\n ${n.body}\n float process(int indices[${l}]) {\n int aindices[${d}];\n int bindices[${f}];\n ${p}\n ${h}\n return ${n.name}(_A(aindices), _B(bindices));\n }`;return{name:n.name,inputNames:["A","B"],inputTypes:[s,s],output:{dims:u,type:o,textureType:s},shaderSource:g,hasMain:c}}const d=(0,a.getGlsl)(e.session.backend.glContext.version),f=`\n ${n.body}\n void main() {\n vec4 v1 = ${d.texture2D}(A, TexCoords);\n vec4 v2 = ${d.texture2D}(B, TexCoords);\n vec4 result = ${n.name}(v1, v2);\n ${d.output} = result;\n }\n `;return{name:n.name,inputNames:["A","B"],inputTypes:[s,s],output:{dims:t[0].dims,type:o,textureType:s},shaderSource:f,hasMain:!0}};t.add=(e,t)=>[e.run(_(e,t,s()),t)],t.and=(e,t)=>[e.run(_(e,t,h(),"bool"),t)],t.div=(e,t)=>[e.run(_(e,t,l()),t)],t.equal=(e,t)=>[e.run(_(e,t,d(),"bool"),t)],t.greater=(e,t)=>[e.run(_(e,t,f(),"bool"),t)],t.less=(e,t)=>[e.run(_(e,t,p(),"bool"),t)],t.mul=(e,t)=>[e.run(_(e,t,u()),t)],t.or=(e,t)=>[e.run(_(e,t,m(),"bool"),t)],t.pow=(e,t)=>[e.run(_(e,t,b()),t)],t.pRelu=(e,t)=>[e.run(_(e,t,y()),t)],t.sub=(e,t)=>[e.run(_(e,t,c()),t)],t.xor=(e,t)=>[e.run(_(e,t,g(),"bool"),t)]},4196:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseCastAttributes=t.cast=void 0;const r=n(2517);t.cast=(e,t,n)=>(o(t),[e.cast(t[0],n)]),t.parseCastAttributes=e=>r.ProtoUtil.tensorDataTypeFromProto(e.attributes.getInt("to"));const o=e=>{if(!e||1!==e.length)throw new Error("Cast requires 1 input.");if("string"===e[0].type)throw new Error("Invalid input type.")}},1163:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createPackedConcatProgramInfoLoader=void 0;const r=n(5060),o=n(2039),a=n(9390),i=n(2827);t.createPackedConcatProgramInfoLoader=(e,t,n)=>{const l=(u=t.length,c=n.cacheKey,{name:"Concat (packed)",inputNames:Array.from({length:u},(e,t)=>`X${t}`),inputTypes:Array(u).fill(o.TextureType.packed),cacheHint:c});var u,c;return Object.assign(Object.assign({},l),{get:()=>((e,t,n,l)=>{const u=n[0].dims.slice();if(l>=u.length||l<-1*u.length)throw new Error("axis specified for concat doesn't match input dimensionality");l<0&&(l=u.length+l);const c=u.slice(0);for(let r=1;r<n.length;r++){const e=n[r].dims.slice();for(let t=0;t<u.length;t++)if(t===l)c[l]+=e[t];else if(u[t]!==e[t])throw new Error("non concat dimensions must match")}const d=c.length,f=(0,i.getChannels)("coords",d),p=(0,a.getCoordsDataType)(d),h=(0,i.unpackFromChannel)(),m=n.map(e=>e.dims),g=(0,a.getGlChannels)(d),b=new Array(m.length-1);b[0]=m[0][l];for(let r=1;r<b.length;r++)b[r]=b[r-1]+m[r][l];const y=g[l],_=g.slice(-2),v=g.join();let w=`if (${y} < ${b[0]}) {\n return getChannel(\n getX0(${v}), vec2(${_.join()}));\n }`;for(let r=1;r<b.length;r++){const e=b[r-1];w+=`\n if (${y} < ${b[r]} && ${y} >= ${b[r-1]}) {\n return getChannel(\n getX${r}(${s(g,y,e)}),\n vec2(${s(_,y,e)}));\n }`}const S=b.length,x=b[b.length-1];w+=`\n return getChannel(\n getX${S}(${s(g,y,x)}),\n vec2(${s(_,y,x)}));`;const T=(0,r.getGlsl)(e.session.backend.glContext.version),E=`\n ${h}\n float getValue(${g.map(e=>"int "+e)}) {\n ${w}\n }\n\n void main() {\n ${p} coords = getOutputCoords();\n int lastDim = coords.${g[d-1]};\n coords.${g[d-1]} = coords.${g[d-2]};\n coords.${g[d-2]} = lastDim;\n\n vec4 result = vec4(getValue(${f}), 0., 0., 0.);\n\n ${f[d-1]} = ${f[d-1]} + 1;\n if (${f[d-1]} < ${c[d-1]}) {\n result.g = getValue(${f});\n }\n\n ${f[d-2]} = ${f[d-2]} + 1;\n if (${f[d-2]} < ${c[d-2]}) {\n result.a = getValue(${f});\n }\n\n ${f[d-1]} = ${f[d-1]} - 1;\n if (${f[d-2]} < ${c[d-2]} &&\n ${f[d-1]} < ${c[d-1]}) {\n result.b = getValue(${f});\n }\n ${T.output} = result;\n }\n `;return Object.assign(Object.assign({},t),{output:{dims:c,type:n[0].type,textureType:o.TextureType.packed},shaderSource:E,hasMain:!0})})(e,l,t,n.axis)})};const s=(e,t,n)=>{const r=e.indexOf(t);return e.map((e,t)=>t===r?`${e} - ${n}`:e).join()}},2069:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseConcatAttributes=t.concat=void 0;const r=n(246),o=n(2039),a=n(1163);t.concat=(e,t,n)=>(d(t),e.session.pack&&t[0].dims.length>1?[e.run((0,a.createPackedConcatProgramInfoLoader)(e,t,n),t)]:[e.run(i(e,t,n),t)]);const i=(e,t,n)=>{const r=(a=t.length,i=n.cacheKey,{name:"Concat",inputNames:Array.from({length:a},(e,t)=>`X${t}`),inputTypes:Array(a).fill(o.TextureType.unpacked),cacheHint:i});var a,i;return Object.assign(Object.assign({},r),{get:()=>((e,t,n,r)=>{const a=n[0].dims.slice();if(r>=a.length||r<-1*a.length)throw new Error("axis specified for concat doesn't match input dimensionality");r<0&&(r=a.length+r);const i=a.slice(0);for(let o=1;o<n.length;o++){const e=n[o].dims.slice();for(let t=0;t<a.length;t++)if(t===r)i[r]+=e[t];else if(a[t]!==e[t])throw new Error("non concat dimensions must match")}const d=i.length,f=new Array(n.length);let p=0;for(let o=0;o<f.length;++o)p+=n[o].dims[r],f[o]=p;let h="";h=n.length<5?s(f):l(f);const m=`\n ${u(n.length,d)}\n ${c(f)}\n ${h}\n float process(int indices[${d}]) {\n int textureIndex = getTextureWhereDataResides (indices[${r}]);\n\n if(textureIndex != 0) {\n indices[${r}] = indices[${r}] - int(getSizeInConcatAxisValueFromIndex(textureIndex-int(1)));\n }\n\n return fetchDataFromCorrectTexture(textureIndex, indices);\n }`;return Object.assign(Object.assign({},t),{output:{dims:i,type:n[0].type,textureType:o.TextureType.unpacked},shaderSource:m})})(0,r,t,n.axis)})},s=e=>`int getTextureWhereDataResides(int index) {\n ${e.map((e,t)=>`if(index<${e}) {return ${t};}\n`).join("")}\n }`,l=e=>s(e),u=(e,t)=>{const n=[`float fetchDataFromCorrectTexture(int textureIndex, int indices[${t}]) {`];for(let r=0;r<e;++r)0===r?n.push(`\tif (textureIndex == ${r}) { return _X${r}(indices); }`):r===e-1?n.push(`\telse { return _X${r}(indices); }`):n.push(`\telse if (textureIndex == ${r}) { return _X${r}(indices); }`);return n.push("\t}"),n.join("\n")},c=e=>{const t=["int getSizeInConcatAxisValueFromIndex(int index) {"];for(let n=0;n<e.length;++n)0===n?t.push(`\tif (index == ${n}) { return ${e[n]}; }`):n===e.length-1?t.push(`\telse { return ${e[n]}; }`):t.push(`\telse if (index == ${n}) { return ${e[n]}; }`);return t.push("\t}"),t.join("\n")};t.parseConcatAttributes=e=>(0,r.createAttributeWithCacheKey)({axis:e.attributes.getInt("axis")});const d=e=>{if(!e||e.length<1)throw new Error("too few inputs");const t=e[0].type,n=e[0].dims.length;if("string"===t)throw new Error("string tensor is not supported yet");for(const r of e){if(r.type!==t)throw new Error("input tensors should be one type");if(r.dims.length!==n)throw new Error("input tensors should have the same shape")}}},4770:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createUnpackedGroupedConvProgramInfoLoader=void 0;const r=n(6231),o=n(5060),a=n(2039),i=n(8138),s=n(2823);t.createUnpackedGroupedConvProgramInfoLoader=(e,t,n)=>{const l=(u=t.length>2,c=n.cacheKey,{name:"GroupedConv",inputNames:u?["X","W","Bias"]:["X","W"],inputTypes:u?[a.TextureType.unpacked,a.TextureType.unpacked,a.TextureType.unpacked]:[a.TextureType.unpacked,a.TextureType.unpacked],cacheHint:c});var u,c;return Object.assign(Object.assign({},l),{get:()=>((e,t,n,l)=>{const u=t.length>2?"value += getBias(output_channel);":"",c=t[0].dims.slice(),d=t[1].dims.slice(),f=d[0]/l.group;r.Logger.verbose("GroupedConv",`autpPad:${l.autoPad}, dilations:${l.dilations}, group:${l.group}, kernelShape:${l.kernelShape}, pads:${l.pads}, strides:${l.strides}`);const p=(0,i.calculateOutputShape)(c,d,l.dilations,l.pads,l.strides),h=(0,o.getGlsl)(e.session.backend.glContext.version),{activationFunction:m,applyActivation:g}=(0,s.getActivationSnippet)(l),b=`\n const ivec2 strides = ivec2(${l.strides[0]}, ${l.strides[1]});\n const ivec2 pads = ivec2(${l.pads[0]}, ${l.pads[1]});\n ${m}\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int output_channel = coords.y;\n ivec2 xRCCorner = coords.zw * strides - pads;\n int group_id = output_channel / ${f};\n\n float value = 0.0;\n for (int wInChannel = 0; wInChannel < ${d[1]}; wInChannel++) {\n int input_channel = group_id * ${d[1]} + wInChannel;\n for (int wHeight = 0; wHeight < ${d[2]}; wHeight++) {\n int xHeight = xRCCorner.x + wHeight * ${l.dilations[0]};\n\n if (xHeight < 0 || xHeight >= ${c[2]}) {\n continue;\n }\n\n for (int wWidth = 0; wWidth < ${d[3]}; wWidth++) {\n int xWidth = xRCCorner.y + wWidth * ${l.dilations[1]};\n if (xWidth < 0 || xWidth >= ${c[3]}) {\n continue;\n }\n\n float xVal = getX(batch, input_channel, xWidth, xHeight);\n float wVal = getW(output_channel, wInChannel, wWidth, wHeight);\n value += xVal*wVal;\n }\n }\n }\n ${u}\n ${g}\n ${h.output} = vec4(value, .0, .0, .0);\n }\n`;return Object.assign(Object.assign({},n),{output:{dims:p,type:t[0].type,textureType:a.TextureType.unpacked},shaderSource:b,hasMain:!0})})(e,t,l,n)})}},1386:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.conv2DPacked=t.conv2DPackedPointwise=void 0;const r=n(8138),o=n(8555),a=n(708);t.conv2DPackedPointwise=(e,t,n)=>{const o=t[0].dims,i=t[1].dims,s=(0,r.calculateOutputShape)(o,i,n.dilations,n.pads,n.strides),l=e.reshapePacked(t[0],[o[1],o[2]*o[3]]),u=e.reshapePacked(t[1],[i[0],i[1]]),c=t.length>2?[u,l,t[2]]:[u,l],d=e.run((0,a.createPackedMatmulProgramInfoLoader)(e,c,n),c);return e.reshapePacked(d,s)},t.conv2DPacked=(e,t,n)=>{const i=t[0].dims,s=t[1].dims,l=(0,r.calculateOutputShape)(i,s,n.dilations,n.pads,n.strides),u=e.run((0,o.createPackedIm2ColProgramInfoLoader)(e,t[0],t[1],l,n),[t[0]]),c=e.reshapePacked(t[1],[s[0],s[1]*s[2]*s[3]]),d=3===t.length?[c,u,t[2]]:[c,u],f=e.run((0,a.createPackedMatmulProgramInfoLoader)(e,d,n),d);return e.reshapePacked(f,l)}},9663:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseConvTransposeAttributes=t.convTranspose=void 0;const r=n(246),o=n(5060),a=n(2039),i=n(2823),s=(e,t,n,r,o,a)=>(e-1)*t+n+(r-1)*o+1-a,l=(e,t,n,r,o)=>{const a=Math.floor(e/2);"SAME_UPPER"===t?(n[r]=a,n[o]=e-a):"SAME_LOWER"===t&&(n[r]=e-a,n[o]=a)};t.convTranspose=(e,t,n)=>(f(t,n),u(e,t,n));const u=(e,t,n)=>{const r=d(n,t);return[c(e,t,r)]},c=(e,t,n)=>e.run(((e,t,n)=>{const r=(s=t.length>2,l=n.cacheKey,{name:"ConvTranspose",inputNames:s?["X","W","B"]:["X","W"],inputTypes:s?[a.TextureType.unpacked,a.TextureType.unpacked,a.TextureType.unpacked]:[a.TextureType.unpacked,a.TextureType.unpacked],cacheHint:l});var s,l;return Object.assign(Object.assign({},r),{get:()=>((e,t,n,r)=>{const s=t.length>2?"getB(output_channel)":"0.0",l=t[0].dims,u=t[1].dims,c=u[1],d=u[0]/r.group,f=[t[0].dims[0],t[1].dims[1]*r.group,...r.outputShape],p=(0,o.getGlsl)(e.session.backend.glContext.version),{activationFunction:h,applyActivation:m}=(0,i.getActivationSnippet)(r),g=`\n const ivec2 strides = ivec2(${r.strides[0]}, ${r.strides[1]});\n const ivec2 pads = ivec2(${r.pads[0]}, ${r.pads[1]});\n ${h}\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int output_channel = coords.y;\n\n ivec2 loc = coords.zw + pads;\n\n int group_id = output_channel / ${c};\n int wOutChannel = output_channel - group_id * ${c};\n\n float value = ${s};\n for (int inChannelOffset = 0; inChannelOffset < ${d}; inChannelOffset++) {\n int input_channel = group_id * ${d} + inChannelOffset;\n for (int wWOff = 0; wWOff < ${u[2]}; wWOff++) {\n for (int wHOff = 0; wHOff < ${u[3]}; wHOff++) {\n ivec2 wOff = ivec2(wWOff * ${r.dilations[0]}, wHOff * ${r.dilations[1]});\n ivec2 wLoc = loc - wOff;\n ivec2 wLocIn = wLoc / strides;\n if (\n wLocIn * strides == wLoc &&\n wLocIn.x >= 0 && wLocIn.x < ${l[2]} &&\n wLocIn.y >= 0 && wLocIn.y < ${l[3]}\n ) {\n float xVal = getX(batch, input_channel, wLocIn.y, wLocIn.x);\n float wVal = getW(input_channel, wOutChannel, wHOff, wWOff);\n value += xVal * wVal;\n }\n }\n }\n }\n ${m}\n ${p.output} = vec4(value, .0, .0, .0);\n }\n`;return Object.assign(Object.assign({},n),{output:{dims:f,type:t[0].type,textureType:a.TextureType.unpacked},shaderSource:g,hasMain:!0})})(e,t,r,n)})})(e,t,n),t),d=(e,t)=>{const n=e.kernelShape.slice();if(0===e.kernelShape.length)for(let i=2;i<t[1].dims.length;++i)n.push(t[1].dims[i]);const r=e.pads.slice(),o=e.outputShape.slice();((e,t,n,r,o,a,i,u)=>{const c=e.length-2,d=0===u.length;for(let f=0;f<c;++f){const p=d?e[f+2]*a[f]:u[f],h=s(e[f+2],a[f],o[f],t[f],n[f],p);l(h,r,o,f,f+c),d&&u.push(a[f]*(e[f+2]-1)+i[f]+(t[f]-1)*n[f]+1-o[f]-o[f+c])}})(t[0].dims,n,e.dilations,e.autoPad,r,e.strides,e.outputPadding,o);const a=Object.assign({},e);return Object.assign(a,{kernelShape:n,pads:r,outputShape:o,cacheKey:e.cacheKey}),a};t.parseConvTransposeAttributes=e=>{const t=e.attributes,n=(0,i.parseInternalActivationAttributes)(t),o=t.getString("auto_pad","NOTSET"),a=t.getInts("dilations",[1,1]),s=t.getInt("group",1),l=t.getInts("kernel_shape",[]),u=t.getInts("output_padding",[0,0]),c=t.getInts("output_shape",[]),d=t.getInts("pads",[0,0,0,0]),f=t.getInts("strides",[1,1]);return(0,r.createAttributeWithCacheKey)(Object.assign({autoPad:o,dilations:a,group:s,kernelShape:l,outputPadding:u,outputShape:c,pads:d,strides:f},n))};const f=(e,t)=>{if(!e||2!==e.length&&3!==e.length)throw new Error("Conv requires 2 or 3 inputs");if(4!==e[0].dims.length||4!==e[1].dims.length)throw new Error("currently only support 2-dimensional conv");if(e[0].dims[1]!==e[1].dims[0])throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");const n=e[1].dims[1]*t.group;if(3===e.length&&(1!==e[2].dims.length||e[2].dims[0]!==n))throw new Error("invalid bias");const r=e[0].dims.length-2;if(t.dilations.length!==r)throw new Error(`dilations should be ${r}D`);if(t.strides.length!==r)throw new Error(`strides should be ${r}D`);if(t.pads.length!==2*r)throw new Error(`pads should be ${2*r}D`);if(t.outputPadding.length!==r)throw new Error(`output_padding should be ${r}D`);if(0!==t.kernelShape.length&&t.kernelShape.length!==e[1].dims.length-2)throw new Error("invalid kernel shape");if(0!==t.outputShape.length&&t.outputShape.length!==e[0].dims.length-2)throw new Error("invalid output shape");if("float32"!==e[0].type||"float32"!==e[1].type)throw new Error("ConvTranspose input(X,W) should be float tensor");if(3===e.length&&"float32"!==e[2].type)throw new Error("ConvTranspose input(bias) should be float tensor")}},8138:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseConvAttributes=t.conv=t.calculateOutputShape=void 0;const r=n(246),o=n(2517),a=n(4770),i=n(1386),s=n(9828),l=n(2823),u=n(3248),c=n(5623);t.calculateOutputShape=(e,t,n,r,o)=>{const a=e[0],i=e.slice(2),s=i.length,l=t[0],u=t.slice(2).map((e,t)=>e+(e-1)*(n[t]-1)),c=i.map((e,t)=>e+r[t]+r[t+s]).map((e,t)=>Math.floor((e-u[t]+o[t])/o[t]));return[a,l].concat(...c)},t.conv=(e,t,n)=>(m(t,n),d(e,t,n));const d=(e,t,n)=>{const r=h(n,t),o=e.session.pack,s=1===r.kernelShape[0]&&1===r.kernelShape[1];return r.group>1?[e.run((0,a.createUnpackedGroupedConvProgramInfoLoader)(e,t,r),t)]:s&&o?[f(e,t,r)]:o&&4===t[0].dims.length&&1===t[0].dims[0]&&!s?[(0,i.conv2DPacked)(e,t,r)]:[p(e,t,r)]},f=(e,n,r)=>{const o=n[0].dims,a=n[1].dims,i=(0,t.calculateOutputShape)(o,a,r.dilations,r.pads,r.strides),s=e.reshapeUnpacked(n[0],[o[1],o[2]*o[3]]),l=e.reshapeUnpacked(n[1],[a[0],a[1]]),u=n.length>2?[l,s,n[2]]:[l,s],d=e.run((0,c.createMatmulProgramInfoLoader)(u,r),u);return e.reshapeUnpacked(d,i)},p=(e,n,r)=>{const o=n[0].dims,a=n[1].dims,i=(0,t.calculateOutputShape)(o,a,r.dilations,r.pads,r.strides),l=e.run((0,u.createIm2ColProgramInfoLoader)(e,n[0],n[1],i,r),[n[0]]),c=3===n.length?[l,n[1],n[2]]:[l,n[1]];return e.run((0,s.createDotProductProgramInfoLoader)(e,n,i,r),c)},h=(e,t)=>{const n=e.kernelShape.slice();if(0===e.kernelShape.length)for(let o=2;o<t[1].dims.length;++o)n.push(t[1].dims[o]);const r=e.pads.slice();o.PoolConvUtil.adjustPadsBasedOnAutoPad(t[0].dims,e.strides,e.dilations,n,r,e.autoPad);const a=Object.assign({},e);return Object.assign(a,{kernelShape:n,pads:r,cacheKey:e.cacheKey}),a};t.parseConvAttributes=e=>{const t=e.attributes,n=(0,l.parseInternalActivationAttributes)(t),o=t.getString("auto_pad","NOTSET"),a=t.getInts("dilations",[1,1]),i=t.getInt("group",1),s=t.getInts("kernel_shape",[]),u=t.getInts("pads",[0,0,0,0]),c=t.getInts("strides",[1,1]);return(0,r.createAttributeWithCacheKey)(Object.assign({autoPad:o,dilations:a,group:i,kernelShape:s,pads:u,strides:c},n))};const m=(e,t)=>{if(!e||2!==e.length&&3!==e.length)throw new Error("Conv requires 2 or 3 inputs");if(4!==e[0].dims.length||4!==e[1].dims.length)throw new Error("currently only support 2-dimensional conv");if(e[0].dims[1]!==e[1].dims[1]*t.group)throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");if(3===e.length&&(1!==e[2].dims.length||e[1].dims[0]!==e[2].dims[0]))throw new Error("invalid bias");const n=e[0].dims.length-2;if(t.dilations.length!==n)throw new Error(`dilations should be ${n}D`);if(t.strides.length!==n)throw new Error(`strides should be ${n}D`);if(t.pads.length!==2*n)throw new Error(`pads should be ${2*n}D`);if(0!==t.kernelShape.length&&t.kernelShape.length!==e[1].dims.length-2)throw new Error("invalid kernel shape");if("float32"!==e[0].type||"float32"!==e[1].type)throw new Error("Conv input(X,W) should be float tensor");if(3===e.length&&"float32"!==e[2].type)throw new Error("Conv input(bias) should be float tensor")}},5193:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseDepthToSpaceAttributes=t.depthToSpace=void 0;const r=n(3738);t.depthToSpace=(e,t,n)=>{o(t);const a=n.blocksize,i=a*a,s="DCR"===n.mode?[0,3,4,1,5,2]:[0,1,4,2,5,3],l="DCR"===n.mode?[t[0].dims[0],a,a,t[0].dims[1]/i,t[0].dims[2],t[0].dims[3]]:[t[0].dims[0],t[0].dims[1]/i,a,a,t[0].dims[2],t[0].dims[3]],u=e.reshapeUnpacked(t[0],l),c={perm:s,cacheKey:`${s}`},[d]=(0,r.transpose)(e,[u],c),f=[t[0].dims[0],t[0].dims[1]/i,t[0].dims[2]*a,t[0].dims[3]*a];return[e.reshapeUnpacked(d,f)]},t.parseDepthToSpaceAttributes=e=>{const t=e.attributes.getInt("blocksize");if(t<1)throw new Error(`blocksize must be >= 1, but got : ${t} for DepthToSpace`);const n=e.attributes.getString("mode","DCR");if("DCR"!==n&&"CRD"!==n)throw new Error(`unrecognized mode: ${n} for DepthToSpace`);return{mode:n,blocksize:t}};const o=e=>{if(1!==e.length)throw new Error(`DepthToSpace expect 1 inputs, but got ${e.length}`);if("string"===e[0].type||4!==e[0].dims.length)throw new TypeError("DepthToSpace input should be a 4-D numeric tensor")}},9828:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDotProductProgramInfoLoader=void 0;const r=n(2517),o=n(5060),a=n(2039),i=n(2823),s=n(3248);t.createDotProductProgramInfoLoader=(e,t,n,l)=>{const u=(c=t.length>2,d=l,{name:"ConvDotProduct",inputNames:c?["Im2Col","K","B"]:["Im2Col","K"],inputTypes:c?[a.TextureType.unpacked,a.TextureType.packedLastDimension,a.TextureType.unpacked]:[a.TextureType.unpacked,a.TextureType.packedLastDimension],cacheKey:d.activationCacheKey});var c,d;return Object.assign(Object.assign({},u),{get:()=>((e,t,n,l,u)=>{const c=n[0].dims,d=n[1].dims,f=[d[0],Math.ceil(c[1]*d[2]*d[3]/4)],p=(0,s.calculateIm2ColDims)(c,d,l),[h,m]=e.calculateTextureWidthAndHeight(f,a.TextureType.packedLastDimension),g=r.ShapeUtil.computeStrides(p),[b,y]=e.calculateTextureWidthAndHeight(p,a.TextureType.packedLastDimension),_=l.length,v=n.length<3?"0.0":"_B(b)",w=Math.ceil(c[1]*d[2]*d[3]/4),{activationFunction:S,applyActivation:x}=(0,i.getActivationSnippet)(u),T=(0,o.getGlsl)(e.session.backend.glContext.version),E=`\n${S}\nfloat process(int indices[${_}]) {\n int b[1];\n b[0] = indices[1];\n int im2col[4];\n im2col[0] = indices[0];\n im2col[1] = indices[2];\n im2col[2] = indices[3];\n int im2colOffset = im2col[0] * ${g[0]} + im2col[1] * ${g[1]} + im2col[2] * ${g[2]};\n int kernelOffset = indices[1] * ${f[1]};\n float value = ${v};\n for (int i = 0; i < ${w}; ++i) {\n vec2 im2colCoords = offsetToCoords(im2colOffset, ${b}, ${y});\n vec2 kernelCoords = offsetToCoords(kernelOffset, ${h}, ${m});\n value += dot(${T.texture2D}(Im2Col, im2colCoords), ${T.texture2D}(K, kernelCoords));\n ++im2colOffset;\n ++kernelOffset;\n }\n ${x}\n return value;\n}`;return Object.assign(Object.assign({},t),{output:{dims:l,type:n[0].type,textureType:a.TextureType.unpacked},shaderSource:E})})(e,u,t,n,l)})}},7992:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseFlattenAttributes=t.flatten=void 0;const r=n(2517);t.flatten=(e,t,n)=>{o(t,n);const a=r.ShapeUtil.flattenShape(t[0].dims,n);return[e.reshapeUnpacked(t[0],a)]},t.parseFlattenAttributes=e=>e.attributes.getInt("axis",1);const o=(e,t)=>{if(!e||1!==e.length)throw new Error("Flatten requires 1 input.");const n=e[0].dims.length;if(0===n)throw new Error("scalar tensor is not supported.");if(t<-n||t>n)throw new Error("Invalid axis");if("string"===e[0].type)throw new Error("string tensor is not supported.")}},2823:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseInternalActivationAttributes=t.getActivationSnippet=void 0;const r=n(2517),o=n(4909);t.getActivationSnippet=function(e){let t;switch(e.activation){case"Relu":t=(0,o.glslRelu)();break;case"Sigmoid":t=(0,o.glslSigmoid)();break;case"Clip":t=(0,o.glslClip)(e.clipMin,e.clipMax);break;default:return{activationFunction:"",applyActivation:""}}const n=t.name;return{activationFunction:t.body,applyActivation:`value = ${n}_(value);`}},t.parseInternalActivationAttributes=e=>{const t=e.getString("activation","");if("Clip"===t){const[n,o]=e.getFloats("activation_params",[r.MIN_CLIP,r.MAX_CLIP]);return{activation:t,clipMax:o,clipMin:n,activationCacheKey:`${t}:${n},${o}`}}return{activation:t,activationCacheKey:t}}},1253:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseGatherAttributes=t.gather=void 0;const r=n(246),o=n(782),a=n(2517),i=n(2039);t.gather=(e,t,n)=>(u(t,n.axis),[e.run(l(e,t,n),t)]),t.parseGatherAttributes=e=>(0,r.createAttributeWithCacheKey)({axis:e.attributes.getInt("axis",0)});const s={name:"Gather",inputNames:["A","B"],inputTypes:[i.TextureType.unpacked,i.TextureType.unpacked]},l=(e,t,n)=>{const r=Object.assign(Object.assign({},s),{cacheHint:n.cacheKey});return Object.assign(Object.assign({},r),{get:()=>((e,t,n,r)=>{const o=n[0].dims.slice(),s=n[1].dims.slice(),l=new Array(o.length+s.length-1);r=a.ShapeUtil.normalizeAxis(r,o.length);const u=[];for(let a=0;a<l.length;a++)a<r?(l[a]=o[a],u.push(`inputIdx[${a}] = outputIdx[${a}];`)):a<r+s.length?(l[a]=s[a-r],u.push(`indexDataIdx[${a-r}] = outputIdx[${a}];`)):(l[a]=o[a-s.length+1],u.push(`inputIdx[${a-s.length+1}] = outputIdx[${a}];`));const c=`\n float process(int outputIdx[${l.length||1}]) {\n int inputIdx[${o.length}];\n int indexDataIdx[${s.length||1}];\n indexDataIdx[0] = 0;\n ${u.join("\n ")}\n int idx = int(_B(indexDataIdx));\n inputIdx[${r}] = idx < 0 ? idx + ${o[r]} : idx;\n return _A(inputIdx);\n }`;return Object.assign(Object.assign({},t),{output:{dims:l,type:n[0].type,textureType:i.TextureType.unpacked},shaderSource:c})})(0,r,t,n.axis)})},u=(e,t)=>{if(!e||2!==e.length)throw new Error("Gather requires 2 inputs.");const n=e[0].dims.length;if(n<1)throw new Error("Invalid input shape.");if(t<-n||t>n-1)throw new Error("Invalid axis.");if(-1===o.NUMBER_TYPES.indexOf(e[0].type))throw new Error("Invaid input type.");if("int32"!==e[1].type&&"int16"!==e[1].type)throw new Error("Invaid input type.")}},4776:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseGemmAttributesV11=t.parseGemmAttributesV7=t.gemm=void 0;const r=n(246),o=n(2517),a=n(2039);t.gemm=(e,t,n)=>(u(t,n),[e.run(s(t,n),t)]);const i=(e,t)=>{const n=0!==e.attributes.getInt("transA",0),o=0!==e.attributes.getInt("transB",0),a=e.attributes.getFloat("alpha",1),i=e.attributes.getFloat("beta",1);return(0,r.createAttributeWithCacheKey)({transA:n,transB:o,alpha:a,beta:i,isOptionalC:t})};t.parseGemmAttributesV7=e=>i(e,!1),t.parseGemmAttributesV11=e=>i(e,!0);const s=(e,t)=>{const n={name:"Gemm",inputNames:3===e.length?["A","B","C"]:["A","B"],inputTypes:3===e.length?[a.TextureType.unpacked,a.TextureType.unpacked,a.TextureType.unpacked]:[a.TextureType.unpacked,a.TextureType.unpacked],key:t.cacheKey};return Object.assign(Object.assign({},n),{get:()=>l(n,e,t)})},l=(e,t,n)=>{const r=t[0].dims.slice(),i=t[1].dims.slice(),[s,l]=o.GemmUtil.getShapeOfGemmResult(r,n.transA,i,n.transB,3===t.length?t[2].dims:void 0),u=[s,l];if(!u)throw new Error("Can't use gemm on the given tensors");let c=r[r.length-1],d="";n.transA&&(c=r[0]),n.transA&&n.transB?d="value += _A_T(a) * _B_T(b);":n.transA&&!n.transB?d="value += _A_T(a) * _B(b);":!n.transA&&n.transB?d="value += _A(a) * _B_T(b);":n.transA||n.transB||(d="value += _A(a) * _B(b);");const f=u.length,p=`\n float process(int indices[${f}]) {\n int a[${f}];\n int b[${f}];\n ${3===t.length?`int c[${t[2].dims.length}];`:""}\n\n copyVec(indices, a);\n copyVec(indices, b);\n ${3===t.length?"bcastIndices_C(indices, c);":""}\n\n float value = 0.0;\n for (int k=0; k<${c}; ++k) {\n a[${f-1}] = k;\n b[${f-2}] = k;\n ${d}\n }\n\n value = value * alpha;\n ${3===t.length?"value += beta * _C(c);":""}\n return value;\n }`;return Object.assign(Object.assign({},e),{output:{dims:u,type:t[0].type,textureType:a.TextureType.unpacked},variables:[{name:"alpha",type:"float",data:n.alpha},{name:"beta",type:"float",data:n.beta}],shaderSource:p})},u=(e,t)=>{if(!e)throw new Error("Input is missing");if(t.isOptionalC&&(e.length<2||e.length>3))throw new Error("Invaid input shape.");if(!t.isOptionalC&&3!==e.length)throw new Error("Gemm requires 3 inputs");if(3===e.length&&1!==e[2].dims.length&&2!==e[2].dims.length)throw new Error("Invalid input shape of C");if("float32"!==e[0].type&&"float64"!==e[0].type||"float32"!==e[1].type&&"float64"!==e[1].type||3===e.length&&"float32"!==e[2].type&&"float64"!==e[2].type)throw new Error("Invalid input type.");if(e[0].type!==e[1].type||3===e.length&&e[0].type!==e[2].type)throw new Error("Input types are mismatched")}},8555:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createPackedIm2ColProgramInfoLoader=void 0;const r=n(5060),o=n(2039),a=n(2827);t.createPackedIm2ColProgramInfoLoader=(e,t,n,i,s)=>{const l=(u=s.cacheKey,{name:"Im2Col (packed)",inputNames:["A"],inputTypes:[o.TextureType.packed],cacheHint:u});var u;return Object.assign(Object.assign({},l),{get:()=>((e,t,n,i,s,l)=>{const u=n.dims,c=i.dims,d=s.length,f=[c[1]*c[2]*c[3],s[2]*s[3]],p=c[2]*c[3],h=(0,a.unpackFromChannel)(),m=(0,r.getGlsl)(e.session.backend.glContext.version);let g="";for(let r=0;r<=1;r++)for(let e=0;e<=1;e++)g+=`\n blockIndex = rc.x + ${e};\n pos = rc.y + ${r};\n\n if(blockIndex < ${f[1]} && pos < ${f[0]}) {\n offsetY = int(blockIndex / (${s[d-1]})) * ${l.strides[0]} -\n ${l.pads[0]};\n d0 = offsetY + ${l.dilations[0]} * (imod(pos, ${p}) / ${c[2]});\n\n if(d0 < ${u[2]} && d0 >= 0) {\n offsetX = imod(blockIndex, ${s[d-1]}) * ${l.strides[1]} -\n ${l.pads[1]};\n d1 = offsetX + ${l.dilations[1]} * imod(imod(pos, ${p}), ${c[2]});\n\n if(d1 < ${u[3]} && d1 >= 0) {\n\n ch = int(float(pos)/ ${p}.);\n innerDims = vec2(d0, d1);\n result[${2*r+e}] = getChannel(\n getA(0, ch, int(innerDims.x),\n int(innerDims.y)), innerDims);\n }\n }\n }\n\n `;const b=`\n ${h}\n\n void main() {\n ivec2 rc = getOutputCoords();\n vec4 result = vec4(0.0);\n int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\n vec2 innerDims;\n ${g}\n ${m.output} = result;\n }\n `;return Object.assign(Object.assign({},t),{output:{dims:f,type:n.type,textureType:o.TextureType.packed},shaderSource:b,hasMain:!0})})(e,l,t,n,i,s)})}},3248:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.calculateIm2ColDims=t.createIm2ColProgramInfoLoader=void 0;const r=n(2039);t.createIm2ColProgramInfoLoader=(e,n,o,a,i)=>{const s=(l=i.cacheKey,{name:"Im2Col",inputNames:["X"],inputTypes:[r.TextureType.unpacked],cacheHint:l});var l;return Object.assign(Object.assign({},s),{get:()=>((e,n,o,a,i,s)=>{const l=o.dims,u=a.dims,c=i.length,d=(0,t.calculateIm2ColDims)(l,u,i,4),f=`\n const int XC = ${l[1]};\n const int XH = ${l[2]};\n const int XW = ${l[3]};\n const int KH = ${s.kernelShape[0]};\n const int KW = ${s.kernelShape[1]};\n const int dilationH = ${s.dilations[0]};\n const int dilationW = ${s.dilations[1]};\n const int strideH = ${s.strides[0]};\n const int strideW = ${s.strides[1]};\n const int padH = ${s.pads[0]};\n const int padW = ${s.pads[1]};\n const int KHKW = KH*KW;\n const int XCKHKW = XC * KHKW;\n const int outputChannels = 4;\n vec4 process(int indices[${c}]) {\n int b = indices[0]; // batch size\n int oh = indices[1] * strideH - padH; //output height\n int ow = indices[2] * strideW - padW; //output width\n int p = indices[3] * outputChannels; //patch\n vec4 value = vec4(0.0);\n for(int i=0; i < outputChannels; ++i) {\n if(p < XCKHKW) {\n int patchC = p / KHKW;\n int patchH = (p - patchC*KHKW) / KW;\n int patchW = (p - patchC*KHKW) - patchH * KW;\n int xh2 = oh + patchH * dilationH;\n int xw2 = ow + patchW * dilationW;\n int x[${l.length}];\n x[0] = b;\n x[1] = patchC;\n x[2] = xh2;\n x[3] = xw2;\n if(xh2 >= 0 &&\n xh2 < XH &&\n xw2 >= 0 &&\n xw2 < XW) {\n value[i] = _X(x);\n }\n }\n ++p;\n }\n return value;\n }\n `;return Object.assign(Object.assign({},n),{output:{dims:d,type:o.type,textureType:r.TextureType.packedLastDimension},shaderSource:f})})(0,s,n,o,a,i)})},t.calculateIm2ColDims=(e,t,n,r=4)=>[n[0],n[2],n[3],Math.ceil(e[1]*t[2]*t[3]/r)]},6572:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseImageScalerAttributes=t.imageScaler=void 0;const r=n(246),o=n(2039);t.imageScaler=(e,t,n)=>(l(t),[e.run(i(e,t,n),t)]),t.parseImageScalerAttributes=e=>{const t=e.attributes.getFloat("scale"),n=e.attributes.getFloats("bias");return(0,r.createAttributeWithCacheKey)({scale:t,bias:n})};const a={name:"ImageScaler",inputNames:["X"],inputTypes:[o.TextureType.unpacked]},i=(e,t,n)=>{const r=Object.assign(Object.assign({},a),{cacheHint:n.cacheKey});return Object.assign(Object.assign({},r),{get:()=>((e,t,n,r)=>{const a=n[0].dims.slice(),i=a.length,l=`\n ${s(r.bias.length)}\n float process(int indices[${i}]) {\n return _X(indices) * scale + getBias(bias, indices[1]);\n }`;return Object.assign(Object.assign({},t),{output:{dims:a,type:n[0].type,textureType:o.TextureType.unpacked},variables:[{name:"bias",type:"float",arrayLength:r.bias.length,data:r.bias},{name:"scale",type:"float",data:r.scale}],shaderSource:l})})(0,r,t,n)})},s=e=>{const t=[`float getBias(float bias[${e}], int channel) {`];for(let n=0;n<e;++n)0===n?t.push(`\tif (channel == ${n}) { return bias[${n}]; }`):n===e-1?t.push(`\telse { return bias[${n}]; }`):t.push(`\telse if (channel == ${n}) { return bias[${n}]; }`);return t.push("\t}"),t.join("\n")},l=e=>{if(!e||1!==e.length)throw new Error("ImageScaler requires 1 input.");if(4!==e[0].dims.length)throw new Error("Invalid input shape.");if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("Invalid input type.")}},3346:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseInstanceNormalizationAttributes=t.instanceNormalization=void 0;const r=n(5060),o=n(2039);t.instanceNormalization=(e,t,n)=>{u(t);const r=e.run(i(t[0]),t);return[e.run(l(e,t[0],n,r.dims),[t[0],r,t[1],t[2]])]},t.parseInstanceNormalizationAttributes=e=>e.attributes.getFloat("epsilon",1e-5);const a={name:"InstanceNormalization_MeanAndVariance",inputNames:["X"],inputTypes:[o.TextureType.unpacked]},i=e=>Object.assign(Object.assign({},a),{get:()=>((e,t)=>{const n=t.dims.slice(),r=n[1],a=n[2]*n[3],i=[n[0],r],s=`\n vec4 process(int[2] indices) {\n vec4 v = vec4(0.0);\n int a[4];\n a[0] = indices[0];\n a[1] = indices[1];\n float temp = 0.0;\n for(int a2=0; a2<${n[2]}; a2++) {\n a[2] = a2;\n for(int a3=0; a3<${n[3]}; a3++) {\n a[3] = a3;\n float x = _X(a);\n temp += x;\n }\n }\n float mean = temp / float(${a});\n temp = 0.0;\n for(int a2=0; a2<${n[2]}; a2++) {\n a[2] = a2;\n for(int a3=0; a3<${n[3]}; a3++) {\n a[3] = a3;\n float x = _X(a);\n temp += (x - mean) * (x - mean);\n }\n }\n v.r = mean;\n v.g = temp / float(${a});\n\n return v;\n }`;return Object.assign(Object.assign({},e),{output:{dims:i,type:t.type,textureType:o.TextureType.packedLastDimension},shaderSource:s})})(a,e)}),s={name:"InstanceNormalization_ComputeOutput",inputNames:["X","MeanAndVariance","Scale","B"],inputTypes:[o.TextureType.unpacked,o.TextureType.packedLastDimension,o.TextureType.unpacked,o.TextureType.unpacked]},l=(e,t,n,a)=>{const i=Object.assign(Object.assign({},s),{cacheHint:`${n}`});return Object.assign(Object.assign({},i),{get:()=>((e,t,n,a,i)=>{const s=(0,r.getGlsl)(e.session.backend.glContext.version),[l,u]=e.calculateTextureWidthAndHeight(i,o.TextureType.packedLastDimension),[c,d]=[l/4,u],f=`\n vec4 get_MeanAndVariance(int[2] mv) {\n int offset = indicesToOffset_MeanAndVariance(mv);\n vec2 coords = offsetToCoords(offset, ${c}, ${d});\n return ${s.texture2D}(MeanAndVariance, coords);\n }\n\n float process(int[4] indices) {\n int mv[2];\n mv[0] = indices[0];\n mv[1] = indices[1];\n vec4 mean_and_variance = get_MeanAndVariance(mv);\n float mean = mean_and_variance.r;\n float variance = mean_and_variance.g;\n\n int sb[1];\n sb[0] = indices[1];\n float scale = _Scale(sb);\n float b = _B(sb);\n\n return scale * (_X(indices) - mean) / sqrt(variance + epsilon) + b;\n }`;return Object.assign(Object.assign({},t),{output:{dims:n.dims,type:n.type,textureType:o.TextureType.unpacked},variables:[{name:"epsilon",type:"float",data:a}],shaderSource:f})})(e,i,t,n,a)})},u=e=>{if(!e||3!==e.length)throw new Error("InstanceNormalization requires 3 inputs.");const t=e[0],n=e[1],r=e[2];if(t.dims.length<3||1!==n.dims.length||1!==r.dims.length)throw new Error("Invalid input shape.");if(n.dims[0]!==t.dims[1]||r.dims[0]!==t.dims[1])throw new Error("Input shapes are mismatched.");if("float32"!==t.type&&"float64"!==t.type||"float32"!==n.type&&"float64"!==n.type||"float32"!==r.type&&"float64"!==r.type)throw new Error("Invalid input type.");if(4!==e[0].dims.length)throw new Error("Only support 4-D input shape.")}},708:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createPackedMatmulProgramInfoLoader=void 0;const r=n(2517),o=n(5060),a=n(2039),i=n(9390),s=n(2823),l=n(5623);t.createPackedMatmulProgramInfoLoader=(e,t,n)=>{const u=(c=t.length>2,d=n.activationCacheKey,{name:"MatMul (packed)",inputNames:c?["A","B","Bias"]:["A","B"],inputTypes:c?[a.TextureType.packed,a.TextureType.packed,a.TextureType.packed]:[a.TextureType.packed,a.TextureType.packed],cacheHint:d});var c,d;return Object.assign(Object.assign({},u),{get:()=>((e,t,n,u)=>{const c=n.length>2,d=c?"value += getBiasForMatmul();":"",f=n[0].dims,p=n[1].dims,h=r.BroadcastUtil.calcShape(f,p,!0),m=!r.ShapeUtil.areEqual(n[0].dims,n[1].dims);if(!h)throw new Error("Can't use matmul on the given tensors");const g=f[f.length-1],b=Math.ceil(g/2),y=f.length,_=p.length,v=(0,o.getGlsl)(e.session.backend.glContext.version),w=(0,i.getCoordsDataType)(h.length),S=h.length,x=(0,i.getGlChannels)(),{activationFunction:T,applyActivation:E}=(0,s.getActivationSnippet)(u),k=c?`${(0,l.getBiasForMatmul)(w,x,n[2].dims,h,!0)}`:"",P=m?`${function(e,t,n,o){let a=[],i=[];const s=n[0].dims,l=n[1].dims,u=s.length,c=l.length,d=o.length,f=d-u,p=d-c;a=s.map((e,n)=>`coords.${t[n+f]}`),a[u-1]="i*2",a.join(", "),i=l.map((e,n)=>`coords.${t[n+p]}`),i[c-2]="i*2",i.join(", ");const h=r.BroadcastUtil.getBroadcastDims(s,o),m=r.BroadcastUtil.getBroadcastDims(l,o),g=h.map(e=>`coords.${t[e+f]} = 0;`).join("\n"),b=m.map(e=>`coords.${t[e+p]} = 0;`).join("\n"),y=`int lastDim = coords.${t[d-1]};\n coords.${t[d-1]} = coords.${t[d-2]};\n coords.${t[d-2]} = lastDim;`;return`\nvec4 getAAtOutCoordsMatmul(int i) {\n ${e} coords = getOutputCoords();\n ${y}\n ${g}\n vec4 outputValue = getA(${a});\n return outputValue;\n}\n\nvec4 getBAtOutCoordsMatmul(int i) {\n ${e} coords = getOutputCoords();\n ${y}\n ${b}\n vec4 outputValue = getB(${i});\n return outputValue;\n}`}(w,x,n,h)}`:"",O=m?"getAAtOutCoordsMatmul(i)":`getA(${function(e,t){let n="";for(let r=0;r<t-2;r++)n+=`rc.${e[r]}, `;return n+=`rc.${e[t-2]}, i*2`,n}(x,y)})`,A=m?"getBAtOutCoordsMatmul(i)":`getB(${function(e,t){let n="";for(let r=0;r<t-2;r++)n+=`rc.${e[r]}, `;return n+=`i*2, rc.${e[t-1]}`,n}(x,_)})`,R=`\n ${P}\n ${k}\n ${T}\n void main() {\n ${m?"":`${w} rc =\n getOutputCoords(); int lastDim = rc.${x[S-1]}; rc.${x[S-1]} =\n rc.${x[S-2]}; rc.${x[S-2]} = lastDim;\n `}\n\n vec4 value = vec4(0);\n for (int i = 0; i < ${b}; i++) {\n vec4 a = ${O};\n vec4 b = ${A};\n\n value += (a.rrbb * b.rgrg);\n value += (a.ggaa * b.baba);\n }\n ${d}\n ${E}\n ${v.output} = value;\n }`;return Object.assign(Object.assign({},t),{output:{dims:h,type:n[0].type,textureType:a.TextureType.packed},shaderSource:R,hasMain:!0})})(e,u,t,n)})}},5623:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getBiasForMatmul=t.createMatmulProgramInfoLoader=t.parseMatMulAttributes=t.matMul=void 0;const r=n(2517),o=n(2039),a=n(9390),i=n(2823),s=n(708);function l(e,t){const n=(s=e.length>2,l=t.activationCacheKey,{name:"MatMul",inputNames:s?["A","B","Bias"]:["A","B"],inputTypes:s?[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]:[o.TextureType.unpacked,o.TextureType.unpacked],cacheHint:l});var s,l;return Object.assign(Object.assign({},n),{get:()=>function(e,t,n){const s=t[0].dims,l=t[1].dims,u=r.BroadcastUtil.calcShape(s,l,!0);if(!u)throw new Error("Can't use matmul on the given tensors");const d=(0,a.getCoordsDataType)(u.length),f=(0,a.getGlChannels)(),{activationFunction:p,applyActivation:h}=(0,i.getActivationSnippet)(n),m=t.length>2,g=m?"value += getBiasForMatmul();":"",b=m?`${c(d,f,t[2].dims,u,!1)}`:"",y=u.length,_=s.length,v=l.length,w=`\n ${p}\n ${b}\n float process(int indices[${y}]) {\n int a[${_}];\n int b[${v}];\n bcastMatmulIndices_A(indices, a);\n bcastMatmulIndices_B(indices, b);\n\n float value;\n for (int k=0; k<${s[s.length-1]}; ++k) {\n a[${_-1}] = k;\n b[${v-2}] = k;\n value += _A(a) * _B(b);\n }\n ${g}\n ${h}\n return value;\n }`;return Object.assign(Object.assign({},e),{output:{dims:u,type:t[0].type,textureType:o.TextureType.unpacked},shaderSource:w})}(n,e,t)})}t.matMul=(e,t,n)=>(u(t),e.session.pack?[e.run((0,s.createPackedMatmulProgramInfoLoader)(e,t,n),t)]:[e.run(l(t,n),t)]),t.parseMatMulAttributes=e=>(0,i.parseInternalActivationAttributes)(e.attributes),t.createMatmulProgramInfoLoader=l;const u=e=>{if(!e||2!==e.length)throw new Error("MatMul requires 2 inputs.");if(e[0].dims[e[0].dims.length-1]!==e[1].dims[e[1].dims.length-2])throw new Error("shared dimension does not match.");if("float32"!==e[0].type&&"float64"!==e[0].type||"float32"!==e[1].type&&"float64"!==e[1].type)throw new Error("inputs should be float type");if(e[0].type!==e[1].type)throw new Error("inputs types should match")};function c(e,t,n,o,a){let i="";const s=n.length,l=o.length,u=l-s;i=l<2&&s>0?"coords":n.map((e,n)=>`coords.${t[n+u]}`).join(", ");const c=r.BroadcastUtil.getBroadcastDims(n,o).map(e=>`coords.${t[e+u]} = 0;`).join("\n");let d="vec4(outputValue.xx, outputValue.yy)";return 1===r.ShapeUtil.size(n)&&(d="vec4(outputValue.x)"),a?`\nvec4 getBiasForMatmul() {\n ${e} coords = getOutputCoords();\n ${c}\n vec4 outputValue = getBias(${i});\n return ${d};\n}`:`\nfloat getBiasForMatmul() {\n ${e} coords = getOutputCoords();\n ${c}\n return getBias(coords.x);\n}`}t.getBiasForMatmul=c},2403:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createPackProgramInfoLoader=void 0;const r=n(5060),o=n(2039),a=n(9390),i=n(2827),s={name:"pack",inputNames:["A"],inputTypes:[o.TextureType.unpackedReversed]};t.createPackProgramInfoLoader=(e,t)=>Object.assign(Object.assign({},s),{get:()=>((e,t)=>{const n=(0,r.getGlsl)(e.session.backend.glContext.version),l=t.dims,u=l.length,c=t.dims.length,d=(0,a.getCoordsDataType)(c),f=(0,i.getChannels)("rc",c),p=(h=c,m=f,g=l[l.length-2],b=l[l.length-1],0===h||1===h?"":`\n int r = ${m[h-2]};\n int c = ${m[h-1]};\n int rp1 = ${m[h-2]} + 1;\n int cp1 = ${m[h-1]} + 1;\n bool rEdge = rp1 >= ${b};\n bool cEdge = cp1 >= ${g};\n `);var h,m,g,b;let y;y=0===u?[1,1]:1===u?[l[0],1]:[l[c-1],l[c-2]];const _=function(e,t,n){if(0===e)return"false";if(1===e)return`rc > ${t[0]}`;let r="";for(let o=e-2;o<e;o++)r+=`${n[o]} >= ${t[o-e+2]}`,o<e-1&&(r+="||");return r}(c,y,f),v=function(e,t){const n=e.length;if(0===n)return"getA(), 0, 0, 0";if(1===n)return`getA(rc),\n rc + 1 >= ${e[0]} ? 0. : getA(rc + 1),\n 0, 0`;let r="";if(n>2)for(let o=0;o<n-2;++o)r+=`${t[o]},`;return`getA(${r}r, c),\n rEdge ? 0. : getA(${r}rp1, c),\n cEdge ? 0. : getA(${r}r, cp1),\n rEdge || cEdge ? 0. : getA(${r}rp1, cp1)`}(l,f),w=`\n void main() {\n ${d} rc = getOutputCoords();\n\n if(${_}) {\n ${n.output} = vec4(0);\n } else {\n ${p}\n\n ${n.output} = vec4(${v});\n }\n }\n `;return Object.assign(Object.assign({},s),{hasMain:!0,output:{dims:t.dims,type:t.type,textureType:o.TextureType.packed},shaderSource:w})})(e,t)})},2827:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unpackFromChannel=t.getChannels=t.getVecChannels=void 0;const r=n(9390);function o(e,t){return(0,r.getGlChannels)(t).map(t=>`${e}.${t}`)}t.getVecChannels=o,t.getChannels=function(e,t){return 1===t?[e]:o(e,t)},t.unpackFromChannel=function(){return"\n float getChannel(vec4 frag, int dim) {\n int modCoord = imod(dim, 2);\n return modCoord == 0 ? frag.r : frag.g;\n }\n\n float getChannel(vec4 frag, vec2 innerDims) {\n vec2 modCoord = mod(innerDims, 2.);\n return modCoord.x == 0. ?\n (modCoord.y == 0. ? frag.r : frag.g) :\n (modCoord.y == 0. ? frag.b : frag.a);\n }\n "}},2870:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parsePadAttributesV11=t.padV11=t.parsePadAttributesV2=t.padV2=void 0;const r=n(246),o=n(2517),a=n(5060),i=n(2039),s={name:"Pad",inputNames:["A"],inputTypes:[i.TextureType.unpacked]};t.padV2=(e,t,n)=>(c(t),[e.run(Object.assign(Object.assign({},s),{cacheHint:n.cacheKey,get:()=>u(e,t[0],n)}),t)]),t.parsePadAttributesV2=e=>{const t=e.attributes.getString("mode","constant"),n=e.attributes.getFloat("value",0),o=e.attributes.getInts("pads");return(0,r.createAttributeWithCacheKey)({mode:t,value:n,pads:o})},t.padV11=(e,n,r)=>{d(n);const o=l(e,n,r);return(0,t.padV2)(e,[n[0]],o)},t.parsePadAttributesV11=e=>e.attributes.getString("mode","constant");const l=(e,t,n)=>{if(!e.session.isInitializer(t[1].dataId)||t.length>=3&&!e.session.isInitializer(t[2].dataId))throw new Error("dynamic pad attributes are not allowed");const o=Array.from(t[1].integerData),a=t.length>=3?t[2].floatData[0]:0;return(0,r.createAttributeWithCacheKey)({mode:n,pads:o,value:a})},u=(e,t,n)=>{const r=o.ShapeUtil.padShape(t.dims.slice(),n.pads),a=r.length,s=`\n ${f(e,t,n)}\n float process(int[${a}] indices) {\n return padA(indices);\n }`;return{name:"Pad",inputNames:["A"],inputTypes:[i.TextureType.unpacked],output:{dims:r,type:t.type,textureType:i.TextureType.unpacked},shaderSource:s}},c=e=>{if(!e||1!==e.length)throw new Error("Pad requires 1 input");if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("Invalid input type.")},d=e=>{if(!e||2!==e.length&&3!==e.length)throw new Error("Pad requires 2 or 3 inputs");if("int32"!==e[1].type)throw new Error("Invalid input type.");if(e.length>=3&&"string"===e[2].type)throw new Error("Invalid input type.")},f=(e,t,n)=>{const r=(0,a.getGlsl)(e.session.backend.glContext.version),[s,l]=e.calculateTextureWidthAndHeight(t.dims,i.TextureType.unpacked),u=o.ShapeUtil.computeStrides(t.dims);switch(n.mode){case"constant":return p(r,t.dims,u,s,l,n.pads,n.value);case"reflect":return h(r,t.dims,u,s,l,n.pads);case"edge":return m(r,t.dims,u,s,l,n.pads);default:throw new Error("Invalid mode")}},p=(e,t,n,r,o,a,i)=>{const s=t.length;let l="";for(let u=s-1;u>=0;--u)l+=`\n k = m[${u}] - ${a[u]};\n if (k < 0) return constant;\n if (k >= ${t[u]}) return constant;\n offset += k * ${n[u]};\n `;return`\n float padA(int m[${s}]) {\n const float constant = float(${i});\n int offset = 0;\n int k = 0;\n ${l}\n vec2 coords = offsetToCoords(offset, ${r}, ${o});\n float value = getColorAsFloat(${e.texture2D}(A, coords));\n return value;\n }\n `},h=(e,t,n,r,o,a)=>{const i=t.length;let s="";for(let l=i-1;l>=0;--l)s+=`\n k = m[${l}] - ${a[l]};\n if (k < 0) { k = -k; }\n {\n const int _2n_1 = ${2*(t[l]-1)};\n k = int( mod( float(k), float(_2n_1) ) ) ;\n if(k >= ${t[l]}) { k = _2n_1 - k; }\n }\n offset += k * ${n[l]};\n `;return`\n float padA(int m[${i}]) {\n int offset = 0;\n int k = 0;\n ${s}\n vec2 coords = offsetToCoords(offset, ${r}, ${o});\n float value = getColorAsFloat(${e.texture2D}(A, coords));\n return value;\n }\n `},m=(e,t,n,r,o,a)=>{const i=t.length;let s="";for(let l=i-1;l>=0;--l)s+=`\n k = m[${l}] - ${a[l]};\n if (k < 0) k = 0;\n if (k >= ${t[l]}) k = ${t[l]-1};\n offset += k * ${n[l]};\n `;return`\n float padA(int m[${i}]) {\n int offset = 0;\n int k = 0;\n ${s}\n vec2 coords = offsetToCoords(offset, ${r}, ${o});\n float value = getColorAsFloat(${e.texture2D}(A, coords));\n return value;\n }\n `}},2143:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.globalMaxPool=t.parseMaxPoolAttributes=t.maxPool=t.parseGlobalAveragePoolAttributes=t.globalAveragePool=t.parseAveragePoolAttributes=t.averagePool=void 0;const r=n(246),o=n(2517),a=n(2039);t.averagePool=(e,t,n)=>{d(t);const r={name:"AveragePool",inputNames:["X"],inputTypes:[a.TextureType.unpacked],cacheHint:n.cacheKey};return[e.run(Object.assign(Object.assign({},r),{get:()=>i(t,r,!1,n)}),t)]},t.parseAveragePoolAttributes=e=>{const t=e.attributes.getString("auto_pad","NOTSET"),n=e.attributes.getInt("ceil_mode",0),o=0!==e.attributes.getInt("count_include_pad",0),a=e.attributes.getInts("kernel_shape"),i=e.attributes.getInts("strides",[]),s=e.attributes.getInts("pads",[]);if(0!==n)throw new Error("using ceil() in shape computation is not yet supported for AveragePool");return(0,r.createAttributeWithCacheKey)({autoPad:t,ceilMode:n,countIncludePad:o,kernelShape:a,strides:i,pads:s})};const i=(e,t,n,r)=>{const[i,s]=l(e,r,n),u=o.ShapeUtil.size(i.kernelShape);let c="";i.countIncludePad?c+=`value /= float(${u});`:c+=`value /= float(${u} - pad);`;const d=`\n ${f(e[0].dims,i,"value += _X(x);",c,"0.0")}\n `;return Object.assign(Object.assign({},t),{output:{dims:s,type:e[0].type,textureType:a.TextureType.unpacked},shaderSource:d})};t.globalAveragePool=(e,t,n)=>{d(t);const r={name:"GlobalAveragePool",inputNames:["X"],inputTypes:[a.TextureType.unpacked],cacheHint:`${n.countIncludePad}`};return[e.run(Object.assign(Object.assign({},r),{get:()=>i(t,r,!0,n)}),t)]},t.parseGlobalAveragePoolAttributes=e=>{const t=0!==e.attributes.getInt("count_include_pad",0);return(0,r.createAttributeWithCacheKey)({autoPad:"",ceilMode:0,countIncludePad:t,kernelShape:[],strides:[],pads:[]})},t.maxPool=(e,t,n)=>{d(t);const r={name:"MaxPool",inputNames:["X"],inputTypes:[a.TextureType.unpacked],cacheHint:n.cacheKey};return[e.run(Object.assign(Object.assign({},r),{get:()=>s(t,r,!1,n)}),t)]},t.parseMaxPoolAttributes=e=>{const t=e.attributes.getString("auto_pad","NOTSET"),n=e.attributes.getInt("ceil_mode",0),o=e.attributes.getInts("kernel_shape"),a=e.attributes.getInts("strides",[]),i=e.attributes.getInts("pads",[]),s=e.attributes.getInt("storage_order",0),l=e.attributes.getInts("dilations",[]);if(0!==s)throw new Error("column major storage order is not yet supported for MaxPool");if(0!==n)throw new Error("using ceil() in shape computation is not yet supported for MaxPool");return(0,r.createAttributeWithCacheKey)({autoPad:t,ceilMode:n,countIncludePad:!1,kernelShape:o,strides:a,pads:i,storageOrder:s,dilations:l})};const s=(e,t,n,r)=>{const[o,i]=l(e,r,n),s=`\n ${f(e[0].dims,o,"\n value = max(_X(x), value);\n ","","-1e5")}\n `;return Object.assign(Object.assign({},t),{output:{dims:i,type:e[0].type,textureType:a.TextureType.unpacked},shaderSource:s})},l=(e,t,n)=>{const r=e[0].dims.slice(),a=Object.hasOwnProperty.call(t,"dilations"),i=t.kernelShape.slice(),s=t.strides.slice(),l=a?t.dilations.slice():[],u=t.pads.slice();o.PoolConvUtil.adjustPoolAttributes(n,r,i,s,l,u);const c=o.PoolConvUtil.computePoolOutputShape(n,r,s,l,i,u,t.autoPad),d=Object.assign({},t);return a?Object.assign(d,{kernelShape:i,strides:s,pads:u,dilations:l,cacheKey:t.cacheKey}):Object.assign(d,{kernelShape:i,strides:s,pads:u,cacheKey:t.cacheKey}),[d,c]},u={autoPad:"",ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[],cacheKey:""},c={name:"GlobalMaxPool",inputNames:["X"],inputTypes:[a.TextureType.unpacked]};t.globalMaxPool=(e,t)=>(d(t),[e.run(Object.assign(Object.assign({},c),{get:()=>s(t,c,!0,u)}),t)]);const d=e=>{if(!e||1!==e.length)throw new Error("Pool ops requires 1 input.");if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("Invalid input type.")},f=(e,t,n,r,a)=>{const i=e.length;if(t.kernelShape.length<=2){const o=t.kernelShape[t.kernelShape.length-1],s=t.strides[t.strides.length-1],l=t.pads[t.pads.length/2-1],u=t.pads[t.pads.length-1],c=e[i-1];let d="",f="",p="";if(d=l+u!==0?`\n for (int i = 0; i < ${o}; i++) {\n x[${i} - 1] = indices[${i} - 1] * ${s} - ${l} + i;\n if (x[${i} - 1] < 0 || x[${i} - 1] >= ${c}) {\n pad++;\n continue;\n }\n ${n}\n }`:`\n for (int i = 0; i < ${o}; i++) {\n x[${i} - 1] = indices[${i} - 1] * ${s} - ${l} + i;\n ${n}\n }`,2===t.kernelShape.length){const n=t.kernelShape[t.kernelShape.length-2],r=t.strides[t.strides.length-2],a=t.pads[t.pads.length/2-2],s=t.pads[t.pads.length-2],l=e[i-2];f=a+s!==0?`\n for (int j = 0; j < ${n}; j++) {\n x[${i} - 2] = indices[${i} - 2] * ${r} - ${a} + j;\n if (x[${i} - 2] < 0 || x[${i} - 2] >= ${l}) {\n pad+= ${o};\n continue;\n }\n `:`\n for (int j = 0; j < ${n}; j++) {\n x[${i} - 2] = indices[${i} - 2] * ${r} - ${a} + j;\n `,p="\n }\n "}return`\n float process(int indices[${i}]) {\n int x[${i}];\n copyVec(indices, x);\n\n float value = ${a};\n int pad = 0;\n ${f}\n ${d}\n ${p}\n ${r}\n return value;\n }\n `}{const s=o.ShapeUtil.size(t.kernelShape),l=o.ShapeUtil.computeStrides(t.kernelShape),u=l.length,c=t.pads.length,d=h(u),f=p(e,"inputDims"),m=p(t.pads,"pads"),g=p(l,"kernelStrides"),b=p(t.strides,"strides");let y="";return y=t.pads.reduce((e,t)=>e+t)?`\n if (x[j] >= inputDims[j] || x[j] < 0) {\n pad++;\n isPad = true;\n break;\n }\n }\n if (!isPad) {\n ${n}\n }`:`\n }\n ${n}\n `,`\n ${d}\n float process(int indices[${i}]) {\n int x[${i}];\n copyVec(indices, x);\n int offset[${u}];\n int pads[${c}];\n int inputDims[${i}];\n int kernelStrides[${u}];\n int strides[${u}];\n ${m}\n ${f}\n ${b}\n ${g}\n\n float value = ${a};\n int pad = 0;\n bool isPad = false;\n for (int i = 0; i < ${s}; i++) {\n offsetToIndices(i, kernelStrides, offset);\n isPad = false;\n for (int j = ${i} - ${u}; j < ${i}; j++) {\n x[j] = indices[j] * strides[j - ${i} + ${u}]\n + offset[j - ${i} + ${u}] - pads[j - 2];\n ${y}\n }\n ${r}\n\n return value;\n }\n `}},p=(e,t)=>{let n="";for(let r=0;r<e.length;r++)n+=`\n ${t}[${r}] = ${e[r]};\n `;return n},h=e=>`\n void offsetToIndices(int offset, int[${e}] strides, out int[${e}] indices) {\n if (${e} == 0) {\n return;\n }\n for (int i = 0; i < ${e} - 1; ++i) {\n indices[i] = offset / strides[i];\n offset -= indices[i] * strides[i];\n }\n indices[${e} - 1] = offset;\n }`},4939:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.reduceLogSumSquare=t.reduceLogSum=t.reduceProd=t.reduceMin=t.reduceMax=t.reduceMean=t.reduceSum=t.parseReduceAttributes=void 0;const r=n(246),o=n(782),a=n(2517),i=n(2039),s=(e,t,n,r,o)=>{u(t);const a={name:r,inputNames:["A"],inputTypes:[i.TextureType.unpacked]};return[e.run(Object.assign(Object.assign({},a),{cacheHint:n.cacheKey,get:()=>l(e,t,n,r,o,a)}),t)]};t.parseReduceAttributes=e=>{const t=e.attributes.getInts("axes",[]),n=1===e.attributes.getInt("keepdims",1);return(0,r.createAttributeWithCacheKey)({axes:t,keepDims:n})};const l=(e,t,n,r,o,s)=>{const l=[],u=t[0].dims.length||1,c=[],d=a.ShapeUtil.normalizeAxes(n.axes,t[0].dims.length),f=o(t,d);let p=f[1];for(let a=0;a<t[0].dims.length;a++)d.indexOf(a)>=0||0===d.length?(n.keepDims&&l.push(1),p=`\n for(int j${a} = 0; j${a} < ${t[0].dims[a]}; j${a}++) {\n inputIdx[${a}] = j${a};\n ${p}\n }`):(c.push(`inputIdx[${a}] = outputIdx[${l.length}];`),l.push(t[0].dims[a]));const h=`\n float process(int outputIdx[${l.length||1}]) {\n float value; // final result\n int inputIdx[${u}]; // addressing input data\n ${c.join("\n")}\n ${f[0]} // init ops for reduce max/min\n ${p}\n ${f[2]} // final computation for reduce mean\n return value;\n }`;return Object.assign(Object.assign({},s),{output:{dims:l,type:t[0].type,textureType:i.TextureType.unpacked},shaderSource:h})},u=e=>{if(!e||1!==e.length)throw new Error("Reduce op requires 1 input.");if(-1===o.NUMBER_TYPES.indexOf(e[0].type))throw new Error("Invalid input type.")};t.reduceSum=(e,t,n)=>s(e,t,n,"ReduceSum",()=>["value = 0.0;","value += _A(inputIdx);",""]),t.reduceMean=(e,t,n)=>s(e,t,n,"ReduceMean",(e,t)=>{let n=1;for(let r=0;r<e[0].dims.length;r++)(t.indexOf(r)>=0||0===t.length)&&(n*=e[0].dims[r]);return["value = 0.0;","value += _A(inputIdx);",`value /= ${n}.;`]}),t.reduceMax=(e,t,n)=>s(e,t,n,"ReduceMax",(e,t)=>{const n=[];for(let r=0;r<e[0].dims.length;r++)(t.indexOf(r)>=0||0===t.length)&&n.push(`inputIdx[${r}] = 0;`);return[`${n.join("\n")}\nvalue = _A(inputIdx);`,"value = max(value, _A(inputIdx));",""]}),t.reduceMin=(e,t,n)=>s(e,t,n,"ReduceMin",(e,t)=>{const n=[];for(let r=0;r<e[0].dims.length;r++)(t.indexOf(r)>=0||0===t.length)&&n.push(`inputIdx[${r}] = 0;`);return[`${n.join("\n")}\nvalue = _A(inputIdx);`,"value = min(value, _A(inputIdx));",""]}),t.reduceProd=(e,t,n)=>s(e,t,n,"ReduceProd",()=>["value = 1.0;","value *= _A(inputIdx);",""]),t.reduceLogSum=(e,t,n)=>s(e,t,n,"ReduceLogSum",()=>["value = 0.0;","value += _A(inputIdx);","value = log(value);"]),t.reduceLogSumSquare=(e,t,n)=>s(e,t,n,"ReduceLogSumSquare",()=>["float t; value = 0.0;","t = _A(inputIdx); value += t * t;",""])},7019:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isReshapeCheap=t.processDims3D=t.createPackedReshape3DProgramInfoLoader=void 0;const r=n(2517),o=n(5060),a=n(2039),i=n(2827);t.createPackedReshape3DProgramInfoLoader=(e,t,n)=>{const s=(l=n,{name:"Reshape (packed)",inputTypes:[a.TextureType.packed],inputNames:["A"],cacheHint:`${l}`});var l;return Object.assign(Object.assign({},s),{get:()=>((e,t,n,s)=>{const l=t.dims,u=s;let c="";for(let r=0;r<4;r++){let e="";switch(r){case 0:e="outputCoords = rc;";break;case 1:e="outputCoords = ivec3(rc.x, rc.y+1, rc.z);";break;case 2:e="outputCoords = ivec3(rc.x, rc.y, rc.z+1);";break;case 3:e="outputCoords = ivec3(rc.x, rc.y+1, rc.z+1);";break;default:throw new Error}c+=`\n ${e}\n ${r>0?"if(outputCoords.y < rows && outputCoords.z < cols){":""}\n int flattenedIndex = getFlattenedIndex(outputCoords);\n\n ivec3 inputRC = inputCoordsFromReshapedOutCoords(flattenedIndex);\n vec2 innerDims = vec2(float(inputRC.y),float(inputRC.z));\n\n result[${r}] = getChannel(getA(inputRC.x, inputRC.y, inputRC.z), innerDims);\n\n ${r>0?"}":""}\n `}const d=(0,o.getGlsl)(e.session.backend.glContext.version),f=`\n ${function(e){const t=r.ShapeUtil.computeStrides(e),n=["b","r","c"],o="index";return`\n ivec3 inputCoordsFromReshapedOutCoords(int index) {\n ${t.map((e,r)=>`int ${n[r]} = ${o} / ${e}; ${r===t.length-1?`int ${n[r+1]} = ${o} - ${n[r]} * ${e}`:`index -= ${n[r]} * ${e}`};`).join("")}\n return ivec3(b, r, c);\n }\n `}(l)}\n ${function(e){const t=r.ShapeUtil.computeStrides(e);return`\n int getFlattenedIndex(ivec3 coords) {\n // reverse y, z order\n return coords.x * ${t[0]} + coords.z * ${t[1]} + coords.y;\n }\n`}(u)}\n ${(0,i.unpackFromChannel)()}\n\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0.0);\n\n ivec3 outputCoords;\n int rows = ${u[2]};\n int cols = ${u[1]};\n\n ${c}\n ${d.output} = result;\n }\n `;return Object.assign(Object.assign({},n),{output:{dims:u,type:t.type,textureType:a.TextureType.packed},shaderSource:f,hasMain:!0})})(e,t,s,n)})},t.processDims3D=function(e){if(0===e.length)return[1,1,1];let t=1;for(let n=0;n<e.length-2;++n)t*=e[n];return[t,e.length>1?e[e.length-2]:1,e[e.length-1]]},t.isReshapeCheap=function(e,t){let n=!1;return n=0===e.length||0===t.length||(e.length<2||t.length<2?e[e.length-1]===t[t.length-1]:e[e.length-1]===t[t.length-1]&&e[e.length-2]===t[t.length-2]),n}},718:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.reshape=void 0;const r=n(2517);t.reshape=(e,t)=>{const n=r.ShapeUtil.calculateReshapedDims(t[0].dims,t[1].integerData);return e.session.pack?[e.reshapePacked(t[0],n)]:[e.reshapeUnpacked(t[0],n)]}},2268:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseResizeAttributesV11=t.parseResizeAttributesV10=t.resize=void 0;const r=n(5060),o=n(2039),a=n(9390),i=n(2827),s=n(9793),l={name:"Resize",inputNames:["A"],inputTypes:[o.TextureType.packed]};t.resize=(e,t,n)=>((0,s.validateInputs)(t,n),[e.run(Object.assign(Object.assign({},l),{cacheHint:n.cacheKey,get:()=>u(e,t,n)}),t)]),t.parseResizeAttributesV10=e=>(0,s.parseUpsampleAttributes)(e,10),t.parseResizeAttributesV11=e=>(0,s.parseUpsampleAttributes)(e,11);const u=(e,t,n)=>{const s=(0,r.getGlsl)(e.session.backend.glContext.version),[u,d]=c(t,n);if(u.every(e=>1===e)&&"tf_crop_and_resize"!==n.coordinateTransformMode)return Object.assign(Object.assign({},l),{output:{dims:d,type:t[0].type,textureType:o.TextureType.packed},hasMain:!0,shaderSource:`void main() {\n vec4 v = ${s.texture2D}(X, TexCoords);\n ${s.output} = v;\n }`});const f=d.length;if(f<2)throw new Error(`output dimension should be at least 2, but got ${f}`);const p=d[f-2],h=d[f-1],m=t[0].dims;if(f!==m.length)throw new Error(`output dimension should match input ${m.length}, but got ${f}`);const g=m[f-2],b=m[f-1],y=u[f-2],_=u[f-1];let v="";if("linear"!==n.mode)throw new Error(`resize (packed) does not support mode: '${n.mode}'`);switch(n.coordinateTransformMode){case"asymmetric":v="\n vec4 getSourceFracIndex(ivec4 coords) {\n return vec4(coords) / scaleWHWH;\n }\n ";break;case"half_pixel":v="\n vec4 getSourceFracIndex(ivec4 coords) {\n return (vec4(coords) + 0.5) / scaleWHWH - 0.5;\n }\n ";break;case"pytorch_half_pixel":v=`\n vec4 getSourceFracIndex(ivec4 coords) {\n vec4 fcoords = vec4(coords);\n return vec4(\n ${h}.0 > 1.0 ? (fcoords.x + 0.5) / scaleWHWH.x - 0.5 : 0.0,\n ${p}.0 > 1.0 ? (fcoords.y + 0.5) / scaleWHWH.y - 0.5 : 0.0,\n ${h}.0 > 1.0 ? (fcoords.z + 0.5) / scaleWHWH.z - 0.5 : 0.0,\n ${p}.0 > 1.0 ? (fcoords.w + 0.5) / scaleWHWH.w - 0.5 : 0.0\n );\n }\n `;break;case"align_corners":v=`\n vec4 getSourceFracIndex(ivec4 coords) {\n vec4 resized = vec4(${h}.0 - 1.0, ${p}.0 - 1.0, ${h}.0 - 1.0,\n ${p}.0 - 1.0);\n vec4 original = vec4(${b}.0 - 1.0, ${g}.0 - 1.0, ${b}.0 - 1.0,\n ${g}.0 - 1.0);\n vec4 new_scale = original / resized;\n return vec4(coords) * new_scale;\n }\n `;break;default:throw new Error(`resize (packed) does not support coordinateTransformMode: '${n.coordinateTransformMode}'`)}const w=(0,a.getCoordsDataType)(f),S=`\n const vec2 inputWH = vec2(${g}.0, ${b}.0);\n const vec4 scaleWHWH = vec4(float(${y}), float(${_}), float(${y}), float(${_}));\n ${(0,i.unpackFromChannel)()}\n ${v}\n float getAValue(int x10, int r, int c, int d) {\n return getChannel(getA(x10, r, c, d), vec2(c, d));\n }\n void main() {\n ${w} rc = getOutputCoords();\n\n int batch = rc[0];\n int depth = rc[1];\n\n // retrieve the 4 coordinates that is used in the 4 packed output values.\n ivec4 coords = ivec4(rc.wz, rc.w + 1, rc.z + 1);\n\n // calculate the source index in fraction\n vec4 sourceFrac = getSourceFracIndex(coords);\n\n // get the lower and upper bound of the 4 values that will be packed into one texel.\n ivec4 x00 = ivec4(max(sourceFrac.xy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xy)));\n ivec4 x01 = ivec4(max(sourceFrac.xw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xw)));\n ivec4 x10 = ivec4(max(sourceFrac.zy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zy)));\n ivec4 x11 = ivec4(max(sourceFrac.zw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zw)));\n\n bool hasNextRow = rc.w < ${p-1};\n bool hasNextCol = rc.z < ${h-1};\n\n // pack x00, x01, x10, x11's top-left corner into one vec4 structure\n vec4 topLeft = vec4(\n getAValue(batch, depth, x00.x, x00.y),\n hasNextCol ? getAValue(batch, depth, x01.x, x01.y) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.x, x10.y) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.y) : 0.0);\n\n // pack x00, x01, x10, x11's top-right corner into one vec4 structure\n vec4 topRight = vec4(\n getAValue(batch, depth, x00.x, x00.w),\n hasNextCol ? getAValue(batch, depth, x01.x, x01.w) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.x, x10.w) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.w) : 0.0);\n\n // pack x00, x01, x10, x11's bottom-left corner into one vec4 structure\n vec4 bottomLeft = vec4(\n getAValue(batch, depth, x00.z, x00.y),\n hasNextCol ? getAValue(batch, depth, x01.z, x01.y) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.z, x10.y) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.y) : 0.0);\n\n // pack x00, x01, x10, x11's bottom-right corner into one vec4 structure\n vec4 bottomRight = vec4(\n getAValue(batch, depth, x00.z, x00.w),\n hasNextCol ? getAValue(batch, depth, x01.z, x01.w) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.z, x10.w) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.w) : 0.0);\n\n // calculate the interpolation fraction on u and v direction\n vec4 frac = vec4(sourceFrac) - floor(sourceFrac);\n vec4 clampFrac = clamp(frac, vec4(0.0), vec4(1.0));\n\n vec4 top = mix(topLeft, topRight, clampFrac.ywyw);\n vec4 bottom = mix(bottomLeft, bottomRight, clampFrac.ywyw);\n vec4 newValue = mix(top, bottom, clampFrac.xxzz);\n\n ${s.output} = vec4(newValue);\n }\n `;return Object.assign(Object.assign({},l),{output:{dims:d,type:t[0].type,textureType:o.TextureType.packed},hasMain:!0,shaderSource:S})},c=(e,t)=>{const n=e[0].dims;let r,o=t.scales;if(0===o.length){const a=e[t.scalesInputIdx];if(a&&0!==a.size){if(e[t.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");o=d(a,t.mode,t.isResize)}else{const a=e[t.sizesInputIdx];if(!a||0===a.size)throw new Error("Either scales or sizes MUST be provided as input.");r=Array.from(a.integerData),o=f(r,n,t.mode,t.isResize)}}else if(e[t.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");const a=r||n.map((e,t)=>Math.floor(e*o[t]));return[o,a]},d=(e,t,n)=>{const r=Array.from(e.floatData);return(0,s.scalesValidation)(r,t,n),r},f=(e,t,n,r)=>{const o=t.length,a=new Array(o);for(let i=0,s=o;i<s;i++)if(0===t[i]){if(0!==e[i])throw new Error("Input dim is zero but required output dim is non-zero.");a[i]=1}else a[i]=e[i]/t[i];return(0,s.scalesValidation)(a,n,r),a}},8117:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.shape=void 0;const r=n(9162);t.shape=(e,t)=>(o(t),[new r.Tensor([t[0].dims.length],"int32",void 0,void 0,new Int32Array(t[0].dims))]);const o=e=>{if(!e||1!==e.length)throw new Error("Shape requires 1 input.")}},2278:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.sliceV10=t.parseSliceAttributes=t.slice=void 0;const r=n(246),o=n(782),a=n(2517),i=n(2039),s={name:"Slice",inputNames:["A"],inputTypes:[i.TextureType.unpacked]};t.slice=(e,t,n)=>(u(t),[e.run(Object.assign(Object.assign({},s),{cacheHint:n.cacheKey,get:()=>l(e,t[0],n)}),t)]),t.parseSliceAttributes=e=>{const t=e.attributes.getInts("starts"),n=e.attributes.getInts("ends"),o=e.attributes.getInts("axes",[]);return(0,r.createAttributeWithCacheKey)({starts:t,ends:n,axes:o})};const l=(e,t,n)=>{const r=0===n.axes.length?t.dims.slice(0).map((e,t)=>t):n.axes,o=a.ShapeUtil.normalizeAxes(r,t.dims.length),l=n.starts.map((e,n)=>e>t.dims[o[n]]-1?t.dims[o[n]]:a.ShapeUtil.normalizeAxis(e,t.dims[o[n]])),u=n.ends.map((e,n)=>e>t.dims[o[n]]-1?t.dims[o[n]]:a.ShapeUtil.normalizeAxis(e,t.dims[o[n]])),c=t.dims.slice(),d=[];for(let a=0;a<o.length;a++)c[o[a]]=u[a]-l[a],l[a]>0&&d.push(`outputIdx[${o[a]}] += ${l[a]};`);const f=`\n float process(int outputIdx[${c.length}]) {\n ${d.join("\n ")}\n return _A(outputIdx);\n }`;return Object.assign(Object.assign({},s),{output:{dims:c,type:t.type,textureType:i.TextureType.unpacked},shaderSource:f})},u=e=>{if(!e||1!==e.length)throw new Error("Slice requires 1 input.");if(-1===o.NUMBER_TYPES.indexOf(e[0].type))throw new Error("Invalid input type.")};t.sliceV10=(e,t)=>{d(t);const n=c(e,t);return[e.run(Object.assign(Object.assign({},s),{cacheHint:n.cacheKey,get:()=>l(e,t[0],n)}),[t[0]])]};const c=(e,t)=>{if(!e.session.isInitializer(t[1].dataId)||!e.session.isInitializer(t[2].dataId)||t.length>=4&&!e.session.isInitializer(t[3].dataId)||t.length>=5&&!e.session.isInitializer(t[4].dataId))throw new Error("dynamic slice attributes are not allowed");if(t.length>=5&&t[4].integerData.some(e=>1!==e))throw new Error("currently non-1 steps is not supported for Slice");const n=Array.from(t[1].integerData),r=Array.from(t[2].integerData),o=t.length>=4?Array.from(t[3].integerData):[];return{starts:n,ends:r,axes:o,cacheKey:`${o};${n};${r}`}},d=e=>{if(!e||e.length<3||e.length>5)throw new Error("Invalid input number.");if("int32"!==e[1].type||1!==e[1].dims.length)throw new Error("Invalid input type.");if("int32"!==e[2].type||1!==e[2].dims.length)throw new Error("Invalid input type.");if(e.length>=4&&("int32"!==e[3].type||1!==e[3].dims.length))throw new Error("Invalid input type.");if(e.length>=5&&("int32"!==e[4].type||1!==e[4].dims.length))throw new Error("Invalid input type.")}},5524:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.softmaxV13=t.parseSoftmaxAttributesV13=t.parseSoftmaxAttributes=t.softmax=void 0;const r=n(246),o=n(2517),a=n(5060),i=n(2039),s=n(3738),l={name:"SoftmaxComputeMax",inputNames:["A"],inputTypes:[i.TextureType.unpacked]},u={name:"SoftmaxComputeScale",inputNames:["A","Max"],inputTypes:[i.TextureType.unpacked,i.TextureType.unpacked]},c={name:"SoftMax",inputNames:["A","Max","Norm"],inputTypes:[i.TextureType.unpacked,i.TextureType.unpacked,i.TextureType.unpacked]};t.softmax=(e,t,n)=>{m(t);const r=t[0].dims.slice(),a=o.ShapeUtil.normalizeAxis(n.axis,r.length),i=o.ShapeUtil.sizeToDimension(r,a),s=o.ShapeUtil.sizeFromDimension(r,a);return d(e,t,n,i,s)},t.parseSoftmaxAttributes=e=>(0,r.createAttributeWithCacheKey)({axis:e.attributes.getInt("axis",1)}),t.parseSoftmaxAttributesV13=e=>(0,r.createAttributeWithCacheKey)({axis:e.attributes.getInt("axis",-1)}),t.softmaxV13=(e,t,n)=>{m(t);const a=t[0].dims.slice(),i=o.ShapeUtil.normalizeAxis(n.axis,a.length),l=a.length,u=i!==l-1,c=[];let f,p=[],h=[];u&&(p=Array.from({length:l}).map((e,t)=>t),p[i]=l-1,p[l-1]=i,p.map(e=>c.push(a[e])),f=(0,r.createAttributeWithCacheKey)({perm:p}),h=(0,s.transpose)(e,t,f));const g=u?o.ShapeUtil.sizeToDimension(c,l-1):o.ShapeUtil.sizeToDimension(a,l-1),b=u?o.ShapeUtil.sizeFromDimension(c,l-1):o.ShapeUtil.sizeFromDimension(a,l-1),y=d(e,u?h:t,n,g,b);return u?(0,s.transpose)(e,y,f):y};const d=(e,t,n,r,o)=>{const a=f(e,t[0],r,o,[r]),i=e.run(Object.assign(Object.assign({},l),{cacheHint:n.cacheKey,get:()=>a}),t),s=p(e,t[0],r,o,a.output.dims,[r]),d=e.run(Object.assign(Object.assign({},u),{cacheHint:n.cacheKey,get:()=>s}),[t[0],i]),m=h(e,t[0],r,o,a.output.dims,s.output.dims);return[e.run(Object.assign(Object.assign({},c),{cacheHint:n.cacheKey,get:()=>m}),[t[0],i,d])]},f=(e,t,n,r,o)=>{const[s,u]=e.calculateTextureWidthAndHeight(t.dims,i.TextureType.unpacked),c=o.length;if(n<1||r<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(1!==o.length)throw new Error("Dimensionality of the output should be 1");if(o[0]!==n)throw new Error("Shape of the output should be equal to logical row count");const d=(0,a.getGlsl)(e.session.backend.glContext.version),f=`\n float process(int[${c}] indices) {\n int logical_row_start_offset = indices[0] * ${r};\n\n float max = getColorAsFloat(${d.texture2D}(A, offsetToCoords(logical_row_start_offset, ${s},\n ${u} )));\n for(int i=1; i<${r}; ++i)\n {\n float current = getColorAsFloat(${d.texture2D}(A, offsetToCoords(logical_row_start_offset + i,\n ${s}, ${u})));\n if(current > max)\n max = current;\n }\n\n return max;\n }`;return Object.assign(Object.assign({},l),{output:{dims:o,type:t.type,textureType:i.TextureType.unpacked},shaderSource:f})},p=(e,t,n,r,o,s)=>{const[l,c]=e.calculateTextureWidthAndHeight(t.dims,i.TextureType.unpacked),d=s.length;if(n<1||r<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(1!==s.length)throw new Error("Dimensionality of the output should be 1");if(s[0]!==n)throw new Error("Shape of the output should be equal to logical row count");if(1!==o.length)throw new Error("Dimensionality of the intermediate results should be 1");if(o[0]!==n)throw new Error("Shape of the intermediate results should be equal to logical row count");const f=`\n float process(int[${d}] indices) {\n int logical_row_start_offset = indices[0] * ${r};\n\n float norm_factor = 0.0;\n float max = _Max(indices);\n for(int i=0; i<${r}; ++i)\n {\n norm_factor += exp(getColorAsFloat(${(0,a.getGlsl)(e.session.backend.glContext.version).texture2D}(A, offsetToCoords(logical_row_start_offset + i,\n ${l}, ${c}))) - max);\n }\n\n return norm_factor;\n }`;return Object.assign(Object.assign({},u),{output:{dims:s,type:t.type,textureType:i.TextureType.unpacked},shaderSource:f})},h=(e,t,n,r,o,a)=>{const[s,l]=e.calculateTextureWidthAndHeight(t.dims,i.TextureType.unpacked),u=t.dims.length;if(n<1||r<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(1!==o.length||1!==a.length)throw new Error("Dimensionality of the intermediate results should be 1");if(o[0]!==n||a[0]!==n)throw new Error("Shape of the intermediate results should be equal to logical row count");const d=`\n float process(int[${u}] indices) {\n\n // get offset of current logical tensor index from the 2-D texture coordinates (TexCoords)\n int offset = coordsToOffset(TexCoords, ${s}, ${l});\n\n //determine the logical row for this index\n int logical_row_index[1];\n logical_row_index[0] = offset / ${r};\n\n float norm_factor = _Norm(logical_row_index);\n\n // avoid possible division by 0\n // if norm_facor is 0, all elements are zero\n // if so, return 0\n if(norm_factor == 0.0)\n return 0.0;\n\n return exp(_A(indices) - _Max(logical_row_index)) / norm_factor;\n }`;return Object.assign(Object.assign({},c),{output:{dims:t.dims,type:t.type,textureType:i.TextureType.unpacked},shaderSource:d})},m=e=>{if(!e||1!==e.length)throw new Error("Softmax requires 1 input.");if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("Invalid input type")}},5975:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseSplitAttributes=t.split=void 0;const r=n(246),o=n(2517),a=n(2039),i={name:"Split",inputNames:["A"],inputTypes:[a.TextureType.unpacked]};t.split=(e,t,n)=>{u(t);const r=o.ShapeUtil.normalizeAxis(n.axis,t[0].dims.length),a=s(e,t,r,n),c=[];for(let o=0;o<a;++o)c.push(e.run(Object.assign(Object.assign({},i),{cacheHint:`${n.cacheKey};${o}`,get:()=>l(e,t[0],n,r,o)}),t));return c},t.parseSplitAttributes=e=>{const t=e.attributes.getInt("axis",0),n=e.attributes.getInts("split",[]),o=e.outputs.length;return(0,r.createAttributeWithCacheKey)({axis:t,split:n,numOutputs:o})};const s=(e,t,n,r)=>{const[,a]=o.SplitUtil.splitShape(t[0].dims,n,r.split,r.numOutputs);return a.length},l=(e,t,n,r,s)=>{const[l,u]=o.SplitUtil.splitShape(t.dims,r,n.split,n.numOutputs),c=u[s],d=l[s],f=`\n float process(int indices[${d.length}]) {\n indices[${r}] += ${c};\n return _A(indices);\n }\n `;return Object.assign(Object.assign({},i),{cacheHint:`${n.cacheKey}:${s}`,output:{dims:d,type:t.type,textureType:a.TextureType.unpacked},shaderSource:f})},u=e=>{if(!e||1!==e.length)throw new Error("Split requires one input.");if("int8"!==e[0].type&&"uint8"!==e[0].type&&"int16"!==e[0].type&&"uint16"!==e[0].type&&"int32"!==e[0].type&&"uint32"!==e[0].type&&"float32"!==e[0].type&&"float64"!==e[0].type&&"bool"!==e[0].type)throw new Error("Invalid input type.")}},3933:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseSqueezeAttributes=t.squeezeV13=t.squeeze=void 0;const r=n(2517);t.squeeze=(e,t,n)=>{o(t);const a=r.ShapeUtil.squeezeShape(t[0].dims,n);return[e.reshapeUnpacked(t[0],a)]},t.squeezeV13=(e,n)=>(a(n),(0,t.squeeze)(e,[n[0]],Array.from(n[1].integerData))),t.parseSqueezeAttributes=e=>e.attributes.getInts("axes");const o=e=>{if(!e||1!==e.length)throw new Error("Squeeze requires 1 input.");if("string"===e[0].type)throw new Error("invalid input tensor types.")},a=e=>{if(!e||2!==e.length)throw new Error("Squeeze requires 2 inputs.");if("int32"!==e[1].type)throw new Error("Invalid input type.")}},6558:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.sum=void 0;const r=n(5060),o=n(2039);t.sum=(e,t)=>{i(t);const n={name:"Sum",inputNames:t.map((e,t)=>`X${t}`),inputTypes:new Array(t.length).fill(o.TextureType.unpacked)};return[e.run(Object.assign(Object.assign({},n),{get:()=>a(e,t,n)}),t)]};const a=(e,t,n)=>{const a=(0,r.getGlsl)(e.session.backend.glContext.version),i=t[0].dims.slice(),s=`\n void main() {\n vec4 result = ${t.map((e,t)=>`${a.texture2D}(X${t},TexCoords)`).join(" + ")};\n ${a.output} = result;\n }\n `;return Object.assign(Object.assign({},n),{output:{dims:i,type:t[0].type,textureType:o.TextureType.unpacked},hasMain:!0,shaderSource:s})},i=e=>{if(!e||0===e.length)throw new Error("Sum requires inputs.");const t=e[0].dims.length;for(let n=1;n<e.length;n++){if(t!==e[n].dims.length)throw new Error("Input shapes are mismatched.");for(let r=0;r<t;r++)if(e[0].dims[r]!==e[n].dims[r])throw new Error("Input shapes are not matched.")}if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("Invalid input type.");for(let n=1;n<e.length;n++)if(e[0].type!==e[n].type)throw new Error("Input types are not matched.")}},5723:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tile=void 0;const r=n(782),o=n(2039);t.tile=(e,t)=>{i(t);const n={name:"Tile",inputNames:["A"],inputTypes:[o.TextureType.unpacked]};return[e.run(Object.assign(Object.assign({},n),{get:()=>a(e,t,n)}),t)]};const a=(e,t,n)=>{const r=t[0].dims.slice(),a=new Array(r.length),i=[];for(let o=0;o<r.length;o++)a[o]=r[o]*t[1].numberData[o],i.push(`inputIdx[${o}] = int(mod(float(outputIdx[${o}]), ${r[o]}.));`);const s=a.length,l=`\n float process(int outputIdx[${s}]) {\n int inputIdx[${s}];\n ${i.join("\n")}\n return _A(inputIdx);\n }\n `;return Object.assign(Object.assign({},n),{output:{dims:a,type:t[0].type,textureType:o.TextureType.unpacked},shaderSource:l})},i=e=>{if(!e||2!==e.length)throw new Error("Tile requires 2 input.");if(1!==e[1].dims.length)throw new Error("The second input shape must 1 dimension.");if(e[1].dims[0]!==e[0].dims.length)throw new Error("Invalid input shape.");if(-1===r.NUMBER_TYPES.indexOf(e[0].type))throw new Error("Invalid input type.");if("int32"!==e[1].type&&"int16"!==e[1].type)throw new Error("Invalid repeat type.")}},3738:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseTransposeAttributes=t.transpose=void 0;const r=n(246),o=n(2517),a=n(2039),i={name:"Transpose",inputNames:["A"],inputTypes:[a.TextureType.unpacked]};t.transpose=(e,t,n)=>(d(t),[e.run(Object.assign(Object.assign({},i),{cacheHint:n.cacheKey,get:()=>s(e,t[0],n.perm)}),t)]),t.parseTransposeAttributes=e=>(0,r.createAttributeWithCacheKey)({perm:e.attributes.getInts("perm",[])});const s=(e,t,n)=>{const r=t.dims;n=l(r,n);const o=u(r,n),s=r.length,d=`\n ${c("perm",n,s)}\n float process(int indices[${s}]) {\n int a[${s}];\n perm(a, indices);\n return _A(a);\n }`;return Object.assign(Object.assign({},i),{output:{dims:o,type:t.type,textureType:a.TextureType.unpacked},shaderSource:d})},l=(e,t)=>(t&&t.length!==e.length&&(t=[...e.keys()].reverse()),t),u=(e,t)=>(t=l(e,t),o.ShapeUtil.sortBasedOnPerm(e,t)),c=(e,t,n)=>{const r=[];r.push(`void ${e}(out int a[${n}], int src[${n}]) {`);for(let o=0;o<n;++o)r.push(`\ta[${t[o]}]=src[${o}];`);return r.push("\t}"),r.join("\n")},d=e=>{if(!e||1!==e.length)throw new Error("Transpose requires 1 input.");if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("input should be float tensor")}},8710:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.encodeAsUint8=void 0;const r=n(5060),o=n(2039);t.encodeAsUint8=(e,t)=>{const n=t.shape,a=(0,r.getGlsl)(e.session.backend.glContext.version),i=`\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n bool isNaN(float val) {\n return (val < 1.0 || 0.0 < val || val == 0.0) ? false : true;\n }\n\n highp vec4 encodeAsUint8(highp float v) {\n if (isNaN(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n\n void main() {\n float value = ${a.texture2D}(X,TexCoords).r;\n ${a.output} = encodeAsUint8(value);\n }`,s={name:"Uint8Encode",inputTypes:[o.TextureType.unpacked],inputNames:["X"],output:{dims:n,type:t.tensor.type,textureType:o.TextureType.downloadUint8AsFloat},shaderSource:i,hasMain:!0};return e.executeProgram(s,[t.tensor])}},4909:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tanh=t.tan=t.sqrt=t.sin=t.sigmoid=t.relu=t.not=t.neg=t.log=t.parseLeakyReluAttributes=t.leakyRelu=t.identity=t.floor=t.exp=t.parseEluAttributes=t.elu=t.cos=t.ceil=t.clipV11=t.parseClipAttributes=t.clip=t.atan=t.asin=t.acos=t.abs=t.glslTanh=t.glslTan=t.glslSqrt=t.glslSigmoid=t.glslRelu=t.glslSin=t.glslNot=t.glslNeg=t.glslLog=t.glslLeakyRelu=t.glslIdentity=t.glslClip=t.glslFloor=t.glslExp=t.glslElu=t.glslCos=t.glslCeil=t.glslAtan=t.glslAsin=t.glslAcos=t.glslAbs=void 0;const r=n(246),o=n(2517),a=n(8520),i=n(5060),s=n(2039);function l(){return A("abs")}function u(){return A("acos")}function c(){return A("asin")}function d(){return A("atan")}function f(){return A("ceil")}function p(){return A("cos")}function h(e){const t="elu";return{body:`\n const float alpha = float(${e});\n\n float ${t}_(float a) {\n return a >= 0.0 ? a: (exp(a) - 1.0) * alpha;\n }\n vec4 ${t}_(vec4 v) {\n return vec4(${t}_(v.x), ${t}_(v.y), ${t}_(v.z), ${t}_(v.w));\n }\n `,name:t,type:a.FunctionType.ValueBased}}function m(){return A("exp")}function g(){return A("floor")}function b(e,t){const n="clip";return{body:`\n const float min = float(${e});\n const float max = float(${t});\n\n float ${n}_(float a) {\n return clamp(a, min, max);\n }\n vec4 ${n}_(vec4 v) {\n return clamp(v, min, max);\n }\n `,name:n,type:a.FunctionType.ValueBased}}function y(){const e="indentity";return{body:`\n float ${e}_(float a) {\n return a;\n }\n vec4 ${e}_(vec4 v) {\n return v;\n }\n `,name:e,type:a.FunctionType.ValueBased}}function _(e){const t="leakyRelu";return{body:`\n const float alpha = float(${e});\n\n float ${t}_(float a) {\n return a < 0.0 ? a * alpha : a;\n }\n vec4 ${t}_(vec4 v) {\n return vec4(${t}_(v.x), ${t}_(v.y), ${t}_(v.z), ${t}_(v.w));\n }\n `,name:t,type:a.FunctionType.ValueBased}}function v(){return A("log")}function w(){const e="neg";return{body:`\n float ${e}_(float a) {\n return -a;\n }\n vec4 ${e}_(vec4 v) {\n return -v;\n }\n `,name:e,type:a.FunctionType.ValueBased}}function S(){const e="not";return{body:`\n float ${e}_(float a) {\n return float( ! bool(a) );\n }\n bool ${e}_(bool a) {\n return !a;\n }\n vec4 ${e}_(vec4 v) {\n return vec4(!bool(v.x), !bool(v.y), !bool(v.z), !bool(v.w));\n }\n bvec4 ${e}_(bvec4 v) {\n return bvec4(!v.x, !v.y, !v.z, !v.w);\n }\n `,name:e,type:a.FunctionType.ValueBased}}function x(){return A("sin")}function T(){const e="relu";return{body:`\n float ${e}_(float a) {\n return max( a, 0.0 );\n }\n vec4 ${e}_(vec4 v) {\n return max( v, 0.0 );\n }\n `,name:e,type:a.FunctionType.ValueBased}}function E(){const e="sigmoid";return{body:`\n float ${e}_(float a) {\n return 1.0 / (1.0 + exp(-a));\n }\n vec4 ${e}_(vec4 v) {\n return 1.0 / (1.0 + exp(-v));\n }\n `,name:e,type:a.FunctionType.ValueBased}}function k(){return A("sqrt")}function P(){return A("tan")}function O(){const e="tanh";return{body:`\n float ${e}_(float a) {\n a = clamp(a, -10., 10.);\n a = exp(2.*a);\n return (a - 1.) / (a + 1.);\n }\n vec4 ${e}_(vec4 v) {\n v = clamp(v, -10., 10.);\n v = exp(2.*v);\n return (v - 1.) / (v + 1.);\n }\n `,name:e,type:a.FunctionType.ValueBased}}function A(e){return{body:`\n float ${e}_(float a) {\n return ${e}(a);\n }\n vec4 ${e}_(vec4 v) {\n return ${e}(v);\n }\n `,name:e,type:a.FunctionType.ValueBased}}t.glslAbs=l,t.glslAcos=u,t.glslAsin=c,t.glslAtan=d,t.glslCeil=f,t.glslCos=p,t.glslElu=h,t.glslExp=m,t.glslFloor=g,t.glslClip=b,t.glslIdentity=y,t.glslLeakyRelu=_,t.glslLog=v,t.glslNeg=w,t.glslNot=S,t.glslSin=x,t.glslRelu=T,t.glslSigmoid=E,t.glslSqrt=k,t.glslTan=P,t.glslTanh=O;const R=(e,t,n,r)=>{const o=e.session.pack?s.TextureType.packed:s.TextureType.unpacked,a={name:n.name,inputTypes:[o],inputNames:["A"],cacheHint:r};return Object.assign(Object.assign({},a),{get:()=>((e,t,n,r)=>{const o=e.session.pack?s.TextureType.packed:s.TextureType.unpacked,a=(0,i.getGlsl)(e.session.backend.glContext.version);return Object.assign(Object.assign({},t),{output:{dims:n.dims,type:n.type,textureType:o},shaderSource:`\n ${r.body}\n void main() {\n vec4 v = ${a.texture2D}(A, TexCoords);\n v = ${r.name}_(v);\n ${a.output} = v;\n }\n `,hasMain:!0})})(e,a,t,n)})};t.abs=(e,t)=>[e.run(R(e,t[0],l()),t)],t.acos=(e,t)=>[e.run(R(e,t[0],u()),t)],t.asin=(e,t)=>[e.run(R(e,t[0],c()),t)],t.atan=(e,t)=>[e.run(R(e,t[0],d()),t)],t.clip=(e,t,n)=>[e.run(R(e,t[0],b(n.min,n.max),n.cacheKey),t)],t.parseClipAttributes=e=>(0,r.createAttributeWithCacheKey)({min:e.attributes.getFloat("min",o.MIN_CLIP),max:e.attributes.getFloat("max",o.MAX_CLIP)}),t.clipV11=(e,n)=>{const r=$(e,n);return(0,t.clip)(e,[n[0]],r)};const $=(e,t)=>{if(t.length>=3&&(!e.session.isInitializer(t[1].dataId)||!e.session.isInitializer(t[2].dataId)))throw new Error("dynamic clip attributes are not allowed");const n=t.length>=3?t[1].numberData[0]:o.MIN_CLIP,a=t.length>=3?t[2].numberData[0]:o.MAX_CLIP;return(0,r.createAttributeWithCacheKey)({min:n,max:a})};t.ceil=(e,t)=>[e.run(R(e,t[0],f()),t)],t.cos=(e,t)=>[e.run(R(e,t[0],p()),t)],t.elu=(e,t,n)=>[e.run(R(e,t[0],h(n.alpha),n.cacheKey),t)],t.parseEluAttributes=e=>(0,r.createAttributeWithCacheKey)({alpha:e.attributes.getFloat("alpha",1)}),t.exp=(e,t)=>[e.run(R(e,t[0],m()),t)],t.floor=(e,t)=>[e.run(R(e,t[0],g()),t)],t.identity=(e,t)=>[e.run(R(e,t[0],y()),t)],t.leakyRelu=(e,t,n)=>[e.run(R(e,t[0],_(n.alpha),n.cacheKey),t)],t.parseLeakyReluAttributes=e=>(0,r.createAttributeWithCacheKey)({alpha:e.attributes.getFloat("alpha",.01)}),t.log=(e,t)=>[e.run(R(e,t[0],v()),t)],t.neg=(e,t)=>[e.run(R(e,t[0],w()),t)],t.not=(e,t)=>[e.run(R(e,t[0],S()),t)],t.relu=(e,t)=>[e.run(R(e,t[0],T()),t)],t.sigmoid=(e,t)=>[e.run(R(e,t[0],E()),t)],t.sin=(e,t)=>[e.run(R(e,t[0],x()),t)],t.sqrt=(e,t)=>[e.run(R(e,t[0],k()),t)],t.tan=(e,t)=>[e.run(R(e,t[0],P()),t)],t.tanh=(e,t)=>[e.run(R(e,t[0],O()),t)]},5611:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createUnpackProgramInfoLoader=t.createUnpackProgramInfo=void 0;const r=n(5060),o=n(2039),a=n(9390),i=n(2827),s={name:"unpack",inputNames:["A"],inputTypes:[o.TextureType.packed]};t.createUnpackProgramInfo=(e,t)=>{const n=t.dims.length,l=(0,i.getChannels)("rc",n),u=l.slice(-2),c=(0,a.getCoordsDataType)(n),d=(0,i.unpackFromChannel)(),f=0===t.dims.length?"":function(e,t){if(1===e)return"rc";let n="";for(let r=0;r<e;r++)n+=t[r],r<e-1&&(n+=",");return n}(n,l),p=n<=1?"rc":`vec2(${u.join(",")})`,h=`\n ${d}\n void main() {\n ${c} rc = getOutputCoords();\n\n // Sample the texture with the coords to get the rgba channel value.\n vec4 packedInput = getA(${f});\n\n ${(0,r.getGlsl)(e.session.backend.glContext.version).output} = vec4(getChannel(packedInput, ${p}), 0, 0, 0);\n }\n `;return Object.assign(Object.assign({},s),{hasMain:!0,output:{dims:t.dims,type:t.type,textureType:o.TextureType.unpacked},shaderSource:h})},t.createUnpackProgramInfoLoader=(e,n)=>Object.assign(Object.assign({},s),{get:()=>(0,t.createUnpackProgramInfo)(e,n)})},8428:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseUnsqueezeAttributes=t.unsqueezeV13=t.unsqueeze=void 0;const r=n(2517);t.unsqueeze=(e,t,n)=>{o(t);const a=r.ShapeUtil.unsqueezeShape(t[0].dims,n);return[e.reshapeUnpacked(t[0],a)]},t.unsqueezeV13=(e,n)=>(a(n),(0,t.unsqueeze)(e,[n[0]],Array.from(n[1].integerData))),t.parseUnsqueezeAttributes=e=>e.attributes.getInts("axes");const o=e=>{if(!e||1!==e.length)throw new Error("Unsqueeze requires 1 input.");if("string"===e[0].type)throw new Error("invalid input tensor types.")},a=e=>{if(!e||2!==e.length)throw new Error("Unsqueeze requires 2 inputs.");if("int32"!==e[1].type)throw new Error("Invalid input type.")}},9793:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.scalesValidation=t.validateInputs=t.parseUpsampleAttributes=t.parseUpsampleAttributesV9=t.parseUpsampleAttributesV7=t.upsample=void 0;const r=n(246),o=n(5060),a=n(2039),i={name:"Upsample",inputNames:["X"],inputTypes:[a.TextureType.unpacked]};t.upsample=(e,n,r)=>((0,t.validateInputs)(n,r),[e.run(Object.assign(Object.assign({},i),{cacheHint:r.cacheKey,get:()=>s(e,n,r)}),n)]),t.parseUpsampleAttributesV7=e=>(0,t.parseUpsampleAttributes)(e,7),t.parseUpsampleAttributesV9=e=>(0,t.parseUpsampleAttributes)(e,9),t.parseUpsampleAttributes=(e,n)=>{const o=n>=10,a=e.attributes.getString("mode","nearest");if("nearest"!==a&&"linear"!==a&&(n<11||"cubic"!==a))throw new Error(`unrecognized mode: ${a}`);let i=[];n<9&&(i=e.attributes.getFloats("scales"),(0,t.scalesValidation)(i,a,o));const s=e.attributes.getFloat("extrapolation_value",0),l=n>10?e.attributes.getString("coordinate_transformation_mode","half_pixel"):"asymmetric";if(-1===["asymmetric","pytorch_half_pixel","tf_half_pixel_for_nn","align_corners","tf_crop_and_resize","half_pixel"].indexOf(l))throw new Error(`coordinate_transform_mode '${l}' is not supported`);const u="tf_crop_and_resize"===l,c=u,d="nearest"===a&&n>=11?e.attributes.getString("nearest_mode","round_prefer_floor"):"";if(-1===["round_prefer_floor","round_prefer_ceil","floor","ceil",""].indexOf(d))throw new Error(`nearest_mode '${d}' is not supported`);const f=e.attributes.getFloat("cubic_coeff_a",-.75),p=0!==e.attributes.getInt("exclude_outside",0);if(p&&"cubic"!==a)throw new Error("exclude_outside can be set to 1 only when mode is CUBIC.");const h=n<11||"nearest"===a&&"asymmetric"===l&&"floor"===d;let m=0,g=0,b=0;return n>10?e.inputs.length>2?(m=1,g=2,b=3):(g=1,b=2):9===n&&(g=1),(0,r.createAttributeWithCacheKey)({opset:n,isResize:o,mode:a,scales:i,extrapolationValue:s,coordinateTransformMode:l,useExtrapolation:c,needRoiInput:u,nearestMode:d,cubicCoefficientA:f,excludeOutside:p,useNearest2xOptimization:h,roiInputIdx:m,scalesInputIdx:g,sizesInputIdx:b})};const s=(e,t,n)=>{const r=(0,o.getGlsl)(e.session.backend.glContext.version),[s,l]=e.calculateTextureWidthAndHeight(t[0].dims,a.TextureType.unpacked),u=t[0].dims.map((e,t)=>Math.floor(e*n.scales[t])),[c,d]=e.calculateTextureWidthAndHeight(u,a.TextureType.unpacked),f=u.length,p=new Array(f),h=new Array(f);let m=`\n int output_pitches[${f}];\n int input_pitches[${f}];\n `;for(let o=f-1;o>=0;o--)p[o]=o===f-1?1:p[o+1]*u[o+1],h[o]=o===f-1?1:h[o+1]*t[0].dims[o+1],m+=`\n output_pitches[${o}] = ${p[o]};\n input_pitches[${o}] = ${h[o]};\n `;const g=`\n float getInputFloat(int index) {\n vec2 coords = offsetToCoords(index, ${s}, ${l});\n float value = getColorAsFloat(${r.texture2D}(X, coords));\n return value;\n }\n `,b="nearest"===n.mode?`\n ${g}\n float process(int indices[${f}]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ${c}, ${d});\n\n ${m}\n\n int d, m;\n for (int dim = 0; dim < ${f}; ++dim) {\n d = output_index / output_pitches[dim];\n m = output_index - d * output_pitches[dim];\n output_index = m;\n\n if (scales[dim] != 1 && d > 0) {\n int d2 = d / scales[dim];\n m = d - d2 * scales[dim];\n d = d2;\n }\n input_index += input_pitches[dim] * d;\n }\n\n return getInputFloat(input_index);\n }`:4===f?`\n ${g}\n float process(int indices[4]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ${c}, ${d});\n\n ${m}\n\n int m;\n int index_of_dim0, index_of_dim1, index_of_dim2, index_of_dim3;\n index_of_dim0 = output_index / output_pitches[0];\n m = output_index - index_of_dim0 * output_pitches[0];\n index_of_dim1 = m / output_pitches[1];\n m = m - index_of_dim1 * output_pitches[1];\n index_of_dim2 = m / output_pitches[2];\n m = m - index_of_dim2 * output_pitches[2];\n index_of_dim3 = m;\n\n int index_of_input_dim2, index_of_input_dim3, x_offset, y_offset;\n index_of_input_dim2 = index_of_dim2 / scales[2];\n y_offset = index_of_dim2 - index_of_input_dim2 * scales[2];\n index_of_input_dim3 = index_of_dim3 / scales[3];\n x_offset = index_of_dim3 - index_of_input_dim3 * scales[3];\n\n input_index = index_of_dim0 * input_pitches[0] +\n index_of_dim1 * input_pitches[1] +\n index_of_input_dim2 * input_pitches[2] +\n index_of_input_dim3;\n\n float x00 = getInputFloat(input_index);\n float x10, x01, x11;\n\n bool end_of_dim2 = false;\n if (index_of_input_dim2 == (${t[0].dims[2]} - 1)) {\n // It's the end in dimension 2\n x01 = x00;\n end_of_dim2 = true;\n } else {\n x01 = getInputFloat(input_index + input_pitches[2]);\n }\n\n if (index_of_input_dim3 == (input_pitches[2] - 1)) {\n // It's the end in dimension 3\n x10 = x00;\n x11 = x01;\n }\n else {\n x10 = getInputFloat(input_index + 1);\n x11 = end_of_dim2 ? x10 : getInputFloat(input_index + input_pitches[2] + 1);\n }\n\n float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[2]);\n float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[2]);\n return y0 + float(x_offset) * (y1 - y0) / float(scales[3]);\n }`:`\n ${g}\n float process(int indices[2]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ${c}, ${d});\n\n ${m}\n\n int m;\n int index_of_dim0, index_of_dim1;\n index_of_dim0 = output_index / output_pitches[0];\n m = output_index - index_of_dim0 * output_pitches[0];\n index_of_dim1 = m;\n\n int index_of_input_dim0, index_of_input_dim1, x_offset, y_offset;\n index_of_input_dim0 = index_of_dim0 / scales[0];\n y_offset = index_of_dim0 - index_of_input_dim0 * scales[0];\n index_of_input_dim1 = index_of_dim1 / scales[1];\n x_offset = index_of_dim1 - index_of_input_dim1 * scales[1];\n\n input_index = index_of_input_dim0 * input_pitches[0] + index_of_input_dim1;\n\n float x00 = getInputFloat(input_index);\n float x10, x01, x11;\n\n bool end_of_dim0 = false;\n if (index_of_input_dim0 == (${t[0].dims[0]} - 1)) {\n // It's the end in dimension 0\n x01 = x00;\n end_of_dim0 = true;\n } else {\n x01 = getInputFloat(input_index + input_pitches[0]);\n }\n\n if (index_of_input_dim1 == (input_pitches[0] - 1)) {\n // It's the end in dimension 1\n x10 = x00;\n x11 = x01;\n }\n else {\n x10 = getInputFloat(input_index + 1);\n x11 = end_of_dim0 ? x10 : getInputFloat(input_index + input_pitches[0] + 1);\n }\n\n float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[0]);\n float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[0]);\n return y0 + float(x_offset) * (y1 - y0) / float(scales[1]);\n }`;return Object.assign(Object.assign({},i),{output:{dims:u,type:t[0].type,textureType:a.TextureType.unpacked},shaderSource:b,variables:[{name:"scales",type:"int",arrayLength:n.scales.length,data:n.scales.map(e=>Math.ceil(e))}]})};t.validateInputs=(e,t)=>{if(!e||t.opset<9&&1!==e.length||t.opset>=9&&t.opset<11&&2!==e.length||t.opset>=11&&e.length<2)throw new Error("invalid inputs.");if(t.scales.length>0&&e[0].dims.length!==t.scales.length)throw new Error("Invalid input shape.");if("string"===e[0].type)throw new Error("Invalid input tensor types.")},t.scalesValidation=(e,t,n)=>{if(n){for(const r of e)if(r<=0)throw new Error("Scale value should be greater than 0.")}else for(const r of e)if(r<1)throw new Error("Scale value should be greater than or equal to 1.");if(!("linear"!==t&&"cubic"!==t||2===e.length||4===e.length&&1===e[0]&&1===e[1]))throw new Error(`'Linear' mode and 'Cubic' mode only support 2-D inputs ('Bilinear', 'Bicubic') or 4-D inputs with the corresponding outermost 2 scale values being 1 in the ${n?"Resize":"Upsample"} opeartor.`)}},1958:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProgramManager=void 0;const r=n(1670),o=n(6231),a=n(8879),i=n(5060);t.ProgramManager=class{constructor(e,t,n){this.profiler=e,this.glContext=t,this.textureLayoutStrategy=n,this.repo=new Map,this.attributesBound=!1}getArtifact(e){return this.repo.get(e)}setArtifact(e,t){this.repo.set(e,t)}run(e,t,n){var r;this.profiler.event("op",`ProgramManager.run ${null!==(r=e.programInfo.name)&&void 0!==r?r:"unknown kernel"}`,()=>{var r;const a=this.glContext.gl,i=e.program;a.useProgram(i);try{this.bindOutput(n),this.attributesBound||this.bindAttributes(e.attribLocations),this.bindUniforms(e.uniformLocations,null!==(r=e.programInfo.variables)&&void 0!==r?r:[],t)}catch(s){throw o.Logger.error("ProgramManager",e.programInfo.shaderSource),s}this.profiler.event("backend","GlContext.draw()",()=>{this.glContext.draw()})},this.glContext)}dispose(){this.vertexShader&&this.glContext.deleteShader(this.vertexShader),this.repo.forEach(e=>this.glContext.deleteProgram(e.program))}build(e,t,n){return this.profiler.event("backend","ProgramManager.build",()=>{const r=new a.GlslPreprocessor(this.glContext,e,t,n),o=r.preprocess(),i=this.compile(o);return{programInfo:e,program:i,uniformLocations:this.getUniformLocations(i,r.context.programInfo.inputNames,r.context.programInfo.variables),attribLocations:this.getAttribLocations(i)}})}compile(e){if(!this.vertexShader){o.Logger.verbose("ProrgramManager","Compiling and caching Vertex shader for the first time");const e=(0,i.getVertexShaderSource)(this.glContext.version);this.vertexShader=this.glContext.compileShader(e,this.glContext.gl.VERTEX_SHADER)}r.env.debug&&o.Logger.verbose("ProrgramManager",`FragShader:\n${e}\n`);const t=this.glContext.compileShader(e,this.glContext.gl.FRAGMENT_SHADER),n=this.glContext.createProgram(this.vertexShader,t);return this.glContext.deleteShader(t),n}bindOutput(e){const t=e.width,n=e.height;o.Logger.verbose("ProrgramManager",`Binding output texture to Framebuffer: w/h=${t}/${n}, shape=${e.shape}, type=${e.tensor.type}`),this.glContext.attachFramebuffer(e.texture,t,n)}bindAttributes(e){const t=e.position,n=e.textureCoord;this.glContext.setVertexAttributes(t,n),this.attributesBound=!0}bindUniforms(e,t,n){var r;const o=this.glContext.gl;let a=0;for(const{name:i,type:s,location:l,arrayLength:u}of e){const e=null===(r=t.find(e=>e.name===i))||void 0===r?void 0:r.data;if("sampler2D"!==s&&!e)throw new Error(`variable '${i}' does not have data defined in program info`);switch(s){case"sampler2D":this.bindTexture(n[a],l,a),a++;break;case"float":u?o.uniform1fv(l,e):o.uniform1f(l,e);break;case"int":u?o.uniform1iv(l,e):o.uniform1i(l,e);break;default:throw new Error(`Uniform not implemented: ${s}`)}}}bindTexture(e,t,n){this.glContext.bindTextureToUniform(e.texture,n,t)}getAttribLocations(e){return{position:this.getAttribLocation(e,"position"),textureCoord:this.getAttribLocation(e,"textureCoord")}}getUniformLocations(e,t,n){const r=[];if(t)for(const o of t)r.push({name:o,type:"sampler2D",location:this.getUniformLocation(e,o)});if(n)for(const o of n)r.push(Object.assign(Object.assign({},o),{location:this.getUniformLocation(e,o.name)}));return r}getUniformLocation(e,t){const n=this.glContext.gl.getUniformLocation(e,t);if(null===n)throw new Error(`Uniform ${t} not found.`);return n}getAttribLocation(e,t){return this.glContext.gl.getAttribLocation(e,t)}}},6416:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WebGLSessionHandler=void 0;const r=n(6231),o=n(1047),a=n(8316),i=n(1640),s=n(1958),l=n(7859),u=n(5702);t.WebGLSessionHandler=class{constructor(e,t){this.backend=e,this.context=t,this.layoutStrategy=new l.PreferLogicalStrategy(e.glContext.maxTextureSize),this.programManager=new s.ProgramManager(this.context.profiler,e.glContext,this.layoutStrategy),this.textureManager=new u.TextureManager(e.glContext,this.layoutStrategy,this.context.profiler,{reuseTextures:"full"===e.textureCacheMode}),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map,this.pack=e.pack,this.pack2unpackMap=new Map,this.unpack2packMap=new Map}createInferenceHandler(){return new a.WebGLInferenceHandler(this)}onGraphInitialized(e){const t=e.getValues().filter(e=>-1===e.from&&e.tensor).map(e=>e.tensor.dataId);this.initializers=new Set(t)}isInitializer(e){return!!this.initializers&&this.initializers.has(e)}addInitializer(e){this.initializers.add(e)}getTextureData(e,t){return t?this.packedTextureDataCache.get(e):this.unpackedTextureDataCache.get(e)}setTextureData(e,t,n=!1){r.Logger.verbose("WebGLSessionHandler","Storing Texture data in cache"),n?this.packedTextureDataCache.set(e,t):this.unpackedTextureDataCache.set(e,t)}dispose(){this.programManager.dispose(),this.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach(e=>this.textureManager.releaseTexture(e,!0)),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach(e=>this.textureManager.releaseTexture(e,!0)),this.unpackedTextureDataCache=new Map}resolve(e,t,n){const r=(0,o.resolveOperator)(e,t,i.WEBGL_OP_RESOLVE_RULES);return{impl:r.opImpl,context:r.opInit?r.opInit(e,n):e}}}},7769:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Uint8DataEncoder=t.RGBAFloatDataEncoder=t.RedFloat32DataEncoder=void 0;const r=n(6231);t.RedFloat32DataEncoder=class{constructor(e,t=1){if(1===t)this.internalFormat=e.R32F,this.format=e.RED,this.textureType=e.FLOAT,this.channelSize=t;else{if(4!==t)throw new Error(`Invalid number of channels: ${t}`);this.internalFormat=e.RGBA32F,this.format=e.RGBA,this.textureType=e.FLOAT,this.channelSize=t}}encode(e,t){let n,o;return e.constructor!==Float32Array&&(r.Logger.warning("Encoder","data was not of type Float32; creating new Float32Array"),o=new Float32Array(e)),t*this.channelSize>e.length?(r.Logger.warning("Encoder","Source data too small. Allocating larger array"),o=e,n=this.allocate(t*this.channelSize),o.forEach((e,t)=>n[t]=e)):(o=e,n=o),n}allocate(e){return new Float32Array(4*e)}decode(e,t){return 1===this.channelSize?e.filter((e,t)=>t%4==0).subarray(0,t):e.subarray(0,t)}},t.RGBAFloatDataEncoder=class{constructor(e,t=1,n){if(1!==t&&4!==t)throw new Error(`Invalid number of channels: ${t}`);this.internalFormat=e.RGBA,this.format=e.RGBA,this.channelSize=t,this.textureType=n||e.FLOAT}encode(e,t){let n=e;return 1===this.channelSize&&(r.Logger.verbose("Encoder","Exploding into a larger array"),n=this.allocate(t),e.forEach((e,t)=>n[4*t]=e)),n}allocate(e){return new Float32Array(4*e)}decode(e,t){return 1===this.channelSize?e.filter((e,t)=>t%4==0).subarray(0,t):e.subarray(0,t)}},t.Uint8DataEncoder=class{constructor(e,t=1){if(this.channelSize=4,1===t)this.internalFormat=e.ALPHA,this.format=e.ALPHA,this.textureType=e.UNSIGNED_BYTE,this.channelSize=t;else{if(4!==t)throw new Error(`Invalid number of channels: ${t}`);this.internalFormat=e.RGBA,this.format=e.RGBA,this.textureType=e.UNSIGNED_BYTE,this.channelSize=t}}encode(e,t){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}allocate(e){return new Uint8Array(e*this.channelSize)}decode(e,t){if(e instanceof Uint8Array)return e.subarray(0,t);throw new Error(`Invalid array type: ${e.constructor}`)}}},7859:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getBatchDim=t.sizeToSquarishShape=t.getRowsCols=t.sizeFromShape=t.isInt=t.parseAxisParam=t.squeezeShape=t.PreferLogicalStrategy=t.AlwaysKeepOriginalSizeStrategy=void 0;const r=n(6231),o=n(2517);function a(e,t){const n=[],r=[],o=null!=t&&Array.isArray(t)&&0===t.length,a=null==t||o?null:i(t,e).sort();let s=0;for(let i=0;i<e.length;++i){if(null!=a){if(a[s]===i&&1!==e[i])throw new Error(`Can't squeeze axis ${i} since its dim '${e[i]}' is not 1`);(null==a[s]||a[s]>i)&&1===e[i]&&(n.push(e[i]),r.push(i)),a[s]<=i&&s++}1!==e[i]&&(n.push(e[i]),r.push(i))}return{newShape:n,keptDims:r}}function i(e,t){const n=t.length;return e=null==e?t.map((e,t)=>t):[].concat(e),(0,o.assert)(e.every(e=>e>=-n&&e<n),()=>`All values in axis param must be in range [-${n}, ${n}) but got axis ${e}`),(0,o.assert)(e.every(s),()=>`All values in axis param must be integers but got axis ${e}`),e.map(e=>e<0?n+e:e)}function s(e){return e%1==0}function l(e){if(0===e.length)return 1;let t=e[0];for(let n=1;n<e.length;n++)t*=e[n];return t}function u(e){const t=Math.ceil(Math.sqrt(e));return[t,Math.ceil(e/t)]}t.AlwaysKeepOriginalSizeStrategy=class{constructor(e){this.maxTextureSize=e}computeTextureWH(e,t){if(0===e.length)return[1,1];const n=this.maxTextureSize;if(t&&void 0!==t.breakAxis){const o=t.breakAxis>=e.length?1:e.slice(t.breakAxis).reduce((e,t)=>e*t),a=t.breakAxis<=0?1:e.slice(0,t.breakAxis).reduce((e,t)=>e*t);if(!(o>n||a>n))return[o,a];r.Logger.verbose("TextureLayout",`Given width/height preferences were unattainable: shape:${e}, breakAxis:${t.breakAxis}`)}const o=e.reduce((e,t)=>e*t);let a=Math.floor(Math.sqrt(o));for(;a<n&&a<o&&o%a!=0;a++);if(a>=n||o%a!=0)throw new Error(`The given dimensions are outside this GPU's boundaries: ${e}`);return[a,o/a]}},t.PreferLogicalStrategy=class{constructor(e){this.maxTextureSize=e}computeTextureWH(e,t){const n=this.computeTexture(e,t);return t&&t.isPacked&&(n[0]/=2,n[1]/=2),t&&t.reverseWH?[n[1],n[0]]:n}computeTexture(e,t){const n=t&&t.isPacked;if(0===e.length)return n?[2,2]:[1,1];let o=this.maxTextureSize;if(t&&void 0!==t.breakAxis){const n=t.breakAxis>=e.length?1:e.slice(t.breakAxis).reduce((e,t)=>e*t),a=t.breakAxis<=0?1:e.slice(0,t.breakAxis).reduce((e,t)=>e*t);if(!(n>o||a>o))return[n,a];r.Logger.verbose("TextureLayout",`Given width/height preferences were unattainable: shape:${e}, breakAxis:${t.breakAxis}`)}let i=e.slice(0);if(n&&(o*=2,i=i.map((e,t)=>t>=i.length-2?i[t]%2==0?i[t]:i[t]+1:i[t]),1===i.length&&(i=[2,i[0]])),2!==i.length){const e=a(i);i=e.newShape}const s=l(i);return i.length<=1&&s<=o?[1,s]:2===i.length&&i[0]<=o&&i[1]<=o?i:3===i.length&&i[0]*i[1]<=o&&i[2]<=o?[i[0]*i[1],i[2]]:3===i.length&&i[0]<=o&&i[1]*i[2]<=o?[i[0],i[1]*i[2]]:4===i.length&&i[0]*i[1]*i[2]<=o&&i[3]<=o?[i[0]*i[1]*i[2],i[3]]:4===i.length&&i[0]<=o&&i[1]*i[2]*i[3]<=o?[i[0],i[1]*i[2]*i[3]]:n?u(s/4).map(e=>2*e):u(s)}},t.squeezeShape=a,t.parseAxisParam=i,t.isInt=s,t.sizeFromShape=l,t.getRowsCols=function(e){if(0===e.length)throw Error("Cannot get rows and columns of an empty shape array.");return[e.length>1?e[e.length-2]:1,e[e.length-1]]},t.sizeToSquarishShape=u,t.getBatchDim=function(e,t=2){return l(e.slice(0,e.length-t))}},4057:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createTextureLayoutFromShape=t.calculateTextureWidthAndHeight=t.createTextureLayoutFromTextureType=void 0;const r=n(2517),o=n(2039);t.createTextureLayoutFromTextureType=(e,n,r)=>{const a=r===o.TextureType.unpacked||r===o.TextureType.unpackedReversed?1:4,i=r===o.TextureType.packed,s=r===o.TextureType.unpackedReversed||r===o.TextureType.packed,l=r===o.TextureType.packedLastDimension?n.length-1:void 0,u=r===o.TextureType.packedLastDimension?n.map((e,t)=>t===n.length-1?4*e:e):void 0;return(0,t.createTextureLayoutFromShape)(e,n,a,u,{isPacked:i,reverseWH:s,breakAxis:l})},t.calculateTextureWidthAndHeight=(e,n,r)=>{const o=(0,t.createTextureLayoutFromTextureType)(e,n,r);return[o.width,o.height]},t.createTextureLayoutFromShape=(e,t,n=1,o,a)=>{const i=!(!a||!a.isPacked),[s,l]=e.computeTextureWH(i&&o||t,a),u=t.length;let c=t.slice(0);if(0===u&&(c=[1]),1===n)o=t;else if(i){if(4!==n)throw new Error("a packed texture must be 4-channel");o=t,u>0&&(c[u-1]=Math.ceil(c[u-1]/2)),u>1&&(c[u-2]=Math.ceil(c[u-2]/2))}else if(!o)throw new Error("Unpacked shape is needed when using channels > 1");return{width:s,height:l,channels:n,isPacked:i,shape:c,strides:r.ShapeUtil.computeStrides(c),unpackedShape:o,reversedWH:a&&a.reverseWH}}},5702:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextureManager=void 0;const r=n(6231);t.TextureManager=class{constructor(e,t,n,r){this.glContext=e,this.layoutStrategy=t,this.profiler=n,this.config=r,this.pendingRead=new Map,r.reuseTextures&&(this.inUseTextures=new Map,this.idleTextures=new Map,this.textureLookup=new Map)}createTextureFromLayout(e,t,n,o){const a=this.toEncoderType(e),i=this.glContext.getEncoder(a,t.channels||1,o);if(t.isPacked&&1===o)throw new Error("not implemented");const s=t.width,l=t.height;let u,c;if(this.config.reuseTextures){u=`${s}x${l}_${i.format}_${i.internalFormat}_${i.textureType}`,c=this.inUseTextures.get(u),c||(c=[],this.inUseTextures.set(u,c));const t=this.idleTextures.get(u);if(t&&t.length>0){const r=t.pop();return c.push(r),1===o&&this.glContext.updateTexture(r,s,l,i,this.toTextureData(e,n)),r}}r.Logger.verbose("TextureManager",`Creating new texture of size ${t.width}x${t.height}`);const d=this.glContext.allocateTexture(s,l,i,this.toTextureData(e,n));return this.config.reuseTextures&&(c.push(d),this.textureLookup.set(d,u)),d}readTexture(e,t,n){return n||(n=1),this.profiler.event("backend","TextureManager.readTexture",()=>{const r=e.shape.reduce((e,t)=>e*t)*n,o=this.glContext.readTexture(e.texture,e.width,e.height,r,this.toEncoderType(t),n);return this.toTensorData(t,o)})}async readTextureAsync(e,t,n){const r=e.tensor.dataId;if(n||(n=1),this.pendingRead.has(r)){const e=this.pendingRead.get(r);return new Promise(t=>null==e?void 0:e.push(t))}return this.profiler.event("backend","TextureManager.readTextureAsync",async()=>{this.pendingRead.set(r,[]);const o=e.shape.reduce((e,t)=>e*t)*n;await this.glContext.createAndWaitForFence();const a=this.glContext.readTexture(e.texture,e.width,e.height,o,this.toEncoderType(t),n),i=this.toTensorData(t,a),s=this.pendingRead.get(r);return this.pendingRead.delete(r),null==s||s.forEach(e=>e(i)),i})}readUint8TextureAsFloat(e){return this.profiler.event("backend","TextureManager.readUint8TextureAsFloat",()=>{const t=e.shape.reduce((e,t)=>e*t),n=this.glContext.readTexture(e.texture,e.width,e.height,4*t,"byte",4);return new Float32Array(n.buffer,n.byteOffset,t)})}releaseTexture(e,t){let n;if(this.config.reuseTextures&&(n=this.textureLookup.get(e.texture),n)){t&&this.textureLookup.delete(n);const r=this.inUseTextures.get(n);if(r){const t=r.indexOf(e.texture);if(-1!==t){r.splice(t,1);let o=this.idleTextures.get(n);o||(o=[],this.idleTextures.set(n,o)),o.push(e.texture)}}}n&&!t||(r.Logger.verbose("TextureManager",`Deleting texture of size ${e.width}x${e.height}`),this.glContext.deleteTexture(e.texture))}toTensorData(e,t){switch(e){case"int16":return t instanceof Int16Array?t:Int16Array.from(t);case"int32":return t instanceof Int32Array?t:Int32Array.from(t);case"int8":return t instanceof Int8Array?t:Int8Array.from(t);case"uint16":return t instanceof Uint16Array?t:Uint16Array.from(t);case"uint32":return t instanceof Uint32Array?t:Uint32Array.from(t);case"uint8":case"bool":return t instanceof Uint8Array?t:Uint8Array.from(t);case"float32":return t instanceof Float32Array?t:Float32Array.from(t);case"float64":return t instanceof Float64Array?t:Float64Array.from(t);default:throw new Error(`TensorData type ${e} is not supported`)}}toTextureData(e,t){if(t)return t instanceof Float32Array?t:new Float32Array(t)}toEncoderType(e){return"float"}clearActiveTextures(){this.glContext.clearActiveTextures()}}},2039:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.TextureType=void 0,(n=t.TextureType||(t.TextureType={}))[n.unpacked=0]="unpacked",n[n.unpackedReversed=1]="unpackedReversed",n[n.packed=2]="packed",n[n.downloadUint8AsFloat=3]="downloadUint8AsFloat",n[n.packedLastDimension=4]="packedLastDimension"},9390:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getGlChannels=t.getCoordsDataType=t.getSqueezedParams=t.squeezeInputShape=t.generateShaderFuncNameFromInputSamplerNameAtOutCoords=t.generateShaderFuncNameFromInputSamplerName=t.repeatedTry=t.getPackedShape=void 0;const r=n(2517);t.getPackedShape=function(e){const t=e.length;return e.slice(0,t-1).concat(e[t-1]/4)},t.repeatedTry=async function(e,t=e=>0,n){return new Promise((r,o)=>{let a=0;const i=()=>{if(e())return void r();a++;const s=t(a);null!=n&&a>=n?o():setTimeout(i,s)};i()})},t.generateShaderFuncNameFromInputSamplerName=function(e){return(0,r.assert)(void 0!==e&&0!==e.length,()=>"empty string found for sampler name"),"get"+e.charAt(0).toUpperCase()+e.slice(1)},t.generateShaderFuncNameFromInputSamplerNameAtOutCoords=function(e){return(0,r.assert)(void 0!==e&&0!==e.length,()=>"empty string found for sampler name"),"get"+e.charAt(0).toUpperCase()+e.slice(1)+"AtOutCoords"},t.squeezeInputShape=function(e,t){let n=JSON.parse(JSON.stringify(e));return n=t,n},t.getSqueezedParams=function(e,t){return t.map(t=>e[t]).join(", ")},t.getCoordsDataType=function(e){if(e<=1)return"int";if(2===e)return"ivec2";if(3===e)return"ivec3";if(4===e)return"ivec4";if(5===e)return"ivec5";if(6===e)return"ivec6";throw Error(`GPU for rank ${e} is not yet supported`)},t.getGlChannels=function(e=6){return["x","y","z","w","u","v"].slice(0,e)}},7305:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createNewWebGLContext=t.createWebGLContext=void 0;const r=n(6231),o=n(1713),a={};function i(e){const t=function(){if("undefined"==typeof document){if("undefined"==typeof OffscreenCanvas)throw new TypeError("failed to create canvas: OffscreenCanvas is not supported");return new OffscreenCanvas(1,1)}const e=document.createElement("canvas");return e.width=1,e.height=1,e}();let n;const a={alpha:!1,depth:!1,antialias:!1,stencil:!1,preserveDrawingBuffer:!1,premultipliedAlpha:!1,failIfMajorPerformanceCaveat:!1};if((!e||"webgl2"===e)&&(n=t.getContext("webgl2",a),n))try{return new o.WebGLContext(n,2)}catch(i){r.Logger.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl2'. Error: ${i}`)}if((!e||"webgl"===e)&&(n=t.getContext("webgl",a)||t.getContext("experimental-webgl",a),n))try{return new o.WebGLContext(n,1)}catch(i){r.Logger.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl' or 'experimental-webgl'. Error: ${i}`)}throw new Error("WebGL is not supported")}t.createWebGLContext=function e(t){let n;t&&"webgl2"!==t||!("webgl2"in a)?t&&"webgl"!==t||!("webgl"in a)||(n=a.webgl):n=a.webgl2,n=n||i(t),t=t||1===n.version?"webgl":"webgl2";const r=n.gl;return a[t]=n,r.isContextLost()?(delete a[t],e(t)):(r.disable(r.DEPTH_TEST),r.disable(r.STENCIL_TEST),r.disable(r.BLEND),r.disable(r.DITHER),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SAMPLE_COVERAGE),r.enable(r.SCISSOR_TEST),r.enable(r.CULL_FACE),r.cullFace(r.BACK),n)},t.createNewWebGLContext=i},1713:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.WebGLContext=t.linearSearchLastTrue=void 0;const i=n(1670),s=a(n(7769)),l=n(9390);function u(e){let t=0;for(;t<e.length&&e[t]();++t);return t-1}t.linearSearchLastTrue=u,t.WebGLContext=class{constructor(e,t){this.frameBufferBound=!1,this.itemsToPoll=[],this.gl=e,this.version=t,this.getExtensions(),this.vertexbuffer=this.createVertexbuffer(),this.framebuffer=this.createFramebuffer(),this.queryVitalParameters()}allocateTexture(e,t,n,r){const o=this.gl,a=o.createTexture();o.bindTexture(o.TEXTURE_2D,a),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.NEAREST),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.NEAREST),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE);const i=r?n.encode(r,e*t):null;return o.texImage2D(o.TEXTURE_2D,0,n.internalFormat,e,t,0,n.format,n.textureType,i),this.checkError(),a}updateTexture(e,t,n,r,o){const a=this.gl;a.bindTexture(a.TEXTURE_2D,e);const i=r.encode(o,t*n);a.texSubImage2D(a.TEXTURE_2D,0,0,0,t,n,r.format,r.textureType,i),this.checkError()}attachFramebuffer(e,t,n){const r=this.gl;r.bindTexture(r.TEXTURE_2D,e),r.bindFramebuffer(r.FRAMEBUFFER,this.framebuffer),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e,0),this.checkError(),r.viewport(0,0,t,n),r.scissor(0,0,t,n)}readTexture(e,t,n,r,o,a){const i=this.gl;a||(a=1),this.frameBufferBound||this.attachFramebuffer(e,t,n);const s=this.getEncoder(o,a),l=s.allocate(t*n);return i.bindTexture(i.TEXTURE_2D,e),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,e,0),i.readPixels(0,0,t,n,i.RGBA,s.textureType,l),this.checkError(),s.decode(l,r)}isFramebufferReady(){return!0}getActiveTexture(){const e=this.gl;return"TEXTURE"+(e.getParameter(this.gl.ACTIVE_TEXTURE)-e.TEXTURE0)}getTextureBinding(){return this.gl.getParameter(this.gl.TEXTURE_BINDING_2D)}getFramebufferBinding(){return this.gl.getParameter(this.gl.FRAMEBUFFER_BINDING)}setVertexAttributes(e,t){const n=this.gl;n.vertexAttribPointer(e,3,n.FLOAT,!1,20,0),n.enableVertexAttribArray(e),-1!==t&&(n.vertexAttribPointer(t,2,n.FLOAT,!1,20,12),n.enableVertexAttribArray(t)),this.checkError()}createProgram(e,t){const n=this.gl,r=n.createProgram();return n.attachShader(r,e),n.attachShader(r,t),n.linkProgram(r),r}compileShader(e,t){const n=this.gl,r=n.createShader(t);if(!r)throw new Error(`createShader() returned null with type ${t}`);if(n.shaderSource(r,e),n.compileShader(r),!1===n.getShaderParameter(r,n.COMPILE_STATUS))throw new Error(`Failed to compile shader: ${n.getShaderInfoLog(r)}\nShader source:\n${e}`);return r}deleteShader(e){this.gl.deleteShader(e)}bindTextureToUniform(e,t,n){const r=this.gl;r.activeTexture(r.TEXTURE0+t),this.checkError(),r.bindTexture(r.TEXTURE_2D,e),this.checkError(),r.uniform1i(n,t),this.checkError()}draw(){this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4),this.checkError()}checkError(){if(i.env.debug){const e=this.gl,t=e.getError();let n="";switch(t){case e.NO_ERROR:return;case e.INVALID_ENUM:n="INVALID_ENUM";break;case e.INVALID_VALUE:n="INVALID_VALUE";break;case e.INVALID_OPERATION:n="INVALID_OPERATION";break;case e.INVALID_FRAMEBUFFER_OPERATION:n="INVALID_FRAMEBUFFER_OPERATION";break;case e.OUT_OF_MEMORY:n="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n="CONTEXT_LOST_WEBGL";break;default:n=`Unknown WebGL Error: ${t.toString(16)}`}throw new Error(n)}}deleteTexture(e){this.gl.deleteTexture(e)}deleteProgram(e){this.gl.deleteProgram(e)}getEncoder(e,t,n=0){if(2===this.version)return new s.RedFloat32DataEncoder(this.gl,t);switch(e){case"float":return 1===n||this.isRenderFloat32Supported?new s.RGBAFloatDataEncoder(this.gl,t):new s.RGBAFloatDataEncoder(this.gl,t,this.textureHalfFloatExtension.HALF_FLOAT_OES);case"int":throw new Error("not implemented");case"byte":return new s.Uint8DataEncoder(this.gl,t);default:throw new Error(`Invalid dataType: ${e}`)}}clearActiveTextures(){const e=this.gl;for(let t=0;t<this.maxTextureImageUnits;++t)e.activeTexture(e.TEXTURE0+t),e.bindTexture(e.TEXTURE_2D,null)}dispose(){if(this.disposed)return;const e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteFramebuffer(this.framebuffer),e.bindBuffer(e.ARRAY_BUFFER,null),e.deleteBuffer(this.vertexbuffer),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null),e.finish(),this.disposed=!0}createDefaultGeometry(){return new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0])}createVertexbuffer(){const e=this.gl,t=e.createBuffer();if(!t)throw new Error("createBuffer() returned null");const n=this.createDefaultGeometry();return e.bindBuffer(e.ARRAY_BUFFER,t),e.bufferData(e.ARRAY_BUFFER,n,e.STATIC_DRAW),this.checkError(),t}createFramebuffer(){const e=this.gl.createFramebuffer();if(!e)throw new Error("createFramebuffer returned null");return e}queryVitalParameters(){const e=this.gl;if(this.isFloatTextureAttachableToFrameBuffer=this.checkFloatTextureAttachableToFrameBuffer(),this.isRenderFloat32Supported=this.checkRenderFloat32(),this.isFloat32DownloadSupported=this.checkFloat32Download(),1===this.version&&!this.textureHalfFloatExtension&&!this.isRenderFloat32Supported)throw new Error("both float32 and float16 TextureType are not supported");this.isBlendSupported=!this.isRenderFloat32Supported||this.checkFloat32Blend(),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),this.maxTextureImageUnits=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),this.version}getExtensions(){2===this.version?(this.colorBufferFloatExtension=this.gl.getExtension("EXT_color_buffer_float"),this.disjointTimerQueryWebgl2Extension=this.gl.getExtension("EXT_disjoint_timer_query_webgl2")):(this.textureFloatExtension=this.gl.getExtension("OES_texture_float"),this.textureHalfFloatExtension=this.gl.getExtension("OES_texture_half_float"))}checkFloatTextureAttachableToFrameBuffer(){const e=this.gl,t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);const n=2===this.version?e.RGBA32F:e.RGBA;e.texImage2D(e.TEXTURE_2D,0,n,1,1,0,e.RGBA,e.FLOAT,null);const r=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0);const o=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(t),e.deleteFramebuffer(r),o}checkRenderFloat32(){if(2===this.version){if(!this.colorBufferFloatExtension)return!1}else if(!this.textureFloatExtension)return!1;return this.isFloatTextureAttachableToFrameBuffer}checkFloat32Download(){if(2===this.version){if(!this.colorBufferFloatExtension)return!1}else{if(!this.textureFloatExtension)return!1;if(!this.gl.getExtension("WEBGL_color_buffer_float"))return!1}return this.isFloatTextureAttachableToFrameBuffer}checkFloat32Blend(){const e=this.gl;let t,n,r,o,a;try{t=e.createTexture(),n=e.createFramebuffer(),e.bindTexture(e.TEXTURE_2D,t);const i=2===this.version?e.RGBA32F:e.RGBA;return e.texImage2D(e.TEXTURE_2D,0,i,1,1,0,e.RGBA,e.FLOAT,null),e.bindFramebuffer(e.FRAMEBUFFER,n),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),e.enable(e.BLEND),r=e.createShader(e.VERTEX_SHADER),!!r&&(e.shaderSource(r,"void main(){}"),e.compileShader(r),o=e.createShader(e.FRAGMENT_SHADER),!!o&&(e.shaderSource(o,"precision highp float;void main(){gl_FragColor=vec4(0.5);}"),e.compileShader(o),a=e.createProgram(),!!a&&(e.attachShader(a,r),e.attachShader(a,o),e.linkProgram(a),e.useProgram(a),e.drawArrays(e.POINTS,0,1),e.getError()===e.NO_ERROR)))}finally{e.disable(e.BLEND),a&&e.deleteProgram(a),r&&e.deleteShader(r),o&&e.deleteShader(o),n&&(e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteFramebuffer(n)),t&&(e.bindTexture(e.TEXTURE_2D,null),e.deleteTexture(t))}}beginTimer(){if(2===this.version&&this.disjointTimerQueryWebgl2Extension){const e=this.gl,t=this.disjointTimerQueryWebgl2Extension,n=e.createQuery();return e.beginQuery(t.TIME_ELAPSED_EXT,n),n}throw new Error("WebGL1 profiling currently not supported.")}endTimer(){if(2!==this.version||!this.disjointTimerQueryWebgl2Extension)throw new Error("WebGL1 profiling currently not supported");{const e=this.gl,t=this.disjointTimerQueryWebgl2Extension;e.endQuery(t.TIME_ELAPSED_EXT)}}isTimerResultAvailable(e){let t=!1,n=!1;if(2!==this.version||!this.disjointTimerQueryWebgl2Extension)throw new Error("WebGL1 profiling currently not supported");{const r=this.gl,o=this.disjointTimerQueryWebgl2Extension;t=r.getQueryParameter(e,r.QUERY_RESULT_AVAILABLE),n=r.getParameter(o.GPU_DISJOINT_EXT)}return t&&!n}getTimerResult(e){let t=0;if(2!==this.version)throw new Error("WebGL1 profiling currently not supported");{const n=this.gl;t=n.getQueryParameter(e,n.QUERY_RESULT),n.deleteQuery(e)}return t/1e6}async waitForQueryAndGetTime(e){return await(0,l.repeatedTry)(()=>this.isTimerResultAvailable(e)),this.getTimerResult(e)}async createAndWaitForFence(){const e=this.createFence(this.gl);return this.pollFence(e)}createFence(e){let t;const n=e,r=n.fenceSync(n.SYNC_GPU_COMMANDS_COMPLETE,0);return e.flush(),t=null===r?()=>!0:()=>{const e=n.clientWaitSync(r,0,0);return e===n.ALREADY_SIGNALED||e===n.CONDITION_SATISFIED},{query:r,isFencePassed:t}}async pollFence(e){return new Promise(t=>{this.addItemToPoll(()=>e.isFencePassed(),()=>t())})}pollItems(){const e=u(this.itemsToPoll.map(e=>e.isDoneFn));for(let t=0;t<=e;++t){const{resolveFn:e}=this.itemsToPoll[t];e()}this.itemsToPoll=this.itemsToPoll.slice(e+1)}async addItemToPoll(e,t){this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1||await(0,l.repeatedTry)(()=>(this.pollItems(),0===this.itemsToPoll.length))}}},1036:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExecutionPlan=void 0;const r=n(6231);class o{constructor(e,t){this.op=e,this.node=t}}t.ExecutionPlan=class{constructor(e,t,n){this.graph=e,this.profiler=n,this.initialize(t)}initialize(e){this.profiler.event("session","ExecutionPlan.initialize",()=>{const t=this.graph.getNodes();if(t.length!==e.length)throw new Error("The size of nodes and OPs do not match.");this._ops=e.map((e,n)=>new o(e,t[n])),this.reset(),this._starter=[],this._ops.forEach((e,t)=>{let n=!0;for(const r of e.node.inputs)if(!this._values[r]&&-1===this.graph.getInputIndices().indexOf(r)){n=!1;break}n&&this._starter.push(t)})})}reset(){this._values=this.graph.getValues().map(e=>e.tensor)}async execute(e,t){return this.profiler.event("session","ExecutionPlan.execute",async()=>{this.reset();const n=e.createInferenceHandler(),o=this.graph.getInputIndices();if(t.length!==o.length)throw new Error(`number of input tensors don't match the number of inputs to the model: actual: ${t.length} expected: ${o.length}`);t.forEach((e,t)=>{const n=o[t];this._values[n]=e});const a=this._starter.slice(0),i=this.graph.getValues(),s=this.graph.getNodes();let l=0;for(;l<a.length;){const e=a[l++],t=this._ops[e],o=t.node.inputs.map(e=>this._values[e]);if(-1!==o.indexOf(void 0))throw new Error(`unresolved input detected: op: ${t.node}`);const u=o;r.Logger.verbose("ExecPlan",`Runing op:${t.node.name} (${u.map((e,n)=>`'${t.node.inputs[n]}': ${e.type}[${e.dims.join(",")}]`).join(", ")})`);const c=await this.profiler.event("node",t.node.name,async()=>t.op.impl(n,u,t.op.context));if(c.length!==t.node.outputs.length)throw new Error("the size of output does not match model definition.");c.forEach((e,n)=>{const r=t.node.outputs[n];if(this._values[r])throw new Error(`output [${r}] already has value: op:${t.node.name}`);this._values[r]=e});const d=new Set;c.forEach((e,n)=>{const r=t.node.outputs[n];for(const t of i[r].to){const e=s[t];let n=!0;for(const t of e.inputs)if(!this._values[t]){n=!1;break}n&&d.add(t)}}),a.push(...d)}const u=[];for(let e=0;e<this.graph.getOutputIndices().length;e++){const t=this.graph.getOutputIndices()[e],n=this._values[t];if(void 0===n)throw new Error(`required output [${t}] does not have value`);0===t?await n.getData():n.data,u.push(n)}return r.Logger.verbose("ExecPlan","disposing of inferenceHandler"),n.dispose(),u})}}},7070:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Graph=void 0;const r=n(1446),o=n(7778),a=n(9395),i=n(9162),s=n(2517);var l=a.onnxruntime.experimental.fbs;t.Graph={from:(e,t)=>new d(e,t)};class u{constructor(e){this._from=void 0,this._to=[],this.tensor=void 0,this.type=void 0,e&&(this.type=s.ProtoUtil.tensorValueTypeFromProto(e.type.tensorType))}get from(){return this._from}get to(){return this._to}}class c{constructor(e,t){e instanceof r.onnx.NodeProto?(this.name=e.name,this.opType=e.opType,this.attributes=new o.Attribute(e.attribute)):e instanceof l.Node&&(this.name=null!=t?t:e.name(),this.opType=e.opType(),this.attributes=new o.Attribute(s.ProtoUtil.tensorAttributesFromORTFormat(e))),this.inputs=[],this.outputs=[],this.executeNode=!0}}class d{constructor(e,t){if(!e)throw new TypeError("graph is empty");this.buildGraph(e),this.transformGraph(t),this.checkIsAcyclic()}getInputIndices(){return this._allInputIndices}getInputNames(){return this._allInputNames}getOutputIndices(){return this._allOutputIndices}getOutputNames(){return this._allOutputNames}getValues(){return this._allData}getNodes(){return this._nodes}buildGraph(e){if(e instanceof r.onnx.GraphProto)this.buildGraphFromOnnxFormat(e);else{if(!(e instanceof l.Graph))throw new TypeError("Graph type is not supported.");this.buildGraphFromOrtFormat(e)}}buildGraphFromOnnxFormat(e){const t=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];const n=new Map;if(!e.input)throw new Error("missing information in graph: input");const r=[];for(const o of e.input){if(t.has(o.name))throw new Error(`duplicated input name: ${o.name}`);const e=this._allData.push(new u(o))-1;t.set(o.name,e),r.push(o.name)}if(!e.initializer)throw new Error("missing information in graph: initializer");for(const o of e.initializer){let e=t.get(o.name);if(void 0===e){const n=new u;n.type={shape:{dims:s.ProtoUtil.tensorDimsFromProto(o.dims)},tensorType:s.ProtoUtil.tensorDataTypeFromProto(o.dataType)},e=this._allData.push(n)-1,t.set(o.name,e)}this._allData[e]._from=-1,this._allData[e].tensor=i.Tensor.fromProto(o)}for(let o=0;o<this._allData.length;o++)this._allData[o].tensor||(this._allInputIndices.push(o),this._allInputNames.push(r[o]));if(!e.output)throw new Error("missing information in graph: output");for(const o of e.output){if(t.has(o.name))throw new Error(`duplicated output name: ${o.name}`);const e=this._allData.push(new u(o))-1;t.set(o.name,e),this._allOutputIndices.push(e),this._allOutputNames.push(o.name)}if(!e.node)throw new Error("missing information in graph: node");for(const o of e.node){if(!o.name)for(let t=0;;t++){const e=`unnamed_${o.opType}_${t}`;if(!n.has(e)){o.name=e;break}}if(n.has(o.name))throw new Error(`duplicated node name: ${o.name}`);const e=this._nodes.push(new c(o))-1;n.set(o.name,e)}for(let o=0;o<this._nodes.length;o++){const n=this._nodes[o],r=e.node[o];if(!r.output)throw new Error(`missing output for node: ${r.name}`);for(const e of r.output){let a=t.get(e);if(void 0===a&&(a=this._allData.push(new u)-1,t.set(e,a)),n.outputs.push(a),void 0!==this._allData[a]._from)throw new Error(`multiple nodes output to one data value: ${a}`);if(this._allData[a]._from=o,"Constant"===r.opType){if(!r.attribute||1!==r.attribute.length||!r.attribute[0].t)throw new Error("missing attributes or missing tensor value in attributes for this Constant operator");if(!r.output||1!==r.output.length)throw new Error("missing output or incorrect number of outputs for this Constant operator");n.outputs.pop(),n.executeNode=!1,this._allData[a]._from=-1,this._allData[a].tensor=i.Tensor.fromProto(r.attribute[0].t)}}}for(let o=0;o<this._nodes.length;o++){const n=this._nodes[o],r=e.node[o];if(!r.input)throw new Error(`missing input for node: ${r.name}`);for(const e of r.input){const a=t.get(e);if(void 0===a){if(""===e&&3===r.input.length&&"Resize"===r.opType)continue;throw new Error(`unrecognized input '${e}' for node: ${r.name}`)}n.inputs.push(a),this._allData[a]._to.push(o)}}return!0}buildGraphFromOrtFormat(e){var t,n,r;const o=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];const a=new Map,d=[];for(let i=0;i<e.inputsLength();i++){const a=e.inputs(i);if(o.has(a))throw new Error(`duplicated input name: ${a}`);for(let i=0;i<e.nodeArgsLength();i++)if((null===(t=e.nodeArgs(i))||void 0===t?void 0:t.name())===a){const t=new u;if((null===(r=null===(n=e.nodeArgs(i))||void 0===n?void 0:n.type())||void 0===r?void 0:r.valueType())!==l.TypeInfoValue.tensor_type)throw new Error("Unexpected value type for the nodeArg.");const c=e.nodeArgs(i).type().value(new l.TensorTypeAndShape),f=s.ProtoUtil.tensorDataTypeFromProto(c.elemType()),p=c.shape(),h=[];for(let e=0;e<p.dimLength();e++)h.push(s.LongUtil.longToNumber(p.dim(e).value().dimValue()));t.type={shape:{dims:h},tensorType:f};const m=this._allData.push(t)-1;o.set(a,m),d.push(a)}}for(let l=0;l<e.initializersLength();l++){const t=e.initializers(l);let n=o.get(t.name());if(void 0===n){const e=new u,r=s.ProtoUtil.tensorDimsFromORTFormat(t),a=s.ProtoUtil.tensorDataTypeFromProto(t.dataType());e.type={shape:{dims:r},tensorType:a},n=this._allData.push(e)-1,o.set(t.name(),n)}this._allData[n]._from=-1,this._allData[n].tensor=i.Tensor.fromOrtTensor(t)}for(let i=0;i<this._allData.length;i++)this._allData[i].tensor||(this._allInputIndices.push(i),this._allInputNames.push(d[i]));for(let i=0;i<e.outputsLength();i++){const t=e.outputs(i);if(o.has(t))throw new Error(`duplicated output name: ${t}`);const n=this._allData.push(new u)-1;o.set(t,n),this._allOutputIndices.push(n),this._allOutputNames.push(t)}if(!e.nodes)throw new Error("missing information in graph: node");for(let i=0;i<e.nodesLength();i++){const t=e.nodes(i);let n=t.name();if(!n)for(let e=0;n=`unnamed_${t.opType()}_${e}`,a.has(n);e++);if(a.has(n))throw new Error(`duplicated node name: ${n}`);const r=this._nodes.push(new c(t,n))-1;a.set(n,r)}for(let s=0;s<this._nodes.length;s++){const t=this._nodes[s],n=e.nodes(s);if(null==n)throw new Error(`No node exists at index ${s}`);if(0===(null==n?void 0:n.outputsLength()))throw new Error(`missing output for node: ${n.name}`);for(let e=0;e<(null==n?void 0:n.outputsLength());e++){const r=null==n?void 0:n.outputs(e);let a=o.get(r);if(void 0===a&&(a=this._allData.push(new u)-1,o.set(r,a)),t.outputs.push(a),void 0!==this._allData[a]._from)throw new Error(`multiple nodes output to one data value: ${a}`);if(this._allData[a]._from=s,"Constant"===n.opType()){if(1!==n.attributesLength()||!n.attributes(0).t())throw new Error("missing attributes or missing tensor value in attributes for this Constant operator");if(1!==n.outputsLength())throw new Error("missing output or incorrect number of outputs for this Constant operator");t.outputs.pop(),t.executeNode=!1,this._allData[a]._from=-1,this._allData[a].tensor=i.Tensor.fromOrtTensor(n.attributes(0).t())}}}for(let i=0;i<this._nodes.length;i++){const t=this._nodes[i],n=e.nodes(i);if(0===n.inputsLength())throw new Error(`missing input for node: ${n.name}`);for(let e=0;e<n.inputsLength();e++){const r=n.inputs(e),a=o.get(r);if(void 0===a)throw new Error(`unrecognized input '${r}' for node: ${n.name()}`);t.inputs.push(a),this._allData[a]._to.push(i)}}}checkIsAcyclic(){const e=new Set;this._allInputIndices.forEach(t=>{this._allData[t]._to.forEach(t=>{e.add(t)})});const t=Array.from(e),n=new Array(this._nodes.length).fill("white");for(;t.length>0;){const e=t.pop();"gray"===n[e]?n[e]="black":(t.push(e),n[e]="gray",this._nodes[e].outputs.forEach(r=>{const o=this._allData[r];if(void 0!==o.tensor)throw new Error("node outputs should not be initialized");if(o._from!==e)throw new Error("from property of the Value object doesn't match index of Node being processed");o._to.forEach(e=>{if("gray"===n[e])throw new Error("model graph is cyclic");"white"===n[e]&&t.push(e)})}))}}transformGraph(e){this.removeAllIdentityNodes(),this.removeAllDropoutNodes(),this.fuseConvActivationNodes(),e&&e.transformGraph(this),this.finalizeGraph()}finalizeGraph(){let e=0;for(let t=0;t<this._nodes.length;t++)this._nodes[t].executeNode?e>0&&(this._nodes[t].inputs.forEach(n=>{const r=this._allData[n]._to.indexOf(t+e);-1!==r&&(this._allData[n]._to[r]=t)}),this._nodes[t].outputs.forEach(n=>{this._allData[n]._from&&this._allData[n]._from===t+e&&(this._allData[n]._from=t)})):(e++,this._nodes[t].outputs.forEach(e=>{this._allData[e]._from=-2}),this._nodes.splice(t,1),t--);e=0;for(let t=0;t<this._allData.length;t++)if(-2!==this._allData[t].from||-1!==this._allOutputIndices.indexOf(t+e)){if(e>0){let n=-1;void 0!==this._allData[t].from&&-1!==this._allData[t].from?(n=this._nodes[this._allData[t].from].outputs.indexOf(t+e),-1!==n&&(this._nodes[this._allData[t].from].outputs[n]=t)):(n=this._allInputIndices.indexOf(t+e),-1!==n&&(this._allInputIndices[n]=t)),this._allData[t].to.forEach(r=>{n=this._nodes[r].inputs.indexOf(t+e),-1!==n&&(this._nodes[r].inputs[n]=t)}),0===this._allData[t].to.length&&(n=this._allOutputIndices.indexOf(t+e),-1!==n&&(this._allOutputIndices[n]=t))}}else e++,this._allData.splice(t,1),t--}deleteNode(e){const t=this._nodes[e];if(t.outputs.length>1)for(let s=1;s<t.outputs.length;s++)if(this._allData[t.outputs[s]].to.length>0)throw new Error("Node deletion with more than one output connected to other nodes is not supported. ");t.executeNode=!1;const n=t.inputs[0],r=t.outputs[0],o=this._allData[r].to,a=this._allData[n].to.indexOf(e);if(-1===a)throw new Error("The Value object doesn't have the current Node in it's 'to' property ");this._allData[n].to.splice(a,1),this._allData[r]._to=[];const i=this._allOutputIndices.indexOf(r);if(-1!==i&&(this._allOutputIndices[i]=n),o&&o.length>0)for(const s of o){const e=this._nodes[s].inputs.indexOf(r);if(-1===e)throw new Error("The Node object doesn't have the output Value in it's 'inputs' property ");this._nodes[s].inputs[e]=n,this._allData[n].to.push(s)}}removeAllDropoutNodes(){let e=0;for(const t of this._nodes){if("Dropout"===t.opType){if(1!==t.inputs.length)throw new Error("Dropout nodes should only contain one input. ");if(1!==t.outputs.length&&2!==t.outputs.length)throw new Error("Dropout nodes should contain either 1 or 2 output(s)");if(2===t.outputs.length&&0!==this._allData[t.outputs[1]]._to.length)throw new Error("Dropout nodes's second output should not be referenced by other nodes");this.deleteNode(e)}e++}}removeAllIdentityNodes(){let e=0;for(const t of this._nodes)"Identity"===t.opType&&this.deleteNode(e),e++}isActivation(e){switch(e.opType){case"Relu":case"Sigmoid":case"Clip":return!0;default:return!1}}fuseConvActivationNodes(){for(const t of this._nodes)if("Conv"===t.opType){const n=this._allData[t.outputs[0]]._to;if(1===n.length&&this.isActivation(this._nodes[n[0]])){const r=this._nodes[n[0]];if("Clip"===r.opType)if(1===r.inputs.length)try{t.attributes.set("activation_params","floats",[r.attributes.getFloat("min"),r.attributes.getFloat("max")])}catch(e){t.attributes.set("activation_params","floats",[s.MIN_CLIP,s.MAX_CLIP])}else{if(!(r.inputs.length>=3&&void 0!==this._allData[r.inputs[1]].tensor&&void 0!==this._allData[r.inputs[2]].tensor))continue;t.attributes.set("activation_params","floats",[this._allData[r.inputs[1]].tensor.floatData[0],this._allData[r.inputs[2]].tensor.floatData[0]])}t.attributes.set("activation","string",r.opType),this.deleteNode(n[0])}}}}},6231:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.now=t.Profiler=t.Logger=void 0;const n={verbose:1e3,info:2e3,warning:4e3,error:5e3,fatal:6e3},r={none:new class{log(e,t,n){}},console:new class{log(e,t,n){console.log(`${this.color(e)} ${n?"[35m"+n+"[0m ":""}${t}`)}color(e){switch(e){case"verbose":return"[34;40mv[0m";case"info":return"[32mi[0m";case"warning":return"[30;43mw[0m";case"error":return"[31;40me[0m";case"fatal":return"[101mf[0m";default:throw new Error(`unsupported severity: ${e}`)}}}},o={provider:"console",minimalSeverity:"warning",logDateTime:!0,logSourceLocation:!1};let a={"":o};function i(e,t,n,r){if(void 0===t)return o=e,{verbose:i.verbose.bind(null,o),info:i.info.bind(null,o),warning:i.warning.bind(null,o),error:i.error.bind(null,o),fatal:i.fatal.bind(null,o)};if(void 0===n)s(e,t);else if("number"==typeof n&&void 0===r)s(e,t);else if("string"==typeof n&&void 0===r)s(e,n,0,t);else{if("string"!=typeof n||"number"!=typeof r)throw new TypeError("input is valid");s(e,n,0,t)}var o}function s(e,t,o,i){const s=a[i||""]||a[""];n[e]<n[s.minimalSeverity]||(s.logDateTime&&(t=`${(new Date).toISOString()}|${t}`),s.logSourceLocation,r[s.provider].log(e,t,i))}!function(e){function t(e){a={},n("",e||{})}function n(e,n){if("*"===e)t(n);else{const t=a[e]||o;a[e]={provider:n.provider||t.provider,minimalSeverity:n.minimalSeverity||t.minimalSeverity,logDateTime:void 0===n.logDateTime?t.logDateTime:n.logDateTime,logSourceLocation:void 0===n.logSourceLocation?t.logSourceLocation:n.logSourceLocation}}}e.verbose=function(t,n){e("verbose",t,n)},e.info=function(t,n){e("info",t,n)},e.warning=function(t,n){e("warning",t,n)},e.error=function(t,n){e("error",t,n)},e.fatal=function(t,n){e("fatal",t,n)},e.reset=t,e.set=n,e.setWithEnv=function(e){const t={};e.logLevel&&(t.minimalSeverity=e.logLevel),n("",t)}}(i||(i={})),t.Logger=i;class l{constructor(e,t,n,r,o,a){this.category=e,this.name=t,this.startTime=n,this.endCallback=r,this.timer=o,this.ctx=a}end(){return this.endCallback(this)}async checkTimer(){if(void 0===this.ctx||void 0===this.timer)throw new Error("No webgl timer found");return this.ctx.endTimer(),this.ctx.waitForQueryAndGetTime(this.timer)}}class u{constructor(e,t,n,r){this.category=e,this.name=t,this.startTime=n,this.endTime=r}}t.Profiler=class{static create(e){return void 0===e?new this:new this(e.maxNumberEvents,e.flushBatchSize,e.flushIntervalInMilliseconds)}constructor(e,t,n){this._started=!1,this._flushPointer=0,this._started=!1,this._maxNumberEvents=void 0===e?1e4:e,this._flushBatchSize=void 0===t?10:t,this._flushIntervalInMilliseconds=void 0===n?5e3:n}start(){this._started=!0,this._timingEvents=[],this._flushTime=(0,t.now)(),this._flushPointer=0}stop(){for(this._started=!1;this._flushPointer<this._timingEvents.length;this._flushPointer++)this.logOneEvent(this._timingEvents[this._flushPointer])}event(e,t,n,r){const o=this._started?this.begin(e,t,r):void 0;let a=!1;const i=n();if(i&&"function"==typeof i.then)return a=!0,new Promise((e,t)=>{i.then(async t=>{o&&await o.end(),e(t)},async e=>{o&&await o.end(),t(e)})});if(!a&&o){const e=o.end();if(e&&"function"==typeof e.then)return new Promise((t,n)=>{e.then(()=>{t(i)},e=>{n(e)})})}return i}begin(e,n,r){if(!this._started)throw new Error("profiler is not started yet");if(void 0===r){const r=(0,t.now)();return this.flush(r),new l(e,n,r,e=>this.endSync(e))}{const t=r.beginTimer();return new l(e,n,0,async e=>this.end(e),t,r)}}async end(e){const t=await e.checkTimer();this._timingEvents.length<this._maxNumberEvents&&(this._timingEvents.push(new u(e.category,e.name,e.startTime,t)),this.flush(t))}endSync(e){const n=(0,t.now)();this._timingEvents.length<this._maxNumberEvents&&(this._timingEvents.push(new u(e.category,e.name,e.startTime,n)),this.flush(n))}logOneEvent(e){t.Logger.verbose(`Profiler.${e.category}`,`${(e.endTime-e.startTime).toFixed(2)}ms on event '${e.name}' at ${e.endTime.toFixed(2)}`)}flush(e){if(this._timingEvents.length-this._flushPointer>=this._flushBatchSize||e-this._flushTime>=this._flushIntervalInMilliseconds){for(const e=this._flushPointer;this._flushPointer<e+this._flushBatchSize&&this._flushPointer<this._timingEvents.length;this._flushPointer++)this.logOneEvent(this._timingEvents[this._flushPointer]);this._flushTime=(0,t.now)()}}get started(){return this._started}},t.now="undefined"!=typeof performance&&performance.now?()=>performance.now():Date.now},2644:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Model=void 0;const r=n(5686),o=n(1446),a=n(7070),i=n(9395),s=n(2517);var l=i.onnxruntime.experimental.fbs;t.Model=class{constructor(){}load(e,t,n){if(!n)try{return void this.loadFromOnnxFormat(e,t)}catch(r){if(void 0!==n)throw r}this.loadFromOrtFormat(e,t)}loadFromOnnxFormat(e,t){const n=o.onnx.ModelProto.decode(e);if(s.LongUtil.longToNumber(n.irVersion)<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=n.opsetImport.map(e=>({domain:e.domain,version:s.LongUtil.longToNumber(e.version)})),this._graph=a.Graph.from(n.graph,t)}loadFromOrtFormat(e,t){const n=new r.flatbuffers.ByteBuffer(e),o=l.InferenceSession.getRootAsInferenceSession(n).model();if(s.LongUtil.longToNumber(o.irVersion())<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=[];for(let r=0;r<o.opsetImportLength();r++){const e=o.opsetImport(r);this._opsets.push({domain:null==e?void 0:e.domain(),version:s.LongUtil.longToNumber(e.version())})}this._graph=a.Graph.from(o.graph(),t)}get graph(){return this._graph}get opsets(){return this._opsets}}},782:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FLOAT_TYPES=t.INT_TYPES=t.NUMBER_TYPES=void 0,t.NUMBER_TYPES=["float32","float64","int32","int16","int8","uint16","uint32","uint8"],t.INT_TYPES=["int32","int16","int8","uint16","uint32","uint8"],t.FLOAT_TYPES=["float32","float64"]},1047:(e,t)=>{function n(e,t){if(t.endsWith("+")){const n=Number.parseInt(t.substring(0,t.length-1),10);return!isNaN(n)&&n<=e}if(2===t.split("-").length){const n=t.split("-"),r=Number.parseInt(n[0],10),o=Number.parseInt(n[1],10);return!isNaN(r)&&!isNaN(o)&&r<=e&&e<=o}return Number.parseInt(t,10)===e}Object.defineProperty(t,"__esModule",{value:!0}),t.resolveOperator=void 0,t.resolveOperator=function(e,t,r){for(const o of r){const r=o[0],a=o[1],i=o[2],s=o[3],l=o[4];if(e.opType===r)for(const e of t)if((e.domain===a||"ai.onnx"===e.domain&&""===a)&&n(e.version,i))return{opImpl:s,opInit:l}}throw new TypeError(`cannot resolve operator '${e.opType}' with opsets: ${t.map(e=>`${e.domain||"ai.onnx"} v${e.version}`).join(", ")}`)}},9395:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.onnxruntime=void 0;const r=n(5686);var o,a,i,s;o=t.onnxruntime||(t.onnxruntime={}),i=(a=o.experimental||(o.experimental={})).fbs||(a.fbs={}),(s=i.AttributeType||(i.AttributeType={}))[s.UNDEFINED=0]="UNDEFINED",s[s.FLOAT=1]="FLOAT",s[s.INT=2]="INT",s[s.STRING=3]="STRING",s[s.TENSOR=4]="TENSOR",s[s.GRAPH=5]="GRAPH",s[s.FLOATS=6]="FLOATS",s[s.INTS=7]="INTS",s[s.STRINGS=8]="STRINGS",s[s.TENSORS=9]="TENSORS",s[s.GRAPHS=10]="GRAPHS",s[s.SPARSE_TENSOR=11]="SPARSE_TENSOR",s[s.SPARSE_TENSORS=12]="SPARSE_TENSORS",function(e){!function(e){var t,n;t=e.fbs||(e.fbs={}),(n=t.DimensionValueType||(t.DimensionValueType={}))[n.UNKNOWN=0]="UNKNOWN",n[n.VALUE=1]="VALUE",n[n.PARAM=2]="PARAM"}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){var t,n;t=e.fbs||(e.fbs={}),(n=t.TensorDataType||(t.TensorDataType={}))[n.UNDEFINED=0]="UNDEFINED",n[n.FLOAT=1]="FLOAT",n[n.UINT8=2]="UINT8",n[n.INT8=3]="INT8",n[n.UINT16=4]="UINT16",n[n.INT16=5]="INT16",n[n.INT32=6]="INT32",n[n.INT64=7]="INT64",n[n.STRING=8]="STRING",n[n.BOOL=9]="BOOL",n[n.FLOAT16=10]="FLOAT16",n[n.DOUBLE=11]="DOUBLE",n[n.UINT32=12]="UINT32",n[n.UINT64=13]="UINT64",n[n.COMPLEX64=14]="COMPLEX64",n[n.COMPLEX128=15]="COMPLEX128",n[n.BFLOAT16=16]="BFLOAT16"}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){var t,n;t=e.fbs||(e.fbs={}),(n=t.NodeType||(t.NodeType={}))[n.Primitive=0]="Primitive",n[n.Fused=1]="Fused"}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){var t,n;t=e.fbs||(e.fbs={}),(n=t.TypeInfoValue||(t.TypeInfoValue={}))[n.NONE=0]="NONE",n[n.tensor_type=1]="tensor_type",n[n.sequence_type=2]="sequence_type",n[n.map_type=3]="map_type"}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsShape(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsShape(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}dim(t,n){let r=this.bb.__offset(this.bb_pos,4);return r?(n||new e.experimental.fbs.Dimension).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}dimLength(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__vector_len(this.bb_pos+e):0}static startShape(e){e.startObject(1)}static addDim(e,t){e.addFieldOffset(0,t,0)}static createDimVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startDimVector(e,t){e.startVector(4,t,4)}static endShape(e){return e.endObject()}static createShape(e,t){return n.startShape(e),n.addDim(e,t),n.endShape(e)}}t.Shape=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDimension(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDimension(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}value(t){let n=this.bb.__offset(this.bb_pos,4);return n?(t||new e.experimental.fbs.DimensionValue).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}denotation(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startDimension(e){e.startObject(2)}static addValue(e,t){e.addFieldOffset(0,t,0)}static addDenotation(e,t){e.addFieldOffset(1,t,0)}static endDimension(e){return e.endObject()}static createDimension(e,t,r){return n.startDimension(e),n.addValue(e,t),n.addDenotation(e,r),n.endDimension(e)}}t.Dimension=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDimensionValue(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDimensionValue(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}dimType(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):e.experimental.fbs.DimensionValueType.UNKNOWN}dimValue(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}dimParam(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__string(this.bb_pos+t,e):null}static startDimensionValue(e){e.startObject(3)}static addDimType(t,n){t.addFieldInt8(0,n,e.experimental.fbs.DimensionValueType.UNKNOWN)}static addDimValue(e,t){e.addFieldInt64(1,t,e.createLong(0,0))}static addDimParam(e,t){e.addFieldOffset(2,t,0)}static endDimensionValue(e){return e.endObject()}static createDimensionValue(e,t,r,o){return n.startDimensionValue(e),n.addDimType(e,t),n.addDimValue(e,r),n.addDimParam(e,o),n.endDimensionValue(e)}}t.DimensionValue=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTensorTypeAndShape(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTensorTypeAndShape(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}elemType(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):e.experimental.fbs.TensorDataType.UNDEFINED}shape(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new e.experimental.fbs.Shape).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startTensorTypeAndShape(e){e.startObject(2)}static addElemType(t,n){t.addFieldInt32(0,n,e.experimental.fbs.TensorDataType.UNDEFINED)}static addShape(e,t){e.addFieldOffset(1,t,0)}static endTensorTypeAndShape(e){return e.endObject()}static createTensorTypeAndShape(e,t,r){return n.startTensorTypeAndShape(e),n.addElemType(e,t),n.addShape(e,r),n.endTensorTypeAndShape(e)}}t.TensorTypeAndShape=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMapType(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMapType(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}keyType(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):e.experimental.fbs.TensorDataType.UNDEFINED}valueType(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new e.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startMapType(e){e.startObject(2)}static addKeyType(t,n){t.addFieldInt32(0,n,e.experimental.fbs.TensorDataType.UNDEFINED)}static addValueType(e,t){e.addFieldOffset(1,t,0)}static endMapType(e){return e.endObject()}static createMapType(e,t,r){return n.startMapType(e),n.addKeyType(e,t),n.addValueType(e,r),n.endMapType(e)}}t.MapType=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSequenceType(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSequenceType(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}elemType(t){let n=this.bb.__offset(this.bb_pos,4);return n?(t||new e.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startSequenceType(e){e.startObject(1)}static addElemType(e,t){e.addFieldOffset(0,t,0)}static endSequenceType(e){return e.endObject()}static createSequenceType(e,t){return n.startSequenceType(e),n.addElemType(e,t),n.endSequenceType(e)}}t.SequenceType=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){(e.fbs||(e.fbs={})).EdgeEnd=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}nodeIndex(){return this.bb.readUint32(this.bb_pos)}srcArgIndex(){return this.bb.readInt32(this.bb_pos+4)}dstArgIndex(){return this.bb.readInt32(this.bb_pos+8)}static createEdgeEnd(e,t,n,r){return e.prep(4,12),e.writeInt32(r),e.writeInt32(n),e.writeInt32(t),e.offset()}}}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsNodeEdge(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsNodeEdge(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}nodeIndex(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb_pos+e):0}inputEdges(t,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new e.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+r)+12*t,this.bb):null}inputEdgesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}outputEdges(t,n){let r=this.bb.__offset(this.bb_pos,8);return r?(n||new e.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+r)+12*t,this.bb):null}outputEdgesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}static startNodeEdge(e){e.startObject(3)}static addNodeIndex(e,t){e.addFieldInt32(0,t,0)}static addInputEdges(e,t){e.addFieldOffset(1,t,0)}static startInputEdgesVector(e,t){e.startVector(12,t,4)}static addOutputEdges(e,t){e.addFieldOffset(2,t,0)}static startOutputEdgesVector(e,t){e.startVector(12,t,4)}static endNodeEdge(e){return e.endObject()}static createNodeEdge(e,t,r,o){return n.startNodeEdge(e),n.addNodeIndex(e,t),n.addInputEdges(e,r),n.addOutputEdges(e,o),n.endNodeEdge(e)}}t.NodeEdge=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsNode(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsNode(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}docString(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}domain(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__string(this.bb_pos+t,e):null}sinceVersion(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt32(this.bb_pos+e):0}index(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readUint32(this.bb_pos+e):0}opType(e){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__string(this.bb_pos+t,e):null}type(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readInt32(this.bb_pos+t):e.experimental.fbs.NodeType.Primitive}executionProviderType(e){let t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__string(this.bb_pos+t,e):null}inputs(e,t){let n=this.bb.__offset(this.bb_pos,20);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}inputsLength(){let e=this.bb.__offset(this.bb_pos,20);return e?this.bb.__vector_len(this.bb_pos+e):0}outputs(e,t){let n=this.bb.__offset(this.bb_pos,22);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}outputsLength(){let e=this.bb.__offset(this.bb_pos,22);return e?this.bb.__vector_len(this.bb_pos+e):0}attributes(t,n){let r=this.bb.__offset(this.bb_pos,24);return r?(n||new e.experimental.fbs.Attribute).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}attributesLength(){let e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__vector_len(this.bb_pos+e):0}inputArgCounts(e){let t=this.bb.__offset(this.bb_pos,26);return t?this.bb.readInt32(this.bb.__vector(this.bb_pos+t)+4*e):0}inputArgCountsLength(){let e=this.bb.__offset(this.bb_pos,26);return e?this.bb.__vector_len(this.bb_pos+e):0}inputArgCountsArray(){let e=this.bb.__offset(this.bb_pos,26);return e?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}implicitInputs(e,t){let n=this.bb.__offset(this.bb_pos,28);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}implicitInputsLength(){let e=this.bb.__offset(this.bb_pos,28);return e?this.bb.__vector_len(this.bb_pos+e):0}static startNode(e){e.startObject(13)}static addName(e,t){e.addFieldOffset(0,t,0)}static addDocString(e,t){e.addFieldOffset(1,t,0)}static addDomain(e,t){e.addFieldOffset(2,t,0)}static addSinceVersion(e,t){e.addFieldInt32(3,t,0)}static addIndex(e,t){e.addFieldInt32(4,t,0)}static addOpType(e,t){e.addFieldOffset(5,t,0)}static addType(t,n){t.addFieldInt32(6,n,e.experimental.fbs.NodeType.Primitive)}static addExecutionProviderType(e,t){e.addFieldOffset(7,t,0)}static addInputs(e,t){e.addFieldOffset(8,t,0)}static createInputsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startInputsVector(e,t){e.startVector(4,t,4)}static addOutputs(e,t){e.addFieldOffset(9,t,0)}static createOutputsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startOutputsVector(e,t){e.startVector(4,t,4)}static addAttributes(e,t){e.addFieldOffset(10,t,0)}static createAttributesVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startAttributesVector(e,t){e.startVector(4,t,4)}static addInputArgCounts(e,t){e.addFieldOffset(11,t,0)}static createInputArgCountsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addInt32(t[n]);return e.endVector()}static startInputArgCountsVector(e,t){e.startVector(4,t,4)}static addImplicitInputs(e,t){e.addFieldOffset(12,t,0)}static createImplicitInputsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startImplicitInputsVector(e,t){e.startVector(4,t,4)}static endNode(e){return e.endObject()}static createNode(e,t,r,o,a,i,s,l,u,c,d,f,p,h){return n.startNode(e),n.addName(e,t),n.addDocString(e,r),n.addDomain(e,o),n.addSinceVersion(e,a),n.addIndex(e,i),n.addOpType(e,s),n.addType(e,l),n.addExecutionProviderType(e,u),n.addInputs(e,c),n.addOutputs(e,d),n.addAttributes(e,f),n.addInputArgCounts(e,p),n.addImplicitInputs(e,h),n.endNode(e)}}t.Node=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsValueInfo(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsValueInfo(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}docString(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}type(t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new e.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startValueInfo(e){e.startObject(3)}static addName(e,t){e.addFieldOffset(0,t,0)}static addDocString(e,t){e.addFieldOffset(1,t,0)}static addType(e,t){e.addFieldOffset(2,t,0)}static endValueInfo(e){return e.endObject()}static createValueInfo(e,t,r,o){return n.startValueInfo(e),n.addName(e,t),n.addDocString(e,r),n.addType(e,o),n.endValueInfo(e)}}t.ValueInfo=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTypeInfo(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTypeInfo(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}denotation(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}valueType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):e.experimental.fbs.TypeInfoValue.NONE}value(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__union(e,this.bb_pos+t):null}static startTypeInfo(e){e.startObject(3)}static addDenotation(e,t){e.addFieldOffset(0,t,0)}static addValueType(t,n){t.addFieldInt8(1,n,e.experimental.fbs.TypeInfoValue.NONE)}static addValue(e,t){e.addFieldOffset(2,t,0)}static endTypeInfo(e){return e.endObject()}static createTypeInfo(e,t,r,o){return n.startTypeInfo(e),n.addDenotation(e,t),n.addValueType(e,r),n.addValue(e,o),n.endTypeInfo(e)}}t.TypeInfo=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){!function(e){class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsOperatorSetId(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsOperatorSetId(e,n){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(n||new t).__init(e.readInt32(e.position())+e.position(),e)}domain(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}version(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}static startOperatorSetId(e){e.startObject(2)}static addDomain(e,t){e.addFieldOffset(0,t,0)}static addVersion(e,t){e.addFieldInt64(1,t,e.createLong(0,0))}static endOperatorSetId(e){return e.endObject()}static createOperatorSetId(e,n,r){return t.startOperatorSetId(e),t.addDomain(e,n),t.addVersion(e,r),t.endOperatorSetId(e)}}e.OperatorSetId=t}(e.fbs||(e.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTensor(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTensor(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}docString(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}dims(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+8*e):this.bb.createLong(0,0)}dimsLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}dataType(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt32(this.bb_pos+t):e.experimental.fbs.TensorDataType.UNDEFINED}rawData(e){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readUint8(this.bb.__vector(this.bb_pos+t)+e):0}rawDataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}rawDataArray(){let e=this.bb.__offset(this.bb_pos,12);return e?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}stringData(e,t){let n=this.bb.__offset(this.bb_pos,14);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}stringDataLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}static startTensor(e){e.startObject(6)}static addName(e,t){e.addFieldOffset(0,t,0)}static addDocString(e,t){e.addFieldOffset(1,t,0)}static addDims(e,t){e.addFieldOffset(2,t,0)}static createDimsVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startDimsVector(e,t){e.startVector(8,t,8)}static addDataType(t,n){t.addFieldInt32(3,n,e.experimental.fbs.TensorDataType.UNDEFINED)}static addRawData(e,t){e.addFieldOffset(4,t,0)}static createRawDataVector(e,t){e.startVector(1,t.length,1);for(let n=t.length-1;n>=0;n--)e.addInt8(t[n]);return e.endVector()}static startRawDataVector(e,t){e.startVector(1,t,1)}static addStringData(e,t){e.addFieldOffset(5,t,0)}static createStringDataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startStringDataVector(e,t){e.startVector(4,t,4)}static endTensor(e){return e.endObject()}static createTensor(e,t,r,o,a,i,s){return n.startTensor(e),n.addName(e,t),n.addDocString(e,r),n.addDims(e,o),n.addDataType(e,a),n.addRawData(e,i),n.addStringData(e,s),n.endTensor(e)}}t.Tensor=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSparseTensor(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSparseTensor(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}values(t){let n=this.bb.__offset(this.bb_pos,4);return n?(t||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}indices(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}dims(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+8*e):this.bb.createLong(0,0)}dimsLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSparseTensor(e){e.startObject(3)}static addValues(e,t){e.addFieldOffset(0,t,0)}static addIndices(e,t){e.addFieldOffset(1,t,0)}static addDims(e,t){e.addFieldOffset(2,t,0)}static createDimsVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startDimsVector(e,t){e.startVector(8,t,8)}static endSparseTensor(e){return e.endObject()}static createSparseTensor(e,t,r,o){return n.startSparseTensor(e),n.addValues(e,t),n.addIndices(e,r),n.addDims(e,o),n.endSparseTensor(e)}}t.SparseTensor=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsAttribute(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsAttribute(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}docString(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}type(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):e.experimental.fbs.AttributeType.UNDEFINED}f(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readFloat32(this.bb_pos+e):0}i(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}s(e){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__string(this.bb_pos+t,e):null}t(t){let n=this.bb.__offset(this.bb_pos,16);return n?(t||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}g(t){let n=this.bb.__offset(this.bb_pos,18);return n?(t||new e.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}floats(e){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.readFloat32(this.bb.__vector(this.bb_pos+t)+4*e):0}floatsLength(){let e=this.bb.__offset(this.bb_pos,20);return e?this.bb.__vector_len(this.bb_pos+e):0}floatsArray(){let e=this.bb.__offset(this.bb_pos,20);return e?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}ints(e){let t=this.bb.__offset(this.bb_pos,22);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+8*e):this.bb.createLong(0,0)}intsLength(){let e=this.bb.__offset(this.bb_pos,22);return e?this.bb.__vector_len(this.bb_pos+e):0}strings(e,t){let n=this.bb.__offset(this.bb_pos,24);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}stringsLength(){let e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__vector_len(this.bb_pos+e):0}tensors(t,n){let r=this.bb.__offset(this.bb_pos,26);return r?(n||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}tensorsLength(){let e=this.bb.__offset(this.bb_pos,26);return e?this.bb.__vector_len(this.bb_pos+e):0}graphs(t,n){let r=this.bb.__offset(this.bb_pos,28);return r?(n||new e.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}graphsLength(){let e=this.bb.__offset(this.bb_pos,28);return e?this.bb.__vector_len(this.bb_pos+e):0}static startAttribute(e){e.startObject(13)}static addName(e,t){e.addFieldOffset(0,t,0)}static addDocString(e,t){e.addFieldOffset(1,t,0)}static addType(t,n){t.addFieldInt32(2,n,e.experimental.fbs.AttributeType.UNDEFINED)}static addF(e,t){e.addFieldFloat32(3,t,0)}static addI(e,t){e.addFieldInt64(4,t,e.createLong(0,0))}static addS(e,t){e.addFieldOffset(5,t,0)}static addT(e,t){e.addFieldOffset(6,t,0)}static addG(e,t){e.addFieldOffset(7,t,0)}static addFloats(e,t){e.addFieldOffset(8,t,0)}static createFloatsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addFloat32(t[n]);return e.endVector()}static startFloatsVector(e,t){e.startVector(4,t,4)}static addInts(e,t){e.addFieldOffset(9,t,0)}static createIntsVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startIntsVector(e,t){e.startVector(8,t,8)}static addStrings(e,t){e.addFieldOffset(10,t,0)}static createStringsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startStringsVector(e,t){e.startVector(4,t,4)}static addTensors(e,t){e.addFieldOffset(11,t,0)}static createTensorsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startTensorsVector(e,t){e.startVector(4,t,4)}static addGraphs(e,t){e.addFieldOffset(12,t,0)}static createGraphsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startGraphsVector(e,t){e.startVector(4,t,4)}static endAttribute(e){return e.endObject()}static createAttribute(e,t,r,o,a,i,s,l,u,c,d,f,p,h){return n.startAttribute(e),n.addName(e,t),n.addDocString(e,r),n.addType(e,o),n.addF(e,a),n.addI(e,i),n.addS(e,s),n.addT(e,l),n.addG(e,u),n.addFloats(e,c),n.addInts(e,d),n.addStrings(e,f),n.addTensors(e,p),n.addGraphs(e,h),n.endAttribute(e)}}t.Attribute=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsGraph(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsGraph(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}initializers(t,n){let r=this.bb.__offset(this.bb_pos,4);return r?(n||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}initializersLength(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__vector_len(this.bb_pos+e):0}nodeArgs(t,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new e.experimental.fbs.ValueInfo).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}nodeArgsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}nodes(t,n){let r=this.bb.__offset(this.bb_pos,8);return r?(n||new e.experimental.fbs.Node).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}nodesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}maxNodeIndex(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readUint32(this.bb_pos+e):0}nodeEdges(t,n){let r=this.bb.__offset(this.bb_pos,12);return r?(n||new e.experimental.fbs.NodeEdge).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}nodeEdgesLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}inputs(e,t){let n=this.bb.__offset(this.bb_pos,14);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}inputsLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}outputs(e,t){let n=this.bb.__offset(this.bb_pos,16);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}outputsLength(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}sparseInitializers(t,n){let r=this.bb.__offset(this.bb_pos,18);return r?(n||new e.experimental.fbs.SparseTensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}sparseInitializersLength(){let e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__vector_len(this.bb_pos+e):0}static startGraph(e){e.startObject(8)}static addInitializers(e,t){e.addFieldOffset(0,t,0)}static createInitializersVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startInitializersVector(e,t){e.startVector(4,t,4)}static addNodeArgs(e,t){e.addFieldOffset(1,t,0)}static createNodeArgsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startNodeArgsVector(e,t){e.startVector(4,t,4)}static addNodes(e,t){e.addFieldOffset(2,t,0)}static createNodesVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startNodesVector(e,t){e.startVector(4,t,4)}static addMaxNodeIndex(e,t){e.addFieldInt32(3,t,0)}static addNodeEdges(e,t){e.addFieldOffset(4,t,0)}static createNodeEdgesVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startNodeEdgesVector(e,t){e.startVector(4,t,4)}static addInputs(e,t){e.addFieldOffset(5,t,0)}static createInputsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startInputsVector(e,t){e.startVector(4,t,4)}static addOutputs(e,t){e.addFieldOffset(6,t,0)}static createOutputsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startOutputsVector(e,t){e.startVector(4,t,4)}static addSparseInitializers(e,t){e.addFieldOffset(7,t,0)}static createSparseInitializersVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startSparseInitializersVector(e,t){e.startVector(4,t,4)}static endGraph(e){return e.endObject()}static createGraph(e,t,r,o,a,i,s,l,u){return n.startGraph(e),n.addInitializers(e,t),n.addNodeArgs(e,r),n.addNodes(e,o),n.addMaxNodeIndex(e,a),n.addNodeEdges(e,i),n.addInputs(e,s),n.addOutputs(e,l),n.addSparseInitializers(e,u),n.endGraph(e)}}t.Graph=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsModel(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsModel(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}irVersion(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}opsetImport(t,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new e.experimental.fbs.OperatorSetId).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}opsetImportLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}producerName(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__string(this.bb_pos+t,e):null}producerVersion(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__string(this.bb_pos+t,e):null}domain(e){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__string(this.bb_pos+t,e):null}modelVersion(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}docString(e){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__string(this.bb_pos+t,e):null}graph(t){let n=this.bb.__offset(this.bb_pos,18);return n?(t||new e.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}graphDocString(e){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.__string(this.bb_pos+t,e):null}static startModel(e){e.startObject(9)}static addIrVersion(e,t){e.addFieldInt64(0,t,e.createLong(0,0))}static addOpsetImport(e,t){e.addFieldOffset(1,t,0)}static createOpsetImportVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startOpsetImportVector(e,t){e.startVector(4,t,4)}static addProducerName(e,t){e.addFieldOffset(2,t,0)}static addProducerVersion(e,t){e.addFieldOffset(3,t,0)}static addDomain(e,t){e.addFieldOffset(4,t,0)}static addModelVersion(e,t){e.addFieldInt64(5,t,e.createLong(0,0))}static addDocString(e,t){e.addFieldOffset(6,t,0)}static addGraph(e,t){e.addFieldOffset(7,t,0)}static addGraphDocString(e,t){e.addFieldOffset(8,t,0)}static endModel(e){return e.endObject()}static createModel(e,t,r,o,a,i,s,l,u,c){return n.startModel(e),n.addIrVersion(e,t),n.addOpsetImport(e,r),n.addProducerName(e,o),n.addProducerVersion(e,a),n.addDomain(e,i),n.addModelVersion(e,s),n.addDocString(e,l),n.addGraph(e,u),n.addGraphDocString(e,c),n.endModel(e)}}t.Model=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){!function(e){class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsKernelCreateInfos(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsKernelCreateInfos(e,n){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(n||new t).__init(e.readInt32(e.position())+e.position(),e)}nodeIndices(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readUint32(this.bb.__vector(this.bb_pos+t)+4*e):0}nodeIndicesLength(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__vector_len(this.bb_pos+e):0}nodeIndicesArray(){let e=this.bb.__offset(this.bb_pos,4);return e?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}kernelDefHashes(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint64(this.bb.__vector(this.bb_pos+t)+8*e):this.bb.createLong(0,0)}kernelDefHashesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}static startKernelCreateInfos(e){e.startObject(2)}static addNodeIndices(e,t){e.addFieldOffset(0,t,0)}static createNodeIndicesVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addInt32(t[n]);return e.endVector()}static startNodeIndicesVector(e,t){e.startVector(4,t,4)}static addKernelDefHashes(e,t){e.addFieldOffset(1,t,0)}static createKernelDefHashesVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startKernelDefHashesVector(e,t){e.startVector(8,t,8)}static endKernelCreateInfos(e){return e.endObject()}static createKernelCreateInfos(e,n,r){return t.startKernelCreateInfos(e),t.addNodeIndices(e,n),t.addKernelDefHashes(e,r),t.endKernelCreateInfos(e)}}e.KernelCreateInfos=t}(e.fbs||(e.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSubGraphSessionState(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSubGraphSessionState(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}graphId(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}sessionState(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new e.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startSubGraphSessionState(e){e.startObject(2)}static addGraphId(e,t){e.addFieldOffset(0,t,0)}static addSessionState(e,t){e.addFieldOffset(1,t,0)}static endSubGraphSessionState(e){let t=e.endObject();return e.requiredField(t,4),t}static createSubGraphSessionState(e,t,r){return n.startSubGraphSessionState(e),n.addGraphId(e,t),n.addSessionState(e,r),n.endSubGraphSessionState(e)}}t.SubGraphSessionState=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSessionState(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSessionState(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}kernels(t){let n=this.bb.__offset(this.bb_pos,4);return n?(t||new e.experimental.fbs.KernelCreateInfos).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}subGraphSessionStates(t,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new e.experimental.fbs.SubGraphSessionState).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}subGraphSessionStatesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSessionState(e){e.startObject(2)}static addKernels(e,t){e.addFieldOffset(0,t,0)}static addSubGraphSessionStates(e,t){e.addFieldOffset(1,t,0)}static createSubGraphSessionStatesVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startSubGraphSessionStatesVector(e,t){e.startVector(4,t,4)}static endSessionState(e){return e.endObject()}static createSessionState(e,t,r){return n.startSessionState(e),n.addKernels(e,t),n.addSubGraphSessionStates(e,r),n.endSessionState(e)}}t.SessionState=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){var t;!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInferenceSession(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInferenceSession(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static bufferHasIdentifier(e){return e.__has_identifier("ORTM")}ortVersion(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}model(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new e.experimental.fbs.Model).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}sessionState(t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new e.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startInferenceSession(e){e.startObject(3)}static addOrtVersion(e,t){e.addFieldOffset(0,t,0)}static addModel(e,t){e.addFieldOffset(1,t,0)}static addSessionState(e,t){e.addFieldOffset(2,t,0)}static endInferenceSession(e){return e.endObject()}static finishInferenceSessionBuffer(e,t){e.finish(t,"ORTM")}static finishSizePrefixedInferenceSessionBuffer(e,t){e.finish(t,"ORTM",!0)}static createInferenceSession(e,t,r,o){return n.startInferenceSession(e),n.addOrtVersion(e,t),n.addModel(e,r),n.addSessionState(e,o),n.endInferenceSession(e)}}t.InferenceSession=n}((t=e.experimental||(e.experimental={})).fbs||(t.fbs={}))}(t.onnxruntime||(t.onnxruntime={}))},7448:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OnnxjsSessionHandler=void 0;const r=n(1670),o=n(9162);t.OnnxjsSessionHandler=class{constructor(e){this.session=e,this.inputNames=this.session.inputNames,this.outputNames=this.session.outputNames}async dispose(){}async run(e,t,n){const a=new Map;for(const r in e)if(Object.hasOwnProperty.call(e,r)){const t=e[r];a.set(r,new o.Tensor(t.dims,t.type,void 0,void 0,t.data))}const i=await this.session.run(a),s={};return i.forEach((e,t)=>{s[t]=new r.Tensor(e.type,e.data,e.dims)}),s}startProfiling(){this.session.startProfiling()}endProfiling(){this.session.endProfiling()}}},6919:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Session=void 0;const r=n(7067),o=n(1296),a=n(7091),i=n(1036),s=n(6231),l=n(2644);t.Session=class{constructor(e={}){this._initialized=!1,this.backendHint=e.backendHint,this.profiler=s.Profiler.create(e.profiler),this.context={profiler:this.profiler,graphInputTypes:[],graphInputDims:[]}}get inputNames(){return this._model.graph.getInputNames()}get outputNames(){return this._model.graph.getOutputNames()}startProfiling(){this.profiler.start()}endProfiling(){this.profiler.stop()}async loadModel(e,t,n){await this.profiler.event("session","Session.loadModel",async()=>{const i=await(0,a.resolveBackend)(this.backendHint);if(this.sessionHandler=i.createSessionHandler(this.context),this._model=new l.Model,"string"==typeof e){const t=e.endsWith(".ort");if("undefined"==typeof fetch){const n=await(0,o.promisify)(r.readFile)(e);this.initialize(n,t)}else{const n=await fetch(e),r=await n.arrayBuffer();this.initialize(new Uint8Array(r),t)}}else if(ArrayBuffer.isView(e))this.initialize(e);else{const r=new Uint8Array(e,t||0,n||e.byteLength);this.initialize(r)}})}initialize(e,t){if(this._initialized)throw new Error("already initialized");this.profiler.event("session","Session.initialize",()=>{const n=this.sessionHandler.transformGraph?this.sessionHandler:void 0;this._model.load(e,n,t),this.sessionHandler.onGraphInitialized&&this.sessionHandler.onGraphInitialized(this._model.graph),this.initializeOps(this._model.graph),this._executionPlan=new i.ExecutionPlan(this._model.graph,this._ops,this.profiler)}),this._initialized=!0}async run(e){if(!this._initialized)throw new Error("session not initialized yet");return this.profiler.event("session","Session.run",async()=>{const t=this.normalizeAndValidateInputs(e),n=await this._executionPlan.execute(this.sessionHandler,t);return this.createOutput(n)})}normalizeAndValidateInputs(e){const t=this._model.graph.getInputNames();if(Array.isArray(e)){if(e.length!==t.length)throw new Error(`incorrect input array length: expected ${t.length} but got ${e.length}`)}else{if(e.size!==t.length)throw new Error(`incorrect input map size: expected ${t.length} but got ${e.size}`);const n=new Array(e.size);let r=0;for(let o=0;o<t.length;++o){const a=e.get(t[o]);if(!a)throw new Error(`missing input tensor for: '${name}'`);n[r++]=a}e=n}if(this.context.graphInputTypes&&0!==this.context.graphInputTypes.length&&this.context.graphInputDims&&0!==this.context.graphInputDims.length)this.validateInputTensorDims(this.context.graphInputDims,e,!1);else{const t=this._model.graph.getInputIndices(),n=this._model.graph.getValues(),r=new Array(t.length);for(let o=0;o<t.length;++o){const a=n[t[o]];r[o]=a.type.shape.dims,this.context.graphInputTypes.push(a.type.tensorType),this.context.graphInputDims.push(e[o].dims)}this.validateInputTensorDims(r,e,!0)}return this.validateInputTensorTypes(this.context.graphInputTypes,e),e}validateInputTensorTypes(e,t){for(let n=0;n<t.length;n++){const r=e[n],o=t[n].type;if(r!==o)throw new Error(`input tensor[${n}] check failed: expected type '${r}' but got ${o}`)}}validateInputTensorDims(e,t,n){for(let r=0;r<t.length;r++){const o=e[r],a=t[r].dims;if(!this.compareTensorDims(o,a,n))throw new Error(`input tensor[${r}] check failed: expected shape '[${o.join(",")}]' but got [${a.join(",")}]`)}}compareTensorDims(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(e[r]!==t[r]&&(!n||0!==e[r]))return!1;return!0}createOutput(e){const t=this._model.graph.getOutputNames();if(e.length!==t.length)throw new Error("expected number of outputs do not match number of generated outputs");const n=new Map;for(let r=0;r<t.length;++r)n.set(t[r],e[r]);return n}initializeOps(e){const t=e.getNodes();this._ops=new Array(t.length);for(let n=0;n<t.length;n++)this._ops[n]=this.sessionHandler.resolve(t[n],this._model.opsets,e)}}},9162:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Tensor=void 0;const o=n(3442),a=r(n(3720)),i=n(1446),s=n(9395),l=n(2517);var u=s.onnxruntime.experimental.fbs;class c{get data(){if(void 0===this.cache){const e=this.dataProvider(this.dataId);if(e.length!==this.size)throw new Error("Length of data provided by the Data Provider is inconsistent with the dims of this Tensor.");this.cache=e}return this.cache}get stringData(){if("string"!==this.type)throw new TypeError("data type is not string");return this.data}get integerData(){switch(this.type){case"uint8":case"int8":case"uint16":case"int16":case"int32":case"uint32":case"bool":return this.data;default:throw new TypeError("data type is not integer (uint8, int8, uint16, int16, int32, uint32, bool)")}}get floatData(){switch(this.type){case"float32":case"float64":return this.data;default:throw new TypeError("data type is not float (float32, float64)")}}get numberData(){if("string"!==this.type)return this.data;throw new TypeError("type cannot be non-number (string)")}get(e){return this.data[l.ShapeUtil.indicesToOffset(e,this.strides)]}set(e,t){this.data[l.ShapeUtil.indicesToOffset(e,this.strides)]=t}async getData(){return void 0===this.cache&&(this.cache=await this.asyncDataProvider(this.dataId)),this.cache}get strides(){return this._strides||(this._strides=l.ShapeUtil.computeStrides(this.dims)),this._strides}constructor(e,t,n,r,a,i=o.Guid.create()){this.dims=e,this.type=t,this.dataProvider=n,this.asyncDataProvider=r,this.cache=a,this.dataId=i,this.size=l.ShapeUtil.validateDimsAndCalcSize(e);const s=this.size,u=void 0===n&&void 0===r&&void 0===a;if(void 0!==a&&a.length!==s)throw new RangeError("Input dims doesn't match data length.");if("string"===t){if(!(void 0===a||Array.isArray(a)&&a.every(e=>"string"==typeof e)))throw new TypeError("cache should be a string array");u&&(this.cache=new Array(s))}else{if(void 0!==a){const e=f(t);if(!(a instanceof e))throw new TypeError(`cache should be type ${e.name}`)}if(u){const e=new ArrayBuffer(s*function(e){switch(e){case"bool":case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;case"float64":return 8;default:throw new Error(`cannot calculate sizeof() on type ${e}`)}}(t));this.cache=(c=e,new(f(t))(c))}}var c}static fromProto(e){if(!e)throw new Error("cannot construct Value from an empty tensor");const t=l.ProtoUtil.tensorDataTypeFromProto(e.dataType),n=l.ProtoUtil.tensorDimsFromProto(e.dims),r=new c(n,t);if("string"===t)e.stringData.forEach((e,t)=>{r.data[t]=(0,l.decodeUtf8String)(e)});else if(e.rawData&&"number"==typeof e.rawData.byteLength&&e.rawData.byteLength>0){const t=r.data,n=new DataView(e.rawData.buffer,e.rawData.byteOffset,e.rawData.byteLength),o=d(e.dataType),a=e.rawData.byteLength/o;if(e.rawData.byteLength%o!=0)throw new Error("invalid buffer length");if(t.length!==a)throw new Error("buffer length mismatch");for(let r=0;r<a;r++){const a=h(n,e.dataType,r*o);t[r]=a}}else{let t;switch(e.dataType){case i.onnx.TensorProto.DataType.FLOAT:t=e.floatData;break;case i.onnx.TensorProto.DataType.INT32:case i.onnx.TensorProto.DataType.INT16:case i.onnx.TensorProto.DataType.UINT16:case i.onnx.TensorProto.DataType.INT8:case i.onnx.TensorProto.DataType.UINT8:case i.onnx.TensorProto.DataType.BOOL:t=e.int32Data;break;case i.onnx.TensorProto.DataType.INT64:t=e.int64Data;break;case i.onnx.TensorProto.DataType.DOUBLE:t=e.doubleData;break;case i.onnx.TensorProto.DataType.UINT32:case i.onnx.TensorProto.DataType.UINT64:t=e.uint64Data;break;default:throw new Error("unspecific error")}if(null==t)throw new Error("failed to populate data from a tensorproto value");const n=r.data;if(n.length!==t.length)throw new Error("array length mismatch");for(let r=0;r<t.length;r++){const o=t[r];a.default.isLong(o)?n[r]=p(o,e.dataType):n[r]=o}}return r}static fromData(e,t,n){return new c(t,n,void 0,void 0,e)}static fromOrtTensor(e){if(!e)throw new Error("cannot construct Value from an empty tensor");const t=l.ProtoUtil.tensorDimsFromORTFormat(e),n=l.ProtoUtil.tensorDataTypeFromProto(e.dataType()),r=new c(t,n);if("string"===n)for(let o=0;o<e.stringDataLength();o++)r.data[o]=e.stringData(o);else if(e.rawDataArray()&&"number"==typeof e.rawDataLength()&&e.rawDataLength()>0){const t=r.data,n=new DataView(e.rawDataArray().buffer,e.rawDataArray().byteOffset,e.rawDataLength()),o=d(e.dataType()),a=e.rawDataLength()/o;if(e.rawDataLength()%o!=0)throw new Error("invalid buffer length");if(t.length!==a)throw new Error("buffer length mismatch");for(let r=0;r<a;r++){const a=h(n,e.dataType(),r*o);t[r]=a}}return r}}function d(e){switch(e){case i.onnx.TensorProto.DataType.UINT8:case i.onnx.TensorProto.DataType.INT8:case i.onnx.TensorProto.DataType.BOOL:return 1;case i.onnx.TensorProto.DataType.UINT16:case i.onnx.TensorProto.DataType.INT16:return 2;case i.onnx.TensorProto.DataType.FLOAT:case i.onnx.TensorProto.DataType.INT32:case i.onnx.TensorProto.DataType.UINT32:return 4;case i.onnx.TensorProto.DataType.INT64:case i.onnx.TensorProto.DataType.DOUBLE:case i.onnx.TensorProto.DataType.UINT64:return 8;default:throw new Error(`cannot calculate sizeof() on type ${i.onnx.TensorProto.DataType[e]}`)}}function f(e){switch(e){case"bool":case"uint8":return Uint8Array;case"int8":return Int8Array;case"int16":return Int16Array;case"uint16":return Uint16Array;case"int32":return Int32Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;default:throw new Error("unspecified error")}}function p(e,t){if(t===i.onnx.TensorProto.DataType.INT64||t===u.TensorDataType.INT64){if(e.greaterThanOrEqual(2147483648)||e.lessThan(-2147483648))throw new TypeError("int64 is not supported")}else{if(t!==i.onnx.TensorProto.DataType.UINT32&&t!==u.TensorDataType.UINT32&&t!==i.onnx.TensorProto.DataType.UINT64&&t!==u.TensorDataType.UINT64)throw new TypeError(`not a LONG type: ${i.onnx.TensorProto.DataType[t]}`);if(e.greaterThanOrEqual(4294967296)||e.lessThan(0))throw new TypeError("uint64 is not supported")}return e.toNumber()}function h(e,t,n){switch(t){case i.onnx.TensorProto.DataType.BOOL:case i.onnx.TensorProto.DataType.UINT8:return e.getUint8(n);case i.onnx.TensorProto.DataType.INT8:return e.getInt8(n);case i.onnx.TensorProto.DataType.UINT16:return e.getUint16(n,!0);case i.onnx.TensorProto.DataType.INT16:return e.getInt16(n,!0);case i.onnx.TensorProto.DataType.FLOAT:return e.getFloat32(n,!0);case i.onnx.TensorProto.DataType.INT32:return e.getInt32(n,!0);case i.onnx.TensorProto.DataType.UINT32:return e.getUint32(n,!0);case i.onnx.TensorProto.DataType.INT64:return p(a.default.fromBits(e.getUint32(n,!0),e.getUint32(n+4,!0),!1),t);case i.onnx.TensorProto.DataType.DOUBLE:return e.getFloat64(n,!0);case i.onnx.TensorProto.DataType.UINT64:return p(a.default.fromBits(e.getUint32(n,!0),e.getUint32(n+4,!0),!0),t);default:throw new Error(`cannot read from DataView for type ${i.onnx.TensorProto.DataType[t]}`)}}t.Tensor=c},2517:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.decodeUtf8String=t.MAX_CLIP=t.MIN_CLIP=t.PoolConvUtil=t.ReduceUtil=t.SplitUtil=t.MathUtil=t.ShapeUtil=t.LongUtil=t.ProtoUtil=t.GemmUtil=t.arrayCopyHelper=t.BroadcastUtil=t.MatMulUtil=t.ArrayUtil=t.assert=t.checkInputsShape=void 0;const o=n(5686),a=r(n(3720)),i=n(1446),s=n(9162);t.checkInputsShape=function(e,...t){if(!e||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].dims||e[n].dims.length!==t[n])return!1;return!0},t.assert=function(e,t){if(!e)throw new Error("string"==typeof t?t:t())},t.ArrayUtil=class{static arraysEqual(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}};class l{static preprocessInputShapes(e,t){return[1===e.length?[1,e[0]]:e,1===t.length?[t[0],1]:t]}static postprocessOutputShape(e,t,n){1===t&&e.splice(e.length-2,1),1===n&&e.pop()}static calcMatMulShape(e,t){return e[1]!==t[0]?void 0:[e[0],t[1]]}}t.MatMulUtil=l;class u{static calcShape(e,t,n=!1){const r=e.length,o=t.length;if(0===r)return t;if(0===o)return e;const a=Math.max(e.length,t.length),i=new Array(a);if(n){if(r<2||o<2)return;const n=l.calcMatMulShape([e[r-2],e[r-1]],[t[o-2],t[o-1]]);if(void 0===n)return;[i[a-2],i[a-1]]=n}for(let s=n?3:1;s<=a;s++){const n=r-s<0?1:e[r-s],l=o-s<0?1:t[o-s];if(n!==l&&n>1&&l>1)return;i[a-s]=Math.max(n,l)}return i}static index(e,t){const n=new Array(t.length);return u.fillIndex(e,t,n),n}static fillIndex(e,t,n){const r=e.length-t.length;for(let o=0;o<t.length;o++)n[o]=e[r+o]%t[o]}static calc(e,t,n,r,o){const a=u.calcShape(e.dims,t.dims);if(a){if(r&&!f.areEqual(a,e.dims))return;const i=f.size(a),l=r?e:new s.Tensor(a,o||e.type);if(0===a.length)l.set([],n(e.get([]),t.get([])));else{const r=new Array(a.length),o=new Array(e.dims.length),s=new Array(t.dims.length);let c,d=0,f=0,p=!1,h=!1;0===e.dims.length&&(d=e.get([]),p=!0),0===t.dims.length&&(f=t.get([]),h=!0);for(let m=0;m<i;m++){c=m;for(let e=a.length-1;e>=0;e--)r[e]=c%a[e],c=Math.floor(c/a[e]);p||(u.fillIndex(r,e.dims,o),d=e.get(o)),h||(u.fillIndex(r,t.dims,s),f=t.get(s)),l.set(r,n(d,f))}}return l}}static isValidBroadcast(e,t){const n=e.length,r=t.length;if(n>r)return!1;for(let o=1;o<=n;o++)if(1!==e[n-o]&&e[n-o]!==t[r-o])return!1;return!0}static getBroadcastDims(e,t){const n=e.length,r=[];for(let o=0;o<n;o++){const a=n-1-o,i=e[a]||1;(t[t.length-1-o]||1)>1&&1===i&&r.unshift(a)}return r}}t.BroadcastUtil=u,t.arrayCopyHelper=function(e,t,n,r,o){if(r<0||r>=t.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=e.length)throw new Error("targetIndex out of bounds");if(r+o>t.length)throw new Error("source indices to be copied are outside bounds");if(n+o>e.length)throw new Error("target array is too small to hold result");for(let a=0;a<o;a++)e[n+a]=t[r+a]},t.GemmUtil=class{static getShapeOfGemmResult(e,t,n,r,o){if(2!==e.length||2!==n.length)throw new Error("shape need to be of size 2");let a,i,s;t?(a=e[1],i=e[0]):(a=e[0],i=e[1]);let l=-1;if(r?(s=n[0],l=1):(s=n[1],l=0),n[l]!==i)throw new Error("dimension mismatch");if(a<=0||s<=0||i<=0)throw new Error("invalid shape specified");if(o&&!u.isValidBroadcast(o,[a,s]))throw new Error("gemm: invalid bias shape for broadcast");return[a,s,i]}};class c{static tensorDataTypeFromProto(e){switch(e){case i.onnx.TensorProto.DataType.INT8:return"int8";case i.onnx.TensorProto.DataType.UINT8:return"uint8";case i.onnx.TensorProto.DataType.BOOL:return"bool";case i.onnx.TensorProto.DataType.INT16:return"int16";case i.onnx.TensorProto.DataType.UINT16:return"uint16";case i.onnx.TensorProto.DataType.INT32:return"int32";case i.onnx.TensorProto.DataType.UINT32:return"uint32";case i.onnx.TensorProto.DataType.FLOAT:return"float32";case i.onnx.TensorProto.DataType.DOUBLE:return"float64";case i.onnx.TensorProto.DataType.STRING:return"string";case i.onnx.TensorProto.DataType.INT64:return"int32";case i.onnx.TensorProto.DataType.UINT64:return"uint32";default:throw new Error(`unsupported data type: ${i.onnx.TensorProto.DataType[e]}`)}}static tensorDataTypeStringToEnum(e){switch(e){case"int8":return i.onnx.TensorProto.DataType.INT8;case"uint8":return i.onnx.TensorProto.DataType.UINT8;case"bool":return i.onnx.TensorProto.DataType.BOOL;case"int16":return i.onnx.TensorProto.DataType.INT16;case"uint16":return i.onnx.TensorProto.DataType.UINT16;case"int32":return i.onnx.TensorProto.DataType.INT32;case"uint32":return i.onnx.TensorProto.DataType.UINT32;case"float32":return i.onnx.TensorProto.DataType.FLOAT;case"float64":return i.onnx.TensorProto.DataType.DOUBLE;case"string":return i.onnx.TensorProto.DataType.STRING;case"int64":return i.onnx.TensorProto.DataType.INT64;case"uint64":return i.onnx.TensorProto.DataType.UINT64;default:throw new Error(`unsupported data type: ${e}`)}}static tensorDimsFromProto(e){return e.map(e=>a.default.isLong(e)?e.toNumber():e)}static tensorValueTypeFromProto(e){return{tensorType:c.tensorDataTypeFromProto(e.elemType),shape:{dims:c.tensorDimsFromProto(e.shape.dim.map(e=>e.dimValue))}}}static tensorDimsFromORTFormat(e){const t=[];for(let n=0;n<e.dimsLength();n++)t.push(d.longToNumber(e.dims(n)));return t}static tensorAttributesFromORTFormat(e){const t=[];for(let n=0;n<e.attributesLength();n++)t.push(e.attributes(n));return t}}t.ProtoUtil=c;class d{static longToNumber(e,t){return a.default.isLong(e)?e.toNumber():e instanceof o.flatbuffers.Long?a.default.fromValue({low:e.low,high:e.high,unsigned:null!=t&&t}).toNumber():e}static isLong(e){return a.default.isLong(e)||e instanceof o.flatbuffers.Long}}t.LongUtil=d;class f{static size(e){return f.getSizeFromDimensionRange(e,0,e.length)}static sizeFromDimension(e,t){if(t<0||t>e.length)throw new Error(`invalid dimension of ${t} for sizeFromDimension as Tensor has ${e.length} dimensions.`);return f.getSizeFromDimensionRange(e,t,e.length)}static sizeToDimension(e,t){if(t<0||t>e.length)throw new Error(`invalid dimension of ${t} for sizeToDimension as Tensor has ${e.length} dimensions.`);return f.getSizeFromDimensionRange(e,0,t)}static getSizeFromDimensionRange(e,t,n){let r=1;for(let o=t;o<n;o++){if(e[o]<=0)throw new Error("cannot get valid size from specified dimension range. Most likely the range contains 0 or negative values in them.");r*=e[o]}return r}static computeStrides(e){const t=e.length;if(0===t)return[];if(1===t)return[1];const n=new Array(t);n[t-1]=1,n[t-2]=e[t-1];for(let r=t-3;r>=0;--r)n[r]=n[r+1]*e[r+1];return n}static transpose(e){return e.slice().reverse()}static indicesToOffset(e,t,n){void 0===n&&(n=e.length);let r=0;for(let o=0;o<n;++o)r+=t[o]*e[o];return r}static offsetToIndices(e,t){const n=t.length;if(0===n)return[];if(1===n)return[e*t[0]];const r=new Array(t.length);for(let o=0;o<r.length-1;++o)r[o]=Math.floor(e/t[o]),e-=r[o]*t[o];return r[r.length-1]=e,r}static normalizeAxis(e,t){if(e<-t&&e>=t)throw new Error("unsupported axis for this operation.");return e<0?e+t:e}static normalizeAxes(e,t){return e.map(e=>this.normalizeAxis(e,t))}static incrementIndex(e,t,n){if(0===t.length||0===e.length)throw new Error("Index incrementing unsupported for scalar Tensor");if(void 0===n)n=t.length;else if(n<=0||n>t.length)throw new Error("Incorrect axis to increment on");for(let r=n-1;r>=0&&(e[r]++,!(e[r]<t[r]));--r)e[r]=0}static calculateReshapedDims(e,t){if(0===t.length){if(0===e.length||1===f.size(e))return[];throw new Error("cannot reshape to a scalar Tensor")}const n=t.length,r=new Array(n);let o=-1,a=1;for(let s=0;s<n;s++){if(t[s]<-1)throw new Error("a dimension in shape hints cannot be less than -1");if(-1===t[s]){if(-1!==o)throw new Error("at most one dimension in shape hints can be -1");o=s}else{if(0===t[s]){if(s>=e.length)throw new Error("the dimension with value zero exceeds the dimension size of the input tensor");r[s]=e[s]}else r[s]=t[s];a*=r[s]}}const i=f.size(e);if(-1!==o){if(i%a!=0)throw new Error(`the input tensor cannot be reshaped to the requested shape. Input shape: [${e}] Output shape: [${t}]`);r[o]=i/a}else if(a!==i)throw new Error("reshapedDims and originalDims don't have matching sizes");return r}static sortBasedOnPerm(e,t){return t?t.map(t=>e[t]):e.slice().reverse()}static padShape(e,t){const n=e.length;return e.map((e,r)=>e+t[r]+t[r+n])}static areEqual(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}static validateDimsAndCalcSize(e){if(e.length>6)throw new TypeError("Only rank 0 to 6 is supported for tensor shape.");let t=1;for(const n of e){if(!Number.isInteger(n))throw new TypeError(`Invalid shape: ${n} is not an integer`);if(n<0||n>2147483647)throw new TypeError(`Invalid shape: length ${n} is not allowed`);t*=n}return t}static flattenShape(e,t){t<0&&(t+=e.length);const n=e.reduce((e,t)=>e*t,1),r=e.slice(t).reduce((e,t)=>e*t,1);return[n/r,r]}static squeezeShape(e,t){const n=new Array;t=f.normalizeAxes(t,e.length);for(let r=0;r<e.length;r++){const o=t.indexOf(r)>=0;if(o&&1!==e[r])throw new Error("squeeze an axis of size different than 1");(0===t.length&&e[r]>1||t.length>0&&!o)&&n.push(e[r])}return n}static unsqueezeShape(e,t){const n=new Array(e.length+t.length);n.fill(0);for(let o=0;o<t.length;o++){const e=f.normalizeAxis(t[o],n.length);if(e>=n.length)throw new Error("'axes' has an out of range axis");if(0!==n[e])throw new Error("'axes' has a duplicate axis");n[e]=1}let r=0;for(let o=0;o<n.length;o++)0===n[o]&&(n[o]=e[r++]);if(r!==e.length)throw new Error("the unsqueezed dimension could not be established");return n}}t.ShapeUtil=f,t.MathUtil=class{static sqr(e,t,n,r,o){if(r<0||r>=t.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=e.length)throw new Error("targetIndex out of bounds");if(r+o>t.length)throw new Error("source indices to be copied are outside bounds");if(n+o>e.length)throw new Error("target array is too small to hold result");for(let a=0;a<o;a++)e[n+a]+=Math.pow(t[r+a],2)}static axpy(e,t,n,r,o,a){if(r<0||r>=t.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=e.length)throw new Error("targetIndex out of bounds");if(r+o>t.length)throw new Error("source indices to be copied are outside bounds");if(n+o>e.length)throw new Error("target array is too small to hold result");for(let i=0;i<o;i++)e[n+i]+=a*t[r+i]}static powx(e,t,n,r,o,a){if(r<0||r>=t.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=e.length)throw new Error("targetIndex out of bounds");if(r+o>t.length)throw new Error("source indices to be copied are outside bounds");if(n+o>e.length)throw new Error("target array is too small to hold result");for(let i=0;i<o;i++)e[n+i]=Math.pow(t[r+i],a)}static mul(e,t,n,r,o){if(r<0||r>=t.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=e.length)throw new Error("targetIndex out of bounds");if(r+o>t.length)throw new Error("source indices to be copied are outside bounds");if(n+o>e.length)throw new Error("target array is too small to hold result");for(let a=0;a<o;a++)e[n+a]=t[r+a]*e[n+a]}};class p{static splitShape(e,t,n,r){if(0===n.length){if(!r)throw new Error("need to know number of outputs when the 'split' attribute is not specified");p.determineSplit(e[t],r,n)}const o=[],a=[0];for(let i=0;i<n.length;++i){0!==i&&a.push(a[i-1]+n[i-1]);const r=e.slice();r[t]=n[i],o.push(r)}return[o,a]}static determineSplit(e,t,n){if(e%t!=0)throw new Error("cannot split tensor to equal sized parts");for(let r=0;r<t;++r)n.push(e/t)}}t.SplitUtil=p;class h{static calcReduce(e,t,n,r,o){const a=e.dims.slice(0);0===t.length&&a.forEach((e,n)=>t.push(n));const i=h.calcReduceShape(a,t,!0),l=f.size(i),c=new s.Tensor(i,e.type),d=f.computeStrides(i),p=f.computeStrides(a),m=new Array(a.length);for(let s=0;s<l;s++){const n=f.offsetToIndices(s,d);u.fillIndex(n,a,m),c.set(n,h.calcReduceByAxis(e.numberData,t,a,0,f.indicesToOffset(m,p),r,o))}return n?c:new s.Tensor(h.calcReduceShape(a,t,n),c.type,void 0,void 0,c.data,c.dataId)}static calcReduceByAxis(e,t,n,r,o,a,i){let s=0;if(r>=t.length)return a(e[o]);const l=t[r],u=l>=n.length?1:f.size(n.slice(l+1));for(let c=0;c<n[l];c++)s=0===c?h.calcReduceByAxis(e,t,n,r+1,o,a,i):i(s,h.calcReduceByAxis(e,t,n,r+1,o,a,i)),o+=u;return s}static calcReduceShape(e,t,n){const r=e.slice();for(let o=0;o<t.length;o++)r[t[o]]=n?1:0;return r.filter(e=>0!==e)}}t.ReduceUtil=h;class m{static adjustPoolAttributes(e,t,n,r,o,a){if(!e&&n.length!==t.length-2)throw new Error("length of specified kernel shapes should be 2 less than length of input dimensions");if(e)for(let i=0;i<t.length-2;i++)i>=n.length?n.push(t[i+2]):n[i]=t[i+2];for(let i=0;i<n.length;i++)if(i<r.length){if(r[i]<0)throw new Error("strides should be greater than or equal to 1")}else r.push(1);for(let i=0;i<n.length;i++)if(i<o.length){if(o[i]<0)throw new Error("dilations should be greater than or equal to 1")}else o.push(1);for(let i=0;i<2*n.length;i++)if(i<a.length){if(a[i]<0)throw new Error("pad should be greater than or equal to 1")}else a.push(0);for(let i=0;i<n.length;i++){if(n[i]<=0)throw new Error("kernel shapes need to be greater than 0");if(a[i]>=n[i]||a[i+n.length]>=n[i])throw new Error("pads should be smaller than kernel")}}static adjustPadsBasedOnAutoPad(e,t,n,r,o,a){if(a){if(o.length!==2*(e.length-2))throw new Error("length of pads should be twice the length of data dimensions");if(t.length!==e.length-2)throw new Error("length of strides should be the length of data dimensions");if(r.length!==e.length-2)throw new Error("length of kernel shapes should be the length of data dimensions");for(let i=0;i<e.length-2;i++)m.adjustPadAndReturnShape(e[i+2],t[i],n[i],r[i],o,i,i+e.length-2,a)}}static computePoolOutputShape(e,t,n,r,o,a,i){if(t.length<=0)throw new Error("input shape must be of size greater than 0");const s=[t[0],t[1]];return m.computeShapeHelper(e,t,s,n,r,o,a,i),s}static computeConvOutputShape(e,t,n,r,o,a,i){if(e.length<=0||t.length<=0)throw new Error("invalid input tensor dims or invalid filter tensor dims");const s=[e[0],t[0]];return m.computeShapeHelper(!1,e,s,n,r,o,a,i),s}static computeShapeHelper(e,t,n,r,o,a,i,s){if(e)for(let l=0;l<t.length-2;l++)n.push(1);else for(let l=0;l<t.length-2;l++)n.push(m.adjustPadAndReturnShape(t[l+2],r[l],o[l],a[l],i,l,l+t.length-2,s))}static adjustPadAndReturnShape(e,t,n,r,o,a,i,s){const l=n*(r-1)+1;if(!s||"NOTSET"===s)return Math.floor((e+o[a]+o[i]-l)/t+1);switch(s){case"VALID":return o[a]=0,o[i]=0,Math.floor((e-l)/t+1);case"SAME_LOWER":case"SAME_UPPER":if(1!==n)throw new Error("Dilation not supported for SAME_UPPER or SAME_LOWER");{const n=((e+t-1)/t-1)*t+r-e;return o[a]="SAME_LOWER"===s?Math.floor((n+1)/2):Math.floor(n/2),o[i]=n-o[a],Math.floor((e+n-r)/t+1)}default:throw new Error("Unsupported AutoPad type")}}}t.PoolConvUtil=m,t.MIN_CLIP=-34028234663852886e22,t.MAX_CLIP=34028234663852886e22,t.decodeUtf8String=function(e){return(new TextDecoder).decode(e)}},7967:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.iterateExtraOptions=void 0,t.iterateExtraOptions=(e,n,r,o)=>{if("object"==typeof e&&null!==e){if(r.has(e))throw new Error("Circular reference in options");r.add(e)}Object.entries(e).forEach(([e,a])=>{const i=n?n+e:e;if("object"==typeof a)(0,t.iterateExtraOptions)(a,i+".",r,o);else if("string"==typeof a||"number"==typeof a)o(i,a.toString());else{if("boolean"!=typeof a)throw new Error("Can't handle extra config type: "+typeof a);o(i,a?"1":"0")}})}},2157:function(e,t,n){var r,o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return a(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.endProfiling=t.run=t.releaseSession=t.createSession=t.createSessionFinalize=t.createSessionAllocate=t.initOrt=t.initWasm=void 0;const s=n(1670),l=i(n(349)),u=n(6361),c=()=>!!s.env.wasm.proxy&&"undefined"!=typeof document;let d,f,p,h=!1,m=!1,g=!1;const b=[],y=[],_=[],v=[],w=[],S=[],x=()=>{if(h||!m||g||!d)throw new Error("worker not ready")},T=e=>{switch(e.data.type){case"init-wasm":h=!1,e.data.err?(g=!0,f[1](e.data.err)):(m=!0,f[0]());break;case"init-ort":e.data.err?p[1](e.data.err):p[0]();break;case"create_allocate":e.data.err?b.shift()[1](e.data.err):b.shift()[0](e.data.out);break;case"create_finalize":e.data.err?y.shift()[1](e.data.err):y.shift()[0](e.data.out);break;case"create":e.data.err?_.shift()[1](e.data.err):_.shift()[0](e.data.out);break;case"release":e.data.err?v.shift()[1](e.data.err):v.shift()[0]();break;case"run":e.data.err?w.shift()[1](e.data.err):w.shift()[0](e.data.out);break;case"end-profiling":e.data.err?S.shift()[1](e.data.err):S.shift()[0]()}},E="undefined"!=typeof document?null===(r=null===document||void 0===document?void 0:document.currentScript)||void 0===r?void 0:r.src:void 0;t.initWasm=async()=>{if(c()){if(m)return;if(h)throw new Error("multiple calls to 'initWasm()' detected.");if(g)throw new Error("previous call to 'initWasm()' failed.");return h=!0,void 0===s.env.wasm.wasmPaths&&E&&0!==E.indexOf("blob:")&&(s.env.wasm.wasmPaths=E.substr(0,+E.lastIndexOf("/")+1)),new Promise((e,t)=>{null==d||d.terminate(),d=n(9710).Z(),d.onmessage=T,f=[e,t];const r={type:"init-wasm",in:s.env.wasm};d.postMessage(r)})}return(0,u.initializeWebAssembly)(s.env.wasm)},t.initOrt=async(e,t)=>{if(c())return x(),new Promise((n,r)=>{p=[n,r];const o={type:"init-ort",in:{numThreads:e,loggingLevel:t}};d.postMessage(o)});l.initOrt(e,t)},t.createSessionAllocate=async e=>c()?(x(),new Promise((t,n)=>{b.push([t,n]);const r={type:"create_allocate",in:{model:e}};d.postMessage(r,[e.buffer])})):l.createSessionAllocate(e),t.createSessionFinalize=async(e,t)=>c()?(x(),new Promise((n,r)=>{y.push([n,r]);const o={type:"create_finalize",in:{modeldata:e,options:t}};d.postMessage(o)})):l.createSessionFinalize(e,t),t.createSession=async(e,t)=>c()?(x(),new Promise((n,r)=>{_.push([n,r]);const o={type:"create",in:{model:e,options:t}};d.postMessage(o,[e.buffer])})):l.createSession(e,t),t.releaseSession=async e=>{if(c())return x(),new Promise((t,n)=>{v.push([t,n]);const r={type:"release",in:e};d.postMessage(r)});l.releaseSession(e)},t.run=async(e,t,n,r,o)=>c()?(x(),new Promise((a,i)=>{w.push([a,i]);const s={type:"run",in:{sessionId:e,inputIndices:t,inputs:n,outputIndices:r,options:o}};d.postMessage(s,l.extractTransferableBuffers(n))})):l.run(e,t,n,r,o),t.endProfiling=async e=>{if(c())return x(),new Promise((t,n)=>{S.push([t,n]);const r={type:"end-profiling",in:e};d.postMessage(r)});l.endProfiling(e)}},586:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setRunOptions=void 0;const r=n(7967),o=n(4983),a=n(6361);t.setRunOptions=e=>{const t=(0,a.getInstance)();let n=0;const i=[],s=e||{};try{if(void 0===(null==e?void 0:e.logSeverityLevel))s.logSeverityLevel=2;else if("number"!=typeof e.logSeverityLevel||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${e.logSeverityLevel}`);if(void 0===(null==e?void 0:e.logVerbosityLevel))s.logVerbosityLevel=0;else if("number"!=typeof e.logVerbosityLevel||!Number.isInteger(e.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);void 0===(null==e?void 0:e.terminate)&&(s.terminate=!1);let a=0;if(void 0!==(null==e?void 0:e.tag)&&(a=(0,o.allocWasmString)(e.tag,i)),n=t._OrtCreateRunOptions(s.logSeverityLevel,s.logVerbosityLevel,!!s.terminate,a),0===n)throw new Error("Can't create run options");return void 0!==(null==e?void 0:e.extra)&&(0,r.iterateExtraOptions)(e.extra,"",new WeakSet,(e,r)=>{const a=(0,o.allocWasmString)(e,i),s=(0,o.allocWasmString)(r,i);if(0!==t._OrtAddRunConfigEntry(n,a,s))throw new Error(`Can't set a run config entry: ${e} - ${r}`)}),[n,i]}catch(l){throw 0!==n&&t._OrtReleaseRunOptions(n),i.forEach(t._free),l}}},2306:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OnnxruntimeWebAssemblySessionHandler=void 0;const r=n(2806),o=n(1670),a=n(2850),i=n(2157);let s;t.OnnxruntimeWebAssemblySessionHandler=class{async createSessionAllocate(e){const t=await fetch(e),n=await t.arrayBuffer();return(0,i.createSessionAllocate)(new Uint8Array(n))}async loadModel(e,t){if(s||(await(0,i.initOrt)(o.env.wasm.numThreads,(e=>{switch(e){case"verbose":return 0;case"info":return 1;case"warning":return 2;case"error":return 3;case"fatal":return 4;default:throw new Error(`unsupported logging level: ${e}`)}})(o.env.logLevel)),s=!0),"string"==typeof e)if("undefined"==typeof fetch){const n=await(0,a.promisify)(r.readFile)(e);[this.sessionId,this.inputNames,this.outputNames]=await(0,i.createSession)(n,t)}else{const n=await this.createSessionAllocate(e);[this.sessionId,this.inputNames,this.outputNames]=await(0,i.createSessionFinalize)(n,t)}else[this.sessionId,this.inputNames,this.outputNames]=await(0,i.createSession)(e,t)}async dispose(){return(0,i.releaseSession)(this.sessionId)}async run(e,t,n){const r=[],a=[];Object.entries(e).forEach(e=>{const t=e[0],n=e[1],o=this.inputNames.indexOf(t);if(-1===o)throw new Error(`invalid input '${t}'`);r.push(n),a.push(o)});const s=[];Object.entries(t).forEach(e=>{const t=e[0],n=this.outputNames.indexOf(t);if(-1===n)throw new Error(`invalid output '${t}'`);s.push(n)});const l=await(0,i.run)(this.sessionId,a,r.map(e=>[e.type,e.dims,e.data]),s,n),u={};for(let i=0;i<l.length;i++)u[this.outputNames[s[i]]]=new o.Tensor(l[i][0],l[i][2],l[i][1]);return u}startProfiling(){}endProfiling(){(0,i.endProfiling)(this.sessionId)}}},4919:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setSessionOptions=void 0;const r=n(7967),o=n(4983),a=n(6361);t.setSessionOptions=e=>{const t=(0,a.getInstance)();let n=0;const i=[],s=e||{};(e=>{e.extra||(e.extra={}),e.extra.session||(e.extra.session={});const t=e.extra.session;t.use_ort_model_bytes_directly||(t.use_ort_model_bytes_directly="1")})(s);try{void 0===(null==e?void 0:e.graphOptimizationLevel)&&(s.graphOptimizationLevel="all");const l=(e=>{switch(e){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${e}`)}})(s.graphOptimizationLevel);void 0===(null==e?void 0:e.enableCpuMemArena)&&(s.enableCpuMemArena=!0),void 0===(null==e?void 0:e.enableMemPattern)&&(s.enableMemPattern=!0),void 0===(null==e?void 0:e.executionMode)&&(s.executionMode="sequential");const u=(e=>{switch(e){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${e}`)}})(s.executionMode);let c=0;if(void 0!==(null==e?void 0:e.logId)&&(c=(0,o.allocWasmString)(e.logId,i)),void 0===(null==e?void 0:e.logSeverityLevel))s.logSeverityLevel=2;else if("number"!=typeof e.logSeverityLevel||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${e.logSeverityLevel}`);if(void 0===(null==e?void 0:e.logVerbosityLevel))s.logVerbosityLevel=0;else if("number"!=typeof e.logVerbosityLevel||!Number.isInteger(e.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);if(void 0===(null==e?void 0:e.enableProfiling)&&(s.enableProfiling=!1),n=t._OrtCreateSessionOptions(l,!!s.enableCpuMemArena,!!s.enableMemPattern,u,!!s.enableProfiling,0,c,s.logSeverityLevel,s.logVerbosityLevel),0===n)throw new Error("Can't create session options");return(null==e?void 0:e.executionProviders)&&((e,t,n)=>{for(const r of t){let t="string"==typeof r?r:r.name;switch(t){case"xnnpack":t="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${t}`)}const i=(0,o.allocWasmString)(t,n);if(0!==(0,a.getInstance)()._OrtAppendExecutionProvider(e,i))throw new Error(`Can't append execution provider: ${t}`)}})(n,e.executionProviders,i),void 0!==(null==e?void 0:e.extra)&&(0,r.iterateExtraOptions)(e.extra,"",new WeakSet,(e,r)=>{const a=(0,o.allocWasmString)(e,i),s=(0,o.allocWasmString)(r,i);if(0!==t._OrtAddSessionConfigEntry(n,a,s))throw new Error(`Can't set a session config entry: ${e} - ${r}`)}),[n,i]}catch(l){throw 0!==n&&t._OrtReleaseSessionOptions(n),i.forEach(t._free),l}}},4983:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.allocWasmString=void 0;const r=n(6361);t.allocWasmString=(e,t)=>{const n=(0,r.getInstance)(),o=n.lengthBytesUTF8(e)+1,a=n._malloc(o);return n.stringToUTF8(e,a,o),t.push(a),a}},349:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extractTransferableBuffers=t.endProfiling=t.run=t.releaseSession=t.createSession=t.createSessionFinalize=t.createSessionAllocate=t.initOrt=void 0;const r=n(586),o=n(4919),a=n(4983),i=n(6361);t.initOrt=(e,t)=>{const n=(0,i.getInstance)()._OrtInit(e,t);if(0!==n)throw new Error(`Can't initialize onnxruntime. error code = ${n}`)};const s=new Map;t.createSessionAllocate=e=>{const t=(0,i.getInstance)(),n=t._malloc(e.byteLength);return t.HEAPU8.set(e,n),[n,e.byteLength]},t.createSessionFinalize=(e,t)=>{const n=(0,i.getInstance)();let r=0,a=0,l=[];try{if([a,l]=(0,o.setSessionOptions)(t),r=n._OrtCreateSession(e[0],e[1],a),0===r)throw new Error("Can't create a session")}finally{n._free(e[0]),n._OrtReleaseSessionOptions(a),l.forEach(n._free)}const u=n._OrtGetInputCount(r),c=n._OrtGetOutputCount(r),d=[],f=[],p=[],h=[];for(let o=0;o<u;o++){const e=n._OrtGetInputName(r,o);if(0===e)throw new Error("Can't get an input name");f.push(e),d.push(n.UTF8ToString(e))}for(let o=0;o<c;o++){const e=n._OrtGetOutputName(r,o);if(0===e)throw new Error("Can't get an output name");h.push(e),p.push(n.UTF8ToString(e))}return s.set(r,[r,f,h]),[r,d,p]},t.createSession=(e,n)=>{const r=(0,t.createSessionAllocate)(e);return(0,t.createSessionFinalize)(r,n)},t.releaseSession=e=>{const t=(0,i.getInstance)(),n=s.get(e);if(!n)throw new Error("invalid session id");const r=n[0],o=n[1],a=n[2];o.forEach(t._OrtFree),a.forEach(t._OrtFree),t._OrtReleaseSession(r),s.delete(e)};const l=e=>{switch(e){case"int8":return 3;case"uint8":return 2;case"bool":return 9;case"int16":return 5;case"uint16":return 4;case"int32":return 6;case"uint32":return 12;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;default:throw new Error(`unsupported data type: ${e}`)}},u=e=>{switch(e){case 3:return"int8";case 2:return"uint8";case 9:return"bool";case 5:return"int16";case 4:return"uint16";case 6:return"int32";case 12:return"uint32";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";default:throw new Error(`unsupported data type: ${e}`)}},c=e=>{switch(e){case"float32":return Float32Array;case"uint8":case"bool":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${e}`)}};t.run=(e,t,n,o,d)=>{const f=(0,i.getInstance)(),p=s.get(e);if(!p)throw new Error("invalid session id");const h=p[0],m=p[1],g=p[2],b=t.length,y=o.length;let _=0,v=[];const w=[],S=[];try{[_,v]=(0,r.setRunOptions)(d);for(let t=0;t<b;t++){const e=n[t][0],r=n[t][1],o=n[t][2];let i,s;if(Array.isArray(o)){s=4*o.length,i=f._malloc(s),S.push(i);let e=i/4;for(let t=0;t<o.length;t++){if("string"!=typeof o[t])throw new TypeError(`tensor data at index ${t} is not a string`);f.HEAPU32[e++]=(0,a.allocWasmString)(o[t],S)}}else s=o.byteLength,i=f._malloc(s),S.push(i),f.HEAPU8.set(new Uint8Array(o.buffer,o.byteOffset,s),i);const u=f.stackSave(),c=f.stackAlloc(4*r.length);try{let t=c/4;r.forEach(e=>f.HEAP32[t++]=e);const n=f._OrtCreateTensor(l(e),i,s,c,r.length);if(0===n)throw new Error("Can't create a tensor");w.push(n)}finally{f.stackRestore(u)}}const e=f.stackSave(),i=f.stackAlloc(4*b),s=f.stackAlloc(4*b),p=f.stackAlloc(4*y),x=f.stackAlloc(4*y);try{let e=i/4,n=s/4,r=p/4,a=x/4;for(let o=0;o<b;o++)f.HEAPU32[e++]=w[o],f.HEAPU32[n++]=m[t[o]];for(let t=0;t<y;t++)f.HEAPU32[r++]=0,f.HEAPU32[a++]=g[o[t]];let l=f._OrtRun(h,s,i,b,x,y,p,_);const d=[];if(0===l)for(let t=0;t<y;t++){const e=f.HEAPU32[p/4+t],n=f.stackSave(),r=f.stackAlloc(16);let o,a=0;try{if(l=f._OrtGetTensorData(e,r,r+4,r+8,r+12),0!==l)throw new Error(`Can't access output tensor data. error code = ${l}`);let t=r/4;const n=f.HEAPU32[t++];a=f.HEAPU32[t++];const i=f.HEAPU32[t++],s=f.HEAPU32[t++],p=[];for(let e=0;e<s;e++)p.push(f.HEAPU32[i/4+e]);f._OrtFree(i);const h=0===p.length?1:p.reduce((e,t)=>e*t);if(o=u(n),"string"===o){const e=[];let t=a/4;for(let n=0;n<h;n++){const r=f.HEAPU32[t++],o=n===h-1?void 0:f.HEAPU32[t]-r;e.push(f.UTF8ToString(r,o))}d.push([o,p,e])}else{const e=new(c(o))(h);new Uint8Array(e.buffer,e.byteOffset,e.byteLength).set(f.HEAPU8.subarray(a,a+e.byteLength)),d.push([o,p,e])}}finally{f.stackRestore(n),"string"===o&&a&&f._free(a),f._OrtReleaseTensor(e)}}if(0===l)return d;throw new Error(`failed to call OrtRun(). error code = ${l}.`)}finally{f.stackRestore(e)}}finally{w.forEach(f._OrtReleaseTensor),S.forEach(f._free),f._OrtReleaseRunOptions(_),v.forEach(f._free)}},t.endProfiling=e=>{const t=(0,i.getInstance)(),n=s.get(e);if(!n)throw new Error("invalid session id");const r=n[0],o=t._OrtEndProfiling(r);if(0===o)throw new Error("Can't get an profile file name");t._OrtFree(o)},t.extractTransferableBuffers=e=>{const t=[];for(const n of e){const e=n[2];!Array.isArray(e)&&e.buffer&&t.push(e.buffer)}return t}},6361:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.dispose=t.getInstance=t.initializeWebAssembly=void 0;const s=a(n(6449)),l=i(n(932)),u=n(3474);let c,d=!1,f=!1,p=!1;const h=(e,t)=>t?e?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":e?"ort-wasm-simd.wasm":"ort-wasm.wasm";t.initializeWebAssembly=async e=>{if(d)return Promise.resolve();if(f)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(p)throw new Error("previous call to 'initializeWebAssembly()' failed.");f=!0;const t=e.initTimeout,r=e.numThreads,o=e.simd,a=r>1&&(()=>{try{return"undefined"!=typeof SharedArrayBuffer&&("undefined"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])))}catch(e){return!1}})(),i=o&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch(e){return!1}})(),m="string"==typeof e.wasmPaths?e.wasmPaths:void 0,g=h(!1,a),b=h(i,a),y="object"==typeof e.wasmPaths?e.wasmPaths[b]:void 0;let _=!1;const v=[];if(t>0&&v.push(new Promise(e=>{setTimeout(()=>{_=!0,e()},t)})),v.push(new Promise((e,t)=>{const r=a?u:l.default,o={locateFile:(e,t)=>a&&e.endsWith(".worker.js")&&"undefined"!=typeof Blob?URL.createObjectURL(new Blob([n(4154)],{type:"text/javascript"})):e===g?null!=y?y:(null!=m?m:t)+b:t+e};if(a)if("undefined"==typeof Blob)o.mainScriptUrlOrBlob=s.join("/","ort-wasm-threaded.js");else{const e=`var ortWasmThreaded=(function(){var _scriptDir;return ${r.toString()}})();`;o.mainScriptUrlOrBlob=new Blob([e],{type:"text/javascript"})}r(o).then(t=>{f=!1,d=!0,c=t,e()},e=>{f=!1,p=!0,t(e)})})),await Promise.race(v),_)throw new Error(`WebAssembly backend initializing failed due to timeout: ${t}ms`)},t.getInstance=()=>{if(d&&c)return c;throw new Error("WebAssembly is not initialized yet.")},t.dispose=()=>{var e;!d||f||p||(f=!0,null===(e=c.PThread)||void 0===e||e.terminateAllThreads(),c=void 0,f=!1,d=!1,p=!0)}},9710:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(477),o=n.n(r);function a(){return o()('/*!\n* ONNX Runtime Web v1.14.0\n* Copyright (c) Microsoft Corporation. All rights reserved.\n* Licensed under the MIT License.\n*/\n(()=>{var t={474:(t,e,n)=>{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){function e(){return j.buffer!=D&&N(j.buffer),P}function r(){return j.buffer!=D&&N(j.buffer),U}function a(){return j.buffer!=D&&N(j.buffer),F}function i(){return j.buffer!=D&&N(j.buffer),I}function o(){return j.buffer!=D&&N(j.buffer),W}var u,c,s;t=t||{},u||(u=void 0!==t?t:{}),u.ready=new Promise((function(t,e){c=t,s=e}));var l,f,p,h,d,y,b=Object.assign({},u),m="./this.program",g=(t,e)=>{throw e},v="object"==typeof window,w="function"==typeof importScripts,_="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,O=u.ENVIRONMENT_IS_PTHREAD||!1,A="";function S(t){return u.locateFile?u.locateFile(t,A):A+t}if(_){let e;A=w?n(908).dirname(A)+"/":"//",y=()=>{d||(h=n(384),d=n(908))},l=function(t,e){return y(),t=d.normalize(t),h.readFileSync(t,e?void 0:"utf8")},p=t=>((t=l(t,!0)).buffer||(t=new Uint8Array(t)),t),f=(t,e,n)=>{y(),t=d.normalize(t),h.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1<process.argv.length&&(m=process.argv[1].replace(/\\\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",(function(t){if(!(t instanceof ct))throw t})),process.on("unhandledRejection",(function(t){throw t})),g=(t,e)=>{if(Q())throw process.exitCode=t,e;e instanceof ct||x("exiting due to exception: "+e),process.exit(t)},u.inspect=function(){return"[Emscripten Module object]"};try{e=n(925)}catch(t){throw console.error(\'The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?\'),t}n.g.Worker=e.Worker}else(v||w)&&(w?A=self.location.href:"undefined"!=typeof document&&document.currentScript&&(A=document.currentScript.src),_scriptDir&&(A=_scriptDir),A=0!==A.indexOf("blob:")?A.substr(0,A.replace(/[?#].*/,"").lastIndexOf("/")+1):"",_||(l=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},w&&(p=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),f=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)}));_&&"undefined"==typeof performance&&(n.g.performance=n(953).performance);var T=console.log.bind(console),E=console.warn.bind(console);_&&(y(),T=t=>h.writeSync(1,t+"\\n"),E=t=>h.writeSync(2,t+"\\n"));var M,C=u.print||T,x=u.printErr||E;Object.assign(u,b),b=null,u.thisProgram&&(m=u.thisProgram),u.quit&&(g=u.quit),u.wasmBinary&&(M=u.wasmBinary);var R=u.noExitRuntime||!1;"object"!=typeof WebAssembly&&at("no native wasm support detected");var j,k,D,P,U,F,I,W,H=!1,L="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function z(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16<n-e&&t.buffer&&L)return L.decode(t.buffer instanceof SharedArrayBuffer?t.slice(e,n):t.subarray(e,n));for(r="";e<n;){var a=t[e++];if(128&a){var i=63&t[e++];if(192==(224&a))r+=String.fromCharCode((31&a)<<6|i);else{var o=63&t[e++];65536>(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function Y(t,e){return(t>>>=0)?z(r(),t,e):""}function B(t,e,n,r){if(!(0<r))return 0;var a=n>>>=0;r=n+r-1;for(var i=0;i<t.length;++i){var o=t.charCodeAt(i);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function G(t){for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);127>=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function N(t){D=t,u.HEAP8=P=new Int8Array(t),u.HEAP16=new Int16Array(t),u.HEAP32=F=new Int32Array(t),u.HEAPU8=U=new Uint8Array(t),u.HEAPU16=new Uint16Array(t),u.HEAPU32=I=new Uint32Array(t),u.HEAPF32=new Float32Array(t),u.HEAPF64=W=new Float64Array(t)}O&&(D=u.buffer);var V=u.INITIAL_MEMORY||16777216;if(O)j=u.wasmMemory,D=u.buffer;else if(u.wasmMemory)j=u.wasmMemory;else if(!((j=new WebAssembly.Memory({initial:V/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw x("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),_&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");j&&(D=j.buffer),V=D.byteLength,N(D);var $,q=[],X=[],J=[],Z=[];function Q(){return R||!1}function K(){var t=u.preRun.shift();q.unshift(t)}var tt,et=0,nt=null,rt=null;function at(t){throw O?postMessage({cmd:"onAbort",arg:t}):u.onAbort&&u.onAbort(t),x(t="Aborted("+t+")"),H=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),s(t),t}function it(){return tt.startsWith("data:application/octet-stream;base64,")}function ot(){var t=tt;try{if(t==tt&&M)return new Uint8Array(M);if(p)return p(t);throw"both async and sync fetching of the wasm failed"}catch(t){at(t)}}tt="ort-wasm-threaded.wasm",it()||(tt=S(tt));var ut={};function ct(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function st(t){(t=ht.Vb[t])||at(),ht.mc(t)}function lt(t){var e=ht.Cc();if(!e)return 6;ht.ac.push(e),ht.Vb[t.Ub]=e,e.Ub=t.Ub;var n={cmd:"run",start_routine:t.Ic,arg:t.zc,pthread_ptr:t.Ub};return e.$b=()=>{n.time=performance.now(),e.postMessage(n,t.Nc)},e.loaded&&(e.$b(),delete e.$b),0}function ft(t){if(O)return $t(1,1,t);Q()||(ht.oc(),u.onExit&&u.onExit(t),H=!0),g(t,new ct(t))}function pt(t,e){if(!e&&O)throw bt(t),"unwind";Q()||O||(me(),dt(J),be(0),re[1].length&&ae(1,10),re[2].length&&ae(2,10),ht.oc()),ft(t)}var ht={Yb:[],ac:[],qc:[],Vb:{},fc:function(){O&&ht.Ec()},Pc:function(){},Ec:function(){ht.receiveObjectTransfer=ht.Gc,ht.threadInitTLS=ht.pc,ht.setExitStatus=ht.nc,R=!1},nc:function(){},oc:function(){for(var t of Object.values(ht.Vb))ht.mc(t);for(t of ht.Yb)t.terminate();ht.Yb=[]},mc:function(t){var e=t.Ub;delete ht.Vb[e],ht.Yb.push(t),ht.ac.splice(ht.ac.indexOf(t),1),t.Ub=0,Oe(e)},Gc:function(){},pc:function(){ht.qc.forEach((t=>t()))},Fc:function(t,e){t.onmessage=n=>{var r=(n=n.data).cmd;if(t.Ub&&(ht.Bc=t.Ub),n.targetThread&&n.targetThread!=he()){var a=ht.Vb[n.Qc];a?a.postMessage(n,n.transferList):x(\'Internal error! Worker sent a message "\'+r+\'" to target pthread \'+n.targetThread+", but that thread no longer exists!")}else"processProxyingQueue"===r?zt(n.queue):"spawnThread"===r?lt(n):"cleanupThread"===r?st(n.thread):"killThread"===r?(n=n.thread,r=ht.Vb[n],delete ht.Vb[n],r.terminate(),Oe(n),ht.ac.splice(ht.ac.indexOf(r),1),r.Ub=0):"cancelThread"===r?ht.Vb[n.thread].postMessage({cmd:"cancel"}):"loaded"===r?(t.loaded=!0,e&&e(t),t.$b&&(t.$b(),delete t.$b)):"print"===r?C("Thread "+n.threadId+": "+n.text):"printErr"===r?x("Thread "+n.threadId+": "+n.text):"alert"===r?alert("Thread "+n.threadId+": "+n.text):"setimmediate"===n.target?t.postMessage(n):"onAbort"===r?u.onAbort&&u.onAbort(n.arg):r&&x("worker sent an unknown command "+r);ht.Bc=void 0},t.onerror=t=>{throw x("worker sent an error! "+t.filename+":"+t.lineno+": "+t.message),t},_&&(t.on("message",(function(e){t.onmessage({data:e})})),t.on("error",(function(e){t.onerror(e)})),t.on("detachedExit",(function(){}))),t.postMessage({cmd:"load",urlOrBlob:u.mainScriptUrlOrBlob||_scriptDir,wasmMemory:j,wasmModule:k})},yc:function(){var t=S("ort-wasm-threaded.worker.js");ht.Yb.push(new Worker(t))},Cc:function(){return 0==ht.Yb.length&&(ht.yc(),ht.Fc(ht.Yb[0])),ht.Yb.pop()}};function dt(t){for(;0<t.length;)t.shift()(u)}function yt(t){var e=Ee();return t=t(),Me(e),t}function bt(t){if(O)return $t(2,0,t);try{pt(t)}catch(t){t instanceof ct||"unwind"==t||g(1,t)}}u.PThread=ht,u.establishStackSpace=function(){var t=he(),e=a()[t+44>>2>>>0];t=a()[t+48>>2>>>0],Te(e,e-t),Me(e)};var mt=[];function gt(t){var e=mt[t];return e||(t>=mt.length&&(mt.length=t+1),mt[t]=e=$.get(t)),e}u.invokeEntryPoint=function(t,e){t=gt(t)(e),Q()?ht.nc(t):Ae(t)};var vt,wt,_t=[],Ot=0,At=0;function St(t){this.Zb=t,this.Sb=t-24,this.xc=function(t){i()[this.Sb+4>>2>>>0]=t},this.bc=function(){return i()[this.Sb+4>>2>>>0]},this.wc=function(t){i()[this.Sb+8>>2>>>0]=t},this.Dc=function(){return i()[this.Sb+8>>2>>>0]},this.rc=function(){a()[this.Sb>>2>>>0]=0},this.hc=function(t){t=t?1:0,e()[this.Sb+12>>0>>>0]=t},this.uc=function(){return 0!=e()[this.Sb+12>>0>>>0]},this.ic=function(t){t=t?1:0,e()[this.Sb+13>>0>>>0]=t},this.kc=function(){return 0!=e()[this.Sb+13>>0>>>0]},this.fc=function(t,e){this.cc(0),this.xc(t),this.wc(e),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(a(),this.Sb>>2,1)},this.Hc=function(){return 1===Atomics.sub(a(),this.Sb>>2,1)},this.cc=function(t){i()[this.Sb+16>>2>>>0]=t},this.tc=function(){return i()[this.Sb+16>>2>>>0]},this.vc=function(){if(Re(this.bc()))return i()[this.Zb>>2>>>0];var t=this.tc();return 0!==t?t:this.Zb}}function Tt(t){return ye(new St(t).Sb)}function Et(t,e,n,r){return O?$t(3,1,t,e,n,r):Mt(t,e,n,r)}function Mt(t,e,n,r){if("undefined"==typeof SharedArrayBuffer)return x("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var a=[];return O&&0===a.length?Et(t,e,n,r):(t={Ic:n,Ub:t,zc:r,Nc:a},O?(t.Oc="spawnThread",postMessage(t,a),0):lt(t))}function Ct(t,e,n){return O?$t(4,1,t,e,n):0}function xt(t,e){if(O)return $t(5,1,t,e)}function Rt(t,e){if(O)return $t(6,1,t,e)}function jt(t,e,n){if(O)return $t(7,1,t,e,n)}function kt(t,e,n){return O?$t(8,1,t,e,n):0}function Dt(t,e){if(O)return $t(9,1,t,e)}function Pt(t,e,n){if(O)return $t(10,1,t,e,n)}function Ut(t,e,n,r){if(O)return $t(11,1,t,e,n,r)}function Ft(t,e,n,r){if(O)return $t(12,1,t,e,n,r)}function It(t,e,n,r){if(O)return $t(13,1,t,e,n,r)}function Wt(t){if(O)return $t(14,1,t)}function Ht(t,e){if(O)return $t(15,1,t,e)}function Lt(t,e,n){if(O)return $t(16,1,t,e,n)}function zt(t){Atomics.store(a(),t>>2,1),he()&&_e(t),Atomics.compareExchange(a(),t>>2,1,0)}function Yt(t){return i()[t>>>2]+4294967296*a()[t+4>>>2]}function Bt(t,e,n,r,a,i){return O?$t(17,1,t,e,n,r,a,i):-52}function Gt(t,e,n,r,a,i){if(O)return $t(18,1,t,e,n,r,a,i)}function Nt(t){var n=G(t)+1,r=de(n);return r&&B(t,e(),r,n),r}function Vt(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}if(O)return $t(19,1,t,e,n);var o=(new Date).getFullYear(),u=new Date(o,0,1),c=new Date(o,6,1);o=u.getTimezoneOffset();var s=c.getTimezoneOffset(),l=Math.max(o,s);a()[t>>2>>>0]=60*l,a()[e>>2>>>0]=Number(o!=s),t=r(u),e=r(c),t=Nt(t),e=Nt(e),s<o?(i()[n>>2>>>0]=t,i()[n+4>>2>>>0]=e):(i()[n>>2>>>0]=e,i()[n+4>>2>>>0]=t)}function $t(t,e){var n=arguments.length-2,r=arguments;return yt((()=>{for(var a=Ce(8*n),i=a>>3,u=0;u<n;u++){var c=r[2+u];o()[i+u>>>0]=c}return we(t,n,a,e)}))}u.executeNotifiedProxyingQueue=zt,wt=_?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:O?()=>performance.now()-u.__performance_now_clock_drift:()=>performance.now();var qt,Xt=[],Jt={};function Zt(){if(!qt){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:m||"./this.program"};for(t in Jt)void 0===Jt[t]?delete e[t]:e[t]=Jt[t];var n=[];for(t in e)n.push(t+"="+e[t]);qt=n}return qt}function Qt(t,n){if(O)return $t(20,1,t,n);var r=0;return Zt().forEach((function(a,o){var u=n+r;for(o=i()[t+4*o>>2>>>0]=u,u=0;u<a.length;++u)e()[o++>>0>>>0]=a.charCodeAt(u);e()[o>>0>>>0]=0,r+=a.length+1})),0}function Kt(t,e){if(O)return $t(21,1,t,e);var n=Zt();i()[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),i()[e>>2>>>0]=r,0}function te(t){return O?$t(22,1,t):52}function ee(t,e,n,r){return O?$t(23,1,t,e,n,r):52}function ne(t,e,n,r,a){return O?$t(24,1,t,e,n,r,a):70}var re=[null,[],[]];function ae(t,e){var n=re[t];0===e||10===e?((1===t?C:x)(z(n,0)),n.length=0):n.push(e)}function ie(t,e,n,a){if(O)return $t(25,1,t,e,n,a);for(var o=0,u=0;u<n;u++){var c=i()[e>>2>>>0],s=i()[e+4>>2>>>0];e+=8;for(var l=0;l<s;l++)ae(t,r()[c+l>>>0]);o+=s}return i()[a>>2>>>0]=o,0}var oe=0;function ue(t){return 0==t%4&&(0!=t%100||0==t%400)}var ce=[31,29,31,30,31,30,31,31,30,31,30,31],se=[31,28,31,30,31,30,31,31,30,31,30,31];function le(t,n,r,i){function o(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.length<e;)t=n[0]+t;return t}function u(t,e){return o(t,e,"0")}function c(t,e){function n(t){return 0>t?-1:0<t?1:0}var r;return 0===(r=n(t.getFullYear()-e.getFullYear()))&&0===(r=n(t.getMonth()-e.getMonth()))&&(r=n(t.getDate()-e.getDate())),r}function s(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function l(t){var e=t.Wb;for(t=new Date(new Date(t.Xb+1900,0,1).getTime());0<e;){var n=t.getMonth(),r=(ue(t.getFullYear())?ce:se)[n];if(!(e>r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=s(new Date(t.getFullYear(),0,4)),n=s(n),0>=c(e,t)?0>=c(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var f=a()[i+40>>2>>>0];for(var p in i={Lc:a()[i>>2>>>0],Kc:a()[i+4>>2>>>0],dc:a()[i+8>>2>>>0],jc:a()[i+12>>2>>>0],ec:a()[i+16>>2>>>0],Xb:a()[i+20>>2>>>0],Tb:a()[i+24>>2>>>0],Wb:a()[i+28>>2>>>0],Rc:a()[i+32>>2>>>0],Jc:a()[i+36>>2>>>0],Mc:f?Y(f):""},r=Y(r),f={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})r=r.replace(new RegExp(p,"g"),f[p]);var h="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),d="January February March April May June July August September October November December".split(" ");for(p in f={"%a":function(t){return h[t.Tb].substring(0,3)},"%A":function(t){return h[t.Tb]},"%b":function(t){return d[t.ec].substring(0,3)},"%B":function(t){return d[t.ec]},"%C":function(t){return u((t.Xb+1900)/100|0,2)},"%d":function(t){return u(t.jc,2)},"%e":function(t){return o(t.jc,2," ")},"%g":function(t){return l(t).toString().substring(2)},"%G":function(t){return l(t)},"%H":function(t){return u(t.dc,2)},"%I":function(t){return 0==(t=t.dc)?t=12:12<t&&(t-=12),u(t,2)},"%j":function(t){for(var e=0,n=0;n<=t.ec-1;e+=(ue(t.Xb+1900)?ce:se)[n++]);return u(t.jc+e,3)},"%m":function(t){return u(t.ec+1,2)},"%M":function(t){return u(t.Kc,2)},"%n":function(){return"\\n"},"%p":function(t){return 0<=t.dc&&12>t.dc?"AM":"PM"},"%S":function(t){return u(t.Lc,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Tb||7},"%U":function(t){return u(Math.floor((t.Wb+7-t.Tb)/7),2)},"%V":function(t){var e=Math.floor((t.Wb+7-(t.Tb+6)%7)/7);if(2>=(t.Tb+371-t.Wb-2)%7&&e++,e)53==e&&(4==(n=(t.Tb+371-t.Wb)%7)||3==n&&ue(t.Xb)||(e=1));else{e=52;var n=(t.Tb+7-t.Wb-1)%7;(4==n||5==n&&ue(t.Xb%400-1))&&e++}return u(e,2)},"%w":function(t){return t.Tb},"%W":function(t){return u(Math.floor((t.Wb+7-(t.Tb+6)%7)/7),2)},"%y":function(t){return(t.Xb+1900).toString().substring(2)},"%Y":function(t){return t.Xb+1900},"%z":function(t){var e=0<=(t=t.Jc);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.Mc},"%%":function(){return"%"}},r=r.replace(/%%/g,"\\0\\0"),f)r.includes(p)&&(r=r.replace(new RegExp(p,"g"),f[p](i)));return p=function(t){var e=Array(G(t)+1);return B(t,e,0,e.length),e}(r=r.replace(/\\0\\0/g,"%")),p.length>n?0:(function(t,n){e().set(t,n>>>0)}(p,t),p.length-1)}ht.fc();var fe=[null,ft,bt,Et,Ct,xt,Rt,jt,kt,Dt,Pt,Ut,Ft,It,Wt,Ht,Lt,Bt,Gt,Vt,Qt,Kt,te,ee,ne,ie],pe={b:function(t){return de(t+24)+24},n:function(t){return(t=new St(t)).uc()||(t.hc(!0),Ot--),t.ic(!1),_t.push(t),t.sc(),t.vc()},ma:function(t){throw x("Unexpected exception thrown, this is not properly supported - aborting"),H=!0,t},x:function(){Se(0);var t=_t.pop();if(t.Hc()&&!t.kc()){var e=t.Dc();e&>(e)(t.Zb),Tt(t.Zb)}At=0},e:function(){var t=At;if(!t)return oe=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(xe(i,n,e.Sb+16))return oe=i,t}return oe=n,t},l:function(){var t=At;if(!t)return oe=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(xe(i,n,e.Sb+16))return oe=i,t}return oe=n,t},h:function(){var t=At;if(!t)return oe=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(xe(i,n,e.Sb+16))return oe=i,t}return oe=n,t},t:Tt,M:function(){var t=_t.pop();t||at("no exception to throw");var e=t.Zb;throw t.kc()||(_t.push(t),t.ic(!0),t.hc(!1),Ot++),At=e,e},c:function(t,e,n){throw new St(t).fc(e,n),At=t,Ot++,t},pa:function(){return Ot},Fa:function(t){ge(t,!w,1,!v),ht.pc()},T:function(t){O?postMessage({cmd:"cleanupThread",thread:t}):st(t)},xa:Mt,j:function(t){throw At||(At=t),t},H:Ct,Ma:xt,ua:Rt,wa:jt,oa:kt,Ka:Dt,Ca:Pt,Ja:Ut,V:Ft,va:It,sa:Wt,La:Ht,ta:Lt,Ta:function(){},X:function(){at("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},Ua:function(){at("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},W:function(){return Date.now()},ya:function(){return 2097152},Oa:function(){return!0},za:function(t,e,n,r){if(t==e)setTimeout((()=>zt(r)));else if(O)postMessage({targetThread:t,cmd:"processProxyingQueue",queue:r});else{if(!(t=ht.Vb[t]))return;t.postMessage({cmd:"processProxyingQueue",queue:r})}return 1},Ea:function(){return-1},Pa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getUTCSeconds(),a()[e+4>>2>>>0]=t.getUTCMinutes(),a()[e+8>>2>>>0]=t.getUTCHours(),a()[e+12>>2>>>0]=t.getUTCDate(),a()[e+16>>2>>>0]=t.getUTCMonth(),a()[e+20>>2>>>0]=t.getUTCFullYear()-1900,a()[e+24>>2>>>0]=t.getUTCDay(),t=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,a()[e+28>>2>>>0]=t},Qa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getSeconds(),a()[e+4>>2>>>0]=t.getMinutes(),a()[e+8>>2>>>0]=t.getHours(),a()[e+12>>2>>>0]=t.getDate(),a()[e+16>>2>>>0]=t.getMonth(),a()[e+20>>2>>>0]=t.getFullYear()-1900,a()[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1),r=(t.getTime()-n.getTime())/864e5|0;a()[e+28>>2>>>0]=r,a()[e+36>>2>>>0]=-60*t.getTimezoneOffset(),r=new Date(t.getFullYear(),6,1).getTimezoneOffset(),t=0|(r!=(n=n.getTimezoneOffset())&&t.getTimezoneOffset()==Math.min(n,r)),a()[e+32>>2>>>0]=t},Ra:function(t){var e=new Date(a()[t+20>>2>>>0]+1900,a()[t+16>>2>>>0],a()[t+12>>2>>>0],a()[t+8>>2>>>0],a()[t+4>>2>>>0],a()[t>>2>>>0],0),n=a()[t+32>>2>>>0],r=e.getTimezoneOffset(),i=new Date(e.getFullYear(),0,1),o=new Date(e.getFullYear(),6,1).getTimezoneOffset(),u=i.getTimezoneOffset(),c=Math.min(u,o);return 0>n?a()[t+32>>2>>>0]=Number(o!=u&&c==r):0<n!=(c==r)&&(o=Math.max(u,o),e.setTime(e.getTime()+6e4*((0<n?c:o)-r))),a()[t+24>>2>>>0]=e.getDay(),n=(e.getTime()-i.getTime())/864e5|0,a()[t+28>>2>>>0]=n,a()[t>>2>>>0]=e.getSeconds(),a()[t+4>>2>>>0]=e.getMinutes(),a()[t+8>>2>>>0]=e.getHours(),a()[t+12>>2>>>0]=e.getDate(),a()[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},Aa:Bt,Ba:Gt,Sa:function t(e,n,r){t.Ac||(t.Ac=!0,Vt(e,n,r))},y:function(){at("")},U:function(){if(!_&&!w){var t="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";vt||(vt={}),vt[t]||(vt[t]=1,_&&(t="warning: "+t),x(t))}},ra:function(){return 4294901760},B:wt,Ia:function(t,e,n){r().copyWithin(t>>>0,e>>>0,e+n>>>0)},F:function(){return _?n(993).cpus().length:navigator.hardwareConcurrency},Da:function(t,e,n){Xt.length=e,n>>=3;for(var r=0;r<e;r++)Xt[r]=o()[n+r>>>0];return(0>t?ut[-t-1]:fe[t]).apply(null,Xt)},qa:function(t){var e=r().length;if((t>>>=0)<=e||4294901760<t)return!1;for(var n=1;4>=n;n*=2){var a=e*(1+.2/n);a=Math.min(a,t+100663296);var i=Math;a=Math.max(t,a),i=i.min.call(i,4294901760,a+(65536-a%65536)%65536);t:{try{j.grow(i-D.byteLength+65535>>>16),N(j.buffer);var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},Na:function(){throw"unwind"},Ga:Qt,Ha:Kt,J:pt,I:te,S:ee,ga:ne,R:ie,d:function(){return oe},na:function t(r,a){t.lc||(t.lc=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(_)try{var e=n(Object(function(){var t=new Error("Cannot find module \'crypto\'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>at("randomDevice")}());for(var i=0;i<a;i++)e()[r+i>>0>>>0]=t.lc();return 0},ia:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ja:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},K:function(t){var e=Ee();try{return gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},f:function(t,e){var n=Ee();try{return gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},P:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},Q:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},k:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},p:function(t,e,n,r){var a=Ee();try{return gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},q:function(t,e,n,r,a){var i=Ee();try{return gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},N:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},s:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},w:function(t,e,n,r,a,i,o){var u=Ee();try{return gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},L:function(t,e,n,r,a,i,o,u){var c=Ee();try{return gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},E:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=Ee();try{return gt(t)(e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=Ee();try{return He(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},_:function(t,e,n,r,a,i,o){var u=Ee();try{return ke(t,e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},Z:function(t,e,n,r,a){var i=Ee();try{return Le(t,e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},ca:function(t,e,n,r){var a=Ee();try{return Ie(t,e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},$:function(t){var e=Ee();try{return je(t)}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},ba:function(t,e){var n=Ee();try{return We(t,e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},Y:function(t,e,n){var r=Ee();try{return De(t,e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},g:function(t){var e=Ee();try{gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},r:function(t,e){var n=Ee();try{gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},i:function(t,e,n){var r=Ee();try{gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ha:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},m:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},v:function(t,e,n,r,a){var i=Ee();try{gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},u:function(t,e,n,r,a,i){var o=Ee();try{gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},O:function(t,e,n,r,a,i,o){var u=Ee();try{gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},A:function(t,e,n,r,a,i,o,u){var c=Ee();try{gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},ka:function(t,e,n,r,a,i,o,u,c){var s=Ee();try{gt(t)(e,n,r,a,i,o,u,c)}catch(t){if(Me(s),t!==t+0)throw t;Se(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,l){var f=Ee();try{gt(t)(e,n,r,a,i,o,u,c,s,l)}catch(t){if(Me(f),t!==t+0)throw t;Se(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,l,f,p,h,d,y){var b=Ee();try{gt(t)(e,n,r,a,i,o,u,c,s,l,f,p,h,d,y)}catch(t){if(Me(b),t!==t+0)throw t;Se(1,0)}},fa:function(t,e,n,r,a,i,o,u){var c=Ee();try{Pe(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},da:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=Ee();try{Fe(t,e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},ea:function(t,e,n,r,a,i){var o=Ee();try{Ue(t,e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},o:function(t){return t},a:j||u.wasmMemory,G:function(t){oe=t},la:le,z:function(t,e,n,r){return le(t,e,n,r)}};!function(){function t(t,e){u.asm=t.exports,ht.qc.push(u.asm.sb),$=u.asm.ub,X.unshift(u.asm.Va),k=e,O||(et--,u.monitorRunDependencies&&u.monitorRunDependencies(et),0==et&&(null!==nt&&(clearInterval(nt),nt=null),rt&&(t=rt,rt=null,t())))}function e(e){t(e.instance,e.module)}function n(t){return function(){if(!M&&(v||w)){if("function"==typeof fetch&&!tt.startsWith("file://"))return fetch(tt,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+tt+"\'";return t.arrayBuffer()})).catch((function(){return ot()}));if(f)return new Promise((function(t,e){f(tt,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return ot()}))}().then((function(t){return WebAssembly.instantiate(t,r)})).then((function(t){return t})).then(t,(function(t){x("failed to asynchronously prepare wasm: "+t),at(t)}))}var r={a:pe};if(O||(et++,u.monitorRunDependencies&&u.monitorRunDependencies(et)),u.instantiateWasm)try{return u.instantiateWasm(r,t)}catch(t){return x("Module.instantiateWasm callback failed with error: "+t),!1}(M||"function"!=typeof WebAssembly.instantiateStreaming||it()||tt.startsWith("file://")||_||"function"!=typeof fetch?n(e):fetch(tt,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(t){return x("wasm streaming compile failed: "+t),x("falling back to ArrayBuffer instantiation"),n(e)}))}))).catch(s)}(),u.___wasm_call_ctors=function(){return(u.___wasm_call_ctors=u.asm.Va).apply(null,arguments)},u._OrtInit=function(){return(u._OrtInit=u.asm.Wa).apply(null,arguments)},u._OrtCreateSessionOptions=function(){return(u._OrtCreateSessionOptions=u.asm.Xa).apply(null,arguments)},u._OrtAppendExecutionProvider=function(){return(u._OrtAppendExecutionProvider=u.asm.Ya).apply(null,arguments)},u._OrtAddSessionConfigEntry=function(){return(u._OrtAddSessionConfigEntry=u.asm.Za).apply(null,arguments)},u._OrtReleaseSessionOptions=function(){return(u._OrtReleaseSessionOptions=u.asm._a).apply(null,arguments)},u._OrtCreateSession=function(){return(u._OrtCreateSession=u.asm.$a).apply(null,arguments)},u._OrtReleaseSession=function(){return(u._OrtReleaseSession=u.asm.ab).apply(null,arguments)},u._OrtGetInputCount=function(){return(u._OrtGetInputCount=u.asm.bb).apply(null,arguments)},u._OrtGetOutputCount=function(){return(u._OrtGetOutputCount=u.asm.cb).apply(null,arguments)},u._OrtGetInputName=function(){return(u._OrtGetInputName=u.asm.db).apply(null,arguments)},u._OrtGetOutputName=function(){return(u._OrtGetOutputName=u.asm.eb).apply(null,arguments)},u._OrtFree=function(){return(u._OrtFree=u.asm.fb).apply(null,arguments)},u._OrtCreateTensor=function(){return(u._OrtCreateTensor=u.asm.gb).apply(null,arguments)},u._OrtGetTensorData=function(){return(u._OrtGetTensorData=u.asm.hb).apply(null,arguments)},u._OrtReleaseTensor=function(){return(u._OrtReleaseTensor=u.asm.ib).apply(null,arguments)},u._OrtCreateRunOptions=function(){return(u._OrtCreateRunOptions=u.asm.jb).apply(null,arguments)},u._OrtAddRunConfigEntry=function(){return(u._OrtAddRunConfigEntry=u.asm.kb).apply(null,arguments)},u._OrtReleaseRunOptions=function(){return(u._OrtReleaseRunOptions=u.asm.lb).apply(null,arguments)},u._OrtRun=function(){return(u._OrtRun=u.asm.mb).apply(null,arguments)},u._OrtEndProfiling=function(){return(u._OrtEndProfiling=u.asm.nb).apply(null,arguments)};var he=u._pthread_self=function(){return(he=u._pthread_self=u.asm.ob).apply(null,arguments)},de=u._malloc=function(){return(de=u._malloc=u.asm.pb).apply(null,arguments)},ye=u._free=function(){return(ye=u._free=u.asm.qb).apply(null,arguments)},be=u._fflush=function(){return(be=u._fflush=u.asm.rb).apply(null,arguments)};u.__emscripten_tls_init=function(){return(u.__emscripten_tls_init=u.asm.sb).apply(null,arguments)};var me=u.___funcs_on_exit=function(){return(me=u.___funcs_on_exit=u.asm.tb).apply(null,arguments)},ge=u.__emscripten_thread_init=function(){return(ge=u.__emscripten_thread_init=u.asm.vb).apply(null,arguments)};u.__emscripten_thread_crashed=function(){return(u.__emscripten_thread_crashed=u.asm.wb).apply(null,arguments)};var ve,we=u._emscripten_run_in_main_runtime_thread_js=function(){return(we=u._emscripten_run_in_main_runtime_thread_js=u.asm.xb).apply(null,arguments)},_e=u.__emscripten_proxy_execute_task_queue=function(){return(_e=u.__emscripten_proxy_execute_task_queue=u.asm.yb).apply(null,arguments)},Oe=u.__emscripten_thread_free_data=function(){return(Oe=u.__emscripten_thread_free_data=u.asm.zb).apply(null,arguments)},Ae=u.__emscripten_thread_exit=function(){return(Ae=u.__emscripten_thread_exit=u.asm.Ab).apply(null,arguments)},Se=u._setThrew=function(){return(Se=u._setThrew=u.asm.Bb).apply(null,arguments)},Te=u._emscripten_stack_set_limits=function(){return(Te=u._emscripten_stack_set_limits=u.asm.Cb).apply(null,arguments)},Ee=u.stackSave=function(){return(Ee=u.stackSave=u.asm.Db).apply(null,arguments)},Me=u.stackRestore=function(){return(Me=u.stackRestore=u.asm.Eb).apply(null,arguments)},Ce=u.stackAlloc=function(){return(Ce=u.stackAlloc=u.asm.Fb).apply(null,arguments)},xe=u.___cxa_can_catch=function(){return(xe=u.___cxa_can_catch=u.asm.Gb).apply(null,arguments)},Re=u.___cxa_is_pointer_type=function(){return(Re=u.___cxa_is_pointer_type=u.asm.Hb).apply(null,arguments)},je=u.dynCall_j=function(){return(je=u.dynCall_j=u.asm.Ib).apply(null,arguments)},ke=u.dynCall_iiiiij=function(){return(ke=u.dynCall_iiiiij=u.asm.Jb).apply(null,arguments)},De=u.dynCall_jii=function(){return(De=u.dynCall_jii=u.asm.Kb).apply(null,arguments)},Pe=u.dynCall_viiiiij=function(){return(Pe=u.dynCall_viiiiij=u.asm.Lb).apply(null,arguments)},Ue=u.dynCall_vjji=function(){return(Ue=u.dynCall_vjji=u.asm.Mb).apply(null,arguments)},Fe=u.dynCall_viiijjjii=function(){return(Fe=u.dynCall_viiijjjii=u.asm.Nb).apply(null,arguments)},Ie=u.dynCall_iij=function(){return(Ie=u.dynCall_iij=u.asm.Ob).apply(null,arguments)},We=u.dynCall_ji=function(){return(We=u.dynCall_ji=u.asm.Pb).apply(null,arguments)},He=u.dynCall_iiiiiij=function(){return(He=u.dynCall_iiiiiij=u.asm.Qb).apply(null,arguments)},Le=u.dynCall_iiij=function(){return(Le=u.dynCall_iiij=u.asm.Rb).apply(null,arguments)};function ze(){function t(){if(!ve&&(ve=!0,u.calledRun=!0,!H)&&(O||dt(X),c(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),!O)){if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;){var t=u.postRun.shift();Z.unshift(t)}dt(Z)}}if(!(0<et))if(O)c(u),O||dt(X),postMessage({cmd:"loaded"});else{if(u.preRun)for("function"==typeof u.preRun&&(u.preRun=[u.preRun]);u.preRun.length;)K();dt(q),0<et||(u.setStatus?(u.setStatus("Running..."),setTimeout((function(){setTimeout((function(){u.setStatus("")}),1),t()}),1)):t())}}if(u.UTF8ToString=Y,u.stringToUTF8=function(t,e,n){return B(t,r(),e,n)},u.lengthBytesUTF8=G,u.keepRuntimeAlive=Q,u.wasmMemory=j,u.stackSave=Ee,u.stackRestore=Me,u.stackAlloc=Ce,u.ExitStatus=ct,u.PThread=ht,rt=function t(){ve||ze(),ve||(rt=t)},u.preInit)for("function"==typeof u.preInit&&(u.preInit=[u.preInit]);0<u.preInit.length;)u.preInit.pop()();return ze(),t.ready});t.exports=r},932:(t,e,n)=>{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){var e,r,a;t=t||{},e||(e=void 0!==t?t:{}),e.ready=new Promise((function(t,e){r=t,a=e}));var i,o,u,c,s,l,f=Object.assign({},e),p="./this.program",h=(t,e)=>{throw e},d="object"==typeof window,y="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,m="";b?(m=y?n(908).dirname(m)+"/":"//",l=()=>{s||(c=n(384),s=n(908))},i=function(t,e){return l(),t=s.normalize(t),c.readFileSync(t,e?void 0:"utf8")},u=t=>((t=i(t,!0)).buffer||(t=new Uint8Array(t)),t),o=(t,e,n)=>{l(),t=s.normalize(t),c.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1<process.argv.length&&(p=process.argv[1].replace(/\\\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",(function(t){if(!(t instanceof J))throw t})),process.on("unhandledRejection",(function(t){throw t})),h=(t,e)=>{if(_||0<L)throw process.exitCode=t,e;e instanceof J||w("exiting due to exception: "+e),process.exit(t)},e.inspect=function(){return"[Emscripten Module object]"}):(d||y)&&(y?m=self.location.href:"undefined"!=typeof document&&document.currentScript&&(m=document.currentScript.src),_scriptDir&&(m=_scriptDir),m=0!==m.indexOf("blob:")?m.substr(0,m.replace(/[?#].*/,"").lastIndexOf("/")+1):"",i=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},y&&(u=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),o=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)});var g,v=e.print||console.log.bind(console),w=e.printErr||console.warn.bind(console);Object.assign(e,f),f=null,e.thisProgram&&(p=e.thisProgram),e.quit&&(h=e.quit),e.wasmBinary&&(g=e.wasmBinary);var _=e.noExitRuntime||!1;"object"!=typeof WebAssembly&&V("no native wasm support detected");var O,A,S,T,E,M,C=!1,x="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function R(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16<n-e&&t.buffer&&x)return x.decode(t.subarray(e,n));for(r="";e<n;){var a=t[e++];if(128&a){var i=63&t[e++];if(192==(224&a))r+=String.fromCharCode((31&a)<<6|i);else{var o=63&t[e++];65536>(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function j(t,e){return(t>>>=0)?R(T,t,e):""}function k(t,e,n,r){if(!(0<r))return 0;var a=n>>>=0;r=n+r-1;for(var i=0;i<t.length;++i){var o=t.charCodeAt(i);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function D(t){for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);127>=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function P(){var t=O.buffer;A=t,e.HEAP8=S=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAP32=E=new Int32Array(t),e.HEAPU8=T=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAPU32=M=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}var U,F=[],I=[],W=[],H=[],L=0;function z(){var t=e.preRun.shift();F.unshift(t)}var Y,B=0,G=null,N=null;function V(t){throw e.onAbort&&e.onAbort(t),w(t="Aborted("+t+")"),C=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),a(t),t}function $(){return Y.startsWith("data:application/octet-stream;base64,")}if(Y="ort-wasm.wasm",!$()){var q=Y;Y=e.locateFile?e.locateFile(q,m):m+q}function X(){var t=Y;try{if(t==Y&&g)return new Uint8Array(g);if(u)return u(t);throw"both async and sync fetching of the wasm failed"}catch(t){V(t)}}function J(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Z(t){for(;0<t.length;)t.shift()(e)}var Q=[],K=0,tt=0;function et(t){this.Db=t,this.zb=t-24,this.Ub=function(t){M[this.zb+4>>2>>>0]=t},this.Eb=function(){return M[this.zb+4>>2>>>0]},this.Sb=function(t){M[this.zb+8>>2>>>0]=t},this.Wb=function(){return M[this.zb+8>>2>>>0]},this.Tb=function(){E[this.zb>>2>>>0]=0},this.Ib=function(t){S[this.zb+12>>0>>>0]=t?1:0},this.Pb=function(){return 0!=S[this.zb+12>>0>>>0]},this.Jb=function(t){S[this.zb+13>>0>>>0]=t?1:0},this.Lb=function(){return 0!=S[this.zb+13>>0>>>0]},this.Rb=function(t,e){this.Fb(0),this.Ub(t),this.Sb(e),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){E[this.zb>>2>>>0]+=1},this.Xb=function(){var t=E[this.zb>>2>>>0];return E[this.zb>>2>>>0]=t-1,1===t},this.Fb=function(t){M[this.zb+16>>2>>>0]=t},this.Ob=function(){return M[this.zb+16>>2>>>0]},this.Qb=function(){if(Mt(this.Eb()))return M[this.Db>>2>>>0];var t=this.Ob();return 0!==t?t:this.Db}}function nt(t){return vt(new et(t).zb)}var rt=[];function at(t){var e=rt[t];return e||(t>=rt.length&&(rt.length=t+1),rt[t]=e=U.get(t)),e}function it(t){var e=D(t)+1,n=gt(e);return n&&k(t,S,n,e),n}var ot={};function ut(){if(!ct){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:p||"./this.program"};for(t in ot)void 0===ot[t]?delete e[t]:e[t]=ot[t];var n=[];for(t in e)n.push(t+"="+e[t]);ct=n}return ct}var ct,st=[null,[],[]];function lt(t,e){var n=st[t];0===e||10===e?((1===t?v:w)(R(n,0)),n.length=0):n.push(e)}var ft=0;function pt(t){return 0==t%4&&(0!=t%100||0==t%400)}var ht=[31,29,31,30,31,30,31,31,30,31,30,31],dt=[31,28,31,30,31,30,31,31,30,31,30,31];function yt(t,e,n,r){function a(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.length<e;)t=n[0]+t;return t}function i(t,e){return a(t,e,"0")}function o(t,e){function n(t){return 0>t?-1:0<t?1:0}var r;return 0===(r=n(t.getFullYear()-e.getFullYear()))&&0===(r=n(t.getMonth()-e.getMonth()))&&(r=n(t.getDate()-e.getDate())),r}function u(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function c(t){var e=t.Bb;for(t=new Date(new Date(t.Cb+1900,0,1).getTime());0<e;){var n=t.getMonth(),r=(pt(t.getFullYear())?ht:dt)[n];if(!(e>r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=u(new Date(t.getFullYear(),0,4)),n=u(n),0>=o(e,t)?0>=o(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var s=E[r+40>>2>>>0];for(var l in r={$b:E[r>>2>>>0],Zb:E[r+4>>2>>>0],Gb:E[r+8>>2>>>0],Kb:E[r+12>>2>>>0],Hb:E[r+16>>2>>>0],Cb:E[r+20>>2>>>0],Ab:E[r+24>>2>>>0],Bb:E[r+28>>2>>>0],bc:E[r+32>>2>>>0],Yb:E[r+36>>2>>>0],ac:s?j(s):""},n=j(n),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(l,"g"),s[l]);var f="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),p="January February March April May June July August September October November December".split(" ");for(l in s={"%a":function(t){return f[t.Ab].substring(0,3)},"%A":function(t){return f[t.Ab]},"%b":function(t){return p[t.Hb].substring(0,3)},"%B":function(t){return p[t.Hb]},"%C":function(t){return i((t.Cb+1900)/100|0,2)},"%d":function(t){return i(t.Kb,2)},"%e":function(t){return a(t.Kb,2," ")},"%g":function(t){return c(t).toString().substring(2)},"%G":function(t){return c(t)},"%H":function(t){return i(t.Gb,2)},"%I":function(t){return 0==(t=t.Gb)?t=12:12<t&&(t-=12),i(t,2)},"%j":function(t){for(var e=0,n=0;n<=t.Hb-1;e+=(pt(t.Cb+1900)?ht:dt)[n++]);return i(t.Kb+e,3)},"%m":function(t){return i(t.Hb+1,2)},"%M":function(t){return i(t.Zb,2)},"%n":function(){return"\\n"},"%p":function(t){return 0<=t.Gb&&12>t.Gb?"AM":"PM"},"%S":function(t){return i(t.$b,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Ab||7},"%U":function(t){return i(Math.floor((t.Bb+7-t.Ab)/7),2)},"%V":function(t){var e=Math.floor((t.Bb+7-(t.Ab+6)%7)/7);if(2>=(t.Ab+371-t.Bb-2)%7&&e++,e)53==e&&(4==(n=(t.Ab+371-t.Bb)%7)||3==n&&pt(t.Cb)||(e=1));else{e=52;var n=(t.Ab+7-t.Bb-1)%7;(4==n||5==n&&pt(t.Cb%400-1))&&e++}return i(e,2)},"%w":function(t){return t.Ab},"%W":function(t){return i(Math.floor((t.Bb+7-(t.Ab+6)%7)/7),2)},"%y":function(t){return(t.Cb+1900).toString().substring(2)},"%Y":function(t){return t.Cb+1900},"%z":function(t){var e=0<=(t=t.Yb);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.ac},"%%":function(){return"%"}},n=n.replace(/%%/g,"\\0\\0"),s)n.includes(l)&&(n=n.replace(new RegExp(l,"g"),s[l](r)));return l=function(t){var e=Array(D(t)+1);return k(t,e,0,e.length),e}(n=n.replace(/\\0\\0/g,"%")),l.length>e?0:(S.set(l,t>>>0),l.length-1)}var bt={a:function(t){return gt(t+24)+24},m:function(t){return(t=new et(t)).Pb()||(t.Ib(!0),K--),t.Jb(!1),Q.push(t),t.Nb(),t.Qb()},ia:function(t){throw w("Unexpected exception thrown, this is not properly supported - aborting"),C=!0,t},w:function(){Ot(0);var t=Q.pop();if(t.Xb()&&!t.Lb()){var e=t.Wb();e&&at(e)(t.Db),nt(t.Db)}tt=0},d:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(Et(i,n,e.zb+16))return ft=i,t}return ft=n,t},k:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(Et(i,n,e.zb+16))return ft=i,t}return ft=n,t},g:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a<r.length;a++){var i=r[a];if(0===i||i===n)break;if(Et(i,n,e.zb+16))return ft=i,t}return ft=n,t},s:nt,L:function(){var t=Q.pop();t||V("no exception to throw");var e=t.Db;throw t.Lb()||(Q.push(t),t.Jb(!0),t.Ib(!1),K++),tt=e,e},b:function(t,e,n){throw new et(t).Rb(e,n),tt=t,K++,t},la:function(){return K},i:function(t){throw tt||(tt=t),t},H:function(){return 0},Ba:function(){},pa:function(){},ra:function(){},ka:function(){return 0},za:function(){},ua:function(){},ya:function(){},R:function(){},qa:function(){},na:function(){},Aa:function(){},oa:function(){},Ha:function(){},Ja:function(){V("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},Ia:function(){V("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking")},S:function(){return Date.now()},Ca:function(){return!0},Da:function(t,e){t=new Date(1e3*(M[t>>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getUTCSeconds(),E[e+4>>2>>>0]=t.getUTCMinutes(),E[e+8>>2>>>0]=t.getUTCHours(),E[e+12>>2>>>0]=t.getUTCDate(),E[e+16>>2>>>0]=t.getUTCMonth(),E[e+20>>2>>>0]=t.getUTCFullYear()-1900,E[e+24>>2>>>0]=t.getUTCDay(),E[e+28>>2>>>0]=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(t,e){t=new Date(1e3*(M[t>>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getSeconds(),E[e+4>>2>>>0]=t.getMinutes(),E[e+8>>2>>>0]=t.getHours(),E[e+12>>2>>>0]=t.getDate(),E[e+16>>2>>>0]=t.getMonth(),E[e+20>>2>>>0]=t.getFullYear()-1900,E[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1);E[e+28>>2>>>0]=(t.getTime()-n.getTime())/864e5|0,E[e+36>>2>>>0]=-60*t.getTimezoneOffset();var r=new Date(t.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),E[e+32>>2>>>0]=0|(r!=n&&t.getTimezoneOffset()==Math.min(n,r))},Fa:function(t){var e=new Date(E[t+20>>2>>>0]+1900,E[t+16>>2>>>0],E[t+12>>2>>>0],E[t+8>>2>>>0],E[t+4>>2>>>0],E[t>>2>>>0],0),n=E[t+32>>2>>>0],r=e.getTimezoneOffset(),a=new Date(e.getFullYear(),0,1),i=new Date(e.getFullYear(),6,1).getTimezoneOffset(),o=a.getTimezoneOffset(),u=Math.min(o,i);return 0>n?E[t+32>>2>>>0]=Number(i!=o&&u==r):0<n!=(u==r)&&(i=Math.max(o,i),e.setTime(e.getTime()+6e4*((0<n?u:i)-r))),E[t+24>>2>>>0]=e.getDay(),E[t+28>>2>>>0]=(e.getTime()-a.getTime())/864e5|0,E[t>>2>>>0]=e.getSeconds(),E[t+4>>2>>>0]=e.getMinutes(),E[t+8>>2>>>0]=e.getHours(),E[t+12>>2>>>0]=e.getDate(),E[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function t(e,n,r){t.Vb||(t.Vb=!0,function(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}var a=(new Date).getFullYear(),i=new Date(a,0,1),o=new Date(a,6,1);a=i.getTimezoneOffset();var u=o.getTimezoneOffset();E[t>>2>>>0]=60*Math.max(a,u),E[e>>2>>>0]=Number(a!=u),t=r(i),e=r(o),t=it(t),e=it(e),u<a?(M[n>>2>>>0]=t,M[n+4>>2>>>0]=e):(M[n>>2>>>0]=e,M[n+4>>2>>>0]=t)}(e,n,r))},B:function(){V("")},ma:function(){return 4294901760},I:b?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now(),xa:function(t,e,n){T.copyWithin(t>>>0,e>>>0,e+n>>>0)},G:function(t){var e=T.length;if(4294901760<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296);var a=Math;r=Math.max(t,r),a=a.min.call(a,4294901760,r+(65536-r%65536)%65536);t:{try{O.grow(a-A.byteLength+65535>>>16),P();var i=1;break t}catch(t){}i=void 0}if(i)return!0}return!1},va:function(t,e){var n=0;return ut().forEach((function(r,a){var i=e+n;for(a=M[t+4*a>>2>>>0]=i,i=0;i<r.length;++i)S[a++>>0>>>0]=r.charCodeAt(i);S[a>>0>>>0]=0,n+=r.length+1})),0},wa:function(t,e){var n=ut();M[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),M[e>>2>>>0]=r,0},ba:function(t){_||0<L||(_t(),Z(W),wt(0),st[1].length&<(1,10),st[2].length&<(2,10)),_||0<L||(e.onExit&&e.onExit(t),C=!0),h(t,new J(t))},E:function(){return 52},Q:function(){return 52},ca:function(){return 70},P:function(t,e,n,r){for(var a=0,i=0;i<n;i++){var o=M[e>>2>>>0],u=M[e+4>>2>>>0];e+=8;for(var c=0;c<u;c++)lt(t,T[o+c>>>0]);a+=u}return M[r>>2>>>0]=a,0},c:function(){return ft},ja:function t(e,r){t.Mb||(t.Mb=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(b)try{var e=n(Object(function(){var t=new Error("Cannot find module \'crypto\'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>V("randomDevice")}());for(var a=0;a<r;a++)S[e+a>>0>>>0]=t.Mb();return 0},ea:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},fa:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},J:function(t){var e=At();try{return at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},e:function(t,e){var n=At();try{return at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},N:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},O:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},j:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},o:function(t,e,n,r){var a=At();try{return at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},p:function(t,e,n,r,a){var i=At();try{return at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},M:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},r:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},v:function(t,e,n,r,a,i,o){var u=At();try{return at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},K:function(t,e,n,r,a,i,o,u){var c=At();try{return at(t)(e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=At();try{return at(t)(e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},X:function(t,e,n,r,a,i,o,u){var c=At();try{return Ft(t,e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},V:function(t,e,n,r,a,i,o){var u=At();try{return xt(t,e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},U:function(t,e,n,r,a){var i=At();try{return It(t,e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},Z:function(t,e,n,r){var a=At();try{return Pt(t,e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},W:function(t){var e=At();try{return Ct(t)}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},Y:function(t,e){var n=At();try{return Ut(t,e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},T:function(t,e,n){var r=At();try{return Rt(t,e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},f:function(t){var e=At();try{at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},q:function(t,e){var n=At();try{at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},h:function(t,e,n){var r=At();try{at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},da:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},l:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},t:function(t,e,n,r,a){var i=At();try{at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},u:function(t,e,n,r,a,i){var o=At();try{at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},x:function(t,e,n,r,a,i,o){var u=At();try{at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},z:function(t,e,n,r,a,i,o,u){var c=At();try{at(t)(e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},ga:function(t,e,n,r,a,i,o,u,c){var s=At();try{at(t)(e,n,r,a,i,o,u,c)}catch(t){if(St(s),t!==t+0)throw t;Ot(1,0)}},A:function(t,e,n,r,a,i,o,u,c,s,l){var f=At();try{at(t)(e,n,r,a,i,o,u,c,s,l)}catch(t){if(St(f),t!==t+0)throw t;Ot(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,l,f,p,h,d,y){var b=At();try{at(t)(e,n,r,a,i,o,u,c,s,l,f,p,h,d,y)}catch(t){if(St(b),t!==t+0)throw t;Ot(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=At();try{jt(t,e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},_:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=At();try{Dt(t,e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},$:function(t,e,n,r,a,i){var o=At();try{kt(t,e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},n:function(t){return t},F:function(t){ft=t},ha:yt,y:function(t,e,n,r){return yt(t,e,n,r)}};!function(){function t(t){e.asm=t.exports,O=e.asm.Ka,P(),U=e.asm.ib,I.unshift(e.asm.La),B--,e.monitorRunDependencies&&e.monitorRunDependencies(B),0==B&&(null!==G&&(clearInterval(G),G=null),N&&(t=N,N=null,t()))}function n(e){t(e.instance)}function r(t){return function(){if(!g&&(d||y)){if("function"==typeof fetch&&!Y.startsWith("file://"))return fetch(Y,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+Y+"\'";return t.arrayBuffer()})).catch((function(){return X()}));if(o)return new Promise((function(t,e){o(Y,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return X()}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){w("failed to asynchronously prepare wasm: "+t),V(t)}))}var i={a:bt};if(B++,e.monitorRunDependencies&&e.monitorRunDependencies(B),e.instantiateWasm)try{return e.instantiateWasm(i,t)}catch(t){return w("Module.instantiateWasm callback failed with error: "+t),!1}(g||"function"!=typeof WebAssembly.instantiateStreaming||$()||Y.startsWith("file://")||b||"function"!=typeof fetch?r(n):fetch(Y,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(n,(function(t){return w("wasm streaming compile failed: "+t),w("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(a)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.La).apply(null,arguments)},e._OrtInit=function(){return(e._OrtInit=e.asm.Ma).apply(null,arguments)},e._OrtCreateSessionOptions=function(){return(e._OrtCreateSessionOptions=e.asm.Na).apply(null,arguments)},e._OrtAppendExecutionProvider=function(){return(e._OrtAppendExecutionProvider=e.asm.Oa).apply(null,arguments)},e._OrtAddSessionConfigEntry=function(){return(e._OrtAddSessionConfigEntry=e.asm.Pa).apply(null,arguments)},e._OrtReleaseSessionOptions=function(){return(e._OrtReleaseSessionOptions=e.asm.Qa).apply(null,arguments)},e._OrtCreateSession=function(){return(e._OrtCreateSession=e.asm.Ra).apply(null,arguments)},e._OrtReleaseSession=function(){return(e._OrtReleaseSession=e.asm.Sa).apply(null,arguments)},e._OrtGetInputCount=function(){return(e._OrtGetInputCount=e.asm.Ta).apply(null,arguments)},e._OrtGetOutputCount=function(){return(e._OrtGetOutputCount=e.asm.Ua).apply(null,arguments)},e._OrtGetInputName=function(){return(e._OrtGetInputName=e.asm.Va).apply(null,arguments)},e._OrtGetOutputName=function(){return(e._OrtGetOutputName=e.asm.Wa).apply(null,arguments)},e._OrtFree=function(){return(e._OrtFree=e.asm.Xa).apply(null,arguments)},e._OrtCreateTensor=function(){return(e._OrtCreateTensor=e.asm.Ya).apply(null,arguments)},e._OrtGetTensorData=function(){return(e._OrtGetTensorData=e.asm.Za).apply(null,arguments)},e._OrtReleaseTensor=function(){return(e._OrtReleaseTensor=e.asm._a).apply(null,arguments)},e._OrtCreateRunOptions=function(){return(e._OrtCreateRunOptions=e.asm.$a).apply(null,arguments)},e._OrtAddRunConfigEntry=function(){return(e._OrtAddRunConfigEntry=e.asm.ab).apply(null,arguments)},e._OrtReleaseRunOptions=function(){return(e._OrtReleaseRunOptions=e.asm.bb).apply(null,arguments)},e._OrtRun=function(){return(e._OrtRun=e.asm.cb).apply(null,arguments)},e._OrtEndProfiling=function(){return(e._OrtEndProfiling=e.asm.db).apply(null,arguments)};var mt,gt=e._malloc=function(){return(gt=e._malloc=e.asm.eb).apply(null,arguments)},vt=e._free=function(){return(vt=e._free=e.asm.fb).apply(null,arguments)},wt=e._fflush=function(){return(wt=e._fflush=e.asm.gb).apply(null,arguments)},_t=e.___funcs_on_exit=function(){return(_t=e.___funcs_on_exit=e.asm.hb).apply(null,arguments)},Ot=e._setThrew=function(){return(Ot=e._setThrew=e.asm.jb).apply(null,arguments)},At=e.stackSave=function(){return(At=e.stackSave=e.asm.kb).apply(null,arguments)},St=e.stackRestore=function(){return(St=e.stackRestore=e.asm.lb).apply(null,arguments)},Tt=e.stackAlloc=function(){return(Tt=e.stackAlloc=e.asm.mb).apply(null,arguments)},Et=e.___cxa_can_catch=function(){return(Et=e.___cxa_can_catch=e.asm.nb).apply(null,arguments)},Mt=e.___cxa_is_pointer_type=function(){return(Mt=e.___cxa_is_pointer_type=e.asm.ob).apply(null,arguments)},Ct=e.dynCall_j=function(){return(Ct=e.dynCall_j=e.asm.pb).apply(null,arguments)},xt=e.dynCall_iiiiij=function(){return(xt=e.dynCall_iiiiij=e.asm.qb).apply(null,arguments)},Rt=e.dynCall_jii=function(){return(Rt=e.dynCall_jii=e.asm.rb).apply(null,arguments)},jt=e.dynCall_viiiiij=function(){return(jt=e.dynCall_viiiiij=e.asm.sb).apply(null,arguments)},kt=e.dynCall_vjji=function(){return(kt=e.dynCall_vjji=e.asm.tb).apply(null,arguments)},Dt=e.dynCall_viiijjjii=function(){return(Dt=e.dynCall_viiijjjii=e.asm.ub).apply(null,arguments)},Pt=e.dynCall_iij=function(){return(Pt=e.dynCall_iij=e.asm.vb).apply(null,arguments)},Ut=e.dynCall_ji=function(){return(Ut=e.dynCall_ji=e.asm.wb).apply(null,arguments)},Ft=e.dynCall_iiiiiij=function(){return(Ft=e.dynCall_iiiiiij=e.asm.xb).apply(null,arguments)},It=e.dynCall_iiij=function(){return(It=e.dynCall_iiij=e.asm.yb).apply(null,arguments)};function Wt(){function t(){if(!mt&&(mt=!0,e.calledRun=!0,!C)){if(Z(I),r(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();H.unshift(t)}Z(H)}}if(!(0<B)){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)z();Z(F),0<B||(e.setStatus?(e.setStatus("Running..."),setTimeout((function(){setTimeout((function(){e.setStatus("")}),1),t()}),1)):t())}}if(e.UTF8ToString=j,e.stringToUTF8=function(t,e,n){return k(t,T,e,n)},e.lengthBytesUTF8=D,e.stackSave=At,e.stackRestore=St,e.stackAlloc=Tt,N=function t(){mt||Wt(),mt||(N=t)},e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);0<e.preInit.length;)e.preInit.pop()();return Wt(),t.ready});t.exports=r},967:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.iterateExtraOptions=void 0,e.iterateExtraOptions=(t,n,r,a)=>{if("object"==typeof t&&null!==t){if(r.has(t))throw new Error("Circular reference in options");r.add(t)}Object.entries(t).forEach((([t,i])=>{const o=n?n+t:t;if("object"==typeof i)(0,e.iterateExtraOptions)(i,o+".",r,a);else if("string"==typeof i||"number"==typeof i)a(o,i.toString());else{if("boolean"!=typeof i)throw new Error("Can\'t handle extra config type: "+typeof i);a(o,i?"1":"0")}}))}},586:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setRunOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setRunOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};try{if(void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);void 0===(null==t?void 0:t.terminate)&&(u.terminate=!1);let i=0;if(void 0!==(null==t?void 0:t.tag)&&(i=(0,a.allocWasmString)(t.tag,o)),n=e._OrtCreateRunOptions(u.logSeverityLevel,u.logVerbosityLevel,!!u.terminate,i),0===n)throw new Error("Can\'t create run options");return void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddRunConfigEntry(n,i,u))throw new Error(`Can\'t set a run config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseRunOptions(n),o.forEach(e._free),t}}},919:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setSessionOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setSessionOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};(t=>{t.extra||(t.extra={}),t.extra.session||(t.extra.session={});const e=t.extra.session;e.use_ort_model_bytes_directly||(e.use_ort_model_bytes_directly="1")})(u);try{void 0===(null==t?void 0:t.graphOptimizationLevel)&&(u.graphOptimizationLevel="all");const c=(t=>{switch(t){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${t}`)}})(u.graphOptimizationLevel);void 0===(null==t?void 0:t.enableCpuMemArena)&&(u.enableCpuMemArena=!0),void 0===(null==t?void 0:t.enableMemPattern)&&(u.enableMemPattern=!0),void 0===(null==t?void 0:t.executionMode)&&(u.executionMode="sequential");const s=(t=>{switch(t){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${t}`)}})(u.executionMode);let l=0;if(void 0!==(null==t?void 0:t.logId)&&(l=(0,a.allocWasmString)(t.logId,o)),void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);if(void 0===(null==t?void 0:t.enableProfiling)&&(u.enableProfiling=!1),n=e._OrtCreateSessionOptions(c,!!u.enableCpuMemArena,!!u.enableMemPattern,s,!!u.enableProfiling,0,l,u.logSeverityLevel,u.logVerbosityLevel),0===n)throw new Error("Can\'t create session options");return(null==t?void 0:t.executionProviders)&&((t,e,n)=>{for(const r of e){let e="string"==typeof r?r:r.name;switch(e){case"xnnpack":e="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${e}`)}const o=(0,a.allocWasmString)(e,n);if(0!==(0,i.getInstance)()._OrtAppendExecutionProvider(t,o))throw new Error(`Can\'t append execution provider: ${e}`)}})(n,t.executionProviders,o),void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddSessionConfigEntry(n,i,u))throw new Error(`Can\'t set a session config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseSessionOptions(n),o.forEach(e._free),t}}},983:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.allocWasmString=void 0;const r=n(361);e.allocWasmString=(t,e)=>{const n=(0,r.getInstance)(),a=n.lengthBytesUTF8(t)+1,i=n._malloc(a);return n.stringToUTF8(t,i,a),e.push(i),i}},349:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.extractTransferableBuffers=e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=void 0;const r=n(586),a=n(919),i=n(983),o=n(361);e.initOrt=(t,e)=>{const n=(0,o.getInstance)()._OrtInit(t,e);if(0!==n)throw new Error(`Can\'t initialize onnxruntime. error code = ${n}`)};const u=new Map;e.createSessionAllocate=t=>{const e=(0,o.getInstance)(),n=e._malloc(t.byteLength);return e.HEAPU8.set(t,n),[n,t.byteLength]},e.createSessionFinalize=(t,e)=>{const n=(0,o.getInstance)();let r=0,i=0,c=[];try{if([i,c]=(0,a.setSessionOptions)(e),r=n._OrtCreateSession(t[0],t[1],i),0===r)throw new Error("Can\'t create a session")}finally{n._free(t[0]),n._OrtReleaseSessionOptions(i),c.forEach(n._free)}const s=n._OrtGetInputCount(r),l=n._OrtGetOutputCount(r),f=[],p=[],h=[],d=[];for(let t=0;t<s;t++){const e=n._OrtGetInputName(r,t);if(0===e)throw new Error("Can\'t get an input name");p.push(e),f.push(n.UTF8ToString(e))}for(let t=0;t<l;t++){const e=n._OrtGetOutputName(r,t);if(0===e)throw new Error("Can\'t get an output name");d.push(e),h.push(n.UTF8ToString(e))}return u.set(r,[r,p,d]),[r,f,h]},e.createSession=(t,n)=>{const r=(0,e.createSessionAllocate)(t);return(0,e.createSessionFinalize)(r,n)},e.releaseSession=t=>{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error("invalid session id");const r=n[0],a=n[1],i=n[2];a.forEach(e._OrtFree),i.forEach(e._OrtFree),e._OrtReleaseSession(r),u.delete(t)};const c=t=>{switch(t){case"int8":return 3;case"uint8":return 2;case"bool":return 9;case"int16":return 5;case"uint16":return 4;case"int32":return 6;case"uint32":return 12;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;default:throw new Error(`unsupported data type: ${t}`)}},s=t=>{switch(t){case 3:return"int8";case 2:return"uint8";case 9:return"bool";case 5:return"int16";case 4:return"uint16";case 6:return"int32";case 12:return"uint32";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";default:throw new Error(`unsupported data type: ${t}`)}},l=t=>{switch(t){case"float32":return Float32Array;case"uint8":case"bool":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${t}`)}};e.run=(t,e,n,a,f)=>{const p=(0,o.getInstance)(),h=u.get(t);if(!h)throw new Error("invalid session id");const d=h[0],y=h[1],b=h[2],m=e.length,g=a.length;let v=0,w=[];const _=[],O=[];try{[v,w]=(0,r.setRunOptions)(f);for(let t=0;t<m;t++){const e=n[t][0],r=n[t][1],a=n[t][2];let o,u;if(Array.isArray(a)){u=4*a.length,o=p._malloc(u),O.push(o);let t=o/4;for(let e=0;e<a.length;e++){if("string"!=typeof a[e])throw new TypeError(`tensor data at index ${e} is not a string`);p.HEAPU32[t++]=(0,i.allocWasmString)(a[e],O)}}else u=a.byteLength,o=p._malloc(u),O.push(o),p.HEAPU8.set(new Uint8Array(a.buffer,a.byteOffset,u),o);const s=p.stackSave(),l=p.stackAlloc(4*r.length);try{let t=l/4;r.forEach((e=>p.HEAP32[t++]=e));const n=p._OrtCreateTensor(c(e),o,u,l,r.length);if(0===n)throw new Error("Can\'t create a tensor");_.push(n)}finally{p.stackRestore(s)}}const t=p.stackSave(),o=p.stackAlloc(4*m),u=p.stackAlloc(4*m),h=p.stackAlloc(4*g),A=p.stackAlloc(4*g);try{let n=o/4,r=u/4,i=h/4,c=A/4;for(let t=0;t<m;t++)p.HEAPU32[n++]=_[t],p.HEAPU32[r++]=y[e[t]];for(let t=0;t<g;t++)p.HEAPU32[i++]=0,p.HEAPU32[c++]=b[a[t]];let f=p._OrtRun(d,u,o,m,A,g,h,v);const w=[];if(0===f)for(let t=0;t<g;t++){const e=p.HEAPU32[h/4+t],n=p.stackSave(),r=p.stackAlloc(16);let a,i=0;try{if(f=p._OrtGetTensorData(e,r,r+4,r+8,r+12),0!==f)throw new Error(`Can\'t access output tensor data. error code = ${f}`);let t=r/4;const o=p.HEAPU32[t++];i=p.HEAPU32[t++];const u=p.HEAPU32[t++],c=p.HEAPU32[t++],h=[];for(let t=0;t<c;t++)h.push(p.HEAPU32[u/4+t]);p._OrtFree(u);const d=0===h.length?1:h.reduce(((t,e)=>t*e));if(a=s(o),"string"===a){const t=[];let e=i/4;for(let n=0;n<d;n++){const r=p.HEAPU32[e++],a=n===d-1?void 0:p.HEAPU32[e]-r;t.push(p.UTF8ToString(r,a))}w.push([a,h,t])}else{const t=new(l(a))(d);new Uint8Array(t.buffer,t.byteOffset,t.byteLength).set(p.HEAPU8.subarray(i,i+t.byteLength)),w.push([a,h,t])}}finally{p.stackRestore(n),"string"===a&&i&&p._free(i),p._OrtReleaseTensor(e)}}if(0===f)return w;throw new Error(`failed to call OrtRun(). error code = ${f}.`)}finally{p.stackRestore(t)}}finally{_.forEach(p._OrtReleaseTensor),O.forEach(p._free),p._OrtReleaseRunOptions(v),w.forEach(p._free)}},e.endProfiling=t=>{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error("invalid session id");const r=n[0],a=e._OrtEndProfiling(r);if(0===a)throw new Error("Can\'t get an profile file name");e._OrtFree(a)},e.extractTransferableBuffers=t=>{const e=[];for(const n of t){const t=n[2];!Array.isArray(t)&&t.buffer&&e.push(t.buffer)}return e}},361:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(e,n);a&&!("get"in a?!e.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,a)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return a(e,t),e},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.dispose=e.getInstance=e.initializeWebAssembly=void 0;const u=i(n(449)),c=o(n(932)),s=n(474);let l,f=!1,p=!1,h=!1;const d=(t,e)=>e?t?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":t?"ort-wasm-simd.wasm":"ort-wasm.wasm";e.initializeWebAssembly=async t=>{if(f)return Promise.resolve();if(p)throw new Error("multiple calls to \'initializeWebAssembly()\' detected.");if(h)throw new Error("previous call to \'initializeWebAssembly()\' failed.");p=!0;const e=t.initTimeout,r=t.numThreads,a=t.simd,i=r>1&&(()=>{try{return"undefined"!=typeof SharedArrayBuffer&&("undefined"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])))}catch(t){return!1}})(),o=a&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch(t){return!1}})(),y="string"==typeof t.wasmPaths?t.wasmPaths:void 0,b=d(!1,i),m=d(o,i),g="object"==typeof t.wasmPaths?t.wasmPaths[m]:void 0;let v=!1;const w=[];if(e>0&&w.push(new Promise((t=>{setTimeout((()=>{v=!0,t()}),e)}))),w.push(new Promise(((t,e)=>{const r=i?s:c.default,a={locateFile:(t,e)=>i&&t.endsWith(".worker.js")&&"undefined"!=typeof Blob?URL.createObjectURL(new Blob([n(154)],{type:"text/javascript"})):t===b?null!=g?g:(null!=y?y:e)+m:e+t};if(i)if("undefined"==typeof Blob)a.mainScriptUrlOrBlob=u.join("/","ort-wasm-threaded.js");else{const t=`var ortWasmThreaded=(function(){var _scriptDir;return ${r.toString()}})();`;a.mainScriptUrlOrBlob=new Blob([t],{type:"text/javascript"})}r(a).then((e=>{p=!1,f=!0,l=e,t()}),(t=>{p=!1,h=!0,e(t)}))}))),await Promise.race(w),v)throw new Error(`WebAssembly backend initializing failed due to timeout: ${e}ms`)},e.getInstance=()=>{if(f&&l)return l;throw new Error("WebAssembly is not initialized yet.")},e.dispose=()=>{var t;!f||p||h||(p=!0,null===(t=l.PThread)||void 0===t||t.terminateAllThreads(),l=void 0,p=!1,f=!1,h=!0)}},154:t=>{"use strict";t.exports=\'"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\\n\'},384:()=>{},993:()=>{},908:()=>{},953:()=>{},925:()=>{},449:()=>{}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),(()=>{"use strict";const t=n(349),e=n(361);self.onmessage=n=>{switch(n.data.type){case"init-wasm":(0,e.initializeWebAssembly)(n.data.in).then((()=>postMessage({type:"init-wasm"})),(t=>postMessage({type:"init-wasm",err:t})));break;case"init-ort":try{const{numThreads:e,loggingLevel:r}=n.data.in;(0,t.initOrt)(e,r),postMessage({type:"init-ort"})}catch(t){postMessage({type:"init-ort",err:t})}break;case"create_allocate":try{const{model:e}=n.data.in,r=(0,t.createSessionAllocate)(e);postMessage({type:"create_allocate",out:r})}catch(t){postMessage({type:"create_allocate",err:t})}break;case"create_finalize":try{const{modeldata:e,options:r}=n.data.in,a=(0,t.createSessionFinalize)(e,r);postMessage({type:"create_finalize",out:a})}catch(t){postMessage({type:"create_finalize",err:t})}break;case"create":try{const{model:e,options:r}=n.data.in,a=(0,t.createSession)(e,r);postMessage({type:"create",out:a})}catch(t){postMessage({type:"create",err:t})}break;case"release":try{const e=n.data.in;(0,t.releaseSession)(e),postMessage({type:"release"})}catch(t){postMessage({type:"release",err:t})}break;case"run":try{const{sessionId:e,inputIndices:r,inputs:a,outputIndices:i,options:o}=n.data.in,u=(0,t.run)(e,r,a,i,o);postMessage({type:"run",out:u},(0,t.extractTransferableBuffers)(u))}catch(t){postMessage({type:"run",err:t})}break;case"end-profiling":try{const e=n.data.in;(0,t.endProfiling)(e),postMessage({type:"end-profiling"})}catch(t){postMessage({type:"end-profiling",err:t})}}}})()})();\n',"Worker",void 0,void 0)}},477:e=>{e.exports=function(e,t,n,r){var o=self||window;try{try{var a;try{a=new o.Blob([e])}catch(u){(a=new(o.BlobBuilder||o.WebKitBlobBuilder||o.MozBlobBuilder||o.MSBlobBuilder)).append(e),a=a.getBlob()}var i=o.URL||o.webkitURL,s=i.createObjectURL(a),l=new o[t](s,n);return i.revokeObjectURL(s),l}catch(c){return new o[t]("data:application/javascript,".concat(encodeURIComponent(e)),n)}}catch(d){if(!r)throw Error("Inline worker is not supported");return new o[t](r,n)}}},4154:e=>{e.exports='"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\n'},1670:e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__1670__},7067:()=>{},1296:()=>{},1384:()=>{},3993:()=>{},908:()=>{},6953:()=>{},9925:()=>{},2806:()=>{},6449:()=>{},2850:()=>{},5381:()=>{},5686:(e,t,n)=>{n.r(t),n.d(t,{flatbuffers:()=>r});var r={};r.Offset,r.Table,r.SIZEOF_SHORT=2,r.SIZEOF_INT=4,r.FILE_IDENTIFIER_LENGTH=4,r.SIZE_PREFIX_LENGTH=4,r.Encoding={UTF8_BYTES:1,UTF16_STRING:2},r.int32=new Int32Array(2),r.float32=new Float32Array(r.int32.buffer),r.float64=new Float64Array(r.int32.buffer),r.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0],r.Long=function(e,t){this.low=0|e,this.high=0|t},r.Long.create=function(e,t){return 0==e&&0==t?r.Long.ZERO:new r.Long(e,t)},r.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},r.Long.prototype.equals=function(e){return this.low==e.low&&this.high==e.high},r.Long.ZERO=new r.Long(0,0),r.Builder=function(e){if(e)t=e;else var t=1024;this.bb=r.ByteBuffer.allocate(t),this.space=t,this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.forceDefaults=function(e){this.force_defaults=e},r.Builder.prototype.dataBuffer=function(){return this.bb},r.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},r.Builder.prototype.prep=function(e,t){e>this.minalign&&(this.minalign=e);for(var n=1+~(this.bb.capacity()-this.space+t)&e-1;this.space<n+e+t;){var o=this.bb.capacity();this.bb=r.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-o}this.pad(n)},r.Builder.prototype.pad=function(e){for(var t=0;t<e;t++)this.bb.writeInt8(--this.space,0)},r.Builder.prototype.writeInt8=function(e){this.bb.writeInt8(this.space-=1,e)},r.Builder.prototype.writeInt16=function(e){this.bb.writeInt16(this.space-=2,e)},r.Builder.prototype.writeInt32=function(e){this.bb.writeInt32(this.space-=4,e)},r.Builder.prototype.writeInt64=function(e){this.bb.writeInt64(this.space-=8,e)},r.Builder.prototype.writeFloat32=function(e){this.bb.writeFloat32(this.space-=4,e)},r.Builder.prototype.writeFloat64=function(e){this.bb.writeFloat64(this.space-=8,e)},r.Builder.prototype.addInt8=function(e){this.prep(1,0),this.writeInt8(e)},r.Builder.prototype.addInt16=function(e){this.prep(2,0),this.writeInt16(e)},r.Builder.prototype.addInt32=function(e){this.prep(4,0),this.writeInt32(e)},r.Builder.prototype.addInt64=function(e){this.prep(8,0),this.writeInt64(e)},r.Builder.prototype.addFloat32=function(e){this.prep(4,0),this.writeFloat32(e)},r.Builder.prototype.addFloat64=function(e){this.prep(8,0),this.writeFloat64(e)},r.Builder.prototype.addFieldInt8=function(e,t,n){(this.force_defaults||t!=n)&&(this.addInt8(t),this.slot(e))},r.Builder.prototype.addFieldInt16=function(e,t,n){(this.force_defaults||t!=n)&&(this.addInt16(t),this.slot(e))},r.Builder.prototype.addFieldInt32=function(e,t,n){(this.force_defaults||t!=n)&&(this.addInt32(t),this.slot(e))},r.Builder.prototype.addFieldInt64=function(e,t,n){!this.force_defaults&&t.equals(n)||(this.addInt64(t),this.slot(e))},r.Builder.prototype.addFieldFloat32=function(e,t,n){(this.force_defaults||t!=n)&&(this.addFloat32(t),this.slot(e))},r.Builder.prototype.addFieldFloat64=function(e,t,n){(this.force_defaults||t!=n)&&(this.addFloat64(t),this.slot(e))},r.Builder.prototype.addFieldOffset=function(e,t,n){(this.force_defaults||t!=n)&&(this.addOffset(t),this.slot(e))},r.Builder.prototype.addFieldStruct=function(e,t,n){t!=n&&(this.nested(t),this.slot(e))},r.Builder.prototype.nested=function(e){if(e!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")},r.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")},r.Builder.prototype.slot=function(e){this.vtable[e]=this.offset()},r.Builder.prototype.offset=function(){return this.bb.capacity()-this.space},r.Builder.growByteBuffer=function(e){var t=e.capacity();if(3221225472&t)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var n=t<<1,o=r.ByteBuffer.allocate(n);return o.setPosition(n-t),o.bytes().set(e.bytes(),n-t),o},r.Builder.prototype.addOffset=function(e){this.prep(r.SIZEOF_INT,0),this.writeInt32(this.offset()-e+r.SIZEOF_INT)},r.Builder.prototype.startObject=function(e){this.notNested(),null==this.vtable&&(this.vtable=[]),this.vtable_in_use=e;for(var t=0;t<e;t++)this.vtable[t]=0;this.isNested=!0,this.object_start=this.offset()},r.Builder.prototype.endObject=function(){if(null==this.vtable||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var e=this.offset(),t=this.vtable_in_use-1;t>=0&&0==this.vtable[t];t--);for(var n=t+1;t>=0;t--)this.addInt16(0!=this.vtable[t]?e-this.vtable[t]:0);this.addInt16(e-this.object_start);var o=(n+2)*r.SIZEOF_SHORT;this.addInt16(o);var a=0,i=this.space;e:for(t=0;t<this.vtables.length;t++){var s=this.bb.capacity()-this.vtables[t];if(o==this.bb.readInt16(s)){for(var l=r.SIZEOF_SHORT;l<o;l+=r.SIZEOF_SHORT)if(this.bb.readInt16(i+l)!=this.bb.readInt16(s+l))continue e;a=this.vtables[t];break}}return a?(this.space=this.bb.capacity()-e,this.bb.writeInt32(this.space,a-e)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-e,this.offset()-e)),this.isNested=!1,e},r.Builder.prototype.finish=function(e,t,n){var o=n?r.SIZE_PREFIX_LENGTH:0;if(t){var a=t;if(this.prep(this.minalign,r.SIZEOF_INT+r.FILE_IDENTIFIER_LENGTH+o),a.length!=r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+r.FILE_IDENTIFIER_LENGTH);for(var i=r.FILE_IDENTIFIER_LENGTH-1;i>=0;i--)this.writeInt8(a.charCodeAt(i))}this.prep(this.minalign,r.SIZEOF_INT+o),this.addOffset(e),o&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},r.Builder.prototype.finishSizePrefixed=function(e,t){this.finish(e,t,!0)},r.Builder.prototype.requiredField=function(e,t){var n=this.bb.capacity()-e,r=n-this.bb.readInt32(n);if(0==this.bb.readInt16(r+t))throw new Error("FlatBuffers: field "+t+" must be set")},r.Builder.prototype.startVector=function(e,t,n){this.notNested(),this.vector_num_elems=t,this.prep(r.SIZEOF_INT,e*t),this.prep(n,e*t)},r.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},r.Builder.prototype.createString=function(e){if(e instanceof Uint8Array)var t=e;else{t=[];for(var n=0;n<e.length;){var r,o=e.charCodeAt(n++);(r=o<55296||o>=56320?o:(o<<10)+e.charCodeAt(n++)+-56613888)<128?t.push(r):(r<2048?t.push(r>>6&31|192):(r<65536?t.push(r>>12&15|224):t.push(r>>18&7|240,r>>12&63|128),t.push(r>>6&63|128)),t.push(63&r|128))}}this.addInt8(0),this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),n=0;for(var a=this.space,i=this.bb.bytes();n<t.length;n++)i[a++]=t[n];return this.endVector()},r.Builder.prototype.createLong=function(e,t){return r.Long.create(e,t)},r.ByteBuffer=function(e){this.bytes_=e,this.position_=0},r.ByteBuffer.allocate=function(e){return new r.ByteBuffer(new Uint8Array(e))},r.ByteBuffer.prototype.clear=function(){this.position_=0},r.ByteBuffer.prototype.bytes=function(){return this.bytes_},r.ByteBuffer.prototype.position=function(){return this.position_},r.ByteBuffer.prototype.setPosition=function(e){this.position_=e},r.ByteBuffer.prototype.capacity=function(){return this.bytes_.length},r.ByteBuffer.prototype.readInt8=function(e){return this.readUint8(e)<<24>>24},r.ByteBuffer.prototype.readUint8=function(e){return this.bytes_[e]},r.ByteBuffer.prototype.readInt16=function(e){return this.readUint16(e)<<16>>16},r.ByteBuffer.prototype.readUint16=function(e){return this.bytes_[e]|this.bytes_[e+1]<<8},r.ByteBuffer.prototype.readInt32=function(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24},r.ByteBuffer.prototype.readUint32=function(e){return this.readInt32(e)>>>0},r.ByteBuffer.prototype.readInt64=function(e){return new r.Long(this.readInt32(e),this.readInt32(e+4))},r.ByteBuffer.prototype.readUint64=function(e){return new r.Long(this.readUint32(e),this.readUint32(e+4))},r.ByteBuffer.prototype.readFloat32=function(e){return r.int32[0]=this.readInt32(e),r.float32[0]},r.ByteBuffer.prototype.readFloat64=function(e){return r.int32[r.isLittleEndian?0:1]=this.readInt32(e),r.int32[r.isLittleEndian?1:0]=this.readInt32(e+4),r.float64[0]},r.ByteBuffer.prototype.writeInt8=function(e,t){this.bytes_[e]=t},r.ByteBuffer.prototype.writeUint8=function(e,t){this.bytes_[e]=t},r.ByteBuffer.prototype.writeInt16=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8},r.ByteBuffer.prototype.writeUint16=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8},r.ByteBuffer.prototype.writeInt32=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24},r.ByteBuffer.prototype.writeUint32=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24},r.ByteBuffer.prototype.writeInt64=function(e,t){this.writeInt32(e,t.low),this.writeInt32(e+4,t.high)},r.ByteBuffer.prototype.writeUint64=function(e,t){this.writeUint32(e,t.low),this.writeUint32(e+4,t.high)},r.ByteBuffer.prototype.writeFloat32=function(e,t){r.float32[0]=t,this.writeInt32(e,r.int32[0])},r.ByteBuffer.prototype.writeFloat64=function(e,t){r.float64[0]=t,this.writeInt32(e,r.int32[r.isLittleEndian?0:1]),this.writeInt32(e+4,r.int32[r.isLittleEndian?1:0])},r.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+r.SIZEOF_INT+r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var e="",t=0;t<r.FILE_IDENTIFIER_LENGTH;t++)e+=String.fromCharCode(this.readInt8(this.position_+r.SIZEOF_INT+t));return e},r.ByteBuffer.prototype.__offset=function(e,t){var n=e-this.readInt32(e);return t<this.readInt16(n)?this.readInt16(n+t):0},r.ByteBuffer.prototype.__union=function(e,t){return e.bb_pos=t+this.readInt32(t),e.bb=this,e},r.ByteBuffer.prototype.__string=function(e,t){e+=this.readInt32(e);var n=this.readInt32(e),o="",a=0;if(e+=r.SIZEOF_INT,t===r.Encoding.UTF8_BYTES)return this.bytes_.subarray(e,e+n);for(;a<n;){var i,s=this.readUint8(e+a++);if(s<192)i=s;else{var l=this.readUint8(e+a++);if(s<224)i=(31&s)<<6|63&l;else{var u=this.readUint8(e+a++);i=s<240?(15&s)<<12|(63&l)<<6|63&u:(7&s)<<18|(63&l)<<12|(63&u)<<6|63&this.readUint8(e+a++)}}i<65536?o+=String.fromCharCode(i):(i-=65536,o+=String.fromCharCode(55296+(i>>10),56320+(1023&i)))}return o},r.ByteBuffer.prototype.__indirect=function(e){return e+this.readInt32(e)},r.ByteBuffer.prototype.__vector=function(e){return e+this.readInt32(e)+r.SIZEOF_INT},r.ByteBuffer.prototype.__vector_len=function(e){return this.readInt32(e+this.readInt32(e))},r.ByteBuffer.prototype.__has_identifier=function(e){if(e.length!=r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+r.FILE_IDENTIFIER_LENGTH);for(var t=0;t<r.FILE_IDENTIFIER_LENGTH;t++)if(e.charCodeAt(t)!=this.readInt8(this.position_+r.SIZEOF_INT+t))return!1;return!0},r.ByteBuffer.prototype.createLong=function(e,t){return r.Long.create(e,t)}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__(6018);return __webpack_exports__})(),module.exports=e(require$$0)})(ortWeb_min);var ortWeb_minExports=ortWeb_min.exports,assetPath={};Object.defineProperty(assetPath,"__esModule",{value:!0}),assetPath.baseAssetPath=void 0;const isWeb="undefined"!=typeof window&&void 0!==window.document,currentScript=isWeb?window.document.currentScript:null;let basePath="/";currentScript&&(basePath=currentScript.src.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),assetPath.baseAssetPath=basePath;var defaultModelFetcher$1={};Object.defineProperty(defaultModelFetcher$1,"__esModule",{value:!0}),defaultModelFetcher$1.defaultModelFetcher=void 0;const defaultModelFetcher=e=>fetch(e).then(e=>e.arrayBuffer());defaultModelFetcher$1.defaultModelFetcher=defaultModelFetcher;var frameProcessor={},logging={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.log=e.LOG_PREFIX=void 0,e.LOG_PREFIX="[VAD]";const t=["error","debug","warn"].reduce((t,n)=>(t[n]=function(t){return(...n)=>{console[t](e.LOG_PREFIX,...n)}}(n),t),{});e.log=t}(logging);var messages={},Message,Message2;Object.defineProperty(messages,"__esModule",{value:!0}),messages.Message=void 0,Message2=Message||(messages.Message=Message={}),Message2.AudioFrame="AUDIO_FRAME",Message2.SpeechStart="SPEECH_START",Message2.VADMisfire="VAD_MISFIRE",Message2.SpeechEnd="SPEECH_END",Message2.SpeechStop="SPEECH_STOP",Object.defineProperty(frameProcessor,"__esModule",{value:!0}),frameProcessor.FrameProcessor=frameProcessor.validateOptions=frameProcessor.defaultV5FrameProcessorOptions=frameProcessor.defaultLegacyFrameProcessorOptions=void 0;const logging_1$3=logging,messages_1=messages,RECOMMENDED_FRAME_SAMPLES=[512,1024,1536];function validateOptions(e){RECOMMENDED_FRAME_SAMPLES.includes(e.frameSamples)||logging_1$3.log.warn("You are using an unusual frame size"),(e.positiveSpeechThreshold<0||e.positiveSpeechThreshold>1)&&logging_1$3.log.error("positiveSpeechThreshold should be a number between 0 and 1"),(e.negativeSpeechThreshold<0||e.negativeSpeechThreshold>e.positiveSpeechThreshold)&&logging_1$3.log.error("negativeSpeechThreshold should be between 0 and positiveSpeechThreshold"),e.preSpeechPadFrames<0&&logging_1$3.log.error("preSpeechPadFrames should be positive"),e.redemptionFrames<0&&logging_1$3.log.error("redemptionFrames should be positive")}frameProcessor.defaultLegacyFrameProcessorOptions={positiveSpeechThreshold:.5,negativeSpeechThreshold:.35,preSpeechPadFrames:1,redemptionFrames:8,frameSamples:1536,minSpeechFrames:3,submitUserSpeechOnPause:!1},frameProcessor.defaultV5FrameProcessorOptions={positiveSpeechThreshold:.5,negativeSpeechThreshold:.35,preSpeechPadFrames:3,redemptionFrames:24,frameSamples:512,minSpeechFrames:9,submitUserSpeechOnPause:!1},frameProcessor.validateOptions=validateOptions;const concatArrays=e=>{const t=e.reduce((e,t)=>(e.push(e.at(-1)+t.length),e),[0]),n=new Float32Array(t.at(-1));return e.forEach((e,r)=>{const o=t[r];n.set(e,o)}),n};class FrameProcessor{constructor(e,t,n){this.modelProcessFunc=e,this.modelResetFunc=t,this.options=n,this.speaking=!1,this.redemptionCounter=0,this.active=!1,this.reset=()=>{this.speaking=!1,this.audioBuffer=[],this.modelResetFunc(),this.redemptionCounter=0},this.pause=()=>(this.active=!1,this.options.submitUserSpeechOnPause?this.endSegment():(this.reset(),{})),this.resume=()=>{this.active=!0},this.endSegment=()=>{const e=this.audioBuffer;this.audioBuffer=[];const t=this.speaking;this.reset();const n=e.reduce((e,t)=>e+ +t.isSpeech,0);if(t){if(n>=this.options.minSpeechFrames){const t=concatArrays(e.map(e=>e.frame));return{msg:messages_1.Message.SpeechEnd,audio:t}}return{msg:messages_1.Message.VADMisfire}}return{}},this.process=async e=>{if(!this.active)return{};const t=await this.modelProcessFunc(e);if(this.audioBuffer.push({frame:e,isSpeech:t.isSpeech>=this.options.positiveSpeechThreshold}),t.isSpeech>=this.options.positiveSpeechThreshold&&this.redemptionCounter&&(this.redemptionCounter=0),t.isSpeech>=this.options.positiveSpeechThreshold&&!this.speaking)return this.speaking=!0,{probs:t,msg:messages_1.Message.SpeechStart,frame:e};if(t.isSpeech<this.options.negativeSpeechThreshold&&this.speaking&&++this.redemptionCounter>=this.options.redemptionFrames){this.redemptionCounter=0,this.speaking=!1;const n=this.audioBuffer;this.audioBuffer=[];if(n.reduce((e,t)=>e+ +t.isSpeech,0)>=this.options.minSpeechFrames){const r=concatArrays(n.map(e=>e.frame));return{probs:t,msg:messages_1.Message.SpeechEnd,audio:r,frame:e}}return{probs:t,msg:messages_1.Message.VADMisfire,frame:e}}if(!this.speaking)for(;this.audioBuffer.length>this.options.preSpeechPadFrames;)this.audioBuffer.shift();return{probs:t,frame:e}},this.audioBuffer=[],this.reset()}}frameProcessor.FrameProcessor=FrameProcessor;var nonRealTimeVad={},models={},common={};Object.defineProperty(common,"__esModule",{value:!0});var legacy={},_a$1;Object.defineProperty(legacy,"__esModule",{value:!0}),legacy.SileroLegacy=void 0;const logging_1$2=logging;class SileroLegacy{constructor(e,t,n,r,o){this.ortInstance=e,this._session=t,this._h=n,this._c=r,this._sr=o,this.reset_state=()=>{const e=Array(128).fill(0);this._h=new this.ortInstance.Tensor("float32",e,[2,1,64]),this._c=new this.ortInstance.Tensor("float32",e,[2,1,64])},this.process=async e=>{var t;const n={input:new this.ortInstance.Tensor("float32",e,[1,e.length]),h:this._h,c:this._c,sr:this._sr},r=await this._session.run(n);this._h=r.hn,this._c=r.cn;const[o]=null==(t=r.output)?void 0:t.data;return{notSpeech:1-o,isSpeech:o}}}}legacy.SileroLegacy=SileroLegacy,_a$1=SileroLegacy,SileroLegacy.new=async(e,t)=>{logging_1$2.log.debug("initializing vad");const n=await t(),r=await e.InferenceSession.create(n),o=new e.Tensor("int64",[16000n]),a=Array(128).fill(0),i=new e.Tensor("float32",a,[2,1,64]),s=new e.Tensor("float32",a,[2,1,64]);logging_1$2.log.debug("vad is initialized");return new _a$1(e,r,i,s,o)};var v5={},_a;Object.defineProperty(v5,"__esModule",{value:!0}),v5.SileroV5=void 0;const logging_1$1=logging;function getNewState(e){const t=Array(256).fill(0);return new e.Tensor("float32",t,[2,1,128])}class SileroV5{constructor(e,t,n,r){this._session=e,this._state=t,this._sr=n,this.ortInstance=r,this.reset_state=()=>{this._state=getNewState(this.ortInstance)},this.process=async e=>{var t;const n={input:new this.ortInstance.Tensor("float32",e,[1,e.length]),state:this._state,sr:this._sr},r=await this._session.run(n);this._state=r.stateN;const[o]=null==(t=r.output)?void 0:t.data;return{notSpeech:1-o,isSpeech:o}}}}v5.SileroV5=SileroV5,_a=SileroV5,SileroV5.new=async(e,t)=>{logging_1$1.log.debug("Loading VAD...");const n=await t(),r=await e.InferenceSession.create(n),o=new e.Tensor("int64",[16000n]),a=getNewState(e);return logging_1$1.log.debug("...finished loading VAD"),new _a(r,a,o,e)},function(e){var t=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=commonjsGlobal&&commonjsGlobal.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.SileroV5=e.SileroLegacy=void 0,n(common,e);var r=legacy;Object.defineProperty(e,"SileroLegacy",{enumerable:!0,get:function(){return r.SileroLegacy}});var o=v5;Object.defineProperty(e,"SileroV5",{enumerable:!0,get:function(){return o.SileroV5}})}(models);var resampler={};Object.defineProperty(resampler,"__esModule",{value:!0}),resampler.Resampler=void 0;const logging_1=logging;class Resampler{constructor(e){this.options=e,this.process=e=>{const t=[];for(const n of e)for(this.inputBuffer.push(n);this.hasEnoughDataForFrame();){const e=this.generateOutputFrame();t.push(e)}return t},this.stream=async function*(e){for(const t of e)for(this.inputBuffer.push(t);this.hasEnoughDataForFrame();){const e=this.generateOutputFrame();yield e}},e.nativeSampleRate<16e3&&logging_1.log.error("nativeSampleRate is too low. Should have 16000 = targetSampleRate <= nativeSampleRate"),this.inputBuffer=[]}hasEnoughDataForFrame(){return this.inputBuffer.length*this.options.targetSampleRate/this.options.nativeSampleRate>=this.options.targetFrameSize}generateOutputFrame(){const e=new Float32Array(this.options.targetFrameSize);let t=0,n=0;for(;t<this.options.targetFrameSize;){let r=0,o=0;for(;n<Math.min(this.inputBuffer.length,(t+1)*this.options.nativeSampleRate/this.options.targetSampleRate);){const e=this.inputBuffer[n];void 0!==e&&(r+=e,o++),n++}e[t]=r/o,t++}return this.inputBuffer=this.inputBuffer.slice(n),e}}resampler.Resampler=Resampler,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PlatformAgnosticNonRealTimeVAD=e.defaultNonRealTimeVADOptions=void 0;const t=frameProcessor,n=messages,r=models,o=resampler;e.defaultNonRealTimeVADOptions={...t.defaultLegacyFrameProcessorOptions,ortConfig:void 0};e.PlatformAgnosticNonRealTimeVAD=class{static async _new(t,n,r={}){const o={...e.defaultNonRealTimeVADOptions,...r};void 0!==o.ortConfig&&o.ortConfig(n);const a=new this(t,n,o);return await a.init(),a}constructor(e,a,i){this.modelFetcher=e,this.ort=a,this.options=i,this.init=async()=>{const e=await r.SileroLegacy.new(this.ort,this.modelFetcher);this.frameProcessor=new t.FrameProcessor(e.process,e.reset_state,{frameSamples:this.options.frameSamples,positiveSpeechThreshold:this.options.positiveSpeechThreshold,negativeSpeechThreshold:this.options.negativeSpeechThreshold,redemptionFrames:this.options.redemptionFrames,preSpeechPadFrames:this.options.preSpeechPadFrames,minSpeechFrames:this.options.minSpeechFrames,submitUserSpeechOnPause:this.options.submitUserSpeechOnPause}),this.frameProcessor.resume()},this.run=async function*(e,t){const r={nativeSampleRate:t,targetSampleRate:16e3,targetFrameSize:this.options.frameSamples},a=new o.Resampler(r);let i=0,s=0,l=0;for await(const o of a.stream(e)){const{msg:e,audio:t}=await this.frameProcessor.process(o);switch(e){case n.Message.SpeechStart:i=l*this.options.frameSamples/16;break;case n.Message.SpeechEnd:s=(l+1)*this.options.frameSamples/16,yield{audio:t,start:i,end:s}}l++}const{msg:u,audio:c}=this.frameProcessor.endSegment();u==n.Message.SpeechEnd&&(yield{audio:c,start:i,end:l*this.options.frameSamples/16})},(0,t.validateOptions)(i)}}}(nonRealTimeVad);var utils={};function minFramesForTargetMS(e,t,n=16e3){return Math.ceil(e*n/1e3/t)}function arrayBufferToBase64(e){const t=new Uint8Array(e),n=t.byteLength,r=new Array(n);for(var o=0;o<n;o++){const e=t[o];if(void 0===e)break;r[o]=String.fromCharCode(e)}return btoa(r.join(""))}function encodeWAV(e,t=3,n=16e3,r=1,o=32){var a=o/8,i=r*a,s=new ArrayBuffer(44+e.length*a),l=new DataView(s);return writeString(l,0,"RIFF"),l.setUint32(4,36+e.length*a,!0),writeString(l,8,"WAVE"),writeString(l,12,"fmt "),l.setUint32(16,16,!0),l.setUint16(20,t,!0),l.setUint16(22,r,!0),l.setUint32(24,n,!0),l.setUint32(28,n*i,!0),l.setUint16(32,i,!0),l.setUint16(34,o,!0),writeString(l,36,"data"),l.setUint32(40,e.length*a,!0),1===t?floatTo16BitPCM(l,44,e):writeFloat32(l,44,e),s}function writeFloat32(e,t,n){for(var r=0;r<n.length;r++,t+=4)e.setFloat32(t,n[r],!0)}function floatTo16BitPCM(e,t,n){for(var r=0;r<n.length;r++,t+=2){var o=Math.max(-1,Math.min(1,n[r]));e.setInt16(t,o<0?32768*o:32767*o,!0)}}function writeString(e,t,n){for(var r=0;r<n.length;r++)e.setUint8(t+r,n.charCodeAt(r))}async function audioFileToArray(e){const t=new OfflineAudioContext(1,1,44100),n=new FileReader;let r=null;if(await new Promise(o=>{n.addEventListener("loadend",e=>{const a=n.result;t.decodeAudioData(a,e=>{r=e,t.startRendering().then(e=>{console.log("Rendering completed successfully"),o()}).catch(e=>{console.error(`Rendering failed: ${e}`)})},e=>{console.log(`Error with decoding audio data: ${e}`)})}),n.readAsArrayBuffer(e)}),null===r)throw Error("some shit");let o=r,a=new Float32Array(o.length);for(let i=0;i<o.length;i++)for(let e=0;e<o.numberOfChannels;e++)a[i]+=o.getChannelData(e)[i];return{audio:a,sampleRate:o.sampleRate}}Object.defineProperty(utils,"__esModule",{value:!0}),utils.audioFileToArray=utils.encodeWAV=utils.arrayBufferToBase64=utils.minFramesForTargetMS=void 0,utils.minFramesForTargetMS=minFramesForTargetMS,utils.arrayBufferToBase64=arrayBufferToBase64,utils.encodeWAV=encodeWAV,utils.audioFileToArray=audioFileToArray;var realTimeVad={};!function(e){var t=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=commonjsGlobal&&commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&t(r,e,o);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.AudioNodeVAD=e.MicVAD=e.getDefaultRealTimeVADOptions=e.ort=e.DEFAULT_MODEL=void 0;const o=r(ortWeb_minExports),a=defaultModelFetcher$1,i=frameProcessor,s=logging,l=messages,u=models,c=resampler;e.DEFAULT_MODEL="legacy",e.ort=o;e.getDefaultRealTimeVADOptions=t=>({..."v5"===t?i.defaultV5FrameProcessorOptions:i.defaultLegacyFrameProcessorOptions,onFrameProcessed:e=>{},onVADMisfire:()=>{s.log.debug("VAD misfire")},onSpeechStart:()=>{s.log.debug("Detected speech start")},onSpeechEnd:()=>{s.log.debug("Detected speech end")},baseAssetPath:"https://cdn.jsdelivr.net/npm/@ricky0123/vad-web@0.0.22/dist/",onnxWASMBasePath:"https://cdn.jsdelivr.net/npm/onnxruntime-web@1.14.0/dist/",stream:void 0,ortConfig:void 0,model:e.DEFAULT_MODEL,workletOptions:{}});class d{static async new(t={}){const n={...(0,e.getDefaultRealTimeVADOptions)(t.model??e.DEFAULT_MODEL),...t};let r;(0,i.validateOptions)(n),r=void 0===n.stream?await navigator.mediaDevices.getUserMedia({audio:{...n.additionalAudioConstraints,channelCount:1,echoCancellation:!0,autoGainControl:!0,noiseSuppression:!0}}):n.stream;const o=new AudioContext,a=new MediaStreamAudioSourceNode(o,{mediaStream:r}),s=await f.new(o,n);return s.receive(a),new d(n,o,r,s,a)}constructor(e,t,n,r,o,a=!1){this.options=e,this.audioContext=t,this.stream=n,this.audioNodeVAD=r,this.sourceNode=o,this.listening=a,this.pause=()=>{this.audioNodeVAD.pause(),this.listening=!1},this.start=()=>{this.audioNodeVAD.start(),this.listening=!0},this.destroy=()=>{this.listening&&this.pause(),void 0===this.options.stream&&this.stream.getTracks().forEach(e=>e.stop()),this.sourceNode.disconnect(),this.audioNodeVAD.destroy(),this.audioContext.close()}}}e.MicVAD=d;class f{static async new(t,n={}){const r={...(0,e.getDefaultRealTimeVADOptions)(n.model??e.DEFAULT_MODEL),...n};(0,i.validateOptions)(r),e.ort.env.wasm.wasmPaths=r.onnxWASMBasePath,void 0!==r.ortConfig&&r.ortConfig(e.ort);const o="v5"===r.model?"silero_vad_v5.onnx":"silero_vad_legacy.onnx",s=r.baseAssetPath+o,l="v5"===r.model?u.SileroV5.new:u.SileroLegacy.new;let c;try{c=await l(e.ort,()=>(0,a.defaultModelFetcher)(s))}catch(h){throw console.error(`Encountered an error while loading model file ${s}`),h}const d=new i.FrameProcessor(c.process,c.reset_state,{frameSamples:r.frameSamples,positiveSpeechThreshold:r.positiveSpeechThreshold,negativeSpeechThreshold:r.negativeSpeechThreshold,redemptionFrames:r.redemptionFrames,preSpeechPadFrames:r.preSpeechPadFrames,minSpeechFrames:r.minSpeechFrames,submitUserSpeechOnPause:r.submitUserSpeechOnPause}),p=new f(t,r,d);return await p.setupAudioNode(),p}constructor(e,t,n){this.ctx=e,this.options=t,this.bufferIndex=0,this.pause=()=>{const e=this.frameProcessor.pause();this.handleFrameProcessorEvent(e)},this.start=()=>{this.frameProcessor.resume()},this.receive=e=>{e.connect(this.audioNode)},this.processFrame=async e=>{const t=await this.frameProcessor.process(e);this.handleFrameProcessorEvent(t)},this.handleFrameProcessorEvent=e=>{switch(void 0!==e.probs&&this.options.onFrameProcessed(e.probs,e.frame),e.msg){case l.Message.SpeechStart:this.options.onSpeechStart();break;case l.Message.VADMisfire:this.options.onVADMisfire();break;case l.Message.SpeechEnd:this.options.onSpeechEnd(e.audio)}},this.destroy=()=>{var e;this.audioNode instanceof AudioWorkletNode&&this.audioNode.port.postMessage({message:l.Message.SpeechStop}),this.audioNode.disconnect(),null==(e=this.gainNode)||e.disconnect()},this.frameProcessor=n}async setupAudioNode(){if("audioWorklet"in this.ctx&&"function"==typeof AudioWorkletNode)try{const e=this.options.baseAssetPath+"vad.worklet.bundle.min.js";await this.ctx.audioWorklet.addModule(e);const t=this.options.workletOptions??{};return t.processorOptions={...t.processorOptions??{},frameSamples:this.options.frameSamples},this.audioNode=new AudioWorkletNode(this.ctx,"vad-helper-worklet",t),void(this.audioNode.port.onmessage=async e=>{var t;if((null==(t=e.data)?void 0:t.message)===l.Message.AudioFrame){let t=e.data.data;t instanceof ArrayBuffer||(t=new ArrayBuffer(e.data.data.byteLength),new Uint8Array(t).set(new Uint8Array(e.data.data)));const n=new Float32Array(t);await this.processFrame(n)}})}catch(t){console.log("AudioWorklet setup failed, falling back to ScriptProcessor",t)}this.resampler=new c.Resampler({nativeSampleRate:this.ctx.sampleRate,targetSampleRate:16e3,targetFrameSize:this.options.frameSamples??480});this.audioNode=this.ctx.createScriptProcessor(4096,1,1),this.gainNode=this.ctx.createGain(),this.gainNode.gain.value=0;let e=!1;this.audioNode.onaudioprocess=async t=>{if(!e){e=!0;try{const e=t.inputBuffer.getChannelData(0);if(t.outputBuffer.getChannelData(0).fill(0),this.resampler){const t=this.resampler.process(e);for(const e of t)await this.processFrame(e)}}catch(n){console.error("Error processing audio:",n)}finally{e=!1}}},this.audioNode.connect(this.gainNode),this.gainNode.connect(this.ctx.destination)}}e.AudioNodeVAD=f}(realTimeVad),function(e){var t=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=commonjsGlobal&&commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&t(r,e,o);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.NonRealTimeVAD=e.Message=e.FrameProcessor=e.getDefaultRealTimeVADOptions=e.MicVAD=e.DEFAULT_MODEL=e.AudioNodeVAD=e.utils=e.defaultNonRealTimeVADOptions=void 0;const o=r(ortWeb_minExports),a=assetPath,i=defaultModelFetcher$1,s=frameProcessor;Object.defineProperty(e,"FrameProcessor",{enumerable:!0,get:function(){return s.FrameProcessor}});const l=messages;Object.defineProperty(e,"Message",{enumerable:!0,get:function(){return l.Message}});const u=nonRealTimeVad,c=utils;e.defaultNonRealTimeVADOptions={modelURL:a.baseAssetPath+"silero_vad_legacy.onnx",modelFetcher:i.defaultModelFetcher};class d extends u.PlatformAgnosticNonRealTimeVAD{static async new(t={}){const{modelURL:n,modelFetcher:r}={...e.defaultNonRealTimeVADOptions,...t};return await this._new(()=>r(n),o,t)}}e.NonRealTimeVAD=d,e.utils={audioFileToArray:c.audioFileToArray,minFramesForTargetMS:c.minFramesForTargetMS,arrayBufferToBase64:c.arrayBufferToBase64,encodeWAV:c.encodeWAV};var f=realTimeVad;Object.defineProperty(e,"AudioNodeVAD",{enumerable:!0,get:function(){return f.AudioNodeVAD}}),Object.defineProperty(e,"DEFAULT_MODEL",{enumerable:!0,get:function(){return f.DEFAULT_MODEL}}),Object.defineProperty(e,"MicVAD",{enumerable:!0,get:function(){return f.MicVAD}}),Object.defineProperty(e,"getDefaultRealTimeVADOptions",{enumerable:!0,get:function(){return f.getDefaultRealTimeVADOptions}})}(dist);class VadWebClient{constructor(e,t,n,r,o,a){this.micStream=null,this.is_vad_loading=!0,this.noSpeechStartTime=null,this.recording_started=!1,this.lastWarningTime=null,this.warningCooldownPeriod=2e3,this.vad_past=[],this.last_clip_index=0,this.clip_points=[0],this.sil_duration_acc=0,this.pref_length_samples=e*r,this.desp_length_samples=t*r,this.max_length_samples=n*r,this.shor_thsld=SHORT_SILENCE_THRESHOLD*r,this.long_thsld=LONG_SILENCE_THRESHOLD*r,this.frame_size=FRAME_SIZE,this.speech_pad_frames=PRE_SPEECH_PAD_FRAMES,this.micVad={},this.audioFileManager=o,this.audioBufferManager=a}setDependencies(e,t){this.audioFileManager=e,this.audioBufferManager=t}setCallbacks(e,t,n){this.onVadFramesCallback=e,this.onVadFrameProcessedCallback=t,this.onUserSpeechCallback=n}stopMicStream(){var e,t;try{null==(t=null==(e=this.micStream)?void 0:e.getTracks)||t.call(e).forEach(e=>e.stop())}catch{}finally{this.micStream=null}}checkNoSpeech(e){if(!this.recording_started)return;const t=Date.now();if(0===e)if(null===this.noSpeechStartTime)this.noSpeechStartTime=t;else{t-this.noSpeechStartTime>=1e4&&(null===this.lastWarningTime||t-this.lastWarningTime>=this.warningCooldownPeriod)&&(this.onVadFramesCallback&&this.onVadFramesCallback({message:"No audio detected for a while. Please talk or stop the recording if done.",error_code:ErrorCode.AUDIO_QUALITY_POOR,status_code:HttpStatus.BAD_REQUEST}),this.lastWarningTime=t,this.noSpeechStartTime=t)}else this.noSpeechStartTime=null,this.lastWarningTime=null,this.onVadFramesCallback&&this.onVadFramesCallback({message:"Audio captured. Recording continues.",status_code:HttpStatus.OK})}getMicVad(){return this.micVad}isVadLoading(){return this.is_vad_loading}processVadFrame(e){let t=!1;this.vad_past.length>0&&(0===e&&(this.sil_duration_acc+=1),1===e&&(this.sil_duration_acc=0));const n=(this.vad_past.length-this.last_clip_index)*this.frame_size,r=this.sil_duration_acc*this.frame_size;return n>this.pref_length_samples&&r>this.long_thsld&&(this.last_clip_index=this.vad_past.length-Math.min(Math.floor(this.sil_duration_acc/2),5),this.clip_points.push(this.last_clip_index),this.sil_duration_acc=0,t=!0),n>this.desp_length_samples&&r>this.shor_thsld&&(this.last_clip_index=this.vad_past.length-Math.min(Math.floor(this.sil_duration_acc/2),5),this.clip_points.push(this.last_clip_index),this.sil_duration_acc=0,t=!0),n>=this.max_length_samples&&(this.last_clip_index=this.vad_past.length,this.clip_points.push(this.last_clip_index),this.sil_duration_acc=0,t=!0),this.vad_past.push(e),t?[!0,this.clip_points[this.clip_points.length-1]]:[!1,this.clip_points[this.clip_points.length-1]]}async initVad(e){let t;this.is_vad_loading=!0,this.stopMicStream();try{t=await navigator.mediaDevices.getUserMedia({audio:!e||{deviceId:{exact:e}}})}catch(n){if("OverconstrainedError"!==(null==n?void 0:n.name)&&"NotFoundError"!==(null==n?void 0:n.name))throw n;t=await navigator.mediaDevices.getUserMedia({audio:!0})}this.micStream=t;try{const e=await dist.MicVAD.new({stream:t,frameSamples:this.frame_size,preSpeechPadFrames:this.speech_pad_frames,onFrameProcessed:(e,t)=>{var n,r,o;if(this.onVadFrameProcessedCallback&&this.onVadFrameProcessedCallback({probabilities:e,frame:t}),!this.recording_started)return;null==(n=this.audioFileManager)||n.incrementTotalRawSamples(t),null==(r=this.audioBufferManager)||r.append(t);const{isSpeech:a}=e;let i=0;a>=.5&&(i=1),this.checkNoSpeech(i);const s=this.processVadFrame(i),l=s[0];if(console.log("is clip point:",l," at index:",s[1]),l){const e=null==(o=this.audioBufferManager)?void 0:o.getAudioData();console.log("Processing audio chunk at clip point:",e),e&&this.processAudioChunk({audioFrames:e})}},onSpeechStart:()=>{var e;null==(e=this.onUserSpeechCallback)||e.call(this,!0)},onSpeechEnd:()=>{var e;null==(e=this.onUserSpeechCallback)||e.call(this,!1)}});return this.is_vad_loading=!1,this.micVad=e,!this.is_vad_loading}catch(n){throw console.error("Error initializing VAD:",n),this.stopMicStream(),this.is_vad_loading=!1,n}}async reinitializeVad(e){return await this.initVad(e)}async processAudioChunk({audioFrames:e}){if(!e||!this.audioFileManager||!this.audioBufferManager)return;const t=`audio_${this.audioFileManager.audioChunks.length||0}.${OUTPUT_FORMAT}`,n=this.audioFileManager.getRawSampleDetails(),r=this.audioBufferManager.calculateChunkTimestamps(n.totalRawSamples);try{const n={fileName:t,timestamp:{st:r.start,et:r.end},status:"pending",audioFrames:e},o=this.audioFileManager.updateAudioInfo(n);this.audioFileManager.incrementInsertedSamples(this.audioBufferManager.getCurrentSampleLength(),this.audioBufferManager.getCurrentFrameLength()),this.audioBufferManager.resetBufferState(),console.log("Uploading audio chunk:",t," at index:",o-1),await this.audioFileManager.uploadAudio({audioFrames:e,fileName:t,chunkIndex:o-1})}catch(o){console.error("Error uploading audio chunk:",o)}}startVad(){this.micVad&&"function"==typeof this.micVad.start&&this.micVad.start(),this.recording_started=!0}pauseVad(){this.micVad&&"function"==typeof this.micVad.pause&&this.micVad.pause(),this.recording_started=!1}destroyVad(){this.micVad&&"function"==typeof this.micVad.destroy&&this.micVad.destroy(),this.stopMicStream(),this.recording_started=!1}resetVadWebInstance(){this.micVad&&"function"==typeof this.micVad.destroy&&this.micVad.destroy(),this.stopMicStream(),this.vad_past=[],this.last_clip_index=0,this.clip_points=[0],this.sil_duration_acc=0,this.noSpeechStartTime=null,this.lastWarningTime=null,this.recording_started=!1,this.is_vad_loading=!0}configureVadConstants({pref_length:e,desp_length:t,max_length:n,sr:r,frame_size:o,pre_speech_pad_frames:a,short_thsld:i,long_thsld:s}){this.pref_length_samples=e*r,this.desp_length_samples=t*r,this.max_length_samples=n*r,this.shor_thsld=i*r,this.long_thsld=s*r,this.frame_size=o,this.speech_pad_frames=a}}class ChunkedRecorder{constructor(e){this._isPaused=!1,this.eventEmitter=e,this.bufferManager=new AudioBufferManager(SAMPLING_RATE,AUDIO_BUFFER_SIZE_IN_S),this.fileManager=new AudioFileManager,this.vadClient=new VadWebClient(PREF_CHUNK_LENGTH,DESP_CHUNK_LENGTH,MAX_CHUNK_LENGTH,SAMPLING_RATE,this.fileManager,this.bufferManager),this.eventEmitter&&(this.fileManager.setUploadProgressCallback((e,t)=>{}),this.vadClient.setCallbacks(e=>{},e=>{},e=>{}))}initialize(e){if(!e.upload_url)throw new Error("Upload URL is required for chunked recording");this.fileManager.setSessionInfo({sessionId:e.session_id,uploadUrl:e.upload_url})}async start(e){await this.vadClient.initVad(e);const t=this.vadClient.getMicVad();if(this.vadClient.isVadLoading()||!t||0===Object.keys(t).length){if(await this.vadClient.reinitializeVad(e))throw new Error("VAD instance is not initialized.")}this.vadClient.startVad()}pause(){this._isPaused||(this.vadClient.pauseVad(),this._isPaused=!0)}resume(){this._isPaused&&(this.vadClient.startVad(),this._isPaused=!1)}isPaused(){return this._isPaused}async stop(){this._isPaused=!1,this.vadClient.resetVadWebInstance(),await this.fileManager.waitForAllUploads();return{failedUploads:await this.fileManager.retryFailedUploads(),totalFiles:this.fileManager.getTotalAudioChunks().length}}reset(){this._isPaused=!1,this.vadClient.resetVadWebInstance(),this.fileManager.resetFileManagerInstance(),this.bufferManager.resetBufferState()}}class SingleRecorder{constructor(e){this.mediaRecorder=null,this.audioChunks=[],this.uploadUrl="",this.stream=null,this._isPaused=!1,this.eventEmitter=e}initialize(e){if(!e.upload_url)throw new Error("Upload URL is required for single recording");this.uploadUrl=e.upload_url}async start(e){let t;this.audioChunks=[];try{t=await navigator.mediaDevices.getUserMedia({audio:!e||{deviceId:{exact:e}}})}catch(n){if("OverconstrainedError"!==(null==n?void 0:n.name)&&"NotFoundError"!==(null==n?void 0:n.name))throw n;t=await navigator.mediaDevices.getUserMedia({audio:!0})}this.stream=t,this.mediaRecorder=new MediaRecorder(t),this.mediaRecorder.ondataavailable=e=>{e.data.size>0&&this.audioChunks.push(e.data)},this.mediaRecorder.start()}pause(){this.mediaRecorder&&"recording"===this.mediaRecorder.state&&(this.mediaRecorder.pause(),this._isPaused=!0)}resume(){this.mediaRecorder&&"paused"===this.mediaRecorder.state&&(this.mediaRecorder.resume(),this._isPaused=!1)}isPaused(){return this._isPaused}async stop(){return this._isPaused=!1,new Promise(e=>{this.mediaRecorder?(this.mediaRecorder.onstop=async()=>{var t;const n=new Blob(this.audioChunks,{type:"audio/webm"}),r=`recording_${Date.now()}.webm`;(await uploadFileWithFormData(this.uploadUrl,r,n)).success?e({failedUploads:[],totalFiles:1}):e({failedUploads:[r],totalFiles:1}),null==(t=this.stream)||t.getTracks().forEach(e=>e.stop()),this.stream=null,this.mediaRecorder=null},this.mediaRecorder.stop()):e({failedUploads:[],totalFiles:0})})}reset(){var e;this._isPaused=!1,this.mediaRecorder&&"inactive"!==this.mediaRecorder.state&&this.mediaRecorder.stop(),null==(e=this.stream)||e.getTracks().forEach(e=>e.stop()),this.stream=null,this.mediaRecorder=null,this.audioChunks=[]}}class EventEmitter{constructor(){this.listeners=new Map}on(e,t){var n;this.listeners.has(e)||this.listeners.set(e,new Set),null==(n=this.listeners.get(e))||n.add(t)}off(e,t){var n;null==(n=this.listeners.get(e))||n.delete(t)}emit(e){var t;null==(t=this.listeners.get(e.type))||t.forEach(t=>{try{t(e)}catch(n){console.error("Error in event listener:",n)}})}}class ScribeClient{static getInstance(e){return ScribeClient.instance||(ScribeClient.instance=new ScribeClient(e)),ScribeClient.instance}static resetInstance(){ScribeClient.instance&&(ScribeClient.instance.reset().catch(()=>{}),ScribeClient.instance=null)}constructor(e){this.discoveryDocument=null,this.currentSession=null,this.isInitialized=!1,this.recorder=null,this.validateConfig(e),this.config={debug:!1,autoDiscovery:!0,...e},this.httpClient=new HttpClient(this.config.apiKey,this.config.debug),this.discoveryAPI=new DiscoveryAPI(this.httpClient),this.sessionAPI=new SessionAPI(this.httpClient,this.config.baseUrl||""),this.eventEmitter=new EventEmitter}async init(){if(this.isInitialized)this.config.debug&&console.log("[ScribeSDK] Already initialized");else{if(!this.config.baseUrl)throw new ValidationError("baseUrl is required for initialization");if(this.config.autoDiscovery)try{this.discoveryDocument=await this.discoveryAPI.getDiscovery(this.config.baseUrl),this.discoveryDocument.endpoints.base_url&&this.sessionAPI.setBaseUrl(this.discoveryDocument.endpoints.base_url),this.emitEvent({type:"discovery:complete",data:this.discoveryDocument}),this.config.debug&&console.log("[ScribeSDK] Discovery complete:",this.discoveryDocument)}catch(e){throw this.emitEvent({type:"error",error:e instanceof Error?e:new Error("Discovery failed")}),e}else this.sessionAPI.setBaseUrl(this.config.baseUrl);this.isInitialized=!0}}async startRecording(e){this.isInitialized||await this.init();if("granted"!==(await navigator.permissions.query({name:"microphone"})).state)throw new ValidationError("Microphone access is required to start recording.");try{const t={templates:e.templates,model:e.model,language_hint:e.languageHint,transcript_language:e.transcriptLanguage,upload_type:e.uploadType||UploadType.CHUNKED,communication_protocol:e.communicationProtocol||"http",additional_data:e.additionalData};return this.currentSession=await this.sessionAPI.createSession(t),this.emitEvent({type:"session:created",data:this.currentSession}),this.config.debug&&console.log("[ScribeSDK] Session created:",this.currentSession),e.uploadType===UploadType.SINGLE?this.recorder=new SingleRecorder(this.eventEmitter):this.recorder=new ChunkedRecorder(this.eventEmitter),this.recorder.initialize(this.currentSession),await this.recorder.start(e.deviceId),this.currentSession}catch(t){throw this.emitEvent({type:"error",error:t instanceof Error?t:new Error("Failed to start recording")}),t}}pauseRecording(){if(!this.recorder)throw new ValidationError("No active recording to pause");this.recorder.pause(),this.emitEvent({type:"recording:paused"}),this.config.debug&&console.log("[ScribeSDK] Recording paused")}resumeRecording(){if(!this.recorder)throw new ValidationError("No active recording to resume");this.recorder.resume(),this.emitEvent({type:"recording:resumed"}),this.config.debug&&console.log("[ScribeSDK] Recording resumed")}isRecordingPaused(){var e;return(null==(e=this.recorder)?void 0:e.isPaused())??!1}async endRecording(){if(!this.currentSession)throw new ValidationError("No active session to end");try{let e=0;if(this.recorder){const{failedUploads:t,totalFiles:n}=await this.recorder.stop();if(t.length>0)throw console.warn("Some audio files failed to upload:",t),new ScribeError(`Failed to upload audio recordings: ${t.join(", ")}`,"upload_failed");e=n||0,this.recorder=null}const t=await this.sessionAPI.endSession(this.currentSession.session_id,e);return this.emitEvent({type:"session:ended",data:t}),this.config.debug&&console.log("[ScribeSDK] Session ended:",t),t}catch(e){throw this.emitEvent({type:"error",error:e instanceof Error?e:new Error("Failed to end recording")}),e}}async reset(){this.recorder&&(await this.recorder.stop().catch(()=>{}),this.recorder=null),this.currentSession=null,this.discoveryAPI.clearCache(),this.discoveryDocument=null,this.isInitialized=!1}emitEvent(e){this.eventEmitter.emit(e)}async getOutputStatus(e){var t;const n=e||(null==(t=this.currentSession)?void 0:t.session_id);if(!n)throw new ValidationError("No session ID provided and no active session");try{const e=await this.sessionAPI.getSessionStatus(n);return this.emitEvent({type:"session:status_update",data:e}),this.config.debug&&console.log("[ScribeSDK] Session status:",e),e}catch(r){throw this.emitEvent({type:"error",error:r instanceof Error?r:new Error("Failed to get output status")}),r}}async pollForCompletion(e,t={}){var n;const r=e||(null==(n=this.currentSession)?void 0:n.session_id);if(!r)throw new ValidationError("No session ID provided and no active session");return this.sessionAPI.pollSessionStatus(r,{...t,onProgress:e=>{this.emitEvent({type:"session:status_update",data:e}),t.onProgress&&t.onProgress(e)}})}getCurrentSession(){return this.currentSession}getDiscoveryDocument(){return this.discoveryDocument}on(e,t){this.eventEmitter.on(e,t)}off(e,t){this.eventEmitter.off(e,t)}clearSession(){this.currentSession=null}validateConfig(e){if(!e.baseUrl)throw new ValidationError("baseUrl is required for initialization")}}function useScribeSession(e){const[t,n]=reactExports.useState("idle"),[r,o]=reactExports.useState(0),[a,i]=reactExports.useState(null),[s,l]=reactExports.useState(""),u=reactExports.useRef(null),c=reactExports.useRef(null),d=reactExports.useRef(0),f=reactExports.useRef(0),p=reactExports.useCallback((...t)=>{e.debug&&console.log("[EkaScribe]",...t)},[e.debug]);reactExports.useEffect(()=>{if(!e.baseUrl)return void p("Skipping SDK init - no baseUrl provided");return(async()=>{try{u.current=new ScribeClient({apiKey:e.apiKey,baseUrl:e.baseUrl,debug:e.debug}),await u.current.init(),p("SDK initialized")}catch(t){p("Failed to initialize SDK",t)}})(),()=>{c.current&&clearInterval(c.current)}},[e.apiKey,e.baseUrl,e.debug,p]);const h=reactExports.useCallback(()=>{c.current=window.setInterval(()=>{const e=Math.floor((Date.now()-d.current)/1e3);o(e)},1e3)},[]),m=reactExports.useCallback(()=>{c.current&&(clearInterval(c.current),c.current=null)},[]),g=reactExports.useCallback(e=>{l(e),n("error")},[]);return{state:t,elapsedTime:r,result:a,errorMessage:s,startRecording:reactExports.useCallback(async()=>{const t=await(async()=>{try{return(await navigator.permissions.query({name:"microphone"})).state}catch{return"prompt"}})();if("denied"!==t){if("prompt"===t){n("permission");if(!(await(async()=>{try{return(await navigator.mediaDevices.getUserMedia({audio:!0})).getTracks().forEach(e=>e.stop()),!0}catch(e){return p("Microphone permission denied",e),!1}})()))return void g("Microphone access is required to record.")}if(u.current)try{n("recording"),await u.current.startRecording({templates:e.templates||["soap"],languageHint:e.languageHint}),d.current=Date.now(),f.current=0,o(0),h(),p("Recording started")}catch(r){p("Failed to start recording",r),g("Failed to start recording. Please try again.")}else g("SDK not initialized. Please try again.")}else g("Microphone access is blocked. Please enable it in your browser settings.")},[e.templates,e.languageHint,p,g,h]),pauseRecording:reactExports.useCallback(()=>{u.current&&(u.current.pauseRecording(),n("paused"),f.current=Date.now(),m(),p("Recording paused"))},[p,m]),resumeRecording:reactExports.useCallback(()=>{u.current&&(u.current.resumeRecording(),n("recording"),f.current&&(d.current+=Date.now()-f.current,f.current=0),h(),p("Recording resumed"))},[p,h]),stopRecording:reactExports.useCallback(async()=>{if(u.current)try{m(),n("processing"),p("Stopping recording...");const t=await u.current.endRecording();p("Recording ended",t),p("Polling for completion...");const r=await u.current.pollForCompletion(void 0,{maxAttempts:60,intervalMs:2e3,onProgress:e=>{p("Status update:",e.status)}});i(r),p("Final result:",r),n("results"),e.onResult&&e.onResult(r)}catch(t){p("Failed to stop recording",t),g("Failed to process recording. Please try again."),e.onError&&t instanceof Error&&e.onError(t)}},[e,p,g,m]),reset:reactExports.useCallback(()=>{i(null),l(""),o(0),n("idle")},[])}}function App({config:e,onClose:t}){const[n,r]=reactExports.useState(!1),[o,a]=reactExports.useState(e.baseUrl?{apiKey:e.apiKey,baseUrl:e.baseUrl}:null),i=reactExports.useMemo(()=>o?{...e,apiKey:o.apiKey,baseUrl:o.baseUrl}:e,[e,o]),s=!o,{state:l,elapsedTime:u,result:c,errorMessage:d,startRecording:f,pauseRecording:p,resumeRecording:h,stopRecording:m,reset:g}=useScribeSession(i);if(n)return null;const b=(e,t)=>{a({apiKey:e,baseUrl:t})};return jsxRuntimeExports.jsx(FloatingPanel,{position:i.position,onClose:t,onMinimize:()=>r(!0),children:(()=>{if(s)return jsxRuntimeExports.jsx(ConfigState,{onSubmit:b,initialApiKey:e.apiKey||"",initialBaseUrl:e.baseUrl||""});switch(l){case"idle":default:return jsxRuntimeExports.jsx(IdleState,{onStartRecording:f});case"permission":return jsxRuntimeExports.jsx(PermissionState,{onRequestPermission:f});case"recording":case"paused":return jsxRuntimeExports.jsx(RecordingState,{elapsedTime:u,isPaused:"paused"===l,onPause:p,onResume:h,onStop:m});case"processing":return jsxRuntimeExports.jsx(ProcessingState,{});case"results":return c?jsxRuntimeExports.jsx(ResultsState,{result:c,onNewRecording:g}):null;case"error":return jsxRuntimeExports.jsx(ErrorState,{message:d,onRetry:g})}})()})}ScribeClient.instance=null;const widgetStyles=":host{all:initial;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,sans-serif}*{box-sizing:border-box;margin:0;padding:0}.scribe-panel{position:fixed;bottom:20px;right:20px;background:#fff;border-radius:16px;box-shadow:0 4px 24px #0000001f,0 0 0 1px #0000000d;z-index:2147483647;overflow:hidden;min-width:320px}.panel-header{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background:#fafafa;border-bottom:1px solid #eee;cursor:grab}.panel-header:active{cursor:grabbing}.drag-handle{display:flex;gap:2px;flex-wrap:wrap;width:16px;opacity:.4}.drag-handle span{width:4px;height:4px;background:#666;border-radius:50%}.header-actions{display:flex;gap:8px}.header-btn{background:none;border:none;cursor:pointer;padding:4px;color:#666;display:flex;align-items:center;justify-content:center;width:24px;height:24px}.header-btn:hover{color:#333}.header-btn svg{width:16px;height:16px}.panel-content{padding:20px 24px}.idle-state{display:flex;align-items:center;gap:24px}.logo{display:flex;align-items:center;gap:8px}.logo-icon{width:32px;height:32px}.logo-icon svg{width:100%;height:100%}.logo-text{font-size:20px;font-weight:600;color:#2563eb}.start-btn{display:flex;align-items:center;gap:8px;background:#2563eb;color:#fff;border:none;padding:12px 24px;border-radius:24px;font-size:16px;font-weight:500;cursor:pointer;transition:background .2s}.start-btn:hover{background:#1d4ed8}.start-btn:disabled{background:#93c5fd;cursor:not-allowed}.mic-icon{width:20px;height:20px}.mic-icon svg{width:100%;height:100%}.recording-state{display:flex;align-items:center;gap:16px}.recording-indicator{display:flex;align-items:center;gap:12px;color:#666}.recording-icon{width:24px;height:24px;color:#666}.recording-icon svg{width:100%;height:100%}.recording-icon.active{color:#ef4444;animation:pulse 1.5s infinite}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.timer{font-size:20px;font-weight:500;font-variant-numeric:tabular-nums;color:#374151}.recording-actions{display:flex;gap:8px;margin-left:auto}.resume-btn{background:#fff;color:#2563eb;border:2px solid #2563eb;padding:10px 20px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s}.resume-btn:hover{background:#eff6ff}.pause-btn{background:#fff;color:#f59e0b;border:2px solid #f59e0b;padding:10px 20px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s}.pause-btn:hover{background:#fffbeb}.stop-btn{background:#ef4444;color:#fff;border:none;padding:10px 16px;border-radius:8px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .2s}.stop-btn:hover{background:#dc2626}.stop-icon{width:16px;height:16px;background:#fff;border-radius:2px}.processing-state{display:flex;flex-direction:column;align-items:center;gap:16px;padding:20px}.spinner{width:40px;height:40px;border:3px solid #e5e7eb;border-top-color:#2563eb;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.processing-text{color:#6b7280;font-size:14px}.results-state{display:flex;flex-direction:column;gap:16px;max-height:400px}.results-header{display:flex;align-items:center;justify-content:space-between}.results-title{font-size:16px;font-weight:600;color:#111827}.new-recording-btn{background:#2563eb;color:#fff;border:none;padding:8px 16px;border-radius:6px;font-size:13px;cursor:pointer;transition:background .2s}.new-recording-btn:hover{background:#1d4ed8}.results-content{overflow-y:auto;max-height:300px}.transcript-section{margin-bottom:16px}.section-title{font-size:13px;font-weight:600;color:#6b7280;text-transform:uppercase;letter-spacing:.05em;margin-bottom:8px}.transcript-text{font-size:14px;line-height:1.6;color:#374151;background:#f9fafb;padding:12px;border-radius:8px;white-space:pre-wrap}.error-state{display:flex;flex-direction:column;align-items:center;gap:12px;padding:20px;text-align:center}.error-icon{width:48px;height:48px;color:#ef4444}.error-icon svg{width:100%;height:100%}.error-message{color:#ef4444;font-size:14px}.retry-btn{background:#ef4444;color:#fff;border:none;padding:10px 20px;border-radius:8px;font-size:14px;cursor:pointer;transition:background .2s}.retry-btn:hover{background:#dc2626}.permission-state{display:flex;flex-direction:column;align-items:center;gap:16px;padding:20px;text-align:center}.permission-icon{width:48px;height:48px;color:#2563eb}.permission-icon svg{width:100%;height:100%}.permission-text{color:#374151;font-size:14px;line-height:1.5}.permission-btn{background:#2563eb;color:#fff;border:none;padding:12px 24px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;transition:background .2s}.permission-btn:hover{background:#1d4ed8}.config-state{display:flex;flex-direction:column;gap:20px}.config-state .logo{justify-content:center}.config-form{display:flex;flex-direction:column;gap:12px}.config-form .form-group{display:flex;flex-direction:column;gap:4px}.config-form label{font-size:13px;font-weight:500;color:#374151}.config-form input{padding:10px 12px;border:1px solid #d1d5db;border-radius:8px;font-size:14px;color:#111827;background:#fff;transition:border-color .2s,box-shadow .2s}.config-form input:focus{outline:none;border-color:#2563eb;box-shadow:0 0 0 3px #2563eb1a}.config-form input::placeholder{color:#9ca3af}.config-error{color:#ef4444;font-size:13px;margin:0}.config-submit-btn{background:#2563eb;color:#fff;border:none;padding:12px 24px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;transition:background .2s;margin-top:4px}.config-submit-btn:hover{background:#1d4ed8}";class ScribeWidget{constructor(e){__publicField(this,"container"),__publicField(this,"shadowRoot"),__publicField(this,"root",null),__publicField(this,"config"),__publicField(this,"visible",!0),this.config={templates:["soap"],languageHint:["en"],position:{bottom:20,right:20},...e},this.container=document.createElement("div"),this.container.id="eka-scribe-widget",this.shadowRoot=this.container.attachShadow({mode:"closed"});const t=document.createElement("style");t.textContent=widgetStyles,this.shadowRoot.appendChild(t);const n=document.createElement("div");n.id="eka-scribe-root",this.shadowRoot.appendChild(n),this.root=createRoot(n)}render(){this.root&&this.visible&&this.root.render(jsxRuntimeExports.jsx(App,{config:this.config,onClose:()=>this.hide()}))}mount(e){const t="string"==typeof e?document.querySelector(e):e||document.body;t&&(t.appendChild(this.container),this.render())}unmount(){this.root&&(this.root.unmount(),this.root=null),this.container.remove()}show(){this.visible=!0,this.container.style.display="block",this.render()}hide(){this.visible=!1,this.container.style.display="none"}isVisible(){return this.visible}}let widgetInstance=null;function initEkaScribe(e){return widgetInstance&&widgetInstance.unmount(),widgetInstance=new ScribeWidget(e),widgetInstance.mount(),widgetInstance}function getEkaScribe(){return widgetInstance}"undefined"!=typeof window&&(window.EkaScribe={init:initEkaScribe,getInstance:getEkaScribe,Widget:ScribeWidget});const index={init:initEkaScribe,getInstance:getEkaScribe,Widget:ScribeWidget};exports.ScribeWidget=ScribeWidget,exports.default=index,exports.getInstance=getEkaScribe,exports.init=initEkaScribe,Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|